react-gldn-kit 0.1.25 → 0.1.27
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/index.js +1 -1
- package/dist/lib/components/Layouts/ModalLayout/index.js +2 -2
- package/dist/lib/components/Layouts/ModalLayout/types.d.ts +0 -1
- package/dist/lib/components/Layouts/PortalLayout/index.js +5 -1
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/PhoneSignUp/index.js +1 -1
- package/dist/lib/components/Modals/Alert/index.js +6 -2
- package/dist/lib/components/ui/Inputs/PhoneInput/index.js +1 -5
- package/dist/lib/components/ui/Inputs/PhoneInput/types.d.ts +1 -0
- package/package.json +4 -4
|
@@ -45,8 +45,8 @@ var PortalLayout_1 = require("../PortalLayout");
|
|
|
45
45
|
var ModalContent_1 = require("./component/ModalContent");
|
|
46
46
|
var styles = __importStar(require("./ModalLayout.module.css"));
|
|
47
47
|
var ModalLayout = function (props) {
|
|
48
|
-
var children = props.children, classes = props.classes, popUpHeaderProps = props.popUpHeaderProps,
|
|
48
|
+
var children = props.children, classes = props.classes, popUpHeaderProps = props.popUpHeaderProps, modalLayoutClasses = props.modalLayoutClasses;
|
|
49
49
|
var title = popUpHeaderProps.title, closeButton = popUpHeaderProps.closeButton;
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(PortalLayout_1.PortalLayout, __assign({ classes: classes
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(PortalLayout_1.PortalLayout, __assign({ classes: classes }, { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.wrapperModalLayout, modalLayoutClasses) }, { children: [(closeButton || title) && ((0, jsx_runtime_1.jsx)(Headers_1.PopUpHeader, __assign({}, (popUpHeaderProps || { title: ' ' }), { closeButton: closeButton, classes: (0, classnames_1.default)((popUpHeaderProps === null || popUpHeaderProps === void 0 ? void 0 : popUpHeaderProps.classes) || '', styles.overflow) }))), (0, jsx_runtime_1.jsx)(ModalContent_1.ModalContent, { children: children })] })) })));
|
|
51
51
|
};
|
|
52
52
|
exports.ModalLayout = ModalLayout;
|
|
@@ -46,12 +46,16 @@ var HOCOutsideClick_1 = require("components/HOCs/HOCOutsideClick");
|
|
|
46
46
|
var styles = __importStar(require("./PortalLayout.module.css"));
|
|
47
47
|
var PortalLayout = function (props) {
|
|
48
48
|
var children = props.children, closeCallback = props.closeCallback, classes = props.classes, _a = props.elementId, elementId = _a === void 0 ? '' : _a;
|
|
49
|
+
console.log('🚀 ~ PortalLayout ~ closeCallback:', closeCallback);
|
|
49
50
|
var element = (0, react_1.useMemo)(function () { return document.getElementById(elementId) || document.body; }, [elementId]);
|
|
50
51
|
var handleClose = function (e) {
|
|
52
|
+
if (!closeCallback) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
51
55
|
e.preventDefault();
|
|
52
56
|
e.stopPropagation();
|
|
53
57
|
closeCallback === null || closeCallback === void 0 ? void 0 : closeCallback(e);
|
|
54
58
|
};
|
|
55
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(HOCOutsideClick_1.HOCOutsideClick, __assign({ classes: (0, classnames_1.default)(styles.wrapperPortalLayout, classes), handleFunc: handleClose }, { children: children })), element);
|
|
59
|
+
return (0, react_dom_1.createPortal)(closeCallback ? ((0, jsx_runtime_1.jsx)(HOCOutsideClick_1.HOCOutsideClick, __assign({ classes: (0, classnames_1.default)(styles.wrapperPortalLayout, classes), handleFunc: handleClose }, { children: children }))) : ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.wrapperPortalLayout, classes) }, { children: children }))), element);
|
|
56
60
|
};
|
|
57
61
|
exports.PortalLayout = PortalLayout;
|
|
@@ -144,6 +144,6 @@ var PhoneSignUp = function (props) {
|
|
|
144
144
|
var PHONE_PROPS = withoutCode
|
|
145
145
|
? constants_1.PHONE_PROPS_WITHOUT_CONFIRMATION
|
|
146
146
|
: constants_1.PHONE_PROPS_WITH_CONFIRMATION;
|
|
147
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PhoneInput_1.PhoneInput, __assign({}, PHONE_PROPS, { placeholder: "registrations.inputs.phone", size: "full", defaultValue: "+", onChange: setPhone, requestCallback: handleIsRequested, classesWrapper: styles.marginB, disabled: isRequestedCode, classes: styles.marginB, requestCode: !withoutCode ? requestCode : undefined })), !withoutCode && isRequestedCode && ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.code", size: "full", isHidePlaceholder: true, disabled: !isRequestedCode, onChange: handleChange('code'), classes: styles.marginB })), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CountrySelector_1.default, { countryInfo: countryInfo }), (0, jsx_runtime_1.jsx)(CurrencySelector_1.default, { availableCurrencies: availableCurrencies }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.default, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(PromoCode_1.default, { setPromoCode: setPromoCode }), (0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, { text: 'registrations.submitBtn', disabled: isDisabledSubmitButton, color: "primary", handleClick: handleSubmitForm, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: styles.marginB })] }));
|
|
147
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PhoneInput_1.PhoneInput, __assign({}, PHONE_PROPS, { placeholder: "registrations.inputs.phone", size: "full", defaultValue: "+", onChange: setPhone, countryInfo: countryInfo, requestCallback: handleIsRequested, classesWrapper: styles.marginB, disabled: isRequestedCode, classes: styles.marginB, requestCode: !withoutCode ? requestCode : undefined })), !withoutCode && isRequestedCode && ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.code", size: "full", isHidePlaceholder: true, disabled: !isRequestedCode, onChange: handleChange('code'), classes: styles.marginB })), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CountrySelector_1.default, { countryInfo: countryInfo }), (0, jsx_runtime_1.jsx)(CurrencySelector_1.default, { availableCurrencies: availableCurrencies }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.default, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(PromoCode_1.default, { setPromoCode: setPromoCode }), (0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, { text: 'registrations.submitBtn', disabled: isDisabledSubmitButton, color: "primary", handleClick: handleSubmitForm, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: styles.marginB })] }));
|
|
148
148
|
};
|
|
149
149
|
exports.PhoneSignUp = PhoneSignUp;
|
|
@@ -130,7 +130,9 @@ var Alerts = function (props) {
|
|
|
130
130
|
var getComponentFn = props.getComponentFn, controllers = props.controllers, hooks = props.hooks;
|
|
131
131
|
var _b = ((controllers === null || controllers === void 0 ? void 0 : controllers()) || {}).sendCommand, sendCommand = _b === void 0 ? console.info : _b;
|
|
132
132
|
var modalType = (0, store_1.useZustandModalKitStore)(selectors_1.zustandModalKitSelector.getModalTypeSelector);
|
|
133
|
+
console.log('🚀 ~ Alerts ~ modalType:', modalType);
|
|
133
134
|
var oldModalType = (0, store_1.useZustandModalKitStore)(selectors_1.zustandModalKitSelector.getNextEModalTypeSelector);
|
|
135
|
+
console.log('🚀 ~ Alerts ~ oldModalType:', oldModalType);
|
|
134
136
|
var closeAndOpen = (0, store_1.useZustandModalKitStore)(selectors_1.zustandModalKitSelector.closeAndOpenModalAction);
|
|
135
137
|
var additionalSettings = (0, store_1.useZustandModalKitStore)(selectors_1.zustandModalKitSelector.getModalAdditionalInfoSelector);
|
|
136
138
|
console.log('🚀 ~ Alerts ~ additionalSettings:', additionalSettings);
|
|
@@ -138,7 +140,9 @@ var Alerts = function (props) {
|
|
|
138
140
|
var isCloseModal = modalType === types_1.EModalTypes.CloseModal && prevType.current;
|
|
139
141
|
var isActiveModal = modalType !== types_1.EModalTypes.Unknown && modalType !== types_1.EModalTypes.CloseModal;
|
|
140
142
|
var handleClose = function () {
|
|
141
|
-
|
|
143
|
+
if (modalType !== types_1.EModalTypes.Unknown) {
|
|
144
|
+
closeAndOpen(types_1.EModalTypes.Unknown);
|
|
145
|
+
}
|
|
142
146
|
};
|
|
143
147
|
var getModalComponent = function () {
|
|
144
148
|
var key = modalType === types_1.EModalTypes.CloseModal ? prevType.current : modalType;
|
|
@@ -183,7 +187,7 @@ var Alerts = function (props) {
|
|
|
183
187
|
}, [modalType, oldModalType]);
|
|
184
188
|
// TODO OPTIMIZE
|
|
185
189
|
return ((0, jsx_runtime_1.jsx)(ModalLayout_1.ModalLayout, __assign({ popUpHeaderProps: __assign({ title: !(additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.bonusSignUp) &&
|
|
186
|
-
((additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.title) || (0, shared_1.getModalTitle)(modalType)), closeButton: (additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.preventClose) ? undefined : handleClose }, ((additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.popUpHeaderProps) || {})),
|
|
190
|
+
((additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.title) || (0, shared_1.getModalTitle)(modalType)), closeButton: (additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.preventClose) ? undefined : handleClose }, ((additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.popUpHeaderProps) || {})), classes: (0, classnames_1.default)(styles.wrapperModal, (_a = {},
|
|
187
191
|
// [styles.modalOpenMobileAnimation]: isActiveModal && isMobile,
|
|
188
192
|
// [styles.modalCloseMobileAnimation]: isCloseModal && isMobile,
|
|
189
193
|
// pass styles
|
|
@@ -46,18 +46,14 @@ var validation_1 = require("service/validation");
|
|
|
46
46
|
var Text_1 = require("components/Text");
|
|
47
47
|
var BaseButton_1 = require("components/ui/Buttons/BaseButton");
|
|
48
48
|
var Timer_1 = __importDefault(require("components/ui/Timer"));
|
|
49
|
-
var useTranslate_1 = require("hooks/useTranslate");
|
|
50
49
|
var constant_1 = require("../BaseInput/constant");
|
|
51
50
|
var styles = __importStar(require("./PhoneInput.module.css"));
|
|
52
51
|
var mock_1 = require("constants/mock");
|
|
53
52
|
var PhoneInput = function (props) {
|
|
54
53
|
var _a;
|
|
55
|
-
var withConfirm = props.withConfirm, requestId = props.requestId, sendDataType = props.sendDataType, children = props.children, classesWrapper = props.classesWrapper, requestCallback = props.requestCallback, onChange = props.onChange, sendKey = props.sendKey, countryCodeDefault = props.countryCodeDefault, _b = props.section, section = _b === void 0 ? undefined : _b, requestCode = props.requestCode;
|
|
54
|
+
var withConfirm = props.withConfirm, requestId = props.requestId, sendDataType = props.sendDataType, children = props.children, classesWrapper = props.classesWrapper, requestCallback = props.requestCallback, onChange = props.onChange, sendKey = props.sendKey, countryCodeDefault = props.countryCodeDefault, _b = props.section, section = _b === void 0 ? undefined : _b, requestCode = props.requestCode, countryInfo = props.countryInfo;
|
|
56
55
|
var _c = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), phone = _c[0], setPhone = _c[1];
|
|
57
56
|
var _d = (0, react_1.useState)(false), isRequestedCode = _d[0], setRequestedCodeStatus = _d[1];
|
|
58
|
-
// const { sendCommand } = useTransportControllers();
|
|
59
|
-
var getText = (0, useTranslate_1.useTranslate)('', '').getText;
|
|
60
|
-
var countryInfo = null;
|
|
61
57
|
var defaultCountry = (0, react_1.useMemo)(function () {
|
|
62
58
|
var _a, _b;
|
|
63
59
|
var country = countryCodeDefault ||
|
|
@@ -2,6 +2,7 @@ import { ERequestIds, RecoverySubType } from 'react-memory-optimization/dist/lib
|
|
|
2
2
|
import { BaseInputProps } from '../BaseInput/types';
|
|
3
3
|
export type PhoneInputProps = BaseInputProps & (PhoneInputPropsWithConfirmation | PhoneInputPropsWithoutConfirmation) & {
|
|
4
4
|
countryCodeDefault?: string;
|
|
5
|
+
countryInfo?: any;
|
|
5
6
|
};
|
|
6
7
|
export type PhoneInputPropsWithoutConfirmation = {
|
|
7
8
|
withConfirm: false | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-gldn-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"build": "rm -rf dist && npm run build:types && webpack --mode=production --node-env=production",
|
|
13
13
|
"publish": "npm i && npm run build && npm publish",
|
|
14
14
|
"clear": "sudo rm -rf node_modules && npm i",
|
|
15
|
-
"add:react": "
|
|
16
|
-
"add:react:win": "
|
|
17
|
-
"add:react-l-b": "
|
|
15
|
+
"add:react": "npm link ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/react ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/@types/react ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/classnames ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/react-dom ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/@types/react-dom ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/react-responsive-carousel ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/react-easy-swipe ../elon-fs-jb-gb/casino-apps/front-end/web-spa/node_modules/react-memory-optimization",
|
|
16
|
+
"add:react:win": "npm link ../landing-builder/web/node_modules/react ../landing-builder/web/node_modules/@types/react ../landing-builder/web/node_modules/classnames ../landing-builder/web/node_modules/react-dom ../landing-builder/web/node_modules/@types/react-dom ../landing-builder/web/node_modules/react-responsive-carousel ../landing-builder/web/node_modules/react-easy-swipe ../landing-builder/web/node_modules/react-memory-optimization",
|
|
17
|
+
"add:react-l-b": "npm link ../landing-builder/web/node_modules/react ../landing-builder/web/node_modules/@types/react ../landing-builder/web/node_modules/classnames ../landing-builder/web/node_modules/react-dom ../landing-builder/web/node_modules/@types/react-dom ../landing-builder/web/node_modules/react-memory-optimization",
|
|
18
18
|
"dev:kit": "sudo npm run add:react && npm run dev",
|
|
19
19
|
"dev:kit-lb": "sudo npm run add:react-l-b && npm run dev",
|
|
20
20
|
"dev:kit-win": "npm run add:react:win && rimraf ./dist/lib && tsc --build tsconfig.json && webpack --watch",
|