@jetbrains/ring-ui-built 7.0.124 → 8.0.0-beta.10
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 +1 -1
- package/components/_helpers/avatar-info.js +3 -5
- package/components/_helpers/caption.js +1 -1
- package/components/_helpers/icon-svg.js +37 -52
- package/components/_helpers/legacy-table.js +3 -0
- package/components/_helpers/tab-link.js +1 -1
- package/components/_helpers/table.js +2 -2
- package/components/_helpers/theme.js +49 -37
- package/components/alert/alert-actions.js +1 -1
- package/components/alert/alert-heading.js +1 -1
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +2 -2
- package/components/auth/auth-core.js +2 -2
- package/components/auth/auth.js +2 -2
- package/components/auth/down-notification.js +2 -2
- package/components/auth/iframe-flow.js +1 -1
- package/components/auth/storage.js +2 -2
- package/components/auth-dialog/auth-dialog.js +2 -2
- package/components/auth-dialog-service/auth-dialog-service.js +2 -2
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar-size.d.ts +0 -4
- package/components/avatar/avatar-size.js +0 -4
- package/components/avatar/avatar.js +1 -8
- package/components/avatar/fallback-avatar.js +3 -48
- package/components/avatar-stack/avatar-stack.js +5 -5
- package/components/banner/banner.js +2 -2
- package/components/button/button.d.ts +0 -4
- package/components/button/button.js +4 -10
- package/components/button-group/button-group.js +1 -1
- package/components/button-toolbar/button-toolbar.js +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +1 -2
- package/components/clipboard/clipboard.js +2 -2
- package/components/collapse/collapse-content.js +35 -43
- package/components/collapse/collapse-context.d.ts +1 -0
- package/components/collapse/collapse-context.js +1 -0
- package/components/collapse/collapse-control.js +5 -5
- package/components/collapse/collapse.js +34 -25
- package/components/collapsible-group/collapsible-group.d.ts +5 -1
- package/components/collapsible-group/collapsible-group.js +80 -98
- package/components/components/util-stories.js +63 -1
- package/components/confirm/confirm.js +2 -2
- package/components/confirm-service/confirm-service.js +4 -4
- package/components/contenteditable/contenteditable.js +4 -5
- package/components/control-help/control-help.js +1 -1
- package/components/control-label/control-label.js +1 -1
- package/components/data-list/data-list.d.ts +4 -4
- package/components/data-list/data-list.js +5 -5
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +2 -2
- package/components/data-list/item.d.ts +1 -1
- package/components/data-list/item.js +3 -3
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +2 -2
- package/components/data-list/title.js +1 -2
- package/components/date-picker/date-input.js +2 -2
- package/components/date-picker/date-picker.js +2 -3
- package/components/date-picker/date-popup.js +4 -5
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.d.ts +0 -2
- package/components/date-picker/month.js +17 -18
- package/components/date-picker/months.js +43 -36
- package/components/date-picker/use-scroll-behavior.js +45 -45
- package/components/date-picker/weekdays.js +1 -1
- package/components/date-picker/years.js +61 -55
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +5 -5
- package/components/dropdown/anchor.js +3 -3
- package/components/dropdown/dropdown.js +3 -3
- package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
- package/components/dropdown-menu/dropdown-menu.js +63 -58
- package/components/editable-heading/editable-heading.d.ts +1 -2
- package/components/editable-heading/editable-heading.js +14 -13
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +1 -2
- package/components/footer/footer.js +1 -1
- package/components/global/compose-refs.d.ts +2 -1
- package/components/global/compose-refs.js +44 -8
- package/components/global/configuration.d.ts +0 -5
- package/components/global/configuration.js +2 -10
- package/components/global/controls-height.js +1 -1
- package/components/global/create-stateful-context.js +11 -11
- package/components/global/focus-sensor-hoc.js +1 -0
- package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
- package/components/global/focus-with-temporary-tabindex.js +23 -0
- package/components/global/intersection-observer-context.d.ts +46 -0
- package/components/global/intersection-observer-context.js +138 -0
- package/components/global/is-within-interactive-element.d.ts +6 -0
- package/components/global/is-within-interactive-element.js +11 -0
- package/components/global/is-within-navigable-element.d.ts +6 -0
- package/components/global/is-within-navigable-element.js +11 -0
- package/components/global/parse-css-duration.d.ts +5 -0
- package/components/global/parse-css-duration.js +14 -0
- package/components/global/rerender-hoc.d.ts +4 -2
- package/components/global/rerender-hoc.js +11 -24
- package/components/global/schedule-with-cleanup.d.ts +12 -0
- package/components/global/schedule-with-cleanup.js +36 -0
- package/components/{table/selection.d.ts → global/table-selection.d.ts} +15 -15
- package/components/{table/selection.js → global/table-selection.js} +5 -5
- package/components/global/theme.d.ts +4 -3
- package/components/global/theme.js +1 -1
- package/components/global/variables.interface.d.ts +0 -4
- package/components/header/header-icon.js +3 -3
- package/components/header/header.js +3 -3
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -2
- package/components/header/profile.js +5 -5
- package/components/header/services.js +3 -3
- package/components/header/smart-profile.js +3 -3
- package/components/header/smart-services.js +3 -3
- package/components/heading/heading.js +1 -1
- package/components/i18n/i18n-context.js +4 -4
- package/components/icon/icon-svg.js +1 -2
- package/components/icon/icon.d.ts +0 -1
- package/components/icon/icon.js +2 -6
- package/components/icon/index.js +1 -2
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +3 -3
- package/components/internal/reorder-animation-context.js +159 -0
- package/components/internal/reorder-handle.js +750 -0
- package/components/internal/reorder-layout-context.js +141 -0
- package/components/internal/table-header.js +685 -0
- package/components/internal/virtualization.js +368 -0
- package/components/island/adaptive-island-hoc.js +3 -3
- package/components/island/content.d.ts +7 -2
- package/components/island/content.js +27 -18
- package/components/island/header.js +1 -1
- package/components/island/island.js +1 -1
- package/components/{table → legacy-table}/cell.js +1 -1
- package/components/{table → legacy-table}/header-cell.js +2 -3
- package/components/{table → legacy-table}/header.js +2 -3
- package/components/{table → legacy-table}/multitable.d.ts +1 -1
- package/components/{table → legacy-table}/row-with-focus-sensor.js +3 -3
- package/components/{table → legacy-table}/row.d.ts +1 -1
- package/components/{table → legacy-table}/row.js +5 -5
- package/components/legacy-table/selection-adapter.d.ts +6 -0
- package/components/{table → legacy-table}/selection-shortcuts-hoc.d.ts +5 -5
- package/components/{table → legacy-table}/simple-table.d.ts +2 -2
- package/components/{table → legacy-table}/simple-table.js +5 -5
- package/components/{table → legacy-table}/smart-table.d.ts +5 -5
- package/components/{table → legacy-table}/smart-table.js +6 -6
- package/components/legacy-table/table.d.ts +109 -0
- package/components/legacy-table/table.js +369 -0
- package/components/list/consts.d.ts +0 -1
- package/components/list/consts.js +0 -1
- package/components/list/list-item.js +3 -5
- package/components/list/list-users-groups-source.js +1 -2
- package/components/list/list.d.ts +0 -4
- package/components/list/list.js +1 -2
- package/components/login-dialog/login-dialog.js +3 -3
- package/components/login-dialog/service.js +2 -2
- package/components/message/message.js +1 -1
- package/components/pager/pager.js +3 -3
- package/components/popup/popup.js +1 -1
- package/components/popup/popup.target.d.ts +3 -2
- package/components/popup/popup.target.js +32 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/query-assist/query-assist-suggestions.js +1 -2
- package/components/query-assist/query-assist.d.ts +3 -1
- package/components/query-assist/query-assist.js +2 -2
- package/components/radio/radio-item.d.ts +3 -3
- package/components/radio/radio-item.js +33 -19
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +2 -2
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/chevron-button.js +3 -3
- package/components/select/select-filter.js +3 -3
- package/components/select/select-popup.d.ts +3 -2
- package/components/select/select-popup.js +9 -4
- package/components/select/select.d.ts +6 -2
- package/components/select/select.js +5 -4
- package/components/selection-toolbar/selection-toolbar.d.ts +11 -0
- package/components/selection-toolbar/selection-toolbar.js +200 -0
- package/components/slider/slider.js +100 -97
- package/components/storage/storage-local.js +2 -2
- package/components/storage/storage.js +2 -2
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +3 -3
- package/components/tab-trap/tab-trap.js +83 -80
- package/components/table/default-item-renderer.d.ts +55 -0
- package/components/table/default-item-renderer.js +240 -0
- package/components/table/internal/reorder-animation-context.d.ts +21 -0
- package/components/table/internal/reorder-handle.d.ts +9 -0
- package/components/table/internal/reorder-layout-context.d.ts +16 -0
- package/components/table/internal/table-header.d.ts +1 -0
- package/components/table/internal/virtualization.d.ts +41 -0
- package/components/table/item-virtualization.d.ts +37 -0
- package/components/table/item-virtualization.js +73 -0
- package/components/table/reorder-animation.d.ts +37 -0
- package/components/table/reorder-animation.js +18 -0
- package/components/table/reorder-item-layout.d.ts +32 -0
- package/components/table/reorder-item-layout.js +57 -0
- package/components/table/table-const.d.ts +10 -0
- package/components/table/table-const.js +13 -0
- package/components/table/table-primitives.d.ts +64 -0
- package/components/table/table-primitives.js +180 -0
- package/components/table/table-props.d.ts +304 -0
- package/components/table/table-props.js +1 -0
- package/components/table/table.d.ts +231 -107
- package/components/table/table.js +351 -346
- package/components/tabs/collapsible-more.js +1 -1
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.js +1 -1
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tabs/tab-link.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.d.ts +3 -1
- package/components/tags-input/tags-input.js +4 -4
- package/components/tags-list/tags-list.js +2 -2
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.d.ts +2 -1
- package/components/tooltip/tooltip.js +5 -3
- package/components/upload/upload.d.ts +4 -3
- package/components/upload/upload.js +7 -30
- package/components/user-agreement/service.js +3 -3
- package/components/user-agreement/user-agreement.js +2 -2
- package/components/user-card/card.js +4 -4
- package/components/user-card/smart-user-card-tooltip.js +3 -3
- package/components/user-card/tooltip.js +3 -3
- package/components/user-card/user-card.js +5 -5
- package/components/util-stories.d.ts +26 -0
- package/package.json +8 -9
- package/components/__mocks__/old-browsers-message.js +0 -3
- package/components/_helpers/grid.js +0 -3
- package/components/_helpers/sidebar.js +0 -110
- package/components/content-layout/content-layout.d.ts +0 -20
- package/components/content-layout/content-layout.js +0 -50
- package/components/content-layout/sidebar.d.ts +0 -26
- package/components/content-layout/sidebar.js +0 -5
- package/components/date-picker/use-intersection-observer.d.ts +0 -6
- package/components/date-picker/use-intersection-observer.js +0 -93
- package/components/expand/collapsible-group.d.ts +0 -8
- package/components/expand/collapsible-group.js +0 -52
- package/components/global/composeRefs.d.ts +0 -6
- package/components/global/composeRefs.js +0 -9
- package/components/global/use-event-callback.d.ts +0 -4
- package/components/global/use-event-callback.js +0 -49
- package/components/grid/col.d.ts +0 -16
- package/components/grid/col.js +0 -63
- package/components/grid/grid.d.ts +0 -13
- package/components/grid/grid.js +0 -27
- package/components/grid/row.d.ts +0 -21
- package/components/grid/row.js +0 -72
- package/components/old-browsers-message/old-browsers-message-stop.d.ts +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -5
- package/components/old-browsers-message/old-browsers-message.d.ts +0 -5
- package/components/old-browsers-message/old-browsers-message.js +0 -89
- package/components/old-browsers-message/white-list.d.ts +0 -2
- package/components/old-browsers-message/white-list.js +0 -30
- package/components/table/selection-adapter.d.ts +0 -6
- /package/components/{table → legacy-table}/cell.d.ts +0 -0
- /package/components/{table → legacy-table}/disable-hover-hoc.d.ts +0 -0
- /package/components/{table → legacy-table}/disable-hover-hoc.js +0 -0
- /package/components/{table → legacy-table}/header-cell.d.ts +0 -0
- /package/components/{table → legacy-table}/header.d.ts +0 -0
- /package/components/{table → legacy-table}/multitable.js +0 -0
- /package/components/{table → legacy-table}/row-with-focus-sensor.d.ts +0 -0
- /package/components/{table → legacy-table}/selection-adapter.js +0 -0
- /package/components/{table → legacy-table}/selection-shortcuts-hoc.js +0 -0
|
@@ -1,369 +1,374 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useRef, Fragment } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import '
|
|
4
|
+
import { useVirtualItems, SpacerRow, VirtualizationContext } from '../internal/virtualization.js';
|
|
5
|
+
import { DefaultItemRenderer } from './default-item-renderer.js';
|
|
6
|
+
import { TablePropsContext, defaultRowHeight } from './table-const.js';
|
|
7
|
+
import { focusWithTemporaryTabIndex } from '../global/focus-with-temporary-tabindex.js';
|
|
8
|
+
import { useReorderAnimationContextValue, ReorderAnimationContext } from '../internal/reorder-animation-context.js';
|
|
9
|
+
import { useComposedRef } from '../global/compose-refs.js';
|
|
10
|
+
import { TableHeader } from '../internal/table-header.js';
|
|
11
|
+
import { keyboardFocusableAttrName } from './table-primitives.js';
|
|
12
|
+
import { isWithinNavigableElement } from '../global/is-within-navigable-element.js';
|
|
13
|
+
import { useReorderLayoutContextValue, ReorderLayoutContext } from '../internal/reorder-layout-context.js';
|
|
14
|
+
import { s as styles } from '../_helpers/table.js';
|
|
15
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
16
|
+
import '../global/intersection-observer-context.js';
|
|
17
|
+
import '../global/schedule-with-cleanup.js';
|
|
18
|
+
import './item-virtualization.js';
|
|
19
|
+
import './reorder-item-layout.js';
|
|
15
20
|
import 'memoize-one';
|
|
16
|
-
import '../
|
|
17
|
-
import '
|
|
18
|
-
import 'combokeys';
|
|
19
|
-
import '../global/sniffer.js';
|
|
20
|
-
import 'sniffr';
|
|
21
|
-
import '../_helpers/loader-core.js';
|
|
22
|
-
import '../global/dom.js';
|
|
23
|
-
import '../checkbox/checkbox.js';
|
|
24
|
-
import '@jetbrains/icons/checkmark-12px';
|
|
25
|
-
import '@jetbrains/icons/remove-12px';
|
|
21
|
+
import '../internal/reorder-handle.js';
|
|
22
|
+
import '@jetbrains/icons/drag-12px';
|
|
26
23
|
import '../icon/icon.js';
|
|
27
24
|
import 'util-deprecate';
|
|
28
25
|
import '../icon/icon.constants.js';
|
|
29
26
|
import '../_helpers/icon-svg.js';
|
|
30
|
-
import 'react-compiler-runtime';
|
|
31
|
-
import '../global/configuration.js';
|
|
32
27
|
import '../global/memoize.js';
|
|
33
|
-
import '../
|
|
34
|
-
import '
|
|
35
|
-
import '
|
|
28
|
+
import '../global/parse-css-duration.js';
|
|
29
|
+
import '@jetbrains/icons/arrow-12px-down';
|
|
30
|
+
import '@jetbrains/icons/arrow-12px-up';
|
|
31
|
+
import '@jetbrains/icons/settings-12px';
|
|
32
|
+
import '@jetbrains/icons/trash-12px';
|
|
36
33
|
import '@jetbrains/icons/unsorted-12px';
|
|
37
|
-
import '
|
|
38
|
-
import './row.js';
|
|
39
|
-
import '@jetbrains/icons/chevron-right';
|
|
40
|
-
import '@jetbrains/icons/chevron-down';
|
|
41
|
-
import '@jetbrains/icons/drag';
|
|
42
|
-
import '../button/button.js';
|
|
43
|
-
import '../link/clickable-link.js';
|
|
44
|
-
import '../global/controls-height.js';
|
|
45
|
-
import '../_helpers/button.classes.js';
|
|
46
|
-
import '../tooltip/tooltip.js';
|
|
47
|
-
import '../popup/popup.js';
|
|
48
|
-
import 'react-dom';
|
|
49
|
-
import '../global/schedule-raf.js';
|
|
50
|
-
import '../tab-trap/tab-trap.js';
|
|
51
|
-
import '../popup/position.js';
|
|
52
|
-
import '../popup/popup.consts.js';
|
|
53
|
-
import '../popup/popup.target.js';
|
|
54
|
-
import '../popup/position-css.js';
|
|
55
|
-
import '../_helpers/theme.js';
|
|
56
|
-
import './cell.js';
|
|
34
|
+
import '../global/is-within-interactive-element.js';
|
|
57
35
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onReorder: () => {},
|
|
64
|
-
getItemKey: item => {
|
|
65
|
-
// Default behavior stays backward compatible: use item's "id" if present
|
|
66
|
-
if ('id' in item) {
|
|
67
|
-
return item.id;
|
|
68
|
-
}
|
|
69
|
-
// If there's no id provided on item and no getKey supplied, fail fast with a clear message
|
|
70
|
-
throw new Error('Table: getItemKey is required when items have no "id" property');
|
|
71
|
-
},
|
|
72
|
-
sortKey: 'id',
|
|
73
|
-
sortOrder: true,
|
|
74
|
-
draggable: false,
|
|
75
|
-
alwaysShowDragHandle: false,
|
|
76
|
-
stickyHeader: true,
|
|
77
|
-
getItemLevel: () => 0,
|
|
78
|
-
getItemClassName: () => null,
|
|
79
|
-
getMetaColumnClassName: () => null,
|
|
80
|
-
getItemDataTest: () => null,
|
|
81
|
-
isItemCollapsible: () => false,
|
|
82
|
-
isParentCollapsible: () => false,
|
|
83
|
-
isItemCollapsed: () => false,
|
|
84
|
-
onItemCollapse: () => {},
|
|
85
|
-
onItemExpand: () => {},
|
|
86
|
-
onItemDoubleClick: () => {},
|
|
87
|
-
onItemClick: () => {},
|
|
88
|
-
remoteSelection: false,
|
|
89
|
-
isDisabledSelectionVisible: () => false,
|
|
90
|
-
getCheckboxTooltip: () => undefined,
|
|
91
|
-
RowComponent: RowWithFocusSensorCallbacks,
|
|
92
|
-
wideFirstColumn: false
|
|
93
|
-
};
|
|
94
|
-
state = {
|
|
95
|
-
shortcutsScope: getUID('ring-table-'),
|
|
96
|
-
userSelectNone: false
|
|
97
|
-
};
|
|
98
|
-
componentDidMount() {
|
|
99
|
-
document.addEventListener('mouseup', this.onMouseUp);
|
|
100
|
-
}
|
|
101
|
-
componentDidUpdate({
|
|
102
|
-
data,
|
|
103
|
-
selection,
|
|
104
|
-
onSelect,
|
|
105
|
-
selectable,
|
|
106
|
-
remoteSelection
|
|
107
|
-
}) {
|
|
108
|
-
if (data !== this.props.data && remoteSelection) {
|
|
109
|
-
onSelect(selection.cloneWith({
|
|
110
|
-
data: this.props.data
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
if (!this.props.selectable && this.props.selectable !== selectable) {
|
|
114
|
-
onSelect(selection.resetSelection());
|
|
36
|
+
function Table(props) {
|
|
37
|
+
const $ = c(68);
|
|
38
|
+
if ($[0] !== "0b2671256cf6184450b7f5a987c20b706c8cb7e8a0bf848df36efecc0eb647dc") {
|
|
39
|
+
for (let $i = 0; $i < 68; $i += 1) {
|
|
40
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
115
41
|
}
|
|
42
|
+
$[0] = "0b2671256cf6184450b7f5a987c20b706c8cb7e8a0bf848df36efecc0eb647dc";
|
|
116
43
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
onRowFocus = row => {
|
|
135
|
-
const {
|
|
136
|
-
selection,
|
|
137
|
-
onSelect
|
|
138
|
-
} = this.props;
|
|
139
|
-
onSelect(selection.focus(row));
|
|
140
|
-
};
|
|
141
|
-
onRowSelect = (row, selected) => {
|
|
142
|
-
const {
|
|
143
|
-
selection,
|
|
144
|
-
onSelect
|
|
145
|
-
} = this.props;
|
|
146
|
-
if (selected) {
|
|
147
|
-
onSelect(selection.select(row));
|
|
148
|
-
} else {
|
|
149
|
-
onSelect(selection.deselect(row));
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
onSortEnd = ({
|
|
153
|
-
oldIndex,
|
|
154
|
-
newIndex
|
|
155
|
-
}) => {
|
|
156
|
-
const data = arrayMove(this.props.data, oldIndex, newIndex);
|
|
157
|
-
this.props.onReorder({
|
|
158
|
-
data,
|
|
159
|
-
oldIndex,
|
|
160
|
-
newIndex
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
onCheckboxChange = e => {
|
|
44
|
+
let className;
|
|
45
|
+
let columns;
|
|
46
|
+
let data;
|
|
47
|
+
let getKey;
|
|
48
|
+
let noColumnReorderAnimation;
|
|
49
|
+
let noItemReorderAnimation;
|
|
50
|
+
let renderItem;
|
|
51
|
+
let restProps;
|
|
52
|
+
let scrollerRef;
|
|
53
|
+
let t0;
|
|
54
|
+
let t1;
|
|
55
|
+
let t2;
|
|
56
|
+
let t3;
|
|
57
|
+
let t4;
|
|
58
|
+
let tbodyClassName;
|
|
59
|
+
let userRef;
|
|
60
|
+
if ($[1] !== props) {
|
|
164
61
|
const {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
onSelect
|
|
170
|
-
} = this.props;
|
|
171
|
-
if (checked) {
|
|
172
|
-
onSelect(selection.selectAll());
|
|
173
|
-
} else {
|
|
174
|
-
onSelect(selection.reset());
|
|
175
|
-
}
|
|
176
|
-
this.restoreFocusWithoutScroll();
|
|
177
|
-
};
|
|
178
|
-
restoreFocusWithoutScroll = () => {
|
|
179
|
-
const {
|
|
180
|
-
scrollX,
|
|
181
|
-
scrollY
|
|
182
|
-
} = window;
|
|
183
|
-
this.props.onFocusRestore();
|
|
184
|
-
window.scrollTo(scrollX, scrollY);
|
|
185
|
-
};
|
|
186
|
-
render() {
|
|
187
|
-
const {
|
|
188
|
-
data,
|
|
189
|
-
selection,
|
|
190
|
-
columns,
|
|
191
|
-
caption,
|
|
192
|
-
getItemKey,
|
|
193
|
-
selectable,
|
|
194
|
-
focused,
|
|
195
|
-
isItemSelectable,
|
|
196
|
-
getItemLevel,
|
|
197
|
-
getItemClassName,
|
|
198
|
-
getMetaColumnClassName,
|
|
199
|
-
getItemDataTest,
|
|
200
|
-
draggable,
|
|
201
|
-
alwaysShowDragHandle,
|
|
202
|
-
dragHandleTitle,
|
|
203
|
-
loading,
|
|
204
|
-
onSort,
|
|
205
|
-
sortKey,
|
|
206
|
-
sortOrder,
|
|
207
|
-
loaderClassName,
|
|
62
|
+
data: t5,
|
|
63
|
+
columns: t6,
|
|
64
|
+
getKey: t7,
|
|
65
|
+
noHeader,
|
|
208
66
|
stickyHeader,
|
|
209
|
-
stickyHeaderOffset,
|
|
210
|
-
isItemCollapsible,
|
|
211
|
-
isParentCollapsible,
|
|
212
|
-
isItemCollapsed,
|
|
213
|
-
onItemCollapse,
|
|
214
|
-
onItemExpand,
|
|
215
|
-
isDisabledSelectionVisible,
|
|
216
|
-
getCheckboxTooltip,
|
|
217
|
-
onItemDoubleClick,
|
|
218
|
-
onItemClick,
|
|
219
|
-
renderEmpty,
|
|
220
|
-
RowComponent,
|
|
221
|
-
renderLoader
|
|
222
|
-
} = this.props;
|
|
223
|
-
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
|
224
|
-
const columnsArray = typeof columns === 'function' ? columns(null) : columns;
|
|
225
|
-
const headerProps = {
|
|
226
|
-
caption,
|
|
227
|
-
selectable,
|
|
228
|
-
draggable,
|
|
229
|
-
columns: columnsArray,
|
|
230
67
|
onSort,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
68
|
+
onColumnDelete,
|
|
69
|
+
onColumnReorder,
|
|
70
|
+
noColumnReorderAnimation: t8,
|
|
71
|
+
canReorderItem,
|
|
72
|
+
onItemReorder,
|
|
73
|
+
noItemReorderAnimation: t9,
|
|
74
|
+
renderItem: t10,
|
|
75
|
+
virtualizeRows: t11,
|
|
76
|
+
scrollerRef: t12,
|
|
77
|
+
estimateHeight: t13,
|
|
78
|
+
lookaheadPx: t14,
|
|
79
|
+
retentionMarginPx: t15,
|
|
80
|
+
minScrollAndResizeDeltaPx: t16,
|
|
81
|
+
columnEditing,
|
|
82
|
+
onColumnEditingRequest,
|
|
83
|
+
columnEditButton,
|
|
84
|
+
theadClassName,
|
|
85
|
+
theadTrClassName,
|
|
86
|
+
tbodyClassName: t17,
|
|
87
|
+
ref: t18,
|
|
88
|
+
className: t19,
|
|
89
|
+
...t20
|
|
90
|
+
} = props;
|
|
91
|
+
data = t5;
|
|
92
|
+
columns = t6;
|
|
93
|
+
getKey = t7;
|
|
94
|
+
noColumnReorderAnimation = t8;
|
|
95
|
+
noItemReorderAnimation = t9;
|
|
96
|
+
renderItem = t10;
|
|
97
|
+
t0 = t11;
|
|
98
|
+
scrollerRef = t12;
|
|
99
|
+
t1 = t13;
|
|
100
|
+
t2 = t14;
|
|
101
|
+
t3 = t15;
|
|
102
|
+
t4 = t16;
|
|
103
|
+
tbodyClassName = t17;
|
|
104
|
+
userRef = t18;
|
|
105
|
+
className = t19;
|
|
106
|
+
restProps = t20;
|
|
107
|
+
$[1] = props;
|
|
108
|
+
$[2] = className;
|
|
109
|
+
$[3] = columns;
|
|
110
|
+
$[4] = data;
|
|
111
|
+
$[5] = getKey;
|
|
112
|
+
$[6] = noColumnReorderAnimation;
|
|
113
|
+
$[7] = noItemReorderAnimation;
|
|
114
|
+
$[8] = renderItem;
|
|
115
|
+
$[9] = restProps;
|
|
116
|
+
$[10] = scrollerRef;
|
|
117
|
+
$[11] = t0;
|
|
118
|
+
$[12] = t1;
|
|
119
|
+
$[13] = t2;
|
|
120
|
+
$[14] = t3;
|
|
121
|
+
$[15] = t4;
|
|
122
|
+
$[16] = tbodyClassName;
|
|
123
|
+
$[17] = userRef;
|
|
124
|
+
} else {
|
|
125
|
+
className = $[2];
|
|
126
|
+
columns = $[3];
|
|
127
|
+
data = $[4];
|
|
128
|
+
getKey = $[5];
|
|
129
|
+
noColumnReorderAnimation = $[6];
|
|
130
|
+
noItemReorderAnimation = $[7];
|
|
131
|
+
renderItem = $[8];
|
|
132
|
+
restProps = $[9];
|
|
133
|
+
scrollerRef = $[10];
|
|
134
|
+
t0 = $[11];
|
|
135
|
+
t1 = $[12];
|
|
136
|
+
t2 = $[13];
|
|
137
|
+
t3 = $[14];
|
|
138
|
+
t4 = $[15];
|
|
139
|
+
tbodyClassName = $[16];
|
|
140
|
+
userRef = $[17];
|
|
141
|
+
}
|
|
142
|
+
const virtualizeRows = t0 === undefined ? false : t0;
|
|
143
|
+
const estimateHeight = t1 === undefined ? _temp : t1;
|
|
144
|
+
const lookaheadPx = t2 === undefined ? 400 : t2;
|
|
145
|
+
const retentionMarginPx = t3 === undefined ? 450 : t3;
|
|
146
|
+
const minScrollAndResizeDeltaPx = t4 === undefined ? 50 : t4;
|
|
147
|
+
const localRef = useRef(null);
|
|
148
|
+
let t5;
|
|
149
|
+
if ($[18] !== columns || $[19] !== data || $[20] !== noColumnReorderAnimation || $[21] !== noItemReorderAnimation) {
|
|
150
|
+
t5 = {
|
|
151
|
+
noColumnReorderAnimation,
|
|
152
|
+
noItemReorderAnimation,
|
|
153
|
+
tableRef: localRef,
|
|
154
|
+
data,
|
|
155
|
+
columns
|
|
272
156
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
157
|
+
$[18] = columns;
|
|
158
|
+
$[19] = data;
|
|
159
|
+
$[20] = noColumnReorderAnimation;
|
|
160
|
+
$[21] = noItemReorderAnimation;
|
|
161
|
+
$[22] = t5;
|
|
162
|
+
} else {
|
|
163
|
+
t5 = $[22];
|
|
164
|
+
}
|
|
165
|
+
const reorderAnimationContextValue = useReorderAnimationContextValue(t5);
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
168
|
+
t6 = function handleRowNavigation(e) {
|
|
169
|
+
if (e.defaultPrevented || isWithinNavigableElement(e.target)) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const arrowUp = e.key === "ArrowUp";
|
|
173
|
+
const arrowDown = e.key === "ArrowDown";
|
|
174
|
+
if (!arrowUp && !arrowDown) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const currentRow = e.target.closest("tr");
|
|
178
|
+
if (currentRow?.parentElement?.parentElement !== localRef.current) {
|
|
179
|
+
return;
|
|
281
180
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}),
|
|
309
|
-
metaColumnClassName: getMetaColumnClassName(value),
|
|
310
|
-
draggable: draggable,
|
|
311
|
-
alwaysShowDragHandle: alwaysShowDragHandle,
|
|
312
|
-
dragHandleTitle: dragHandleTitle,
|
|
313
|
-
columns: columns,
|
|
314
|
-
"data-test": getItemDataTest(value),
|
|
315
|
-
cellClassName: this.props.cellClassName,
|
|
316
|
-
...restProps,
|
|
317
|
-
key: (_restProps$key = restProps.key) !== null && _restProps$key !== void 0 ? _restProps$key : getItemKey(value)
|
|
318
|
-
});
|
|
319
|
-
return isDragged ? /*#__PURE__*/jsx("table", {
|
|
320
|
-
style: {
|
|
321
|
-
...props.style
|
|
322
|
-
},
|
|
323
|
-
className: style.draggingTable,
|
|
324
|
-
children: /*#__PURE__*/jsx("tbody", {
|
|
325
|
-
children: row
|
|
326
|
-
})
|
|
327
|
-
}) : row;
|
|
181
|
+
let candidate = currentRow;
|
|
182
|
+
while (candidate) {
|
|
183
|
+
candidate = arrowUp ? candidate.previousElementSibling : candidate.nextElementSibling;
|
|
184
|
+
if (candidate?.hasAttribute(keyboardFocusableAttrName)) {
|
|
185
|
+
focusWithTemporaryTabIndex(candidate);
|
|
186
|
+
e.preventDefault();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
$[23] = t6;
|
|
192
|
+
} else {
|
|
193
|
+
t6 = $[23];
|
|
194
|
+
}
|
|
195
|
+
const handleRowNavigation = t6;
|
|
196
|
+
let t7;
|
|
197
|
+
if ($[24] !== data || $[25] !== estimateHeight || $[26] !== lookaheadPx || $[27] !== minScrollAndResizeDeltaPx || $[28] !== retentionMarginPx || $[29] !== scrollerRef || $[30] !== virtualizeRows) {
|
|
198
|
+
t7 = {
|
|
199
|
+
enabled: virtualizeRows,
|
|
200
|
+
data,
|
|
201
|
+
scrollerRef,
|
|
202
|
+
tableRef: localRef,
|
|
203
|
+
estimateHeight,
|
|
204
|
+
lookaheadPx,
|
|
205
|
+
retentionMarginPx,
|
|
206
|
+
minScrollAndResizeDeltaPx
|
|
328
207
|
};
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
208
|
+
$[24] = data;
|
|
209
|
+
$[25] = estimateHeight;
|
|
210
|
+
$[26] = lookaheadPx;
|
|
211
|
+
$[27] = minScrollAndResizeDeltaPx;
|
|
212
|
+
$[28] = retentionMarginPx;
|
|
213
|
+
$[29] = scrollerRef;
|
|
214
|
+
$[30] = virtualizeRows;
|
|
215
|
+
$[31] = t7;
|
|
216
|
+
} else {
|
|
217
|
+
t7 = $[31];
|
|
218
|
+
}
|
|
219
|
+
const {
|
|
220
|
+
virtualItems,
|
|
221
|
+
virtualizationContextValue
|
|
222
|
+
} = useVirtualItems(t7);
|
|
223
|
+
const itemReorderLayoutContextValue = useReorderLayoutContextValue();
|
|
224
|
+
let t8;
|
|
225
|
+
if ($[32] !== className) {
|
|
226
|
+
t8 = classNames(styles.table, className);
|
|
227
|
+
$[32] = className;
|
|
228
|
+
$[33] = t8;
|
|
229
|
+
} else {
|
|
230
|
+
t8 = $[33];
|
|
231
|
+
}
|
|
232
|
+
const t9 = useComposedRef(userRef, localRef);
|
|
233
|
+
let t10;
|
|
234
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
235
|
+
t10 = /*#__PURE__*/jsx(TableHeader, {});
|
|
236
|
+
$[34] = t10;
|
|
237
|
+
} else {
|
|
238
|
+
t10 = $[34];
|
|
239
|
+
}
|
|
240
|
+
const t11 = virtualizeRows ? virtualItems : data;
|
|
241
|
+
let t12;
|
|
242
|
+
if ($[35] !== columns || $[36] !== data || $[37] !== getKey || $[38] !== renderItem || $[39] !== t11 || $[40] !== virtualizeRows) {
|
|
243
|
+
let t13;
|
|
244
|
+
if ($[42] !== columns || $[43] !== data || $[44] !== getKey || $[45] !== renderItem || $[46] !== virtualizeRows) {
|
|
245
|
+
t13 = (item, index) => {
|
|
246
|
+
let dataItem;
|
|
247
|
+
let dataItemIndex;
|
|
248
|
+
if (virtualizeRows) {
|
|
249
|
+
const virtualItem = item;
|
|
250
|
+
if (virtualItem.type === "spacer") {
|
|
251
|
+
return /*#__PURE__*/jsx(SpacerRow, {
|
|
252
|
+
spacer: virtualItem,
|
|
253
|
+
colSpan: columns.length
|
|
254
|
+
}, virtualItem.key);
|
|
255
|
+
}
|
|
256
|
+
dataItemIndex = virtualItem.index;
|
|
257
|
+
if (dataItemIndex < 0 || dataItemIndex >= data.length) {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
dataItem = data[dataItemIndex];
|
|
261
|
+
} else {
|
|
262
|
+
dataItem = item;
|
|
263
|
+
dataItemIndex = index;
|
|
264
|
+
}
|
|
265
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
266
|
+
children: renderItem ? renderItem(dataItem, dataItemIndex, data) : /*#__PURE__*/jsx(DefaultItemRenderer, {
|
|
267
|
+
index: dataItemIndex
|
|
268
|
+
})
|
|
269
|
+
}, getKey(dataItem, dataItemIndex, data));
|
|
270
|
+
};
|
|
271
|
+
$[42] = columns;
|
|
272
|
+
$[43] = data;
|
|
273
|
+
$[44] = getKey;
|
|
274
|
+
$[45] = renderItem;
|
|
275
|
+
$[46] = virtualizeRows;
|
|
276
|
+
$[47] = t13;
|
|
277
|
+
} else {
|
|
278
|
+
t13 = $[47];
|
|
279
|
+
}
|
|
280
|
+
t12 = t11.map(t13);
|
|
281
|
+
$[35] = columns;
|
|
282
|
+
$[36] = data;
|
|
283
|
+
$[37] = getKey;
|
|
284
|
+
$[38] = renderItem;
|
|
285
|
+
$[39] = t11;
|
|
286
|
+
$[40] = virtualizeRows;
|
|
287
|
+
$[41] = t12;
|
|
288
|
+
} else {
|
|
289
|
+
t12 = $[41];
|
|
290
|
+
}
|
|
291
|
+
let t13;
|
|
292
|
+
if ($[48] !== itemReorderLayoutContextValue || $[49] !== t12) {
|
|
293
|
+
t13 = /*#__PURE__*/jsx(ReorderLayoutContext, {
|
|
294
|
+
value: itemReorderLayoutContextValue,
|
|
295
|
+
children: t12
|
|
354
296
|
});
|
|
297
|
+
$[48] = itemReorderLayoutContextValue;
|
|
298
|
+
$[49] = t12;
|
|
299
|
+
$[50] = t13;
|
|
300
|
+
} else {
|
|
301
|
+
t13 = $[50];
|
|
355
302
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
303
|
+
let t14;
|
|
304
|
+
if ($[51] !== t13 || $[52] !== virtualizationContextValue) {
|
|
305
|
+
t14 = /*#__PURE__*/jsx(VirtualizationContext, {
|
|
306
|
+
value: virtualizationContextValue,
|
|
307
|
+
children: t13
|
|
308
|
+
});
|
|
309
|
+
$[51] = t13;
|
|
310
|
+
$[52] = virtualizationContextValue;
|
|
311
|
+
$[53] = t14;
|
|
312
|
+
} else {
|
|
313
|
+
t14 = $[53];
|
|
314
|
+
}
|
|
315
|
+
let t15;
|
|
316
|
+
if ($[54] !== t14 || $[55] !== tbodyClassName) {
|
|
317
|
+
t15 = /*#__PURE__*/jsx("tbody", {
|
|
318
|
+
className: tbodyClassName,
|
|
319
|
+
onKeyDown: handleRowNavigation,
|
|
320
|
+
children: t14
|
|
321
|
+
});
|
|
322
|
+
$[54] = t14;
|
|
323
|
+
$[55] = tbodyClassName;
|
|
324
|
+
$[56] = t15;
|
|
325
|
+
} else {
|
|
326
|
+
t15 = $[56];
|
|
327
|
+
}
|
|
328
|
+
let t16;
|
|
329
|
+
if ($[57] !== restProps || $[58] !== t15 || $[59] !== t8 || $[60] !== t9) {
|
|
330
|
+
t16 = /*#__PURE__*/jsxs("table", {
|
|
331
|
+
className: t8,
|
|
332
|
+
ref: t9,
|
|
333
|
+
...restProps,
|
|
334
|
+
children: [t10, t15]
|
|
365
335
|
});
|
|
336
|
+
$[57] = restProps;
|
|
337
|
+
$[58] = t15;
|
|
338
|
+
$[59] = t8;
|
|
339
|
+
$[60] = t9;
|
|
340
|
+
$[61] = t16;
|
|
341
|
+
} else {
|
|
342
|
+
t16 = $[61];
|
|
366
343
|
}
|
|
344
|
+
let t17;
|
|
345
|
+
if ($[62] !== reorderAnimationContextValue || $[63] !== t16) {
|
|
346
|
+
t17 = /*#__PURE__*/jsx(ReorderAnimationContext, {
|
|
347
|
+
value: reorderAnimationContextValue,
|
|
348
|
+
children: t16
|
|
349
|
+
});
|
|
350
|
+
$[62] = reorderAnimationContextValue;
|
|
351
|
+
$[63] = t16;
|
|
352
|
+
$[64] = t17;
|
|
353
|
+
} else {
|
|
354
|
+
t17 = $[64];
|
|
355
|
+
}
|
|
356
|
+
let t18;
|
|
357
|
+
if ($[65] !== props || $[66] !== t17) {
|
|
358
|
+
t18 = /*#__PURE__*/jsx(TablePropsContext, {
|
|
359
|
+
value: props,
|
|
360
|
+
children: t17
|
|
361
|
+
});
|
|
362
|
+
$[65] = props;
|
|
363
|
+
$[66] = t17;
|
|
364
|
+
$[67] = t18;
|
|
365
|
+
} else {
|
|
366
|
+
t18 = $[67];
|
|
367
|
+
}
|
|
368
|
+
return t18;
|
|
369
|
+
}
|
|
370
|
+
function _temp() {
|
|
371
|
+
return defaultRowHeight;
|
|
367
372
|
}
|
|
368
373
|
|
|
369
|
-
export { Table
|
|
374
|
+
export { Table as default };
|