@xaypay/tui 0.2.20 → 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 +393 -126
- package/dist/index.js +393 -126
- 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}`);
|
|
@@ -1707,8 +1719,8 @@ function styleInject(css, ref) {
|
|
|
1707
1719
|
}
|
|
1708
1720
|
}
|
|
1709
1721
|
|
|
1710
|
-
var css_248z$d = ".file-module_small-file-component__nlpcW>svg{max-height:77%!important}";
|
|
1711
|
-
var styles$b = {"small-file-component":"file-module_small-file-component__nlpcW"};
|
|
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"};
|
|
1712
1724
|
styleInject(css_248z$d);
|
|
1713
1725
|
|
|
1714
1726
|
// eslint-disable-next-line react/display-name
|
|
@@ -1741,6 +1753,14 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1741
1753
|
labelStyle,
|
|
1742
1754
|
labelWeight,
|
|
1743
1755
|
labelFamily,
|
|
1756
|
+
labelTooltipColor,
|
|
1757
|
+
labelTooltipPadding,
|
|
1758
|
+
labelTooltipFontSize,
|
|
1759
|
+
labelTooltipFontStyle,
|
|
1760
|
+
labelTooltipFontFamily,
|
|
1761
|
+
labelTooltipFontWeight,
|
|
1762
|
+
labelTooltipBorderRadius,
|
|
1763
|
+
labelTooltipBackgroundColor,
|
|
1744
1764
|
removeFile,
|
|
1745
1765
|
labelColor,
|
|
1746
1766
|
errorColor,
|
|
@@ -1750,6 +1770,8 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1750
1770
|
uploadColor,
|
|
1751
1771
|
defaultData,
|
|
1752
1772
|
formatError,
|
|
1773
|
+
errorIcon,
|
|
1774
|
+
errorIconShow,
|
|
1753
1775
|
errorMessage,
|
|
1754
1776
|
fileSizeText,
|
|
1755
1777
|
maxSizeError,
|
|
@@ -1806,6 +1828,7 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1806
1828
|
listItemBackgroundColor,
|
|
1807
1829
|
listItemBackgroundErrorColor,
|
|
1808
1830
|
maxCHoosenLengthErrorHideTime,
|
|
1831
|
+
textAlignLeftInSmallComponent,
|
|
1809
1832
|
showPreviewIconInSmallComponent,
|
|
1810
1833
|
maxSize = 10,
|
|
1811
1834
|
preview = true,
|
|
@@ -1813,12 +1836,14 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
1813
1836
|
fileExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
1814
1837
|
}, ref) => {
|
|
1815
1838
|
const inpRef = useRef(null);
|
|
1839
|
+
const labelRef = useRef(null);
|
|
1816
1840
|
const memoizedItems = useMemo(() => filesArray, [filesArray]);
|
|
1817
1841
|
const [error, setError] = useState('');
|
|
1818
1842
|
const [isHover, setIsHover] = useState(false);
|
|
1819
1843
|
const [classProps, setClassProps] = useState({});
|
|
1820
1844
|
const [singleFile, setSingleFile] = useState(null);
|
|
1821
1845
|
const [configStyles, setConfigStyles] = useState({});
|
|
1846
|
+
const [tooltipElem, setTooltipElem] = useState(null);
|
|
1822
1847
|
const [choosenFileCount, setChoosenFileCount] = useState(0);
|
|
1823
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);
|
|
1824
1849
|
const handleCheckHeicFormat = async file => {
|
|
@@ -2083,6 +2108,71 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2083
2108
|
const handleStopPropagation = e => {
|
|
2084
2109
|
e.stopPropagation();
|
|
2085
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
|
+
};
|
|
2086
2176
|
useImperativeHandle(ref, () => ({
|
|
2087
2177
|
handleReset() {
|
|
2088
2178
|
setError('');
|
|
@@ -2149,6 +2239,11 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2149
2239
|
}, error => {
|
|
2150
2240
|
console.error(error);
|
|
2151
2241
|
});
|
|
2242
|
+
return () => {
|
|
2243
|
+
if (tooltipElem) {
|
|
2244
|
+
document.body.removeChild(tooltipElem);
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2152
2247
|
}, []);
|
|
2153
2248
|
return configStyles.FILE && /*#__PURE__*/React__default.createElement("div", {
|
|
2154
2249
|
style: {
|
|
@@ -2163,15 +2258,28 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2163
2258
|
alignItems: 'center',
|
|
2164
2259
|
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2165
2260
|
}
|
|
2166
|
-
}, label && /*#__PURE__*/React__default.createElement("
|
|
2261
|
+
}, label && /*#__PURE__*/React__default.createElement("div", {
|
|
2167
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%',
|
|
2168
2274
|
color: labelColor ?? configStyles.FILE.label.color,
|
|
2169
2275
|
fontSize: labelSize ?? configStyles.FILE.label.font.size,
|
|
2170
2276
|
fontStyle: labelStyle ?? configStyles.FILE.label.font.style,
|
|
2171
2277
|
fontWeight: labelWeight ?? configStyles.FILE.label.font.weight,
|
|
2172
2278
|
fontFamily: labelFamily ?? configStyles.FILE.label.font.family
|
|
2173
|
-
}
|
|
2174
|
-
|
|
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", {
|
|
2175
2283
|
style: {
|
|
2176
2284
|
cursor: 'pointer'
|
|
2177
2285
|
},
|
|
@@ -2256,7 +2364,7 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2256
2364
|
display: 'flex',
|
|
2257
2365
|
alignItems: 'center',
|
|
2258
2366
|
boxSizing: 'border-box',
|
|
2259
|
-
justifyContent: 'space-between'
|
|
2367
|
+
justifyContent: textAlignLeftInSmallComponent ? 'flex-start' : 'space-between'
|
|
2260
2368
|
}
|
|
2261
2369
|
}, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default.createElement(Button, {
|
|
2262
2370
|
contentWidth: true,
|
|
@@ -2318,14 +2426,16 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
2318
2426
|
}, iconRemoveFile ? iconRemoveFile : configStyles.FILE.icon.removeFile ? configStyles.FILE.icon.removeFile : /*#__PURE__*/React__default.createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default.createElement("span", {
|
|
2319
2427
|
style: {
|
|
2320
2428
|
marginTop: '6px',
|
|
2321
|
-
display: 'inline-block',
|
|
2322
2429
|
color: errorColor ?? configStyles.FILE.error.color,
|
|
2323
2430
|
fontSize: errorSize ?? configStyles.FILE.error.font.size,
|
|
2324
2431
|
fontStyle: errorStyle ?? configStyles.FILE.error.font.style,
|
|
2325
2432
|
fontWeight: errorWeight ?? configStyles.FILE.error.font.weight,
|
|
2326
|
-
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'
|
|
2327
2437
|
}
|
|
2328
|
-
}, 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 => {
|
|
2329
2439
|
return /*#__PURE__*/React__default.createElement(FileItem, {
|
|
2330
2440
|
key: item.uuid,
|
|
2331
2441
|
uuid: item.uuid,
|
|
@@ -2397,6 +2507,14 @@ File.propTypes = {
|
|
|
2397
2507
|
labelWeight: PropTypes.string,
|
|
2398
2508
|
labelFamily: PropTypes.string,
|
|
2399
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,
|
|
2400
2518
|
errorColor: PropTypes.string,
|
|
2401
2519
|
formatError: PropTypes.string,
|
|
2402
2520
|
putFileHere: PropTypes.string,
|
|
@@ -2404,6 +2522,8 @@ File.propTypes = {
|
|
|
2404
2522
|
defaultData: PropTypes.object,
|
|
2405
2523
|
componentId: PropTypes.number,
|
|
2406
2524
|
maxSizeError: PropTypes.string,
|
|
2525
|
+
errorIcon: PropTypes.element,
|
|
2526
|
+
errorIconShow: PropTypes.bool,
|
|
2407
2527
|
errorMessage: PropTypes.string,
|
|
2408
2528
|
fileSizeText: PropTypes.string,
|
|
2409
2529
|
noChoosenFile: PropTypes.string,
|
|
@@ -2461,10 +2581,107 @@ File.propTypes = {
|
|
|
2461
2581
|
listItemBackgroundErrorColor: PropTypes.string,
|
|
2462
2582
|
maxCHoosenLengthErrorHideTime: PropTypes.number,
|
|
2463
2583
|
filesArray: PropTypes.arrayOf(PropTypes.object),
|
|
2584
|
+
textAlignLeftInSmallComponent: PropTypes.bool,
|
|
2464
2585
|
showPreviewIconInSmallComponent: PropTypes.bool,
|
|
2465
2586
|
fileExtensions: PropTypes.arrayOf(PropTypes.string)
|
|
2466
2587
|
};
|
|
2467
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
|
+
|
|
2468
2685
|
const SvgCheckboxUnchecked = ({
|
|
2469
2686
|
title,
|
|
2470
2687
|
titleId,
|
|
@@ -2630,102 +2847,6 @@ SingleCheckbox.propTypes = {
|
|
|
2630
2847
|
ignoreDisabledForChecked: PropTypes.bool
|
|
2631
2848
|
};
|
|
2632
2849
|
|
|
2633
|
-
const hasOwnerProperty = (object, property) => {
|
|
2634
|
-
return Object.prototype.hasOwnProperty.call(object, property);
|
|
2635
|
-
};
|
|
2636
|
-
const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
|
|
2637
|
-
if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
|
|
2638
|
-
alert('Please set a second param of handleUtilsMouseEnter function as valid object');
|
|
2639
|
-
return;
|
|
2640
|
-
}
|
|
2641
|
-
if (!hasOwnerProperty(e, 'target')) {
|
|
2642
|
-
alert('Please set a valid object like DOM event');
|
|
2643
|
-
return;
|
|
2644
|
-
}
|
|
2645
|
-
const existStyle = e.target.style;
|
|
2646
|
-
if (typeof existStyle !== 'object' || existStyle === null) {
|
|
2647
|
-
alert('Please set a valid style object in DOM event tergat');
|
|
2648
|
-
return;
|
|
2649
|
-
}
|
|
2650
|
-
for (const property in behaviourStyle) {
|
|
2651
|
-
if (existStyle[property]) {
|
|
2652
|
-
existStyle[property] = behaviourStyle[property];
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
};
|
|
2656
|
-
const handleUtilsCheckTypeTel = (val, prevVal) => {
|
|
2657
|
-
const phoneNumberRegex = /^\d{0,8}$/;
|
|
2658
|
-
if (val.length > 7) {
|
|
2659
|
-
val = val.substr(0, 8);
|
|
2660
|
-
}
|
|
2661
|
-
if (!phoneNumberRegex.test(val)) {
|
|
2662
|
-
val = prevVal;
|
|
2663
|
-
}
|
|
2664
|
-
return val;
|
|
2665
|
-
};
|
|
2666
|
-
const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
|
|
2667
|
-
if (maxLength && maxLength > 0) {
|
|
2668
|
-
if (val.length > maxLength) {
|
|
2669
|
-
val = val.substr(0, maxLength);
|
|
2670
|
-
}
|
|
2671
|
-
} else {
|
|
2672
|
-
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
|
|
2673
|
-
if (cardNumber) {
|
|
2674
|
-
if (val.length > 19 && !val.includes('.')) {
|
|
2675
|
-
val = val.substr(0, 19);
|
|
2676
|
-
}
|
|
2677
|
-
} else {
|
|
2678
|
-
if (val.length > 16 && !val.includes('.')) {
|
|
2679
|
-
val = val.substr(0, 16);
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
|
|
2683
|
-
val = val.substr(0, numberMaxLength);
|
|
2684
|
-
}
|
|
2685
|
-
const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
|
|
2686
|
-
const int = floatNumParts[0];
|
|
2687
|
-
const float = floatNumParts[1];
|
|
2688
|
-
if (floatToFix > 0) {
|
|
2689
|
-
if (float && float.length > 0) {
|
|
2690
|
-
let floatResult = '';
|
|
2691
|
-
[...float].map((item, index) => {
|
|
2692
|
-
if (index + 1 <= floatToFix) {
|
|
2693
|
-
floatResult += item;
|
|
2694
|
-
}
|
|
2695
|
-
});
|
|
2696
|
-
floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
|
|
2697
|
-
}
|
|
2698
|
-
} else {
|
|
2699
|
-
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2700
|
-
val = `${int}`;
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
if (!regNum.test(val)) {
|
|
2704
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2705
|
-
const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2706
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2707
|
-
});
|
|
2708
|
-
val = newStr;
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2712
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2713
|
-
const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2714
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2715
|
-
});
|
|
2716
|
-
val = newStr;
|
|
2717
|
-
}
|
|
2718
|
-
return val;
|
|
2719
|
-
};
|
|
2720
|
-
const handleUtilsOpenInNewTab = url => {
|
|
2721
|
-
const imageLink = document.createElement('a');
|
|
2722
|
-
imageLink.href = url, imageLink.target = '_blank';
|
|
2723
|
-
imageLink.click();
|
|
2724
|
-
};
|
|
2725
|
-
const handleRemoveLeadingZeros = str => {
|
|
2726
|
-
return str.replace(/^0+(\d)/, '$1');
|
|
2727
|
-
};
|
|
2728
|
-
|
|
2729
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%}";
|
|
2730
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"};
|
|
2731
2852
|
styleInject(css_248z$c);
|
|
@@ -2820,6 +2941,7 @@ const TD = ({
|
|
|
2820
2941
|
tBodyFontFamily,
|
|
2821
2942
|
tBodyFontWeight,
|
|
2822
2943
|
handleCheckDots,
|
|
2944
|
+
collapseFullRow,
|
|
2823
2945
|
openListFontSize,
|
|
2824
2946
|
borderRightColor,
|
|
2825
2947
|
openListFontStyle,
|
|
@@ -2834,6 +2956,11 @@ const TD = ({
|
|
|
2834
2956
|
handleCheckArrowAction,
|
|
2835
2957
|
handleOpenCloseRowSingleArrow
|
|
2836
2958
|
}) => {
|
|
2959
|
+
const [actionHover, setActionHover] = useState({
|
|
2960
|
+
id: '',
|
|
2961
|
+
type: '',
|
|
2962
|
+
index: -1
|
|
2963
|
+
});
|
|
2837
2964
|
const handleBodyAction = (e, data) => {
|
|
2838
2965
|
const actionData = {
|
|
2839
2966
|
index,
|
|
@@ -2873,6 +3000,24 @@ const TD = ({
|
|
|
2873
3000
|
contentListInnerItem
|
|
2874
3001
|
});
|
|
2875
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
|
+
};
|
|
2876
3021
|
return /*#__PURE__*/React__default.createElement("td", {
|
|
2877
3022
|
style: {
|
|
2878
3023
|
width: 'auto',
|
|
@@ -2907,8 +3052,10 @@ const TD = ({
|
|
|
2907
3052
|
type: newItem.type,
|
|
2908
3053
|
className: styles$a['td-span'],
|
|
2909
3054
|
key: `${newItem.id}_${newIndex}`,
|
|
2910
|
-
onClick: e => handleCheckActions(e, newItem, 'type', newIndex)
|
|
2911
|
-
|
|
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 : '');
|
|
2912
3059
|
} else if (newItem && Array.isArray(newItem)) {
|
|
2913
3060
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2914
3061
|
key: `${newItem.id}_${newIndex}`,
|
|
@@ -2928,9 +3075,11 @@ const TD = ({
|
|
|
2928
3075
|
id: iT.id ? iT.id : '',
|
|
2929
3076
|
type: iT.type ? iT.type : '',
|
|
2930
3077
|
className: styles$a['td-span'],
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
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 : '');
|
|
2934
3083
|
}));
|
|
2935
3084
|
} else {
|
|
2936
3085
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -2995,7 +3144,7 @@ const TD = ({
|
|
|
2995
3144
|
cursor: hasOwnerProperty(item, 'arrowComponent') || hasOwnerProperty(item, 'dots') ? 'pointer' : 'auto',
|
|
2996
3145
|
...item.props
|
|
2997
3146
|
},
|
|
2998
|
-
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) : _ => _
|
|
2999
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", {
|
|
3000
3149
|
style: {
|
|
3001
3150
|
display: 'block',
|
|
@@ -3042,7 +3191,7 @@ const TD = ({
|
|
|
3042
3191
|
},
|
|
3043
3192
|
title: optionItem.content
|
|
3044
3193
|
}, optionItem.content === 0 ? optionItem.content.toString() : optionItem.content ? optionItem.content : ''));
|
|
3045
|
-
}))) : ''), hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default.createElement("div", {
|
|
3194
|
+
}))) : ''), hasOwnerProperty(item, 'contentList') && !collapseFullRow && /*#__PURE__*/React__default.createElement("div", {
|
|
3046
3195
|
style: {
|
|
3047
3196
|
overflow: 'auto',
|
|
3048
3197
|
marginTop: '10px',
|
|
@@ -3203,7 +3352,12 @@ const Table = ({
|
|
|
3203
3352
|
draggableColor,
|
|
3204
3353
|
getDraggableData,
|
|
3205
3354
|
draggableItemBoxShadow,
|
|
3206
|
-
draggableItemBackgroundColor
|
|
3355
|
+
draggableItemBackgroundColor,
|
|
3356
|
+
tableBorder,
|
|
3357
|
+
tableBorderColor,
|
|
3358
|
+
collapseFullRow,
|
|
3359
|
+
openArrow,
|
|
3360
|
+
closeArrow
|
|
3207
3361
|
}) => {
|
|
3208
3362
|
const itemRefs = useRef({});
|
|
3209
3363
|
const headerRef = useRef(null);
|
|
@@ -3337,8 +3491,8 @@ const Table = ({
|
|
|
3337
3491
|
status: 'close',
|
|
3338
3492
|
checkIndex: null,
|
|
3339
3493
|
arrowComponent: true,
|
|
3340
|
-
openArrow: /*#__PURE__*/React__default.createElement(SvgUpArrow, null),
|
|
3341
|
-
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)
|
|
3342
3496
|
};
|
|
3343
3497
|
if (type === 'body') {
|
|
3344
3498
|
return data.map((item, index) => {
|
|
@@ -3502,6 +3656,49 @@ const Table = ({
|
|
|
3502
3656
|
prev[rowPosition] = checkedOpenableRow;
|
|
3503
3657
|
return [...prev];
|
|
3504
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
|
+
}
|
|
3505
3702
|
};
|
|
3506
3703
|
const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
|
|
3507
3704
|
let single = {};
|
|
@@ -3542,6 +3739,7 @@ const Table = ({
|
|
|
3542
3739
|
};
|
|
3543
3740
|
const handleCheckArrowActionHeader = (e, item) => {
|
|
3544
3741
|
e.stopPropagation();
|
|
3742
|
+
let mergedArray = [];
|
|
3545
3743
|
const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
|
|
3546
3744
|
if (item.checkIndex === (draggable && !showOrder ? innerIndex - 1 : draggable && showOrder ? innerIndex - 2 : innerIndex)) {
|
|
3547
3745
|
if (item.status === 'close') {
|
|
@@ -3564,8 +3762,52 @@ const Table = ({
|
|
|
3564
3762
|
return iElem;
|
|
3565
3763
|
});
|
|
3566
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
|
+
}
|
|
3567
3809
|
setHeader(() => checkedOpenableAllRows);
|
|
3568
|
-
setBody(() => checkedOpenableAllRowsBody);
|
|
3810
|
+
setBody(() => !collapseFullRow ? checkedOpenableAllRowsBody : mergedArray);
|
|
3569
3811
|
};
|
|
3570
3812
|
const handleCheckDots = (e, item, index, innerIndex) => {
|
|
3571
3813
|
e.stopPropagation();
|
|
@@ -3834,8 +4076,11 @@ const Table = ({
|
|
|
3834
4076
|
return configStyles.TABLE && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("table", {
|
|
3835
4077
|
style: {
|
|
3836
4078
|
width: '100%',
|
|
3837
|
-
|
|
3838
|
-
|
|
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'
|
|
3839
4084
|
},
|
|
3840
4085
|
onClick: handleTableClick,
|
|
3841
4086
|
className: classProps
|
|
@@ -3845,7 +4090,7 @@ const Table = ({
|
|
|
3845
4090
|
style: {
|
|
3846
4091
|
color: tHeadColor ?? configStyles.TABLE.head.color,
|
|
3847
4092
|
backgroundColor: tHeadBackgroundColor ?? configStyles.TABLE.head.colors.background,
|
|
3848
|
-
borderColor: hideBorder ? 'transparent' :
|
|
4093
|
+
borderColor: hideBorder ? 'transparent' : tableBorderColor ?? configStyles.TABLE.borderColor
|
|
3849
4094
|
}
|
|
3850
4095
|
}, header.map((item, index) => {
|
|
3851
4096
|
return /*#__PURE__*/React__default.createElement(TH, {
|
|
@@ -3922,7 +4167,8 @@ const Table = ({
|
|
|
3922
4167
|
borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.body.row.border,
|
|
3923
4168
|
borderRightColor: innerIndex === Object.values(item).length - 1 ? 'transparent' : configStyles.TABLE.body.row.borderColor,
|
|
3924
4169
|
handleCheckArrowAction: handleCheckArrowAction,
|
|
3925
|
-
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
|
|
4170
|
+
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow,
|
|
4171
|
+
collapseFullRow: collapseFullRow
|
|
3926
4172
|
});
|
|
3927
4173
|
}));
|
|
3928
4174
|
})) : '', body && body.length > 0 && draggable && dragging && draggedItem && /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
@@ -4014,7 +4260,12 @@ Table.propTypes = {
|
|
|
4014
4260
|
openListFontStyle: PropTypes.string,
|
|
4015
4261
|
openListFontWeight: PropTypes.string,
|
|
4016
4262
|
openListFontFamily: PropTypes.string,
|
|
4017
|
-
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
|
|
4018
4269
|
};
|
|
4019
4270
|
|
|
4020
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)}}";
|
|
@@ -4614,6 +4865,7 @@ const TelInput = ({
|
|
|
4614
4865
|
disabled: disabled,
|
|
4615
4866
|
onInput: handleChange,
|
|
4616
4867
|
name: inpAttributes?.iName,
|
|
4868
|
+
className: "tui-color-placeholder",
|
|
4617
4869
|
placeholder: inpAttributes?.placeholder,
|
|
4618
4870
|
autoComplete: inpAttributes?.autoComplete,
|
|
4619
4871
|
style: {
|
|
@@ -4666,6 +4918,7 @@ const TextInput = ({
|
|
|
4666
4918
|
disabled: disabled,
|
|
4667
4919
|
onInput: handleChange,
|
|
4668
4920
|
name: inpAttributes?.iName,
|
|
4921
|
+
className: "tui-color-placeholder",
|
|
4669
4922
|
placeholder: inpAttributes?.placeholder,
|
|
4670
4923
|
autoComplete: inpAttributes?.autoComplete,
|
|
4671
4924
|
style: {
|
|
@@ -4724,6 +4977,7 @@ const PassInput = ({
|
|
|
4724
4977
|
disabled: disabled,
|
|
4725
4978
|
onInput: handleChange,
|
|
4726
4979
|
name: inpAttributes?.iName,
|
|
4980
|
+
className: "tui-color-placeholder",
|
|
4727
4981
|
placeholder: inpAttributes?.placeholder,
|
|
4728
4982
|
autoComplete: inpAttributes?.autoComplete,
|
|
4729
4983
|
style: {
|
|
@@ -4766,7 +5020,11 @@ const NumberInput = ({
|
|
|
4766
5020
|
currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
|
|
4767
5021
|
if (cardNumber) {
|
|
4768
5022
|
let digits = currentValue.replace(/\D/g, '');
|
|
4769
|
-
|
|
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
|
+
}
|
|
4770
5028
|
} else {
|
|
4771
5029
|
setInnerValue(() => currentValue);
|
|
4772
5030
|
}
|
|
@@ -4844,7 +5102,11 @@ const NumberInput = ({
|
|
|
4844
5102
|
}
|
|
4845
5103
|
if (cardNumber) {
|
|
4846
5104
|
let digits = newValue.replace(/\D/g, '');
|
|
4847
|
-
|
|
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
|
+
}
|
|
4848
5110
|
} else {
|
|
4849
5111
|
setInnerValue(() => newValue);
|
|
4850
5112
|
}
|
|
@@ -4855,6 +5117,7 @@ const NumberInput = ({
|
|
|
4855
5117
|
value: innerValue,
|
|
4856
5118
|
disabled: disabled,
|
|
4857
5119
|
name: inpAttributes?.iName,
|
|
5120
|
+
className: "tui-color-placeholder",
|
|
4858
5121
|
placeholder: inpAttributes?.placeholder,
|
|
4859
5122
|
autoComplete: inpAttributes?.autoComplete,
|
|
4860
5123
|
style: {
|
|
@@ -4960,6 +5223,7 @@ const Input = ({
|
|
|
4960
5223
|
numberMaxLength,
|
|
4961
5224
|
backgroundColor,
|
|
4962
5225
|
errorIconMargin,
|
|
5226
|
+
placeholderColor,
|
|
4963
5227
|
withZero = false,
|
|
4964
5228
|
labelMarginBottom,
|
|
4965
5229
|
regexpErrorMessage,
|
|
@@ -5074,7 +5338,9 @@ const Input = ({
|
|
|
5074
5338
|
}, []);
|
|
5075
5339
|
return configStyles.INPUT && /*#__PURE__*/React__default.createElement("div", {
|
|
5076
5340
|
className: classProps
|
|
5077
|
-
},
|
|
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", {
|
|
5078
5344
|
style: {
|
|
5079
5345
|
maxWidth: '100%',
|
|
5080
5346
|
color: labelColor ?? configStyles.INPUT.label.color,
|
|
@@ -5302,6 +5568,7 @@ Input.propTypes = {
|
|
|
5302
5568
|
labelMarginBottom: PropTypes.string,
|
|
5303
5569
|
borderRight: PropTypes.string,
|
|
5304
5570
|
placeholder: PropTypes.string,
|
|
5571
|
+
placeholderColor: PropTypes.string,
|
|
5305
5572
|
phoneDisplay: PropTypes.string,
|
|
5306
5573
|
autoComplete: PropTypes.string,
|
|
5307
5574
|
errorDots: PropTypes.bool,
|
|
@@ -6853,7 +7120,7 @@ const Stepper = ({
|
|
|
6853
7120
|
}, (() => {
|
|
6854
7121
|
let steppers = [];
|
|
6855
7122
|
for (let step = 1; step <= stepLength; step++) {
|
|
6856
|
-
steppers.push(
|
|
7123
|
+
steppers.push(/*#__PURE__*/React__default.createElement("div", {
|
|
6857
7124
|
className: classnames(`${step <= activeSteps ? styles$3.activeRing : styles$3.bigRing}`),
|
|
6858
7125
|
key: step
|
|
6859
7126
|
}, /*#__PURE__*/React__default.createElement("div", {
|