@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.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)); }); })( /* @vite-ignore */componentName);
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}`);
@@ -1711,6 +1723,37 @@ const SvgDeleteComponent = ({
1711
1723
  fill: fillColor ? fillColor : '#E00'
1712
1724
  }));
1713
1725
 
1726
+ function styleInject(css, ref) {
1727
+ if ( ref === void 0 ) ref = {};
1728
+ var insertAt = ref.insertAt;
1729
+
1730
+ if (!css || typeof document === 'undefined') { return; }
1731
+
1732
+ var head = document.head || document.getElementsByTagName('head')[0];
1733
+ var style = document.createElement('style');
1734
+ style.type = 'text/css';
1735
+
1736
+ if (insertAt === 'top') {
1737
+ if (head.firstChild) {
1738
+ head.insertBefore(style, head.firstChild);
1739
+ } else {
1740
+ head.appendChild(style);
1741
+ }
1742
+ } else {
1743
+ head.appendChild(style);
1744
+ }
1745
+
1746
+ if (style.styleSheet) {
1747
+ style.styleSheet.cssText = css;
1748
+ } else {
1749
+ style.appendChild(document.createTextNode(css));
1750
+ }
1751
+ }
1752
+
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"};
1755
+ styleInject(css_248z$d);
1756
+
1714
1757
  // eslint-disable-next-line react/display-name
1715
1758
  const File = /*#__PURE__*/React.forwardRef(({
1716
1759
  or,
@@ -1741,6 +1784,14 @@ const File = /*#__PURE__*/React.forwardRef(({
1741
1784
  labelStyle,
1742
1785
  labelWeight,
1743
1786
  labelFamily,
1787
+ labelTooltipColor,
1788
+ labelTooltipPadding,
1789
+ labelTooltipFontSize,
1790
+ labelTooltipFontStyle,
1791
+ labelTooltipFontFamily,
1792
+ labelTooltipFontWeight,
1793
+ labelTooltipBorderRadius,
1794
+ labelTooltipBackgroundColor,
1744
1795
  removeFile,
1745
1796
  labelColor,
1746
1797
  errorColor,
@@ -1750,6 +1801,8 @@ const File = /*#__PURE__*/React.forwardRef(({
1750
1801
  uploadColor,
1751
1802
  defaultData,
1752
1803
  formatError,
1804
+ errorIcon,
1805
+ errorIconShow,
1753
1806
  errorMessage,
1754
1807
  fileSizeText,
1755
1808
  maxSizeError,
@@ -1806,18 +1859,22 @@ const File = /*#__PURE__*/React.forwardRef(({
1806
1859
  listItemBackgroundColor,
1807
1860
  listItemBackgroundErrorColor,
1808
1861
  maxCHoosenLengthErrorHideTime,
1862
+ textAlignLeftInSmallComponent,
1863
+ showPreviewIconInSmallComponent,
1809
1864
  maxSize = 10,
1810
1865
  preview = true,
1811
1866
  timeForRemoveError = 5000,
1812
1867
  fileExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'heic']
1813
1868
  }, ref) => {
1814
1869
  const inpRef = React.useRef(null);
1870
+ const labelRef = React.useRef(null);
1815
1871
  const memoizedItems = React.useMemo(() => filesArray, [filesArray]);
1816
1872
  const [error, setError] = React.useState('');
1817
1873
  const [isHover, setIsHover] = React.useState(false);
1818
1874
  const [classProps, setClassProps] = React.useState({});
1819
1875
  const [singleFile, setSingleFile] = React.useState(null);
1820
1876
  const [configStyles, setConfigStyles] = React.useState({});
1877
+ const [tooltipElem, setTooltipElem] = React.useState(null);
1821
1878
  const [choosenFileCount, setChoosenFileCount] = React.useState(0);
1822
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);
1823
1880
  const handleCheckHeicFormat = async file => {
@@ -2082,6 +2139,71 @@ const File = /*#__PURE__*/React.forwardRef(({
2082
2139
  const handleStopPropagation = e => {
2083
2140
  e.stopPropagation();
2084
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
+ };
2085
2207
  React.useImperativeHandle(ref, () => ({
2086
2208
  handleReset() {
2087
2209
  setError('');
@@ -2148,6 +2270,11 @@ const File = /*#__PURE__*/React.forwardRef(({
2148
2270
  }, error => {
2149
2271
  console.error(error);
2150
2272
  });
2273
+ return () => {
2274
+ if (tooltipElem) {
2275
+ document.body.removeChild(tooltipElem);
2276
+ }
2277
+ };
2151
2278
  }, []);
2152
2279
  return configStyles.FILE && /*#__PURE__*/React__default["default"].createElement("div", {
2153
2280
  style: {
@@ -2162,15 +2289,28 @@ const File = /*#__PURE__*/React.forwardRef(({
2162
2289
  alignItems: 'center',
2163
2290
  justifyContent: label ? 'space-between' : 'flex-end'
2164
2291
  }
2165
- }, label && /*#__PURE__*/React__default["default"].createElement("label", {
2292
+ }, label && /*#__PURE__*/React__default["default"].createElement("div", {
2166
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%',
2167
2305
  color: labelColor ?? configStyles.FILE.label.color,
2168
2306
  fontSize: labelSize ?? configStyles.FILE.label.font.size,
2169
2307
  fontStyle: labelStyle ?? configStyles.FILE.label.font.style,
2170
2308
  fontWeight: labelWeight ?? configStyles.FILE.label.font.weight,
2171
2309
  fontFamily: labelFamily ?? configStyles.FILE.label.font.family
2172
- }
2173
- }, 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", {
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", {
2174
2314
  style: {
2175
2315
  cursor: 'pointer'
2176
2316
  },
@@ -2248,15 +2388,29 @@ const File = /*#__PURE__*/React.forwardRef(({
2248
2388
  padding: '0px 10px'
2249
2389
  }
2250
2390
  }, fileSizeText ?? configStyles.FILE.sizeText, " ", maxSize, " \u0544\u0532 (", ' ', fileExtensions.toString().split(',').join(', '), " )"))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
2391
+ className: styles$b['small-file-component'],
2251
2392
  style: {
2252
2393
  width: '100%',
2253
2394
  padding: '5px',
2254
2395
  display: 'flex',
2255
2396
  alignItems: 'center',
2256
2397
  boxSizing: 'border-box',
2257
- justifyContent: 'space-between'
2398
+ justifyContent: textAlignLeftInSmallComponent ? 'flex-start' : 'space-between'
2258
2399
  }
2259
- }, /*#__PURE__*/React__default["default"].createElement(Button, {
2400
+ }, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default["default"].createElement(Button, {
2401
+ contentWidth: true,
2402
+ onClick: _ => _,
2403
+ font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
2404
+ size: uploadBtnSize ?? configStyles.FILE.uploadBtn.font.size,
2405
+ style: uploadBtnStyle ?? configStyles.FILE.uploadBtn.font.style,
2406
+ weight: uploadBtnWeight ?? configStyles.FILE.uploadBtn.font.weight,
2407
+ label: uploadBtnLabel ?? configStyles.FILE.uploadBtn.label,
2408
+ color: uploadBtnColor ?? configStyles.FILE.uploadBtn.color,
2409
+ height: uploadBtnHeight ?? configStyles.FILE.uploadBtn.height,
2410
+ hoverColor: uploadBtnHoverColor ?? configStyles.FILE.uploadBtn.colors.hover,
2411
+ backgroundColor: uploadBtnBackgroundColor ?? configStyles.FILE.uploadBtn.colors.background,
2412
+ backgroundHoverColor: uploadBtnBackgroundColorHover ?? configStyles.FILE.uploadBtn.colors.backgroundHover
2413
+ }) : image === 'pdf' ? iconPdf ? iconPdf : configStyles.FILE.icon.pdf ? configStyles.FILE.icon.pdf : /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : image === 'heif' || image === 'heic' ? iconHeic ? iconHeic : configStyles.FILE.icon.heic ? configStyles.FILE.icon.heic : /*#__PURE__*/React__default["default"].createElement(SvgHeic, null) : image === 'doc' ? iconDoc ? iconDoc : configStyles.FILE.icon.doc ? configStyles.FILE.icon.doc : /*#__PURE__*/React__default["default"].createElement(SvgDocIcon, null) : image === 'docx' ? iconDocx ? iconDocx : configStyles.FILE.icon.docx ? configStyles.FILE.icon.docx : /*#__PURE__*/React__default["default"].createElement(SvgDocIcon, null) : singleFile[0].type === 'image/jpeg' ? iconJpeg ? iconJpeg : configStyles.FILE.icon.jpeg ? configStyles.FILE.icon.jpeg : /*#__PURE__*/React__default["default"].createElement(SvgListItemJpeg, null) : singleFile[0].type === 'image/png' ? iconPng ? iconPng : configStyles.FILE.icon.png ? configStyles.FILE.icon.png : /*#__PURE__*/React__default["default"].createElement(SvgListItemPng, null) : singleFile[0].type === 'image/jpg' ? iconJpeg ? iconJpg : configStyles.FILE.icon.jpg ? configStyles.FILE.icon.jpg : /*#__PURE__*/React__default["default"].createElement(SvgListItemJpg, null) : '' : /*#__PURE__*/React__default["default"].createElement(Button, {
2260
2414
  contentWidth: true,
2261
2415
  onClick: _ => _,
2262
2416
  font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
@@ -2303,14 +2457,16 @@ const File = /*#__PURE__*/React.forwardRef(({
2303
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", {
2304
2458
  style: {
2305
2459
  marginTop: '6px',
2306
- display: 'inline-block',
2307
2460
  color: errorColor ?? configStyles.FILE.error.color,
2308
2461
  fontSize: errorSize ?? configStyles.FILE.error.font.size,
2309
2462
  fontStyle: errorStyle ?? configStyles.FILE.error.font.style,
2310
2463
  fontWeight: errorWeight ?? configStyles.FILE.error.font.weight,
2311
- 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'
2312
2468
  }
2313
- }, 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 => {
2314
2470
  return /*#__PURE__*/React__default["default"].createElement(FileItem, {
2315
2471
  key: item.uuid,
2316
2472
  uuid: item.uuid,
@@ -2382,6 +2538,14 @@ File.propTypes = {
2382
2538
  labelWeight: PropTypes__default["default"].string,
2383
2539
  labelFamily: PropTypes__default["default"].string,
2384
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,
2385
2549
  errorColor: PropTypes__default["default"].string,
2386
2550
  formatError: PropTypes__default["default"].string,
2387
2551
  putFileHere: PropTypes__default["default"].string,
@@ -2389,6 +2553,8 @@ File.propTypes = {
2389
2553
  defaultData: PropTypes__default["default"].object,
2390
2554
  componentId: PropTypes__default["default"].number,
2391
2555
  maxSizeError: PropTypes__default["default"].string,
2556
+ errorIcon: PropTypes__default["default"].element,
2557
+ errorIconShow: PropTypes__default["default"].bool,
2392
2558
  errorMessage: PropTypes__default["default"].string,
2393
2559
  fileSizeText: PropTypes__default["default"].string,
2394
2560
  noChoosenFile: PropTypes__default["default"].string,
@@ -2446,9 +2612,107 @@ File.propTypes = {
2446
2612
  listItemBackgroundErrorColor: PropTypes__default["default"].string,
2447
2613
  maxCHoosenLengthErrorHideTime: PropTypes__default["default"].number,
2448
2614
  filesArray: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
2615
+ textAlignLeftInSmallComponent: PropTypes__default["default"].bool,
2616
+ showPreviewIconInSmallComponent: PropTypes__default["default"].bool,
2449
2617
  fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
2450
2618
  };
2451
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
+
2452
2716
  const SvgCheckboxUnchecked = ({
2453
2717
  title,
2454
2718
  titleId,
@@ -2614,129 +2878,6 @@ SingleCheckbox.propTypes = {
2614
2878
  ignoreDisabledForChecked: PropTypes__default["default"].bool
2615
2879
  };
2616
2880
 
2617
- const hasOwnerProperty = (object, property) => {
2618
- return Object.prototype.hasOwnProperty.call(object, property);
2619
- };
2620
- const handleUtilsMouseEnterLeave = (e, behaviourStyle) => {
2621
- if (typeof behaviourStyle !== 'object' || behaviourStyle === null || behaviourStyle === undefined) {
2622
- alert('Please set a second param of handleUtilsMouseEnter function as valid object');
2623
- return;
2624
- }
2625
- if (!hasOwnerProperty(e, 'target')) {
2626
- alert('Please set a valid object like DOM event');
2627
- return;
2628
- }
2629
- const existStyle = e.target.style;
2630
- if (typeof existStyle !== 'object' || existStyle === null) {
2631
- alert('Please set a valid style object in DOM event tergat');
2632
- return;
2633
- }
2634
- for (const property in behaviourStyle) {
2635
- if (existStyle[property]) {
2636
- existStyle[property] = behaviourStyle[property];
2637
- }
2638
- }
2639
- };
2640
- const handleUtilsCheckTypeTel = (val, prevVal) => {
2641
- const phoneNumberRegex = /^\d{0,8}$/;
2642
- if (val.length > 7) {
2643
- val = val.substr(0, 8);
2644
- }
2645
- if (!phoneNumberRegex.test(val)) {
2646
- val = prevVal;
2647
- }
2648
- return val;
2649
- };
2650
- const handleUtilsCheckTypeNumber = (val, prevVal, maxLength, floatToFix, maxNumSize, withoutDot, innerMinNumSize, numberMaxLength, cardNumber) => {
2651
- if (maxLength && maxLength > 0) {
2652
- if (val.length > maxLength) {
2653
- val = val.substr(0, maxLength);
2654
- }
2655
- } else {
2656
- const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.|\․|\.|\,)?(\d+)?$/ : /^\d+$/;
2657
- if (cardNumber) {
2658
- if (val.length > 19 && !val.includes('.')) {
2659
- val = val.substr(0, 19);
2660
- }
2661
- } else {
2662
- if (val.length > 16 && !val.includes('.')) {
2663
- val = val.substr(0, 16);
2664
- }
2665
- }
2666
- if (numberMaxLength && numberMaxLength > 0 && !val.includes('.')) {
2667
- val = val.substr(0, numberMaxLength);
2668
- }
2669
- const floatNumParts = typeof val === 'string' ? val.split(/\.|\․|\.|\,/) : val;
2670
- const int = floatNumParts[0];
2671
- const float = floatNumParts[1];
2672
- if (floatToFix > 0) {
2673
- if (float && float.length > 0) {
2674
- let floatResult = '';
2675
- [...float].map((item, index) => {
2676
- if (index + 1 <= floatToFix) {
2677
- floatResult += item;
2678
- }
2679
- });
2680
- floatResult !== '' ? val = `${int}.${floatResult}` : val = `${int}`;
2681
- }
2682
- } else {
2683
- if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
2684
- val = `${int}`;
2685
- }
2686
- }
2687
- if (!regNum.test(val)) {
2688
- let newVal = typeof val === 'number' ? val.toString() : val;
2689
- const newStr = newVal.replace(/[^0-9.]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
2690
- return b + c.replace(/\.|\․|\.|\,/g, '');
2691
- });
2692
- val = newStr;
2693
- }
2694
- }
2695
- if (withoutDot && !/^\d+$/.test(val)) {
2696
- let newVal = typeof val === 'number' ? val.toString() : val;
2697
- const newStr = newVal.replace(/[^0-9]/g, '').replace(/^([^.]*\.|\․|\.|\,)(.*)$/, function (_, b, c) {
2698
- return b + c.replace(/\.|\․|\.|\,/g, '');
2699
- });
2700
- val = newStr;
2701
- }
2702
- return val;
2703
- };
2704
- const handleUtilsOpenInNewTab = url => {
2705
- const imageLink = document.createElement('a');
2706
- imageLink.href = url, imageLink.target = '_blank';
2707
- imageLink.click();
2708
- };
2709
- const handleRemoveLeadingZeros = str => {
2710
- return str.replace(/^0+(\d)/, '$1');
2711
- };
2712
-
2713
- function styleInject(css, ref) {
2714
- if ( ref === void 0 ) ref = {};
2715
- var insertAt = ref.insertAt;
2716
-
2717
- if (!css || typeof document === 'undefined') { return; }
2718
-
2719
- var head = document.head || document.getElementsByTagName('head')[0];
2720
- var style = document.createElement('style');
2721
- style.type = 'text/css';
2722
-
2723
- if (insertAt === 'top') {
2724
- if (head.firstChild) {
2725
- head.insertBefore(style, head.firstChild);
2726
- } else {
2727
- head.appendChild(style);
2728
- }
2729
- } else {
2730
- head.appendChild(style);
2731
- }
2732
-
2733
- if (style.styleSheet) {
2734
- style.styleSheet.cssText = css;
2735
- } else {
2736
- style.appendChild(document.createTextNode(css));
2737
- }
2738
- }
2739
-
2740
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%}";
2741
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"};
2742
2883
  styleInject(css_248z$c);
@@ -2831,6 +2972,7 @@ const TD = ({
2831
2972
  tBodyFontFamily,
2832
2973
  tBodyFontWeight,
2833
2974
  handleCheckDots,
2975
+ collapseFullRow,
2834
2976
  openListFontSize,
2835
2977
  borderRightColor,
2836
2978
  openListFontStyle,
@@ -2845,6 +2987,11 @@ const TD = ({
2845
2987
  handleCheckArrowAction,
2846
2988
  handleOpenCloseRowSingleArrow
2847
2989
  }) => {
2990
+ const [actionHover, setActionHover] = React.useState({
2991
+ id: '',
2992
+ type: '',
2993
+ index: -1
2994
+ });
2848
2995
  const handleBodyAction = (e, data) => {
2849
2996
  const actionData = {
2850
2997
  index,
@@ -2884,6 +3031,24 @@ const TD = ({
2884
3031
  contentListInnerItem
2885
3032
  });
2886
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
+ };
2887
3052
  return /*#__PURE__*/React__default["default"].createElement("td", {
2888
3053
  style: {
2889
3054
  width: 'auto',
@@ -2918,8 +3083,10 @@ const TD = ({
2918
3083
  type: newItem.type,
2919
3084
  className: styles$a['td-span'],
2920
3085
  key: `${newItem.id}_${newIndex}`,
2921
- onClick: e => handleCheckActions(e, newItem, 'type', newIndex)
2922
- }, newItem.content === 0 ? newItem.content.toString() : newItem.content ? newItem.content : '');
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 : '');
2923
3090
  } else if (newItem && Array.isArray(newItem)) {
2924
3091
  return /*#__PURE__*/React__default["default"].createElement("span", {
2925
3092
  key: `${newItem.id}_${newIndex}`,
@@ -2939,9 +3106,11 @@ const TD = ({
2939
3106
  id: iT.id ? iT.id : '',
2940
3107
  type: iT.type ? iT.type : '',
2941
3108
  className: styles$a['td-span'],
2942
- onClick: e => handleCheckActions(e, iT, 'type', iN),
2943
- key: `${iT.id || iT.content}_${iN}`
2944
- }, iT.content === 0 ? iT.content.toString() : iT.content ? iT.content : '');
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 : '');
2945
3114
  }));
2946
3115
  } else {
2947
3116
  return /*#__PURE__*/React__default["default"].createElement("span", {
@@ -3006,7 +3175,7 @@ const TD = ({
3006
3175
  cursor: hasOwnerProperty(item, 'arrowComponent') || hasOwnerProperty(item, 'dots') ? 'pointer' : 'auto',
3007
3176
  ...item.props
3008
3177
  },
3009
- 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) : _ => _
3010
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", {
3011
3180
  style: {
3012
3181
  display: 'block',
@@ -3053,7 +3222,7 @@ const TD = ({
3053
3222
  },
3054
3223
  title: optionItem.content
3055
3224
  }, optionItem.content === 0 ? optionItem.content.toString() : optionItem.content ? optionItem.content : ''));
3056
- }))) : ''), hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default["default"].createElement("div", {
3225
+ }))) : ''), hasOwnerProperty(item, 'contentList') && !collapseFullRow && /*#__PURE__*/React__default["default"].createElement("div", {
3057
3226
  style: {
3058
3227
  overflow: 'auto',
3059
3228
  marginTop: '10px',
@@ -3214,7 +3383,12 @@ const Table = ({
3214
3383
  draggableColor,
3215
3384
  getDraggableData,
3216
3385
  draggableItemBoxShadow,
3217
- draggableItemBackgroundColor
3386
+ draggableItemBackgroundColor,
3387
+ tableBorder,
3388
+ tableBorderColor,
3389
+ collapseFullRow,
3390
+ openArrow,
3391
+ closeArrow
3218
3392
  }) => {
3219
3393
  const itemRefs = React.useRef({});
3220
3394
  const headerRef = React.useRef(null);
@@ -3348,8 +3522,8 @@ const Table = ({
3348
3522
  status: 'close',
3349
3523
  checkIndex: null,
3350
3524
  arrowComponent: true,
3351
- openArrow: /*#__PURE__*/React__default["default"].createElement(SvgUpArrow, null),
3352
- 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)
3353
3527
  };
3354
3528
  if (type === 'body') {
3355
3529
  return data.map((item, index) => {
@@ -3513,6 +3687,49 @@ const Table = ({
3513
3687
  prev[rowPosition] = checkedOpenableRow;
3514
3688
  return [...prev];
3515
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
+ }
3516
3733
  };
3517
3734
  const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
3518
3735
  let single = {};
@@ -3553,6 +3770,7 @@ const Table = ({
3553
3770
  };
3554
3771
  const handleCheckArrowActionHeader = (e, item) => {
3555
3772
  e.stopPropagation();
3773
+ let mergedArray = [];
3556
3774
  const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
3557
3775
  if (item.checkIndex === (draggable && !showOrder ? innerIndex - 1 : draggable && showOrder ? innerIndex - 2 : innerIndex)) {
3558
3776
  if (item.status === 'close') {
@@ -3575,8 +3793,52 @@ const Table = ({
3575
3793
  return iElem;
3576
3794
  });
3577
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
+ }
3578
3840
  setHeader(() => checkedOpenableAllRows);
3579
- setBody(() => checkedOpenableAllRowsBody);
3841
+ setBody(() => !collapseFullRow ? checkedOpenableAllRowsBody : mergedArray);
3580
3842
  };
3581
3843
  const handleCheckDots = (e, item, index, innerIndex) => {
3582
3844
  e.stopPropagation();
@@ -3845,8 +4107,11 @@ const Table = ({
3845
4107
  return configStyles.TABLE && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("table", {
3846
4108
  style: {
3847
4109
  width: '100%',
3848
- borderCollapse: tableRowItem ?? configStyles.TABLE.body.row.asItem ? 'separate' : 'collapse',
3849
- borderSpacing: `0 ${tBodyRowMarginTop ?? configStyles.TABLE.body.row.marginTop}`
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'
3850
4115
  },
3851
4116
  onClick: handleTableClick,
3852
4117
  className: classProps
@@ -3856,7 +4121,7 @@ const Table = ({
3856
4121
  style: {
3857
4122
  color: tHeadColor ?? configStyles.TABLE.head.color,
3858
4123
  backgroundColor: tHeadBackgroundColor ?? configStyles.TABLE.head.colors.background,
3859
- borderColor: hideBorder ? 'transparent' : '#eeeeee'
4124
+ borderColor: hideBorder ? 'transparent' : tableBorderColor ?? configStyles.TABLE.borderColor
3860
4125
  }
3861
4126
  }, header.map((item, index) => {
3862
4127
  return /*#__PURE__*/React__default["default"].createElement(TH, {
@@ -3933,7 +4198,8 @@ const Table = ({
3933
4198
  borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.body.row.border,
3934
4199
  borderRightColor: innerIndex === Object.values(item).length - 1 ? 'transparent' : configStyles.TABLE.body.row.borderColor,
3935
4200
  handleCheckArrowAction: handleCheckArrowAction,
3936
- handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
4201
+ handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow,
4202
+ collapseFullRow: collapseFullRow
3937
4203
  });
3938
4204
  }));
3939
4205
  })) : '', body && body.length > 0 && draggable && dragging && draggedItem && /*#__PURE__*/React__default["default"].createElement("tbody", null, /*#__PURE__*/React__default["default"].createElement("tr", {
@@ -4025,7 +4291,12 @@ Table.propTypes = {
4025
4291
  openListFontStyle: PropTypes__default["default"].string,
4026
4292
  openListFontWeight: PropTypes__default["default"].string,
4027
4293
  openListFontFamily: PropTypes__default["default"].string,
4028
- 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
4029
4300
  };
4030
4301
 
4031
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)}}";
@@ -4625,6 +4896,7 @@ const TelInput = ({
4625
4896
  disabled: disabled,
4626
4897
  onInput: handleChange,
4627
4898
  name: inpAttributes?.iName,
4899
+ className: "tui-color-placeholder",
4628
4900
  placeholder: inpAttributes?.placeholder,
4629
4901
  autoComplete: inpAttributes?.autoComplete,
4630
4902
  style: {
@@ -4677,6 +4949,7 @@ const TextInput = ({
4677
4949
  disabled: disabled,
4678
4950
  onInput: handleChange,
4679
4951
  name: inpAttributes?.iName,
4952
+ className: "tui-color-placeholder",
4680
4953
  placeholder: inpAttributes?.placeholder,
4681
4954
  autoComplete: inpAttributes?.autoComplete,
4682
4955
  style: {
@@ -4735,6 +5008,7 @@ const PassInput = ({
4735
5008
  disabled: disabled,
4736
5009
  onInput: handleChange,
4737
5010
  name: inpAttributes?.iName,
5011
+ className: "tui-color-placeholder",
4738
5012
  placeholder: inpAttributes?.placeholder,
4739
5013
  autoComplete: inpAttributes?.autoComplete,
4740
5014
  style: {
@@ -4775,7 +5049,16 @@ const NumberInput = ({
4775
5049
  let prevValue = innerValue;
4776
5050
  let currentValue = event.target.value.replace(/\.|․|\.|,/g, '.');
4777
5051
  currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4778
- setInnerValue(() => cardNumber ? currentValue.replace(/(\d{4})(?=\d)/g, '$1-') : currentValue);
5052
+ if (cardNumber) {
5053
+ let digits = currentValue.replace(/\D/g, '');
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
+ }
5059
+ } else {
5060
+ setInnerValue(() => currentValue);
5061
+ }
4779
5062
  if (inputChange && currentValue !== prevValue) {
4780
5063
  if (currentValue < Number.MIN_SAFE_INTEGER || currentValue > Number.MAX_SAFE_INTEGER) {
4781
5064
  if (!cardNumber) {
@@ -4848,14 +5131,24 @@ const NumberInput = ({
4848
5131
  if (value !== undefined && value !== null) {
4849
5132
  newValue = handleUtilsCheckTypeNumber(value, newValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4850
5133
  }
4851
- setInnerValue(() => cardNumber ? newValue.replace(/(\d{4})(?=\d)/g, '$1-') : newValue);
4852
- // inputChange(cardNumber ? newValue.replaceAll('-', '') : newValue);
5134
+ if (cardNumber) {
5135
+ let digits = newValue.replace(/\D/g, '');
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
+ }
5141
+ } else {
5142
+ setInnerValue(() => newValue);
5143
+ }
4853
5144
  }, [dots, value, float, cardNumber, maxNumSize, minNumSize, numberMaxLength]);
4854
5145
  return /*#__PURE__*/React__default["default"].createElement("input", {
4855
5146
  type: "text",
5147
+ inputMode: "decimal",
4856
5148
  value: innerValue,
4857
5149
  disabled: disabled,
4858
5150
  name: inpAttributes?.iName,
5151
+ className: "tui-color-placeholder",
4859
5152
  placeholder: inpAttributes?.placeholder,
4860
5153
  autoComplete: inpAttributes?.autoComplete,
4861
5154
  style: {
@@ -4961,6 +5254,7 @@ const Input = ({
4961
5254
  numberMaxLength,
4962
5255
  backgroundColor,
4963
5256
  errorIconMargin,
5257
+ placeholderColor,
4964
5258
  withZero = false,
4965
5259
  labelMarginBottom,
4966
5260
  regexpErrorMessage,
@@ -5075,7 +5369,9 @@ const Input = ({
5075
5369
  }, []);
5076
5370
  return configStyles.INPUT && /*#__PURE__*/React__default["default"].createElement("div", {
5077
5371
  className: classProps
5078
- }, label ? /*#__PURE__*/React__default["default"].createElement("label", {
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", {
5079
5375
  style: {
5080
5376
  maxWidth: '100%',
5081
5377
  color: labelColor ?? configStyles.INPUT.label.color,
@@ -5303,6 +5599,7 @@ Input.propTypes = {
5303
5599
  labelMarginBottom: PropTypes__default["default"].string,
5304
5600
  borderRight: PropTypes__default["default"].string,
5305
5601
  placeholder: PropTypes__default["default"].string,
5602
+ placeholderColor: PropTypes__default["default"].string,
5306
5603
  phoneDisplay: PropTypes__default["default"].string,
5307
5604
  autoComplete: PropTypes__default["default"].string,
5308
5605
  errorDots: PropTypes__default["default"].bool,
@@ -6854,7 +7151,7 @@ const Stepper = ({
6854
7151
  }, (() => {
6855
7152
  let steppers = [];
6856
7153
  for (let step = 1; step <= stepLength; step++) {
6857
- steppers.push( /*#__PURE__*/React__default["default"].createElement("div", {
7154
+ steppers.push(/*#__PURE__*/React__default["default"].createElement("div", {
6858
7155
  className: classnames__default["default"](`${step <= activeSteps ? styles$3.activeRing : styles$3.bigRing}`),
6859
7156
  key: step
6860
7157
  }, /*#__PURE__*/React__default["default"].createElement("div", {