@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.
Files changed (92) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/FactorTypeSelector/FactorTypeSelector.d.ts +2 -2
  3. package/dist/FactorTypeSelector/FactorTypeSelector.js +37 -58
  4. package/dist/FactorTypeSelector/FactorTypeSelector.styles.d.ts +18 -18
  5. package/dist/FactorTypeSelector/FactorTypeSelector.styles.js +10 -10
  6. package/dist/FactorValue/Array/Array.const.js +8 -3
  7. package/dist/FactorValue/Array/Array.d.ts +2 -2
  8. package/dist/FactorValue/Array/Array.js +45 -57
  9. package/dist/FactorValue/Array/Array.styles.d.ts +39 -39
  10. package/dist/FactorValue/Array/Array.styles.js +44 -33
  11. package/dist/FactorValue/Array/Array.types.d.ts +3 -3
  12. package/dist/FactorValue/Array/Array.types.js +1 -1
  13. package/dist/FactorValue/Array/Array.utils.d.ts +2 -2
  14. package/dist/FactorValue/Array/Array.utils.js +21 -18
  15. package/dist/FactorValue/Array/components/ArrayCollector.d.ts +2 -2
  16. package/dist/FactorValue/Array/components/ArrayCollector.js +70 -94
  17. package/dist/FactorValue/Array/components/ArrayCreator.d.ts +2 -2
  18. package/dist/FactorValue/Array/components/ArrayCreator.js +43 -75
  19. package/dist/FactorValue/Array/components/ArrayLimit.d.ts +2 -2
  20. package/dist/FactorValue/Array/components/ArrayLimit.js +16 -14
  21. package/dist/FactorValue/Array/components/ArrayModal.d.ts +2 -2
  22. package/dist/FactorValue/Array/components/ArrayModal.js +78 -143
  23. package/dist/FactorValue/Array/components/ArrayRaw.d.ts +2 -2
  24. package/dist/FactorValue/Array/components/ArrayRaw.js +47 -58
  25. package/dist/FactorValue/Array/components/CopyButton.d.ts +2 -2
  26. package/dist/FactorValue/Array/components/CopyButton.js +20 -30
  27. package/dist/FactorValue/Array/hooks/useCollector.d.ts +3 -3
  28. package/dist/FactorValue/Array/hooks/useCollector.js +21 -22
  29. package/dist/FactorValue/Date/Date.d.ts +2 -2
  30. package/dist/FactorValue/Date/Date.js +38 -53
  31. package/dist/FactorValue/DateRange/DateRange.d.ts +2 -2
  32. package/dist/FactorValue/DateRange/DateRange.js +26 -41
  33. package/dist/FactorValue/DynamicKey/DynamicKey.d.ts +2 -2
  34. package/dist/FactorValue/DynamicKey/DynamicKey.js +37 -66
  35. package/dist/FactorValue/DynamicKey/DynamicKey.style.d.ts +2 -2
  36. package/dist/FactorValue/DynamicKey/DynamicKey.style.js +10 -8
  37. package/dist/FactorValue/FactorValue.d.ts +2 -2
  38. package/dist/FactorValue/FactorValue.js +68 -70
  39. package/dist/FactorValue/FactorValue.style.d.ts +1 -1
  40. package/dist/FactorValue/FactorValue.style.js +20 -20
  41. package/dist/FactorValue/Formula/Formula.d.ts +2 -2
  42. package/dist/FactorValue/Formula/Formula.js +36 -54
  43. package/dist/FactorValue/Formula/Formula.styles.d.ts +1 -1
  44. package/dist/FactorValue/Formula/Formula.styles.js +6 -5
  45. package/dist/FactorValue/Formula/FormulaModal.d.ts +2 -2
  46. package/dist/FactorValue/Formula/FormulaModal.js +27 -42
  47. package/dist/FactorValue/Number/NumberInput.d.ts +2 -2
  48. package/dist/FactorValue/Number/NumberInput.js +21 -31
  49. package/dist/FactorValue/Parameter/Parameter.constants.d.ts +1 -1
  50. package/dist/FactorValue/Parameter/Parameter.constants.js +27 -13
  51. package/dist/FactorValue/Parameter/Parameter.d.ts +2 -2
  52. package/dist/FactorValue/Parameter/Parameter.js +82 -127
  53. package/dist/FactorValue/Parameter/Parameter.style.d.ts +28 -28
  54. package/dist/FactorValue/Parameter/Parameter.style.js +34 -31
  55. package/dist/FactorValue/Parameter/Parameter.types.d.ts +2 -2
  56. package/dist/FactorValue/Parameter/Parameter.types.js +1 -1
  57. package/dist/FactorValue/Parameter/ParameterDropdown.d.ts +2 -2
  58. package/dist/FactorValue/Parameter/ParameterDropdown.js +155 -226
  59. package/dist/FactorValue/Parameter/ParameterDropdownItem.d.ts +3 -3
  60. package/dist/FactorValue/Parameter/ParameterDropdownItem.js +27 -33
  61. package/dist/FactorValue/Parameter/useGroups.d.ts +2 -2
  62. package/dist/FactorValue/Parameter/useGroups.js +30 -42
  63. package/dist/FactorValue/Parameter/utils.d.ts +2 -2
  64. package/dist/FactorValue/Parameter/utils.js +22 -17
  65. package/dist/FactorValue/RelativeDate/RelativeDate.const.d.ts +1 -1
  66. package/dist/FactorValue/RelativeDate/RelativeDate.const.js +12 -5
  67. package/dist/FactorValue/RelativeDate/RelativeDate.d.ts +2 -2
  68. package/dist/FactorValue/RelativeDate/RelativeDate.js +57 -88
  69. package/dist/FactorValue/RelativeDate/RelativeDate.utils.d.ts +1 -1
  70. package/dist/FactorValue/RelativeDate/RelativeDate.utils.js +14 -10
  71. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.d.ts +2 -2
  72. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.js +56 -87
  73. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.d.ts +7 -7
  74. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.js +23 -20
  75. package/dist/FactorValue/Text/Text.d.ts +2 -2
  76. package/dist/FactorValue/Text/Text.js +56 -121
  77. package/dist/FactorValue/Text/Text.styles.d.ts +3 -3
  78. package/dist/FactorValue/Text/Text.styles.js +11 -10
  79. package/dist/FactorValue/Text/TextModal.d.ts +2 -2
  80. package/dist/FactorValue/Text/TextModal.js +19 -33
  81. package/dist/Factors.d.ts +2 -2
  82. package/dist/Factors.js +95 -132
  83. package/dist/Factors.types.d.ts +9 -9
  84. package/dist/Factors.types.js +8 -3
  85. package/dist/hooks/useTexts.d.ts +2 -2
  86. package/dist/hooks/useTexts.js +287 -291
  87. package/dist/index.js +7 -6
  88. package/dist/modules.d.js +1 -1
  89. package/dist/modules.d.ts +0 -0
  90. package/dist/style/Factors.style.d.ts +1 -1
  91. package/dist/style/Factors.style.js +10 -11
  92. package/package.json +32 -32
@@ -1,39 +1,42 @@
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
- export var RelativeDateDropdownWrapper = styled(Dropdown.Wrapper).withConfig({
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
- export var RelativeDateDropdownFooter = styled.div.withConfig({
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;"], function (props) {
14
- return props.theme.palette['grey-100'];
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
- export var IconWrapper = styled.div.withConfig({
18
+ const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
21
19
  displayName: "RelativeDateDropdownstyles__IconWrapper",
22
20
  componentId: "sc-1xn8l81-3"
23
21
  })([""]);
24
- export var ClearIcon = styled(Icon).withConfig({
22
+ const ClearIcon = /* @__PURE__ */ styled(Icon).withConfig({
25
23
  displayName: "RelativeDateDropdownstyles__ClearIcon",
26
24
  componentId: "sc-1xn8l81-4"
27
25
  })([""]);
28
- export var ChevronIcon = styled(Icon).withConfig({
26
+ const ChevronIcon = /* @__PURE__ */ styled(Icon).withConfig({
29
27
  displayName: "RelativeDateDropdownstyles__ChevronIcon",
30
28
  componentId: "sc-1xn8l81-5"
31
29
  })([""]);
32
- export var Trigger = styled(Input).withConfig({
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, function (props) {
36
- return props.theme.palette['red-600'];
37
- }, function (props) {
38
- return props.theme.palette['red-500'];
39
- }, ChevronIcon);
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 { type FactorValueComponentProps } from '../../Factors.types';
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
- 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
- import React, { useCallback, useEffect, useMemo, useState } 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 * as S from './Text.styles';
8
- import TextModal from './TextModal';
9
- var TextInput = function TextInput(_ref) {
10
- var value = _ref.value,
11
- onChange = _ref.onChange,
12
- texts = _ref.texts,
13
- textType = _ref.textType,
14
- autocompleteText = _ref.autocompleteText,
15
- factorType = _ref.factorType,
16
- opened = _ref.opened,
17
- onDeactivate = _ref.onDeactivate,
18
- onActivate = _ref.onActivate,
19
- error = _ref.error,
20
- inputProps = _ref.inputProps,
21
- getPopupContainerOverride = _ref.getPopupContainerOverride,
22
- _ref$readOnly = _ref.readOnly,
23
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
24
- factorValueExtraProps = _ref.factorValueExtraProps,
25
- uncontrolledComponent = _ref.uncontrolledComponent;
26
- var _useState = useState(false),
27
- openExpanseEditor = _useState[0],
28
- setOpenExpanseEditor = _useState[1];
29
- var _useState2 = useState(),
30
- inputRef = _useState2[0],
31
- setInputRef = _useState2[1];
32
- var _useState3 = useState(function () {
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
- var handleChange = useCallback(function (event) {
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
- var handleApply = useCallback(function (val) {
45
+ const handleApply = useCallback((val) => {
56
46
  setOpenExpanseEditor(false);
57
47
  setLocalValue(val);
58
48
  onChange(val);
59
49
  }, [onChange]);
60
- var handleAutocomplete = useCallback(function (val) {
50
+ const handleAutocomplete = useCallback((val) => {
61
51
  setLocalValue(val);
62
52
  onChange(val);
63
53
  }, [onChange]);
64
- useEffect(function () {
54
+ useEffect(() => {
65
55
  if (!uncontrolledComponent) {
66
56
  setLocalValue(value);
67
57
  }
68
58
  }, [value, uncontrolledComponent]);
69
- useEffect(function () {
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
- var autocompleteOptions = useMemo(function () {
76
- return autocompleteText && autocompleteText.options.filter(function (option) {
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
- var _ref2 = (factorValueExtraProps == null ? void 0 : factorValueExtraProps.text) || {},
81
- _ref2$autoCompletePro = _ref2.autoCompleteProps,
82
- autoCompleteProps = _ref2$autoCompletePro === void 0 ? {} : _ref2$autoCompletePro,
83
- _ref2$inputProps = _ref2.inputProps,
84
- extraInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps;
85
- var renderInput = function renderInput(typesOfInput, factorsType) {
86
- if (typesOfInput === 'autocomplete' && factorsType === 'text') {
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 === 'default' && factorsType === 'text') {
106
- return /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, extraInputProps, {
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 /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.InputWrapper, null, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, extraInputProps, {
119
- handleInputRef: setInputRef,
120
- placeholder: texts.valuePlaceholder,
121
- icon1: /*#__PURE__*/React.createElement(S.IconWrapper, {
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 /*#__PURE__*/React.createElement(S.TextWrapper, {
149
- "data-testid": "ds-factors-" + factorType + "-" + textType
150
- }, renderInput(textType, factorType));
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("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
+ 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 'styled-components';
2
- export var IconWrapper = styled.span.withConfig({
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:", ";}}"], function (props) {
6
- return props.theme.palette['blue-600'];
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
- export var TextWrapper = styled.div.withConfig({
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,4 +1,4 @@
1
- import React from 'react';
2
- import { type TextModalProps } from '../../Factors.types';
1
+ import { default as React } from 'react';
2
+ import { TextModalProps } from '../../Factors.types';
3
3
  declare const TextModal: React.FC<TextModalProps>;
4
4
  export default TextModal;
@@ -1,41 +1,27 @@
1
- import React from 'react';
2
- import Textarea from '@synerise/ds-input/dist/Textarea/Textarea';
3
- import ModalProxy from '@synerise/ds-modal';
4
- var TextModal = function TextModal(_ref) {
5
- var value = _ref.value,
6
- onApply = _ref.onApply,
7
- onCancel = _ref.onCancel,
8
- visible = _ref.visible,
9
- texts = _ref.texts;
10
- // const [expandValue, setExpandValue] = React.useState('' || value); // TESTME
11
- var _React$useState = React.useState(value),
12
- expandValue = _React$useState[0],
13
- setExpandValue = _React$useState[1];
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
- var handleCancel = React.useCallback(function () {
16
+ const handleCancel = React.useCallback(() => {
18
17
  setExpandValue(value);
19
18
  onCancel();
20
19
  }, [onCancel, setExpandValue, value]);
21
- var handleOk = React.useCallback(function () {
20
+ const handleOk = React.useCallback(() => {
22
21
  onApply(expandValue);
23
22
  }, [onApply, expandValue]);
24
- return /*#__PURE__*/React.createElement(ModalProxy, {
25
- size: "medium",
26
- title: texts.modalTitle,
27
- closable: true,
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 { type DefinedFactorTypes, type FactorsProps, type SelectedFactorType } from './Factors.types';
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;