pds-dev-kit-web 2.2.114 → 2.2.115

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.
@@ -1,3 +1,9 @@
1
1
  export interface IFormValues {
2
2
  [key: string]: string;
3
3
  }
4
+ /**
5
+ * 중첩된 객체 구조에서 점(.)으로 구분된 경로를 통해 에러 객체를 조회합니다
6
+ */
7
+ export declare const getErrorByName: (errors: {
8
+ [x: string]: any;
9
+ }, name: string) => any;
@@ -1,2 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getErrorByName = void 0;
4
+ /**
5
+ * 중첩된 객체 구조에서 점(.)으로 구분된 경로를 통해 에러 객체를 조회합니다
6
+ */
7
+ var getErrorByName = function (errors, name) {
8
+ return name.split('.').reduce(function (errors, property) { return errors && errors[property]; }, errors);
9
+ };
10
+ exports.getErrorByName = getErrorByName;
@@ -42,6 +42,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
42
42
  /* eslint-disable react/jsx-no-bind */
43
43
  var react_1 = require("react");
44
44
  var react_hook_form_1 = require("react-hook-form");
45
+ var types_1 = require("../../../common/types");
45
46
  var styled_components_1 = __importStar(require("styled-components"));
46
47
  var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
47
48
  var hybrid_1 = require("../../../hybrid");
@@ -69,10 +70,7 @@ function TextField(_a) {
69
70
  var _w = (0, react_1.useState)(false), isFocused = _w[0], setIsFocused = _w[1];
70
71
  var _x = (0, react_hook_form_1.useFormContext)(), register = _x.register, trigger = _x.trigger, errors = _x.formState.errors;
71
72
  var _y = register(name, validation), validateOnChange = _y.onChange, validateOnBlur = _y.onBlur;
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
+ var isError = (0, types_1.getErrorByName)(errors, name);
76
74
  var handleClickIBtn1 = function () {
77
75
  if (onClickIBtn1) {
78
76
  onClickIBtn1();
@@ -158,7 +156,7 @@ function TextField(_a) {
158
156
  }[colorTheme]), iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 }))] })] }));
159
157
  }
160
158
  };
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
+ 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 = (0, types_1.getErrorByName)(errors, name)) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: (0, types_1.getErrorByName)(errors, name).message })))] })));
162
160
  }
163
161
  var S_TextFieldBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
164
162
  var size = _a.size;
@@ -42,6 +42,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
42
42
  /* eslint-disable react/jsx-no-bind */
43
43
  var react_1 = require("react");
44
44
  var react_hook_form_1 = require("react-hook-form");
45
+ var types_1 = require("../../../common/types");
45
46
  var styled_components_1 = __importStar(require("styled-components"));
46
47
  var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
47
48
  var hybrid_1 = require("../../../hybrid");
@@ -69,10 +70,7 @@ function TextField(_a) {
69
70
  var _w = (0, react_1.useState)(false), isFocused = _w[0], setIsFocused = _w[1];
70
71
  var _x = (0, react_hook_form_1.useFormContext)(), register = _x.register, trigger = _x.trigger, errors = _x.formState.errors;
71
72
  var _y = register(name, validation), validateOnChange = _y.onChange, validateOnBlur = _y.onBlur;
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
+ var isError = (0, types_1.getErrorByName)(errors, name);
76
74
  var handleClickIBtn1 = function () {
77
75
  if (onClickIBtn1) {
78
76
  onClickIBtn1();
@@ -158,7 +156,7 @@ function TextField(_a) {
158
156
  }[colorTheme]), iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 }))] })] }));
159
157
  }
160
158
  };
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
+ 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 = (0, types_1.getErrorByName)(errors, name)) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: (0, types_1.getErrorByName)(errors, name).message })))] })));
162
160
  }
163
161
  var S_TextFieldBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
164
162
  var size = _a.size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.114",
3
+ "version": "2.2.115",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.114]
2
+ ## [v2.2.115]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * [CHORE] pipeline에서 sourcemap 제거와 메모리 옵션 구문 수정
7
- * postcss-styled-components 추가
6
+ * [PDS-1262] TextField name prop 버그 수정