@jetbrains/ring-ui-built 7.0.0-beta.1 → 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/header.js +1 -1
- 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 +55 -51
- 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.d.ts +3 -0
- package/components/global/theme.js +2 -19
- 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.d.ts +2 -0
- package/components/header/links.js +20 -0
- 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 +53 -0
- package/components/select/select.js +701 -796
- 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/scrollable-section.js +0 -47
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
- /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.string.trim.js';
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
4
|
import * as React from 'react';
|
4
5
|
import { useCallback, useEffect } from 'react';
|
5
6
|
import classNames from 'classnames';
|
@@ -12,127 +13,78 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
12
13
|
import 'prop-types';
|
13
14
|
import 'util-deprecate';
|
14
15
|
import '../_helpers/heading.js';
|
15
|
-
import 'core-js/modules/es.array.concat.js';
|
16
16
|
import '@jetbrains/icons/chevron-down';
|
17
17
|
import '../icon/icon.js';
|
18
18
|
import '../icon/icon__constants.js';
|
19
19
|
import '../_helpers/icon__svg.js';
|
20
20
|
import 'core-js/modules/es.regexp.exec.js';
|
21
21
|
import 'core-js/modules/es.string.replace.js';
|
22
|
-
import 'core-js/modules/es.string.starts-with.js';
|
23
22
|
import '../global/memoize.js';
|
24
|
-
import 'core-js/modules/es.array.iterator.js';
|
25
|
-
import 'core-js/modules/es.map.js';
|
26
|
-
import 'core-js/modules/es.object.to-string.js';
|
27
|
-
import 'core-js/modules/es.weak-map.js';
|
28
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
29
23
|
import '../link/clickableLink.js';
|
30
24
|
import '../global/controls-height.js';
|
31
25
|
import '../_helpers/button__classes.js';
|
32
|
-
import 'core-js/modules/es.object.values.js';
|
33
26
|
import '@jetbrains/icons/close-12px';
|
34
27
|
import '../global/prop-types.js';
|
35
28
|
import '../i18n/i18n-context.js';
|
36
29
|
import '../i18n/i18n.js';
|
37
|
-
import 'core-js/modules/es.set.js';
|
38
30
|
import '../global/composeRefs.js';
|
39
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
40
31
|
import 'memoize-one';
|
41
32
|
import '../control-label/control-label.js';
|
42
33
|
import '../control-help/control-help.js';
|
43
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
44
|
-
import 'core-js/modules/es.array.map.js';
|
45
34
|
import '../shortcuts/core.js';
|
46
|
-
import 'core-js/modules/es.array.find-index.js';
|
47
|
-
import 'core-js/modules/es.array.includes.js';
|
48
|
-
import 'core-js/modules/es.array.slice.js';
|
49
|
-
import 'core-js/modules/es.array.splice.js';
|
50
|
-
import 'core-js/modules/es.object.assign.js';
|
51
|
-
import 'core-js/modules/es.string.includes.js';
|
52
|
-
import 'core-js/modules/es.string.match.js';
|
53
35
|
import 'combokeys';
|
54
36
|
import '../global/sniffer.js';
|
55
37
|
import 'sniffr';
|
56
38
|
|
57
39
|
var modules_6e69b0fe = {"editableHeading":"editableHeading_rui_0f5a","fullSize":"fullSize_rui_0f5a","isEditing":"isEditing_rui_0f5a","headingWrapperButton":"headingWrapperButton_rui_0f5a","disabled":"disabled_rui_0f5a","selectionMode":"selectionMode_rui_0f5a","heading":"heading_rui_0f5a","multiline":"multiline_rui_0f5a","input":"input_rui_0f5a","error":"error_rui_0f5a","textarea":"textarea_rui_0f5a","textareaNotOverflow":"textareaNotOverflow_rui_0f5a","textareaFade":"textareaFade_rui_0f5a","textareaWrapper":"textareaWrapper_rui_0f5a","button":"button_rui_0f5a","errorText":"errorText_rui_0f5a","level1":"level1_rui_0f5a","level2":"level2_rui_0f5a","level3":"level3_rui_0f5a","sizeS":"sizeS_rui_0f5a","sizeM":"sizeM_rui_0f5a","sizeL":"sizeL_rui_0f5a","sizeFULL":"sizeFULL_rui_0f5a"};
|
58
40
|
|
59
|
-
|
41
|
+
const _excluded = ["level", "className", "headingClassName", "inputClassName", "children", "isEditing", "isSavingPossible", "isSaving", "embedded", "size", "onEdit", "onSave", "onCancel", "autoFocus", "data-test", "error", "disabled", "multiline", "renderMenu", "onFocus", "onBlur", "onChange", "onScroll", "maxInputRows", "translations"];
|
60
42
|
function noop() {}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
renderMenu = _props$renderMenu === void 0 ? function () {
|
93
|
-
return null;
|
94
|
-
} : _props$renderMenu,
|
95
|
-
onFocus = props.onFocus,
|
96
|
-
onBlur = props.onBlur,
|
97
|
-
onChange = props.onChange,
|
98
|
-
onScroll = props.onScroll,
|
99
|
-
maxInputRows = props.maxInputRows,
|
100
|
-
_props$translations = props.translations,
|
101
|
-
translations = _props$translations === void 0 ? {
|
102
|
-
save: 'Save',
|
103
|
-
cancel: 'Cancel'
|
104
|
-
} : _props$translations,
|
43
|
+
const EditableHeading = props => {
|
44
|
+
const {
|
45
|
+
level = Levels.H1,
|
46
|
+
className,
|
47
|
+
headingClassName,
|
48
|
+
inputClassName,
|
49
|
+
children,
|
50
|
+
isEditing = false,
|
51
|
+
isSavingPossible = false,
|
52
|
+
isSaving = false,
|
53
|
+
embedded = false,
|
54
|
+
size = Size.L,
|
55
|
+
onEdit = noop,
|
56
|
+
onSave = noop,
|
57
|
+
onCancel = noop,
|
58
|
+
autoFocus = true,
|
59
|
+
'data-test': dataTest,
|
60
|
+
error,
|
61
|
+
disabled,
|
62
|
+
multiline = false,
|
63
|
+
renderMenu = () => null,
|
64
|
+
onFocus,
|
65
|
+
onBlur,
|
66
|
+
onChange,
|
67
|
+
onScroll,
|
68
|
+
maxInputRows,
|
69
|
+
translations = {
|
70
|
+
save: 'Save',
|
71
|
+
cancel: 'Cancel'
|
72
|
+
}
|
73
|
+
} = props,
|
105
74
|
restProps = _objectWithoutProperties(props, _excluded);
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
isInSelectionMode = _React$useState8[0],
|
120
|
-
setIsInSelectionMode = _React$useState8[1];
|
121
|
-
var textAreaRef = React.useRef(null);
|
122
|
-
var _React$useState9 = React.useState(false),
|
123
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
124
|
-
isScrolledToBottom = _React$useState10[0],
|
125
|
-
setIsScrolledToBottom = _React$useState10[1];
|
126
|
-
var _React$useState11 = React.useState(false),
|
127
|
-
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
128
|
-
isOverflow = _React$useState12[0],
|
129
|
-
setIsOverflow = _React$useState12[1];
|
130
|
-
var hasError = error !== undefined;
|
131
|
-
var isSaveDisabled = !isSavingPossible || !children || children.trim() === '' || hasError || isSaving;
|
132
|
-
var isCancelDisabled = isSaving;
|
133
|
-
var isShortcutsDisabled = !isInFocus || isSaving;
|
134
|
-
var shortcutsMap = React.useMemo(function () {
|
135
|
-
var map = {};
|
75
|
+
const [shortcutsScope] = React.useState(getUID('ring-editable-heading-'));
|
76
|
+
const [isInFocus, setIsInFocus] = React.useState(false);
|
77
|
+
const [isMouseDown, setIsMouseDown] = React.useState(false);
|
78
|
+
const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);
|
79
|
+
const textAreaRef = React.useRef(null);
|
80
|
+
const [isScrolledToBottom, setIsScrolledToBottom] = React.useState(false);
|
81
|
+
const [isOverflow, setIsOverflow] = React.useState(false);
|
82
|
+
const hasError = error !== undefined;
|
83
|
+
const isSaveDisabled = !isSavingPossible || !children || children.trim() === '' || hasError || isSaving;
|
84
|
+
const isCancelDisabled = isSaving;
|
85
|
+
const isShortcutsDisabled = !isInFocus || isSaving;
|
86
|
+
const shortcutsMap = React.useMemo(() => {
|
87
|
+
const map = {};
|
136
88
|
if (!isSaveDisabled) {
|
137
89
|
map.enter = onSave;
|
138
90
|
}
|
@@ -141,7 +93,7 @@ var EditableHeading = function EditableHeading(props) {
|
|
141
93
|
}
|
142
94
|
return map;
|
143
95
|
}, [isSaveDisabled, isCancelDisabled, onSave, onCancel]);
|
144
|
-
|
96
|
+
const classes = classNames(modules_6e69b0fe.editableHeading, className, {
|
145
97
|
[modules_6e69b0fe.fullSize]: isEditing && size === Size.FULL,
|
146
98
|
[modules_6e69b0fe.isEditing]: isEditing,
|
147
99
|
[modules_6e69b0fe.error]: hasError,
|
@@ -149,71 +101,72 @@ var EditableHeading = function EditableHeading(props) {
|
|
149
101
|
[modules_6e69b0fe.multiline]: multiline,
|
150
102
|
[modules_6e69b0fe.selectionMode]: isInSelectionMode
|
151
103
|
});
|
152
|
-
|
153
|
-
|
104
|
+
const headingClasses = classNames(modules_6e69b0fe.heading, headingClassName, modules_6e69b0fe["size".concat(size)]);
|
105
|
+
const inputClasses = classNames('ring-js-shortcuts', modules_6e69b0fe.input, modules_6e69b0fe.textarea, {
|
154
106
|
[modules_6e69b0fe.textareaNotOverflow]: !isOverflow
|
155
107
|
}, modules_88cfaf40["size".concat(size)], modules_6e69b0fe["level".concat(level)], inputClassName);
|
156
|
-
|
108
|
+
const stretch = useCallback(el => {
|
157
109
|
if (!el || !el.style) {
|
158
110
|
return;
|
159
111
|
}
|
160
112
|
el.style.height = '0';
|
161
|
-
|
162
|
-
paddingTop
|
163
|
-
paddingBottom
|
113
|
+
const {
|
114
|
+
paddingTop,
|
115
|
+
paddingBottom
|
116
|
+
} = window.getComputedStyle(el);
|
164
117
|
el.style.height = "".concat(el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom), "px");
|
165
118
|
}, []);
|
166
|
-
|
119
|
+
const checkValue = useCallback(el => {
|
167
120
|
if (multiline && el != null && el.scrollHeight >= el.clientHeight) {
|
168
121
|
stretch(el);
|
169
122
|
}
|
170
123
|
}, [stretch, multiline]);
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
124
|
+
const checkOverflow = useCallback(el => {
|
125
|
+
const scrollHeight = el.scrollHeight || 0;
|
126
|
+
const clientHeight = el.clientHeight || 0;
|
127
|
+
const scrollTop = el.scrollTop || 0;
|
175
128
|
setIsScrolledToBottom(scrollHeight - clientHeight <= scrollTop);
|
176
129
|
setIsOverflow(scrollHeight > clientHeight);
|
177
130
|
}, [setIsScrolledToBottom]);
|
178
|
-
|
131
|
+
const onHeadingMouseDown = React.useCallback(() => {
|
179
132
|
setIsMouseDown(true);
|
180
133
|
}, []);
|
181
|
-
|
134
|
+
const onMouseMove = React.useCallback(() => {
|
182
135
|
if (!isMouseDown) {
|
183
136
|
return;
|
184
137
|
}
|
185
138
|
setIsInSelectionMode(true);
|
186
139
|
}, [isMouseDown]);
|
187
|
-
|
140
|
+
const onMouseUp = React.useCallback(() => {
|
188
141
|
if (isMouseDown && !isInSelectionMode && !disabled) {
|
189
142
|
onEdit();
|
190
143
|
}
|
191
144
|
setIsMouseDown(false);
|
192
145
|
setIsInSelectionMode(false);
|
193
146
|
}, [isMouseDown, isInSelectionMode, disabled, onEdit]);
|
194
|
-
|
147
|
+
const onInputFocus = React.useCallback(e => {
|
195
148
|
setIsInFocus(true);
|
196
149
|
checkValue(e.target);
|
197
150
|
checkOverflow(e.target);
|
198
151
|
onFocus === null || onFocus === void 0 || onFocus(e);
|
199
152
|
}, [onFocus, checkOverflow, checkValue]);
|
200
|
-
|
153
|
+
const onInputChange = React.useCallback(e => {
|
201
154
|
checkValue(e.target);
|
202
155
|
checkOverflow(e.target);
|
203
156
|
onChange === null || onChange === void 0 || onChange(e);
|
204
157
|
}, [onChange, checkOverflow, checkValue]);
|
205
|
-
|
158
|
+
const onInputScroll = React.useCallback(e => {
|
206
159
|
checkOverflow(e.target);
|
207
160
|
onScroll === null || onScroll === void 0 || onScroll(e);
|
208
161
|
}, [onScroll, checkOverflow]);
|
209
|
-
|
162
|
+
const onInputBlur = React.useCallback(e => {
|
210
163
|
setIsInFocus(false);
|
211
164
|
onBlur === null || onBlur === void 0 || onBlur(e);
|
212
165
|
}, [onBlur]);
|
213
|
-
useEffect(
|
166
|
+
useEffect(() => {
|
214
167
|
window.addEventListener('mousemove', onMouseMove);
|
215
168
|
window.addEventListener('mouseup', onMouseUp);
|
216
|
-
return
|
169
|
+
return () => {
|
217
170
|
window.removeEventListener('mousemove', onMouseMove);
|
218
171
|
window.removeEventListener('mouseup', onMouseUp);
|
219
172
|
};
|
@@ -1,36 +1,19 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import '
|
3
|
-
import { Children, cloneElement, PureComponent } from 'react';
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import { PureComponent, Children, cloneElement } from 'react';
|
4
3
|
import PropTypes from 'prop-types';
|
5
4
|
import classNames from 'classnames';
|
6
5
|
import Popup from '../popup/popup.js';
|
7
6
|
import { Directions } from '../popup/popup.consts.js';
|
8
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
9
|
-
import 'core-js/modules/es.array.concat.js';
|
10
|
-
import 'core-js/modules/es.object.entries.js';
|
11
|
-
import 'core-js/modules/es.object.to-string.js';
|
12
8
|
import 'core-js/modules/es.regexp.exec.js';
|
13
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
14
9
|
import 'core-js/modules/es.string.replace.js';
|
15
|
-
import 'core-js/modules/web.dom-collections.
|
10
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
16
11
|
import 'react-dom';
|
17
12
|
import '../global/get-uid.js';
|
18
13
|
import '../global/schedule-raf.js';
|
19
14
|
import '../global/dom.js';
|
20
|
-
import 'core-js/modules/es.array.filter.js';
|
21
|
-
import 'core-js/modules/es.array.iterator.js';
|
22
|
-
import 'core-js/modules/es.object.assign.js';
|
23
|
-
import 'core-js/modules/es.set.js';
|
24
|
-
import 'core-js/modules/es.string.split.js';
|
25
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
26
15
|
import '../shortcuts/shortcuts.js';
|
27
16
|
import '../shortcuts/core.js';
|
28
|
-
import 'core-js/modules/es.array.find-index.js';
|
29
|
-
import 'core-js/modules/es.array.includes.js';
|
30
|
-
import 'core-js/modules/es.array.slice.js';
|
31
|
-
import 'core-js/modules/es.array.splice.js';
|
32
|
-
import 'core-js/modules/es.string.includes.js';
|
33
|
-
import 'core-js/modules/es.string.match.js';
|
34
17
|
import 'combokeys';
|
35
18
|
import '../global/sniffer.js';
|
36
19
|
import 'sniffr';
|
@@ -43,41 +26,33 @@ import '../popup/popup.target.js';
|
|
43
26
|
|
44
27
|
var modules_ee284100 = {"light":"light_rui_2ac4","errorBubblePopup":"errorBubblePopup_rui_7233","errorBubbleWrapper":"errorBubbleWrapper_rui_7233","errorBubble":"errorBubble_rui_7233"};
|
45
28
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
29
|
+
const _excluded = ["children", "className"];
|
30
|
+
class ErrorBubble extends PureComponent {
|
31
|
+
render() {
|
32
|
+
const _this$props = this.props,
|
33
|
+
{
|
34
|
+
children,
|
35
|
+
className
|
36
|
+
} = _this$props,
|
37
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
38
|
+
const errorBubbleClasses = classNames(modules_ee284100.errorBubble, className);
|
39
|
+
return /*#__PURE__*/jsxs("div", {
|
40
|
+
className: modules_ee284100.errorBubbleWrapper,
|
41
|
+
children: [Children.map(children, child => /*#__PURE__*/cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), restProps))), restProps.error && /*#__PURE__*/jsx(Popup, {
|
42
|
+
trapFocus: false,
|
43
|
+
className: modules_ee284100.errorBubblePopup,
|
44
|
+
hidden: false,
|
45
|
+
attached: false,
|
46
|
+
directions: [Directions.RIGHT_CENTER, Directions.RIGHT_BOTTOM, Directions.RIGHT_TOP],
|
47
|
+
children: /*#__PURE__*/jsx("div", {
|
48
|
+
className: errorBubbleClasses,
|
49
|
+
"data-test": "ring-error-bubble",
|
50
|
+
children: restProps.error
|
51
|
+
})
|
52
|
+
})]
|
53
|
+
});
|
51
54
|
}
|
52
|
-
|
53
|
-
return _createClass(ErrorBubble, [{
|
54
|
-
key: "render",
|
55
|
-
value: function render() {
|
56
|
-
var _this$props = this.props,
|
57
|
-
children = _this$props.children,
|
58
|
-
className = _this$props.className,
|
59
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
60
|
-
var errorBubbleClasses = classNames(modules_ee284100.errorBubble, className);
|
61
|
-
return /*#__PURE__*/jsxs("div", {
|
62
|
-
className: modules_ee284100.errorBubbleWrapper,
|
63
|
-
children: [Children.map(children, function (child) {
|
64
|
-
return /*#__PURE__*/cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), restProps));
|
65
|
-
}), restProps.error && /*#__PURE__*/jsx(Popup, {
|
66
|
-
trapFocus: false,
|
67
|
-
className: modules_ee284100.errorBubblePopup,
|
68
|
-
hidden: false,
|
69
|
-
attached: false,
|
70
|
-
directions: [Directions.RIGHT_CENTER, Directions.RIGHT_BOTTOM, Directions.RIGHT_TOP],
|
71
|
-
children: /*#__PURE__*/jsx("div", {
|
72
|
-
className: errorBubbleClasses,
|
73
|
-
"data-test": "ring-error-bubble",
|
74
|
-
children: restProps.error
|
75
|
-
})
|
76
|
-
})]
|
77
|
-
});
|
78
|
-
}
|
79
|
-
}]);
|
80
|
-
}(PureComponent);
|
55
|
+
}
|
81
56
|
_defineProperty(ErrorBubble, "propTypes", {
|
82
57
|
error: PropTypes.string,
|
83
58
|
className: PropTypes.string,
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.symbol.description.js';
|
4
3
|
import { Component } from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
@@ -12,60 +11,46 @@ import 'util-deprecate';
|
|
12
11
|
import '../_helpers/icon__svg.js';
|
13
12
|
import 'core-js/modules/es.regexp.exec.js';
|
14
13
|
import 'core-js/modules/es.string.replace.js';
|
15
|
-
import 'core-js/modules/es.string.starts-with.js';
|
16
14
|
import '../global/memoize.js';
|
17
|
-
import 'core-js/modules/es.array.iterator.js';
|
18
|
-
import 'core-js/modules/es.map.js';
|
19
|
-
import 'core-js/modules/es.object.to-string.js';
|
20
|
-
import 'core-js/modules/es.weak-map.js';
|
21
15
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
22
|
-
import 'core-js/modules/es.array.concat.js';
|
23
16
|
import 'core-js/modules/es.array.reduce.js';
|
24
|
-
import 'core-js/modules/es.object.entries.js';
|
25
17
|
|
26
18
|
var modules_2c5e8509 = {"light":"light_rui_2ac4","errorMessage":"errorMessage_rui_94a5","title":"title_rui_94a5","description":"description_rui_94a5","content":"content_rui_94a5","icon":"icon_rui_94a5"};
|
27
19
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
class ErrorMessage extends Component {
|
21
|
+
render() {
|
22
|
+
const {
|
23
|
+
className,
|
24
|
+
icon,
|
25
|
+
code,
|
26
|
+
message,
|
27
|
+
description,
|
28
|
+
children,
|
29
|
+
'data-test': dataTest
|
30
|
+
} = this.props;
|
31
|
+
const classes = classNames(modules_2c5e8509.errorMessage, className);
|
32
|
+
return /*#__PURE__*/jsxs("div", {
|
33
|
+
className: classes,
|
34
|
+
"data-test": joinDataTestAttributes('ring-error-message', dataTest),
|
35
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
36
|
+
className: modules_2c5e8509.icon,
|
37
|
+
glyph: icon,
|
38
|
+
size: Size.Size64,
|
39
|
+
suppressSizeWarning: true
|
40
|
+
}), /*#__PURE__*/jsxs("div", {
|
41
|
+
className: modules_2c5e8509.content,
|
42
|
+
children: [/*#__PURE__*/jsxs("div", {
|
43
|
+
className: modules_2c5e8509.title,
|
44
|
+
"data-test": "ring-error-message-title",
|
45
|
+
children: [code && "".concat(code, ":"), " ", message]
|
46
|
+
}), description && /*#__PURE__*/jsx("div", {
|
47
|
+
className: modules_2c5e8509.description,
|
48
|
+
children: description
|
49
|
+
}), children]
|
50
|
+
})]
|
51
|
+
});
|
32
52
|
}
|
33
|
-
|
34
|
-
return _createClass(ErrorMessage, [{
|
35
|
-
key: "render",
|
36
|
-
value: function render() {
|
37
|
-
var _this$props = this.props,
|
38
|
-
className = _this$props.className,
|
39
|
-
icon = _this$props.icon,
|
40
|
-
code = _this$props.code,
|
41
|
-
message = _this$props.message,
|
42
|
-
description = _this$props.description,
|
43
|
-
children = _this$props.children,
|
44
|
-
dataTest = _this$props['data-test'];
|
45
|
-
var classes = classNames(modules_2c5e8509.errorMessage, className);
|
46
|
-
return /*#__PURE__*/jsxs("div", {
|
47
|
-
className: classes,
|
48
|
-
"data-test": joinDataTestAttributes('ring-error-message', dataTest),
|
49
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
50
|
-
className: modules_2c5e8509.icon,
|
51
|
-
glyph: icon,
|
52
|
-
size: Size.Size64,
|
53
|
-
suppressSizeWarning: true
|
54
|
-
}), /*#__PURE__*/jsxs("div", {
|
55
|
-
className: modules_2c5e8509.content,
|
56
|
-
children: [/*#__PURE__*/jsxs("div", {
|
57
|
-
className: modules_2c5e8509.title,
|
58
|
-
"data-test": "ring-error-message-title",
|
59
|
-
children: [code && "".concat(code, ":"), " ", message]
|
60
|
-
}), description && /*#__PURE__*/jsx("div", {
|
61
|
-
className: modules_2c5e8509.description,
|
62
|
-
children: description
|
63
|
-
}), children]
|
64
|
-
})]
|
65
|
-
});
|
66
|
-
}
|
67
|
-
}]);
|
68
|
-
}(Component);
|
53
|
+
}
|
69
54
|
_defineProperty(ErrorMessage, "propTypes", {
|
70
55
|
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
71
56
|
code: PropTypes.string,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import 'core-js/modules/es.array.map.js';
|
2
1
|
import { memo, isValidElement } from 'react';
|
3
2
|
import PropTypes from 'prop-types';
|
4
3
|
import classNames from 'classnames';
|
@@ -6,19 +5,19 @@ import Link from '../link/link.js';
|
|
6
5
|
import { jsx } from 'react/jsx-runtime';
|
7
6
|
import '../_helpers/_rollupPluginBabelHelpers.js';
|
8
7
|
import '../global/data-tests.js';
|
9
|
-
import 'core-js/modules/es.array.concat.js';
|
10
8
|
import 'core-js/modules/es.array.reduce.js';
|
11
|
-
import 'core-js/modules/
|
12
|
-
import 'core-js/modules/es.object.to-string.js';
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
13
10
|
import '../link/clickableLink.js';
|
14
11
|
import '../_helpers/link.js';
|
15
12
|
|
16
13
|
var modules_7385b3fd = {"light":"light_rui_2ac4","footer":"footer_rui_b622 font_rui_f295","footerFloating":"footerFloating_rui_b622 footer_rui_b622 font_rui_f295","column":"column_rui_b622","columnItem":"columnItem_rui_b622","columnLeft":"columnLeft_rui_b622 column_rui_b622","columnCenter":"columnCenter_rui_b622 column_rui_b622","line":"line_rui_b622","columnRight":"columnRight_rui_b622 column_rui_b622","lineCenter":"lineCenter_rui_b622"};
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
const FooterColumn = /*#__PURE__*/memo(function FooterColumn(_ref) {
|
16
|
+
let {
|
17
|
+
position,
|
18
|
+
children
|
19
|
+
} = _ref;
|
20
|
+
const classes = classNames({
|
22
21
|
[modules_7385b3fd.columnLeft]: position === 'left',
|
23
22
|
[modules_7385b3fd.columnCenter]: position === 'center',
|
24
23
|
[modules_7385b3fd.columnRight]: position === 'right'
|
@@ -41,9 +40,9 @@ FooterColumn.propTypes = {
|
|
41
40
|
* @returns {string}
|
42
41
|
*/
|
43
42
|
function copyright(year) {
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
const currentYear = new Date().getUTCFullYear();
|
44
|
+
const ndash = '–';
|
45
|
+
let ret = 'Copyright © ';
|
47
46
|
if (year >= currentYear) {
|
48
47
|
ret += year;
|
49
48
|
} else {
|
@@ -55,14 +54,14 @@ function copyright(year) {
|
|
55
54
|
* @constructor
|
56
55
|
* @extends {ReactComponent}
|
57
56
|
*/
|
58
|
-
|
59
|
-
|
57
|
+
const FooterLine = /*#__PURE__*/memo(function FooterLine(props) {
|
58
|
+
const items = Array.isArray(props.item) ? props.item : [props.item];
|
60
59
|
function renderItem(item) {
|
61
60
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
62
61
|
if ( /*#__PURE__*/isValidElement(item) || typeof item !== 'object') {
|
63
62
|
return item;
|
64
63
|
}
|
65
|
-
|
64
|
+
const element = (item.copyright ? copyright(item.copyright) : '') + (item.label || item);
|
66
65
|
if (item.url) {
|
67
66
|
return /*#__PURE__*/jsx(Link, {
|
68
67
|
href: item.url,
|
@@ -81,28 +80,28 @@ var FooterLine = /*#__PURE__*/memo(function FooterLine(props) {
|
|
81
80
|
FooterLine.propTypes = {
|
82
81
|
item: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string])
|
83
82
|
};
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
const Footer = /*#__PURE__*/memo(function Footer(_ref2) {
|
84
|
+
let {
|
85
|
+
floating,
|
86
|
+
className,
|
87
|
+
left,
|
88
|
+
center,
|
89
|
+
right
|
90
|
+
} = _ref2;
|
90
91
|
function content(elements, position) {
|
91
92
|
if (!elements) {
|
92
93
|
return false;
|
93
94
|
}
|
94
95
|
return /*#__PURE__*/jsx(FooterColumn, {
|
95
96
|
position: position,
|
96
|
-
children: elements.map(
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}, idx);
|
102
|
-
})
|
97
|
+
children: elements.map((item, idx) => /*#__PURE__*/jsx(FooterLine
|
98
|
+
// eslint-disable-next-line react/no-array-index-key
|
99
|
+
, {
|
100
|
+
item: item
|
101
|
+
}, idx))
|
103
102
|
}, position);
|
104
103
|
}
|
105
|
-
|
104
|
+
const classes = classNames(modules_7385b3fd.footer, className, {
|
106
105
|
[modules_7385b3fd.footerFloating]: floating
|
107
106
|
});
|
108
107
|
return /*#__PURE__*/jsx("footer", {
|
@@ -1,17 +1,10 @@
|
|
1
1
|
import 'core-js/modules/es.array.reduce.js';
|
2
|
-
import 'core-js/modules/es.object.to-string.js';
|
3
2
|
|
4
3
|
function compose() {
|
5
4
|
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
6
5
|
funcs[_key] = arguments[_key];
|
7
6
|
}
|
8
|
-
return funcs.reduce(
|
9
|
-
return function (arg) {
|
10
|
-
return acc(func(arg));
|
11
|
-
};
|
12
|
-
}, function (arg) {
|
13
|
-
return arg;
|
14
|
-
});
|
7
|
+
return funcs.reduce((acc, func) => arg => acc(func(arg)), arg => arg);
|
15
8
|
}
|
16
9
|
|
17
10
|
export { compose as default };
|
@@ -1,5 +1,2 @@
|
|
1
1
|
import { Ref } from 'react';
|
2
|
-
declare function composeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void;
|
3
|
-
declare const _default: typeof composeRefs;
|
4
|
-
export default _default;
|
5
2
|
export declare function createComposedRef<T>(): import("memoize-one").MemoizedFn<(...refs: (Ref<T> | undefined)[]) => (value: T | null) => void>;
|