@xaypay/tui 0.0.52 → 0.0.54

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.
package/dist/index.js CHANGED
@@ -5,29 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var PropTypes = require('prop-types');
7
7
  var classnames = require('classnames');
8
- var styled = require('styled-components');
9
8
 
10
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
10
 
12
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
12
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
14
13
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
15
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
16
-
17
- function _extends() {
18
- _extends = Object.assign ? Object.assign.bind() : function (target) {
19
- for (var i = 1; i < arguments.length; i++) {
20
- var source = arguments[i];
21
- for (var key in source) {
22
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23
- target[key] = source[key];
24
- }
25
- }
26
- }
27
- return target;
28
- };
29
- return _extends.apply(this, arguments);
30
- }
31
14
 
32
15
  function styleInject(css, ref) {
33
16
  if ( ref === void 0 ) ref = {};
@@ -56,282 +39,161 @@ function styleInject(css, ref) {
56
39
  }
57
40
  }
58
41
 
59
- var css_248z$d = ".button-module_btn__ffRtT{border:none;border-radius:6px;box-sizing:border-box;cursor:pointer;font-size:16px;line-height:20px;max-height:46px;min-height:46px;outline:none;overflow:hidden;padding:12px 20px;text-transform:none;transition:background-color .24s,color .24s}.button-module_btn__ffRtT.button-module_full-size__vmV2E{width:100%}.button-module_btn__ffRtT.button-module_content-size__f7JSE{width:auto}.button-module_btn__ffRtT.button-module_type-filled__BiyVo{background-color:#00236a;color:#fff}.button-module_btn__ffRtT.button-module_type-filled__BiyVo:hover{background-color:#001745}.button-module_btn__ffRtT.button-module_type-filled__BiyVo:disabled{background-color:#eee;color:#3c393e;pointer-events:none}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V{background-color:#fff;box-shadow:inset 0 0 0 2px #00236a}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V:hover{background-color:#001745;color:#fff}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V:disabled{box-shadow:inset 0 0 0 2px #eee;color:#3c393e;pointer-events:none}";
60
- var styles$b = {"btn":"button-module_btn__ffRtT","full-size":"button-module_full-size__vmV2E","content-size":"button-module_content-size__f7JSE","size-default":"button-module_size-default__ydEgl","type-filled":"button-module_type-filled__BiyVo","with-icon":"button-module_with-icon__mfKU-","type-outline":"button-module_type-outline__RpZ2V"};
61
- styleInject(css_248z$d);
62
-
63
- /**
64
- * Primary UI component for user interaction
65
- */
66
-
67
- const ButtonType = {
68
- BUTTON: 'button',
69
- RESET: 'reset',
70
- SUBMIT: 'submit'
71
- };
72
- const ButtonTheme = {
73
- DEFAULT: 'content-size',
74
- PRIMARY: 'full-size',
75
- SUCCESS: 'btn-success',
76
- INFO: 'btn-info',
77
- WARNING: 'btn-warning',
78
- DANGER: 'btn-danger',
79
- LINK: 'btn-link'
80
- };
81
- const ButtonSize = {
82
- SMALL: 'small',
83
- MEDIUM: 'medium',
84
- LARGE: 'large'
85
- };
86
- const Button = ({
87
- primary,
88
- backgroundColor,
89
- theme,
90
- size,
91
- className,
92
- disabled,
93
- label,
94
- outline,
95
- ...props
96
- }) => {
97
- const classProps = classnames__default["default"](styles$b.btn, styles$b[theme], styles$b[size], outline ? styles$b['type-outline'] : styles$b['type-filled'], className, 'button-rem');
98
- // className='btn type-outline size-default'
99
- return /*#__PURE__*/React__default["default"].createElement("button", _extends({
100
- type: "button",
101
- className: classProps,
102
- style: backgroundColor && {
103
- backgroundColor
104
- },
105
- disabled: disabled ? 'disabled' : ''
106
- }, props), label);
107
- };
108
- Button.propTypes = {
109
- type: PropTypes__default["default"].oneOf(Object.values(ButtonType)),
110
- theme: PropTypes__default["default"].oneOf(Object.values(ButtonTheme)),
111
- size: PropTypes__default["default"].oneOf(Object.values(ButtonSize)),
112
- /**
113
- * What background color to use
114
- */
115
- backgroundColor: PropTypes__default["default"].string,
116
- /**
117
- * How large should the button be?
118
- */
119
- // size: PropTypes.oneOf(['small', 'medium', 'large']),
120
- /**
121
- * Button contents
122
- */
123
- label: PropTypes__default["default"].string.isRequired,
124
- /**
125
- * Optional click handler
126
- */
127
- onClick: PropTypes__default["default"].func,
128
- /**
129
- * disabled
130
- */
131
- disabled: PropTypes__default["default"].bool,
132
- className: PropTypes__default["default"].string,
133
- outline: PropTypes__default["default"].bool
134
- };
135
- Button.defaultProps = {
136
- backgroundColor: null,
137
- primary: false,
138
- size: 'medium',
139
- onClick: undefined,
140
- outline: false
141
- };
142
-
143
- var css_248z$c = "h1{font-size:70px;line-height:78px}h1,h2{font-weight:400;text-transform:uppercase}h2{font-size:50px;line-height:56px}h3{font-size:38px;font-weight:400;line-height:44px;text-transform:uppercase}h4{font-size:24px;line-height:28px}h4,h5{font-weight:600;text-transform:uppercase}h5{font-size:20px;line-height:26px}h6{font-size:14px;font-weight:600;line-height:20px;text-transform:none}p{font-size:13px;line-height:18px}p,span{color:#3c393e;font-weight:500;text-transform:none}span{font-size:12px;line-height:16px}i{font-family:icomoon;font-style:inherit}";
42
+ var css_248z$c = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{bottom:0;display:block;height:190px;left:0;margin:auto;max-height:190px;position:absolute;right:0;top:0;width:auto}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
43
+ var styles$b = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
144
44
  styleInject(css_248z$c);
145
45
 
146
- const TypographyType = {
147
- h1: 'h1',
148
- h2: 'h2',
149
- h3: 'h3',
150
- h4: 'h4',
151
- h5: 'h5',
152
- h6: 'h6',
153
- span: 'span',
154
- p: 'p',
155
- i: 'i'
156
- };
157
- const Typography = ({
158
- onClick,
159
- variant,
160
- className,
161
- color,
162
- bold,
163
- children,
164
- ...props
165
- }) => {
166
- const classProps = classnames__default["default"](className, 'sizes-rem', bold ? 'bold' : '');
167
- const CustomTag = variant;
168
-
169
- // const Tag = ({ className, children }) => (
170
- // <CustomTag
171
- // className={className}
172
- // {...props}
173
- // >
174
- // {children}
175
- // </CustomTag>
176
- // );
177
-
178
- const StyledTypograpy = styled__default["default"](CustomTag)`
179
- ${color ? 'color: ' + color + ';' : ''}
180
- ${bold ? 'font-weight: bold;' : ''}
181
- `;
182
- return /*#__PURE__*/React__default["default"].createElement(StyledTypograpy, {
183
- className: classProps,
184
- onClick: onClick
185
- }, " ", children, " ");
186
- };
187
- Typography.propTypes = {
188
- variant: PropTypes__default["default"].oneOf(Object.values(TypographyType)),
189
- className: PropTypes__default["default"].string,
190
- bold: PropTypes__default["default"].bool,
191
- color: PropTypes__default["default"].string,
192
- onClick: PropTypes__default["default"].func
193
- };
194
- Typography.defaultProps = {
195
- variant: 'h1',
196
- onClick: () => {}
197
- };
198
-
199
- var css_248z$b = ".autocomplate-module_autocomplate-content__UbIUT{display:flex;flex-direction:column;position:relative}.autocomplate-module_autocomplate-content-top__FVgCp{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.autocomplate-module_autocomplate-content-top__FVgCp.autocomplate-module_active__40fdV{border-color:#00236a}.autocomplate-module_autocomplate-content-top__FVgCp:hover{border-color:#3c393e}.autocomplate-module_autocomplate-content-bottom__yk0zP{animation:autocomplate-module_select-show__7Uap4 .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.autocomplate-module_autocomplate-content-bottom-inner__rF5IF{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes autocomplate-module_select-show__7Uap4{to{max-height:400px}}.autocomplate-module_autocomplate-content-bottom-row__dRsZa{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;height:46px;line-height:22px;margin-bottom:2px;padding:0 15px;transition:background .24s,color .24s}.autocomplate-module_autocomplate-content-bottom-row__dRsZa .autocomplate-module_no-option__xv0-E{color:red}.autocomplate-module_autocomplate-content-bottom-row__dRsZa:hover{background:unset;color:#00236a}.autocomplate-module_option-active__WuH4I .autocomplate-module_autocomplate-content-bottom-row__dRsZa{color:#00236a}.autocomplate-module_autocomplate-title__3Qxqz{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.autocomplate-module_errorBorder__LV-nb{border:2px solid #e00!important}.autocomplate-module_errorMessage__Gchpc{color:#e00!important}";
200
- var styles$a = {"autocomplate-content":"autocomplate-module_autocomplate-content__UbIUT","autocomplate-content-top":"autocomplate-module_autocomplate-content-top__FVgCp","active":"autocomplate-module_active__40fdV","autocomplate-content-bottom":"autocomplate-module_autocomplate-content-bottom__yk0zP","select-show":"autocomplate-module_select-show__7Uap4","autocomplate-content-bottom-inner":"autocomplate-module_autocomplate-content-bottom-inner__rF5IF","autocomplate-content-bottom-row":"autocomplate-module_autocomplate-content-bottom-row__dRsZa","no-option":"autocomplate-module_no-option__xv0-E","option-active":"autocomplate-module_option-active__WuH4I","autocomplate-title":"autocomplate-module_autocomplate-title__3Qxqz","errorBorder":"autocomplate-module_errorBorder__LV-nb","errorMessage":"autocomplate-module_errorMessage__Gchpc"};
46
+ var css_248z$b = "";
201
47
  styleInject(css_248z$b);
202
48
 
203
- const Autocomplate = ({
204
- className,
49
+ const File = ({
50
+ name,
205
51
  label,
52
+ maxSize,
206
53
  required,
207
54
  disabled,
208
- jsonOptionsData,
209
- jsonSelectedOptionsData,
210
55
  onChange,
211
- value,
212
- searchCount,
213
- placeHolder,
214
- keyNames,
56
+ className,
57
+ defaultData,
215
58
  errorMesage,
59
+ fileExtensions,
216
60
  ...props
217
61
  }) => {
218
- classnames__default["default"](styles$a.searchBox, className);
219
- const parseSelectedOptionsData = jsonSelectedOptionsData ? JSON.parse(jsonSelectedOptionsData) : {
220
- name: '',
221
- id: ''
222
- };
223
- const [inputValue, setInputValue] = React.useState(parseSelectedOptionsData[keyNames.name]);
224
- const [inputId, setInputId] = React.useState(parseSelectedOptionsData[keyNames.id]);
225
- const [activeOption, setActiveOption] = React.useState(0);
226
- const [showOptions, setShowOptions] = React.useState(false);
227
- const parseOptionsData = jsonOptionsData ? JSON.parse(jsonOptionsData) : [];
228
- React.useEffect(() => {
229
- setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
230
- setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
231
- }, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
232
- const handleChange = e => {
233
- const currentInputValue = e.currentTarget.value;
234
- setInputId(null);
235
- setInputValue(currentInputValue);
236
- setInputId('');
237
- setActiveOption(0);
238
- setShowOptions(true);
239
- onChange({
240
- name: currentInputValue,
241
- id: e.target.id
242
- });
62
+ const pdfImageName = 'https://play-lh.googleusercontent.com/kIwlXqs28otssKK_9AKwdkB6gouex_U2WmtLshTACnwIJuvOqVvJEzewpzuYBXwXQQ';
63
+ const [image, setImage] = React.useState(defaultData ? defaultData.type != 'application/pdf' ? defaultData.url : pdfImageName : null);
64
+ const [error, setError] = React.useState('');
65
+ const [fileName, setFileName] = React.useState('no selected file');
66
+ const handleCheckFile = e => {
67
+ const file = e.target.files;
68
+ if (file[0]) {
69
+ if (file[0].size <= maxSize * Math.pow(2, 20)) {
70
+ if (fileExtensions.includes(file[0].type.split('/')[1])) {
71
+ if (file[0].type === 'application/pdf') {
72
+ setError('');
73
+ onChange({
74
+ file
75
+ });
76
+ setImage(pdfImageName);
77
+ } else {
78
+ setError('');
79
+ onChange({
80
+ file
81
+ });
82
+ setFileName(file[0].name);
83
+ setImage(URL.createObjectURL(file[0]));
84
+ }
85
+ } else {
86
+ setImage(null);
87
+ setError('ֆայլի սխալ ֆորմատ');
88
+ setFileName('no selected file');
89
+ }
90
+ } else {
91
+ setImage(null);
92
+ setError('առավելագույն ծավալ');
93
+ setFileName('no selected file');
94
+ }
95
+ } else {
96
+ setImage(null);
97
+ setError('Ֆայլը ընտրված չէ');
98
+ setFileName('no selected file');
99
+ }
243
100
  };
244
- const handleClick = e => {
245
- setActiveOption(0);
246
- setShowOptions(false);
247
- setInputValue(e.target.innerText);
248
- setInputId(e.target.id);
101
+ const handleRemoveFile = () => {
102
+ setImage(null);
249
103
  onChange({
250
- name: e.target.innerText,
251
- id: e.target.id
104
+ target: null
252
105
  });
106
+ setFileName('no selected file');
107
+ document.querySelector(`.${name}`).value = "";
253
108
  };
254
- let optionList;
255
- if (showOptions && inputValue) {
256
- if (parseOptionsData.length && inputValue.length >= searchCount) {
257
- optionList = /*#__PURE__*/React__default["default"].createElement("div", {
258
- className: `${styles$a['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
259
- }, /*#__PURE__*/React__default["default"].createElement("div", {
260
- className: `${styles$a['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
261
- }, parseOptionsData.map((optionName, index) => {
262
- let className;
263
- if (index === activeOption) {
264
- className = "option-active";
265
- }
266
- return /*#__PURE__*/React__default["default"].createElement("div", {
267
- className: `${styles$a[className]} autocomplate-content-click-rem`,
268
- key: optionName[keyNames.id],
269
- onClick: handleClick
270
- }, /*#__PURE__*/React__default["default"].createElement("div", {
271
- id: optionName[keyNames.id],
272
- className: `${styles$a['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
273
- }, optionName[keyNames.name]));
274
- })));
275
- } else {
276
- optionList = /*#__PURE__*/React__default["default"].createElement("div", {
277
- className: `${styles$a['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
278
- }, /*#__PURE__*/React__default["default"].createElement("div", {
279
- className: `${styles$a['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
280
- }, /*#__PURE__*/React__default["default"].createElement("div", {
281
- className: `${styles$a['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
282
- }, /*#__PURE__*/React__default["default"].createElement("div", {
283
- className: `${styles$a['no-option']} autocomplate-no-option`
284
- }, inputValue.length < searchCount ? `Լրացնել առնվազն ${searchCount} նիշ` : 'Նման տվյալ առկա չէ'))));
285
- }
286
- }
287
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
288
- className: `${styles$a['autocomplate-title']} autocomplate-title-rem`
109
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
110
+ className: `${styles$b['file-form-title']} ile-form-title-rem`
289
111
  }, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
290
112
  style: {
291
113
  color: "#ee0000"
292
114
  }
293
- }, "*")) : "", /*#__PURE__*/React__default["default"].createElement("div", {
294
- className: `${styles$a['autocomplate-content']} autocomplate-content-rem`
295
- }, /*#__PURE__*/React__default["default"].createElement("input", _extends({
296
- id: inputId,
297
- type: "text",
298
- className: `${styles$a['autocomplate-content-top']} autocomplate-content-top-rem ${errorMesage ? styles$a.errorBorder : ''}`,
115
+ }, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
116
+ className: classnames__default["default"](`${styles$b['file-form-wrap']} file-form-wrap-rem`, image ? styles$b['active'] : '')
117
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
118
+ onChange: e => console.log(e),
119
+ className: `${styles$b['file-form']} file-form-rem ${errorMesage ? styles$b['error'] : ''}`,
120
+ onClick: () => document.querySelector(`.${name}`).click()
121
+ }, /*#__PURE__*/React__default["default"].createElement("input", {
122
+ hidden: true,
123
+ type: "file",
124
+ className: name,
299
125
  disabled: disabled,
300
- onChange: handleChange,
301
- onClick: () => {
302
- setShowOptions(!showOptions);
303
- },
304
- value: inputValue,
305
- placeholder: placeHolder
306
- }, props)), errorMesage ? /*#__PURE__*/React__default["default"].createElement("span", {
307
- className: styles$a.errorMessage
308
- }, errorMesage) : null, optionList));
126
+ onChange: e => handleCheckFile(e)
127
+ }), image ? /*#__PURE__*/React__default["default"].createElement("div", {
128
+ className: `${styles$b['upload-file-content']} upload-file-content-rem`
129
+ }, /*#__PURE__*/React__default["default"].createElement("img", {
130
+ src: image,
131
+ alt: fileName
132
+ })) : /*#__PURE__*/React__default["default"].createElement("div", {
133
+ className: `${styles$b['file-form-inner-upload']} ile-form-inner-upload-rem`
134
+ }, /*#__PURE__*/React__default["default"].createElement("img", {
135
+ src: "../../assets/upload.svg",
136
+ alt: ""
137
+ }), /*#__PURE__*/React__default["default"].createElement("span", {
138
+ className: `${styles$b['upload-info']} upload-info-rem`
139
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
140
+ className: `${styles$b['upload-info-txt']} upload-info-txt-rem`
141
+ }, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default["default"].createElement("span", {
142
+ className: `${styles$b['upload-info-size']} upload-info-size-rem`
143
+ }, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), /*#__PURE__*/React__default["default"].createElement("div", {
144
+ className: `${styles$b['delete-upload-icon']} delete-upload-icon-rem`,
145
+ onClick: handleRemoveFile
146
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
147
+ className: "icon-delete"
148
+ })), errorMesage || error ? /*#__PURE__*/React__default["default"].createElement("span", {
149
+ style: {
150
+ color: 'red'
151
+ }
152
+ }, errorMesage || error) : null));
309
153
  };
310
- Autocomplate.propTypes = {
311
- className: PropTypes__default["default"].string,
154
+ File.propTypes = {
312
155
  label: PropTypes__default["default"].string,
313
- placeHolder: PropTypes__default["default"].string,
314
156
  required: PropTypes__default["default"].bool,
315
157
  disabled: PropTypes__default["default"].bool,
316
- jsonOptionsData: PropTypes__default["default"].string,
317
- jsonSelectedOptionsData: PropTypes__default["default"].string,
318
158
  onChange: PropTypes__default["default"].func,
319
- value: PropTypes__default["default"].string,
320
- searchCount: PropTypes__default["default"].number,
321
- keyNames: PropTypes__default["default"].object,
322
- errorMesage: PropTypes__default["default"].string
159
+ maxSize: PropTypes__default["default"].number,
160
+ className: PropTypes__default["default"].string,
161
+ errorMesage: PropTypes__default["default"].string,
162
+ defaultData: PropTypes__default["default"].object,
163
+ fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
323
164
  };
324
- Autocomplate.defaultProps = {
325
- required: false
165
+ File.defaultProps = {
166
+ maxSize: 5,
167
+ required: false,
168
+ fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
326
169
  };
327
170
 
328
- var css_248z$a = ".checkbox-module_checkbox-wrap__Xrg-m{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.checkbox-module_checkbox-wrap__Xrg-m>input{height:0;opacity:0;position:absolute;width:0}.checkbox-module_checkbox-wrap__Xrg-m .checkbox-module_checkmark__M8DY6{border:1px solid #d9d9d9;border-radius:3px;bottom:0;display:inline-block;height:14px;left:0;margin:auto 4px auto auto;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.checkbox-module_checkbox-wrap__Xrg-m>.checkbox-module_checkmark__M8DY6:after{border:solid #1890ff;border-width:0 2px 2px 0;content:\"\";display:block;height:8px;left:4px;opacity:0;position:absolute;top:1px;transform:rotate(45deg);transition:opacity .24s;width:4px}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6:after{opacity:1}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6,.checkbox-module_checkbox-wrap__Xrg-m:hover input~.checkbox-module_checkmark__M8DY6{border-color:#1890ff}";
329
- var styles$9 = {"checkbox-wrap":"checkbox-module_checkbox-wrap__Xrg-m","checkmark":"checkbox-module_checkmark__M8DY6"};
171
+ var css_248z$a = ".table-module_table-wrap__KKAnM{background:#fff;border-radius:14px 14px 0 0;box-shadow:0 10px 30px rgba(0,35,106,.06);overflow:hidden;width:100%}.table-module_table-wrap__KKAnM:not(:first-child){margin-top:30px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:first-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:first-child{flex:0 0 auto;width:60px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(2),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(2){flex:0 0 auto;width:120px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(3),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(3){flex:0 0 auto;width:170px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(4),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(4){flex:0 0 auto;width:126px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(5),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(6),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(8),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(5),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(6),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(8){flex:0 0 auto;width:100px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:last-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:last-child{flex:0 0 auto;width:104px}.table-module_table-top__tfEKM{background:#00236a;height:44px;width:100%}.table-module_table-top__tfEKM .table-module_table-items__UpFg2{align-items:center;color:#fff;display:flex;flex:1 1;font-size:15px;justify-content:center;line-height:17px;text-align:center}.table-module_table-bottom-inner__0Pus0{background:#fff;min-height:40px;width:100%}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2{align-items:center;border-bottom:1px solid #eee;display:flex;flex:1 1;font-size:14px;justify-content:center;line-height:16px;padding:4px;text-align:center}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:not(:last-child){border-right:1px solid #eee}";
172
+ var styles$a = {"table-wrap":"table-module_table-wrap__KKAnM","table-bottom-inner":"table-module_table-bottom-inner__0Pus0","table-items":"table-module_table-items__UpFg2","table-top":"table-module_table-top__tfEKM"};
330
173
  styleInject(css_248z$a);
331
174
 
332
- const Checkbox = ({
333
- disabled,
334
- required,
175
+ function _extends() {
176
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
177
+ for (var i = 1; i < arguments.length; i++) {
178
+ var source = arguments[i];
179
+ for (var key in source) {
180
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
181
+ target[key] = source[key];
182
+ }
183
+ }
184
+ }
185
+ return target;
186
+ };
187
+ return _extends.apply(this, arguments);
188
+ }
189
+
190
+ var css_248z$9 = ".checkbox-module_checkbox-wrap__Xrg-m{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.checkbox-module_checkbox-wrap__Xrg-m>input{height:0;opacity:0;position:absolute;width:0}.checkbox-module_checkbox-wrap__Xrg-m .checkbox-module_checkmark__M8DY6{border:1px solid #d9d9d9;border-radius:3px;bottom:0;display:inline-block;height:14px;left:0;margin:auto 4px auto auto;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.checkbox-module_checkbox-wrap__Xrg-m>.checkbox-module_checkmark__M8DY6:after{border:solid #1890ff;border-width:0 2px 2px 0;content:\"\";display:block;height:8px;left:4px;opacity:0;position:absolute;top:1px;transform:rotate(45deg);transition:opacity .24s;width:4px}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6:after{opacity:1}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6,.checkbox-module_checkbox-wrap__Xrg-m:hover input~.checkbox-module_checkmark__M8DY6{border-color:#1890ff}";
191
+ var styles$9 = {"checkbox-wrap":"checkbox-module_checkbox-wrap__Xrg-m","checkmark":"checkbox-module_checkmark__M8DY6"};
192
+ styleInject(css_248z$9);
193
+
194
+ const Checkbox = ({
195
+ disabled,
196
+ required,
335
197
  className,
336
198
  name,
337
199
  value,
@@ -413,288 +275,406 @@ Checkbox.defaultProps = {
413
275
  jsonData: '[{"value":"email", "name":"contact1", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact2", "label":"Phone", "id":"contactChoice2"}]'
414
276
  };
415
277
 
416
- var css_248z$9 = "";
417
- styleInject(css_248z$9);
278
+ const Table = ({
279
+ className,
280
+ onChange,
281
+ config,
282
+ jsonData,
283
+ hearderData,
284
+ keyNames,
285
+ actions,
286
+ ...props
287
+ }) => {
288
+ classnames__default["default"](className);
289
+ let tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
290
+ React.useEffect(() => {
291
+ tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
292
+ }, [jsonData]);
293
+ const [checked, setChecked] = React.useState(config.isCheckbox && config.isCheckbox.checked ? config.isCheckbox.checked : []);
294
+ config.isCheckbox && config.isCheckbox.showCheckbox == undefined ? config.isCheckbox.showCheckbox = () => {
295
+ return true;
296
+ } : "";
297
+ return /*#__PURE__*/React__default["default"].createElement("div", {
298
+ className: `${styles$a["table-wrap"]} table-wrap-rem`
299
+ }, config.isHeader && hearderData.map((header, key) => {
300
+ return /*#__PURE__*/React__default["default"].createElement("div", {
301
+ className: `${styles$a["table-top"]} table-top-rem`,
302
+ key: key
303
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
304
+ className: `${styles$a["table-items"]} table-items-rem`
305
+ }, header));
306
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
307
+ className: `${styles$a["table-bottom"]} table-bottom-rem`
308
+ }, tbodyData.map((item, key) => {
309
+ return /*#__PURE__*/React__default["default"].createElement("div", {
310
+ className: `${styles$a["table-bottom-inner"]} table-bottom-inner-rem`,
311
+ key: key
312
+ }, keyNames.map((keyName, keyNameKey) => {
313
+ return /*#__PURE__*/React__default["default"].createElement("div", {
314
+ className: `${styles$a["table-items"]} table-items-rem`,
315
+ key: keyNameKey
316
+ }, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/React__default["default"].createElement(Checkbox, {
317
+ onClick: e => {
318
+ const id = e.target.id;
319
+ const checkedValue = e.target.checked;
320
+ let ch = [...checked];
321
+ checkedValue ? ch.push(Number(id)) : ch.splice(ch.indexOf(id), 1);
322
+ setChecked(ch);
323
+ config.isCheckbox.onChange(ch);
324
+ },
325
+ jsonData: `[{"value":"", "name":"", "label":"", "id":${item.id}, "checked":${checked.indexOf(item.id) > -1 ? true : false}}]`
326
+ }), typeof keyName === "string" ? item[keyName] : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("i", {
327
+ className: keyName.icon
328
+ }), item[keyName.name]));
329
+ }), actions && /*#__PURE__*/React__default["default"].createElement("div", {
330
+ className: `${styles$a["table-items"]} table-items-rem`
331
+ }, actions.filter(a => a.show && a.show(item) || a.show === undefined).map((action, key) => {
332
+ return /*#__PURE__*/React__default["default"].createElement("div", {
333
+ key: key
334
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
335
+ className: action.icon,
336
+ onClick: action.click ? action.click : () => {}
337
+ }, action.icon));
338
+ })));
339
+ })));
340
+ };
341
+ Table.propTypes = {
342
+ className: PropTypes__default["default"].string,
343
+ onChange: PropTypes__default["default"].func,
344
+ config: PropTypes__default["default"].object,
345
+ actions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
346
+ jsonData: PropTypes__default["default"].string,
347
+ keyNames: PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOf([PropTypes__default["default"].string, PropTypes__default["default"].object])),
348
+ hearderData: PropTypes__default["default"].array
349
+ };
350
+ Table.defaultProps = {
351
+ className: "",
352
+ onChange: undefined,
353
+ errorMesage: "",
354
+ config: {
355
+ isHeader: true,
356
+ isCheckbox: {
357
+ checked: []
358
+ }
359
+ },
360
+ actions: [],
361
+ jsonData: "",
362
+ keyNames: [],
363
+ hearderData: []
364
+ };
418
365
 
419
- var css_248z$8 = ".input-module_input-wrap__NunrE{max-width:400px;position:relative}.input-module_input__-ipHD{border:none;border-radius:6px;box-shadow:inset 0 0 0 2px #d1d1d1;box-sizing:border-box;color:#3c393e;cursor:text;font-size:16px;line-height:20px;outline:none;overflow:hidden;transition:background-color .24s,color .24s}.input-module_input__-ipHD.input-module_full-size__38YG7{width:100%}.input-module_input__-ipHD.input-module_content-size__rZ5EA{width:auto}.input-module_input__-ipHD.input-module_size-medium__frTDq{min-height:46px;padding:12px 15px}.input-module_input__-ipHD:hover{box-shadow:inset 0 0 0 2px #3c393e}.input-module_input__-ipHD:active{box-shadow:inset 0 0 0 2px #00236a}.input-module_inputErrorMessages__hx490{animation:input-module_error-message-show__OrVSo .24s forwards;bottom:0;color:#e00;font-size:14px;left:0;line-height:19px;position:absolute;transform:scale3d(0,0,0);z-index:1}.input-module_labelInput__sUMKQ{color:#000}.input-module_input__-ipHD.input-module_state-disabled__402v0{background-color:#fbfbfb;pointer-events:none}.input-module_input__-ipHD.input-module_error-message__7NphF{box-shadow:inset 0 0 0 2px #e00}.input-module_input-title__giCsY{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}@keyframes input-module_error-message-show__OrVSo{to{bottom:-20px;transform:scaleX(1)}}";
420
- var styles$8 = {"input-wrap":"input-module_input-wrap__NunrE","input":"input-module_input__-ipHD","full-size":"input-module_full-size__38YG7","content-size":"input-module_content-size__rZ5EA","size-medium":"input-module_size-medium__frTDq","with-icon":"input-module_with-icon__w3jTW","inputErrorMessages":"input-module_inputErrorMessages__hx490","error-message-show":"input-module_error-message-show__OrVSo","labelInput":"input-module_labelInput__sUMKQ","state-disabled":"input-module_state-disabled__402v0","error-message":"input-module_error-message__7NphF","input-title":"input-module_input-title__giCsY"};
366
+ var css_248z$8 = ".modal-module_modal-wrap__IsXXf{background:rgba(0,0,0,.4);height:100%;left:0;position:fixed;top:0;width:100%;z-index:9}.modal-module_modal-top__ntDBi{background:#fbfbfb;box-sizing:border-box;display:flex;flex-direction:row;height:44px;padding:4px 10px 4px 0;width:100%}.modal-module_modal-title__r-WKl{align-items:center;color:#3c393e;display:flex;flex:1 1;font-size:20px;font-weight:500;line-height:24px;padding-right:20px}.modal-module_close-btn__Qf2UD{cursor:pointer;flex:0 0 auto;width:24px}.modal-module_close-btn__Qf2UD,.modal-module_modal-section__Bp8jN{align-items:center;display:flex;height:100%;justify-content:center}.modal-module_modal-section__Bp8jN{flex:1 1;padding:10px 0;width:100%}.modal-module_modal-content__1F-uE{align-items:center;animation:modal-module_show-popup__WrH7a .24s;background:#fff;border-radius:8px;display:flex;flex-direction:column;height:auto;left:0;margin:auto;min-height:130px;overflow:hidden;padding:10px;position:absolute;right:0;top:110px;width:fit-content}@keyframes modal-module_show-popup__WrH7a{0%{transform:translate3d(0,-30%,0)}to{opacity:1;transform:translateZ(0)}}";
367
+ var styles$8 = {"modal-wrap":"modal-module_modal-wrap__IsXXf","modal-top":"modal-module_modal-top__ntDBi","modal-title":"modal-module_modal-title__r-WKl","close-btn":"modal-module_close-btn__Qf2UD","modal-section":"modal-module_modal-section__Bp8jN","modal-content":"modal-module_modal-content__1F-uE","show-popup":"modal-module_show-popup__WrH7a"};
421
368
  styleInject(css_248z$8);
422
369
 
423
- const InputTypes = {
424
- TEXT: "text",
425
- PASSWORD: "password",
426
- EMAIL: "email",
427
- NUMBER: "number",
428
- TEL: "tel"
370
+ const _ = require('lodash');
371
+ const compereConfigs = () => {
372
+ let projectConfig = {};
373
+ let packageConfig = {};
374
+ try {
375
+ packageConfig = require('../tui.config.js');
376
+ } catch (error) {
377
+ // console.log(error, 'Package: tui.config.js file is not define');
378
+ }
379
+ try {
380
+ projectConfig = require('../../../../tui.config.js');
381
+ } catch (error) {
382
+ projectConfig = {};
383
+ // console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
384
+ }
385
+
386
+ return _.merge(packageConfig, projectConfig);
429
387
  };
430
- const InputSizes = {
431
- SMALL: "size-small",
432
- MEDIUM: "size-medium",
433
- LARGE: "size-large"
388
+
389
+ const TypographyType = {
390
+ p: 'p',
391
+ h1: 'h1',
392
+ h2: 'h2',
393
+ h3: 'h3',
394
+ h4: 'h4',
395
+ h5: 'h5',
396
+ h6: 'h6',
397
+ span: 'span'
434
398
  };
435
- const Input = ({
399
+ const Typography = ({
436
400
  size,
437
401
  color,
402
+ weight,
403
+ onClick,
404
+ variant,
405
+ children,
406
+ className,
407
+ ...props
408
+ }) => {
409
+ const configStyles = compereConfigs();
410
+ const classProps = classnames__default["default"](className);
411
+ const [validVariant, setValidVariant] = React.useState(false);
412
+ const [style, setStyle] = React.useState({
413
+ fontSize: size ? size : configStyles.TYPOGRAPHY['fSize' + variant],
414
+ fontWeight: weight ? weight : configStyles.TYPOGRAPHY['fWeight' + variant]
415
+ });
416
+ React.useEffect(() => {
417
+ if (!Object.values(TypographyType).includes(variant)) {
418
+ setValidVariant(true);
419
+ }
420
+ }, [variant]);
421
+ React.useEffect(() => {
422
+ if (color) {
423
+ setStyle(prev => {
424
+ return {
425
+ ...prev,
426
+ color: color
427
+ };
428
+ });
429
+ }
430
+ }, [color]);
431
+ const tagT = /*#__PURE__*/React__default["default"].createElement(variant, {
432
+ style,
433
+ ...props,
434
+ className: classProps,
435
+ onClick: onClick ? onClick : _ => _
436
+ }, [children]);
437
+ return validVariant ? 'Please set Typography valid variant' : tagT;
438
+ };
439
+ Typography.propTypes = {
440
+ size: PropTypes__default["default"].string,
441
+ color: PropTypes__default["default"].string,
442
+ weight: PropTypes__default["default"].string,
443
+ onClick: PropTypes__default["default"].func,
444
+ className: PropTypes__default["default"].string,
445
+ variant: PropTypes__default["default"].oneOf(Object.values(TypographyType)).isRequired
446
+ };
447
+
448
+ const Modal = ({
449
+ setShow,
450
+ headerText,
438
451
  className,
452
+ type,
453
+ data,
454
+ selected,
455
+ children
456
+ }) => {
457
+ classnames__default["default"](styles$8.modal, className);
458
+ const [select, setSelect] = React.useState(selected);
459
+ return /*#__PURE__*/React__default["default"].createElement("div", {
460
+ className: `${styles$8["modal-wrap"]} modal-wrap-rem`,
461
+ onClick: () => setShow(false)
462
+ }, type == "content" ? /*#__PURE__*/React__default["default"].createElement("div", {
463
+ className: `${styles$8["modal-content"]} modal-content-rem`,
464
+ onClick: e => {
465
+ e.stopPropagation();
466
+ }
467
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
468
+ className: `${styles$8["modal-top"]} modal-top-rem`
469
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
470
+ className: `${styles$8["modal-title"]} modal-title-rem`
471
+ }, /*#__PURE__*/React__default["default"].createElement(Typography, {
472
+ variant: TypographyType.p,
473
+ color: "#00236A"
474
+ }, headerText)), /*#__PURE__*/React__default["default"].createElement("div", {
475
+ className: `${styles$8["close-btn"]} close-btn-rem`,
476
+ onClick: () => setShow(false)
477
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
478
+ className: "icon-close"
479
+ }))), /*#__PURE__*/React__default["default"].createElement("div", {
480
+ className: `${styles$8["modal-section"]} modal-section-rem`
481
+ }, children)) : type == "images" ? /*#__PURE__*/React__default["default"].createElement("div", {
482
+ className: `${styles$8["modal-content"]} modal-content-rem`,
483
+ onClick: e => {
484
+ e.stopPropagation();
485
+ }
486
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
487
+ className: `${styles$8["close-btn"]} close-btn-rem`,
488
+ onClick: () => setShow(false)
489
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
490
+ className: "icon-close"
491
+ })), /*#__PURE__*/React__default["default"].createElement("div", {
492
+ className: `${styles$8["modal-section"]} modal-section-rem`
493
+ }, /*#__PURE__*/React__default["default"].createElement("div", null, select > 1 ? /*#__PURE__*/React__default["default"].createElement("h1", {
494
+ onClick: () => setSelect(select - 1)
495
+ }, "-") : null, data.map(elem => {
496
+ if (select == elem.id) {
497
+ return /*#__PURE__*/React__default["default"].createElement("img", {
498
+ width: "600px",
499
+ key: elem.id,
500
+ src: elem.url
501
+ });
502
+ }
503
+ }), select < data.length ? /*#__PURE__*/React__default["default"].createElement("h1", {
504
+ onClick: () => {
505
+ setSelect(select + 1);
506
+ }
507
+ }, "+") : null))) : null);
508
+ };
509
+ Modal.propTypes = {
510
+ setShow: PropTypes__default["default"].func,
511
+ headerText: PropTypes__default["default"].string,
512
+ className: PropTypes__default["default"].string,
513
+ type: PropTypes__default["default"].string,
514
+ selected: PropTypes__default["default"].string,
515
+ data: PropTypes__default["default"].array
516
+ };
517
+
518
+ var css_248z$7 = ".input-module_input-wrap__NunrE{width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}.input-module_input-title__giCsY{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px}.input-module_inputErrorMessages__hx490{color:#e00;font-size:14px;line-height:19px}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}";
519
+ var styles$7 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","input-title":"input-module_input-title__giCsY","inputErrorMessages":"input-module_inputErrorMessages__hx490"};
520
+ styleInject(css_248z$7);
521
+
522
+ const InputTypes = {
523
+ TEXT: "text",
524
+ PASSWORD: "password"
525
+ };
526
+ const Input = ({
527
+ type,
528
+ name,
529
+ color,
439
530
  label,
440
- regexp,
441
- regexpError,
442
- errorMesage,
531
+ value,
532
+ width,
533
+ height,
534
+ radius,
535
+ border,
536
+ padding,
537
+ tooltip,
538
+ bgColor,
539
+ leftIcon,
540
+ fontSize,
443
541
  required,
444
- showEye,
445
542
  disabled,
446
- type,
447
- tooltip,
448
543
  onChange,
449
- value,
544
+ iconWidth,
545
+ rightIcon,
546
+ className,
547
+ boxSizing,
548
+ boxShadow,
549
+ errorMesage,
550
+ borderColor,
551
+ placeholder,
552
+ autoComplete,
553
+ boxShadowHover,
450
554
  ...props
451
555
  }) => {
452
- const [inputValue, setInputValue] = React.useState(value);
453
- const [eyeStatus, setEyeStatus] = React.useState("");
556
+ const [show, setShow] = React.useState(false);
557
+ const [isHover, setIsHover] = React.useState(false);
454
558
  const [tooltipStatus, setTooltipStatus] = React.useState(false);
559
+ const random = Math.floor(Math.random() * 1000 + 1);
560
+ const configStyles = compereConfigs();
561
+ const classProps = classnames__default["default"](className);
455
562
  const handleChange = event => {
456
- setInputValue(event.target.value);
457
- onChange ? onChange(event.target.value) : "";
563
+ onChange ? onChange(event.target.value) : _ => _;
458
564
  };
459
- document.onmouseup = () => {
460
- setEyeStatus("");
565
+ const handleMouseEnter = () => {
566
+ setIsHover(true);
567
+ };
568
+ const handleMouseLeave = () => {
569
+ setIsHover(false);
461
570
  };
462
- React.useEffect(() => {
463
- setInputValue(value);
464
- }, [value]);
465
- let eMessage = "";
466
- if (errorMesage) {
467
- eMessage = errorMesage;
468
- } else if (regexp) {
469
- const regex = new RegExp(regexp);
470
- eMessage = regex.test(inputValue) ? "" : regexpError;
471
- }
472
- const classProps = classnames__default["default"](styles$8.input, styles$8[size], eMessage != "" ? styles$8["error-message"] : "", className, "input-inner-rem");
473
571
  return /*#__PURE__*/React__default["default"].createElement("div", {
474
- className: `${styles$8["input-wrap"]} input-wrap-rem`
572
+ className: `${styles$7["input-wrap"]}`
475
573
  }, label ? /*#__PURE__*/React__default["default"].createElement("label", {
476
- className: `${styles$8["input-title"]} input-title-rem`
574
+ className: `${styles$7["input-title"]}`
477
575
  }, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
478
576
  style: {
479
577
  color: "#ee0000"
480
578
  }
481
- }, "*")) : "", /*#__PURE__*/React__default["default"].createElement("input", _extends({}, props, {
482
- type: eyeStatus || type,
483
- className: classProps,
484
- style: color && {
485
- color
579
+ }, "*")) : '', /*#__PURE__*/React__default["default"].createElement("div", {
580
+ className: `${styles$7["input-content"]}`,
581
+ style: {
582
+ borderRadius: radius ? radius : configStyles.INPUT.radius,
583
+ boxShadow: isHover ? boxShadowHover ? boxShadowHover : configStyles.INPUT.boxShadowHover : boxShadow ? boxShadow : configStyles.INPUT.boxShadow
486
584
  },
487
- disabled: disabled ? disabled : "",
585
+ onMouseEnter: handleMouseEnter,
586
+ onMouseLeave: handleMouseLeave
587
+ }, leftIcon && leftIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
588
+ onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
589
+ onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
590
+ onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
591
+ style: {
592
+ cursor: type === 'password' ? 'pointer' : 'default',
593
+ height: height ? height : configStyles.INPUT.height,
594
+ padding: padding ? padding : configStyles.INPUT.padding,
595
+ width: iconWidth ? iconWidth : configStyles.INPUT.iconWidth,
596
+ boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
597
+ borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
598
+ borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
599
+ backgroundColor: disabled ? '#FBFBFB' : bgColor ? bgColor : configStyles.INPUT.bgColor
600
+ }
601
+ }, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', /*#__PURE__*/React__default["default"].createElement("input", _extends({}, props, {
602
+ value: value,
603
+ className: classProps,
488
604
  onChange: handleChange,
489
- value: inputValue
490
- })), type === "password" && showEye ? /*#__PURE__*/React__default["default"].createElement("p", {
491
- onMouseDown: () => {
492
- setEyeStatus("text");
493
- },
494
- onMouseUp: () => {
495
- setEyeStatus("");
605
+ type: show ? 'text' : type,
606
+ disabled: disabled ? disabled : "",
607
+ name: name ? name : `tui_${random}_tui`,
608
+ placeholder: placeholder ? placeholder : '',
609
+ autoComplete: autoComplete ? autoComplete : configStyles.INPUT.autoComplete,
610
+ style: {
611
+ border: 'none',
612
+ outline: 'none',
613
+ pointerEvents: disabled ? 'none' : 'auto',
614
+ width: width ? width : configStyles.INPUT.width,
615
+ height: height ? height : configStyles.INPUT.height,
616
+ padding: padding ? padding : configStyles.INPUT.padding,
617
+ borderRadius: radius ? radius : configStyles.INPUT.radius,
618
+ fontSize: fontSize ? fontSize : configStyles.INPUT.fontSize,
619
+ boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
620
+ color: errorMesage ? 'rgba(238, 0, 0, 1)' : color ? color : configStyles.INPUT.color,
621
+ backgroundColor: disabled ? '#FBFBFB' : bgColor ? bgColor : configStyles.INPUT.bgColor
496
622
  }
497
- }, "\uD83D\uDC41") : null, tooltip ? /*#__PURE__*/React__default["default"].createElement(Typography, {
498
- variant: "p",
499
- onClick: () => {
500
- setTooltipStatus(!tooltipStatus);
623
+ })), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
624
+ onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
625
+ onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
626
+ onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
627
+ style: {
628
+ cursor: type === 'password' ? 'pointer' : 'default',
629
+ border: border ? border : configStyles.INPUT.border,
630
+ height: height ? height : configStyles.INPUT.height,
631
+ padding: padding ? padding : configStyles.INPUT.padding,
632
+ width: iconWidth ? iconWidth : configStyles.INPUT.iconWidth,
633
+ boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
634
+ borderTopRightRadius: radius ? radius : configStyles.INPUT.radius,
635
+ borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
636
+ backgroundColor: disabled ? '#FBFBFB' : bgColor ? bgColor : configStyles.INPUT.bgColor
501
637
  }
502
- }, "\u24D8") : null, tooltipStatus ? /*#__PURE__*/React__default["default"].createElement("p", null, tooltip) : null, eMessage ? /*#__PURE__*/React__default["default"].createElement("span", {
503
- className: styles$8.inputErrorMessages
504
- }, eMessage) : "");
638
+ }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? /*#__PURE__*/React__default["default"].createElement(Typography, {
639
+ variant: "p",
640
+ onClick: () => setTooltipStatus(!tooltipStatus)
641
+ }, "\u24D8") : null, tooltipStatus ? /*#__PURE__*/React__default["default"].createElement("p", null, tooltip) : null, errorMesage ? /*#__PURE__*/React__default["default"].createElement("span", {
642
+ className: styles$7.inputErrorMessages
643
+ }, errorMesage) : "");
505
644
  };
506
645
  Input.propTypes = {
507
- type: PropTypes__default["default"].oneOf(Object.values(InputTypes)),
508
- size: PropTypes__default["default"].oneOf(Object.values(InputSizes)),
646
+ name: PropTypes__default["default"].string,
509
647
  color: PropTypes__default["default"].string,
510
- className: PropTypes__default["default"].string,
648
+ value: PropTypes__default["default"].string,
649
+ width: PropTypes__default["default"].string,
650
+ label: PropTypes__default["default"].string,
511
651
  onChange: PropTypes__default["default"].func,
512
652
  required: PropTypes__default["default"].bool,
513
- errorMesage: PropTypes__default["default"].string,
514
- regexp: PropTypes__default["default"].string,
515
- regexpError: PropTypes__default["default"].string,
516
- label: PropTypes__default["default"].string.isRequired,
517
653
  disabled: PropTypes__default["default"].bool,
518
- value: PropTypes__default["default"].string,
519
- showEye: PropTypes__default["default"].bool,
520
- tooltip: PropTypes__default["default"].string
654
+ height: PropTypes__default["default"].string,
655
+ radius: PropTypes__default["default"].string,
656
+ bgColor: PropTypes__default["default"].string,
657
+ fontSize: PropTypes__default["default"].string,
658
+ tooltip: PropTypes__default["default"].element,
659
+ className: PropTypes__default["default"].string,
660
+ iconWidth: PropTypes__default["default"].string,
661
+ boxSizing: PropTypes__default["default"].string,
662
+ boxShadow: PropTypes__default["default"].string,
663
+ placeholder: PropTypes__default["default"].string,
664
+ errorMesage: PropTypes__default["default"].string,
665
+ autoComplete: PropTypes__default["default"].string,
666
+ boxShadowHover: PropTypes__default["default"].string,
667
+ leftIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
668
+ rightIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
669
+ type: PropTypes__default["default"].oneOf(Object.values(InputTypes))
521
670
  };
522
671
  Input.defaultProps = {
523
- label: "",
524
- color: null,
525
- size: InputSizes.MEDIUM,
526
- onChange: undefined,
527
- required: false,
528
- errorMesage: "",
529
- type: "text",
530
- value: ""
672
+ type: "text"
531
673
  };
532
674
 
533
- var css_248z$7 = ".pagination-module_listItem__b1-WN:focus{background-color:#4caf50;color:#fff}.pagination-module_listItem__b1-WN:hover:not(.pagination-module_active__KwBDp){background-color:#ddd}.pagination-module_pagination-bar__MrtYT{display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px;justify-content:center}.pagination-module_pagination-btn__w8Yh8{border:none;border-radius:6px;outline:none}.pagination-module_pagination-btn__w8Yh8,.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{align-items:center;background-color:#fff;box-shadow:0 0 0 1px #eee;cursor:pointer;display:flex;height:34px;justify-content:center;width:34px}.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{border-radius:6px;flex:0 0 auto;font-size:13px;line-height:16px;position:relative;transition:background-color .24s}.pagination-module_pagination-item__t3emS:hover{background-color:#eee}.pagination-module_pagination-item__t3emS.pagination-module_selected__EXzCA{background-color:#00236a;color:#fff}.pagination-module_pagination-jump-next-arrow__aEVD8,.pagination-module_pagination-jump-next-txt__e7nFj{align-items:center;bottom:0;display:flex;font-size:12px;justify-content:center;left:0;line-height:14px;margin:auto;position:absolute;right:0;top:0;transition:opacity .24s,color .24s}.pagination-module_pagination-jump-next-arrow__aEVD8{opacity:0}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-arrow__aEVD8{opacity:1}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-txt__e7nFj{opacity:0}i{color:#3c393e;font-size:12px;line-height:12px}";
534
- var styles$7 = {"listItem":"pagination-module_listItem__b1-WN","active":"pagination-module_active__KwBDp","pagination-bar":"pagination-module_pagination-bar__MrtYT","pagination-btn":"pagination-module_pagination-btn__w8Yh8","pagination-item":"pagination-module_pagination-item__t3emS","pagination-jump-next":"pagination-module_pagination-jump-next__LAb9Z","selected":"pagination-module_selected__EXzCA","pagination-jump-next-txt":"pagination-module_pagination-jump-next-txt__e7nFj","pagination-jump-next-arrow":"pagination-module_pagination-jump-next-arrow__aEVD8"};
535
- styleInject(css_248z$7);
536
-
537
- // import styles from "./pagination.module.scss";
538
-
539
- const Dots = "...";
540
- const range = (start, end) => {
541
- const length = end - start + 1;
542
- return Array.from({
543
- length
544
- }, (_, idx) => idx + start);
545
- };
546
- const PaginationRange = ({
547
- currentTotalCount,
548
- offset,
549
- siblingCountNumber,
550
- currentPageNumber
551
- }) => {
552
- const paginationRange = React.useMemo(() => {
553
- const totalPageCount = Math.ceil(currentTotalCount / offset);
554
-
555
- //currentPage + 2*Dots + start + end = 5
556
- const totalPageNumber = siblingCountNumber + 5;
557
- if (totalPageNumber >= totalPageCount) {
558
- return range(1, totalPageCount);
559
- }
560
- const rightSiblingIndex = Math.min(currentPageNumber + siblingCountNumber, totalPageCount);
561
- const leftSiblingIndex = Math.max(currentPageNumber - siblingCountNumber, 1);
562
- const shouldShowLeftDots = leftSiblingIndex > 2;
563
- const shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
564
- const firstPageIndex = 1;
565
- const lastPageIndex = totalPageCount;
566
- if (!shouldShowLeftDots && shouldShowRightDots) {
567
- let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
568
- let leftRange = range(1, leftItemCount);
569
- return [...leftRange, Dots, totalPageCount];
570
- }
571
- if (shouldShowLeftDots && !shouldShowRightDots) {
572
- let rightItemCount = 0;
573
- currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
574
- let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
575
- return [firstPageIndex, Dots, ...rightRange];
576
- }
577
- if (shouldShowLeftDots && shouldShowRightDots) {
578
- let middleRange = range(leftSiblingIndex, rightSiblingIndex);
579
- return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
580
- }
581
- }, [currentTotalCount, offset, siblingCountNumber, currentPageNumber]);
582
- return paginationRange;
583
- };
584
-
585
- const Pagination = ({
586
- onChange,
587
- totalCount,
588
- siblingCount,
589
- currentPage,
590
- offset,
591
- className
592
- }) => {
593
- const [siblingCountNumber, setSibilingCountNumber] = React.useState(siblingCount);
594
- const [currentPageNumber, setCurrentPage] = React.useState(currentPage);
595
- const [currentTotalCount, setcurrentTotalCount] = React.useState(totalCount);
596
- React.useEffect(() => {
597
- setcurrentTotalCount(totalCount);
598
- }, [totalCount]);
599
- React.useEffect(() => {
600
- setSibilingCountNumber(siblingCount);
601
- }, [siblingCount]);
602
- React.useEffect(() => {
603
- setCurrentPage(currentPage);
604
- }, [currentPage]);
605
- const onPageChange = page => {
606
- if (page > 0) {
607
- setCurrentPage(page);
608
- }
609
- };
610
- React.useEffect(() => {
611
- onChange(currentPageNumber);
612
- }, [currentPageNumber]);
613
- const paginationRange = PaginationRange({
614
- currentPageNumber,
615
- currentTotalCount,
616
- siblingCountNumber,
617
- offset
618
- });
619
- if (currentPageNumber === 0 || paginationRange.length < 2) {
620
- return null;
621
- }
622
- const classProps = classnames__default["default"](styles$7.list, className ? className : `${styles$7["pagination-bar"]} pagination-bar-rem`);
623
- const onNext = () => {
624
- onPageChange(currentPageNumber + 1);
625
- };
626
- const onPrevious = () => {
627
- onPageChange(currentPageNumber - 1);
628
- };
629
- const onNextFive = () => {
630
- currentPageNumber !== lastPage - 4 ? onPageChange(currentPageNumber + 5) : onPageChange(currentPageNumber + 4);
631
- };
632
- const onPreviousFive = e => {
633
- currentPageNumber !== 5 ? onPageChange(currentPageNumber - 5) : onPageChange(currentPageNumber - 4);
634
- };
635
- let lastPage = paginationRange[paginationRange.length - 1];
636
- return /*#__PURE__*/React__default["default"].createElement("ul", {
637
- className: classProps
638
- }, /*#__PURE__*/React__default["default"].createElement("button", {
639
- className: `${styles$7["pagination-btn"]} pagination-btn-rem`,
640
- onClick: onPrevious,
641
- disabled: currentPage === 1 ? true : false
642
- }, /*#__PURE__*/React__default["default"].createElement("i", {
643
- className: "icon-arrow-back"
644
- })), paginationRange.map((pageNumber, id) => {
645
- if (pageNumber === Dots) {
646
- let currentPageIndex = paginationRange.indexOf(currentPageNumber);
647
- return /*#__PURE__*/React__default["default"].createElement("li", {
648
- key: id,
649
- className: classnames__default["default"](`${styles$7["pagination-jump-next"]} pagination-jump-next-rem`, styles$7.listItem),
650
- onClick: id < currentPageIndex ? onPreviousFive : onNextFive,
651
- disabled: currentPageIndex === 0 ? true : false
652
- }, id < currentPageIndex ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
653
- className: `${styles$7["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
654
- }, /*#__PURE__*/React__default["default"].createElement("i", {
655
- className: "icon-text"
656
- })), /*#__PURE__*/React__default["default"].createElement("span", {
657
- className: `${styles$7["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
658
- }, /*#__PURE__*/React__default["default"].createElement("i", {
659
- className: "icon-arrow-jump-back"
660
- }))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
661
- className: `${styles$7["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
662
- }, /*#__PURE__*/React__default["default"].createElement("i", {
663
- className: "icon-text"
664
- })), /*#__PURE__*/React__default["default"].createElement("span", {
665
- className: `${styles$7["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
666
- }, /*#__PURE__*/React__default["default"].createElement("i", {
667
- className: "icon-arrow-jump-next"
668
- }))));
669
- }
670
- return /*#__PURE__*/React__default["default"].createElement("li", {
671
- onClick: () => onPageChange(pageNumber),
672
- key: id,
673
- className: classnames__default["default"](`${pageNumber === currentPageNumber ? styles$7.selected : styles$7.listItem}`, `${styles$7["pagination-item"]} pagination-item-rem`)
674
- }, pageNumber);
675
- }), /*#__PURE__*/React__default["default"].createElement("button", {
676
- onClick: onNext,
677
- className: `${styles$7["pagination-btn"]} pagination-btn-rem`,
678
- disabled: currentPageNumber === lastPage ? true : false
679
- }, /*#__PURE__*/React__default["default"].createElement("i", {
680
- className: "icon-arrow"
681
- })));
682
- };
683
- Pagination.propTypes = {
684
- offset: PropTypes__default["default"].number,
685
- totalCount: PropTypes__default["default"].number,
686
- className: PropTypes__default["default"].string,
687
- siblingCount: PropTypes__default["default"].number,
688
- currentPage: PropTypes__default["default"].number
689
- };
690
- Pagination.defaultProps = {
691
- offset: 2,
692
- siblingCount: 2
693
- };
694
-
695
- var css_248z$6 = ".radio-module_radio-wrap__-lO7V{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.radio-module_radio-wrap__-lO7V>input{height:0;opacity:0;position:absolute;width:0}.radio-module_radio-wrap__-lO7V .radio-module_radio-checkmark__Kvol0{border:1px solid #d9d9d9;border-radius:50%;display:inline-block;height:14px;left:0;margin-right:4px;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.radio-module_radio-wrap__-lO7V>.radio-module_radio-checkmark__Kvol0:after{background-color:#d9d9d9;border-radius:50%;bottom:0;content:\"\";height:8px;left:0;margin:auto;opacity:0;position:absolute;right:0;top:0;transition:opacity .24s,background-color .24s;width:8px}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0:after{background-color:#1890ff;opacity:1}.radio-module_radio-wrap__-lO7V:hover input~.radio-module_radio-checkmark__Kvol0:after{opacity:1}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0{border-color:#1890ff}";
696
- var styles$6 = {"radio-wrap":"radio-module_radio-wrap__-lO7V","radio-checkmark":"radio-module_radio-checkmark__Kvol0"};
697
- styleInject(css_248z$6);
675
+ var css_248z$6 = ".radio-module_radio-wrap__-lO7V{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.radio-module_radio-wrap__-lO7V>input{height:0;opacity:0;position:absolute;width:0}.radio-module_radio-wrap__-lO7V .radio-module_radio-checkmark__Kvol0{border:1px solid #d9d9d9;border-radius:50%;display:inline-block;height:14px;left:0;margin-right:4px;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.radio-module_radio-wrap__-lO7V>.radio-module_radio-checkmark__Kvol0:after{background-color:#d9d9d9;border-radius:50%;bottom:0;content:\"\";height:8px;left:0;margin:auto;opacity:0;position:absolute;right:0;top:0;transition:opacity .24s,background-color .24s;width:8px}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0:after{background-color:#1890ff;opacity:1}.radio-module_radio-wrap__-lO7V:hover input~.radio-module_radio-checkmark__Kvol0:after{opacity:1}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0{border-color:#1890ff}";
676
+ var styles$6 = {"radio-wrap":"radio-module_radio-wrap__-lO7V","radio-checkmark":"radio-module_radio-checkmark__Kvol0"};
677
+ styleInject(css_248z$6);
698
678
 
699
679
  const Radio = ({
700
680
  disabled,
@@ -746,109 +726,94 @@ Radio.defaultProps = {
746
726
  jsonData: '[{"value":"email", "name":"contact", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact", "label":"Phone", "id":"contactChoice2"}]'
747
727
  };
748
728
 
749
- var css_248z$5 = "*{margin:0;padding:0}.captcha-module_main__Ys3EH{height:74px;max-width:400px;position:relative;width:100%}.captcha-module_slider__KLYny{-webkit-appearance:none;background:#eee;border-radius:2px;bottom:0;height:4px;left:0;margin:auto 0;outline:none;position:absolute;top:0;width:100%}.captcha-module_slider__KLYny::-webkit-slider-thumb{-webkit-appearance:none;height:30px;position:relative;width:30px;z-index:3}.captcha-module_selector__JFhb4{left:0;z-index:2}.captcha-module_selectBtn__GP1iH,.captcha-module_selector__JFhb4{bottom:0;height:30px;margin:auto 0;position:absolute;top:0;width:30px}.captcha-module_selectBtn__GP1iH{background:#00236a;border:2px solid #fff;border-radius:50%;box-shadow:1px 0 6px rgba(60,57,62,.15);cursor:pointer}.captcha-module_progressBar__mhdtM{background:red;bottom:0;height:4px;left:0;margin:auto 0;position:absolute;top:0;width:auto}.captcha-module_range__k24I2{color:blue;margin-bottom:15px;margin-top:15px}";
750
- var styles$5 = {"main":"captcha-module_main__Ys3EH","slider":"captcha-module_slider__KLYny","selector":"captcha-module_selector__JFhb4","selectBtn":"captcha-module_selectBtn__GP1iH","progressBar":"captcha-module_progressBar__mhdtM","range":"captcha-module_range__k24I2"};
751
- styleInject(css_248z$5);
752
-
753
- const Captcha = ({
754
- onclick,
755
- rangeCount
756
- }) => {
757
- const [data, setData] = React.useState("");
758
- const [right, setRight] = React.useState(false);
759
- let range = rangeCount <= 100 ? rangeCount : 0;
760
- let rangeElement = document.getElementsByClassName(styles$5.range);
761
- React.useEffect(() => {
762
- for (let element of rangeElement) {
763
- element.style.marginLeft = `${range + 60}%`;
764
- element.style.color = data;
765
- }
766
- }, [range, data]);
767
- function sliderInput(event) {
768
- setData(rangeCount == event.target.value ? 'green' : 'indianred');
769
- let selector = document.getElementsByClassName(styles$5.selector);
770
- let selectBtn = document.getElementsByClassName(styles$5.selectBtn);
771
- let progressBar = document.getElementsByClassName(styles$5.progressBar);
772
- selector[0].style.left = event.target.value + '%';
773
- progressBar[0].style.width = event.target.value + '%';
774
- if (rangeCount == event.target.value) {
775
- selectBtn[0].style.background = "pink";
776
- } else {
777
- selectBtn[0].style.background = "red";
778
- }
779
- }
780
- function sliderChange(e) {
781
- setRight(rangeCount == e.target.value ? true : false);
782
- }
783
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
784
- className: styles$5.main
785
- }, /*#__PURE__*/React__default["default"].createElement("div", {
786
- className: styles$5.range
787
- }, /*#__PURE__*/React__default["default"].createElement("i", {
788
- className: "icon-vector-down"
789
- })), /*#__PURE__*/React__default["default"].createElement("input", {
790
- type: "range",
791
- className: styles$5.slider,
792
- onClick: right ? onclick : null,
793
- onInput: sliderInput,
794
- onMouseUp: sliderChange
795
- }), /*#__PURE__*/React__default["default"].createElement("div", {
796
- className: styles$5.selector
797
- }, /*#__PURE__*/React__default["default"].createElement("div", {
798
- className: styles$5.selectBtn
799
- })), /*#__PURE__*/React__default["default"].createElement("div", {
800
- className: styles$5.progressBar
801
- }), /*#__PURE__*/React__default["default"].createElement("div", {
802
- className: styles$5.range
803
- }, /*#__PURE__*/React__default["default"].createElement("i", {
804
- className: "icon-vector-up"
805
- }))));
806
- };
807
- Captcha.propTypes = {
808
- onclick: PropTypes__default["default"].func,
809
- className: PropTypes__default["default"].string,
810
- rangeCount: PropTypes__default["default"].number
811
- };
812
- Captcha.defaultProps = {
813
- onclick: undefined
814
- };
815
-
816
- var css_248z$4 = ".stepper-module_stepper-container__-OVGy>div:last-child:before{display:none}.stepper-module_activeRing__Lzvh1,.stepper-module_bigRing__5GBm0{border-radius:50%;cursor:pointer;height:36px;margin-bottom:36px;position:relative;width:36px}.stepper-module_bigRing__5GBm0{box-shadow:0 0 0 2px #d1d1d1}.stepper-module_bigRing__5GBm0:before{background:#d1d1d1}.stepper-module_activeRing__Lzvh1{box-shadow:0 0 0 2px #00236a}.stepper-module_activeRing__Lzvh1:before{background:#00236a}.stepper-module_activeRing__Lzvh1:before,.stepper-module_bigRing__5GBm0:before{border-radius:20px;bottom:-32px;content:\"\";height:28px;left:0;margin:auto;overflow:hidden;position:absolute;right:0;width:2px}.stepper-module_smallActiveRing__im-XG,.stepper-module_smallRing__u-5a8{border-radius:50%;bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.stepper-module_smallRing__u-5a8{background-color:#d1d1d1;height:14px;width:14px}.stepper-module_smallActiveRing__im-XG{align-items:center;background-color:#00236a;color:#fff;display:flex;height:28px;justify-content:center;width:28px}";
817
- var styles$4 = {"stepper-container":"stepper-module_stepper-container__-OVGy","bigRing":"stepper-module_bigRing__5GBm0","activeRing":"stepper-module_activeRing__Lzvh1","smallRing":"stepper-module_smallRing__u-5a8","smallActiveRing":"stepper-module_smallActiveRing__im-XG"};
818
- styleInject(css_248z$4);
819
-
820
- const Stepper = ({
729
+ const Button = ({
730
+ type,
731
+ color,
732
+ label,
733
+ width,
734
+ height,
735
+ cursor,
736
+ border,
737
+ outline,
738
+ padding,
739
+ onClick,
740
+ fontSize,
741
+ disabled,
821
742
  className,
822
- onChange,
823
- stepLength,
824
- activeSteps
743
+ boxSizing,
744
+ transition,
745
+ contentWidth,
746
+ borderRadius,
747
+ backgroundColor,
748
+ disabledThemeColor,
749
+ disabledThemeBgColor,
750
+ disabledThemeLineColor,
751
+ ...props
825
752
  }) => {
826
- classnames__default["default"](className, 'stepper-inner-rem');
827
- return /*#__PURE__*/React__default["default"].createElement("div", {
828
- className: `${styles$4['stepper-container']} stepper-container-rem`
829
- }, (() => {
830
- let steppers = [];
831
- for (let step = 1; step <= stepLength; step++) {
832
- steppers.push( /*#__PURE__*/React__default["default"].createElement("div", {
833
- className: classnames__default["default"](`${step <= activeSteps ? styles$4.activeRing : styles$4.bigRing}`),
834
- key: step
835
- }, /*#__PURE__*/React__default["default"].createElement("div", {
836
- className: classnames__default["default"](`${step <= activeSteps ? styles$4.smallActiveRing : styles$4.smallRing}`)
837
- }, step <= activeSteps ? step : "")));
753
+ const [isHover, setIsHover] = React.useState(false);
754
+ React.useEffect(() => {
755
+ if (!label) {
756
+ alert('Button component: label prop is required, please add it!!!');
838
757
  }
839
- return steppers;
840
- })());
758
+ }, []);
759
+ const configStyles = compereConfigs();
760
+ const classProps = classnames__default["default"](className);
761
+ const handleMouseEnter = () => {
762
+ setIsHover(true);
763
+ };
764
+ const handleMouseLeave = () => {
765
+ setIsHover(false);
766
+ };
767
+ return /*#__PURE__*/React__default["default"].createElement("button", _extends({
768
+ style: {
769
+ height: height ? height : configStyles.BUTTON.height,
770
+ padding: padding ? padding : configStyles.BUTTON.padding,
771
+ fontSize: fontSize ? fontSize : configStyles.BUTTON.fontSize,
772
+ boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
773
+ transition: transition ? transition : configStyles.BUTTON.transition,
774
+ border: outline ? 'none' : border ? border : configStyles.BUTTON.border,
775
+ width: contentWidth ? 'auto' : width ? width : configStyles.BUTTON.width,
776
+ borderRadius: borderRadius ? borderRadius : configStyles.BUTTON.borderRadius,
777
+ cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
778
+ backgroundColor: (outline || !outline) && disabled ? disabledThemeBgColor ? disabledThemeBgColor : configStyles.BUTTON.disabledThemeBgColor : outline && !disabled ? isHover ? backgroundColor ? backgroundColor : configStyles.BUTTON.bgColor : '#ffffff' : backgroundColor ? backgroundColor : configStyles.BUTTON.bgColor,
779
+ boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledThemeLineColor ? disabledThemeLineColor : configStyles.BUTTON.disabledThemeLineColor}` : `inset 0 0 0 2px ${backgroundColor ? backgroundColor : configStyles.BUTTON.bgColor}` : 'none',
780
+ color: (outline || !outline) && disabled ? disabledThemeColor ? disabledThemeColor : configStyles.BUTTON.disabledThemeColor : outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color : backgroundColor ? backgroundColor : configStyles.BUTTON.bgColor : color ? color : configStyles.BUTTON.color
781
+ },
782
+ type: type ? type : configStyles.BUTTON.type,
783
+ disabled: disabled ? disabled : configStyles.BUTTON.disabled,
784
+ onClick: disabled ? _ => _ : type !== 'submit' ? onClick ? onClick : _ => alert('Add click event handler on Button component') : _ => _,
785
+ onMouseEnter: handleMouseEnter,
786
+ onMouseLeave: handleMouseLeave,
787
+ className: classProps
788
+ }, props), label);
841
789
  };
842
- Stepper.propTypes = {
790
+ Button.propTypes = {
791
+ type: PropTypes__default["default"].string,
792
+ color: PropTypes__default["default"].string,
793
+ width: PropTypes__default["default"].string,
794
+ outline: PropTypes__default["default"].bool,
795
+ onClick: PropTypes__default["default"].func,
796
+ height: PropTypes__default["default"].string,
797
+ cursor: PropTypes__default["default"].string,
798
+ border: PropTypes__default["default"].string,
799
+ disabled: PropTypes__default["default"].bool,
800
+ padding: PropTypes__default["default"].string,
801
+ fontSize: PropTypes__default["default"].string,
802
+ boxSizing: PropTypes__default["default"].string,
843
803
  className: PropTypes__default["default"].string,
844
- onChange: PropTypes__default["default"].func,
845
- stepLength: PropTypes__default["default"].number,
846
- activeSteps: PropTypes__default["default"].number
804
+ transition: PropTypes__default["default"].string,
805
+ contentWidth: PropTypes__default["default"].bool,
806
+ borderRadius: PropTypes__default["default"].string,
807
+ backgroundColor: PropTypes__default["default"].string,
808
+ label: PropTypes__default["default"].string.isRequired,
809
+ disabledThemeColor: PropTypes__default["default"].string,
810
+ disabledThemeBgColor: PropTypes__default["default"].string,
811
+ disabledThemeLineColor: PropTypes__default["default"].string
847
812
  };
848
813
 
849
- var css_248z$3 = ".select-module_select-title__c8bR7{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.select-module_select-content-top__Aw-fB.select-module_active__v2Dce{border-color:#00236a}.select-module_select-content-top__Aw-fB:hover{border-color:#3c393e}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes select-module_select-show__391hQ{to{max-height:400px}}.select-module_select-content-top-text__euajq{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>i{color:#3c393e;font-size:12px!important}.select-module_select-content-top-icon__MBrGK>i:not(:last-child){align-items:center;border-right:1px solid #eee;display:flex;height:22px;margin-right:8px;padding:0 8px}.select-module_select-content-bottom-row__eKq5L{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;line-height:22px;margin-bottom:2px;min-height:46px;padding:0 15px;transition:background .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}.select-module_select-content-bottom-row__eKq5L:hover{background:unset;color:#00236a}.select-module_error-message__-ac6X{border:2px solid #e00!important}.select-module_eMessage__Mm-F7{color:#e00}";
850
- var styles$3 = {"select-title":"select-module_select-title__c8bR7","select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","active":"select-module_active__v2Dce","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-text":"select-module_select-content-top-text__euajq","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L","error-message":"select-module_error-message__-ac6X","eMessage":"select-module_eMessage__Mm-F7"};
851
- styleInject(css_248z$3);
814
+ var css_248z$5 = ".select-module_select-title__c8bR7{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.select-module_select-content-top__Aw-fB.select-module_active__v2Dce{border-color:#00236a}.select-module_select-content-top__Aw-fB:hover{border-color:#3c393e}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes select-module_select-show__391hQ{to{max-height:400px}}.select-module_select-content-top-text__euajq{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>i{color:#3c393e;font-size:12px!important}.select-module_select-content-top-icon__MBrGK>i:not(:last-child){align-items:center;border-right:1px solid #eee;display:flex;height:22px;margin-right:8px;padding:0 8px}.select-module_select-content-bottom-row__eKq5L{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;line-height:22px;margin-bottom:2px;min-height:46px;padding:0 15px;transition:background .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}.select-module_select-content-bottom-row__eKq5L:hover{background:unset;color:#00236a}.select-module_error-message__-ac6X{border:2px solid #e00!important}.select-module_eMessage__Mm-F7{color:#e00}";
815
+ var styles$5 = {"select-title":"select-module_select-title__c8bR7","select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","active":"select-module_active__v2Dce","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-text":"select-module_select-content-top-text__euajq","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L","error-message":"select-module_error-message__-ac6X","eMessage":"select-module_eMessage__Mm-F7"};
816
+ styleInject(css_248z$5);
852
817
 
853
818
  const SelectTheme = {
854
819
  DEFAULT: 'select-default',
@@ -899,31 +864,31 @@ const Select = ({
899
864
  };
900
865
  }
901
866
  }, [opened]);
902
- classnames__default["default"](styles$3[theme], styles$3[size], {
903
- [styles$3.disabled]: disabled,
904
- [styles$3.required]: required
867
+ classnames__default["default"](styles$5[theme], styles$5[size], {
868
+ [styles$5.disabled]: disabled,
869
+ [styles$5.required]: required
905
870
  }, className);
906
871
  return /*#__PURE__*/React__default["default"].createElement("div", null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
907
- className: `${styles$3['select-title']} select-title-rem`
872
+ className: `${styles$5['select-title']} select-title-rem`
908
873
  }, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
909
874
  style: {
910
875
  color: "#ee0000"
911
876
  }
912
877
  }, "*")) : "", /*#__PURE__*/React__default["default"].createElement("div", {
913
- className: `${styles$3['select-wrap']} select-wrap-rem`,
878
+ className: `${styles$5['select-wrap']} select-wrap-rem`,
914
879
  ref: ref
915
880
  }, /*#__PURE__*/React__default["default"].createElement("div", {
916
- className: styles$3['select-content'],
917
- id: styles$3.selector
881
+ className: styles$5['select-content'],
882
+ id: styles$5.selector
918
883
  }, /*#__PURE__*/React__default["default"].createElement("div", {
919
- className: `${styles$3['select-content-top']} select-content-top-rem ${eMessage ? styles$3['error-message'] : ''}`,
884
+ className: `${styles$5['select-content-top']} select-content-top-rem ${eMessage ? styles$5['error-message'] : ''}`,
920
885
  onClick: () => {
921
886
  setOpened(!opened);
922
887
  }
923
888
  }, /*#__PURE__*/React__default["default"].createElement("div", {
924
- className: `${styles$3['select-content-top-text']} select-content-top-text-rem`
889
+ className: `${styles$5['select-content-top-text']} select-content-top-text-rem`
925
890
  }, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption), /*#__PURE__*/React__default["default"].createElement("div", {
926
- className: `${styles$3['select-content-top-icon']} select-content-top-icon-rem`
891
+ className: `${styles$5['select-content-top-icon']} select-content-top-icon-rem`
927
892
  }, Object.keys(newSelected).length > 0 && /*#__PURE__*/React__default["default"].createElement("i", {
928
893
  className: "icon-close",
929
894
  onClick: e => {
@@ -934,13 +899,13 @@ const Select = ({
934
899
  }), /*#__PURE__*/React__default["default"].createElement("i", {
935
900
  className: opened ? 'icon-icon-up' : 'icon-icon-down'
936
901
  }))), opened && !disabled ? /*#__PURE__*/React__default["default"].createElement("div", {
937
- className: `${styles$3['select-content-bottom']} select-content-bottom-rem`
902
+ className: `${styles$5['select-content-bottom']} select-content-bottom-rem`
938
903
  }, /*#__PURE__*/React__default["default"].createElement("div", {
939
- className: `${styles$3['select-content-bottom-inner']} select-content-bottom-inner-rem`
904
+ className: `${styles$5['select-content-bottom-inner']} select-content-bottom-inner-rem`
940
905
  }, options.map((option, i) => {
941
906
  return /*#__PURE__*/React__default["default"].createElement("div", {
942
907
  key: i,
943
- className: `${styles$3['select-content-bottom-row']} select-content-bottom-row-rem`,
908
+ className: `${styles$5['select-content-bottom-row']} select-content-bottom-row-rem`,
944
909
  disabled: true,
945
910
  onClick: () => {
946
911
  setNewSelected(option);
@@ -950,7 +915,7 @@ const Select = ({
950
915
  defaultValue: option[keyNames.id]
951
916
  }, option[keyNames.name]);
952
917
  }))) : null)), eMessage ? /*#__PURE__*/React__default["default"].createElement("span", {
953
- className: styles$3.eMessage
918
+ className: styles$5.eMessage
954
919
  }, eMessage) : null);
955
920
  };
956
921
  Select.propTypes = {
@@ -972,308 +937,497 @@ Select.defaultProps = {
972
937
  required: false
973
938
  };
974
939
 
975
- var css_248z$2 = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{bottom:0;display:block;height:190px;left:0;margin:auto;max-height:190px;position:absolute;right:0;top:0;width:auto}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
976
- var styles$2 = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
977
- styleInject(css_248z$2);
940
+ var css_248z$4 = ".tooltip-module_tooltip-block__v8U9u{align-items:center;display:flex;justify-content:center;position:relative}.tooltip-module_tooltip__emM6A{padding:10px;position:absolute;z-index:1}.tooltip-module_tooltip-rel__to9gq{align-items:center;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;display:flex;height:auto;justify-content:center;min-height:20px;min-width:50px;position:relative;width:auto}.tooltip-module_tooltip-decor__qvt7t{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;height:10px;position:absolute;transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);width:10px;z-index:-1}";
941
+ var styles$4 = {"tooltip-block":"tooltip-module_tooltip-block__v8U9u","tooltip":"tooltip-module_tooltip__emM6A","tooltip-rel":"tooltip-module_tooltip-rel__to9gq","tooltip-decor":"tooltip-module_tooltip-decor__qvt7t"};
942
+ styleInject(css_248z$4);
978
943
 
979
- const File = ({
980
- name,
981
- label,
982
- maxSize,
983
- required,
984
- disabled,
985
- onChange,
944
+ const Tooltip = ({
945
+ type,
946
+ text,
947
+ width,
948
+ color,
949
+ tIcon,
950
+ height,
951
+ bgColor,
952
+ fontSize,
953
+ tBgColor,
986
954
  className,
987
- defaultData,
988
- errorMesage,
989
- fileExtensions,
990
- ...props
955
+ fontFamily,
956
+ borderRadius,
957
+ tBorderRadius
991
958
  }) => {
992
- const pdfImageName = 'https://play-lh.googleusercontent.com/kIwlXqs28otssKK_9AKwdkB6gouex_U2WmtLshTACnwIJuvOqVvJEzewpzuYBXwXQQ';
993
- const [image, setImage] = React.useState(defaultData ? defaultData.type != 'application/pdf' ? defaultData.url : pdfImageName : null);
994
- const [error, setError] = React.useState('');
995
- const [fileName, setFileName] = React.useState('no selected file');
996
- const handleCheckFile = e => {
997
- const file = e.target.files;
998
- if (file[0]) {
999
- if (file[0].size <= maxSize * Math.pow(2, 20)) {
1000
- if (fileExtensions.includes(file[0].type.split('/')[1])) {
1001
- if (file[0].type === 'application/pdf') {
1002
- setError('');
1003
- onChange({
1004
- file
1005
- });
1006
- setImage(pdfImageName);
1007
- } else {
1008
- setError('');
1009
- onChange({
1010
- file
1011
- });
1012
- setFileName(file[0].name);
1013
- setImage(URL.createObjectURL(file[0]));
1014
- }
1015
- } else {
1016
- setImage(null);
1017
- setError('ֆայլի սխալ ֆորմատ');
1018
- setFileName('no selected file');
1019
- }
1020
- } else {
1021
- setImage(null);
1022
- setError('առավելագույն ծավալ');
1023
- setFileName('no selected file');
1024
- }
1025
- } else {
1026
- setImage(null);
1027
- setError('Ֆայլը ընտրված չէ');
1028
- setFileName('no selected file');
959
+ const tooltipRef = /*#__PURE__*/React.createRef(null);
960
+ const [tooltipWidth, setTooltipWidth] = React.useState(0);
961
+ const [tooltipHeight, setTooltipHeight] = React.useState(0);
962
+ const [showTooltip, setShowTooltip] = React.useState(false);
963
+ const configStyles = compereConfigs();
964
+ const classProps = classnames__default["default"](styles$4['tooltip'], className);
965
+ React.useEffect(_ => {
966
+ if (!type && !text) {
967
+ alert('Add type and text on tooltip');
968
+ } else if (!type) {
969
+ alert('Add type on tooltip');
970
+ } else if (!text) {
971
+ alert('Add text on tooltip');
1029
972
  }
973
+ tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setTooltipWidth(tooltipRef.current.clientWidth);
974
+ tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setTooltipHeight(tooltipRef.current.clientHeight);
975
+ }, [type, text, tooltipWidth, tooltipRef]);
976
+ const handleShow = () => {
977
+ setShowTooltip(!showTooltip);
1030
978
  };
1031
- const handleRemoveFile = () => {
1032
- setImage(null);
1033
- onChange({
1034
- target: null
1035
- });
1036
- setFileName('no selected file');
1037
- document.querySelector(`.${name}`).value = "";
1038
- };
1039
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
1040
- className: `${styles$2['file-form-title']} ile-form-title-rem`
1041
- }, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
979
+ return /*#__PURE__*/React__default["default"].createElement("div", {
980
+ className: `${styles$4['tooltip-block']}`,
1042
981
  style: {
1043
- color: "#ee0000"
982
+ width: width ? width : configStyles.TOOLTIP.width,
983
+ height: height ? height : configStyles.TOOLTIP.height,
984
+ backgroundColor: bgColor ? bgColor : configStyles.TOOLTIP.bgColor
985
+ }
986
+ }, showTooltip ? /*#__PURE__*/React__default["default"].createElement("div", {
987
+ ref: tooltipRef,
988
+ className: classProps,
989
+ style: {
990
+ backgroundColor: tBgColor ? tBgColor : configStyles.TOOLTIP.tBgColor,
991
+ borderRadius: tBorderRadius ? tBorderRadius : configStyles.TOOLTIP.tBorderRadius,
992
+ top: type === 'top' ? `calc(-${tooltipHeight + 7}px)` : type === 'bottom' ? 'calc(100% + 7px)' : type === 'left' || type === 'right' ? `calc(50% - ${tooltipHeight / 2}px)` : '0px',
993
+ left: type === 'top' || type === 'bottom' ? `calc(50% - ${tooltipWidth / 2}px)` : type === 'left' ? `-${tooltipWidth + 7}px` : type === 'right' ? 'calc(100% + 7px)' : '0px'
1044
994
  }
1045
- }, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
1046
- className: classnames__default["default"](`${styles$2['file-form-wrap']} file-form-wrap-rem`, image ? styles$2['active'] : '')
1047
995
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1048
- onChange: e => console.log(e),
1049
- className: `${styles$2['file-form']} file-form-rem ${errorMesage ? styles$2['error'] : ''}`,
1050
- onClick: () => document.querySelector(`.${name}`).click()
1051
- }, /*#__PURE__*/React__default["default"].createElement("input", {
1052
- hidden: true,
1053
- type: "file",
1054
- className: name,
1055
- disabled: disabled,
1056
- onChange: e => handleCheckFile(e)
1057
- }), image ? /*#__PURE__*/React__default["default"].createElement("div", {
1058
- className: `${styles$2['upload-file-content']} upload-file-content-rem`
1059
- }, /*#__PURE__*/React__default["default"].createElement("img", {
1060
- src: image,
1061
- alt: fileName
1062
- })) : /*#__PURE__*/React__default["default"].createElement("div", {
1063
- className: `${styles$2['file-form-inner-upload']} ile-form-inner-upload-rem`
1064
- }, /*#__PURE__*/React__default["default"].createElement("img", {
1065
- src: "../../assets/upload.svg",
1066
- alt: ""
1067
- }), /*#__PURE__*/React__default["default"].createElement("span", {
1068
- className: `${styles$2['upload-info']} upload-info-rem`
1069
- }, /*#__PURE__*/React__default["default"].createElement("span", {
1070
- className: `${styles$2['upload-info-txt']} upload-info-txt-rem`
1071
- }, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default["default"].createElement("span", {
1072
- className: `${styles$2['upload-info-size']} upload-info-size-rem`
1073
- }, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), /*#__PURE__*/React__default["default"].createElement("div", {
1074
- className: `${styles$2['delete-upload-icon']} delete-upload-icon-rem`,
1075
- onClick: handleRemoveFile
1076
- }, /*#__PURE__*/React__default["default"].createElement("i", {
1077
- className: "icon-delete"
1078
- })), errorMesage || error ? /*#__PURE__*/React__default["default"].createElement("span", {
996
+ className: `${styles$4['tooltip-rel']}`
997
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
998
+ className: `${styles$4['tooltip-decor']}`,
1079
999
  style: {
1080
- color: 'red'
1000
+ backgroundColor: tBgColor ? tBgColor : configStyles.TOOLTIP.bgColor,
1001
+ left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
1002
+ top: type === 'top' ? 'calc(100% + 5px)' : type === 'bottom' ? '-15px' : type === 'right' || type === 'left' ? 'calc(50% - 5px)' : '0px'
1081
1003
  }
1082
- }, errorMesage || error) : null));
1004
+ }), /*#__PURE__*/React__default["default"].createElement("p", {
1005
+ style: {
1006
+ color: color ? color : configStyles.TOOLTIP.color,
1007
+ fontSize: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
1008
+ lineHeight: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
1009
+ fontFamily: fontFamily ? fontFamily : configStyles.TOOLTIP.fontFamily
1010
+ }
1011
+ }, text))) : '', /*#__PURE__*/React__default["default"].createElement("div", {
1012
+ style: {
1013
+ cursor: 'pointer'
1014
+ },
1015
+ onClick: handleShow
1016
+ }));
1083
1017
  };
1084
- File.propTypes = {
1085
- label: PropTypes__default["default"].string,
1086
- required: PropTypes__default["default"].bool,
1087
- disabled: PropTypes__default["default"].bool,
1088
- onChange: PropTypes__default["default"].func,
1089
- maxSize: PropTypes__default["default"].number,
1018
+ Tooltip.propTypes = {
1019
+ width: PropTypes__default["default"].string,
1020
+ color: PropTypes__default["default"].string,
1021
+ tIcon: PropTypes__default["default"].element,
1022
+ height: PropTypes__default["default"].string,
1023
+ bgColor: PropTypes__default["default"].string,
1024
+ tBgColor: PropTypes__default["default"].string,
1025
+ fontSize: PropTypes__default["default"].string,
1090
1026
  className: PropTypes__default["default"].string,
1091
- errorMesage: PropTypes__default["default"].string,
1092
- defaultData: PropTypes__default["default"].object,
1093
- fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
1094
- };
1095
- File.defaultProps = {
1096
- maxSize: 5,
1097
- required: false,
1098
- fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
1027
+ fontFamily: PropTypes__default["default"].string,
1028
+ borderRadius: PropTypes__default["default"].string,
1029
+ tBorderRadius: PropTypes__default["default"].string,
1030
+ type: PropTypes__default["default"].string.isRequired,
1031
+ text: PropTypes__default["default"].string.isRequired
1099
1032
  };
1100
1033
 
1101
- var css_248z$1 = ".modal-module_modal-wrap__IsXXf{background:rgba(0,0,0,.4);height:100%;left:0;position:fixed;top:0;width:100%;z-index:9}.modal-module_modal-top__ntDBi{background:#fbfbfb;box-sizing:border-box;display:flex;flex-direction:row;height:44px;padding:4px 10px 4px 0;width:100%}.modal-module_modal-title__r-WKl{align-items:center;color:#3c393e;display:flex;flex:1 1;font-size:20px;font-weight:500;line-height:24px;padding-right:20px}.modal-module_close-btn__Qf2UD{cursor:pointer;flex:0 0 auto;width:24px}.modal-module_close-btn__Qf2UD,.modal-module_modal-section__Bp8jN{align-items:center;display:flex;height:100%;justify-content:center}.modal-module_modal-section__Bp8jN{flex:1 1;padding:10px 0;width:100%}.modal-module_modal-content__1F-uE{align-items:center;animation:modal-module_show-popup__WrH7a .24s;background:#fff;border-radius:8px;display:flex;flex-direction:column;height:auto;left:0;margin:auto;min-height:130px;overflow:hidden;padding:10px;position:absolute;right:0;top:110px;width:fit-content}@keyframes modal-module_show-popup__WrH7a{0%{transform:translate3d(0,-30%,0)}to{opacity:1;transform:translateZ(0)}}";
1102
- var styles$1 = {"modal-wrap":"modal-module_modal-wrap__IsXXf","modal-top":"modal-module_modal-top__ntDBi","modal-title":"modal-module_modal-title__r-WKl","close-btn":"modal-module_close-btn__Qf2UD","modal-section":"modal-module_modal-section__Bp8jN","modal-content":"modal-module_modal-content__1F-uE","show-popup":"modal-module_show-popup__WrH7a"};
1103
- styleInject(css_248z$1);
1034
+ var css_248z$3 = "*{margin:0;padding:0}.captcha-module_main__Ys3EH{height:74px;max-width:400px;position:relative;width:100%}.captcha-module_slider__KLYny{-webkit-appearance:none;background:#eee;border-radius:2px;bottom:0;height:4px;left:0;margin:auto 0;outline:none;position:absolute;top:0;width:100%}.captcha-module_slider__KLYny::-webkit-slider-thumb{-webkit-appearance:none;height:30px;position:relative;width:30px;z-index:3}.captcha-module_selector__JFhb4{left:0;z-index:2}.captcha-module_selectBtn__GP1iH,.captcha-module_selector__JFhb4{bottom:0;height:30px;margin:auto 0;position:absolute;top:0;width:30px}.captcha-module_selectBtn__GP1iH{background:#00236a;border:2px solid #fff;border-radius:50%;box-shadow:1px 0 6px rgba(60,57,62,.15);cursor:pointer}.captcha-module_progressBar__mhdtM{background:red;bottom:0;height:4px;left:0;margin:auto 0;position:absolute;top:0;width:auto}.captcha-module_range__k24I2{color:blue;margin-bottom:15px;margin-top:15px}";
1035
+ var styles$3 = {"main":"captcha-module_main__Ys3EH","slider":"captcha-module_slider__KLYny","selector":"captcha-module_selector__JFhb4","selectBtn":"captcha-module_selectBtn__GP1iH","progressBar":"captcha-module_progressBar__mhdtM","range":"captcha-module_range__k24I2"};
1036
+ styleInject(css_248z$3);
1104
1037
 
1105
- const Modal = ({
1106
- setShow,
1107
- headerText,
1108
- className,
1109
- type,
1110
- data,
1111
- selected,
1112
- children
1038
+ const Captcha = ({
1039
+ onclick,
1040
+ rangeCount
1113
1041
  }) => {
1114
- classnames__default["default"](styles$1.modal, className);
1115
- const [select, setSelect] = React.useState(selected);
1116
- return /*#__PURE__*/React__default["default"].createElement("div", {
1117
- className: `${styles$1["modal-wrap"]} modal-wrap-rem`,
1118
- onClick: () => setShow(false)
1119
- }, type == "content" ? /*#__PURE__*/React__default["default"].createElement("div", {
1120
- className: `${styles$1["modal-content"]} modal-content-rem`,
1121
- onClick: e => {
1122
- e.stopPropagation();
1042
+ const [data, setData] = React.useState("");
1043
+ const [right, setRight] = React.useState(false);
1044
+ let range = rangeCount <= 100 ? rangeCount : 0;
1045
+ let rangeElement = document.getElementsByClassName(styles$3.range);
1046
+ React.useEffect(() => {
1047
+ for (let element of rangeElement) {
1048
+ element.style.marginLeft = `${range + 60}%`;
1049
+ element.style.color = data;
1123
1050
  }
1124
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1125
- className: `${styles$1["modal-top"]} modal-top-rem`
1126
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1127
- className: `${styles$1["modal-title"]} modal-title-rem`
1128
- }, /*#__PURE__*/React__default["default"].createElement(Typography, {
1129
- variant: TypographyType.p,
1130
- color: "#00236A"
1131
- }, headerText)), /*#__PURE__*/React__default["default"].createElement("div", {
1132
- className: `${styles$1["close-btn"]} close-btn-rem`,
1133
- onClick: () => setShow(false)
1134
- }, /*#__PURE__*/React__default["default"].createElement("i", {
1135
- className: "icon-close"
1136
- }))), /*#__PURE__*/React__default["default"].createElement("div", {
1137
- className: `${styles$1["modal-section"]} modal-section-rem`
1138
- }, children)) : type == "images" ? /*#__PURE__*/React__default["default"].createElement("div", {
1139
- className: `${styles$1["modal-content"]} modal-content-rem`,
1140
- onClick: e => {
1141
- e.stopPropagation();
1051
+ }, [range, data]);
1052
+ function sliderInput(event) {
1053
+ setData(rangeCount == event.target.value ? 'green' : 'indianred');
1054
+ let selector = document.getElementsByClassName(styles$3.selector);
1055
+ let selectBtn = document.getElementsByClassName(styles$3.selectBtn);
1056
+ let progressBar = document.getElementsByClassName(styles$3.progressBar);
1057
+ selector[0].style.left = event.target.value + '%';
1058
+ progressBar[0].style.width = event.target.value + '%';
1059
+ if (rangeCount == event.target.value) {
1060
+ selectBtn[0].style.background = "pink";
1061
+ } else {
1062
+ selectBtn[0].style.background = "red";
1142
1063
  }
1064
+ }
1065
+ function sliderChange(e) {
1066
+ setRight(rangeCount == e.target.value ? true : false);
1067
+ }
1068
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1069
+ className: styles$3.main
1143
1070
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1144
- className: `${styles$1["close-btn"]} close-btn-rem`,
1145
- onClick: () => setShow(false)
1071
+ className: styles$3.range
1146
1072
  }, /*#__PURE__*/React__default["default"].createElement("i", {
1147
- className: "icon-close"
1073
+ className: "icon-vector-down"
1074
+ })), /*#__PURE__*/React__default["default"].createElement("input", {
1075
+ type: "range",
1076
+ className: styles$3.slider,
1077
+ onClick: right ? onclick : null,
1078
+ onInput: sliderInput,
1079
+ onMouseUp: sliderChange
1080
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
1081
+ className: styles$3.selector
1082
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1083
+ className: styles$3.selectBtn
1148
1084
  })), /*#__PURE__*/React__default["default"].createElement("div", {
1149
- className: `${styles$1["modal-section"]} modal-section-rem`
1150
- }, /*#__PURE__*/React__default["default"].createElement("div", null, select > 1 ? /*#__PURE__*/React__default["default"].createElement("h1", {
1151
- onClick: () => setSelect(select - 1)
1152
- }, "-") : null, data.map(elem => {
1153
- if (select == elem.id) {
1154
- return /*#__PURE__*/React__default["default"].createElement("img", {
1155
- width: "600px",
1156
- key: elem.id,
1157
- src: elem.url
1158
- });
1159
- }
1160
- }), select < data.length ? /*#__PURE__*/React__default["default"].createElement("h1", {
1161
- onClick: () => {
1162
- setSelect(select + 1);
1163
- }
1164
- }, "+") : null))) : null);
1085
+ className: styles$3.progressBar
1086
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
1087
+ className: styles$3.range
1088
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1089
+ className: "icon-vector-up"
1090
+ }))));
1165
1091
  };
1166
- Modal.propTypes = {
1167
- setShow: PropTypes__default["default"].func,
1168
- headerText: PropTypes__default["default"].string,
1092
+ Captcha.propTypes = {
1093
+ onclick: PropTypes__default["default"].func,
1169
1094
  className: PropTypes__default["default"].string,
1170
- type: PropTypes__default["default"].string,
1171
- selected: PropTypes__default["default"].string,
1172
- data: PropTypes__default["default"].array
1095
+ rangeCount: PropTypes__default["default"].number
1096
+ };
1097
+ Captcha.defaultProps = {
1098
+ onclick: undefined
1173
1099
  };
1174
1100
 
1175
- var css_248z = ".table-module_table-wrap__KKAnM{background:#fff;border-radius:14px 14px 0 0;box-shadow:0 10px 30px rgba(0,35,106,.06);overflow:hidden;width:100%}.table-module_table-wrap__KKAnM:not(:first-child){margin-top:30px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:first-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:first-child{flex:0 0 auto;width:60px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(2),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(2){flex:0 0 auto;width:120px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(3),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(3){flex:0 0 auto;width:170px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(4),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(4){flex:0 0 auto;width:126px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(5),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(6),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(8),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(5),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(6),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(8){flex:0 0 auto;width:100px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:last-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:last-child{flex:0 0 auto;width:104px}.table-module_table-top__tfEKM{background:#00236a;height:44px;width:100%}.table-module_table-top__tfEKM .table-module_table-items__UpFg2{align-items:center;color:#fff;display:flex;flex:1 1;font-size:15px;justify-content:center;line-height:17px;text-align:center}.table-module_table-bottom-inner__0Pus0{background:#fff;min-height:40px;width:100%}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2{align-items:center;border-bottom:1px solid #eee;display:flex;flex:1 1;font-size:14px;justify-content:center;line-height:16px;padding:4px;text-align:center}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:not(:last-child){border-right:1px solid #eee}";
1176
- var styles = {"table-wrap":"table-module_table-wrap__KKAnM","table-bottom-inner":"table-module_table-bottom-inner__0Pus0","table-items":"table-module_table-items__UpFg2","table-top":"table-module_table-top__tfEKM"};
1177
- styleInject(css_248z);
1101
+ var css_248z$2 = ".stepper-module_stepper-container__-OVGy>div:last-child:before{display:none}.stepper-module_activeRing__Lzvh1,.stepper-module_bigRing__5GBm0{border-radius:50%;cursor:pointer;height:36px;margin-bottom:36px;position:relative;width:36px}.stepper-module_bigRing__5GBm0{box-shadow:0 0 0 2px #d1d1d1}.stepper-module_bigRing__5GBm0:before{background:#d1d1d1}.stepper-module_activeRing__Lzvh1{box-shadow:0 0 0 2px #00236a}.stepper-module_activeRing__Lzvh1:before{background:#00236a}.stepper-module_activeRing__Lzvh1:before,.stepper-module_bigRing__5GBm0:before{border-radius:20px;bottom:-32px;content:\"\";height:28px;left:0;margin:auto;overflow:hidden;position:absolute;right:0;width:2px}.stepper-module_smallActiveRing__im-XG,.stepper-module_smallRing__u-5a8{border-radius:50%;bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.stepper-module_smallRing__u-5a8{background-color:#d1d1d1;height:14px;width:14px}.stepper-module_smallActiveRing__im-XG{align-items:center;background-color:#00236a;color:#fff;display:flex;height:28px;justify-content:center;width:28px}";
1102
+ var styles$2 = {"stepper-container":"stepper-module_stepper-container__-OVGy","bigRing":"stepper-module_bigRing__5GBm0","activeRing":"stepper-module_activeRing__Lzvh1","smallRing":"stepper-module_smallRing__u-5a8","smallActiveRing":"stepper-module_smallActiveRing__im-XG"};
1103
+ styleInject(css_248z$2);
1178
1104
 
1179
- const Table = ({
1105
+ const Stepper = ({
1180
1106
  className,
1181
1107
  onChange,
1182
- config,
1183
- jsonData,
1184
- hearderData,
1185
- keyNames,
1186
- actions,
1187
- ...props
1108
+ stepLength,
1109
+ activeSteps
1188
1110
  }) => {
1189
- classnames__default["default"](className);
1190
- let tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
1191
- React.useEffect(() => {
1192
- tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
1193
- }, [jsonData]);
1194
- const [checked, setChecked] = React.useState(config.isCheckbox && config.isCheckbox.checked ? config.isCheckbox.checked : []);
1195
- config.isCheckbox && config.isCheckbox.showCheckbox == undefined ? config.isCheckbox.showCheckbox = () => {
1196
- return true;
1197
- } : "";
1111
+ classnames__default["default"](className, 'stepper-inner-rem');
1198
1112
  return /*#__PURE__*/React__default["default"].createElement("div", {
1199
- className: `${styles["table-wrap"]} table-wrap-rem`
1200
- }, config.isHeader && hearderData.map((header, key) => {
1201
- return /*#__PURE__*/React__default["default"].createElement("div", {
1202
- className: `${styles["table-top"]} table-top-rem`,
1203
- key: key
1204
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1205
- className: `${styles["table-items"]} table-items-rem`
1206
- }, header));
1207
- }), /*#__PURE__*/React__default["default"].createElement("div", {
1208
- className: `${styles["table-bottom"]} table-bottom-rem`
1209
- }, tbodyData.map((item, key) => {
1210
- return /*#__PURE__*/React__default["default"].createElement("div", {
1211
- className: `${styles["table-bottom-inner"]} table-bottom-inner-rem`,
1212
- key: key
1213
- }, keyNames.map((keyName, keyNameKey) => {
1214
- return /*#__PURE__*/React__default["default"].createElement("div", {
1215
- className: `${styles["table-items"]} table-items-rem`,
1216
- key: keyNameKey
1217
- }, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/React__default["default"].createElement(Checkbox, {
1218
- onClick: e => {
1219
- const id = e.target.id;
1220
- const checkedValue = e.target.checked;
1221
- let ch = [...checked];
1222
- checkedValue ? ch.push(Number(id)) : ch.splice(ch.indexOf(id), 1);
1223
- setChecked(ch);
1224
- config.isCheckbox.onChange(ch);
1225
- },
1226
- jsonData: `[{"value":"", "name":"", "label":"", "id":${item.id}, "checked":${checked.indexOf(item.id) > -1 ? true : false}}]`
1227
- }), typeof keyName === "string" ? item[keyName] : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("i", {
1228
- className: keyName.icon
1229
- }), item[keyName.name]));
1230
- }), actions && /*#__PURE__*/React__default["default"].createElement("div", {
1231
- className: `${styles["table-items"]} table-items-rem`
1232
- }, actions.filter(a => a.show && a.show(item) || a.show === undefined).map((action, key) => {
1233
- return /*#__PURE__*/React__default["default"].createElement("div", {
1234
- key: key
1235
- }, /*#__PURE__*/React__default["default"].createElement("i", {
1236
- className: action.icon,
1237
- onClick: action.click ? action.click : () => {}
1238
- }, action.icon));
1239
- })));
1240
- })));
1241
- };
1242
- Table.propTypes = {
1113
+ className: `${styles$2['stepper-container']} stepper-container-rem`
1114
+ }, (() => {
1115
+ let steppers = [];
1116
+ for (let step = 1; step <= stepLength; step++) {
1117
+ steppers.push( /*#__PURE__*/React__default["default"].createElement("div", {
1118
+ className: classnames__default["default"](`${step <= activeSteps ? styles$2.activeRing : styles$2.bigRing}`),
1119
+ key: step
1120
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1121
+ className: classnames__default["default"](`${step <= activeSteps ? styles$2.smallActiveRing : styles$2.smallRing}`)
1122
+ }, step <= activeSteps ? step : "")));
1123
+ }
1124
+ return steppers;
1125
+ })());
1126
+ };
1127
+ Stepper.propTypes = {
1243
1128
  className: PropTypes__default["default"].string,
1244
1129
  onChange: PropTypes__default["default"].func,
1245
- config: PropTypes__default["default"].object,
1246
- actions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
1247
- jsonData: PropTypes__default["default"].string,
1248
- keyNames: PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOf([PropTypes__default["default"].string, PropTypes__default["default"].object])),
1249
- hearderData: PropTypes__default["default"].array
1130
+ stepLength: PropTypes__default["default"].number,
1131
+ activeSteps: PropTypes__default["default"].number
1250
1132
  };
1251
- Table.defaultProps = {
1252
- className: "",
1253
- onChange: undefined,
1254
- errorMesage: "",
1255
- config: {
1256
- isHeader: true,
1257
- isCheckbox: {
1258
- checked: []
1133
+
1134
+ var css_248z$1 = ".pagination-module_listItem__b1-WN:focus{background-color:#4caf50;color:#fff}.pagination-module_listItem__b1-WN:hover:not(.pagination-module_active__KwBDp){background-color:#ddd}.pagination-module_pagination-bar__MrtYT{display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px;justify-content:center}.pagination-module_pagination-btn__w8Yh8{border:none;border-radius:6px;outline:none}.pagination-module_pagination-btn__w8Yh8,.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{align-items:center;background-color:#fff;box-shadow:0 0 0 1px #eee;cursor:pointer;display:flex;height:34px;justify-content:center;width:34px}.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{border-radius:6px;flex:0 0 auto;font-size:13px;line-height:16px;position:relative;transition:background-color .24s}.pagination-module_pagination-item__t3emS:hover{background-color:#eee}.pagination-module_pagination-item__t3emS.pagination-module_selected__EXzCA{background-color:#00236a;color:#fff}.pagination-module_pagination-jump-next-arrow__aEVD8,.pagination-module_pagination-jump-next-txt__e7nFj{align-items:center;bottom:0;display:flex;font-size:12px;justify-content:center;left:0;line-height:14px;margin:auto;position:absolute;right:0;top:0;transition:opacity .24s,color .24s}.pagination-module_pagination-jump-next-arrow__aEVD8{opacity:0}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-arrow__aEVD8{opacity:1}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-txt__e7nFj{opacity:0}i{color:#3c393e;font-size:12px;line-height:12px}";
1135
+ var styles$1 = {"listItem":"pagination-module_listItem__b1-WN","active":"pagination-module_active__KwBDp","pagination-bar":"pagination-module_pagination-bar__MrtYT","pagination-btn":"pagination-module_pagination-btn__w8Yh8","pagination-item":"pagination-module_pagination-item__t3emS","pagination-jump-next":"pagination-module_pagination-jump-next__LAb9Z","selected":"pagination-module_selected__EXzCA","pagination-jump-next-txt":"pagination-module_pagination-jump-next-txt__e7nFj","pagination-jump-next-arrow":"pagination-module_pagination-jump-next-arrow__aEVD8"};
1136
+ styleInject(css_248z$1);
1137
+
1138
+ // import styles from "./pagination.module.scss";
1139
+
1140
+ const Dots = "...";
1141
+ const range = (start, end) => {
1142
+ const length = end - start + 1;
1143
+ return Array.from({
1144
+ length
1145
+ }, (_, idx) => idx + start);
1146
+ };
1147
+ const PaginationRange = ({
1148
+ currentTotalCount,
1149
+ offset,
1150
+ siblingCountNumber,
1151
+ currentPageNumber
1152
+ }) => {
1153
+ const paginationRange = React.useMemo(() => {
1154
+ const totalPageCount = Math.ceil(currentTotalCount / offset);
1155
+
1156
+ //currentPage + 2*Dots + start + end = 5
1157
+ const totalPageNumber = siblingCountNumber + 5;
1158
+ if (totalPageNumber >= totalPageCount) {
1159
+ return range(1, totalPageCount);
1259
1160
  }
1260
- },
1261
- actions: [],
1262
- jsonData: "",
1263
- keyNames: [],
1264
- hearderData: []
1161
+ const rightSiblingIndex = Math.min(currentPageNumber + siblingCountNumber, totalPageCount);
1162
+ const leftSiblingIndex = Math.max(currentPageNumber - siblingCountNumber, 1);
1163
+ const shouldShowLeftDots = leftSiblingIndex > 2;
1164
+ const shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
1165
+ const firstPageIndex = 1;
1166
+ const lastPageIndex = totalPageCount;
1167
+ if (!shouldShowLeftDots && shouldShowRightDots) {
1168
+ let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
1169
+ let leftRange = range(1, leftItemCount);
1170
+ return [...leftRange, Dots, totalPageCount];
1171
+ }
1172
+ if (shouldShowLeftDots && !shouldShowRightDots) {
1173
+ let rightItemCount = 0;
1174
+ currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
1175
+ let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
1176
+ return [firstPageIndex, Dots, ...rightRange];
1177
+ }
1178
+ if (shouldShowLeftDots && shouldShowRightDots) {
1179
+ let middleRange = range(leftSiblingIndex, rightSiblingIndex);
1180
+ return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
1181
+ }
1182
+ }, [currentTotalCount, offset, siblingCountNumber, currentPageNumber]);
1183
+ return paginationRange;
1184
+ };
1185
+
1186
+ const Pagination = ({
1187
+ onChange,
1188
+ totalCount,
1189
+ siblingCount,
1190
+ currentPage,
1191
+ offset,
1192
+ className
1193
+ }) => {
1194
+ const [siblingCountNumber, setSibilingCountNumber] = React.useState(siblingCount);
1195
+ const [currentPageNumber, setCurrentPage] = React.useState(currentPage);
1196
+ const [currentTotalCount, setcurrentTotalCount] = React.useState(totalCount);
1197
+ React.useEffect(() => {
1198
+ setcurrentTotalCount(totalCount);
1199
+ }, [totalCount]);
1200
+ React.useEffect(() => {
1201
+ setSibilingCountNumber(siblingCount);
1202
+ }, [siblingCount]);
1203
+ React.useEffect(() => {
1204
+ setCurrentPage(currentPage);
1205
+ }, [currentPage]);
1206
+ const onPageChange = page => {
1207
+ if (page > 0) {
1208
+ setCurrentPage(page);
1209
+ }
1210
+ };
1211
+ React.useEffect(() => {
1212
+ onChange(currentPageNumber);
1213
+ }, [currentPageNumber]);
1214
+ const paginationRange = PaginationRange({
1215
+ currentPageNumber,
1216
+ currentTotalCount,
1217
+ siblingCountNumber,
1218
+ offset
1219
+ });
1220
+ if (currentPageNumber === 0 || paginationRange.length < 2) {
1221
+ return null;
1222
+ }
1223
+ const classProps = classnames__default["default"](styles$1.list, className ? className : `${styles$1["pagination-bar"]} pagination-bar-rem`);
1224
+ const onNext = () => {
1225
+ onPageChange(currentPageNumber + 1);
1226
+ };
1227
+ const onPrevious = () => {
1228
+ onPageChange(currentPageNumber - 1);
1229
+ };
1230
+ const onNextFive = () => {
1231
+ currentPageNumber !== lastPage - 4 ? onPageChange(currentPageNumber + 5) : onPageChange(currentPageNumber + 4);
1232
+ };
1233
+ const onPreviousFive = e => {
1234
+ currentPageNumber !== 5 ? onPageChange(currentPageNumber - 5) : onPageChange(currentPageNumber - 4);
1235
+ };
1236
+ let lastPage = paginationRange[paginationRange.length - 1];
1237
+ return /*#__PURE__*/React__default["default"].createElement("ul", {
1238
+ className: classProps
1239
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
1240
+ className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
1241
+ onClick: onPrevious,
1242
+ disabled: currentPage === 1 ? true : false
1243
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1244
+ className: "icon-arrow-back"
1245
+ })), paginationRange.map((pageNumber, id) => {
1246
+ if (pageNumber === Dots) {
1247
+ let currentPageIndex = paginationRange.indexOf(currentPageNumber);
1248
+ return /*#__PURE__*/React__default["default"].createElement("li", {
1249
+ key: id,
1250
+ className: classnames__default["default"](`${styles$1["pagination-jump-next"]} pagination-jump-next-rem`, styles$1.listItem),
1251
+ onClick: id < currentPageIndex ? onPreviousFive : onNextFive,
1252
+ disabled: currentPageIndex === 0 ? true : false
1253
+ }, id < currentPageIndex ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
1254
+ className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
1255
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1256
+ className: "icon-text"
1257
+ })), /*#__PURE__*/React__default["default"].createElement("span", {
1258
+ className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
1259
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1260
+ className: "icon-arrow-jump-back"
1261
+ }))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
1262
+ className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
1263
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1264
+ className: "icon-text"
1265
+ })), /*#__PURE__*/React__default["default"].createElement("span", {
1266
+ className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
1267
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1268
+ className: "icon-arrow-jump-next"
1269
+ }))));
1270
+ }
1271
+ return /*#__PURE__*/React__default["default"].createElement("li", {
1272
+ onClick: () => onPageChange(pageNumber),
1273
+ key: id,
1274
+ className: classnames__default["default"](`${pageNumber === currentPageNumber ? styles$1.selected : styles$1.listItem}`, `${styles$1["pagination-item"]} pagination-item-rem`)
1275
+ }, pageNumber);
1276
+ }), /*#__PURE__*/React__default["default"].createElement("button", {
1277
+ onClick: onNext,
1278
+ className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
1279
+ disabled: currentPageNumber === lastPage ? true : false
1280
+ }, /*#__PURE__*/React__default["default"].createElement("i", {
1281
+ className: "icon-arrow"
1282
+ })));
1283
+ };
1284
+ Pagination.propTypes = {
1285
+ offset: PropTypes__default["default"].number,
1286
+ totalCount: PropTypes__default["default"].number,
1287
+ className: PropTypes__default["default"].string,
1288
+ siblingCount: PropTypes__default["default"].number,
1289
+ currentPage: PropTypes__default["default"].number
1290
+ };
1291
+ Pagination.defaultProps = {
1292
+ offset: 2,
1293
+ siblingCount: 2
1294
+ };
1295
+
1296
+ var css_248z = ".autocomplate-module_autocomplate-content__UbIUT{display:flex;flex-direction:column;position:relative}.autocomplate-module_autocomplate-content-top__FVgCp{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.autocomplate-module_autocomplate-content-top__FVgCp.autocomplate-module_active__40fdV{border-color:#00236a}.autocomplate-module_autocomplate-content-top__FVgCp:hover{border-color:#3c393e}.autocomplate-module_autocomplate-content-bottom__yk0zP{animation:autocomplate-module_select-show__7Uap4 .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.autocomplate-module_autocomplate-content-bottom-inner__rF5IF{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes autocomplate-module_select-show__7Uap4{to{max-height:400px}}.autocomplate-module_autocomplate-content-bottom-row__dRsZa{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;height:46px;line-height:22px;margin-bottom:2px;padding:0 15px;transition:background .24s,color .24s}.autocomplate-module_autocomplate-content-bottom-row__dRsZa .autocomplate-module_no-option__xv0-E{color:red}.autocomplate-module_autocomplate-content-bottom-row__dRsZa:hover{background:unset;color:#00236a}.autocomplate-module_option-active__WuH4I .autocomplate-module_autocomplate-content-bottom-row__dRsZa{color:#00236a}.autocomplate-module_autocomplate-title__3Qxqz{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.autocomplate-module_errorBorder__LV-nb{border:2px solid #e00!important}.autocomplate-module_errorMessage__Gchpc{color:#e00!important}";
1297
+ var styles = {"autocomplate-content":"autocomplate-module_autocomplate-content__UbIUT","autocomplate-content-top":"autocomplate-module_autocomplate-content-top__FVgCp","active":"autocomplate-module_active__40fdV","autocomplate-content-bottom":"autocomplate-module_autocomplate-content-bottom__yk0zP","select-show":"autocomplate-module_select-show__7Uap4","autocomplate-content-bottom-inner":"autocomplate-module_autocomplate-content-bottom-inner__rF5IF","autocomplate-content-bottom-row":"autocomplate-module_autocomplate-content-bottom-row__dRsZa","no-option":"autocomplate-module_no-option__xv0-E","option-active":"autocomplate-module_option-active__WuH4I","autocomplate-title":"autocomplate-module_autocomplate-title__3Qxqz","errorBorder":"autocomplate-module_errorBorder__LV-nb","errorMessage":"autocomplate-module_errorMessage__Gchpc"};
1298
+ styleInject(css_248z);
1299
+
1300
+ const Autocomplate = ({
1301
+ className,
1302
+ label,
1303
+ required,
1304
+ disabled,
1305
+ jsonOptionsData,
1306
+ jsonSelectedOptionsData,
1307
+ onChange,
1308
+ value,
1309
+ searchCount,
1310
+ placeHolder,
1311
+ keyNames,
1312
+ errorMesage,
1313
+ ...props
1314
+ }) => {
1315
+ classnames__default["default"](styles.searchBox, className);
1316
+ const parseSelectedOptionsData = jsonSelectedOptionsData ? JSON.parse(jsonSelectedOptionsData) : {
1317
+ name: '',
1318
+ id: ''
1319
+ };
1320
+ const [inputValue, setInputValue] = React.useState(parseSelectedOptionsData[keyNames.name]);
1321
+ const [inputId, setInputId] = React.useState(parseSelectedOptionsData[keyNames.id]);
1322
+ const [activeOption, setActiveOption] = React.useState(0);
1323
+ const [showOptions, setShowOptions] = React.useState(false);
1324
+ const parseOptionsData = jsonOptionsData ? JSON.parse(jsonOptionsData) : [];
1325
+ React.useEffect(() => {
1326
+ setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
1327
+ setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
1328
+ }, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
1329
+ const handleChange = e => {
1330
+ const currentInputValue = e.currentTarget.value;
1331
+ setInputId(null);
1332
+ setInputValue(currentInputValue);
1333
+ setInputId('');
1334
+ setActiveOption(0);
1335
+ setShowOptions(true);
1336
+ onChange({
1337
+ name: currentInputValue,
1338
+ id: e.target.id
1339
+ });
1340
+ };
1341
+ const handleClick = e => {
1342
+ setActiveOption(0);
1343
+ setShowOptions(false);
1344
+ setInputValue(e.target.innerText);
1345
+ setInputId(e.target.id);
1346
+ onChange({
1347
+ name: e.target.innerText,
1348
+ id: e.target.id
1349
+ });
1350
+ };
1351
+ let optionList;
1352
+ if (showOptions && inputValue) {
1353
+ if (parseOptionsData.length && inputValue.length >= searchCount) {
1354
+ optionList = /*#__PURE__*/React__default["default"].createElement("div", {
1355
+ className: `${styles['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
1356
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1357
+ className: `${styles['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
1358
+ }, parseOptionsData.map((optionName, index) => {
1359
+ let className;
1360
+ if (index === activeOption) {
1361
+ className = "option-active";
1362
+ }
1363
+ return /*#__PURE__*/React__default["default"].createElement("div", {
1364
+ className: `${styles[className]} autocomplate-content-click-rem`,
1365
+ key: optionName[keyNames.id],
1366
+ onClick: handleClick
1367
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1368
+ id: optionName[keyNames.id],
1369
+ className: `${styles['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
1370
+ }, optionName[keyNames.name]));
1371
+ })));
1372
+ } else {
1373
+ optionList = /*#__PURE__*/React__default["default"].createElement("div", {
1374
+ className: `${styles['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
1375
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1376
+ className: `${styles['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
1377
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1378
+ className: `${styles['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
1379
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
1380
+ className: `${styles['no-option']} autocomplate-no-option`
1381
+ }, inputValue.length < searchCount ? `Լրացնել առնվազն ${searchCount} նիշ` : 'Նման տվյալ առկա չէ'))));
1382
+ }
1383
+ }
1384
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
1385
+ className: `${styles['autocomplate-title']} autocomplate-title-rem`
1386
+ }, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
1387
+ style: {
1388
+ color: "#ee0000"
1389
+ }
1390
+ }, "*")) : "", /*#__PURE__*/React__default["default"].createElement("div", {
1391
+ className: `${styles['autocomplate-content']} autocomplate-content-rem`
1392
+ }, /*#__PURE__*/React__default["default"].createElement("input", _extends({
1393
+ id: inputId,
1394
+ type: "text",
1395
+ className: `${styles['autocomplate-content-top']} autocomplate-content-top-rem ${errorMesage ? styles.errorBorder : ''}`,
1396
+ disabled: disabled,
1397
+ onChange: handleChange,
1398
+ onClick: () => {
1399
+ setShowOptions(!showOptions);
1400
+ },
1401
+ value: inputValue,
1402
+ placeholder: placeHolder
1403
+ }, props)), errorMesage ? /*#__PURE__*/React__default["default"].createElement("span", {
1404
+ className: styles.errorMessage
1405
+ }, errorMesage) : null, optionList));
1406
+ };
1407
+ Autocomplate.propTypes = {
1408
+ className: PropTypes__default["default"].string,
1409
+ label: PropTypes__default["default"].string,
1410
+ placeHolder: PropTypes__default["default"].string,
1411
+ required: PropTypes__default["default"].bool,
1412
+ disabled: PropTypes__default["default"].bool,
1413
+ jsonOptionsData: PropTypes__default["default"].string,
1414
+ jsonSelectedOptionsData: PropTypes__default["default"].string,
1415
+ onChange: PropTypes__default["default"].func,
1416
+ value: PropTypes__default["default"].string,
1417
+ searchCount: PropTypes__default["default"].number,
1418
+ keyNames: PropTypes__default["default"].object,
1419
+ errorMesage: PropTypes__default["default"].string
1420
+ };
1421
+ Autocomplate.defaultProps = {
1422
+ required: false
1265
1423
  };
1266
1424
 
1267
1425
  exports.Autocomplate = Autocomplate;
1268
1426
  exports.Button = Button;
1269
- exports.ButtonSize = ButtonSize;
1270
- exports.ButtonTheme = ButtonTheme;
1271
- exports.ButtonType = ButtonType;
1272
1427
  exports.Captcha = Captcha;
1273
1428
  exports.Checkbox = Checkbox;
1274
1429
  exports.File = File;
1275
1430
  exports.Input = Input;
1276
- exports.InputSizes = InputSizes;
1277
1431
  exports.InputTypes = InputTypes;
1278
1432
  exports.Modal = Modal;
1279
1433
  exports.Pagination = Pagination;
@@ -1283,5 +1437,6 @@ exports.SelectSize = SelectSize;
1283
1437
  exports.SelectTheme = SelectTheme;
1284
1438
  exports.Stepper = Stepper;
1285
1439
  exports.Table = Table;
1440
+ exports.Tooltip = Tooltip;
1286
1441
  exports.Typography = Typography;
1287
1442
  exports.TypographyType = TypographyType;