@synerise/ds-factors 1.0.1 → 1.1.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [1.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.0.1...@synerise/ds-factors@1.1.0) (2025-03-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* 🎸 removes debounce from factors ([1156197](https://github.com/Synerise/synerise-design/commit/11561979b0c1b368e9d9909e8a0cf84cfb45472b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.0.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.0.0...@synerise/ds-factors@1.0.1) (2025-03-18)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React, { useEffect,
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { RawInput } from '@synerise/ds-input';
|
|
4
|
-
import { debounce } from 'lodash';
|
|
5
4
|
import * as S from './DynamicKey.style';
|
|
6
5
|
var DynamicKey = function DynamicKey(_ref) {
|
|
7
6
|
var value = _ref.value,
|
|
@@ -23,15 +22,11 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
23
22
|
var _useState2 = useState(false),
|
|
24
23
|
localError = _useState2[0],
|
|
25
24
|
setLocalError = _useState2[1];
|
|
26
|
-
var onChangeRef = useRef(onChange);
|
|
27
|
-
var debouncedOnChange = useRef(debounce(function (inputValue) {
|
|
28
|
-
onChangeRef.current && onChangeRef.current(inputValue);
|
|
29
|
-
}, 300)).current;
|
|
30
25
|
var handleChange = function handleChange(event) {
|
|
31
26
|
var newValue = _extends({}, value);
|
|
32
27
|
newValue[event.target.name] = event.target.value;
|
|
33
28
|
setLocalValue(newValue);
|
|
34
|
-
|
|
29
|
+
onChange(newValue);
|
|
35
30
|
if (!event.target.value.length) {
|
|
36
31
|
setLocalError(true);
|
|
37
32
|
} else {
|
|
@@ -39,13 +34,11 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
39
34
|
}
|
|
40
35
|
};
|
|
41
36
|
useEffect(function () {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
}, [debouncedOnChange]);
|
|
37
|
+
setLocalValue({
|
|
38
|
+
key: value.key,
|
|
39
|
+
value: value.value
|
|
40
|
+
});
|
|
41
|
+
}, [value]);
|
|
49
42
|
var trigger = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RawInput, {
|
|
50
43
|
placeholder: texts.dynamicKey.keyPlaceholder,
|
|
51
44
|
value: localValue.key,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import InputNumber from '@synerise/ds-input-number';
|
|
3
|
-
import { debounce } from 'lodash';
|
|
4
3
|
var NumberInput = function NumberInput(_ref) {
|
|
5
4
|
var error = _ref.error,
|
|
6
5
|
value = _ref.value,
|
|
@@ -13,21 +12,12 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
13
12
|
var _useState = useState(value),
|
|
14
13
|
localValue = _useState[0],
|
|
15
14
|
setLocalValue = _useState[1];
|
|
16
|
-
var onChangeRef = useRef(onChange);
|
|
17
15
|
useEffect(function () {
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
var debouncedOnChange = useRef(debounce(function (inputValue) {
|
|
21
|
-
onChangeRef.current && onChangeRef.current(inputValue);
|
|
22
|
-
}, 300)).current;
|
|
23
|
-
useEffect(function () {
|
|
24
|
-
return function () {
|
|
25
|
-
debouncedOnChange.cancel();
|
|
26
|
-
};
|
|
27
|
-
}, [debouncedOnChange]);
|
|
16
|
+
setLocalValue(value);
|
|
17
|
+
}, [value]);
|
|
28
18
|
var handleChange = function handleChange(val) {
|
|
29
19
|
setLocalValue(val);
|
|
30
|
-
|
|
20
|
+
onChange(val);
|
|
31
21
|
};
|
|
32
22
|
return /*#__PURE__*/React.createElement(InputNumber, {
|
|
33
23
|
error: error,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
3
|
-
import { debounce } from 'lodash';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
3
|
import Icon, { FullScreenM } from '@synerise/ds-icon';
|
|
5
4
|
import { theme } from '@synerise/ds-core';
|
|
6
5
|
import Autocomplete from '@synerise/ds-autocomplete';
|
|
@@ -33,41 +32,32 @@ var TextInput = function TextInput(_ref) {
|
|
|
33
32
|
var _useState4 = useState(false),
|
|
34
33
|
localError = _useState4[0],
|
|
35
34
|
setLocalError = _useState4[1];
|
|
36
|
-
var onChangeRef = useRef(onChange);
|
|
37
35
|
useEffect(function () {
|
|
38
36
|
if (inputRef != null && inputRef.current && opened) {
|
|
39
37
|
inputRef.current.focus();
|
|
40
38
|
}
|
|
41
39
|
}, [inputRef, opened]);
|
|
42
|
-
useEffect(function () {
|
|
43
|
-
onChangeRef.current = onChange;
|
|
44
|
-
}, [localValue, onChange]);
|
|
45
|
-
var debouncedOnChange = useRef(debounce(function (inputValue) {
|
|
46
|
-
onChangeRef.current && onChangeRef.current(inputValue);
|
|
47
|
-
}, 300)).current;
|
|
48
|
-
useEffect(function () {
|
|
49
|
-
return function () {
|
|
50
|
-
debouncedOnChange.cancel();
|
|
51
|
-
};
|
|
52
|
-
}, [debouncedOnChange]);
|
|
53
40
|
var handleChange = useCallback(function (event) {
|
|
54
41
|
setLocalValue(event.target.value);
|
|
55
|
-
|
|
42
|
+
onChange(event.target.value);
|
|
56
43
|
if (!event.target.value.length) {
|
|
57
44
|
setLocalError(true);
|
|
58
45
|
} else {
|
|
59
46
|
setLocalError(false);
|
|
60
47
|
}
|
|
61
|
-
}, [setLocalValue, setLocalError,
|
|
48
|
+
}, [setLocalValue, setLocalError, onChange]);
|
|
62
49
|
var handleApply = useCallback(function (val) {
|
|
63
50
|
setOpenExpanseEditor(false);
|
|
64
51
|
setLocalValue(val);
|
|
65
|
-
|
|
66
|
-
}, [
|
|
52
|
+
onChange(val);
|
|
53
|
+
}, [onChange]);
|
|
67
54
|
var handleAutocomplete = useCallback(function (val) {
|
|
68
55
|
setLocalValue(val);
|
|
69
|
-
|
|
70
|
-
}, [
|
|
56
|
+
onChange(val);
|
|
57
|
+
}, [onChange]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
setLocalValue(value);
|
|
60
|
+
}, [value]);
|
|
71
61
|
var autocompleteOptions = useMemo(function () {
|
|
72
62
|
return autocompleteText && autocompleteText.options.filter(function (option) {
|
|
73
63
|
return option.toLowerCase().includes(String(localValue).toLowerCase());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,25 +34,25 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-autocomplete": "^1.0.
|
|
38
|
-
"@synerise/ds-badge": "^1.0.
|
|
39
|
-
"@synerise/ds-button": "^1.1.
|
|
40
|
-
"@synerise/ds-date-picker": "^1.0.
|
|
41
|
-
"@synerise/ds-date-range-picker": "^1.1.
|
|
42
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
43
|
-
"@synerise/ds-icon": "^1.0
|
|
44
|
-
"@synerise/ds-information-card": "^1.0.
|
|
45
|
-
"@synerise/ds-inline-edit": "^1.0.
|
|
46
|
-
"@synerise/ds-input": "^1.0.
|
|
47
|
-
"@synerise/ds-input-number": "^1.0.
|
|
48
|
-
"@synerise/ds-list-item": "^1.0.
|
|
49
|
-
"@synerise/ds-menu": "^1.0.
|
|
50
|
-
"@synerise/ds-modal": "^1.0.
|
|
51
|
-
"@synerise/ds-result": "^1.0.
|
|
52
|
-
"@synerise/ds-scrollbar": "^1.0.
|
|
53
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
54
|
-
"@synerise/ds-tabs": "^1.0.
|
|
55
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
37
|
+
"@synerise/ds-autocomplete": "^1.0.2",
|
|
38
|
+
"@synerise/ds-badge": "^1.0.2",
|
|
39
|
+
"@synerise/ds-button": "^1.1.1",
|
|
40
|
+
"@synerise/ds-date-picker": "^1.0.2",
|
|
41
|
+
"@synerise/ds-date-range-picker": "^1.1.1",
|
|
42
|
+
"@synerise/ds-dropdown": "^1.0.2",
|
|
43
|
+
"@synerise/ds-icon": "^1.1.0",
|
|
44
|
+
"@synerise/ds-information-card": "^1.0.2",
|
|
45
|
+
"@synerise/ds-inline-edit": "^1.0.2",
|
|
46
|
+
"@synerise/ds-input": "^1.0.2",
|
|
47
|
+
"@synerise/ds-input-number": "^1.0.2",
|
|
48
|
+
"@synerise/ds-list-item": "^1.0.2",
|
|
49
|
+
"@synerise/ds-menu": "^1.0.2",
|
|
50
|
+
"@synerise/ds-modal": "^1.0.2",
|
|
51
|
+
"@synerise/ds-result": "^1.0.2",
|
|
52
|
+
"@synerise/ds-scrollbar": "^1.0.2",
|
|
53
|
+
"@synerise/ds-skeleton": "^1.0.2",
|
|
54
|
+
"@synerise/ds-tabs": "^1.0.2",
|
|
55
|
+
"@synerise/ds-tooltip": "^1.1.1",
|
|
56
56
|
"@synerise/ds-utils": "^1.0.1",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
58
|
"react-window": "1.8.5",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
66
66
|
"styled-components": "^5.3.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "47960dcd849dc47c85bd134bcfeb90a5505656a7"
|
|
69
69
|
}
|