pds-dev-kit-web-test 2.7.0 → 2.7.2
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.
@@ -92,6 +92,10 @@ function LocalizedContentModal(_a) {
|
|
92
92
|
var form = (0, react_hook_form_1.useForm)({
|
93
93
|
defaultValues: initialValues
|
94
94
|
});
|
95
|
+
// 컴포넌트 내부에서
|
96
|
+
var watchedValues = (0, react_hook_form_1.useWatch)({
|
97
|
+
control: form.control
|
98
|
+
});
|
95
99
|
(0, react_1.useLayoutEffect)(function () {
|
96
100
|
if (isOpen && initialValues) {
|
97
101
|
form.reset(initialValues);
|
@@ -141,6 +145,9 @@ function LocalizedContentModal(_a) {
|
|
141
145
|
var handleCancel = function () {
|
142
146
|
onClose();
|
143
147
|
};
|
148
|
+
var handleDelete = function (code) {
|
149
|
+
form.setValue(code, '');
|
150
|
+
};
|
144
151
|
if (!isOpen)
|
145
152
|
return null;
|
146
153
|
return ((0, jsx_runtime_1.jsx)(DesktopBasicModal_1.DesktopBasicModal, __assign({ titleText: t('str_multilingual_settings'), btnMode: readonly ? 'mbtn_amount1' : 'mbtn_amount2', mBtn1Text: readonly ? t('str_confirm') : t('str_apply'), mBtn2Text: t('str_cancel'), size: size, onClickMBtn1: handleApply, onClickMBtn2: handleCancel }, { children: (0, jsx_runtime_1.jsxs)(react_hook_form_1.FormProvider, __assign({}, form, { children: [originalText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: t('str_original_text'), wordBreak: "keep_all", styleTheme: "subTitleBold", colorTheme: "sysTextPrimary" }), originalFieldType === 'text' && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: textFieldLineType === 'tinyeditor' ? ((0, jsx_runtime_1.jsx)(S_ReadonlyContent, { children: (0, jsx_runtime_1.jsx)(HTMLReader_1.HTMLReader, { data: originalText }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: originalText, wordBreak: "keep_all", styleTheme: "body2Regular", colorTheme: "sysTextPrimary" })] })) })), originalFieldType === 'image' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsx)(components_3.ImageView, __assign({ width: "responsive", height: "responsive" }, imageConfig, { src: 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" })] })), visibleLanguages === null || visibleLanguages === void 0 ? void 0 : visibleLanguages.map(function (languageCode, index) {
|
@@ -155,7 +162,7 @@ function LocalizedContentModal(_a) {
|
|
155
162
|
'link insertfile image media',
|
156
163
|
'undo redo',
|
157
164
|
'code'
|
158
|
-
] }))), textFieldLineType !== 'tinyeditor' && ((0, jsx_runtime_1.jsx)(components_1.TextField, { responsiveMode: "use", multiRows: textFieldLineType === 'multi' ? 5 : undefined, autoMaxRows: textFieldLineType === 'auto' ? 5 : undefined, autoMinRows: textFieldLineType === 'auto' ? 1 : undefined, name: languageCode, hintText: t('str_9071'), placeholder: "Input Text", textLineType: textFieldLineType, state: readonly ? 'disabled' : 'normal' }))] })), originalFieldType === 'image' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!readonly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsxs)(S_ImageUploadButtonWrapper, { children: [(0, jsx_runtime_1.jsx)(index_1.D_UploadMainButton, { text: t('str_upload'), styleTheme: "secondary", size: "small", accept: (imageConfig === null || imageConfig === void 0 ? void 0 : imageConfig.accept) || 'image/png, image/jpg, image/jpeg, image/gif', onClick: function (e) { return handleImageUpload(e, languageCode); } }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }), (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: t('str_delete'), styleTheme: "secondary", size: "small", state:
|
165
|
+
] }))), textFieldLineType !== 'tinyeditor' && ((0, jsx_runtime_1.jsx)(components_1.TextField, { responsiveMode: "use", multiRows: textFieldLineType === 'multi' ? 5 : undefined, autoMaxRows: textFieldLineType === 'auto' ? 5 : undefined, autoMinRows: textFieldLineType === 'auto' ? 1 : undefined, name: languageCode, hintText: t('str_9071'), placeholder: "Input Text", textLineType: textFieldLineType, state: readonly ? 'disabled' : 'normal' }))] })), originalFieldType === 'image' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!readonly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsxs)(S_ImageUploadButtonWrapper, { children: [(0, jsx_runtime_1.jsx)(index_1.D_UploadMainButton, { text: t('str_upload'), styleTheme: "secondary", size: "small", accept: (imageConfig === null || imageConfig === void 0 ? void 0 : imageConfig.accept) || 'image/png, image/jpg, image/jpeg, image/gif', onClick: function (e) { return handleImageUpload(e, languageCode); } }), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }), (0, jsx_runtime_1.jsx)(components_1.MainButton, { text: t('str_delete'), styleTheme: "secondary", size: "small", state: (watchedValues === null || watchedValues === void 0 ? void 0 : watchedValues[languageCode]) ? 'normal' : 'disabled', onClick: function () { return handleDelete(languageCode); } })] })] })), (watchedValues === null || watchedValues === void 0 ? void 0 : watchedValues[languageCode]) && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_d" }), (0, jsx_runtime_1.jsx)(components_3.ImageView, __assign({ width: "responsive", height: "responsive" }, imageConfig, { src: watchedValues === null || watchedValues === void 0 ? void 0 : watchedValues[languageCode] }))] })), (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" })] })), index < ((visibleLanguages === null || visibleLanguages === void 0 ? void 0 : visibleLanguages.length) || 0) - 1 && (0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_f" })] }, "".concat(languageCode, "_field")));
|
159
166
|
})] })) })));
|
160
167
|
}
|
161
168
|
var S_LanguageField = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
package/package.json
CHANGED
package/release-note.md
CHANGED