pds-dev-kit-web 2.2.210 → 2.2.212
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/src/common/services/i18n/resources/en.json +14 -14
- package/dist/src/common/styles/scroll/scrollbarStyle.d.ts +2 -0
- package/dist/src/common/styles/scroll/scrollbarStyle.js +4 -3
- package/dist/src/desktop/components/Calendar/Calendar.js +46 -51
- package/dist/src/desktop/components/Calendar/CalendarContext.d.ts +3 -1
- package/dist/src/desktop/components/Calendar/CalendarContext.js +2 -1
- package/dist/src/desktop/components/Calendar/DailyView.d.ts +8 -2
- package/dist/src/desktop/components/Calendar/DailyView.js +88 -7
- package/dist/src/desktop/components/Calendar/MonthlyView.d.ts +2 -1
- package/dist/src/desktop/components/Calendar/MonthlyView.js +81 -6
- package/dist/src/desktop/components/Calendar/WeeklyView.d.ts +3 -0
- package/dist/src/desktop/components/Calendar/WeeklyView.js +113 -7
- package/dist/src/desktop/components/Calendar/calendarUtils.js +20 -10
- package/dist/src/desktop/components/Calendar/types.d.ts +8 -4
- package/dist/src/desktop/components/PriceTextField/PriceTextField.d.ts +5 -4
- package/dist/src/desktop/components/PriceTextField/PriceTextField.js +53 -70
- package/dist/src/desktop/panels/DesktopBasicModal/DesktopBasicModal.d.ts +2 -1
- package/dist/src/desktop/panels/DesktopBasicModal/DesktopBasicModal.js +13 -15
- package/dist/src/desktop/panels/DesktopBasicModalWithTab/DesktopBasicModalWithTab.d.ts +3 -1
- package/dist/src/desktop/panels/DesktopBasicModalWithTab/DesktopBasicModalWithTab.js +16 -10
- package/dist/src/desktop/panels/DesktopHeadlessModal/DesktopHeadlessModal.d.ts +2 -1
- package/dist/src/desktop/panels/DesktopHeadlessModal/DesktopHeadlessModal.js +7 -27
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.d.ts +3 -1
- package/dist/src/desktop/panels/DesktopTutorialModal/DesktopTutorialModal.js +11 -5
- package/dist/src/desktop/panels/MultilingualModal/MultilingualModal.d.ts +3 -1
- package/dist/src/desktop/panels/MultilingualModal/MultilingualModal.js +11 -4
- package/dist/src/mobile/components/PriceTextField/PriceTextField.d.ts +5 -4
- package/dist/src/mobile/components/PriceTextField/PriceTextField.js +53 -70
- package/dist/src/mobile/panels/MobileBasicModal/MobileBasicModal.d.ts +3 -1
- package/dist/src/mobile/panels/MobileBasicModal/MobileBasicModal.js +13 -6
- package/package.json +1 -1
- package/release-note.md +3 -2
|
@@ -21,14 +21,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
22
|
var react_1 = require("react");
|
|
23
23
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
24
|
+
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
24
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
25
26
|
var animationStyle_1 = require("../../../common/styles/movement/animationStyle");
|
|
26
|
-
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
27
27
|
var hybrid_1 = require("../../../hybrid");
|
|
28
28
|
var components_1 = require("../../components");
|
|
29
29
|
var Components_1 = require("./Components");
|
|
30
30
|
function DesktopBasicModalWithTab(_a) {
|
|
31
|
-
var _b = _a.size, size = _b === void 0 ? 'large' : _b, modalTitleText = _a.modalTitleText, infoArray = _a.infoArray, _c = _a.btnMode, btnMode =
|
|
31
|
+
var _b = _a.size, size = _b === void 0 ? 'large' : _b, modalTitleText = _a.modalTitleText, infoArray = _a.infoArray, _c = _a.scrollVisibleType, scrollVisibleType = _c === void 0 ? 'visible' : _c, _d = _a.btnMode, btnMode = _d === void 0 ? 'btn_amount2' : _d, btn1Text = _a.btn1Text, btn2Text = _a.btn2Text, btn3Text = _a.btn3Text, _e = _a.btn1State, btn1State = _e === void 0 ? 'normal' : _e, _f = _a.btn2State, btn2State = _f === void 0 ? 'normal' : _f, _g = _a.btn3State, btn3State = _g === void 0 ? 'normal' : _g, _h = _a.btn1Type, btn1Type = _h === void 0 ? 'button' : _h, _j = _a.btn2Type, btn2Type = _j === void 0 ? 'button' : _j, _k = _a.btn3Type, btn3Type = _k === void 0 ? 'button' : _k, onClickBtn1 = _a.onClickBtn1, onClickBtn2 = _a.onClickBtn2, onClickBtn3 = _a.onClickBtn3;
|
|
32
32
|
var container = (0, react_1.useState)(function () {
|
|
33
33
|
var modalRoot = document.createElement('div');
|
|
34
34
|
modalRoot.setAttribute('id', 'DesktopBasicModalWithTab');
|
|
@@ -44,7 +44,7 @@ function DesktopBasicModalWithTab(_a) {
|
|
|
44
44
|
root.removeChild(container);
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
var
|
|
47
|
+
var _l = (0, react_1.useState)("".concat(infoArray[0].sideTabTitleText, "0")), selectedItem = _l[0], setSelectedItem = _l[1];
|
|
48
48
|
var sideTabTitleArray = infoArray.map(function (data, index) {
|
|
49
49
|
return {
|
|
50
50
|
title: data.sideTabTitleText,
|
|
@@ -57,7 +57,7 @@ function DesktopBasicModalWithTab(_a) {
|
|
|
57
57
|
var btn3Mode = ['btn_amount3'];
|
|
58
58
|
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, {}), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ "x-pds-name": "DesktopBasicModalWithTab", "x-pds-element-type": "panel", "x-pds-device-type": "desktop", size: size }, { children: [(0, jsx_runtime_1.jsxs)(S_UpsidePanel, { children: [(0, jsx_runtime_1.jsxs)(S_LeftPanel, { children: [(0, jsx_runtime_1.jsx)(S_Header, { children: (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: modalTitleText, lineLimit: 2, ellipsisMode: "use", styleTheme: "headingBold" }) }), (0, jsx_runtime_1.jsxs)(S_SideTabWrapper, { children: [(0, jsx_runtime_1.jsx)(Components_1.SideTab, { itemArray: sideTabTitleArray }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_i" })] })] }), infoArray
|
|
59
59
|
.filter(function (data, index) { return selectedItem === "".concat(data.sideTabTitleText).concat(index); })
|
|
60
|
-
.map(function (data, index) { return ((0, jsx_runtime_1.jsx)(S_RightContainer, { children: (0, jsx_runtime_1.jsxs)(S_RightArea, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.bodyTitleText ? data.bodyTitleText : data.sideTabTitleText, styleTheme: "headingBold" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_e" }), (0, jsx_runtime_1.jsx)(S_Body, { children: data.body && data.body })] }) }, "".concat(data.sideTabTitleText).concat(index))); })] }), (0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, { children: btn3Mode.includes(btnMode) && btn3Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: btn3Text, state: btn3State, type: btn3Type, size: "medium", onClick: onClickBtn3 })) }), (0, jsx_runtime_1.jsxs)(S_Right, { children: [(0, jsx_runtime_1.jsx)(S_Btn2Wrapper, { children: btn2Mode.includes(btnMode) && btn2Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: btn2Text, state: btn2State, type: btn2Type, size: "medium", onClick: onClickBtn2 })) }), btn1Mode.includes(btnMode) && btn1Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { text: btn1Text, state: btn1State, type: btn1Type, size: "medium", onClick: onClickBtn1 }))] })] })] }))] }), container);
|
|
60
|
+
.map(function (data, index) { return ((0, jsx_runtime_1.jsx)(S_RightContainer, __assign({ scrollVisibleType: scrollVisibleType }, { children: (0, jsx_runtime_1.jsxs)(S_RightArea, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.bodyTitleText ? data.bodyTitleText : data.sideTabTitleText, styleTheme: "headingBold" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_e" }), (0, jsx_runtime_1.jsx)(S_Body, { children: data.body && data.body })] }) }), "".concat(data.sideTabTitleText).concat(index))); })] }), (0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, { children: btn3Mode.includes(btnMode) && btn3Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: btn3Text, state: btn3State, type: btn3Type, size: "medium", onClick: onClickBtn3 })) }), (0, jsx_runtime_1.jsxs)(S_Right, { children: [(0, jsx_runtime_1.jsx)(S_Btn2Wrapper, { children: btn2Mode.includes(btnMode) && btn2Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: btn2Text, state: btn2State, type: btn2Type, size: "medium", onClick: onClickBtn2 })) }), btn1Mode.includes(btnMode) && btn1Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { text: btn1Text, state: btn1State, type: btn1Type, size: "medium", onClick: onClickBtn1 }))] })] })] }))] }), container);
|
|
61
61
|
}
|
|
62
62
|
var S_ModalOverlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"], ["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"])), function (_a) {
|
|
63
63
|
var theme = _a.theme;
|
|
@@ -102,21 +102,27 @@ var S_SideTabWrapper = styled_components_1.default.div(templateObject_6 || (temp
|
|
|
102
102
|
var theme = _a.theme;
|
|
103
103
|
return theme.ui_cpnt_modalwithtab_leftside_base;
|
|
104
104
|
});
|
|
105
|
-
var S_RightContainer = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n overflow-x: hidden;\n overflow-y: overlay;\n\n ", "\n"], ["\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n overflow-x: hidden;\n overflow-y: overlay;\n\n ", "\n"])),
|
|
106
|
-
var S_RightArea = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n box-sizing: border-box;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"], ["\n box-sizing: border-box;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"])), function (_a) {
|
|
105
|
+
var S_RightContainer = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n margin-top: ", ";\n overflow-x: hidden;\n overflow-y: overlay;\n\n ", "\n"], ["\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n margin-top: ", ";\n overflow-x: hidden;\n overflow-y: overlay;\n\n ", "\n"])), function (_a) {
|
|
107
106
|
var theme = _a.theme;
|
|
108
|
-
return theme.spacing.
|
|
107
|
+
return theme.spacing.spacingE;
|
|
109
108
|
}, function (_a) {
|
|
109
|
+
var scrollVisibleType = _a.scrollVisibleType;
|
|
110
|
+
return ({
|
|
111
|
+
visible: scrollbarStyle_1.scrollbarStyle,
|
|
112
|
+
hidden: scrollbarStyle_1.scrollInvisible
|
|
113
|
+
}[scrollVisibleType]);
|
|
114
|
+
});
|
|
115
|
+
var S_RightArea = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n box-sizing: border-box;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n box-sizing: border-box;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
110
116
|
var theme = _a.theme;
|
|
111
|
-
return theme.spacing.
|
|
117
|
+
return theme.spacing.spacingI;
|
|
112
118
|
}, function (_a) {
|
|
113
119
|
var theme = _a.theme;
|
|
114
120
|
return theme.spacing.spacingF;
|
|
115
121
|
}, function (_a) {
|
|
116
122
|
var theme = _a.theme;
|
|
117
|
-
return theme.spacing.
|
|
123
|
+
return theme.spacing.spacingF;
|
|
118
124
|
});
|
|
119
|
-
var S_Body = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n overflow-x: hidden;\n"], ["\n overflow-x: hidden;\n"])));
|
|
125
|
+
var S_Body = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n overflow-wrap: break-word;\n overflow-x: hidden;\n white-space: pre-wrap;\n"], ["\n overflow-wrap: break-word;\n overflow-x: hidden;\n white-space: pre-wrap;\n"])));
|
|
120
126
|
var S_Footer = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n border-top: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"], ["\n border-top: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"])), function (_a) {
|
|
121
127
|
var theme = _a.theme;
|
|
122
128
|
return theme.ui_cpnt_modal_border;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ScrollVisibleType } from '../../../common/styles/scroll/scrollbarStyle';
|
|
2
3
|
import type { PDSTextType } from '../../../common/types';
|
|
3
4
|
type DesktopHeadlessModalProps = {
|
|
4
5
|
body: React.ReactNode;
|
|
5
6
|
size?: 'large' | 'medium' | 'small' | 'rlarge' | 'xlarge' | 'rxlarge';
|
|
6
7
|
dimmedClickCloseMode?: 'use' | 'none';
|
|
7
|
-
scrollVisibleType?:
|
|
8
|
+
scrollVisibleType?: ScrollVisibleType;
|
|
8
9
|
footerMode?: 'use' | 'none';
|
|
9
10
|
btnMode?: 'mbtn_amount1' | 'mbtn_amount2' | 'mbtn_amount3';
|
|
10
11
|
mBtn1Text?: PDSTextType;
|
|
@@ -44,10 +44,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
44
44
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
45
45
|
var react_1 = require("react");
|
|
46
46
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
47
|
+
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
47
48
|
var components_1 = require("../../components");
|
|
48
49
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
49
50
|
var animationStyle_1 = require("../../../common/styles/movement/animationStyle");
|
|
50
|
-
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
51
51
|
function DesktopHeadlessModal(_a) {
|
|
52
52
|
var body = _a.body, _b = _a.size, size = _b === void 0 ? 'rlarge' : _b, _c = _a.dimmedClickCloseMode, dimmedClickCloseMode = _c === void 0 ? 'none' : _c, _d = _a.scrollVisibleType, scrollVisibleType = _d === void 0 ? 'visible' : _d, onClose = _a.onClose, _e = _a.footerMode, footerMode = _e === void 0 ? 'none' : _e, _f = _a.btnMode, btnMode = _f === void 0 ? 'mbtn_amount2' : _f, mBtn1Text = _a.mBtn1Text, mBtn2Text = _a.mBtn2Text, mBtn3Text = _a.mBtn3Text, _g = _a.mBtn1State, mBtn1State = _g === void 0 ? 'normal' : _g, _h = _a.mBtn2State, mBtn2State = _h === void 0 ? 'normal' : _h, _j = _a.mBtn3State, mBtn3State = _j === void 0 ? 'normal' : _j, _k = _a.mBtn1Type, mBtn1Type = _k === void 0 ? 'button' : _k, _l = _a.mBtn2Type, mBtn2Type = _l === void 0 ? 'button' : _l, _m = _a.mBtn3Type, mBtn3Type = _m === void 0 ? 'button' : _m, onClickMBtn1 = _a.onClickMBtn1, onClickMBtn2 = _a.onClickMBtn2, onClickMBtn3 = _a.onClickMBtn3;
|
|
53
53
|
var container = (0, react_1.useState)(function () {
|
|
@@ -55,7 +55,6 @@ function DesktopHeadlessModal(_a) {
|
|
|
55
55
|
modalRoot.setAttribute('id', 'DesktopHeadlessModal');
|
|
56
56
|
return modalRoot;
|
|
57
57
|
})[0];
|
|
58
|
-
var targetRef = (0, react_1.useRef)(null);
|
|
59
58
|
var handleClickOutside = function (e) {
|
|
60
59
|
e.stopPropagation();
|
|
61
60
|
if (dimmedClickCloseMode === 'use') {
|
|
@@ -66,32 +65,18 @@ function DesktopHeadlessModal(_a) {
|
|
|
66
65
|
};
|
|
67
66
|
(0, react_1.useLayoutEffect)(function () {
|
|
68
67
|
var root = document.getElementById('root');
|
|
69
|
-
var isScrolling;
|
|
70
|
-
var handleScroll = function () {
|
|
71
|
-
if (targetRef.current) {
|
|
72
|
-
targetRef.current.classList.add('scrollMoving');
|
|
73
|
-
}
|
|
74
|
-
isScrolling = setTimeout(function () {
|
|
75
|
-
var _a;
|
|
76
|
-
(_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove('scrollMoving');
|
|
77
|
-
}, 500);
|
|
78
|
-
};
|
|
79
68
|
if (!root) {
|
|
80
69
|
return;
|
|
81
70
|
}
|
|
82
|
-
if (targetRef.current) {
|
|
83
|
-
targetRef.current.onscroll = handleScroll;
|
|
84
|
-
}
|
|
85
71
|
root.appendChild(container);
|
|
86
72
|
return function () {
|
|
87
73
|
root.removeChild(container);
|
|
88
|
-
clearTimeout(isScrolling);
|
|
89
74
|
};
|
|
90
75
|
}, []);
|
|
91
76
|
var btn1Mode = ['mbtn_amount1', 'mbtn_amount2', 'mbtn_amount3'];
|
|
92
77
|
var btn2Mode = ['mbtn_amount2', 'mbtn_amount3'];
|
|
93
78
|
var btn3Mode = ['mbtn_amount3'];
|
|
94
|
-
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, { "x-pds-name": "DesktopHeadlessModal", "x-pds-element-type": "panel", "x-pds-device-type": "desktop", onMouseDown: handleClickOutside }), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ size: size }, { children: [(0, jsx_runtime_1.jsx)(S_Body, __assign({
|
|
79
|
+
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, { "x-pds-name": "DesktopHeadlessModal", "x-pds-element-type": "panel", "x-pds-device-type": "desktop", onMouseDown: handleClickOutside }), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ size: size }, { children: [(0, jsx_runtime_1.jsx)(S_Body, __assign({ scrollVisibleType: scrollVisibleType }, { children: body && body })), footerMode === 'use' && ((0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, { children: btn3Mode.includes(btnMode) && mBtn3Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: mBtn3Text, state: mBtn3State, type: mBtn3Type, size: "medium", onClick: onClickMBtn3 })) }), (0, jsx_runtime_1.jsxs)(S_Right, { children: [(0, jsx_runtime_1.jsx)(S_Btn2Wrapper, { children: btn2Mode.includes(btnMode) && mBtn2Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: mBtn2Text, state: mBtn2State, type: mBtn2Type, size: "medium", onClick: onClickMBtn2 })) }), btn1Mode.includes(btnMode) && mBtn1Text && ((0, jsx_runtime_1.jsx)(components_1.MainButton, { text: mBtn1Text, state: mBtn1State, type: mBtn1Type, size: "medium", onClick: onClickMBtn1 }))] })] }))] }))] }), container);
|
|
95
80
|
}
|
|
96
81
|
var S_ModalOverlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"], ["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"])), function (_a) {
|
|
97
82
|
var theme = _a.theme;
|
|
@@ -122,17 +107,12 @@ var S_ModalWrapper = styled_components_1.default.div(templateObject_2 || (templa
|
|
|
122
107
|
return sizes[size];
|
|
123
108
|
}, animationStyle_1.modalOnAni);
|
|
124
109
|
var scrollInvisible = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ::-webkit-scrollbar {\n display: none;\n }\n"], ["\n ::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
125
|
-
var S_Body = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n overflow: auto;\n overflow-y: overlay;\n width: 100%;\n\n ", "\n
|
|
126
|
-
var scrollVisibleType = _a.scrollVisibleType;
|
|
127
|
-
return scrollVisibleType &&
|
|
128
|
-
{
|
|
129
|
-
moving: scrollInvisible,
|
|
130
|
-
visible: scrollbarStyle_1.scrollbarWithPaddingStyle,
|
|
131
|
-
hidden: scrollInvisible
|
|
132
|
-
}[scrollVisibleType];
|
|
133
|
-
}, function (_a) {
|
|
110
|
+
var S_Body = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n overflow: auto;\n overflow-y: overlay;\n width: 100%;\n\n ", "\n"], ["\n overflow: auto;\n overflow-y: overlay;\n width: 100%;\n\n ", "\n"])), function (_a) {
|
|
134
111
|
var scrollVisibleType = _a.scrollVisibleType;
|
|
135
|
-
return
|
|
112
|
+
return ({
|
|
113
|
+
visible: scrollbarStyle_1.scrollbarWithPaddingStyle,
|
|
114
|
+
hidden: scrollInvisible
|
|
115
|
+
}[scrollVisibleType]);
|
|
136
116
|
});
|
|
137
117
|
var S_Left = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n"], ["\n margin-right: ", ";\n"])), function (_a) {
|
|
138
118
|
var theme = _a.theme;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ScrollVisibleType } from '../../../common/styles/scroll/scrollbarStyle';
|
|
2
3
|
import type { PDSTextType } from '../../../common';
|
|
3
4
|
export type DesktopTutorialModalInfoType = {
|
|
4
5
|
sideTabTitleText: PDSTextType;
|
|
@@ -13,7 +14,8 @@ type DesktopTutorialModalProps = {
|
|
|
13
14
|
modalTitleText: PDSTextType;
|
|
14
15
|
infoArray: DesktopTutorialModalInfoType[];
|
|
15
16
|
sequenceMode?: 'use' | 'none';
|
|
17
|
+
scrollVisibleType?: ScrollVisibleType;
|
|
16
18
|
onClose: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
19
|
};
|
|
18
|
-
declare function DesktopTutorialModal({ modalTitleText, infoArray, sequenceMode, onClose }: DesktopTutorialModalProps): import("react").ReactPortal;
|
|
20
|
+
declare function DesktopTutorialModal({ modalTitleText, infoArray, sequenceMode, scrollVisibleType, onClose }: DesktopTutorialModalProps): import("react").ReactPortal;
|
|
19
21
|
export default DesktopTutorialModal;
|
|
@@ -21,14 +21,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
22
|
var react_1 = require("react");
|
|
23
23
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
24
|
+
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
24
25
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
25
26
|
var animationStyle_1 = require("../../../common/styles/movement/animationStyle");
|
|
26
|
-
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
27
27
|
var hybrid_1 = require("../../../hybrid");
|
|
28
28
|
var components_1 = require("../../components");
|
|
29
29
|
var Components_1 = require("./Components");
|
|
30
30
|
function DesktopTutorialModal(_a) {
|
|
31
|
-
var modalTitleText = _a.modalTitleText, infoArray = _a.infoArray, _b = _a.sequenceMode, sequenceMode = _b === void 0 ? 'use' : _b, onClose = _a.onClose;
|
|
31
|
+
var modalTitleText = _a.modalTitleText, infoArray = _a.infoArray, _b = _a.sequenceMode, sequenceMode = _b === void 0 ? 'use' : _b, _c = _a.scrollVisibleType, scrollVisibleType = _c === void 0 ? 'visible' : _c, onClose = _a.onClose;
|
|
32
32
|
var container = (0, react_1.useState)(function () {
|
|
33
33
|
var modalRoot = document.createElement('div');
|
|
34
34
|
modalRoot.setAttribute('id', 'DesktopTutorialModal');
|
|
@@ -44,7 +44,7 @@ function DesktopTutorialModal(_a) {
|
|
|
44
44
|
root.removeChild(container);
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
var
|
|
47
|
+
var _d = (0, react_1.useState)("".concat(infoArray[0].sideTabTitleText, "0")), selectedItem = _d[0], setSelectedItem = _d[1];
|
|
48
48
|
var sideTabTitleArray = infoArray.map(function (data, index) {
|
|
49
49
|
return {
|
|
50
50
|
title: data.sideTabTitleText,
|
|
@@ -70,7 +70,7 @@ function DesktopTutorialModal(_a) {
|
|
|
70
70
|
};
|
|
71
71
|
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, {}), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ "x-pds-name": "DesktopTutorialModal", "x-pds-element-type": "panel", "x-pds-device-type": "desktop" }, { children: [(0, jsx_runtime_1.jsxs)(S_LeftPanel, { children: [(0, jsx_runtime_1.jsx)(S_Header, { children: (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: modalTitleText, lineLimit: 2, ellipsisMode: "use", styleTheme: "headingBold" }) }), (0, jsx_runtime_1.jsxs)(S_SideTabWrapper, { children: [(0, jsx_runtime_1.jsx)(Components_1.SideTab, { itemArray: sideTabTitleArray }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_i" })] })] }), infoArray
|
|
72
72
|
.filter(function (data, index) { return selectedItem === "".concat(data.sideTabTitleText).concat(index); })
|
|
73
|
-
.map(function (data, index) { return ((0, jsx_runtime_1.jsxs)(S_RightPanel, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { src: data.imageSrc, shapeType: "rectangle", width: "responsive", ratio: "16_9", scaleType: "cover", backgroundFillMode: "use" }), (0, jsx_runtime_1.jsxs)(S_InfoBox, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.infoTitleText ? data.infoTitleText : data.sideTabTitleText, styleTheme: "headingBold" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.infoDescText, styleTheme: "body2Regular", colorTheme: "sysTextSecondary" })] }), data.btnMode === 'btn_amount1' && ((0, jsx_runtime_1.jsx)(S_Footer, { children: (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: data.btn1Text, type: "button", size: "medium", onClick: data.onClickBtn1 }) }))] }, "".concat(data.sideTabTitleText).concat(index))); }), (0, jsx_runtime_1.jsx)(S_IconButtonWrapper, { children: sequenceMode === 'use' && selectedItemIndex !== lastIndex ? ((0, jsx_runtime_1.jsx)(components_1.IconButton, { shapeType: "circular", baseSize: "medium", baseColorKey: "ui_cpnt_button_fill_base_tutorialmodal", iconName: "ic_arrow_right", iconColorKey: "ui_cpnt_button_icon_white", onClick: handleClickNextBtn })) : ((0, jsx_runtime_1.jsx)(components_1.IconButton, { shapeType: "circular", baseSize: "medium", baseColorKey: "ui_cpnt_button_fill_base_tutorialmodal", iconName: "ic_xmark", iconColorKey: "ui_cpnt_button_icon_white", onClick: handleClickCloseBtn })) })] }))] }), container);
|
|
73
|
+
.map(function (data, index) { return ((0, jsx_runtime_1.jsxs)(S_RightPanel, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { src: data.imageSrc, shapeType: "rectangle", width: "responsive", ratio: "16_9", scaleType: "cover", backgroundFillMode: "use" }), (0, jsx_runtime_1.jsxs)(S_InfoBox, __assign({ scrollVisibleType: scrollVisibleType }, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.infoTitleText ? data.infoTitleText : data.sideTabTitleText, styleTheme: "headingBold" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: data.infoDescText, styleTheme: "body2Regular", colorTheme: "sysTextSecondary" })] })), data.btnMode === 'btn_amount1' && ((0, jsx_runtime_1.jsx)(S_Footer, { children: (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: data.btn1Text, type: "button", size: "medium", onClick: data.onClickBtn1 }) }))] }, "".concat(data.sideTabTitleText).concat(index))); }), (0, jsx_runtime_1.jsx)(S_IconButtonWrapper, { children: sequenceMode === 'use' && selectedItemIndex !== lastIndex ? ((0, jsx_runtime_1.jsx)(components_1.IconButton, { shapeType: "circular", baseSize: "medium", baseColorKey: "ui_cpnt_button_fill_base_tutorialmodal", iconName: "ic_arrow_right", iconColorKey: "ui_cpnt_button_icon_white", onClick: handleClickNextBtn })) : ((0, jsx_runtime_1.jsx)(components_1.IconButton, { shapeType: "circular", baseSize: "medium", baseColorKey: "ui_cpnt_button_fill_base_tutorialmodal", iconName: "ic_xmark", iconColorKey: "ui_cpnt_button_icon_white", onClick: handleClickCloseBtn })) })] }))] }), container);
|
|
74
74
|
}
|
|
75
75
|
var S_ModalOverlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"], ["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"])), function (_a) {
|
|
76
76
|
var theme = _a.theme;
|
|
@@ -114,7 +114,13 @@ var S_InfoBox = styled_components_1.default.div(templateObject_7 || (templateObj
|
|
|
114
114
|
}, function (_a) {
|
|
115
115
|
var theme = _a.theme;
|
|
116
116
|
return theme.spacing.spacingF;
|
|
117
|
-
},
|
|
117
|
+
}, function (_a) {
|
|
118
|
+
var scrollVisibleType = _a.scrollVisibleType;
|
|
119
|
+
return ({
|
|
120
|
+
visible: scrollbarStyle_1.scrollbarStyle,
|
|
121
|
+
hidden: scrollbarStyle_1.scrollInvisible
|
|
122
|
+
}[scrollVisibleType]);
|
|
123
|
+
});
|
|
118
124
|
var S_Footer = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n display: flex;\n height: 88px;\n min-height: 88px;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: flex-end;\n box-sizing: border-box;\n display: flex;\n height: 88px;\n min-height: 88px;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
119
125
|
var theme = _a.theme;
|
|
120
126
|
return theme.spacing.spacingF;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ScrollVisibleType } from '../../../common/styles/scroll/scrollbarStyle';
|
|
2
3
|
import type { MultilingualConfig } from '../../../common/types';
|
|
3
4
|
type MultilingualModalModalProps = {
|
|
4
5
|
isOpen: boolean;
|
|
@@ -6,6 +7,7 @@ type MultilingualModalModalProps = {
|
|
|
6
7
|
config?: MultilingualConfig;
|
|
7
8
|
size?: 'large' | 'medium' | 'small' | 'rlarge';
|
|
8
9
|
onHiddenInputUpdate?: (newValue: string) => void;
|
|
10
|
+
scrollVisibleType?: ScrollVisibleType;
|
|
9
11
|
};
|
|
10
|
-
declare function MultilingualModal({ isOpen, onClose, config, size, onHiddenInputUpdate }: MultilingualModalModalProps): import("react").ReactPortal | null;
|
|
12
|
+
declare function MultilingualModal({ isOpen, onClose, config, size, onHiddenInputUpdate, scrollVisibleType }: MultilingualModalModalProps): import("react").ReactPortal | null;
|
|
11
13
|
export default MultilingualModal;
|
|
@@ -24,6 +24,7 @@ var react_dom_1 = __importDefault(require("react-dom"));
|
|
|
24
24
|
var react_hook_form_1 = require("react-hook-form");
|
|
25
25
|
var react_i18next_1 = require("react-i18next");
|
|
26
26
|
var animationStyle_1 = require("../../../common/styles/movement/animationStyle");
|
|
27
|
+
var scrollbarStyle_1 = require("../../../common/styles/scroll/scrollbarStyle");
|
|
27
28
|
var components_1 = require("../../components");
|
|
28
29
|
var components_2 = require("../../../hybrid/components");
|
|
29
30
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
@@ -38,7 +39,7 @@ var LANGUAGE_I18N_KEYS = {
|
|
|
38
39
|
};
|
|
39
40
|
function MultilingualModal(_a) {
|
|
40
41
|
var _b, _c;
|
|
41
|
-
var isOpen = _a.isOpen, onClose = _a.onClose, config = _a.config, _d = _a.size, size = _d === void 0 ? 'medium' : _d, onHiddenInputUpdate = _a.onHiddenInputUpdate;
|
|
42
|
+
var isOpen = _a.isOpen, onClose = _a.onClose, config = _a.config, _d = _a.size, size = _d === void 0 ? 'medium' : _d, onHiddenInputUpdate = _a.onHiddenInputUpdate, _e = _a.scrollVisibleType, scrollVisibleType = _e === void 0 ? 'visible' : _e;
|
|
42
43
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
43
44
|
var allLangInReadonly = (_b = config === null || config === void 0 ? void 0 : config.visibleLanguages) === null || _b === void 0 ? void 0 : _b.every(function (item) { var _a; return (_a = config === null || config === void 0 ? void 0 : config.readonlyLanguages) === null || _a === void 0 ? void 0 : _a.includes(item); });
|
|
44
45
|
// FormProvider에서 사용할 기본값 계산
|
|
@@ -114,11 +115,11 @@ function MultilingualModal(_a) {
|
|
|
114
115
|
};
|
|
115
116
|
if (!isOpen)
|
|
116
117
|
return null;
|
|
117
|
-
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(react_hook_form_1.FormProvider, __assign({}, methods, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, { onClick: handleCancel }), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ "x-pds-name": "MultiLanguageModal", "x-pds-element-type": "panel", "x-pds-device-type": "desktop", size: size }, { children: [(0, jsx_runtime_1.jsx)(S_Header, { children: (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: t('str_multilingual_settings'), colorTheme: "sysTextPrimary", styleTheme: "headingBold" }) }), (0, jsx_runtime_1.jsxs)(S_Body, { children: [(config === null || config === void 0 ? void 0 : config.originalText) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.BodyTextGroup, { titleText: t('str_original_text'), contentText: config.originalText }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" }), (0, jsx_runtime_1.jsx)(components_2.Divider, {}), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" })] })), (_c = config === null || config === void 0 ? void 0 : config.visibleLanguages) === null || _c === void 0 ? void 0 : _c.map(function (languageCode, index) {
|
|
118
|
+
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)(react_hook_form_1.FormProvider, __assign({}, methods, { children: [(0, jsx_runtime_1.jsx)(S_ModalOverlay, { onClick: handleCancel }), (0, jsx_runtime_1.jsxs)(S_ModalWrapper, __assign({ "x-pds-name": "MultiLanguageModal", "x-pds-element-type": "panel", "x-pds-device-type": "desktop", size: size }, { children: [(0, jsx_runtime_1.jsx)(S_Header, { children: (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: t('str_multilingual_settings'), colorTheme: "sysTextPrimary", styleTheme: "headingBold" }) }), (0, jsx_runtime_1.jsxs)(S_Body, __assign({ scrollVisibleType: scrollVisibleType }, { children: [(config === null || config === void 0 ? void 0 : config.originalText) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.BodyTextGroup, { titleText: t('str_original_text'), contentText: config.originalText }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" }), (0, jsx_runtime_1.jsx)(components_2.Divider, {}), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" })] })), (_c = config === null || config === void 0 ? void 0 : config.visibleLanguages) === null || _c === void 0 ? void 0 : _c.map(function (languageCode, index) {
|
|
118
119
|
var _a, _b;
|
|
119
120
|
var isReadonly = (_a = config.readonlyLanguages) === null || _a === void 0 ? void 0 : _a.includes(languageCode);
|
|
120
121
|
return ((0, jsx_runtime_1.jsxs)(S_LanguageField, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: "".concat(t(LANGUAGE_I18N_KEYS[languageCode])), styleTheme: "subTitleBold", colorTheme: "sysTextPrimary" }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b" }), (0, jsx_runtime_1.jsx)(components_1.TextField, { responsiveMode: "use", multiRows: config.textFieldLineType === 'multi' ? 5 : undefined, autoMaxRows: config.textFieldLineType === 'auto' ? 5 : undefined, autoMinRows: config.textFieldLineType === 'auto' ? 1 : undefined, name: languageCode, hintText: t('str_9071'), placeholder: "Input Text", textLineType: config.textFieldLineType, state: isReadonly ? 'disabled' : 'normal' }), index < (((_b = config.visibleLanguages) === null || _b === void 0 ? void 0 : _b.length) || 0) - 1 && (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" })] }, "".concat(languageCode, "_field")));
|
|
121
|
-
})] }), (0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, {}), (0, jsx_runtime_1.jsxs)(S_Right, { children: [!allLangInReadonly && ((0, jsx_runtime_1.jsx)(S_Btn2Wrapper, { children: (0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: t('str_cancel'), size: "medium", onClick: handleCancel }) })), (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: allLangInReadonly ? t('str_confirm') : t('str_apply'), size: "medium", onClick: handleConfirm })] })] })] }))] })), container);
|
|
122
|
+
})] })), (0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, {}), (0, jsx_runtime_1.jsxs)(S_Right, { children: [!allLangInReadonly && ((0, jsx_runtime_1.jsx)(S_Btn2Wrapper, { children: (0, jsx_runtime_1.jsx)(components_1.MainButton, { styleTheme: "secondary", text: t('str_cancel'), size: "medium", onClick: handleCancel }) })), (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: allLangInReadonly ? t('str_confirm') : t('str_apply'), size: "medium", onClick: handleConfirm })] })] })] }))] })), container);
|
|
122
123
|
}
|
|
123
124
|
var S_ModalOverlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"], ["\n background-color: ", ";\n height: 100vh;\n left: 0;\n position: fixed;\n top: 0;\n width: 100vw;\n\n ", "\n"])), function (_a) {
|
|
124
125
|
var theme = _a.theme;
|
|
@@ -156,7 +157,7 @@ var S_Header = styled_components_1.default.div(templateObject_3 || (templateObje
|
|
|
156
157
|
var theme = _a.theme;
|
|
157
158
|
return theme.spacing.spacingE;
|
|
158
159
|
});
|
|
159
|
-
var S_Body = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n max-height: 60vh;\n overflow: auto;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"], ["\n flex: 1;\n max-height: 60vh;\n overflow: auto;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"])), function (_a) {
|
|
160
|
+
var S_Body = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n max-height: 60vh;\n overflow: auto;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n\n ", "\n"], ["\n flex: 1;\n max-height: 60vh;\n overflow: auto;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n\n ", "\n"])), function (_a) {
|
|
160
161
|
var theme = _a.theme;
|
|
161
162
|
return theme.spacing.spacingF;
|
|
162
163
|
}, function (_a) {
|
|
@@ -168,6 +169,12 @@ var S_Body = styled_components_1.default.div(templateObject_4 || (templateObject
|
|
|
168
169
|
}, function (_a) {
|
|
169
170
|
var theme = _a.theme;
|
|
170
171
|
return theme.spacing.spacingD;
|
|
172
|
+
}, function (_a) {
|
|
173
|
+
var scrollVisibleType = _a.scrollVisibleType;
|
|
174
|
+
return ({
|
|
175
|
+
visible: scrollbarStyle_1.scrollbarStyle,
|
|
176
|
+
hidden: scrollbarStyle_1.scrollInvisible
|
|
177
|
+
}[scrollVisibleType]);
|
|
171
178
|
});
|
|
172
179
|
var S_Footer = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-top: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"], ["\n border-top: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n"])), function (_a) {
|
|
173
180
|
var theme = _a.theme;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
|
-
import { CurrencyCode
|
|
3
|
+
import { CurrencyCode } from '../../../core/pricing';
|
|
4
4
|
import type { IFormValues, PDSTextType } from '../../../common';
|
|
5
5
|
import type { TextFieldBaseProps } from '../../common/components/TextFieldBase/TextFieldBase';
|
|
6
6
|
export declare const DEFAULT_DECIMAL_PLACES: {
|
|
@@ -19,12 +19,13 @@ type Props = {
|
|
|
19
19
|
baseCurrency?: CurrencyCode;
|
|
20
20
|
currencies?: CurrencyCode[];
|
|
21
21
|
decimalPlaces?: Record<string, number>;
|
|
22
|
-
exchangeRates?:
|
|
22
|
+
exchangeRates?: {
|
|
23
|
+
[key: string]: number;
|
|
24
|
+
};
|
|
23
25
|
hintTextFontWeight?: 'normal' | 'bold';
|
|
24
26
|
validation?: any;
|
|
25
27
|
useRequiredValidation?: 'none' | 'use';
|
|
26
28
|
useDotBadge?: 'none' | 'use';
|
|
27
|
-
returnType?: 'object' | 'string' | 'rawValue';
|
|
28
29
|
deleteBtnMode?: 'none' | 'use';
|
|
29
30
|
minPriceAmount?: string | number;
|
|
30
31
|
onChange?: (value: string) => void;
|
|
@@ -38,5 +39,5 @@ type Props = {
|
|
|
38
39
|
displayValue: string;
|
|
39
40
|
}) => void;
|
|
40
41
|
} & Omit<Partial<TextFieldBaseProps>, 'textAlign' | 'preventBlankMode' | 'enterSubmitMode' | 'multiRows' | 'colorTheme'>;
|
|
41
|
-
declare function PriceTextField({ name, hintText, defaultAmount, colorTheme, size, fontWeight, hintTextFontWeight, responsiveMode, state, dropdownState, customWidth, baseCurrency, currencies, decimalPlaces, exchangeRates, textAlign, validation, useRequiredValidation, useDotBadge,
|
|
42
|
+
declare function PriceTextField({ name, hintText, defaultAmount, colorTheme, size, fontWeight, hintTextFontWeight, responsiveMode, state, dropdownState, customWidth, baseCurrency, currencies, decimalPlaces, exchangeRates, textAlign, validation, useRequiredValidation, useDotBadge, deleteBtnMode, minPriceAmount, onChange, onBlur, onFocus, onTarget, onCurrencyChange, onValueChange }: Props): JSX.Element;
|
|
42
43
|
export default PriceTextField;
|
|
@@ -66,18 +66,50 @@ exports.DEFAULT_DECIMAL_PLACES = {
|
|
|
66
66
|
function PriceTextField(_a) {
|
|
67
67
|
var _b;
|
|
68
68
|
var _c;
|
|
69
|
-
var name = _a.name, hintText = _a.hintText, defaultAmount = _a.defaultAmount, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, _e = _a.size, size = _e === void 0 ? 'large' : _e, _f = _a.fontWeight, fontWeight = _f === void 0 ? 'bold' : _f, _g = _a.hintTextFontWeight, hintTextFontWeight = _g === void 0 ? 'normal' : _g, _h = _a.responsiveMode, responsiveMode = _h === void 0 ? 'none' : _h, _j = _a.state, state = _j === void 0 ? 'normal' : _j, _k = _a.dropdownState, dropdownState = _k === void 0 ? 'normal' : _k, customWidth = _a.customWidth, _l = _a.baseCurrency, baseCurrency = _l === void 0 ? pricing_1.CurrencyCode.KRW : _l, _m = _a.currencies, currencies = _m === void 0 ? [pricing_1.CurrencyCode.KRW, pricing_1.CurrencyCode.USD] : _m, _o = _a.decimalPlaces, decimalPlaces = _o === void 0 ? exports.DEFAULT_DECIMAL_PLACES : _o, _p = _a.exchangeRates, exchangeRates = _p === void 0 ? (_b = {}, _b[pricing_1.CurrencyCode.KRW] = 1300, _b[pricing_1.CurrencyCode.USD] = 1, _b) : _p, _q = _a.textAlign, textAlign = _q === void 0 ? 'right' : _q, validation = _a.validation, _r = _a.useRequiredValidation, useRequiredValidation = _r === void 0 ? 'use' : _r, _s = _a.useDotBadge, useDotBadge = _s === void 0 ? 'use' : _s, _t = _a.
|
|
69
|
+
var name = _a.name, hintText = _a.hintText, defaultAmount = _a.defaultAmount, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, _e = _a.size, size = _e === void 0 ? 'large' : _e, _f = _a.fontWeight, fontWeight = _f === void 0 ? 'bold' : _f, _g = _a.hintTextFontWeight, hintTextFontWeight = _g === void 0 ? 'normal' : _g, _h = _a.responsiveMode, responsiveMode = _h === void 0 ? 'none' : _h, _j = _a.state, state = _j === void 0 ? 'normal' : _j, _k = _a.dropdownState, dropdownState = _k === void 0 ? 'normal' : _k, customWidth = _a.customWidth, _l = _a.baseCurrency, baseCurrency = _l === void 0 ? pricing_1.CurrencyCode.KRW : _l, _m = _a.currencies, currencies = _m === void 0 ? [pricing_1.CurrencyCode.KRW, pricing_1.CurrencyCode.USD] : _m, _o = _a.decimalPlaces, decimalPlaces = _o === void 0 ? exports.DEFAULT_DECIMAL_PLACES : _o, _p = _a.exchangeRates, exchangeRates = _p === void 0 ? (_b = {}, _b[pricing_1.CurrencyCode.KRW] = 1300, _b[pricing_1.CurrencyCode.USD] = 1, _b) : _p, _q = _a.textAlign, textAlign = _q === void 0 ? 'right' : _q, validation = _a.validation, _r = _a.useRequiredValidation, useRequiredValidation = _r === void 0 ? 'use' : _r, _s = _a.useDotBadge, useDotBadge = _s === void 0 ? 'use' : _s, _t = _a.deleteBtnMode, deleteBtnMode = _t === void 0 ? 'use' : _t, minPriceAmount = _a.minPriceAmount, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, onTarget = _a.onTarget, onCurrencyChange = _a.onCurrencyChange, onValueChange = _a.onValueChange;
|
|
70
70
|
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
|
|
71
|
+
var _u = (0, react_1.useState)(defaultAmount ? String(defaultAmount) : ''), baseCurrencyValue = _u[0], setBaseCurrencyValue = _u[1];
|
|
72
|
+
var _v = (0, react_1.useState)(baseCurrency), selectedCurrency = _v[0], setSelectedCurrency = _v[1];
|
|
73
|
+
var _w = (0, react_1.useState)(false), isDropdownFocused = _w[0], setIsDropdownFocused = _w[1];
|
|
74
|
+
var _x = (0, react_1.useState)(false), isInputFocused = _x[0], setIsInputFocused = _x[1];
|
|
75
|
+
var _y = (0, react_1.useState)(null), contextMenuSizeOffset = _y[0], setContextMenuSizeOffset = _y[1];
|
|
76
|
+
var _z = (0, react_1.useState)(null), dropdownPositionOffset = _z[0], setDropdownPositionOffset = _z[1];
|
|
77
|
+
/** 입력 시 천 단위 콤마 추가 함수 */
|
|
78
|
+
var addCommas = function (value) {
|
|
79
|
+
if (!value)
|
|
80
|
+
return '';
|
|
81
|
+
var parts = value.split('.');
|
|
82
|
+
var integerPart = parts[0];
|
|
83
|
+
var decimalPart = parts[1];
|
|
84
|
+
// 정수 부분에 콤마 추가
|
|
85
|
+
var formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
86
|
+
// 소수점이 있으면 합치기
|
|
87
|
+
return decimalPart !== undefined ? "".concat(formattedInteger, ".").concat(decimalPart) : formattedInteger;
|
|
88
|
+
};
|
|
89
|
+
var displayValue = (0, react_1.useMemo)(function () {
|
|
90
|
+
if (!baseCurrencyValue || baseCurrencyValue === '') {
|
|
91
|
+
return '';
|
|
92
|
+
}
|
|
93
|
+
if (selectedCurrency === baseCurrency) {
|
|
94
|
+
return isInputFocused
|
|
95
|
+
? addCommas(baseCurrencyValue)
|
|
96
|
+
: formatCurrency(Number(baseCurrencyValue), selectedCurrency, decimalPlaces);
|
|
97
|
+
}
|
|
98
|
+
var rate = exchangeRates[selectedCurrency] || 1;
|
|
99
|
+
var baseRate = exchangeRates[baseCurrency] || 1;
|
|
100
|
+
var convertedValue = (Number(baseCurrencyValue) / baseRate) * rate;
|
|
101
|
+
return formatCurrency(convertedValue, selectedCurrency, decimalPlaces);
|
|
102
|
+
}, [
|
|
103
|
+
baseCurrencyValue,
|
|
104
|
+
selectedCurrency,
|
|
105
|
+
baseCurrency,
|
|
106
|
+
exchangeRates,
|
|
107
|
+
decimalPlaces,
|
|
108
|
+
isInputFocused
|
|
109
|
+
]);
|
|
78
110
|
var contextMenuRef = (0, react_1.useRef)(null);
|
|
79
111
|
var dropdownRef = (0, react_1.useRef)(null);
|
|
80
|
-
var
|
|
112
|
+
var _0 = (0, react_hook_form_1.useFormContext)(), register = _0.register, trigger = _0.trigger, errors = _0.formState.errors, setValue = _0.setValue;
|
|
81
113
|
/** 기본 validation */
|
|
82
114
|
var defaultValidation = (0, react_1.useMemo)(function () {
|
|
83
115
|
var validationConfig = {};
|
|
@@ -192,30 +224,13 @@ function PriceTextField(_a) {
|
|
|
192
224
|
};
|
|
193
225
|
// 환율 계산된 값 계산 (항상 baseCurrency 기준으로)
|
|
194
226
|
var calculatedValue = (0, react_1.useMemo)(function () {
|
|
195
|
-
if (selectedCurrency === baseCurrency) {
|
|
227
|
+
if (!baseCurrencyValue || selectedCurrency === baseCurrency) {
|
|
196
228
|
return Number(baseCurrencyValue);
|
|
197
229
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
if (isInputFocused && selectedCurrency === baseCurrency) {
|
|
203
|
-
setDisplayValue(addCommas(baseCurrencyValue) || '');
|
|
204
|
-
}
|
|
205
|
-
else if (!baseCurrencyValue || baseCurrencyValue === '') {
|
|
206
|
-
setDisplayValue('');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
setDisplayValue(formatCurrency(calculatedValue, selectedCurrency, decimalPlaces));
|
|
210
|
-
}
|
|
211
|
-
}, [
|
|
212
|
-
baseCurrencyValue,
|
|
213
|
-
calculatedValue,
|
|
214
|
-
selectedCurrency,
|
|
215
|
-
isInputFocused,
|
|
216
|
-
baseCurrency,
|
|
217
|
-
decimalPlaces
|
|
218
|
-
]);
|
|
230
|
+
var rate = exchangeRates[selectedCurrency] || 1;
|
|
231
|
+
var baseRate = exchangeRates[baseCurrency] || 1;
|
|
232
|
+
return (Number(baseCurrencyValue) / baseRate) * rate;
|
|
233
|
+
}, [baseCurrencyValue, selectedCurrency, baseCurrency, exchangeRates]);
|
|
219
234
|
/** 드롭다운 위치 업데이트 */
|
|
220
235
|
(0, react_1.useEffect)(function () {
|
|
221
236
|
if (!isDropdownFocused && contextMenuRef.current) {
|
|
@@ -245,36 +260,16 @@ function PriceTextField(_a) {
|
|
|
245
260
|
}
|
|
246
261
|
return formatCurrency(calculatedValue || 0, selectedCurrency, decimalPlaces);
|
|
247
262
|
}, [baseCurrencyValue, calculatedValue, selectedCurrency, decimalPlaces]);
|
|
248
|
-
/** returnType에 따른 폼 값 */
|
|
249
|
-
var formValue = (0, react_1.useMemo)(function () {
|
|
250
|
-
if (!baseCurrencyValue || baseCurrencyValue === '') {
|
|
251
|
-
return '';
|
|
252
|
-
}
|
|
253
|
-
switch (returnType) {
|
|
254
|
-
case 'string':
|
|
255
|
-
return formattedValue;
|
|
256
|
-
case 'rawValue':
|
|
257
|
-
return baseCurrencyValue;
|
|
258
|
-
case 'object':
|
|
259
|
-
default:
|
|
260
|
-
return formattedValue;
|
|
261
|
-
}
|
|
262
|
-
}, [baseCurrencyValue, formattedValue, returnType]);
|
|
263
263
|
/** 폼 값 업데이트 */
|
|
264
264
|
(0, react_1.useEffect)(function () {
|
|
265
|
-
setValue(name,
|
|
266
|
-
}, [name, setValue,
|
|
265
|
+
setValue(name, baseCurrencyValue);
|
|
266
|
+
}, [name, setValue, baseCurrencyValue]);
|
|
267
267
|
/** onChange 콜백 처리 */
|
|
268
268
|
(0, react_1.useEffect)(function () {
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
if (!baseCurrencyValue || baseCurrencyValue === '') {
|
|
272
|
-
onChange('');
|
|
273
|
-
return;
|
|
269
|
+
if (onChange && baseCurrencyValue) {
|
|
270
|
+
onChange(baseCurrencyValue);
|
|
274
271
|
}
|
|
275
|
-
|
|
276
|
-
onChange(callbackValue);
|
|
277
|
-
}, [onChange, baseCurrencyValue, formattedValue, formValue, returnType]);
|
|
272
|
+
}, [onChange, baseCurrencyValue]);
|
|
278
273
|
/** onValueChange 콜백 처리 */
|
|
279
274
|
(0, react_1.useEffect)(function () {
|
|
280
275
|
if (!onValueChange)
|
|
@@ -289,18 +284,6 @@ function PriceTextField(_a) {
|
|
|
289
284
|
displayValue: formattedValue
|
|
290
285
|
});
|
|
291
286
|
}, [baseCurrencyValue, selectedCurrency, calculatedValue, formattedValue]);
|
|
292
|
-
/** 입력 시 천 단위 콤마 추가 함수 */
|
|
293
|
-
var addCommas = function (value) {
|
|
294
|
-
if (!value)
|
|
295
|
-
return '';
|
|
296
|
-
var parts = value.split('.');
|
|
297
|
-
var integerPart = parts[0];
|
|
298
|
-
var decimalPart = parts[1];
|
|
299
|
-
// 정수 부분에 콤마 추가
|
|
300
|
-
var formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
301
|
-
// 소수점이 있으면 합치기
|
|
302
|
-
return decimalPart !== undefined ? "".concat(formattedInteger, ".").concat(decimalPart) : formattedInteger;
|
|
303
|
-
};
|
|
304
287
|
var handleChange = function (e) {
|
|
305
288
|
var _a = e.target, value = _a.value, selectionStart = _a.selectionStart;
|
|
306
289
|
var prevValue = displayValue;
|
|
@@ -431,13 +414,13 @@ function PriceTextField(_a) {
|
|
|
431
414
|
};
|
|
432
415
|
var handleDelete = (0, react_1.useCallback)(function () {
|
|
433
416
|
setBaseCurrencyValue('');
|
|
434
|
-
setDisplayValue('');
|
|
435
417
|
setValue(name, '');
|
|
436
418
|
}, [name, setValue]);
|
|
437
419
|
return ((0, jsx_runtime_1.jsxs)(S_PriceTextField, __assign({ "x-pds-name": "PriceTextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", inputSize: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsxs)(S_ComponentBox, __assign({ inputSize: size, responsiveMode: responsiveMode, isFocused: isInputFocused, isError: Boolean(isError), state: state, customWidth: customWidth, isInputReadOnly: isInputReadOnly }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldBaseWrapper, __assign({ state: state, isError: Boolean(isError), isFocused: isInputFocused, inputSize: size, isInputReadOnly: isInputReadOnly }, { children: (0, jsx_runtime_1.jsx)(components_1.TextFieldBase, { name: name, hintText: hintText ||
|
|
438
420
|
t('str_channel_min_price', {
|
|
439
421
|
channelMinPrice: pricing_1.PricingService.format.price({
|
|
440
|
-
amount: minPriceAmount ||
|
|
422
|
+
amount: minPriceAmount ||
|
|
423
|
+
policy_1.DEFAULT_CURRENCY_PRICE_POLICIES[baseCurrency].minPayment.amount,
|
|
441
424
|
currency: baseCurrency
|
|
442
425
|
})
|
|
443
426
|
}), value: displayValue, textAlign: textAlign, validation: finalValidation, textLineType: "single", inputType: "text", inputMode: "decimal", preventBlankMode: "all", enterSubmitMode: "none", state: isInputReadOnly ? 'read_only' : state, colorTheme: colorTheme, textSize: "form2", textWeight: fontWeight === 'bold' ? 'bold' : 'normal', hintTextWeight: hintTextFontWeight === 'bold' ? 'bold' : 'normal', fieldPaddingRight: size === 'large' || size === 'rlarge' ? 12 : undefined, deleteIconMode: deleteBtnMode, deleteIconSize: size === 'large' || size === 'rlarge' ? 20 : 16, deleteIconColor: deleteIconColor, isFocused: isInputFocused, suffixTextRightSpacingMode: size === 'large' || size === 'rlarge' ? 'use' : 'none', onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onTarget: handleTarget, onDelete: handleDelete }) })), (0, jsx_runtime_1.jsx)(S_DropdownWrapper, __assign({ ref: dropdownRef, inputSize: size, onClick: handleDropdownClick, onBlur: handleDropdownBlur, tabIndex: 0, isFocused: isDropdownFocused, state: dropdownState, isError: Boolean(isError) }, { children: (0, jsx_runtime_1.jsxs)(S_Select, __assign({ inputSize: size }, { children: [useDotBadge === 'use' && selectedCurrency === baseCurrency && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(S_Badge, {}), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: selectedCurrency, styleTheme: "form2Bold", singleLineMode: "use", colorTheme: "sysTextPrimary", ellipsisMode: "use", customFontWeight: "bold", colorOverride: getDropdownTextColorKey(), lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" }), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isDropdownFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getArrowIconColorKey() })] })) }))] })), isDropdownFocused &&
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ScrollVisibleType } from '../../../common/styles/scroll/scrollbarStyle';
|
|
2
3
|
import type { PDSTextType } from '../../../common';
|
|
3
4
|
type MobileBasicModalProps = {
|
|
4
5
|
titleText: PDSTextType;
|
|
5
6
|
bodySpacingMode?: 'none' | 'use';
|
|
6
7
|
bodyOverflowType?: 'auto' | 'visible';
|
|
8
|
+
scrollVisibleType?: ScrollVisibleType;
|
|
7
9
|
contentText?: PDSTextType;
|
|
8
10
|
mBtnText: PDSTextType;
|
|
9
11
|
mBtnState?: 'normal' | 'disabled';
|
|
@@ -16,5 +18,5 @@ type MobileBasicModalProps = {
|
|
|
16
18
|
onClickXMarkIcon?: () => void;
|
|
17
19
|
children?: React.ReactNode;
|
|
18
20
|
};
|
|
19
|
-
declare function MobileBasicModal({ titleText, bodySpacingMode, bodyOverflowType, contentText, mBtnText, mBtnState, mBtnType, tBtnText, tBtnState, tBtnType, onClickMBtn, onClickTBtn, onClickXMarkIcon, children }: MobileBasicModalProps): import("react").ReactPortal;
|
|
21
|
+
declare function MobileBasicModal({ titleText, bodySpacingMode, bodyOverflowType, scrollVisibleType, contentText, mBtnText, mBtnState, mBtnType, tBtnText, tBtnState, tBtnType, onClickMBtn, onClickTBtn, onClickXMarkIcon, children }: MobileBasicModalProps): import("react").ReactPortal;
|
|
20
22
|
export default MobileBasicModal;
|