@xaypay/tui 0.2.19 → 0.2.20

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 CHANGED
@@ -1680,6 +1680,37 @@ const SvgDeleteComponent = ({
1680
1680
  fill: fillColor ? fillColor : '#E00'
1681
1681
  }));
1682
1682
 
1683
+ function styleInject(css, ref) {
1684
+ if ( ref === void 0 ) ref = {};
1685
+ var insertAt = ref.insertAt;
1686
+
1687
+ if (!css || typeof document === 'undefined') { return; }
1688
+
1689
+ var head = document.head || document.getElementsByTagName('head')[0];
1690
+ var style = document.createElement('style');
1691
+ style.type = 'text/css';
1692
+
1693
+ if (insertAt === 'top') {
1694
+ if (head.firstChild) {
1695
+ head.insertBefore(style, head.firstChild);
1696
+ } else {
1697
+ head.appendChild(style);
1698
+ }
1699
+ } else {
1700
+ head.appendChild(style);
1701
+ }
1702
+
1703
+ if (style.styleSheet) {
1704
+ style.styleSheet.cssText = css;
1705
+ } else {
1706
+ style.appendChild(document.createTextNode(css));
1707
+ }
1708
+ }
1709
+
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"};
1712
+ styleInject(css_248z$d);
1713
+
1683
1714
  // eslint-disable-next-line react/display-name
1684
1715
  const File = /*#__PURE__*/forwardRef(({
1685
1716
  or,
@@ -1775,6 +1806,7 @@ const File = /*#__PURE__*/forwardRef(({
1775
1806
  listItemBackgroundColor,
1776
1807
  listItemBackgroundErrorColor,
1777
1808
  maxCHoosenLengthErrorHideTime,
1809
+ showPreviewIconInSmallComponent,
1778
1810
  maxSize = 10,
1779
1811
  preview = true,
1780
1812
  timeForRemoveError = 5000,
@@ -2217,6 +2249,7 @@ const File = /*#__PURE__*/forwardRef(({
2217
2249
  padding: '0px 10px'
2218
2250
  }
2219
2251
  }, fileSizeText ?? configStyles.FILE.sizeText, " ", maxSize, " \u0544\u0532 (", ' ', fileExtensions.toString().split(',').join(', '), " )"))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
2252
+ className: styles$b['small-file-component'],
2220
2253
  style: {
2221
2254
  width: '100%',
2222
2255
  padding: '5px',
@@ -2225,7 +2258,20 @@ const File = /*#__PURE__*/forwardRef(({
2225
2258
  boxSizing: 'border-box',
2226
2259
  justifyContent: 'space-between'
2227
2260
  }
2228
- }, /*#__PURE__*/React__default.createElement(Button, {
2261
+ }, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default.createElement(Button, {
2262
+ contentWidth: true,
2263
+ onClick: _ => _,
2264
+ font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
2265
+ size: uploadBtnSize ?? configStyles.FILE.uploadBtn.font.size,
2266
+ style: uploadBtnStyle ?? configStyles.FILE.uploadBtn.font.style,
2267
+ weight: uploadBtnWeight ?? configStyles.FILE.uploadBtn.font.weight,
2268
+ label: uploadBtnLabel ?? configStyles.FILE.uploadBtn.label,
2269
+ color: uploadBtnColor ?? configStyles.FILE.uploadBtn.color,
2270
+ height: uploadBtnHeight ?? configStyles.FILE.uploadBtn.height,
2271
+ hoverColor: uploadBtnHoverColor ?? configStyles.FILE.uploadBtn.colors.hover,
2272
+ backgroundColor: uploadBtnBackgroundColor ?? configStyles.FILE.uploadBtn.colors.background,
2273
+ backgroundHoverColor: uploadBtnBackgroundColorHover ?? configStyles.FILE.uploadBtn.colors.backgroundHover
2274
+ }) : image === 'pdf' ? iconPdf ? iconPdf : configStyles.FILE.icon.pdf ? configStyles.FILE.icon.pdf : /*#__PURE__*/React__default.createElement(SvgPdf, null) : image === 'heif' || image === 'heic' ? iconHeic ? iconHeic : configStyles.FILE.icon.heic ? configStyles.FILE.icon.heic : /*#__PURE__*/React__default.createElement(SvgHeic, null) : image === 'doc' ? iconDoc ? iconDoc : configStyles.FILE.icon.doc ? configStyles.FILE.icon.doc : /*#__PURE__*/React__default.createElement(SvgDocIcon, null) : image === 'docx' ? iconDocx ? iconDocx : configStyles.FILE.icon.docx ? configStyles.FILE.icon.docx : /*#__PURE__*/React__default.createElement(SvgDocIcon, null) : singleFile[0].type === 'image/jpeg' ? iconJpeg ? iconJpeg : configStyles.FILE.icon.jpeg ? configStyles.FILE.icon.jpeg : /*#__PURE__*/React__default.createElement(SvgListItemJpeg, null) : singleFile[0].type === 'image/png' ? iconPng ? iconPng : configStyles.FILE.icon.png ? configStyles.FILE.icon.png : /*#__PURE__*/React__default.createElement(SvgListItemPng, null) : singleFile[0].type === 'image/jpg' ? iconJpeg ? iconJpg : configStyles.FILE.icon.jpg ? configStyles.FILE.icon.jpg : /*#__PURE__*/React__default.createElement(SvgListItemJpg, null) : '' : /*#__PURE__*/React__default.createElement(Button, {
2229
2275
  contentWidth: true,
2230
2276
  onClick: _ => _,
2231
2277
  font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
@@ -2415,6 +2461,7 @@ File.propTypes = {
2415
2461
  listItemBackgroundErrorColor: PropTypes.string,
2416
2462
  maxCHoosenLengthErrorHideTime: PropTypes.number,
2417
2463
  filesArray: PropTypes.arrayOf(PropTypes.object),
2464
+ showPreviewIconInSmallComponent: PropTypes.bool,
2418
2465
  fileExtensions: PropTypes.arrayOf(PropTypes.string)
2419
2466
  };
2420
2467
 
@@ -2679,33 +2726,6 @@ const handleRemoveLeadingZeros = str => {
2679
2726
  return str.replace(/^0+(\d)/, '$1');
2680
2727
  };
2681
2728
 
2682
- function styleInject(css, ref) {
2683
- if ( ref === void 0 ) ref = {};
2684
- var insertAt = ref.insertAt;
2685
-
2686
- if (!css || typeof document === 'undefined') { return; }
2687
-
2688
- var head = document.head || document.getElementsByTagName('head')[0];
2689
- var style = document.createElement('style');
2690
- style.type = 'text/css';
2691
-
2692
- if (insertAt === 'top') {
2693
- if (head.firstChild) {
2694
- head.insertBefore(style, head.firstChild);
2695
- } else {
2696
- head.appendChild(style);
2697
- }
2698
- } else {
2699
- head.appendChild(style);
2700
- }
2701
-
2702
- if (style.styleSheet) {
2703
- style.styleSheet.cssText = css;
2704
- } else {
2705
- style.appendChild(document.createTextNode(css));
2706
- }
2707
- }
2708
-
2709
2729
  var css_248z$c = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}.table-module_list-text__kmKIq{align-items:center;cursor:pointer;display:flex;margin:0 0 8px;min-height:38px;white-space:wrap}.table-module_dots-option-item__jNOxO{box-sizing:border-box;cursor:pointer;display:flex;height:39px;margin-bottom:2px;padding:10px;position:relative;width:100%}.table-module_dots-option-item__jNOxO:after{background-color:#eee;border-radius:1px;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;-o-border-radius:1px;content:\"\";height:2px;left:10px;position:absolute;top:calc(100% - 2px);width:calc(100% - 20px)}.table-module_dots-option-item__jNOxO:last-child:after{display:none}.table-module_no-tabel-data__6xp3N{align-items:center;display:flex;height:200px;justify-content:center;width:100%}";
2710
2730
  var styles$a = {"sorting-arrows":"table-module_sorting-arrows__BaN-G","td-span":"table-module_td-span__XHo6k","list-text":"table-module_list-text__kmKIq","dots-option-item":"table-module_dots-option-item__jNOxO","no-tabel-data":"table-module_no-tabel-data__6xp3N"};
2711
2731
  styleInject(css_248z$c);
@@ -4744,7 +4764,12 @@ const NumberInput = ({
4744
4764
  let prevValue = innerValue;
4745
4765
  let currentValue = event.target.value.replace(/\.|․|\.|,/g, '.');
4746
4766
  currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4747
- setInnerValue(() => cardNumber ? currentValue.replace(/(\d{4})(?=\d)/g, '$1-') : currentValue);
4767
+ if (cardNumber) {
4768
+ let digits = currentValue.replace(/\D/g, '');
4769
+ setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
4770
+ } else {
4771
+ setInnerValue(() => currentValue);
4772
+ }
4748
4773
  if (inputChange && currentValue !== prevValue) {
4749
4774
  if (currentValue < Number.MIN_SAFE_INTEGER || currentValue > Number.MAX_SAFE_INTEGER) {
4750
4775
  if (!cardNumber) {
@@ -4817,11 +4842,16 @@ const NumberInput = ({
4817
4842
  if (value !== undefined && value !== null) {
4818
4843
  newValue = handleUtilsCheckTypeNumber(value, newValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4819
4844
  }
4820
- setInnerValue(() => cardNumber ? newValue.replace(/(\d{4})(?=\d)/g, '$1-') : newValue);
4821
- // inputChange(cardNumber ? newValue.replaceAll('-', '') : newValue);
4845
+ if (cardNumber) {
4846
+ let digits = newValue.replace(/\D/g, '');
4847
+ setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
4848
+ } else {
4849
+ setInnerValue(() => newValue);
4850
+ }
4822
4851
  }, [dots, value, float, cardNumber, maxNumSize, minNumSize, numberMaxLength]);
4823
4852
  return /*#__PURE__*/React__default.createElement("input", {
4824
4853
  type: "text",
4854
+ inputMode: "decimal",
4825
4855
  value: innerValue,
4826
4856
  disabled: disabled,
4827
4857
  name: inpAttributes?.iName,
package/dist/index.js CHANGED
@@ -1711,6 +1711,37 @@ const SvgDeleteComponent = ({
1711
1711
  fill: fillColor ? fillColor : '#E00'
1712
1712
  }));
1713
1713
 
1714
+ function styleInject(css, ref) {
1715
+ if ( ref === void 0 ) ref = {};
1716
+ var insertAt = ref.insertAt;
1717
+
1718
+ if (!css || typeof document === 'undefined') { return; }
1719
+
1720
+ var head = document.head || document.getElementsByTagName('head')[0];
1721
+ var style = document.createElement('style');
1722
+ style.type = 'text/css';
1723
+
1724
+ if (insertAt === 'top') {
1725
+ if (head.firstChild) {
1726
+ head.insertBefore(style, head.firstChild);
1727
+ } else {
1728
+ head.appendChild(style);
1729
+ }
1730
+ } else {
1731
+ head.appendChild(style);
1732
+ }
1733
+
1734
+ if (style.styleSheet) {
1735
+ style.styleSheet.cssText = css;
1736
+ } else {
1737
+ style.appendChild(document.createTextNode(css));
1738
+ }
1739
+ }
1740
+
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"};
1743
+ styleInject(css_248z$d);
1744
+
1714
1745
  // eslint-disable-next-line react/display-name
1715
1746
  const File = /*#__PURE__*/React.forwardRef(({
1716
1747
  or,
@@ -1806,6 +1837,7 @@ const File = /*#__PURE__*/React.forwardRef(({
1806
1837
  listItemBackgroundColor,
1807
1838
  listItemBackgroundErrorColor,
1808
1839
  maxCHoosenLengthErrorHideTime,
1840
+ showPreviewIconInSmallComponent,
1809
1841
  maxSize = 10,
1810
1842
  preview = true,
1811
1843
  timeForRemoveError = 5000,
@@ -2248,6 +2280,7 @@ const File = /*#__PURE__*/React.forwardRef(({
2248
2280
  padding: '0px 10px'
2249
2281
  }
2250
2282
  }, 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", {
2283
+ className: styles$b['small-file-component'],
2251
2284
  style: {
2252
2285
  width: '100%',
2253
2286
  padding: '5px',
@@ -2256,7 +2289,20 @@ const File = /*#__PURE__*/React.forwardRef(({
2256
2289
  boxSizing: 'border-box',
2257
2290
  justifyContent: 'space-between'
2258
2291
  }
2259
- }, /*#__PURE__*/React__default["default"].createElement(Button, {
2292
+ }, showPreviewIconInSmallComponent ? !image ? /*#__PURE__*/React__default["default"].createElement(Button, {
2293
+ contentWidth: true,
2294
+ onClick: _ => _,
2295
+ font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
2296
+ size: uploadBtnSize ?? configStyles.FILE.uploadBtn.font.size,
2297
+ style: uploadBtnStyle ?? configStyles.FILE.uploadBtn.font.style,
2298
+ weight: uploadBtnWeight ?? configStyles.FILE.uploadBtn.font.weight,
2299
+ label: uploadBtnLabel ?? configStyles.FILE.uploadBtn.label,
2300
+ color: uploadBtnColor ?? configStyles.FILE.uploadBtn.color,
2301
+ height: uploadBtnHeight ?? configStyles.FILE.uploadBtn.height,
2302
+ hoverColor: uploadBtnHoverColor ?? configStyles.FILE.uploadBtn.colors.hover,
2303
+ backgroundColor: uploadBtnBackgroundColor ?? configStyles.FILE.uploadBtn.colors.background,
2304
+ backgroundHoverColor: uploadBtnBackgroundColorHover ?? configStyles.FILE.uploadBtn.colors.backgroundHover
2305
+ }) : 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
2306
  contentWidth: true,
2261
2307
  onClick: _ => _,
2262
2308
  font: uploadBtnFont ?? configStyles.FILE.uploadBtn.font.family,
@@ -2446,6 +2492,7 @@ File.propTypes = {
2446
2492
  listItemBackgroundErrorColor: PropTypes__default["default"].string,
2447
2493
  maxCHoosenLengthErrorHideTime: PropTypes__default["default"].number,
2448
2494
  filesArray: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
2495
+ showPreviewIconInSmallComponent: PropTypes__default["default"].bool,
2449
2496
  fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
2450
2497
  };
2451
2498
 
@@ -2710,33 +2757,6 @@ const handleRemoveLeadingZeros = str => {
2710
2757
  return str.replace(/^0+(\d)/, '$1');
2711
2758
  };
2712
2759
 
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
2760
  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
2761
  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
2762
  styleInject(css_248z$c);
@@ -4775,7 +4795,12 @@ const NumberInput = ({
4775
4795
  let prevValue = innerValue;
4776
4796
  let currentValue = event.target.value.replace(/\.|․|\.|,/g, '.');
4777
4797
  currentValue = handleUtilsCheckTypeNumber(currentValue, prevValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4778
- setInnerValue(() => cardNumber ? currentValue.replace(/(\d{4})(?=\d)/g, '$1-') : currentValue);
4798
+ if (cardNumber) {
4799
+ let digits = currentValue.replace(/\D/g, '');
4800
+ setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
4801
+ } else {
4802
+ setInnerValue(() => currentValue);
4803
+ }
4779
4804
  if (inputChange && currentValue !== prevValue) {
4780
4805
  if (currentValue < Number.MIN_SAFE_INTEGER || currentValue > Number.MAX_SAFE_INTEGER) {
4781
4806
  if (!cardNumber) {
@@ -4848,11 +4873,16 @@ const NumberInput = ({
4848
4873
  if (value !== undefined && value !== null) {
4849
4874
  newValue = handleUtilsCheckTypeNumber(value, newValue, null, float, maxNumSize, dots, innerMinNumSize, numberMaxLength, cardNumber);
4850
4875
  }
4851
- setInnerValue(() => cardNumber ? newValue.replace(/(\d{4})(?=\d)/g, '$1-') : newValue);
4852
- // inputChange(cardNumber ? newValue.replaceAll('-', '') : newValue);
4876
+ if (cardNumber) {
4877
+ let digits = newValue.replace(/\D/g, '');
4878
+ setInnerValue(() => digits.replace(/(\d{4})(?=\d)/g, '$1-'));
4879
+ } else {
4880
+ setInnerValue(() => newValue);
4881
+ }
4853
4882
  }, [dots, value, float, cardNumber, maxNumSize, minNumSize, numberMaxLength]);
4854
4883
  return /*#__PURE__*/React__default["default"].createElement("input", {
4855
4884
  type: "text",
4885
+ inputMode: "decimal",
4856
4886
  value: innerValue,
4857
4887
  disabled: disabled,
4858
4888
  name: inpAttributes?.iName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",