@xaypay/tui 0.0.53 → 0.0.55

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