@xaypay/tui 0.0.61 → 0.0.62
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 +173 -138
- package/dist/index.js +65 -12
- package/package.json +3 -2
- package/src/components/icon/Arrow.js +19 -0
- package/src/components/icon/CheckboxChecked.js +21 -0
- package/src/components/icon/CheckboxUnchecked.js +21 -0
- package/src/components/icon/CloseIcon.js +19 -0
- package/src/components/icon/Tooltip.js +19 -0
- package/src/components/icon/index.js +5 -6
- package/src/components/select/index.js +14 -6
- package/src/components/select/select.module.css +1 -0
- package/src/components/icon/LikeFilled.js +0 -24
- package/src/components/icon/LikeOutline.js +0 -24
- package/src/components/icon/StarFilled.js +0 -24
- package/src/components/icon/StarOutline.js +0 -24
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { useState, useEffect, useRef, createRef, useMemo } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import classnames from 'classnames';
|
|
4
5
|
import styled, { keyframes, css } from 'styled-components';
|
|
@@ -97,46 +98,46 @@ const File = ({
|
|
|
97
98
|
setFileName('no selected file');
|
|
98
99
|
document.querySelector(`.${name}`).value = "";
|
|
99
100
|
};
|
|
100
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
|
|
101
102
|
className: `${styles$b['file-form-title']} ile-form-title-rem`
|
|
102
|
-
}, label, " ", required && /*#__PURE__*/
|
|
103
|
+
}, label, " ", required && /*#__PURE__*/React__default.createElement("sup", {
|
|
103
104
|
style: {
|
|
104
105
|
color: "#ee0000"
|
|
105
106
|
}
|
|
106
|
-
}, "*")), /*#__PURE__*/
|
|
107
|
+
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
107
108
|
className: classnames(`${styles$b['file-form-wrap']} file-form-wrap-rem`, image ? styles$b['active'] : '')
|
|
108
|
-
}, /*#__PURE__*/
|
|
109
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
109
110
|
onChange: e => console.log(e),
|
|
110
111
|
className: `${styles$b['file-form']} file-form-rem ${errorMessage ? styles$b['error'] : ''}`,
|
|
111
112
|
onClick: () => document.querySelector(`.${name}`).click()
|
|
112
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
113
114
|
hidden: true,
|
|
114
115
|
type: "file",
|
|
115
116
|
className: name,
|
|
116
117
|
disabled: disabled,
|
|
117
118
|
onChange: e => handleCheckFile(e)
|
|
118
|
-
}), image ? /*#__PURE__*/
|
|
119
|
+
}), image ? /*#__PURE__*/React__default.createElement("div", {
|
|
119
120
|
className: `${styles$b['upload-file-content']} upload-file-content-rem`
|
|
120
|
-
}, /*#__PURE__*/
|
|
121
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
121
122
|
src: image,
|
|
122
123
|
alt: fileName
|
|
123
|
-
})) : /*#__PURE__*/
|
|
124
|
+
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
124
125
|
className: `${styles$b['file-form-inner-upload']} ile-form-inner-upload-rem`
|
|
125
|
-
}, /*#__PURE__*/
|
|
126
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
126
127
|
src: "../../assets/upload.svg",
|
|
127
128
|
alt: ""
|
|
128
|
-
}), /*#__PURE__*/
|
|
129
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
129
130
|
className: `${styles$b['upload-info']} upload-info-rem`
|
|
130
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
131
132
|
className: `${styles$b['upload-info-txt']} upload-info-txt-rem`
|
|
132
|
-
}, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/
|
|
133
|
+
}, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default.createElement("span", {
|
|
133
134
|
className: `${styles$b['upload-info-size']} upload-info-size-rem`
|
|
134
|
-
}, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), /*#__PURE__*/
|
|
135
|
+
}, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), /*#__PURE__*/React__default.createElement("div", {
|
|
135
136
|
className: `${styles$b['delete-upload-icon']} delete-upload-icon-rem`,
|
|
136
137
|
onClick: handleRemoveFile
|
|
137
|
-
}, /*#__PURE__*/
|
|
138
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
138
139
|
className: "icon-delete"
|
|
139
|
-
})), errorMessage || error ? /*#__PURE__*/
|
|
140
|
+
})), errorMessage || error ? /*#__PURE__*/React__default.createElement("span", {
|
|
140
141
|
style: {
|
|
141
142
|
color: 'red'
|
|
142
143
|
}
|
|
@@ -226,11 +227,11 @@ const Checkbox = ({
|
|
|
226
227
|
value: 'value',
|
|
227
228
|
label: 'label'
|
|
228
229
|
} : '';
|
|
229
|
-
return /*#__PURE__*/
|
|
230
|
-
return /*#__PURE__*/
|
|
230
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, data.map(element => {
|
|
231
|
+
return /*#__PURE__*/React__default.createElement("label", {
|
|
231
232
|
className: `${styles$9["checkbox-wrap"]} checkbox-wrap-rem`,
|
|
232
233
|
key: element.value
|
|
233
|
-
}, /*#__PURE__*/
|
|
234
|
+
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
234
235
|
type: "checkbox",
|
|
235
236
|
className: classProps,
|
|
236
237
|
disabled: disabled,
|
|
@@ -241,9 +242,9 @@ const Checkbox = ({
|
|
|
241
242
|
onChange: handleChange,
|
|
242
243
|
onClick: onClick ? onClick : () => {},
|
|
243
244
|
defaultChecked: element.checked
|
|
244
|
-
}, props)), /*#__PURE__*/
|
|
245
|
+
}, props)), /*#__PURE__*/React__default.createElement("span", {
|
|
245
246
|
className: `${styles$9["checkmark"]} checkmark-rem`
|
|
246
|
-
}), element[keyNames.label] ? /*#__PURE__*/
|
|
247
|
+
}), element[keyNames.label] ? /*#__PURE__*/React__default.createElement("label", {
|
|
247
248
|
className: styles$9.labelCheckbox,
|
|
248
249
|
for: element[keyNames.id]
|
|
249
250
|
}, element[keyNames.label]) : "");
|
|
@@ -285,26 +286,26 @@ const Table = ({
|
|
|
285
286
|
config.isCheckbox && config.isCheckbox.showCheckbox == undefined ? config.isCheckbox.showCheckbox = () => {
|
|
286
287
|
return true;
|
|
287
288
|
} : "";
|
|
288
|
-
return /*#__PURE__*/
|
|
289
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
289
290
|
className: `${styles$a["table-wrap"]} table-wrap-rem`
|
|
290
291
|
}, config.isHeader && hearderData.map((header, key) => {
|
|
291
|
-
return /*#__PURE__*/
|
|
292
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
292
293
|
className: `${styles$a["table-top"]} table-top-rem`,
|
|
293
294
|
key: key
|
|
294
|
-
}, /*#__PURE__*/
|
|
295
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
295
296
|
className: `${styles$a["table-items"]} table-items-rem`
|
|
296
297
|
}, header));
|
|
297
|
-
}), /*#__PURE__*/
|
|
298
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
298
299
|
className: `${styles$a["table-bottom"]} table-bottom-rem`
|
|
299
300
|
}, tbodyData.map((item, key) => {
|
|
300
|
-
return /*#__PURE__*/
|
|
301
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
301
302
|
className: `${styles$a["table-bottom-inner"]} table-bottom-inner-rem`,
|
|
302
303
|
key: key
|
|
303
304
|
}, keyNames.map((keyName, keyNameKey) => {
|
|
304
|
-
return /*#__PURE__*/
|
|
305
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
305
306
|
className: `${styles$a["table-items"]} table-items-rem`,
|
|
306
307
|
key: keyNameKey
|
|
307
|
-
}, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/
|
|
308
|
+
}, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
308
309
|
onClick: e => {
|
|
309
310
|
const id = e.target.id;
|
|
310
311
|
const checkedValue = e.target.checked;
|
|
@@ -314,15 +315,15 @@ const Table = ({
|
|
|
314
315
|
config.isCheckbox.onChange(ch);
|
|
315
316
|
},
|
|
316
317
|
jsonData: `[{"value":"", "name":"", "label":"", "id":${item.id}, "checked":${checked.indexOf(item.id) > -1 ? true : false}}]`
|
|
317
|
-
}), typeof keyName === "string" ? item[keyName] : /*#__PURE__*/
|
|
318
|
+
}), typeof keyName === "string" ? item[keyName] : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("i", {
|
|
318
319
|
className: keyName.icon
|
|
319
320
|
}), item[keyName.name]));
|
|
320
|
-
}), actions && /*#__PURE__*/
|
|
321
|
+
}), actions && /*#__PURE__*/React__default.createElement("div", {
|
|
321
322
|
className: `${styles$a["table-items"]} table-items-rem`
|
|
322
323
|
}, actions.filter(a => a.show && a.show(item) || a.show === undefined).map((action, key) => {
|
|
323
|
-
return /*#__PURE__*/
|
|
324
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
324
325
|
key: key
|
|
325
|
-
}, /*#__PURE__*/
|
|
326
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
326
327
|
className: action.icon,
|
|
327
328
|
onClick: action.click ? action.click : () => {}
|
|
328
329
|
}, action.icon));
|
|
@@ -428,7 +429,7 @@ const Typography = ({
|
|
|
428
429
|
const handleMouseLeave = () => {
|
|
429
430
|
setIsHover(false);
|
|
430
431
|
};
|
|
431
|
-
const tagT = /*#__PURE__*/
|
|
432
|
+
const tagT = /*#__PURE__*/React__default.createElement(variant, {
|
|
432
433
|
style: {
|
|
433
434
|
border: border ? border : configStyles.TYPOGRAPHY.border,
|
|
434
435
|
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
@@ -488,51 +489,51 @@ const Modal = ({
|
|
|
488
489
|
}) => {
|
|
489
490
|
classnames(styles$8.modal, className);
|
|
490
491
|
const [select, setSelect] = useState(selected);
|
|
491
|
-
return /*#__PURE__*/
|
|
492
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
492
493
|
className: `${styles$8["modal-wrap"]} modal-wrap-rem`,
|
|
493
494
|
onClick: () => setShow(false)
|
|
494
|
-
}, type == "content" ? /*#__PURE__*/
|
|
495
|
+
}, type == "content" ? /*#__PURE__*/React__default.createElement("div", {
|
|
495
496
|
className: `${styles$8["modal-content"]} modal-content-rem`,
|
|
496
497
|
onClick: e => {
|
|
497
498
|
e.stopPropagation();
|
|
498
499
|
}
|
|
499
|
-
}, /*#__PURE__*/
|
|
500
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
500
501
|
className: `${styles$8["modal-top"]} modal-top-rem`
|
|
501
|
-
}, /*#__PURE__*/
|
|
502
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
502
503
|
className: `${styles$8["modal-title"]} modal-title-rem`
|
|
503
|
-
}, /*#__PURE__*/
|
|
504
|
+
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
504
505
|
variant: TypographyType.p,
|
|
505
506
|
color: "#00236A"
|
|
506
|
-
}, headerText)), /*#__PURE__*/
|
|
507
|
+
}, headerText)), /*#__PURE__*/React__default.createElement("div", {
|
|
507
508
|
className: `${styles$8["close-btn"]} close-btn-rem`,
|
|
508
509
|
onClick: () => setShow(false)
|
|
509
|
-
}, /*#__PURE__*/
|
|
510
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
510
511
|
className: "icon-close"
|
|
511
|
-
}))), /*#__PURE__*/
|
|
512
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
512
513
|
className: `${styles$8["modal-section"]} modal-section-rem`
|
|
513
|
-
}, children)) : type == "images" ? /*#__PURE__*/
|
|
514
|
+
}, children)) : type == "images" ? /*#__PURE__*/React__default.createElement("div", {
|
|
514
515
|
className: `${styles$8["modal-content"]} modal-content-rem`,
|
|
515
516
|
onClick: e => {
|
|
516
517
|
e.stopPropagation();
|
|
517
518
|
}
|
|
518
|
-
}, /*#__PURE__*/
|
|
519
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
519
520
|
className: `${styles$8["close-btn"]} close-btn-rem`,
|
|
520
521
|
onClick: () => setShow(false)
|
|
521
|
-
}, /*#__PURE__*/
|
|
522
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
522
523
|
className: "icon-close"
|
|
523
|
-
})), /*#__PURE__*/
|
|
524
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
524
525
|
className: `${styles$8["modal-section"]} modal-section-rem`
|
|
525
|
-
}, /*#__PURE__*/
|
|
526
|
+
}, /*#__PURE__*/React__default.createElement("div", null, select > 1 ? /*#__PURE__*/React__default.createElement("h1", {
|
|
526
527
|
onClick: () => setSelect(select - 1)
|
|
527
528
|
}, "-") : null, data.map(elem => {
|
|
528
529
|
if (select == elem.id) {
|
|
529
|
-
return /*#__PURE__*/
|
|
530
|
+
return /*#__PURE__*/React__default.createElement("img", {
|
|
530
531
|
width: "600px",
|
|
531
532
|
key: elem.id,
|
|
532
533
|
src: elem.url
|
|
533
534
|
});
|
|
534
535
|
}
|
|
535
|
-
}), select < data.length ? /*#__PURE__*/
|
|
536
|
+
}), select < data.length ? /*#__PURE__*/React__default.createElement("h1", {
|
|
536
537
|
onClick: () => {
|
|
537
538
|
setSelect(select + 1);
|
|
538
539
|
}
|
|
@@ -634,9 +635,9 @@ const Input = ({
|
|
|
634
635
|
const handleMouseLeave = () => {
|
|
635
636
|
setIsHover(false);
|
|
636
637
|
};
|
|
637
|
-
return /*#__PURE__*/
|
|
638
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
638
639
|
className: `${styles$7["input-wrap"]}`
|
|
639
|
-
}, label ? /*#__PURE__*/
|
|
640
|
+
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
640
641
|
className: `${styles$7["input-title"]}`,
|
|
641
642
|
style: {
|
|
642
643
|
color: labelColor ? labelColor : configStyles.INPUT.labelColor,
|
|
@@ -646,11 +647,11 @@ const Input = ({
|
|
|
646
647
|
lineHeight: labelLineHeight ? labelLineHeight : configStyles.INPUT.labelLineHeight,
|
|
647
648
|
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.INPUT.labelMarginBottom
|
|
648
649
|
}
|
|
649
|
-
}, label, " ", required && /*#__PURE__*/
|
|
650
|
+
}, label, " ", required && /*#__PURE__*/React__default.createElement("sup", {
|
|
650
651
|
style: {
|
|
651
652
|
color: "#ee0000"
|
|
652
653
|
}
|
|
653
|
-
}, "*")) : '', /*#__PURE__*/
|
|
654
|
+
}, "*")) : '', /*#__PURE__*/React__default.createElement("div", {
|
|
654
655
|
className: `${styles$7["input-content"]}`,
|
|
655
656
|
style: {
|
|
656
657
|
width: width ? width : configStyles.INPUT.width,
|
|
@@ -659,7 +660,7 @@ const Input = ({
|
|
|
659
660
|
},
|
|
660
661
|
onMouseEnter: handleMouseEnter,
|
|
661
662
|
onMouseLeave: handleMouseLeave
|
|
662
|
-
}, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/
|
|
663
|
+
}, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/React__default.createElement("div", {
|
|
663
664
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
664
665
|
onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
|
|
665
666
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -673,7 +674,7 @@ const Input = ({
|
|
|
673
674
|
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
674
675
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
675
676
|
}
|
|
676
|
-
}, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/
|
|
677
|
+
}, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/React__default.createElement("div", {
|
|
677
678
|
style: {
|
|
678
679
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
679
680
|
fontSize: size ? size : configStyles.INPUT.size,
|
|
@@ -688,7 +689,7 @@ const Input = ({
|
|
|
688
689
|
justifyContent: phoneJustifyContent ? phoneJustifyContent : configStyles.INPUT.phoneJustifyContent,
|
|
689
690
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
690
691
|
}
|
|
691
|
-
}, "+374") : '', /*#__PURE__*/
|
|
692
|
+
}, "+374") : '', /*#__PURE__*/React__default.createElement("input", _extends({}, props, {
|
|
692
693
|
value: value,
|
|
693
694
|
className: classProps,
|
|
694
695
|
onChange: handleChange,
|
|
@@ -710,7 +711,7 @@ const Input = ({
|
|
|
710
711
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor,
|
|
711
712
|
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color
|
|
712
713
|
}
|
|
713
|
-
})), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/
|
|
714
|
+
})), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
714
715
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
715
716
|
onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
|
|
716
717
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -724,7 +725,7 @@ const Input = ({
|
|
|
724
725
|
borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
725
726
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
726
727
|
}
|
|
727
|
-
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', errorMessage ? /*#__PURE__*/
|
|
728
|
+
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', errorMessage ? /*#__PURE__*/React__default.createElement(P, {
|
|
728
729
|
style: {
|
|
729
730
|
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
730
731
|
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
@@ -807,11 +808,11 @@ const Radio = ({
|
|
|
807
808
|
}) => {
|
|
808
809
|
const classProps = classnames(styles$6.checkbox, className);
|
|
809
810
|
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
810
|
-
return /*#__PURE__*/
|
|
811
|
-
return /*#__PURE__*/
|
|
811
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, parseData.map((element, id) => {
|
|
812
|
+
return /*#__PURE__*/React__default.createElement("label", {
|
|
812
813
|
className: `${styles$6["radio-wrap"]} radio-wrap-rem`,
|
|
813
814
|
key: element.value
|
|
814
|
-
}, /*#__PURE__*/
|
|
815
|
+
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
815
816
|
type: "radio",
|
|
816
817
|
className: classProps,
|
|
817
818
|
disabled: disabled,
|
|
@@ -819,9 +820,9 @@ const Radio = ({
|
|
|
819
820
|
defaultChecked: id === 0 ? defaultChecked : "",
|
|
820
821
|
value: value ? value : element.value,
|
|
821
822
|
name: name ? name : element.name
|
|
822
|
-
}, props)), /*#__PURE__*/
|
|
823
|
+
}, props)), /*#__PURE__*/React__default.createElement("span", {
|
|
823
824
|
className: `${styles$6["radio-checkmark"]} radio-checkmark-rem`
|
|
824
|
-
}), element.label ? /*#__PURE__*/
|
|
825
|
+
}), element.label ? /*#__PURE__*/React__default.createElement("span", {
|
|
825
826
|
className: styles$6.labelRadio
|
|
826
827
|
}, label ? label : element.label) : "");
|
|
827
828
|
}));
|
|
@@ -884,7 +885,7 @@ const Button = ({
|
|
|
884
885
|
const handleMouseLeave = () => {
|
|
885
886
|
setIsHover(false);
|
|
886
887
|
};
|
|
887
|
-
return /*#__PURE__*/
|
|
888
|
+
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
888
889
|
style: {
|
|
889
890
|
fontSize: size ? size : configStyles.BUTTON.size,
|
|
890
891
|
fontFamily: font ? font : configStyles.BUTTON.font,
|
|
@@ -944,13 +945,13 @@ var ReactCheckboxChecked = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\
|
|
|
944
945
|
const SelectCheckbox = ({
|
|
945
946
|
checked
|
|
946
947
|
}) => {
|
|
947
|
-
return /*#__PURE__*/
|
|
948
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
948
949
|
style: {
|
|
949
950
|
marginRight: '9px'
|
|
950
951
|
}
|
|
951
|
-
}, checked ? /*#__PURE__*/
|
|
952
|
+
}, checked ? /*#__PURE__*/React__default.createElement("img", {
|
|
952
953
|
src: ReactCheckboxChecked
|
|
953
|
-
}) : /*#__PURE__*/
|
|
954
|
+
}) : /*#__PURE__*/React__default.createElement("img", {
|
|
954
955
|
src: ReactCheckbox
|
|
955
956
|
}));
|
|
956
957
|
};
|
|
@@ -958,11 +959,43 @@ SelectCheckbox.propTypes = {
|
|
|
958
959
|
checked: PropTypes.bool
|
|
959
960
|
};
|
|
960
961
|
|
|
961
|
-
|
|
962
|
+
const SvgArrow = ({
|
|
963
|
+
title,
|
|
964
|
+
titleId,
|
|
965
|
+
...props
|
|
966
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
967
|
+
width: "1em",
|
|
968
|
+
height: "1em",
|
|
969
|
+
viewBox: "0 0 15 9",
|
|
970
|
+
fill: "none",
|
|
971
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
972
|
+
"aria-labelledby": titleId
|
|
973
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
974
|
+
id: titleId
|
|
975
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
976
|
+
d: "M7.988 8a.997.997 0 0 1-.64-.23l-5.989-5a1.002 1.002 0 0 1 .548-1.767.998.998 0 0 1 .73.227l5.35 4.48 5.351-4.32a.997.997 0 0 1 1.408.15 1 1 0 0 1-.14 1.46l-5.99 4.83a.997.997 0 0 1-.628.17Z",
|
|
977
|
+
fill: "#3C393E"
|
|
978
|
+
}));
|
|
962
979
|
|
|
963
|
-
|
|
980
|
+
const SvgCloseIcon = ({
|
|
981
|
+
title,
|
|
982
|
+
titleId,
|
|
983
|
+
...props
|
|
984
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
985
|
+
width: "1em",
|
|
986
|
+
height: "1em",
|
|
987
|
+
viewBox: "0 0 14 14",
|
|
988
|
+
fill: "none",
|
|
989
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
990
|
+
"aria-labelledby": titleId
|
|
991
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
992
|
+
id: titleId
|
|
993
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
994
|
+
d: "m12.425.241.006-.005a.95.95 0 0 1 1.34 1.34l-.005.006-5.38 5.38 5.38 5.38.005.007a.95.95 0 0 1-1.34 1.34l-.006-.005-5.38-5.38-5.378 5.37a.951.951 0 1 1-1.34-1.341l5.377-5.37-5.38-5.388-.005-.006a.95.95 0 0 1 1.34-1.34l.006.005 5.38 5.387 5.38-5.38Z",
|
|
995
|
+
fill: "#3C393E"
|
|
996
|
+
}));
|
|
964
997
|
|
|
965
|
-
var css_248z$5 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;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}.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>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
|
|
998
|
+
var css_248z$5 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;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}.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>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
|
|
966
999
|
var styles$5 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","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-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
|
|
967
1000
|
styleInject(css_248z$5);
|
|
968
1001
|
|
|
@@ -1079,6 +1112,14 @@ const Select = ({
|
|
|
1079
1112
|
e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor;
|
|
1080
1113
|
e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
|
|
1081
1114
|
};
|
|
1115
|
+
const isObjectEmpty = obj => {
|
|
1116
|
+
for (var key in obj) {
|
|
1117
|
+
if (obj.hasOwnProperty(key)) {
|
|
1118
|
+
return false;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
return true;
|
|
1122
|
+
};
|
|
1082
1123
|
useEffect(() => {
|
|
1083
1124
|
if (opened) {
|
|
1084
1125
|
const checkIfClickedOutside = e => {
|
|
@@ -1093,7 +1134,7 @@ const Select = ({
|
|
|
1093
1134
|
}
|
|
1094
1135
|
}, [opened]);
|
|
1095
1136
|
useEffect(() => {
|
|
1096
|
-
selected && selected.length > 0 && setNewSelected(selected);
|
|
1137
|
+
selected && selected.length > 0 && setNewSelected(isObjectEmpty(selected[0]) ? [] : selected);
|
|
1097
1138
|
if (!multiple) {
|
|
1098
1139
|
options && options.length > 0 && setExistOptions(options);
|
|
1099
1140
|
} else {
|
|
@@ -1111,9 +1152,9 @@ const Select = ({
|
|
|
1111
1152
|
setExistOptions(modifiedOptions);
|
|
1112
1153
|
}
|
|
1113
1154
|
}, [options, multiple, selected]);
|
|
1114
|
-
return /*#__PURE__*/
|
|
1155
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1115
1156
|
className: classProps
|
|
1116
|
-
}, label ? /*#__PURE__*/
|
|
1157
|
+
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
1117
1158
|
style: {
|
|
1118
1159
|
color: labelColor ? labelColor : configStyles.SELECT.labelColor,
|
|
1119
1160
|
fontWeight: labelWeight ? labelWeight : configStyles.SELECT.labelWeight,
|
|
@@ -1123,15 +1164,15 @@ const Select = ({
|
|
|
1123
1164
|
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.SELECT.labelMarginBottom,
|
|
1124
1165
|
textTransform: labelTextTransform ? labelTextTransform : configStyles.SELECT.labelTextTransform
|
|
1125
1166
|
}
|
|
1126
|
-
}, label, required && /*#__PURE__*/
|
|
1167
|
+
}, label, required && /*#__PURE__*/React__default.createElement("sup", {
|
|
1127
1168
|
style: {
|
|
1128
1169
|
color: "#ee0000"
|
|
1129
1170
|
}
|
|
1130
|
-
}, "*")) : "", /*#__PURE__*/
|
|
1171
|
+
}, "*")) : "", /*#__PURE__*/React__default.createElement("div", {
|
|
1131
1172
|
ref: ref
|
|
1132
|
-
}, /*#__PURE__*/
|
|
1173
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1133
1174
|
className: styles$5['select-content']
|
|
1134
|
-
}, /*#__PURE__*/
|
|
1175
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1135
1176
|
style: {
|
|
1136
1177
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
|
|
1137
1178
|
minHeight: selectedMinHeight ? selectedMinHeight : configStyles.SELECT.selectedMinHeight,
|
|
@@ -1149,7 +1190,7 @@ const Select = ({
|
|
|
1149
1190
|
onMouseEnter: disabled ? _ => _ : _ => handleMouseEnter(),
|
|
1150
1191
|
onMouseLeave: disabled ? _ => _ : _ => handleMouseLeave(),
|
|
1151
1192
|
className: `${styles$5['select-content-top']}`
|
|
1152
|
-
}, /*#__PURE__*/
|
|
1193
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1153
1194
|
className: `${styles$5['select-content-top-text']}`,
|
|
1154
1195
|
style: {
|
|
1155
1196
|
color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor
|
|
@@ -1162,26 +1203,20 @@ const Select = ({
|
|
|
1162
1203
|
return newSelected[index][keyNames.name];
|
|
1163
1204
|
}
|
|
1164
1205
|
}
|
|
1165
|
-
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/
|
|
1206
|
+
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default.createElement("div", {
|
|
1166
1207
|
className: `${styles$5['select-content-top-icon']}`
|
|
1167
|
-
}, multiple && newSelected.length > 1 && /*#__PURE__*/
|
|
1208
|
+
}, multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
1168
1209
|
className: `${styles$5['close-icon']}`,
|
|
1169
1210
|
onClick: disabled ? _ => _ : handleClearSelect,
|
|
1170
1211
|
style: {
|
|
1171
1212
|
marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'
|
|
1172
1213
|
}
|
|
1173
|
-
}, closeIcon ? closeIcon : /*#__PURE__*/
|
|
1174
|
-
src: ReactCloseIcon,
|
|
1175
|
-
alt: "icon"
|
|
1176
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1214
|
+
}, closeIcon ? closeIcon : /*#__PURE__*/React__default.createElement(SvgCloseIcon, null)), /*#__PURE__*/React__default.createElement("div", {
|
|
1177
1215
|
style: {
|
|
1178
1216
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)'
|
|
1179
1217
|
},
|
|
1180
1218
|
className: `${styles$5['arrow-icon']}`
|
|
1181
|
-
}, arrowIcon ? arrowIcon : /*#__PURE__*/
|
|
1182
|
-
src: ReactArrowIcon,
|
|
1183
|
-
alt: "icon"
|
|
1184
|
-
})))), opened && !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
1219
|
+
}, arrowIcon ? arrowIcon : /*#__PURE__*/React__default.createElement(SvgArrow, null)))), opened && !disabled ? /*#__PURE__*/React__default.createElement("div", {
|
|
1185
1220
|
style: {
|
|
1186
1221
|
boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
|
|
1187
1222
|
borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
|
|
@@ -1189,10 +1224,10 @@ const Select = ({
|
|
|
1189
1224
|
top: parseFloat(selectedMinHeight ? selectedMinHeight.substring(0, selectedMinHeight.length - 2) : configStyles.SELECT.selectedMinHeight.substring(0, configStyles.SELECT.selectedMinHeight.length - 2)) + 6 + 'px'
|
|
1190
1225
|
},
|
|
1191
1226
|
className: `${styles$5['select-content-bottom']}`
|
|
1192
|
-
}, /*#__PURE__*/
|
|
1227
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1193
1228
|
className: `${styles$5['select-content-bottom-inner']}`
|
|
1194
1229
|
}, existOptions && existOptions.length > 0 && existOptions.map((option, i) => {
|
|
1195
|
-
return /*#__PURE__*/
|
|
1230
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1196
1231
|
key: i,
|
|
1197
1232
|
disabled: true,
|
|
1198
1233
|
defaultValue: option[keyNames.id],
|
|
@@ -1212,10 +1247,10 @@ const Select = ({
|
|
|
1212
1247
|
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1213
1248
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1214
1249
|
}
|
|
1215
|
-
}, multiple && multipleCheckbox ? /*#__PURE__*/
|
|
1250
|
+
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default.createElement(SelectCheckbox, {
|
|
1216
1251
|
checked: option.checked
|
|
1217
1252
|
}) : '', option[keyNames.name]);
|
|
1218
|
-
}))) : null)), errorMessage ? /*#__PURE__*/
|
|
1253
|
+
}))) : null)), errorMessage ? /*#__PURE__*/React__default.createElement("span", {
|
|
1219
1254
|
style: {
|
|
1220
1255
|
color: errorColor ? errorColor : configStyles.SELECT.errorColor,
|
|
1221
1256
|
fontSize: errorSize ? errorSize : configStyles.SELECT.errorSize
|
|
@@ -1314,7 +1349,7 @@ const Tooltip = ({
|
|
|
1314
1349
|
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setCheckTooltipWidth(tooltipRef.current.clientWidth);
|
|
1315
1350
|
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setCheckTooltipHeight(tooltipRef.current.clientHeight);
|
|
1316
1351
|
}, [text, tooltipRef, checkTooltipWidth, checkTooltipHeight]);
|
|
1317
|
-
return /*#__PURE__*/
|
|
1352
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1318
1353
|
className: `${styles$4['tooltip-block']}`,
|
|
1319
1354
|
style: {
|
|
1320
1355
|
width: width ? width : configStyles.TOOLTIP.width,
|
|
@@ -1322,7 +1357,7 @@ const Tooltip = ({
|
|
|
1322
1357
|
borderRadius: radius ? radius : configStyles.TOOLTIP.radius,
|
|
1323
1358
|
backgroundColor: backgroundColor ? backgroundColor : configStyles.TOOLTIP.backgroundColor
|
|
1324
1359
|
}
|
|
1325
|
-
}, showTooltip ? /*#__PURE__*/
|
|
1360
|
+
}, showTooltip ? /*#__PURE__*/React__default.createElement("div", {
|
|
1326
1361
|
ref: tooltipRef,
|
|
1327
1362
|
className: classProps,
|
|
1328
1363
|
style: {
|
|
@@ -1332,27 +1367,27 @@ const Tooltip = ({
|
|
|
1332
1367
|
top: type === 'top' ? `calc(-${checkTooltipHeight + 7}px)` : type === 'bottom' ? 'calc(100% + 7px)' : type === 'left' || type === 'right' ? `calc(50% - ${checkTooltipHeight / 2}px)` : '0px',
|
|
1333
1368
|
left: type === 'top' || type === 'bottom' ? `calc(50% - ${checkTooltipWidth / 2}px)` : type === 'left' ? `-${checkTooltipWidth + 7}px` : type === 'right' ? 'calc(100% + 7px)' : '0px'
|
|
1334
1369
|
}
|
|
1335
|
-
}, /*#__PURE__*/
|
|
1370
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1336
1371
|
className: `${styles$4['tooltip-rel']}`
|
|
1337
|
-
}, /*#__PURE__*/
|
|
1372
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1338
1373
|
className: `${styles$4['tooltip-decor']}`,
|
|
1339
1374
|
style: {
|
|
1340
1375
|
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
1341
1376
|
left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
|
|
1342
1377
|
top: type === 'top' ? 'calc(100% + 5px)' : type === 'bottom' ? '-15px' : type === 'right' || type === 'left' ? 'calc(50% - 5px)' : '0px'
|
|
1343
1378
|
}
|
|
1344
|
-
}), /*#__PURE__*/
|
|
1379
|
+
}), /*#__PURE__*/React__default.createElement("p", {
|
|
1345
1380
|
style: {
|
|
1346
1381
|
color: color ? color : configStyles.TOOLTIP.color,
|
|
1347
1382
|
fontSize: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
1348
1383
|
fontFamily: fontFamily ? fontFamily : configStyles.TOOLTIP.fontFamily
|
|
1349
1384
|
}
|
|
1350
|
-
}, text))) : '', /*#__PURE__*/
|
|
1385
|
+
}, text))) : '', /*#__PURE__*/React__default.createElement("div", {
|
|
1351
1386
|
style: {
|
|
1352
1387
|
cursor: 'pointer'
|
|
1353
1388
|
},
|
|
1354
1389
|
onClick: handleShow
|
|
1355
|
-
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/
|
|
1390
|
+
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default.createElement("img", {
|
|
1356
1391
|
src: ReactInfoIcon
|
|
1357
1392
|
})));
|
|
1358
1393
|
};
|
|
@@ -1410,27 +1445,27 @@ const Captcha = ({
|
|
|
1410
1445
|
function sliderChange(e) {
|
|
1411
1446
|
setRight(rangeCount == e.target.value ? true : false);
|
|
1412
1447
|
}
|
|
1413
|
-
return /*#__PURE__*/
|
|
1448
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
1414
1449
|
className: styles$3.main
|
|
1415
|
-
}, /*#__PURE__*/
|
|
1450
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1416
1451
|
className: styles$3.range
|
|
1417
|
-
}, /*#__PURE__*/
|
|
1452
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1418
1453
|
className: "icon-vector-down"
|
|
1419
|
-
})), /*#__PURE__*/
|
|
1454
|
+
})), /*#__PURE__*/React__default.createElement("input", {
|
|
1420
1455
|
type: "range",
|
|
1421
1456
|
className: styles$3.slider,
|
|
1422
1457
|
onClick: right ? onclick : null,
|
|
1423
1458
|
onInput: sliderInput,
|
|
1424
1459
|
onMouseUp: sliderChange
|
|
1425
|
-
}), /*#__PURE__*/
|
|
1460
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1426
1461
|
className: styles$3.selector
|
|
1427
|
-
}, /*#__PURE__*/
|
|
1462
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1428
1463
|
className: styles$3.selectBtn
|
|
1429
|
-
})), /*#__PURE__*/
|
|
1464
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
1430
1465
|
className: styles$3.progressBar
|
|
1431
|
-
}), /*#__PURE__*/
|
|
1466
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1432
1467
|
className: styles$3.range
|
|
1433
|
-
}, /*#__PURE__*/
|
|
1468
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1434
1469
|
className: "icon-vector-up"
|
|
1435
1470
|
}))));
|
|
1436
1471
|
};
|
|
@@ -1454,15 +1489,15 @@ const Stepper = ({
|
|
|
1454
1489
|
activeSteps
|
|
1455
1490
|
}) => {
|
|
1456
1491
|
classnames(className, 'stepper-inner-rem');
|
|
1457
|
-
return /*#__PURE__*/
|
|
1492
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1458
1493
|
className: `${styles$2['stepper-container']} stepper-container-rem`
|
|
1459
1494
|
}, (() => {
|
|
1460
1495
|
let steppers = [];
|
|
1461
1496
|
for (let step = 1; step <= stepLength; step++) {
|
|
1462
|
-
steppers.push( /*#__PURE__*/
|
|
1497
|
+
steppers.push( /*#__PURE__*/React__default.createElement("div", {
|
|
1463
1498
|
className: classnames(`${step <= activeSteps ? styles$2.activeRing : styles$2.bigRing}`),
|
|
1464
1499
|
key: step
|
|
1465
|
-
}, /*#__PURE__*/
|
|
1500
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1466
1501
|
className: classnames(`${step <= activeSteps ? styles$2.smallActiveRing : styles$2.smallRing}`)
|
|
1467
1502
|
}, step <= activeSteps ? step : "")));
|
|
1468
1503
|
}
|
|
@@ -1579,50 +1614,50 @@ const Pagination = ({
|
|
|
1579
1614
|
currentPageNumber !== 5 ? onPageChange(currentPageNumber - 5) : onPageChange(currentPageNumber - 4);
|
|
1580
1615
|
};
|
|
1581
1616
|
let lastPage = paginationRange[paginationRange.length - 1];
|
|
1582
|
-
return /*#__PURE__*/
|
|
1617
|
+
return /*#__PURE__*/React__default.createElement("ul", {
|
|
1583
1618
|
className: classProps
|
|
1584
|
-
}, /*#__PURE__*/
|
|
1619
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
1585
1620
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
1586
1621
|
onClick: onPrevious,
|
|
1587
1622
|
disabled: currentPage === 1 ? true : false
|
|
1588
|
-
}, /*#__PURE__*/
|
|
1623
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1589
1624
|
className: "icon-arrow-back"
|
|
1590
1625
|
})), paginationRange.map((pageNumber, id) => {
|
|
1591
1626
|
if (pageNumber === Dots) {
|
|
1592
1627
|
let currentPageIndex = paginationRange.indexOf(currentPageNumber);
|
|
1593
|
-
return /*#__PURE__*/
|
|
1628
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
1594
1629
|
key: id,
|
|
1595
1630
|
className: classnames(`${styles$1["pagination-jump-next"]} pagination-jump-next-rem`, styles$1.listItem),
|
|
1596
1631
|
onClick: id < currentPageIndex ? onPreviousFive : onNextFive,
|
|
1597
1632
|
disabled: currentPageIndex === 0 ? true : false
|
|
1598
|
-
}, id < currentPageIndex ? /*#__PURE__*/
|
|
1633
|
+
}, id < currentPageIndex ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
1599
1634
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
1600
|
-
}, /*#__PURE__*/
|
|
1635
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1601
1636
|
className: "icon-text"
|
|
1602
|
-
})), /*#__PURE__*/
|
|
1637
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
1603
1638
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
|
|
1604
|
-
}, /*#__PURE__*/
|
|
1639
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1605
1640
|
className: "icon-arrow-jump-back"
|
|
1606
|
-
}))) : /*#__PURE__*/
|
|
1641
|
+
}))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
1607
1642
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
1608
|
-
}, /*#__PURE__*/
|
|
1643
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1609
1644
|
className: "icon-text"
|
|
1610
|
-
})), /*#__PURE__*/
|
|
1645
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
1611
1646
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
|
|
1612
|
-
}, /*#__PURE__*/
|
|
1647
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1613
1648
|
className: "icon-arrow-jump-next"
|
|
1614
1649
|
}))));
|
|
1615
1650
|
}
|
|
1616
|
-
return /*#__PURE__*/
|
|
1651
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
1617
1652
|
onClick: () => onPageChange(pageNumber),
|
|
1618
1653
|
key: id,
|
|
1619
1654
|
className: classnames(`${pageNumber === currentPageNumber ? styles$1.selected : styles$1.listItem}`, `${styles$1["pagination-item"]} pagination-item-rem`)
|
|
1620
1655
|
}, pageNumber);
|
|
1621
|
-
}), /*#__PURE__*/
|
|
1656
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
|
1622
1657
|
onClick: onNext,
|
|
1623
1658
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
1624
1659
|
disabled: currentPageNumber === lastPage ? true : false
|
|
1625
|
-
}, /*#__PURE__*/
|
|
1660
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
1626
1661
|
className: "icon-arrow"
|
|
1627
1662
|
})));
|
|
1628
1663
|
};
|
|
@@ -1694,32 +1729,32 @@ const Autocomplate = ({
|
|
|
1694
1729
|
let optionList;
|
|
1695
1730
|
if (showOptions && inputValue) {
|
|
1696
1731
|
if (parseOptionsData.length && inputValue.length >= searchCount) {
|
|
1697
|
-
optionList = /*#__PURE__*/
|
|
1732
|
+
optionList = /*#__PURE__*/React__default.createElement("div", {
|
|
1698
1733
|
className: `${styles['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
|
|
1699
|
-
}, /*#__PURE__*/
|
|
1734
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1700
1735
|
className: `${styles['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
|
|
1701
1736
|
}, parseOptionsData.map((optionName, index) => {
|
|
1702
1737
|
let className;
|
|
1703
1738
|
if (index === activeOption) {
|
|
1704
1739
|
className = "option-active";
|
|
1705
1740
|
}
|
|
1706
|
-
return /*#__PURE__*/
|
|
1741
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1707
1742
|
className: `${styles[className]} autocomplate-content-click-rem`,
|
|
1708
1743
|
key: optionName[keyNames.id],
|
|
1709
1744
|
onClick: handleClick
|
|
1710
|
-
}, /*#__PURE__*/
|
|
1745
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1711
1746
|
id: optionName[keyNames.id],
|
|
1712
1747
|
className: `${styles['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
|
|
1713
1748
|
}, optionName[keyNames.name]));
|
|
1714
1749
|
})));
|
|
1715
1750
|
} else {
|
|
1716
|
-
optionList = /*#__PURE__*/
|
|
1751
|
+
optionList = /*#__PURE__*/React__default.createElement("div", {
|
|
1717
1752
|
className: `${styles['autocomplate-content-bottom']} autocomplate-content-bottom-rem`
|
|
1718
|
-
}, /*#__PURE__*/
|
|
1753
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1719
1754
|
className: `${styles['autocomplate-content-bottom-inner']} autocomplate-content-bottom-inner-rem`
|
|
1720
|
-
}, /*#__PURE__*/
|
|
1755
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1721
1756
|
className: `${styles['autocomplate-content-bottom-row']} autocomplate-content-bottom-row-rem`
|
|
1722
|
-
}, /*#__PURE__*/
|
|
1757
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1723
1758
|
className: `${styles['no-option']} autocomplate-no-option`
|
|
1724
1759
|
}, inputValue.length < searchCount ? `Լրացնել առնվազն ${searchCount} նիշ` : 'Նման տվյալ առկա չէ'))));
|
|
1725
1760
|
}
|
|
@@ -1728,15 +1763,15 @@ const Autocomplate = ({
|
|
|
1728
1763
|
setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
|
|
1729
1764
|
setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
|
|
1730
1765
|
}, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
|
|
1731
|
-
return /*#__PURE__*/
|
|
1766
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
1732
1767
|
className: `${styles['autocomplate-title']} autocomplate-title-rem`
|
|
1733
|
-
}, label, " ", required && /*#__PURE__*/
|
|
1768
|
+
}, label, " ", required && /*#__PURE__*/React__default.createElement("sup", {
|
|
1734
1769
|
style: {
|
|
1735
1770
|
color: "#ee0000"
|
|
1736
1771
|
}
|
|
1737
|
-
}, "*")) : "", /*#__PURE__*/
|
|
1772
|
+
}, "*")) : "", /*#__PURE__*/React__default.createElement("div", {
|
|
1738
1773
|
className: `${styles['autocomplate-content']} autocomplate-content-rem`
|
|
1739
|
-
}, /*#__PURE__*/
|
|
1774
|
+
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
1740
1775
|
id: inputId,
|
|
1741
1776
|
type: "text",
|
|
1742
1777
|
autoComplete: autoComplete ? autoComplete : configStyles.INPUT.autoComplete,
|
|
@@ -1748,7 +1783,7 @@ const Autocomplate = ({
|
|
|
1748
1783
|
},
|
|
1749
1784
|
value: inputValue,
|
|
1750
1785
|
placeholder: placeHolder
|
|
1751
|
-
}, props)), errorMessage ? /*#__PURE__*/
|
|
1786
|
+
}, props)), errorMessage ? /*#__PURE__*/React__default.createElement("span", {
|
|
1752
1787
|
className: styles.errorMessage
|
|
1753
1788
|
}, errorMessage) : null, optionList));
|
|
1754
1789
|
};
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,26 @@ var styled = require('styled-components');
|
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
12
30
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
13
32
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
14
33
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
15
34
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
@@ -969,11 +988,43 @@ SelectCheckbox.propTypes = {
|
|
|
969
988
|
checked: PropTypes__default["default"].bool
|
|
970
989
|
};
|
|
971
990
|
|
|
972
|
-
|
|
991
|
+
const SvgArrow = ({
|
|
992
|
+
title,
|
|
993
|
+
titleId,
|
|
994
|
+
...props
|
|
995
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
996
|
+
width: "1em",
|
|
997
|
+
height: "1em",
|
|
998
|
+
viewBox: "0 0 15 9",
|
|
999
|
+
fill: "none",
|
|
1000
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1001
|
+
"aria-labelledby": titleId
|
|
1002
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
1003
|
+
id: titleId
|
|
1004
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
1005
|
+
d: "M7.988 8a.997.997 0 0 1-.64-.23l-5.989-5a1.002 1.002 0 0 1 .548-1.767.998.998 0 0 1 .73.227l5.35 4.48 5.351-4.32a.997.997 0 0 1 1.408.15 1 1 0 0 1-.14 1.46l-5.99 4.83a.997.997 0 0 1-.628.17Z",
|
|
1006
|
+
fill: "#3C393E"
|
|
1007
|
+
}));
|
|
973
1008
|
|
|
974
|
-
|
|
1009
|
+
const SvgCloseIcon = ({
|
|
1010
|
+
title,
|
|
1011
|
+
titleId,
|
|
1012
|
+
...props
|
|
1013
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1014
|
+
width: "1em",
|
|
1015
|
+
height: "1em",
|
|
1016
|
+
viewBox: "0 0 14 14",
|
|
1017
|
+
fill: "none",
|
|
1018
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1019
|
+
"aria-labelledby": titleId
|
|
1020
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
1021
|
+
id: titleId
|
|
1022
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
1023
|
+
d: "m12.425.241.006-.005a.95.95 0 0 1 1.34 1.34l-.005.006-5.38 5.38 5.38 5.38.005.007a.95.95 0 0 1-1.34 1.34l-.006-.005-5.38-5.38-5.378 5.37a.951.951 0 1 1-1.34-1.341l5.377-5.37-5.38-5.388-.005-.006a.95.95 0 0 1 1.34-1.34l.006.005 5.38 5.387 5.38-5.38Z",
|
|
1024
|
+
fill: "#3C393E"
|
|
1025
|
+
}));
|
|
975
1026
|
|
|
976
|
-
var css_248z$5 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;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}.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>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
|
|
1027
|
+
var css_248z$5 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;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}.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>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
|
|
977
1028
|
var styles$5 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","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-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
|
|
978
1029
|
styleInject(css_248z$5);
|
|
979
1030
|
|
|
@@ -1090,6 +1141,14 @@ const Select = ({
|
|
|
1090
1141
|
e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor;
|
|
1091
1142
|
e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
|
|
1092
1143
|
};
|
|
1144
|
+
const isObjectEmpty = obj => {
|
|
1145
|
+
for (var key in obj) {
|
|
1146
|
+
if (obj.hasOwnProperty(key)) {
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return true;
|
|
1151
|
+
};
|
|
1093
1152
|
React.useEffect(() => {
|
|
1094
1153
|
if (opened) {
|
|
1095
1154
|
const checkIfClickedOutside = e => {
|
|
@@ -1104,7 +1163,7 @@ const Select = ({
|
|
|
1104
1163
|
}
|
|
1105
1164
|
}, [opened]);
|
|
1106
1165
|
React.useEffect(() => {
|
|
1107
|
-
selected && selected.length > 0 && setNewSelected(selected);
|
|
1166
|
+
selected && selected.length > 0 && setNewSelected(isObjectEmpty(selected[0]) ? [] : selected);
|
|
1108
1167
|
if (!multiple) {
|
|
1109
1168
|
options && options.length > 0 && setExistOptions(options);
|
|
1110
1169
|
} else {
|
|
@@ -1181,18 +1240,12 @@ const Select = ({
|
|
|
1181
1240
|
style: {
|
|
1182
1241
|
marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'
|
|
1183
1242
|
}
|
|
1184
|
-
}, closeIcon ? closeIcon : /*#__PURE__*/React__default["default"].createElement("
|
|
1185
|
-
src: ReactCloseIcon,
|
|
1186
|
-
alt: "icon"
|
|
1187
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1243
|
+
}, closeIcon ? closeIcon : /*#__PURE__*/React__default["default"].createElement(SvgCloseIcon, null)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1188
1244
|
style: {
|
|
1189
1245
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)'
|
|
1190
1246
|
},
|
|
1191
1247
|
className: `${styles$5['arrow-icon']}`
|
|
1192
|
-
}, arrowIcon ? arrowIcon : /*#__PURE__*/React__default["default"].createElement("
|
|
1193
|
-
src: ReactArrowIcon,
|
|
1194
|
-
alt: "icon"
|
|
1195
|
-
})))), opened && !disabled ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1248
|
+
}, arrowIcon ? arrowIcon : /*#__PURE__*/React__default["default"].createElement(SvgArrow, null)))), opened && !disabled ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1196
1249
|
style: {
|
|
1197
1250
|
boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
|
|
1198
1251
|
borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaypay/tui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"storybook": "STORYBOOK_PATH=../../tui.config.js start-storybook -p 6006",
|
|
10
10
|
"build-storybook": "STORYBOOK_PATH=../../tui.config.js build-storybook",
|
|
11
11
|
"build-lib": "STORYBOOK_PATH=../tui.config.js rollup --config rollup.config.js",
|
|
12
|
-
"svgr": "svgr --icon --title-prop
|
|
12
|
+
"svgr": "svgr --icon --title-prop -d src/components/icon -- src/assets/icons"
|
|
13
13
|
},
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "MIT",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@storybook/react": "^6.5.10",
|
|
29
29
|
"@storybook/testing-library": "^0.0.13",
|
|
30
30
|
"@svgr/cli": "^6.4.0",
|
|
31
|
+
"@svgr/webpack": "^6.5.1",
|
|
31
32
|
"babel-loader": "^8.2.5",
|
|
32
33
|
"classnames": "^2.3.1",
|
|
33
34
|
"css-loader": "^6.7.1",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgArrow = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="1em"
|
|
5
|
+
height="1em"
|
|
6
|
+
viewBox="0 0 15 9"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="M7.988 8a.997.997 0 0 1-.64-.23l-5.989-5a1.002 1.002 0 0 1 .548-1.767.998.998 0 0 1 .73.227l5.35 4.48 5.351-4.32a.997.997 0 0 1 1.408.15 1 1 0 0 1-.14 1.46l-5.99 4.83a.997.997 0 0 1-.628.17Z"
|
|
15
|
+
fill="#3C393E"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgArrow;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCheckboxChecked = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="1em"
|
|
5
|
+
height="1em"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M12.8 0H3.2A3.2 3.2 0 0 0 0 3.2v9.6A3.2 3.2 0 0 0 3.2 16h9.6a3.2 3.2 0 0 0 3.2-3.2V3.2A3.2 3.2 0 0 0 12.8 0ZM6.85 10.966c.068.023.14.034.218.034.078 0 .151-.011.219-.034a.515.515 0 0 0 .19-.114l5.363-4.94A.496.496 0 0 0 13 5.53a.496.496 0 0 0-.16-.382.589.589 0 0 0-.415-.148.59.59 0 0 0-.416.148l-4.94 4.55-2.085-1.92a.579.579 0 0 0-.408-.147.579.579 0 0 0-.408.148A.52.52 0 0 0 4 8.16a.476.476 0 0 0 .154.383l2.506 2.308a.515.515 0 0 0 .19.114Z"
|
|
17
|
+
fill="#00236A"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
export default SvgCheckboxChecked;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCheckboxUnchecked = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="1em"
|
|
5
|
+
height="1em"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M3.2 0h9.6A3.2 3.2 0 0 1 16 3.2v9.6a3.2 3.2 0 0 1-3.2 3.2H3.2A3.2 3.2 0 0 1 0 12.8V3.2A3.2 3.2 0 0 1 3.2 0Zm0 1.6a1.6 1.6 0 0 0-1.6 1.6v9.6a1.6 1.6 0 0 0 1.6 1.6h9.6a1.6 1.6 0 0 0 1.6-1.6V3.2a1.6 1.6 0 0 0-1.6-1.6H3.2Z"
|
|
17
|
+
fill="#D1D1D1"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
export default SvgCheckboxUnchecked;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCloseIcon = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="1em"
|
|
5
|
+
height="1em"
|
|
6
|
+
viewBox="0 0 14 14"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="m12.425.241.006-.005a.95.95 0 0 1 1.34 1.34l-.005.006-5.38 5.38 5.38 5.38.005.007a.95.95 0 0 1-1.34 1.34l-.006-.005-5.38-5.38-5.378 5.37a.951.951 0 1 1-1.34-1.341l5.377-5.37-5.38-5.388-.005-.006a.95.95 0 0 1 1.34-1.34l.006.005 5.38 5.387 5.38-5.38Z"
|
|
15
|
+
fill="#3C393E"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgCloseIcon;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgTooltip = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="1em"
|
|
5
|
+
height="1em"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="M8 0a8 8 0 1 0 .001 16.001A8 8 0 0 0 8 0Zm.571 11.857A.143.143 0 0 1 8.43 12H7.57a.143.143 0 0 1-.142-.143V7c0-.079.064-.143.142-.143h.858c.078 0 .142.064.142.143v4.857ZM8 5.714A.857.857 0 0 1 8 4a.857.857 0 0 1 0 1.714Z"
|
|
15
|
+
fill="#D1D1D1"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgTooltip;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as StarOutline } from "./StarOutline";
|
|
1
|
+
export { default as Arrow } from "./Arrow";
|
|
2
|
+
export { default as CheckboxChecked } from "./CheckboxChecked";
|
|
3
|
+
export { default as CheckboxUnchecked } from "./CheckboxUnchecked";
|
|
4
|
+
export { default as CloseIcon } from "./CloseIcon";
|
|
5
|
+
export { default as Tooltip } from "./Tooltip";
|
|
@@ -2,11 +2,10 @@ import React, {useEffect, useState, useRef} from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { compereConfigs } from "./../../utils";
|
|
5
|
-
|
|
6
5
|
import { SelectCheckbox } from './../selectCheckbox';
|
|
7
6
|
|
|
8
|
-
import ReactArrowIcon from '
|
|
9
|
-
import ReactCloseIcon from '
|
|
7
|
+
import ReactArrowIcon from '../icon/Arrow';
|
|
8
|
+
import ReactCloseIcon from '../icon/CloseIcon';
|
|
10
9
|
|
|
11
10
|
import styles from './select.module.css';
|
|
12
11
|
|
|
@@ -147,6 +146,15 @@ export const Select = ({
|
|
|
147
146
|
e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
|
|
148
147
|
};
|
|
149
148
|
|
|
149
|
+
const isObjectEmpty = (obj) => {
|
|
150
|
+
for (var key in obj) {
|
|
151
|
+
if (obj.hasOwnProperty(key)) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
|
|
150
158
|
useEffect(() => {
|
|
151
159
|
if(opened){
|
|
152
160
|
const checkIfClickedOutside = e => {
|
|
@@ -162,7 +170,7 @@ export const Select = ({
|
|
|
162
170
|
}, [opened]);
|
|
163
171
|
|
|
164
172
|
useEffect(() => {
|
|
165
|
-
selected && selected.length > 0 && setNewSelected(selected);
|
|
173
|
+
selected && selected.length > 0 && setNewSelected(isObjectEmpty(selected[0]) ? []: selected );
|
|
166
174
|
if (!multiple) {
|
|
167
175
|
options && options.length > 0 && setExistOptions(options);
|
|
168
176
|
} else {
|
|
@@ -252,7 +260,7 @@ export const Select = ({
|
|
|
252
260
|
onClick={disabled ? _ => _ : handleClearSelect}
|
|
253
261
|
style={{marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'}}
|
|
254
262
|
>
|
|
255
|
-
{ closeIcon ? closeIcon : <
|
|
263
|
+
{ closeIcon ? closeIcon : <ReactCloseIcon /> }
|
|
256
264
|
</div>
|
|
257
265
|
}
|
|
258
266
|
|
|
@@ -261,7 +269,7 @@ export const Select = ({
|
|
|
261
269
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
262
270
|
}}
|
|
263
271
|
className={`${styles['arrow-icon']}`}>
|
|
264
|
-
{arrowIcon ? arrowIcon : <
|
|
272
|
+
{arrowIcon ? arrowIcon : <ReactArrowIcon />}
|
|
265
273
|
</div>
|
|
266
274
|
</div>
|
|
267
275
|
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgLikeFilled = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="1em"
|
|
6
|
-
height="1em"
|
|
7
|
-
viewBox="0 0 23 20"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
role="img"
|
|
10
|
-
aria-labelledby={titleId}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
14
|
-
<g fill="none" fillRule="evenodd">
|
|
15
|
-
<path opacity={0.87} d="M-1-1h24v24H-1z" />
|
|
16
|
-
<path
|
|
17
|
-
d="M12.12 1.06 6.58 6.6c-.37.37-.58.88-.58 1.41V18c0 1.1.9 2 2 2h9c.8 0 1.52-.48 1.84-1.21l3.26-7.61C22.94 9.2 21.49 7 19.34 7h-5.65l.95-4.58c.1-.5-.05-1.01-.41-1.37-.59-.58-1.53-.58-2.11.01ZM2 20c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2s-2 .9-2 2v8c0 1.1.9 2 2 2Z"
|
|
18
|
-
fill="currentColor"
|
|
19
|
-
/>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgLikeFilled;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgLikeOutline = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="1em"
|
|
6
|
-
height="1em"
|
|
7
|
-
viewBox="0 0 22 20"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
role="img"
|
|
10
|
-
aria-labelledby={titleId}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
14
|
-
<g fill="none" fillRule="evenodd">
|
|
15
|
-
<path opacity={0.87} d="M-1-1h24v24H-1z" />
|
|
16
|
-
<path
|
|
17
|
-
d="M20 7h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L13.17 0 6.59 6.59C6.22 6.95 6 7.45 6 8v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73V9c0-1.1-.9-2-2-2Zm0 4-3 7H8V8l4.34-4.34L11.23 9H20v2ZM0 8h4v12H0V8Z"
|
|
18
|
-
fill="currentColor"
|
|
19
|
-
/>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgLikeOutline;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgStarFilled = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="1em"
|
|
6
|
-
height="1em"
|
|
7
|
-
viewBox="0 0 18 17"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
role="img"
|
|
10
|
-
aria-labelledby={titleId}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
14
|
-
<g fill="none" fillRule="evenodd">
|
|
15
|
-
<path d="M-3-3h24v24H-3z" />
|
|
16
|
-
<path
|
|
17
|
-
d="m9 14.27 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L6.19 5.63l-4.83.41C.48 6.11.12 7.21.79 7.79l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08L9 14.27Z"
|
|
18
|
-
fill="currentColor"
|
|
19
|
-
/>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgStarFilled;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgStarOutline = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
viewBox="0 0 24 24"
|
|
7
|
-
fill="none"
|
|
8
|
-
stroke="currentColor"
|
|
9
|
-
strokeWidth={2}
|
|
10
|
-
strokeLinecap="round"
|
|
11
|
-
strokeLinejoin="round"
|
|
12
|
-
className="star-outline_svg__feather star-outline_svg__feather-star"
|
|
13
|
-
width="1em"
|
|
14
|
-
height="1em"
|
|
15
|
-
role="img"
|
|
16
|
-
aria-labelledby={titleId}
|
|
17
|
-
{...props}
|
|
18
|
-
>
|
|
19
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
20
|
-
<path d="m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgStarOutline;
|