@xaypay/tui 0.0.15 → 0.0.17
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 +252 -182
- package/dist/index.js +230 -157
- package/package.json +1 -1
- package/src/components/button/index.js +0 -3
- package/src/components/captcha/captcha.stories.js +0 -1
- package/src/components/icon/Icon.js +9 -2
- package/src/components/input/index.js +4 -1
- package/src/components/input/input.stories.js +1 -1
- package/src/components/multiselect/index.js +24 -13
- package/src/components/multiselect/multiselect.stories.js +7 -6
- package/src/components/pagination/index.js +7 -5
- package/src/components/select/index.js +72 -67
- package/src/components/select/select.stories.js +3 -3
- package/src/index.js +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React, { useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -7,14 +7,12 @@ function _extends() {
|
|
|
7
7
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
8
8
|
for (var i = 1; i < arguments.length; i++) {
|
|
9
9
|
var source = arguments[i];
|
|
10
|
-
|
|
11
10
|
for (var key in source) {
|
|
12
11
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13
12
|
target[key] = source[key];
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return target;
|
|
19
17
|
};
|
|
20
18
|
return _extends.apply(this, arguments);
|
|
@@ -47,9 +45,9 @@ function styleInject(css, ref) {
|
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
var css_248z$
|
|
51
|
-
var styles$
|
|
52
|
-
styleInject(css_248z$
|
|
48
|
+
var css_248z$a = ".button-module_btn__ffRtT{border:none;border-radius:6px;box-sizing:border-box;cursor:pointer;font-size:16px;line-height:20px;min-height:46px;outline:none;overflow:hidden;padding:12px 20px;text-transform:capitalize;transition:background-color .24s,color .24s}.button-module_btn__ffRtT.button-module_full-size__vmV2E{width:100%}.button-module_btn__ffRtT.button-module_content-size__f7JSE{width:auto}.button-module_btn__ffRtT.button-module_type-filled__BiyVo{background-color:#00236a;color:#fff}.button-module_btn__ffRtT.button-module_type-filled__BiyVo:hover{background-color:#001745}.button-module_btn__ffRtT.button-module_type-filled__BiyVo:disabled{background-color:#eee;color:#3c393e;pointer-events:none}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V{background-color:#fff;box-shadow:inset 0 0 0 2px #00236a}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V:hover{background-color:#001745;color:#fff}.button-module_btn__ffRtT.button-module_type-outline__RpZ2V:disabled{box-shadow:inset 0 0 0 2px #eee;color:#3c393e;pointer-events:none}";
|
|
49
|
+
var styles$8 = {"btn":"button-module_btn__ffRtT","full-size":"button-module_full-size__vmV2E","content-size":"button-module_content-size__f7JSE","size-default":"button-module_size-default__ydEgl","type-filled":"button-module_type-filled__BiyVo","with-icon":"button-module_with-icon__mfKU-","type-outline":"button-module_type-outline__RpZ2V"};
|
|
50
|
+
styleInject(css_248z$a);
|
|
53
51
|
|
|
54
52
|
/**
|
|
55
53
|
* Primary UI component for user interaction
|
|
@@ -85,12 +83,9 @@ const Button = ({
|
|
|
85
83
|
outline,
|
|
86
84
|
...props
|
|
87
85
|
}) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log(classProps);
|
|
93
|
-
return /*#__PURE__*/React$1.createElement("button", _extends({
|
|
86
|
+
const classProps = classnames(styles$8.btn, styles$8[theme], styles$8[size], outline ? styles$8['type-outline'] : styles$8['type-filled'], className);
|
|
87
|
+
// className='btn type-outline size-default'
|
|
88
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
94
89
|
type: "button",
|
|
95
90
|
className: classProps,
|
|
96
91
|
style: backgroundColor && {
|
|
@@ -103,27 +98,22 @@ Button.propTypes = {
|
|
|
103
98
|
type: PropTypes.oneOf(Object.values(ButtonType)),
|
|
104
99
|
theme: PropTypes.oneOf(Object.values(ButtonTheme)),
|
|
105
100
|
size: PropTypes.oneOf(Object.values(ButtonSize)),
|
|
106
|
-
|
|
107
101
|
/**
|
|
108
102
|
* What background color to use
|
|
109
103
|
*/
|
|
110
104
|
backgroundColor: PropTypes.string,
|
|
111
|
-
|
|
112
105
|
/**
|
|
113
106
|
* How large should the button be?
|
|
114
107
|
*/
|
|
115
108
|
// size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
116
|
-
|
|
117
109
|
/**
|
|
118
110
|
* Button contents
|
|
119
111
|
*/
|
|
120
112
|
label: PropTypes.string.isRequired,
|
|
121
|
-
|
|
122
113
|
/**
|
|
123
114
|
* Optional click handler
|
|
124
115
|
*/
|
|
125
116
|
onClick: PropTypes.func,
|
|
126
|
-
|
|
127
117
|
/**
|
|
128
118
|
* disabled
|
|
129
119
|
*/
|
|
@@ -139,8 +129,8 @@ Button.defaultProps = {
|
|
|
139
129
|
outline: false
|
|
140
130
|
};
|
|
141
131
|
|
|
142
|
-
var css_248z$
|
|
143
|
-
styleInject(css_248z$
|
|
132
|
+
var css_248z$9 = "h1{font-size:70px;line-height:70px}h1,h2{font-weight:400;text-transform:uppercase}h2{font-size:50px;line-height:50px}h3{font-size:38px;font-weight:400;line-height:38px}h3,h4{text-transform:uppercase}h4{font-size:24px;font-weight:600;line-height:24px}h5{font-size:20px;font-size:16px;line-height:20px;line-height:22px;text-transform:uppercase}h5,p{font-weight:600;text-transform:capitalize}p{font-size:14px;line-height:20px}span{font-size:12px;font-weight:500;line-height:16px;text-transform:capitalize}i{font-family:icomoon;font-style:inherit}";
|
|
133
|
+
styleInject(css_248z$9);
|
|
144
134
|
|
|
145
135
|
const TypographyType = {
|
|
146
136
|
h1: 'h1',
|
|
@@ -162,7 +152,9 @@ const Typography = ({
|
|
|
162
152
|
...props
|
|
163
153
|
}) => {
|
|
164
154
|
const classProps = classnames(className, bold ? 'bold' : '');
|
|
165
|
-
const CustomTag = variant;
|
|
155
|
+
const CustomTag = variant;
|
|
156
|
+
|
|
157
|
+
// const Tag = ({ className, children }) => (
|
|
166
158
|
// <CustomTag
|
|
167
159
|
// className={className}
|
|
168
160
|
// {...props}
|
|
@@ -175,7 +167,7 @@ const Typography = ({
|
|
|
175
167
|
${color ? 'color: ' + color + ';' : ''}
|
|
176
168
|
${bold ? 'font-weight: bold;' : ''}
|
|
177
169
|
`;
|
|
178
|
-
return /*#__PURE__*/React
|
|
170
|
+
return /*#__PURE__*/React.createElement(StyledTypograpy, {
|
|
179
171
|
className: classProps
|
|
180
172
|
}, " ", children, " ");
|
|
181
173
|
};
|
|
@@ -189,9 +181,9 @@ Typography.defaultProps = {
|
|
|
189
181
|
variant: 'h1'
|
|
190
182
|
};
|
|
191
183
|
|
|
192
|
-
var css_248z$
|
|
193
|
-
var styles$
|
|
194
|
-
styleInject(css_248z$
|
|
184
|
+
var css_248z$8 = ".autocomplate-module_autocomplate-content__UbIUT{display:flex;flex-direction:column}.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);max-height:0;max-width:400px;overflow:hidden;position:relative;top:6px}.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}";
|
|
185
|
+
var styles$7 = {"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"};
|
|
186
|
+
styleInject(css_248z$8);
|
|
195
187
|
|
|
196
188
|
const Autocomplate = ({
|
|
197
189
|
className,
|
|
@@ -204,13 +196,12 @@ const Autocomplate = ({
|
|
|
204
196
|
searchCount,
|
|
205
197
|
...props
|
|
206
198
|
}) => {
|
|
207
|
-
classnames(styles$
|
|
199
|
+
classnames(styles$7.searchBox, className);
|
|
208
200
|
const [inputValue, setInputValue] = useState("");
|
|
209
201
|
const [activeOption, setActiveOption] = useState(0);
|
|
210
202
|
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
211
203
|
const [showOptions, setShowOptions] = useState(false);
|
|
212
204
|
const parseOptionsData = jsonOptionsData.length !== 0 ? JSON.parse(jsonOptionsData).sort() : [];
|
|
213
|
-
|
|
214
205
|
const handleChange = e => {
|
|
215
206
|
const currentInputValue = e.currentTarget.value;
|
|
216
207
|
const filteredOptions = parseOptionsData.filter(optionName => optionName.toLowerCase().indexOf(currentInputValue.toLowerCase()) > -1);
|
|
@@ -219,57 +210,51 @@ const Autocomplate = ({
|
|
|
219
210
|
setFilteredOptions(filteredOptions);
|
|
220
211
|
setShowOptions(true);
|
|
221
212
|
};
|
|
222
|
-
|
|
223
213
|
const handleClick = e => {
|
|
224
214
|
setInputValue(e.currentTarget.innerText);
|
|
225
215
|
setActiveOption(0);
|
|
226
216
|
setFilteredOptions([]);
|
|
227
217
|
setShowOptions(false);
|
|
228
218
|
};
|
|
229
|
-
|
|
230
219
|
let optionList;
|
|
231
|
-
|
|
232
220
|
if (showOptions && inputValue) {
|
|
233
221
|
if (filteredOptions.length && inputValue.length >= searchCount) {
|
|
234
|
-
optionList = /*#__PURE__*/React
|
|
235
|
-
className: styles$
|
|
236
|
-
}, /*#__PURE__*/React
|
|
237
|
-
className: styles$
|
|
222
|
+
optionList = /*#__PURE__*/React.createElement("div", {
|
|
223
|
+
className: styles$7['autocomplate-content-bottom']
|
|
224
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
className: styles$7['autocomplate-content-bottom-inner']
|
|
238
226
|
}, filteredOptions.map((optionName, index) => {
|
|
239
227
|
let className;
|
|
240
|
-
|
|
241
228
|
if (index === activeOption) {
|
|
242
229
|
className = "option-active";
|
|
243
230
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
className: styles$6[className],
|
|
231
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
className: styles$7[className],
|
|
247
233
|
key: optionName,
|
|
248
234
|
onClick: handleClick
|
|
249
|
-
}, /*#__PURE__*/React
|
|
250
|
-
className: styles$
|
|
235
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
className: styles$7['autocomplate-content-bottom-row']
|
|
251
237
|
}, optionName));
|
|
252
238
|
})));
|
|
253
239
|
} else {
|
|
254
|
-
optionList = /*#__PURE__*/React
|
|
255
|
-
className: styles$
|
|
256
|
-
}, /*#__PURE__*/React
|
|
257
|
-
className: styles$
|
|
258
|
-
}, /*#__PURE__*/React
|
|
259
|
-
className: styles$
|
|
260
|
-
}, /*#__PURE__*/React
|
|
261
|
-
className: styles$
|
|
240
|
+
optionList = /*#__PURE__*/React.createElement("div", {
|
|
241
|
+
className: styles$7['autocomplate-content-bottom']
|
|
242
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
243
|
+
className: styles$7['autocomplate-content-bottom-inner']
|
|
244
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
245
|
+
className: styles$7['autocomplate-content-bottom-row']
|
|
246
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
247
|
+
className: styles$7['no-option']
|
|
262
248
|
}, "No Option!"))));
|
|
263
249
|
}
|
|
264
250
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}, /*#__PURE__*/React$1.createElement("input", _extends({
|
|
251
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label ? /*#__PURE__*/React.createElement("label", {
|
|
252
|
+
className: styles$7.labelInput
|
|
253
|
+
}, label) : "", /*#__PURE__*/React.createElement("div", {
|
|
254
|
+
className: styles$7['autocomplate-content']
|
|
255
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
271
256
|
type: "text",
|
|
272
|
-
className: styles$
|
|
257
|
+
className: styles$7['autocomplate-content-top'],
|
|
273
258
|
required: required,
|
|
274
259
|
disabled: disabled,
|
|
275
260
|
onChange: handleChange,
|
|
@@ -292,9 +277,9 @@ Autocomplate.defaultProps = {
|
|
|
292
277
|
searchCount: 2
|
|
293
278
|
};
|
|
294
279
|
|
|
295
|
-
var css_248z$
|
|
296
|
-
var styles$
|
|
297
|
-
styleInject(css_248z$
|
|
280
|
+
var css_248z$7 = ".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;display:inline-block;height:14px;left:0;margin-right:4px;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}";
|
|
281
|
+
var styles$6 = {"checkbox-wrap":"checkbox-module_checkbox-wrap__Xrg-m","checkmark":"checkbox-module_checkmark__M8DY6"};
|
|
282
|
+
styleInject(css_248z$7);
|
|
298
283
|
|
|
299
284
|
const Checkbox = ({
|
|
300
285
|
disabled,
|
|
@@ -308,10 +293,9 @@ const Checkbox = ({
|
|
|
308
293
|
keyNames,
|
|
309
294
|
...props
|
|
310
295
|
}) => {
|
|
311
|
-
const classProps = classnames(styles$
|
|
296
|
+
const classProps = classnames(styles$6.checkbox, className);
|
|
312
297
|
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
313
298
|
const [data, setData] = useState(parseData);
|
|
314
|
-
|
|
315
299
|
const handleChange = e => {
|
|
316
300
|
if (e.target.checked) {
|
|
317
301
|
data.forEach(item => {
|
|
@@ -329,12 +313,11 @@ const Checkbox = ({
|
|
|
329
313
|
});
|
|
330
314
|
}
|
|
331
315
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
className: styles$5["checkbox-wrap"],
|
|
316
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(element => {
|
|
317
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
318
|
+
className: styles$6["checkbox-wrap"],
|
|
336
319
|
key: element.value
|
|
337
|
-
}, /*#__PURE__*/React
|
|
320
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
338
321
|
type: "checkbox",
|
|
339
322
|
className: classProps,
|
|
340
323
|
disabled: disabled,
|
|
@@ -342,10 +325,10 @@ const Checkbox = ({
|
|
|
342
325
|
value: value ? value : element.value,
|
|
343
326
|
name: name ? name : element.name,
|
|
344
327
|
onChange: handleChange
|
|
345
|
-
}, props)), /*#__PURE__*/React
|
|
346
|
-
className: styles$
|
|
347
|
-
}), element.label ? /*#__PURE__*/React
|
|
348
|
-
className: styles$
|
|
328
|
+
}, props)), /*#__PURE__*/React.createElement("span", {
|
|
329
|
+
className: styles$6["checkmark"]
|
|
330
|
+
}), element.label ? /*#__PURE__*/React.createElement("span", {
|
|
331
|
+
className: styles$6.labelRadio
|
|
349
332
|
}, label ? label : element.label) : "");
|
|
350
333
|
}));
|
|
351
334
|
};
|
|
@@ -366,20 +349,21 @@ Checkbox.defaultProps = {
|
|
|
366
349
|
jsonData: '[{"value":"email", "name":"contact1", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact2", "label":"Phone", "id":"contactChoice2"}]'
|
|
367
350
|
};
|
|
368
351
|
|
|
369
|
-
var css_248z$
|
|
370
|
-
styleInject(css_248z$
|
|
352
|
+
var css_248z$6 = "@font-face{font-display:block;font-family:icomoon;font-style:normal;font-weight:400;src:url(fonts/icomoon.eot?b29ky3);src:url(fonts/icomoon.eot?b29ky3#iefix) format(\"embedded-opentype\"),url(fonts/icomoon.ttf?b29ky3) format(\"truetype\"),url(fonts/icomoon.woff?b29ky3) format(\"woff\"),url(fonts/icomoon.svg?b29ky3#icomoon) format(\"svg\")}[class*=\" icon-\"],[class^=icon-]{speak:never;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:icomoon!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.icon-close:before{content:\"\\e907\"}.icon-arrow-up:before{content:\"\\e905\"}.icon-arrow-down:before{content:\"\\e906\"}.icon-arrow:before{content:\"\\e900\"}.icon-arrow-jump-next:before{content:\"\\e901\"}.icon-arrow-jump-back:before{content:\"\\e902\"}.icon-text:before{content:\"\\e903\"}.icon-arrow-back:before{content:\"\\e904\"}";
|
|
353
|
+
styleInject(css_248z$6);
|
|
371
354
|
|
|
372
355
|
/**
|
|
373
356
|
* Created by aleksanyan.tigran on 10/7/2022.
|
|
374
357
|
*/
|
|
358
|
+
const Icon = props => {
|
|
359
|
+
return /*#__PURE__*/React.createElement("i", {
|
|
360
|
+
className: css_248z$6[props.className]
|
|
361
|
+
});
|
|
362
|
+
};
|
|
375
363
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
var css_248z$4 = ".input-module_input-wrap__NunrE{position:relative}.input-module_input__-ipHD{border:none;border-radius:6px;box-shadow:inset 0 0 0 2px #d1d1d1;box-sizing:border-box;color:#3c393e;cursor:pointer;font-size:16px;line-height:20px;outline:none;overflow:hidden;text-transform:capitalize;transition:background-color .24s,color .24s}.input-module_input__-ipHD.input-module_full-size__38YG7{width:100%}.input-module_input__-ipHD.input-module_content-size__rZ5EA{width:auto}.input-module_input__-ipHD.input-module_size-medium__frTDq{min-height:46px;padding:12px 15px}.input-module_input__-ipHD:hover{box-shadow:inset 0 0 0 2px #3c393e}.input-module_input__-ipHD:active{box-shadow:inset 0 0 0 2px #00236a}.input-module_inputErrorMessages__hx490{animation:input-module_error-message-show__OrVSo .24s forwards;bottom:0;color:#e00;font-size:14px;left:0;line-height:19px;position:absolute;transform:scale3d(0,0,0);z-index:1}.input-module_labelInput__sUMKQ{color:#000}.input-module_input__-ipHD.input-module_state-disabled__402v0{background-color:#fbfbfb;pointer-events:none}.input-module_input__-ipHD.input-module_error-message__7NphF{box-shadow:inset 0 0 0 2px #e00}@keyframes input-module_error-message-show__OrVSo{to{bottom:-20px;transform:scaleX(1)}}";
|
|
381
|
-
var styles$4 = {"input-wrap":"input-module_input-wrap__NunrE","input":"input-module_input__-ipHD","full-size":"input-module_full-size__38YG7","content-size":"input-module_content-size__rZ5EA","size-medium":"input-module_size-medium__frTDq","with-icon":"input-module_with-icon__w3jTW","inputErrorMessages":"input-module_inputErrorMessages__hx490","error-message-show":"input-module_error-message-show__OrVSo","labelInput":"input-module_labelInput__sUMKQ","state-disabled":"input-module_state-disabled__402v0","error-message":"input-module_error-message__7NphF"};
|
|
382
|
-
styleInject(css_248z$4);
|
|
364
|
+
var css_248z$5 = ".input-module_input-wrap__NunrE{position:relative}.input-module_input__-ipHD{border:none;border-radius:6px;box-shadow:inset 0 0 0 2px #d1d1d1;box-sizing:border-box;color:#3c393e;cursor:pointer;font-size:16px;line-height:20px;outline:none;overflow:hidden;text-transform:capitalize;transition:background-color .24s,color .24s}.input-module_input__-ipHD.input-module_full-size__38YG7{width:100%}.input-module_input__-ipHD.input-module_content-size__rZ5EA{width:auto}.input-module_input__-ipHD.input-module_size-medium__frTDq{min-height:46px;padding:12px 15px}.input-module_input__-ipHD:hover{box-shadow:inset 0 0 0 2px #3c393e}.input-module_input__-ipHD:active{box-shadow:inset 0 0 0 2px #00236a}.input-module_inputErrorMessages__hx490{animation:input-module_error-message-show__OrVSo .24s forwards;bottom:0;color:#e00;font-size:14px;left:0;line-height:19px;position:absolute;transform:scale3d(0,0,0);z-index:1}.input-module_labelInput__sUMKQ{color:#000}.input-module_input__-ipHD.input-module_state-disabled__402v0{background-color:#fbfbfb;pointer-events:none}.input-module_input__-ipHD.input-module_error-message__7NphF{box-shadow:inset 0 0 0 2px #e00}@keyframes input-module_error-message-show__OrVSo{to{bottom:-20px;transform:scaleX(1)}}";
|
|
365
|
+
var styles$5 = {"input-wrap":"input-module_input-wrap__NunrE","input":"input-module_input__-ipHD","full-size":"input-module_full-size__38YG7","content-size":"input-module_content-size__rZ5EA","size-medium":"input-module_size-medium__frTDq","with-icon":"input-module_with-icon__w3jTW","inputErrorMessages":"input-module_inputErrorMessages__hx490","error-message-show":"input-module_error-message-show__OrVSo","labelInput":"input-module_labelInput__sUMKQ","state-disabled":"input-module_state-disabled__402v0","error-message":"input-module_error-message__7NphF"};
|
|
366
|
+
styleInject(css_248z$5);
|
|
383
367
|
|
|
384
368
|
const InputTypes = {
|
|
385
369
|
TEXT: "text",
|
|
@@ -405,30 +389,27 @@ const Input = ({
|
|
|
405
389
|
disabled,
|
|
406
390
|
type,
|
|
407
391
|
onChange,
|
|
392
|
+
value,
|
|
408
393
|
...props
|
|
409
394
|
}) => {
|
|
410
|
-
const [inputValue, setInputValue] = useState(
|
|
411
|
-
|
|
395
|
+
const [inputValue, setInputValue] = useState(value);
|
|
412
396
|
const handleChange = event => {
|
|
413
397
|
setInputValue(event.target.value);
|
|
414
398
|
onChange ? onChange(event.target.value) : '';
|
|
415
399
|
};
|
|
416
|
-
|
|
417
400
|
let eMessage = "";
|
|
418
|
-
|
|
419
401
|
if (errorMesage) {
|
|
420
402
|
eMessage = errorMesage;
|
|
421
403
|
} else if (regexp) {
|
|
422
404
|
const regex = new RegExp(regexp);
|
|
423
405
|
eMessage = regex.test(inputValue) ? "" : regexpError;
|
|
424
406
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}, label) : "", /*#__PURE__*/React$1.createElement("input", _extends({}, props, {
|
|
407
|
+
const classProps = classnames(styles$5.input, styles$5[size], eMessage != '' ? styles$5['error-message'] : "", className);
|
|
408
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
409
|
+
className: styles$5['input-wrap']
|
|
410
|
+
}, label ? /*#__PURE__*/React.createElement("label", {
|
|
411
|
+
className: styles$5.labelInput
|
|
412
|
+
}, label) : "", /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
432
413
|
type: type,
|
|
433
414
|
className: classProps,
|
|
434
415
|
style: color && {
|
|
@@ -437,8 +418,8 @@ const Input = ({
|
|
|
437
418
|
disabled: disabled ? disabled : "",
|
|
438
419
|
onChange: handleChange,
|
|
439
420
|
value: inputValue
|
|
440
|
-
})), eMessage ? /*#__PURE__*/React
|
|
441
|
-
className: styles$
|
|
421
|
+
})), eMessage ? /*#__PURE__*/React.createElement("span", {
|
|
422
|
+
className: styles$5.inputErrorMessages
|
|
442
423
|
}, eMessage) : "");
|
|
443
424
|
};
|
|
444
425
|
Input.propTypes = {
|
|
@@ -452,7 +433,8 @@ Input.propTypes = {
|
|
|
452
433
|
regexp: PropTypes.string,
|
|
453
434
|
regexpError: PropTypes.string,
|
|
454
435
|
label: PropTypes.string.isRequired,
|
|
455
|
-
disabled: PropTypes.bool
|
|
436
|
+
disabled: PropTypes.bool,
|
|
437
|
+
value: PropTypes.string
|
|
456
438
|
};
|
|
457
439
|
Input.defaultProps = {
|
|
458
440
|
label: "",
|
|
@@ -461,22 +443,23 @@ Input.defaultProps = {
|
|
|
461
443
|
onChange: undefined,
|
|
462
444
|
required: true,
|
|
463
445
|
errorMesage: "",
|
|
464
|
-
type: "text"
|
|
446
|
+
type: "text",
|
|
447
|
+
value: ""
|
|
465
448
|
};
|
|
466
449
|
|
|
467
|
-
var css_248z$
|
|
468
|
-
var styles$
|
|
469
|
-
styleInject(css_248z$
|
|
450
|
+
var css_248z$4 = ".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}.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:16px;line-height:22px;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}";
|
|
451
|
+
var styles$4 = {"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"};
|
|
452
|
+
styleInject(css_248z$4);
|
|
470
453
|
|
|
471
|
-
|
|
454
|
+
// import styles from "./pagination.module.scss";
|
|
472
455
|
|
|
456
|
+
const Dots = "...";
|
|
473
457
|
const range = (start, end) => {
|
|
474
458
|
const length = end - start + 1;
|
|
475
459
|
return Array.from({
|
|
476
460
|
length
|
|
477
461
|
}, (_, idx) => idx + start);
|
|
478
462
|
};
|
|
479
|
-
|
|
480
463
|
const PaginationRange = ({
|
|
481
464
|
currentTotalCount,
|
|
482
465
|
offset,
|
|
@@ -484,33 +467,29 @@ const PaginationRange = ({
|
|
|
484
467
|
currentPageNumber
|
|
485
468
|
}) => {
|
|
486
469
|
const paginationRange = useMemo(() => {
|
|
487
|
-
const totalPageCount = Math.ceil(currentTotalCount / offset);
|
|
470
|
+
const totalPageCount = Math.ceil(currentTotalCount / offset);
|
|
488
471
|
|
|
472
|
+
//currentPage + 2*Dots + start + end = 5
|
|
489
473
|
const totalPageNumber = siblingCountNumber + 5;
|
|
490
|
-
|
|
491
474
|
if (totalPageNumber >= totalPageCount) {
|
|
492
475
|
return range(1, totalPageCount);
|
|
493
476
|
}
|
|
494
|
-
|
|
495
477
|
const rightSiblingIndex = Math.min(currentPageNumber + siblingCountNumber, totalPageCount);
|
|
496
478
|
const leftSiblingIndex = Math.max(currentPageNumber - siblingCountNumber, 1);
|
|
497
479
|
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
498
480
|
const shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
|
|
499
481
|
const firstPageIndex = 1;
|
|
500
482
|
const lastPageIndex = totalPageCount;
|
|
501
|
-
|
|
502
483
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
503
484
|
let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
|
|
504
485
|
let leftRange = range(1, leftItemCount);
|
|
505
486
|
return [...leftRange, Dots, totalPageCount];
|
|
506
487
|
}
|
|
507
|
-
|
|
508
488
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
509
489
|
let rightItemCount = currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
|
|
510
490
|
let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
511
491
|
return [firstPageIndex, Dots, ...rightRange];
|
|
512
492
|
}
|
|
513
|
-
|
|
514
493
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
515
494
|
let middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
516
495
|
return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
|
|
@@ -527,9 +506,9 @@ const Pagination = ({
|
|
|
527
506
|
offset,
|
|
528
507
|
className
|
|
529
508
|
}) => {
|
|
530
|
-
const [siblingCountNumber, setSibilingCountNumber] = useState(
|
|
531
|
-
const [currentPageNumber, setCurrentPage] = useState(
|
|
532
|
-
const [currentTotalCount, setcurrentTotalCount] = useState(
|
|
509
|
+
const [siblingCountNumber, setSibilingCountNumber] = useState(siblingCount);
|
|
510
|
+
const [currentPageNumber, setCurrentPage] = useState(currentPage);
|
|
511
|
+
const [currentTotalCount, setcurrentTotalCount] = useState(totalCount);
|
|
533
512
|
useEffect(() => {
|
|
534
513
|
setcurrentTotalCount(totalCount);
|
|
535
514
|
}, [totalCount]);
|
|
@@ -539,77 +518,69 @@ const Pagination = ({
|
|
|
539
518
|
useEffect(() => {
|
|
540
519
|
setCurrentPage(currentPage);
|
|
541
520
|
}, [currentPage]);
|
|
542
|
-
|
|
543
521
|
const onPageChange = page => {
|
|
544
522
|
setCurrentPage(page);
|
|
545
523
|
};
|
|
546
|
-
|
|
547
|
-
|
|
524
|
+
useEffect(() => {
|
|
525
|
+
onChange(currentPageNumber);
|
|
526
|
+
}, [currentPageNumber]);
|
|
548
527
|
const paginationRange = PaginationRange({
|
|
549
528
|
currentPageNumber,
|
|
550
529
|
currentTotalCount,
|
|
551
530
|
siblingCountNumber,
|
|
552
531
|
offset
|
|
553
532
|
});
|
|
554
|
-
|
|
555
533
|
if (currentPageNumber === 0 || paginationRange.length < 2) {
|
|
556
534
|
return null;
|
|
557
535
|
}
|
|
558
|
-
|
|
559
|
-
const classProps = classnames(styles$3.list, className ? className : styles$3["pagination-bar"]);
|
|
560
|
-
|
|
536
|
+
const classProps = classnames(styles$4.list, className ? className : styles$4["pagination-bar"]);
|
|
561
537
|
const onNext = () => {
|
|
562
538
|
onPageChange(currentPageNumber + 1);
|
|
563
539
|
};
|
|
564
|
-
|
|
565
540
|
const onPrevious = () => {
|
|
566
541
|
onPageChange(currentPageNumber - 1);
|
|
567
542
|
};
|
|
568
|
-
|
|
569
543
|
const onNextFive = () => {
|
|
570
544
|
currentPageNumber !== lastPage - 4 ? onPageChange(currentPageNumber + 5) : onPageChange(currentPageNumber + 4);
|
|
571
545
|
};
|
|
572
|
-
|
|
573
546
|
const onPreviousFive = e => {
|
|
574
547
|
currentPageNumber !== 5 ? onPageChange(currentPageNumber - 5) : onPageChange(currentPageNumber - 4);
|
|
575
548
|
};
|
|
576
|
-
|
|
577
549
|
let lastPage = paginationRange[paginationRange.length - 1];
|
|
578
|
-
return /*#__PURE__*/React
|
|
550
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
579
551
|
className: classProps
|
|
580
|
-
}, /*#__PURE__*/React
|
|
581
|
-
className: styles$
|
|
552
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
553
|
+
className: styles$4["pagination-btn"],
|
|
582
554
|
onClick: onPrevious,
|
|
583
555
|
disabled: currentPage === 1 ? true : false
|
|
584
|
-
}, /*#__PURE__*/React
|
|
556
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
585
557
|
className: "icon-arrow-back"
|
|
586
558
|
})), paginationRange.map((pageNumber, id) => {
|
|
587
559
|
if (pageNumber === Dots) {
|
|
588
560
|
let currentPageIndex = paginationRange.indexOf(currentPageNumber);
|
|
589
|
-
return /*#__PURE__*/React
|
|
561
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
590
562
|
key: id,
|
|
591
|
-
className: classnames(styles$
|
|
563
|
+
className: classnames(styles$4['pagination-jump-next'], styles$4.listItem),
|
|
592
564
|
onClick: id < currentPageIndex ? onPreviousFive : onNextFive,
|
|
593
565
|
disabled: currentPageIndex === 0 ? true : false
|
|
594
|
-
}, /*#__PURE__*/React
|
|
595
|
-
className: styles$
|
|
596
|
-
}, "..."), /*#__PURE__*/React
|
|
597
|
-
className: styles$
|
|
598
|
-
}, /*#__PURE__*/React
|
|
566
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
567
|
+
className: styles$4['pagination-jump-next-txt']
|
|
568
|
+
}, "..."), /*#__PURE__*/React.createElement("span", {
|
|
569
|
+
className: styles$4['pagination-jump-next-arrow']
|
|
570
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
599
571
|
className: "icon-arrow-jump-next"
|
|
600
572
|
})));
|
|
601
573
|
}
|
|
602
|
-
|
|
603
|
-
return /*#__PURE__*/React$2.createElement("li", {
|
|
574
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
604
575
|
onClick: () => onPageChange(pageNumber),
|
|
605
576
|
key: id,
|
|
606
|
-
className: classnames(`${pageNumber === currentPageNumber ? styles$
|
|
577
|
+
className: classnames(`${pageNumber === currentPageNumber ? styles$4.selected : styles$4.listItem}`, styles$4['pagination-item'])
|
|
607
578
|
}, pageNumber);
|
|
608
|
-
}), /*#__PURE__*/React
|
|
579
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
609
580
|
onClick: onNext,
|
|
610
|
-
className: styles$
|
|
581
|
+
className: styles$4["pagination-btn"],
|
|
611
582
|
disabled: currentPageNumber === lastPage ? true : false
|
|
612
|
-
}, /*#__PURE__*/React
|
|
583
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
613
584
|
className: "icon-arrow"
|
|
614
585
|
})));
|
|
615
586
|
};
|
|
@@ -625,9 +596,9 @@ Pagination.defaultProps = {
|
|
|
625
596
|
siblingCount: 2
|
|
626
597
|
};
|
|
627
598
|
|
|
628
|
-
var css_248z$
|
|
629
|
-
var styles$
|
|
630
|
-
styleInject(css_248z$
|
|
599
|
+
var css_248z$3 = ".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}";
|
|
600
|
+
var styles$3 = {"radio-wrap":"radio-module_radio-wrap__-lO7V","radio-checkmark":"radio-module_radio-checkmark__Kvol0"};
|
|
601
|
+
styleInject(css_248z$3);
|
|
631
602
|
|
|
632
603
|
const Radio = ({
|
|
633
604
|
disabled,
|
|
@@ -641,13 +612,13 @@ const Radio = ({
|
|
|
641
612
|
keyNames,
|
|
642
613
|
...props
|
|
643
614
|
}) => {
|
|
644
|
-
const classProps = classnames(styles$
|
|
615
|
+
const classProps = classnames(styles$3.checkbox, className);
|
|
645
616
|
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
646
|
-
return /*#__PURE__*/React
|
|
647
|
-
return /*#__PURE__*/React
|
|
648
|
-
className: styles$
|
|
617
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, parseData.map((element, id) => {
|
|
618
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
619
|
+
className: styles$3["radio-wrap"],
|
|
649
620
|
key: element.value
|
|
650
|
-
}, /*#__PURE__*/React
|
|
621
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
651
622
|
type: "radio",
|
|
652
623
|
className: classProps,
|
|
653
624
|
disabled: disabled,
|
|
@@ -655,10 +626,10 @@ const Radio = ({
|
|
|
655
626
|
defaultChecked: id === 0 ? defaultChecked : "",
|
|
656
627
|
value: value ? value : element.value,
|
|
657
628
|
name: name ? name : element.name
|
|
658
|
-
}, props)), /*#__PURE__*/React
|
|
659
|
-
className: styles$
|
|
660
|
-
}), element.label ? /*#__PURE__*/React
|
|
661
|
-
className: styles$
|
|
629
|
+
}, props)), /*#__PURE__*/React.createElement("span", {
|
|
630
|
+
className: styles$3["radio-checkmark"]
|
|
631
|
+
}), element.label ? /*#__PURE__*/React.createElement("span", {
|
|
632
|
+
className: styles$3.labelRadio
|
|
662
633
|
}, label ? label : element.label) : "");
|
|
663
634
|
}));
|
|
664
635
|
};
|
|
@@ -679,9 +650,9 @@ Radio.defaultProps = {
|
|
|
679
650
|
jsonData: '[{"value":"email", "name":"contact", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact", "label":"Phone", "id":"contactChoice2"}]'
|
|
680
651
|
};
|
|
681
652
|
|
|
682
|
-
var css_248z$
|
|
683
|
-
var styles$
|
|
684
|
-
styleInject(css_248z$
|
|
653
|
+
var css_248z$2 = "*{margin:0;padding:0}.captcha-module_main__Ys3EH{margin:0;padding:0;position:relative;width:40%}.captcha-module_slider__KLYny{-webkit-appearance:none;background-color:hsla(0,0%,100%,.575);border:.1px solid hsla(0,0%,59%,.432);height:7px;outline:none;width:100%}.captcha-module_slider__KLYny::-webkit-slider-thumb{-webkit-appearance:none;height:48px;position:relative;width:48px;z-index:3}.captcha-module_selector__JFhb4{bottom:-20px;height:48px;left:50%;position:absolute;width:48px;z-index:2}.captcha-module_selectBtn__GP1iH{background-image:url(https://i.ibb.co/rQZNNzN/blue.png);background-position:50%;background-size:cover;border-radius:50%;bottom:40px;height:40px;position:absolute;right:30px;width:40px}.captcha-module_progressBar__mhdtM{background:#7070ee;bottom:38px;height:7px;left:0;margin:0;padding:0;position:absolute;width:50%}.captcha-module_range__k24I2{color:blue;margin-bottom:15px;margin-top:15px}";
|
|
654
|
+
var styles$2 = {"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"};
|
|
655
|
+
styleInject(css_248z$2);
|
|
685
656
|
|
|
686
657
|
const Captcha = ({
|
|
687
658
|
onclick,
|
|
@@ -690,51 +661,47 @@ const Captcha = ({
|
|
|
690
661
|
const [data, setData] = useState("");
|
|
691
662
|
const [right, setRight] = useState(false);
|
|
692
663
|
let range = rangeCount <= 100 ? rangeCount : 0;
|
|
693
|
-
let rangeElement = document.getElementsByClassName(styles$
|
|
664
|
+
let rangeElement = document.getElementsByClassName(styles$2.range);
|
|
694
665
|
useEffect(() => {
|
|
695
666
|
for (let element of rangeElement) {
|
|
696
667
|
element.style.marginLeft = `${range - 3}%`;
|
|
697
668
|
element.style.color = data;
|
|
698
669
|
}
|
|
699
670
|
}, [range, data]);
|
|
700
|
-
|
|
701
671
|
function sliderInput(event) {
|
|
702
672
|
setData(rangeCount == event.target.value ? 'green' : 'indianred');
|
|
703
|
-
let selector = document.getElementsByClassName(styles$
|
|
704
|
-
let selectBtn = document.getElementsByClassName(styles$
|
|
705
|
-
let progressBar = document.getElementsByClassName(styles$
|
|
673
|
+
let selector = document.getElementsByClassName(styles$2.selector);
|
|
674
|
+
let selectBtn = document.getElementsByClassName(styles$2.selectBtn);
|
|
675
|
+
let progressBar = document.getElementsByClassName(styles$2.progressBar);
|
|
706
676
|
selector[0].style.left = event.target.value + '%';
|
|
707
677
|
progressBar[0].style.width = event.target.value + '%';
|
|
708
|
-
|
|
709
678
|
if (rangeCount == event.target.value) {
|
|
710
679
|
selectBtn[0].style.backgroundImage = "url('https://i.ibb.co/b1HDRtd/green.png')";
|
|
711
680
|
} else {
|
|
712
681
|
selectBtn[0].style.backgroundImage = "url('https://i.ibb.co/QvXjjLM/red.png')";
|
|
713
682
|
}
|
|
714
683
|
}
|
|
715
|
-
|
|
716
684
|
function sliderChange(e) {
|
|
717
685
|
setRight(rangeCount == e.target.value ? true : false);
|
|
718
686
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}, "\u25BC"), /*#__PURE__*/React$1.createElement("input", {
|
|
687
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
688
|
+
className: styles$2.main
|
|
689
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
690
|
+
className: styles$2.range
|
|
691
|
+
}, "\u25BC"), /*#__PURE__*/React.createElement("input", {
|
|
725
692
|
type: "range",
|
|
726
|
-
className: styles$
|
|
693
|
+
className: styles$2.slider,
|
|
727
694
|
onClick: right ? onclick : null,
|
|
728
695
|
onInput: sliderInput,
|
|
729
696
|
onMouseUp: sliderChange
|
|
730
|
-
}), /*#__PURE__*/React
|
|
731
|
-
className: styles$
|
|
732
|
-
}, /*#__PURE__*/React
|
|
733
|
-
className: styles$
|
|
734
|
-
})), /*#__PURE__*/React
|
|
735
|
-
className: styles$
|
|
736
|
-
}), /*#__PURE__*/React
|
|
737
|
-
className: styles$
|
|
697
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
698
|
+
className: styles$2.selector
|
|
699
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
700
|
+
className: styles$2.selectBtn
|
|
701
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
702
|
+
className: styles$2.progressBar
|
|
703
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
704
|
+
className: styles$2.range
|
|
738
705
|
}, "\u25B2")));
|
|
739
706
|
};
|
|
740
707
|
Captcha.propTypes = {
|
|
@@ -746,9 +713,9 @@ Captcha.defaultProps = {
|
|
|
746
713
|
onclick: undefined
|
|
747
714
|
};
|
|
748
715
|
|
|
749
|
-
var css_248z = ".stepper-module_bigRing__5GBm0{border:1px solid gray;border-radius:50%;cursor:pointer;height:30px;margin:10px;position:relative;width:30px}.stepper-module_smallRing__u-5a8{background-color:gray;border-radius:50%;color:#fff;font-size:12px;height:50%;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:50%}.stepper-module_activeRing__Lzvh1{border:1px solid blue;border-radius:50%;cursor:pointer;height:30px;margin:10px;position:relative;width:30px}.stepper-module_smallActiveRing__im-XG{background-color:blue;border-radius:50%;color:#fff;font-size:12px;height:50%;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:50%}";
|
|
750
|
-
var styles = {"bigRing":"stepper-module_bigRing__5GBm0","smallRing":"stepper-module_smallRing__u-5a8","activeRing":"stepper-module_activeRing__Lzvh1","smallActiveRing":"stepper-module_smallActiveRing__im-XG"};
|
|
751
|
-
styleInject(css_248z);
|
|
716
|
+
var css_248z$1 = ".stepper-module_bigRing__5GBm0{border:1px solid gray;border-radius:50%;cursor:pointer;height:30px;margin:10px;position:relative;width:30px}.stepper-module_smallRing__u-5a8{background-color:gray;border-radius:50%;color:#fff;font-size:12px;height:50%;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:50%}.stepper-module_activeRing__Lzvh1{border:1px solid blue;border-radius:50%;cursor:pointer;height:30px;margin:10px;position:relative;width:30px}.stepper-module_smallActiveRing__im-XG{background-color:blue;border-radius:50%;color:#fff;font-size:12px;height:50%;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:50%}";
|
|
717
|
+
var styles$1 = {"bigRing":"stepper-module_bigRing__5GBm0","smallRing":"stepper-module_smallRing__u-5a8","activeRing":"stepper-module_activeRing__Lzvh1","smallActiveRing":"stepper-module_smallActiveRing__im-XG"};
|
|
718
|
+
styleInject(css_248z$1);
|
|
752
719
|
|
|
753
720
|
const Stepper = ({
|
|
754
721
|
className,
|
|
@@ -757,18 +724,16 @@ const Stepper = ({
|
|
|
757
724
|
activeSteps
|
|
758
725
|
}) => {
|
|
759
726
|
classnames(className);
|
|
760
|
-
return /*#__PURE__*/React
|
|
727
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (() => {
|
|
761
728
|
let steppers = [];
|
|
762
|
-
|
|
763
729
|
for (let step = 1; step <= stepLength; step++) {
|
|
764
|
-
steppers.push( /*#__PURE__*/React
|
|
765
|
-
className: classnames(`${step <= activeSteps ? styles.activeRing : styles.bigRing}`),
|
|
730
|
+
steppers.push( /*#__PURE__*/React.createElement("div", {
|
|
731
|
+
className: classnames(`${step <= activeSteps ? styles$1.activeRing : styles$1.bigRing}`),
|
|
766
732
|
key: step
|
|
767
|
-
}, /*#__PURE__*/React
|
|
768
|
-
className: classnames(`${step <= activeSteps ? styles.smallActiveRing : styles.smallRing}`)
|
|
733
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
734
|
+
className: classnames(`${step <= activeSteps ? styles$1.smallActiveRing : styles$1.smallRing}`)
|
|
769
735
|
}, step <= activeSteps ? step : "")));
|
|
770
736
|
}
|
|
771
|
-
|
|
772
737
|
return steppers;
|
|
773
738
|
})());
|
|
774
739
|
};
|
|
@@ -779,4 +744,109 @@ Stepper.propTypes = {
|
|
|
779
744
|
activeSteps: PropTypes.number
|
|
780
745
|
};
|
|
781
746
|
|
|
782
|
-
|
|
747
|
+
var css_248z = ".select-module_select-title__c8bR7{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:capitalize}.select-module_select-content__GCMDX{display:flex;flex-direction:column}.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);max-height:0;max-width:400px;overflow:hidden;position:relative;top:6px}.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: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;height:46px;line-height:22px;margin-bottom:2px;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}";
|
|
748
|
+
var styles = {"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"};
|
|
749
|
+
styleInject(css_248z);
|
|
750
|
+
|
|
751
|
+
const SelectTheme = {
|
|
752
|
+
DEFAULT: 'select-default',
|
|
753
|
+
PRIMARY: 'select-primary',
|
|
754
|
+
SUCCESS: 'select-success',
|
|
755
|
+
INFO: 'select-info',
|
|
756
|
+
WARNING: 'select-warning',
|
|
757
|
+
DANGER: 'select-danger',
|
|
758
|
+
LINK: 'select-link'
|
|
759
|
+
};
|
|
760
|
+
const SelectSize = {
|
|
761
|
+
SMALL: 'small',
|
|
762
|
+
MEDIUM: 'medium',
|
|
763
|
+
LARGE: 'large'
|
|
764
|
+
};
|
|
765
|
+
const Select = ({
|
|
766
|
+
theme,
|
|
767
|
+
size,
|
|
768
|
+
className,
|
|
769
|
+
disabled,
|
|
770
|
+
label,
|
|
771
|
+
jsonData,
|
|
772
|
+
eMessage,
|
|
773
|
+
required,
|
|
774
|
+
defaultOption,
|
|
775
|
+
onChange,
|
|
776
|
+
keyNames,
|
|
777
|
+
selected
|
|
778
|
+
}) => {
|
|
779
|
+
const options = jsonData.length ? JSON.parse(jsonData) : [];
|
|
780
|
+
const parseSelectedData = selected.length !== 0 ? JSON.parse(selected) : {};
|
|
781
|
+
let [opened, setOpened] = useState(false);
|
|
782
|
+
let [newSelected, setNewSelected] = useState(parseSelectedData);
|
|
783
|
+
classnames(styles[theme], styles[size], {
|
|
784
|
+
[styles.disabled]: disabled,
|
|
785
|
+
[styles.required]: required
|
|
786
|
+
}, className);
|
|
787
|
+
return /*#__PURE__*/React.createElement("div", null, label ? /*#__PURE__*/React.createElement("label", {
|
|
788
|
+
className: styles['select-title']
|
|
789
|
+
}, label) : "", /*#__PURE__*/React.createElement("div", {
|
|
790
|
+
className: styles['select-wrap']
|
|
791
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
792
|
+
className: styles['select-content'],
|
|
793
|
+
id: styles.selector
|
|
794
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
795
|
+
className: styles['select-content-top'],
|
|
796
|
+
onClick: () => {
|
|
797
|
+
setOpened(!opened);
|
|
798
|
+
}
|
|
799
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
800
|
+
className: styles['select-content-top-text']
|
|
801
|
+
}, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption), /*#__PURE__*/React.createElement("div", {
|
|
802
|
+
className: styles['select-content-top-icon']
|
|
803
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
804
|
+
className: opened ? 'icon-arrow-up' : 'icon-arrow-down'
|
|
805
|
+
}))), opened && !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
806
|
+
className: styles['select-content-bottom']
|
|
807
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
808
|
+
className: styles['select-content-bottom-inner']
|
|
809
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
810
|
+
className: styles['select-content-bottom-row'],
|
|
811
|
+
onClick: () => {
|
|
812
|
+
if (!required && !selected) {
|
|
813
|
+
setNewSelected(defaultOption);
|
|
814
|
+
onChange(defaultOption);
|
|
815
|
+
setOpened(!opened);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}, defaultOption), options.map((option, i) => {
|
|
819
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
820
|
+
key: i,
|
|
821
|
+
className: styles['select-content-bottom-row'],
|
|
822
|
+
disabled: true,
|
|
823
|
+
onClick: () => {
|
|
824
|
+
setNewSelected(option);
|
|
825
|
+
onChange(option);
|
|
826
|
+
setOpened(!opened);
|
|
827
|
+
},
|
|
828
|
+
defaultValue: option[keyNames.id]
|
|
829
|
+
}, option[keyNames.name]);
|
|
830
|
+
}))) : null)), eMessage ? /*#__PURE__*/React.createElement("span", {
|
|
831
|
+
className: styles.eMessage
|
|
832
|
+
}, eMessage) : null);
|
|
833
|
+
};
|
|
834
|
+
Select.propTypes = {
|
|
835
|
+
theme: PropTypes.oneOf(Object.values(SelectTheme)),
|
|
836
|
+
size: PropTypes.oneOf(Object.values(SelectSize)),
|
|
837
|
+
label: PropTypes.string,
|
|
838
|
+
eMessage: PropTypes.string,
|
|
839
|
+
defaultOption: PropTypes.string,
|
|
840
|
+
onChange: PropTypes.func,
|
|
841
|
+
required: PropTypes.bool,
|
|
842
|
+
disabled: PropTypes.bool,
|
|
843
|
+
className: PropTypes.string,
|
|
844
|
+
selected: PropTypes.string,
|
|
845
|
+
jsonData: PropTypes.string,
|
|
846
|
+
keyNames: PropTypes.object
|
|
847
|
+
};
|
|
848
|
+
Select.defaultProps = {
|
|
849
|
+
size: 'medium'
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
export { Autocomplate, Button, ButtonSize, ButtonTheme, ButtonType, Captcha, Checkbox, Input, InputSizes, InputTypes, Pagination, Radio, Select, SelectSize, SelectTheme, Stepper, Typography, TypographyType };
|