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