@synerise/ds-factors 0.15.5 → 0.15.7

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,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.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.15.6...@synerise/ds-factors@0.15.7) (2022-10-14)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-factors
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **factors:** add input AutoResize to pick from inputs ([f641612](https://github.com/Synerise/synerise-design/commit/f641612ab4e109da277b8618d7b09e1f07505c0c))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [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)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-factors
@@ -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
- return /*#__PURE__*/React.createElement(S.TextWrapper, null, factorType === 'text' && textType === 'autocomplete' ? /*#__PURE__*/React.createElement(Autocomplete, {
86
- placeholder: texts.valuePlaceholder,
87
- value: localValue,
88
- onChange: handleAutocomplete,
89
- onBlur: onDeactivate,
90
- error: localError || error,
91
- handleInputRef: setInputRef,
92
- defaultOpen: true
93
- }, autocompleteOptions == null ? void 0 : autocompleteOptions.map(function (option) {
94
- return /*#__PURE__*/React.createElement(Autocomplete.Option, {
95
- key: option,
96
- value: option
97
- }, option);
98
- })) : /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, {
99
- handleInputRef: setInputRef,
100
- placeholder: texts.valuePlaceholder,
101
- suffix: SuffixIcon,
102
- value: localValue,
103
- onChange: handleChange,
104
- onBlur: onDeactivate,
105
- error: localError || error
106
- }))), /*#__PURE__*/React.createElement(TextModal, {
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);
@@ -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.5",
3
+ "version": "0.15.7",
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.41",
39
- "@synerise/ds-date-range-picker": "^0.17.2",
40
- "@synerise/ds-dropdown": "^0.17.38",
38
+ "@synerise/ds-date-picker": "^0.6.42",
39
+ "@synerise/ds-date-range-picker": "^0.17.4",
40
+ "@synerise/ds-dropdown": "^0.17.39",
41
41
  "@synerise/ds-icon": "^0.51.0",
42
- "@synerise/ds-information-card": "^0.1.23",
43
- "@synerise/ds-inline-edit": "^0.6.34",
44
- "@synerise/ds-input": "^0.18.23",
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.33",
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": "81b52bf3a3b9b3fa38f9e736674720b27b3965d0"
59
+ "gitHead": "664dece0bd2c724cd411f46b35503fcb409b741e"
60
60
  }