@jetbrains/ring-ui-built 7.0.0-beta.12 → 7.0.0-beta.14
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/_helpers/anchor.js +4 -4
- package/components/_helpers/badge.js +2 -2
- package/components/_helpers/button__classes.js +13 -13
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +18 -18
- package/components/_helpers/date-picker.js +2 -2
- package/components/_helpers/dialog__body-scroll-preventer.js +4 -4
- package/components/_helpers/grid.js +2 -2
- package/components/_helpers/header.js +2 -2
- package/components/_helpers/heading.js +2 -2
- package/components/_helpers/icon__svg.js +6 -6
- package/components/_helpers/input.js +14 -14
- package/components/_helpers/island.js +2 -2
- package/components/_helpers/link.js +2 -2
- package/components/_helpers/list.js +2 -2
- package/components/_helpers/query-assist__suggestions.js +7 -7
- package/components/_helpers/select__filter.js +3 -3
- package/components/_helpers/services-link.js +3 -3
- package/components/_helpers/sidebar.js +9 -9
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/table.js +2 -2
- package/components/_helpers/theme.js +9 -9
- package/components/_helpers/title.js +7 -7
- package/components/alert/alert.d.ts +2 -2
- package/components/alert/alert.js +12 -12
- package/components/alert/container.js +3 -3
- package/components/auth/auth__core.js +1 -1
- package/components/auth/background-flow.js +2 -2
- package/components/auth/down-notification.js +3 -3
- package/components/auth/token-validator.js +1 -1
- package/components/auth-dialog/auth-dialog.js +10 -10
- package/components/auth-dialog-service/auth-dialog-service.js +1 -1
- package/components/avatar/avatar.js +6 -6
- package/components/badge/badge.js +6 -13
- package/components/breadcrumbs/breadcrumbs.js +2 -2
- package/components/button/button.js +4 -4
- package/components/button/button__classes.d.ts +1 -1
- package/components/button-group/button-group.js +3 -3
- package/components/button-set/button-set.js +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -2
- package/components/checkbox/checkbox.js +8 -8
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +6 -6
- package/components/collapse/collapse-content.js +4 -4
- package/components/confirm/confirm.d.ts +2 -2
- package/components/confirm/confirm.js +3 -3
- package/components/confirm-service/confirm-service.d.ts +1 -1
- package/components/content-layout/content-layout.js +4 -4
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/control-help/control-help.js +2 -2
- package/components/control-label/control-label.js +5 -5
- package/components/data-list/data-list.d.ts +2 -2
- package/components/data-list/data-list.js +6 -6
- package/components/data-list/data-list.mock.js +0 -1
- package/components/data-list/item.js +8 -8
- package/components/date-picker/date-input.js +2 -2
- package/components/date-picker/date-picker.d.ts +2 -1
- package/components/date-picker/date-picker.js +12 -11
- package/components/date-picker/date-popup.js +4 -4
- package/components/date-picker/day.js +15 -15
- package/components/date-picker/month-names.js +5 -5
- package/components/date-picker/month-slider.js +3 -3
- package/components/date-picker/month.js +3 -3
- package/components/date-picker/months.js +3 -3
- package/components/date-picker/weekdays.js +4 -4
- package/components/date-picker/years.js +5 -5
- package/components/dialog/dialog.d.ts +1 -0
- package/components/dialog/dialog.js +21 -16
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +2 -2
- package/components/editable-heading/editable-heading.js +19 -19
- package/components/error-bubble/error-bubble.js +4 -4
- package/components/error-message/error-message.js +6 -6
- package/components/footer/footer.js +8 -8
- package/components/form/form.js +2 -3
- package/components/global/theme.js +1 -1
- package/components/grid/col.js +4 -4
- package/components/grid/grid.js +2 -2
- package/components/grid/row.js +4 -4
- package/components/group/group.js +2 -2
- package/components/header/header-icon.js +4 -4
- package/components/header/header.js +3 -3
- package/components/header/links.js +2 -2
- package/components/header/logo.js +2 -2
- package/components/header/profile.d.ts +2 -2
- package/components/header/profile.js +10 -10
- package/components/header/services.js +7 -7
- package/components/header/tray.js +3 -3
- package/components/heading/heading.js +3 -3
- package/components/http/http.d.ts +3 -3
- package/components/icon/icon.js +8 -6
- package/components/input/input-legacy.js +2 -3
- package/components/input-size/input-size.js +2 -3
- package/components/island/content.js +7 -7
- package/components/island/header.js +4 -4
- package/components/island/island.js +4 -4
- package/components/link/link.js +7 -7
- package/components/list/list.d.ts +1 -1
- package/components/list/list.js +5 -5
- package/components/list/list__custom.js +5 -5
- package/components/list/list__hint.js +2 -2
- package/components/list/list__item.js +22 -22
- package/components/list/list__link.js +5 -5
- package/components/list/list__separator.js +3 -3
- package/components/list/list__title.js +5 -5
- package/components/loader/loader__core.js +5 -5
- package/components/loader-inline/loader-inline.js +3 -3
- package/components/loader-screen/loader-screen.js +4 -4
- package/components/login-dialog/login-dialog.js +6 -6
- package/components/markdown/markdown.d.ts +2 -2
- package/components/markdown/markdown.js +6 -6
- package/components/message/message.js +9 -9
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +9 -9
- package/components/panel/panel.js +2 -2
- package/components/permissions/permissions__cache.js +2 -2
- package/components/popup/popup.js +5 -5
- package/components/popup/position.js +2 -2
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/progress-bar/progress-bar.js +5 -5
- package/components/query-assist/query-assist.js +26 -26
- package/components/radio/radio__item.js +5 -5
- package/components/scrollable-section/scrollable-section.js +6 -6
- package/components/select/select.d.ts +1 -1
- package/components/select/select.js +22 -21
- package/components/select/select__popup.js +11 -11
- package/components/shortcuts/core.js +1 -1
- package/components/slider/slider.js +20 -20
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +2 -2
- package/components/table/cell.js +2 -2
- package/components/table/header-cell.js +8 -8
- package/components/table/header.d.ts +1 -2
- package/components/table/header.js +7 -13
- package/components/table/row.d.ts +0 -1
- package/components/table/row.js +11 -17
- package/components/table/selection.d.ts +2 -3
- package/components/table/simple-table.js +2 -2
- package/components/table/table.d.ts +0 -1
- package/components/table/table.js +17 -19
- package/components/tabs/collapsible-more.d.ts +1 -1
- package/components/tabs/collapsible-more.js +6 -6
- package/components/tabs/collapsible-tab.js +4 -4
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +5 -5
- package/components/tabs/dumb-tabs.js +5 -5
- package/components/tag/tag.js +13 -13
- package/components/tags-input/tags-input.js +8 -8
- package/components/text/text.js +7 -7
- package/components/toggle/toggle.d.ts +2 -2
- package/components/toggle/toggle.js +12 -12
- package/components/tooltip/tooltip.js +11 -4
- package/components/user-agreement/user-agreement.js +7 -7
- package/components/user-card/smart-user-card-tooltip.js +2 -2
- package/components/user-card/tooltip.js +2 -2
- package/package.json +6 -5
- package/typings.d.ts +2 -4
- package/components/island-legacy/content-legacy.d.ts +0 -5
- package/components/island-legacy/content-legacy.js +0 -23
- package/components/island-legacy/header-legacy.d.ts +0 -5
- package/components/island-legacy/header-legacy.js +0 -26
- package/components/island-legacy/island-legacy.d.ts +0 -7
- package/components/island-legacy/island-legacy.js +0 -25
@@ -5,7 +5,7 @@ import { isNodeInVisiblePartOfPage } from '../global/dom.js';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
6
6
|
import 'core-js/modules/es.regexp.exec.js';
|
7
7
|
|
8
|
-
var
|
8
|
+
var styles = {"trapButton":"trapButton_rui_11f0"};
|
9
9
|
|
10
10
|
const _excluded = ["children", "trapDisabled", "autoFocusFirst", "focusBackOnClose", "focusBackOnExit"];
|
11
11
|
const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
@@ -130,7 +130,7 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
130
130
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
131
131
|
tabIndex: 0,
|
132
132
|
ref: trapButtonNodeRef,
|
133
|
-
className:
|
133
|
+
className: styles.trapButton,
|
134
134
|
onFocus: focusLastIfEnabled,
|
135
135
|
onBlur: handleBlurIfWithoutFocus,
|
136
136
|
"data-trap-button": true
|
package/components/table/cell.js
CHANGED
@@ -2,14 +2,14 @@ import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { PureComponent } from 'react';
|
3
3
|
import classNames from 'classnames';
|
4
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
5
|
-
import {
|
5
|
+
import { s as style } from '../_helpers/table.js';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
7
|
import 'core-js/modules/es.array.reduce.js';
|
8
8
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
9
9
|
|
10
10
|
class Cell extends PureComponent {
|
11
11
|
render() {
|
12
|
-
const classes = classNames(
|
12
|
+
const classes = classNames(style.cell, this.props.className);
|
13
13
|
return /*#__PURE__*/jsx("td", _objectSpread2(_objectSpread2({}, this.props), {}, {
|
14
14
|
className: classes,
|
15
15
|
"data-test": joinDataTestAttributes('ring-table-cell', this.props['data-test']),
|
@@ -6,7 +6,7 @@ import sortableIcon from '@jetbrains/icons/unsorted-10px';
|
|
6
6
|
import chevronDown from '@jetbrains/icons/chevron-10px';
|
7
7
|
import Icon from '../icon/icon.js';
|
8
8
|
import joinDataTestAttributes from '../global/data-tests.js';
|
9
|
-
import {
|
9
|
+
import { s as style } from '../_helpers/table.js';
|
10
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
11
11
|
import 'util-deprecate';
|
12
12
|
import '../icon/icon__constants.js';
|
@@ -54,11 +54,11 @@ class HeaderCell extends PureComponent {
|
|
54
54
|
this.sorted = sortKey === column.id;
|
55
55
|
const glyph = this.sorted ? chevronDown : sortableIcon;
|
56
56
|
const classes = classNames(className, column.headerClassName, {
|
57
|
-
[
|
58
|
-
[
|
59
|
-
[
|
60
|
-
[
|
61
|
-
[
|
57
|
+
[style.headerCell]: true,
|
58
|
+
[style.headerCellSortable]: this.sortable,
|
59
|
+
[style.headerCellSorted]: this.sorted,
|
60
|
+
[style.sortedUp]: sortOrder && this.sorted,
|
61
|
+
[style.cellRight]: column.rightAlign
|
62
62
|
});
|
63
63
|
return /*#__PURE__*/jsxs("th", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
64
64
|
className: classes,
|
@@ -69,10 +69,10 @@ class HeaderCell extends PureComponent {
|
|
69
69
|
role: "presentation",
|
70
70
|
children: this.props.children
|
71
71
|
}), column.getHeaderValue ? column.getHeaderValue() : column.title, this.sortable && /*#__PURE__*/jsx("span", {
|
72
|
-
className:
|
72
|
+
className: style.sorter,
|
73
73
|
children: /*#__PURE__*/jsx(Icon, {
|
74
74
|
glyph: glyph,
|
75
|
-
className:
|
75
|
+
className: style.icon
|
76
76
|
})
|
77
77
|
})]
|
78
78
|
}));
|
@@ -13,7 +13,6 @@ export interface HeaderProps {
|
|
13
13
|
sortOrder: boolean;
|
14
14
|
caption?: string | null | undefined;
|
15
15
|
checkboxDisabled?: boolean | undefined;
|
16
|
-
maxColSpan?: number;
|
17
16
|
}
|
18
17
|
export default class Header extends PureComponent<HeaderProps> {
|
19
18
|
static defaultProps: {
|
@@ -29,7 +28,7 @@ export default class Header extends PureComponent<HeaderProps> {
|
|
29
28
|
};
|
30
29
|
id: string;
|
31
30
|
onCheckboxFocus: (event: SyntheticEvent<HTMLElement>) => void;
|
32
|
-
createCells(widths?: never[]):
|
31
|
+
createCells(widths?: never[]): import("react").JSX.Element[];
|
33
32
|
render(): import("react").JSX.Element;
|
34
33
|
}
|
35
34
|
export type HeaderAttrs = JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
@@ -4,7 +4,7 @@ import { PureComponent } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
5
5
|
import Checkbox from '../checkbox/checkbox.js';
|
6
6
|
import getUID from '../global/get-uid.js';
|
7
|
-
import {
|
7
|
+
import { s as style } from '../_helpers/table.js';
|
8
8
|
import HeaderCell from './header-cell.js';
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
10
10
|
import '@jetbrains/icons/checkmark-12px';
|
@@ -45,7 +45,7 @@ class Header extends PureComponent {
|
|
45
45
|
sortKey,
|
46
46
|
sortOrder
|
47
47
|
} = this.props;
|
48
|
-
const metaColumnClasses = classNames(
|
48
|
+
const metaColumnClasses = classNames(style.metaColumn, style.headerMetaColumn);
|
49
49
|
const metaColumn = /*#__PURE__*/jsx("div", {
|
50
50
|
className: metaColumnClasses,
|
51
51
|
children: selectable && /*#__PURE__*/jsx(Checkbox, {
|
@@ -56,7 +56,6 @@ class Header extends PureComponent {
|
|
56
56
|
onFocus: this.onCheckboxFocus
|
57
57
|
})
|
58
58
|
});
|
59
|
-
let colSpan = 0;
|
60
59
|
return columns.map((column, index) => {
|
61
60
|
const columnStyle = widths[index] ? {
|
62
61
|
width: widths[index]
|
@@ -68,13 +67,8 @@ class Header extends PureComponent {
|
|
68
67
|
sortOrder,
|
69
68
|
style: columnStyle
|
70
69
|
};
|
71
|
-
colSpan += column.colSpan || 1;
|
72
|
-
if (colSpan > (this.props.maxColSpan || Infinity)) {
|
73
|
-
return null;
|
74
|
-
}
|
75
70
|
return /*#__PURE__*/jsx(HeaderCell, _objectSpread2(_objectSpread2({
|
76
|
-
"data-test": column.id
|
77
|
-
colSpan: column.colSpan
|
71
|
+
"data-test": column.id
|
78
72
|
}, props), {}, {
|
79
73
|
children: index === 0 && (draggable || selectable) && metaColumn
|
80
74
|
}), column.id);
|
@@ -94,19 +88,19 @@ class Header extends PureComponent {
|
|
94
88
|
top: topStickOffset
|
95
89
|
},
|
96
90
|
className: classNames({
|
97
|
-
[
|
98
|
-
[
|
91
|
+
[style.tableHead]: true,
|
92
|
+
[style.subHeaderSticky]: sticky
|
99
93
|
}),
|
100
94
|
children: [caption && /*#__PURE__*/jsx("tr", {
|
101
95
|
"data-test": "ring-table-header-row",
|
102
96
|
children: /*#__PURE__*/jsx("th", {
|
103
|
-
className: classNames(
|
97
|
+
className: classNames(style.headerCell, style.caption),
|
104
98
|
colSpan: regularCells.length + 1,
|
105
99
|
"data-test": "ring-table-header-cell",
|
106
100
|
children: caption
|
107
101
|
})
|
108
102
|
}), /*#__PURE__*/jsx("tr", {
|
109
|
-
className:
|
103
|
+
className: style.subHeader,
|
110
104
|
"data-test": "ring-table-header-row",
|
111
105
|
children: regularCells
|
112
106
|
})]
|
@@ -6,7 +6,6 @@ import { SelectionItem } from './selection';
|
|
6
6
|
export interface RowProps<T extends SelectionItem> extends Omit<HTMLAttributes<HTMLTableRowElement>, 'onClick' | 'onDoubleClick' | 'onSelect'>, FocusSensorAddProps<HTMLTableRowElement> {
|
7
7
|
item: T;
|
8
8
|
columns: readonly Column<T>[] | ((item: T) => readonly Column<T>[]);
|
9
|
-
maxColSpan?: number;
|
10
9
|
selectable: boolean;
|
11
10
|
showFocus: boolean;
|
12
11
|
draggable: boolean;
|
package/components/table/row.js
CHANGED
@@ -12,7 +12,7 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
12
12
|
import getUID from '../global/get-uid.js';
|
13
13
|
import { createComposedRef } from '../global/composeRefs.js';
|
14
14
|
import Cell from './cell.js';
|
15
|
-
import {
|
15
|
+
import { s as style } from '../_helpers/table.js';
|
16
16
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
17
17
|
import '@jetbrains/icons/checkmark-12px';
|
18
18
|
import '@jetbrains/icons/remove-12px';
|
@@ -45,14 +45,14 @@ import '../_helpers/theme.js';
|
|
45
45
|
import 'core-js/modules/es.array.reduce.js';
|
46
46
|
import 'memoize-one';
|
47
47
|
|
48
|
-
const _excluded = ["item", "columns", "selectable", "selected", "showFocus", "draggable", "alwaysShowDragHandle", "dragHandleTitle", "level", "collapsible", "parentCollapsible", "collapsed", "
|
48
|
+
const _excluded = ["item", "columns", "selectable", "selected", "showFocus", "draggable", "alwaysShowDragHandle", "dragHandleTitle", "level", "collapsible", "parentCollapsible", "collapsed", "onCollapse", "onExpand", "showDisabledSelection", "onSelect", "checkboxTooltip", "innerRef", "focused", "autofocus", "onFocusReset", "onFocusRestore", "onHover", "className", "metaColumnClassName", "data-test"];
|
49
49
|
const DragHandle = _ref => {
|
50
50
|
let {
|
51
51
|
alwaysShowDragHandle,
|
52
52
|
dragHandleTitle = 'Drag to reorder'
|
53
53
|
} = _ref;
|
54
|
-
const classes = classNames(
|
55
|
-
[
|
54
|
+
const classes = classNames(style.dragHandle, {
|
55
|
+
[style.visibleDragHandle]: alwaysShowDragHandle
|
56
56
|
});
|
57
57
|
return /*#__PURE__*/jsx(Button, {
|
58
58
|
"data-movable-handle": true,
|
@@ -125,7 +125,6 @@ class Row extends PureComponent {
|
|
125
125
|
collapsible,
|
126
126
|
parentCollapsible,
|
127
127
|
collapsed,
|
128
|
-
maxColSpan,
|
129
128
|
onCollapse,
|
130
129
|
onExpand,
|
131
130
|
showDisabledSelection,
|
@@ -143,15 +142,15 @@ class Row extends PureComponent {
|
|
143
142
|
} = _this$props,
|
144
143
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
145
144
|
const classes = classNames(className, {
|
146
|
-
[
|
147
|
-
[
|
148
|
-
[
|
145
|
+
[style.row]: true,
|
146
|
+
[style.rowFocused]: showFocus,
|
147
|
+
[style.rowSelected]: selected
|
149
148
|
});
|
150
149
|
const testAttrs = {
|
151
150
|
'data-test-focused': showFocus || undefined,
|
152
151
|
'data-test-selected': selected || undefined
|
153
152
|
};
|
154
|
-
const metaColumnClasses = classNames(metaColumnClassName,
|
153
|
+
const metaColumnClasses = classNames(metaColumnClassName, style.metaColumn);
|
155
154
|
const SUBITEM_OFFSET = 30;
|
156
155
|
const COLLAPSIBLE_PARENT_OFFSET = 20;
|
157
156
|
const gap = level * SUBITEM_OFFSET + (parentCollapsible ? COLLAPSIBLE_PARENT_OFFSET : 0);
|
@@ -182,29 +181,24 @@ class Row extends PureComponent {
|
|
182
181
|
disabled: true
|
183
182
|
})
|
184
183
|
}), collapsible && collapsed && /*#__PURE__*/jsx(Button, {
|
185
|
-
className:
|
184
|
+
className: style.rowCollapseExpandButton,
|
186
185
|
icon: chevronRightIcon,
|
187
186
|
onClick: () => onExpand(item)
|
188
187
|
}), collapsible && !collapsed && /*#__PURE__*/jsx(Button, {
|
189
|
-
className:
|
188
|
+
className: style.rowCollapseExpandButton,
|
190
189
|
icon: chevronDownIcon,
|
191
190
|
onClick: () => onCollapse(item)
|
192
191
|
})]
|
193
192
|
});
|
194
193
|
const columns = typeof columnProps === 'function' ? columnProps(item) : columnProps;
|
195
|
-
let colSpan = 0;
|
196
194
|
const cells = columns.map((column, index) => {
|
197
195
|
const getValue = column.getValue || (() => item[column.id]);
|
198
196
|
const getDataTest = column.getDataTest || (() => column.id);
|
199
197
|
const value = getValue(item, column);
|
200
198
|
const cellClasses = classNames({
|
201
|
-
[
|
199
|
+
[style.cellRight]: column.rightAlign
|
202
200
|
}, column.className);
|
203
201
|
const showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
204
|
-
colSpan += column.colSpan || 1;
|
205
|
-
if (colSpan > (maxColSpan || Infinity)) {
|
206
|
-
return null;
|
207
|
-
}
|
208
202
|
return /*#__PURE__*/jsxs(Cell, {
|
209
203
|
colSpan: column.colSpan,
|
210
204
|
className: cellClasses,
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export interface SelectionItem {
|
2
2
|
id: string | number;
|
3
|
-
[key: string]: unknown;
|
4
3
|
}
|
5
4
|
export interface TableSelectionConfig<T extends SelectionItem> {
|
6
5
|
data?: readonly T[] | undefined;
|
@@ -17,13 +16,13 @@ export interface CloneWithConfig<T> {
|
|
17
16
|
}
|
18
17
|
export default class Selection<T extends SelectionItem> {
|
19
18
|
private _rawData;
|
20
|
-
protected _getChildren: (
|
19
|
+
protected _getChildren: (item: T) => readonly T[];
|
21
20
|
protected _data: Set<T>;
|
22
21
|
protected _selected: Set<T>;
|
23
22
|
protected _focused: T | null;
|
24
23
|
private _getKey;
|
25
24
|
protected _isItemSelectable: (item: T) => boolean | undefined;
|
26
|
-
constructor({ data, selected, focused, getKey, getChildren, isItemSelectable }?: TableSelectionConfig<T>);
|
25
|
+
constructor({ data, selected, focused, getKey, getChildren, isItemSelectable, }?: TableSelectionConfig<T>);
|
27
26
|
protected _buildData(data: readonly T[] | null | undefined): Set<T>;
|
28
27
|
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
29
28
|
cloneWith({ data, selected, focused }: CloneWithConfig<T>): Selection<T>;
|
@@ -2,7 +2,7 @@ import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPl
|
|
2
2
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import classNames from 'classnames';
|
5
|
-
import {
|
5
|
+
import { s as style } from '../_helpers/table.js';
|
6
6
|
import TableContainer from './table.js';
|
7
7
|
import Selection$1 from './selection.js';
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
@@ -67,7 +67,7 @@ class SimpleTable extends PureComponent {
|
|
67
67
|
data: this.props.data
|
68
68
|
})
|
69
69
|
});
|
70
|
-
_defineProperty(this, "classes", classNames(
|
70
|
+
_defineProperty(this, "classes", classNames(style.disabledHover, this.props.className));
|
71
71
|
}
|
72
72
|
render() {
|
73
73
|
return /*#__PURE__*/jsx(TableContainer, _objectSpread2(_objectSpread2({}, this.props), {}, {
|
@@ -18,7 +18,6 @@ export interface ReorderParams<T> {
|
|
18
18
|
export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps<HTMLTableRowElement>, SelectionShortcutsAddProps<T>, DisableHoverAddProps {
|
19
19
|
data: readonly T[];
|
20
20
|
columns: readonly Column<T>[] | ((item: T | null) => readonly Column<T>[]);
|
21
|
-
maxColSpan?: number;
|
22
21
|
isItemSelectable: (item: T) => boolean;
|
23
22
|
loading: boolean;
|
24
23
|
onSort: (params: SortParams) => void;
|
@@ -8,7 +8,7 @@ import getUID from '../global/get-uid.js';
|
|
8
8
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
9
9
|
import Loader from '../loader/loader.js';
|
10
10
|
import Header from './header.js';
|
11
|
-
import {
|
11
|
+
import { s as style } from '../_helpers/table.js';
|
12
12
|
import selectionShortcutsHOC from './selection-shortcuts-hoc.js';
|
13
13
|
import disableHoverHOC from './disable-hover-hoc.js';
|
14
14
|
import RowWithFocusSensorCallbacks from './row-with-focus-sensor.js';
|
@@ -190,21 +190,20 @@ class Table extends PureComponent {
|
|
190
190
|
onItemDoubleClick,
|
191
191
|
onItemClick,
|
192
192
|
renderEmpty,
|
193
|
-
maxColSpan,
|
194
193
|
RowComponent
|
195
194
|
} = this.props;
|
196
195
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
196
|
+
const columnsArray = typeof columns === 'function' ? columns(null) : columns;
|
197
197
|
const headerProps = {
|
198
198
|
caption,
|
199
199
|
selectable,
|
200
200
|
draggable,
|
201
|
-
columns:
|
201
|
+
columns: columnsArray,
|
202
202
|
onSort,
|
203
203
|
sortKey,
|
204
204
|
sortOrder,
|
205
205
|
sticky: stickyHeader,
|
206
|
-
topStickOffset: stickyHeaderOffset
|
207
|
-
maxColSpan: this.props.maxColSpan
|
206
|
+
topStickOffset: stickyHeaderOffset
|
208
207
|
};
|
209
208
|
const selectedSize = selection.getSelected().size;
|
210
209
|
const allSelectedSize = selection.selectAll().getSelected().size;
|
@@ -212,15 +211,15 @@ class Table extends PureComponent {
|
|
212
211
|
headerProps.onCheckboxChange = this.onCheckboxChange;
|
213
212
|
headerProps.checkboxDisabled = this.props.data.length === 0;
|
214
213
|
const wrapperClasses = classNames({
|
215
|
-
[
|
216
|
-
[
|
214
|
+
[style.tableWrapper]: true,
|
215
|
+
[style.loading]: loading
|
217
216
|
});
|
218
217
|
const classes = classNames(this.props.className, {
|
219
|
-
[
|
220
|
-
[
|
221
|
-
[
|
222
|
-
[
|
223
|
-
[
|
218
|
+
[style.table]: true,
|
219
|
+
[style.wideFirstColumn]: this.props.wideFirstColumn,
|
220
|
+
[style.multiSelection]: selection.getSelected().size > 0,
|
221
|
+
[style.userSelectNone]: this.state.userSelectNone,
|
222
|
+
[style.disabledHover]: this.props.disabledHover
|
224
223
|
});
|
225
224
|
const renderList = _ref3 => {
|
226
225
|
let {
|
@@ -229,8 +228,8 @@ class Table extends PureComponent {
|
|
229
228
|
} = _ref3;
|
230
229
|
const empty = /*#__PURE__*/jsx("tr", {
|
231
230
|
children: /*#__PURE__*/jsx("td", {
|
232
|
-
colSpan:
|
233
|
-
className:
|
231
|
+
colSpan: columnsArray.length || 1,
|
232
|
+
className: style.tableMessage,
|
234
233
|
children: renderEmpty ? renderEmpty() : null
|
235
234
|
})
|
236
235
|
});
|
@@ -279,21 +278,20 @@ class Table extends PureComponent {
|
|
279
278
|
showDisabledSelection: isDisabledSelectionVisible(value),
|
280
279
|
checkboxTooltip: getCheckboxTooltip(value),
|
281
280
|
className: classNames(getItemClassName(value), {
|
282
|
-
[
|
281
|
+
[style.draggingRow]: isDragged
|
283
282
|
}),
|
284
283
|
metaColumnClassName: getMetaColumnClassName(value),
|
285
284
|
draggable: draggable,
|
286
285
|
alwaysShowDragHandle: alwaysShowDragHandle,
|
287
286
|
dragHandleTitle: dragHandleTitle,
|
288
287
|
columns: columns,
|
289
|
-
"data-test": getItemDataTest(value)
|
290
|
-
maxColSpan: maxColSpan
|
288
|
+
"data-test": getItemDataTest(value)
|
291
289
|
}, restProps), {}, {
|
292
290
|
key: (_restProps$key = restProps.key) !== null && _restProps$key !== void 0 ? _restProps$key : getItemKey(value)
|
293
291
|
}));
|
294
292
|
return isDragged ? /*#__PURE__*/jsx("table", {
|
295
293
|
style: _objectSpread2({}, props.style),
|
296
|
-
className:
|
294
|
+
className: style.draggingTable,
|
297
295
|
children: /*#__PURE__*/jsx("tbody", {
|
298
296
|
children: row
|
299
297
|
})
|
@@ -321,7 +319,7 @@ class Table extends PureComponent {
|
|
321
319
|
}))
|
322
320
|
})
|
323
321
|
}), loading && /*#__PURE__*/jsx("div", {
|
324
|
-
className:
|
322
|
+
className: style.loadingOverlay,
|
325
323
|
children: /*#__PURE__*/jsx(Loader, {
|
326
324
|
className: loaderClassName
|
327
325
|
})
|
@@ -17,5 +17,5 @@ export interface MoreButtonProps {
|
|
17
17
|
morePopupItemClassName?: string | undefined;
|
18
18
|
morePopupBeforeEnd: ReactNode;
|
19
19
|
}
|
20
|
-
export declare const MoreButton: import("react").MemoExoticComponent<({ items, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupItemClassName, morePopupBeforeEnd }: MoreButtonProps) => import("react").JSX.Element | null>;
|
20
|
+
export declare const MoreButton: import("react").MemoExoticComponent<({ items, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupItemClassName, morePopupBeforeEnd, }: MoreButtonProps) => import("react").JSX.Element | null>;
|
21
21
|
export declare const FakeMoreButton: import("react").MemoExoticComponent<({ moreClassName, moreActiveClassName, hasActiveChildren }: FakeMoreButtonProps) => import("react").JSX.Element>;
|
@@ -7,7 +7,7 @@ import PopupMenu, { ListProps } from '../popup-menu/popup-menu.js';
|
|
7
7
|
import Dropdown from '../dropdown/dropdown.js';
|
8
8
|
import Link from '../link/link.js';
|
9
9
|
import Icon from '../icon/icon.js';
|
10
|
-
import {
|
10
|
+
import { s as styles } from '../_helpers/tab-link.js';
|
11
11
|
import getTabTitles from './collapsible-tab.js';
|
12
12
|
import { CustomItem } from './custom-item.js';
|
13
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
@@ -76,14 +76,14 @@ const AnchorLink = _ref => {
|
|
76
76
|
moreActiveClassName
|
77
77
|
} = _ref,
|
78
78
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
79
|
-
const classnames = classNames(
|
79
|
+
const classnames = classNames(styles.title, hasActiveChildren && styles.selected, hasActiveChildren && moreActiveClassName, moreClassName);
|
80
80
|
return /*#__PURE__*/jsxs(Link, _objectSpread2(_objectSpread2({
|
81
81
|
title: 'More',
|
82
82
|
className: classnames
|
83
83
|
}, restProps), {}, {
|
84
84
|
children: ['More', /*#__PURE__*/jsx(Icon, {
|
85
85
|
glyph: chevronDown,
|
86
|
-
className:
|
86
|
+
className: styles.chevron
|
87
87
|
})]
|
88
88
|
}));
|
89
89
|
};
|
@@ -128,7 +128,7 @@ const MoreButton = /*#__PURE__*/memo(_ref2 => {
|
|
128
128
|
popupItems.push({
|
129
129
|
template: morePopupBeforeEnd,
|
130
130
|
key: 'before-end-content',
|
131
|
-
className:
|
131
|
+
className: styles.morePopupBeforeEnd,
|
132
132
|
rgItemType: ListProps.Type.CUSTOM
|
133
133
|
});
|
134
134
|
}
|
@@ -149,7 +149,7 @@ const MoreButton = /*#__PURE__*/memo(_ref2 => {
|
|
149
149
|
return null;
|
150
150
|
}
|
151
151
|
return /*#__PURE__*/jsx("div", {
|
152
|
-
className: classNames(
|
152
|
+
className: classNames(styles.title, moreClassName, hasActiveChild && moreActiveClassName),
|
153
153
|
children: /*#__PURE__*/jsx(Dropdown, {
|
154
154
|
hoverMode: true,
|
155
155
|
anchor: popupAnchor,
|
@@ -165,7 +165,7 @@ const FakeMoreButton = /*#__PURE__*/memo(_ref3 => {
|
|
165
165
|
hasActiveChildren
|
166
166
|
} = _ref3;
|
167
167
|
return /*#__PURE__*/jsx("div", {
|
168
|
-
className: classNames(
|
168
|
+
className: classNames(styles.moreButton, styles.title),
|
169
169
|
children: /*#__PURE__*/jsx(AnchorLink, {
|
170
170
|
moreClassName: moreClassName,
|
171
171
|
moreActiveClassName: moreActiveClassName,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import * as React from 'react';
|
3
3
|
import classNames from 'classnames';
|
4
|
-
import {
|
4
|
+
import { s as styles, T as TabLink } from '../_helpers/tab-link.js';
|
5
5
|
import { CustomItem } from './custom-item.js';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
7
|
import '../link/link.js';
|
@@ -34,9 +34,9 @@ const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
|
|
34
34
|
collapsedClassName,
|
35
35
|
collapsedActiveClassName
|
36
36
|
} = child.props;
|
37
|
-
const titleClasses = classNames(
|
38
|
-
[
|
39
|
-
[
|
37
|
+
const titleClasses = classNames(styles.title, className, {
|
38
|
+
[styles.selected]: selected,
|
39
|
+
[styles.collapsed]: collapsed,
|
40
40
|
[activeClassName !== null && activeClassName !== void 0 ? activeClassName : '']: selected,
|
41
41
|
[collapsedClassName !== null && collapsedClassName !== void 0 ? collapsedClassName : '']: collapsed,
|
42
42
|
[collapsedActiveClassName !== null && collapsedActiveClassName !== void 0 ? collapsedActiveClassName : '']: collapsed && selected
|
@@ -11,6 +11,6 @@ export interface CollapsibleTabsProps {
|
|
11
11
|
initialVisibleItems?: number | null | undefined;
|
12
12
|
morePopupBeforeEnd?: ReactNode;
|
13
13
|
}
|
14
|
-
export declare const CollapsibleTabs: ({ children, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupBeforeEnd, morePopupItemClassName, initialVisibleItems }: CollapsibleTabsProps) => import("react").JSX.Element;
|
15
|
-
declare const _default: import("react").MemoExoticComponent<({ children, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupBeforeEnd, morePopupItemClassName, initialVisibleItems }: CollapsibleTabsProps) => import("react").JSX.Element>;
|
14
|
+
export declare const CollapsibleTabs: ({ children, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupBeforeEnd, morePopupItemClassName, initialVisibleItems, }: CollapsibleTabsProps) => import("react").JSX.Element;
|
15
|
+
declare const _default: import("react").MemoExoticComponent<({ children, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupBeforeEnd, morePopupItemClassName, initialVisibleItems, }: CollapsibleTabsProps) => import("react").JSX.Element>;
|
16
16
|
export default _default;
|
@@ -5,7 +5,7 @@ import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
5
|
import { memo, useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import fastdom from 'fastdom';
|
8
|
-
import {
|
8
|
+
import { s as styles } from '../_helpers/tab-link.js';
|
9
9
|
import { MoreButton, FakeMoreButton } from './collapsible-more.js';
|
10
10
|
import getTabTitles from './collapsible-tab.js';
|
11
11
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
@@ -257,11 +257,11 @@ const CollapsibleTabs = _ref => {
|
|
257
257
|
};
|
258
258
|
}, [adjustTabs]);
|
259
259
|
const isAdjusted = elements.lastVisibleIndex !== null && preparedElements.ready === true || initialVisibleItems;
|
260
|
-
const className = classNames(
|
260
|
+
const className = classNames(styles.titles, styles.autoCollapse, isAdjusted && styles.adjusted);
|
261
261
|
return /*#__PURE__*/jsxs("div", {
|
262
|
-
className:
|
262
|
+
className: styles.autoCollapseContainer,
|
263
263
|
children: [/*#__PURE__*/jsxs("div", {
|
264
|
-
className: classNames(className,
|
264
|
+
className: classNames(className, styles.rendered),
|
265
265
|
children: [visibleElements, /*#__PURE__*/jsx(MoreButton, {
|
266
266
|
moreClassName: moreClassName,
|
267
267
|
moreActiveClassName: moreActiveClassName,
|
@@ -274,7 +274,7 @@ const CollapsibleTabs = _ref => {
|
|
274
274
|
})]
|
275
275
|
}), /*#__PURE__*/jsxs("div", {
|
276
276
|
ref: measureRef,
|
277
|
-
className: classNames(className,
|
277
|
+
className: classNames(className, styles.measure),
|
278
278
|
children: [childrenToMeasure, /*#__PURE__*/jsx(FakeMoreButton, {
|
279
279
|
hasActiveChildren: preparedElements.hidden.some(item => item.props.alwaysHidden && item.props.id === selected),
|
280
280
|
moreClassName: moreClassName,
|
@@ -5,7 +5,7 @@ import { PureComponent } from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import memoize from '../global/memoize.js';
|
7
7
|
import joinDataTestAttributes from '../global/data-tests.js';
|
8
|
-
import {
|
8
|
+
import { s as styles, T as TabLink } from '../_helpers/tab-link.js';
|
9
9
|
import CollapsibleTabs from './collapsible-tabs.js';
|
10
10
|
import { CustomItem } from './custom-item.js';
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
@@ -95,8 +95,8 @@ class Tabs extends PureComponent {
|
|
95
95
|
} = child.props;
|
96
96
|
const key = id || String(i);
|
97
97
|
const isSelected = key === selected;
|
98
|
-
const titleClasses = classNames(
|
99
|
-
[
|
98
|
+
const titleClasses = classNames(styles.title, className, isSelected && activeClassName, {
|
99
|
+
[styles.selected]: isSelected
|
100
100
|
});
|
101
101
|
return /*#__PURE__*/jsx(TabLink, _objectSpread2({
|
102
102
|
title: title,
|
@@ -119,7 +119,7 @@ class Tabs extends PureComponent {
|
|
119
119
|
'data-test': dataTest
|
120
120
|
} = _this$props,
|
121
121
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
122
|
-
const classes = classNames(
|
122
|
+
const classes = classNames(styles.tabs, className);
|
123
123
|
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
124
124
|
return /*#__PURE__*/jsxs("div", {
|
125
125
|
className: classes,
|
@@ -129,7 +129,7 @@ class Tabs extends PureComponent {
|
|
129
129
|
selected: selected,
|
130
130
|
children: childrenArray
|
131
131
|
})) : /*#__PURE__*/jsx("div", {
|
132
|
-
className:
|
132
|
+
className: styles.titles,
|
133
133
|
children: childrenArray.map(this.getTabTitle)
|
134
134
|
}), /*#__PURE__*/jsx("div", {
|
135
135
|
className: classNames(tabContainerClassName),
|