@jetbrains/ring-ui 6.0.48 → 6.0.50
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/components/dialog/dialog.js +1 -0
- package/components/select/select.js +7 -3
- package/components/table/simple-table.d.ts +1 -0
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +3 -0
- package/components/table/table.js +3 -2
- package/components/toggle/toggle.css +1 -1
- package/package.json +13 -13
|
@@ -84,6 +84,7 @@ export default class Dialog extends PureComponent {
|
|
|
84
84
|
const { show, modal } = this.props;
|
|
85
85
|
if (this.nativeDialog.current != null) {
|
|
86
86
|
if (show) {
|
|
87
|
+
this.nativeDialog.current.removeAttribute('open');
|
|
87
88
|
modal ? this.nativeDialog.current.showModal() : this.nativeDialog.current.show();
|
|
88
89
|
}
|
|
89
90
|
else {
|
|
@@ -620,13 +620,10 @@ export default class Select extends Component {
|
|
|
620
620
|
let nextSelection;
|
|
621
621
|
if (!prevState.multipleMap[selected.key]) {
|
|
622
622
|
nextSelection = currentSelection.concat(selected);
|
|
623
|
-
this.props.onSelect && this.props.onSelect(selected, event);
|
|
624
623
|
}
|
|
625
624
|
else {
|
|
626
625
|
nextSelection = currentSelection.filter(item => item.key !== selected.key);
|
|
627
|
-
this.props.onDeselect && this.props.onDeselect(selected);
|
|
628
626
|
}
|
|
629
|
-
this.props.onChange(nextSelection, event);
|
|
630
627
|
const nextState = {
|
|
631
628
|
filterValue: '',
|
|
632
629
|
selected: nextSelection,
|
|
@@ -648,6 +645,13 @@ export default class Select extends Component {
|
|
|
648
645
|
}
|
|
649
646
|
return { ...prevState, ...nextState };
|
|
650
647
|
}, () => {
|
|
648
|
+
if (this.state.multipleMap[selected.key]) {
|
|
649
|
+
this.props.onSelect?.(selected, event);
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
this.props.onDeselect?.(selected);
|
|
653
|
+
}
|
|
654
|
+
this.props.onChange(this.state.selected, event);
|
|
651
655
|
if (tryKeepOpen) {
|
|
652
656
|
this._redrawPopup();
|
|
653
657
|
}
|
|
@@ -45,6 +45,7 @@ declare class SimpleTable<T extends SelectionItem> extends PureComponent<SimpleT
|
|
|
45
45
|
loaderClassName?: import("react").Validator<string | null | undefined> | undefined;
|
|
46
46
|
stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
|
|
47
47
|
renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
|
|
48
|
+
RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
|
|
48
49
|
shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
|
49
50
|
};
|
|
50
51
|
static defaultProps: {
|
|
@@ -49,6 +49,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
|
|
|
49
49
|
loaderClassName?: import("react").Validator<string | null | undefined> | undefined;
|
|
50
50
|
stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
|
|
51
51
|
renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
|
|
52
|
+
RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
|
|
52
53
|
selectable?: import("react").Validator<boolean | null | undefined> | undefined;
|
|
53
54
|
shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
|
54
55
|
onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -8,6 +8,7 @@ import { FocusSensorAddProps, FocusSensorProps } from '../global/focus-sensor-ho
|
|
|
8
8
|
import { SelectionItem } from './selection';
|
|
9
9
|
import { SelectionShortcutsAddProps, SelectionShortcutsProps } from './selection-shortcuts-hoc';
|
|
10
10
|
import { DisableHoverAddProps, DisableHoverProps } from './disable-hover-hoc';
|
|
11
|
+
import Row from './row-with-focus-sensor';
|
|
11
12
|
import { Column, SortParams } from './header-cell';
|
|
12
13
|
export interface ReorderParams<T> {
|
|
13
14
|
data: T[];
|
|
@@ -49,6 +50,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
|
|
|
49
50
|
caption?: string | null | undefined;
|
|
50
51
|
stickyHeaderOffset?: string | undefined;
|
|
51
52
|
renderEmpty?: (() => ReactNode) | null | undefined;
|
|
53
|
+
RowComponent: typeof Row;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Interactive table with selection and keyboard navigation support.
|
|
@@ -79,6 +81,7 @@ export declare class Table<T extends SelectionItem> extends PureComponent<TableP
|
|
|
79
81
|
remoteSelection: boolean;
|
|
80
82
|
isDisabledSelectionVisible: () => boolean;
|
|
81
83
|
getCheckboxTooltip: () => undefined;
|
|
84
|
+
RowComponent: typeof Row;
|
|
82
85
|
wideFirstColumn: boolean;
|
|
83
86
|
};
|
|
84
87
|
state: {
|
|
@@ -45,6 +45,7 @@ export class Table extends PureComponent {
|
|
|
45
45
|
remoteSelection: false,
|
|
46
46
|
isDisabledSelectionVisible: () => false,
|
|
47
47
|
getCheckboxTooltip: () => undefined,
|
|
48
|
+
RowComponent: Row,
|
|
48
49
|
//TODO: change to false in 7.0
|
|
49
50
|
wideFirstColumn: true
|
|
50
51
|
};
|
|
@@ -110,7 +111,7 @@ export class Table extends PureComponent {
|
|
|
110
111
|
window.scrollTo(scrollX, scrollY);
|
|
111
112
|
};
|
|
112
113
|
render() {
|
|
113
|
-
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, maxColSpan } = this.props;
|
|
114
|
+
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, maxColSpan, RowComponent } = this.props;
|
|
114
115
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
|
115
116
|
const headerProps = {
|
|
116
117
|
caption, selectable, draggable,
|
|
@@ -155,7 +156,7 @@ export class Table extends PureComponent {
|
|
|
155
156
|
return null;
|
|
156
157
|
}
|
|
157
158
|
const { ref, ...restProps } = props;
|
|
158
|
-
const row = (<
|
|
159
|
+
const row = (<RowComponent innerRef={ref} level={getItemLevel(value)} item={value} showFocus={selection.isFocused(value)} autofocus={selection.isFocused(value)} focused={focused && selection.isFocused(value)} selectable={selectable && isItemSelectable(value)} selected={selectable && selection.isSelected(value)} onFocus={this.onRowFocus} onSelect={this.onRowSelect} onDoubleClick={onItemDoubleClick} onClick={onItemClick} collapsible={isItemCollapsible(value)} parentCollapsible={isParentCollapsible(value)} collapsed={isItemCollapsed(value)} onCollapse={onItemCollapse} onExpand={onItemExpand} showDisabledSelection={isDisabledSelectionVisible(value)} checkboxTooltip={getCheckboxTooltip(value)} className={classNames(getItemClassName(value), { [style.draggingRow]: isDragged })} metaColumnClassName={getMetaColumnClassName(value)} draggable={draggable} alwaysShowDragHandle={alwaysShowDragHandle} dragHandleTitle={dragHandleTitle} columns={columns} data-test={getItemDataTest(value)} maxColSpan={maxColSpan} {...restProps} key={restProps.key ?? getItemKey(value)}/>);
|
|
159
160
|
return isDragged
|
|
160
161
|
? (<table style={{ ...props.style }} className={style.draggingTable}>
|
|
161
162
|
<tbody>{row}</tbody>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.50",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -88,16 +88,16 @@
|
|
|
88
88
|
"@rollup/plugin-json": "^6.1.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
90
90
|
"@rollup/plugin-replace": "^5.0.7",
|
|
91
|
-
"@storybook/addon-a11y": "8.2.
|
|
92
|
-
"@storybook/addon-docs": "8.2.
|
|
93
|
-
"@storybook/addon-essentials": "8.2.
|
|
94
|
-
"@storybook/components": "8.2.
|
|
95
|
-
"@storybook/manager-api": "8.2.
|
|
96
|
-
"@storybook/preview-api": "8.2.
|
|
97
|
-
"@storybook/react": "8.2.
|
|
98
|
-
"@storybook/react-webpack5": "8.2.
|
|
91
|
+
"@storybook/addon-a11y": "8.2.6",
|
|
92
|
+
"@storybook/addon-docs": "8.2.6",
|
|
93
|
+
"@storybook/addon-essentials": "8.2.6",
|
|
94
|
+
"@storybook/components": "8.2.6",
|
|
95
|
+
"@storybook/manager-api": "8.2.6",
|
|
96
|
+
"@storybook/preview-api": "8.2.6",
|
|
97
|
+
"@storybook/react": "8.2.6",
|
|
98
|
+
"@storybook/react-webpack5": "8.2.6",
|
|
99
99
|
"@storybook/test-runner": "^0.19.1",
|
|
100
|
-
"@storybook/theming": "8.2.
|
|
100
|
+
"@storybook/theming": "8.2.6",
|
|
101
101
|
"@testing-library/dom": "^10.4.0",
|
|
102
102
|
"@testing-library/react": "^16.0.0",
|
|
103
103
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@types/chai-dom": "0.0.10",
|
|
107
107
|
"@types/chai-enzyme": "^0.6.13",
|
|
108
108
|
"@types/enzyme": "^3.10.18",
|
|
109
|
-
"@types/markdown-it": "^14.1.
|
|
109
|
+
"@types/markdown-it": "^14.1.2",
|
|
110
110
|
"@types/react": "^18.3.3",
|
|
111
111
|
"@types/react-dom": "^18.3.0",
|
|
112
112
|
"@types/sinon": "^17.0.3",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"sinon": "^18.0.0",
|
|
163
163
|
"sinon-chai": "^3.7.0",
|
|
164
164
|
"storage-mock": "^2.1.0",
|
|
165
|
-
"storybook": "8.2.
|
|
165
|
+
"storybook": "8.2.6",
|
|
166
166
|
"storybook-addon-themes": "^6.1.0",
|
|
167
167
|
"stylelint": "^16.7.0",
|
|
168
168
|
"svg-inline-loader": "^0.8.2",
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
"highlight.js": "^10.7.2",
|
|
227
227
|
"just-debounce-it": "^3.2.0",
|
|
228
228
|
"memoize-one": "^6.0.0",
|
|
229
|
-
"postcss": "^8.4.
|
|
229
|
+
"postcss": "^8.4.40",
|
|
230
230
|
"postcss-calc": "^10.0.0",
|
|
231
231
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
232
232
|
"postcss-font-family-system-ui": "^5.0.0",
|