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