@synerise/ds-factors 0.20.6 → 0.20.8
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 +23 -0
- package/dist/FactorValue/DateRange/DateRange.d.ts +1 -2
- package/dist/FactorValue/DateRange/DateRange.js +7 -4
- package/dist/FactorValue/DynamicKey/DynamicKey.js +1 -1
- package/dist/FactorValue/DynamicKey/DynamicKey.style.js +1 -1
- package/dist/FactorValue/Formula/Formula.d.ts +1 -2
- package/dist/FactorValue/Formula/Formula.js +14 -13
- package/dist/FactorValue/Number/NumberInput.js +3 -1
- package/dist/Factors.d.ts +2 -2
- package/package.json +21 -21
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
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.20.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.20.7...@synerise/ds-factors@0.20.8) (2023-10-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **date-range-picker:** ui/ux updates to filter and relative section ([8bb636b](https://github.com/Synerise/synerise-design/commit/8bb636b185a5fe98a4ef70350dc387493ac6f0a5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.20.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.20.6...@synerise/ds-factors@0.20.7) (2023-10-17)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **factors:** error validation for formula and date range factor type ([a9485dd](https://github.com/Synerise/synerise-design/commit/a9485dd239e8b5cf285ef5f2ab08f1d9b1993628))
|
|
23
|
+
* **factors:** pass error to number input ([1a76ef6](https://github.com/Synerise/synerise-design/commit/1a76ef686593e40bd4c0fe31405134220a2fa669))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [0.20.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.20.5...@synerise/ds-factors@0.20.6) (2023-10-11)
|
|
7
30
|
|
|
8
31
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { InputProps } from '../../Factors.types';
|
|
3
|
-
declare const DateRangeInput:
|
|
2
|
+
declare const DateRangeInput: ({ value, onChange, error, texts, onDeactivate, readOnly }: InputProps) => JSX.Element;
|
|
4
3
|
export default DateRangeInput;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import DateRangePicker from '@synerise/ds-date-range-picker';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
|
|
5
5
|
var DateRangeInput = function DateRangeInput(_ref) {
|
|
6
6
|
var value = _ref.value,
|
|
7
7
|
onChange = _ref.onChange,
|
|
8
|
+
error = _ref.error,
|
|
8
9
|
texts = _ref.texts,
|
|
9
10
|
onDeactivate = _ref.onDeactivate,
|
|
10
11
|
_ref$readOnly = _ref.readOnly,
|
|
11
12
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
12
13
|
var intl = useIntl();
|
|
13
|
-
var changeHandler =
|
|
14
|
+
var changeHandler = useCallback(function (date) {
|
|
14
15
|
onChange(date);
|
|
15
16
|
}, [onChange]);
|
|
16
|
-
var handleVisibleChange =
|
|
17
|
+
var handleVisibleChange = useCallback(function (visible) {
|
|
17
18
|
if (!visible) {
|
|
18
19
|
onDeactivate && onDeactivate();
|
|
19
20
|
}
|
|
@@ -33,10 +34,12 @@ var DateRangeInput = function DateRangeInput(_ref) {
|
|
|
33
34
|
placement: 'bottomLeft',
|
|
34
35
|
onVisibleChange: handleVisibleChange
|
|
35
36
|
},
|
|
37
|
+
showNowButton: false,
|
|
36
38
|
filterRangeDisplayMode: "slider",
|
|
37
39
|
filterValueSelectionModes: ['Range'],
|
|
38
40
|
rangePickerInputProps: {
|
|
39
|
-
readOnly: readOnly
|
|
41
|
+
readOnly: readOnly,
|
|
42
|
+
error: error
|
|
40
43
|
},
|
|
41
44
|
readOnly: readOnly
|
|
42
45
|
});
|
|
@@ -73,7 +73,7 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
73
73
|
error: localError || error,
|
|
74
74
|
readOnly: readOnly
|
|
75
75
|
}));
|
|
76
|
-
return
|
|
76
|
+
return /*#__PURE__*/React.createElement(S.DynamicKey, {
|
|
77
77
|
withoutTypeSelector: withoutTypeSelector
|
|
78
78
|
}, trigger);
|
|
79
79
|
};
|
|
@@ -4,5 +4,5 @@ export var DynamicKey = styled.div.withConfig({
|
|
|
4
4
|
displayName: "DynamicKeystyle__DynamicKey",
|
|
5
5
|
componentId: "sc-43cup-0"
|
|
6
6
|
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;.ant-input{flex:1;&:focus{z-index:2;}&:first-of-type{border-radius:", ";}&:last-of-type{border-radius:0 3px 3px 0;margin-left:-1px;}}"], function (props) {
|
|
7
|
-
return props.withoutTypeSelector ? '3px 0 0 3px' : '0
|
|
7
|
+
return props.withoutTypeSelector ? '3px 0 0 3px' : '0';
|
|
8
8
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { InputProps } from '../../Factors.types';
|
|
3
|
-
declare const FormulaInput:
|
|
2
|
+
declare const FormulaInput: ({ value, error, onChange, withoutTypeSelector, texts, formulaEditor, readOnly, }: InputProps) => JSX.Element;
|
|
4
3
|
export default FormulaInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
2
2
|
import Button from '@synerise/ds-button';
|
|
3
3
|
import Icon, { EditS } from '@synerise/ds-icon';
|
|
4
4
|
import Badge from '@synerise/ds-badge';
|
|
@@ -7,6 +7,7 @@ import * as S from './Formula.styles';
|
|
|
7
7
|
|
|
8
8
|
var FormulaInput = function FormulaInput(_ref) {
|
|
9
9
|
var value = _ref.value,
|
|
10
|
+
error = _ref.error,
|
|
10
11
|
onChange = _ref.onChange,
|
|
11
12
|
_ref$withoutTypeSelec = _ref.withoutTypeSelector,
|
|
12
13
|
withoutTypeSelector = _ref$withoutTypeSelec === void 0 ? false : _ref$withoutTypeSelec,
|
|
@@ -15,41 +16,41 @@ var FormulaInput = function FormulaInput(_ref) {
|
|
|
15
16
|
_ref$readOnly = _ref.readOnly,
|
|
16
17
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
17
18
|
|
|
18
|
-
var
|
|
19
|
-
openFormulaModal =
|
|
20
|
-
setOpenFormulaModal =
|
|
19
|
+
var _useState = useState(false),
|
|
20
|
+
openFormulaModal = _useState[0],
|
|
21
|
+
setOpenFormulaModal = _useState[1];
|
|
21
22
|
|
|
22
|
-
var triggerMode =
|
|
23
|
+
var triggerMode = useMemo(function () {
|
|
23
24
|
if (value) {
|
|
24
25
|
return readOnly ? 'label-icon' : 'two-icons';
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
return readOnly ? 'simple' : 'label-icon';
|
|
28
29
|
}, [value, readOnly]);
|
|
29
|
-
var activeIcon =
|
|
30
|
+
var activeIcon = useMemo(function () {
|
|
30
31
|
return value ? /*#__PURE__*/React.createElement(Badge, {
|
|
31
32
|
flag: true,
|
|
32
33
|
status: "active"
|
|
33
34
|
}) : '';
|
|
34
35
|
}, [value]);
|
|
35
|
-
var label =
|
|
36
|
+
var label = useMemo(function () {
|
|
36
37
|
return value ? value.name : texts.formula.buttonPlaceholder;
|
|
37
38
|
}, [value, texts.formula.buttonPlaceholder]);
|
|
38
|
-
var handleChange =
|
|
39
|
+
var handleChange = useCallback(function (val) {
|
|
39
40
|
setOpenFormulaModal(false);
|
|
40
41
|
onChange(val);
|
|
41
42
|
}, [onChange]);
|
|
42
|
-
|
|
43
|
-
var handleClick = function handleClick() {
|
|
43
|
+
var handleClick = !readOnly ? function () {
|
|
44
44
|
return setOpenFormulaModal(true);
|
|
45
|
-
};
|
|
46
|
-
|
|
45
|
+
} : undefined;
|
|
47
46
|
return /*#__PURE__*/React.createElement(S.FormulaButton, {
|
|
48
47
|
withoutTypeSelector: withoutTypeSelector
|
|
49
48
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
49
|
+
readOnly: readOnly,
|
|
50
50
|
type: "secondary",
|
|
51
|
+
error: error,
|
|
51
52
|
mode: triggerMode,
|
|
52
|
-
onClick:
|
|
53
|
+
onClick: handleClick
|
|
53
54
|
}, activeIcon, label, /*#__PURE__*/React.createElement(Icon, {
|
|
54
55
|
component: /*#__PURE__*/React.createElement(EditS, null)
|
|
55
56
|
})), /*#__PURE__*/React.createElement(FormulaModal, {
|
|
@@ -3,7 +3,8 @@ import InputNumber from '@synerise/ds-input-number';
|
|
|
3
3
|
import { debounce } from 'lodash';
|
|
4
4
|
|
|
5
5
|
var NumberInput = function NumberInput(_ref) {
|
|
6
|
-
var
|
|
6
|
+
var error = _ref.error,
|
|
7
|
+
value = _ref.value,
|
|
7
8
|
onChange = _ref.onChange,
|
|
8
9
|
texts = _ref.texts,
|
|
9
10
|
opened = _ref.opened,
|
|
@@ -31,6 +32,7 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
31
32
|
setLocalValue(value);
|
|
32
33
|
}, [value]);
|
|
33
34
|
return /*#__PURE__*/React.createElement(InputNumber, {
|
|
35
|
+
error: error,
|
|
34
36
|
autoFocus: opened,
|
|
35
37
|
placeholder: texts.valuePlaceholder,
|
|
36
38
|
value: localValue,
|
package/dist/Factors.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const factorTypes: {
|
|
|
29
29
|
formula: {
|
|
30
30
|
icon: JSX.Element;
|
|
31
31
|
name: string;
|
|
32
|
-
input:
|
|
32
|
+
input: ({ value, error, onChange, withoutTypeSelector, texts, formulaEditor, readOnly, }: import("./Factors.types").InputProps) => JSX.Element;
|
|
33
33
|
};
|
|
34
34
|
array: {
|
|
35
35
|
icon: JSX.Element;
|
|
@@ -44,7 +44,7 @@ export declare const factorTypes: {
|
|
|
44
44
|
dateRange: {
|
|
45
45
|
icon: JSX.Element;
|
|
46
46
|
name: string;
|
|
47
|
-
input:
|
|
47
|
+
input: ({ value, onChange, error, texts, onDeactivate, readOnly }: import("./Factors.types").InputProps) => JSX.Element;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
declare const Factors: React.FC<FactorsProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.8",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,25 +33,25 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-autocomplete": "^0.5.
|
|
37
|
-
"@synerise/ds-badge": "^0.6.
|
|
38
|
-
"@synerise/ds-button": "^0.18.
|
|
39
|
-
"@synerise/ds-date-picker": "^0.10.
|
|
40
|
-
"@synerise/ds-date-range-picker": "^0.
|
|
41
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
42
|
-
"@synerise/ds-icon": "^0.58.
|
|
43
|
-
"@synerise/ds-information-card": "^0.3.
|
|
44
|
-
"@synerise/ds-inline-edit": "^0.6.
|
|
45
|
-
"@synerise/ds-input": "^0.19.
|
|
46
|
-
"@synerise/ds-input-number": "^0.8.
|
|
47
|
-
"@synerise/ds-loader": "^0.2.
|
|
48
|
-
"@synerise/ds-menu": "^0.18.
|
|
49
|
-
"@synerise/ds-modal": "^0.17.
|
|
50
|
-
"@synerise/ds-result": "^0.6.
|
|
51
|
-
"@synerise/ds-scrollbar": "^0.6.
|
|
52
|
-
"@synerise/ds-tabs": "^0.13.
|
|
53
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
54
|
-
"@synerise/ds-utils": "^0.24.
|
|
36
|
+
"@synerise/ds-autocomplete": "^0.5.5",
|
|
37
|
+
"@synerise/ds-badge": "^0.6.40",
|
|
38
|
+
"@synerise/ds-button": "^0.18.5",
|
|
39
|
+
"@synerise/ds-date-picker": "^0.10.22",
|
|
40
|
+
"@synerise/ds-date-range-picker": "^0.25.1",
|
|
41
|
+
"@synerise/ds-dropdown": "^0.17.84",
|
|
42
|
+
"@synerise/ds-icon": "^0.58.5",
|
|
43
|
+
"@synerise/ds-information-card": "^0.3.43",
|
|
44
|
+
"@synerise/ds-inline-edit": "^0.6.84",
|
|
45
|
+
"@synerise/ds-input": "^0.19.5",
|
|
46
|
+
"@synerise/ds-input-number": "^0.8.27",
|
|
47
|
+
"@synerise/ds-loader": "^0.2.47",
|
|
48
|
+
"@synerise/ds-menu": "^0.18.2",
|
|
49
|
+
"@synerise/ds-modal": "^0.17.8",
|
|
50
|
+
"@synerise/ds-result": "^0.6.34",
|
|
51
|
+
"@synerise/ds-scrollbar": "^0.6.10",
|
|
52
|
+
"@synerise/ds-tabs": "^0.13.82",
|
|
53
|
+
"@synerise/ds-tooltip": "^0.14.7",
|
|
54
|
+
"@synerise/ds-utils": "^0.24.19",
|
|
55
55
|
"lodash": "^4.17.19",
|
|
56
56
|
"react-intl": "3.12.0",
|
|
57
57
|
"react-window": "1.8.5",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@testing-library/react": "10.0.1",
|
|
68
68
|
"@testing-library/user-event": "^10.3.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "1b2696001dd88b4c11413977e38b541b0c78733d"
|
|
71
71
|
}
|