@synerise/ds-factors 1.4.3 → 1.4.5
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 +16 -0
- package/dist/FactorTypeSelector/FactorTypeSelector.js +19 -14
- package/dist/FactorValue/Array/Array.styles.d.ts +5 -6
- package/dist/FactorValue/Array/hooks/useCollector.d.ts +0 -1
- package/dist/FactorValue/DynamicKey/DynamicKey.js +9 -5
- package/dist/FactorValue/DynamicKey/DynamicKey.style.d.ts +2 -3
- package/dist/FactorValue/FactorValue.style.d.ts +2 -2
- package/dist/FactorValue/Parameter/Parameter.style.d.ts +3 -4
- package/dist/FactorValue/Parameter/ParameterDropdownItem.d.ts +1 -1
- package/dist/FactorValue/Parameter/useGroups.d.ts +0 -1
- package/dist/FactorValue/Parameter/utils.d.ts +1 -1
- package/dist/FactorValue/RelativeDate/RelativeDate.utils.d.ts +2 -2
- package/dist/FactorValue/RelativeDate/RelativeDate.utils.js +6 -1
- package/dist/FactorValue/RelativeDate/RelativeDateDropdown.styles.d.ts +3 -4
- package/dist/Factors.d.ts +1 -0
- package/dist/Factors.js +8 -3
- package/dist/Factors.types.d.ts +10 -16
- package/dist/Factors.types.js +3 -1
- package/dist/style/Factors.style.d.ts +1 -2
- package/package.json +30 -30
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.4.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.4.4...@synerise/ds-factors@1.4.5) (2025-07-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.4.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.4.3...@synerise/ds-factors@1.4.4) (2025-07-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.4.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.4.2...@synerise/ds-factors@1.4.3) (2025-07-15)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -26,11 +26,12 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
return list.map(function (type) {
|
|
29
|
+
var typeData = factorTypeMapping[type];
|
|
29
30
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
30
31
|
className: "ds-factor-type",
|
|
31
|
-
key:
|
|
32
|
+
key: typeData.name,
|
|
32
33
|
prefixel: /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
-
component:
|
|
34
|
+
component: typeData.icon
|
|
34
35
|
}),
|
|
35
36
|
suffixel: type === selectedFactorType ? /*#__PURE__*/React.createElement(Icon, {
|
|
36
37
|
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
@@ -54,17 +55,21 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
|
54
55
|
if (readOnly) {
|
|
55
56
|
return trigger;
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
return (
|
|
59
|
+
/*#__PURE__*/
|
|
60
|
+
// @ts-expect-error selectedFactorType can be any string - requires type refactor in analytics-core
|
|
61
|
+
React.createElement(Tooltip, {
|
|
62
|
+
title: texts[selectedFactorType],
|
|
63
|
+
trigger: ['hover']
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
65
|
+
open: dropdownOpen,
|
|
66
|
+
onOpenChange: setDropdownOpen,
|
|
67
|
+
dropdownRender: function dropdownRender() {
|
|
68
|
+
return /*#__PURE__*/React.createElement(S.FactorTypeList, null, typesList);
|
|
69
|
+
},
|
|
70
|
+
trigger: ['click'],
|
|
71
|
+
disabled: readOnly
|
|
72
|
+
}, trigger))
|
|
73
|
+
);
|
|
69
74
|
};
|
|
70
75
|
export default FactorTypeSelector;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import Button from '@synerise/ds-button';
|
|
3
2
|
export declare const TextArea: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/input").TextAreaProps & {
|
|
4
|
-
error?: boolean
|
|
3
|
+
error?: boolean;
|
|
5
4
|
} & import("react").RefAttributes<import("antd/lib/input/TextArea").TextAreaRef>>, any, {
|
|
6
|
-
error?: boolean
|
|
5
|
+
error?: boolean;
|
|
7
6
|
}, never>;
|
|
8
7
|
export declare const Modal: import("styled-components").StyledComponent<{
|
|
9
|
-
(props: import("@synerise/ds-modal").ModalProps):
|
|
8
|
+
(props: import("@synerise/ds-modal").ModalProps): React.JSX.Element;
|
|
10
9
|
info: import("antd/lib/modal/confirm").ModalFunc;
|
|
11
10
|
success: import("antd/lib/modal/confirm").ModalFunc;
|
|
12
11
|
error: import("antd/lib/modal/confirm").ModalFunc;
|
|
@@ -15,7 +14,7 @@ export declare const Modal: import("styled-components").StyledComponent<{
|
|
|
15
14
|
}, any, {
|
|
16
15
|
viewportHeight: number;
|
|
17
16
|
}, never>;
|
|
18
|
-
export declare const EmptyState: import("styled-components").StyledComponent<({ size, label, text, button, fontSize, customIcon, className, mode, iconPosition, textAlign, }: import("@synerise/ds-empty-states").EmptyStatesProps) =>
|
|
17
|
+
export declare const EmptyState: import("styled-components").StyledComponent<({ size, label, text, button, fontSize, customIcon, className, mode, iconPosition, textAlign, }: import("@synerise/ds-empty-states").EmptyStatesProps) => React.JSX.Element, any, {}, never>;
|
|
19
18
|
export declare const TriggerButtonLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
19
|
export declare const TriggerButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
21
20
|
export declare const ModalFooterLeftSide: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -27,6 +26,6 @@ export declare const SearchWrapper: import("styled-components").StyledComponent<
|
|
|
27
26
|
export declare const RightSide: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
28
27
|
export declare const LeftSide: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
28
|
export declare const CreatorItemsList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
|
-
export declare const DeleteIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) =>
|
|
29
|
+
export declare const DeleteIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
|
|
31
30
|
export declare const CollectorWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
31
|
export declare const CreatorRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -22,12 +22,12 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
22
22
|
var _useState2 = useState(false),
|
|
23
23
|
localError = _useState2[0],
|
|
24
24
|
setLocalError = _useState2[1];
|
|
25
|
-
var handleChange = function handleChange(
|
|
25
|
+
var handleChange = function handleChange(inputKey, inputValue) {
|
|
26
26
|
var newValue = _extends({}, value);
|
|
27
|
-
newValue[
|
|
27
|
+
newValue[inputKey] = inputValue;
|
|
28
28
|
setLocalValue(newValue);
|
|
29
29
|
onChange(newValue);
|
|
30
|
-
if (!
|
|
30
|
+
if (!inputValue.length) {
|
|
31
31
|
setLocalError(true);
|
|
32
32
|
} else {
|
|
33
33
|
setLocalError(false);
|
|
@@ -51,7 +51,9 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
51
51
|
placeholder: texts.dynamicKey.keyPlaceholder,
|
|
52
52
|
value: localValue.key,
|
|
53
53
|
name: "key",
|
|
54
|
-
onChange:
|
|
54
|
+
onChange: function onChange(event) {
|
|
55
|
+
return handleChange('key', event.target.value);
|
|
56
|
+
},
|
|
55
57
|
autoFocus: opened,
|
|
56
58
|
onBlur: onDeactivate,
|
|
57
59
|
error: localError || error,
|
|
@@ -62,7 +64,9 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
62
64
|
placeholder: texts.dynamicKey.valuePlaceholder,
|
|
63
65
|
value: localValue.value,
|
|
64
66
|
name: "value",
|
|
65
|
-
onChange:
|
|
67
|
+
onChange: function onChange(event) {
|
|
68
|
+
return handleChange('value', event.target.value);
|
|
69
|
+
},
|
|
66
70
|
error: localError || error,
|
|
67
71
|
readOnly: readOnly
|
|
68
72
|
})));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
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, {
|
|
1
|
+
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) => React.JSX.Element, any, {
|
|
3
2
|
index: 0 | 1;
|
|
4
|
-
withoutTypeSelector?: boolean
|
|
3
|
+
withoutTypeSelector?: boolean;
|
|
5
4
|
}, never>;
|
|
6
5
|
export declare const DynamicKey: import("styled-components").StyledComponent<"div", any, {
|
|
7
6
|
withoutTypeSelector: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const FactorInput: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
withoutTypeSelector: boolean;
|
|
3
|
-
inputTextType?:
|
|
4
|
-
inputType?: string
|
|
3
|
+
inputTextType?: "autocomplete" | "default" | "expansible";
|
|
4
|
+
inputType?: string;
|
|
5
5
|
}, never>;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { VariableSizeList } from 'react-window';
|
|
3
2
|
import Button from '@synerise/ds-button';
|
|
4
3
|
export declare const TabsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
4
|
export declare const ContentPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
5
|
export declare const ItemsList: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
-
contentHeight?: number
|
|
6
|
+
contentHeight?: number;
|
|
8
7
|
}, never>;
|
|
9
8
|
export declare const SearchResult: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
10
9
|
export declare const SearchResultHighlight: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
10
|
export declare const Value: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
11
|
export declare const ParameterButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
13
12
|
export declare const StyledList: import("styled-components").StyledComponent<typeof VariableSizeList, any, {}, never>;
|
|
14
|
-
export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) =>
|
|
15
|
-
contentHeight?: number
|
|
13
|
+
export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) => React.JSX.Element, any, {
|
|
14
|
+
contentHeight?: number;
|
|
16
15
|
}, never>;
|
|
17
16
|
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
17
|
export declare const ShowMoreItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ParameterGroup, type ParameterItem } from '../../Factors.types';
|
|
3
3
|
import { type DropdownItem } from './Parameter.types';
|
|
4
|
-
declare const ParameterDropdownItem: <ItemType extends
|
|
4
|
+
declare const ParameterDropdownItem: <ItemType extends ParameterItem | ParameterGroup>({ item, clearSearch, searchQuery, hideDropdown, select, className, style, label, }: DropdownItem<ItemType>) => React.JSX.Element;
|
|
5
5
|
export default ParameterDropdownItem;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type ParameterGroup, type ParameterItem } from '../../Factors.types';
|
|
3
2
|
export declare const useGroups: (items?: ParameterItem[], groups?: ParameterGroup[], renderEmptyGroups?: boolean) => {
|
|
4
3
|
visibleGroups: ParameterGroup[] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ParameterGroup } from 'Factors.types';
|
|
1
|
+
import { type ParameterGroup } from '../../Factors.types';
|
|
2
2
|
import { type DropdownItem } from './Parameter.types';
|
|
3
3
|
import { type DividerItem, type TitleItem } from './ParameterDropdown';
|
|
4
4
|
export declare const groupItems: (dropdownItems: DropdownItem<ParameterGroup>[], activeGroup: ParameterGroup | undefined) => (DropdownItem<ParameterGroup> | TitleItem | DividerItem)[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const getTranslation: (texts:
|
|
1
|
+
import { type RelativeDateFactorTexts, type RelativeDateFactorTextsString, type RelativeDateValueType } from '../../Factors.types';
|
|
2
|
+
export declare const getTranslation: (texts: RelativeDateFactorTextsString, key: string) => string;
|
|
3
3
|
export declare const defaultTriggerModifier: (value: RelativeDateValueType, texts: RelativeDateFactorTexts) => string;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { RelativeDateKeysString } from '../../Factors.types';
|
|
2
|
+
var isTextsKey = function isTextsKey(key) {
|
|
3
|
+
return [].concat(RelativeDateKeysString).includes(key);
|
|
4
|
+
};
|
|
1
5
|
export var getTranslation = function getTranslation(texts, key) {
|
|
2
|
-
|
|
6
|
+
var lowercaseKey = key.toLowerCase();
|
|
7
|
+
return isTextsKey(lowercaseKey) ? texts[lowercaseKey] : key;
|
|
3
8
|
};
|
|
4
9
|
export var defaultTriggerModifier = function defaultTriggerModifier(value, texts) {
|
|
5
10
|
var relation = value.temporalModifier < 0 ? texts.before : texts.after;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const RelativeDateDropdownWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const RelativeDateDropdownFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const RelativeDateCurrentLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
4
|
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const ClearIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) =>
|
|
7
|
-
export declare const ChevronIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) =>
|
|
8
|
-
export declare const Trigger: 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) =>
|
|
5
|
+
export declare const ClearIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
|
|
6
|
+
export declare const ChevronIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
|
|
7
|
+
export declare const Trigger: 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) => React.JSX.Element, any, {}, never>;
|
package/dist/Factors.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DefinedFactorTypes, type FactorsProps, type SelectedFactorType } from './Factors.types';
|
|
3
|
+
export declare const DEFAULT_FACTOR_TYPE: DefinedFactorTypes;
|
|
3
4
|
export declare const FACTOR_TYPE_MAPPING: Record<DefinedFactorTypes, SelectedFactorType>;
|
|
4
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, getMenuEntryProps, }: FactorsProps) => React.JSX.Element;
|
|
5
6
|
export default Factors;
|
package/dist/Factors.js
CHANGED
|
@@ -15,6 +15,7 @@ import RelativeDateInput from './FactorValue/RelativeDate/RelativeDate';
|
|
|
15
15
|
import TextInput from './FactorValue/Text/Text';
|
|
16
16
|
import { useTexts } from './hooks/useTexts';
|
|
17
17
|
import * as S from './style/Factors.style';
|
|
18
|
+
export var DEFAULT_FACTOR_TYPE = 'text';
|
|
18
19
|
export var FACTOR_TYPE_MAPPING = {
|
|
19
20
|
text: {
|
|
20
21
|
icon: /*#__PURE__*/React.createElement(TextM, null),
|
|
@@ -67,6 +68,9 @@ export var FACTOR_TYPE_MAPPING = {
|
|
|
67
68
|
component: DateRangeInput
|
|
68
69
|
}
|
|
69
70
|
};
|
|
71
|
+
var isDefinedFactorType = function isDefinedFactorType(type) {
|
|
72
|
+
return FACTOR_TYPE_MAPPING[type] !== undefined;
|
|
73
|
+
};
|
|
70
74
|
var Factors = function Factors(_ref) {
|
|
71
75
|
var selectedFactorType = _ref.selectedFactorType,
|
|
72
76
|
_ref$setSelectedFacto = _ref.setSelectedFactorType,
|
|
@@ -77,7 +81,7 @@ var Factors = function Factors(_ref) {
|
|
|
77
81
|
_ref$defaultFactorTyp = _ref.defaultFactorType,
|
|
78
82
|
defaultFactorType = _ref$defaultFactorTyp === void 0 ? 'text' : _ref$defaultFactorTyp,
|
|
79
83
|
_ref$textType = _ref.textType,
|
|
80
|
-
textType = _ref$textType === void 0 ? '
|
|
84
|
+
textType = _ref$textType === void 0 ? 'default' : _ref$textType,
|
|
81
85
|
unavailableFactorTypes = _ref.unavailableFactorTypes,
|
|
82
86
|
availableFactorTypes = _ref.availableFactorTypes,
|
|
83
87
|
parameters = _ref.parameters,
|
|
@@ -111,7 +115,8 @@ var Factors = function Factors(_ref) {
|
|
|
111
115
|
var type = _ref2[0],
|
|
112
116
|
factorTypeData = _ref2[1];
|
|
113
117
|
var mergedData = customFactorValueComponents ? _extends({}, factorTypeData, customFactorValueComponents[type]) : factorTypeData;
|
|
114
|
-
|
|
118
|
+
var dataTuple = [type, _extends({}, factorTypeData, mergedData)];
|
|
119
|
+
return dataTuple;
|
|
115
120
|
}).reduce(function (result, _ref3) {
|
|
116
121
|
var type = _ref3[0],
|
|
117
122
|
factorTypeData = _ref3[1];
|
|
@@ -120,7 +125,7 @@ var Factors = function Factors(_ref) {
|
|
|
120
125
|
}, {});
|
|
121
126
|
}, [customFactorValueComponents]);
|
|
122
127
|
var selectedFactorData = useMemo(function () {
|
|
123
|
-
return mergedFactorData[factorType];
|
|
128
|
+
return mergedFactorData[isDefinedFactorType(factorType) ? factorType : DEFAULT_FACTOR_TYPE];
|
|
124
129
|
}, [mergedFactorData, factorType]);
|
|
125
130
|
return /*#__PURE__*/React.createElement(S.Group, {
|
|
126
131
|
resetMargin: true,
|
package/dist/Factors.types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { ArrayValueElement } from './FactorValue/Array/Array.types';
|
|
|
12
12
|
export declare const ALL_FACTOR_TYPES: readonly ["text", "number", "parameter", "contextParameter", "dynamicKey", "formula", "array", "date", "relativeDate", "dateRange"];
|
|
13
13
|
export type FactorType = LiteralStringUnion<(typeof ALL_FACTOR_TYPES)[number]>;
|
|
14
14
|
export type DefinedFactorTypes = (typeof ALL_FACTOR_TYPES)[number];
|
|
15
|
+
export type TupleType = [DefinedFactorTypes, SelectedFactorType];
|
|
15
16
|
export type RelativeDateUnit = Exclude<RelativeUnits, 'SINCE'>;
|
|
16
17
|
export type RelativeTimeRelation = 'BEFORE' | 'AFTER';
|
|
17
18
|
export type RelativeDateValueType = {
|
|
@@ -62,21 +63,13 @@ export type SelectedFactorType = {
|
|
|
62
63
|
icon: ReactNode;
|
|
63
64
|
component: ComponentType<FactorValueComponentProps>;
|
|
64
65
|
};
|
|
65
|
-
export
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
days: string;
|
|
73
|
-
weeks: string;
|
|
74
|
-
months: string;
|
|
75
|
-
years: string;
|
|
76
|
-
before: string;
|
|
77
|
-
after: string;
|
|
78
|
-
apply: ReactNode;
|
|
79
|
-
cancel: ReactNode;
|
|
66
|
+
export declare const RelativeDateKeysString: readonly ["triggerValue", "triggerPlaceholder", "seconds", "minutes", "hours", "days", "weeks", "months", "years", "before", "after"];
|
|
67
|
+
export declare const RelativeDateKeysReactNode: readonly ["currentDatetime", "apply", "cancel"];
|
|
68
|
+
export type RelativeDateFactorTextsString = {
|
|
69
|
+
[K in (typeof RelativeDateKeysString)[number]]: string;
|
|
70
|
+
};
|
|
71
|
+
export type RelativeDateFactorTexts = RelativeDateFactorTextsString & {
|
|
72
|
+
[K in (typeof RelativeDateKeysReactNode)[number]]: ReactNode;
|
|
80
73
|
};
|
|
81
74
|
export type FactorsTexts = {
|
|
82
75
|
dateRangePicker: DateRangeTexts;
|
|
@@ -135,6 +128,7 @@ export type FactorsTexts = {
|
|
|
135
128
|
};
|
|
136
129
|
};
|
|
137
130
|
export type FactorTypeMapping = Record<DefinedFactorTypes, Partial<SelectedFactorType>>;
|
|
131
|
+
export type MergedFactorTypeMapping = Record<DefinedFactorTypes, SelectedFactorType>;
|
|
138
132
|
type InputPropKeys = 'icon1' | 'icon1Tooltip' | 'icon2' | 'icon2Tooltip';
|
|
139
133
|
export type ExtraPropsMapping = {
|
|
140
134
|
text: {
|
|
@@ -169,7 +163,7 @@ export type FactorsProps = {
|
|
|
169
163
|
onChangeValue: (value: FactorValueType) => void;
|
|
170
164
|
value: FactorValueType;
|
|
171
165
|
arrayProps?: ArrayProps;
|
|
172
|
-
textType?:
|
|
166
|
+
textType?: 'autocomplete' | 'expansible' | 'default';
|
|
173
167
|
autoResize?: AutoResizeProp;
|
|
174
168
|
relativeDateProps?: {
|
|
175
169
|
triggerValueFormatter?: (value: RelativeDateValueType) => string;
|
package/dist/Factors.types.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export var ALL_FACTOR_TYPES = ['text', 'number', 'parameter', 'contextParameter', 'dynamicKey', 'formula', 'array', 'date', 'relativeDate', 'dateRange'];
|
|
1
|
+
export var ALL_FACTOR_TYPES = ['text', 'number', 'parameter', 'contextParameter', 'dynamicKey', 'formula', 'array', 'date', 'relativeDate', 'dateRange'];
|
|
2
|
+
export var RelativeDateKeysString = ['triggerValue', 'triggerPlaceholder', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years', 'before', 'after'];
|
|
3
|
+
export var RelativeDateKeysReactNode = ['currentDatetime', 'apply', 'cancel'];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Group: import("styled-components").StyledComponent<({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: import("@synerise/ds-input/dist/InputGroup.types").Props) => import("react").JSX.Element, any, {
|
|
1
|
+
export declare const Group: import("styled-components").StyledComponent<({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: import("@synerise/ds-input/dist/InputGroup.types").Props) => React.JSX.Element, any, {
|
|
3
2
|
withoutTypeSelector: boolean;
|
|
4
3
|
}, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-alert": "^1.1.
|
|
38
|
-
"@synerise/ds-autocomplete": "^1.2.
|
|
39
|
-
"@synerise/ds-badge": "^1.0.
|
|
40
|
-
"@synerise/ds-button": "^1.4.
|
|
41
|
-
"@synerise/ds-button-group": "^1.1.
|
|
42
|
-
"@synerise/ds-collector": "^1.3.
|
|
43
|
-
"@synerise/ds-date-picker": "^1.2.
|
|
44
|
-
"@synerise/ds-date-range-picker": "^1.3.
|
|
45
|
-
"@synerise/ds-divider": "^1.0.
|
|
46
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
47
|
-
"@synerise/ds-empty-states": "^1.0.
|
|
48
|
-
"@synerise/ds-icon": "^1.6.
|
|
49
|
-
"@synerise/ds-information-card": "^1.0.
|
|
50
|
-
"@synerise/ds-inline-edit": "^1.0.
|
|
51
|
-
"@synerise/ds-input": "^1.3.
|
|
52
|
-
"@synerise/ds-input-number": "^1.2.
|
|
53
|
-
"@synerise/ds-list-item": "^1.0.
|
|
54
|
-
"@synerise/ds-menu": "^1.0.
|
|
55
|
-
"@synerise/ds-modal": "^1.2.
|
|
56
|
-
"@synerise/ds-result": "^1.0.
|
|
57
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
58
|
-
"@synerise/ds-search": "^1.2.
|
|
59
|
-
"@synerise/ds-select": "^1.1.
|
|
60
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
61
|
-
"@synerise/ds-tabs": "^1.0.
|
|
62
|
-
"@synerise/ds-tag": "^1.1.
|
|
63
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
64
|
-
"@synerise/ds-utils": "^1.
|
|
37
|
+
"@synerise/ds-alert": "^1.1.11",
|
|
38
|
+
"@synerise/ds-autocomplete": "^1.2.4",
|
|
39
|
+
"@synerise/ds-badge": "^1.0.17",
|
|
40
|
+
"@synerise/ds-button": "^1.4.6",
|
|
41
|
+
"@synerise/ds-button-group": "^1.1.10",
|
|
42
|
+
"@synerise/ds-collector": "^1.3.5",
|
|
43
|
+
"@synerise/ds-date-picker": "^1.2.2",
|
|
44
|
+
"@synerise/ds-date-range-picker": "^1.3.16",
|
|
45
|
+
"@synerise/ds-divider": "^1.0.17",
|
|
46
|
+
"@synerise/ds-dropdown": "^1.0.19",
|
|
47
|
+
"@synerise/ds-empty-states": "^1.0.15",
|
|
48
|
+
"@synerise/ds-icon": "^1.6.2",
|
|
49
|
+
"@synerise/ds-information-card": "^1.0.23",
|
|
50
|
+
"@synerise/ds-inline-edit": "^1.0.22",
|
|
51
|
+
"@synerise/ds-input": "^1.3.6",
|
|
52
|
+
"@synerise/ds-input-number": "^1.2.7",
|
|
53
|
+
"@synerise/ds-list-item": "^1.0.17",
|
|
54
|
+
"@synerise/ds-menu": "^1.0.18",
|
|
55
|
+
"@synerise/ds-modal": "^1.2.6",
|
|
56
|
+
"@synerise/ds-result": "^1.0.18",
|
|
57
|
+
"@synerise/ds-scrollbar": "^1.1.5",
|
|
58
|
+
"@synerise/ds-search": "^1.2.6",
|
|
59
|
+
"@synerise/ds-select": "^1.1.13",
|
|
60
|
+
"@synerise/ds-skeleton": "^1.0.18",
|
|
61
|
+
"@synerise/ds-tabs": "^1.0.20",
|
|
62
|
+
"@synerise/ds-tag": "^1.1.15",
|
|
63
|
+
"@synerise/ds-tooltip": "^1.1.15",
|
|
64
|
+
"@synerise/ds-utils": "^1.4.0",
|
|
65
65
|
"copy-to-clipboard": "^3.3.3",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
67
|
"react-window": "^1.8.5",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
75
75
|
"styled-components": "^5.3.3"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "b35b1875727156fe9f5b3bad55aed5ca447c8c8d"
|
|
78
78
|
}
|