@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,20 +1,12 @@
|
|
1
|
-
import { i as _slicedToArray, j as _toConsumableArray } 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.from.js';
|
5
|
-
import 'core-js/modules/es.array.map.js';
|
6
|
-
import 'core-js/modules/es.array.slice.js';
|
7
|
-
import 'core-js/modules/es.object.to-string.js';
|
8
1
|
import 'core-js/modules/es.regexp.exec.js';
|
9
|
-
import 'core-js/modules/
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
10
3
|
import { useMemo } from 'react';
|
11
4
|
import PropTypes from 'prop-types';
|
12
5
|
import getUID from '../global/get-uid.js';
|
13
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
14
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
15
7
|
|
16
|
-
|
17
|
-
|
8
|
+
const colorPairs = [['#60A800', '#D5CA00'], ['#21D370', '#03E9E1'], ['#3BA1FF', '#36E97D'], ['#00C243', '#00FFFF'], ['#4BE098', '#627FFF'], ['#168BFA', '#26F7C7'], ['#9D4CFF', '#39D3C3'], ['#0A81F6', '#0ACFF6'], ['#765AF8', '#5A91F8'], ['#9E54FF', '#0ACFF6'], ['#B345F1', '#669DFF'], ['#765AF8', '#C059EE'], ['#9039D0', '#C239D0'], ['#9F2AFF', '#FD56FD'], ['#AB3AF2', '#E40568'], ['#9F2AFF', '#E9A80B'], ['#D50F6B', '#E73AE8'], ['#ED5502', '#E73AE8'], ['#ED358C', '#DBED18'], ['#ED358C', '#F9902E'], ['#FF7500', '#FFCA00']];
|
9
|
+
const Sizes = {
|
18
10
|
18: {
|
19
11
|
radius: 2,
|
20
12
|
text: {
|
@@ -63,11 +55,9 @@ var Sizes = {
|
|
63
55
|
}
|
64
56
|
}
|
65
57
|
};
|
66
|
-
|
58
|
+
const sizeKeys = Object.keys(Sizes).map(Number);
|
67
59
|
function extractLetters(name) {
|
68
|
-
|
69
|
-
return Array.from(word);
|
70
|
-
});
|
60
|
+
const names = name.split(/[\s._]+/).filter(Boolean).map(word => Array.from(word));
|
71
61
|
if (names.length >= 2) {
|
72
62
|
return names[0][0].toUpperCase() + names[1][0].toUpperCase();
|
73
63
|
} else if (names.length === 1) {
|
@@ -81,31 +71,27 @@ function extractLetters(name) {
|
|
81
71
|
}
|
82
72
|
}
|
83
73
|
// https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0#gistcomment-2775538
|
84
|
-
|
74
|
+
const BASE = 32;
|
85
75
|
function hashCode(s) {
|
86
|
-
|
87
|
-
for (
|
76
|
+
let h = 0;
|
77
|
+
for (let i = 0; i < s.length; i++) {
|
88
78
|
h = Math.imul(BASE - 1, h) + s.charCodeAt(i) | 0;
|
89
79
|
}
|
90
80
|
return h;
|
91
81
|
}
|
92
82
|
function FallbackAvatar(_ref) {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
var radius = round ? '50%' : sizes.radius;
|
106
|
-
var gradientId = useMemo(function () {
|
107
|
-
return getUID('gradient-');
|
108
|
-
}, []);
|
83
|
+
let {
|
84
|
+
username,
|
85
|
+
size,
|
86
|
+
round
|
87
|
+
} = _ref;
|
88
|
+
const hash = Math.abs(hashCode(username.toLowerCase()));
|
89
|
+
const [fromColor, toColor] = colorPairs[hash % colorPairs.length];
|
90
|
+
const possibleSizeKeys = sizeKeys.filter(key => key >= size);
|
91
|
+
const sizeKey = possibleSizeKeys.length > 0 ? Math.min(...possibleSizeKeys) : Math.max(...sizeKeys);
|
92
|
+
const sizes = Sizes[sizeKey];
|
93
|
+
const radius = round ? '50%' : sizes.radius;
|
94
|
+
const gradientId = useMemo(() => getUID('gradient-'), []);
|
109
95
|
return /*#__PURE__*/jsxs("svg", {
|
110
96
|
viewBox: "0 0 ".concat(sizeKey, " ").concat(sizeKey),
|
111
97
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { PureComponent } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import classNames from 'classnames';
|
@@ -6,50 +6,44 @@ import deprecate from 'util-deprecate';
|
|
6
6
|
import joinDataTestAttributes from '../global/data-tests.js';
|
7
7
|
import { m as modules_6c9187df } from '../_helpers/badge.js';
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
9
|
-
import 'core-js/modules/es.array.concat.js';
|
10
9
|
import 'core-js/modules/es.array.reduce.js';
|
11
|
-
import 'core-js/modules/
|
12
|
-
import 'core-js/modules/es.object.to-string.js';
|
10
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
13
11
|
|
14
|
-
|
15
|
-
|
12
|
+
const _excluded = ["gray", "valid", "invalid", "disabled", "className", "children", "data-test"];
|
13
|
+
const warn = deprecate(() => {}, 'Badge is deprecated and will be removed in RingUI 7.0. Use Tag instead.');
|
16
14
|
/**
|
17
15
|
* @name Badge
|
18
16
|
*/
|
19
17
|
// TODO remove in 7.0
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
class Badge extends PureComponent {
|
19
|
+
render() {
|
20
|
+
warn();
|
21
|
+
const _this$props = this.props,
|
22
|
+
{
|
23
|
+
// Modifiers
|
24
|
+
gray,
|
25
|
+
valid,
|
26
|
+
invalid,
|
27
|
+
disabled,
|
28
|
+
// Props
|
29
|
+
className,
|
30
|
+
children,
|
31
|
+
'data-test': dataTest
|
32
|
+
} = _this$props,
|
33
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
34
|
+
const classes = classNames(modules_6c9187df.badge, className, {
|
35
|
+
[modules_6c9187df.gray]: gray,
|
36
|
+
[modules_6c9187df.valid]: valid,
|
37
|
+
[modules_6c9187df.invalid]: invalid,
|
38
|
+
[modules_6c9187df.disabled]: disabled
|
39
|
+
});
|
40
|
+
return /*#__PURE__*/jsx("span", _objectSpread2(_objectSpread2({}, props), {}, {
|
41
|
+
"data-test": joinDataTestAttributes('ring-badge', dataTest),
|
42
|
+
className: classes,
|
43
|
+
children: children
|
44
|
+
}));
|
24
45
|
}
|
25
|
-
|
26
|
-
return _createClass(Badge, [{
|
27
|
-
key: "render",
|
28
|
-
value: function render() {
|
29
|
-
warn();
|
30
|
-
var _this$props = this.props,
|
31
|
-
gray = _this$props.gray,
|
32
|
-
valid = _this$props.valid,
|
33
|
-
invalid = _this$props.invalid,
|
34
|
-
disabled = _this$props.disabled,
|
35
|
-
className = _this$props.className,
|
36
|
-
children = _this$props.children,
|
37
|
-
dataTest = _this$props['data-test'],
|
38
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
39
|
-
var classes = classNames(modules_6c9187df.badge, className, {
|
40
|
-
[modules_6c9187df.gray]: gray,
|
41
|
-
[modules_6c9187df.valid]: valid,
|
42
|
-
[modules_6c9187df.invalid]: invalid,
|
43
|
-
[modules_6c9187df.disabled]: disabled
|
44
|
-
});
|
45
|
-
return /*#__PURE__*/jsx("span", _objectSpread2(_objectSpread2({}, props), {}, {
|
46
|
-
"data-test": joinDataTestAttributes('ring-badge', dataTest),
|
47
|
-
className: classes,
|
48
|
-
children: children
|
49
|
-
}));
|
50
|
-
}
|
51
|
-
}]);
|
52
|
-
}(PureComponent);
|
46
|
+
}
|
53
47
|
_defineProperty(Badge, "propTypes", {
|
54
48
|
gray: PropTypes.bool,
|
55
49
|
valid: PropTypes.bool,
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import 'core-js/modules/es.array.map.js';
|
2
|
-
import 'core-js/modules/es.object.to-string.js';
|
3
|
-
import 'core-js/modules/es.promise.js';
|
4
1
|
import classNames from 'classnames';
|
5
2
|
import { Children, Fragment } from 'react';
|
6
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
@@ -8,20 +5,19 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
5
|
var modules_18e4daa4 = {"separator":"separator_rui_09b2"};
|
9
6
|
|
10
7
|
function Breadcrumbs(_ref) {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
});
|
8
|
+
let {
|
9
|
+
separatorClassName,
|
10
|
+
children
|
11
|
+
} = _ref;
|
12
|
+
return Children.toArray(children).map((child, index) =>
|
13
|
+
/*#__PURE__*/
|
14
|
+
// eslint-disable-next-line react/no-array-index-key
|
15
|
+
jsxs(Fragment, {
|
16
|
+
children: [index > 0 && /*#__PURE__*/jsx("span", {
|
17
|
+
className: classNames(modules_18e4daa4.separator, separatorClassName),
|
18
|
+
children: '/'
|
19
|
+
}), child]
|
20
|
+
}, index));
|
25
21
|
}
|
26
22
|
|
27
23
|
export { Breadcrumbs as default };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { PureComponent, createRef } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import classNames from 'classnames';
|
@@ -14,96 +14,83 @@ import 'util-deprecate';
|
|
14
14
|
import '../_helpers/icon__svg.js';
|
15
15
|
import 'core-js/modules/es.regexp.exec.js';
|
16
16
|
import 'core-js/modules/es.string.replace.js';
|
17
|
-
import 'core-js/modules/es.string.starts-with.js';
|
18
17
|
import '../global/memoize.js';
|
19
|
-
import 'core-js/modules/es.array.iterator.js';
|
20
|
-
import 'core-js/modules/es.map.js';
|
21
|
-
import 'core-js/modules/es.object.to-string.js';
|
22
|
-
import 'core-js/modules/es.weak-map.js';
|
23
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
24
18
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
31
|
-
args[_key] = arguments[_key];
|
32
|
-
}
|
33
|
-
_this = _callSuper(this, Button, [].concat(args));
|
34
|
-
_defineProperty(_this, "buttonRef", /*#__PURE__*/createRef());
|
35
|
-
return _this;
|
19
|
+
const _excluded = ["active", "danger", "delayed", "loader", "primary", "short", "text", "inline", "dropdown", "height", "icon", "iconSize", "iconClassName", "iconSuppressSizeWarning", "className", "children"];
|
20
|
+
class Button extends PureComponent {
|
21
|
+
constructor() {
|
22
|
+
super(...arguments);
|
23
|
+
_defineProperty(this, "buttonRef", /*#__PURE__*/createRef());
|
36
24
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
var _this$props = this.props,
|
42
|
-
active = _this$props.active,
|
43
|
-
danger = _this$props.danger,
|
44
|
-
delayed = _this$props.delayed,
|
45
|
-
loader = _this$props.loader,
|
46
|
-
primary = _this$props.primary,
|
47
|
-
short = _this$props.short,
|
48
|
-
text = _this$props.text,
|
49
|
-
inline = _this$props.inline,
|
50
|
-
dropdown = _this$props.dropdown,
|
51
|
-
_this$props$height = _this$props.height,
|
52
|
-
height = _this$props$height === void 0 ? this.context : _this$props$height,
|
53
|
-
icon = _this$props.icon,
|
54
|
-
iconSize = _this$props.iconSize,
|
55
|
-
iconClassName = _this$props.iconClassName,
|
56
|
-
iconSuppressSizeWarning = _this$props.iconSuppressSizeWarning,
|
57
|
-
className = _this$props.className,
|
58
|
-
children = _this$props.children,
|
59
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
60
|
-
var classes = getButtonClasses({
|
61
|
-
className,
|
25
|
+
render() {
|
26
|
+
const _this$props = this.props,
|
27
|
+
{
|
28
|
+
// Modifiers
|
62
29
|
active,
|
63
30
|
danger,
|
64
31
|
delayed,
|
65
|
-
icon,
|
66
32
|
loader,
|
67
33
|
primary,
|
68
34
|
short,
|
69
35
|
text,
|
70
36
|
inline,
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
37
|
+
dropdown,
|
38
|
+
height = this.context,
|
39
|
+
// Props
|
40
|
+
icon,
|
41
|
+
iconSize,
|
42
|
+
iconClassName,
|
43
|
+
iconSuppressSizeWarning,
|
44
|
+
className,
|
45
|
+
children
|
46
|
+
} = _this$props,
|
47
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
48
|
+
const classes = getButtonClasses({
|
49
|
+
className,
|
50
|
+
active,
|
51
|
+
danger,
|
52
|
+
delayed,
|
53
|
+
icon,
|
54
|
+
loader,
|
55
|
+
primary,
|
56
|
+
short,
|
57
|
+
text,
|
58
|
+
inline,
|
59
|
+
height
|
60
|
+
});
|
61
|
+
const content = /*#__PURE__*/jsxs("span", {
|
62
|
+
className: modules_e81895c9.content,
|
63
|
+
children: [icon && /*#__PURE__*/jsx("span", {
|
64
|
+
className: classNames(modules_e81895c9.icon, iconClassName),
|
65
|
+
children: /*#__PURE__*/jsx(Icon, {
|
66
|
+
glyph: icon,
|
67
|
+
size: iconSize,
|
68
|
+
loading: loader,
|
69
|
+
suppressSizeWarning: iconSuppressSizeWarning
|
98
70
|
})
|
99
|
-
})
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
71
|
+
}), children && /*#__PURE__*/jsx("span", {
|
72
|
+
children: children
|
73
|
+
}), dropdown && /*#__PURE__*/jsx(Icon, {
|
74
|
+
glyph: chevronDownIcon,
|
75
|
+
className: modules_e81895c9.dropdownIcon
|
76
|
+
})]
|
77
|
+
});
|
78
|
+
const commonProps = _objectSpread2(_objectSpread2({
|
79
|
+
tabIndex: loader ? -1 : 0
|
80
|
+
}, props), {}, {
|
81
|
+
className: classes,
|
82
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
83
|
+
children: [loader && !text && !icon && /*#__PURE__*/jsx("div", {
|
84
|
+
className: modules_e81895c9.loaderBackground
|
85
|
+
}), content]
|
86
|
+
})
|
87
|
+
});
|
88
|
+
return commonProps.href != null ? /*#__PURE__*/jsx(ClickableLink, _objectSpread2({}, commonProps)) : /*#__PURE__*/jsx("button", _objectSpread2({
|
89
|
+
ref: this.buttonRef,
|
90
|
+
type: "button"
|
91
|
+
}, commonProps));
|
92
|
+
}
|
93
|
+
}
|
107
94
|
_defineProperty(Button, "propTypes", {
|
108
95
|
active: PropTypes.bool,
|
109
96
|
danger: PropTypes.bool,
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.regexp.exec.js';
|
3
|
-
import 'core-js/modules/es.string.split.js';
|
4
3
|
import { PureComponent } from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
6
5
|
import classNames from 'classnames';
|
@@ -10,43 +9,35 @@ import ControlHelp from '../control-help/control-help.js';
|
|
10
9
|
import { m as modules_1068e447 } from '../_helpers/caption.js';
|
11
10
|
export { C as Caption } from '../_helpers/caption.js';
|
12
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
13
|
-
import 'core-js/modules/es.array.concat.js';
|
14
12
|
import 'core-js/modules/es.array.reduce.js';
|
15
|
-
import 'core-js/modules/
|
16
|
-
import 'core-js/modules/es.object.to-string.js';
|
13
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
const _excluded = ["className", "split", "data-test", "label", "help"];
|
16
|
+
class ButtonGroup extends PureComponent {
|
17
|
+
render() {
|
18
|
+
const _this$props = this.props,
|
19
|
+
{
|
20
|
+
className,
|
21
|
+
split,
|
22
|
+
'data-test': dataTest,
|
23
|
+
label,
|
24
|
+
help
|
25
|
+
} = _this$props,
|
26
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
27
|
+
const classes = classNames(split ? modules_1068e447.split : modules_1068e447.buttonGroup, className);
|
28
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
29
|
+
children: [label && /*#__PURE__*/jsx(ControlLabel, {
|
30
|
+
children: label
|
31
|
+
}), /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
32
|
+
"data-test": joinDataTestAttributes('ring-button-group', dataTest),
|
33
|
+
className: classes
|
34
|
+
})), help && /*#__PURE__*/jsx(ControlHelp, {
|
35
|
+
className: modules_1068e447.help,
|
36
|
+
children: help
|
37
|
+
})]
|
38
|
+
});
|
23
39
|
}
|
24
|
-
|
25
|
-
return _createClass(ButtonGroup, [{
|
26
|
-
key: "render",
|
27
|
-
value: function render() {
|
28
|
-
var _this$props = this.props,
|
29
|
-
className = _this$props.className,
|
30
|
-
split = _this$props.split,
|
31
|
-
dataTest = _this$props['data-test'],
|
32
|
-
label = _this$props.label,
|
33
|
-
help = _this$props.help,
|
34
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
35
|
-
var classes = classNames(split ? modules_1068e447.split : modules_1068e447.buttonGroup, className);
|
36
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
37
|
-
children: [label && /*#__PURE__*/jsx(ControlLabel, {
|
38
|
-
children: label
|
39
|
-
}), /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
40
|
-
"data-test": joinDataTestAttributes('ring-button-group', dataTest),
|
41
|
-
className: classes
|
42
|
-
})), help && /*#__PURE__*/jsx(ControlHelp, {
|
43
|
-
className: modules_1068e447.help,
|
44
|
-
children: help
|
45
|
-
})]
|
46
|
-
});
|
47
|
-
}
|
48
|
-
}]);
|
49
|
-
}(PureComponent);
|
40
|
+
}
|
50
41
|
_defineProperty(ButtonGroup, "propTypes", {
|
51
42
|
children: PropTypes.node,
|
52
43
|
className: PropTypes.string
|
@@ -1,40 +1,32 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { PureComponent } from 'react';
|
3
3
|
import classNames from 'classnames';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import joinDataTestAttributes from '../global/data-tests.js';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
|
-
import 'core-js/modules/es.array.concat.js';
|
8
7
|
import 'core-js/modules/es.array.reduce.js';
|
9
|
-
import 'core-js/modules/
|
10
|
-
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
11
9
|
|
12
10
|
var modules_fd849143 = {"button":"button_rui_6ad6","light":"light_rui_2ac4","buttonSet":"buttonSet_rui_97ff"};
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
const _excluded = ["className", "data-test", "children"];
|
13
|
+
class ButtonSet extends PureComponent {
|
14
|
+
render() {
|
15
|
+
const _this$props = this.props,
|
16
|
+
{
|
17
|
+
className,
|
18
|
+
'data-test': dataTest,
|
19
|
+
children
|
20
|
+
} = _this$props,
|
21
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
22
|
+
const classes = classNames(modules_fd849143.buttonSet, className);
|
23
|
+
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
24
|
+
"data-test": joinDataTestAttributes('ring-button-set', dataTest),
|
25
|
+
className: classes,
|
26
|
+
children: children
|
27
|
+
}));
|
19
28
|
}
|
20
|
-
|
21
|
-
return _createClass(ButtonSet, [{
|
22
|
-
key: "render",
|
23
|
-
value: function render() {
|
24
|
-
var _this$props = this.props,
|
25
|
-
className = _this$props.className,
|
26
|
-
dataTest = _this$props['data-test'],
|
27
|
-
children = _this$props.children,
|
28
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
29
|
-
var classes = classNames(modules_fd849143.buttonSet, className);
|
30
|
-
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
31
|
-
"data-test": joinDataTestAttributes('ring-button-set', dataTest),
|
32
|
-
className: classes,
|
33
|
-
children: children
|
34
|
-
}));
|
35
|
-
}
|
36
|
-
}]);
|
37
|
-
}(PureComponent);
|
29
|
+
}
|
38
30
|
_defineProperty(ButtonSet, "propTypes", {
|
39
31
|
children: PropTypes.node,
|
40
32
|
className: PropTypes.string,
|
@@ -1,38 +1,30 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { PureComponent } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import classNames from 'classnames';
|
5
5
|
import joinDataTestAttributes from '../global/data-tests.js';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
|
-
import 'core-js/modules/es.array.concat.js';
|
8
7
|
import 'core-js/modules/es.array.reduce.js';
|
9
|
-
import 'core-js/modules/
|
10
|
-
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
11
9
|
|
12
10
|
var modules_34154ec0 = {"button":"button_rui_6ad6","light":"light_rui_2ac4","buttonToolbar":"buttonToolbar_rui_5c90","buttonGroup":"buttonGroup_rui_5c90","split":"split_rui_5c90"};
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
const _excluded = ["className", "data-test"];
|
13
|
+
class ButtonToolbar extends PureComponent {
|
14
|
+
render() {
|
15
|
+
const _this$props = this.props,
|
16
|
+
{
|
17
|
+
className,
|
18
|
+
'data-test': dataTest
|
19
|
+
} = _this$props,
|
20
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
21
|
+
const classes = classNames(modules_34154ec0.buttonToolbar, className);
|
22
|
+
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
23
|
+
"data-test": joinDataTestAttributes('ring-button-toolbar', dataTest),
|
24
|
+
className: classes
|
25
|
+
}));
|
19
26
|
}
|
20
|
-
|
21
|
-
return _createClass(ButtonToolbar, [{
|
22
|
-
key: "render",
|
23
|
-
value: function render() {
|
24
|
-
var _this$props = this.props,
|
25
|
-
className = _this$props.className,
|
26
|
-
dataTest = _this$props['data-test'],
|
27
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
28
|
-
var classes = classNames(modules_34154ec0.buttonToolbar, className);
|
29
|
-
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
30
|
-
"data-test": joinDataTestAttributes('ring-button-toolbar', dataTest),
|
31
|
-
className: classes
|
32
|
-
}));
|
33
|
-
}
|
34
|
-
}]);
|
35
|
-
}(PureComponent);
|
27
|
+
}
|
36
28
|
_defineProperty(ButtonToolbar, "propTypes", {
|
37
29
|
children: PropTypes.node,
|
38
30
|
className: PropTypes.string,
|