@xaypay/tui 0.0.91 → 0.0.92
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 +129 -111
- package/dist/index.js +129 -111
- package/package.json +1 -1
- package/src/components/input/index.js +15 -1
- package/src/components/input/input.module.css +1 -0
- package/src/components/newAutocomplete/autocomplete.module.css +3 -0
- package/src/components/newAutocomplete/index.js +3 -0
- package/src/components/select/select.module.css +2 -0
- package/src/components/textarea/textarea.module.css +4 -0
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ export const Input = ({
|
|
|
45
45
|
errorSize,
|
|
46
46
|
labelSize,
|
|
47
47
|
maxLength,
|
|
48
|
+
floatToFix,
|
|
48
49
|
minNumSize,
|
|
49
50
|
maxNumSize,
|
|
50
51
|
labelColor,
|
|
@@ -147,6 +148,18 @@ export const Input = ({
|
|
|
147
148
|
change(maxNumSize);
|
|
148
149
|
}
|
|
149
150
|
}
|
|
151
|
+
if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(currentValue))) {
|
|
152
|
+
const floatNumParts = currentValue.split('.');
|
|
153
|
+
const int = floatNumParts[0];
|
|
154
|
+
const float = floatNumParts[1];
|
|
155
|
+
|
|
156
|
+
if (float && float.length > floatToFix) {
|
|
157
|
+
setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
|
|
158
|
+
if (change) {
|
|
159
|
+
change(`${int}.${float.substr(0, floatToFix)}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
150
163
|
if (currentValue === '') {
|
|
151
164
|
setInnerValue('');
|
|
152
165
|
if (change) {
|
|
@@ -309,9 +322,9 @@ export const Input = ({
|
|
|
309
322
|
disabled={disabled ? disabled : ""}
|
|
310
323
|
name={name ? name : `tui_${random}_tui`}
|
|
311
324
|
placeholder={placeholder ? placeholder : ''}
|
|
312
|
-
autoComplete={autoComplete ? autoComplete : configStyles.INPUT.autoComplete}
|
|
313
325
|
min={type === 'number' && minNumSize ? minNumSize: ''}
|
|
314
326
|
max={type === 'number' && maxNumSize ? maxNumSize : ''}
|
|
327
|
+
autoComplete={autoComplete ? autoComplete : configStyles.INPUT.autoComplete}
|
|
315
328
|
style={{
|
|
316
329
|
border: 'none',
|
|
317
330
|
outline: 'none',
|
|
@@ -401,6 +414,7 @@ Input.propTypes = {
|
|
|
401
414
|
errorLeft: PropTypes.string,
|
|
402
415
|
labelSize: PropTypes.string,
|
|
403
416
|
maxLength: PropTypes.number,
|
|
417
|
+
floatToFix: PropTypes.number,
|
|
404
418
|
minNumSize: PropTypes.number,
|
|
405
419
|
maxNumSize: PropTypes.number,
|
|
406
420
|
errorColor: PropTypes.string,
|
|
@@ -4,6 +4,8 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { keyframes, css } from 'styled-components';
|
|
5
5
|
|
|
6
6
|
import { compereConfigs } from './../../utils';
|
|
7
|
+
|
|
8
|
+
import styles from './autocomplete.module.css';
|
|
7
9
|
|
|
8
10
|
export const NewAutocomplete = ({
|
|
9
11
|
label,
|
|
@@ -320,6 +322,7 @@ export const NewAutocomplete = ({
|
|
|
320
322
|
onInput={handleChange}
|
|
321
323
|
onMouseEnter={handleMouseEnter}
|
|
322
324
|
onMouseLeave={handleMouseLeave}
|
|
325
|
+
className={styles['auto-complete']}
|
|
323
326
|
placeholder={placeHolder ? placeHolder : ''}
|
|
324
327
|
autoComplete={autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete}
|
|
325
328
|
style={{
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
position: relative;
|
|
5
|
+
-webkit-appearance: none;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.select-content-top {
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
flex-wrap: nowrap;
|
|
11
12
|
align-items: center;
|
|
12
13
|
justify-content: space-between;
|
|
14
|
+
-webkit-appearance: none;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
.select-content-bottom {
|