@synerise/ds-factors 0.28.14 → 1.0.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 +8 -0
- package/dist/FactorTypeSelector/FactorTypeSelector.d.ts +1 -1
- package/dist/FactorTypeSelector/FactorTypeSelector.js +4 -4
- package/dist/FactorValue/Date/Date.d.ts +2 -2
- package/dist/FactorValue/DateRange/DateRange.d.ts +2 -2
- package/dist/FactorValue/DynamicKey/DynamicKey.d.ts +2 -2
- package/dist/FactorValue/FactorValue.js +6 -5
- package/dist/FactorValue/Formula/Formula.d.ts +2 -2
- package/dist/FactorValue/Number/NumberInput.d.ts +2 -2
- package/dist/FactorValue/Parameter/Parameter.d.ts +2 -2
- package/dist/FactorValue/Parameter/Parameter.js +6 -6
- package/dist/FactorValue/Parameter/Parameter.style.js +1 -1
- package/dist/FactorValue/Text/Text.d.ts +2 -2
- package/dist/Factors.d.ts +2 -2
- package/dist/Factors.js +34 -18
- package/dist/Factors.types.d.ts +7 -4
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.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
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.28.14](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.28.13...@synerise/ds-factors@0.28.14) (2025-03-10)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FactorTypeSelectorProps } from '../Factors.types';
|
|
3
|
-
declare const FactorTypeSelector: ({ selectedFactorType, setSelectedFactorType, unavailableFactorTypes, availableFactorTypes, selectedFactor, texts, readOnly, }: FactorTypeSelectorProps) => React.JSX.Element;
|
|
3
|
+
declare const FactorTypeSelector: ({ selectedFactorType, setSelectedFactorType, unavailableFactorTypes, availableFactorTypes, factorTypeMapping, selectedFactor, texts, readOnly, }: FactorTypeSelectorProps) => React.JSX.Element;
|
|
4
4
|
export default FactorTypeSelector;
|
|
@@ -6,12 +6,12 @@ import ListItem from '@synerise/ds-list-item';
|
|
|
6
6
|
import { theme } from '@synerise/ds-core';
|
|
7
7
|
import * as S from './FactorTypeSelector.styles';
|
|
8
8
|
import { ALL_FACTOR_TYPES } from '../Factors.types';
|
|
9
|
-
import { factorTypes } from '../Factors';
|
|
10
9
|
var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
11
10
|
var selectedFactorType = _ref.selectedFactorType,
|
|
12
11
|
setSelectedFactorType = _ref.setSelectedFactorType,
|
|
13
12
|
unavailableFactorTypes = _ref.unavailableFactorTypes,
|
|
14
13
|
availableFactorTypes = _ref.availableFactorTypes,
|
|
14
|
+
factorTypeMapping = _ref.factorTypeMapping,
|
|
15
15
|
selectedFactor = _ref.selectedFactor,
|
|
16
16
|
texts = _ref.texts,
|
|
17
17
|
readOnly = _ref.readOnly;
|
|
@@ -28,9 +28,9 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
|
28
28
|
return list.map(function (type) {
|
|
29
29
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
30
30
|
className: "ds-factor-type",
|
|
31
|
-
key:
|
|
31
|
+
key: factorTypeMapping[type].name,
|
|
32
32
|
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
-
component:
|
|
33
|
+
component: factorTypeMapping[type].icon
|
|
34
34
|
}),
|
|
35
35
|
suffixel: type === selectedFactorType ? /*#__PURE__*/React.createElement(Icon, {
|
|
36
36
|
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
@@ -42,7 +42,7 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
|
42
42
|
}
|
|
43
43
|
}, texts[type]);
|
|
44
44
|
});
|
|
45
|
-
}, [availableFactorTypes, unavailableFactorTypes, selectedFactorType, texts, setSelectedFactorType]);
|
|
45
|
+
}, [availableFactorTypes, unavailableFactorTypes, factorTypeMapping, selectedFactorType, texts, setSelectedFactorType]);
|
|
46
46
|
var trigger = /*#__PURE__*/React.createElement(S.TriggerButton, {
|
|
47
47
|
mode: "single-icon",
|
|
48
48
|
className: "ds-factors-type-selector",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const DateInput: ({ value, onChange, texts, opened, onDeactivate, onActivate, error, allowClear, readOnly, getPopupContainerOverride, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const DateInput: ({ value, onChange, texts, opened, onDeactivate, onActivate, error, allowClear, readOnly, getPopupContainerOverride, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default DateInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const DateRangeInput: ({ getPopupContainerOverride, value, onChange, error, texts, onDeactivate, allowClear, readOnly, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const DateRangeInput: ({ getPopupContainerOverride, value, onChange, error, texts, onDeactivate, allowClear, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default DateRangeInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, readOnly, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default DynamicKey;
|
|
@@ -30,16 +30,17 @@ var FactorValue = function FactorValue(_ref) {
|
|
|
30
30
|
if (!selectedFactor) {
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
return /*#__PURE__*/React.createElement(
|
|
33
|
+
var FactorValueComponent = selectedFactor.component;
|
|
34
|
+
return /*#__PURE__*/React.createElement(FactorValueComponent, {
|
|
35
35
|
key: factorKey + "-" + selectedFactor.name,
|
|
36
|
-
value: value
|
|
37
|
-
placeholder
|
|
36
|
+
value: value
|
|
37
|
+
// placeholder={texts.valuePlaceholder}
|
|
38
|
+
,
|
|
38
39
|
onChange: onChangeValue,
|
|
39
40
|
textType: textType,
|
|
40
41
|
factorType: selectedFactorType,
|
|
41
42
|
autocompleteText: autocompleteText,
|
|
42
|
-
parameters: ['parameter', 'contextParameter'].indexOf(selectedFactorType) >= 0
|
|
43
|
+
parameters: ['parameter', 'contextParameter'].indexOf(selectedFactorType) >= 0 ? parameters : undefined,
|
|
43
44
|
withoutTypeSelector: withoutTypeSelector,
|
|
44
45
|
texts: texts,
|
|
45
46
|
inputProps: inputProps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const FormulaInput: ({ value, error, onChange, withoutTypeSelector, texts, formulaEditor, readOnly, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const FormulaInput: ({ value, error, onChange, withoutTypeSelector, texts, formulaEditor, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default FormulaInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const NumberInput: ({ error, value, onChange, texts, opened, onDeactivate, readOnly }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const NumberInput: ({ error, value, onChange, texts, opened, onDeactivate, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default NumberInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const ParameterInput: ({ value, onChange, onParamsClick, parameters, texts, opened, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, readOnly, error, loading, getMenuEntryProps, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const ParameterInput: ({ value, onChange, onParamsClick, parameters, texts, opened, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, readOnly, error, loading, getMenuEntryProps, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default ParameterInput;
|
|
@@ -27,12 +27,12 @@ var ParameterInput = function ParameterInput(_ref) {
|
|
|
27
27
|
error = _ref.error,
|
|
28
28
|
loading = _ref.loading,
|
|
29
29
|
getMenuEntryProps = _ref.getMenuEntryProps;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
buttonLabel =
|
|
33
|
-
selectedButtonColored =
|
|
34
|
-
dropdownDimensionsConfig =
|
|
35
|
-
restParameters = _objectWithoutPropertiesLoose(
|
|
30
|
+
var _ref2 = parameters || {},
|
|
31
|
+
buttonIcon = _ref2.buttonIcon,
|
|
32
|
+
buttonLabel = _ref2.buttonLabel,
|
|
33
|
+
selectedButtonColored = _ref2.selectedButtonColored,
|
|
34
|
+
dropdownDimensionsConfig = _ref2.dropdownDimensionsConfig,
|
|
35
|
+
restParameters = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
36
36
|
var dimensionsConfig = _extends({
|
|
37
37
|
defaultHeight: DROPDOWN_HEIGHT,
|
|
38
38
|
lowerHeight: DROPDOWN_HEIGHT_BELOW_THRESHOLD,
|
|
@@ -34,7 +34,7 @@ export var Value = styled.span.withConfig({
|
|
|
34
34
|
export var StyledList = styled(VariableSizeList).withConfig({
|
|
35
35
|
displayName: "Parameterstyle__StyledList",
|
|
36
36
|
componentId: "sc-u2uvgh-6"
|
|
37
|
-
})(["
|
|
37
|
+
})(["overflow-x:unset;overflow-y:unset;height:auto !important;max-height:300px;"]);
|
|
38
38
|
export var Skeleton = styled(DropdownSkeleton).withConfig({
|
|
39
39
|
displayName: "Parameterstyle__Skeleton",
|
|
40
40
|
componentId: "sc-u2uvgh-7"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const TextInput: ({ value, onChange, texts, textType, autocompleteText, factorType, opened, onDeactivate, error, inputProps, getPopupContainerOverride, readOnly, }:
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
|
+
declare const TextInput: ({ value, onChange, texts, textType, autocompleteText, factorType, opened, onDeactivate, error, inputProps, getPopupContainerOverride, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default TextInput;
|
package/dist/Factors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DefinedFactorTypes, FactorsProps, SelectedFactorType } from './Factors.types';
|
|
3
|
-
export declare const
|
|
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, error, inputProps, readOnly, getMenuEntryProps, }: FactorsProps) => React.JSX.Element;
|
|
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, readOnly, getMenuEntryProps, }: FactorsProps) => React.JSX.Element;
|
|
5
5
|
export default Factors;
|
package/dist/Factors.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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); }
|
|
1
2
|
import React, { useMemo } from 'react';
|
|
2
3
|
import { BookM, Calendar2M, DynamicKeyM, FormulaM, HashM, ListM, ShowM, TextM } from '@synerise/ds-icon';
|
|
4
|
+
import { NOOP } from '@synerise/ds-utils';
|
|
3
5
|
import * as S from './style/Factors.style';
|
|
4
6
|
import FactorTypeSelector from './FactorTypeSelector/FactorTypeSelector';
|
|
5
7
|
import FactorValue from './FactorValue/FactorValue';
|
|
@@ -11,55 +13,53 @@ import ParameterInput from './FactorValue/Parameter/Parameter';
|
|
|
11
13
|
import NumberInput from './FactorValue/Number/NumberInput';
|
|
12
14
|
import DateRangeInput from './FactorValue/DateRange/DateRange';
|
|
13
15
|
import { useTexts } from './hooks/useTexts';
|
|
14
|
-
export var
|
|
16
|
+
export var FACTOR_TYPE_MAPPING = {
|
|
15
17
|
text: {
|
|
16
18
|
icon: /*#__PURE__*/React.createElement(TextM, null),
|
|
17
19
|
name: 'Text',
|
|
18
|
-
|
|
20
|
+
component: TextInput
|
|
19
21
|
},
|
|
20
22
|
number: {
|
|
21
23
|
icon: /*#__PURE__*/React.createElement(HashM, null),
|
|
22
24
|
name: 'Number',
|
|
23
|
-
|
|
25
|
+
component: NumberInput
|
|
24
26
|
},
|
|
25
27
|
parameter: {
|
|
26
28
|
icon: /*#__PURE__*/React.createElement(BookM, null),
|
|
27
29
|
name: 'Parameter',
|
|
28
|
-
|
|
30
|
+
component: ParameterInput
|
|
29
31
|
},
|
|
30
32
|
contextParameter: {
|
|
31
33
|
icon: /*#__PURE__*/React.createElement(ShowM, null),
|
|
32
34
|
name: 'Context parameter',
|
|
33
|
-
|
|
35
|
+
component: ParameterInput
|
|
34
36
|
},
|
|
35
37
|
dynamicKey: {
|
|
36
38
|
icon: /*#__PURE__*/React.createElement(DynamicKeyM, null),
|
|
37
39
|
name: 'Dynamic key',
|
|
38
|
-
|
|
40
|
+
component: DynamicKey
|
|
39
41
|
},
|
|
40
42
|
formula: {
|
|
41
43
|
icon: /*#__PURE__*/React.createElement(FormulaM, null),
|
|
42
44
|
name: 'Formula',
|
|
43
|
-
|
|
45
|
+
component: FormulaInput
|
|
44
46
|
},
|
|
45
47
|
array: {
|
|
46
48
|
icon: /*#__PURE__*/React.createElement(ListM, null),
|
|
47
49
|
name: 'Array',
|
|
48
|
-
|
|
50
|
+
component: TextInput
|
|
49
51
|
},
|
|
50
52
|
date: {
|
|
51
53
|
icon: /*#__PURE__*/React.createElement(Calendar2M, null),
|
|
52
54
|
name: 'Date',
|
|
53
|
-
|
|
55
|
+
component: DateInput
|
|
54
56
|
},
|
|
55
57
|
dateRange: {
|
|
56
58
|
icon: /*#__PURE__*/React.createElement(Calendar2M, null),
|
|
57
59
|
name: 'Date range',
|
|
58
|
-
|
|
60
|
+
component: DateRangeInput
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
62
|
-
var NOOP = function NOOP() {};
|
|
63
63
|
var Factors = function Factors(_ref) {
|
|
64
64
|
var selectedFactorType = _ref.selectedFactorType,
|
|
65
65
|
_ref$setSelectedFacto = _ref.setSelectedFactorType,
|
|
@@ -88,6 +88,7 @@ var Factors = function Factors(_ref) {
|
|
|
88
88
|
onActivate = _ref.onActivate,
|
|
89
89
|
onDeactivate = _ref.onDeactivate,
|
|
90
90
|
getPopupContainerOverride = _ref.getPopupContainerOverride,
|
|
91
|
+
customFactorValueComponents = _ref.customFactorValueComponents,
|
|
91
92
|
error = _ref.error,
|
|
92
93
|
inputProps = _ref.inputProps,
|
|
93
94
|
readOnly = _ref.readOnly,
|
|
@@ -96,19 +97,34 @@ var Factors = function Factors(_ref) {
|
|
|
96
97
|
var factorType = useMemo(function () {
|
|
97
98
|
return selectedFactorType || defaultFactorType;
|
|
98
99
|
}, [selectedFactorType, defaultFactorType]);
|
|
99
|
-
var
|
|
100
|
-
return
|
|
101
|
-
|
|
100
|
+
var mergedFactorData = useMemo(function () {
|
|
101
|
+
return Object.entries(FACTOR_TYPE_MAPPING).map(function (_ref2) {
|
|
102
|
+
var type = _ref2[0],
|
|
103
|
+
factorTypeData = _ref2[1];
|
|
104
|
+
var mergedData = customFactorValueComponents ? _extends({}, factorTypeData, customFactorValueComponents[type]) : factorTypeData;
|
|
105
|
+
return [type, _extends({}, factorTypeData, mergedData)];
|
|
106
|
+
}).reduce(function (result, _ref3) {
|
|
107
|
+
var type = _ref3[0],
|
|
108
|
+
factorTypeData = _ref3[1];
|
|
109
|
+
// eslint-disable-next-line no-param-reassign
|
|
110
|
+
result[type] = factorTypeData;
|
|
111
|
+
return result;
|
|
112
|
+
}, {});
|
|
113
|
+
}, [customFactorValueComponents]);
|
|
114
|
+
var selectedFactorData = useMemo(function () {
|
|
115
|
+
return mergedFactorData[factorType];
|
|
116
|
+
}, [mergedFactorData, factorType]);
|
|
102
117
|
return /*#__PURE__*/React.createElement(S.Group, {
|
|
103
118
|
resetMargin: true,
|
|
104
119
|
compact: true,
|
|
105
120
|
withoutTypeSelector: withoutTypeSelector,
|
|
106
121
|
className: "ds-factors ds-factors-" + factorType
|
|
107
|
-
},
|
|
122
|
+
}, selectedFactorData && !withoutTypeSelector && setSelectedFactorType && /*#__PURE__*/React.createElement(FactorTypeSelector, {
|
|
108
123
|
texts: allTexts.factorTypes,
|
|
124
|
+
factorTypeMapping: mergedFactorData,
|
|
109
125
|
selectedFactorType: factorType,
|
|
110
126
|
setSelectedFactorType: setSelectedFactorType,
|
|
111
|
-
selectedFactor:
|
|
127
|
+
selectedFactor: selectedFactorData,
|
|
112
128
|
availableFactorTypes: availableFactorTypes,
|
|
113
129
|
unavailableFactorTypes: unavailableFactorTypes,
|
|
114
130
|
readOnly: readOnly
|
|
@@ -116,7 +132,7 @@ var Factors = function Factors(_ref) {
|
|
|
116
132
|
value: value,
|
|
117
133
|
onChangeValue: onChangeValue,
|
|
118
134
|
onParamsClick: onParamsClick,
|
|
119
|
-
selectedFactor:
|
|
135
|
+
selectedFactor: selectedFactorData,
|
|
120
136
|
selectedFactorType: factorType,
|
|
121
137
|
textType: textType,
|
|
122
138
|
parameters: parameters,
|
package/dist/Factors.types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactText, ReactNode,
|
|
1
|
+
import type { ReactText, ReactNode, ComponentType } from 'react';
|
|
2
2
|
import type { DateFilter } from '@synerise/ds-date-range-picker/dist/date.types';
|
|
3
3
|
import type { Texts as DateRangeTexts } from '@synerise/ds-date-range-picker/dist/DateRangePicker.types';
|
|
4
4
|
import type { MenuItemProps } from '@synerise/ds-menu';
|
|
@@ -49,7 +49,7 @@ export type FactorValueType = string | number | null | Date | undefined | Dynami
|
|
|
49
49
|
export type SelectedFactorType = {
|
|
50
50
|
name: string;
|
|
51
51
|
icon: ReactNode;
|
|
52
|
-
|
|
52
|
+
component: ComponentType<FactorValueComponentProps>;
|
|
53
53
|
};
|
|
54
54
|
export type FactorsTexts = {
|
|
55
55
|
dateRangePicker: DateRangeTexts;
|
|
@@ -83,6 +83,7 @@ export type FactorsTexts = {
|
|
|
83
83
|
[k in DefinedFactorTypes]: string;
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
+
export type FactorTypeMapping = Record<DefinedFactorTypes, Partial<SelectedFactorType>>;
|
|
86
87
|
export type FactorsProps = {
|
|
87
88
|
factorKey?: ReactText;
|
|
88
89
|
error?: boolean;
|
|
@@ -93,6 +94,7 @@ export type FactorsProps = {
|
|
|
93
94
|
availableFactorTypes?: FactorType[];
|
|
94
95
|
selectedFactorType: FactorType;
|
|
95
96
|
defaultFactorType: FactorType;
|
|
97
|
+
customFactorValueComponents?: Partial<FactorTypeMapping>;
|
|
96
98
|
getPopupContainerOverride?: (trigger: HTMLElement | null) => HTMLElement;
|
|
97
99
|
onActivate?: () => void;
|
|
98
100
|
onDeactivate?: () => void;
|
|
@@ -126,13 +128,14 @@ export type FactorsProps = {
|
|
|
126
128
|
loading?: boolean;
|
|
127
129
|
preventAutoloadData?: boolean;
|
|
128
130
|
withCustomFactor?: ReactNode;
|
|
129
|
-
inputProps?: Partial<
|
|
131
|
+
inputProps?: Partial<FactorValueComponentProps>;
|
|
130
132
|
readOnly?: boolean;
|
|
131
133
|
getMenuEntryProps?: (arg?: ParameterValueType) => MenuItemProps;
|
|
132
134
|
};
|
|
133
135
|
export type FactorTypeSelectorProps = Pick<FactorsProps, 'unavailableFactorTypes' | 'availableFactorTypes' | 'selectedFactorType' | 'readOnly'> & {
|
|
134
136
|
setSelectedFactorType: (factor: FactorType) => void;
|
|
135
137
|
selectedFactor: SelectedFactorType;
|
|
138
|
+
factorTypeMapping: FactorTypeMapping;
|
|
136
139
|
texts: {
|
|
137
140
|
[k in DefinedFactorTypes]: string;
|
|
138
141
|
};
|
|
@@ -141,7 +144,7 @@ export type FactorValueProps = Pick<FactorsProps, 'onChangeValue' | 'onParamsCli
|
|
|
141
144
|
texts: FactorsTexts;
|
|
142
145
|
selectedFactor: SelectedFactorType;
|
|
143
146
|
};
|
|
144
|
-
export type
|
|
147
|
+
export type FactorValueComponentProps = Pick<FactorsProps, 'value' | 'parameters' | 'allowClear' | 'autocompleteText' | 'withoutTypeSelector' | 'textType' | 'opened' | 'getPopupContainerOverride' | 'onActivate' | 'onDeactivate' | 'error' | 'inputProps' | 'autoResize' | 'readOnly' | 'getMenuEntryProps'> & {
|
|
145
148
|
texts: FactorsTexts;
|
|
146
149
|
onChange: (value: FactorValueType) => void;
|
|
147
150
|
factorType: FactorType;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export { default, factorTypes } from './Factors';
|
|
1
|
+
export { default, FACTOR_TYPE_MAPPING as factorTypes } from './Factors';
|
|
2
2
|
export { ALL_FACTOR_TYPES } from './Factors.types';
|
|
3
|
-
export type { FactorType, DefinedFactorTypes, FactorsProps, FactorsTexts, ParameterValueType, ParameterItem, ParameterGroup,
|
|
3
|
+
export type { FactorType, DefinedFactorTypes, FactorsProps, FactorsTexts, ParameterValueType, ParameterItem, ParameterGroup, FactorValueComponentProps,
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated, use FactorValueComponentProps type instead
|
|
6
|
+
*/
|
|
7
|
+
FactorValueComponentProps as InputProps, FactorValueType, FactorValueProps, DynamicKeyValueType, FormulaValueType, FactorTypeSelectorProps, FormulaModalProps, TextModalProps, ParameterDropdownProps, SelectedFactorType, } from './Factors.types';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default, factorTypes } from './Factors';
|
|
1
|
+
export { default, FACTOR_TYPE_MAPPING as factorTypes } from './Factors';
|
|
2
2
|
export { ALL_FACTOR_TYPES } from './Factors.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,26 +34,26 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-autocomplete": "^0.
|
|
38
|
-
"@synerise/ds-badge": "^0.
|
|
39
|
-
"@synerise/ds-button": "^
|
|
40
|
-
"@synerise/ds-date-picker": "^0.
|
|
41
|
-
"@synerise/ds-date-range-picker": "^
|
|
42
|
-
"@synerise/ds-dropdown": "^0.
|
|
43
|
-
"@synerise/ds-icon": "^0.
|
|
44
|
-
"@synerise/ds-information-card": "^0.
|
|
45
|
-
"@synerise/ds-inline-edit": "^0.
|
|
46
|
-
"@synerise/ds-input": "^0.
|
|
47
|
-
"@synerise/ds-input-number": "^0.
|
|
48
|
-
"@synerise/ds-list-item": "^0.
|
|
49
|
-
"@synerise/ds-menu": "^0.
|
|
50
|
-
"@synerise/ds-modal": "^0.
|
|
51
|
-
"@synerise/ds-result": "^0.
|
|
52
|
-
"@synerise/ds-scrollbar": "^0.
|
|
53
|
-
"@synerise/ds-skeleton": "^0.
|
|
54
|
-
"@synerise/ds-tabs": "^0.
|
|
55
|
-
"@synerise/ds-tooltip": "^
|
|
56
|
-
"@synerise/ds-utils": "^0.
|
|
37
|
+
"@synerise/ds-autocomplete": "^1.0.1",
|
|
38
|
+
"@synerise/ds-badge": "^1.0.1",
|
|
39
|
+
"@synerise/ds-button": "^1.1.0",
|
|
40
|
+
"@synerise/ds-date-picker": "^1.0.1",
|
|
41
|
+
"@synerise/ds-date-range-picker": "^1.1.0",
|
|
42
|
+
"@synerise/ds-dropdown": "^1.0.1",
|
|
43
|
+
"@synerise/ds-icon": "^1.0.1",
|
|
44
|
+
"@synerise/ds-information-card": "^1.0.1",
|
|
45
|
+
"@synerise/ds-inline-edit": "^1.0.1",
|
|
46
|
+
"@synerise/ds-input": "^1.0.1",
|
|
47
|
+
"@synerise/ds-input-number": "^1.0.1",
|
|
48
|
+
"@synerise/ds-list-item": "^1.0.1",
|
|
49
|
+
"@synerise/ds-menu": "^1.0.1",
|
|
50
|
+
"@synerise/ds-modal": "^1.0.1",
|
|
51
|
+
"@synerise/ds-result": "^1.0.1",
|
|
52
|
+
"@synerise/ds-scrollbar": "^1.0.1",
|
|
53
|
+
"@synerise/ds-skeleton": "^1.0.1",
|
|
54
|
+
"@synerise/ds-tabs": "^1.0.1",
|
|
55
|
+
"@synerise/ds-tooltip": "^1.1.0",
|
|
56
|
+
"@synerise/ds-utils": "^1.0.1",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
58
|
"react-window": "1.8.5",
|
|
59
59
|
"uuid": "^8.3.2"
|
|
@@ -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": "218110f61f4371bc04d793b2b976b71d14e99e76"
|
|
69
69
|
}
|