@acusti/css-value-input 0.19.0 → 0.20.0
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/CSSValueInput.d.ts +31 -0
- package/dist/CSSValueInput.js +164 -0
- package/dist/CSSValueInput.js.flow +43 -0
- package/dist/CSSValueInput.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CSSValueType } from '@acusti/css-values';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** Boolean indicating if the user can submit an empty value (i.e. clear the value); defaults to true */
|
|
5
|
+
allowEmpty?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
cssValueType?: CSSValueType;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
getValueAsNumber?: (value: string | number) => number;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
label?: string;
|
|
12
|
+
max?: number;
|
|
13
|
+
min?: number;
|
|
14
|
+
name?: string;
|
|
15
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => unknown;
|
|
16
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
17
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => unknown;
|
|
18
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => unknown;
|
|
19
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => unknown;
|
|
20
|
+
onSubmitValue: (value: string) => unknown;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
step?: number;
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
unit?: string;
|
|
26
|
+
/** Regex or validator function to validate non-numeric values */
|
|
27
|
+
validator?: RegExp | ((value: string) => boolean);
|
|
28
|
+
value?: string;
|
|
29
|
+
};
|
|
30
|
+
declare const CSSValueInput: React.FC<Props>;
|
|
31
|
+
export default CSSValueInput;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { DEFAULT_CSS_VALUE_TYPE, DEFAULT_UNIT_BY_CSS_VALUE_TYPE, getCSSValueAsNumber, getCSSValueWithUnit, getUnitFromCSSValue, roundToPrecision, } from '@acusti/css-values';
|
|
2
|
+
import InputText from '@acusti/input-text';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
const { useCallback, useImperativeHandle, useRef } = React;
|
|
6
|
+
const ROOT_CLASS_NAME = 'cssvalueinput';
|
|
7
|
+
const CSSValueInput = React.forwardRef(({ allowEmpty = true, className, cssValueType = DEFAULT_CSS_VALUE_TYPE, disabled, getValueAsNumber = getCSSValueAsNumber, icon, label, max, min, name, onBlur, onChange, onFocus, onKeyDown, onKeyUp, onSubmitValue, placeholder, step = 1, tabIndex, title, unit = DEFAULT_UNIT_BY_CSS_VALUE_TYPE[cssValueType], validator, value, }, ref) => {
|
|
8
|
+
const inputRef = useRef(null);
|
|
9
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
10
|
+
const submittedValueRef = useRef(value || '');
|
|
11
|
+
const handleSubmitValue = useCallback(() => {
|
|
12
|
+
if (!inputRef.current)
|
|
13
|
+
return;
|
|
14
|
+
const currentValue = inputRef.current.value;
|
|
15
|
+
// Store last submittedValue (used to reset value on invalid input)
|
|
16
|
+
submittedValueRef.current = currentValue;
|
|
17
|
+
onSubmitValue(currentValue);
|
|
18
|
+
}, [onSubmitValue]);
|
|
19
|
+
const handleBlur = useCallback((event) => {
|
|
20
|
+
if (onBlur)
|
|
21
|
+
onBlur(event);
|
|
22
|
+
if (!inputRef.current)
|
|
23
|
+
return;
|
|
24
|
+
const currentValue = inputRef.current.value.trim();
|
|
25
|
+
// If allowEmpty and value is empty, skip all validation + normalization
|
|
26
|
+
if (allowEmpty && !currentValue) {
|
|
27
|
+
handleSubmitValue();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const currentValueAsNumber = getValueAsNumber(currentValue);
|
|
31
|
+
const isCurrentValueFinite = Number.isFinite(currentValueAsNumber);
|
|
32
|
+
if (!isCurrentValueFinite) {
|
|
33
|
+
let isValid = false;
|
|
34
|
+
if (validator instanceof RegExp) {
|
|
35
|
+
isValid = validator.test(currentValue);
|
|
36
|
+
}
|
|
37
|
+
else if (validator) {
|
|
38
|
+
isValid = validator(currentValue);
|
|
39
|
+
}
|
|
40
|
+
if (isValid) {
|
|
41
|
+
handleSubmitValue();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// If current value isn’t valid, revert to last submitted value
|
|
45
|
+
inputRef.current.value = submittedValueRef.current;
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// Normalize value by applying min/max and integer constraints
|
|
50
|
+
let normalizedValueAsNumber = currentValueAsNumber;
|
|
51
|
+
if (isCurrentValueFinite) {
|
|
52
|
+
if (min != null && currentValueAsNumber < min) {
|
|
53
|
+
normalizedValueAsNumber = min;
|
|
54
|
+
}
|
|
55
|
+
else if (max != null && currentValueAsNumber > max) {
|
|
56
|
+
normalizedValueAsNumber = max;
|
|
57
|
+
}
|
|
58
|
+
else if (cssValueType === 'integer') {
|
|
59
|
+
normalizedValueAsNumber = Math.floor(currentValueAsNumber);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (normalizedValueAsNumber !== currentValueAsNumber) {
|
|
63
|
+
const currentUnit = getUnitFromCSSValue({
|
|
64
|
+
cssValueType,
|
|
65
|
+
defaultUnit: unit,
|
|
66
|
+
value: currentValue,
|
|
67
|
+
});
|
|
68
|
+
inputRef.current.value = normalizedValueAsNumber + currentUnit;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
inputRef.current.value = getCSSValueWithUnit({
|
|
72
|
+
cssValueType,
|
|
73
|
+
defaultUnit: unit,
|
|
74
|
+
value: currentValue,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
handleSubmitValue();
|
|
78
|
+
}, [
|
|
79
|
+
allowEmpty,
|
|
80
|
+
cssValueType,
|
|
81
|
+
getValueAsNumber,
|
|
82
|
+
handleSubmitValue,
|
|
83
|
+
max,
|
|
84
|
+
min,
|
|
85
|
+
onBlur,
|
|
86
|
+
unit,
|
|
87
|
+
validator,
|
|
88
|
+
]);
|
|
89
|
+
const getNextValue = useCallback(({ currentValue, multiplier = 1, signum = 1, }) => {
|
|
90
|
+
const modifier = multiplier * step * signum;
|
|
91
|
+
const currentValueAsNumber = getValueAsNumber(currentValue);
|
|
92
|
+
// If currentValue isn’t numeric, don’t try to increment/decrement it
|
|
93
|
+
if (typeof currentValue === 'string' &&
|
|
94
|
+
Number.isNaN(currentValueAsNumber)) {
|
|
95
|
+
return currentValue;
|
|
96
|
+
}
|
|
97
|
+
let nextValue = currentValueAsNumber + modifier;
|
|
98
|
+
if (cssValueType === 'integer') {
|
|
99
|
+
nextValue = Math.floor(nextValue);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
nextValue = roundToPrecision(nextValue, 5);
|
|
103
|
+
}
|
|
104
|
+
if (typeof max === 'number' && Number.isFinite(max)) {
|
|
105
|
+
nextValue = Math.min(max, nextValue);
|
|
106
|
+
}
|
|
107
|
+
if (typeof min === 'number' && Number.isFinite(min)) {
|
|
108
|
+
nextValue = Math.max(min, nextValue);
|
|
109
|
+
}
|
|
110
|
+
const nextUnit = getUnitFromCSSValue({
|
|
111
|
+
cssValueType,
|
|
112
|
+
defaultUnit: unit,
|
|
113
|
+
value: currentValue,
|
|
114
|
+
});
|
|
115
|
+
return `${nextValue}${nextUnit}`;
|
|
116
|
+
}, [cssValueType, getValueAsNumber, max, min, step, unit]);
|
|
117
|
+
const handleKeyDown = useCallback((event) => {
|
|
118
|
+
if (onKeyDown)
|
|
119
|
+
onKeyDown(event);
|
|
120
|
+
const input = event.currentTarget;
|
|
121
|
+
const currentValue = input.value || placeholder || `0${unit}`;
|
|
122
|
+
let nextValue = '';
|
|
123
|
+
switch (event.key) {
|
|
124
|
+
case 'Escape':
|
|
125
|
+
case 'Enter':
|
|
126
|
+
if (event.key === 'Escape') {
|
|
127
|
+
input.value = submittedValueRef.current;
|
|
128
|
+
}
|
|
129
|
+
input.blur();
|
|
130
|
+
return;
|
|
131
|
+
case 'ArrowUp':
|
|
132
|
+
case 'ArrowDown':
|
|
133
|
+
nextValue = getNextValue({
|
|
134
|
+
currentValue,
|
|
135
|
+
multiplier: event.shiftKey ? 10 : 1,
|
|
136
|
+
signum: event.key === 'ArrowUp' ? 1 : -1,
|
|
137
|
+
});
|
|
138
|
+
if (nextValue === currentValue)
|
|
139
|
+
return;
|
|
140
|
+
event.stopPropagation();
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
input.value = nextValue;
|
|
143
|
+
return;
|
|
144
|
+
default:
|
|
145
|
+
// No default key handling
|
|
146
|
+
}
|
|
147
|
+
}, [getNextValue, onKeyDown, placeholder, unit]);
|
|
148
|
+
const handleKeyUp = useCallback((event) => {
|
|
149
|
+
if (onKeyUp)
|
|
150
|
+
onKeyUp(event);
|
|
151
|
+
// If this is the key up from ↑ or ↓ keys, time to handleSubmitValue
|
|
152
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
153
|
+
handleSubmitValue();
|
|
154
|
+
}
|
|
155
|
+
}, [handleSubmitValue, onKeyUp]);
|
|
156
|
+
return (React.createElement("label", { className: classnames(ROOT_CLASS_NAME, className, { disabled }), title: title },
|
|
157
|
+
icon && React.createElement("div", { className: `${ROOT_CLASS_NAME}-icon` }, icon),
|
|
158
|
+
label && (React.createElement("div", { className: `${ROOT_CLASS_NAME}-label` },
|
|
159
|
+
React.createElement("p", { className: `${ROOT_CLASS_NAME}-label-text` }, label))),
|
|
160
|
+
React.createElement("div", { className: `${ROOT_CLASS_NAME}-value` },
|
|
161
|
+
React.createElement(InputText, { disabled: disabled, initialValue: value, name: name, onBlur: handleBlur, onChange: onChange, onFocus: onFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, placeholder: placeholder, ref: inputRef, selectTextOnFocus: true, tabIndex: tabIndex }))));
|
|
162
|
+
});
|
|
163
|
+
export default CSSValueInput;
|
|
164
|
+
//# sourceMappingURL=CSSValueInput.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for CSSValueInput
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.20.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import type { CSSValueType } from "@acusti/css-values";
|
|
10
|
+
export type Props = {|
|
|
11
|
+
/**
|
|
12
|
+
* Boolean indicating if the user can submit an empty value (i.e. clear the value); defaults to true
|
|
13
|
+
*/
|
|
14
|
+
allowEmpty?: boolean,
|
|
15
|
+
className?: string,
|
|
16
|
+
cssValueType?: CSSValueType,
|
|
17
|
+
disabled?: boolean,
|
|
18
|
+
getValueAsNumber?: (value: string | number) => number,
|
|
19
|
+
icon?: React.Node,
|
|
20
|
+
label?: string,
|
|
21
|
+
max?: number,
|
|
22
|
+
min?: number,
|
|
23
|
+
name?: string,
|
|
24
|
+
onBlur?: (event: SyntheticFocusEvent<HTMLInputElement>) => mixed,
|
|
25
|
+
onChange?: (event: SyntheticInputEvent<HTMLInputElement>) => mixed,
|
|
26
|
+
onFocus?: (event: SyntheticFocusEvent<HTMLInputElement>) => mixed,
|
|
27
|
+
onKeyDown?: (event: SyntheticKeyboardEvent<HTMLInputElement>) => mixed,
|
|
28
|
+
onKeyUp?: (event: SyntheticKeyboardEvent<HTMLInputElement>) => mixed,
|
|
29
|
+
onSubmitValue: (value: string) => mixed,
|
|
30
|
+
placeholder?: string,
|
|
31
|
+
step?: number,
|
|
32
|
+
tabIndex?: number,
|
|
33
|
+
title?: string,
|
|
34
|
+
unit?: string,
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Regex or validator function to validate non-numeric values
|
|
38
|
+
*/
|
|
39
|
+
validator?: RegExp | ((value: string) => boolean),
|
|
40
|
+
value?: string,
|
|
41
|
+
|};
|
|
42
|
+
declare var CSSValueInput: React.StatelessFunctionalComponent<Props>;
|
|
43
|
+
declare export default typeof CSSValueInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CSSValueInput.js","sourceRoot":"","sources":["../src/CSSValueInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkC/B,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAE3D,MAAM,eAAe,GAAG,eAAe,CAAC;AAExC,MAAM,aAAa,GAAoB,KAAK,CAAC,UAAU,CACnD,CACI,EACI,UAAU,GAAG,IAAI,EACjB,SAAS,EACT,YAAY,GAAG,sBAAsB,EACrC,QAAQ,EACR,gBAAgB,GAAG,mBAAmB,EACtC,IAAI,EACJ,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,aAAa,EACb,WAAW,EACX,IAAI,GAAG,CAAC,EACR,QAAQ,EACR,KAAK,EACL,IAAI,GAAG,8BAA8B,CAAC,YAAY,CAAC,EACnD,SAAS,EACT,KAAK,GACR,EACD,GAAG,EACL,EAAE;IACA,MAAM,QAAQ,GAAG,MAAM,CAAW,IAAI,CAAC,CAAC;IACxC,mBAAmB,CAAqB,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAErE,MAAM,iBAAiB,GAAG,MAAM,CAAS,KAAK,IAAI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/D,KAAK,EAAE,KAAK;QAEX,IAAI,IAAI,6BAAK,SAAS,EAAE,GAAG,eAAe,OAAO,IAAG,IAAI,CAAO;QAC/D,KAAK,IAAI,CACN,6BAAK,SAAS,EAAE,GAAG,eAAe,QAAQ;YACtC,2BAAG,SAAS,EAAE,GAAG,eAAe,aAAa,IAAG,KAAK,CAAK,CACxD,CACT;QACD,6BAAK,SAAS,EAAE,GAAG,eAAe,QAAQ;YACtC,oBAAC,SAAS,IACN,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,KAAK,EACnB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,QAAQ,EACb,iBAAiB,QACjB,QAAQ,EAAE,QAAQ,GACpB,CACA,CACF,CACX,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acusti/css-value-input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": "./dist/CSSValueInput.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@acusti/css-values": "^0.18.0",
|
|
30
|
-
"@acusti/input-text": "^0.
|
|
30
|
+
"@acusti/input-text": "^0.11.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"classnames": "^2",
|