pds-dev-kit-web 2.2.67 → 2.2.68
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.
|
@@ -69,7 +69,10 @@ function TextField(_a) {
|
|
|
69
69
|
var _w = (0, react_1.useState)(false), isFocused = _w[0], setIsFocused = _w[1];
|
|
70
70
|
var _x = (0, react_hook_form_1.useFormContext)(), register = _x.register, trigger = _x.trigger, errors = _x.formState.errors;
|
|
71
71
|
var _y = register(name, validation), validateOnChange = _y.onChange, validateOnBlur = _y.onBlur;
|
|
72
|
-
var
|
|
72
|
+
var getErrorByName = function (errors, name) {
|
|
73
|
+
return name.split('.').reduce(function (errors, property) { return errors && errors[property]; }, errors);
|
|
74
|
+
};
|
|
75
|
+
var isError = getErrorByName(errors, name);
|
|
73
76
|
var handleClickIBtn1 = function () {
|
|
74
77
|
if (onClickIBtn1) {
|
|
75
78
|
onClickIBtn1();
|
|
@@ -155,7 +158,7 @@ function TextField(_a) {
|
|
|
155
158
|
}[colorTheme]), iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 }))] })] }));
|
|
156
159
|
}
|
|
157
160
|
};
|
|
158
|
-
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "desktop", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: isError, state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: errors[name].message })))] })));
|
|
161
|
+
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "desktop", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: Boolean(isError), state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: errors[name].message })))] })));
|
|
159
162
|
}
|
|
160
163
|
var S_TextFieldBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
|
|
161
164
|
var size = _a.size;
|
|
@@ -69,7 +69,10 @@ function TextField(_a) {
|
|
|
69
69
|
var _w = (0, react_1.useState)(false), isFocused = _w[0], setIsFocused = _w[1];
|
|
70
70
|
var _x = (0, react_hook_form_1.useFormContext)(), register = _x.register, trigger = _x.trigger, errors = _x.formState.errors;
|
|
71
71
|
var _y = register(name, validation), validateOnChange = _y.onChange, validateOnBlur = _y.onBlur;
|
|
72
|
-
var
|
|
72
|
+
var getErrorByName = function (errors, name) {
|
|
73
|
+
return name.split('.').reduce(function (errors, property) { return errors && errors[property]; }, errors);
|
|
74
|
+
};
|
|
75
|
+
var isError = getErrorByName(errors, name);
|
|
73
76
|
var handleClickIBtn1 = function () {
|
|
74
77
|
if (onClickIBtn1) {
|
|
75
78
|
onClickIBtn1();
|
|
@@ -155,7 +158,7 @@ function TextField(_a) {
|
|
|
155
158
|
}[colorTheme]), iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 }))] })] }));
|
|
156
159
|
}
|
|
157
160
|
};
|
|
158
|
-
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: isError, state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: errors[name].message })))] })));
|
|
161
|
+
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: Boolean(isError), state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: errors[name].message })))] })));
|
|
159
162
|
}
|
|
160
163
|
var S_TextFieldBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
|
|
161
164
|
var size = _a.size;
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
# PDS-DEV-KIT-WEB Release Notes
|
|
2
|
-
## [v2.2.
|
|
2
|
+
## [v2.2.68]
|
|
3
3
|
## daily|https://design.storybook.publ.biz/
|
|
4
4
|
|
|
5
5
|
### sub
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
ic_typeface_blackletter_20
|
|
9
|
-
ic_typeface_deco_20
|
|
10
|
-
ic_typeface_round_20
|
|
11
|
-
ic_typeface_script_20
|
|
12
|
-
ic_typeface_slab_20
|
|
13
|
-
ic_typeface_symbol_20
|
|
14
|
-
ic_recent
|
|
15
|
-
ic_logo_sandoll
|
|
16
|
-
* 기존 것 업데이트
|
|
17
|
-
ic_typeface_system
|
|
18
|
-
ic_logo_google
|
|
6
|
+
* components > TextField
|
|
7
|
+
* TextField 에러 조건 고침
|