@xaypay/tui 0.0.53 → 0.0.54

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