@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.js
CHANGED
|
@@ -595,6 +595,7 @@ var packageResult = {
|
|
|
595
595
|
shadowHover: `0 0 0 2px ${presetColors.dark}` // like border
|
|
596
596
|
},
|
|
597
597
|
colors: {
|
|
598
|
+
placeholder: 'gray',
|
|
598
599
|
background: 'white',
|
|
599
600
|
backgroundDisable: presetColors.secondary
|
|
600
601
|
},
|
|
@@ -1048,6 +1049,15 @@ var packageResult = {
|
|
|
1048
1049
|
color: '#4A4A4D',
|
|
1049
1050
|
font: {
|
|
1050
1051
|
...fontObject
|
|
1052
|
+
},
|
|
1053
|
+
tooltip: {
|
|
1054
|
+
color: '#fff',
|
|
1055
|
+
padding: '12px',
|
|
1056
|
+
borderRadius: '8px',
|
|
1057
|
+
font: {
|
|
1058
|
+
...fontObject
|
|
1059
|
+
},
|
|
1060
|
+
backgroundColor: '#000'
|
|
1051
1061
|
}
|
|
1052
1062
|
},
|
|
1053
1063
|
font: {
|
|
@@ -1225,6 +1235,8 @@ var packageResult = {
|
|
|
1225
1235
|
TABLE: {
|
|
1226
1236
|
className: '',
|
|
1227
1237
|
textAlign: 'center',
|
|
1238
|
+
border: '1px solid',
|
|
1239
|
+
borderColor: 'transparent',
|
|
1228
1240
|
column: {
|
|
1229
1241
|
maxWidth: '',
|
|
1230
1242
|
minWidth: ''
|
|
@@ -1429,7 +1441,7 @@ async function getPProps() {
|
|
|
1429
1441
|
const projectPath = `../../../../tui.config.js`;
|
|
1430
1442
|
async function loadComponent(componentName) {
|
|
1431
1443
|
try {
|
|
1432
|
-
const Component = await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(
|
|
1444
|
+
const Component = await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(/* @vite-ignore */componentName);
|
|
1433
1445
|
return Component.default;
|
|
1434
1446
|
} catch (err) {
|
|
1435
1447
|
console.error(`Error loading component: ${componentName}`);
|
|
@@ -1738,8 +1750,8 @@ function styleInject(css, ref) {
|
|
|
1738
1750
|
}
|
|
1739
1751
|
}
|
|
1740
1752
|
|
|
1741
|
-
var css_248z$d = ".file-module_small-file-component__nlpcW>svg{max-height:77%!important}";
|
|
1742
|
-
var styles$b = {"small-file-component":"file-module_small-file-component__nlpcW"};
|
|
1753
|
+
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}";
|
|
1754
|
+
var styles$b = {"small-file-component":"file-module_small-file-component__nlpcW","file-label":"file-module_file-label__uscgT","tooltip":"file-module_tooltip__FjCUU"};
|
|
1743
1755
|
styleInject(css_248z$d);
|
|
1744
1756
|
|
|
1745
1757
|
// eslint-disable-next-line react/display-name
|
|
@@ -1772,6 +1784,14 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
1772
1784
|
labelStyle,
|
|
1773
1785
|
labelWeight,
|
|
1774
1786
|
labelFamily,
|
|
1787
|
+
labelTooltipColor,
|
|
1788
|
+
labelTooltipPadding,
|
|
1789
|
+
labelTooltipFontSize,
|
|
1790
|
+
labelTooltipFontStyle,
|
|
1791
|
+
labelTooltipFontFamily,
|
|
1792
|
+
labelTooltipFontWeight,
|
|
1793
|
+
labelTooltipBorderRadius,
|
|
1794
|
+
labelTooltipBackgroundColor,
|
|
1775
1795
|
removeFile,
|
|
1776
1796
|
labelColor,
|
|
1777
1797
|
errorColor,
|
|
@@ -1781,6 +1801,8 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
1781
1801
|
uploadColor,
|
|
1782
1802
|
defaultData,
|
|
1783
1803
|
formatError,
|
|
1804
|
+
errorIcon,
|
|
1805
|
+
errorIconShow,
|
|
1784
1806
|
errorMessage,
|
|
1785
1807
|
fileSizeText,
|
|
1786
1808
|
maxSizeError,
|
|
@@ -1837,6 +1859,7 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
1837
1859
|
listItemBackgroundColor,
|
|
1838
1860
|
listItemBackgroundErrorColor,
|
|
1839
1861
|
maxCHoosenLengthErrorHideTime,
|
|
1862
|
+
textAlignLeftInSmallComponent,
|
|
1840
1863
|
showPreviewIconInSmallComponent,
|
|
1841
1864
|
maxSize = 10,
|
|
1842
1865
|
preview = true,
|
|
@@ -1844,12 +1867,14 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
1844
1867
|
fileExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
1845
1868
|
}, ref) => {
|
|
1846
1869
|
const inpRef = React.useRef(null);
|
|
1870
|
+
const labelRef = React.useRef(null);
|
|
1847
1871
|
const memoizedItems = React.useMemo(() => filesArray, [filesArray]);
|
|
1848
1872
|
const [error, setError] = React.useState('');
|
|
1849
1873
|
const [isHover, setIsHover] = React.useState(false);
|
|
1850
1874
|
const [classProps, setClassProps] = React.useState({});
|
|
1851
1875
|
const [singleFile, setSingleFile] = React.useState(null);
|
|
1852
1876
|
const [configStyles, setConfigStyles] = React.useState({});
|
|
1877
|
+
const [tooltipElem, setTooltipElem] = React.useState(null);
|
|
1853
1878
|
const [choosenFileCount, setChoosenFileCount] = React.useState(0);
|
|
1854
1879
|
const [image, setImage] = React.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);
|
|
1855
1880
|
const handleCheckHeicFormat = async file => {
|
|
@@ -2114,6 +2139,71 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
2114
2139
|
const handleStopPropagation = e => {
|
|
2115
2140
|
e.stopPropagation();
|
|
2116
2141
|
};
|
|
2142
|
+
const getRenderedTextWidth = element => {
|
|
2143
|
+
const clone = element.cloneNode(true);
|
|
2144
|
+
clone.style.width = 'fit-content';
|
|
2145
|
+
document.body.appendChild(clone);
|
|
2146
|
+
const width = clone.offsetWidth;
|
|
2147
|
+
document.body.removeChild(clone);
|
|
2148
|
+
return width;
|
|
2149
|
+
};
|
|
2150
|
+
const handleLabelMouseEnter = event => {
|
|
2151
|
+
if (labelRef.current) {
|
|
2152
|
+
const rect = labelRef.current.getBoundingClientRect();
|
|
2153
|
+
const top = rect.top;
|
|
2154
|
+
const left = rect.left;
|
|
2155
|
+
const height = rect.height;
|
|
2156
|
+
const elementWidth = rect.width;
|
|
2157
|
+
const x = event.clientX - rect.left;
|
|
2158
|
+
const textWidth = getRenderedTextWidth(labelRef.current);
|
|
2159
|
+
console.log(textWidth, ' - - - - textWidth');
|
|
2160
|
+
console.log(elementWidth, ' - - - - elementWidth');
|
|
2161
|
+
if (textWidth > elementWidth) {
|
|
2162
|
+
const newTooltipElem = document.createElement('div');
|
|
2163
|
+
const newTootltipTextElem = document.createElement('p');
|
|
2164
|
+
const newTooltipChildElem = document.createElement('div');
|
|
2165
|
+
const newTooltipDecorElem = document.createElement('div');
|
|
2166
|
+
newTooltipElem.style.position = 'fixed';
|
|
2167
|
+
newTooltipElem.style.left = left + 'px';
|
|
2168
|
+
newTooltipElem.style.paddingTop = '20px';
|
|
2169
|
+
newTooltipElem.style.height = 'fit-content';
|
|
2170
|
+
newTooltipElem.style.boxSizing = 'border-box';
|
|
2171
|
+
newTooltipElem.style.top = top + height + 'px';
|
|
2172
|
+
newTooltipElem.style.width = elementWidth + 'px';
|
|
2173
|
+
newTooltipChildElem.style.width = '100%';
|
|
2174
|
+
newTooltipChildElem.style.position = 'relative';
|
|
2175
|
+
newTooltipChildElem.style.height = 'fit-content';
|
|
2176
|
+
newTooltipChildElem.style.boxSizing = 'border-box';
|
|
2177
|
+
newTooltipChildElem.style.padding = labelTooltipPadding ?? configStyles.FILE.label.tooltip.padding;
|
|
2178
|
+
newTooltipChildElem.style.borderRadius = labelTooltipBorderRadius ?? configStyles.FILE.label.tooltip.borderRadius;
|
|
2179
|
+
newTooltipChildElem.style.backgroundColor = labelTooltipBackgroundColor ?? configStyles.FILE.label.tooltip.backgroundColor;
|
|
2180
|
+
newTooltipDecorElem.style.zIndex = -1;
|
|
2181
|
+
newTooltipDecorElem.style.top = '-8px';
|
|
2182
|
+
newTooltipDecorElem.style.width = '18px';
|
|
2183
|
+
newTooltipDecorElem.style.height = '18px';
|
|
2184
|
+
newTooltipDecorElem.style.rotate = '45deg';
|
|
2185
|
+
newTooltipDecorElem.style.position = 'absolute';
|
|
2186
|
+
newTooltipDecorElem.style.left = x > elementWidth / 2 ? 'calc(100% - 30px)' : '13px';
|
|
2187
|
+
newTooltipDecorElem.style.backgroundColor = labelTooltipBackgroundColor ?? configStyles.FILE.label.tooltip.backgroundColor;
|
|
2188
|
+
newTootltipTextElem.innerText = label;
|
|
2189
|
+
newTootltipTextElem.style.color = labelTooltipColor ?? configStyles.FILE.label.tooltip.color;
|
|
2190
|
+
newTootltipTextElem.style.fontSize = labelTooltipFontSize ?? configStyles.FILE.label.tooltip.font.size;
|
|
2191
|
+
newTootltipTextElem.style.fontStyle = labelTooltipFontStyle ?? configStyles.FILE.label.tooltip.font.style;
|
|
2192
|
+
newTootltipTextElem.style.fontFamily = labelTooltipFontFamily ?? configStyles.FILE.label.tooltip.font.family;
|
|
2193
|
+
newTootltipTextElem.style.fontWeight = labelTooltipFontWeight ?? configStyles.FILE.label.tooltip.font.weight;
|
|
2194
|
+
document.body.appendChild(newTooltipElem);
|
|
2195
|
+
newTooltipElem.appendChild(newTooltipChildElem);
|
|
2196
|
+
newTooltipChildElem.appendChild(newTooltipDecorElem);
|
|
2197
|
+
newTooltipChildElem.appendChild(newTootltipTextElem);
|
|
2198
|
+
setTooltipElem(() => newTooltipElem);
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
};
|
|
2202
|
+
const handleLabelMouseLeave = () => {
|
|
2203
|
+
if (tooltipElem) {
|
|
2204
|
+
document.body.removeChild(tooltipElem);
|
|
2205
|
+
}
|
|
2206
|
+
};
|
|
2117
2207
|
React.useImperativeHandle(ref, () => ({
|
|
2118
2208
|
handleReset() {
|
|
2119
2209
|
setError('');
|
|
@@ -2180,6 +2270,11 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
2180
2270
|
}, error => {
|
|
2181
2271
|
console.error(error);
|
|
2182
2272
|
});
|
|
2273
|
+
return () => {
|
|
2274
|
+
if (tooltipElem) {
|
|
2275
|
+
document.body.removeChild(tooltipElem);
|
|
2276
|
+
}
|
|
2277
|
+
};
|
|
2183
2278
|
}, []);
|
|
2184
2279
|
return configStyles.FILE && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2185
2280
|
style: {
|
|
@@ -2194,15 +2289,28 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
2194
2289
|
alignItems: 'center',
|
|
2195
2290
|
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2196
2291
|
}
|
|
2197
|
-
}, label && /*#__PURE__*/React__default["default"].createElement("
|
|
2292
|
+
}, label && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2198
2293
|
style: {
|
|
2294
|
+
display: 'flex',
|
|
2295
|
+
maxWidth: '100%',
|
|
2296
|
+
width: 'fit-content',
|
|
2297
|
+
columnGap: '4px',
|
|
2298
|
+
justifyContent: 'flex-start'
|
|
2299
|
+
}
|
|
2300
|
+
}, /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2301
|
+
ref: labelRef,
|
|
2302
|
+
className: styles$b['file-label'],
|
|
2303
|
+
style: {
|
|
2304
|
+
width: '100%',
|
|
2199
2305
|
color: labelColor ?? configStyles.FILE.label.color,
|
|
2200
2306
|
fontSize: labelSize ?? configStyles.FILE.label.font.size,
|
|
2201
2307
|
fontStyle: labelStyle ?? configStyles.FILE.label.font.style,
|
|
2202
2308
|
fontWeight: labelWeight ?? configStyles.FILE.label.font.weight,
|
|
2203
2309
|
fontFamily: labelFamily ?? configStyles.FILE.label.font.family
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2310
|
+
},
|
|
2311
|
+
onMouseEnter: handleLabelMouseEnter,
|
|
2312
|
+
onMouseLeave: handleLabelMouseLeave
|
|
2313
|
+
}, label), required && /*#__PURE__*/React__default["default"].createElement("sup", null, iconRequired ? iconRequired : configStyles.FILE.icon.required ? configStyles.FILE.icon.required : /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))), deleteComponent && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2206
2314
|
style: {
|
|
2207
2315
|
cursor: 'pointer'
|
|
2208
2316
|
},
|
|
@@ -2287,7 +2395,7 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
2287
2395
|
display: 'flex',
|
|
2288
2396
|
alignItems: 'center',
|
|
2289
2397
|
boxSizing: 'border-box',
|
|
2290
|
-
justifyContent: 'space-between'
|
|
2398
|
+
justifyContent: textAlignLeftInSmallComponent ? 'flex-start' : 'space-between'
|
|
2291
2399
|
}
|
|
2292
2400
|
}, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
2293
2401
|
contentWidth: true,
|
|
@@ -2349,14 +2457,16 @@ const File = /*#__PURE__*/React.forwardRef(({
|
|
|
2349
2457
|
}, iconRemoveFile ? iconRemoveFile : configStyles.FILE.icon.removeFile ? configStyles.FILE.icon.removeFile : /*#__PURE__*/React__default["default"].createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2350
2458
|
style: {
|
|
2351
2459
|
marginTop: '6px',
|
|
2352
|
-
display: 'inline-block',
|
|
2353
2460
|
color: errorColor ?? configStyles.FILE.error.color,
|
|
2354
2461
|
fontSize: errorSize ?? configStyles.FILE.error.font.size,
|
|
2355
2462
|
fontStyle: errorStyle ?? configStyles.FILE.error.font.style,
|
|
2356
2463
|
fontWeight: errorWeight ?? configStyles.FILE.error.font.weight,
|
|
2357
|
-
fontFamily: errorFamily ?? configStyles.FILE.error.font.family
|
|
2464
|
+
fontFamily: errorFamily ?? configStyles.FILE.error.font.family,
|
|
2465
|
+
alignItems: 'center',
|
|
2466
|
+
columnGap: '5px',
|
|
2467
|
+
display: errorIconShow && (errorIcon || configStyles.FILE.error?.icon) ? 'inline-flex' : 'inline-block'
|
|
2358
2468
|
}
|
|
2359
|
-
}, error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2469
|
+
}, errorIconShow ? errorIcon ? errorIcon : configStyles.FILE.error?.icon ? configStyles.FILE.error?.icon : '' : '', error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2360
2470
|
return /*#__PURE__*/React__default["default"].createElement(FileItem, {
|
|
2361
2471
|
key: item.uuid,
|
|
2362
2472
|
uuid: item.uuid,
|
|
@@ -2428,6 +2538,14 @@ File.propTypes = {
|
|
|
2428
2538
|
labelWeight: PropTypes__default["default"].string,
|
|
2429
2539
|
labelFamily: PropTypes__default["default"].string,
|
|
2430
2540
|
labelColor: PropTypes__default["default"].string,
|
|
2541
|
+
labelTooltipColor: PropTypes__default["default"].string,
|
|
2542
|
+
labelTooltipPadding: PropTypes__default["default"].string,
|
|
2543
|
+
labelTooltipFontSize: PropTypes__default["default"].string,
|
|
2544
|
+
labelTooltipFontStyle: PropTypes__default["default"].string,
|
|
2545
|
+
labelTooltipFontFamily: PropTypes__default["default"].string,
|
|
2546
|
+
labelTooltipFontWeight: PropTypes__default["default"].string,
|
|
2547
|
+
labelTooltipBorderRadius: PropTypes__default["default"].string,
|
|
2548
|
+
labelTooltipBackgroundColor: PropTypes__default["default"].string,
|
|
2431
2549
|
errorColor: PropTypes__default["default"].string,
|
|
2432
2550
|
formatError: PropTypes__default["default"].string,
|
|
2433
2551
|
putFileHere: PropTypes__default["default"].string,
|
|
@@ -2435,6 +2553,8 @@ File.propTypes = {
|
|
|
2435
2553
|
defaultData: PropTypes__default["default"].object,
|
|
2436
2554
|
componentId: PropTypes__default["default"].number,
|
|
2437
2555
|
maxSizeError: PropTypes__default["default"].string,
|
|
2556
|
+
errorIcon: PropTypes__default["default"].element,
|
|
2557
|
+
errorIconShow: PropTypes__default["default"].bool,
|
|
2438
2558
|
errorMessage: PropTypes__default["default"].string,
|
|
2439
2559
|
fileSizeText: PropTypes__default["default"].string,
|
|
2440
2560
|
noChoosenFile: PropTypes__default["default"].string,
|
|
@@ -2492,10 +2612,107 @@ File.propTypes = {
|
|
|
2492
2612
|
listItemBackgroundErrorColor: PropTypes__default["default"].string,
|
|
2493
2613
|
maxCHoosenLengthErrorHideTime: PropTypes__default["default"].number,
|
|
2494
2614
|
filesArray: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
2615
|
+
textAlignLeftInSmallComponent: PropTypes__default["default"].bool,
|
|
2495
2616
|
showPreviewIconInSmallComponent: PropTypes__default["default"].bool,
|
|
2496
2617
|
fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
|
2497
2618
|
};
|
|
2498
2619
|
|
|
2620
|
+
const hasOwnerProperty = (object, property) => {
|
|
2621
|
+
return Object.prototype.hasOwnProperty.call(object, property);
|
|
2622
|
+
};
|
|
2623
|
+
const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
|
|
2624
|
+
if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
|
|
2625
|
+
alert('Please set a second param of handleUtilsMouseEnter function as valid object');
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
if (!hasOwnerProperty(e, 'target')) {
|
|
2629
|
+
alert('Please set a valid object like DOM event');
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
const existStyle = e.target.style;
|
|
2633
|
+
if (typeof existStyle !== 'object' || existStyle === null) {
|
|
2634
|
+
alert('Please set a valid style object in DOM event tergat');
|
|
2635
|
+
return;
|
|
2636
|
+
}
|
|
2637
|
+
for (const property in behaviourStyle) {
|
|
2638
|
+
if (existStyle[property]) {
|
|
2639
|
+
existStyle[property] = behaviourStyle[property];
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
};
|
|
2643
|
+
const handleUtilsCheckTypeTel = (val, prevVal) => {
|
|
2644
|
+
const phoneNumberRegex = /^\d{0,8}$/;
|
|
2645
|
+
if (val.length > 7) {
|
|
2646
|
+
val = val.substr(0, 8);
|
|
2647
|
+
}
|
|
2648
|
+
if (!phoneNumberRegex.test(val)) {
|
|
2649
|
+
val = prevVal;
|
|
2650
|
+
}
|
|
2651
|
+
return val;
|
|
2652
|
+
};
|
|
2653
|
+
const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
|
|
2654
|
+
if (maxLength && maxLength > 0) {
|
|
2655
|
+
if (val.length > maxLength) {
|
|
2656
|
+
val = val.substr(0, maxLength);
|
|
2657
|
+
}
|
|
2658
|
+
} else {
|
|
2659
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
|
|
2660
|
+
if (cardNumber) {
|
|
2661
|
+
if (val.length > 19 && !val.includes('.')) {
|
|
2662
|
+
val = val.substr(0, 19);
|
|
2663
|
+
}
|
|
2664
|
+
} else {
|
|
2665
|
+
if (val.length > 16 && !val.includes('.')) {
|
|
2666
|
+
val = val.substr(0, 16);
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
|
|
2670
|
+
val = val.substr(0, numberMaxLength);
|
|
2671
|
+
}
|
|
2672
|
+
const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
|
|
2673
|
+
const int = floatNumParts[0];
|
|
2674
|
+
const float = floatNumParts[1];
|
|
2675
|
+
if (floatToFix > 0) {
|
|
2676
|
+
if (float && float.length > 0) {
|
|
2677
|
+
let floatResult = '';
|
|
2678
|
+
[...float].map((item, index) => {
|
|
2679
|
+
if (index + 1 <= floatToFix) {
|
|
2680
|
+
floatResult += item;
|
|
2681
|
+
}
|
|
2682
|
+
});
|
|
2683
|
+
floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
|
|
2684
|
+
}
|
|
2685
|
+
} else {
|
|
2686
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2687
|
+
val = `${int}`;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
if (!regNum.test(val)) {
|
|
2691
|
+
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2692
|
+
const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2693
|
+
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2694
|
+
});
|
|
2695
|
+
val = newStr;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2699
|
+
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2700
|
+
const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2701
|
+
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2702
|
+
});
|
|
2703
|
+
val = newStr;
|
|
2704
|
+
}
|
|
2705
|
+
return val;
|
|
2706
|
+
};
|
|
2707
|
+
const handleUtilsOpenInNewTab = url => {
|
|
2708
|
+
const imageLink = document.createElement('a');
|
|
2709
|
+
imageLink.href = url, imageLink.target = '_blank';
|
|
2710
|
+
imageLink.click();
|
|
2711
|
+
};
|
|
2712
|
+
const handleRemoveLeadingZeros = str => {
|
|
2713
|
+
return str.replace(/^0+(\d)/, '$1');
|
|
2714
|
+
};
|
|
2715
|
+
|
|
2499
2716
|
const SvgCheckboxUnchecked = ({
|
|
2500
2717
|
title,
|
|
2501
2718
|
titleId,
|
|
@@ -2661,102 +2878,6 @@ SingleCheckbox.propTypes = {
|
|
|
2661
2878
|
ignoreDisabledForChecked: PropTypes__default["default"].bool
|
|
2662
2879
|
};
|
|
2663
2880
|
|
|
2664
|
-
const hasOwnerProperty = (object, property) => {
|
|
2665
|
-
return Object.prototype.hasOwnProperty.call(object, property);
|
|
2666
|
-
};
|
|
2667
|
-
const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
|
|
2668
|
-
if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
|
|
2669
|
-
alert('Please set a second param of handleUtilsMouseEnter function as valid object');
|
|
2670
|
-
return;
|
|
2671
|
-
}
|
|
2672
|
-
if (!hasOwnerProperty(e, 'target')) {
|
|
2673
|
-
alert('Please set a valid object like DOM event');
|
|
2674
|
-
return;
|
|
2675
|
-
}
|
|
2676
|
-
const existStyle = e.target.style;
|
|
2677
|
-
if (typeof existStyle !== 'object' || existStyle === null) {
|
|
2678
|
-
alert('Please set a valid style object in DOM event tergat');
|
|
2679
|
-
return;
|
|
2680
|
-
}
|
|
2681
|
-
for (const property in behaviourStyle) {
|
|
2682
|
-
if (existStyle[property]) {
|
|
2683
|
-
existStyle[property] = behaviourStyle[property];
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
};
|
|
2687
|
-
const handleUtilsCheckTypeTel = (val, prevVal) => {
|
|
2688
|
-
const phoneNumberRegex = /^\d{0,8}$/;
|
|
2689
|
-
if (val.length > 7) {
|
|
2690
|
-
val = val.substr(0, 8);
|
|
2691
|
-
}
|
|
2692
|
-
if (!phoneNumberRegex.test(val)) {
|
|
2693
|
-
val = prevVal;
|
|
2694
|
-
}
|
|
2695
|
-
return val;
|
|
2696
|
-
};
|
|
2697
|
-
const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
|
|
2698
|
-
if (maxLength && maxLength > 0) {
|
|
2699
|
-
if (val.length > maxLength) {
|
|
2700
|
-
val = val.substr(0, maxLength);
|
|
2701
|
-
}
|
|
2702
|
-
} else {
|
|
2703
|
-
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
|
|
2704
|
-
if (cardNumber) {
|
|
2705
|
-
if (val.length > 19 && !val.includes('.')) {
|
|
2706
|
-
val = val.substr(0, 19);
|
|
2707
|
-
}
|
|
2708
|
-
} else {
|
|
2709
|
-
if (val.length > 16 && !val.includes('.')) {
|
|
2710
|
-
val = val.substr(0, 16);
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
|
|
2714
|
-
val = val.substr(0, numberMaxLength);
|
|
2715
|
-
}
|
|
2716
|
-
const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
|
|
2717
|
-
const int = floatNumParts[0];
|
|
2718
|
-
const float = floatNumParts[1];
|
|
2719
|
-
if (floatToFix > 0) {
|
|
2720
|
-
if (float && float.length > 0) {
|
|
2721
|
-
let floatResult = '';
|
|
2722
|
-
[...float].map((item, index) => {
|
|
2723
|
-
if (index + 1 <= floatToFix) {
|
|
2724
|
-
floatResult += item;
|
|
2725
|
-
}
|
|
2726
|
-
});
|
|
2727
|
-
floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
|
|
2728
|
-
}
|
|
2729
|
-
} else {
|
|
2730
|
-
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2731
|
-
val = `${int}`;
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
if (!regNum.test(val)) {
|
|
2735
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2736
|
-
const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2737
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2738
|
-
});
|
|
2739
|
-
val = newStr;
|
|
2740
|
-
}
|
|
2741
|
-
}
|
|
2742
|
-
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2743
|
-
let newVal = typeof val === 'number' ? val.toString() : val;
|
|
2744
|
-
const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
|
|
2745
|
-
return b + c.replace(/\.|\․|\.|\,/g, '');
|
|
2746
|
-
});
|
|
2747
|
-
val = newStr;
|
|
2748
|
-
}
|
|
2749
|
-
return val;
|
|
2750
|
-
};
|
|
2751
|
-
const handleUtilsOpenInNewTab = url => {
|
|
2752
|
-
const imageLink = document.createElement('a');
|
|
2753
|
-
imageLink.href = url, imageLink.target = '_blank';
|
|
2754
|
-
imageLink.click();
|
|
2755
|
-
};
|
|
2756
|
-
const handleRemoveLeadingZeros = str => {
|
|
2757
|
-
return str.replace(/^0+(\d)/, '$1');
|
|
2758
|
-
};
|
|
2759
|
-
|
|
2760
2881
|
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%}";
|
|
2761
2882
|
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"};
|
|
2762
2883
|
styleInject(css_248z$c);
|
|
@@ -2851,6 +2972,7 @@ const TD = ({
|
|
|
2851
2972
|
tBodyFontFamily,
|
|
2852
2973
|
tBodyFontWeight,
|
|
2853
2974
|
handleCheckDots,
|
|
2975
|
+
collapseFullRow,
|
|
2854
2976
|
openListFontSize,
|
|
2855
2977
|
borderRightColor,
|
|
2856
2978
|
openListFontStyle,
|
|
@@ -2865,6 +2987,11 @@ const TD = ({
|
|
|
2865
2987
|
handleCheckArrowAction,
|
|
2866
2988
|
handleOpenCloseRowSingleArrow
|
|
2867
2989
|
}) => {
|
|
2990
|
+
const [actionHover, setActionHover] = React.useState({
|
|
2991
|
+
id: '',
|
|
2992
|
+
type: '',
|
|
2993
|
+
index: -1
|
|
2994
|
+
});
|
|
2868
2995
|
const handleBodyAction = (e, data) => {
|
|
2869
2996
|
const actionData = {
|
|
2870
2997
|
index,
|
|
@@ -2904,6 +3031,24 @@ const TD = ({
|
|
|
2904
3031
|
contentListInnerItem
|
|
2905
3032
|
});
|
|
2906
3033
|
};
|
|
3034
|
+
const handleMouseEnter = (item, index) => {
|
|
3035
|
+
setActionHover(() => {
|
|
3036
|
+
return {
|
|
3037
|
+
id: item.id,
|
|
3038
|
+
type: item.type,
|
|
3039
|
+
index
|
|
3040
|
+
};
|
|
3041
|
+
});
|
|
3042
|
+
};
|
|
3043
|
+
const handleMouseLeave = () => {
|
|
3044
|
+
setActionHover(() => {
|
|
3045
|
+
return {
|
|
3046
|
+
id: '',
|
|
3047
|
+
type: '',
|
|
3048
|
+
index: -1
|
|
3049
|
+
};
|
|
3050
|
+
});
|
|
3051
|
+
};
|
|
2907
3052
|
return /*#__PURE__*/React__default["default"].createElement("td", {
|
|
2908
3053
|
style: {
|
|
2909
3054
|
width: 'auto',
|
|
@@ -2938,8 +3083,10 @@ const TD = ({
|
|
|
2938
3083
|
type: newItem.type,
|
|
2939
3084
|
className: styles$a['td-span'],
|
|
2940
3085
|
key: `${newItem.id}_${newIndex}`,
|
|
2941
|
-
onClick: e => handleCheckActions(e, newItem, 'type', newIndex)
|
|
2942
|
-
|
|
3086
|
+
onClick: e => handleCheckActions(e, newItem, 'type', newIndex),
|
|
3087
|
+
onMouseEnter: () => handleMouseEnter(newItem, newIndex),
|
|
3088
|
+
onMouseLeave: () => handleMouseLeave()
|
|
3089
|
+
}, 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 : '');
|
|
2943
3090
|
} else if (newItem && Array.isArray(newItem)) {
|
|
2944
3091
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2945
3092
|
key: `${newItem.id}_${newIndex}`,
|
|
@@ -2959,9 +3106,11 @@ const TD = ({
|
|
|
2959
3106
|
id: iT.id ? iT.id : '',
|
|
2960
3107
|
type: iT.type ? iT.type : '',
|
|
2961
3108
|
className: styles$a['td-span'],
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3109
|
+
key: `${iT.id || iT.content}_${iN}`,
|
|
3110
|
+
onMouseEnter: () => handleMouseEnter(iT, iN),
|
|
3111
|
+
onMouseLeave: () => handleMouseLeave(),
|
|
3112
|
+
onClick: e => handleCheckActions(e, iT, 'type', iN)
|
|
3113
|
+
}, 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 : '');
|
|
2965
3114
|
}));
|
|
2966
3115
|
} else {
|
|
2967
3116
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
@@ -3026,7 +3175,7 @@ const TD = ({
|
|
|
3026
3175
|
cursor: hasOwnerProperty(item, 'arrowComponent') || hasOwnerProperty(item, 'dots') ? 'pointer' : 'auto',
|
|
3027
3176
|
...item.props
|
|
3028
3177
|
},
|
|
3029
|
-
onClick: hasOwnerProperty(item, 'arrowComponent') ? () => handleCheckArrowAction(item, item.checkIndex) : hasOwnerProperty(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
|
|
3178
|
+
onClick: hasOwnerProperty(item, 'arrowComponent') ? () => handleCheckArrowAction(item, collapseFullRow ? index : item.checkIndex) : hasOwnerProperty(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
|
|
3030
3179
|
}, 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["default"].createElement("span", {
|
|
3031
3180
|
style: {
|
|
3032
3181
|
display: 'block',
|
|
@@ -3073,7 +3222,7 @@ const TD = ({
|
|
|
3073
3222
|
},
|
|
3074
3223
|
title: optionItem.content
|
|
3075
3224
|
}, optionItem.content === 0 ? optionItem.content.toString() : optionItem.content ? optionItem.content : ''));
|
|
3076
|
-
}))) : ''), hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3225
|
+
}))) : ''), hasOwnerProperty(item, 'contentList') && !collapseFullRow && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3077
3226
|
style: {
|
|
3078
3227
|
overflow: 'auto',
|
|
3079
3228
|
marginTop: '10px',
|
|
@@ -3234,7 +3383,12 @@ const Table = ({
|
|
|
3234
3383
|
draggableColor,
|
|
3235
3384
|
getDraggableData,
|
|
3236
3385
|
draggableItemBoxShadow,
|
|
3237
|
-
draggableItemBackgroundColor
|
|
3386
|
+
draggableItemBackgroundColor,
|
|
3387
|
+
tableBorder,
|
|
3388
|
+
tableBorderColor,
|
|
3389
|
+
collapseFullRow,
|
|
3390
|
+
openArrow,
|
|
3391
|
+
closeArrow
|
|
3238
3392
|
}) => {
|
|
3239
3393
|
const itemRefs = React.useRef({});
|
|
3240
3394
|
const headerRef = React.useRef(null);
|
|
@@ -3368,8 +3522,8 @@ const Table = ({
|
|
|
3368
3522
|
status: 'close',
|
|
3369
3523
|
checkIndex: null,
|
|
3370
3524
|
arrowComponent: true,
|
|
3371
|
-
openArrow: /*#__PURE__*/React__default["default"].createElement(SvgUpArrow, null),
|
|
3372
|
-
closeArrow: /*#__PURE__*/React__default["default"].createElement(SvgDownArrow, null)
|
|
3525
|
+
openArrow: openArrow ? openArrow : configStyles.TABLE?.openArrow ? configStyles.TABLE?.openArrow : /*#__PURE__*/React__default["default"].createElement(SvgUpArrow, null),
|
|
3526
|
+
closeArrow: closeArrow ? closeArrow : configStyles.TABLE?.closeArrow ? configStyles.TABLE?.closeArrow : /*#__PURE__*/React__default["default"].createElement(SvgDownArrow, null)
|
|
3373
3527
|
};
|
|
3374
3528
|
if (type === 'body') {
|
|
3375
3529
|
return data.map((item, index) => {
|
|
@@ -3533,6 +3687,49 @@ const Table = ({
|
|
|
3533
3687
|
prev[rowPosition] = checkedOpenableRow;
|
|
3534
3688
|
return [...prev];
|
|
3535
3689
|
});
|
|
3690
|
+
if (collapseFullRow) {
|
|
3691
|
+
const newRows = [];
|
|
3692
|
+
body[rowPosition].filter(newItem => hasOwnerProperty(newItem, 'contentList')).map((cfrItem, cfrIndex) => {
|
|
3693
|
+
newRows[cfrIndex] = cfrItem.contentList;
|
|
3694
|
+
});
|
|
3695
|
+
const transformedArray = newRows && newRows[0] && newRows[0].map((_, index) => {
|
|
3696
|
+
let result = [];
|
|
3697
|
+
for (let i = 0; i < newRows.length; i++) {
|
|
3698
|
+
result[i] = newRows[i][index];
|
|
3699
|
+
}
|
|
3700
|
+
return result;
|
|
3701
|
+
});
|
|
3702
|
+
if (transformedArray && transformedArray.length) {
|
|
3703
|
+
const fakeData = transformedArray.map(fakeItem => {
|
|
3704
|
+
fakeItem.unshift({
|
|
3705
|
+
id: 'fake',
|
|
3706
|
+
content: ''
|
|
3707
|
+
});
|
|
3708
|
+
fakeItem.push({
|
|
3709
|
+
id: 'fake',
|
|
3710
|
+
content: ''
|
|
3711
|
+
});
|
|
3712
|
+
return fakeItem;
|
|
3713
|
+
});
|
|
3714
|
+
if (status === 'close') {
|
|
3715
|
+
let met = [...body];
|
|
3716
|
+
setTimeout(() => {
|
|
3717
|
+
setBody(() => {
|
|
3718
|
+
met.splice(rowPosition + 1, 0, ...fakeData);
|
|
3719
|
+
return met;
|
|
3720
|
+
});
|
|
3721
|
+
}, 0);
|
|
3722
|
+
} else {
|
|
3723
|
+
let met = [...body];
|
|
3724
|
+
setTimeout(() => {
|
|
3725
|
+
setBody(() => {
|
|
3726
|
+
met.splice(rowPosition + 1, fakeData.length);
|
|
3727
|
+
return met;
|
|
3728
|
+
});
|
|
3729
|
+
}, 0);
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3536
3733
|
};
|
|
3537
3734
|
const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
|
|
3538
3735
|
let single = {};
|
|
@@ -3573,6 +3770,7 @@ const Table = ({
|
|
|
3573
3770
|
};
|
|
3574
3771
|
const handleCheckArrowActionHeader = (e, item) => {
|
|
3575
3772
|
e.stopPropagation();
|
|
3773
|
+
let mergedArray = [];
|
|
3576
3774
|
const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
|
|
3577
3775
|
if (item.checkIndex === (draggable && !showOrder ? innerIndex - 1 : draggable && showOrder ? innerIndex - 2 : innerIndex)) {
|
|
3578
3776
|
if (item.status === 'close') {
|
|
@@ -3595,8 +3793,52 @@ const Table = ({
|
|
|
3595
3793
|
return iElem;
|
|
3596
3794
|
});
|
|
3597
3795
|
});
|
|
3796
|
+
if (collapseFullRow) {
|
|
3797
|
+
if (item.status === 'open') {
|
|
3798
|
+
const newFakeBody = checkedOpenableAllRowsBody.map(bodyItem => {
|
|
3799
|
+
let fakeData = [];
|
|
3800
|
+
const newRows = [];
|
|
3801
|
+
bodyItem.filter(newItem => hasOwnerProperty(newItem, 'contentList')).map((cfrItem, cfrIndex) => {
|
|
3802
|
+
newRows[cfrIndex] = cfrItem.contentList;
|
|
3803
|
+
});
|
|
3804
|
+
const transformedArray = newRows && newRows[0] && newRows[0].map((_, index) => {
|
|
3805
|
+
let result = [];
|
|
3806
|
+
for (let i = 0; i < newRows.length; i++) {
|
|
3807
|
+
result[i] = newRows[i][index];
|
|
3808
|
+
}
|
|
3809
|
+
return result;
|
|
3810
|
+
});
|
|
3811
|
+
if (transformedArray && transformedArray.length) {
|
|
3812
|
+
fakeData = transformedArray.map(fakeItem => {
|
|
3813
|
+
fakeItem.unshift({
|
|
3814
|
+
id: 'fake',
|
|
3815
|
+
content: ''
|
|
3816
|
+
});
|
|
3817
|
+
fakeItem.push({
|
|
3818
|
+
id: 'fake',
|
|
3819
|
+
content: ''
|
|
3820
|
+
});
|
|
3821
|
+
return fakeItem;
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3824
|
+
return fakeData;
|
|
3825
|
+
});
|
|
3826
|
+
if (newFakeBody && newFakeBody.length) {
|
|
3827
|
+
checkedOpenableAllRowsBody.map((newBodyItem, newBodyIndex) => {
|
|
3828
|
+
mergedArray.push(newBodyItem);
|
|
3829
|
+
if (newFakeBody[newBodyIndex] && newFakeBody[newBodyIndex].length) {
|
|
3830
|
+
newFakeBody[newBodyIndex].map(newFakeBodyItem => {
|
|
3831
|
+
mergedArray.push(newFakeBodyItem);
|
|
3832
|
+
});
|
|
3833
|
+
}
|
|
3834
|
+
});
|
|
3835
|
+
}
|
|
3836
|
+
} else {
|
|
3837
|
+
mergedArray = checkedOpenableAllRowsBody.filter(realArray => !realArray.some(item => item.id === 'fake'));
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3598
3840
|
setHeader(() => checkedOpenableAllRows);
|
|
3599
|
-
setBody(() => checkedOpenableAllRowsBody);
|
|
3841
|
+
setBody(() => !collapseFullRow ? checkedOpenableAllRowsBody : mergedArray);
|
|
3600
3842
|
};
|
|
3601
3843
|
const handleCheckDots = (e, item, index, innerIndex) => {
|
|
3602
3844
|
e.stopPropagation();
|
|
@@ -3865,8 +4107,11 @@ const Table = ({
|
|
|
3865
4107
|
return configStyles.TABLE && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("table", {
|
|
3866
4108
|
style: {
|
|
3867
4109
|
width: '100%',
|
|
3868
|
-
|
|
3869
|
-
|
|
4110
|
+
borderRadius: tHeadBorderRadius ?? configStyles.TABLE.head.radius,
|
|
4111
|
+
outline: hideBorder ? 'none' : tableBorder ?? configStyles.TABLE.border,
|
|
4112
|
+
outlineColor: hideBorder ? 'none' : tableBorderColor ?? configStyles.TABLE.borderColor,
|
|
4113
|
+
borderSpacing: `0 ${tBodyRowMarginTop ?? configStyles.TABLE.body.row.marginTop}`,
|
|
4114
|
+
borderCollapse: tableRowItem ?? configStyles.TABLE.body.row.asItem ? 'separate' : 'collapse'
|
|
3870
4115
|
},
|
|
3871
4116
|
onClick: handleTableClick,
|
|
3872
4117
|
className: classProps
|
|
@@ -3876,7 +4121,7 @@ const Table = ({
|
|
|
3876
4121
|
style: {
|
|
3877
4122
|
color: tHeadColor ?? configStyles.TABLE.head.color,
|
|
3878
4123
|
backgroundColor: tHeadBackgroundColor ?? configStyles.TABLE.head.colors.background,
|
|
3879
|
-
borderColor: hideBorder ? 'transparent' :
|
|
4124
|
+
borderColor: hideBorder ? 'transparent' : tableBorderColor ?? configStyles.TABLE.borderColor
|
|
3880
4125
|
}
|
|
3881
4126
|
}, header.map((item, index) => {
|
|
3882
4127
|
return /*#__PURE__*/React__default["default"].createElement(TH, {
|
|
@@ -3953,7 +4198,8 @@ const Table = ({
|
|
|
3953
4198
|
borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.body.row.border,
|
|
3954
4199
|
borderRightColor: innerIndex === Object.values(item).length - 1 ? 'transparent' : configStyles.TABLE.body.row.borderColor,
|
|
3955
4200
|
handleCheckArrowAction: handleCheckArrowAction,
|
|
3956
|
-
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
|
|
4201
|
+
handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow,
|
|
4202
|
+
collapseFullRow: collapseFullRow
|
|
3957
4203
|
});
|
|
3958
4204
|
}));
|
|
3959
4205
|
})) : '', body && body.length > 0 && draggable && dragging && draggedItem && /*#__PURE__*/React__default["default"].createElement("tbody", null, /*#__PURE__*/React__default["default"].createElement("tr", {
|
|
@@ -4045,7 +4291,12 @@ Table.propTypes = {
|
|
|
4045
4291
|
openListFontStyle: PropTypes__default["default"].string,
|
|
4046
4292
|
openListFontWeight: PropTypes__default["default"].string,
|
|
4047
4293
|
openListFontFamily: PropTypes__default["default"].string,
|
|
4048
|
-
hideBorder: PropTypes__default["default"].bool
|
|
4294
|
+
hideBorder: PropTypes__default["default"].bool,
|
|
4295
|
+
collapseFullRow: PropTypes__default["default"].bool,
|
|
4296
|
+
tableBorder: PropTypes__default["default"].string,
|
|
4297
|
+
tableBorderColor: PropTypes__default["default"].string,
|
|
4298
|
+
openArrow: PropTypes__default["default"].element,
|
|
4299
|
+
closeArrow: PropTypes__default["default"].element
|
|
4049
4300
|
};
|
|
4050
4301
|
|
|
4051
4302
|
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)}}";
|
|
@@ -4645,6 +4896,7 @@ const TelInput = ({
|
|
|
4645
4896
|
disabled: disabled,
|
|
4646
4897
|
onInput: handleChange,
|
|
4647
4898
|
name: inpAttributes?.iName,
|
|
4899
|
+
className: "tui-color-placeholder",
|
|
4648
4900
|
placeholder: inpAttributes?.placeholder,
|
|
4649
4901
|
autoComplete: inpAttributes?.autoComplete,
|
|
4650
4902
|
style: {
|
|
@@ -4697,6 +4949,7 @@ const TextInput = ({
|
|
|
4697
4949
|
disabled: disabled,
|
|
4698
4950
|
onInput: handleChange,
|
|
4699
4951
|
name: inpAttributes?.iName,
|
|
4952
|
+
className: "tui-color-placeholder",
|
|
4700
4953
|
placeholder: inpAttributes?.placeholder,
|
|
4701
4954
|
autoComplete: inpAttributes?.autoComplete,
|
|
4702
4955
|
style: {
|
|
@@ -4755,6 +5008,7 @@ const PassInput = ({
|
|
|
4755
5008
|
disabled: disabled,
|
|
4756
5009
|
onInput: handleChange,
|
|
4757
5010
|
name: inpAttributes?.iName,
|
|
5011
|
+
className: "tui-color-placeholder",
|
|
4758
5012
|
placeholder: inpAttributes?.placeholder,
|
|
4759
5013
|
autoComplete: inpAttributes?.autoComplete,
|
|
4760
5014
|
style: {
|
|
@@ -4797,7 +5051,11 @@ const NumberInput = ({
|
|
|
4797
5051
|
currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
|
|
4798
5052
|
if (cardNumber) {
|
|
4799
5053
|
let digits = currentValue.replace(/\D/g, '');
|
|
4800
|
-
|
|
5054
|
+
if (digits.length <= 16) {
|
|
5055
|
+
setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5056
|
+
} else {
|
|
5057
|
+
setInnerValue(() => digits.substring(0, 16).replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5058
|
+
}
|
|
4801
5059
|
} else {
|
|
4802
5060
|
setInnerValue(() => currentValue);
|
|
4803
5061
|
}
|
|
@@ -4875,7 +5133,11 @@ const NumberInput = ({
|
|
|
4875
5133
|
}
|
|
4876
5134
|
if (cardNumber) {
|
|
4877
5135
|
let digits = newValue.replace(/\D/g, '');
|
|
4878
|
-
|
|
5136
|
+
if (digits.length <= 16) {
|
|
5137
|
+
setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5138
|
+
} else {
|
|
5139
|
+
setInnerValue(() => digits.substring(0, 16).replace(/(\d{4})(?=\d)/g, '$1-'));
|
|
5140
|
+
}
|
|
4879
5141
|
} else {
|
|
4880
5142
|
setInnerValue(() => newValue);
|
|
4881
5143
|
}
|
|
@@ -4886,6 +5148,7 @@ const NumberInput = ({
|
|
|
4886
5148
|
value: innerValue,
|
|
4887
5149
|
disabled: disabled,
|
|
4888
5150
|
name: inpAttributes?.iName,
|
|
5151
|
+
className: "tui-color-placeholder",
|
|
4889
5152
|
placeholder: inpAttributes?.placeholder,
|
|
4890
5153
|
autoComplete: inpAttributes?.autoComplete,
|
|
4891
5154
|
style: {
|
|
@@ -4991,6 +5254,7 @@ const Input = ({
|
|
|
4991
5254
|
numberMaxLength,
|
|
4992
5255
|
backgroundColor,
|
|
4993
5256
|
errorIconMargin,
|
|
5257
|
+
placeholderColor,
|
|
4994
5258
|
withZero = false,
|
|
4995
5259
|
labelMarginBottom,
|
|
4996
5260
|
regexpErrorMessage,
|
|
@@ -5105,7 +5369,9 @@ const Input = ({
|
|
|
5105
5369
|
}, []);
|
|
5106
5370
|
return configStyles.INPUT && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5107
5371
|
className: classProps
|
|
5108
|
-
},
|
|
5372
|
+
}, /*#__PURE__*/React__default["default"].createElement("style", null, `.tui-color-placeholder::placeholder {
|
|
5373
|
+
color: ${placeholderColor ?? configStyles.INPUT.colors.placeholder};
|
|
5374
|
+
}`), label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
5109
5375
|
style: {
|
|
5110
5376
|
maxWidth: '100%',
|
|
5111
5377
|
color: labelColor ?? configStyles.INPUT.label.color,
|
|
@@ -5333,6 +5599,7 @@ Input.propTypes = {
|
|
|
5333
5599
|
labelMarginBottom: PropTypes__default["default"].string,
|
|
5334
5600
|
borderRight: PropTypes__default["default"].string,
|
|
5335
5601
|
placeholder: PropTypes__default["default"].string,
|
|
5602
|
+
placeholderColor: PropTypes__default["default"].string,
|
|
5336
5603
|
phoneDisplay: PropTypes__default["default"].string,
|
|
5337
5604
|
autoComplete: PropTypes__default["default"].string,
|
|
5338
5605
|
errorDots: PropTypes__default["default"].bool,
|
|
@@ -6884,7 +7151,7 @@ const Stepper = ({
|
|
|
6884
7151
|
}, (() => {
|
|
6885
7152
|
let steppers = [];
|
|
6886
7153
|
for (let step = 1; step <= stepLength; step++) {
|
|
6887
|
-
steppers.push(
|
|
7154
|
+
steppers.push(/*#__PURE__*/React__default["default"].createElement("div", {
|
|
6888
7155
|
className: classnames__default["default"](`${step <= activeSteps ? styles$3.activeRing : styles$3.bigRing}`),
|
|
6889
7156
|
key: step
|
|
6890
7157
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|