@jetbrains/ring-ui 5.0.35 → 5.0.37
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/date-picker/date-popup.js +3 -1
- package/components/editable-heading/editable-heading.css +69 -0
- package/components/editable-heading/editable-heading.d.ts +21 -0
- package/components/editable-heading/editable-heading.js +34 -0
- package/components/input/input.css +2 -0
- package/components/query-assist/query-assist.js +1 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -4
- package/dist/_helpers/anchor.js +0 -1
- package/dist/_helpers/card.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -11
- package/dist/_helpers/footer.js +2 -13
- package/dist/_helpers/query-assist__suggestions.js +0 -10
- package/dist/_helpers/select__filter.js +0 -11
- package/dist/_helpers/services-link.js +0 -2
- package/dist/_helpers/sidebar.js +0 -12
- package/dist/_helpers/theme.js +0 -3
- package/dist/_helpers/title.js +0 -9
- package/dist/alert/alert.js +2 -32
- package/dist/alert/container.js +0 -5
- package/dist/alert-service/alert-service.js +0 -26
- package/dist/analytics/analytics.js +0 -22
- package/dist/analytics/analytics__custom-plugin.js +0 -38
- package/dist/analytics/analytics__fus-plugin.js +0 -20
- package/dist/analytics/analytics__ga-plugin.js +0 -13
- package/dist/analytics/analytics__plugin-utils.js +0 -8
- package/dist/analytics-ng/analytics-ng.js +3 -9
- package/dist/auth/auth.js +2 -3
- package/dist/auth/auth__core.js +30 -243
- package/dist/auth/background-flow.js +2 -25
- package/dist/auth/down-notification.js +0 -7
- package/dist/auth/iframe-flow.js +2 -26
- package/dist/auth/landing.js +2 -6
- package/dist/auth/request-builder.js +0 -11
- package/dist/auth/response-parser.js +4 -26
- package/dist/auth/storage.js +4 -60
- package/dist/auth/token-validator.js +6 -42
- package/dist/auth/window-flow.js +2 -34
- package/dist/auth-dialog/auth-dialog.js +2 -12
- package/dist/auth-dialog-service/auth-dialog-service.js +2 -4
- package/dist/auth-ng/auth-ng.js +6 -22
- package/dist/auth-ng/auth-ng.mock.js +0 -4
- package/dist/autofocus-ng/autofocus-ng.js +0 -5
- package/dist/avatar/avatar.js +4 -17
- package/dist/avatar/fallback-avatar.js +2 -9
- package/dist/avatar-editor-ng/avatar-editor-ng.js +1 -17
- package/dist/badge/badge.js +0 -3
- package/dist/button/button.js +0 -8
- package/dist/button-group/button-group.js +0 -3
- package/dist/button-group/caption.js +0 -2
- package/dist/button-group-ng/button-group-ng.js +0 -4
- package/dist/button-ng/button-ng.js +3 -21
- package/dist/button-set/button-set.js +0 -3
- package/dist/button-set-ng/button-set-ng.js +0 -2
- package/dist/button-toolbar/button-toolbar.js +0 -3
- package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -2
- package/dist/caret/caret.js +2 -53
- package/dist/checkbox/checkbox.js +0 -12
- package/dist/code/code.js +3 -25
- package/dist/compiler-ng/compiler-ng.js +0 -5
- package/dist/confirm/confirm.js +0 -6
- package/dist/confirm-service/confirm-service.js +10 -8
- package/dist/content-layout/content-layout.js +0 -7
- package/dist/contenteditable/contenteditable.js +6 -13
- package/dist/data-list/data-list.js +4 -28
- package/dist/data-list/item.js +0 -15
- package/dist/data-list/selection.js +0 -27
- package/dist/date-picker/consts.js +0 -7
- package/dist/date-picker/date-input.js +0 -20
- package/dist/date-picker/date-picker.js +2 -36
- package/dist/date-picker/date-popup.js +21 -72
- package/dist/date-picker/day.js +0 -14
- package/dist/date-picker/month-names.js +0 -9
- package/dist/date-picker/month-slider.js +0 -10
- package/dist/date-picker/month.js +2 -4
- package/dist/date-picker/months.js +6 -13
- package/dist/date-picker/years.js +0 -14
- package/dist/dialog/dialog.js +0 -19
- package/dist/dialog-ng/dialog-ng.js +17 -105
- package/dist/docked-panel-ng/docked-panel-ng.js +6 -29
- package/dist/dropdown/dropdown.js +2 -33
- package/dist/dropdown-menu/dropdown-menu.js +4 -8
- package/dist/editable-heading/editable-heading.d.ts +21 -0
- package/dist/editable-heading/editable-heading.js +85 -0
- package/dist/error-bubble/error-bubble.js +2 -4
- package/dist/error-message/error-message.js +0 -3
- package/dist/footer-ng/footer-ng.js +0 -13
- package/dist/form-ng/form-ng.js +1 -21
- package/dist/global/angular-component-factory.js +0 -10
- package/dist/global/compose.js +0 -1
- package/dist/global/composeRefs.js +0 -1
- package/dist/global/controls-height.js +0 -2
- package/dist/global/create-stateful-context.js +0 -5
- package/dist/global/data-tests.js +0 -4
- package/dist/global/dom.js +2 -11
- package/dist/global/focus-sensor-hoc.js +4 -33
- package/dist/global/fuzzy-highlight.js +2 -16
- package/dist/global/get-event-key.js +8 -17
- package/dist/global/get-uid.js +0 -2
- package/dist/global/linear-function.js +0 -2
- package/dist/global/listeners.js +0 -13
- package/dist/global/memoize.js +0 -2
- package/dist/global/normalize-indent.js +2 -5
- package/dist/global/react-dom-renderer.js +0 -8
- package/dist/global/react-render-adapter.js +0 -7
- package/dist/global/rerender-hoc.js +0 -7
- package/dist/global/ring-angular-component.js +0 -5
- package/dist/global/schedule-raf.js +0 -5
- package/dist/global/trivial-template-tag.js +2 -3
- package/dist/global/url.js +0 -27
- package/dist/grid/col.js +0 -4
- package/dist/grid/grid.js +0 -3
- package/dist/grid/row.js +0 -5
- package/dist/group/group.js +0 -3
- package/dist/header/header.js +0 -5
- package/dist/header/logo.js +0 -4
- package/dist/header/profile.js +0 -7
- package/dist/header/services.js +0 -11
- package/dist/header/smart-profile.js +4 -18
- package/dist/header/smart-services.js +0 -17
- package/dist/header/tray-icon.js +2 -3
- package/dist/header/tray.js +0 -3
- package/dist/heading/heading.js +0 -5
- package/dist/http/http.js +20 -65
- package/dist/http/http.mock.js +2 -14
- package/dist/hub-source/hub-source.js +0 -32
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +0 -12
- package/dist/icon/icon.js +0 -13
- package/dist/icon/icon__constants.js +0 -4
- package/dist/icon/icon__svg.js +0 -10
- package/dist/icon-ng/icon-ng.js +2 -7
- package/dist/input/input.js +0 -30
- package/dist/input-ng/input-ng.js +0 -17
- package/dist/island/adaptive-island-hoc.js +0 -7
- package/dist/island/content.js +0 -25
- package/dist/island/header.js +0 -7
- package/dist/island/island.js +0 -4
- package/dist/island-legacy/content-legacy.js +0 -2
- package/dist/island-legacy/header-legacy.js +0 -2
- package/dist/island-legacy/island-legacy.js +0 -2
- package/dist/island-ng/island-content-ng.js +0 -3
- package/dist/link/clickableLink.js +2 -10
- package/dist/link/link.js +2 -9
- package/dist/link-ng/link-ng.js +0 -2
- package/dist/list/consts.js +0 -4
- package/dist/list/list.js +6 -128
- package/dist/list/list__custom.js +0 -4
- package/dist/list/list__hint.js +0 -3
- package/dist/list/list__item.js +0 -8
- package/dist/list/list__link.js +2 -3
- package/dist/list/list__separator.js +0 -1
- package/dist/list/list__title.js +0 -1
- package/dist/list/list__users-groups-source.js +4 -17
- package/dist/loader/loader.js +0 -10
- package/dist/loader/loader__core.js +6 -70
- package/dist/loader-inline/loader-inline.js +0 -3
- package/dist/loader-ng/loader-ng.js +0 -7
- package/dist/loader-screen/loader-screen.js +0 -3
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -14
- package/dist/login-dialog/login-dialog.js +0 -15
- package/dist/login-dialog/service.js +2 -4
- package/dist/markdown/code.js +0 -2
- package/dist/markdown/heading.js +0 -1
- package/dist/markdown/link.js +0 -1
- package/dist/markdown/markdown.js +0 -2
- package/dist/message/message.js +0 -24
- package/dist/message-bundle-ng/message-bundle-ng.js +2 -45
- package/dist/old-browsers-message/old-browsers-message.js +2 -21
- package/dist/old-browsers-message/white-list.js +2 -6
- package/dist/pager/pager.js +2 -39
- package/dist/panel/panel.js +0 -3
- package/dist/permissions/permissions.js +1 -43
- package/dist/permissions/permissions__cache.js +12 -63
- package/dist/permissions-ng/permissions-ng.js +11 -19
- package/dist/place-under-ng/place-under-ng.js +0 -19
- package/dist/popup/popup.consts.js +0 -11
- package/dist/popup/popup.js +6 -68
- package/dist/popup/position.js +8 -30
- package/dist/popup-menu/popup-menu.js +4 -13
- package/dist/progress-bar/progress-bar.js +0 -14
- package/dist/promised-click-ng/promised-click-ng.js +3 -22
- package/dist/query-assist/query-assist.js +17 -201
- package/dist/radio/radio.js +0 -6
- package/dist/radio/radio__item.js +0 -9
- package/dist/radio-ng/radio-ng.js +0 -4
- package/dist/save-field-ng/save-field-ng.js +1 -37
- package/dist/select/select.js +18 -208
- package/dist/select/select__popup.js +4 -76
- package/dist/select-ng/select-ng.js +18 -74
- package/dist/select-ng/select-ng__lazy.js +2 -17
- package/dist/select-ng/select-ng__options.js +3 -29
- package/dist/shortcuts/core.js +4 -56
- package/dist/shortcuts/shortcuts-hoc.js +0 -4
- package/dist/shortcuts/shortcuts.js +0 -10
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -13
- package/dist/shortcuts-ng/shortcuts-ng.js +16 -46
- package/dist/sidebar-ng/sidebar-ng.js +2 -12
- package/dist/storage/storage.js +2 -5
- package/dist/storage/storage__fallback.js +2 -48
- package/dist/storage/storage__local.js +0 -23
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +0 -37
- package/dist/table/cell.js +0 -2
- package/dist/table/disable-hover-hoc.js +0 -9
- package/dist/table/header-cell.js +0 -8
- package/dist/table/header.js +0 -16
- package/dist/table/multitable.js +0 -23
- package/dist/table/row-with-focus-sensor.js +0 -12
- package/dist/table/row.js +0 -18
- package/dist/table/selection-adapter.js +0 -2
- package/dist/table/selection-shortcuts-hoc.js +8 -42
- package/dist/table/selection.js +0 -50
- package/dist/table/smart-table.js +0 -9
- package/dist/table/table.js +6 -37
- package/dist/table-legacy-ng/table-legacy-ng.js +12 -42
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -31
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -32
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -5
- package/dist/tabs/collapsible-more.js +0 -5
- package/dist/tabs/collapsible-tab.js +0 -4
- package/dist/tabs/collapsible-tabs.js +8 -28
- package/dist/tabs/dumb-tabs.js +0 -8
- package/dist/tabs/smart-tabs.js +0 -6
- package/dist/tabs/tab-link.js +0 -1
- package/dist/tabs/tab.js +0 -2
- package/dist/tabs-ng/tabs-ng.js +13 -29
- package/dist/tag/tag.js +0 -24
- package/dist/tags-input/tags-input.js +0 -76
- package/dist/tags-list/tags-list.js +0 -6
- package/dist/template-ng/template-ng.js +0 -12
- package/dist/text/text.js +0 -3
- package/dist/theme-ng/theme-ng.js +0 -8
- package/dist/title-ng/title-ng.js +6 -17
- package/dist/toggle/toggle.js +0 -4
- package/dist/tooltip/tooltip.js +4 -35
- package/dist/tooltip-ng/tooltip-ng.js +2 -8
- package/dist/user-agreement/service.js +0 -62
- package/dist/user-agreement/user-agreement.js +0 -8
- package/dist/user-card/smart-user-card-tooltip.js +2 -8
- package/dist/user-card/tooltip.js +0 -3
- package/package.json +22 -22
|
@@ -15,42 +15,33 @@ import '../global/memoize.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* @name Checkbox
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
/**
|
|
20
19
|
* Displays a checkbox.
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
21
|
class Checkbox extends PureComponent {
|
|
24
22
|
constructor() {
|
|
25
23
|
super(...arguments);
|
|
26
|
-
|
|
27
24
|
_defineProperty(this, "input", void 0);
|
|
28
|
-
|
|
29
25
|
_defineProperty(this, "inputRef", el => {
|
|
30
26
|
if (el != null) {
|
|
31
27
|
el.indeterminate = this.props.indeterminate;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
this.input = el;
|
|
35
30
|
});
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
componentDidMount() {
|
|
39
33
|
if (this.input != null) {
|
|
40
34
|
this.input.indeterminate = this.props.indeterminate;
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
componentDidUpdate(prevProps) {
|
|
45
38
|
const {
|
|
46
39
|
indeterminate
|
|
47
40
|
} = this.props;
|
|
48
|
-
|
|
49
41
|
if (this.input != null && indeterminate !== prevProps.indeterminate) {
|
|
50
42
|
this.input.indeterminate = this.props.indeterminate;
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
render() {
|
|
55
46
|
const {
|
|
56
47
|
children,
|
|
@@ -88,9 +79,7 @@ class Checkbox extends PureComponent {
|
|
|
88
79
|
className: labelClasses
|
|
89
80
|
}, label || children));
|
|
90
81
|
}
|
|
91
|
-
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
_defineProperty(Checkbox, "propTypes", {
|
|
95
84
|
name: PropTypes.string,
|
|
96
85
|
label: PropTypes.string,
|
|
@@ -106,7 +95,6 @@ _defineProperty(Checkbox, "propTypes", {
|
|
|
106
95
|
onChange: PropTypes.func,
|
|
107
96
|
children: PropTypes.node
|
|
108
97
|
});
|
|
109
|
-
|
|
110
98
|
_defineProperty(Checkbox, "defaultProps", {
|
|
111
99
|
indeterminate: false
|
|
112
100
|
});
|
package/dist/code/code.js
CHANGED
|
@@ -13,83 +13,65 @@ var modules_66c414ea = {"unit":"8px","code":"code_rui_7185","inline":"inline_rui
|
|
|
13
13
|
var modules_39cf09e8 = {"highlightContainer":"highlightContainer_rui_6e02"};
|
|
14
14
|
|
|
15
15
|
function noop() {}
|
|
16
|
-
|
|
17
16
|
const registerLanguage = memoize(async language => {
|
|
18
|
-
const languageExports = await import(
|
|
19
|
-
/* webpackChunkName: "highlight-[request]" */
|
|
17
|
+
const languageExports = await import( /* webpackChunkName: "highlight-[request]" */
|
|
20
18
|
`highlight.js/lib/languages/${language}`);
|
|
21
19
|
highlight.registerLanguage(language, languageExports.default);
|
|
22
20
|
});
|
|
23
21
|
/**
|
|
24
22
|
* @name Code
|
|
25
23
|
*/
|
|
26
|
-
|
|
27
24
|
class Code extends PureComponent {
|
|
28
25
|
constructor() {
|
|
29
26
|
super(...arguments);
|
|
30
|
-
|
|
31
27
|
_defineProperty(this, "code", void 0);
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
componentDidMount() {
|
|
35
30
|
this.highlight();
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
componentDidUpdate() {
|
|
39
33
|
this.highlight();
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
async highlight() {
|
|
43
36
|
const codeRef = this.codeRef;
|
|
44
|
-
|
|
45
37
|
if (codeRef == null) {
|
|
46
38
|
return;
|
|
47
39
|
}
|
|
48
|
-
|
|
49
40
|
const {
|
|
50
41
|
language,
|
|
51
42
|
inline,
|
|
52
43
|
replacer
|
|
53
44
|
} = this.props;
|
|
54
|
-
|
|
55
45
|
if (!inline) {
|
|
56
46
|
if (language != null && highlight.getLanguage(language) == null) {
|
|
57
47
|
await registerLanguage(language);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
}
|
|
49
|
+
// @ts-expect-error https://github.com/highlightjs/highlight.js/issues/2945
|
|
61
50
|
highlight.highlightElement(codeRef);
|
|
62
51
|
}
|
|
63
|
-
|
|
64
52
|
replacer(codeRef);
|
|
65
53
|
}
|
|
66
|
-
|
|
67
54
|
get codeRef() {
|
|
68
55
|
const {
|
|
69
56
|
codeRef
|
|
70
57
|
} = this.props;
|
|
71
58
|
return !codeRef || typeof codeRef === 'function' ? this.code : codeRef.current;
|
|
72
59
|
}
|
|
73
|
-
|
|
74
60
|
get initCodeRef() {
|
|
75
61
|
const {
|
|
76
62
|
codeRef
|
|
77
63
|
} = this.props;
|
|
78
64
|
const isFunctionCodeRef = typeof codeRef === 'function';
|
|
79
|
-
|
|
80
65
|
if (codeRef && !isFunctionCodeRef) {
|
|
81
66
|
return codeRef;
|
|
82
67
|
}
|
|
83
|
-
|
|
84
68
|
return ref => {
|
|
85
69
|
this.code = ref;
|
|
86
|
-
|
|
87
70
|
if (isFunctionCodeRef) {
|
|
88
71
|
codeRef(this.code);
|
|
89
72
|
}
|
|
90
73
|
};
|
|
91
74
|
}
|
|
92
|
-
|
|
93
75
|
render() {
|
|
94
76
|
const {
|
|
95
77
|
code,
|
|
@@ -113,9 +95,7 @@ class Code extends PureComponent {
|
|
|
113
95
|
className: modules_39cf09e8.highlightContainer
|
|
114
96
|
}, normalizeIndent(code)));
|
|
115
97
|
}
|
|
116
|
-
|
|
117
98
|
}
|
|
118
|
-
|
|
119
99
|
_defineProperty(Code, "propTypes", {
|
|
120
100
|
className: PropTypes.string,
|
|
121
101
|
code: PropTypes.string.isRequired,
|
|
@@ -127,13 +107,11 @@ _defineProperty(Code, "propTypes", {
|
|
|
127
107
|
current: PropTypes.instanceOf(Element)
|
|
128
108
|
}), PropTypes.func])
|
|
129
109
|
});
|
|
130
|
-
|
|
131
110
|
_defineProperty(Code, "defaultProps", {
|
|
132
111
|
inline: false,
|
|
133
112
|
softWrap: false,
|
|
134
113
|
replacer: noop
|
|
135
114
|
});
|
|
136
|
-
|
|
137
115
|
const code = trivialTemplateTag(source => /*#__PURE__*/React.createElement(Code, {
|
|
138
116
|
code: source
|
|
139
117
|
}));
|
|
@@ -26,22 +26,17 @@ const angularModule = angular.module('Ring.compiler', []).factory('rgCompiler',
|
|
|
26
26
|
element,
|
|
27
27
|
link: function link(scope) {
|
|
28
28
|
locals.$scope = scope;
|
|
29
|
-
|
|
30
29
|
if (controller) {
|
|
31
30
|
const invokeCtrl = $controller(controller, locals, true);
|
|
32
|
-
|
|
33
31
|
if (bindToController) {
|
|
34
32
|
angular.extend(invokeCtrl.instance, locals);
|
|
35
33
|
}
|
|
36
|
-
|
|
37
34
|
const ctrl = invokeCtrl();
|
|
38
35
|
element.data('$ngControllerController', ctrl);
|
|
39
|
-
|
|
40
36
|
if (controllerAs) {
|
|
41
37
|
scope[controllerAs] = ctrl;
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
return linkFn(scope);
|
|
46
41
|
}
|
|
47
42
|
};
|
package/dist/confirm/confirm.js
CHANGED
|
@@ -45,18 +45,15 @@ var modules_4c9c3a3a = {"unit":"8px","description":"description_rui_2cda"};
|
|
|
45
45
|
/**
|
|
46
46
|
* @name Confirm
|
|
47
47
|
*/
|
|
48
|
-
|
|
49
48
|
class Confirm extends PureComponent {
|
|
50
49
|
constructor() {
|
|
51
50
|
super(...arguments);
|
|
52
|
-
|
|
53
51
|
_defineProperty(this, "onEscPress", () => {
|
|
54
52
|
if (this.props.rejectOnEsc) {
|
|
55
53
|
this.props.onReject();
|
|
56
54
|
}
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
|
-
|
|
60
57
|
render() {
|
|
61
58
|
const {
|
|
62
59
|
show,
|
|
@@ -92,9 +89,7 @@ class Confirm extends PureComponent {
|
|
|
92
89
|
primary: cancelIsDefault
|
|
93
90
|
}, rejectLabel)));
|
|
94
91
|
}
|
|
95
|
-
|
|
96
92
|
}
|
|
97
|
-
|
|
98
93
|
_defineProperty(Confirm, "propTypes", {
|
|
99
94
|
className: PropTypes.string,
|
|
100
95
|
text: PropTypes.string,
|
|
@@ -108,7 +103,6 @@ _defineProperty(Confirm, "propTypes", {
|
|
|
108
103
|
onConfirm: PropTypes.func,
|
|
109
104
|
onReject: PropTypes.func
|
|
110
105
|
});
|
|
111
|
-
|
|
112
106
|
_defineProperty(Confirm, "defaultProps", {
|
|
113
107
|
text: null,
|
|
114
108
|
description: null,
|
|
@@ -46,7 +46,6 @@ const containerElement = document.createElement('div');
|
|
|
46
46
|
/**
|
|
47
47
|
* Renders Confirm into virtual node to skip maintaining container
|
|
48
48
|
*/
|
|
49
|
-
|
|
50
49
|
function renderConfirm(props) {
|
|
51
50
|
const {
|
|
52
51
|
buttonsHeight = ControlsHeight.M,
|
|
@@ -56,7 +55,6 @@ function renderConfirm(props) {
|
|
|
56
55
|
value: buttonsHeight
|
|
57
56
|
}, /*#__PURE__*/React.createElement(Confirm, restProps)), containerElement);
|
|
58
57
|
}
|
|
59
|
-
|
|
60
58
|
function confirm(_ref) {
|
|
61
59
|
let {
|
|
62
60
|
text,
|
|
@@ -78,29 +76,33 @@ function confirm(_ref) {
|
|
|
78
76
|
show: true,
|
|
79
77
|
onConfirm: () => {
|
|
80
78
|
if (onBeforeConfirm) {
|
|
81
|
-
renderConfirm({
|
|
79
|
+
renderConfirm({
|
|
80
|
+
...props,
|
|
82
81
|
inProgress: true
|
|
83
82
|
});
|
|
84
83
|
return Promise.resolve(onBeforeConfirm()).then(() => {
|
|
85
|
-
renderConfirm({
|
|
84
|
+
renderConfirm({
|
|
85
|
+
...props,
|
|
86
86
|
show: false
|
|
87
87
|
});
|
|
88
88
|
resolve();
|
|
89
89
|
}).catch(err => {
|
|
90
|
-
renderConfirm({
|
|
90
|
+
renderConfirm({
|
|
91
|
+
...props,
|
|
91
92
|
show: false
|
|
92
93
|
});
|
|
93
94
|
reject(err);
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
renderConfirm({
|
|
98
|
+
...props,
|
|
98
99
|
show: false
|
|
99
100
|
});
|
|
100
101
|
return resolve();
|
|
101
102
|
},
|
|
102
103
|
onReject: () => {
|
|
103
|
-
renderConfirm({
|
|
104
|
+
renderConfirm({
|
|
105
|
+
...props,
|
|
104
106
|
show: false
|
|
105
107
|
});
|
|
106
108
|
reject(new Error('Confirm(@jetbrains/ring-ui): null exception'));
|
|
@@ -9,22 +9,18 @@ import 'react-waypoint';
|
|
|
9
9
|
/**
|
|
10
10
|
* @name Content Layout
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
class ContentLayout extends Component {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
16
|
-
|
|
17
15
|
_defineProperty(this, "state", {
|
|
18
16
|
contentNode: null
|
|
19
17
|
});
|
|
20
|
-
|
|
21
18
|
_defineProperty(this, "saveContentNode", contentNode => {
|
|
22
19
|
this.setState({
|
|
23
20
|
contentNode
|
|
24
21
|
});
|
|
25
22
|
});
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
render() {
|
|
29
25
|
const {
|
|
30
26
|
children,
|
|
@@ -50,16 +46,13 @@ class ContentLayout extends Component {
|
|
|
50
46
|
ref: this.saveContentNode
|
|
51
47
|
}, contentChildren));
|
|
52
48
|
}
|
|
53
|
-
|
|
54
49
|
}
|
|
55
|
-
|
|
56
50
|
_defineProperty(ContentLayout, "propTypes", {
|
|
57
51
|
children: PropTypes.node,
|
|
58
52
|
className: PropTypes.string,
|
|
59
53
|
contentClassName: PropTypes.string,
|
|
60
54
|
responsive: PropTypes.bool
|
|
61
55
|
});
|
|
62
|
-
|
|
63
56
|
_defineProperty(ContentLayout, "defaultProps", {
|
|
64
57
|
responsive: true
|
|
65
58
|
});
|
|
@@ -6,9 +6,7 @@ import { renderToStaticMarkup } from 'react-dom/server';
|
|
|
6
6
|
/**
|
|
7
7
|
* @name ContentEditable
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
function noop() {}
|
|
11
|
-
|
|
12
10
|
const commonPropTypes = {
|
|
13
11
|
disabled: PropTypes.bool,
|
|
14
12
|
tabIndex: PropTypes.number,
|
|
@@ -17,16 +15,13 @@ const commonPropTypes = {
|
|
|
17
15
|
className: PropTypes.string,
|
|
18
16
|
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
19
17
|
};
|
|
20
|
-
|
|
21
18
|
class ContentEditableBase extends Component {
|
|
22
19
|
shouldComponentUpdate(nextProps) {
|
|
23
20
|
return nextProps.disabled !== this.props.disabled || nextProps.__html !== this.props.__html;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
componentDidUpdate(prevProps) {
|
|
27
23
|
this.props.onComponentUpdate(prevProps);
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
render() {
|
|
31
26
|
const {
|
|
32
27
|
__html,
|
|
@@ -37,7 +32,8 @@ class ContentEditableBase extends Component {
|
|
|
37
32
|
...props
|
|
38
33
|
} = this.props;
|
|
39
34
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
40
|
-
ref: inputRef
|
|
35
|
+
ref: inputRef
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
37
|
// @ts-ignore
|
|
42
38
|
,
|
|
43
39
|
disabled: disabled,
|
|
@@ -49,20 +45,17 @@ class ContentEditableBase extends Component {
|
|
|
49
45
|
}
|
|
50
46
|
}));
|
|
51
47
|
}
|
|
52
|
-
|
|
53
48
|
}
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
_defineProperty(ContentEditableBase, "propTypes", {
|
|
50
|
+
...commonPropTypes,
|
|
56
51
|
__html: PropTypes.string
|
|
57
52
|
});
|
|
58
|
-
|
|
59
53
|
_defineProperty(ContentEditableBase, "defaultProps", {
|
|
60
54
|
disabled: false,
|
|
61
55
|
tabIndex: 0,
|
|
62
56
|
onInput: noop,
|
|
63
57
|
onComponentUpdate: noop
|
|
64
58
|
});
|
|
65
|
-
|
|
66
59
|
const ContentEditable = _ref => {
|
|
67
60
|
let {
|
|
68
61
|
children,
|
|
@@ -72,8 +65,8 @@ const ContentEditable = _ref => {
|
|
|
72
65
|
__html: renderToStaticMarkup(children)
|
|
73
66
|
}));
|
|
74
67
|
};
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
ContentEditable.propTypes = {
|
|
69
|
+
...commonPropTypes,
|
|
77
70
|
children: PropTypes.node
|
|
78
71
|
};
|
|
79
72
|
|
|
@@ -48,9 +48,7 @@ import '../_helpers/checkbox.js';
|
|
|
48
48
|
class DataList extends PureComponent {
|
|
49
49
|
constructor() {
|
|
50
50
|
super(...arguments);
|
|
51
|
-
|
|
52
51
|
_defineProperty(this, "shortcutsScope", getUID('ring-data-list-'));
|
|
53
|
-
|
|
54
52
|
_defineProperty(this, "onItemFocus", item => {
|
|
55
53
|
const {
|
|
56
54
|
selection,
|
|
@@ -58,49 +56,39 @@ class DataList extends PureComponent {
|
|
|
58
56
|
} = this.props;
|
|
59
57
|
onSelect(selection.focus(item));
|
|
60
58
|
});
|
|
61
|
-
|
|
62
59
|
_defineProperty(this, "onItemSelect", (item, selected) => {
|
|
63
60
|
const {
|
|
64
61
|
selection,
|
|
65
62
|
onSelect
|
|
66
63
|
} = this.props;
|
|
67
|
-
|
|
68
64
|
if (selected) {
|
|
69
65
|
onSelect(selection.select(item));
|
|
70
66
|
} else {
|
|
71
67
|
onSelect(selection.deselect(item));
|
|
72
68
|
}
|
|
73
69
|
});
|
|
74
|
-
|
|
75
70
|
_defineProperty(this, "onEqualPress", () => {
|
|
76
71
|
const {
|
|
77
72
|
selection,
|
|
78
73
|
itemFormatter
|
|
79
74
|
} = this.props;
|
|
80
75
|
const focused = selection.getFocused();
|
|
81
|
-
|
|
82
76
|
if (focused == null) {
|
|
83
77
|
throw new Error('No focused item');
|
|
84
78
|
}
|
|
85
|
-
|
|
86
79
|
const item = itemFormatter(focused);
|
|
87
|
-
|
|
88
80
|
if (item.collapsed) {
|
|
89
81
|
var _item$onExpand;
|
|
90
|
-
|
|
91
82
|
(_item$onExpand = item.onExpand) === null || _item$onExpand === void 0 ? void 0 : _item$onExpand.call(item);
|
|
92
83
|
} else {
|
|
93
84
|
var _item$onCollapse;
|
|
94
|
-
|
|
95
85
|
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse === void 0 ? void 0 : _item$onCollapse.call(item);
|
|
96
86
|
}
|
|
97
87
|
});
|
|
98
|
-
|
|
99
88
|
_defineProperty(this, "shortcutsMap", {
|
|
100
89
|
'=': this.onEqualPress
|
|
101
90
|
});
|
|
102
91
|
}
|
|
103
|
-
|
|
104
92
|
componentDidUpdate(prevProps) {
|
|
105
93
|
const {
|
|
106
94
|
data,
|
|
@@ -108,18 +96,15 @@ class DataList extends PureComponent {
|
|
|
108
96
|
onSelect,
|
|
109
97
|
selectable
|
|
110
98
|
} = this.props;
|
|
111
|
-
|
|
112
99
|
if (data !== prevProps.data && !prevProps.remoteSelection) {
|
|
113
100
|
onSelect(selection.cloneWith({
|
|
114
101
|
data
|
|
115
102
|
}));
|
|
116
103
|
}
|
|
117
|
-
|
|
118
104
|
if (!selectable && prevProps.selectable) {
|
|
119
105
|
onSelect(selection.resetSelection());
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
|
-
|
|
123
108
|
render() {
|
|
124
109
|
const {
|
|
125
110
|
data,
|
|
@@ -131,7 +116,8 @@ class DataList extends PureComponent {
|
|
|
131
116
|
focused,
|
|
132
117
|
innerRef
|
|
133
118
|
} = this.props;
|
|
134
|
-
const shortcutsMap = {
|
|
119
|
+
const shortcutsMap = {
|
|
120
|
+
...this.shortcutsMap,
|
|
135
121
|
...this.props.shortcutsMap
|
|
136
122
|
};
|
|
137
123
|
const classes = classNames(className, {
|
|
@@ -150,7 +136,6 @@ class DataList extends PureComponent {
|
|
|
150
136
|
className: classes
|
|
151
137
|
}, data.map(model => {
|
|
152
138
|
var _this$props$itemMoreL, _this$props;
|
|
153
|
-
|
|
154
139
|
const item = itemFormatter(model);
|
|
155
140
|
const {
|
|
156
141
|
id,
|
|
@@ -182,16 +167,13 @@ class DataList extends PureComponent {
|
|
|
182
167
|
className: data.length > 0 ? modules_09d014b4.loadingOverlay : undefined
|
|
183
168
|
}, /*#__PURE__*/React.createElement(Loader, null)));
|
|
184
169
|
}
|
|
185
|
-
|
|
186
170
|
}
|
|
187
|
-
|
|
188
171
|
_defineProperty(DataList, "defaultProps", {
|
|
189
172
|
loading: false,
|
|
190
173
|
onItemMoreLess: () => {},
|
|
191
174
|
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
192
175
|
remoteSelection: false
|
|
193
176
|
});
|
|
194
|
-
|
|
195
177
|
DataList.propTypes = {
|
|
196
178
|
className: PropTypes.string,
|
|
197
179
|
data: PropTypes.array.isRequired,
|
|
@@ -208,23 +190,17 @@ DataList.propTypes = {
|
|
|
208
190
|
onSelect: PropTypes.func.isRequired,
|
|
209
191
|
remoteSelection: PropTypes.bool
|
|
210
192
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
193
|
+
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
|
194
|
+
// eslint-disable-next-line react/no-multi-comp
|
|
215
195
|
class DataListContainer extends Component {
|
|
216
196
|
constructor() {
|
|
217
197
|
super(...arguments);
|
|
218
|
-
|
|
219
198
|
_defineProperty(this, "DataList", getContainer());
|
|
220
199
|
}
|
|
221
|
-
|
|
222
200
|
render() {
|
|
223
201
|
return /*#__PURE__*/React.createElement(this.DataList, this.props);
|
|
224
202
|
}
|
|
225
|
-
|
|
226
203
|
}
|
|
227
|
-
|
|
228
204
|
_defineProperty(DataListContainer, "propTypes", getContainer().propTypes);
|
|
229
205
|
|
|
230
206
|
export { DataListContainer as default };
|
package/dist/data-list/item.js
CHANGED
|
@@ -34,20 +34,17 @@ import '../_helpers/checkbox.js';
|
|
|
34
34
|
import '../global/get-uid.js';
|
|
35
35
|
|
|
36
36
|
var moreLessButtonStates;
|
|
37
|
-
|
|
38
37
|
(function (moreLessButtonStates) {
|
|
39
38
|
moreLessButtonStates[moreLessButtonStates["UNUSED"] = 0] = "UNUSED";
|
|
40
39
|
moreLessButtonStates[moreLessButtonStates["MORE"] = 1] = "MORE";
|
|
41
40
|
moreLessButtonStates[moreLessButtonStates["MORE_LOADING"] = 2] = "MORE_LOADING";
|
|
42
41
|
moreLessButtonStates[moreLessButtonStates["LESS"] = 3] = "LESS";
|
|
43
42
|
})(moreLessButtonStates || (moreLessButtonStates = {}));
|
|
44
|
-
|
|
45
43
|
const ITEM_LEFT_OFFSET = 32;
|
|
46
44
|
const LIST_LEFT_OFFSET = 24;
|
|
47
45
|
class Item extends PureComponent {
|
|
48
46
|
constructor() {
|
|
49
47
|
super(...arguments);
|
|
50
|
-
|
|
51
48
|
_defineProperty(this, "onShowMore", () => {
|
|
52
49
|
const {
|
|
53
50
|
onItemMoreLess,
|
|
@@ -55,7 +52,6 @@ class Item extends PureComponent {
|
|
|
55
52
|
} = this.props;
|
|
56
53
|
onItemMoreLess(item, true);
|
|
57
54
|
});
|
|
58
|
-
|
|
59
55
|
_defineProperty(this, "onShowLess", () => {
|
|
60
56
|
const {
|
|
61
57
|
onItemMoreLess,
|
|
@@ -63,7 +59,6 @@ class Item extends PureComponent {
|
|
|
63
59
|
} = this.props;
|
|
64
60
|
onItemMoreLess(item, false);
|
|
65
61
|
});
|
|
66
|
-
|
|
67
62
|
_defineProperty(this, "onFocus", () => {
|
|
68
63
|
const {
|
|
69
64
|
onFocus,
|
|
@@ -71,7 +66,6 @@ class Item extends PureComponent {
|
|
|
71
66
|
} = this.props;
|
|
72
67
|
onFocus(item);
|
|
73
68
|
});
|
|
74
|
-
|
|
75
69
|
_defineProperty(this, "onSelect", selected => {
|
|
76
70
|
const {
|
|
77
71
|
onSelect,
|
|
@@ -79,7 +73,6 @@ class Item extends PureComponent {
|
|
|
79
73
|
} = this.props;
|
|
80
74
|
onSelect(item, selected);
|
|
81
75
|
});
|
|
82
|
-
|
|
83
76
|
_defineProperty(this, "renderItem", (model, parentShift) => {
|
|
84
77
|
const {
|
|
85
78
|
onFocus,
|
|
@@ -110,7 +103,6 @@ class Item extends PureComponent {
|
|
|
110
103
|
});
|
|
111
104
|
});
|
|
112
105
|
}
|
|
113
|
-
|
|
114
106
|
render() {
|
|
115
107
|
const {
|
|
116
108
|
title,
|
|
@@ -127,7 +119,6 @@ class Item extends PureComponent {
|
|
|
127
119
|
onExpand
|
|
128
120
|
} = this.props;
|
|
129
121
|
let moreLessButton;
|
|
130
|
-
|
|
131
122
|
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
|
132
123
|
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
|
133
124
|
info: true
|
|
@@ -147,9 +138,7 @@ class Item extends PureComponent {
|
|
|
147
138
|
onClick: this.onShowLess
|
|
148
139
|
}, 'Show less'));
|
|
149
140
|
}
|
|
150
|
-
|
|
151
141
|
let collapserExpander = null;
|
|
152
|
-
|
|
153
142
|
if (collapsible) {
|
|
154
143
|
if (collapsed) {
|
|
155
144
|
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
|
@@ -171,7 +160,6 @@ class Item extends PureComponent {
|
|
|
171
160
|
});
|
|
172
161
|
}
|
|
173
162
|
}
|
|
174
|
-
|
|
175
163
|
const itemIsEmpty = !(items !== null && items !== void 0 && items.length) || collapsible && collapsed;
|
|
176
164
|
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
|
177
165
|
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Title, {
|
|
@@ -190,9 +178,7 @@ class Item extends PureComponent {
|
|
|
190
178
|
className: modules_09d014b4.showMore
|
|
191
179
|
}, moreLessButton) : null) : null);
|
|
192
180
|
}
|
|
193
|
-
|
|
194
181
|
}
|
|
195
|
-
|
|
196
182
|
_defineProperty(Item, "defaultProps", {
|
|
197
183
|
items: [],
|
|
198
184
|
level: 0,
|
|
@@ -200,7 +186,6 @@ _defineProperty(Item, "defaultProps", {
|
|
|
200
186
|
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
201
187
|
onItemMoreLess: () => {}
|
|
202
188
|
});
|
|
203
|
-
|
|
204
189
|
Item.propTypes = {
|
|
205
190
|
item: PropTypes.shape({
|
|
206
191
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|