wini-web-components 2.6.8 → 2.7.0

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.
Files changed (33) hide show
  1. package/README.md +21 -21
  2. package/dist/component/button/button.d.ts +1 -1
  3. package/dist/component/date-picker/date-picker.d.ts +25 -25
  4. package/dist/component/date-picker/date-picker.js +329 -329
  5. package/dist/component/date-time-picker/date-time-picker.js +2 -2
  6. package/dist/component/input-opt/input-opt.d.ts +21 -21
  7. package/dist/component/input-opt/input-opt.js +157 -157
  8. package/dist/component/input-otp/input-otp.d.ts +1 -0
  9. package/dist/component/input-otp/input-otp.js +1 -1
  10. package/dist/component/number-picker/number-picker.d.ts +4 -0
  11. package/dist/component/tag/tag.d.ts +2 -1
  12. package/dist/component/text-area/text-area.d.ts +0 -1
  13. package/dist/component/text-area/text-area.js +5 -2
  14. package/dist/component/text-field/text-field.d.ts +4 -1
  15. package/dist/component/text-field/text-field.js +5 -2
  16. package/dist/index.js +1 -1
  17. package/package.json +1 -1
  18. package/public/index.html +43 -43
  19. package/public/manifest.json +25 -25
  20. package/public/robots.txt +3 -3
  21. package/.early.coverage/clover.xml +0 -6
  22. package/.early.coverage/coverage-final.json +0 -1
  23. package/.early.coverage/lcov-report/base.css +0 -224
  24. package/.early.coverage/lcov-report/block-navigation.js +0 -87
  25. package/.early.coverage/lcov-report/favicon.png +0 -0
  26. package/.early.coverage/lcov-report/index.html +0 -101
  27. package/.early.coverage/lcov-report/prettify.css +0 -1
  28. package/.early.coverage/lcov-report/prettify.js +0 -2
  29. package/.early.coverage/lcov-report/sort-arrow-sprite.png +0 -0
  30. package/.early.coverage/lcov-report/sorter.js +0 -196
  31. package/.early.coverage/lcov.info +0 -0
  32. package/.early.coverage/v8/coverage-final.json +0 -1
  33. package/coverage/early.sample.test.js +0 -1
@@ -308,7 +308,7 @@ const PopupDateTimePicker = (0, react_1.forwardRef)(function PopupDateTimePicker
308
308
  (0, popup_1.showPopup)({
309
309
  ref: popupRef,
310
310
  clickOverlayClosePopup: true,
311
- content: react_2.default.createElement("div", { className: `col ${date_time_picker_module_css_1.default['popup-actions']}`, style: { maxHeight: "24rem", top: rect.bottom + 2, right: document.body.offsetWidth - rect.right, width: rect.width, overflow: "hidden auto", backgroundColor: "var(--neutral-absolute-background-color)", borderRadius: "0.8rem" } }, Array.from({ length: 48 }).map((_, i) => {
311
+ content: react_2.default.createElement("div", { className: `col ${date_time_picker_module_css_1.default['popup-actions']}`, style: { maxHeight: "24rem", top: rect.bottom + 2, right: document.body.offsetWidth - rect.right, width: rect.width, overflow: "hidden auto", border: "var(--neutral-main-border)" } }, Array.from({ length: 48 }).map((_, i) => {
312
312
  if (i % 2 === 0)
313
313
  var timeValue = `${(i / 2) < 9 ? `0${i / 2}` : (i / 2)}:00`;
314
314
  else
@@ -336,7 +336,7 @@ const PopupDateTimePicker = (0, react_1.forwardRef)(function PopupDateTimePicker
336
336
  (0, popup_1.showPopup)({
337
337
  ref: popupRef,
338
338
  clickOverlayClosePopup: true,
339
- content: react_2.default.createElement("div", { className: `col ${date_time_picker_module_css_1.default['popup-actions']}`, style: { maxHeight: "24rem", top: rect.bottom + 2, right: document.body.offsetWidth - rect.right, width: rect.width, overflow: "hidden auto", backgroundColor: "var(--neutral-absolute-background-color)", borderRadius: "0.8rem" } }, Array.from({ length: 48 }).map((_, i) => {
339
+ content: react_2.default.createElement("div", { className: `col ${date_time_picker_module_css_1.default['popup-actions']}`, style: { maxHeight: "24rem", top: rect.bottom + 2, right: document.body.offsetWidth - rect.right, width: rect.width, overflow: "hidden auto", border: "var(--neutral-main-border)" } }, Array.from({ length: 48 }).map((_, i) => {
340
340
  if (i % 2 === 0)
341
341
  var timeValue = `${(i / 2) < 9 ? `0${i / 2}` : (i / 2)}:00`;
342
342
  else
@@ -1,21 +1,21 @@
1
- import React, { CSSProperties, ReactNode } from "react";
2
- interface Props {
3
- id?: string;
4
- onChange?: (value: string, target: HTMLDivElement) => void;
5
- disabled?: boolean;
6
- value?: string;
7
- length?: number;
8
- inputStyle?: CSSProperties;
9
- style?: CSSProperties;
10
- className?: string;
11
- helperText?: string;
12
- helperTextColor?: string;
13
- }
14
- export declare class InputOpt extends React.Component<Props> {
15
- private containerRef;
16
- constructor(props: Props | Readonly<Props>);
17
- getValue: () => string;
18
- componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
19
- render(): ReactNode;
20
- }
21
- export {};
1
+ import React, { CSSProperties, ReactNode } from "react";
2
+ interface Props {
3
+ id?: string;
4
+ onChange?: (value: string, target: HTMLDivElement) => void;
5
+ disabled?: boolean;
6
+ value?: string;
7
+ length?: number;
8
+ inputStyle?: CSSProperties;
9
+ style?: CSSProperties;
10
+ className?: string;
11
+ helperText?: string;
12
+ helperTextColor?: string;
13
+ }
14
+ export declare class InputOpt extends React.Component<Props> {
15
+ private containerRef;
16
+ constructor(props: Props | Readonly<Props>);
17
+ getValue: () => string;
18
+ componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
19
+ render(): ReactNode;
20
+ }
21
+ export {};
@@ -1,157 +1,157 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
- if (k2 === undefined) k2 = k;
30
- var desc = Object.getOwnPropertyDescriptor(m, k);
31
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
- desc = { enumerable: true, get: function() { return m[k]; } };
33
- }
34
- Object.defineProperty(o, k2, desc);
35
- }) : (function(o, m, k, k2) {
36
- if (k2 === undefined) k2 = k;
37
- o[k2] = m[k];
38
- }));
39
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
40
- Object.defineProperty(o, "default", { enumerable: true, value: v });
41
- }) : function(o, v) {
42
- o["default"] = v;
43
- });
44
- var __importStar = (this && this.__importStar) || (function () {
45
- var ownKeys = function(o) {
46
- ownKeys = Object.getOwnPropertyNames || function (o) {
47
- var ar = [];
48
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
49
- return ar;
50
- };
51
- return ownKeys(o);
52
- };
53
- return function (mod) {
54
- if (mod && mod.__esModule) return mod;
55
- var result = {};
56
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
57
- __setModuleDefault(result, mod);
58
- return result;
59
- };
60
- })();
61
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
62
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
63
- if (ar || !(i in from)) {
64
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
65
- ar[i] = from[i];
66
- }
67
- }
68
- return to.concat(ar || Array.prototype.slice.call(from));
69
- };
70
- var __importDefault = (this && this.__importDefault) || function (mod) {
71
- return (mod && mod.__esModule) ? mod : { "default": mod };
72
- };
73
- Object.defineProperty(exports, "__esModule", { value: true });
74
- exports.InputOpt = void 0;
75
- var react_1 = __importStar(require("react"));
76
- var input_opt_module_css_1 = __importDefault(require("./input-opt.module.css"));
77
- var InputOpt = /** @class */ (function (_super) {
78
- __extends(InputOpt, _super);
79
- function InputOpt(props) {
80
- var _this = _super.call(this, props) || this;
81
- _this.containerRef = (0, react_1.createRef)();
82
- _this.getValue = function () {
83
- var _a;
84
- if (_this.containerRef.current)
85
- return __spreadArray([], _this.containerRef.current.querySelectorAll("input"), true).map(function (v) { return v.value; }).join("");
86
- else
87
- return (_a = _this.props.value) !== null && _a !== void 0 ? _a : "";
88
- };
89
- _this.getValue = _this.getValue.bind(_this);
90
- return _this;
91
- }
92
- InputOpt.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) {
93
- var _a;
94
- if (prevProps.value !== this.props.value && this.containerRef.current) {
95
- var inputList = __spreadArray([], this.containerRef.current.querySelectorAll("input"), true);
96
- if ((_a = this.props.value) === null || _a === void 0 ? void 0 : _a.length) {
97
- for (var i = 0; i < inputList.length; i++)
98
- inputList[i].value = this.props.value[i];
99
- }
100
- else {
101
- for (var i = 0; i < inputList.length; i++)
102
- inputList[i].value = "";
103
- }
104
- }
105
- };
106
- InputOpt.prototype.render = function () {
107
- var _this = this;
108
- var _a, _b, _c, _d, _e;
109
- return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_a = this.props.helperTextColor) !== null && _a !== void 0 ? _a : '#e14337' }), this.props.style) : { '--helper-text-color': (_b = this.props.helperTextColor) !== null && _b !== void 0 ? _b : '#e14337' }, className: "row body-1 ".concat(input_opt_module_css_1.default['input-opt-container'], " ").concat(((_c = this.props.helperText) === null || _c === void 0 ? void 0 : _c.length) && 'helper-text', " ").concat((_d = this.props.className) !== null && _d !== void 0 ? _d : ''), onMouseDown: function (ev) {
110
- ev.stopPropagation();
111
- ev.preventDefault();
112
- var inputList = __spreadArray([], ev.target.closest("div").childNodes, true);
113
- for (var _i = 0, _a = inputList.entries(); _i < _a.length; _i++) {
114
- var _b = _a[_i], index = _b[0], input = _b[1];
115
- if (!input.value.length || index === (inputList.length - 1)) {
116
- input.focus();
117
- break;
118
- }
119
- continue;
120
- }
121
- } }, Array.from({ length: (_e = this.props.length) !== null && _e !== void 0 ? _e : 6 }).map(function (_, i) { return react_1.default.createElement("input", { key: "opt-" + i, disabled: _this.props.disabled, style: _this.props.inputStyle, onKeyDown: function (ev) {
122
- var _a, _b;
123
- var key = ev.key.toLowerCase();
124
- switch (key) {
125
- case "backspace":
126
- if (ev.target.value.length)
127
- ev.target.value = "";
128
- else if (((_a = ev.target.previousSibling) === null || _a === void 0 ? void 0 : _a.localName) === "input")
129
- ev.target.previousSibling.focus();
130
- else
131
- ev.target.blur();
132
- break;
133
- case "delete":
134
- ev.target.value = "";
135
- break;
136
- default:
137
- ev.preventDefault();
138
- ev.stopPropagation();
139
- var numberCheck = /[0-9]/g;
140
- if (numberCheck.test(key)) {
141
- if (!ev.target.value.length)
142
- ev.target.value = key;
143
- if (((_b = ev.target.nextSibling) === null || _b === void 0 ? void 0 : _b.localName) === "input" && !ev.target.nextSibling.value.length)
144
- ev.target.nextSibling.focus();
145
- else
146
- ev.target.blur();
147
- }
148
- break;
149
- }
150
- }, onBlur: function () {
151
- if (_this.props.onChange)
152
- _this.props.onChange(_this.getValue(), _this.containerRef.current);
153
- } }); }));
154
- };
155
- return InputOpt;
156
- }(react_1.default.Component));
157
- exports.InputOpt = InputOpt;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ var desc = Object.getOwnPropertyDescriptor(m, k);
31
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
+ desc = { enumerable: true, get: function() { return m[k]; } };
33
+ }
34
+ Object.defineProperty(o, k2, desc);
35
+ }) : (function(o, m, k, k2) {
36
+ if (k2 === undefined) k2 = k;
37
+ o[k2] = m[k];
38
+ }));
39
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
40
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
41
+ }) : function(o, v) {
42
+ o["default"] = v;
43
+ });
44
+ var __importStar = (this && this.__importStar) || (function () {
45
+ var ownKeys = function(o) {
46
+ ownKeys = Object.getOwnPropertyNames || function (o) {
47
+ var ar = [];
48
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
49
+ return ar;
50
+ };
51
+ return ownKeys(o);
52
+ };
53
+ return function (mod) {
54
+ if (mod && mod.__esModule) return mod;
55
+ var result = {};
56
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
57
+ __setModuleDefault(result, mod);
58
+ return result;
59
+ };
60
+ })();
61
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
62
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
63
+ if (ar || !(i in from)) {
64
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
65
+ ar[i] = from[i];
66
+ }
67
+ }
68
+ return to.concat(ar || Array.prototype.slice.call(from));
69
+ };
70
+ var __importDefault = (this && this.__importDefault) || function (mod) {
71
+ return (mod && mod.__esModule) ? mod : { "default": mod };
72
+ };
73
+ Object.defineProperty(exports, "__esModule", { value: true });
74
+ exports.InputOpt = void 0;
75
+ var react_1 = __importStar(require("react"));
76
+ var input_opt_module_css_1 = __importDefault(require("./input-opt.module.css"));
77
+ var InputOpt = /** @class */ (function (_super) {
78
+ __extends(InputOpt, _super);
79
+ function InputOpt(props) {
80
+ var _this = _super.call(this, props) || this;
81
+ _this.containerRef = (0, react_1.createRef)();
82
+ _this.getValue = function () {
83
+ var _a;
84
+ if (_this.containerRef.current)
85
+ return __spreadArray([], _this.containerRef.current.querySelectorAll("input"), true).map(function (v) { return v.value; }).join("");
86
+ else
87
+ return (_a = _this.props.value) !== null && _a !== void 0 ? _a : "";
88
+ };
89
+ _this.getValue = _this.getValue.bind(_this);
90
+ return _this;
91
+ }
92
+ InputOpt.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) {
93
+ var _a;
94
+ if (prevProps.value !== this.props.value && this.containerRef.current) {
95
+ var inputList = __spreadArray([], this.containerRef.current.querySelectorAll("input"), true);
96
+ if ((_a = this.props.value) === null || _a === void 0 ? void 0 : _a.length) {
97
+ for (var i = 0; i < inputList.length; i++)
98
+ inputList[i].value = this.props.value[i];
99
+ }
100
+ else {
101
+ for (var i = 0; i < inputList.length; i++)
102
+ inputList[i].value = "";
103
+ }
104
+ }
105
+ };
106
+ InputOpt.prototype.render = function () {
107
+ var _this = this;
108
+ var _a, _b, _c, _d, _e;
109
+ return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_a = this.props.helperTextColor) !== null && _a !== void 0 ? _a : '#e14337' }), this.props.style) : { '--helper-text-color': (_b = this.props.helperTextColor) !== null && _b !== void 0 ? _b : '#e14337' }, className: "row body-1 ".concat(input_opt_module_css_1.default['input-opt-container'], " ").concat(((_c = this.props.helperText) === null || _c === void 0 ? void 0 : _c.length) && 'helper-text', " ").concat((_d = this.props.className) !== null && _d !== void 0 ? _d : ''), onMouseDown: function (ev) {
110
+ ev.stopPropagation();
111
+ ev.preventDefault();
112
+ var inputList = __spreadArray([], ev.target.closest("div").childNodes, true);
113
+ for (var _i = 0, _a = inputList.entries(); _i < _a.length; _i++) {
114
+ var _b = _a[_i], index = _b[0], input = _b[1];
115
+ if (!input.value.length || index === (inputList.length - 1)) {
116
+ input.focus();
117
+ break;
118
+ }
119
+ continue;
120
+ }
121
+ } }, Array.from({ length: (_e = this.props.length) !== null && _e !== void 0 ? _e : 6 }).map(function (_, i) { return react_1.default.createElement("input", { key: "opt-" + i, disabled: _this.props.disabled, style: _this.props.inputStyle, onKeyDown: function (ev) {
122
+ var _a, _b;
123
+ var key = ev.key.toLowerCase();
124
+ switch (key) {
125
+ case "backspace":
126
+ if (ev.target.value.length)
127
+ ev.target.value = "";
128
+ else if (((_a = ev.target.previousSibling) === null || _a === void 0 ? void 0 : _a.localName) === "input")
129
+ ev.target.previousSibling.focus();
130
+ else
131
+ ev.target.blur();
132
+ break;
133
+ case "delete":
134
+ ev.target.value = "";
135
+ break;
136
+ default:
137
+ ev.preventDefault();
138
+ ev.stopPropagation();
139
+ var numberCheck = /[0-9]/g;
140
+ if (numberCheck.test(key)) {
141
+ if (!ev.target.value.length)
142
+ ev.target.value = key;
143
+ if (((_b = ev.target.nextSibling) === null || _b === void 0 ? void 0 : _b.localName) === "input" && !ev.target.nextSibling.value.length)
144
+ ev.target.nextSibling.focus();
145
+ else
146
+ ev.target.blur();
147
+ }
148
+ break;
149
+ }
150
+ }, onBlur: function () {
151
+ if (_this.props.onChange)
152
+ _this.props.onChange(_this.getValue(), _this.containerRef.current);
153
+ } }); }));
154
+ };
155
+ return InputOpt;
156
+ }(react_1.default.Component));
157
+ exports.InputOpt = InputOpt;
@@ -10,6 +10,7 @@ interface Props {
10
10
  className?: string;
11
11
  helperText?: string;
12
12
  helperTextColor?: string;
13
+ autoFocus?: boolean;
13
14
  }
14
15
  export declare class InputOtp extends React.Component<Props> {
15
16
  private containerRef;
@@ -79,7 +79,7 @@ class InputOtp extends react_1.default.Component {
79
79
  }
80
80
  continue;
81
81
  }
82
- } }, Array.from({ length: (_e = this.props.length) !== null && _e !== void 0 ? _e : 6 }).map((_, i) => react_1.default.createElement("input", { key: "opt-" + i, disabled: this.props.disabled, style: this.props.inputStyle, onKeyDown: (ev) => {
82
+ } }, Array.from({ length: (_e = this.props.length) !== null && _e !== void 0 ? _e : 6 }).map((_, i) => react_1.default.createElement("input", { key: "opt-" + i, autoFocus: i === 0 && this.props.autoFocus, disabled: this.props.disabled, style: this.props.inputStyle, onKeyDown: (ev) => {
83
83
  var _a, _b;
84
84
  const key = ev.key.toLowerCase();
85
85
  switch (key) {
@@ -5,6 +5,10 @@ interface Props {
5
5
  onChange?: (ev: number) => void;
6
6
  disabled?: boolean;
7
7
  readOnly?: boolean;
8
+ /**
9
+ * default: size32: body-3 \
10
+ * recommend: size40: body-2 | size24: body-3
11
+ * */
8
12
  className?: string;
9
13
  helperText?: string;
10
14
  helperTextColor?: string;
@@ -9,7 +9,8 @@ interface TagProps {
9
9
  style?: CSSProperties;
10
10
  /**
11
11
  * default: size24: button-text-6 \
12
- * recommend: size24: button-text-6 | size32: button-text-4
12
+ * recommend: size24: button-text-6 | size32: button-text-4 \
13
+ * status tag: tag-primary | tag-infor | tag-warning | tag-error | tag-success | tag-grey | tag-neutral | tag-infor-main | tag-warning-main | tag-error-main | tag-success-main
13
14
  * */
14
15
  className?: string;
15
16
  status?: ComponentStatus;
@@ -1,5 +1,4 @@
1
1
  import React, { CSSProperties } from "react";
2
- import './text-area.css';
3
2
  import { UseFormRegister } from "react-hook-form";
4
3
  interface TextAreaProps {
5
4
  id?: string;
@@ -32,10 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.TextArea = void 0;
37
40
  const react_1 = __importStar(require("react"));
38
- require("./text-area.css");
41
+ const text_area_module_css_1 = __importDefault(require("./text-area.module.css"));
39
42
  class TextArea extends react_1.default.Component {
40
43
  constructor() {
41
44
  super(...arguments);
@@ -47,7 +50,7 @@ class TextArea extends react_1.default.Component {
47
50
  }
48
51
  render() {
49
52
  var _a, _b, _c, _d;
50
- return react_1.default.createElement("div", { ref: this.containerRef, id: this.props.id, className: `text-area-container row ${(_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3'} ${((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'}`, "helper-text": this.props.helperText, style: this.props.style ? Object.assign(Object.assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } }, this.props.register ?
53
+ return react_1.default.createElement("div", { ref: this.containerRef, id: this.props.id, className: `${text_area_module_css_1.default['text-area-container']} row ${(_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3'} ${((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) ? text_area_module_css_1.default['helper-text'] : ""}`, "helper-text": this.props.helperText, style: this.props.style ? Object.assign(Object.assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } }, this.props.register ?
51
54
  react_1.default.createElement("textarea", Object.assign({ name: this.props.name, autoFocus: this.props.autoFocus }, this.props.register, { maxLength: this.props.maxLength, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("textarea", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }));
52
55
  }
53
56
  }
@@ -1,5 +1,4 @@
1
1
  import React, { CSSProperties, ReactNode } from "react";
2
- import './text-field.css';
3
2
  import { UseFormRegister } from "react-hook-form";
4
3
  interface TextFieldProps {
5
4
  id?: string;
@@ -13,6 +12,10 @@ interface TextFieldProps {
13
12
  placeholder?: string;
14
13
  disabled?: boolean;
15
14
  readOnly?: boolean;
15
+ /**
16
+ * default: size40: body-3
17
+ * recommend: size48: body-3 | size32: body-3 | size24: body-3
18
+ * */
16
19
  className?: string;
17
20
  helperText?: string;
18
21
  name?: string;
@@ -32,10 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.TextField = void 0;
37
40
  const react_1 = __importStar(require("react"));
38
- require("./text-field.css");
41
+ const text_field_module_css_1 = __importDefault(require("./text-field.module.css"));
39
42
  class TextField extends react_1.default.Component {
40
43
  constructor() {
41
44
  super(...arguments);
@@ -47,7 +50,7 @@ class TextField extends react_1.default.Component {
47
50
  }
48
51
  render() {
49
52
  var _a, _b, _c, _d, _e, _f;
50
- return react_1.default.createElement("div", { ref: this.containerRef, id: this.props.id, className: `text-field-container row ${(_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3'} ${((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) ? 'helper-text' : ""}`, "helper-text": this.props.helperText, style: this.props.style ? Object.assign(Object.assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } },
53
+ return react_1.default.createElement("div", { ref: this.containerRef, id: this.props.id, className: `${text_field_module_css_1.default['text-field-container']} row ${(_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3'} ${((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) ? text_field_module_css_1.default['helper-text'] : ""}`, "helper-text": this.props.helperText, style: this.props.style ? Object.assign(Object.assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } },
51
54
  this.props.prefix,
52
55
  this.props.register ?
53
56
  react_1.default.createElement("input", Object.assign({ name: this.props.name }, this.props.register, { autoComplete: this.props.autoComplete, autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, type: (_e = this.props.type) !== null && _e !== void 0 ? _e : 'text', placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus, onKeyDown: this.props.onComplete ? (ev) => {