@synerise/ds-factors 0.23.7 → 0.25.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
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
+ # [0.25.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.24.0...@synerise/ds-factors@0.25.0) (2024-09-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **storybook7:** added filter stories ([eb4f165](https://github.com/Synerise/synerise-design/commit/eb4f165077eac361d4c4e4deab48842edd191825))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.24.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.23.7...@synerise/ds-factors@0.24.0) (2024-08-30)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **context-selector:** reuse renderHoverTooltip for selected item ([57e8a14](https://github.com/Synerise/synerise-design/commit/57e8a148e70bccd54c6d4540fb36c14d492f110b))
23
+
24
+
25
+ ### Features
26
+
27
+ * **storybook7:** condition stories ([50c3613](https://github.com/Synerise/synerise-design/commit/50c36138dfd1097fe3b1182047eded4bbea584e9))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [0.23.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.23.6...@synerise/ds-factors@0.23.7) (2024-08-27)
7
34
 
8
35
 
@@ -45,6 +45,7 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
45
45
  var trigger = /*#__PURE__*/React.createElement(S.TriggerButton, {
46
46
  mode: "single-icon",
47
47
  className: "ds-factors-type-selector",
48
+ "data-testid": "ds-factors-type-selector",
48
49
  readOnly: readOnly
49
50
  }, /*#__PURE__*/React.createElement(Icon, {
50
51
  component: selectedFactor.icon
@@ -119,7 +119,7 @@ var ParameterInput = function ParameterInput(_ref) {
119
119
  popupPlacement: 'top',
120
120
  getPopupContainer: getPopupContainerOverride || getPopupContainer
121
121
  },
122
- renderHoverTooltip: parameter != null && parameter.name ? function () {
122
+ renderHoverTooltip: isSelected ? (parameter == null ? void 0 : parameter.renderHoverTooltip) || function () {
123
123
  var _parameter$id;
124
124
 
125
125
  return /*#__PURE__*/React.createElement(InformationCard, _extends({
@@ -171,6 +171,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
171
171
  };
172
172
 
173
173
  return /*#__PURE__*/React.createElement(Dropdown.Wrapper, {
174
+ "data-testid": "ds-factors-parameter-dropdown-wrapper",
174
175
  style: {
175
176
  width: '300px'
176
177
  },
@@ -18,7 +18,7 @@ var ParameterDropdownItem = function ParameterDropdownItem(_ref) {
18
18
  style = _ref.style;
19
19
 
20
20
  var id = item.id,
21
- _ = item.icon,
21
+ icon = item.icon,
22
22
  itemProps = _objectWithoutPropertiesLoose(item, _excluded);
23
23
 
24
24
  return /*#__PURE__*/React.createElement(ListItem, _extends({}, itemProps, {
@@ -26,7 +26,7 @@ var ParameterDropdownItem = function ParameterDropdownItem(_ref) {
26
26
  className: className,
27
27
  key: item.name + item.id,
28
28
  prefixel: /*#__PURE__*/React.createElement(Icon, {
29
- component: item.icon
29
+ component: icon
30
30
  }),
31
31
  highlight: searchQuery,
32
32
  onClick: function onClick() {
@@ -1,48 +1,49 @@
1
- import * as React from 'react';
2
- import { DateFilter } from '@synerise/ds-date-range-picker/dist/date.types';
3
- import { Texts as DateRangeTexts } from '@synerise/ds-date-range-picker/dist/DateRangePicker.types';
1
+ import type { ReactText, ReactNode, ElementType } from 'react';
2
+ import type { DateFilter } from '@synerise/ds-date-range-picker/dist/date.types';
3
+ import type { Texts as DateRangeTexts } from '@synerise/ds-date-range-picker/dist/DateRangePicker.types';
4
4
  import type { MenuItemProps } from '@synerise/ds-menu';
5
5
  import type { AutoResizeProp } from '@synerise/ds-input';
6
- import { InformationCardProps } from '@synerise/ds-information-card';
6
+ import type { InformationCardProps } from '@synerise/ds-information-card';
7
+ import type { ListItemProps } from '@synerise/ds-list-item';
7
8
  export declare const ALL_FACTOR_TYPES: readonly ["text", "number", "parameter", "contextParameter", "dynamicKey", "formula", "array", "date", "dateRange"];
8
9
  export type FactorType = typeof ALL_FACTOR_TYPES[number] | string;
9
10
  export type DefinedFactorTypes = typeof ALL_FACTOR_TYPES[number];
10
11
  export type DynamicKeyValueType = {
11
- key: React.ReactText;
12
- value: React.ReactText;
12
+ key: ReactText;
13
+ value: ReactText;
13
14
  };
14
15
  export type FormulaValueType = {
15
16
  name: string;
16
17
  value: string;
17
18
  };
18
- export type ParameterValueType = {
19
+ export type ParameterValueType = Pick<ListItemProps, 'renderHoverTooltip' | 'hoverTooltipProps' | 'disabled'> & {
19
20
  type: string;
20
- icon: React.ReactNode;
21
+ icon: ReactNode;
21
22
  name: string;
22
- id: React.ReactText;
23
- groupId?: React.ReactText;
23
+ id: ReactText;
24
+ groupId?: ReactText;
24
25
  description?: string;
25
26
  informationCardProps?: Partial<InformationCardProps>;
26
27
  };
27
28
  export type ParameterGroup = {
28
- id: React.ReactText;
29
+ id: ReactText;
29
30
  name: string;
30
31
  defaultGroup?: boolean;
31
- icon?: React.ReactNode;
32
+ icon?: ReactNode;
32
33
  subGroups?: ParameterGroup[];
33
34
  };
34
35
  export type ParameterItem = {
35
- id: React.ReactText;
36
+ id: ReactText;
36
37
  name: string;
37
- groupId: React.ReactText;
38
- icon?: React.ReactNode;
38
+ groupId: ReactText;
39
+ icon?: ReactNode;
39
40
  disabled?: boolean;
40
41
  };
41
42
  export type FactorValueType = string | number | Date | undefined | DynamicKeyValueType | FormulaValueType | ParameterValueType | Partial<DateFilter>;
42
43
  export type SelectedFactorType = {
43
44
  name: string;
44
- icon: React.ReactNode;
45
- input: React.ElementType;
45
+ icon: ReactNode;
46
+ input: ElementType;
46
47
  };
47
48
  export type FactorsTexts = {
48
49
  dateRangePicker: Partial<DateRangeTexts>;
@@ -74,9 +75,9 @@ export type FactorsTexts = {
74
75
  };
75
76
  };
76
77
  export type FactorsProps = {
77
- factorKey?: React.ReactText;
78
+ factorKey?: ReactText;
78
79
  error?: boolean;
79
- errorText?: React.ReactNode | string;
80
+ errorText?: ReactNode;
80
81
  withoutTypeSelector?: boolean;
81
82
  setSelectedFactorType?: (factor: FactorType) => void;
82
83
  unavailableFactorTypes?: FactorType[];
@@ -94,20 +95,20 @@ export type FactorsProps = {
94
95
  options: string[];
95
96
  };
96
97
  parameters?: {
97
- buttonLabel: string | React.ReactNode;
98
- buttonIcon: React.ReactNode;
98
+ buttonLabel: ReactNode;
99
+ buttonIcon: ReactNode;
99
100
  selectedButtonColored?: boolean;
100
101
  groups?: ParameterGroup[];
101
102
  items: ParameterItem[];
102
103
  showAllGroup?: boolean;
103
104
  };
104
105
  onParamsClick?: () => void;
105
- formulaEditor?: React.ReactNode;
106
+ formulaEditor?: ReactNode;
106
107
  texts?: Partial<FactorsTexts>;
107
108
  opened?: boolean;
108
109
  loading?: boolean;
109
110
  preventAutoloadData?: boolean;
110
- withCustomFactor?: React.ReactNode;
111
+ withCustomFactor?: ReactNode;
111
112
  inputProps?: Partial<InputProps>;
112
113
  readOnly?: boolean;
113
114
  getMenuEntryProps?: (arg?: ParameterValueType) => MenuItemProps;
@@ -128,7 +129,7 @@ export type InputProps = Pick<FactorsProps, 'value' | 'parameters' | 'autocomple
128
129
  onChange: (value: FactorValueType) => void;
129
130
  factorType: FactorType;
130
131
  onParamsClick?: () => void;
131
- formulaEditor?: React.ReactNode;
132
+ formulaEditor?: ReactNode;
132
133
  loading?: boolean;
133
134
  preventAutoloadData?: boolean;
134
135
  };
@@ -155,5 +156,5 @@ export type FormulaModalProps = {
155
156
  visible: boolean;
156
157
  onCancel: () => void;
157
158
  texts: FactorsTexts;
158
- formulaEditor?: React.ReactNode;
159
+ formulaEditor?: ReactNode;
159
160
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { default, factorTypes } from './Factors';
2
2
  export { ALL_FACTOR_TYPES } from './Factors.types';
3
- export type { FactorsProps, ParameterValueType, InputProps } from './Factors.types';
3
+ export type { FactorsProps, ParameterValueType, InputProps, FactorValueType } from './Factors.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-factors",
3
- "version": "0.23.7",
3
+ "version": "0.25.0",
4
4
  "description": "Factors UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,26 +33,26 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-autocomplete": "^0.8.14",
37
- "@synerise/ds-badge": "^0.8.5",
38
- "@synerise/ds-button": "^0.21.6",
39
- "@synerise/ds-date-picker": "^0.11.12",
40
- "@synerise/ds-date-range-picker": "^0.29.7",
41
- "@synerise/ds-dropdown": "^0.18.10",
42
- "@synerise/ds-icon": "^0.65.1",
43
- "@synerise/ds-information-card": "^0.5.4",
44
- "@synerise/ds-inline-edit": "^0.8.6",
45
- "@synerise/ds-input": "^0.24.0",
46
- "@synerise/ds-input-number": "^0.10.1",
47
- "@synerise/ds-list-item": "^0.4.6",
48
- "@synerise/ds-menu": "^0.19.10",
49
- "@synerise/ds-modal": "^0.17.37",
50
- "@synerise/ds-result": "^0.7.0",
51
- "@synerise/ds-scrollbar": "^0.11.6",
52
- "@synerise/ds-skeleton": "^0.6.5",
53
- "@synerise/ds-tabs": "^0.15.3",
54
- "@synerise/ds-tooltip": "^0.14.36",
55
- "@synerise/ds-utils": "^0.28.2",
36
+ "@synerise/ds-autocomplete": "^0.8.16",
37
+ "@synerise/ds-badge": "^0.8.7",
38
+ "@synerise/ds-button": "^0.21.8",
39
+ "@synerise/ds-date-picker": "^0.11.14",
40
+ "@synerise/ds-date-range-picker": "^0.29.9",
41
+ "@synerise/ds-dropdown": "^0.18.12",
42
+ "@synerise/ds-icon": "^0.65.3",
43
+ "@synerise/ds-information-card": "^0.5.6",
44
+ "@synerise/ds-inline-edit": "^0.8.8",
45
+ "@synerise/ds-input": "^0.24.2",
46
+ "@synerise/ds-input-number": "^0.10.3",
47
+ "@synerise/ds-list-item": "^0.4.8",
48
+ "@synerise/ds-menu": "^0.19.12",
49
+ "@synerise/ds-modal": "^0.17.39",
50
+ "@synerise/ds-result": "^0.7.2",
51
+ "@synerise/ds-scrollbar": "^0.11.8",
52
+ "@synerise/ds-skeleton": "^0.6.6",
53
+ "@synerise/ds-tabs": "^0.15.5",
54
+ "@synerise/ds-tooltip": "^0.14.38",
55
+ "@synerise/ds-utils": "^0.29.0",
56
56
  "lodash": "^4.17.19",
57
57
  "react-intl": "3.12.0",
58
58
  "react-window": "1.8.5",
@@ -64,5 +64,5 @@
64
64
  "react": ">=16.9.0 <= 17.0.2",
65
65
  "styled-components": "5.0.1"
66
66
  },
67
- "gitHead": "a035aeea499cea00e72e20e3790c0ffcad4fe956"
67
+ "gitHead": "6fe94d574f25c5267c7593dec9399527f441b23a"
68
68
  }