@xaypay/tui 0.2.19 → 0.2.21
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 +450 -153
- package/dist/index.js +450 -153
- package/package.json +1 -1
- package/tui.config.js +12 -1
package/dist/index.es.js
CHANGED
|
@@ -564,6 +564,7 @@ var packageResult = {
|
|
|
564
564
|
shadowHover: `0 0 0 2px ${presetColors.dark}` // like border
|
|
565
565
|
},
|
|
566
566
|
colors: {
|
|
567
|
+
placeholder: 'gray',
|
|
567
568
|
background: 'white',
|
|
568
569
|
backgroundDisable: presetColors.secondary
|
|
569
570
|
},
|
|
@@ -1017,6 +1018,15 @@ var packageResult = {
|
|
|
1017
1018
|
color: '#4A4A4D',
|
|
1018
1019
|
font: {
|
|
1019
1020
|
...fontObject
|
|
1021
|
+
},
|
|
1022
|
+
tooltip: {
|
|
1023
|
+
color: '#fff',
|
|
1024
|
+
padding: '12px',
|
|
1025
|
+
borderRadius: '8px',
|
|
1026
|
+
font: {
|
|
1027
|
+
...fontObject
|
|
1028
|
+
},
|
|
1029
|
+
backgroundColor: '#000'
|
|
1020
1030
|
}
|
|
1021
1031
|
},
|
|
1022
1032
|
font: {
|
|
@@ -1194,6 +1204,8 @@ var packageResult = {
|
|
|
1194
1204
|
TABLE: {
|
|
1195
1205
|
className: '',
|
|
1196
1206
|
textAlign: 'center',
|
|
1207
|
+
border: '1px solid',
|
|
1208
|
+
borderColor: 'transparent',
|
|
1197
1209
|
column: {
|
|
1198
1210
|
maxWidth: '',
|
|
1199
1211
|
minWidth: ''
|
|
@@ -1398,7 +1410,7 @@ async function getPProps() {
|
|
|
1398
1410
|
const projectPath = `../../../../tui.config.js`;
|
|
1399
1411
|
async function loadComponent(componentName) {
|
|
1400
1412
|
try {
|
|
1401
|
-
const Component = await import(
|
|
1413
|
+
const Component = await import(/* @vite-ignore */componentName);
|
|
1402
1414
|
return Component.default;
|
|
1403
1415
|
} catch (err) {
|
|
1404
1416
|
console.error(`Error loading component: ${componentName}`);
|
|
@@ -1680,6 +1692,37 @@ const SvgDeleteComponent = ({
|
|
|
1680
1692
|
fill: fillColor ? fillColor : '#E00'
|
|
1681
1693
|
}));
|
|
1682
1694
|
|
|
1695
|
+
function styleInject(css, ref) {
|
|
1696
|
+
if ( ref === void 0 ) ref = {};
|
|
1697
|
+
var insertAt = ref.insertAt;
|
|
1698
|
+
|
|
1699
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
1700
|
+
|
|
1701
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1702
|
+
var style = document.createElement('style');
|
|
1703
|
+
style.type = 'text/css';
|
|
1704
|
+
|
|
1705
|
+
if (insertAt === 'top') {
|
|
1706
|
+
if (head.firstChild) {
|
|
1707
|
+
head.insertBefore(style, head.firstChild);
|
|
1708
|
+
} else {
|
|
1709
|
+
head.appendChild(style);
|
|
1710
|
+
}
|
|
1711
|
+
} else {
|
|
1712
|
+
head.appendChild(style);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
if (style.styleSheet) {
|
|
1716
|
+
style.styleSheet.cssText = css;
|
|
1717
|
+
} else {
|
|
1718
|
+
style.appendChild(document.createTextNode(css));
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
var css_248z$d = ".file-module_small-file-component__nlpcW>svg{max-height:77%!important}.file-module_file-label__uscgT{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-module_tooltip__FjCUU{background-color:#333;border-radius:4px;color:#fff;font-size:14px;pointer-events:none;position:fixed;visibility:hidden;white-space:nowrap;z-index:1000}";
|
|
1723
|
+
var styles$b = {"small-file-component":"file-module_small-file-component__nlpcW","file-label":"file-module_file-label__uscgT","tooltip":"file-module_tooltip__FjCUU"};
|
|
1724
|
+
styleInject(css_248z$d);
|
|
1725
|
+
|
|
1683
1726
|
// eslint-disable-next-line react/display-name
|
|
1684
1727
|
const File = /*#__PURE__*/forwardRef(({
|
|
1685
1728
|
or,
|
|
@@ -1710,6 +1753,14 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1710
1753
|
labelStyle,
|
|
1711
1754
|
labelWeight,
|
|
1712
1755
|
labelFamily,
|
|
1756
|
+
labelTooltipColor,
|
|
1757
|
+
labelTooltipPadding,
|
|
1758
|
+
labelTooltipFontSize,
|
|
1759
|
+
labelTooltipFontStyle,
|
|
1760
|
+
labelTooltipFontFamily,
|
|
1761
|
+
labelTooltipFontWeight,
|
|
1762
|
+
labelTooltipBorderRadius,
|
|
1763
|
+
labelTooltipBackgroundColor,
|
|
1713
1764
|
removeFile,
|
|
1714
1765
|
labelColor,
|
|
1715
1766
|
errorColor,
|
|
@@ -1719,6 +1770,8 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1719
1770
|
uploadColor,
|
|
1720
1771
|
defaultData,
|
|
1721
1772
|
formatError,
|
|
1773
|
+
errorIcon,
|
|
1774
|
+
errorIconShow,
|
|
1722
1775
|
errorMessage,
|
|
1723
1776
|
fileSizeText,
|
|
1724
1777
|
maxSizeError,
|
|
@@ -1775,18 +1828,22 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1775
1828
|
listItemBackgroundColor,
|
|
1776
1829
|
listItemBackgroundErrorColor,
|
|
1777
1830
|
maxCHoosenLengthErrorHideTime,
|
|
1831
|
+
textAlignLeftInSmallComponent,
|
|
1832
|
+
showPreviewIconInSmallComponent,
|
|
1778
1833
|
maxSize = 10,
|
|
1779
1834
|
preview = true,
|
|
1780
1835
|
timeForRemoveError = 5000,
|
|
1781
1836
|
fileExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
1782
1837
|
}, ref) => {
|
|
1783
1838
|
const inpRef = useRef(null);
|
|
1839
|
+
const labelRef = useRef(null);
|
|
1784
1840
|
const memoizedItems = useMemo(() => filesArray, [filesArray]);
|
|
1785
1841
|
const [error, setError] = useState('');
|
|
1786
1842
|
const [isHover, setIsHover] = useState(false);
|
|
1787
1843
|
const [classProps, setClassProps] = useState({});
|
|
1788
1844
|
const [singleFile, setSingleFile] = useState(null);
|
|
1789
1845
|
const [configStyles, setConfigStyles] = useState({});
|
|
1846
|
+
const [tooltipElem, setTooltipElem] = useState(null);
|
|
1790
1847
|
const [choosenFileCount, setChoosenFileCount] = useState(0);
|
|
1791
1848
|
const [image, setImage] = useState(!multiple ? defaultData ? defaultData.type !== 'application/pdf' ? defaultData.url.startsWith('data:image/heif') || defaultData.url.startsWith('data:image/heic') || defaultData.url.startsWith('data:application/octet-stream') ? 'heic' : defaultData.url : 'pdf' : null : null);
|
|
1792
1849
|
const handleCheckHeicFormat = async file => {
|
|
@@ -2051,6 +2108,71 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2051
2108
|
const handleStopPropagation = e => {
|
|
2052
2109
|
e.stopPropagation();
|
|
2053
2110
|
};
|
|
2111
|
+
const getRenderedTextWidth = element => {
|
|
2112
|
+
const clone = element.cloneNode(true);
|
|
2113
|
+
clone.style.width = 'fit-content';
|
|
2114
|
+
document.body.appendChild(clone);
|
|
2115
|
+
const width = clone.offsetWidth;
|
|
2116
|
+
document.body.removeChild(clone);
|
|
2117
|
+
return width;
|
|
2118
|
+
};
|
|
2119
|
+
const handleLabelMouseEnter = event => {
|
|
2120
|
+
if (labelRef.current) {
|
|
2121
|
+
const rect = labelRef.current.getBoundingClientRect();
|
|
2122
|
+
const top = rect.top;
|
|
2123
|
+
const left = rect.left;
|
|
2124
|
+
const height = rect.height;
|
|
2125
|
+
const elementWidth = rect.width;
|
|
2126
|
+
const x = event.clientX - rect.left;
|
|
2127
|
+
const textWidth = getRenderedTextWidth(labelRef.current);
|
|
2128
|
+
console.log(textWidth, ' - - - - textWidth');
|
|
2129
|
+
console.log(elementWidth, ' - - - - elementWidth');
|
|
2130
|
+
if (textWidth > elementWidth) {
|
|
2131
|
+
const newTooltipElem = document.createElement('div');
|
|
2132
|
+
const newTootltipTextElem = document.createElement('p');
|
|
2133
|
+
const newTooltipChildElem = document.createElement('div');
|
|
2134
|
+
const newTooltipDecorElem = document.createElement('div');
|
|
2135
|
+
newTooltipElem.style.position = 'fixed';
|
|
2136
|
+
newTooltipElem.style.left = left + 'px';
|
|
2137
|
+
newTooltipElem.style.paddingTop = '20px';
|
|
2138
|
+
newTooltipElem.style.height = 'fit-content';
|
|
2139
|
+
newTooltipElem.style.boxSizing = 'border-box';
|
|
2140
|
+
newTooltipElem.style.top = top + height + 'px';
|
|
2141
|
+
newTooltipElem.style.width = elementWidth + 'px';
|
|
2142
|
+
newTooltipChildElem.style.width = '100%';
|
|
2143
|
+
newTooltipChildElem.style.position = 'relative';
|
|
2144
|
+
newTooltipChildElem.style.height = 'fit-content';
|
|
2145
|
+
newTooltipChildElem.style.boxSizing = 'border-box';
|
|
2146
|
+
newTooltipChildElem.style.padding = labelTooltipPadding ?? configStyles.FILE.label.tooltip.padding;
|
|
2147
|
+
newTooltipChildElem.style.borderRadius = labelTooltipBorderRadius ?? configStyles.FILE.label.tooltip.borderRadius;
|
|
2148
|
+
newTooltipChildElem.style.backgroundColor = labelTooltipBackgroundColor ?? configStyles.FILE.label.tooltip.backgroundColor;
|
|
2149
|
+
newTooltipDecorElem.style.zIndex = -1;
|
|
2150
|
+
newTooltipDecorElem.style.top = '-8px';
|
|
2151
|
+
newTooltipDecorElem.style.width = '18px';
|
|
2152
|
+
newTooltipDecorElem.style.height = '18px';
|
|
2153
|
+
newTooltipDecorElem.style.rotate = '45deg';
|
|
2154
|
+
newTooltipDecorElem.style.position = 'absolute';
|
|
2155
|
+
newTooltipDecorElem.style.left = x > elementWidth / 2 ? 'calc(100% - 30px)' : '13px';
|
|
2156
|
+
newTooltipDecorElem.style.backgroundColor = labelTooltipBackgroundColor ?? configStyles.FILE.label.tooltip.backgroundColor;
|
|
2157
|
+
newTootltipTextElem.innerText = label;
|
|
2158
|
+
newTootltipTextElem.style.color = labelTooltipColor ?? configStyles.FILE.label.tooltip.color;
|
|
2159
|
+
newTootltipTextElem.style.fontSize = labelTooltipFontSize ?? configStyles.FILE.label.tooltip.font.size;
|
|
2160
|
+
newTootltipTextElem.style.fontStyle = labelTooltipFontStyle ?? configStyles.FILE.label.tooltip.font.style;
|
|
2161
|
+
newTootltipTextElem.style.fontFamily = labelTooltipFontFamily ?? configStyles.FILE.label.tooltip.font.family;
|
|
2162
|
+
newTootltipTextElem.style.fontWeight = labelTooltipFontWeight ?? configStyles.FILE.label.tooltip.font.weight;
|
|
2163
|
+
document.body.appendChild(newTooltipElem);
|
|
2164
|
+
newTooltipElem.appendChild(newTooltipChildElem);
|
|
2165
|
+
newTooltipChildElem.appendChild(newTooltipDecorElem);
|
|
2166
|
+
newTooltipChildElem.appendChild(newTootltipTextElem);
|
|
2167
|
+
setTooltipElem(() => newTooltipElem);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
};
|
|
2171
|
+
const handleLabelMouseLeave = () => {
|
|
2172
|
+
if (tooltipElem) {
|
|
2173
|
+
document.body.removeChild(tooltipElem);
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2054
2176
|
useImperativeHandle(ref, () => ({
|
|
2055
2177
|
handleReset() {
|
|
2056
2178
|
setError('');
|
|
@@ -2117,6 +2239,11 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2117
2239
|
}, error => {
|
|
2118
2240
|
console.error(error);
|
|
2119
2241
|
});
|
|
2242
|
+
return () => {
|
|
2243
|
+
if (tooltipElem) {
|
|
2244
|
+
document.body.removeChild(tooltipElem);
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2120
2247
|
}, []);
|
|
2121
2248
|
return configStyles.FILE && /*#__PURE__*/React__default.createElement("div", {
|
|
2122
2249
|
style: {
|
|
@@ -2131,15 +2258,28 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2131
2258
|
alignItems: 'center',
|
|
2132
2259
|
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2133
2260
|
}
|
|
2134
|
-
}, label && /*#__PURE__*/React__default.createElement("
|
|
2261
|
+
}, label && /*#__PURE__*/React__default.createElement("div", {
|
|
2135
2262
|
style: {
|
|
2263
|
+
display: 'flex',
|
|
2264
|
+
maxWidth: '100%',
|
|
2265
|
+
width: 'fit-content',
|
|
2266
|
+
columnGap: '4px',
|
|
2267
|
+
justifyContent: 'flex-start'
|
|
2268
|
+
}
|
|
2269
|
+
}, /*#__PURE__*/React__default.createElement("label", {
|
|
2270
|
+
ref: labelRef,
|
|
2271
|
+
className: styles$b['file-label'],
|
|
2272
|
+
style: {
|
|
2273
|
+
width: '100%',
|
|
2136
2274
|
color: labelColor ?? configStyles.FILE.label.color,
|
|
2137
2275
|
fontSize: labelSize ?? configStyles.FILE.label.font.size,
|
|
2138
2276
|
fontStyle: labelStyle ?? configStyles.FILE.label.font.style,
|
|
2139
2277
|
fontWeight: labelWeight ?? configStyles.FILE.label.font.weight,
|
|
2140
2278
|
fontFamily: labelFamily ?? configStyles.FILE.label.font.family
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2279
|
+
},
|
|
2280
|
+
onMouseEnter: handleLabelMouseEnter,
|
|
2281
|
+
onMouseLeave: handleLabelMouseLeave
|
|
2282
|
+
}, label), required && /*#__PURE__*/React__default.createElement("sup", null, iconRequired ? iconRequired : configStyles.FILE.icon.required ? configStyles.FILE.icon.required : /*#__PURE__*/React__default.createElement(SvgRequired, null))), deleteComponent && /*#__PURE__*/React__default.createElement("span", {
|
|
2143
2283
|
style: {
|
|
2144
2284
|
cursor: 'pointer'
|
|
2145
2285
|
},
|
|
@@ -2217,15 +2357,29 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2217
2357
|
padding: '0px 10px'
|
|
2218
2358
|
}
|
|
2219
2359
|
}, fileSizeText ?? configStyles.FILE.sizeText, " ", maxSize, " \u0544\u0532 (", ' ', fileExtensions.toString().split(',').join(', '), " )"))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
2360
|
+
className: styles$b['small-file-component'],
|
|
2220
2361
|
style: {
|
|
2221
2362
|
width: '100%',
|
|
2222
2363
|
padding: '5px',
|
|
2223
2364
|
display: 'flex',
|
|
2224
2365
|
alignItems: 'center',
|
|
2225
2366
|
boxSizing: 'border-box',
|
|
2226
|
-
justifyContent: 'space-between'
|
|
2367
|
+
justifyContent: textAlignLeftInSmallComponent ? 'flex-start' : 'space-between'
|
|
2227
2368
|
}
|
|
2228
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
2369
|
+
}, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default.createElement(Button, {
|
|
2370
|
+
contentWidth: true,
|
|
2371
|
+
onClick: _ => _,
|
|
2372
|
+
font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
|
|
2373
|
+
size: uploadBtnSize ?? configStyles.FILE.uploadBtn.font.size,
|
|
2374
|
+
style: uploadBtnStyle ?? configStyles.FILE.uploadBtn.font.style,
|
|
2375
|
+
weight: uploadBtnWeight ?? configStyles.FILE.uploadBtn.font.weight,
|
|
2376
|
+
label: uploadBtnLabel ?? configStyles.FILE.uploadBtn.label,
|
|
2377
|
+
color: uploadBtnColor ?? configStyles.FILE.uploadBtn.color,
|
|
2378
|
+
height: uploadBtnHeight ?? configStyles.FILE.uploadBtn.height,
|
|
2379
|
+
hoverColor: uploadBtnHoverColor ?? configStyles.FILE.uploadBtn.colors.hover,
|
|
2380
|
+
backgroundColor: uploadBtnBackgroundColor ?? configStyles.FILE.uploadBtn.colors.background,
|
|
2381
|
+
backgroundHoverColor: uploadBtnBackgroundColorHover ?? configStyles.FILE.uploadBtn.colors.backgroundHover
|
|
2382
|
+
}) : image === 'pdf' ? iconPdf ? iconPdf : configStyles.FILE.icon.pdf ? configStyles.FILE.icon.pdf : /*#__PURE__*/React__default.createElement(SvgPdf, null) : image === 'heif' || image === 'heic' ? iconHeic ? iconHeic : configStyles.FILE.icon.heic ? configStyles.FILE.icon.heic : /*#__PURE__*/React__default.createElement(SvgHeic, null) : image === 'doc' ? iconDoc ? iconDoc : configStyles.FILE.icon.doc ? configStyles.FILE.icon.doc : /*#__PURE__*/React__default.createElement(SvgDocIcon, null) : image === 'docx' ? iconDocx ? iconDocx : configStyles.FILE.icon.docx ? configStyles.FILE.icon.docx : /*#__PURE__*/React__default.createElement(SvgDocIcon, null) : singleFile[0].type === 'image/jpeg' ? iconJpeg ? iconJpeg : configStyles.FILE.icon.jpeg ? configStyles.FILE.icon.jpeg : /*#__PURE__*/React__default.createElement(SvgListItemJpeg, null) : singleFile[0].type === 'image/png' ? iconPng ? iconPng : configStyles.FILE.icon.png ? configStyles.FILE.icon.png : /*#__PURE__*/React__default.createElement(SvgListItemPng, null) : singleFile[0].type === 'image/jpg' ? iconJpeg ? iconJpg : configStyles.FILE.icon.jpg ? configStyles.FILE.icon.jpg : /*#__PURE__*/React__default.createElement(SvgListItemJpg, null) : '' : /*#__PURE__*/React__default.createElement(Button, {
|
|
2229
2383
|
contentWidth: true,
|
|
2230
2384
|
onClick: _ => _,
|
|
2231
2385
|
font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
|
|
@@ -2272,14 +2426,16 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2272
2426
|
}, iconRemoveFile ? iconRemoveFile : configStyles.FILE.icon.removeFile ? configStyles.FILE.icon.removeFile : /*#__PURE__*/React__default.createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default.createElement("span", {
|
|
2273
2427
|
style: {
|
|
2274
2428
|
marginTop: '6px',
|
|
2275
|
-
display: 'inline-block',
|
|
2276
2429
|
color: errorColor ?? configStyles.FILE.error.color,
|
|
2277
2430
|
fontSize: errorSize ?? configStyles.FILE.error.font.size,
|
|
2278
2431
|
fontStyle: errorStyle ?? configStyles.FILE.error.font.style,
|
|
2279
2432
|
fontWeight: errorWeight ?? configStyles.FILE.error.font.weight,
|
|
2280
|
-
fontFamily: errorFamily ?? configStyles.FILE.error.font.family
|
|
2433
|
+
fontFamily: errorFamily ?? configStyles.FILE.error.font.family,
|
|
2434
|
+
alignItems: 'center',
|
|
2435
|
+
columnGap: '5px',
|
|
2436
|
+
display: errorIconShow && (errorIcon || configStyles.FILE.error?.icon) ? 'inline-flex' : 'inline-block'
|
|
2281
2437
|
}
|
|
2282
|
-
}, error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2438
|
+
}, errorIconShow ? errorIcon ? errorIcon : configStyles.FILE.error?.icon ? configStyles.FILE.error?.icon : '' : '', error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2283
2439
|
return /*#__PURE__*/React__default.createElement(FileItem, {
|
|
2284
2440
|
key: item.uuid,
|
|
2285
2441
|
uuid: item.uuid,
|
|
@@ -2351,6 +2507,14 @@ File.propTypes = {
|
|
|
2351
2507
|
labelWeight: PropTypes.string,
|
|
2352
2508
|
labelFamily: PropTypes.string,
|
|
2353
2509
|
labelColor: PropTypes.string,
|
|
2510
|
+
labelTooltipColor: PropTypes.string,
|
|
2511
|
+
labelTooltipPadding: PropTypes.string,
|
|
2512
|
+
labelTooltipFontSize: PropTypes.string,
|
|
2513
|
+
labelTooltipFontStyle: PropTypes.string,
|
|
2514
|
+
labelTooltipFontFamily: PropTypes.string,
|
|
2515
|
+
labelTooltipFontWeight: PropTypes.string,
|
|
2516
|
+
labelTooltipBorderRadius: PropTypes.string,
|
|
2517
|
+
labelTooltipBackgroundColor: PropTypes.string,
|
|
2354
2518
|
errorColor: PropTypes.string,
|
|
2355
2519
|
formatError: PropTypes.string,
|
|
2356
2520
|
putFileHere: PropTypes.string,
|
|
@@ -2358,6 +2522,8 @@ File.propTypes = {
|
|
|
2358
2522
|
defaultData: PropTypes.object,
|
|
2359
2523
|
componentId: PropTypes.number,
|
|
2360
2524
|
maxSizeError: PropTypes.string,
|
|
2525
|
+
errorIcon: PropTypes.element,
|
|
2526
|
+
errorIconShow: PropTypes.bool,
|
|
2361
2527
|
errorMessage: PropTypes.string,
|
|
2362
2528
|
fileSizeText: PropTypes.string,
|
|
2363
2529
|
noChoosenFile: PropTypes.string,
|
|
@@ -2415,9 +2581,107 @@ File.propTypes = {
|
|
|
2415
2581
|
listItemBackgroundErrorColor: PropTypes.string,
|
|
2416
2582
|
maxCHoosenLengthErrorHideTime: PropTypes.number,
|
|
2417
2583
|
filesArray: PropTypes.arrayOf(PropTypes.object),
|
|
2584
|
+
textAlignLeftInSmallComponent: PropTypes.bool,
|
|
2585
|
+
showPreviewIconInSmallComponent: PropTypes.bool,
|
|
2418
2586
|
fileExtensions: PropTypes.arrayOf(PropTypes.string)
|
|
2419
2587
|
};
|
|
2420
2588
|
|
|
2589
|
+
const hasOwnerProperty = (object, property) => {
|
|
2590
|
+
return Object.prototype.hasOwnProperty.call(object, property);
|
|
2591
|
+
};
|
|
2592
|
+
const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
|
|
2593
|
+
if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
|
|
2594
|
+
alert('Please set a second param of handleUtilsMouseEnter function as valid object');
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
if (!hasOwnerProperty(e, 'target')) {
|
|
2598
|
+
alert('Please set a valid object like DOM event');
|
|
2599
|
+
return;
|
|
2600
|
+
}
|
|
2601
|
+
const existStyle = e.target.style;
|
|
2602
|
+
if (typeof existStyle !== 'object' || existStyle === null) {
|
|
2603
|
+
alert('Please set a valid style object in DOM event tergat');
|
|
2604
|
+
return;
|
|
2605
|
+
}
|
|
2606
|
+
for (const property in behaviourStyle) {
|
|
2607
|
+
if (existStyle[property]) {
|
|
2608
|
+
existStyle[property] = behaviourStyle[property];
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
};
|
|
2612
|
+
const handleUtilsCheckTypeTel = (val, prevVal) => {
|
|
2613
|
+
const phoneNumberRegex = /^\d{0,8}$/;
|
|
2614
|
+
if (val.length > 7) {
|
|
2615
|
+
val = val.substr(0, 8);
|
|
2616
|
+
}
|
|
2617
|
+
if (!phoneNumberRegex.test(val)) {
|
|
2618
|
+
val = prevVal;
|
|
2619
|
+
}
|
|
2620
|
+
return val;
|
|
2621
|
+
};
|
|
2622
|
+
const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
|
|
2623
|
+
if (maxLength && maxLength > 0) {
|
|
2624
|
+
if (val.length > maxLength) {
|
|
2625
|
+
val = val.substr(0, maxLength);
|
|
2626
|
+
}
|
|
2627
|
+
} else {
|
|
2628
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
|
|
2629
|
+
if (cardNumber) {
|
|
2630
|
+
if (val.length > 19 && !val.includes('.')) {
|
|
2631
|
+
val = val.substr(0, 19);
|
|
2632
|
+
}
|
|
2633
|
+
} else {
|
|
2634
|
+
if (val.length > 16 && !val.includes('.')) {
|
|
2635
|
+
val = val.substr(0, 16);
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
|
|
2639
|
+
val = val.substr(0, numberMaxLength);
|
|
2640
|
+
}
|
|
2641
|
+
const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
|
|
2642
|
+
const int = floatNumParts[0];
|
|
2643
|
+
const float = floatNumParts[1];
|
|
2644
|
+
if (floatToFix > 0) {
|
|
2645
|
+
if (float && float.length > 0) {
|
|
2646
|
+
let floatResult = '';
|
|
2647
|
+
[...float].map((item, index) => {
|
|
2648
|
+
if (index + 1 <= floatToFix) {
|
|
2649
|
+
floatResult += item;
|
|
2650
|
+
}
|
|
2651
|
+
});
|
|
2652
|
+
floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
|
|
2653
|
+
}
|
|
2654
|
+
} else {
|
|
2655
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2656
|
+
val = `${int}`;
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
if (!regNum.test(val)) {
|
|
2660
|
+
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2661
|
+
const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2662
|
+
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2663
|
+
});
|
|
2664
|
+
val = newStr;
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2668
|
+
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2669
|
+
const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2670
|
+
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2671
|
+
});
|
|
2672
|
+
val = newStr;
|
|
2673
|
+
}
|
|
2674
|
+
return val;
|
|
2675
|
+
};
|
|
2676
|
+
const handleUtilsOpenInNewTab = url => {
|
|
2677
|
+
const imageLink = document.createElement('a');
|
|
2678
|
+
imageLink.href = url, imageLink.target = '_blank';
|
|
2679
|
+
imageLink.click();
|
|
2680
|
+
};
|
|
2681
|
+
const handleRemoveLeadingZeros = str => {
|
|
2682
|
+
return str.replace(/^0+(\d)/, '$1');
|
|
2683
|
+
};
|
|
2684
|
+
|
|
2421
2685
|
const SvgCheckboxUnchecked = ({
|
|
2422
2686
|
title,
|
|
2423
2687
|
titleId,
|
|
@@ -2583,129 +2847,6 @@ SingleCheckbox.propTypes = {
|
|
|
2583
2847
|
ignoreDisabledForChecked: PropTypes.bool
|
|
2584
2848
|
};
|
|
2585
2849
|
|
|
2586
|
-
const hasOwnerProperty = (object, property) => {
|
|
2587
|
-
return Object.prototype.hasOwnProperty.call(object, property);
|
|
2588
|
-
};
|
|
2589
|
-
const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
|
|
2590
|
-
if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
|
|
2591
|
-
alert('Please set a second param of handleUtilsMouseEnter function as valid object');
|
|
2592
|
-
return;
|
|
2593
|
-
}
|
|
2594
|
-
if (!hasOwnerProperty(e, 'target')) {
|
|
2595
|
-
alert('Please set a valid object like DOM event');
|
|
2596
|
-
return;
|
|
2597
|
-
}
|
|
2598
|
-
const existStyle = e.target.style;
|
|
2599
|
-
if (typeof existStyle !== 'object' || existStyle === null) {
|
|
2600
|
-
alert('Please set a valid style object in DOM event tergat');
|
|
2601
|
-
return;
|
|
2602
|
-
}
|
|
2603
|
-
for (const property in behaviourStyle) {
|
|
2604
|
-
if (existStyle[property]) {
|
|
2605
|
-
existStyle[property] = behaviourStyle[property];
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
};
|
|
2609
|
-
const handleUtilsCheckTypeTel = (val, prevVal) => {
|
|
2610
|
-
const phoneNumberRegex = /^\d{0,8}$/;
|
|
2611
|
-
if (val.length > 7) {
|
|
2612
|
-
val = val.substr(0, 8);
|
|
2613
|
-
}
|
|
2614
|
-
if (!phoneNumberRegex.test(val)) {
|
|
2615
|
-
val = prevVal;
|
|
2616
|
-
}
|
|
2617
|
-
return val;
|
|
2618
|
-
};
|
|
2619
|
-
const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
|
|
2620
|
-
if (maxLength && maxLength > 0) {
|
|
2621
|
-
if (val.length > maxLength) {
|
|
2622
|
-
val = val.substr(0, maxLength);
|
|
2623
|
-
}
|
|
2624
|
-
} else {
|
|
2625
|
-
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
|
|
2626
|
-
if (cardNumber) {
|
|
2627
|
-
if (val.length > 19 && !val.includes('.')) {
|
|
2628
|
-
val = val.substr(0, 19);
|
|
2629
|
-
}
|
|
2630
|
-
} else {
|
|
2631
|
-
if (val.length > 16 && !val.includes('.')) {
|
|
2632
|
-
val = val.substr(0, 16);
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
|
|
2636
|
-
val = val.substr(0, numberMaxLength);
|
|
2637
|
-
}
|
|
2638
|
-
const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
|
|
2639
|
-
const int = floatNumParts[0];
|
|
2640
|
-
const float = floatNumParts[1];
|
|
2641
|
-
if (floatToFix > 0) {
|
|
2642
|
-
if (float && float.length > 0) {
|
|
2643
|
-
let floatResult = '';
|
|
2644
|
-
[...float].map((item, index) => {
|
|
2645
|
-
if (index + 1 <= floatToFix) {
|
|
2646
|
-
floatResult += item;
|
|
2647
|
-
}
|
|
2648
|
-
});
|
|
2649
|
-
floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
|
|
2650
|
-
}
|
|
2651
|
-
} else {
|
|
2652
|
-
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2653
|
-
val = `${int}`;
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
if (!regNum.test(val)) {
|
|
2657
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2658
|
-
const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2659
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2660
|
-
});
|
|
2661
|
-
val = newStr;
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2665
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2666
|
-
const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2667
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2668
|
-
});
|
|
2669
|
-
val = newStr;
|
|
2670
|
-
}
|
|
2671
|
-
return val;
|
|
2672
|
-
};
|
|
2673
|
-
const handleUtilsOpenInNewTab = url => {
|
|
2674
|
-
const imageLink = document.createElement('a');
|
|
2675
|
-
imageLink.href = url, imageLink.target = '_blank';
|
|
2676
|
-
imageLink.click();
|
|
2677
|
-
};
|
|
2678
|
-
const handleRemoveLeadingZeros = str => {
|
|
2679
|
-
return str.replace(/^0+(\d)/, '$1');
|
|
2680
|
-
};
|
|
2681
|
-
|
|
2682
|
-
function styleInject(css, ref) {
|
|
2683
|
-
if ( ref === void 0 ) ref = {};
|
|
2684
|
-
var insertAt = ref.insertAt;
|
|
2685
|
-
|
|
2686
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
2687
|
-
|
|
2688
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
2689
|
-
var style = document.createElement('style');
|
|
2690
|
-
style.type = 'text/css';
|
|
2691
|
-
|
|
2692
|
-
if (insertAt === 'top') {
|
|
2693
|
-
if (head.firstChild) {
|
|
2694
|
-
head.insertBefore(style, head.firstChild);
|
|
2695
|
-
} else {
|
|
2696
|
-
head.appendChild(style);
|
|
2697
|
-
}
|
|
2698
|
-
} else {
|
|
2699
|
-
head.appendChild(style);
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
if (style.styleSheet) {
|
|
2703
|
-
style.styleSheet.cssText = css;
|
|
2704
|
-
} else {
|
|
2705
|
-
style.appendChild(document.createTextNode(css));
|
|
2706
|
-
}
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
2850
|
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{align-items:center;cursor:pointer;display:flex;margin:0 0 8px;min-height:38px;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}.table-module_no-tabel-data__6xp3N{align-items:center;display:flex;height:200px;justify-content:center;width:100%}";
|
|
2710
2851
|
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","no-tabel-data":"table-module_no-tabel-data__6xp3N"};
|
|
2711
2852
|
styleInject(css_248z$c);
|
|
@@ -2800,6 +2941,7 @@ const TD = ({
|
|
|
2800
2941
|
tBodyFontFamily,
|
|
2801
2942
|
tBodyFontWeight,
|
|
2802
2943
|
handleCheckDots,
|
|
2944
|
+
collapseFullRow,
|
|
2803
2945
|
openListFontSize,
|
|
2804
2946
|
borderRightColor,
|
|
2805
2947
|
openListFontStyle,
|
|
@@ -2814,6 +2956,11 @@ const TD = ({
|
|
|
2814
2956
|
handleCheckArrowAction,
|
|
2815
2957
|
handleOpenCloseRowSingleArrow
|
|
2816
2958
|
}) => {
|
|
2959
|
+
const [actionHover, setActionHover] = useState({
|
|
2960
|
+
id: '',
|
|
2961
|
+
type: '',
|
|
2962
|
+
index: -1
|
|
2963
|
+
});
|
|
2817
2964
|
const handleBodyAction = (e, data) => {
|
|
2818
2965
|
const actionData = {
|
|
2819
2966
|
index,
|
|
@@ -2853,6 +3000,24 @@ const TD = ({
|
|
|
2853
3000
|
contentListInnerItem
|
|
2854
3001
|
});
|
|
2855
3002
|
};
|
|
3003
|
+
const handleMouseEnter = (item, index) => {
|
|
3004
|
+
setActionHover(() => {
|
|
3005
|
+
return {
|
|
3006
|
+
id: item.id,
|
|
3007
|
+
type: item.type,
|
|
3008
|
+
index
|
|
3009
|
+
};
|
|
3010
|
+
});
|
|
3011
|
+
};
|
|
3012
|
+
const handleMouseLeave = () => {
|
|
3013
|
+
setActionHover(() => {
|
|
3014
|
+
return {
|
|
3015
|
+
id: '',
|
|
3016
|
+
type: '',
|
|
3017
|
+
index: -1
|
|
3018
|
+
};
|
|
3019
|
+
});
|
|
3020
|
+
};
|
|
2856
3021
|
return /*#__PURE__*/React__default.createElement("td", {
|
|
2857
3022
|
style: {
|
|
2858
3023
|
width: 'auto',
|
|
@@ -2887,8 +3052,10 @@ const TD = ({
|
|
|
2887
3052
|
type: newItem.type,
|
|
2888
3053
|
className: styles$a['td-span'],
|
|
2889
3054
|
key: `${newItem.id}_${newIndex}`,
|
|
2890
|
-
onClick: e => handleCheckActions(e, newItem, 'type', newIndex)
|
|
2891
|
-
|
|
3055
|
+
onClick: e => handleCheckActions(e, newItem, 'type', newIndex),
|
|
3056
|
+
onMouseEnter: () => handleMouseEnter(newItem, newIndex),
|
|
3057
|
+
onMouseLeave: () => handleMouseLeave()
|
|
3058
|
+
}, newItem.content === 0 ? newItem.content.toString() : newItem.contentHover && actionHover.id === newItem.id && actionHover.type === newItem.type && actionHover.index === newIndex ? newItem.contentHover : newItem.content ? newItem.content : '');
|
|
2892
3059
|
} else if (newItem && Array.isArray(newItem)) {
|
|
2893
3060
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2894
3061
|
key: `${newItem.id}_${newIndex}`,
|
|
@@ -2908,9 +3075,11 @@ const TD = ({
|
|
|
2908
3075
|
id: iT.id ? iT.id : '',
|
|
2909
3076
|
type: iT.type ? iT.type : '',
|
|
2910
3077
|
className: styles$a['td-span'],
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
3078
|
+
key: `${iT.id || iT.content}_${iN}`,
|
|
3079
|
+
onMouseEnter: () => handleMouseEnter(iT, iN),
|
|
3080
|
+
onMouseLeave: () => handleMouseLeave(),
|
|
3081
|
+
onClick: e => handleCheckActions(e, iT, 'type', iN)
|
|
3082
|
+
}, iT.content === 0 ? iT.content.toString() : iT.contentHover && actionHover.id === iT.id && actionHover.type === iT.type && actionHover.index === iN ? iT.contentHover : iT.content ? iT.content : '');
|
|
2914
3083
|
}));
|
|
2915
3084
|
} else {
|
|
2916
3085
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -2975,7 +3144,7 @@ const TD = ({
|
|
|
2975
3144
|
cursor: hasOwnerProperty(item, 'arrowComponent') || hasOwnerProperty(item, 'dots') ? 'pointer' : 'auto',
|
|
2976
3145
|
...item.props
|
|
2977
3146
|
},
|
|
2978
|
-
onClick: hasOwnerProperty(item, 'arrowComponent') ? () => handleCheckArrowAction(item, item.checkIndex) : hasOwnerProperty(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
|
|
3147
|
+
onClick: hasOwnerProperty(item, 'arrowComponent') ? () => handleCheckArrowAction(item, collapseFullRow ? index : item.checkIndex) : hasOwnerProperty(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
|
|
2979
3148
|
}, item.content === 0 ? item.content.toString() : item.content ? item.content : hasOwnerProperty(item, 'arrowComponent') ? item.status === 'close' ? item.closeArrow : item.openArrow : hasOwnerProperty(item, 'dots') ? /*#__PURE__*/React__default.createElement("span", {
|
|
2980
3149
|
style: {
|
|
2981
3150
|
display: 'block',
|
|
@@ -3022,7 +3191,7 @@ const TD = ({
|
|
|
3022
3191
|
},
|
|
3023
3192
|
title: optionItem.content
|
|
3024
3193
|
}, optionItem.content === 0 ? optionItem.content.toString() : optionItem.content ? optionItem.content : ''));
|
|
3025
|
-
}))) : ''), hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default.createElement("div", {
|
|
3194
|
+
}))) : ''), hasOwnerProperty(item, 'contentList') && !collapseFullRow && /*#__PURE__*/React__default.createElement("div", {
|
|
3026
3195
|
style: {
|
|
3027
3196
|
overflow: 'auto',
|
|
3028
3197
|
marginTop: '10px',
|
|
@@ -3183,7 +3352,12 @@ const Table = ({
|
|
|
3183
3352
|
draggableColor,
|
|
3184
3353
|
getDraggableData,
|
|
3185
3354
|
draggableItemBoxShadow,
|
|
3186
|
-
draggableItemBackgroundColor
|
|
3355
|
+
draggableItemBackgroundColor,
|
|
3356
|
+
tableBorder,
|
|
3357
|
+
tableBorderColor,
|
|
3358
|
+
collapseFullRow,
|
|
3359
|
+
openArrow,
|
|
3360
|
+
closeArrow
|
|
3187
3361
|
}) => {
|
|
3188
3362
|
const itemRefs = useRef({});
|
|
3189
3363
|
const headerRef = useRef(null);
|
|
@@ -3317,8 +3491,8 @@ const Table = ({
|
|
|
3317
3491
|
status: 'close',
|
|
3318
3492
|
checkIndex: null,
|
|
3319
3493
|
arrowComponent: true,
|
|
3320
|
-
openArrow: /*#__PURE__*/React__default.createElement(SvgUpArrow, null),
|
|
3321
|
-
closeArrow: /*#__PURE__*/React__default.createElement(SvgDownArrow, null)
|
|
3494
|
+
openArrow: openArrow ? openArrow : configStyles.TABLE?.openArrow ? configStyles.TABLE?.openArrow : /*#__PURE__*/React__default.createElement(SvgUpArrow, null),
|
|
3495
|
+
closeArrow: closeArrow ? closeArrow : configStyles.TABLE?.closeArrow ? configStyles.TABLE?.closeArrow : /*#__PURE__*/React__default.createElement(SvgDownArrow, null)
|
|
3322
3496
|
};
|
|
3323
3497
|
if (type === 'body') {
|
|
3324
3498
|
return data.map((item, index) => {
|
|
@@ -3482,6 +3656,49 @@ const Table = ({
|
|
|
3482
3656
|
prev[rowPosition] = checkedOpenableRow;
|
|
3483
3657
|
return [...prev];
|
|
3484
3658
|
});
|
|
3659
|
+
if (collapseFullRow) {
|
|
3660
|
+
const newRows = [];
|
|
3661
|
+
body[rowPosition].filter(newItem => hasOwnerProperty(newItem, 'contentList')).map((cfrItem, cfrIndex) => {
|
|
3662
|
+
newRows[cfrIndex] = cfrItem.contentList;
|
|
3663
|
+
});
|
|
3664
|
+
const transformedArray = newRows && newRows[0] && newRows[0].map((_, index) => {
|
|
3665
|
+
let result = [];
|
|
3666
|
+
for (let i = 0; i < newRows.length; i++) {
|
|
3667
|
+
result[i] = newRows[i][index];
|
|
3668
|
+
}
|
|
3669
|
+
return result;
|
|
3670
|
+
});
|
|
3671
|
+
if (transformedArray && transformedArray.length) {
|
|
3672
|
+
const fakeData = transformedArray.map(fakeItem => {
|
|
3673
|
+
fakeItem.unshift({
|
|
3674
|
+
id: 'fake',
|
|
3675
|
+
content: ''
|
|
3676
|
+
});
|
|
3677
|
+
fakeItem.push({
|
|
3678
|
+
id: 'fake',
|
|
3679
|
+
content: ''
|
|
3680
|
+
});
|
|
3681
|
+
return fakeItem;
|
|
3682
|
+
});
|
|
3683
|
+
if (status === 'close') {
|
|
3684
|
+
let met = [...body];
|
|
3685
|
+
setTimeout(() => {
|
|
3686
|
+
setBody(() => {
|
|
3687
|
+
met.splice(rowPosition + 1, 0, ...fakeData);
|
|
3688
|
+
return met;
|
|
3689
|
+
});
|
|
3690
|
+
}, 0);
|
|
3691
|
+
} else {
|
|
3692
|
+
let met = [...body];
|
|
3693
|
+
setTimeout(() => {
|
|
3694
|
+
setBody(() => {
|
|
3695
|
+
met.splice(rowPosition + 1, fakeData.length);
|
|
3696
|
+
return met;
|
|
3697
|
+
});
|
|
3698
|
+
}, 0);
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3485
3702
|
};
|
|
3486
3703
|
const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
|
|
3487
3704
|
let single = {};
|
|
@@ -3522,6 +3739,7 @@ const Table = ({
|
|
|
3522
3739
|
};
|
|
3523
3740
|
const handleCheckArrowActionHeader = (e, item) => {
|
|
3524
3741
|
e.stopPropagation();
|
|
3742
|
+
let mergedArray = [];
|
|
3525
3743
|
const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
|
|
3526
3744
|
if (item.checkIndex === (draggable && !showOrder ? innerIndex - 1 : draggable && showOrder ? innerIndex - 2 : innerIndex)) {
|
|
3527
3745
|
if (item.status === 'close') {
|
|
@@ -3544,8 +3762,52 @@ const Table = ({
|
|
|
3544
3762
|
return iElem;
|
|
3545
3763
|
});
|
|
3546
3764
|
});
|
|
3765
|
+
if (collapseFullRow) {
|
|
3766
|
+
if (item.status === 'open') {
|
|
3767
|
+
const newFakeBody = checkedOpenableAllRowsBody.map(bodyItem => {
|
|
3768
|
+
let fakeData = [];
|
|
3769
|
+
const newRows = [];
|
|
3770
|
+
bodyItem.filter(newItem => hasOwnerProperty(newItem, 'contentList')).map((cfrItem, cfrIndex) => {
|
|
3771
|
+
newRows[cfrIndex] = cfrItem.contentList;
|
|
3772
|
+
});
|
|
3773
|
+
const transformedArray = newRows && newRows[0] && newRows[0].map((_, index) => {
|
|
3774
|
+
let result = [];
|
|
3775
|
+
for (let i = 0; i < newRows.length; i++) {
|
|
3776
|
+
result[i] = newRows[i][index];
|
|
3777
|
+
}
|
|
3778
|
+
return result;
|
|
3779
|
+
});
|
|
3780
|
+
if (transformedArray && transformedArray.length) {
|
|
3781
|
+
fakeData = transformedArray.map(fakeItem => {
|
|
3782
|
+
fakeItem.unshift({
|
|
3783
|
+
id: 'fake',
|
|
3784
|
+
content: ''
|
|
3785
|
+
});
|
|
3786
|
+
fakeItem.push({
|
|
3787
|
+
id: 'fake',
|
|
3788
|
+
content: ''
|
|
3789
|
+
});
|
|
3790
|
+
return fakeItem;
|
|
3791
|
+
});
|
|
3792
|
+
}
|
|
3793
|
+
return fakeData;
|
|
3794
|
+
});
|
|
3795
|
+
if (newFakeBody && newFakeBody.length) {
|
|
3796
|
+
checkedOpenableAllRowsBody.map((newBodyItem, newBodyIndex) => {
|
|
3797
|
+
mergedArray.push(newBodyItem);
|
|
3798
|
+
if (newFakeBody[newBodyIndex] && newFakeBody[newBodyIndex].length) {
|
|
3799
|
+
newFakeBody[newBodyIndex].map(newFakeBodyItem => {
|
|
3800
|
+
mergedArray.push(newFakeBodyItem);
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
} else {
|
|
3806
|
+
mergedArray = checkedOpenableAllRowsBody.filter(realArray => !realArray.some(item => item.id === 'fake'));
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3547
3809
|
setHeader(() => checkedOpenableAllRows);
|
|
3548
|
-
setBody(() => checkedOpenableAllRowsBody);
|
|
3810
|
+
setBody(() => !collapseFullRow ? checkedOpenableAllRowsBody : mergedArray);
|
|
3549
3811
|
};
|
|
3550
3812
|
const handleCheckDots = (e, item, index, innerIndex) => {
|
|
3551
3813
|
e.stopPropagation();
|
|
@@ -3814,8 +4076,11 @@ const Table = ({
|
|
|
3814
4076
|
return configStyles.TABLE && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("table", {
|
|
3815
4077
|
style: {
|
|
3816
4078
|
width: '100%',
|
|
3817
|
-
|
|
3818
|
-
|
|
4079
|
+
borderRadius: tHeadBorderRadius ?? configStyles.TABLE.head.radius,
|
|
4080
|
+
outline: hideBorder ? 'none' : tableBorder ?? configStyles.TABLE.border,
|
|
4081
|
+
outlineColor: hideBorder ? 'none' : tableBorderColor ?? configStyles.TABLE.borderColor,
|
|
4082
|
+
borderSpacing: `0 ${tBodyRowMarginTop ?? configStyles.TABLE.body.row.marginTop}`,
|
|
4083
|
+
borderCollapse: tableRowItem ?? configStyles.TABLE.body.row.asItem ? 'separate' : 'collapse'
|
|
3819
4084
|
},
|
|
3820
4085
|
onClick: handleTableClick,
|
|
3821
4086
|
className: classProps
|
|
@@ -3825,7 +4090,7 @@ const Table = ({
|
|
|
3825
4090
|
style: {
|
|
3826
4091
|
color: tHeadColor ?? configStyles.TABLE.head.color,
|
|
3827
4092
|
backgroundColor: tHeadBackgroundColor ?? configStyles.TABLE.head.colors.background,
|
|
3828
|
-
borderColor: hideBorder ? 'transparent' :
|
|
4093
|
+
borderColor: hideBorder ? 'transparent' : tableBorderColor ?? configStyles.TABLE.borderColor
|
|
3829
4094
|
}
|
|
3830
4095
|
}, header.map((item, index) => {
|
|
3831
4096
|
return /*#__PURE__*/React__default.createElement(TH, {
|
|
@@ -3902,7 +4167,8 @@ const Table = ({
|
|
|
3902
4167
|
borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.body.row.border,
|
|
3903
4168
|
borderRightColor: innerIndex === Object.values(item).length - 1 ? 'transparent' : configStyles.TABLE.body.row.borderColor,
|
|
3904
4169
|
handleCheckArrowAction: handleCheckArrowAction,
|
|
3905
|
-
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
|
|
4170
|
+
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow,
|
|
4171
|
+
collapseFullRow: collapseFullRow
|
|
3906
4172
|
});
|
|
3907
4173
|
}));
|
|
3908
4174
|
})) : '', body && body.length > 0 && draggable && dragging && draggedItem && /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
@@ -3994,7 +4260,12 @@ Table.propTypes = {
|
|
|
3994
4260
|
openListFontStyle: PropTypes.string,
|
|
3995
4261
|
openListFontWeight: PropTypes.string,
|
|
3996
4262
|
openListFontFamily: PropTypes.string,
|
|
3997
|
-
hideBorder: PropTypes.bool
|
|
4263
|
+
hideBorder: PropTypes.bool,
|
|
4264
|
+
collapseFullRow: PropTypes.bool,
|
|
4265
|
+
tableBorder: PropTypes.string,
|
|
4266
|
+
tableBorderColor: PropTypes.string,
|
|
4267
|
+
openArrow: PropTypes.element,
|
|
4268
|
+
closeArrow: PropTypes.element
|
|
3998
4269
|
};
|
|
3999
4270
|
|
|
4000
4271
|
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)}}";
|
|
@@ -4594,6 +4865,7 @@ const TelInput = ({
|
|
|
4594
4865
|
disabled: disabled,
|
|
4595
4866
|
onInput: handleChange,
|
|
4596
4867
|
name: inpAttributes?.iName,
|
|
4868
|
+
className: "tui-color-placeholder",
|
|
4597
4869
|
placeholder: inpAttributes?.placeholder,
|
|
4598
4870
|
autoComplete: inpAttributes?.autoComplete,
|
|
4599
4871
|
style: {
|
|
@@ -4646,6 +4918,7 @@ const TextInput = ({
|
|
|
4646
4918
|
disabled: disabled,
|
|
4647
4919
|
onInput: handleChange,
|
|
4648
4920
|
name: inpAttributes?.iName,
|
|
4921
|
+
className: "tui-color-placeholder",
|
|
4649
4922
|
placeholder: inpAttributes?.placeholder,
|
|
4650
4923
|
autoComplete: inpAttributes?.autoComplete,
|
|
4651
4924
|
style: {
|
|
@@ -4704,6 +4977,7 @@ const PassInput = ({
|
|
|
4704
4977
|
disabled: disabled,
|
|
4705
4978
|
onInput: handleChange,
|
|
4706
4979
|
name: inpAttributes?.iName,
|
|
4980
|
+
className: "tui-color-placeholder",
|
|
4707
4981
|
placeholder: inpAttributes?.placeholder,
|
|
4708
4982
|
autoComplete: inpAttributes?.autoComplete,
|
|
4709
4983
|
style: {
|
|
@@ -4744,7 +5018,16 @@ const NumberInput = ({
|
|
|
4744
5018
|
let prevValue = innerValue;
|
|
4745
5019
|
let currentValue = event.target.value.replace(/\.|․|\.|,/g, '.');
|
|
4746
5020
|
currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
|
|
4747
|
-
|
|
5021
|
+
if (cardNumber) {
|
|
5022
|
+
let digits = currentValue.replace(/\D/g, '');
|
|
5023
|
+
if (digits.length <= 16) {
|
|
5024
|
+
setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5025
|
+
} else {
|
|
5026
|
+
setInnerValue(() => digits.substring(0, 16).replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5027
|
+
}
|
|
5028
|
+
} else {
|
|
5029
|
+
setInnerValue(() => currentValue);
|
|
5030
|
+
}
|
|
4748
5031
|
if (inputChange && currentValue !== prevValue) {
|
|
4749
5032
|
if (currentValue < Number.MIN_SAFE_INTEGER || currentValue > Number.MAX_SAFE_INTEGER) {
|
|
4750
5033
|
if (!cardNumber) {
|
|
@@ -4817,14 +5100,24 @@ const NumberInput = ({
|
|
|
4817
5100
|
if (value !== undefined && value !== null) {
|
|
4818
5101
|
newValue = handleUtilsCheckTypeNumber(value, newValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
|
|
4819
5102
|
}
|
|
4820
|
-
|
|
4821
|
-
|
|
5103
|
+
if (cardNumber) {
|
|
5104
|
+
let digits = newValue.replace(/\D/g, '');
|
|
5105
|
+
if (digits.length <= 16) {
|
|
5106
|
+
setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5107
|
+
} else {
|
|
5108
|
+
setInnerValue(() => digits.substring(0, 16).replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5109
|
+
}
|
|
5110
|
+
} else {
|
|
5111
|
+
setInnerValue(() => newValue);
|
|
5112
|
+
}
|
|
4822
5113
|
}, [dots, value, float, cardNumber, maxNumSize, minNumSize, numberMaxLength]);
|
|
4823
5114
|
return /*#__PURE__*/React__default.createElement("input", {
|
|
4824
5115
|
type: "text",
|
|
5116
|
+
inputMode: "decimal",
|
|
4825
5117
|
value: innerValue,
|
|
4826
5118
|
disabled: disabled,
|
|
4827
5119
|
name: inpAttributes?.iName,
|
|
5120
|
+
className: "tui-color-placeholder",
|
|
4828
5121
|
placeholder: inpAttributes?.placeholder,
|
|
4829
5122
|
autoComplete: inpAttributes?.autoComplete,
|
|
4830
5123
|
style: {
|
|
@@ -4930,6 +5223,7 @@ const Input = ({
|
|
|
4930
5223
|
numberMaxLength,
|
|
4931
5224
|
backgroundColor,
|
|
4932
5225
|
errorIconMargin,
|
|
5226
|
+
placeholderColor,
|
|
4933
5227
|
withZero = false,
|
|
4934
5228
|
labelMarginBottom,
|
|
4935
5229
|
regexpErrorMessage,
|
|
@@ -5044,7 +5338,9 @@ const Input = ({
|
|
|
5044
5338
|
}, []);
|
|
5045
5339
|
return configStyles.INPUT && /*#__PURE__*/React__default.createElement("div", {
|
|
5046
5340
|
className: classProps
|
|
5047
|
-
},
|
|
5341
|
+
}, /*#__PURE__*/React__default.createElement("style", null, `.tui-color-placeholder::placeholder {
|
|
5342
|
+
color: ${placeholderColor ?? configStyles.INPUT.colors.placeholder};
|
|
5343
|
+
}`), label ? /*#__PURE__*/React__default.createElement("label", {
|
|
5048
5344
|
style: {
|
|
5049
5345
|
maxWidth: '100%',
|
|
5050
5346
|
color: labelColor ?? configStyles.INPUT.label.color,
|
|
@@ -5272,6 +5568,7 @@ Input.propTypes = {
|
|
|
5272
5568
|
labelMarginBottom: PropTypes.string,
|
|
5273
5569
|
borderRight: PropTypes.string,
|
|
5274
5570
|
placeholder: PropTypes.string,
|
|
5571
|
+
placeholderColor: PropTypes.string,
|
|
5275
5572
|
phoneDisplay: PropTypes.string,
|
|
5276
5573
|
autoComplete: PropTypes.string,
|
|
5277
5574
|
errorDots: PropTypes.bool,
|
|
@@ -6823,7 +7120,7 @@ const Stepper = ({
|
|
|
6823
7120
|
}, (() => {
|
|
6824
7121
|
let steppers = [];
|
|
6825
7122
|
for (let step = 1; step <= stepLength; step++) {
|
|
6826
|
-
steppers.push(
|
|
7123
|
+
steppers.push(/*#__PURE__*/React__default.createElement("div", {
|
|
6827
7124
|
className: classnames(`${step <= activeSteps ? styles$3.activeRing : styles$3.bigRing}`),
|
|
6828
7125
|
key: step
|
|
6829
7126
|
}, /*#__PURE__*/React__default.createElement("div", {
|