@saasquatch/mint-components 2.1.8-0 → 2.1.8-1
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-1d15cdf7.js → ShadowViewAddon-5ce32291.js} +89 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +2 -16
- package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +329 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +158 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +143 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +90 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +462 -0
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +180 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +2 -16
- package/dist/esm/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +89 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +2 -16
- package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +333 -6
- package/dist/esm/sqm-stencilbook.entry.js +158 -1
- package/dist/esm-es5/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.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-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -0
- 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-0f036907.system.js +1 -0
- package/dist/mint-components/{p-0e6c90b1.entry.js → p-22e39d2c.entry.js} +90 -21
- package/dist/mint-components/p-499885aa.entry.js +9 -0
- package/dist/mint-components/p-a6621899.system.entry.js +1 -0
- package/dist/mint-components/{p-e980472a.js → p-adc4e263.js} +25 -25
- package/dist/mint-components/{p-7d16ee0e.entry.js → p-b0253f4c.entry.js} +2 -2
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/p-d93e19e9.system.entry.js +1 -0
- package/dist/mint-components/p-e45a9966.system.entry.js +1 -0
- package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +13 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +41 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +80 -0
- package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +16 -0
- package/dist/types/components.d.ts +138 -0
- 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/esm-es5/sqm-big-stat_45.entry.js +0 -1
- package/dist/mint-components/p-17b32de7.system.entry.js +0 -1
- package/dist/mint-components/p-54ea8b9b.system.entry.js +0 -1
- package/dist/mint-components/p-807ed3bf.system.js +0 -1
- package/dist/mint-components/p-de7bb373.entry.js +0 -9
- package/dist/mint-components/p-e9258d20.system.entry.js +0 -1
|
@@ -27,7 +27,7 @@ const useInstantAccessRegistration = require('./useInstantAccessRegistration-239
|
|
|
27
27
|
const useLeadFormState = require('./useLeadFormState-b4c2ab5b.js');
|
|
28
28
|
const utilities = require('./utilities-fcdb9504.js');
|
|
29
29
|
const ErrorView = require('./ErrorView-ee7b0f36.js');
|
|
30
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
30
|
+
const ShadowViewAddon = require('./ShadowViewAddon-5ce32291.js');
|
|
31
31
|
require('./sqm-portal-container-view-70a47420.js');
|
|
32
32
|
const data = require('./data-8c8a08f6.js');
|
|
33
33
|
const extractProps = require('./extractProps-e9c55ba8.js');
|
|
@@ -2837,6 +2837,333 @@ function useNavigationMenuDemo(props) {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
NavigationMenu.style = sqmNavigationMenuCss;
|
|
2839
2839
|
|
|
2840
|
+
const GET_USER_PARTNER_INFO = index_module.dist.gql `
|
|
2841
|
+
query getUserPartnerInfo {
|
|
2842
|
+
user: viewer {
|
|
2843
|
+
... on User {
|
|
2844
|
+
id
|
|
2845
|
+
firstName
|
|
2846
|
+
lastName
|
|
2847
|
+
email
|
|
2848
|
+
countryCode
|
|
2849
|
+
customFields
|
|
2850
|
+
impactConnection {
|
|
2851
|
+
connected
|
|
2852
|
+
publisher {
|
|
2853
|
+
countryCode
|
|
2854
|
+
currency
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
`;
|
|
2861
|
+
const GET_COUNTRIES = index_module.dist.gql `
|
|
2862
|
+
query getCountries {
|
|
2863
|
+
impactPayoutCountries(limit: 1000) {
|
|
2864
|
+
data {
|
|
2865
|
+
countryCode
|
|
2866
|
+
displayName
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
`;
|
|
2871
|
+
const GET_CURRENCIES = index_module.dist.gql `
|
|
2872
|
+
query currencies($locale: RSLocale) {
|
|
2873
|
+
currencies(limit: 300) {
|
|
2874
|
+
data {
|
|
2875
|
+
displayName(locale: $locale)
|
|
2876
|
+
currencyCode
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
`;
|
|
2881
|
+
const CONNECT_PARTNER = index_module.dist.gql `
|
|
2882
|
+
mutation createImpactConnection($vars: ImpactConnectionInput!) {
|
|
2883
|
+
createImpactConnection(impactConnectionInput: $vars) {
|
|
2884
|
+
success
|
|
2885
|
+
validationErrors {
|
|
2886
|
+
field
|
|
2887
|
+
message
|
|
2888
|
+
}
|
|
2889
|
+
user {
|
|
2890
|
+
id
|
|
2891
|
+
accountId
|
|
2892
|
+
impactConnection {
|
|
2893
|
+
connected
|
|
2894
|
+
publisher {
|
|
2895
|
+
brandedSignup
|
|
2896
|
+
requiredTaxDocumentType
|
|
2897
|
+
currentTaxDocument {
|
|
2898
|
+
type
|
|
2899
|
+
status
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
`;
|
|
2907
|
+
const GET_BRAND_NAME = index_module.dist.gql `
|
|
2908
|
+
query getTenantSettings {
|
|
2909
|
+
tenantSettings {
|
|
2910
|
+
companyName
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
`;
|
|
2914
|
+
function usePartnerInfoModal(props) {
|
|
2915
|
+
var _a, _b, _c, _d;
|
|
2916
|
+
const user = index_module.J();
|
|
2917
|
+
const locale = index_module.L();
|
|
2918
|
+
const { data: userData, loading: userLoading, refetch, } = index_module.wn(GET_USER_PARTNER_INFO, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2919
|
+
const { data: currenciesData } = index_module.wn(GET_CURRENCIES, { variables: { locale } }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2920
|
+
const { data: countriesData } = index_module.wn(GET_COUNTRIES, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2921
|
+
const { data: tenantSettingsData } = index_module.wn(GET_BRAND_NAME, {});
|
|
2922
|
+
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
2923
|
+
const [countryCode, setCountryCode] = domContextHooks_module.useState("");
|
|
2924
|
+
const [currency, setCurrency] = domContextHooks_module.useState("");
|
|
2925
|
+
const [error, setError] = domContextHooks_module.useState("");
|
|
2926
|
+
const [success, setSuccess] = domContextHooks_module.useState(false);
|
|
2927
|
+
console.log(user, "user identity in create partner modal"); // TEMP
|
|
2928
|
+
console.log(userData, "user data from partner info query"); // TEMP
|
|
2929
|
+
const impactConnection = (_a = userData === null || userData === void 0 ? void 0 : userData.user) === null || _a === void 0 ? void 0 : _a.impactConnection;
|
|
2930
|
+
function onCountryChange(e) {
|
|
2931
|
+
var _a, _b;
|
|
2932
|
+
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
2933
|
+
if (!value)
|
|
2934
|
+
return;
|
|
2935
|
+
setCountryCode(value);
|
|
2936
|
+
setCurrency("");
|
|
2937
|
+
setError("");
|
|
2938
|
+
}
|
|
2939
|
+
function onCurrencyChange(e) {
|
|
2940
|
+
var _a, _b;
|
|
2941
|
+
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
2942
|
+
if (!value)
|
|
2943
|
+
return;
|
|
2944
|
+
setCurrency(value);
|
|
2945
|
+
setError("");
|
|
2946
|
+
}
|
|
2947
|
+
async function onSubmit() {
|
|
2948
|
+
var _a, _b;
|
|
2949
|
+
if (!countryCode || !currency) {
|
|
2950
|
+
setError(props.missingFieldsErrorText);
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2953
|
+
setError("");
|
|
2954
|
+
// AL TODO: How to create impact connection if we dont have address, postalCode, and city?
|
|
2955
|
+
try {
|
|
2956
|
+
const vars = {
|
|
2957
|
+
user: {
|
|
2958
|
+
id: user.id,
|
|
2959
|
+
accountId: user.accountId,
|
|
2960
|
+
},
|
|
2961
|
+
firstName: userData.user.firstName,
|
|
2962
|
+
lastName: userData.user.lastName,
|
|
2963
|
+
countryCode,
|
|
2964
|
+
currency,
|
|
2965
|
+
};
|
|
2966
|
+
const result = await connectImpactPartner({ vars });
|
|
2967
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message)) {
|
|
2968
|
+
setError(props.networkErrorText);
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
const connectionResult = result
|
|
2972
|
+
.createImpactConnection;
|
|
2973
|
+
console.log(result, connectionResult, "result and connectionResult from creating partner from modal");
|
|
2974
|
+
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
|
|
2975
|
+
const validationMsg = (_b = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e.message).join(". ");
|
|
2976
|
+
setError(validationMsg || props.networkErrorText);
|
|
2977
|
+
console.error("Failed to create Impact connection:", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
|
|
2978
|
+
return;
|
|
2979
|
+
}
|
|
2980
|
+
// Success
|
|
2981
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2982
|
+
await refetch();
|
|
2983
|
+
setSuccess(true);
|
|
2984
|
+
}
|
|
2985
|
+
catch (e) {
|
|
2986
|
+
console.error("Partner creation error:", e);
|
|
2987
|
+
setError(props.networkErrorText);
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
const shouldShow = !success && !userLoading && !(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected);
|
|
2991
|
+
return {
|
|
2992
|
+
states: {
|
|
2993
|
+
open: shouldShow,
|
|
2994
|
+
loading: userLoading,
|
|
2995
|
+
submitting: connectLoading,
|
|
2996
|
+
isExistingPartner: !!(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected),
|
|
2997
|
+
countryCode,
|
|
2998
|
+
currency,
|
|
2999
|
+
error,
|
|
3000
|
+
success,
|
|
3001
|
+
brandName: ((_b = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _b === void 0 ? void 0 : _b.companyName) || "",
|
|
3002
|
+
filteredCountries: ((_c = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _c === void 0 ? void 0 : _c.data) || [],
|
|
3003
|
+
filteredCurrencies: ((_d = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _d === void 0 ? void 0 : _d.data) || [],
|
|
3004
|
+
},
|
|
3005
|
+
callbacks: {
|
|
3006
|
+
onCountryChange,
|
|
3007
|
+
onCurrencyChange,
|
|
3008
|
+
onCountrySearch: () => { },
|
|
3009
|
+
onCurrencySearch: () => { },
|
|
3010
|
+
onSubmit,
|
|
3011
|
+
onClose: () => setSuccess(true),
|
|
3012
|
+
},
|
|
3013
|
+
text: props.getTextProps(),
|
|
3014
|
+
};
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
const PartnerInfoModal = class {
|
|
3018
|
+
constructor(hostRef) {
|
|
3019
|
+
index.registerInstance(this, hostRef);
|
|
3020
|
+
/**
|
|
3021
|
+
* Brand name shown in the modal header
|
|
3022
|
+
*
|
|
3023
|
+
* @uiName Brand name
|
|
3024
|
+
*/
|
|
3025
|
+
this.brandName = "";
|
|
3026
|
+
/**
|
|
3027
|
+
* Header text when user has no existing partner
|
|
3028
|
+
*
|
|
3029
|
+
* @uiName New partner header
|
|
3030
|
+
* @uiWidget textArea
|
|
3031
|
+
*/
|
|
3032
|
+
this.modalBrandHeader = "Welcome to {brandName} Program!";
|
|
3033
|
+
/**
|
|
3034
|
+
* Description for new partner setup
|
|
3035
|
+
*
|
|
3036
|
+
* @uiName New partner description
|
|
3037
|
+
* @uiWidget textArea
|
|
3038
|
+
*/
|
|
3039
|
+
this.descriptionNewPartner = "We just need a bit more information about you before you start earning cash!";
|
|
3040
|
+
/**
|
|
3041
|
+
* Description for existing partner confirmation
|
|
3042
|
+
*
|
|
3043
|
+
* @uiName Existing partner description
|
|
3044
|
+
* @uiWidget textArea
|
|
3045
|
+
*/
|
|
3046
|
+
this.descriptionExistingPartner = "We noticed you are already an Impact.com partner, please confirm your information.";
|
|
3047
|
+
/**
|
|
3048
|
+
* @uiName Country label
|
|
3049
|
+
*/
|
|
3050
|
+
this.countryLabel = "Country";
|
|
3051
|
+
/**
|
|
3052
|
+
* @uiName Currency label
|
|
3053
|
+
*/
|
|
3054
|
+
this.currencyLabel = "Currency";
|
|
3055
|
+
/**
|
|
3056
|
+
* @uiName Submit button label
|
|
3057
|
+
*/
|
|
3058
|
+
this.submitButtonLabel = "Submit";
|
|
3059
|
+
/**
|
|
3060
|
+
* @uiName Confirm button label
|
|
3061
|
+
*/
|
|
3062
|
+
this.confirmButtonLabel = "Confirm";
|
|
3063
|
+
/**
|
|
3064
|
+
* @uiName Search country placeholder
|
|
3065
|
+
*/
|
|
3066
|
+
this.searchCountryPlaceholder = "Search for a country";
|
|
3067
|
+
/**
|
|
3068
|
+
* @uiName Search currency placeholder
|
|
3069
|
+
*/
|
|
3070
|
+
this.searchCurrencyPlaceholder = "Search for a currency";
|
|
3071
|
+
/**
|
|
3072
|
+
* @uiName Network error text
|
|
3073
|
+
* @uiWidget textArea
|
|
3074
|
+
*/
|
|
3075
|
+
this.networkErrorText = "An error occurred. Please try again.";
|
|
3076
|
+
/**
|
|
3077
|
+
* @uiName Missing fields error text
|
|
3078
|
+
* @uiWidget textArea
|
|
3079
|
+
*/
|
|
3080
|
+
this.missingFieldsErrorText = "Please select both a country and currency.";
|
|
3081
|
+
domContextHooks_module.h$1(this);
|
|
3082
|
+
}
|
|
3083
|
+
disconnectedCallback() { }
|
|
3084
|
+
getTextProps() {
|
|
3085
|
+
return utils.getProps(this);
|
|
3086
|
+
}
|
|
3087
|
+
render() {
|
|
3088
|
+
// AL: TODO add usePartnerInfoModal
|
|
3089
|
+
const props = index_module.isDemo()
|
|
3090
|
+
? useDemoPartnerInfoModal(this)
|
|
3091
|
+
: usePartnerInfoModal(this);
|
|
3092
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
3093
|
+
}
|
|
3094
|
+
};
|
|
3095
|
+
function useDemoPartnerInfoModal(props) {
|
|
3096
|
+
const [countryCode, setCountryCode] = domContextHooks_module.useState("US");
|
|
3097
|
+
const [currency, setCurrency] = domContextHooks_module.useState("");
|
|
3098
|
+
const [error, setError] = domContextHooks_module.useState("");
|
|
3099
|
+
const demoCountries = [
|
|
3100
|
+
{ countryCode: "US", displayName: "United States" },
|
|
3101
|
+
{ countryCode: "CA", displayName: "Canada" },
|
|
3102
|
+
{ countryCode: "GB", displayName: "United Kingdom" },
|
|
3103
|
+
{ countryCode: "AU", displayName: "Australia" },
|
|
3104
|
+
{ countryCode: "DE", displayName: "Germany" },
|
|
3105
|
+
];
|
|
3106
|
+
const demoCurrencies = [
|
|
3107
|
+
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
3108
|
+
{ currencyCode: "CAD", displayName: "Canadian Dollar" },
|
|
3109
|
+
{ currencyCode: "GBP", displayName: "British Pound" },
|
|
3110
|
+
{ currencyCode: "EUR", displayName: "Euro" },
|
|
3111
|
+
{ currencyCode: "AUD", displayName: "Australian Dollar" },
|
|
3112
|
+
];
|
|
3113
|
+
return cjs.cjs({
|
|
3114
|
+
states: {
|
|
3115
|
+
brandName: "Test Brand",
|
|
3116
|
+
open: true,
|
|
3117
|
+
loading: false,
|
|
3118
|
+
submitting: false,
|
|
3119
|
+
isExistingPartner: false,
|
|
3120
|
+
countryCode,
|
|
3121
|
+
currency,
|
|
3122
|
+
error,
|
|
3123
|
+
success: false,
|
|
3124
|
+
filteredCountries: demoCountries,
|
|
3125
|
+
filteredCurrencies: demoCurrencies,
|
|
3126
|
+
},
|
|
3127
|
+
callbacks: {
|
|
3128
|
+
onCountryChange: (e) => {
|
|
3129
|
+
var _a, _b;
|
|
3130
|
+
const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
3131
|
+
if (value) {
|
|
3132
|
+
setCountryCode(value);
|
|
3133
|
+
setCurrency("");
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
onCurrencyChange: (e) => {
|
|
3137
|
+
var _a, _b;
|
|
3138
|
+
const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
3139
|
+
if (value)
|
|
3140
|
+
setCurrency(value);
|
|
3141
|
+
},
|
|
3142
|
+
onCountrySearch: () => { },
|
|
3143
|
+
onCurrencySearch: () => { },
|
|
3144
|
+
onSubmit: () => {
|
|
3145
|
+
if (!countryCode || !currency) {
|
|
3146
|
+
setError(props.missingFieldsErrorText);
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
setError("");
|
|
3150
|
+
},
|
|
3151
|
+
onClose: () => { },
|
|
3152
|
+
},
|
|
3153
|
+
text: {
|
|
3154
|
+
modalBrandHeader: props.modalBrandHeader,
|
|
3155
|
+
descriptionNewPartner: props.descriptionNewPartner,
|
|
3156
|
+
descriptionExistingPartner: props.descriptionExistingPartner,
|
|
3157
|
+
countryLabel: props.countryLabel,
|
|
3158
|
+
currencyLabel: props.currencyLabel,
|
|
3159
|
+
submitButtonLabel: props.submitButtonLabel,
|
|
3160
|
+
confirmButtonLabel: props.confirmButtonLabel,
|
|
3161
|
+
searchCountryPlaceholder: props.searchCountryPlaceholder,
|
|
3162
|
+
searchCurrencyPlaceholder: props.searchCurrencyPlaceholder,
|
|
3163
|
+
},
|
|
3164
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
3165
|
+
}
|
|
3166
|
+
|
|
2840
3167
|
const style$1 = {
|
|
2841
3168
|
Wrapper: {
|
|
2842
3169
|
maxWidth: "200px",
|
|
@@ -7951,6 +8278,7 @@ exports.sqm_link_button = LinkButton;
|
|
|
7951
8278
|
exports.sqm_marketing_emails_checkbox = MarketingEmailsCheckbox;
|
|
7952
8279
|
exports.sqm_name_fields = NameFields;
|
|
7953
8280
|
exports.sqm_navigation_menu = NavigationMenu;
|
|
8281
|
+
exports.sqm_partner_info_modal = PartnerInfoModal;
|
|
7954
8282
|
exports.sqm_payout_button_scroll = PayoutButtonScroll;
|
|
7955
8283
|
exports.sqm_payout_status_alert = PayoutStatusAlert;
|
|
7956
8284
|
exports.sqm_portal_change_marketing = PortalChangeMarketing;
|
|
@@ -33,7 +33,7 @@ require('./utilities-fcdb9504.js');
|
|
|
33
33
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-6b1acd90.js');
|
|
34
34
|
require('./ErrorView-ee7b0f36.js');
|
|
35
35
|
const sqmQrCodeView = require('./sqm-qr-code-view-1f2daa76.js');
|
|
36
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
36
|
+
const ShadowViewAddon = require('./ShadowViewAddon-5ce32291.js');
|
|
37
37
|
const sqmPortalContainerView = require('./sqm-portal-container-view-70a47420.js');
|
|
38
38
|
const sqmUserInfoFormView = require('./sqm-user-info-form-view-53306f6e.js');
|
|
39
39
|
const data = require('./data-8c8a08f6.js');
|
|
@@ -18700,6 +18700,162 @@ const UserInfoFormView = /*#__PURE__*/Object.freeze({
|
|
|
18700
18700
|
DisabledForm: DisabledForm
|
|
18701
18701
|
});
|
|
18702
18702
|
|
|
18703
|
+
const PartnerInfoModal_stories = {
|
|
18704
|
+
title: "Components/Partner Info Modal",
|
|
18705
|
+
};
|
|
18706
|
+
const demoCountries = [
|
|
18707
|
+
{ countryCode: "US", displayName: "United States" },
|
|
18708
|
+
{ countryCode: "CA", displayName: "Canada" },
|
|
18709
|
+
{ countryCode: "GB", displayName: "United Kingdom" },
|
|
18710
|
+
{ countryCode: "AU", displayName: "Australia" },
|
|
18711
|
+
{ countryCode: "DE", displayName: "Germany" },
|
|
18712
|
+
{ countryCode: "FR", displayName: "France" },
|
|
18713
|
+
{ countryCode: "JP", displayName: "Japan" },
|
|
18714
|
+
];
|
|
18715
|
+
const demoCurrencies = [
|
|
18716
|
+
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
18717
|
+
{ currencyCode: "CAD", displayName: "Canadian Dollar" },
|
|
18718
|
+
{ currencyCode: "GBP", displayName: "British Pound" },
|
|
18719
|
+
{ currencyCode: "EUR", displayName: "Euro" },
|
|
18720
|
+
{ currencyCode: "AUD", displayName: "Australian Dollar" },
|
|
18721
|
+
];
|
|
18722
|
+
const noopCallbacks = {
|
|
18723
|
+
onCountryChange: (e) => console.log("Country changed:", e),
|
|
18724
|
+
onCurrencyChange: (e) => console.log("Currency changed:", e),
|
|
18725
|
+
onCountrySearch: (v) => console.log("Country search:", v),
|
|
18726
|
+
onCurrencySearch: (v) => console.log("Currency search:", v),
|
|
18727
|
+
onSubmit: () => console.log("Submit"),
|
|
18728
|
+
onClose: () => console.log("Close"),
|
|
18729
|
+
};
|
|
18730
|
+
const defaultText$1 = {
|
|
18731
|
+
modalBrandHeader: "Welcome to {brandName} Program!",
|
|
18732
|
+
descriptionNewPartner: "We just need a bit more information about you before you start earning cash!",
|
|
18733
|
+
descriptionExistingPartner: "We noticed you are already an Impact.com partner, please confirm your information.",
|
|
18734
|
+
countryLabel: "Country",
|
|
18735
|
+
currencyLabel: "Currency",
|
|
18736
|
+
submitButtonLabel: "Submit",
|
|
18737
|
+
confirmButtonLabel: "Confirm",
|
|
18738
|
+
searchCountryPlaceholder: "Search for a country",
|
|
18739
|
+
searchCurrencyPlaceholder: "Search for a currency",
|
|
18740
|
+
};
|
|
18741
|
+
const defaultProps$y = {
|
|
18742
|
+
states: {
|
|
18743
|
+
open: true,
|
|
18744
|
+
loading: false,
|
|
18745
|
+
submitting: false,
|
|
18746
|
+
isExistingPartner: false,
|
|
18747
|
+
countryCode: "",
|
|
18748
|
+
currency: "",
|
|
18749
|
+
error: "",
|
|
18750
|
+
success: false,
|
|
18751
|
+
brandName: "Test Brand",
|
|
18752
|
+
filteredCountries: demoCountries,
|
|
18753
|
+
filteredCurrencies: demoCurrencies,
|
|
18754
|
+
},
|
|
18755
|
+
callbacks: noopCallbacks,
|
|
18756
|
+
text: defaultText$1,
|
|
18757
|
+
};
|
|
18758
|
+
const NewPartnerEmpty = () => {
|
|
18759
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, defaultProps$y));
|
|
18760
|
+
};
|
|
18761
|
+
const NewPartnerPrefilled = () => {
|
|
18762
|
+
const props = {
|
|
18763
|
+
...defaultProps$y,
|
|
18764
|
+
states: {
|
|
18765
|
+
...defaultProps$y.states,
|
|
18766
|
+
countryCode: "US",
|
|
18767
|
+
currency: "",
|
|
18768
|
+
},
|
|
18769
|
+
};
|
|
18770
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18771
|
+
};
|
|
18772
|
+
const NewPartnerFullySelected = () => {
|
|
18773
|
+
const props = {
|
|
18774
|
+
...defaultProps$y,
|
|
18775
|
+
states: {
|
|
18776
|
+
...defaultProps$y.states,
|
|
18777
|
+
countryCode: "US",
|
|
18778
|
+
currency: "USD",
|
|
18779
|
+
},
|
|
18780
|
+
};
|
|
18781
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18782
|
+
};
|
|
18783
|
+
const ExistingPartnerConfirm = () => {
|
|
18784
|
+
const props = {
|
|
18785
|
+
...defaultProps$y,
|
|
18786
|
+
states: {
|
|
18787
|
+
...defaultProps$y.states,
|
|
18788
|
+
isExistingPartner: true,
|
|
18789
|
+
countryCode: "CA",
|
|
18790
|
+
currency: "CAD",
|
|
18791
|
+
},
|
|
18792
|
+
};
|
|
18793
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18794
|
+
};
|
|
18795
|
+
const Submitting = () => {
|
|
18796
|
+
const props = {
|
|
18797
|
+
...defaultProps$y,
|
|
18798
|
+
states: {
|
|
18799
|
+
...defaultProps$y.states,
|
|
18800
|
+
countryCode: "GB",
|
|
18801
|
+
currency: "GBP",
|
|
18802
|
+
submitting: true,
|
|
18803
|
+
},
|
|
18804
|
+
};
|
|
18805
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18806
|
+
};
|
|
18807
|
+
const WithError$3 = () => {
|
|
18808
|
+
const props = {
|
|
18809
|
+
...defaultProps$y,
|
|
18810
|
+
states: {
|
|
18811
|
+
...defaultProps$y.states,
|
|
18812
|
+
countryCode: "US",
|
|
18813
|
+
currency: "USD",
|
|
18814
|
+
error: "An error occurred while creating your partner account. Please try again.",
|
|
18815
|
+
},
|
|
18816
|
+
};
|
|
18817
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18818
|
+
};
|
|
18819
|
+
const ValidationError$1 = () => {
|
|
18820
|
+
const props = {
|
|
18821
|
+
...defaultProps$y,
|
|
18822
|
+
states: {
|
|
18823
|
+
...defaultProps$y.states,
|
|
18824
|
+
countryCode: "",
|
|
18825
|
+
currency: "",
|
|
18826
|
+
error: "Please select both a country and currency.",
|
|
18827
|
+
},
|
|
18828
|
+
};
|
|
18829
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18830
|
+
};
|
|
18831
|
+
const Closed = () => {
|
|
18832
|
+
const props = {
|
|
18833
|
+
...defaultProps$y,
|
|
18834
|
+
states: {
|
|
18835
|
+
...defaultProps$y.states,
|
|
18836
|
+
open: false,
|
|
18837
|
+
},
|
|
18838
|
+
};
|
|
18839
|
+
return index.h(ShadowViewAddon.PartnerInfoModalView, Object.assign({}, props));
|
|
18840
|
+
};
|
|
18841
|
+
const FullStackDemo = () => {
|
|
18842
|
+
return (index.h("sqm-partner-info-modal", { "brand-name": "Acme", "header-new-partner": "Welcome to {brandName} Program!", "description-new-partner": "We just need a bit more information about you before you start earning cash!", "submit-button-label": "Submit" }));
|
|
18843
|
+
};
|
|
18844
|
+
|
|
18845
|
+
const PartnerInfoModal = /*#__PURE__*/Object.freeze({
|
|
18846
|
+
__proto__: null,
|
|
18847
|
+
'default': PartnerInfoModal_stories,
|
|
18848
|
+
NewPartnerEmpty: NewPartnerEmpty,
|
|
18849
|
+
NewPartnerPrefilled: NewPartnerPrefilled,
|
|
18850
|
+
NewPartnerFullySelected: NewPartnerFullySelected,
|
|
18851
|
+
ExistingPartnerConfirm: ExistingPartnerConfirm,
|
|
18852
|
+
Submitting: Submitting,
|
|
18853
|
+
WithError: WithError$3,
|
|
18854
|
+
ValidationError: ValidationError$1,
|
|
18855
|
+
Closed: Closed,
|
|
18856
|
+
FullStackDemo: FullStackDemo
|
|
18857
|
+
});
|
|
18858
|
+
|
|
18703
18859
|
function deepFreeze(obj) {
|
|
18704
18860
|
if (obj instanceof Map) {
|
|
18705
18861
|
obj.clear = obj.delete = obj.set = function () {
|
|
@@ -21393,6 +21549,7 @@ const stories = [
|
|
|
21393
21549
|
TaxAndCashRewardsTable,
|
|
21394
21550
|
TaxAndCashReferralTableRewardsCell,
|
|
21395
21551
|
TaxAndCashReferralTable$1,
|
|
21552
|
+
PartnerInfoModal,
|
|
21396
21553
|
];
|
|
21397
21554
|
const StencilStorybook = class {
|
|
21398
21555
|
constructor(hostRef) {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"./components/sqm-navigation-menu/sqm-navigation-menu.js",
|
|
55
55
|
"./components/sqm-navigation-sidebar/sqm-navigation-sidebar.js",
|
|
56
56
|
"./components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item.js",
|
|
57
|
+
"./components/sqm-partner-info-modal/sqm-partner-info-modal.js",
|
|
57
58
|
"./components/sqm-payout-button-scroll/sqm-payout-button-scroll.js",
|
|
58
59
|
"./components/sqm-popup-container/sqm-popup-container.js",
|
|
59
60
|
"./components/sqm-portal-change-marketing/sqm-portal-change-marketing.js",
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { PartnerInfoModalView, } from "./sqm-partner-info-modal-view";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Partner Info Modal",
|
|
5
|
+
};
|
|
6
|
+
const demoCountries = [
|
|
7
|
+
{ countryCode: "US", displayName: "United States" },
|
|
8
|
+
{ countryCode: "CA", displayName: "Canada" },
|
|
9
|
+
{ countryCode: "GB", displayName: "United Kingdom" },
|
|
10
|
+
{ countryCode: "AU", displayName: "Australia" },
|
|
11
|
+
{ countryCode: "DE", displayName: "Germany" },
|
|
12
|
+
{ countryCode: "FR", displayName: "France" },
|
|
13
|
+
{ countryCode: "JP", displayName: "Japan" },
|
|
14
|
+
];
|
|
15
|
+
const demoCurrencies = [
|
|
16
|
+
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
17
|
+
{ currencyCode: "CAD", displayName: "Canadian Dollar" },
|
|
18
|
+
{ currencyCode: "GBP", displayName: "British Pound" },
|
|
19
|
+
{ currencyCode: "EUR", displayName: "Euro" },
|
|
20
|
+
{ currencyCode: "AUD", displayName: "Australian Dollar" },
|
|
21
|
+
];
|
|
22
|
+
const noopCallbacks = {
|
|
23
|
+
onCountryChange: (e) => console.log("Country changed:", e),
|
|
24
|
+
onCurrencyChange: (e) => console.log("Currency changed:", e),
|
|
25
|
+
onCountrySearch: (v) => console.log("Country search:", v),
|
|
26
|
+
onCurrencySearch: (v) => console.log("Currency search:", v),
|
|
27
|
+
onSubmit: () => console.log("Submit"),
|
|
28
|
+
onClose: () => console.log("Close"),
|
|
29
|
+
};
|
|
30
|
+
const defaultText = {
|
|
31
|
+
modalBrandHeader: "Welcome to {brandName} Program!",
|
|
32
|
+
descriptionNewPartner: "We just need a bit more information about you before you start earning cash!",
|
|
33
|
+
descriptionExistingPartner: "We noticed you are already an Impact.com partner, please confirm your information.",
|
|
34
|
+
countryLabel: "Country",
|
|
35
|
+
currencyLabel: "Currency",
|
|
36
|
+
submitButtonLabel: "Submit",
|
|
37
|
+
confirmButtonLabel: "Confirm",
|
|
38
|
+
searchCountryPlaceholder: "Search for a country",
|
|
39
|
+
searchCurrencyPlaceholder: "Search for a currency",
|
|
40
|
+
};
|
|
41
|
+
const defaultProps = {
|
|
42
|
+
states: {
|
|
43
|
+
open: true,
|
|
44
|
+
loading: false,
|
|
45
|
+
submitting: false,
|
|
46
|
+
isExistingPartner: false,
|
|
47
|
+
countryCode: "",
|
|
48
|
+
currency: "",
|
|
49
|
+
error: "",
|
|
50
|
+
success: false,
|
|
51
|
+
brandName: "Test Brand",
|
|
52
|
+
filteredCountries: demoCountries,
|
|
53
|
+
filteredCurrencies: demoCurrencies,
|
|
54
|
+
},
|
|
55
|
+
callbacks: noopCallbacks,
|
|
56
|
+
text: defaultText,
|
|
57
|
+
};
|
|
58
|
+
export const NewPartnerEmpty = () => {
|
|
59
|
+
return h(PartnerInfoModalView, Object.assign({}, defaultProps));
|
|
60
|
+
};
|
|
61
|
+
export const NewPartnerPrefilled = () => {
|
|
62
|
+
const props = {
|
|
63
|
+
...defaultProps,
|
|
64
|
+
states: {
|
|
65
|
+
...defaultProps.states,
|
|
66
|
+
countryCode: "US",
|
|
67
|
+
currency: "",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
71
|
+
};
|
|
72
|
+
export const NewPartnerFullySelected = () => {
|
|
73
|
+
const props = {
|
|
74
|
+
...defaultProps,
|
|
75
|
+
states: {
|
|
76
|
+
...defaultProps.states,
|
|
77
|
+
countryCode: "US",
|
|
78
|
+
currency: "USD",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
82
|
+
};
|
|
83
|
+
export const ExistingPartnerConfirm = () => {
|
|
84
|
+
const props = {
|
|
85
|
+
...defaultProps,
|
|
86
|
+
states: {
|
|
87
|
+
...defaultProps.states,
|
|
88
|
+
isExistingPartner: true,
|
|
89
|
+
countryCode: "CA",
|
|
90
|
+
currency: "CAD",
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
94
|
+
};
|
|
95
|
+
export const Submitting = () => {
|
|
96
|
+
const props = {
|
|
97
|
+
...defaultProps,
|
|
98
|
+
states: {
|
|
99
|
+
...defaultProps.states,
|
|
100
|
+
countryCode: "GB",
|
|
101
|
+
currency: "GBP",
|
|
102
|
+
submitting: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
106
|
+
};
|
|
107
|
+
export const WithError = () => {
|
|
108
|
+
const props = {
|
|
109
|
+
...defaultProps,
|
|
110
|
+
states: {
|
|
111
|
+
...defaultProps.states,
|
|
112
|
+
countryCode: "US",
|
|
113
|
+
currency: "USD",
|
|
114
|
+
error: "An error occurred while creating your partner account. Please try again.",
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
118
|
+
};
|
|
119
|
+
export const ValidationError = () => {
|
|
120
|
+
const props = {
|
|
121
|
+
...defaultProps,
|
|
122
|
+
states: {
|
|
123
|
+
...defaultProps.states,
|
|
124
|
+
countryCode: "",
|
|
125
|
+
currency: "",
|
|
126
|
+
error: "Please select both a country and currency.",
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
130
|
+
};
|
|
131
|
+
export const Closed = () => {
|
|
132
|
+
const props = {
|
|
133
|
+
...defaultProps,
|
|
134
|
+
states: {
|
|
135
|
+
...defaultProps.states,
|
|
136
|
+
open: false,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
140
|
+
};
|
|
141
|
+
export const FullStackDemo = () => {
|
|
142
|
+
return (h("sqm-partner-info-modal", { "brand-name": "Acme", "header-new-partner": "Welcome to {brandName} Program!", "description-new-partner": "We just need a bit more information about you before you start earning cash!", "submit-button-label": "Submit" }));
|
|
143
|
+
};
|