@synerise/ds-factors 0.15.4 → 0.15.6
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 +19 -0
- package/dist/FactorValue/Text/Text.js +47 -23
- package/dist/Factors.types.d.ts +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.15.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.15.5...@synerise/ds-factors@0.15.6) (2022-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **factors:** add input AutoResize to pick from inputs ([f641612](https://github.com/Synerise/synerise-design/commit/f641612ab4e109da277b8618d7b09e1f07505c0c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.15.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.15.4...@synerise/ds-factors@0.15.5) (2022-09-29)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.15.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.15.3...@synerise/ds-factors@0.15.4) (2022-09-29)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import Icon, { FullScreenM } from '@synerise/ds-icon';
|
|
5
5
|
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
6
6
|
import Autocomplete from '@synerise/ds-autocomplete';
|
|
7
|
-
import { Input } from '@synerise/ds-input';
|
|
7
|
+
import { AutoResizeInput, Input } from '@synerise/ds-input';
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import { debounce } from 'lodash';
|
|
10
10
|
import * as S from './Text.styles';
|
|
@@ -82,28 +82,52 @@ var TextInput = function TextInput(_ref) {
|
|
|
82
82
|
return option.toLowerCase().includes(String(localValue).toLowerCase());
|
|
83
83
|
}) || [];
|
|
84
84
|
}, [localValue, autocompleteText]);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
|
|
86
|
+
var renderInput = function renderInput(typesOfInput, factorsType) {
|
|
87
|
+
if (typesOfInput === 'autocomplete' && factorsType === 'text') {
|
|
88
|
+
return /*#__PURE__*/React.createElement(Autocomplete, {
|
|
89
|
+
placeholder: texts.valuePlaceholder,
|
|
90
|
+
value: localValue,
|
|
91
|
+
onChange: handleAutocomplete,
|
|
92
|
+
onBlur: onDeactivate,
|
|
93
|
+
error: localError || error,
|
|
94
|
+
handleInputRef: setInputRef,
|
|
95
|
+
defaultOpen: true
|
|
96
|
+
}, autocompleteOptions == null ? void 0 : autocompleteOptions.map(function (option) {
|
|
97
|
+
return /*#__PURE__*/React.createElement(Autocomplete.Option, {
|
|
98
|
+
key: option,
|
|
99
|
+
value: option
|
|
100
|
+
}, option);
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (typesOfInput === 'default' && factorsType === 'text') {
|
|
105
|
+
return /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, {
|
|
106
|
+
handleInputRef: setInputRef,
|
|
107
|
+
placeholder: texts.valuePlaceholder,
|
|
108
|
+
suffix: SuffixIcon,
|
|
109
|
+
value: localValue,
|
|
110
|
+
onChange: handleChange,
|
|
111
|
+
onBlur: onDeactivate,
|
|
112
|
+
error: localError || error
|
|
113
|
+
})));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (typesOfInput === 'autoresize' && factorsType === 'text') {
|
|
117
|
+
return /*#__PURE__*/React.createElement(AutoResizeInput, _extends({}, inputProps, {
|
|
118
|
+
handleInputRef: setInputRef,
|
|
119
|
+
placeholder: texts.valuePlaceholder,
|
|
120
|
+
value: localValue,
|
|
121
|
+
onChange: handleChange,
|
|
122
|
+
onBlur: onDeactivate,
|
|
123
|
+
error: localError || error
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return null;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
return /*#__PURE__*/React.createElement(S.TextWrapper, null, renderInput(textType, factorType), /*#__PURE__*/React.createElement(TextModal, {
|
|
107
131
|
visible: openExpanseEditor,
|
|
108
132
|
onCancel: function onCancel() {
|
|
109
133
|
return setOpenExpanseEditor(false);
|
package/dist/Factors.types.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare type FactorsProps = {
|
|
|
83
83
|
onDeactivate?: () => void;
|
|
84
84
|
onChangeValue: (value: FactorValueType) => void;
|
|
85
85
|
value: FactorValueType;
|
|
86
|
-
textType?: 'autocomplete' | 'expansible' | 'default' | string;
|
|
86
|
+
textType?: 'autocomplete' | 'expansible' | 'default' | 'autoresize' | string;
|
|
87
87
|
autoResize?: boolean | {
|
|
88
88
|
minWidth: string;
|
|
89
89
|
maxWidth: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"@synerise/ds-autocomplete": "^0.4.27",
|
|
36
36
|
"@synerise/ds-badge": "^0.6.17",
|
|
37
37
|
"@synerise/ds-button": "^0.17.9",
|
|
38
|
-
"@synerise/ds-date-picker": "^0.6.
|
|
39
|
-
"@synerise/ds-date-range-picker": "^0.17.
|
|
40
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
38
|
+
"@synerise/ds-date-picker": "^0.6.42",
|
|
39
|
+
"@synerise/ds-date-range-picker": "^0.17.3",
|
|
40
|
+
"@synerise/ds-dropdown": "^0.17.39",
|
|
41
41
|
"@synerise/ds-icon": "^0.51.0",
|
|
42
|
-
"@synerise/ds-information-card": "^0.1.
|
|
43
|
-
"@synerise/ds-inline-edit": "^0.6.
|
|
44
|
-
"@synerise/ds-input": "^0.18.
|
|
42
|
+
"@synerise/ds-information-card": "^0.1.24",
|
|
43
|
+
"@synerise/ds-inline-edit": "^0.6.35",
|
|
44
|
+
"@synerise/ds-input": "^0.18.24",
|
|
45
45
|
"@synerise/ds-input-number": "^0.6.24",
|
|
46
46
|
"@synerise/ds-menu": "^0.16.0",
|
|
47
47
|
"@synerise/ds-modal": "^0.16.7",
|
|
48
48
|
"@synerise/ds-result": "^0.6.16",
|
|
49
|
-
"@synerise/ds-tabs": "^0.13.
|
|
49
|
+
"@synerise/ds-tabs": "^0.13.34",
|
|
50
50
|
"@synerise/ds-typography": "^0.12.7",
|
|
51
51
|
"@synerise/ds-utils": "^0.19.0",
|
|
52
52
|
"classnames": "^2.2.6",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@synerise/ds-core": "*",
|
|
57
57
|
"react": ">=16.9.0 < 17.0.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "41d417bdee4ee513979582394f0b4cdcdb2fed2f"
|
|
60
60
|
}
|