@xaypay/tui 0.0.117 → 0.0.119
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/README.md +92 -0
- package/dist/index.es.js +357 -162
- package/dist/index.js +358 -161
- package/package.json +1 -1
- package/src/components/captcha/index.js +2 -2
- package/src/components/newFile/index.js +77 -3
- package/src/components/newFile/newFile.stories.js +47 -11
- package/src/components/radio/index.js +222 -41
- package/src/components/radio/radio.stories.js +52 -3
- package/src/components/table/index.js +38 -0
- package/src/components/table/table.module.css +1 -4
- package/src/components/table/td.js +17 -8
- package/src/components/table/th.js +4 -1
- package/src/components/textarea/index.js +51 -17
- package/src/components/textarea/textarea.stories.js +7 -1
- package/src/stories/changelog.stories.mdx +44 -3
- package/src/stories/configuration.stories.mdx +46 -17
- package/src/stories/static/radio-usage.png +0 -0
- package/src/stories/usage.stories.mdx +5 -4
- package/tui.config.js +32 -3
- package/src/stories/static/single-checkbox-usage.png +0 -0
package/dist/index.js
CHANGED
|
@@ -114,9 +114,9 @@ function styleInject(css, ref) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
var css_248z$
|
|
118
|
-
var styles$
|
|
119
|
-
styleInject(css_248z$
|
|
117
|
+
var css_248z$d = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{display:block;height:auto;max-height:95%;object-fit:contain;width:27.8rem}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
|
|
118
|
+
var styles$b = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
|
|
119
|
+
styleInject(css_248z$d);
|
|
120
120
|
|
|
121
121
|
const File = ({
|
|
122
122
|
name,
|
|
@@ -176,11 +176,11 @@ const File = ({
|
|
|
176
176
|
document.querySelector(`.${name}`).value = '';
|
|
177
177
|
};
|
|
178
178
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
179
|
-
className: `${styles$
|
|
179
|
+
className: `${styles$b['file-form-title']} ile-form-title-rem`
|
|
180
180
|
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", null, /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
181
|
-
className: classnames__default["default"](`${styles$
|
|
181
|
+
className: classnames__default["default"](`${styles$b['file-form-wrap']} file-form-wrap-rem`, image ? styles$b['active'] : '')
|
|
182
182
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
183
|
-
className: `${styles$
|
|
183
|
+
className: `${styles$b['file-form']} file-form-rem ${error || errorMessage ? styles$b['error'] : ''}`,
|
|
184
184
|
onClick: () => document.querySelector(`.${name}`).click()
|
|
185
185
|
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
186
186
|
hidden: true,
|
|
@@ -189,23 +189,23 @@ const File = ({
|
|
|
189
189
|
disabled: disabled,
|
|
190
190
|
onChange: e => handleCheckFile(e)
|
|
191
191
|
}), image ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
192
|
-
className: `${styles$
|
|
192
|
+
className: `${styles$b['upload-file-content']} upload-file-content-rem`
|
|
193
193
|
}, image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
194
194
|
src: image,
|
|
195
195
|
alt: fileName
|
|
196
196
|
})) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
197
|
-
className: `${styles$
|
|
197
|
+
className: `${styles$b['file-form-inner-upload']} ile-form-inner-upload-rem`
|
|
198
198
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
199
199
|
src: "../../assets/upload.svg",
|
|
200
200
|
alt: ""
|
|
201
201
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
202
|
-
className: `${styles$
|
|
202
|
+
className: `${styles$b['upload-info']} upload-info-rem`
|
|
203
203
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
204
|
-
className: `${styles$
|
|
204
|
+
className: `${styles$b['upload-info-txt']} upload-info-txt-rem`
|
|
205
205
|
}, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
206
|
-
className: `${styles$
|
|
206
|
+
className: `${styles$b['upload-info-size']} upload-info-size-rem`
|
|
207
207
|
}, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), !disabled && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
208
|
-
className: `${styles$
|
|
208
|
+
className: `${styles$b['delete-upload-icon']} delete-upload-icon-rem`,
|
|
209
209
|
onClick: handleRemoveFile
|
|
210
210
|
}, /*#__PURE__*/React__default["default"].createElement("i", {
|
|
211
211
|
className: "icon-delete"
|
|
@@ -413,9 +413,9 @@ SingleCheckbox.propTypes = {
|
|
|
413
413
|
ignoreDisabledForChecked: PropTypes__default["default"].bool
|
|
414
414
|
};
|
|
415
415
|
|
|
416
|
-
var css_248z$
|
|
417
|
-
var styles$
|
|
418
|
-
styleInject(css_248z$
|
|
416
|
+
var css_248z$c = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}.table-module_list-text__kmKIq{cursor:pointer;margin:0 0 8px;white-space:wrap}.table-module_dots-option-item__jNOxO{box-sizing:border-box;cursor:pointer;display:flex;height:39px;margin-bottom:2px;padding:10px;position:relative;width:100%}.table-module_dots-option-item__jNOxO:after{background-color:#eee;border-radius:1px;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;-o-border-radius:1px;content:\"\";height:2px;left:10px;position:absolute;top:calc(100% - 2px);width:calc(100% - 20px)}.table-module_dots-option-item__jNOxO:last-child:after{display:none}";
|
|
417
|
+
var styles$a = {"sorting-arrows":"table-module_sorting-arrows__BaN-G","td-span":"table-module_td-span__XHo6k","list-text":"table-module_list-text__kmKIq","dots-option-item":"table-module_dots-option-item__jNOxO"};
|
|
418
|
+
styleInject(css_248z$c);
|
|
419
419
|
|
|
420
420
|
/* eslint-disable no-prototype-builtins */
|
|
421
421
|
const TH = ({
|
|
@@ -426,6 +426,8 @@ const TH = ({
|
|
|
426
426
|
tHeadFontSize,
|
|
427
427
|
tHeadTextAlign,
|
|
428
428
|
tHeadFontWeight,
|
|
429
|
+
tableColumnMinWidth,
|
|
430
|
+
tableColumnMaxWidth,
|
|
429
431
|
handleCheckedHeader,
|
|
430
432
|
borderTopLeftRadius,
|
|
431
433
|
borderTopRightRadius,
|
|
@@ -441,18 +443,19 @@ const TH = ({
|
|
|
441
443
|
style: {
|
|
442
444
|
width: 'auto',
|
|
443
445
|
cursor: 'pointer',
|
|
444
|
-
whiteSpace: 'nowrap',
|
|
445
446
|
position: 'relative',
|
|
446
447
|
padding: tHeadPadding,
|
|
447
448
|
fontSize: tHeadFontSize,
|
|
448
449
|
fontFamily: tHeadFamily,
|
|
449
450
|
fontWeight: tHeadFontWeight,
|
|
451
|
+
minWidth: tableColumnMinWidth,
|
|
452
|
+
maxWidth: tableColumnMaxWidth,
|
|
450
453
|
borderTopLeftRadius: borderTopLeftRadius,
|
|
451
454
|
borderTopRightRadius: borderTopRightRadius,
|
|
452
455
|
borderColor: hideBorder ? 'transparent' : '#eeeeee'
|
|
453
456
|
},
|
|
454
457
|
onClick: handleHeaderItemClick,
|
|
455
|
-
className: `${hasOwnerProperty(item, 'sortingArrows') ? item.sortingArrows === true ? styles$
|
|
458
|
+
className: `${hasOwnerProperty(item, 'sortingArrows') ? item.sortingArrows === true ? styles$a['sorting-arrows'] : '' : ''}`
|
|
456
459
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
457
460
|
style: {
|
|
458
461
|
display: 'flex',
|
|
@@ -491,7 +494,11 @@ const TD = ({
|
|
|
491
494
|
tBodyFontFamily,
|
|
492
495
|
tBodyFontWeight,
|
|
493
496
|
handleCheckDots,
|
|
497
|
+
openListFontSize,
|
|
494
498
|
handleCheckedBody,
|
|
499
|
+
openListFontFamily,
|
|
500
|
+
tableColumnMinWidth,
|
|
501
|
+
tableColumnMaxWidth,
|
|
495
502
|
handleBodyActionClick,
|
|
496
503
|
handleMoreOptionsClick,
|
|
497
504
|
handleContentListClick,
|
|
@@ -541,13 +548,15 @@ const TD = ({
|
|
|
541
548
|
width: 'auto',
|
|
542
549
|
color: tBodyColor,
|
|
543
550
|
verticalAlign: 'top',
|
|
544
|
-
whiteSpace: 'nowrap',
|
|
545
551
|
padding: tBodyPadding,
|
|
546
552
|
fontSize: tBodyFontSize,
|
|
547
553
|
borderRight: borderRight,
|
|
548
554
|
textAlign: tBodyTextAlign,
|
|
549
555
|
fontFamily: tBodyFontFamily,
|
|
550
556
|
fontWeight: tBodyFontWeight,
|
|
557
|
+
minWidth: tableColumnMinWidth,
|
|
558
|
+
maxWidth: tableColumnMaxWidth,
|
|
559
|
+
whiteSpace: Array.isArray(item) ? 'nowrap' : 'wrap',
|
|
551
560
|
borderColor: hideBorder ? 'transparent' : '#eeeeee',
|
|
552
561
|
boxShadow: hasOwnerProperty(item, 'colorStatus') ? `inset 3px 0px 0px 0px ${item.colorStatus}` : '',
|
|
553
562
|
borderTopLeftRadius: rowItem && innerIndex === 0 ? rowRadius : '0px',
|
|
@@ -566,7 +575,7 @@ const TD = ({
|
|
|
566
575
|
},
|
|
567
576
|
id: newItem.id,
|
|
568
577
|
type: newItem.type,
|
|
569
|
-
className: styles$
|
|
578
|
+
className: styles$a['td-span'],
|
|
570
579
|
key: `${newItem.id}_${newIndex}`,
|
|
571
580
|
onClick: e => handleCheckActions(e, newItem, 'type', newIndex)
|
|
572
581
|
}, newItem.content === 0 ? newItem.content.toString() : newItem.content ? newItem.content : '');
|
|
@@ -588,7 +597,7 @@ const TD = ({
|
|
|
588
597
|
},
|
|
589
598
|
id: iT.id ? iT.id : '',
|
|
590
599
|
type: iT.type ? iT.type : '',
|
|
591
|
-
className: styles$
|
|
600
|
+
className: styles$a['td-span'],
|
|
592
601
|
onClick: e => handleCheckActions(e, iT, 'type', iN),
|
|
593
602
|
key: `${iT.id || iT.content}_${iN}`
|
|
594
603
|
}, iT.content === 0 ? iT.content.toString() : iT.content ? iT.content : '');
|
|
@@ -612,7 +621,7 @@ const TD = ({
|
|
|
612
621
|
cursor: 'pointer'
|
|
613
622
|
},
|
|
614
623
|
onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
|
|
615
|
-
className: styles$
|
|
624
|
+
className: styles$a['td-span']
|
|
616
625
|
}, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '', hasOwnerProperty(item, 'checkBox') && /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
|
|
617
626
|
data: item,
|
|
618
627
|
index: index,
|
|
@@ -624,11 +633,13 @@ const TD = ({
|
|
|
624
633
|
unCheckedColor: item.checkBox.unCheckedColor
|
|
625
634
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
626
635
|
style: {
|
|
627
|
-
|
|
628
|
-
|
|
636
|
+
flexShrink: 11,
|
|
637
|
+
marginLeft: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '0px' : '11px' : hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow') ? '11px' : '0px' : '0px',
|
|
638
|
+
marginRight: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '11px' : '0px' : '0px' : '0px'
|
|
629
639
|
}
|
|
630
640
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
631
641
|
style: {
|
|
642
|
+
textAlign: tBodyTextAlign,
|
|
632
643
|
margin: '0px',
|
|
633
644
|
cursor: hasOwnerProperty(item, 'arrowComponent') || hasOwnerProperty(item, 'dots') ? 'pointer' : 'auto'
|
|
634
645
|
},
|
|
@@ -657,7 +668,7 @@ const TD = ({
|
|
|
657
668
|
}, hasOwnerProperty(item, 'options') && item.options.map((optionItem, optionIndex) => {
|
|
658
669
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
659
670
|
key: `${optionItem.content}_${optionIndex}`,
|
|
660
|
-
className: styles$
|
|
671
|
+
className: styles$a['dots-option-item'],
|
|
661
672
|
style: {
|
|
662
673
|
color: '#3C393E',
|
|
663
674
|
fontSize: '14px',
|
|
@@ -683,17 +694,20 @@ const TD = ({
|
|
|
683
694
|
style: {
|
|
684
695
|
overflow: 'auto',
|
|
685
696
|
marginTop: '10px',
|
|
686
|
-
maxHeight: '
|
|
697
|
+
maxHeight: '500px',
|
|
687
698
|
maxWidth: '100%',
|
|
688
699
|
height: item.status === 'close' ? '0px' : 'auto'
|
|
689
700
|
}
|
|
690
701
|
}, item.contentList.map((innerItem, innerItemIndex) => {
|
|
691
702
|
return /*#__PURE__*/React__default["default"].createElement("p", {
|
|
692
703
|
key: `${innerItem}_${innerItemIndex}`,
|
|
693
|
-
className: styles$
|
|
704
|
+
className: styles$a['list-text'],
|
|
694
705
|
style: {
|
|
706
|
+
maxWidth: '100%',
|
|
695
707
|
color: openListColor,
|
|
696
|
-
|
|
708
|
+
textAlign: tBodyTextAlign,
|
|
709
|
+
fontSize: openListFontSize,
|
|
710
|
+
fontFamily: openListFontFamily
|
|
697
711
|
},
|
|
698
712
|
onClick: e => handleContentList(e, item, index, innerIndex, innerItem.id, innerItem.content, innerItemIndex)
|
|
699
713
|
}, innerItem.content === 0 ? innerItem.content.toString() : innerItem.content ? innerItem.content : '');
|
|
@@ -705,7 +719,7 @@ const TD = ({
|
|
|
705
719
|
cursor: 'pointer'
|
|
706
720
|
},
|
|
707
721
|
onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
|
|
708
|
-
className: styles$
|
|
722
|
+
className: styles$a['td-span']
|
|
709
723
|
}, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '') : '');
|
|
710
724
|
};
|
|
711
725
|
|
|
@@ -771,6 +785,8 @@ const Table = ({
|
|
|
771
785
|
tableRowRadius,
|
|
772
786
|
tableRowBGColor,
|
|
773
787
|
tableRowBoxShadow,
|
|
788
|
+
tableColumnMaxWidth,
|
|
789
|
+
tableColumnMinWidth,
|
|
774
790
|
tHeadColor,
|
|
775
791
|
tHeadFamily,
|
|
776
792
|
tHeadPadding,
|
|
@@ -790,6 +806,8 @@ const Table = ({
|
|
|
790
806
|
tBodyRowMarginTop,
|
|
791
807
|
className,
|
|
792
808
|
openListColor,
|
|
809
|
+
openListFontSize,
|
|
810
|
+
openListFontFamily,
|
|
793
811
|
hideBorder
|
|
794
812
|
}) => {
|
|
795
813
|
const [body, setBody] = React.useState([]);
|
|
@@ -1290,7 +1308,9 @@ const Table = ({
|
|
|
1290
1308
|
tHeadTextAlign: tHeadTextAlign ? tHeadTextAlign : configStyles.TABLE.tHeadTextAlign,
|
|
1291
1309
|
tHeadFontWeight: tHeadFontWeight ? tHeadFontWeight : configStyles.TABLE.tHeadFontWeight,
|
|
1292
1310
|
borderTopLeftRadius: index === 0 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px',
|
|
1293
|
-
borderTopRightRadius: index === header.length - 1 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px'
|
|
1311
|
+
borderTopRightRadius: index === header.length - 1 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px',
|
|
1312
|
+
tableColumnMinWidth: tableColumnMinWidth ? tableColumnMinWidth : configStyles.TABLE.tableColumnMinWidth,
|
|
1313
|
+
tableColumnMaxWidth: tableColumnMaxWidth ? tableColumnMaxWidth : configStyles.TABLE.tableColumnMaxWidth
|
|
1294
1314
|
});
|
|
1295
1315
|
}))), body && body.length > 0 && /*#__PURE__*/React__default["default"].createElement("tbody", {
|
|
1296
1316
|
style: {
|
|
@@ -1316,6 +1336,10 @@ const Table = ({
|
|
|
1316
1336
|
handleCheckDots: handleCheckDots,
|
|
1317
1337
|
key: `${innerItem}_${index}_${innerIndex}`,
|
|
1318
1338
|
openListColor: openListColor ? openListColor : configStyles.TABLE.openListColor,
|
|
1339
|
+
tableColumnMinWidth: tableColumnMinWidth ? tableColumnMinWidth : configStyles.TABLE.tableColumnMinWidth,
|
|
1340
|
+
tableColumnMaxWidth: tableColumnMaxWidth ? tableColumnMaxWidth : configStyles.TABLE.tableColumnMaxWidth,
|
|
1341
|
+
openListFontSize: openListFontSize ? openListFontSize : configStyles.TABLE.openListFontSize,
|
|
1342
|
+
openListFontFamily: openListFontFamily ? openListFontFamily : configStyles.TABLE.openListFontFamily,
|
|
1319
1343
|
handleCheckedBody: handleCheckedBody,
|
|
1320
1344
|
handleBodyActionClick: handleBodyActionClick,
|
|
1321
1345
|
handleMoreOptionsClick: handleMoreOptionsClick,
|
|
@@ -1345,6 +1369,8 @@ Table.propTypes = {
|
|
|
1345
1369
|
tableRowRadius: PropTypes__default["default"].string,
|
|
1346
1370
|
tableRowBGColor: PropTypes__default["default"].string,
|
|
1347
1371
|
tableRowBoxShadow: PropTypes__default["default"].string,
|
|
1372
|
+
tableColumnMaxWidth: PropTypes__default["default"].string,
|
|
1373
|
+
tableColumnMinWidth: PropTypes__default["default"].string,
|
|
1348
1374
|
tHeadColor: PropTypes__default["default"].string,
|
|
1349
1375
|
tHeadFamily: PropTypes__default["default"].string,
|
|
1350
1376
|
tHeadPadding: PropTypes__default["default"].string,
|
|
@@ -1364,12 +1390,14 @@ Table.propTypes = {
|
|
|
1364
1390
|
className: PropTypes__default["default"].string,
|
|
1365
1391
|
tBodyRowBorder: PropTypes__default["default"].string,
|
|
1366
1392
|
openListColor: PropTypes__default["default"].string,
|
|
1393
|
+
openListFontSize: PropTypes__default["default"].string,
|
|
1394
|
+
openListFontFamily: PropTypes__default["default"].string,
|
|
1367
1395
|
hideBorder: PropTypes__default["default"].bool
|
|
1368
1396
|
};
|
|
1369
1397
|
|
|
1370
|
-
var css_248z$
|
|
1371
|
-
var styles$
|
|
1372
|
-
styleInject(css_248z$
|
|
1398
|
+
var css_248z$b = ".modal-module_animation__modal__3mt48{animation:modal-module_show-popup__WrH7a .15s;-webkit-animation:modal-module_show-popup__WrH7a .15s}@keyframes modal-module_show-popup__WrH7a{0%{transform:translate3d(0,-50%,0);-webkit-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);-o-transform:translate3d(0,-50%,0)}to{opacity:1;transform:translateZ(0);-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0)}}";
|
|
1399
|
+
var styles$9 = {"animation__modal":"modal-module_animation__modal__3mt48","show-popup":"modal-module_show-popup__WrH7a"};
|
|
1400
|
+
styleInject(css_248z$b);
|
|
1373
1401
|
|
|
1374
1402
|
const SvgNext = ({
|
|
1375
1403
|
title,
|
|
@@ -1609,7 +1637,7 @@ const Modal = ({
|
|
|
1609
1637
|
justifyContent: justifyContent ? justifyContent : configStyles.MODAL.justifyContent
|
|
1610
1638
|
}
|
|
1611
1639
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1612
|
-
className: `${styles$
|
|
1640
|
+
className: `${styles$9['animation__modal']}`,
|
|
1613
1641
|
onClick: handleStopClosing,
|
|
1614
1642
|
style: {
|
|
1615
1643
|
position: 'relative',
|
|
@@ -1813,9 +1841,9 @@ Modal.defaultProps = {
|
|
|
1813
1841
|
type: 'content'
|
|
1814
1842
|
};
|
|
1815
1843
|
|
|
1816
|
-
var css_248z$
|
|
1817
|
-
var styles$
|
|
1818
|
-
styleInject(css_248z$
|
|
1844
|
+
var css_248z$a = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{appearance:none!important;-webkit-appearance:none!important;display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}input::-ms-clear,input::-ms-reveal{display:none}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}.input-module_inp-num__vH7HL::-webkit-inner-spin-button,.input-module_inp-num__vH7HL::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-module_inp-num__vH7HL[type=number]{-moz-appearance:textfield}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
1845
|
+
var styles$8 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","error-message-show":"input-module_error-message-show__OrVSo","error-show":"input-module_error-show__9MP6k","inp-num":"input-module_inp-num__vH7HL"};
|
|
1846
|
+
styleInject(css_248z$a);
|
|
1819
1847
|
|
|
1820
1848
|
const InputTypes = {
|
|
1821
1849
|
TEL: 'tel',
|
|
@@ -1893,7 +1921,7 @@ const Input = ({
|
|
|
1893
1921
|
const [innerErrorMessage, setInnerErrorMessage] = React.useState('');
|
|
1894
1922
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
1895
1923
|
const configStyles = compereConfigs();
|
|
1896
|
-
const classProps = classnames__default["default"](className ? className : configStyles.INPUT.className, type === 'number' ? styles$
|
|
1924
|
+
const classProps = classnames__default["default"](className ? className : configStyles.INPUT.className, type === 'number' ? styles$8['inp-num'] : '', styles$8['input-wrap']);
|
|
1897
1925
|
const errorShow = styled.keyframes`
|
|
1898
1926
|
100% {
|
|
1899
1927
|
bottom: '-20px';
|
|
@@ -2193,7 +2221,7 @@ const Input = ({
|
|
|
2193
2221
|
fontFamily: labelFontFamily ? labelFontFamily : configStyles.INPUT.labelFontFamily
|
|
2194
2222
|
}
|
|
2195
2223
|
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", null, /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))) : '', /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2196
|
-
className: `${styles$
|
|
2224
|
+
className: `${styles$8['input-content']}`,
|
|
2197
2225
|
style: {
|
|
2198
2226
|
width: width ? width : configStyles.INPUT.width,
|
|
2199
2227
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
@@ -2353,57 +2381,222 @@ Input.defaultProps = {
|
|
|
2353
2381
|
type: 'text'
|
|
2354
2382
|
};
|
|
2355
2383
|
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2384
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
2385
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
2386
|
+
// generators (like Math.random()).
|
|
2387
|
+
let getRandomValues;
|
|
2388
|
+
const rnds8 = new Uint8Array(16);
|
|
2389
|
+
function rng() {
|
|
2390
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
2391
|
+
if (!getRandomValues) {
|
|
2392
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
2393
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
2394
|
+
|
|
2395
|
+
if (!getRandomValues) {
|
|
2396
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
return getRandomValues(rnds8);
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
2405
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
2406
|
+
*/
|
|
2407
|
+
|
|
2408
|
+
const byteToHex = [];
|
|
2409
|
+
|
|
2410
|
+
for (let i = 0; i < 256; ++i) {
|
|
2411
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
function unsafeStringify(arr, offset = 0) {
|
|
2415
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
2416
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
2417
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
2421
|
+
var native = {
|
|
2422
|
+
randomUUID
|
|
2423
|
+
};
|
|
2424
|
+
|
|
2425
|
+
function v4(options, buf, offset) {
|
|
2426
|
+
if (native.randomUUID && !buf && !options) {
|
|
2427
|
+
return native.randomUUID();
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
options = options || {};
|
|
2431
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
2432
|
+
|
|
2433
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
2434
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
2435
|
+
|
|
2436
|
+
if (buf) {
|
|
2437
|
+
offset = offset || 0;
|
|
2438
|
+
|
|
2439
|
+
for (let i = 0; i < 16; ++i) {
|
|
2440
|
+
buf[offset + i] = rnds[i];
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
return buf;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
return unsafeStringify(rnds);
|
|
2447
|
+
}
|
|
2359
2448
|
|
|
2449
|
+
const RadioDirectionMode = {
|
|
2450
|
+
VERTICAL: 'vertical',
|
|
2451
|
+
HORINZONTAL: 'horizontal'
|
|
2452
|
+
};
|
|
2360
2453
|
const Radio = ({
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2454
|
+
data,
|
|
2455
|
+
size,
|
|
2456
|
+
getData,
|
|
2457
|
+
selected,
|
|
2458
|
+
keyNames,
|
|
2459
|
+
diraction,
|
|
2364
2460
|
className,
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2461
|
+
borderSize,
|
|
2462
|
+
labelColor,
|
|
2463
|
+
borderColor,
|
|
2464
|
+
borderStyle,
|
|
2465
|
+
labelFontSize,
|
|
2466
|
+
labelFontFamily,
|
|
2467
|
+
labelFontWeight,
|
|
2468
|
+
labelLineHeight,
|
|
2469
|
+
radioMarginRight,
|
|
2470
|
+
borderActiveColor,
|
|
2471
|
+
radioItemMarginRight,
|
|
2472
|
+
radioItemMarginBottom
|
|
2370
2473
|
}) => {
|
|
2371
|
-
const
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2474
|
+
const configStyles = compereConfigs();
|
|
2475
|
+
const classProps = classnames__default["default"](className ? className : configStyles.RADIO.className);
|
|
2476
|
+
const [innerData, setInnerData] = React.useState([]);
|
|
2477
|
+
const [radioInnerSize, setRadioInnerSize] = React.useState('');
|
|
2478
|
+
const [radioInnerFormat, setRadioInnerFormat] = React.useState('');
|
|
2479
|
+
const [innerSelectedData, setInnerSelectedData] = React.useState({});
|
|
2480
|
+
const handleMouseEnter = (id, elemID) => {
|
|
2481
|
+
const elem = document.querySelector(`#${elemID}`);
|
|
2482
|
+
elem.style.backgroundColor = id === innerSelectedData?.id ? borderActiveColor ? borderActiveColor : configStyles.RADIO.borderActiveColor : borderColor ? borderColor : configStyles.RADIO.borderColor;
|
|
2483
|
+
};
|
|
2484
|
+
const handleMouseLeave = (id, elemID) => {
|
|
2485
|
+
const elem = document.querySelector(`#${elemID}`);
|
|
2486
|
+
elem.style.backgroundColor = id === innerSelectedData?.id ? borderActiveColor ? borderActiveColor : configStyles.RADIO.borderActiveColor : 'transparent';
|
|
2487
|
+
};
|
|
2488
|
+
const handleChecked = selItem => {
|
|
2489
|
+
setInnerSelectedData(selItem);
|
|
2490
|
+
getData && getData(selItem);
|
|
2491
|
+
};
|
|
2492
|
+
React.useEffect(() => {
|
|
2493
|
+
if (Array.isArray(data)) {
|
|
2494
|
+
setInnerData(data);
|
|
2495
|
+
} else {
|
|
2496
|
+
setInnerData([data]);
|
|
2497
|
+
}
|
|
2498
|
+
}, [data]);
|
|
2499
|
+
React.useEffect(() => {
|
|
2500
|
+
let radioSize = '';
|
|
2501
|
+
let radioSizeFormat = '';
|
|
2502
|
+
const checkSize = size || configStyles.RADIO.size;
|
|
2503
|
+
if (checkSize && typeof checkSize === 'string') {
|
|
2504
|
+
if (checkSize.length > 0) {
|
|
2505
|
+
checkSize.split('').map(item => {
|
|
2506
|
+
if (!isNaN(parseInt(item))) {
|
|
2507
|
+
radioSize += item;
|
|
2508
|
+
} else {
|
|
2509
|
+
radioSizeFormat += item;
|
|
2510
|
+
}
|
|
2511
|
+
});
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
if (radioSize < '10') {
|
|
2515
|
+
radioSize = '10';
|
|
2516
|
+
}
|
|
2517
|
+
setRadioInnerFormat(radioSizeFormat);
|
|
2518
|
+
setRadioInnerSize(`${parseInt(radioSize) / 2}`);
|
|
2519
|
+
}, [size, configStyles.RADIO.size]);
|
|
2520
|
+
React.useEffect(() => {
|
|
2521
|
+
setInnerSelectedData(selected);
|
|
2522
|
+
}, [selected]);
|
|
2523
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2524
|
+
className: classProps,
|
|
2525
|
+
style: {
|
|
2526
|
+
display: 'flex',
|
|
2527
|
+
flexDirection: diraction === 'horizontal' ? 'row' : 'column'
|
|
2528
|
+
}
|
|
2529
|
+
}, innerData && innerData.length > 0 && innerData.map((item, index) => {
|
|
2530
|
+
const elemId = `TUI_${index}_radio_inner` + v4();
|
|
2531
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2532
|
+
key: `TUI_${index}_radio`,
|
|
2533
|
+
style: {
|
|
2534
|
+
display: 'flex',
|
|
2535
|
+
cursor: item.disabled ? 'not-allowed' : 'pointer',
|
|
2536
|
+
width: 'fit-content',
|
|
2537
|
+
alignItems: 'center',
|
|
2538
|
+
marginRight: diraction === 'horizontal' ? radioItemMarginRight ? radioItemMarginRight : configStyles.RADIO.radioItemMarginRight : '0px',
|
|
2539
|
+
marginBottom: diraction === 'vertical' ? radioItemMarginBottom ? radioItemMarginBottom : configStyles.RADIO.radioItemMarginBottom : '0px'
|
|
2540
|
+
},
|
|
2541
|
+
onClick: item.disabled ? _ => _ : () => handleChecked(item),
|
|
2542
|
+
onMouseEnter: () => handleMouseEnter(item[keyNames.id], elemId),
|
|
2543
|
+
onMouseLeave: () => handleMouseLeave(item[keyNames.id], elemId)
|
|
2544
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2545
|
+
style: {
|
|
2546
|
+
display: 'flex',
|
|
2547
|
+
alignItems: 'center',
|
|
2548
|
+
borderRadius: '100%',
|
|
2549
|
+
justifyContent: 'center',
|
|
2550
|
+
width: size ? size : configStyles.RADIO.size,
|
|
2551
|
+
height: size ? size : configStyles.RADIO.size,
|
|
2552
|
+
marginRight: item.label ? radioMarginRight ? radioMarginRight : configStyles.RADIO.radioMarginRight : '0px',
|
|
2553
|
+
border: `${borderSize ? borderSize : configStyles.RADIO.borderSize} ${borderStyle ? borderStyle : configStyles.RADIO.borderStyle}`,
|
|
2554
|
+
borderColor: item[keyNames.id] === innerSelectedData?.id ? borderActiveColor ? borderActiveColor : configStyles.RADIO.borderActiveColor : borderColor ? borderColor : configStyles.RADIO.borderColor
|
|
2555
|
+
}
|
|
2556
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2557
|
+
id: elemId,
|
|
2558
|
+
style: {
|
|
2559
|
+
borderRadius: '100%',
|
|
2560
|
+
width: radioInnerSize + radioInnerFormat,
|
|
2561
|
+
height: radioInnerSize + radioInnerFormat,
|
|
2562
|
+
backgroundColor: item[keyNames.id] === innerSelectedData?.id ? borderActiveColor ? borderActiveColor : configStyles.RADIO.borderActiveColor : 'transparent'
|
|
2563
|
+
}
|
|
2564
|
+
})), item[keyNames.label] ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2565
|
+
style: {
|
|
2566
|
+
color: labelColor ? labelColor : configStyles.RADIO.labelColor,
|
|
2567
|
+
fontSize: labelFontSize ? labelFontSize : configStyles.RADIO.labelFontSize,
|
|
2568
|
+
fontFamily: labelFontFamily ? labelFontFamily : configStyles.RADIO.labelFontFamily,
|
|
2569
|
+
fontWeight: labelFontWeight ? labelFontWeight : configStyles.RADIO.labelFontWeight,
|
|
2570
|
+
lineHeight: labelLineHeight ? labelLineHeight : configStyles.RADIO.labelLineHeight
|
|
2571
|
+
},
|
|
2572
|
+
onMouseEnter: () => handleMouseEnter(item[keyNames.id], elemId),
|
|
2573
|
+
onMouseLeave: () => handleMouseLeave(item[keyNames.id], elemId)
|
|
2574
|
+
}, item[keyNames.label]) : '');
|
|
2390
2575
|
}));
|
|
2391
2576
|
};
|
|
2392
2577
|
Radio.propTypes = {
|
|
2578
|
+
size: PropTypes__default["default"].string,
|
|
2579
|
+
selected: PropTypes__default["default"].object,
|
|
2580
|
+
keyNames: PropTypes__default["default"].object,
|
|
2393
2581
|
className: PropTypes__default["default"].string,
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2582
|
+
borderSize: PropTypes__default["default"].string,
|
|
2583
|
+
labelColor: PropTypes__default["default"].string,
|
|
2584
|
+
borderColor: PropTypes__default["default"].string,
|
|
2585
|
+
borderStyle: PropTypes__default["default"].string,
|
|
2586
|
+
labelFontSize: PropTypes__default["default"].string,
|
|
2587
|
+
labelFontFamily: PropTypes__default["default"].string,
|
|
2588
|
+
labelFontWeight: PropTypes__default["default"].string,
|
|
2589
|
+
labelLineHeight: PropTypes__default["default"].string,
|
|
2590
|
+
radioMarginRight: PropTypes__default["default"].string,
|
|
2591
|
+
getData: PropTypes__default["default"].func.isRequired,
|
|
2592
|
+
borderActiveColor: PropTypes__default["default"].string,
|
|
2593
|
+
radioItemMarginRight: PropTypes__default["default"].string,
|
|
2594
|
+
radioItemMarginBottom: PropTypes__default["default"].string,
|
|
2595
|
+
diraction: PropTypes__default["default"].oneOf(Object.values(RadioDirectionMode)),
|
|
2596
|
+
data: PropTypes__default["default"].oneOfType([PropTypes__default["default"].arrayOf(PropTypes__default["default"].object), PropTypes__default["default"].object])
|
|
2403
2597
|
};
|
|
2404
2598
|
Radio.defaultProps = {
|
|
2405
|
-
|
|
2406
|
-
jsonData: '[{"value":"email", "name":"contact", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact", "label":"Phone", "id":"contactChoice2"}]'
|
|
2599
|
+
diraction: 'vertical'
|
|
2407
2600
|
};
|
|
2408
2601
|
|
|
2409
2602
|
const Button = ({
|
|
@@ -3438,8 +3631,8 @@ const Captcha = ({
|
|
|
3438
3631
|
className: classProps
|
|
3439
3632
|
}, label && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3440
3633
|
style: {
|
|
3441
|
-
fontSize: size ? size : configStyles.
|
|
3442
|
-
color: color ? color : configStyles.
|
|
3634
|
+
fontSize: size ? size : configStyles.CAPTCHA.size,
|
|
3635
|
+
color: color ? color : configStyles.CAPTCHA.color
|
|
3443
3636
|
}
|
|
3444
3637
|
}, label), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3445
3638
|
style: {
|
|
@@ -3555,71 +3748,6 @@ Stepper.propTypes = {
|
|
|
3555
3748
|
activeSteps: PropTypes__default["default"].number
|
|
3556
3749
|
};
|
|
3557
3750
|
|
|
3558
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
3559
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
3560
|
-
// generators (like Math.random()).
|
|
3561
|
-
let getRandomValues;
|
|
3562
|
-
const rnds8 = new Uint8Array(16);
|
|
3563
|
-
function rng() {
|
|
3564
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
3565
|
-
if (!getRandomValues) {
|
|
3566
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
3567
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
3568
|
-
|
|
3569
|
-
if (!getRandomValues) {
|
|
3570
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
3571
|
-
}
|
|
3572
|
-
}
|
|
3573
|
-
|
|
3574
|
-
return getRandomValues(rnds8);
|
|
3575
|
-
}
|
|
3576
|
-
|
|
3577
|
-
/**
|
|
3578
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
3579
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
3580
|
-
*/
|
|
3581
|
-
|
|
3582
|
-
const byteToHex = [];
|
|
3583
|
-
|
|
3584
|
-
for (let i = 0; i < 256; ++i) {
|
|
3585
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
3586
|
-
}
|
|
3587
|
-
|
|
3588
|
-
function unsafeStringify(arr, offset = 0) {
|
|
3589
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
3590
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
3591
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
3592
|
-
}
|
|
3593
|
-
|
|
3594
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
3595
|
-
var native = {
|
|
3596
|
-
randomUUID
|
|
3597
|
-
};
|
|
3598
|
-
|
|
3599
|
-
function v4(options, buf, offset) {
|
|
3600
|
-
if (native.randomUUID && !buf && !options) {
|
|
3601
|
-
return native.randomUUID();
|
|
3602
|
-
}
|
|
3603
|
-
|
|
3604
|
-
options = options || {};
|
|
3605
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
3606
|
-
|
|
3607
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
3608
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
3609
|
-
|
|
3610
|
-
if (buf) {
|
|
3611
|
-
offset = offset || 0;
|
|
3612
|
-
|
|
3613
|
-
for (let i = 0; i < 16; ++i) {
|
|
3614
|
-
buf[offset + i] = rnds[i];
|
|
3615
|
-
}
|
|
3616
|
-
|
|
3617
|
-
return buf;
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
|
-
return unsafeStringify(rnds);
|
|
3621
|
-
}
|
|
3622
|
-
|
|
3623
3751
|
const SvgHeic = ({
|
|
3624
3752
|
title,
|
|
3625
3753
|
titleId,
|
|
@@ -4038,6 +4166,7 @@ const NewFile = ({
|
|
|
4038
4166
|
change,
|
|
4039
4167
|
border,
|
|
4040
4168
|
upload,
|
|
4169
|
+
preview,
|
|
4041
4170
|
maxSize,
|
|
4042
4171
|
maxWidth,
|
|
4043
4172
|
disabled,
|
|
@@ -4061,6 +4190,12 @@ const NewFile = ({
|
|
|
4061
4190
|
maxSizeError,
|
|
4062
4191
|
progressColor,
|
|
4063
4192
|
noChoosenFile,
|
|
4193
|
+
uploadBtnFont,
|
|
4194
|
+
uploadBtnSize,
|
|
4195
|
+
uploadBtnLabel,
|
|
4196
|
+
uploadBtnColor,
|
|
4197
|
+
uploadBtnHeight,
|
|
4198
|
+
uploadBtnBackgroundColor,
|
|
4064
4199
|
fileExtensions,
|
|
4065
4200
|
listItemHeight,
|
|
4066
4201
|
backgroundColor,
|
|
@@ -4106,6 +4241,7 @@ const NewFile = ({
|
|
|
4106
4241
|
};
|
|
4107
4242
|
const handleRemoveFile = () => {
|
|
4108
4243
|
setImage(null);
|
|
4244
|
+
setSingleFile(null);
|
|
4109
4245
|
removeFile && removeFile(singleFile);
|
|
4110
4246
|
};
|
|
4111
4247
|
const handleUploadFiles = file => {
|
|
@@ -4359,7 +4495,7 @@ const NewFile = ({
|
|
|
4359
4495
|
fontSize: size ? size : configStyles.FILE.size,
|
|
4360
4496
|
fontWeight: weight ? weight : configStyles.FILE.weight
|
|
4361
4497
|
}
|
|
4362
|
-
}, !multiple && image ? image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : image === 'heif' || image === 'heic' ? /*#__PURE__*/React__default["default"].createElement(SvgHeic, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
4498
|
+
}, !multiple && image && preview ? image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : image === 'heif' || image === 'heic' ? /*#__PURE__*/React__default["default"].createElement(SvgHeic, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
4363
4499
|
src: image,
|
|
4364
4500
|
style: {
|
|
4365
4501
|
display: 'block',
|
|
@@ -4370,7 +4506,7 @@ const NewFile = ({
|
|
|
4370
4506
|
height: fileAreaImageHeight ? fileAreaImageHeight : configStyles.FILE.fileAreaImageHeight
|
|
4371
4507
|
},
|
|
4372
4508
|
alt: "file preview"
|
|
4373
|
-
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(SvgUpload, null)), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4509
|
+
}) : preview ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(SvgUpload, null)), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4374
4510
|
style: {
|
|
4375
4511
|
margin: '0px'
|
|
4376
4512
|
}
|
|
@@ -4386,7 +4522,35 @@ const NewFile = ({
|
|
|
4386
4522
|
style: {
|
|
4387
4523
|
margin: '0px'
|
|
4388
4524
|
}
|
|
4389
|
-
}, fileSizeText ? fileSizeText : configStyles.FILE.fileSizeText, " ", maxSize, "\u0544\u0532 (", ' ', fileExtensions.toString().split(',').join(', '), " )")))
|
|
4525
|
+
}, fileSizeText ? fileSizeText : configStyles.FILE.fileSizeText, " ", maxSize, " \u0544\u0532 (", ' ', fileExtensions.toString().split(',').join(', '), " )"))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4526
|
+
style: {
|
|
4527
|
+
width: '100%',
|
|
4528
|
+
padding: '5px',
|
|
4529
|
+
display: 'flex',
|
|
4530
|
+
alignItems: 'center',
|
|
4531
|
+
boxSizing: 'border-box',
|
|
4532
|
+
justifyContent: 'space-between'
|
|
4533
|
+
}
|
|
4534
|
+
}, /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
4535
|
+
contentWidth: true,
|
|
4536
|
+
onClick: _ => _,
|
|
4537
|
+
font: uploadBtnFont ? uploadBtnFont : configStyles.FILE.uploadBtnFont,
|
|
4538
|
+
size: uploadBtnSize ? uploadBtnSize : configStyles.FILE.uploadBtnSize,
|
|
4539
|
+
label: uploadBtnLabel ? uploadBtnLabel : configStyles.FILE.uploadBtnLabel,
|
|
4540
|
+
color: uploadBtnColor ? uploadBtnColor : configStyles.FILE.uploadBtnColor,
|
|
4541
|
+
height: uploadBtnHeight ? uploadBtnHeight : configStyles.FILE.uploadBtnHeight,
|
|
4542
|
+
hoverColor: uploadBtnColor ? uploadBtnColor : configStyles.FILE.uploadBtnColor,
|
|
4543
|
+
backgroundColor: uploadBtnBackgroundColor ? uploadBtnBackgroundColor : configStyles.FILE.uploadBtnBackgroundColor,
|
|
4544
|
+
backgroundHoverColor: uploadBtnBackgroundColor ? uploadBtnBackgroundColor : configStyles.FILE.uploadBtnBackgroundColor
|
|
4545
|
+
}), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4546
|
+
style: {
|
|
4547
|
+
margin: '0px',
|
|
4548
|
+
marginLeft: '5px',
|
|
4549
|
+
overflow: 'hidden',
|
|
4550
|
+
whiteSpace: 'nowrap',
|
|
4551
|
+
textOverflow: 'ellipsis'
|
|
4552
|
+
}
|
|
4553
|
+
}, singleFile ? singleFile[0].name : /*#__PURE__*/React__default["default"].createElement("span", null, fileSizeText ? fileSizeText : configStyles.FILE.fileSizeText, " ", maxSize, " \u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4390
4554
|
style: {
|
|
4391
4555
|
position: 'absolute',
|
|
4392
4556
|
top: '0px',
|
|
@@ -4446,6 +4610,7 @@ const NewFile = ({
|
|
|
4446
4610
|
NewFile.propTypes = {
|
|
4447
4611
|
or: PropTypes__default["default"].string,
|
|
4448
4612
|
size: PropTypes__default["default"].string,
|
|
4613
|
+
preview: PropTypes__default["default"].bool,
|
|
4449
4614
|
label: PropTypes__default["default"].string,
|
|
4450
4615
|
color: PropTypes__default["default"].string,
|
|
4451
4616
|
height: PropTypes__default["default"].string,
|
|
@@ -4456,6 +4621,7 @@ NewFile.propTypes = {
|
|
|
4456
4621
|
upload: PropTypes__default["default"].string,
|
|
4457
4622
|
weight: PropTypes__default["default"].number,
|
|
4458
4623
|
maxSize: PropTypes__default["default"].number,
|
|
4624
|
+
maxWidth: PropTypes__default["default"].string,
|
|
4459
4625
|
removeFile: PropTypes__default["default"].func,
|
|
4460
4626
|
className: PropTypes__default["default"].string,
|
|
4461
4627
|
errorSize: PropTypes__default["default"].string,
|
|
@@ -4475,6 +4641,12 @@ NewFile.propTypes = {
|
|
|
4475
4641
|
progressColor: PropTypes__default["default"].string,
|
|
4476
4642
|
deleteComponent: PropTypes__default["default"].bool,
|
|
4477
4643
|
removeComponent: PropTypes__default["default"].func,
|
|
4644
|
+
uploadBtnFont: PropTypes__default["default"].string,
|
|
4645
|
+
uploadBtnSize: PropTypes__default["default"].string,
|
|
4646
|
+
uploadBtnLabel: PropTypes__default["default"].string,
|
|
4647
|
+
uploadBtnColor: PropTypes__default["default"].string,
|
|
4648
|
+
uploadBtnHeight: PropTypes__default["default"].string,
|
|
4649
|
+
uploadBtnBackgroundColor: PropTypes__default["default"].string,
|
|
4478
4650
|
listItemHeight: PropTypes__default["default"].string,
|
|
4479
4651
|
backgroundColor: PropTypes__default["default"].string,
|
|
4480
4652
|
change: PropTypes__default["default"].func.isRequired,
|
|
@@ -4502,6 +4674,7 @@ NewFile.propTypes = {
|
|
|
4502
4674
|
};
|
|
4503
4675
|
NewFile.defaultProps = {
|
|
4504
4676
|
maxSize: 10,
|
|
4677
|
+
preview: true,
|
|
4505
4678
|
timeForRemoveError: 5000,
|
|
4506
4679
|
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
4507
4680
|
};
|
|
@@ -4599,6 +4772,10 @@ Checkbox.defaultProps = {
|
|
|
4599
4772
|
var css_248z$4 = "textarea{-webkit-appearance:none}textarea::-webkit-scrollbar{width:6px}textarea::-webkit-scrollbar-track{background:#eee}textarea::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-track{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px}textarea::-webkit-scrollbar-thumb{background:#d1d1d1}";
|
|
4600
4773
|
styleInject(css_248z$4);
|
|
4601
4774
|
|
|
4775
|
+
const PositionSide = {
|
|
4776
|
+
TOP: 'top',
|
|
4777
|
+
BOTTOM: 'bottom'
|
|
4778
|
+
};
|
|
4602
4779
|
const Textarea = ({
|
|
4603
4780
|
size,
|
|
4604
4781
|
label,
|
|
@@ -4633,7 +4810,8 @@ const Textarea = ({
|
|
|
4633
4810
|
borderFocusColor,
|
|
4634
4811
|
borderHoverColor,
|
|
4635
4812
|
labelMarginBottom,
|
|
4636
|
-
showCharacterCount
|
|
4813
|
+
showCharacterCount,
|
|
4814
|
+
characterCountPosition
|
|
4637
4815
|
}) => {
|
|
4638
4816
|
const [error, setError] = React.useState('');
|
|
4639
4817
|
const [isHover, setIsHover] = React.useState(false);
|
|
@@ -4673,18 +4851,16 @@ const Textarea = ({
|
|
|
4673
4851
|
if (!onChange) {
|
|
4674
4852
|
alert('Please add onChange function on Textarea component');
|
|
4675
4853
|
}
|
|
4676
|
-
if (value === '') {
|
|
4677
|
-
setError('');
|
|
4678
|
-
}
|
|
4679
|
-
setInnerValue(value);
|
|
4680
|
-
}, [value, onChange]);
|
|
4681
|
-
React.useEffect(() => {
|
|
4682
4854
|
if (errorMessage) {
|
|
4683
4855
|
setError(errorMessage);
|
|
4684
4856
|
} else {
|
|
4685
4857
|
setError('');
|
|
4686
4858
|
}
|
|
4687
|
-
|
|
4859
|
+
if (value === '') {
|
|
4860
|
+
setError('');
|
|
4861
|
+
}
|
|
4862
|
+
setInnerValue(value);
|
|
4863
|
+
}, [value, onChange, errorMessage]);
|
|
4688
4864
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4689
4865
|
style: {
|
|
4690
4866
|
width: width ? width : configStyles.TEXTAREA.width
|
|
@@ -4705,7 +4881,7 @@ const Textarea = ({
|
|
|
4705
4881
|
display: labelDisplay ? labelDisplay : configStyles.TEXTAREA.labelDisplay,
|
|
4706
4882
|
fontWeight: labelWeight ? labelWeight : configStyles.TEXTAREA.labelWeight
|
|
4707
4883
|
}
|
|
4708
|
-
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", null, /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))) : '', showCharacterCount && maxLength && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4884
|
+
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", null, /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))) : '', showCharacterCount && maxLength && characterCountPosition === 'top' && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4709
4885
|
style: {
|
|
4710
4886
|
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
4711
4887
|
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize
|
|
@@ -4738,14 +4914,29 @@ const Textarea = ({
|
|
|
4738
4914
|
placeholder: placeholder,
|
|
4739
4915
|
onMouseEnter: handleMouseEnter,
|
|
4740
4916
|
onMouseLeave: handleMouseLeave
|
|
4741
|
-
}),
|
|
4917
|
+
}), showCharacterCount && maxLength && characterCountPosition === 'bottom' && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4918
|
+
style: {
|
|
4919
|
+
float: 'right'
|
|
4920
|
+
}
|
|
4921
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4922
|
+
style: {
|
|
4923
|
+
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
4924
|
+
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize
|
|
4925
|
+
}
|
|
4926
|
+
}, maxLength - value.length, " \u0576\u056B\u0577")), error ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4927
|
+
style: {
|
|
4928
|
+
clear: 'both',
|
|
4929
|
+
wordBreak: 'break-all',
|
|
4930
|
+
maxWidth: width ? width : configStyles.TEXTAREA.width
|
|
4931
|
+
}
|
|
4932
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4742
4933
|
style: {
|
|
4743
4934
|
display: 'inline-block',
|
|
4744
4935
|
fontSize: errorSize ? errorSize : configStyles.TEXTAREA.errorSize,
|
|
4745
4936
|
color: errorColor ? errorColor : configStyles.TEXTAREA.errorColor,
|
|
4746
4937
|
marginTop: marginTop ? marginTop : configStyles.TEXTAREA.marginTop
|
|
4747
4938
|
}
|
|
4748
|
-
}, error) : '');
|
|
4939
|
+
}, error)) : '');
|
|
4749
4940
|
};
|
|
4750
4941
|
Textarea.propTypes = {
|
|
4751
4942
|
size: PropTypes__default["default"].string,
|
|
@@ -4781,7 +4972,11 @@ Textarea.propTypes = {
|
|
|
4781
4972
|
borderFocusColor: PropTypes__default["default"].string,
|
|
4782
4973
|
borderHoverColor: PropTypes__default["default"].string,
|
|
4783
4974
|
labelMarginBottom: PropTypes__default["default"].string,
|
|
4784
|
-
onChange: PropTypes__default["default"].func.isRequired
|
|
4975
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
|
4976
|
+
characterCountPosition: PropTypes__default["default"].oneOf(Object.values(PositionSide))
|
|
4977
|
+
};
|
|
4978
|
+
Textarea.defaultProps = {
|
|
4979
|
+
characterCountPosition: 'top'
|
|
4785
4980
|
};
|
|
4786
4981
|
|
|
4787
4982
|
var css_248z$3 = "";
|
|
@@ -5649,7 +5844,9 @@ exports.Modal = Modal;
|
|
|
5649
5844
|
exports.NewAutocomplete = NewAutocomplete;
|
|
5650
5845
|
exports.NewFile = NewFile;
|
|
5651
5846
|
exports.Pagination = Pagination;
|
|
5847
|
+
exports.PositionSide = PositionSide;
|
|
5652
5848
|
exports.Radio = Radio;
|
|
5849
|
+
exports.RadioDirectionMode = RadioDirectionMode;
|
|
5653
5850
|
exports.Select = Select;
|
|
5654
5851
|
exports.Stepper = Stepper;
|
|
5655
5852
|
exports.Table = Table;
|