@synerise/ds-factors 1.5.7 → 1.5.9
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 +19 -0
- package/dist/FactorValue/Array/Array.types.d.ts +1 -2
- package/dist/FactorValue/Array/Array.utils.d.ts +2 -1
- package/dist/FactorValue/Number/NumberInput.js +6 -0
- package/dist/FactorValue/Parameter/Parameter.types.d.ts +7 -0
- package/dist/FactorValue/Parameter/ParameterDropdown.d.ts +0 -7
- package/dist/FactorValue/Parameter/ParameterDropdown.js +1 -7
- package/dist/FactorValue/Parameter/utils.d.ts +3 -2
- package/dist/FactorValue/Parameter/utils.js +6 -0
- package/dist/FactorValue/Text/Text.js +6 -0
- package/dist/Factors.types.d.ts +1 -1
- package/package.json +31 -30
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.5.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.5.8...@synerise/ds-factors@1.5.9) (2025-09-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add value clearing on factory type change ([a5ab3e1](https://github.com/Synerise/synerise-design/commit/a5ab3e1046201d26a88c3ca4c04bede7450ca4ae))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.5.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.5.7...@synerise/ds-factors@1.5.8) (2025-09-16)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.5.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@1.5.6...@synerise/ds-factors@1.5.7) (2025-09-05)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { RequiredProps } from '@synerise/ds-utils';
|
|
3
|
-
import type { ArrayProps, FactorsTexts } from '../../Factors.types';
|
|
3
|
+
import type { ArrayProps, ArrayValueElement, FactorsTexts } from '../../Factors.types';
|
|
4
4
|
export type ArrayModalProps<ItemType extends 'string' | 'number'> = RequiredProps<ArrayProps, 'itemType'> & {
|
|
5
5
|
visible?: boolean;
|
|
6
6
|
readOnly?: boolean;
|
|
@@ -9,7 +9,6 @@ export type ArrayModalProps<ItemType extends 'string' | 'number'> = RequiredProp
|
|
|
9
9
|
texts: FactorsTexts;
|
|
10
10
|
value?: ArrayValueElement<ItemType>[];
|
|
11
11
|
};
|
|
12
|
-
export type ArrayValueElement<ItemType extends 'string' | 'number'> = ItemType extends 'number' ? number : string;
|
|
13
12
|
export type ArrayValueWithID<ItemType extends 'string' | 'number'> = {
|
|
14
13
|
value: ArrayValueElement<ItemType>;
|
|
15
14
|
id: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ArrayValueElement
|
|
1
|
+
import { type ArrayValueElement } from '../../Factors.types';
|
|
2
|
+
import { type ArrayValueWithID } from './Array.types';
|
|
2
3
|
export declare const matchesSearchQuery: (item: string | number, searchQuery: string) => boolean;
|
|
3
4
|
export declare const arrayWithUUID: <ItemType extends "string" | "number">(items: ArrayValueElement<ItemType>[]) => ArrayValueWithID<ItemType>[];
|
|
4
5
|
export declare const sanitiseValues: (element: string) => string;
|
|
@@ -20,6 +20,12 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
20
20
|
setLocalValue(value);
|
|
21
21
|
}
|
|
22
22
|
}, [value, uncontrolledComponent]);
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
if (uncontrolledComponent && !value && localValue !== value) {
|
|
25
|
+
setLocalValue(value);
|
|
26
|
+
}
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, [value, uncontrolledComponent]);
|
|
23
29
|
var handleChange = function handleChange(val) {
|
|
24
30
|
setLocalValue(val);
|
|
25
31
|
onChange(val);
|
|
@@ -16,3 +16,10 @@ export type ParameterDropdownTitleProps = {
|
|
|
16
16
|
type?: string;
|
|
17
17
|
};
|
|
18
18
|
export type MixedDropdownItemProps = DropdownItemProps<ParameterItem> | DropdownItemProps<ParameterGroup>;
|
|
19
|
+
export type TitleItem = {
|
|
20
|
+
type: 'title';
|
|
21
|
+
title: string;
|
|
22
|
+
};
|
|
23
|
+
export type DividerItem = {
|
|
24
|
+
type: 'divider';
|
|
25
|
+
};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ParameterDropdownProps } from '../../Factors.types';
|
|
3
|
-
export type TitleItem = {
|
|
4
|
-
type: 'title';
|
|
5
|
-
title: string;
|
|
6
|
-
};
|
|
7
|
-
export type DividerItem = {
|
|
8
|
-
type: 'divider';
|
|
9
|
-
};
|
|
10
3
|
declare const ParameterDropdown: ({ setSelected, texts, groups, items, recentItems, setDropdownVisible, loading, onFetchData, hasMoreItems, outerHeight, value, renderEmptyGroups, maxSearchResultsInGroup, }: ParameterDropdownProps) => React.JSX.Element;
|
|
11
4
|
export default ParameterDropdown;
|
|
@@ -14,13 +14,7 @@ import { DROPDOWN_HEIGHT, ITEM_SIZE, LIST_STYLE, NO_GROUP_NAME, SEARCH_HEGIHT, S
|
|
|
14
14
|
import * as S from './Parameter.style';
|
|
15
15
|
import ParameterDropdownItem from './ParameterDropdownItem';
|
|
16
16
|
import { useGroups } from './useGroups';
|
|
17
|
-
import { groupItems } from './utils';
|
|
18
|
-
var isListTitle = function isListTitle(element) {
|
|
19
|
-
return element.title !== undefined;
|
|
20
|
-
};
|
|
21
|
-
var isDivider = function isDivider(item) {
|
|
22
|
-
return item.type === 'divider';
|
|
23
|
-
};
|
|
17
|
+
import { groupItems, isDivider, isListTitle } from './utils';
|
|
24
18
|
var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
25
19
|
var setSelected = _ref.setSelected,
|
|
26
20
|
texts = _ref.texts,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ParameterGroup } from '../../Factors.types';
|
|
2
|
-
import { type DropdownItem } from './Parameter.types';
|
|
3
|
-
import { type DividerItem, type TitleItem } from './ParameterDropdown';
|
|
2
|
+
import { type DividerItem, type DropdownItem, type MixedDropdownItemProps, type ParameterDropdownTitleProps, type TitleItem } from './Parameter.types';
|
|
4
3
|
export declare const groupItems: (dropdownItems: DropdownItem<ParameterGroup>[], activeGroup: ParameterGroup | undefined) => (DropdownItem<ParameterGroup> | TitleItem | DividerItem)[];
|
|
4
|
+
export declare const isListTitle: (element?: MixedDropdownItemProps) => element is ParameterDropdownTitleProps;
|
|
5
|
+
export declare const isDivider: (item: MixedDropdownItemProps | TitleItem | DividerItem) => item is DividerItem;
|
|
@@ -25,4 +25,10 @@ export var groupItems = function groupItems(dropdownItems, activeGroup) {
|
|
|
25
25
|
resultItems = resultItems.concat(groupedItems[key]);
|
|
26
26
|
});
|
|
27
27
|
return resultItems;
|
|
28
|
+
};
|
|
29
|
+
export var isListTitle = function isListTitle(element) {
|
|
30
|
+
return element.title !== undefined;
|
|
31
|
+
};
|
|
32
|
+
export var isDivider = function isDivider(item) {
|
|
33
|
+
return item.type === 'divider';
|
|
28
34
|
};
|
|
@@ -66,6 +66,12 @@ var TextInput = function TextInput(_ref) {
|
|
|
66
66
|
setLocalValue(value);
|
|
67
67
|
}
|
|
68
68
|
}, [value, uncontrolledComponent]);
|
|
69
|
+
useEffect(function () {
|
|
70
|
+
if (uncontrolledComponent && !value && localValue !== value) {
|
|
71
|
+
setLocalValue(value);
|
|
72
|
+
}
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
+
}, [value, uncontrolledComponent]);
|
|
69
75
|
var autocompleteOptions = useMemo(function () {
|
|
70
76
|
return autocompleteText && autocompleteText.options.filter(function (option) {
|
|
71
77
|
return option.toLowerCase().includes(String(localValue).toLowerCase());
|
package/dist/Factors.types.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type { AutoResizeProp, InputProps } from '@synerise/ds-input';
|
|
|
8
8
|
import type { ListItemProps } from '@synerise/ds-list-item';
|
|
9
9
|
import type { MenuItemProps } from '@synerise/ds-menu';
|
|
10
10
|
import type { DeepPartial, LiteralStringUnion } from '@synerise/ds-utils';
|
|
11
|
-
import type { ArrayValueElement } from './FactorValue/Array/Array.types';
|
|
12
11
|
export declare const ALL_FACTOR_TYPES: readonly ["text", "number", "parameter", "contextParameter", "dynamicKey", "formula", "array", "date", "relativeDate", "dateRange"];
|
|
13
12
|
export type FactorType = LiteralStringUnion<(typeof ALL_FACTOR_TYPES)[number]>;
|
|
14
13
|
export type DefinedFactorTypes = (typeof ALL_FACTOR_TYPES)[number];
|
|
@@ -250,4 +249,5 @@ export type FormulaModalProps = {
|
|
|
250
249
|
texts: FactorsTexts;
|
|
251
250
|
formulaEditor?: ReactNode;
|
|
252
251
|
};
|
|
252
|
+
export type ArrayValueElement<ItemType extends 'string' | 'number'> = ItemType extends 'number' ? number : string;
|
|
253
253
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.9",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"test": "jest",
|
|
27
27
|
"test:watch": "npm run test -- --watchAll",
|
|
28
28
|
"types": "tsc --noEmit",
|
|
29
|
+
"check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
|
|
29
30
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
30
31
|
},
|
|
31
32
|
"sideEffects": [
|
|
@@ -34,34 +35,34 @@
|
|
|
34
35
|
],
|
|
35
36
|
"types": "dist/index.d.ts",
|
|
36
37
|
"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.7.
|
|
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.3.
|
|
59
|
-
"@synerise/ds-select": "^1.1.
|
|
60
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
61
|
-
"@synerise/ds-tabs": "^1.0.
|
|
62
|
-
"@synerise/ds-tag": "^1.
|
|
63
|
-
"@synerise/ds-tooltip": "^1.
|
|
64
|
-
"@synerise/ds-utils": "^1.4.
|
|
38
|
+
"@synerise/ds-alert": "^1.1.18",
|
|
39
|
+
"@synerise/ds-autocomplete": "^1.2.8",
|
|
40
|
+
"@synerise/ds-badge": "^1.0.22",
|
|
41
|
+
"@synerise/ds-button": "^1.4.11",
|
|
42
|
+
"@synerise/ds-button-group": "^1.1.15",
|
|
43
|
+
"@synerise/ds-collector": "^1.3.10",
|
|
44
|
+
"@synerise/ds-date-picker": "^1.2.7",
|
|
45
|
+
"@synerise/ds-date-range-picker": "^1.3.24",
|
|
46
|
+
"@synerise/ds-divider": "^1.0.21",
|
|
47
|
+
"@synerise/ds-dropdown": "^1.0.23",
|
|
48
|
+
"@synerise/ds-empty-states": "^1.0.18",
|
|
49
|
+
"@synerise/ds-icon": "^1.7.2",
|
|
50
|
+
"@synerise/ds-information-card": "^1.1.0",
|
|
51
|
+
"@synerise/ds-inline-edit": "^1.0.27",
|
|
52
|
+
"@synerise/ds-input": "^1.3.10",
|
|
53
|
+
"@synerise/ds-input-number": "^1.2.11",
|
|
54
|
+
"@synerise/ds-list-item": "^1.0.21",
|
|
55
|
+
"@synerise/ds-menu": "^1.0.23",
|
|
56
|
+
"@synerise/ds-modal": "^1.2.11",
|
|
57
|
+
"@synerise/ds-result": "^1.0.24",
|
|
58
|
+
"@synerise/ds-scrollbar": "^1.1.8",
|
|
59
|
+
"@synerise/ds-search": "^1.3.2",
|
|
60
|
+
"@synerise/ds-select": "^1.1.18",
|
|
61
|
+
"@synerise/ds-skeleton": "^1.0.22",
|
|
62
|
+
"@synerise/ds-tabs": "^1.0.25",
|
|
63
|
+
"@synerise/ds-tag": "^1.2.0",
|
|
64
|
+
"@synerise/ds-tooltip": "^1.2.0",
|
|
65
|
+
"@synerise/ds-utils": "^1.4.2",
|
|
65
66
|
"copy-to-clipboard": "^3.3.3",
|
|
66
67
|
"lodash": "^4.17.21",
|
|
67
68
|
"react-window": "^1.8.11",
|
|
@@ -74,5 +75,5 @@
|
|
|
74
75
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
75
76
|
"styled-components": "^5.3.3"
|
|
76
77
|
},
|
|
77
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "5029af8713235b315d36bb3c73363f2feca86da0"
|
|
78
79
|
}
|