@synerise/ds-subject 1.0.16 → 1.0.18
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 +428 -1527
- package/README.md +24 -27
- package/dist/Subject.d.ts +1 -1
- package/dist/Subject.js +1 -1
- package/dist/Subject.types.d.ts +1 -1
- package/dist/SubjectList/SubjectList.d.ts +1 -1
- package/dist/SubjectList/SubjectList.js +3 -4
- package/dist/SubjectList/SubjectListItem.d.ts +2 -2
- package/dist/SubjectTrigger/SubjectTrigger.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ title: Subject
|
|
|
6
6
|
Subject UI Component
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
|
+
|
|
9
10
|
```
|
|
10
11
|
npm i @synerise/ds-subject
|
|
11
12
|
or
|
|
@@ -13,6 +14,7 @@ yarn add @synerise/ds-subject
|
|
|
13
14
|
```
|
|
14
15
|
|
|
15
16
|
## Usage
|
|
17
|
+
|
|
16
18
|
```
|
|
17
19
|
import Subject from '@synerise/ds-subject'
|
|
18
20
|
|
|
@@ -49,36 +51,31 @@ import Subject from '@synerise/ds-subject'
|
|
|
49
51
|
|
|
50
52
|
## API
|
|
51
53
|
|
|
52
|
-
| ---------
|
|
53
|
-
| getPopupContainerOverride | Popup container function for child tooltips and dropdowns
|
|
54
|
-
| iconPlaceholder
|
|
55
|
-
| items
|
|
56
|
-
| onActivate
|
|
57
|
-
| onDeactivate
|
|
58
|
-
| onSelectItem
|
|
59
|
-
| onShowPreview
|
|
60
|
-
| placeholder
|
|
61
|
-
| Property
|
|
62
|
-
| selectedItem?
|
|
63
|
-
| texts
|
|
64
|
-
| type?
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
| --------- | ------ | ------ | ----- |
|
|
55
|
+
| getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement | null) => HTMLElement; | - |
|
|
56
|
+
| iconPlaceholder | Icon for empty selected item | React.ReactNode | - |
|
|
57
|
+
| items | Array of available subjects | SubjectItem[] | [] |
|
|
58
|
+
| onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
|
|
59
|
+
| onDeactivate | Callback called when user closes dropdown | () => void | - |
|
|
60
|
+
| onSelectItem | Callback called when user select new subject | ( SubjectItem) => void; | - |
|
|
61
|
+
| onShowPreview | Callback called when user clicks on Show Preview button | () => void \ undefined | - |
|
|
62
|
+
| placeholder | Placeholder for empty selected item | string \ React.ReactNode; | - |
|
|
63
|
+
| Property | Description | Type | Default |
|
|
64
|
+
| selectedItem? | Selected item | SubjectItem \ undefined; | `undefined` |
|
|
65
|
+
| texts | Object with translations | TEXTS | - |
|
|
66
|
+
| type? | Type of subject `parameter` \ `context` \ `event` | SubjectType | `parameter` |
|
|
67
67
|
|
|
68
68
|
### SubjectItem
|
|
69
69
|
|
|
70
|
-
| Property
|
|
71
|
-
|
|
|
72
|
-
| icon
|
|
73
|
-
| id
|
|
74
|
-
| name
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
| Property | Description | Type | Default |
|
|
71
|
+
| -------- | -------------------- | --------------- | ------- |
|
|
72
|
+
| icon | Icon of subject item | React.ReactNode | - |
|
|
73
|
+
| id | Id of subject item | React.ReactText | - |
|
|
74
|
+
| name | Name of subject item | string | - |
|
|
77
75
|
|
|
78
76
|
### TEXTS
|
|
79
|
-
| Property | Description | Type | Default |
|
|
80
|
-
| --------- | ------ | ------ | ----- |
|
|
81
|
-
| noResults | No results info | string | - |
|
|
82
|
-
| searchPlaceholder | Search box placeholder | string | - |
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
| Property | Description | Type | Default |
|
|
79
|
+
| ----------------- | ---------------------- | ------ | ------- |
|
|
80
|
+
| noResults | No results info | string | - |
|
|
81
|
+
| searchPlaceholder | Search box placeholder | string | - |
|
package/dist/Subject.d.ts
CHANGED
package/dist/Subject.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Dropdown from '@synerise/ds-dropdown';
|
|
3
3
|
import Icon, { ShowM } from '@synerise/ds-icon';
|
|
4
|
-
import SubjectTrigger from './SubjectTrigger/SubjectTrigger';
|
|
5
4
|
import * as S from './Subject.style';
|
|
6
5
|
import SubjectList from './SubjectList/SubjectList';
|
|
6
|
+
import SubjectTrigger from './SubjectTrigger/SubjectTrigger';
|
|
7
7
|
var Subject = function Subject(_ref) {
|
|
8
8
|
var selectedItem = _ref.selectedItem,
|
|
9
9
|
iconPlaceholder = _ref.iconPlaceholder,
|
package/dist/Subject.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, ReactText } from 'react';
|
|
2
2
|
export declare const ALL_TYPES: readonly ["event", "parameter", "context"];
|
|
3
|
-
export type SubjectType = typeof ALL_TYPES[number] | string;
|
|
3
|
+
export type SubjectType = (typeof ALL_TYPES)[number] | string;
|
|
4
4
|
export type SubjectItem = {
|
|
5
5
|
id: ReactText;
|
|
6
6
|
name: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { v4 as uuid } from 'uuid';
|
|
2
3
|
import Dropdown from '@synerise/ds-dropdown';
|
|
3
|
-
import
|
|
4
|
+
import Icon, { SearchM } from '@synerise/ds-icon';
|
|
4
5
|
import Result from '@synerise/ds-result';
|
|
6
|
+
import Scrollbar from '@synerise/ds-scrollbar';
|
|
5
7
|
import { focusWithArrowKeys, useOnClickOutside } from '@synerise/ds-utils';
|
|
6
|
-
import Icon, { SearchM } from '@synerise/ds-icon';
|
|
7
|
-
import { v4 as uuid } from 'uuid';
|
|
8
8
|
import * as S from './SubjectList.styles';
|
|
9
9
|
import SubjectListItem from './SubjectListItem';
|
|
10
10
|
var SubjectList = function SubjectList(_ref) {
|
|
@@ -50,7 +50,6 @@ var SubjectList = function SubjectList(_ref) {
|
|
|
50
50
|
"data-testid": "subject-overlay",
|
|
51
51
|
onKeyDown: function onKeyDown(e) {
|
|
52
52
|
setSearchInputFocus(false);
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
54
53
|
searchQuery && focusWithArrowKeys(e, classNames.split(' ')[1], function () {
|
|
55
54
|
setSearchInputFocus(true);
|
|
56
55
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SubjectItem } from '../Subject.types';
|
|
2
|
+
import { type SubjectItem } from '../Subject.types';
|
|
3
3
|
type Props = {
|
|
4
4
|
item: SubjectItem;
|
|
5
5
|
clearSearch: () => void;
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
select: (item: SubjectItem) => void;
|
|
9
9
|
className: string;
|
|
10
10
|
};
|
|
11
|
-
declare const SubjectListItem: ({ item, clearSearch, searchQuery, hideDropdown, select, className }: Props) => React.JSX.Element;
|
|
11
|
+
declare const SubjectListItem: ({ item, clearSearch, searchQuery, hideDropdown, select, className, }: Props) => React.JSX.Element;
|
|
12
12
|
export default SubjectListItem;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Subject';
|
|
2
|
-
export type { SubjectProps, SubjectItem, SubjectListProps, SubjectTriggerProps, SubjectType } from './Subject.types';
|
|
2
|
+
export type { SubjectProps, SubjectItem, SubjectListProps, SubjectTriggerProps, SubjectType, } from './Subject.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-subject",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Subject UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^1.4.
|
|
38
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
39
|
-
"@synerise/ds-icon": "^1.5.
|
|
40
|
-
"@synerise/ds-list-item": "^1.0.
|
|
41
|
-
"@synerise/ds-result": "^1.0.
|
|
42
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
43
|
-
"@synerise/ds-utils": "^1.3.
|
|
37
|
+
"@synerise/ds-button": "^1.4.3",
|
|
38
|
+
"@synerise/ds-dropdown": "^1.0.16",
|
|
39
|
+
"@synerise/ds-icon": "^1.5.4",
|
|
40
|
+
"@synerise/ds-list-item": "^1.0.13",
|
|
41
|
+
"@synerise/ds-result": "^1.0.15",
|
|
42
|
+
"@synerise/ds-scrollbar": "^1.1.2",
|
|
43
|
+
"@synerise/ds-utils": "^1.3.1",
|
|
44
44
|
"uuid": "^8.3.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react": ">=16.9.0 <= 18.3.1",
|
|
49
49
|
"styled-components": "^5.3.3"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8db1900bf3f7b0782c834ff82f628199530cd934"
|
|
52
52
|
}
|