@xaypay/tui 0.0.114 → 0.0.115
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 +13 -5
- package/dist/index.js +13 -5
- package/package.json +1 -1
- package/src/components/input/index.js +24 -4
- package/src/components/table/table.stories.js +1 -1
- package/src/components/table/th.js +7 -1
- package/tui.config.js +1 -0
package/dist/index.es.js
CHANGED
|
@@ -401,7 +401,7 @@ const TH = ({
|
|
|
401
401
|
borderTopRightRadius: borderTopRightRadius
|
|
402
402
|
},
|
|
403
403
|
onClick: handleHeaderItemClick,
|
|
404
|
-
className: `${item.sortingArrows
|
|
404
|
+
className: `${hasOwnerProperty(item, 'sortingArrows') ? item.sortingArrows === true ? styles$c['sorting-arrows'] : '' : ''}`
|
|
405
405
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
406
406
|
style: {
|
|
407
407
|
display: 'flex',
|
|
@@ -1923,10 +1923,11 @@ const Input = ({
|
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
|
-
|
|
1927
|
-
|
|
1926
|
+
const max = configStyles.INPUT.maxLength || maxLength;
|
|
1927
|
+
if (max && currentValue.length > max && type !== 'tel' && type !== 'number') {
|
|
1928
|
+
setInnerValue(currentValue.substr(0, max));
|
|
1928
1929
|
if (change) {
|
|
1929
|
-
change(currentValue.substr(0,
|
|
1930
|
+
change(currentValue.substr(0, max));
|
|
1930
1931
|
}
|
|
1931
1932
|
}
|
|
1932
1933
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
@@ -2067,12 +2068,19 @@ const Input = ({
|
|
|
2067
2068
|
if (maxLength && value.length > maxLength && type !== 'tel') {
|
|
2068
2069
|
setInnerValue(value.substr(0, maxLength));
|
|
2069
2070
|
}
|
|
2071
|
+
const max = configStyles.INPUT.maxLength || maxLength;
|
|
2072
|
+
if (max && value.length > max && type !== 'tel' && type !== 'number') {
|
|
2073
|
+
setInnerValue(value.substr(0, max));
|
|
2074
|
+
if (change) {
|
|
2075
|
+
change(value.substr(0, max));
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2070
2078
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
2071
2079
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
2072
2080
|
}
|
|
2073
2081
|
}
|
|
2074
2082
|
}
|
|
2075
|
-
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
2083
|
+
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage, configStyles.INPUT.maxLength]);
|
|
2076
2084
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2077
2085
|
className: `${styles$a['input-wrap']}`
|
|
2078
2086
|
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
package/dist/index.js
CHANGED
|
@@ -431,7 +431,7 @@ const TH = ({
|
|
|
431
431
|
borderTopRightRadius: borderTopRightRadius
|
|
432
432
|
},
|
|
433
433
|
onClick: handleHeaderItemClick,
|
|
434
|
-
className: `${item.sortingArrows
|
|
434
|
+
className: `${hasOwnerProperty(item, 'sortingArrows') ? item.sortingArrows === true ? styles$c['sorting-arrows'] : '' : ''}`
|
|
435
435
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
436
436
|
style: {
|
|
437
437
|
display: 'flex',
|
|
@@ -1953,10 +1953,11 @@ const Input = ({
|
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1956
|
+
const max = configStyles.INPUT.maxLength || maxLength;
|
|
1957
|
+
if (max && currentValue.length > max && type !== 'tel' && type !== 'number') {
|
|
1958
|
+
setInnerValue(currentValue.substr(0, max));
|
|
1958
1959
|
if (change) {
|
|
1959
|
-
change(currentValue.substr(0,
|
|
1960
|
+
change(currentValue.substr(0, max));
|
|
1960
1961
|
}
|
|
1961
1962
|
}
|
|
1962
1963
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
@@ -2097,12 +2098,19 @@ const Input = ({
|
|
|
2097
2098
|
if (maxLength && value.length > maxLength && type !== 'tel') {
|
|
2098
2099
|
setInnerValue(value.substr(0, maxLength));
|
|
2099
2100
|
}
|
|
2101
|
+
const max = configStyles.INPUT.maxLength || maxLength;
|
|
2102
|
+
if (max && value.length > max && type !== 'tel' && type !== 'number') {
|
|
2103
|
+
setInnerValue(value.substr(0, max));
|
|
2104
|
+
if (change) {
|
|
2105
|
+
change(value.substr(0, max));
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2100
2108
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
2101
2109
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
2102
2110
|
}
|
|
2103
2111
|
}
|
|
2104
2112
|
}
|
|
2105
|
-
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
2113
|
+
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage, configStyles.INPUT.maxLength]);
|
|
2106
2114
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2107
2115
|
className: `${styles$a['input-wrap']}`
|
|
2108
2116
|
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
package/package.json
CHANGED
|
@@ -235,10 +235,12 @@ export const Input = ({
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
const max = configStyles.INPUT.maxLength || maxLength
|
|
239
|
+
|
|
240
|
+
if (max && currentValue.length > max && type !== 'tel' && type !== 'number') {
|
|
241
|
+
setInnerValue(currentValue.substr(0, max))
|
|
240
242
|
if (change) {
|
|
241
|
-
change(currentValue.substr(0,
|
|
243
|
+
change(currentValue.substr(0, max))
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
246
|
|
|
@@ -392,12 +394,30 @@ export const Input = ({
|
|
|
392
394
|
setInnerValue(value.substr(0, maxLength))
|
|
393
395
|
}
|
|
394
396
|
|
|
397
|
+
const max = configStyles.INPUT.maxLength || maxLength
|
|
398
|
+
|
|
399
|
+
if (max && value.length > max && type !== 'tel' && type !== 'number') {
|
|
400
|
+
setInnerValue(value.substr(0, max))
|
|
401
|
+
if (change) {
|
|
402
|
+
change(value.substr(0, max))
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
395
406
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
396
407
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('')
|
|
397
408
|
}
|
|
398
409
|
}
|
|
399
410
|
}
|
|
400
|
-
}, [
|
|
411
|
+
}, [
|
|
412
|
+
type,
|
|
413
|
+
value,
|
|
414
|
+
regexp,
|
|
415
|
+
maxLength,
|
|
416
|
+
errorMessage,
|
|
417
|
+
regexpErrorMessage,
|
|
418
|
+
telErrorMessage,
|
|
419
|
+
configStyles.INPUT.maxLength,
|
|
420
|
+
])
|
|
401
421
|
|
|
402
422
|
return (
|
|
403
423
|
<div className={`${styles['input-wrap']}`}>
|
|
@@ -40,7 +40,13 @@ const TH = ({
|
|
|
40
40
|
borderTopRightRadius: borderTopRightRadius,
|
|
41
41
|
}}
|
|
42
42
|
onClick={handleHeaderItemClick}
|
|
43
|
-
className={`${
|
|
43
|
+
className={`${
|
|
44
|
+
hasOwnerProperty(item, 'sortingArrows')
|
|
45
|
+
? item.sortingArrows === true
|
|
46
|
+
? styles['sorting-arrows']
|
|
47
|
+
: ''
|
|
48
|
+
: ''
|
|
49
|
+
}`}
|
|
44
50
|
>
|
|
45
51
|
<div
|
|
46
52
|
style={{
|
package/tui.config.js
CHANGED
|
@@ -32,6 +32,7 @@ module.exports = {
|
|
|
32
32
|
width: '100%', // for width
|
|
33
33
|
radius: '0px', // for input and also (if there exist left or right icons) icons block border-radius
|
|
34
34
|
className: '', // for input classname (you can set custom class for your custom css)
|
|
35
|
+
maxLength: 255, // for characters maximum count
|
|
35
36
|
height: '46px', // for height
|
|
36
37
|
required: false, // for showing required mark on label (it meens input is required)
|
|
37
38
|
disabled: false, // for disabled
|