@jetbrains/ring-ui-built 7.0.0-beta.2 → 7.0.0-beta.3
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/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +41 -50
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +1 -18
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.js +6 -3
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +22 -32
- package/components/select/select.js +693 -793
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
@@ -1,6 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty
|
2
|
-
import 'core-js/modules/
|
3
|
-
import 'core-js/modules/es.array.map.js';
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
4
3
|
import { PureComponent } from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
6
5
|
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
@@ -9,14 +8,12 @@ import Link from '../link/link.js';
|
|
9
8
|
import Text from '../text/text.js';
|
10
9
|
import LoaderInline from '../loader-inline/loader-inline.js';
|
11
10
|
import { Button } from '../button/button.js';
|
12
|
-
import Selection from '../table/selection.js';
|
11
|
+
import Selection$1 from '../table/selection.js';
|
13
12
|
import { m as modules_09d014b4, T as Title } from '../_helpers/title.js';
|
14
|
-
import {
|
13
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
15
14
|
import 'classnames';
|
16
15
|
import '../global/data-tests.js';
|
17
16
|
import 'core-js/modules/es.array.reduce.js';
|
18
|
-
import 'core-js/modules/es.object.entries.js';
|
19
|
-
import 'core-js/modules/es.object.to-string.js';
|
20
17
|
import '../link/clickableLink.js';
|
21
18
|
import '../_helpers/link.js';
|
22
19
|
import '../icon/icon.js';
|
@@ -25,28 +22,18 @@ import '../icon/icon__constants.js';
|
|
25
22
|
import '../_helpers/icon__svg.js';
|
26
23
|
import 'core-js/modules/es.regexp.exec.js';
|
27
24
|
import 'core-js/modules/es.string.replace.js';
|
28
|
-
import 'core-js/modules/es.string.starts-with.js';
|
29
25
|
import '../global/memoize.js';
|
30
|
-
import 'core-js/modules/es.array.iterator.js';
|
31
|
-
import 'core-js/modules/es.map.js';
|
32
|
-
import 'core-js/modules/es.weak-map.js';
|
33
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
34
26
|
import '../global/controls-height.js';
|
35
27
|
import '../_helpers/button__classes.js';
|
36
|
-
import 'core-js/modules/es.array.filter.js';
|
37
|
-
import 'core-js/modules/es.array.index-of.js';
|
38
|
-
import 'core-js/modules/es.set.js';
|
39
28
|
import '../global/focus-sensor-hoc.js';
|
40
29
|
import '../global/prop-types.js';
|
41
30
|
import '../global/composeRefs.js';
|
42
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
43
31
|
import 'memoize-one';
|
44
32
|
import '../checkbox/checkbox.js';
|
45
33
|
import '@jetbrains/icons/checkmark-12px';
|
46
34
|
import '@jetbrains/icons/remove-12px';
|
47
35
|
import '../control-help/control-help.js';
|
48
36
|
import '../global/get-uid.js';
|
49
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
50
37
|
|
51
38
|
var moreLessButtonStates;
|
52
39
|
(function (moreLessButtonStates) {
|
@@ -55,48 +42,48 @@ var moreLessButtonStates;
|
|
55
42
|
moreLessButtonStates[moreLessButtonStates["MORE_LOADING"] = 2] = "MORE_LOADING";
|
56
43
|
moreLessButtonStates[moreLessButtonStates["LESS"] = 3] = "LESS";
|
57
44
|
})(moreLessButtonStates || (moreLessButtonStates = {}));
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
_defineProperty(_this, "onShowMore", function () {
|
69
|
-
var _this$props = _this.props,
|
70
|
-
onItemMoreLess = _this$props.onItemMoreLess,
|
71
|
-
item = _this$props.item;
|
45
|
+
const ITEM_LEFT_OFFSET = 32;
|
46
|
+
const LIST_LEFT_OFFSET = 24;
|
47
|
+
class Item extends PureComponent {
|
48
|
+
constructor() {
|
49
|
+
super(...arguments);
|
50
|
+
_defineProperty(this, "onShowMore", () => {
|
51
|
+
const {
|
52
|
+
onItemMoreLess,
|
53
|
+
item
|
54
|
+
} = this.props;
|
72
55
|
onItemMoreLess(item, true);
|
73
56
|
});
|
74
|
-
_defineProperty(
|
75
|
-
|
76
|
-
onItemMoreLess
|
77
|
-
item
|
57
|
+
_defineProperty(this, "onShowLess", () => {
|
58
|
+
const {
|
59
|
+
onItemMoreLess,
|
60
|
+
item
|
61
|
+
} = this.props;
|
78
62
|
onItemMoreLess(item, false);
|
79
63
|
});
|
80
|
-
_defineProperty(
|
81
|
-
|
82
|
-
onFocus
|
83
|
-
item
|
64
|
+
_defineProperty(this, "onFocus", () => {
|
65
|
+
const {
|
66
|
+
onFocus,
|
67
|
+
item
|
68
|
+
} = this.props;
|
84
69
|
onFocus(item);
|
85
70
|
});
|
86
|
-
_defineProperty(
|
87
|
-
|
88
|
-
onSelect
|
89
|
-
item
|
71
|
+
_defineProperty(this, "onSelect", selected => {
|
72
|
+
const {
|
73
|
+
onSelect,
|
74
|
+
item
|
75
|
+
} = this.props;
|
90
76
|
onSelect(item, selected);
|
91
77
|
});
|
92
|
-
_defineProperty(
|
93
|
-
|
94
|
-
onFocus
|
95
|
-
onSelect
|
96
|
-
selection
|
97
|
-
level
|
98
|
-
itemFormatter
|
99
|
-
|
78
|
+
_defineProperty(this, "renderItem", (model, parentShift) => {
|
79
|
+
const {
|
80
|
+
onFocus,
|
81
|
+
onSelect,
|
82
|
+
selection,
|
83
|
+
level,
|
84
|
+
itemFormatter
|
85
|
+
} = this.props;
|
86
|
+
const item = itemFormatter(model);
|
100
87
|
return /*#__PURE__*/jsx(Item, {
|
101
88
|
item: model,
|
102
89
|
title: item.title,
|
@@ -116,104 +103,97 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
116
103
|
onSelect: onSelect
|
117
104
|
}, item.key || item.id);
|
118
105
|
});
|
119
|
-
return _this;
|
120
106
|
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
107
|
+
render() {
|
108
|
+
const {
|
109
|
+
title,
|
110
|
+
items,
|
111
|
+
showMoreLessButton,
|
112
|
+
level,
|
113
|
+
parentShift,
|
114
|
+
showFocus,
|
115
|
+
selectable,
|
116
|
+
selected,
|
117
|
+
collapsible,
|
118
|
+
collapsed,
|
119
|
+
onCollapse,
|
120
|
+
onExpand
|
121
|
+
} = this.props;
|
122
|
+
let moreLessButton;
|
123
|
+
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
124
|
+
moreLessButton = /*#__PURE__*/jsxs(Text, {
|
125
|
+
info: true,
|
126
|
+
children: [/*#__PURE__*/jsx(Link, {
|
127
|
+
inherit: true,
|
128
|
+
pseudo: true,
|
129
|
+
onClick: this.onShowMore,
|
130
|
+
children: 'Show more'
|
131
|
+
}), showMoreLessButton === moreLessButtonStates.MORE_LOADING && /*#__PURE__*/jsx(LoaderInline, {
|
132
|
+
className: modules_09d014b4.showMoreLoader
|
133
|
+
})]
|
134
|
+
});
|
135
|
+
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
136
|
+
moreLessButton = /*#__PURE__*/jsx(Text, {
|
137
|
+
info: true,
|
138
|
+
children: /*#__PURE__*/jsx(Link, {
|
139
|
+
inherit: true,
|
140
|
+
pseudo: true,
|
141
|
+
onClick: this.onShowLess,
|
142
|
+
children: 'Show less'
|
143
|
+
})
|
144
|
+
});
|
145
|
+
}
|
146
|
+
let collapserExpander = null;
|
147
|
+
if (collapsible) {
|
148
|
+
if (collapsed) {
|
149
|
+
collapserExpander = /*#__PURE__*/jsx(Button, {
|
150
|
+
title: "Expand",
|
151
|
+
onClick: onExpand,
|
152
|
+
icon: chevronRightIcon,
|
153
|
+
className: modules_09d014b4.collapseButton,
|
154
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
155
|
+
"data-test": "ring-data-list-expand"
|
151
156
|
});
|
152
|
-
} else
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
})
|
157
|
+
} else {
|
158
|
+
collapserExpander = /*#__PURE__*/jsx(Button, {
|
159
|
+
title: "Collapse",
|
160
|
+
onClick: onCollapse,
|
161
|
+
icon: chevronDownIcon,
|
162
|
+
className: modules_09d014b4.collapseButton,
|
163
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
164
|
+
"data-test": "ring-data-list-collapse"
|
161
165
|
});
|
162
166
|
}
|
163
|
-
var collapserExpander = null;
|
164
|
-
if (collapsible) {
|
165
|
-
if (collapsed) {
|
166
|
-
collapserExpander = /*#__PURE__*/jsx(Button, {
|
167
|
-
title: "Expand",
|
168
|
-
onClick: onExpand,
|
169
|
-
icon: chevronRightIcon,
|
170
|
-
className: modules_09d014b4.collapseButton,
|
171
|
-
iconClassName: modules_09d014b4.collapseIcon,
|
172
|
-
"data-test": "ring-data-list-expand"
|
173
|
-
});
|
174
|
-
} else {
|
175
|
-
collapserExpander = /*#__PURE__*/jsx(Button, {
|
176
|
-
title: "Collapse",
|
177
|
-
onClick: onCollapse,
|
178
|
-
icon: chevronDownIcon,
|
179
|
-
className: modules_09d014b4.collapseButton,
|
180
|
-
iconClassName: modules_09d014b4.collapseIcon,
|
181
|
-
"data-test": "ring-data-list-collapse"
|
182
|
-
});
|
183
|
-
}
|
184
|
-
}
|
185
|
-
var itemIsEmpty = !(items !== null && items !== void 0 && items.length) || collapsible && collapsed;
|
186
|
-
var offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
187
|
-
return /*#__PURE__*/jsxs("li", {
|
188
|
-
children: [/*#__PURE__*/jsx(Title, {
|
189
|
-
title: title,
|
190
|
-
focused: showFocus,
|
191
|
-
showFocus: showFocus,
|
192
|
-
selectable: selectable,
|
193
|
-
selected: selected,
|
194
|
-
collapserExpander: collapserExpander,
|
195
|
-
onFocus: this.onFocus,
|
196
|
-
onSelect: this.onSelect,
|
197
|
-
offset: offset
|
198
|
-
}), !itemIsEmpty ? /*#__PURE__*/jsxs("ul", {
|
199
|
-
className: modules_09d014b4.itemContent,
|
200
|
-
children: [items.map(function (model) {
|
201
|
-
return _this2.renderItem(model, parentShift);
|
202
|
-
}), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/jsx("li", {
|
203
|
-
className: modules_09d014b4.showMore,
|
204
|
-
children: moreLessButton
|
205
|
-
}) : null]
|
206
|
-
}) : null]
|
207
|
-
});
|
208
167
|
}
|
209
|
-
|
210
|
-
|
168
|
+
const itemIsEmpty = !(items !== null && items !== void 0 && items.length) || collapsible && collapsed;
|
169
|
+
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
170
|
+
return /*#__PURE__*/jsxs("li", {
|
171
|
+
children: [/*#__PURE__*/jsx(Title, {
|
172
|
+
title: title,
|
173
|
+
focused: showFocus,
|
174
|
+
showFocus: showFocus,
|
175
|
+
selectable: selectable,
|
176
|
+
selected: selected,
|
177
|
+
collapserExpander: collapserExpander,
|
178
|
+
onFocus: this.onFocus,
|
179
|
+
onSelect: this.onSelect,
|
180
|
+
offset: offset
|
181
|
+
}), !itemIsEmpty ? /*#__PURE__*/jsxs("ul", {
|
182
|
+
className: modules_09d014b4.itemContent,
|
183
|
+
children: [items.map(model => this.renderItem(model, parentShift)), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/jsx("li", {
|
184
|
+
className: modules_09d014b4.showMore,
|
185
|
+
children: moreLessButton
|
186
|
+
}) : null]
|
187
|
+
}) : null]
|
188
|
+
});
|
189
|
+
}
|
190
|
+
}
|
211
191
|
_defineProperty(Item, "defaultProps", {
|
212
192
|
items: [],
|
213
193
|
level: 0,
|
214
194
|
parentShift: 0,
|
215
195
|
showMoreLessButton: moreLessButtonStates.UNUSED,
|
216
|
-
onItemMoreLess:
|
196
|
+
onItemMoreLess: () => {}
|
217
197
|
});
|
218
198
|
Item.propTypes = {
|
219
199
|
item: PropTypes.shape({
|
@@ -231,7 +211,7 @@ Item.propTypes = {
|
|
231
211
|
onExpand: PropTypes.func,
|
232
212
|
showFocus: PropTypes.bool,
|
233
213
|
onFocus: PropTypes.func.isRequired,
|
234
|
-
selection: PropTypes.instanceOf(Selection).isRequired,
|
214
|
+
selection: PropTypes.instanceOf(Selection$1).isRequired,
|
235
215
|
selectable: PropTypes.bool,
|
236
216
|
selected: PropTypes.bool,
|
237
217
|
onSelect: PropTypes.func.isRequired,
|
@@ -1,146 +1,88 @@
|
|
1
|
-
import { a as _inherits, b as _createClass, j as _toConsumableArray, l as _get, m as _getPrototypeOf, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
-
import 'core-js/modules/es.array.concat.js';
|
3
|
-
import 'core-js/modules/es.array.filter.js';
|
4
|
-
import 'core-js/modules/es.array.find.js';
|
5
|
-
import 'core-js/modules/es.array.includes.js';
|
6
|
-
import 'core-js/modules/es.array.iterator.js';
|
7
|
-
import 'core-js/modules/es.object.to-string.js';
|
8
|
-
import 'core-js/modules/es.set.js';
|
9
|
-
import 'core-js/modules/es.string.includes.js';
|
10
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
11
1
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
12
2
|
import Selection$1 from '../table/selection.js';
|
13
|
-
import '
|
3
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
14
4
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
return _callSuper(this, Selection, arguments);
|
5
|
+
class Selection extends Selection$1 {
|
6
|
+
_buildData(data) {
|
7
|
+
return new Set(this._getDescendants(data));
|
19
8
|
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
}, {
|
27
|
-
key: "_buildSelected",
|
28
|
-
value: function _buildSelected(data, selected) {
|
29
|
-
var _this = this;
|
30
|
-
var _selected = new Set(selected);
|
31
|
-
_toConsumableArray(data).forEach(function (item) {
|
32
|
-
if (_selected.has(item)) {
|
33
|
-
_this._selectDescendants(item, _selected);
|
34
|
-
}
|
35
|
-
});
|
36
|
-
return _selected;
|
37
|
-
}
|
38
|
-
}, {
|
39
|
-
key: "_getDescendants",
|
40
|
-
value: function _getDescendants(items) {
|
41
|
-
var _this2 = this;
|
42
|
-
var result = [];
|
43
|
-
items.forEach(function (item) {
|
44
|
-
result.push(item);
|
45
|
-
result = [].concat(_toConsumableArray(result), _toConsumableArray(_this2._getDescendants(_this2._getChildren(item))));
|
46
|
-
});
|
47
|
-
return result;
|
48
|
-
}
|
49
|
-
}, {
|
50
|
-
key: "_getAncestors",
|
51
|
-
value: function _getAncestors(item) {
|
52
|
-
var _this3 = this;
|
53
|
-
var result = [];
|
54
|
-
var parent = _toConsumableArray(this._data).find(function (it) {
|
55
|
-
return _this3._getChildren(it).includes(item);
|
56
|
-
});
|
57
|
-
if (parent) {
|
58
|
-
result = [parent].concat(_toConsumableArray(this._getAncestors(parent)));
|
9
|
+
_buildSelected(data, selected) {
|
10
|
+
const _selected = new Set(selected);
|
11
|
+
[...data].forEach(item => {
|
12
|
+
if (_selected.has(item)) {
|
13
|
+
this._selectDescendants(item, _selected);
|
59
14
|
}
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}, {
|
77
|
-
key: "_selectAncestors",
|
78
|
-
value: function _selectAncestors(item, selected) {
|
79
|
-
var _this4 = this;
|
80
|
-
this._getAncestors(item).forEach(function (ancestor) {
|
81
|
-
var groupIsSelected = _this4._getChildren(ancestor).filter(function (it) {
|
82
|
-
return _this4._isItemSelectable(it);
|
83
|
-
}).every(function (it) {
|
84
|
-
return selected.has(it);
|
85
|
-
});
|
86
|
-
if (groupIsSelected) {
|
87
|
-
selected.add(ancestor);
|
88
|
-
}
|
89
|
-
});
|
90
|
-
}
|
91
|
-
}, {
|
92
|
-
key: "_deselectAncestors",
|
93
|
-
value: function _deselectAncestors(item, selected) {
|
94
|
-
this._getAncestors(item).forEach(function (it) {
|
95
|
-
return selected.delete(it);
|
96
|
-
});
|
15
|
+
});
|
16
|
+
return _selected;
|
17
|
+
}
|
18
|
+
_getDescendants(items) {
|
19
|
+
let result = [];
|
20
|
+
items.forEach(item => {
|
21
|
+
result.push(item);
|
22
|
+
result = [...result, ...this._getDescendants(this._getChildren(item))];
|
23
|
+
});
|
24
|
+
return result;
|
25
|
+
}
|
26
|
+
_getAncestors(item) {
|
27
|
+
let result = [];
|
28
|
+
const parent = [...this._data].find(it => this._getChildren(it).includes(item));
|
29
|
+
if (parent) {
|
30
|
+
result = [parent, ...this._getAncestors(parent)];
|
97
31
|
}
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
32
|
+
return result;
|
33
|
+
}
|
34
|
+
_selectDescendants(item, selected) {
|
35
|
+
this._getDescendants(this._getChildren(item)).forEach(it => selected.add(it));
|
36
|
+
}
|
37
|
+
_deselectDescendants(item, selected) {
|
38
|
+
this._getDescendants(this._getChildren(item)).forEach(it => selected.delete(it));
|
39
|
+
}
|
40
|
+
_selectAncestors(item, selected) {
|
41
|
+
this._getAncestors(item).forEach(ancestor => {
|
42
|
+
const groupIsSelected = this._getChildren(ancestor).filter(it => this._isItemSelectable(it)).every(it => selected.has(it));
|
43
|
+
if (groupIsSelected) {
|
44
|
+
selected.add(ancestor);
|
104
45
|
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
key: "focus",
|
115
|
-
value: function focus(value) {
|
116
|
-
return _get(_getPrototypeOf(Selection.prototype), "focus", this).call(this, value);
|
117
|
-
}
|
118
|
-
}, {
|
119
|
-
key: "resetSelection",
|
120
|
-
value: function resetSelection() {
|
121
|
-
return _get(_getPrototypeOf(Selection.prototype), "resetSelection", this).call(this);
|
122
|
-
}
|
123
|
-
}, {
|
124
|
-
key: "cloneWith",
|
125
|
-
value: function cloneWith(config) {
|
126
|
-
return _get(_getPrototypeOf(Selection.prototype), "cloneWith", this).call(this, config);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
_deselectAncestors(item, selected) {
|
49
|
+
this._getAncestors(item).forEach(it => selected.delete(it));
|
50
|
+
}
|
51
|
+
select() {
|
52
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
53
|
+
if (!value || !this._isItemSelectable(value)) {
|
54
|
+
return this;
|
127
55
|
}
|
128
|
-
|
129
|
-
|
130
|
-
value
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
56
|
+
const selected = new Set(this._selected);
|
57
|
+
selected.add(value);
|
58
|
+
this._selectDescendants(value, selected);
|
59
|
+
this._selectAncestors(value, selected);
|
60
|
+
return this.cloneWith({
|
61
|
+
selected
|
62
|
+
});
|
63
|
+
}
|
64
|
+
focus(value) {
|
65
|
+
return super.focus(value);
|
66
|
+
}
|
67
|
+
resetSelection() {
|
68
|
+
return super.resetSelection();
|
69
|
+
}
|
70
|
+
cloneWith(config) {
|
71
|
+
return super.cloneWith(config);
|
72
|
+
}
|
73
|
+
deselect() {
|
74
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
75
|
+
if (!value || !this._isItemSelectable(value)) {
|
76
|
+
return this;
|
142
77
|
}
|
143
|
-
|
144
|
-
|
78
|
+
const selected = new Set(this._selected);
|
79
|
+
selected.delete(value);
|
80
|
+
this._deselectDescendants(value, selected);
|
81
|
+
this._deselectAncestors(value, selected);
|
82
|
+
return this.cloneWith({
|
83
|
+
selected
|
84
|
+
});
|
85
|
+
}
|
86
|
+
}
|
145
87
|
|
146
88
|
export { Selection as default };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
-
import 'core-js/modules/
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import 'react';
|
4
4
|
import 'prop-types';
|
5
5
|
import 'classnames';
|
@@ -10,22 +10,14 @@ import '../global/prop-types.js';
|
|
10
10
|
export { T as default } from '../_helpers/title.js';
|
11
11
|
import 'react/jsx-runtime';
|
12
12
|
import '../global/composeRefs.js';
|
13
|
-
import 'core-js/modules/es.object.to-string.js';
|
14
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
15
13
|
import 'memoize-one';
|
16
|
-
import 'util-deprecate';
|
17
14
|
import '@jetbrains/icons/checkmark-12px';
|
18
15
|
import '@jetbrains/icons/remove-12px';
|
19
16
|
import '../icon/icon.js';
|
17
|
+
import 'util-deprecate';
|
20
18
|
import '../icon/icon__constants.js';
|
21
19
|
import '../_helpers/icon__svg.js';
|
22
20
|
import 'core-js/modules/es.regexp.exec.js';
|
23
21
|
import 'core-js/modules/es.string.replace.js';
|
24
|
-
import 'core-js/modules/es.string.starts-with.js';
|
25
22
|
import '../global/memoize.js';
|
26
|
-
import 'core-js/modules/es.array.iterator.js';
|
27
|
-
import 'core-js/modules/es.map.js';
|
28
|
-
import 'core-js/modules/es.weak-map.js';
|
29
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
30
23
|
import '../control-help/control-help.js';
|
31
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
@@ -1,13 +1,9 @@
|
|
1
|
-
import 'core-js/modules/es.array.concat.js';
|
2
|
-
import 'core-js/modules/es.array.index-of.js';
|
3
|
-
import 'core-js/modules/es.array.slice.js';
|
4
|
-
import 'core-js/modules/es.object.values.js';
|
5
1
|
import 'core-js/modules/es.regexp.exec.js';
|
6
2
|
import PropTypes from 'prop-types';
|
7
3
|
import { add } from 'date-fns/add';
|
8
4
|
|
9
|
-
|
10
|
-
|
5
|
+
const unit = 8; // px;
|
6
|
+
const units = {
|
11
7
|
unit,
|
12
8
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
13
9
|
cellSize: unit * 3,
|
@@ -15,10 +11,10 @@ var units = {
|
|
15
11
|
yearHeight: unit * 4
|
16
12
|
/* eslint-enable */
|
17
13
|
};
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
const YEAR = 12;
|
15
|
+
const WEEK = 7;
|
16
|
+
const FIFTH_DAY = 4;
|
17
|
+
const weekdays = {
|
22
18
|
MO: 1,
|
23
19
|
TU: 2,
|
24
20
|
WE: 3,
|
@@ -27,19 +23,17 @@ var weekdays = {
|
|
27
23
|
SA: 6,
|
28
24
|
SU: 0
|
29
25
|
};
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
};
|
34
|
-
var yearDuration = durationToMillis({
|
26
|
+
const MIDDLE_DAY = 15;
|
27
|
+
const durationToMillis = duration => +add(0, duration);
|
28
|
+
const yearDuration = durationToMillis({
|
35
29
|
years: 1
|
36
30
|
});
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
31
|
+
const yearScrollSpeed = yearDuration / (YEAR * units.cellSize);
|
32
|
+
const DOUBLE = 2;
|
33
|
+
const HALF = 0.5;
|
34
|
+
const dateType = PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]);
|
41
35
|
function parseTime(time) {
|
42
|
-
|
36
|
+
let result = null;
|
43
37
|
if (/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
44
38
|
result = time;
|
45
39
|
} else if (/^([0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
@@ -48,7 +42,7 @@ function parseTime(time) {
|
|
48
42
|
return result;
|
49
43
|
}
|
50
44
|
function shiftWeekArray(arr, startOfWeek) {
|
51
|
-
|
45
|
+
const shiftTimes = startOfWeek - 1;
|
52
46
|
return arr.slice(shiftTimes).concat(arr.slice(0, shiftTimes));
|
53
47
|
}
|
54
48
|
function getWeekStartsOn(locale) {
|
@@ -56,7 +50,7 @@ function getWeekStartsOn(locale) {
|
|
56
50
|
return (_locale$options$weekS = locale === null || locale === void 0 || (_locale$options = locale.options) === null || _locale$options === void 0 ? void 0 : _locale$options.weekStartsOn) !== null && _locale$options$weekS !== void 0 ? _locale$options$weekS : weekdays.MO;
|
57
51
|
}
|
58
52
|
function getDayNumInWeek(locale, day) {
|
59
|
-
|
53
|
+
const weekDays = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(locale));
|
60
54
|
return weekDays.indexOf(day);
|
61
55
|
}
|
62
56
|
|