@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,39 +1,42 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import Dropdown from
|
|
3
|
-
import Icon from
|
|
4
|
-
import { Input } from
|
|
5
|
-
import { InputNumberContainer } from
|
|
6
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Dropdown from "@synerise/ds-dropdown";
|
|
3
|
+
import Icon from "@synerise/ds-icon";
|
|
4
|
+
import { Input } from "@synerise/ds-input";
|
|
5
|
+
import { InputNumberContainer } from "@synerise/ds-input-number/dist/InputNumber.styles";
|
|
6
|
+
const RelativeDateDropdownWrapper = /* @__PURE__ */ styled(Dropdown.Wrapper).withConfig({
|
|
7
7
|
displayName: "RelativeDateDropdownstyles__RelativeDateDropdownWrapper",
|
|
8
8
|
componentId: "sc-1xn8l81-0"
|
|
9
9
|
})(["padding:24px;display:flex;align-items:center;width:100%;gap:8px;min-width:420px;", "{width:70px;}& > *{flex:1 1 auto;}"], InputNumberContainer);
|
|
10
|
-
|
|
10
|
+
const RelativeDateDropdownFooter = /* @__PURE__ */ styled.div.withConfig({
|
|
11
11
|
displayName: "RelativeDateDropdownstyles__RelativeDateDropdownFooter",
|
|
12
12
|
componentId: "sc-1xn8l81-1"
|
|
13
|
-
})(["background:", ";display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px;"],
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
export var RelativeDateCurrentLabel = styled.div.withConfig({
|
|
13
|
+
})(["background:", ";display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px;"], (props) => props.theme.palette["grey-100"]);
|
|
14
|
+
const RelativeDateCurrentLabel = /* @__PURE__ */ styled.div.withConfig({
|
|
17
15
|
displayName: "RelativeDateDropdownstyles__RelativeDateCurrentLabel",
|
|
18
16
|
componentId: "sc-1xn8l81-2"
|
|
19
17
|
})(["font-weight:500;"]);
|
|
20
|
-
|
|
18
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
21
19
|
displayName: "RelativeDateDropdownstyles__IconWrapper",
|
|
22
20
|
componentId: "sc-1xn8l81-3"
|
|
23
21
|
})([""]);
|
|
24
|
-
|
|
22
|
+
const ClearIcon = /* @__PURE__ */ styled(Icon).withConfig({
|
|
25
23
|
displayName: "RelativeDateDropdownstyles__ClearIcon",
|
|
26
24
|
componentId: "sc-1xn8l81-4"
|
|
27
25
|
})([""]);
|
|
28
|
-
|
|
26
|
+
const ChevronIcon = /* @__PURE__ */ styled(Icon).withConfig({
|
|
29
27
|
displayName: "RelativeDateDropdownstyles__ChevronIcon",
|
|
30
28
|
componentId: "sc-1xn8l81-5"
|
|
31
29
|
})([""]);
|
|
32
|
-
|
|
30
|
+
const Trigger = /* @__PURE__ */ styled(Input).withConfig({
|
|
33
31
|
displayName: "RelativeDateDropdownstyles__Trigger",
|
|
34
32
|
componentId: "sc-1xn8l81-6"
|
|
35
|
-
})(["", "{display:none;}&:hover{", "{display:block;svg{fill:", ";}&:hover svg{fill:", ";}}", "{display:none;}}"], ClearIcon, ClearIcon,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
})(["", "{display:none;}&:hover{", "{display:block;svg{fill:", ";}&:hover svg{fill:", ";}}", "{display:none;}}"], ClearIcon, ClearIcon, (props) => props.theme.palette["red-600"], (props) => props.theme.palette["red-500"], ChevronIcon);
|
|
34
|
+
export {
|
|
35
|
+
ChevronIcon,
|
|
36
|
+
ClearIcon,
|
|
37
|
+
IconWrapper,
|
|
38
|
+
RelativeDateCurrentLabel,
|
|
39
|
+
RelativeDateDropdownFooter,
|
|
40
|
+
RelativeDateDropdownWrapper,
|
|
41
|
+
Trigger
|
|
42
|
+
};
|
|
@@ -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 TextInput: ({ value, onChange, texts, textType, autocompleteText, factorType, opened, onDeactivate, onActivate, error, inputProps, getPopupContainerOverride, readOnly, factorValueExtraProps, uncontrolledComponent, }: FactorValueComponentProps) => React.JSX.Element;
|
|
4
4
|
export default TextInput;
|
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import Autocomplete from
|
|
4
|
-
import { useTheme } from
|
|
5
|
-
import Icon, { FullScreenM } from
|
|
6
|
-
import { Input } from
|
|
7
|
-
import
|
|
8
|
-
import TextModal from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return value;
|
|
34
|
-
}),
|
|
35
|
-
localValue = _useState3[0],
|
|
36
|
-
setLocalValue = _useState3[1];
|
|
37
|
-
var _useState4 = useState(false),
|
|
38
|
-
localError = _useState4[0],
|
|
39
|
-
setLocalError = _useState4[1];
|
|
40
|
-
var theme = useTheme();
|
|
41
|
-
useEffect(function () {
|
|
42
|
-
if (inputRef != null && inputRef.current && opened) {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import Autocomplete from "@synerise/ds-autocomplete";
|
|
4
|
+
import { useTheme } from "@synerise/ds-core";
|
|
5
|
+
import Icon, { FullScreenM } from "@synerise/ds-icon";
|
|
6
|
+
import { Input } from "@synerise/ds-input";
|
|
7
|
+
import { TextWrapper, InputWrapper, IconWrapper } from "./Text.styles.js";
|
|
8
|
+
import TextModal from "./TextModal.js";
|
|
9
|
+
const TextInput = ({
|
|
10
|
+
value,
|
|
11
|
+
onChange,
|
|
12
|
+
texts,
|
|
13
|
+
textType,
|
|
14
|
+
autocompleteText,
|
|
15
|
+
factorType,
|
|
16
|
+
opened,
|
|
17
|
+
onDeactivate,
|
|
18
|
+
onActivate,
|
|
19
|
+
error,
|
|
20
|
+
inputProps,
|
|
21
|
+
getPopupContainerOverride,
|
|
22
|
+
readOnly = false,
|
|
23
|
+
factorValueExtraProps,
|
|
24
|
+
uncontrolledComponent
|
|
25
|
+
}) => {
|
|
26
|
+
const [openExpanseEditor, setOpenExpanseEditor] = useState(false);
|
|
27
|
+
const [inputRef, setInputRef] = useState();
|
|
28
|
+
const [localValue, setLocalValue] = useState(() => value);
|
|
29
|
+
const [localError, setLocalError] = useState(false);
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (inputRef?.current && opened) {
|
|
43
33
|
inputRef.current.focus();
|
|
44
34
|
}
|
|
45
35
|
}, [inputRef, opened]);
|
|
46
|
-
|
|
36
|
+
const handleChange = useCallback((event) => {
|
|
47
37
|
setLocalValue(event.target.value);
|
|
48
38
|
onChange(event.target.value);
|
|
49
39
|
if (!event.target.value.length) {
|
|
@@ -52,101 +42,46 @@ var TextInput = function TextInput(_ref) {
|
|
|
52
42
|
setLocalError(false);
|
|
53
43
|
}
|
|
54
44
|
}, [setLocalValue, setLocalError, onChange]);
|
|
55
|
-
|
|
45
|
+
const handleApply = useCallback((val) => {
|
|
56
46
|
setOpenExpanseEditor(false);
|
|
57
47
|
setLocalValue(val);
|
|
58
48
|
onChange(val);
|
|
59
49
|
}, [onChange]);
|
|
60
|
-
|
|
50
|
+
const handleAutocomplete = useCallback((val) => {
|
|
61
51
|
setLocalValue(val);
|
|
62
52
|
onChange(val);
|
|
63
53
|
}, [onChange]);
|
|
64
|
-
useEffect(
|
|
54
|
+
useEffect(() => {
|
|
65
55
|
if (!uncontrolledComponent) {
|
|
66
56
|
setLocalValue(value);
|
|
67
57
|
}
|
|
68
58
|
}, [value, uncontrolledComponent]);
|
|
69
|
-
useEffect(
|
|
59
|
+
useEffect(() => {
|
|
70
60
|
if (uncontrolledComponent && !value && localValue !== value) {
|
|
71
61
|
setLocalValue(value);
|
|
72
62
|
}
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
63
|
}, [value, uncontrolledComponent]);
|
|
75
|
-
|
|
76
|
-
return autocompleteText && autocompleteText.options.filter(
|
|
77
|
-
return option.toLowerCase().includes(String(localValue).toLowerCase());
|
|
78
|
-
}) || [];
|
|
64
|
+
const autocompleteOptions = useMemo(() => {
|
|
65
|
+
return autocompleteText && autocompleteText.options.filter((option) => option.toLowerCase().includes(String(localValue).toLowerCase())) || [];
|
|
79
66
|
}, [localValue, autocompleteText]);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return /*#__PURE__*/React.createElement(Autocomplete, _extends({}, inputProps, autoCompleteProps, {
|
|
88
|
-
placeholder: texts.valuePlaceholder,
|
|
89
|
-
value: localValue,
|
|
90
|
-
onChange: handleAutocomplete,
|
|
91
|
-
onBlur: onDeactivate,
|
|
92
|
-
onFocus: onActivate,
|
|
93
|
-
error: localError || error,
|
|
94
|
-
handleInputRef: setInputRef,
|
|
95
|
-
defaultOpen: true,
|
|
96
|
-
getPopupContainer: getPopupContainerOverride,
|
|
97
|
-
readOnly: readOnly
|
|
98
|
-
}), autocompleteOptions == null ? void 0 : autocompleteOptions.map(function (option) {
|
|
99
|
-
return /*#__PURE__*/React.createElement(Autocomplete.Option, {
|
|
100
|
-
key: option,
|
|
101
|
-
value: option
|
|
102
|
-
}, option);
|
|
103
|
-
}));
|
|
67
|
+
const {
|
|
68
|
+
autoCompleteProps = {},
|
|
69
|
+
inputProps: extraInputProps = {}
|
|
70
|
+
} = factorValueExtraProps?.text || {};
|
|
71
|
+
const renderInput = (typesOfInput, factorsType) => {
|
|
72
|
+
if (typesOfInput === "autocomplete" && factorsType === "text") {
|
|
73
|
+
return /* @__PURE__ */ jsx(Autocomplete, { ...inputProps, ...autoCompleteProps, placeholder: texts.valuePlaceholder, value: localValue, onChange: handleAutocomplete, onBlur: onDeactivate, onFocus: onActivate, error: localError || error, handleInputRef: setInputRef, defaultOpen: true, getPopupContainer: getPopupContainerOverride, readOnly, children: autocompleteOptions?.map((option) => /* @__PURE__ */ jsx(Autocomplete.Option, { value: option, children: option }, option)) });
|
|
104
74
|
}
|
|
105
|
-
if (typesOfInput ===
|
|
106
|
-
return
|
|
107
|
-
handleInputRef: setInputRef,
|
|
108
|
-
placeholder: texts.valuePlaceholder,
|
|
109
|
-
value: localValue,
|
|
110
|
-
onChange: handleChange,
|
|
111
|
-
onBlur: onDeactivate,
|
|
112
|
-
onFocus: onActivate,
|
|
113
|
-
error: localError || error,
|
|
114
|
-
readOnly: readOnly,
|
|
115
|
-
resetMargin: true
|
|
116
|
-
})));
|
|
75
|
+
if (typesOfInput === "default" && factorsType === "text") {
|
|
76
|
+
return /* @__PURE__ */ jsx(InputWrapper, { children: /* @__PURE__ */ jsx(Input, { ...inputProps, ...extraInputProps, handleInputRef: setInputRef, placeholder: texts.valuePlaceholder, value: localValue, onChange: handleChange, onBlur: onDeactivate, onFocus: onActivate, error: localError || error, readOnly, resetMargin: true }) });
|
|
117
77
|
}
|
|
118
|
-
return
|
|
119
|
-
handleInputRef: setInputRef,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
onClick: function onClick() {
|
|
123
|
-
return setOpenExpanseEditor(true);
|
|
124
|
-
}
|
|
125
|
-
}, !readOnly && /*#__PURE__*/React.createElement(Icon, {
|
|
126
|
-
component: /*#__PURE__*/React.createElement(FullScreenM, {
|
|
127
|
-
"data-testid": "ds-factors-expansible-icon"
|
|
128
|
-
}),
|
|
129
|
-
color: theme.palette['grey-600']
|
|
130
|
-
})),
|
|
131
|
-
value: localValue,
|
|
132
|
-
onChange: handleChange,
|
|
133
|
-
onBlur: onDeactivate,
|
|
134
|
-
onFocus: onActivate,
|
|
135
|
-
error: localError || error,
|
|
136
|
-
readOnly: readOnly,
|
|
137
|
-
resetMargin: true
|
|
138
|
-
}))), /*#__PURE__*/React.createElement(TextModal, {
|
|
139
|
-
visible: openExpanseEditor,
|
|
140
|
-
onCancel: function onCancel() {
|
|
141
|
-
return setOpenExpanseEditor(false);
|
|
142
|
-
},
|
|
143
|
-
value: localValue,
|
|
144
|
-
onApply: handleApply,
|
|
145
|
-
texts: texts
|
|
146
|
-
}));
|
|
78
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx(InputWrapper, { children: /* @__PURE__ */ jsx(Input, { ...inputProps, ...extraInputProps, handleInputRef: setInputRef, placeholder: texts.valuePlaceholder, icon1: /* @__PURE__ */ jsx(IconWrapper, { onClick: () => setOpenExpanseEditor(true), children: !readOnly && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(FullScreenM, { "data-testid": "ds-factors-expansible-icon" }), color: theme.palette["grey-600"] }) }), value: localValue, onChange: handleChange, onBlur: onDeactivate, onFocus: onActivate, error: localError || error, readOnly, resetMargin: true }) }),
|
|
80
|
+
/* @__PURE__ */ jsx(TextModal, { visible: openExpanseEditor, onCancel: () => setOpenExpanseEditor(false), value: localValue, onApply: handleApply, texts })
|
|
81
|
+
] });
|
|
147
82
|
};
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
|
|
83
|
+
return /* @__PURE__ */ jsx(TextWrapper, { "data-testid": `ds-factors-${factorType}-${textType}`, children: renderInput(textType, factorType) });
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
TextInput as default
|
|
151
87
|
};
|
|
152
|
-
export default TextInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const IconWrapper: import(
|
|
2
|
-
export declare const InputWrapper: import(
|
|
3
|
-
export declare const TextWrapper: import(
|
|
1
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
2
|
+
export declare const InputWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const TextWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const IconWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
3
3
|
displayName: "Textstyles__IconWrapper",
|
|
4
4
|
componentId: "sc-rjr8p0-0"
|
|
5
|
-
})(["&:hover{cursor:pointer;svg{color:", ";fill:", ";}}"],
|
|
6
|
-
|
|
7
|
-
}, function (props) {
|
|
8
|
-
return props.theme.palette['blue-600'];
|
|
9
|
-
});
|
|
10
|
-
export var InputWrapper = styled.div.withConfig({
|
|
5
|
+
})(["&:hover{cursor:pointer;svg{color:", ";fill:", ";}}"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"]);
|
|
6
|
+
const InputWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
11
7
|
displayName: "Textstyles__InputWrapper",
|
|
12
8
|
componentId: "sc-rjr8p0-1"
|
|
13
9
|
})(["&{position:relative;display:flex;> *{min-width:0;}}"]);
|
|
14
|
-
|
|
10
|
+
const TextWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
15
11
|
displayName: "Textstyles__TextWrapper",
|
|
16
12
|
componentId: "sc-rjr8p0-2"
|
|
17
|
-
})([""]);
|
|
13
|
+
})([""]);
|
|
14
|
+
export {
|
|
15
|
+
IconWrapper,
|
|
16
|
+
InputWrapper,
|
|
17
|
+
TextWrapper
|
|
18
|
+
};
|
|
@@ -1,41 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
React.useEffect(function () {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Textarea from "@synerise/ds-input/dist/Textarea/Textarea";
|
|
4
|
+
import ModalProxy from "@synerise/ds-modal";
|
|
5
|
+
const TextModal = ({
|
|
6
|
+
value,
|
|
7
|
+
onApply,
|
|
8
|
+
onCancel,
|
|
9
|
+
visible,
|
|
10
|
+
texts
|
|
11
|
+
}) => {
|
|
12
|
+
const [expandValue, setExpandValue] = React.useState(value);
|
|
13
|
+
React.useEffect(() => {
|
|
15
14
|
setExpandValue(value);
|
|
16
15
|
}, [value]);
|
|
17
|
-
|
|
16
|
+
const handleCancel = React.useCallback(() => {
|
|
18
17
|
setExpandValue(value);
|
|
19
18
|
onCancel();
|
|
20
19
|
}, [onCancel, setExpandValue, value]);
|
|
21
|
-
|
|
20
|
+
const handleOk = React.useCallback(() => {
|
|
22
21
|
onApply(expandValue);
|
|
23
22
|
}, [onApply, expandValue]);
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onOk: handleOk,
|
|
29
|
-
onCancel: handleCancel,
|
|
30
|
-
visible: visible,
|
|
31
|
-
okText: texts.modalApply,
|
|
32
|
-
cancelText: texts.modalCancel
|
|
33
|
-
}, /*#__PURE__*/React.createElement(Textarea, {
|
|
34
|
-
rows: 7,
|
|
35
|
-
value: expandValue,
|
|
36
|
-
onChange: function onChange(event) {
|
|
37
|
-
return setExpandValue(event.target.value);
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
23
|
+
return /* @__PURE__ */ jsx(ModalProxy, { size: "medium", title: texts.modalTitle, closable: true, onOk: handleOk, onCancel: handleCancel, visible, okText: texts.modalApply, cancelText: texts.modalCancel, children: /* @__PURE__ */ jsx(Textarea, { rows: 7, value: expandValue, onChange: (event) => setExpandValue(event.target.value) }) });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
TextModal as default
|
|
40
27
|
};
|
|
41
|
-
export default TextModal;
|
package/dist/Factors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DefinedFactorTypes, FactorsProps, SelectedFactorType } from './Factors.types';
|
|
3
3
|
export declare const DEFAULT_FACTOR_TYPE: DefinedFactorTypes;
|
|
4
4
|
export declare const FACTOR_TYPE_MAPPING: Record<DefinedFactorTypes, SelectedFactorType>;
|
|
5
5
|
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, uncontrolledComponent, }: FactorsProps) => React.JSX.Element;
|