@synerise/ds-operators 1.0.15 → 1.0.16

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/README.md CHANGED
@@ -6,6 +6,7 @@ title: Operators
6
6
  Operators UI Component
7
7
 
8
8
  ## Installation
9
+
9
10
  ```
10
11
  npm i @synerise/ds-operators
11
12
  or
@@ -13,6 +14,7 @@ yarn add @synerise/ds-operators
13
14
  ```
14
15
 
15
16
  ## Usage
17
+
16
18
  ```
17
19
  import Operators from '@synerise/ds-operators'
18
20
 
@@ -77,22 +79,22 @@ import Operators from '@synerise/ds-operators'
77
79
  ## API
78
80
 
79
81
  | Property | Description | Type | Default |
80
- | --- | --- | --- | --- |
81
- | error | error validation | boolean | - |
82
- | getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement \ null) => HTMLElement; | - |
83
- | groups | Groups of operators | OperatorsGroup[] | [] |
84
- | items | Array of operators | OperatorsItem[] | [] |
85
- | onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
86
- | onChange | Callback called when user selects operator | (item: OperatorsItem \ OperatorsGroup \ undefined) => void | - |
87
- | onDeactivate | Callback called when user closes dropdown | () => void | - |
88
- | opened | Whether if dropdown should opens from outside of component | boolean | false |
89
- | texts | Translations object | OperatorTexts | - |
90
- | value | Selected operator | OperatorsItem \ undefined | undefined |
82
+ | ------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | --------- |
83
+ | error | error validation | boolean | - |
84
+ | getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement \ null) => HTMLElement; | - |
85
+ | groups | Groups of operators | OperatorsGroup[] | [] |
86
+ | items | Array of operators | OperatorsItem[] | [] |
87
+ | onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
88
+ | onChange | Callback called when user selects operator | (item: OperatorsItem \ OperatorsGroup \ undefined) => void | - |
89
+ | onDeactivate | Callback called when user closes dropdown | () => void | - |
90
+ | opened | Whether if dropdown should opens from outside of component | boolean | false |
91
+ | texts | Translations object | OperatorTexts | - |
92
+ | value | Selected operator | OperatorsItem \ undefined | undefined |
91
93
 
92
94
  ### OperatorsGroup
93
95
 
94
96
  | Property | Description | Type | Default |
95
- | --- | --- | --- | --- |
97
+ | ------------ | -------------------------------- | ---------------- | ------- |
96
98
  | defaultGroup | Whether if this group is default | boolean | false |
97
99
  | icon | Icon of group | React.ReactNode | - |
98
100
  | id | Id of group | React.ReactText | - |
@@ -104,7 +106,7 @@ import Operators from '@synerise/ds-operators'
104
106
  ### OperatorsItem
105
107
 
106
108
  | Property | Description | Type | Default |
107
- | --- | --- | --- | --- |
109
+ | --------- | --------------------- | ---------------- | ------- |
108
110
  | group | Group of item | string | - |
109
111
  | groupId | Id of group | React.ReactText | - |
110
112
  | groupName | Name of group | string | - |
@@ -118,7 +120,7 @@ import Operators from '@synerise/ds-operators'
118
120
  ### OperatorTexts
119
121
 
120
122
  | Property | Description | Type | Default |
121
- | --- | --- | --- | --- |
122
- | buttonLabel | Button label | 'Choose' |
123
- | noResults | No results info | 'No results' |
124
- | searchPlaceholder | Search box placeholder | 'Search' |
123
+ | ----------------- | ---------------------- | ------------ | ------- |
124
+ | buttonLabel | Button label | 'Choose' |
125
+ | noResults | No results info | 'No results' |
126
+ | searchPlaceholder | Search box placeholder | 'Search' |
@@ -1,4 +1,4 @@
1
- import { ReactNode, ReactText } from 'react';
1
+ import { type ReactNode, type ReactText } from 'react';
2
2
  export type OperatorTexts = {
3
3
  buttonLabel: string;
4
4
  searchPlaceholder: string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { OperatorsProps } from './Operator.types';
2
+ import { type OperatorsProps } from './Operator.types';
3
3
  declare const Operators: ({ value, onChange, groups, items, texts, opened, getPopupContainerOverride, onActivate, onDeactivate, readOnly, errorText, dropdownDimensionsConfig, }: OperatorsProps) => React.JSX.Element;
4
4
  export default Operators;
package/dist/Operators.js CHANGED
@@ -2,12 +2,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { useIntl } from 'react-intl';
4
4
  import Button from '@synerise/ds-button';
5
- import { getPopupContainer } from '@synerise/ds-utils';
6
- import Icon, { AngleDownS } from '@synerise/ds-icon';
7
5
  import Dropdown from '@synerise/ds-dropdown';
6
+ import Icon, { AngleDownS } from '@synerise/ds-icon';
8
7
  import Tooltip from '@synerise/ds-tooltip';
9
- import OperatorsDropdown from './OperatorsDropdown/OperatorsDropdown';
8
+ import { getPopupContainer } from '@synerise/ds-utils';
10
9
  import * as S from './Operators.style';
10
+ import OperatorsDropdown from './OperatorsDropdown/OperatorsDropdown';
11
11
  import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from './constants';
12
12
  var isOperatorItem = function isOperatorItem(item) {
13
13
  return 'groupId' in item;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { OperatorsDropdownProps } from '../Operator.types';
2
+ import { type OperatorsDropdownProps } from '../Operator.types';
3
3
  declare const OperatorsDropdown: ({ texts, setSelected, groups, items, setDropdownVisible, value, outerHeight, }: OperatorsDropdownProps) => React.JSX.Element;
4
4
  export default OperatorsDropdown;
@@ -1,17 +1,17 @@
1
- import React, { useEffect, useCallback, useRef, useState, useMemo } from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { v4 as uuid } from 'uuid';
3
+ import { theme } from '@synerise/ds-core';
3
4
  import Dropdown from '@synerise/ds-dropdown';
4
5
  import Icon, { SearchM } from '@synerise/ds-icon';
5
- import Tabs from '@synerise/ds-tabs';
6
- import { focusWithArrowKeys, useOnClickOutside } from '@synerise/ds-utils';
7
6
  import Result from '@synerise/ds-result';
8
7
  import Scrollbar from '@synerise/ds-scrollbar';
9
- import { theme } from '@synerise/ds-core';
10
- import OperatorsDropdownItem from './OperatorsDropdownItem';
11
- import OperatorsDropdownGroupName from './OperatorsDropdownGroupName';
8
+ import Tabs from '@synerise/ds-tabs';
9
+ import { focusWithArrowKeys, useOnClickOutside } from '@synerise/ds-utils';
12
10
  import * as S from '../Operators.style';
11
+ import { DEFAULT_TAB_INDEX, DROPDOWN_HEIGHT, NO_GROUP_NAME, PADDING, SEARCH_HEIGHT, TABS_HEIGHT } from '../constants';
13
12
  import { groupByGroupName } from '../utils';
14
- import { NO_GROUP_NAME, DROPDOWN_HEIGHT, TABS_HEIGHT, PADDING, DEFAULT_TAB_INDEX, SEARCH_HEIGHT } from '../constants';
13
+ import OperatorsDropdownGroupName from './OperatorsDropdownGroupName';
14
+ import OperatorsDropdownItem from './OperatorsDropdownItem';
15
15
  var OperatorsDropdown = function OperatorsDropdown(_ref) {
16
16
  var texts = _ref.texts,
17
17
  setSelected = _ref.setSelected,
@@ -148,7 +148,6 @@ var OperatorsDropdown = function OperatorsDropdown(_ref) {
148
148
  ref: overlayRef,
149
149
  onKeyDown: function onKeyDown(e) {
150
150
  setSearchInputFocus(false);
151
- // eslint-disable-next-line @typescript-eslint/no-empty-function
152
151
  searchQuery && focusWithArrowKeys(e, classNames.split(' ')[1], function () {
153
152
  setSearchInputFocus(true);
154
153
  });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { OperatorsGroup, OperatorsItem } from '../Operator.types';
2
+ import { type OperatorsGroup, type OperatorsItem } from '../Operator.types';
3
3
  type OperatorsDropdownItemProps = {
4
4
  item: OperatorsItem | OperatorsGroup;
5
5
  searchQuery: string;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { theme } from '@synerise/ds-core';
2
3
  import Icon, { CheckS } from '@synerise/ds-icon';
3
4
  import ListItem from '@synerise/ds-list-item';
4
- import { theme } from '@synerise/ds-core';
5
5
  var OperatorsDropdownItem = function OperatorsDropdownItem(_ref) {
6
6
  var item = _ref.item,
7
7
  clearSearch = _ref.clearSearch,
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { default } from './Operators';
2
- export type { OperatorsGroup, OperatorsItem, OperatorsProps } from './Operator.types';
2
+ export type { OperatorsGroup, OperatorsItem, OperatorsProps, } from './Operator.types';
@@ -1,2 +1,2 @@
1
- import { OperatorsItem } from '../Operator.types';
1
+ import { type OperatorsItem } from '../Operator.types';
2
2
  export declare const groupByGroupName: (activeItems: OperatorsItem[]) => {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-operators",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Operators UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,15 +34,15 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.4.1",
38
- "@synerise/ds-dropdown": "^1.0.14",
39
- "@synerise/ds-icon": "^1.5.3",
40
- "@synerise/ds-list-item": "^1.0.12",
41
- "@synerise/ds-result": "^1.0.13",
42
- "@synerise/ds-scrollbar": "^1.1.1",
43
- "@synerise/ds-tabs": "^1.0.15",
44
- "@synerise/ds-tooltip": "^1.1.11",
45
- "@synerise/ds-utils": "^1.3.0",
37
+ "@synerise/ds-button": "^1.4.2",
38
+ "@synerise/ds-dropdown": "^1.0.15",
39
+ "@synerise/ds-icon": "^1.5.4",
40
+ "@synerise/ds-list-item": "^1.0.13",
41
+ "@synerise/ds-result": "^1.0.14",
42
+ "@synerise/ds-scrollbar": "^1.1.2",
43
+ "@synerise/ds-tabs": "^1.0.16",
44
+ "@synerise/ds-tooltip": "^1.1.12",
45
+ "@synerise/ds-utils": "^1.3.1",
46
46
  "uuid": "^8.3.2"
47
47
  },
48
48
  "peerDependencies": {
@@ -51,5 +51,5 @@
51
51
  "react-intl": ">=3.12.0 <= 6.8",
52
52
  "styled-components": "^5.3.3"
53
53
  },
54
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
54
+ "gitHead": "4512641033ba3581a3df208143c547fcfed45895"
55
55
  }