@synerise/ds-factors 1.3.1 → 1.4.0

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 (68) hide show
  1. package/CHANGELOG.md +786 -2398
  2. package/dist/FactorTypeSelector/FactorTypeSelector.d.ts +1 -1
  3. package/dist/FactorTypeSelector/FactorTypeSelector.js +6 -4
  4. package/dist/FactorValue/Array/Array.d.ts +1 -1
  5. package/dist/FactorValue/Array/Array.js +5 -3
  6. package/dist/FactorValue/Array/Array.styles.js +2 -2
  7. package/dist/FactorValue/Array/Array.types.d.ts +1 -1
  8. package/dist/FactorValue/Array/Array.utils.d.ts +1 -1
  9. package/dist/FactorValue/Array/components/ArrayCollector.d.ts +1 -1
  10. package/dist/FactorValue/Array/components/ArrayCollector.js +1 -1
  11. package/dist/FactorValue/Array/components/ArrayCreator.js +1 -1
  12. package/dist/FactorValue/Array/components/ArrayLimit.d.ts +1 -1
  13. package/dist/FactorValue/Array/components/ArrayModal.d.ts +1 -1
  14. package/dist/FactorValue/Array/components/ArrayModal.js +3 -4
  15. package/dist/FactorValue/Array/components/ArrayRaw.d.ts +1 -1
  16. package/dist/FactorValue/Array/components/ArrayRaw.js +1 -1
  17. package/dist/FactorValue/Array/components/CopyButton.d.ts +1 -1
  18. package/dist/FactorValue/Array/components/CopyButton.js +2 -2
  19. package/dist/FactorValue/Array/hooks/useCollector.d.ts +1 -1
  20. package/dist/FactorValue/Array/hooks/useCollector.js +1 -1
  21. package/dist/FactorValue/Date/Date.d.ts +1 -1
  22. package/dist/FactorValue/Date/Date.js +1 -1
  23. package/dist/FactorValue/DateRange/DateRange.d.ts +1 -1
  24. package/dist/FactorValue/DateRange/DateRange.js +1 -1
  25. package/dist/FactorValue/DynamicKey/DynamicKey.d.ts +2 -2
  26. package/dist/FactorValue/DynamicKey/DynamicKey.js +14 -4
  27. package/dist/FactorValue/DynamicKey/DynamicKey.style.d.ts +5 -0
  28. package/dist/FactorValue/DynamicKey/DynamicKey.style.js +10 -7
  29. package/dist/FactorValue/FactorValue.d.ts +2 -2
  30. package/dist/FactorValue/FactorValue.js +5 -3
  31. package/dist/FactorValue/FactorValue.style.js +0 -1
  32. package/dist/FactorValue/Formula/Formula.d.ts +1 -1
  33. package/dist/FactorValue/Formula/Formula.js +3 -3
  34. package/dist/FactorValue/Formula/Formula.styles.js +0 -2
  35. package/dist/FactorValue/Formula/FormulaModal.d.ts +1 -1
  36. package/dist/FactorValue/Formula/FormulaModal.js +1 -1
  37. package/dist/FactorValue/Number/NumberInput.d.ts +1 -1
  38. package/dist/FactorValue/Parameter/Parameter.constants.d.ts +1 -1
  39. package/dist/FactorValue/Parameter/Parameter.d.ts +1 -1
  40. package/dist/FactorValue/Parameter/Parameter.js +8 -9
  41. package/dist/FactorValue/Parameter/Parameter.style.d.ts +3 -1
  42. package/dist/FactorValue/Parameter/Parameter.style.js +11 -6
  43. package/dist/FactorValue/Parameter/Parameter.types.d.ts +2 -2
  44. package/dist/FactorValue/Parameter/ParameterDropdown.d.ts +1 -1
  45. package/dist/FactorValue/Parameter/ParameterDropdown.js +11 -11
  46. package/dist/FactorValue/Parameter/ParameterDropdownItem.d.ts +2 -2
  47. package/dist/FactorValue/Parameter/useGroups.d.ts +1 -1
  48. package/dist/FactorValue/Parameter/utils.d.ts +3 -3
  49. package/dist/FactorValue/RelativeDate/RelativeDate.const.d.ts +1 -1
  50. package/dist/FactorValue/RelativeDate/RelativeDate.d.ts +1 -1
  51. package/dist/FactorValue/RelativeDate/RelativeDate.js +8 -6
  52. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.d.ts +1 -1
  53. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.js +2 -2
  54. package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.js +2 -2
  55. package/dist/FactorValue/Text/Text.d.ts +2 -2
  56. package/dist/FactorValue/Text/Text.js +17 -8
  57. package/dist/FactorValue/Text/Text.styles.js +0 -2
  58. package/dist/FactorValue/Text/TextModal.d.ts +1 -1
  59. package/dist/FactorValue/Text/TextModal.js +3 -2
  60. package/dist/Factors.d.ts +2 -2
  61. package/dist/Factors.js +10 -9
  62. package/dist/Factors.types.d.ts +23 -9
  63. package/dist/hooks/useTexts.d.ts +1 -1
  64. package/dist/hooks/useTexts.js +1 -1
  65. package/dist/index.d.ts +2 -3
  66. package/dist/index.js +5 -1
  67. package/dist/style/Factors.style.js +1 -1
  68. package/package.json +30 -30
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorTypeSelectorProps } from '../Factors.types';
2
+ import { type FactorTypeSelectorProps } from '../Factors.types';
3
3
  declare const FactorTypeSelector: ({ selectedFactorType, setSelectedFactorType, unavailableFactorTypes, availableFactorTypes, factorTypeMapping, selectedFactor, texts, readOnly, }: FactorTypeSelectorProps) => React.JSX.Element;
4
4
  export default FactorTypeSelector;
@@ -1,11 +1,11 @@
1
1
  import React, { useMemo, useState } from 'react';
2
+ import { theme } from '@synerise/ds-core';
2
3
  import Dropdown from '@synerise/ds-dropdown';
3
4
  import Icon, { CheckS } from '@synerise/ds-icon';
4
- import Tooltip from '@synerise/ds-tooltip';
5
5
  import ListItem from '@synerise/ds-list-item';
6
- import { theme } from '@synerise/ds-core';
7
- import * as S from './FactorTypeSelector.styles';
6
+ import Tooltip from '@synerise/ds-tooltip';
8
7
  import { ALL_FACTOR_TYPES } from '../Factors.types';
8
+ import * as S from './FactorTypeSelector.styles';
9
9
  var FactorTypeSelector = function FactorTypeSelector(_ref) {
10
10
  var selectedFactorType = _ref.selectedFactorType,
11
11
  setSelectedFactorType = _ref.setSelectedFactorType,
@@ -51,7 +51,9 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
51
51
  }, /*#__PURE__*/React.createElement(Icon, {
52
52
  component: selectedFactor.icon
53
53
  }));
54
- if (readOnly) return trigger;
54
+ if (readOnly) {
55
+ return trigger;
56
+ }
55
57
  return /*#__PURE__*/React.createElement(Tooltip, {
56
58
  title: texts[selectedFactorType],
57
59
  trigger: ['hover']
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ArrayItemType, FactorValueComponentProps } from '../../Factors.types';
2
+ import { type ArrayItemType, type FactorValueComponentProps } from '../../Factors.types';
3
3
  export declare const Array: <ItemType extends ArrayItemType>({ value: arrayValue, onChange, texts, opened, onActivate, onDeactivate, readOnly, error, arrayProps, }: FactorValueComponentProps) => React.JSX.Element;
@@ -1,10 +1,10 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useMemo, useState } from 'react';
3
- import Icon, { EditS } from '@synerise/ds-icon';
4
3
  import { useTheme } from '@synerise/ds-core';
4
+ import Icon, { EditS } from '@synerise/ds-icon';
5
5
  import { TagShape } from '@synerise/ds-tag';
6
- import { ArrayModal } from './components/ArrayModal';
7
6
  import * as S from './Array.styles';
7
+ import { ArrayModal } from './components/ArrayModal';
8
8
  export var Array = function Array(_ref) {
9
9
  var arrayValue = _ref.value,
10
10
  onChange = _ref.onChange,
@@ -25,7 +25,9 @@ export var Array = function Array(_ref) {
25
25
  onActivate && onActivate();
26
26
  };
27
27
  var buttonLabel = useMemo(function () {
28
- if (!(arrayValue != null && arrayValue.length)) return texts.array.triggerLabel;
28
+ if (!(arrayValue != null && arrayValue.length)) {
29
+ return texts.array.triggerLabel;
30
+ }
29
31
  return arrayValue.join(', ') + " ";
30
32
  }, [arrayValue, texts.array.triggerLabel]);
31
33
  var triggerMode = useMemo(function () {
@@ -1,9 +1,9 @@
1
1
  import styled from 'styled-components';
2
+ import Button from '@synerise/ds-button';
2
3
  import EmptyStateBase from '@synerise/ds-empty-states';
3
4
  import Icon from '@synerise/ds-icon';
4
- import Button from '@synerise/ds-button';
5
- import ModalBase from '@synerise/ds-modal';
6
5
  import { RawTextArea } from '@synerise/ds-input';
6
+ import ModalBase from '@synerise/ds-modal';
7
7
  export var TextArea = styled(RawTextArea).withConfig({
8
8
  displayName: "Arraystyles__TextArea",
9
9
  componentId: "sc-9atgo7-0"
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import type { RequiredProps } from '@synerise/ds-utils';
3
3
  import type { ArrayProps, FactorsTexts } from '../../Factors.types';
4
4
  export type ArrayModalProps<ItemType extends 'string' | 'number'> = RequiredProps<ArrayProps, 'itemType'> & {
@@ -1,4 +1,4 @@
1
- import { ArrayValueElement, ArrayValueWithID } from './Array.types';
1
+ import { type ArrayValueElement, type ArrayValueWithID } from './Array.types';
2
2
  export declare const matchesSearchQuery: (item: string | number, searchQuery: string) => boolean;
3
3
  export declare const arrayWithUUID: <ItemType extends "string" | "number">(items: ArrayValueElement<ItemType>[]) => ArrayValueWithID<ItemType>[];
4
4
  export declare const sanitiseValues: (element: string) => string;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ArrayCollectorProps } from '../Array.types';
2
+ import { type ArrayCollectorProps } from '../Array.types';
3
3
  export declare const ArrayCollector: <ItemType extends "string" | "number">({ limit, itemType, arrayValueCount, texts, onConfirm, collectorSuggestions, }: ArrayCollectorProps<ItemType>) => React.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { v4 as uuid } from 'uuid';
3
3
  import Collector from '@synerise/ds-collector';
4
+ import * as S from '../Array.styles';
4
5
  import { isArrayOfNumbersAsString, isNumberAsString, sanitiseValues } from '../Array.utils';
5
6
  import { useCollector } from '../hooks/useCollector';
6
- import * as S from '../Array.styles';
7
7
  export var ArrayCollector = function ArrayCollector(_ref) {
8
8
  var limit = _ref.limit,
9
9
  itemType = _ref.itemType,
@@ -1,9 +1,9 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useMemo } from 'react';
3
+ import { CloseM, InboxNoResultsL } from '@synerise/ds-icon';
3
4
  import { Input } from '@synerise/ds-input';
4
5
  import InputNumber from '@synerise/ds-input-number';
5
6
  import Tooltip from '@synerise/ds-tooltip';
6
- import { InboxNoResultsL, CloseM } from '@synerise/ds-icon';
7
7
  import * as S from '../Array.styles';
8
8
  import { matchesSearchQuery } from '../Array.utils';
9
9
  import { ArrayCollector } from './ArrayCollector';
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ArrayLimitProps } from '../Array.types';
2
+ import { type ArrayLimitProps } from '../Array.types';
3
3
  export declare const ArrayLimit: ({ limit, count, texts }: ArrayLimitProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ArrayModalProps } from '../Array.types';
2
+ import { type ArrayModalProps } from '../Array.types';
3
3
  export declare const ArrayModal: <ItemType extends "string" | "number">({ value, itemType, onApply, onCancel, visible, readOnly, texts, limit, collectorSuggestions, }: ArrayModalProps<ItemType>) => React.JSX.Element;
@@ -5,13 +5,13 @@ import ButtonGroup from '@synerise/ds-button-group';
5
5
  import Icon, { CodeM, EditM, TrashM } from '@synerise/ds-icon';
6
6
  import { SearchInput } from '@synerise/ds-search';
7
7
  import { useIsMounted } from '@synerise/ds-utils';
8
+ import { MODAL_VIEWPORT_HEIGHT } from '../Array.const';
8
9
  import * as S from '../Array.styles';
9
- import { ArrayCreator } from './ArrayCreator';
10
- import { ArrayRaw } from './ArrayRaw';
11
10
  import { arrayWithUUID } from '../Array.utils';
11
+ import { ArrayCreator } from './ArrayCreator';
12
12
  import { ArrayLimit } from './ArrayLimit';
13
+ import { ArrayRaw } from './ArrayRaw';
13
14
  import { CopyButton } from './CopyButton';
14
- import { MODAL_VIEWPORT_HEIGHT } from '../Array.const';
15
15
  export var ArrayModal = function ArrayModal(_ref) {
16
16
  var value = _ref.value,
17
17
  itemType = _ref.itemType,
@@ -37,7 +37,6 @@ export var ArrayModal = function ArrayModal(_ref) {
37
37
  var isMounted = useIsMounted();
38
38
  useEffect(function () {
39
39
  isMounted.current && setArrayValue(arrayWithUUID(value || []));
40
- // eslint-disable-next-line react-hooks/exhaustive-deps
41
40
  }, [value, isMounted]);
42
41
  var handleRawEditorError = function handleRawEditorError(errorMessage) {
43
42
  setRawEditorError(errorMessage);
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ArrayRawProps } from '../Array.types';
2
+ import { type ArrayRawProps } from '../Array.types';
3
3
  export declare const ArrayRaw: <ItemType extends "string" | "number">({ value, itemType, onValueChange, readOnly, texts, limit, onError, }: ArrayRawProps<ItemType>) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useMemo, useRef, useState } from 'react';
2
- import { arrayWithUUID, isArrayOfNumbersAsString, sanitiseValues } from '../Array.utils';
3
2
  import * as S from '../Array.styles';
3
+ import { arrayWithUUID, isArrayOfNumbersAsString, sanitiseValues } from '../Array.utils';
4
4
  export var ArrayRaw = function ArrayRaw(_ref) {
5
5
  var _ref$value = _ref.value,
6
6
  value = _ref$value === void 0 ? [] : _ref$value,
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { CopyButtonProps } from '../Array.types';
2
+ import { type CopyButtonProps } from '../Array.types';
3
3
  export declare const CopyButton: ({ copyValue, texts }: CopyButtonProps) => React.JSX.Element;
@@ -1,8 +1,8 @@
1
- import React, { useCallback, useState } from 'react';
2
1
  import copy from 'copy-to-clipboard';
3
- import Tooltip from '@synerise/ds-tooltip';
2
+ import React, { useCallback, useState } from 'react';
4
3
  import Button from '@synerise/ds-button';
5
4
  import Icon, { CopyClipboardM } from '@synerise/ds-icon';
5
+ import Tooltip from '@synerise/ds-tooltip';
6
6
  export var CopyButton = function CopyButton(_ref) {
7
7
  var copyValue = _ref.copyValue,
8
8
  texts = _ref.texts;
@@ -6,7 +6,7 @@ type UseCollectorProps = {
6
6
  arrayValueCount?: number;
7
7
  texts: FactorsTexts;
8
8
  };
9
- export declare const useCollector: ({ limit, collectorCount, arrayValueCount, texts }: UseCollectorProps) => {
9
+ export declare const useCollector: ({ limit, collectorCount, arrayValueCount, texts, }: UseCollectorProps) => {
10
10
  disabled: boolean;
11
11
  error: boolean;
12
12
  errorMessage: import("react").ReactNode;
@@ -1,4 +1,4 @@
1
- import { useState, useCallback, useMemo } from 'react';
1
+ import { useCallback, useMemo, useState } from 'react';
2
2
  export var useCollector = function useCollector(_ref) {
3
3
  var limit = _ref.limit,
4
4
  collectorCount = _ref.collectorCount,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
3
  declare const DateInput: ({ value, onChange, texts, opened, onDeactivate, onActivate, error, allowClear, readOnly, getPopupContainerOverride, }: FactorValueComponentProps) => React.JSX.Element;
4
4
  export default DateInput;
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { getPopupContainer } from '@synerise/ds-utils';
3
2
  import DatePicker from '@synerise/ds-date-picker';
3
+ import { getPopupContainer } from '@synerise/ds-utils';
4
4
  var DateInput = function DateInput(_ref) {
5
5
  var value = _ref.value,
6
6
  onChange = _ref.onChange,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
3
  declare const DateRangeInput: ({ getPopupContainerOverride, value, onChange, error, texts, onDeactivate, allowClear, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
4
4
  export default DateRangeInput;
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
+ import { useIntl } from 'react-intl';
2
3
  import DateRangePicker from '@synerise/ds-date-range-picker';
3
4
  import { getPopupContainer } from '@synerise/ds-utils';
4
- import { useIntl } from 'react-intl';
5
5
  var DateRangeInput = function DateRangeInput(_ref) {
6
6
  var getPopupContainerOverride = _ref.getPopupContainerOverride,
7
7
  value = _ref.value,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
3
- declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
+ declare const DynamicKey: ({ value, onChange, withoutTypeSelector, texts, opened, onDeactivate, error, factorValueExtraProps, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
4
4
  export default DynamicKey;
@@ -1,6 +1,5 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useEffect, useState } from 'react';
3
- import { RawInput } from '@synerise/ds-input';
4
3
  import * as S from './DynamicKey.style';
5
4
  var DynamicKey = function DynamicKey(_ref) {
6
5
  var value = _ref.value,
@@ -11,6 +10,7 @@ var DynamicKey = function DynamicKey(_ref) {
11
10
  opened = _ref.opened,
12
11
  onDeactivate = _ref.onDeactivate,
13
12
  error = _ref.error,
13
+ factorValueExtraProps = _ref.factorValueExtraProps,
14
14
  _ref$readOnly = _ref.readOnly,
15
15
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
16
16
  var _useState = useState({
@@ -39,7 +39,15 @@ var DynamicKey = function DynamicKey(_ref) {
39
39
  value: value.value
40
40
  });
41
41
  }, [value]);
42
- var trigger = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RawInput, {
42
+ var _ref2 = (factorValueExtraProps == null ? void 0 : factorValueExtraProps.dynamicKey) || {},
43
+ _ref2$keyInputProps = _ref2.keyInputProps,
44
+ keyInputProps = _ref2$keyInputProps === void 0 ? {} : _ref2$keyInputProps,
45
+ _ref2$valueInputProps = _ref2.valueInputProps,
46
+ valueInputProps = _ref2$valueInputProps === void 0 ? {} : _ref2$valueInputProps;
47
+ var trigger = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.DynamicKeyInput, _extends({
48
+ withoutTypeSelector: withoutTypeSelector,
49
+ index: 0
50
+ }, keyInputProps, {
43
51
  placeholder: texts.dynamicKey.keyPlaceholder,
44
52
  value: localValue.key,
45
53
  name: "key",
@@ -48,14 +56,16 @@ var DynamicKey = function DynamicKey(_ref) {
48
56
  onBlur: onDeactivate,
49
57
  error: localError || error,
50
58
  readOnly: readOnly
51
- }), /*#__PURE__*/React.createElement(RawInput, {
59
+ })), /*#__PURE__*/React.createElement(S.DynamicKeyInput, _extends({
60
+ index: 1
61
+ }, valueInputProps, {
52
62
  placeholder: texts.dynamicKey.valuePlaceholder,
53
63
  value: localValue.value,
54
64
  name: "value",
55
65
  onChange: handleChange,
56
66
  error: localError || error,
57
67
  readOnly: readOnly
58
- }));
68
+ })));
59
69
  return /*#__PURE__*/React.createElement(S.DynamicKey, {
60
70
  "data-testid": "ds-factors-dynamic-key",
61
71
  withoutTypeSelector: withoutTypeSelector
@@ -1,3 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const DynamicKeyInput: import("styled-components").StyledComponent<({ className, errorText, label, description, counterLimit, tooltip, tooltipConfig, icon1, icon1Tooltip, autoResize, icon2, icon2Tooltip, resetMargin, handleInputRef, prefixel, suffixel, error, expandable, expandableTooltip, renderCustomCounter, autoResizeProps, ...antdInputProps }: import("@synerise/ds-input").InputProps) => import("react").JSX.Element, any, {
3
+ index: 0 | 1;
4
+ withoutTypeSelector?: boolean | undefined;
5
+ }, never>;
1
6
  export declare const DynamicKey: import("styled-components").StyledComponent<"div", any, {
2
7
  withoutTypeSelector: boolean;
3
8
  }, never>;
@@ -1,9 +1,12 @@
1
- import styled from 'styled-components';
2
-
3
- // eslint-disable-next-line import/prefer-default-export
1
+ import styled, { css } from 'styled-components';
2
+ import { Input } from '@synerise/ds-input';
3
+ export var DynamicKeyInput = styled(Input).withConfig({
4
+ displayName: "DynamicKeystyle__DynamicKeyInput",
5
+ componentId: "sc-43cup-0"
6
+ })(["flex:1;&:focus{z-index:2;}.ant-input{", "}"], function (props) {
7
+ return props.index === 0 ? css(["border-radius:", ";"], props.withoutTypeSelector ? '3px 0 0 3px' : '0') : css(["border-radius:0 3px 3px 0;margin-left:-1px;"]);
8
+ });
4
9
  export var DynamicKey = styled.div.withConfig({
5
10
  displayName: "DynamicKeystyle__DynamicKey",
6
- componentId: "sc-43cup-0"
7
- })(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;.ant-input{flex:1;&:focus{z-index:2;}&:first-of-type{border-radius:", ";}&:last-of-type{border-radius:0 3px 3px 0;margin-left:-1px;}}"], function (props) {
8
- return props.withoutTypeSelector ? '3px 0 0 3px' : '0';
9
- });
11
+ componentId: "sc-43cup-1"
12
+ })(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;"]);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueProps } from '../Factors.types';
3
- declare const FactorValue: ({ selectedFactorType, value, onChangeValue, onParamsClick, selectedFactor, textType, parameters, autocompleteText, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, inputProps, allowClear, readOnly, getMenuEntryProps, relativeDateProps, arrayProps, }: FactorValueProps) => React.JSX.Element;
2
+ import { type FactorValueProps } from '../Factors.types';
3
+ declare const FactorValue: ({ selectedFactorType, value, onChangeValue, onParamsClick, selectedFactor, textType, parameters, autocompleteText, withoutTypeSelector, texts, formulaEditor, opened, loading, factorKey, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, inputProps, allowClear, readOnly, getMenuEntryProps, relativeDateProps, arrayProps, factorValueExtraProps, }: FactorValueProps) => React.JSX.Element;
4
4
  export default FactorValue;
@@ -28,7 +28,8 @@ var FactorValue = function FactorValue(_ref) {
28
28
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
29
29
  getMenuEntryProps = _ref.getMenuEntryProps,
30
30
  relativeDateProps = _ref.relativeDateProps,
31
- arrayProps = _ref.arrayProps;
31
+ arrayProps = _ref.arrayProps,
32
+ factorValueExtraProps = _ref.factorValueExtraProps;
32
33
  var inputType = React.useMemo(function () {
33
34
  if (!selectedFactor) {
34
35
  return undefined;
@@ -59,9 +60,10 @@ var FactorValue = function FactorValue(_ref) {
59
60
  allowClear: allowClear,
60
61
  readOnly: readOnly,
61
62
  getMenuEntryProps: getMenuEntryProps,
62
- inputProps: inputProps
63
+ inputProps: inputProps,
64
+ factorValueExtraProps: factorValueExtraProps
63
65
  }, relativeDateProps));
64
- }, [selectedFactor, factorKey, value, texts, onChangeValue, textType, selectedFactorType, autocompleteText, parameters, withoutTypeSelector, inputProps, arrayProps, formulaEditor, opened, loading, onParamsClick, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, allowClear, readOnly, getMenuEntryProps, relativeDateProps]);
66
+ }, [selectedFactor, factorKey, value, texts, onChangeValue, textType, selectedFactorType, autocompleteText, parameters, withoutTypeSelector, inputProps, arrayProps, formulaEditor, opened, loading, onParamsClick, preventAutoloadData, getPopupContainerOverride, onActivate, onDeactivate, error, allowClear, readOnly, getMenuEntryProps, relativeDateProps, factorValueExtraProps]);
65
67
  return /*#__PURE__*/React.createElement(S.FactorInput, {
66
68
  inputType: selectedFactorType,
67
69
  inputTextType: textType,
@@ -5,7 +5,6 @@ var DEFAULT_WIDTH = {
5
5
  'text-default': '147px',
6
6
  'text-expansible': '123px'
7
7
  };
8
- // eslint-disable-next-line import/prefer-default-export
9
8
  export var FactorInput = styled.div.withConfig({
10
9
  displayName: "FactorValuestyle__FactorInput",
11
10
  componentId: "sc-17jtnx3-0"
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
3
  declare const FormulaInput: ({ value, error, onChange, withoutTypeSelector, texts, formulaEditor, readOnly, }: FactorValueComponentProps) => React.JSX.Element;
4
4
  export default FormulaInput;
@@ -1,9 +1,9 @@
1
- import React, { useState, useMemo, useCallback } from 'react';
1
+ import React, { useCallback, useMemo, useState } from 'react';
2
+ import Badge from '@synerise/ds-badge';
2
3
  import Button from '@synerise/ds-button';
3
4
  import Icon, { EditS } from '@synerise/ds-icon';
4
- import Badge from '@synerise/ds-badge';
5
- import FormulaModal from './FormulaModal';
6
5
  import * as S from './Formula.styles';
6
+ import FormulaModal from './FormulaModal';
7
7
  var FormulaInput = function FormulaInput(_ref) {
8
8
  var value = _ref.value,
9
9
  error = _ref.error,
@@ -1,6 +1,4 @@
1
1
  import styled from 'styled-components';
2
-
3
- // eslint-disable-next-line import/prefer-default-export
4
2
  export var FormulaButton = styled.div.withConfig({
5
3
  displayName: "Formulastyles__FormulaButton",
6
4
  componentId: "sc-bixbni-0"
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FormulaModalProps } from '../../Factors.types';
2
+ import { type FormulaModalProps } from '../../Factors.types';
3
3
  declare const FormulaModal: React.FC<FormulaModalProps>;
4
4
  export default FormulaModal;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import ModalProxy from '@synerise/ds-modal';
3
2
  import InlineEdit from '@synerise/ds-inline-edit';
3
+ import ModalProxy from '@synerise/ds-modal';
4
4
  var FormulaModal = function FormulaModal(_ref) {
5
5
  var value = _ref.value,
6
6
  onApply = _ref.onApply,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
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
- import { CSSProperties } from 'react';
1
+ import { type CSSProperties } from 'react';
2
2
  export declare const LIST_STYLE: CSSProperties;
3
3
  export declare const NO_GROUP_NAME = "NO_GROUP_NAME";
4
4
  export declare const ITEM_SIZE: {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { FactorValueComponentProps } from '../../Factors.types';
2
+ import { type FactorValueComponentProps } from '../../Factors.types';
3
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;
@@ -1,16 +1,15 @@
1
1
  var _excluded = ["buttonIcon", "buttonLabel", "selectedButtonColored", "dropdownDimensionsConfig"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useCallback, useMemo, useState, useEffect } from 'react';
4
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
5
5
  import Dropdown from '@synerise/ds-dropdown';
6
- import Button from '@synerise/ds-button';
7
- import Menu from '@synerise/ds-menu';
8
6
  import Icon, { AngleDownS } from '@synerise/ds-icon';
9
- import { getPopupContainer } from '@synerise/ds-utils';
10
7
  import InformationCard from '@synerise/ds-information-card';
11
- import { Value } from './Parameter.style';
12
- import ParameterDropdown from './ParameterDropdown';
8
+ import Menu from '@synerise/ds-menu';
9
+ import { getPopupContainer } from '@synerise/ds-utils';
13
10
  import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from './Parameter.constants';
11
+ import { ParameterButton, Value } from './Parameter.style';
12
+ import ParameterDropdown from './ParameterDropdown';
14
13
  var ParameterInput = function ParameterInput(_ref) {
15
14
  var value = _ref.value,
16
15
  onChange = _ref.onChange,
@@ -71,11 +70,11 @@ var ParameterInput = function ParameterInput(_ref) {
71
70
  onParamsClick && onParamsClick();
72
71
  onActivate && onActivate();
73
72
  }
74
- // eslint-disable-next-line
73
+ // eslint-disable-next-line react-hooks/exhaustive-deps
75
74
  }, [opened]);
76
75
  useEffect(function () {
77
76
  !preventAutoloadData && onParamsClick && onParamsClick();
78
- // eslint-disable-next-line
77
+ // eslint-disable-next-line react-hooks/exhaustive-deps
79
78
  }, []);
80
79
  var onDropdownVisibilityChange = useCallback(function (newValue) {
81
80
  newValue && onActivate && onActivate();
@@ -90,7 +89,7 @@ var ParameterInput = function ParameterInput(_ref) {
90
89
  }
91
90
  return readOnly ? 'simple' : 'label-icon';
92
91
  }, [parameterIcon, readOnly]);
93
- var triggerButton = /*#__PURE__*/React.createElement(Button, {
92
+ var triggerButton = /*#__PURE__*/React.createElement(ParameterButton, {
94
93
  error: error,
95
94
  type: isSelected && selectedButtonColored ? 'custom-color' : 'secondary',
96
95
  color: isSelected && selectedButtonColored ? 'green' : undefined,
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { VariableSizeList } from 'react-window';
3
+ import Button from '@synerise/ds-button';
3
4
  export declare const TabsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
5
  export declare const ContentPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
5
6
  export declare const ItemsList: import("styled-components").StyledComponent<"div", any, {
@@ -8,8 +9,9 @@ export declare const ItemsList: import("styled-components").StyledComponent<"div
8
9
  export declare const SearchResult: import("styled-components").StyledComponent<"span", any, {}, never>;
9
10
  export declare const SearchResultHighlight: import("styled-components").StyledComponent<"span", any, {}, never>;
10
11
  export declare const Value: import("styled-components").StyledComponent<"span", any, {}, never>;
12
+ export declare const ParameterButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
11
13
  export declare const StyledList: import("styled-components").StyledComponent<typeof VariableSizeList, any, {}, never>;
12
- export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className }: import("@synerise/ds-skeleton").SkeletonProps) => import("react").JSX.Element, any, {
14
+ export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) => import("react").JSX.Element, any, {
13
15
  contentHeight?: number | undefined;
14
16
  }, never>;
15
17
  export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,7 @@
1
+ import { VariableSizeList } from 'react-window';
1
2
  import styled from 'styled-components';
3
+ import Button from '@synerise/ds-button';
2
4
  import DropdownSkeleton from '@synerise/ds-skeleton';
3
- import { VariableSizeList } from 'react-window';
4
5
  export var TabsWrapper = styled.div.withConfig({
5
6
  displayName: "Parameterstyle__TabsWrapper",
6
7
  componentId: "sc-u2uvgh-0"
@@ -30,24 +31,28 @@ export var SearchResultHighlight = styled.span.withConfig({
30
31
  export var Value = styled.span.withConfig({
31
32
  displayName: "Parameterstyle__Value",
32
33
  componentId: "sc-u2uvgh-5"
33
- })(["max-width:110px;text-overflow:ellipsis;overflow:hidden;"]);
34
+ })(["max-width:110px;text-overflow:ellipsis;overflow:hidden;text-align:left;"]);
35
+ export var ParameterButton = styled(Button).withConfig({
36
+ displayName: "Parameterstyle__ParameterButton",
37
+ componentId: "sc-u2uvgh-6"
38
+ })(["max-width:100%;"]);
34
39
  export var StyledList = styled(VariableSizeList).withConfig({
35
40
  displayName: "Parameterstyle__StyledList",
36
- componentId: "sc-u2uvgh-6"
41
+ componentId: "sc-u2uvgh-7"
37
42
  })(["overflow-x:unset;overflow-y:unset;height:auto !important;max-height:300px;"]);
38
43
  export var Skeleton = styled(DropdownSkeleton).withConfig({
39
44
  displayName: "Parameterstyle__Skeleton",
40
- componentId: "sc-u2uvgh-7"
45
+ componentId: "sc-u2uvgh-8"
41
46
  })(["", ""], function (props) {
42
47
  return props.contentHeight !== undefined && "height: " + props.contentHeight + "px;";
43
48
  });
44
49
  export var Title = styled.div.withConfig({
45
50
  displayName: "Parameterstyle__Title",
46
- componentId: "sc-u2uvgh-8"
51
+ componentId: "sc-u2uvgh-9"
47
52
  })(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"], function (props) {
48
53
  return props.theme.palette['grey-500'];
49
54
  });
50
55
  export var ShowMoreItem = styled.div.withConfig({
51
56
  displayName: "Parameterstyle__ShowMoreItem",
52
- componentId: "sc-u2uvgh-9"
57
+ componentId: "sc-u2uvgh-10"
53
58
  })(["font-weight:500;"]);
@@ -1,5 +1,5 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- import type { ParameterItem, ParameterGroup } from '../../Factors.types';
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ import type { ParameterGroup, ParameterItem } from '../../Factors.types';
3
3
  export type DropdownItem<ItemType extends ParameterItem | ParameterGroup> = {
4
4
  item: ItemType;
5
5
  searchQuery: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ParameterDropdownProps } from '../../Factors.types';
2
+ import { type ParameterDropdownProps } from '../../Factors.types';
3
3
  export type TitleItem = {
4
4
  type: 'title';
5
5
  title: string;