@synerise/ds-factors 1.11.11 → 1.11.13
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 +2 -2
- package/dist/FactorTypeSelector/FactorTypeSelector.js +37 -58
- package/dist/FactorTypeSelector/FactorTypeSelector.styles.d.ts +18 -18
- package/dist/FactorTypeSelector/FactorTypeSelector.styles.js +10 -10
- package/dist/FactorValue/Array/Array.const.js +8 -3
- package/dist/FactorValue/Array/Array.d.ts +2 -2
- package/dist/FactorValue/Array/Array.js +45 -57
- package/dist/FactorValue/Array/Array.styles.d.ts +39 -39
- package/dist/FactorValue/Array/Array.styles.js +44 -33
- package/dist/FactorValue/Array/Array.types.d.ts +3 -3
- package/dist/FactorValue/Array/Array.types.js +1 -1
- package/dist/FactorValue/Array/Array.utils.d.ts +2 -2
- package/dist/FactorValue/Array/Array.utils.js +21 -18
- package/dist/FactorValue/Array/components/ArrayCollector.d.ts +2 -2
- package/dist/FactorValue/Array/components/ArrayCollector.js +70 -94
- package/dist/FactorValue/Array/components/ArrayCreator.d.ts +2 -2
- package/dist/FactorValue/Array/components/ArrayCreator.js +43 -75
- package/dist/FactorValue/Array/components/ArrayLimit.d.ts +2 -2
- package/dist/FactorValue/Array/components/ArrayLimit.js +16 -14
- package/dist/FactorValue/Array/components/ArrayModal.d.ts +2 -2
- package/dist/FactorValue/Array/components/ArrayModal.js +78 -143
- package/dist/FactorValue/Array/components/ArrayRaw.d.ts +2 -2
- package/dist/FactorValue/Array/components/ArrayRaw.js +47 -58
- package/dist/FactorValue/Array/components/CopyButton.d.ts +2 -2
- package/dist/FactorValue/Array/components/CopyButton.js +20 -30
- package/dist/FactorValue/Array/hooks/useCollector.d.ts +3 -3
- package/dist/FactorValue/Array/hooks/useCollector.js +21 -22
- package/dist/FactorValue/Date/Date.d.ts +2 -2
- package/dist/FactorValue/Date/Date.js +38 -53
- package/dist/FactorValue/DateRange/DateRange.d.ts +2 -2
- package/dist/FactorValue/DateRange/DateRange.js +26 -41
- package/dist/FactorValue/DynamicKey/DynamicKey.d.ts +2 -2
- package/dist/FactorValue/DynamicKey/DynamicKey.js +37 -66
- package/dist/FactorValue/DynamicKey/DynamicKey.style.d.ts +2 -2
- package/dist/FactorValue/DynamicKey/DynamicKey.style.js +10 -8
- package/dist/FactorValue/FactorValue.d.ts +2 -2
- package/dist/FactorValue/FactorValue.js +68 -70
- package/dist/FactorValue/FactorValue.style.d.ts +1 -1
- package/dist/FactorValue/FactorValue.style.js +20 -20
- package/dist/FactorValue/Formula/Formula.d.ts +2 -2
- package/dist/FactorValue/Formula/Formula.js +36 -54
- package/dist/FactorValue/Formula/Formula.styles.d.ts +1 -1
- package/dist/FactorValue/Formula/Formula.styles.js +6 -5
- package/dist/FactorValue/Formula/FormulaModal.d.ts +2 -2
- package/dist/FactorValue/Formula/FormulaModal.js +27 -42
- package/dist/FactorValue/Number/NumberInput.d.ts +2 -2
- package/dist/FactorValue/Number/NumberInput.js +21 -31
- package/dist/FactorValue/Parameter/Parameter.constants.d.ts +1 -1
- package/dist/FactorValue/Parameter/Parameter.constants.js +27 -13
- package/dist/FactorValue/Parameter/Parameter.d.ts +2 -2
- package/dist/FactorValue/Parameter/Parameter.js +82 -127
- package/dist/FactorValue/Parameter/Parameter.style.d.ts +28 -28
- package/dist/FactorValue/Parameter/Parameter.style.js +34 -31
- package/dist/FactorValue/Parameter/Parameter.types.d.ts +2 -2
- package/dist/FactorValue/Parameter/Parameter.types.js +1 -1
- package/dist/FactorValue/Parameter/ParameterDropdown.d.ts +2 -2
- package/dist/FactorValue/Parameter/ParameterDropdown.js +155 -226
- package/dist/FactorValue/Parameter/ParameterDropdownItem.d.ts +3 -3
- package/dist/FactorValue/Parameter/ParameterDropdownItem.js +27 -33
- package/dist/FactorValue/Parameter/useGroups.d.ts +2 -2
- package/dist/FactorValue/Parameter/useGroups.js +30 -42
- package/dist/FactorValue/Parameter/utils.d.ts +2 -2
- package/dist/FactorValue/Parameter/utils.js +22 -17
- package/dist/FactorValue/RelativeDate/RelativeDate.const.d.ts +1 -1
- package/dist/FactorValue/RelativeDate/RelativeDate.const.js +12 -5
- package/dist/FactorValue/RelativeDate/RelativeDate.d.ts +2 -2
- package/dist/FactorValue/RelativeDate/RelativeDate.js +57 -88
- package/dist/FactorValue/RelativeDate/RelativeDate.utils.d.ts +1 -1
- package/dist/FactorValue/RelativeDate/RelativeDate.utils.js +14 -10
- package/dist/FactorValue/RelativeDate/RelativeDateDropdown.d.ts +2 -2
- package/dist/FactorValue/RelativeDate/RelativeDateDropdown.js +56 -87
- package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.d.ts +7 -7
- package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.js +23 -20
- package/dist/FactorValue/Text/Text.d.ts +2 -2
- package/dist/FactorValue/Text/Text.js +56 -121
- package/dist/FactorValue/Text/Text.styles.d.ts +3 -3
- package/dist/FactorValue/Text/Text.styles.js +11 -10
- package/dist/FactorValue/Text/TextModal.d.ts +2 -2
- package/dist/FactorValue/Text/TextModal.js +19 -33
- package/dist/Factors.d.ts +2 -2
- package/dist/Factors.js +95 -132
- package/dist/Factors.types.d.ts +9 -9
- package/dist/Factors.types.js +8 -3
- package/dist/hooks/useTexts.d.ts +2 -2
- package/dist/hooks/useTexts.js +287 -291
- package/dist/index.js +7 -6
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/style/Factors.style.d.ts +1 -1
- package/dist/style/Factors.style.js +10 -11
- package/package.json +32 -32
|
@@ -1,47 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import InlineEdit from "@synerise/ds-inline-edit";
|
|
4
|
+
import ModalProxy from "@synerise/ds-modal";
|
|
5
|
+
const FormulaModal = ({
|
|
6
|
+
value,
|
|
7
|
+
onApply,
|
|
8
|
+
onCancel,
|
|
9
|
+
visible,
|
|
10
|
+
texts,
|
|
11
|
+
formulaEditor
|
|
12
|
+
}) => {
|
|
13
|
+
const [formulaName, setFormulaName] = React.useState(value?.name || texts.formula.defaultName);
|
|
14
|
+
const handleOk = React.useCallback(() => {
|
|
15
15
|
onApply({
|
|
16
16
|
name: formulaName,
|
|
17
|
-
value:
|
|
17
|
+
value: "FORMULA VALUE"
|
|
18
18
|
});
|
|
19
19
|
}, [onApply, formulaName]);
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
onBlur: function onBlur(e) {
|
|
34
|
-
return setFormulaName(e.target.value || texts.formula.defaultName);
|
|
35
|
-
},
|
|
36
|
-
value: formulaName
|
|
37
|
-
}
|
|
38
|
-
}),
|
|
39
|
-
closable: true,
|
|
40
|
-
onOk: handleOk,
|
|
41
|
-
onCancel: onCancel,
|
|
42
|
-
visible: visible,
|
|
43
|
-
okText: texts.modalApply,
|
|
44
|
-
cancelText: texts.modalCancel
|
|
45
|
-
}, formulaEditor);
|
|
20
|
+
return /* @__PURE__ */ jsx(ModalProxy, { size: "medium", title: /* @__PURE__ */ jsx(InlineEdit, { input: {
|
|
21
|
+
maxLength: 120,
|
|
22
|
+
name: "name-of-input",
|
|
23
|
+
placeholder: texts.formula.buttonPlaceholder,
|
|
24
|
+
onChange: (e) => setFormulaName(e.target.value),
|
|
25
|
+
onEnterPress: (e) => setFormulaName(e.target.value),
|
|
26
|
+
onBlur: (e) => setFormulaName(e.target.value || texts.formula.defaultName),
|
|
27
|
+
value: formulaName
|
|
28
|
+
} }), closable: true, onOk: handleOk, onCancel, visible, okText: texts.modalApply, cancelText: texts.modalCancel, children: formulaEditor });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
FormulaModal as default
|
|
46
32
|
};
|
|
47
|
-
export default FormulaModal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
3
|
declare const NumberInput: ({ error, value, onChange, texts, opened, onDeactivate, readOnly, uncontrolledComponent, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default NumberInput;
|
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
localValue = _useState[0],
|
|
17
|
-
setLocalValue = _useState[1];
|
|
18
|
-
useEffect(function () {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import InputNumber from "@synerise/ds-input-number";
|
|
4
|
+
const NumberInput = ({
|
|
5
|
+
error,
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
texts,
|
|
9
|
+
opened,
|
|
10
|
+
onDeactivate,
|
|
11
|
+
readOnly = false,
|
|
12
|
+
uncontrolledComponent
|
|
13
|
+
}) => {
|
|
14
|
+
const [localValue, setLocalValue] = useState(() => value);
|
|
15
|
+
useEffect(() => {
|
|
19
16
|
if (!uncontrolledComponent) {
|
|
20
17
|
setLocalValue(value);
|
|
21
18
|
}
|
|
22
19
|
}, [value, uncontrolledComponent]);
|
|
23
|
-
useEffect(
|
|
20
|
+
useEffect(() => {
|
|
24
21
|
if (uncontrolledComponent && !value && localValue !== value) {
|
|
25
22
|
setLocalValue(value);
|
|
26
23
|
}
|
|
27
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
24
|
}, [value, uncontrolledComponent]);
|
|
29
|
-
|
|
25
|
+
const handleChange = (val) => {
|
|
30
26
|
setLocalValue(val);
|
|
31
27
|
onChange(val);
|
|
32
28
|
};
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
value: localValue,
|
|
38
|
-
onChange: handleChange,
|
|
39
|
-
onBlur: onDeactivate,
|
|
40
|
-
readOnly: readOnly
|
|
41
|
-
});
|
|
29
|
+
return /* @__PURE__ */ jsx(InputNumber, { error, autoFocus: opened, placeholder: texts.valuePlaceholder, value: localValue, onChange: handleChange, onBlur: onDeactivate, readOnly });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
NumberInput as default
|
|
42
33
|
};
|
|
43
|
-
export default NumberInput;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { itemSizes } from "@synerise/ds-list-item";
|
|
2
|
+
const LIST_STYLE = {
|
|
3
|
+
overflowX: "unset",
|
|
4
|
+
overflowY: "unset"
|
|
5
|
+
};
|
|
6
|
+
const NO_GROUP_NAME = "NO_GROUP_NAME";
|
|
7
|
+
const ITEM_SIZE = {
|
|
8
|
+
[itemSizes.LARGE]: 50,
|
|
9
|
+
[itemSizes.DEFAULT]: 32,
|
|
10
|
+
title: 32
|
|
11
|
+
};
|
|
12
|
+
const DROPDOWN_HEIGHT = 420;
|
|
13
|
+
const DROPDOWN_HEIGHT_BELOW_THRESHOLD = 350;
|
|
14
|
+
const DROPDOWN_HEIGHT_THRESHOLD = 800;
|
|
15
|
+
const SEARCH_HEGIHT = 53;
|
|
16
|
+
const TABS_HEIGHT = 50;
|
|
17
|
+
const SUBGROUP_HEADER_HEIGHT = 53;
|
|
18
|
+
export {
|
|
19
|
+
DROPDOWN_HEIGHT,
|
|
20
|
+
DROPDOWN_HEIGHT_BELOW_THRESHOLD,
|
|
21
|
+
DROPDOWN_HEIGHT_THRESHOLD,
|
|
22
|
+
ITEM_SIZE,
|
|
23
|
+
LIST_STYLE,
|
|
24
|
+
NO_GROUP_NAME,
|
|
25
|
+
SEARCH_HEGIHT,
|
|
26
|
+
SUBGROUP_HEADER_HEIGHT,
|
|
27
|
+
TABS_HEIGHT
|
|
6
28
|
};
|
|
7
|
-
export var NO_GROUP_NAME = 'NO_GROUP_NAME';
|
|
8
|
-
export var ITEM_SIZE = (_ITEM_SIZE = {}, _ITEM_SIZE[itemSizes.LARGE] = 50, _ITEM_SIZE[itemSizes.DEFAULT] = 32, _ITEM_SIZE.title = 32, _ITEM_SIZE);
|
|
9
|
-
export var DROPDOWN_HEIGHT = 420;
|
|
10
|
-
export var DROPDOWN_HEIGHT_BELOW_THRESHOLD = 350;
|
|
11
|
-
export var DROPDOWN_HEIGHT_THRESHOLD = 800;
|
|
12
|
-
export var SEARCH_HEGIHT = 53;
|
|
13
|
-
export var TABS_HEIGHT = 50;
|
|
14
|
-
export var SUBGROUP_HEADER_HEIGHT = 53;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FactorValueComponentProps } from '../../Factors.types';
|
|
3
3
|
declare const ParameterInput: ({ value, onChange, onParamsClick, parameters, texts, opened, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, readOnly, error, loading, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default ParameterInput;
|
|
@@ -1,154 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var dimensionsConfig = _extends({
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useCallback, useEffect } from "react";
|
|
3
|
+
import Dropdown from "@synerise/ds-dropdown";
|
|
4
|
+
import Icon, { AngleDownS } from "@synerise/ds-icon";
|
|
5
|
+
import InformationCard, { InformationCardTooltip } from "@synerise/ds-information-card";
|
|
6
|
+
import { getPopupContainer } from "@synerise/ds-utils";
|
|
7
|
+
import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from "./Parameter.constants.js";
|
|
8
|
+
import { ParameterButton, Value } from "./Parameter.style.js";
|
|
9
|
+
import ParameterDropdown from "./ParameterDropdown.js";
|
|
10
|
+
const ParameterInput = ({
|
|
11
|
+
value,
|
|
12
|
+
onChange,
|
|
13
|
+
onParamsClick,
|
|
14
|
+
parameters,
|
|
15
|
+
texts,
|
|
16
|
+
opened,
|
|
17
|
+
preventAutoloadData,
|
|
18
|
+
getPopupContainerOverride,
|
|
19
|
+
onActivate,
|
|
20
|
+
onDeactivate,
|
|
21
|
+
readOnly = false,
|
|
22
|
+
error,
|
|
23
|
+
loading
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
buttonIcon,
|
|
27
|
+
buttonLabel,
|
|
28
|
+
selectedButtonColored,
|
|
29
|
+
dropdownDimensionsConfig,
|
|
30
|
+
...restParameters
|
|
31
|
+
} = parameters || {};
|
|
32
|
+
const dimensionsConfig = {
|
|
34
33
|
defaultHeight: DROPDOWN_HEIGHT,
|
|
35
34
|
lowerHeight: DROPDOWN_HEIGHT_BELOW_THRESHOLD,
|
|
36
|
-
threshold: DROPDOWN_HEIGHT_THRESHOLD
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
}, [parameter, buttonIcon, buttonLabel]),
|
|
54
|
-
parameterIcon = _useMemo.parameterIcon,
|
|
55
|
-
parameterName = _useMemo.parameterName,
|
|
56
|
-
isSelected = _useMemo.isSelected;
|
|
57
|
-
var handleChange = useCallback(function (val) {
|
|
35
|
+
threshold: DROPDOWN_HEIGHT_THRESHOLD,
|
|
36
|
+
...dropdownDimensionsConfig
|
|
37
|
+
};
|
|
38
|
+
const [dropdownVisible, setDropdownVisible] = useState(false);
|
|
39
|
+
const [outerHeight, setOuterHeight] = useState(dimensionsConfig.defaultHeight);
|
|
40
|
+
const parameter = useMemo(() => value, [value]);
|
|
41
|
+
const {
|
|
42
|
+
parameterIcon,
|
|
43
|
+
parameterName,
|
|
44
|
+
isSelected
|
|
45
|
+
} = useMemo(() => ({
|
|
46
|
+
isSelected: Boolean(parameter?.icon || parameter?.name),
|
|
47
|
+
parameterIcon: parameter?.icon || buttonIcon,
|
|
48
|
+
parameterName: parameter?.name || buttonLabel
|
|
49
|
+
}), [parameter, buttonIcon, buttonLabel]);
|
|
50
|
+
const handleChange = useCallback((val) => {
|
|
58
51
|
onChange(val);
|
|
59
52
|
}, [onChange]);
|
|
60
|
-
|
|
53
|
+
const handleOnClick = useCallback(() => {
|
|
61
54
|
onParamsClick && onParamsClick();
|
|
62
55
|
setDropdownVisible(true);
|
|
63
56
|
onActivate && onActivate();
|
|
64
57
|
}, [onParamsClick, onActivate]);
|
|
65
|
-
useEffect(
|
|
58
|
+
useEffect(() => {
|
|
66
59
|
setDropdownVisible(Boolean(opened));
|
|
67
60
|
if (opened) {
|
|
68
61
|
onParamsClick && onParamsClick();
|
|
69
62
|
onActivate && onActivate();
|
|
70
63
|
}
|
|
71
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
64
|
}, [opened]);
|
|
73
|
-
useEffect(
|
|
65
|
+
useEffect(() => {
|
|
74
66
|
!preventAutoloadData && onParamsClick && onParamsClick();
|
|
75
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
67
|
}, []);
|
|
77
|
-
|
|
68
|
+
const onDropdownVisibilityChange = useCallback((newValue) => {
|
|
78
69
|
newValue && onActivate && onActivate();
|
|
79
70
|
setDropdownVisible(newValue);
|
|
80
71
|
}, [onActivate]);
|
|
81
|
-
|
|
72
|
+
const triggerMode = useMemo(() => {
|
|
82
73
|
if (parameterIcon) {
|
|
83
|
-
return readOnly ?
|
|
74
|
+
return readOnly ? "icon-label" : "two-icons";
|
|
84
75
|
}
|
|
85
|
-
return readOnly ?
|
|
76
|
+
return readOnly ? "simple" : "label-icon";
|
|
86
77
|
}, [parameterIcon, readOnly]);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}));
|
|
99
|
-
var selectedItemInfoCard = useMemo(function () {
|
|
100
|
-
var _parameter$id;
|
|
101
|
-
return isSelected && parameter && ((parameter.renderHoverTooltip == null ? void 0 : parameter.renderHoverTooltip()) || /*#__PURE__*/React.createElement(InformationCard, _extends({
|
|
102
|
-
icon: parameterIcon,
|
|
103
|
-
subtitle: (_parameter$id = parameter.id) == null ? void 0 : _parameter$id.toString(),
|
|
104
|
-
title: parameterName,
|
|
105
|
-
descriptionConfig: parameter.description ? {
|
|
106
|
-
value: parameter.description,
|
|
107
|
-
disabled: true,
|
|
108
|
-
label: undefined
|
|
109
|
-
} : undefined
|
|
110
|
-
}, parameter.informationCardProps)));
|
|
78
|
+
const triggerButton = /* @__PURE__ */ jsxs(ParameterButton, { error, type: isSelected && selectedButtonColored ? "custom-color" : "secondary", color: isSelected && selectedButtonColored ? "green" : void 0, mode: triggerMode, onClick: !readOnly ? handleOnClick : void 0, readOnly, children: [
|
|
79
|
+
parameterIcon && /* @__PURE__ */ jsx(Icon, { component: parameterIcon }),
|
|
80
|
+
/* @__PURE__ */ jsx(Value, { children: parameterName }),
|
|
81
|
+
!readOnly && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}) })
|
|
82
|
+
] });
|
|
83
|
+
const selectedItemInfoCard = useMemo(() => {
|
|
84
|
+
return isSelected && parameter && (parameter.renderHoverTooltip?.() || /* @__PURE__ */ jsx(InformationCard, { icon: parameterIcon, subtitle: parameter.id?.toString(), title: parameterName, descriptionConfig: parameter.description ? {
|
|
85
|
+
value: parameter.description,
|
|
86
|
+
disabled: true,
|
|
87
|
+
label: void 0
|
|
88
|
+
} : void 0, ...parameter.informationCardProps }));
|
|
111
89
|
}, [parameter, isSelected, parameterIcon, parameterName]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, triggerButton) : triggerButton;
|
|
119
|
-
useEffect(function () {
|
|
120
|
-
var checkViewportHeight = function checkViewportHeight() {
|
|
121
|
-
return setOuterHeight(window.innerHeight < dimensionsConfig.threshold ? dimensionsConfig.lowerHeight : dimensionsConfig.defaultHeight);
|
|
122
|
-
};
|
|
90
|
+
const trigger = selectedItemInfoCard ? /* @__PURE__ */ jsx(InformationCardTooltip, { content: selectedItemInfoCard, popoverProps: {
|
|
91
|
+
placement: "top",
|
|
92
|
+
getPopupContainer: getPopupContainerOverride || getPopupContainer
|
|
93
|
+
}, children: triggerButton }) : triggerButton;
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const checkViewportHeight = () => setOuterHeight(window.innerHeight < dimensionsConfig.threshold ? dimensionsConfig.lowerHeight : dimensionsConfig.defaultHeight);
|
|
123
96
|
checkViewportHeight();
|
|
124
|
-
window.addEventListener(
|
|
125
|
-
return
|
|
126
|
-
window.removeEventListener(
|
|
97
|
+
window.addEventListener("resize", checkViewportHeight);
|
|
98
|
+
return () => {
|
|
99
|
+
window.removeEventListener("resize", checkViewportHeight);
|
|
127
100
|
};
|
|
128
101
|
}, [dimensionsConfig.defaultHeight, dimensionsConfig.lowerHeight, dimensionsConfig.threshold]);
|
|
129
|
-
return readOnly ? trigger :
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
asChild: false,
|
|
137
|
-
size: 300,
|
|
138
|
-
onDismiss: onDeactivate,
|
|
139
|
-
overlay: /*#__PURE__*/React.createElement(ParameterDropdown, _extends({
|
|
140
|
-
setDropdownVisible: setDropdownVisible,
|
|
141
|
-
setSelected: handleChange
|
|
142
|
-
}, restParameters, {
|
|
143
|
-
texts: texts,
|
|
144
|
-
loading: loading,
|
|
145
|
-
outerHeight: outerHeight,
|
|
146
|
-
value: isSelected ? parameter : undefined
|
|
147
|
-
})),
|
|
148
|
-
popoverProps: {
|
|
149
|
-
testId: 'factors-parameters',
|
|
150
|
-
returnFocus: false
|
|
151
|
-
}
|
|
152
|
-
}, trigger));
|
|
102
|
+
return readOnly ? trigger : /* @__PURE__ */ jsx("div", { "data-popup-container": true, "data-testid": "ds-factors-parameter", children: /* @__PURE__ */ jsx(Dropdown, { open: dropdownVisible, getPopupContainer: getPopupContainerOverride || getPopupContainer, onOpenChange: onDropdownVisibilityChange, asChild: false, size: 300, onDismiss: onDeactivate, overlay: /* @__PURE__ */ jsx(ParameterDropdown, { setDropdownVisible, setSelected: handleChange, ...restParameters, texts, loading, outerHeight, value: isSelected ? parameter : void 0 }), popoverProps: {
|
|
103
|
+
testId: "factors-parameters",
|
|
104
|
+
returnFocus: false
|
|
105
|
+
}, children: trigger }) });
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
ParameterInput as default
|
|
153
109
|
};
|
|
154
|
-
export default ParameterInput;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { VariableSizeList } from '
|
|
2
|
-
export declare const TabsWrapper: import(
|
|
3
|
-
export declare const ContentPlaceholder: import(
|
|
4
|
-
export declare const ItemsList: import(
|
|
1
|
+
import { VariableSizeList } from '../../../../../../config/vitest/__mocks__/reactWindowMock.js';
|
|
2
|
+
export declare const TabsWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const ContentPlaceholder: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const ItemsList: import('styled-components').StyledComponent<"div", any, {
|
|
5
5
|
contentHeight?: number;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const SearchResult: import(
|
|
8
|
-
export declare const SearchResultHighlight: import(
|
|
9
|
-
export declare const Value: import(
|
|
10
|
-
export declare const ParameterButton: import(
|
|
7
|
+
export declare const SearchResult: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
8
|
+
export declare const SearchResultHighlight: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
9
|
+
export declare const Value: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
10
|
+
export declare const ParameterButton: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<Omit<Partial<{
|
|
11
11
|
href: string;
|
|
12
12
|
target?: string;
|
|
13
13
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
14
|
-
} & import(
|
|
15
|
-
htmlType?: import(
|
|
14
|
+
} & import('antd/lib/button/button').BaseButtonProps & Omit<import('react').AnchorHTMLAttributes<any>, "onClick" | "type"> & {
|
|
15
|
+
htmlType?: import('antd/lib/button/button').ButtonHTMLType;
|
|
16
16
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
17
|
-
} & Omit<import(
|
|
18
|
-
type?: import(
|
|
19
|
-
mode?: import(
|
|
20
|
-
color?: import(
|
|
21
|
-
groupVariant?: import(
|
|
17
|
+
} & Omit<import('react').ButtonHTMLAttributes<any>, "onClick" | "type">>, "type" | "ghost"> & {
|
|
18
|
+
type?: import('@synerise/ds-utils').LiteralStringUnion<import('@synerise/ds-button/dist/Button.types').ButtonType>;
|
|
19
|
+
mode?: import('@synerise/ds-utils').LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
20
|
+
color?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
21
|
+
groupVariant?: import('@synerise/ds-utils').LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
22
22
|
justifyContent?: string;
|
|
23
23
|
loading?: boolean | {
|
|
24
24
|
delay?: number;
|
|
25
25
|
};
|
|
26
|
-
onClick?: (event: import(
|
|
27
|
-
iconColor?: import(
|
|
26
|
+
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
27
|
+
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
28
28
|
error?: boolean;
|
|
29
29
|
readOnly?: boolean;
|
|
30
|
-
tagProps?: import(
|
|
31
|
-
tooltipProps?: import(
|
|
32
|
-
} & import(
|
|
33
|
-
Creator: import(
|
|
34
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import(
|
|
35
|
-
Star: (props: import(
|
|
36
|
-
Checkbox: (props: import(
|
|
30
|
+
tagProps?: import('@synerise/ds-tag').TagProps;
|
|
31
|
+
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
32
|
+
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
33
|
+
Creator: import('react').ForwardRefExoticComponent<Omit<import('@synerise/ds-button').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import('@synerise/ds-button').ExpanderProps) => import("react").JSX.Element;
|
|
35
|
+
Star: (props: import('@synerise/ds-button').StarButtonProps) => React.ReactElement;
|
|
36
|
+
Checkbox: (props: import('@synerise/ds-button').CheckboxButtonProps) => React.ReactElement;
|
|
37
37
|
}, any, {}, never>;
|
|
38
|
-
export declare const StyledList: import(
|
|
39
|
-
export declare const Skeleton: import(
|
|
38
|
+
export declare const StyledList: import('styled-components').StyledComponent<typeof VariableSizeList, any, {}, never>;
|
|
39
|
+
export declare const Skeleton: import('styled-components').StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import('@synerise/ds-skeleton').SkeletonProps) => React.JSX.Element, any, {
|
|
40
40
|
contentHeight?: number;
|
|
41
41
|
}, never>;
|
|
42
|
-
export declare const Title: import(
|
|
43
|
-
export declare const ShowMoreItem: import(
|
|
42
|
+
export declare const Title: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
43
|
+
export declare const ShowMoreItem: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import { VariableSizeList } from
|
|
2
|
-
import styled from
|
|
3
|
-
import Button from
|
|
4
|
-
import DropdownSkeleton from
|
|
5
|
-
|
|
1
|
+
import { VariableSizeList } from "react-window";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Button from "@synerise/ds-button";
|
|
4
|
+
import DropdownSkeleton from "@synerise/ds-skeleton";
|
|
5
|
+
const TabsWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
6
6
|
displayName: "Parameterstyle__TabsWrapper",
|
|
7
7
|
componentId: "sc-u2uvgh-0"
|
|
8
8
|
})(["width:100%;padding:0 0 8px 0;"]);
|
|
9
|
-
|
|
9
|
+
const ContentPlaceholder = /* @__PURE__ */ styled.div.withConfig({
|
|
10
10
|
displayName: "Parameterstyle__ContentPlaceholder",
|
|
11
11
|
componentId: "sc-u2uvgh-1"
|
|
12
12
|
})(["height:100px;"]);
|
|
13
|
-
|
|
13
|
+
const ItemsList = /* @__PURE__ */ styled.div.withConfig({
|
|
14
14
|
displayName: "Parameterstyle__ItemsList",
|
|
15
15
|
componentId: "sc-u2uvgh-2"
|
|
16
|
-
})(["width:100%;", ""],
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
export var SearchResult = styled.span.withConfig({
|
|
16
|
+
})(["width:100%;", ""], (props) => props.contentHeight !== void 0 && `height: ${props.contentHeight}px;`);
|
|
17
|
+
const SearchResult = /* @__PURE__ */ styled.span.withConfig({
|
|
20
18
|
displayName: "Parameterstyle__SearchResult",
|
|
21
19
|
componentId: "sc-u2uvgh-3"
|
|
22
|
-
})(["font-weight:400;color:", ";"],
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
export var SearchResultHighlight = styled.span.withConfig({
|
|
20
|
+
})(["font-weight:400;color:", ";"], (props) => props.theme.palette["grey-500"]);
|
|
21
|
+
const SearchResultHighlight = /* @__PURE__ */ styled.span.withConfig({
|
|
26
22
|
displayName: "Parameterstyle__SearchResultHighlight",
|
|
27
23
|
componentId: "sc-u2uvgh-4"
|
|
28
|
-
})(["font-weight:500;color:", ";"],
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
export var Value = styled.span.withConfig({
|
|
24
|
+
})(["font-weight:500;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
25
|
+
const Value = /* @__PURE__ */ styled.span.withConfig({
|
|
32
26
|
displayName: "Parameterstyle__Value",
|
|
33
27
|
componentId: "sc-u2uvgh-5"
|
|
34
28
|
})(["max-width:110px;text-overflow:ellipsis;overflow:hidden;text-align:left;"]);
|
|
35
|
-
|
|
29
|
+
const ParameterButton = /* @__PURE__ */ styled(Button).withConfig({
|
|
36
30
|
displayName: "Parameterstyle__ParameterButton",
|
|
37
31
|
componentId: "sc-u2uvgh-6"
|
|
38
32
|
})(["max-width:100%;"]);
|
|
39
|
-
|
|
33
|
+
const StyledList = /* @__PURE__ */ styled(VariableSizeList).withConfig({
|
|
40
34
|
displayName: "Parameterstyle__StyledList",
|
|
41
35
|
componentId: "sc-u2uvgh-7"
|
|
42
36
|
})(["overflow-x:unset;overflow-y:unset;height:auto !important;max-height:300px;"]);
|
|
43
|
-
|
|
37
|
+
const Skeleton = /* @__PURE__ */ styled(DropdownSkeleton).withConfig({
|
|
44
38
|
displayName: "Parameterstyle__Skeleton",
|
|
45
39
|
componentId: "sc-u2uvgh-8"
|
|
46
|
-
})(["", ""],
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
export var Title = styled.div.withConfig({
|
|
40
|
+
})(["", ""], (props) => props.contentHeight !== void 0 && `height: ${props.contentHeight}px;`);
|
|
41
|
+
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
50
42
|
displayName: "Parameterstyle__Title",
|
|
51
43
|
componentId: "sc-u2uvgh-9"
|
|
52
|
-
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"],
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
export var ShowMoreItem = styled.div.withConfig({
|
|
44
|
+
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"], (props) => props.theme.palette["grey-500"]);
|
|
45
|
+
const ShowMoreItem = /* @__PURE__ */ styled.div.withConfig({
|
|
56
46
|
displayName: "Parameterstyle__ShowMoreItem",
|
|
57
47
|
componentId: "sc-u2uvgh-10"
|
|
58
|
-
})(["font-weight:500;"]);
|
|
48
|
+
})(["font-weight:500;"]);
|
|
49
|
+
export {
|
|
50
|
+
ContentPlaceholder,
|
|
51
|
+
ItemsList,
|
|
52
|
+
ParameterButton,
|
|
53
|
+
SearchResult,
|
|
54
|
+
SearchResultHighlight,
|
|
55
|
+
ShowMoreItem,
|
|
56
|
+
Skeleton,
|
|
57
|
+
StyledList,
|
|
58
|
+
TabsWrapper,
|
|
59
|
+
Title,
|
|
60
|
+
Value
|
|
61
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ParameterGroup, ParameterItem } from '../../Factors.types';
|
|
3
3
|
export type DropdownItem<ItemType extends ParameterItem | ParameterGroup> = {
|
|
4
4
|
item: ItemType;
|
|
5
5
|
searchQuery: string;
|