@synerise/ds-factors 0.14.0 → 0.14.3
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/CHANGELOG.md +34 -0
- package/dist/FactorValue/Date/Date.js +4 -0
- package/dist/FactorValue/DateRange/DateRange.js +1 -0
- package/dist/FactorValue/DynamicKey/DynamicKey.js +6 -7
- package/dist/FactorValue/Text/Text.js +7 -3
- package/dist/FactorValue/Text/Text.styles.d.ts +1 -0
- package/dist/FactorValue/Text/Text.styles.js +5 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.14.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.14.2...@synerise/ds-factors@0.14.3) (2022-06-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **factors:** fixes using of autocomplete ([dd56cb3](https://github.com/Synerise/synerise-design/commit/dd56cb38a2a7bf022e8f9d12b2e23e6812b2f0b1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.14.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.14.1...@synerise/ds-factors@0.14.2) (2022-05-31)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **factors:** calls onChange callback on clearing input value ([37742e9](https://github.com/Synerise/synerise-design/commit/37742e9d87f526283641be964577c9f4754f463d))
|
|
23
|
+
* **factors:** calls onChange callback on clearing input value ([92a3f80](https://github.com/Synerise/synerise-design/commit/92a3f80cc8d2d3ab2d4f0c5aa9c7be7168edb324))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [0.14.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.14.0...@synerise/ds-factors@0.14.1) (2022-05-30)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **condition:** fix dynamic key condition validation ([1777297](https://github.com/Synerise/synerise-design/commit/1777297c2d3eddb29620b7ac4a802a5cb3c2f84c))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
6
40
|
# [0.14.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.13.2...@synerise/ds-factors@0.14.0) (2022-05-28)
|
|
7
41
|
|
|
8
42
|
|
|
@@ -11,12 +11,16 @@ var DateInput = function DateInput(_ref) {
|
|
|
11
11
|
var changeHandler = React.useCallback(function (date) {
|
|
12
12
|
onChange(date);
|
|
13
13
|
}, [onChange]);
|
|
14
|
+
var handleClear = React.useCallback(function () {
|
|
15
|
+
onChange(undefined);
|
|
16
|
+
}, [onChange]);
|
|
14
17
|
var handleVisibleChange = React.useCallback(function (visible) {
|
|
15
18
|
if (!visible) {
|
|
16
19
|
onDeactivate && onDeactivate();
|
|
17
20
|
}
|
|
18
21
|
}, [onDeactivate]);
|
|
19
22
|
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
23
|
+
onClear: handleClear,
|
|
20
24
|
onApply: changeHandler,
|
|
21
25
|
onValueChange: changeHandler,
|
|
22
26
|
value: value,
|
|
@@ -38,18 +38,17 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
38
38
|
newValue[event.target.name] = event.target.value;
|
|
39
39
|
setLocalValue(newValue);
|
|
40
40
|
onChangeDebounce(newValue);
|
|
41
|
-
};
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
setLocalValue(value);
|
|
45
|
-
}, [value]);
|
|
46
|
-
React.useEffect(function () {
|
|
47
|
-
if (localValue) {
|
|
42
|
+
if (!event.target.value.length) {
|
|
48
43
|
setLocalError(true);
|
|
49
44
|
} else {
|
|
50
45
|
setLocalError(false);
|
|
51
46
|
}
|
|
52
|
-
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
React.useEffect(function () {
|
|
50
|
+
setLocalValue(value);
|
|
51
|
+
}, [value]);
|
|
53
52
|
return /*#__PURE__*/React.createElement(S.DynamicKey, {
|
|
54
53
|
withoutTypeSelector: withoutTypeSelector
|
|
55
54
|
}, /*#__PURE__*/React.createElement(RawInput, {
|
|
@@ -75,14 +75,18 @@ var TextInput = function TextInput(_ref) {
|
|
|
75
75
|
onChange(val);
|
|
76
76
|
}, [onChange]);
|
|
77
77
|
var autocompleteOptions = React.useMemo(function () {
|
|
78
|
-
return
|
|
78
|
+
return autocompleteText && autocompleteText.options.filter(function (option) {
|
|
79
79
|
return option.toLowerCase().includes(localValue.toLowerCase());
|
|
80
80
|
}) || [];
|
|
81
81
|
}, [localValue, autocompleteText]);
|
|
82
|
-
return /*#__PURE__*/React.createElement(
|
|
82
|
+
return /*#__PURE__*/React.createElement(S.TextWrapper, null, factorType === 'text' && textType === 'autocomplete' ? /*#__PURE__*/React.createElement(Autocomplete, {
|
|
83
83
|
placeholder: texts.valuePlaceholder,
|
|
84
84
|
value: localValue,
|
|
85
|
-
onChange: handleAutocomplete
|
|
85
|
+
onChange: handleAutocomplete,
|
|
86
|
+
onBlur: onDeactivate,
|
|
87
|
+
error: localError || error,
|
|
88
|
+
handleInputRef: setInputRef,
|
|
89
|
+
defaultOpen: true
|
|
86
90
|
}, autocompleteOptions == null ? void 0 : autocompleteOptions.map(function (option) {
|
|
87
91
|
return /*#__PURE__*/React.createElement(Autocomplete.Option, {
|
|
88
92
|
key: option,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const IconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
2
2
|
export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const TextWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -11,4 +11,8 @@ export var IconWrapper = styled.span.withConfig({
|
|
|
11
11
|
export var InputWrapper = styled.div.withConfig({
|
|
12
12
|
displayName: "Textstyles__InputWrapper",
|
|
13
13
|
componentId: "rjr8p0-1"
|
|
14
|
-
})(["input{padding:0;&:before{display:none;}input{max-height:30px;}}"]);
|
|
14
|
+
})(["input{padding:0;&:before{display:none;}input{max-height:30px;}}"]);
|
|
15
|
+
export var TextWrapper = styled.div.withConfig({
|
|
16
|
+
displayName: "Textstyles__TextWrapper",
|
|
17
|
+
componentId: "rjr8p0-2"
|
|
18
|
+
})([""]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-autocomplete": "^0.4.
|
|
35
|
+
"@synerise/ds-autocomplete": "^0.4.11",
|
|
36
36
|
"@synerise/ds-badge": "^0.6.3",
|
|
37
37
|
"@synerise/ds-button": "^0.17.2",
|
|
38
38
|
"@synerise/ds-date-picker": "^0.6.18",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"@synerise/ds-core": "*",
|
|
56
56
|
"react": ">=16.9.0 < 17.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "116cf109200639a805ef51ce8301e47dc7a8b168"
|
|
59
59
|
}
|