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