@synerise/ds-factors 1.3.2 → 1.4.1
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 +24 -0
- package/dist/FactorValue/DynamicKey/DynamicKey.d.ts +1 -1
- package/dist/FactorValue/DynamicKey/DynamicKey.js +14 -4
- package/dist/FactorValue/DynamicKey/DynamicKey.style.d.ts +5 -0
- package/dist/FactorValue/DynamicKey/DynamicKey.style.js +10 -5
- package/dist/FactorValue/FactorValue.d.ts +1 -1
- package/dist/FactorValue/FactorValue.js +5 -3
- package/dist/FactorValue/Parameter/Parameter.js +2 -3
- package/dist/FactorValue/Parameter/Parameter.style.d.ts +2 -0
- package/dist/FactorValue/Parameter/Parameter.style.js +10 -7
- package/dist/FactorValue/Text/Text.d.ts +1 -1
- package/dist/FactorValue/Text/Text.js +16 -7
- package/dist/Factors.d.ts +1 -1
- package/dist/Factors.js +3 -1
- package/dist/Factors.types.d.ts +16 -2
- package/package.json +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.4.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.4.0...@synerise/ds-factors@1.4.1) (2025-07-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.3.2...@synerise/ds-factors@1.4.0) (2025-07-04)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **condition:** allow param button to use available space ([b3ea666](https://github.com/Synerise/synerise-design/commit/b3ea666417cd14440ceff58de2e91e58198bfd49))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **factors:** pass component props ([81f40dd](https://github.com/Synerise/synerise-design/commit/81f40dd18b3e7d88828d5e418efc94b1cb9eda91))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [1.3.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.3.1...@synerise/ds-factors@1.3.2) (2025-07-01)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
-
declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
3
|
+
declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, factorValueExtraProps, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default DynamicKey;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { RawInput } from '@synerise/ds-input';
|
|
4
3
|
import * as S from './DynamicKey.style';
|
|
5
4
|
var DynamicKey = function DynamicKey(_ref) {
|
|
6
5
|
var value = _ref.value,
|
|
@@ -11,6 +10,7 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
11
10
|
opened = _ref.opened,
|
|
12
11
|
onDeactivate = _ref.onDeactivate,
|
|
13
12
|
error = _ref.error,
|
|
13
|
+
factorValueExtraProps = _ref.factorValueExtraProps,
|
|
14
14
|
_ref$readOnly = _ref.readOnly,
|
|
15
15
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
16
16
|
var _useState = useState({
|
|
@@ -39,7 +39,15 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
39
39
|
value: value.value
|
|
40
40
|
});
|
|
41
41
|
}, [value]);
|
|
42
|
-
var
|
|
42
|
+
var _ref2 = (factorValueExtraProps == null ? void 0 : factorValueExtraProps.dynamicKey) || {},
|
|
43
|
+
_ref2$keyInputProps = _ref2.keyInputProps,
|
|
44
|
+
keyInputProps = _ref2$keyInputProps === void 0 ? {} : _ref2$keyInputProps,
|
|
45
|
+
_ref2$valueInputProps = _ref2.valueInputProps,
|
|
46
|
+
valueInputProps = _ref2$valueInputProps === void 0 ? {} : _ref2$valueInputProps;
|
|
47
|
+
var trigger = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.DynamicKeyInput, _extends({
|
|
48
|
+
withoutTypeSelector: withoutTypeSelector,
|
|
49
|
+
index: 0
|
|
50
|
+
}, keyInputProps, {
|
|
43
51
|
placeholder: texts.dynamicKey.keyPlaceholder,
|
|
44
52
|
value: localValue.key,
|
|
45
53
|
name: "key",
|
|
@@ -48,14 +56,16 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
48
56
|
onBlur: onDeactivate,
|
|
49
57
|
error: localError || error,
|
|
50
58
|
readOnly: readOnly
|
|
51
|
-
}), /*#__PURE__*/React.createElement(
|
|
59
|
+
})), /*#__PURE__*/React.createElement(S.DynamicKeyInput, _extends({
|
|
60
|
+
index: 1
|
|
61
|
+
}, valueInputProps, {
|
|
52
62
|
placeholder: texts.dynamicKey.valuePlaceholder,
|
|
53
63
|
value: localValue.value,
|
|
54
64
|
name: "value",
|
|
55
65
|
onChange: handleChange,
|
|
56
66
|
error: localError || error,
|
|
57
67
|
readOnly: readOnly
|
|
58
|
-
}));
|
|
68
|
+
})));
|
|
59
69
|
return /*#__PURE__*/React.createElement(S.DynamicKey, {
|
|
60
70
|
"data-testid": "ds-factors-dynamic-key",
|
|
61
71
|
withoutTypeSelector: withoutTypeSelector
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DynamicKeyInput: import("styled-components").StyledComponent<({ className, errorText, label, description, counterLimit, tooltip, tooltipConfig, icon1, icon1Tooltip, autoResize, icon2, icon2Tooltip, resetMargin, handleInputRef, prefixel, suffixel, error, expandable, expandableTooltip, renderCustomCounter, autoResizeProps, ...antdInputProps }: import("@synerise/ds-input").InputProps) => import("react").JSX.Element, any, {
|
|
3
|
+
index: 0 | 1;
|
|
4
|
+
withoutTypeSelector?: boolean | undefined;
|
|
5
|
+
}, never>;
|
|
1
6
|
export declare const DynamicKey: import("styled-components").StyledComponent<"div", any, {
|
|
2
7
|
withoutTypeSelector: boolean;
|
|
3
8
|
}, never>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Input } from '@synerise/ds-input';
|
|
3
|
+
export var DynamicKeyInput = styled(Input).withConfig({
|
|
4
|
+
displayName: "DynamicKeystyle__DynamicKeyInput",
|
|
5
|
+
componentId: "sc-43cup-0"
|
|
6
|
+
})(["flex:1;&:focus{z-index:2;}.ant-input{", "}"], function (props) {
|
|
7
|
+
return props.index === 0 ? css(["border-radius:", ";"], props.withoutTypeSelector ? '3px 0 0 3px' : '0') : css(["border-radius:0 3px 3px 0;margin-left:-1px;"]);
|
|
8
|
+
});
|
|
2
9
|
export var DynamicKey = styled.div.withConfig({
|
|
3
10
|
displayName: "DynamicKeystyle__DynamicKey",
|
|
4
|
-
componentId: "sc-43cup-
|
|
5
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100
|
|
6
|
-
return props.withoutTypeSelector ? '3px 0 0 3px' : '0';
|
|
7
|
-
});
|
|
11
|
+
componentId: "sc-43cup-1"
|
|
12
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FactorValueProps } from '../Factors.types';
|
|
3
|
-
declare const FactorValue: ({ selectedFactorType, value, onChangeValue, onParamsClick, selectedFactor, textType, parameters, autocompleteText, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, inputProps, allowClear, readOnly, getMenuEntryProps, relativeDateProps, arrayProps, }: FactorValueProps) => React.JSX.Element;
|
|
3
|
+
declare const FactorValue: ({ selectedFactorType, value, onChangeValue, onParamsClick, selectedFactor, textType, parameters, autocompleteText, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, inputProps, allowClear, readOnly, getMenuEntryProps, relativeDateProps, arrayProps, factorValueExtraProps, }: FactorValueProps) => React.JSX.Element;
|
|
4
4
|
export default FactorValue;
|
|
@@ -28,7 +28,8 @@ var FactorValue = function FactorValue(_ref) {
|
|
|
28
28
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
29
29
|
getMenuEntryProps = _ref.getMenuEntryProps,
|
|
30
30
|
relativeDateProps = _ref.relativeDateProps,
|
|
31
|
-
arrayProps = _ref.arrayProps
|
|
31
|
+
arrayProps = _ref.arrayProps,
|
|
32
|
+
factorValueExtraProps = _ref.factorValueExtraProps;
|
|
32
33
|
var inputType = React.useMemo(function () {
|
|
33
34
|
if (!selectedFactor) {
|
|
34
35
|
return undefined;
|
|
@@ -59,9 +60,10 @@ var FactorValue = function FactorValue(_ref) {
|
|
|
59
60
|
allowClear: allowClear,
|
|
60
61
|
readOnly: readOnly,
|
|
61
62
|
getMenuEntryProps: getMenuEntryProps,
|
|
62
|
-
inputProps: inputProps
|
|
63
|
+
inputProps: inputProps,
|
|
64
|
+
factorValueExtraProps: factorValueExtraProps
|
|
63
65
|
}, relativeDateProps));
|
|
64
|
-
}, [selectedFactor, factorKey, value, texts, onChangeValue, textType, selectedFactorType, autocompleteText, parameters, withoutTypeSelector, inputProps, arrayProps, formulaEditor, opened, loading, onParamsClick, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, allowClear, readOnly, getMenuEntryProps, relativeDateProps]);
|
|
66
|
+
}, [selectedFactor, factorKey, value, texts, onChangeValue, textType, selectedFactorType, autocompleteText, parameters, withoutTypeSelector, inputProps, arrayProps, formulaEditor, opened, loading, onParamsClick, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, allowClear, readOnly, getMenuEntryProps, relativeDateProps, factorValueExtraProps]);
|
|
65
67
|
return /*#__PURE__*/React.createElement(S.FactorInput, {
|
|
66
68
|
inputType: selectedFactorType,
|
|
67
69
|
inputTextType: textType,
|
|
@@ -2,14 +2,13 @@ var _excluded = ["buttonIcon", "buttonLabel", "selectedButtonColored", "dropdown
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import Button from '@synerise/ds-button';
|
|
6
5
|
import Dropdown from '@synerise/ds-dropdown';
|
|
7
6
|
import Icon, { AngleDownS } from '@synerise/ds-icon';
|
|
8
7
|
import InformationCard from '@synerise/ds-information-card';
|
|
9
8
|
import Menu from '@synerise/ds-menu';
|
|
10
9
|
import { getPopupContainer } from '@synerise/ds-utils';
|
|
11
10
|
import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from './Parameter.constants';
|
|
12
|
-
import { Value } from './Parameter.style';
|
|
11
|
+
import { ParameterButton, Value } from './Parameter.style';
|
|
13
12
|
import ParameterDropdown from './ParameterDropdown';
|
|
14
13
|
var ParameterInput = function ParameterInput(_ref) {
|
|
15
14
|
var value = _ref.value,
|
|
@@ -90,7 +89,7 @@ var ParameterInput = function ParameterInput(_ref) {
|
|
|
90
89
|
}
|
|
91
90
|
return readOnly ? 'simple' : 'label-icon';
|
|
92
91
|
}, [parameterIcon, readOnly]);
|
|
93
|
-
var triggerButton = /*#__PURE__*/React.createElement(
|
|
92
|
+
var triggerButton = /*#__PURE__*/React.createElement(ParameterButton, {
|
|
94
93
|
error: error,
|
|
95
94
|
type: isSelected && selectedButtonColored ? 'custom-color' : 'secondary',
|
|
96
95
|
color: isSelected && selectedButtonColored ? 'green' : undefined,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { VariableSizeList } from 'react-window';
|
|
3
|
+
import Button from '@synerise/ds-button';
|
|
3
4
|
export declare const TabsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const ContentPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
6
|
export declare const ItemsList: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -8,6 +9,7 @@ export declare const ItemsList: import("styled-components").StyledComponent<"div
|
|
|
8
9
|
export declare const SearchResult: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
9
10
|
export declare const SearchResultHighlight: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
10
11
|
export declare const Value: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
|
+
export declare const ParameterButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
11
13
|
export declare const StyledList: import("styled-components").StyledComponent<typeof VariableSizeList, any, {}, never>;
|
|
12
14
|
export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) => import("react").JSX.Element, any, {
|
|
13
15
|
contentHeight?: number | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { VariableSizeList } from 'react-window';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
|
|
4
|
-
// TESTME
|
|
3
|
+
import Button from '@synerise/ds-button';
|
|
5
4
|
import DropdownSkeleton from '@synerise/ds-skeleton';
|
|
6
5
|
export var TabsWrapper = styled.div.withConfig({
|
|
7
6
|
displayName: "Parameterstyle__TabsWrapper",
|
|
@@ -32,24 +31,28 @@ export var SearchResultHighlight = styled.span.withConfig({
|
|
|
32
31
|
export var Value = styled.span.withConfig({
|
|
33
32
|
displayName: "Parameterstyle__Value",
|
|
34
33
|
componentId: "sc-u2uvgh-5"
|
|
35
|
-
})(["max-width:110px;text-overflow:ellipsis;overflow:hidden;"]);
|
|
34
|
+
})(["max-width:110px;text-overflow:ellipsis;overflow:hidden;text-align:left;"]);
|
|
35
|
+
export var ParameterButton = styled(Button).withConfig({
|
|
36
|
+
displayName: "Parameterstyle__ParameterButton",
|
|
37
|
+
componentId: "sc-u2uvgh-6"
|
|
38
|
+
})(["max-width:100%;"]);
|
|
36
39
|
export var StyledList = styled(VariableSizeList).withConfig({
|
|
37
40
|
displayName: "Parameterstyle__StyledList",
|
|
38
|
-
componentId: "sc-u2uvgh-
|
|
41
|
+
componentId: "sc-u2uvgh-7"
|
|
39
42
|
})(["overflow-x:unset;overflow-y:unset;height:auto !important;max-height:300px;"]);
|
|
40
43
|
export var Skeleton = styled(DropdownSkeleton).withConfig({
|
|
41
44
|
displayName: "Parameterstyle__Skeleton",
|
|
42
|
-
componentId: "sc-u2uvgh-
|
|
45
|
+
componentId: "sc-u2uvgh-8"
|
|
43
46
|
})(["", ""], function (props) {
|
|
44
47
|
return props.contentHeight !== undefined && "height: " + props.contentHeight + "px;";
|
|
45
48
|
});
|
|
46
49
|
export var Title = styled.div.withConfig({
|
|
47
50
|
displayName: "Parameterstyle__Title",
|
|
48
|
-
componentId: "sc-u2uvgh-
|
|
51
|
+
componentId: "sc-u2uvgh-9"
|
|
49
52
|
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"], function (props) {
|
|
50
53
|
return props.theme.palette['grey-500'];
|
|
51
54
|
});
|
|
52
55
|
export var ShowMoreItem = styled.div.withConfig({
|
|
53
56
|
displayName: "Parameterstyle__ShowMoreItem",
|
|
54
|
-
componentId: "sc-u2uvgh-
|
|
57
|
+
componentId: "sc-u2uvgh-10"
|
|
55
58
|
})(["font-weight:500;"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
-
declare const TextInput: ({ value, onChange, texts, textType, autocompleteText, factorType, opened, onDeactivate, onActivate, error, inputProps, getPopupContainerOverride, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
3
|
+
declare const TextInput: ({ value, onChange, texts, textType, autocompleteText, factorType, opened, onDeactivate, onActivate, error, inputProps, getPopupContainerOverride, readOnly, factorValueExtraProps, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default TextInput;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import Autocomplete from '@synerise/ds-autocomplete';
|
|
4
|
-
import {
|
|
4
|
+
import { useTheme } from '@synerise/ds-core';
|
|
5
5
|
import Icon, { FullScreenM } from '@synerise/ds-icon';
|
|
6
6
|
import { Input } from '@synerise/ds-input';
|
|
7
7
|
import * as S from './Text.styles';
|
|
@@ -20,7 +20,8 @@ var TextInput = function TextInput(_ref) {
|
|
|
20
20
|
inputProps = _ref.inputProps,
|
|
21
21
|
getPopupContainerOverride = _ref.getPopupContainerOverride,
|
|
22
22
|
_ref$readOnly = _ref.readOnly,
|
|
23
|
-
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly
|
|
23
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
24
|
+
factorValueExtraProps = _ref.factorValueExtraProps;
|
|
24
25
|
var _useState = useState(false),
|
|
25
26
|
openExpanseEditor = _useState[0],
|
|
26
27
|
setOpenExpanseEditor = _useState[1];
|
|
@@ -33,6 +34,7 @@ var TextInput = function TextInput(_ref) {
|
|
|
33
34
|
var _useState4 = useState(false),
|
|
34
35
|
localError = _useState4[0],
|
|
35
36
|
setLocalError = _useState4[1];
|
|
37
|
+
var theme = useTheme();
|
|
36
38
|
useEffect(function () {
|
|
37
39
|
if (inputRef != null && inputRef.current && opened) {
|
|
38
40
|
inputRef.current.focus();
|
|
@@ -64,9 +66,14 @@ var TextInput = function TextInput(_ref) {
|
|
|
64
66
|
return option.toLowerCase().includes(String(localValue).toLowerCase());
|
|
65
67
|
}) || [];
|
|
66
68
|
}, [localValue, autocompleteText]);
|
|
69
|
+
var _ref2 = (factorValueExtraProps == null ? void 0 : factorValueExtraProps.text) || {},
|
|
70
|
+
_ref2$autoCompletePro = _ref2.autoCompleteProps,
|
|
71
|
+
autoCompleteProps = _ref2$autoCompletePro === void 0 ? {} : _ref2$autoCompletePro,
|
|
72
|
+
_ref2$inputProps = _ref2.inputProps,
|
|
73
|
+
extraInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps;
|
|
67
74
|
var renderInput = function renderInput(typesOfInput, factorsType) {
|
|
68
75
|
if (typesOfInput === 'autocomplete' && factorsType === 'text') {
|
|
69
|
-
return /*#__PURE__*/React.createElement(Autocomplete, _extends({}, inputProps, {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Autocomplete, _extends({}, inputProps, autoCompleteProps, {
|
|
70
77
|
placeholder: texts.valuePlaceholder,
|
|
71
78
|
value: localValue,
|
|
72
79
|
onChange: handleAutocomplete,
|
|
@@ -85,7 +92,7 @@ var TextInput = function TextInput(_ref) {
|
|
|
85
92
|
}));
|
|
86
93
|
}
|
|
87
94
|
if (typesOfInput === 'default' && factorsType === 'text') {
|
|
88
|
-
return /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, {
|
|
95
|
+
return /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, extraInputProps, {
|
|
89
96
|
handleInputRef: setInputRef,
|
|
90
97
|
placeholder: texts.valuePlaceholder,
|
|
91
98
|
value: localValue,
|
|
@@ -93,10 +100,11 @@ var TextInput = function TextInput(_ref) {
|
|
|
93
100
|
onBlur: onDeactivate,
|
|
94
101
|
onFocus: onActivate,
|
|
95
102
|
error: localError || error,
|
|
96
|
-
readOnly: readOnly
|
|
103
|
+
readOnly: readOnly,
|
|
104
|
+
resetMargin: true
|
|
97
105
|
})));
|
|
98
106
|
}
|
|
99
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, {
|
|
107
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, extraInputProps, {
|
|
100
108
|
handleInputRef: setInputRef,
|
|
101
109
|
placeholder: texts.valuePlaceholder,
|
|
102
110
|
icon1: /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
@@ -114,7 +122,8 @@ var TextInput = function TextInput(_ref) {
|
|
|
114
122
|
onBlur: onDeactivate,
|
|
115
123
|
onFocus: onActivate,
|
|
116
124
|
error: localError || error,
|
|
117
|
-
readOnly: readOnly
|
|
125
|
+
readOnly: readOnly,
|
|
126
|
+
resetMargin: true
|
|
118
127
|
}))), /*#__PURE__*/React.createElement(TextModal, {
|
|
119
128
|
visible: openExpanseEditor,
|
|
120
129
|
onCancel: function onCancel() {
|
package/dist/Factors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DefinedFactorTypes, type FactorsProps, type SelectedFactorType } from './Factors.types';
|
|
3
3
|
export declare const FACTOR_TYPE_MAPPING: Record<DefinedFactorTypes, SelectedFactorType>;
|
|
4
|
-
declare const Factors: ({ selectedFactorType, setSelectedFactorType, onChangeValue, onParamsClick, value, defaultFactorType, textType, unavailableFactorTypes, availableFactorTypes, parameters, autocompleteText, allowClear, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, onActivate, onDeactivate, getPopupContainerOverride, customFactorValueComponents, error, inputProps, arrayProps, readOnly, getMenuEntryProps, }: FactorsProps) => React.JSX.Element;
|
|
4
|
+
declare const Factors: ({ selectedFactorType, setSelectedFactorType, onChangeValue, onParamsClick, value, defaultFactorType, textType, unavailableFactorTypes, availableFactorTypes, parameters, autocompleteText, allowClear, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, onActivate, onDeactivate, getPopupContainerOverride, customFactorValueComponents, error, inputProps, arrayProps, readOnly, factorValueExtraProps, getMenuEntryProps, }: FactorsProps) => React.JSX.Element;
|
|
5
5
|
export default Factors;
|
package/dist/Factors.js
CHANGED
|
@@ -100,6 +100,7 @@ var Factors = function Factors(_ref) {
|
|
|
100
100
|
inputProps = _ref.inputProps,
|
|
101
101
|
arrayProps = _ref.arrayProps,
|
|
102
102
|
readOnly = _ref.readOnly,
|
|
103
|
+
factorValueExtraProps = _ref.factorValueExtraProps,
|
|
103
104
|
getMenuEntryProps = _ref.getMenuEntryProps;
|
|
104
105
|
var allTexts = useTexts(texts);
|
|
105
106
|
var factorType = useMemo(function () {
|
|
@@ -159,7 +160,8 @@ var Factors = function Factors(_ref) {
|
|
|
159
160
|
error: error,
|
|
160
161
|
allowClear: allowClear,
|
|
161
162
|
readOnly: readOnly,
|
|
162
|
-
getMenuEntryProps: getMenuEntryProps
|
|
163
|
+
getMenuEntryProps: getMenuEntryProps,
|
|
164
|
+
factorValueExtraProps: factorValueExtraProps
|
|
163
165
|
}));
|
|
164
166
|
};
|
|
165
167
|
export default Factors;
|
package/dist/Factors.types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode, ReactText } from 'react';
|
|
2
|
+
import type { AutocompleteProps } from '@synerise/ds-autocomplete';
|
|
2
3
|
import type { CollectorValue } from '@synerise/ds-collector';
|
|
3
4
|
import type { Texts as DateRangeTexts } from '@synerise/ds-date-range-picker/dist/DateRangePicker.types';
|
|
4
5
|
import type { DateFilter, RelativeUnits } from '@synerise/ds-date-range-picker/dist/date.types';
|
|
@@ -134,6 +135,17 @@ export type FactorsTexts = {
|
|
|
134
135
|
};
|
|
135
136
|
};
|
|
136
137
|
export type FactorTypeMapping = Record<DefinedFactorTypes, Partial<SelectedFactorType>>;
|
|
138
|
+
type InputPropKeys = 'icon1' | 'icon1Tooltip' | 'icon2' | 'icon2Tooltip';
|
|
139
|
+
export type ExtraPropsMapping = {
|
|
140
|
+
text: {
|
|
141
|
+
inputProps?: Pick<InputProps, InputPropKeys>;
|
|
142
|
+
autoCompleteProps?: Partial<AutocompleteProps>;
|
|
143
|
+
};
|
|
144
|
+
dynamicKey: {
|
|
145
|
+
keyInputProps?: Pick<InputProps, InputPropKeys>;
|
|
146
|
+
valueInputProps?: Pick<InputProps, InputPropKeys>;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
137
149
|
export type ArrayProps = {
|
|
138
150
|
itemType?: ArrayItemType;
|
|
139
151
|
limit?: number;
|
|
@@ -150,6 +162,7 @@ export type FactorsProps = {
|
|
|
150
162
|
selectedFactorType: FactorType;
|
|
151
163
|
defaultFactorType: FactorType;
|
|
152
164
|
customFactorValueComponents?: Partial<FactorTypeMapping>;
|
|
165
|
+
factorValueExtraProps?: Partial<ExtraPropsMapping>;
|
|
153
166
|
getPopupContainerOverride?: (trigger: HTMLElement | null) => HTMLElement;
|
|
154
167
|
onActivate?: () => void;
|
|
155
168
|
onDeactivate?: () => void;
|
|
@@ -199,11 +212,11 @@ export type FactorTypeSelectorProps = Pick<FactorsProps, 'unavailableFactorTypes
|
|
|
199
212
|
[k in DefinedFactorTypes]: string;
|
|
200
213
|
};
|
|
201
214
|
};
|
|
202
|
-
export type FactorValueProps = Pick<FactorsProps, 'onChangeValue' | 'onParamsClick' | 'value' | 'selectedFactorType' | 'parameters' | 'autocompleteText' | 'withoutTypeSelector' | 'textType' | 'formulaEditor' | 'opened' | 'loading' | 'factorKey' | 'preventAutoloadData' | 'getPopupContainerOverride' | 'onActivate' | 'onDeactivate' | 'error' | 'allowClear' | 'inputProps' | 'autoResize' | 'readOnly' | 'relativeDateProps' | 'arrayProps' | 'getMenuEntryProps'> & {
|
|
215
|
+
export type FactorValueProps = Pick<FactorsProps, 'onChangeValue' | 'onParamsClick' | 'value' | 'selectedFactorType' | 'parameters' | 'autocompleteText' | 'withoutTypeSelector' | 'textType' | 'formulaEditor' | 'opened' | 'loading' | 'factorKey' | 'preventAutoloadData' | 'getPopupContainerOverride' | 'onActivate' | 'onDeactivate' | 'error' | 'allowClear' | 'inputProps' | 'autoResize' | 'readOnly' | 'relativeDateProps' | 'arrayProps' | 'getMenuEntryProps' | 'factorValueExtraProps'> & {
|
|
203
216
|
texts: FactorsTexts;
|
|
204
217
|
selectedFactor: SelectedFactorType;
|
|
205
218
|
};
|
|
206
|
-
export type FactorValueComponentProps = Pick<FactorsProps, 'value' | 'parameters' | 'allowClear' | 'autocompleteText' | 'withoutTypeSelector' | 'textType' | 'opened' | 'getPopupContainerOverride' | 'onActivate' | 'onDeactivate' | 'error' | 'inputProps' | 'autoResize' | 'readOnly' | 'arrayProps' | 'getMenuEntryProps'> & {
|
|
219
|
+
export type FactorValueComponentProps = Pick<FactorsProps, 'value' | 'parameters' | 'allowClear' | 'autocompleteText' | 'withoutTypeSelector' | 'textType' | 'opened' | 'getPopupContainerOverride' | 'onActivate' | 'onDeactivate' | 'error' | 'inputProps' | 'autoResize' | 'readOnly' | 'arrayProps' | 'getMenuEntryProps' | 'factorValueExtraProps'> & {
|
|
207
220
|
texts: FactorsTexts;
|
|
208
221
|
onChange: (value: FactorValueType) => void;
|
|
209
222
|
factorType: FactorType;
|
|
@@ -242,3 +255,4 @@ export type FormulaModalProps = {
|
|
|
242
255
|
texts: FactorsTexts;
|
|
243
256
|
formulaEditor?: ReactNode;
|
|
244
257
|
};
|
|
258
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,31 +34,31 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-alert": "^1.1.
|
|
38
|
-
"@synerise/ds-autocomplete": "^1.1
|
|
39
|
-
"@synerise/ds-badge": "^1.0.
|
|
40
|
-
"@synerise/ds-button": "^1.4.
|
|
41
|
-
"@synerise/ds-button-group": "^1.1.
|
|
42
|
-
"@synerise/ds-collector": "^1.
|
|
43
|
-
"@synerise/ds-date-picker": "^1.1.
|
|
44
|
-
"@synerise/ds-date-range-picker": "^1.3.
|
|
45
|
-
"@synerise/ds-divider": "^1.0.
|
|
46
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
37
|
+
"@synerise/ds-alert": "^1.1.8",
|
|
38
|
+
"@synerise/ds-autocomplete": "^1.2.1",
|
|
39
|
+
"@synerise/ds-badge": "^1.0.14",
|
|
40
|
+
"@synerise/ds-button": "^1.4.3",
|
|
41
|
+
"@synerise/ds-button-group": "^1.1.7",
|
|
42
|
+
"@synerise/ds-collector": "^1.3.1",
|
|
43
|
+
"@synerise/ds-date-picker": "^1.1.12",
|
|
44
|
+
"@synerise/ds-date-range-picker": "^1.3.12",
|
|
45
|
+
"@synerise/ds-divider": "^1.0.14",
|
|
46
|
+
"@synerise/ds-dropdown": "^1.0.16",
|
|
47
47
|
"@synerise/ds-empty-states": "^1.0.12",
|
|
48
48
|
"@synerise/ds-icon": "^1.5.4",
|
|
49
|
-
"@synerise/ds-information-card": "^1.0.
|
|
50
|
-
"@synerise/ds-inline-edit": "^1.0.
|
|
51
|
-
"@synerise/ds-input": "^1.3.
|
|
52
|
-
"@synerise/ds-input-number": "^1.2.
|
|
49
|
+
"@synerise/ds-information-card": "^1.0.20",
|
|
50
|
+
"@synerise/ds-inline-edit": "^1.0.18",
|
|
51
|
+
"@synerise/ds-input": "^1.3.3",
|
|
52
|
+
"@synerise/ds-input-number": "^1.2.4",
|
|
53
53
|
"@synerise/ds-list-item": "^1.0.13",
|
|
54
|
-
"@synerise/ds-menu": "^1.0.
|
|
55
|
-
"@synerise/ds-modal": "^1.2.
|
|
56
|
-
"@synerise/ds-result": "^1.0.
|
|
54
|
+
"@synerise/ds-menu": "^1.0.15",
|
|
55
|
+
"@synerise/ds-modal": "^1.2.3",
|
|
56
|
+
"@synerise/ds-result": "^1.0.15",
|
|
57
57
|
"@synerise/ds-scrollbar": "^1.1.2",
|
|
58
|
-
"@synerise/ds-search": "^1.2.
|
|
59
|
-
"@synerise/ds-select": "^1.1.
|
|
60
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
61
|
-
"@synerise/ds-tabs": "^1.0.
|
|
58
|
+
"@synerise/ds-search": "^1.2.3",
|
|
59
|
+
"@synerise/ds-select": "^1.1.10",
|
|
60
|
+
"@synerise/ds-skeleton": "^1.0.15",
|
|
61
|
+
"@synerise/ds-tabs": "^1.0.17",
|
|
62
62
|
"@synerise/ds-tag": "^1.1.12",
|
|
63
63
|
"@synerise/ds-tooltip": "^1.1.12",
|
|
64
64
|
"@synerise/ds-utils": "^1.3.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
75
75
|
"styled-components": "^5.3.3"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "8db1900bf3f7b0782c834ff82f628199530cd934"
|
|
78
78
|
}
|