react-validate-component 0.1.1 → 0.1.3

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.
@@ -27,23 +27,23 @@ function styleInject(css, ref) {
27
27
  }
28
28
  }
29
29
 
30
- var css_248z = ".index-module_invalid__gHKsE {\r\n border: 2px solid red;\r\n}\r\n\r\n/* 유효성 메시지 locate */\r\n.index-module_vinput__tFGFH {\r\n display: flex;\r\n}\r\n.index-module_vinput-top-left__2g8Bq {\r\n flex-direction: column-reverse;\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-top__ZTh6H {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-top-right__t6K-Q {\r\n flex-direction: column-reverse;\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-center-left__vJn0s {\r\n flex-direction: row-reverse;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-center-right__HDgip {\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom-left__xxaiT {\r\n flex-direction: column;\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom__nCOAf {\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom-right__6AjOE {\r\n flex-direction: column;\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage__rihga {\r\n position: absolute;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 2px 5px;\r\n display: flex;\r\n}\r\n.index-module_innerMessage-top-left__HLoYg {\r\n align-items: flex-start;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-top__ouYW6 {\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-top-right__7tMC8 {\r\n align-items: flex-start;\r\n justify-content: flex-end;\r\n}\r\n.index-module_innerMessage-center-left__4iZyl {\r\n align-items: center;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-center__U2006 {\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-center-right__Pg2oU {\r\n align-items: center;\r\n justify-content: flex-end;\r\n}\r\n.index-module_innerMessage-bottom-left__1QDIv {\r\n align-items: flex-end;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-bottom__gMogT {\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-bottom-right__peBq- {\r\n align-items: flex-end;\r\n justify-content: flex-end;\r\n}\r\n\r\n.index-module_animateMessage__Gxf3M {\r\n animation: index-module_fade-in__GxKz8 1s ease-in-out;\r\n}\r\n\r\n@keyframes index-module_fade-in__GxKz8 {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 1;\r\n }\r\n}\r\n";
31
- var styles = {"invalid":"index-module_invalid__gHKsE","vinput":"index-module_vinput__tFGFH","vinput-top-left":"index-module_vinput-top-left__2g8Bq","vinput-top":"index-module_vinput-top__ZTh6H","vinput-top-right":"index-module_vinput-top-right__t6K-Q","vinput-center-left":"index-module_vinput-center-left__vJn0s","vinput-center-right":"index-module_vinput-center-right__HDgip","vinput-bottom-left":"index-module_vinput-bottom-left__xxaiT","vinput-bottom":"index-module_vinput-bottom__nCOAf","vinput-bottom-right":"index-module_vinput-bottom-right__6AjOE","innerMessage":"index-module_innerMessage__rihga","innerMessage-top-left":"index-module_innerMessage-top-left__HLoYg","innerMessage-top":"index-module_innerMessage-top__ouYW6","innerMessage-top-right":"index-module_innerMessage-top-right__7tMC8","innerMessage-center-left":"index-module_innerMessage-center-left__4iZyl","innerMessage-center":"index-module_innerMessage-center__U2006","innerMessage-center-right":"index-module_innerMessage-center-right__Pg2oU","innerMessage-bottom-left":"index-module_innerMessage-bottom-left__1QDIv","innerMessage-bottom":"index-module_innerMessage-bottom__gMogT","innerMessage-bottom-right":"index-module_innerMessage-bottom-right__peBq-","animateMessage":"index-module_animateMessage__Gxf3M","fade-in":"index-module_fade-in__GxKz8"};
30
+ var css_248z = ".index-module_invalid__iPosr {\r\n border: 2px solid red;\r\n outline: none;\r\n}\r\n.index-module_invalid__iPosr:focus,\r\n.index-module_invalid__iPosr:focus-visible,\r\n.index-module_invalid__iPosr:focus-within {\r\n border: 2px solid red;\r\n}\r\n\r\n/* vType === 'outer' */\r\n.index-module_vinput__Xz53v {\r\n display: flex;\r\n}\r\n.index-module_vinput-top-left__UFNRe {\r\n flex-direction: column-reverse;\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-top__Gor3M {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-top-right__wexyT {\r\n flex-direction: column-reverse;\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-center-left__oTbXC {\r\n flex-direction: row-reverse;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-center-right__wz--8 {\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom-left__9gm8q {\r\n flex-direction: column;\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom__bxp6x {\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_vinput-bottom-right__ihiB0 {\r\n flex-direction: column;\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n\r\n/* vType === 'inner' */\r\n.index-module_innerMessage__cnS6N {\r\n position: absolute;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 2px 5px;\r\n display: flex;\r\n}\r\n.index-module_innerMessage-top-left__3804h {\r\n align-items: flex-start;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-top__MRmrS {\r\n align-items: flex-start;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-top-right__4ejsZ {\r\n align-items: flex-start;\r\n justify-content: flex-end;\r\n}\r\n.index-module_innerMessage-center-left__t2SwR {\r\n align-items: center;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-center__gT4X6 {\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-center-right__FzHy2 {\r\n align-items: center;\r\n justify-content: flex-end;\r\n}\r\n.index-module_innerMessage-bottom-left__gI2z5 {\r\n align-items: flex-end;\r\n justify-content: flex-start;\r\n}\r\n.index-module_innerMessage-bottom__Zb48i {\r\n align-items: flex-end;\r\n justify-content: center;\r\n}\r\n.index-module_innerMessage-bottom-right__OlaLD {\r\n align-items: flex-end;\r\n justify-content: flex-end;\r\n}\r\n\r\n/* vType === 'tooltip' */\r\n.index-module_tooltipMessage__BG3C0 {\r\n position: absolute;\r\n margin: 0;\r\n padding: 10px 20px;\r\n border: 1px solid transparent;\r\n border-radius: 10px;\r\n background-color: black;\r\n}\r\np[class*='tooltipMessage-top'] {\r\n transform: translateY(calc(-100% - 10px));\r\n}\r\np[class*='tooltipMessage-top']::after {\r\n content: '';\r\n position: absolute;\r\n bottom: 0;\r\n border: 10px solid transparent;\r\n border-top-color: black;\r\n border-bottom: 0;\r\n margin-bottom: -11px;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-top-left__EExDe {\r\n justify-content: flex-start;\r\n}\r\np.index-module_tooltipMessage-top-left__EExDe::after {\r\n left: 3%;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-top__L7c5- {\r\n justify-content: center;\r\n}\r\np.index-module_tooltipMessage-top__L7c5-::after {\r\n left: 44%;\r\n}\r\n.index-module_tooltipMessage-top-right__iVHO9 {\r\n justify-content: flex-end;\r\n}\r\np.index-module_tooltipMessage-top-right__iVHO9::after {\r\n left: 87%;\r\n}\r\np[class*='tooltipMessage-center'] {\r\n /* transform: translateY(calc(-100% - 10px)); */\r\n}\r\np[class*='tooltipMessage-center']::after {\r\n content: '';\r\n position: absolute;\r\n border: 10px solid transparent;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-center-right__nL7jv {\r\n justify-content: flex-end;\r\n}\r\np.index-module_tooltipMessage-center-right__nL7jv {\r\n transform: translateX(calc(100% + 10px));\r\n}\r\np.index-module_tooltipMessage-center-right__nL7jv::after {\r\n border-right-color: black;\r\n left: -10%;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-center-left__C2dwc {\r\n justify-content: flex-start;\r\n}\r\np.index-module_tooltipMessage-center-left__C2dwc {\r\n transform: translateX(calc(-100% - 10px));\r\n}\r\np.index-module_tooltipMessage-center-left__C2dwc::after {\r\n border-left-color: black;\r\n left: 100%;\r\n}\r\n\r\np[class*='tooltipMessage-bottom'] {\r\n transform: translateY(calc(120% + 10px));\r\n}\r\np[class*='tooltipMessage-bottom']::after {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n border: 10px solid transparent;\r\n border-bottom-color: black;\r\n border-top: 0;\r\n margin-top: -11px;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-bottom-left__G4dRB {\r\n justify-content: flex-start;\r\n}\r\np.index-module_tooltipMessage-bottom-left__G4dRB::after {\r\n left: 3%;\r\n}\r\n.index-module_vinput__Xz53v.index-module_tooltipMessage-bottom__O5fIQ {\r\n justify-content: center;\r\n}\r\np.index-module_tooltipMessage-bottom__O5fIQ::after {\r\n left: 44%;\r\n}\r\n.index-module_tooltipMessage-bottom-right__ACA9z {\r\n justify-content: flex-end;\r\n}\r\np.index-module_tooltipMessage-bottom-right__ACA9z::after {\r\n left: 87%;\r\n}\r\n\r\n.index-module_animateMessage__2Xq3T {\r\n animation: index-module_fade-in__Xcu-Q 1s ease-in-out;\r\n}\r\n\r\n@keyframes index-module_fade-in__Xcu-Q {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 1;\r\n }\r\n}\r\n";
31
+ var styles = {"invalid":"index-module_invalid__iPosr","vinput":"index-module_vinput__Xz53v","vinput-top-left":"index-module_vinput-top-left__UFNRe","vinput-top":"index-module_vinput-top__Gor3M","vinput-top-right":"index-module_vinput-top-right__wexyT","vinput-center-left":"index-module_vinput-center-left__oTbXC","vinput-center-right":"index-module_vinput-center-right__wz--8","vinput-bottom-left":"index-module_vinput-bottom-left__9gm8q","vinput-bottom":"index-module_vinput-bottom__bxp6x","vinput-bottom-right":"index-module_vinput-bottom-right__ihiB0","innerMessage":"index-module_innerMessage__cnS6N","innerMessage-top-left":"index-module_innerMessage-top-left__3804h","innerMessage-top":"index-module_innerMessage-top__MRmrS","innerMessage-top-right":"index-module_innerMessage-top-right__4ejsZ","innerMessage-center-left":"index-module_innerMessage-center-left__t2SwR","innerMessage-center":"index-module_innerMessage-center__gT4X6","innerMessage-center-right":"index-module_innerMessage-center-right__FzHy2","innerMessage-bottom-left":"index-module_innerMessage-bottom-left__gI2z5","innerMessage-bottom":"index-module_innerMessage-bottom__Zb48i","innerMessage-bottom-right":"index-module_innerMessage-bottom-right__OlaLD","tooltipMessage":"index-module_tooltipMessage__BG3C0","tooltipMessage-top-left":"index-module_tooltipMessage-top-left__EExDe","tooltipMessage-top":"index-module_tooltipMessage-top__L7c5-","tooltipMessage-top-right":"index-module_tooltipMessage-top-right__iVHO9","tooltipMessage-center-right":"index-module_tooltipMessage-center-right__nL7jv","tooltipMessage-center-left":"index-module_tooltipMessage-center-left__C2dwc","tooltipMessage-bottom-left":"index-module_tooltipMessage-bottom-left__G4dRB","tooltipMessage-bottom":"index-module_tooltipMessage-bottom__O5fIQ","tooltipMessage-bottom-right":"index-module_tooltipMessage-bottom-right__ACA9z","animateMessage":"index-module_animateMessage__2Xq3T","fade-in":"index-module_fade-in__Xcu-Q"};
32
32
  styleInject(css_248z);
33
33
 
34
34
  // Text
35
- var VText = function VText(_ref) {
36
- var _props$defaultValue;
35
+ function VText(_ref) {
36
+ var _props$defaultValue, _props$defaultValue2, _props$defaultValue3;
37
37
  var _ref$vState = _ref.vState,
38
38
  vState = _ref$vState === void 0 ? false : _ref$vState,
39
+ _ref$vType = _ref.vType,
40
+ vType = _ref$vType === void 0 ? 'outer' : _ref$vType,
39
41
  _ref$vClassName = _ref.vClassName,
40
42
  vClassName = _ref$vClassName === void 0 ? '' : _ref$vClassName,
41
43
  _ref$vShowMessage = _ref.vShowMessage,
42
44
  vShowMessage = _ref$vShowMessage === void 0 ? false : _ref$vShowMessage,
43
45
  _ref$vMessage = _ref.vMessage,
44
46
  vMessage = _ref$vMessage === void 0 ? '' : _ref$vMessage,
45
- _ref$vIsInnerMessage = _ref.vIsInnerMessage,
46
- vIsInnerMessage = _ref$vIsInnerMessage === void 0 ? false : _ref$vIsInnerMessage,
47
47
  _ref$vLocateMessage = _ref.vLocateMessage,
48
48
  vLocateMessage = _ref$vLocateMessage === void 0 ? 'bottom' : _ref$vLocateMessage,
49
49
  _ref$vMessageClass = _ref.vMessageClass,
@@ -52,60 +52,86 @@ var VText = function VText(_ref) {
52
52
  vIsAnimate = _ref$vIsAnimate === void 0 ? false : _ref$vIsAnimate,
53
53
  _ref$props = _ref.props,
54
54
  props = _ref$props === void 0 ? {} : _ref$props;
55
- var Result = React.createElement("div", {
56
- className: styles.vinput + " " + styles["vinput-" + vLocateMessage]
57
- }, React.createElement("input", Object.assign({
58
- type: "text"
59
- }, props, {
60
- defaultValue: (_props$defaultValue = props == null ? void 0 : props.defaultValue) != null ? _props$defaultValue : '',
61
- className: (props == null ? void 0 : props.className) + " " + (vState ? vClassName || styles.invalid : '')
62
- })), vState && vShowMessage ? React.createElement("p", {
63
- className: vMessageClass + " " + (vIsInnerMessage ? (props == null ? void 0 : props.className) + " " + styles.innerMessage + " " + styles["innerMessage-" + vLocateMessage] : '') + " " + (vIsAnimate ? styles.animateMessage : '')
64
- }, vMessage) : null);
65
- return Result;
66
- };
67
- // Checkbox
68
- var VCheckbox = function VCheckbox() {
69
- return React.createElement("input", {
55
+ switch (vType) {
56
+ case 'outer':
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ className: styles.vinput + " " + styles["vinput-" + vLocateMessage]
59
+ }, /*#__PURE__*/React.createElement("input", Object.assign({
60
+ type: "text"
61
+ }, props, {
62
+ defaultValue: (_props$defaultValue = props == null ? void 0 : props.defaultValue) != null ? _props$defaultValue : '',
63
+ className: (props == null ? void 0 : props.className) + " " + (vState ? vClassName || styles.invalid : '')
64
+ })), vState && vShowMessage ? ( /*#__PURE__*/React.createElement("p", {
65
+ className: vMessageClass + " " + (vIsAnimate ? styles.animateMessage : '')
66
+ }, vMessage)) : null);
67
+ case 'inner':
68
+ return /*#__PURE__*/React.createElement("div", {
69
+ className: styles.vinput
70
+ }, /*#__PURE__*/React.createElement("input", Object.assign({
71
+ type: "text"
72
+ }, props, {
73
+ defaultValue: (_props$defaultValue2 = props == null ? void 0 : props.defaultValue) != null ? _props$defaultValue2 : '',
74
+ className: (props == null ? void 0 : props.className) + " " + (vState ? vClassName || styles.invalid : '')
75
+ })), vState && vShowMessage ? ( /*#__PURE__*/React.createElement("p", {
76
+ className: vMessageClass + " " + styles.innerMessage + " " + styles["innerMessage-" + vLocateMessage] + " " + (vIsAnimate ? styles.animateMessage : '')
77
+ }, vMessage)) : null);
78
+ case 'tooltip':
79
+ return /*#__PURE__*/React.createElement("div", {
80
+ className: styles.vinput + " " + styles["tooltipMessage-" + vLocateMessage]
81
+ }, /*#__PURE__*/React.createElement("input", Object.assign({
82
+ type: "text"
83
+ }, props, {
84
+ defaultValue: (_props$defaultValue3 = props == null ? void 0 : props.defaultValue) != null ? _props$defaultValue3 : '',
85
+ className: (props == null ? void 0 : props.className) + " " + (vState ? vClassName || styles.invalid : '')
86
+ })), vState && vShowMessage ? ( /*#__PURE__*/React.createElement("p", {
87
+ className: vMessageClass + " " + styles.tooltipMessage + " " + styles["tooltipMessage-" + vLocateMessage] + " " + (vIsAnimate ? styles.animateMessage : '')
88
+ }, vMessage)) : null);
89
+ default:
90
+ return /*#__PURE__*/React.createElement("div", null);
91
+ }
92
+ }
93
+
94
+ function VCheckbox() {
95
+ return /*#__PURE__*/React.createElement("input", {
70
96
  type: "checkbox"
71
97
  });
72
- };
73
- // Radio
74
- var VRadio = function VRadio() {
75
- return React.createElement("input", {
76
- type: "radio"
98
+ }
99
+
100
+ function vColor() {
101
+ return /*#__PURE__*/React.createElement("input", {
102
+ type: "color"
77
103
  });
78
- };
79
- // Date
80
- var VDate = function VDate() {
81
- return React.createElement("input", {
104
+ }
105
+
106
+ function vDate() {
107
+ return /*#__PURE__*/React.createElement("input", {
82
108
  type: "date"
83
109
  });
84
- };
85
- // Color
86
- var VColor = function VColor() {
87
- return React.createElement("input", {
88
- type: "color"
89
- });
90
- };
91
- // Email
92
- var VEmail = function VEmail() {
93
- return React.createElement("input", {
110
+ }
111
+
112
+ function vEmail() {
113
+ return /*#__PURE__*/React.createElement("input", {
94
114
  type: "email"
95
115
  });
96
- };
97
- // Range
98
- var VRange = function VRange() {
99
- return React.createElement("input", {
116
+ }
117
+
118
+ function vRadio() {
119
+ return /*#__PURE__*/React.createElement("input", {
120
+ type: "radio"
121
+ });
122
+ }
123
+
124
+ function vRange() {
125
+ return /*#__PURE__*/React.createElement("input", {
100
126
  type: "range"
101
127
  });
102
- };
103
- // Url
104
- var VUrl = function VUrl() {
105
- return React.createElement("input", {
128
+ }
129
+
130
+ function vURL() {
131
+ return /*#__PURE__*/React.createElement("input", {
106
132
  type: "url"
107
133
  });
108
- };
134
+ }
109
135
 
110
- export { VCheckbox, VColor, VDate, VEmail, VRadio, VRange, VText, VUrl };
136
+ export { VCheckbox, VText, vColor, vDate, vEmail, vRadio, vRange, vURL };
111
137
  //# sourceMappingURL=react-validate-component.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-validate-component.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from 'react';\nimport styles from './index.module.css';\nimport { VTEXT_PARAMS } from './types/vinput';\n\n// Text\nexport const VText = ({\n vState = false,\n vClassName = '',\n vShowMessage = false,\n vMessage = '',\n vIsInnerMessage = false,\n vLocateMessage = 'bottom',\n vMessageClass = '',\n vIsAnimate = false,\n props = {},\n}: VTEXT_PARAMS) => {\n const Result: JSX.Element = (\n <div className={`${styles.vinput} ${styles[`vinput-${vLocateMessage}`]}`}>\n <input\n type=\"text\"\n {...props}\n defaultValue={props?.defaultValue ?? ''}\n className={`${props?.className} ${\n vState ? vClassName || styles.invalid : ''\n }`}\n ></input>\n {vState && vShowMessage ? (\n <p\n className={`${vMessageClass} ${\n vIsInnerMessage\n ? `${props?.className} ${styles.innerMessage} ${\n styles[`innerMessage-${vLocateMessage}`]\n }`\n : ''\n } ${vIsAnimate ? styles.animateMessage : ''}`}\n >\n {vMessage}\n </p>\n ) : null}\n </div>\n );\n\n return Result;\n};\n\n// Checkbox\nexport const VCheckbox = () => {\n return <input type=\"checkbox\" />;\n};\n\n// Radio\nexport const VRadio = () => {\n return <input type=\"radio\" />;\n};\n\n// Date\nexport const VDate = () => {\n return <input type=\"date\" />;\n};\n\n// Color\nexport const VColor = () => {\n return <input type=\"color\" />;\n};\n\n// Email\nexport const VEmail = () => {\n return <input type=\"email\" />;\n};\n\n// Range\nexport const VRange = () => {\n return <input type=\"range\" />;\n};\n\n// Url\nexport const VUrl = () => {\n return <input type=\"url\" />;\n};\n"],"names":["VText","_ref","vState","_ref$vState","_ref$vClassName","vClassName","_ref$vShowMessage","vShowMessage","_ref$vMessage","vMessage","_ref$vIsInnerMessage","vIsInnerMessage","_ref$vLocateMessage","vLocateMessage","_ref$vMessageClass","vMessageClass","_ref$vIsAnimate","vIsAnimate","_ref$props","props","Result","React","className","styles","vinput","type","defaultValue","_props$defaultValue","invalid","innerMessage","animateMessage","VCheckbox","VRadio","VDate","VColor","VEmail","VRange","VUrl"],"mappings":";;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;ACrBA;AACA,IAAaA,KAAK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SAAS,EAAKP,aAAa,UACzBJ,eAAe,IACRQ,KAAK,oBAALA,KAAK,CAAEG,SAAS,UAAIC,MAAM,CAACM,YAAY,SACxCN,MAAM,mBAAiBV,cAAc,CACvC,GACA,EACN,WAAII,UAAU,GAAGM,MAAM,CAACO,cAAc,GAAG,EAAE;KAE1CrB,QAAQ,CACP,GACF,IAAI,CAEX;EAED,OAAOW,MAAM;AACf,CAAC;AAED;AACA,IAAaW,SAAS,GAAG,SAAZA,SAASA;EACpB,OAAOV;IAAOI,IAAI,EAAC;IAAa;AAClC,CAAC;AAED;AACA,IAAaO,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOX;IAAOI,IAAI,EAAC;IAAU;AAC/B,CAAC;AAED;AACA,IAAaQ,KAAK,GAAG,SAARA,KAAKA;EAChB,OAAOZ;IAAOI,IAAI,EAAC;IAAS;AAC9B,CAAC;AAED;AACA,IAAaS,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOb;IAAOI,IAAI,EAAC;IAAU;AAC/B,CAAC;AAED;AACA,IAAaU,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOd;IAAOI,IAAI,EAAC;IAAU;AAC/B,CAAC;AAED;AACA,IAAaW,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOf;IAAOI,IAAI,EAAC;IAAU;AAC/B,CAAC;AAED;AACA,IAAaY,IAAI,GAAG,SAAPA,IAAIA;EACf,OAAOhB;IAAOI,IAAI,EAAC;IAAQ;AAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"react-validate-component.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/vText/index.tsx","../src/vCheckbox/index.tsx","../src/vColor/index.tsx","../src/vDate/index.tsx","../src/vEmail/index.tsx","../src/vRadio/index.tsx","../src/vRange/index.tsx","../src/vURL/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from 'react';\nimport styles from './index.module.css';\nimport { VTEXT_PARAMS } from './vText';\n\n// Text\nexport function VText({\n vState = false,\n vType = 'outer',\n vClassName = '',\n vShowMessage = false,\n vMessage = '',\n vLocateMessage = 'bottom',\n vMessageClass = '',\n vIsAnimate = false,\n props = {},\n}: VTEXT_PARAMS) {\n switch (vType) {\n case 'outer':\n return (\n <div\n className={`${styles.vinput} ${styles[`vinput-${vLocateMessage}`]}`}\n >\n <input\n type=\"text\"\n {...props}\n defaultValue={props?.defaultValue ?? ''}\n className={`${props?.className} ${\n vState ? vClassName || styles.invalid : ''\n }`}\n ></input>\n {vState && vShowMessage ? (\n <p\n className={`${vMessageClass} ${\n vIsAnimate ? styles.animateMessage : ''\n }`}\n >\n {vMessage}\n </p>\n ) : null}\n </div>\n );\n case 'inner':\n return (\n <div className={styles.vinput}>\n <input\n type=\"text\"\n {...props}\n defaultValue={props?.defaultValue ?? ''}\n className={`${props?.className} ${\n vState ? vClassName || styles.invalid : ''\n }`}\n ></input>\n {vState && vShowMessage ? (\n <p\n className={`${vMessageClass} ${styles.innerMessage} ${\n styles[`innerMessage-${vLocateMessage}`]\n } ${vIsAnimate ? styles.animateMessage : ''}`}\n >\n {vMessage}\n </p>\n ) : null}\n </div>\n );\n case 'tooltip':\n return (\n <div\n className={`${styles.vinput} ${\n styles[`tooltipMessage-${vLocateMessage}`]\n }`}\n >\n <input\n type=\"text\"\n {...props}\n defaultValue={props?.defaultValue ?? ''}\n className={`${props?.className} ${\n vState ? vClassName || styles.invalid : ''\n }`}\n ></input>\n {vState && vShowMessage ? (\n <p\n className={`${vMessageClass} ${styles.tooltipMessage} ${\n styles[`tooltipMessage-${vLocateMessage}`]\n } ${vIsAnimate ? styles.animateMessage : ''}`}\n >\n {vMessage}\n </p>\n ) : null}\n </div>\n );\n default:\n return <div></div>;\n }\n}\n","import React from 'react';\r\n\r\nexport function VCheckbox() {\r\n return <input type=\"checkbox\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vColor() {\r\n return <input type=\"color\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vDate() {\r\n return <input type=\"date\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vEmail() {\r\n return <input type=\"email\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vRadio() {\r\n return <input type=\"radio\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vRange() {\r\n return <input type=\"range\" />;\r\n}\r\n","import React from 'react';\r\n\r\nexport function vURL() {\r\n return <input type=\"url\" />;\r\n}\r\n"],"names":["VText","_ref","vState","_ref$vState","_ref$vType","vType","_ref$vClassName","vClassName","_ref$vShowMessage","vShowMessage","_ref$vMessage","vMessage","_ref$vLocateMessage","vLocateMessage","_ref$vMessageClass","vMessageClass","_ref$vIsAnimate","vIsAnimate","_ref$props","props","React","className","styles","vinput","type","defaultValue","_props$defaultValue","invalid","animateMessage","_props$defaultValue2","innerMessage","_props$defaultValue3","tooltipMessage","VCheckbox","vColor","vDate","vEmail","vRadio","vRange","vURL"],"mappings":";;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,o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 +1,2 @@
1
+ import React from 'react';
2
+ export declare function VCheckbox(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vColor(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vDate(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vEmail(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vRadio(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vRange(): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { VTEXT_PARAMS } from './vText';
3
+ export declare function VText({ vState, vType, vClassName, vShowMessage, vMessage, vLocateMessage, vMessageClass, vIsAnimate, props, }: VTEXT_PARAMS): React.JSX.Element;
@@ -1,10 +1,11 @@
1
- import propsType from './vprops';
1
+ import propsType from '../types/vprops';
2
2
  export interface VTEXT_PARAMS {
3
3
  readonly vState: boolean;
4
+ readonly vType: // 유효성 메시지를 출력할 타입
5
+ 'inner' | 'outer' | 'tooltip';
4
6
  vClassName?: string;
5
7
  readonly vShowMessage: boolean;
6
8
  vMessage?: string;
7
- vIsInnerMessage?: boolean;
8
9
  vLocateMessage?: 'top-left' | 'top' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom' | 'bottom-right';
9
10
  vMessageClass?: string;
10
11
  vIsAnimate?: boolean;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function vURL(): React.JSX.Element;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.1",
2
+ "version": "0.1.3",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "scripts": {
14
14
  "start": "tsdx watch",
15
15
  "build": "tsdx build",
16
- "test": "tsdx test --passWithNoTests",
16
+ "test": "jest",
17
17
  "lint": "tsdx lint",
18
18
  "prepare": "tsdx build",
19
19
  "size": "size-limit",
@@ -27,6 +27,9 @@
27
27
  "pre-commit": "tsdx lint"
28
28
  }
29
29
  },
30
+ "jest": {
31
+ "testEnvironment": "jsdom"
32
+ },
30
33
  "prettier": {
31
34
  "printWidth": 80,
32
35
  "semi": true,
@@ -35,6 +38,26 @@
35
38
  },
36
39
  "name": "react-validate-component",
37
40
  "author": "JongGeun",
41
+ "description": "A component library that checks the validity of data entered into 'input' tags and displays validation messages.",
42
+ "keywords": [
43
+ "Validation",
44
+ "ErrorMessages",
45
+ "FormValidation",
46
+ "InputFields",
47
+ "ComponentLibrary",
48
+ "UserInput",
49
+ "DataValidation",
50
+ "React",
51
+ "Frontend",
52
+ "FormComponents",
53
+ "CustomValidators",
54
+ "DynamicValidation",
55
+ "FieldErrors"
56
+ ],
57
+ "bugs": {
58
+ "url": "https://github.com/dldvk9999/react-validate-component/issues"
59
+ },
60
+ "homepage": "https://github.com/dldvk9999/react-validate-component/issues",
38
61
  "module": "dist/react-validate-component.esm.js",
39
62
  "size-limit": [
40
63
  {
@@ -51,6 +74,8 @@
51
74
  "@types/react": "^18.3.3",
52
75
  "@types/react-dom": "^18.3.0",
53
76
  "husky": "^9.1.4",
77
+ "jest": "^29.7.0",
78
+ "jest-environment-jsdom": "^29.7.0",
54
79
  "react": "^18.3.1",
55
80
  "react-dom": "^18.3.1",
56
81
  "size-limit": "^11.1.4",
@@ -59,10 +84,18 @@
59
84
  "typescript": "^3.9.10"
60
85
  },
61
86
  "dependencies": {
87
+ "@babel/cli": "^7.24.8",
62
88
  "@babel/core": "^7.25.2",
89
+ "@babel/plugin-transform-arrow-functions": "^7.24.7",
63
90
  "@babel/plugin-transform-runtime": "^7.24.7",
91
+ "@babel/plugin-transform-template-literals": "^7.24.7",
64
92
  "@babel/preset-env": "^7.25.3",
93
+ "@babel/preset-react": "^7.24.7",
65
94
  "babel-jest": "^29.7.0",
66
- "rollup-plugin-postcss": "^4.0.2"
95
+ "babel-loader": "^9.1.3",
96
+ "rollup-plugin-postcss": "^4.0.2",
97
+ "webpack": "^5.93.0",
98
+ "webpack-cli": "^5.1.4",
99
+ "webpack-dev-server": "^5.0.4"
67
100
  }
68
101
  }
package/src/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { VText } from './vText';
2
+ import { VCheckbox } from './vCheckbox';
3
+ import { vColor } from './vColor';
4
+ import { vDate } from './vDate';
5
+ import { vEmail } from './vEmail';
6
+ import { vRadio } from './vRadio';
7
+ import { vRange } from './vRange';
8
+ import { vURL } from './vURL';
9
+
10
+ export { VText, VCheckbox, vColor, vDate, vEmail, vRadio, vRange, vURL };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function VCheckbox() {
4
+ return <input type="checkbox" />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function vColor() {
4
+ return <input type="color" />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function vDate() {
4
+ return <input type="date" />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function vEmail() {
4
+ return <input type="email" />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function vRadio() {
4
+ return <input type="radio" />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export function vRange() {
4
+ return <input type="range" />;
5
+ }
@@ -0,0 +1,210 @@
1
+ .invalid {
2
+ border: 2px solid red;
3
+ outline: none;
4
+ }
5
+ .invalid:focus,
6
+ .invalid:focus-visible,
7
+ .invalid:focus-within {
8
+ border: 2px solid red;
9
+ }
10
+
11
+ /* vType === 'outer' */
12
+ .vinput {
13
+ display: flex;
14
+ }
15
+ .vinput-top-left {
16
+ flex-direction: column-reverse;
17
+ align-items: flex-start;
18
+ justify-content: center;
19
+ }
20
+ .vinput-top {
21
+ flex-direction: column-reverse;
22
+ align-items: center;
23
+ justify-content: center;
24
+ }
25
+ .vinput-top-right {
26
+ flex-direction: column-reverse;
27
+ align-items: flex-end;
28
+ justify-content: center;
29
+ }
30
+ .vinput-center-left {
31
+ flex-direction: row-reverse;
32
+ align-items: center;
33
+ justify-content: center;
34
+ }
35
+ .vinput-center-right {
36
+ align-items: center;
37
+ justify-content: center;
38
+ }
39
+ .vinput-bottom-left {
40
+ flex-direction: column;
41
+ align-items: flex-start;
42
+ justify-content: center;
43
+ }
44
+ .vinput-bottom {
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ }
49
+ .vinput-bottom-right {
50
+ flex-direction: column;
51
+ align-items: flex-end;
52
+ justify-content: center;
53
+ }
54
+
55
+ /* vType === 'inner' */
56
+ .innerMessage {
57
+ position: absolute;
58
+ font-size: 12px;
59
+ margin: 0;
60
+ padding: 2px 5px;
61
+ display: flex;
62
+ }
63
+ .innerMessage-top-left {
64
+ align-items: flex-start;
65
+ justify-content: flex-start;
66
+ }
67
+ .innerMessage-top {
68
+ align-items: flex-start;
69
+ justify-content: center;
70
+ }
71
+ .innerMessage-top-right {
72
+ align-items: flex-start;
73
+ justify-content: flex-end;
74
+ }
75
+ .innerMessage-center-left {
76
+ align-items: center;
77
+ justify-content: flex-start;
78
+ }
79
+ .innerMessage-center {
80
+ align-items: center;
81
+ justify-content: center;
82
+ }
83
+ .innerMessage-center-right {
84
+ align-items: center;
85
+ justify-content: flex-end;
86
+ }
87
+ .innerMessage-bottom-left {
88
+ align-items: flex-end;
89
+ justify-content: flex-start;
90
+ }
91
+ .innerMessage-bottom {
92
+ align-items: flex-end;
93
+ justify-content: center;
94
+ }
95
+ .innerMessage-bottom-right {
96
+ align-items: flex-end;
97
+ justify-content: flex-end;
98
+ }
99
+
100
+ /* vType === 'tooltip' */
101
+ .tooltipMessage {
102
+ position: absolute;
103
+ margin: 0;
104
+ padding: 10px 20px;
105
+ border: 1px solid transparent;
106
+ border-radius: 10px;
107
+ background-color: black;
108
+ }
109
+ p[class*='tooltipMessage-top'] {
110
+ transform: translateY(calc(-100% - 10px));
111
+ }
112
+ p[class*='tooltipMessage-top']::after {
113
+ content: '';
114
+ position: absolute;
115
+ bottom: 0;
116
+ border: 10px solid transparent;
117
+ border-top-color: black;
118
+ border-bottom: 0;
119
+ margin-bottom: -11px;
120
+ }
121
+ .vinput.tooltipMessage-top-left {
122
+ justify-content: flex-start;
123
+ }
124
+ p.tooltipMessage-top-left::after {
125
+ left: 3%;
126
+ }
127
+ .vinput.tooltipMessage-top {
128
+ justify-content: center;
129
+ }
130
+ p.tooltipMessage-top::after {
131
+ left: 44%;
132
+ }
133
+ .tooltipMessage-top-right {
134
+ justify-content: flex-end;
135
+ }
136
+ p.tooltipMessage-top-right::after {
137
+ left: 87%;
138
+ }
139
+ p[class*='tooltipMessage-center'] {
140
+ /* transform: translateY(calc(-100% - 10px)); */
141
+ }
142
+ p[class*='tooltipMessage-center']::after {
143
+ content: '';
144
+ position: absolute;
145
+ border: 10px solid transparent;
146
+ }
147
+ .vinput.tooltipMessage-center-right {
148
+ justify-content: flex-end;
149
+ }
150
+ p.tooltipMessage-center-right {
151
+ transform: translateX(calc(100% + 10px));
152
+ }
153
+ p.tooltipMessage-center-right::after {
154
+ border-right-color: black;
155
+ left: -10%;
156
+ }
157
+ .vinput.tooltipMessage-center-left {
158
+ justify-content: flex-start;
159
+ }
160
+ p.tooltipMessage-center-left {
161
+ transform: translateX(calc(-100% - 10px));
162
+ }
163
+ p.tooltipMessage-center-left::after {
164
+ border-left-color: black;
165
+ left: 100%;
166
+ }
167
+
168
+ p[class*='tooltipMessage-bottom'] {
169
+ transform: translateY(calc(120% + 10px));
170
+ }
171
+ p[class*='tooltipMessage-bottom']::after {
172
+ content: '';
173
+ position: absolute;
174
+ top: 0;
175
+ border: 10px solid transparent;
176
+ border-bottom-color: black;
177
+ border-top: 0;
178
+ margin-top: -11px;
179
+ }
180
+ .vinput.tooltipMessage-bottom-left {
181
+ justify-content: flex-start;
182
+ }
183
+ p.tooltipMessage-bottom-left::after {
184
+ left: 3%;
185
+ }
186
+ .vinput.tooltipMessage-bottom {
187
+ justify-content: center;
188
+ }
189
+ p.tooltipMessage-bottom::after {
190
+ left: 44%;
191
+ }
192
+ .tooltipMessage-bottom-right {
193
+ justify-content: flex-end;
194
+ }
195
+ p.tooltipMessage-bottom-right::after {
196
+ left: 87%;
197
+ }
198
+
199
+ .animateMessage {
200
+ animation: fade-in 1s ease-in-out;
201
+ }
202
+
203
+ @keyframes fade-in {
204
+ 0% {
205
+ opacity: 0;
206
+ }
207
+ 100% {
208
+ opacity: 1;
209
+ }
210
+ }