pds-dev-kit-web-test 2.5.496 → 2.5.498

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.
@@ -3,3 +3,4 @@ export * from './styled-components';
3
3
  export * from './text';
4
4
  export * from './uiColors';
5
5
  export * from './components';
6
+ export * from './multilingual';
@@ -19,3 +19,4 @@ __exportStar(require("./styled-components"), exports);
19
19
  __exportStar(require("./text"), exports);
20
20
  __exportStar(require("./uiColors"), exports);
21
21
  __exportStar(require("./components"), exports);
22
+ __exportStar(require("./multilingual"), exports);
@@ -0,0 +1,16 @@
1
+ type LanguageCode = 'en' | 'ko' | 'ja' | 'zh' | 'zh-Hant' | 'fr' | 'de' | 'es' | 'it' | 'pt' | 'ru' | 'vi' | 'th' | 'id' | 'ms' | 'ar' | 'tr' | 'pl' | 'nl' | 'sv' | 'fi' | 'no' | 'da' | 'he' | 'hi' | 'bn' | 'ta' | 'el' | 'cs' | 'ro';
2
+ type MultilingualConfig = {
3
+ textFieldLineType?: 'single' | 'multi' | 'auto' | 'tinyeditor';
4
+ originalText?: string;
5
+ initialValues?: {
6
+ [key in LanguageCode]?: string;
7
+ };
8
+ visibleLanguages?: LanguageCode[];
9
+ readonlyLanguages?: LanguageCode[];
10
+ hiddenInputId: string;
11
+ onApply?: (values: {
12
+ [key in LanguageCode]?: string;
13
+ }) => void;
14
+ onTinyEditorAction?: () => void;
15
+ };
16
+ export type { LanguageCode, MultilingualConfig };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { PDSTextType } from '../../../common/types';
3
- type LanguageCode = 'en' | 'ko' | 'ja' | 'zh' | 'zh-Hant' | 'fr' | 'de' | 'es' | 'it' | 'pt' | 'ru' | 'vi' | 'th' | 'id' | 'ms' | 'ar' | 'tr' | 'pl' | 'nl' | 'sv' | 'fi' | 'no' | 'da' | 'he' | 'hi' | 'bn' | 'ta' | 'el' | 'cs' | 'ro';
4
- type MultilingualConfig = {
5
- textFieldLineType?: 'single' | 'multi' | 'auto';
6
- originalText?: string;
7
- initialValues?: {
8
- [key in LanguageCode]?: string;
9
- };
10
- visibleLanguages?: LanguageCode[];
11
- readonlyLanguages?: LanguageCode[];
12
- hiddenInputId: string;
13
- onApply?: (values: {
14
- [key in LanguageCode]?: string;
15
- }) => void;
16
- };
2
+ import type { PDSTextType, MultilingualConfig } from '../../../common/types';
17
3
  type BasicFormGroupProps = {
18
4
  titleStyleTheme?: 'headingBold' | 'leadParaBold' | 'subTitleBold';
19
5
  titleText?: PDSTextType;
@@ -27,4 +13,3 @@ type BasicFormGroupProps = {
27
13
  };
28
14
  declare function BasicFormGroup({ titleStyleTheme, titleText, descText, captionText, inputForm, titleRequirementMode, multilingualBtnMode, multilingualBtnState, multilingualConfig }: BasicFormGroupProps): JSX.Element;
29
15
  export default BasicFormGroup;
30
- export type { LanguageCode, MultilingualConfig };
@@ -21,7 +21,7 @@ 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 components_1 = require("../../components");
24
- var panels_1 = require("../../panels");
24
+ var MultilingualModal_1 = __importDefault(require("../../panels/MultilingualModal"));
25
25
  var components_2 = require("../../../hybrid/components");
26
26
  var styled_components_1 = __importDefault(require("styled-components"));
27
27
  function BasicFormGroup(_a) {
@@ -52,6 +52,13 @@ function BasicFormGroup(_a) {
52
52
  checkMultilingualValues();
53
53
  }, [hiddenInputValue]);
54
54
  var handleLanguageButtonClick = function () {
55
+ // TinyEditor 모드일 때는 모달을 열지 않고 onTinyEditorAction 실행
56
+ if ((multilingualConfig === null || multilingualConfig === void 0 ? void 0 : multilingualConfig.textFieldLineType) === 'tinyeditor') {
57
+ if (multilingualConfig.onTinyEditorAction) {
58
+ multilingualConfig.onTinyEditorAction();
59
+ }
60
+ return;
61
+ }
55
62
  setIsMultiLanguageModalOpen(true);
56
63
  };
57
64
  var handleLanguageModalClose = function () {
@@ -61,8 +68,8 @@ function BasicFormGroup(_a) {
61
68
  setHiddenInputValue(newValue);
62
69
  };
63
70
  return ((0, jsx_runtime_1.jsxs)("div", __assign({ "x-pds-name": "BasicFormGroup", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: [titleText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(S_TitleTextWrapper, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: titleText, styleTheme: titleStyleTheme, colorTheme: "sysTextPrimary" }), titleRequirementMode === 'use' && ((0, jsx_runtime_1.jsx)(S_IconWrapper, { children: (0, jsx_runtime_1.jsx)(components_2.Icon, { iconName: "ic_requirement", size: 16, fillType: "line", colorKey: "ui_cpnt_icon_sys_error_01" }) })), multilingualBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(S_MultilingualButtonWrapper, { children: (0, jsx_runtime_1.jsx)(components_1.IconButton, { iconFillType: "line", iconName: "ic_translate", baseSize: "small", shapeType: "round", baseColorKey: "ui_cpnt_button_icon_default", iconColorKey: hasMultilingualValues
64
- ? 'ui_cpnt_button_fill_base_primary'
65
- : 'ui_cpnt_button_fill_base_disabled', state: multilingualBtnState, onClick: multilingualBtnState === 'normal' ? handleLanguageButtonClick : undefined }) }))] }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b" })] })), multilingualBtnMode === 'use' && multilingualConfig && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: "hiddenInput_".concat(multilingualConfig.hiddenInputId), name: multilingualConfig.hiddenInputId, value: hiddenInputValue, readOnly: true }), (0, jsx_runtime_1.jsx)(panels_1.MultilingualModal, { isOpen: isMultiLanguageModalOpen, onClose: handleLanguageModalClose, config: multilingualConfig, onHiddenInputUpdate: handleHiddenInputUpdate })] })), descText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: descText, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" })] })), inputForm, captionText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: captionText, styleTheme: "caption1Regular", colorTheme: "sysTextPrimary" })] }))] })));
71
+ ? 'ui_cpnt_button_icon_primary'
72
+ : 'ui_cpnt_button_icon_disabled', state: multilingualBtnState, onClick: multilingualBtnState === 'normal' ? handleLanguageButtonClick : undefined }) }))] }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b" })] })), multilingualBtnMode === 'use' && multilingualConfig && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: "hiddenInput_".concat(multilingualConfig.hiddenInputId), name: multilingualConfig.hiddenInputId, value: hiddenInputValue, readOnly: true }), (0, jsx_runtime_1.jsx)(MultilingualModal_1.default, { isOpen: isMultiLanguageModalOpen, onClose: handleLanguageModalClose, config: multilingualConfig, onHiddenInputUpdate: handleHiddenInputUpdate })] })), descText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: descText, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" })] })), inputForm, captionText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: captionText, styleTheme: "caption1Regular", colorTheme: "sysTextPrimary" })] }))] })));
66
73
  }
67
74
  var S_TitleTextWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n"], ["\n align-items: center;\n display: flex;\n"])));
68
75
  var S_IconWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 100%;\n height: 16px;\n justify-content: center;\n padding: 0 ", ";\n width: 16px;\n"], ["\n align-items: center;\n display: flex;\n height: 100%;\n height: 16px;\n justify-content: center;\n padding: 0 ", ";\n width: 16px;\n"])), function (_a) {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { MultilingualConfig } from '../../components/BasicFormGroup/BasicFormGroup';
2
+ import type { MultilingualConfig } from '../../../common/types';
3
3
  type MultilingualModalModalProps = {
4
4
  isOpen: boolean;
5
5
  onClose: () => void;
@@ -103,7 +103,6 @@ function MultilingualModal(_a) {
103
103
  hiddenInput.dispatchEvent(event_1);
104
104
  }
105
105
  }
106
- // onApply 콜백이 있으면 호출
107
106
  if (config === null || config === void 0 ? void 0 : config.onApply) {
108
107
  config.onApply(formValues);
109
108
  }
@@ -117,7 +116,7 @@ function MultilingualModal(_a) {
117
116
  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('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" })] })), (_b = config === null || config === void 0 ? void 0 : config.visibleLanguages) === null || _b === void 0 ? void 0 : _b.map(function (languageCode, index) {
118
117
  var _a, _b;
119
118
  var isReadonly = (_a = config.readonlyLanguages) === null || _a === void 0 ? void 0 : _a.includes(languageCode);
120
- return ((0, jsx_runtime_1.jsxs)(S_LanguageField, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: "".concat(t(LANGUAGE_I18N_KEYS[languageCode]), " (").concat(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", name: languageCode, hintText: t('str_9071'), placeholder: "Input Text", textLineType: config.textFieldLineType || 'single', 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")));
119
+ return ((0, jsx_runtime_1.jsxs)(S_LanguageField, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: "".concat(t(LANGUAGE_I18N_KEYS[languageCode]), " (").concat(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
120
  })] }), (0, jsx_runtime_1.jsxs)(S_Footer, { children: [(0, jsx_runtime_1.jsx)(S_Left, {}), (0, jsx_runtime_1.jsxs)(S_Right, { children: [(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: t('str_apply'), size: "medium", onClick: handleConfirm })] })] })] }))] })), container);
122
121
  }
123
122
  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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.496",
3
+ "version": "2.5.498",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",