@jetbrains/ring-ui-built 7.0.66 → 7.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/_helpers/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +16 -24
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,5 +1,3 @@
|
|
|
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
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent, createRef } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -12,29 +10,25 @@ import { ControlsHeightContext } from '../global/controls-height.js';
|
|
|
12
10
|
import { g as getButtonClasses, s as styles } from '../_helpers/button.classes.js';
|
|
13
11
|
import { Size } from '../icon/icon.constants.js';
|
|
14
12
|
import '../_helpers/icon-svg.js';
|
|
15
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
16
|
-
import 'core-js/modules/es.string.replace.js';
|
|
17
13
|
import '../global/memoize.js';
|
|
18
14
|
import '../global/configuration.js';
|
|
19
15
|
|
|
20
|
-
const _excluded = ["download", "href", "hrefLang", "media", "ping", "target", "type", "referrerPolicy", "onConditionalClick", "onPlainLeftClick", "activeClassName"],
|
|
21
|
-
_excluded2 = ["active", "danger", "delayed", "loader", "primary", "success", "error", "secondary", "ghost", "short", "text", "dropdown", "height", "icon", "iconRight", "iconSize", "iconClassName", "iconRightClassName", "iconSuppressSizeWarning", "className", "children", "inline", "disabled"];
|
|
22
16
|
const warnText = deprecate(() => {}, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
|
23
17
|
function removeLinkProps(props) {
|
|
24
18
|
const {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
download,
|
|
20
|
+
href,
|
|
21
|
+
hrefLang,
|
|
22
|
+
media,
|
|
23
|
+
ping,
|
|
24
|
+
target,
|
|
25
|
+
type,
|
|
26
|
+
referrerPolicy,
|
|
27
|
+
onConditionalClick,
|
|
28
|
+
onPlainLeftClick,
|
|
29
|
+
activeClassName,
|
|
30
|
+
...restProps
|
|
31
|
+
} = props;
|
|
38
32
|
return restProps;
|
|
39
33
|
}
|
|
40
34
|
/**
|
|
@@ -44,49 +38,51 @@ function removeLinkProps(props) {
|
|
|
44
38
|
* A component for displaying variously styled buttons.
|
|
45
39
|
*/
|
|
46
40
|
class Button extends PureComponent {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
43
|
+
*/
|
|
44
|
+
static IconSize = Size;
|
|
45
|
+
static contextType = ControlsHeightContext;
|
|
46
|
+
buttonRef = /*#__PURE__*/createRef();
|
|
51
47
|
render() {
|
|
52
48
|
var _ref;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
props = _objectWithoutProperties(_this$props, _excluded2);
|
|
49
|
+
const {
|
|
50
|
+
// Modifiers
|
|
51
|
+
active,
|
|
52
|
+
danger,
|
|
53
|
+
delayed,
|
|
54
|
+
loader,
|
|
55
|
+
primary,
|
|
56
|
+
success,
|
|
57
|
+
error,
|
|
58
|
+
secondary,
|
|
59
|
+
ghost,
|
|
60
|
+
short,
|
|
61
|
+
text,
|
|
62
|
+
dropdown,
|
|
63
|
+
height,
|
|
64
|
+
// Props
|
|
65
|
+
icon,
|
|
66
|
+
iconRight,
|
|
67
|
+
iconSize,
|
|
68
|
+
iconClassName,
|
|
69
|
+
iconRightClassName,
|
|
70
|
+
iconSuppressSizeWarning,
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
inline,
|
|
74
|
+
disabled,
|
|
75
|
+
...props
|
|
76
|
+
} = this.props;
|
|
82
77
|
const isInline = (_ref = inline !== null && inline !== void 0 ? inline : text) !== null && _ref !== void 0 ? _ref : !!icon;
|
|
83
78
|
if (text) {
|
|
84
79
|
warnText();
|
|
85
80
|
}
|
|
86
|
-
const classes = getButtonClasses(
|
|
81
|
+
const classes = getButtonClasses({
|
|
82
|
+
...this.props,
|
|
87
83
|
inline: isInline,
|
|
88
84
|
height: height !== null && height !== void 0 ? height : typeof this.context === 'function' ? this.context() : this.context
|
|
89
|
-
})
|
|
85
|
+
});
|
|
90
86
|
const content = jsxs(Fragment, {
|
|
91
87
|
children: [icon && jsx(Icon, {
|
|
92
88
|
className: classNames(styles.icon, iconClassName),
|
|
@@ -102,25 +98,24 @@ class Button extends PureComponent {
|
|
|
102
98
|
})]
|
|
103
99
|
});
|
|
104
100
|
const isDisabled = disabled || loader || undefined;
|
|
105
|
-
const commonProps =
|
|
101
|
+
const commonProps = {
|
|
102
|
+
...(props.href !== undefined && isDisabled ? removeLinkProps(props) : props),
|
|
106
103
|
className: classes,
|
|
107
104
|
children: jsxs(Fragment, {
|
|
108
105
|
children: [loader && !isInline && jsx("div", {
|
|
109
106
|
className: styles.loaderBackground
|
|
110
107
|
}), content]
|
|
111
108
|
})
|
|
112
|
-
}
|
|
113
|
-
return 'href' in commonProps && commonProps.href !== undefined ? jsx(ClickableLink,
|
|
109
|
+
};
|
|
110
|
+
return 'href' in commonProps && commonProps.href !== undefined ? jsx(ClickableLink, {
|
|
111
|
+
...commonProps
|
|
112
|
+
}) : jsx("button", {
|
|
114
113
|
ref: this.buttonRef,
|
|
115
114
|
type: 'button',
|
|
116
|
-
disabled: isDisabled
|
|
117
|
-
|
|
115
|
+
disabled: isDisabled,
|
|
116
|
+
...commonProps
|
|
117
|
+
});
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
/**
|
|
121
|
-
* @deprecated Use icons with appropriate intrinsic sizes instead
|
|
122
|
-
*/
|
|
123
|
-
_defineProperty(Button, "IconSize", Size);
|
|
124
|
-
_defineProperty(Button, "contextType", ControlsHeightContext);
|
|
125
120
|
|
|
126
121
|
export { Button, Size as IconSize, Button as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
3
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent, Children } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -8,33 +6,31 @@ import { ControlLabel } from '../control-label/control-label.js';
|
|
|
8
6
|
import ControlHelp from '../control-help/control-help.js';
|
|
9
7
|
import { s as styles } from '../_helpers/caption.js';
|
|
10
8
|
export { C as Caption } from '../_helpers/caption.js';
|
|
11
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
12
9
|
|
|
13
|
-
const _excluded = ["className", "split", "data-test", "label", "help"];
|
|
14
10
|
/**
|
|
15
11
|
* @name Button Group
|
|
16
12
|
*/
|
|
17
13
|
class ButtonGroup extends PureComponent {
|
|
18
14
|
render() {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
split,
|
|
18
|
+
'data-test': dataTest,
|
|
19
|
+
label,
|
|
20
|
+
help,
|
|
21
|
+
...restProps
|
|
22
|
+
} = this.props;
|
|
28
23
|
const classes = classNames(split ? styles.split : styles.buttonGroup, className, {
|
|
29
24
|
[styles.disabled]: Children.toArray(this.props.children).every(child => !!child && typeof child === 'object' && 'props' in child && child.props.disabled)
|
|
30
25
|
});
|
|
31
26
|
return jsxs(Fragment, {
|
|
32
27
|
children: [label && jsx(ControlLabel, {
|
|
33
28
|
children: label
|
|
34
|
-
}), jsx("div",
|
|
29
|
+
}), jsx("div", {
|
|
30
|
+
...restProps,
|
|
35
31
|
"data-test": joinDataTestAttributes('ring-button-group', dataTest),
|
|
36
32
|
className: classes
|
|
37
|
-
})
|
|
33
|
+
}), help && jsx(ControlHelp, {
|
|
38
34
|
className: styles.help,
|
|
39
35
|
children: help
|
|
40
36
|
})]
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
|
|
8
6
|
var styles = {"button":"ring-button-button","buttonSet":"ring-button-set-buttonSet"};
|
|
9
7
|
|
|
10
|
-
const _excluded = ["className", "data-test", "children"];
|
|
11
8
|
/**
|
|
12
9
|
* @name Button Set
|
|
13
10
|
*/
|
|
14
11
|
class ButtonSet extends PureComponent {
|
|
15
12
|
render() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
'data-test': dataTest,
|
|
16
|
+
children,
|
|
17
|
+
...restProps
|
|
18
|
+
} = this.props;
|
|
23
19
|
const classes = classNames(styles.buttonSet, className);
|
|
24
|
-
return jsx("div",
|
|
20
|
+
return jsx("div", {
|
|
21
|
+
...restProps,
|
|
25
22
|
"data-test": joinDataTestAttributes('ring-button-set', dataTest),
|
|
26
23
|
className: classes,
|
|
27
24
|
children: children
|
|
28
|
-
})
|
|
25
|
+
});
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
|
|
8
6
|
var styles = {"button":"ring-button-button","buttonToolbar":"ring-button-toolbar-buttonToolbar","buttonGroup":"ring-button-toolbar-buttonGroup","split":"ring-button-toolbar-split"};
|
|
9
7
|
|
|
10
|
-
const _excluded = ["className", "data-test"];
|
|
11
8
|
/**
|
|
12
9
|
* @name Button Toolbar
|
|
13
10
|
*/
|
|
14
11
|
class ButtonToolbar extends PureComponent {
|
|
15
12
|
render() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
'data-test': dataTest,
|
|
16
|
+
...restProps
|
|
17
|
+
} = this.props;
|
|
22
18
|
const classes = classNames(styles.buttonToolbar, className);
|
|
23
|
-
return jsx("div",
|
|
19
|
+
return jsx("div", {
|
|
20
|
+
...restProps,
|
|
24
21
|
"data-test": joinDataTestAttributes('ring-button-toolbar', dataTest),
|
|
25
22
|
className: classes
|
|
26
|
-
})
|
|
23
|
+
});
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
3
|
-
import 'core-js/modules/es.string.replace.js';
|
|
4
1
|
import { getRect } from '../global/dom.js';
|
|
5
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
6
2
|
|
|
7
3
|
/**
|
|
8
4
|
* @name Caret
|
|
9
5
|
*/
|
|
10
6
|
class Caret {
|
|
7
|
+
/**
|
|
8
|
+
* Line endings RegExp
|
|
9
|
+
* @type {RegExp}
|
|
10
|
+
*/
|
|
11
|
+
static returnRE = /\r/g;
|
|
11
12
|
/**
|
|
12
13
|
* Line endings normalizer
|
|
13
14
|
* Borrowed from jQuery
|
|
@@ -18,8 +19,8 @@ class Caret {
|
|
|
18
19
|
static normalizeNewlines(value) {
|
|
19
20
|
return typeof value === 'string' ? value.replace(this.returnRE, '') : value;
|
|
20
21
|
}
|
|
22
|
+
target;
|
|
21
23
|
constructor(target) {
|
|
22
|
-
_defineProperty(this, "target", void 0);
|
|
23
24
|
this.target = target;
|
|
24
25
|
}
|
|
25
26
|
isContentEditable() {
|
|
@@ -43,8 +44,8 @@ class Caret {
|
|
|
43
44
|
let curPos = 0;
|
|
44
45
|
while (_curNode && _curNode !== this.target) {
|
|
45
46
|
while (_curNode.previousSibling) {
|
|
46
|
-
var _curNode$previousSibl
|
|
47
|
-
curPos += (_curNode$previousSibl =
|
|
47
|
+
var _curNode$previousSibl;
|
|
48
|
+
curPos += (_curNode$previousSibl = _curNode.previousSibling.textContent?.length) !== null && _curNode$previousSibl !== void 0 ? _curNode$previousSibl : 0;
|
|
48
49
|
_curNode = _curNode.previousSibling;
|
|
49
50
|
}
|
|
50
51
|
_curNode = _curNode.parentNode;
|
|
@@ -57,14 +58,13 @@ class Caret {
|
|
|
57
58
|
* @param {boolean} params.avoidFocus
|
|
58
59
|
* @return {number}
|
|
59
60
|
*/
|
|
60
|
-
getPosition() {
|
|
61
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
61
|
+
getPosition(params = {}) {
|
|
62
62
|
if (this.isContentEditable()) {
|
|
63
63
|
if (!params.avoidFocus) {
|
|
64
64
|
this.focus();
|
|
65
65
|
}
|
|
66
66
|
const selection = window.getSelection();
|
|
67
|
-
if (!
|
|
67
|
+
if (!selection?.rangeCount) {
|
|
68
68
|
return 0;
|
|
69
69
|
}
|
|
70
70
|
const range1 = selection.getRangeAt(0);
|
|
@@ -137,12 +137,12 @@ class Caret {
|
|
|
137
137
|
while (curPos < position && _curNode.nodeType !== nodeTypeText) {
|
|
138
138
|
i++;
|
|
139
139
|
if (_curNode.childNodes[i]) {
|
|
140
|
-
var _curNode$childNodes$i
|
|
141
|
-
curPos += (_curNode$childNodes$i =
|
|
140
|
+
var _curNode$childNodes$i;
|
|
141
|
+
curPos += (_curNode$childNodes$i = _curNode.childNodes[i].textContent?.length) !== null && _curNode$childNodes$i !== void 0 ? _curNode$childNodes$i : 0;
|
|
142
142
|
if (curPos >= position) {
|
|
143
|
-
var _curNode$textContent
|
|
143
|
+
var _curNode$textContent$;
|
|
144
144
|
_curNode = _curNode.childNodes[i];
|
|
145
|
-
curPos -= (_curNode$textContent$ =
|
|
145
|
+
curPos -= (_curNode$textContent$ = _curNode.textContent?.length) !== null && _curNode$textContent$ !== void 0 ? _curNode$textContent$ : 0;
|
|
146
146
|
i = -1;
|
|
147
147
|
}
|
|
148
148
|
} else {
|
|
@@ -179,7 +179,7 @@ class Caret {
|
|
|
179
179
|
} else if (position === -1) {
|
|
180
180
|
var _value$length;
|
|
181
181
|
const value = isContentEditable ? this.target.textContent : Caret.normalizeNewlines('value' in this.target ? this.target.value : undefined);
|
|
182
|
-
correctedPosition = (_value$length = value
|
|
182
|
+
correctedPosition = (_value$length = value?.length) !== null && _value$length !== void 0 ? _value$length : 0;
|
|
183
183
|
} else {
|
|
184
184
|
const {
|
|
185
185
|
_curNode,
|
|
@@ -193,12 +193,10 @@ class Caret {
|
|
|
193
193
|
this.focus();
|
|
194
194
|
try {
|
|
195
195
|
if (correctedPosition instanceof Range) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
(_window$getSelection2 = window.getSelection()) === null || _window$getSelection2 === void 0 || _window$getSelection2.addRange(correctedPosition);
|
|
196
|
+
window.getSelection()?.removeAllRanges();
|
|
197
|
+
window.getSelection()?.addRange(correctedPosition);
|
|
199
198
|
} else {
|
|
200
|
-
|
|
201
|
-
(_window$getSelection3 = window.getSelection()) === null || _window$getSelection3 === void 0 || _window$getSelection3.collapse(curNode || this.target, correctedPosition);
|
|
199
|
+
window.getSelection()?.collapse(curNode || this.target, correctedPosition);
|
|
202
200
|
}
|
|
203
201
|
} catch (e) {
|
|
204
202
|
// Do nothing
|
|
@@ -216,10 +214,9 @@ class Caret {
|
|
|
216
214
|
let offset = 0;
|
|
217
215
|
let range;
|
|
218
216
|
try {
|
|
219
|
-
var _window$getSelection4, _range;
|
|
220
217
|
// Both statements may throw
|
|
221
|
-
range =
|
|
222
|
-
|
|
218
|
+
range = window.getSelection()?.getRangeAt(0).cloneRange();
|
|
219
|
+
range?.setStart(range.startContainer, range.startOffset - 1);
|
|
223
220
|
} catch (e) {
|
|
224
221
|
return offset;
|
|
225
222
|
}
|
|
@@ -229,10 +226,5 @@ class Caret {
|
|
|
229
226
|
return offset;
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Line endings RegExp
|
|
234
|
-
* @type {RegExp}
|
|
235
|
-
*/
|
|
236
|
-
_defineProperty(Caret, "returnRE", /\r/g);
|
|
237
229
|
|
|
238
230
|
export { Caret as default };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import figma from '@figma/code-connect';
|
|
4
2
|
|
|
5
|
-
var _templateObject;
|
|
6
3
|
const instance = figma.selectedInstance;
|
|
7
4
|
const labelType = instance.getString('Label');
|
|
8
5
|
const children = instance.findConnectedInstances(() => true);
|
|
9
6
|
const label = instance.findText('Group description').textContent;
|
|
10
7
|
const isFormLabel = labelType === 'form';
|
|
11
|
-
const imports = [
|
|
8
|
+
const imports = [`import ControlLabel${isFormLabel ? ', {LabelType}' : ''} from '@jetbrains/ring-ui/components/control-label/control-label'`];
|
|
12
9
|
const labelProps = [];
|
|
13
10
|
if (isFormLabel) {
|
|
14
11
|
labelProps.push('type={LabelType.FORM}');
|
|
@@ -25,12 +22,13 @@ const renderedChildren = children.map(child => {
|
|
|
25
22
|
});
|
|
26
23
|
var checkboxGroup_figma = {
|
|
27
24
|
id: 'checkbox-group',
|
|
28
|
-
example: figma.code
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
example: figma.code`${imports.join('\n')}
|
|
26
|
+
${renderedChildren[0].imports}
|
|
27
|
+
|
|
28
|
+
<ControlLabel ${labelProps.map(prop => `${prop} `).join('')}>${label}</ControlLabel>
|
|
29
|
+
${renderedChildren.map(({
|
|
30
|
+
code
|
|
31
|
+
}) => code).join('\n<br />\n')}`
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
export { checkboxGroup_figma as default };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import figma from '@figma/code-connect';
|
|
3
2
|
|
|
4
|
-
var _templateObject;
|
|
5
3
|
const instance = figma.selectedInstance;
|
|
6
4
|
const selected = instance.getString('Selected');
|
|
7
5
|
const hasLabel = instance.getBoolean('Label');
|
|
@@ -20,17 +18,19 @@ switch (selected) {
|
|
|
20
18
|
break;
|
|
21
19
|
}
|
|
22
20
|
if (hasLabel) {
|
|
23
|
-
props.push(
|
|
21
|
+
props.push(`label="${label}"`);
|
|
24
22
|
}
|
|
25
23
|
if (hasHelpText) {
|
|
26
|
-
props.push(
|
|
24
|
+
props.push(`help="${helpText}"`);
|
|
27
25
|
}
|
|
28
26
|
if (state === 'Disabled') {
|
|
29
27
|
props.push('disabled');
|
|
30
28
|
}
|
|
31
29
|
var checkbox_figma = {
|
|
32
30
|
id: 'checkbox',
|
|
33
|
-
example: figma.code
|
|
31
|
+
example: figma.code`${imports.join('\n')}
|
|
32
|
+
|
|
33
|
+
<Checkbox ${props.map(prop => `${prop} `).join('')}/>`
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export { checkbox_figma as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
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
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -11,14 +9,11 @@ import ControlHelp from '../control-help/control-help.js';
|
|
|
11
9
|
import 'util-deprecate';
|
|
12
10
|
import '../icon/icon.constants.js';
|
|
13
11
|
import '../_helpers/icon-svg.js';
|
|
14
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
15
|
-
import 'core-js/modules/es.string.replace.js';
|
|
16
12
|
import '../global/memoize.js';
|
|
17
13
|
import 'memoize-one';
|
|
18
14
|
|
|
19
15
|
var styles = {"checkbox":"ring-checkbox-checkbox","cell":"ring-checkbox-cell","icon":"ring-checkbox-icon","check":"ring-checkbox-check ring-checkbox-icon","minus":"ring-checkbox-minus ring-checkbox-icon","input":"ring-checkbox-input","cellWrapper":"ring-checkbox-cellWrapper","focus":"ring-checkbox-focus","label":"ring-checkbox-label"};
|
|
20
16
|
|
|
21
|
-
const _excluded = ["children", "label", "className", "containerClassName", "containerStyle", "cellClassName", "labelClassName", "indeterminate", "inputRef", "help"];
|
|
22
17
|
/**
|
|
23
18
|
* @name Checkbox
|
|
24
19
|
*/
|
|
@@ -26,17 +21,9 @@ const _excluded = ["children", "label", "className", "containerClassName", "cont
|
|
|
26
21
|
* Displays a checkbox.
|
|
27
22
|
*/
|
|
28
23
|
class Checkbox extends PureComponent {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "inputRef", el => {
|
|
33
|
-
if (el) {
|
|
34
|
-
el.indeterminate = this.props.indeterminate;
|
|
35
|
-
}
|
|
36
|
-
this.input = el;
|
|
37
|
-
});
|
|
38
|
-
_defineProperty(this, "composedInputRef", createComposedRef());
|
|
39
|
-
}
|
|
24
|
+
static defaultProps = {
|
|
25
|
+
indeterminate: false
|
|
26
|
+
};
|
|
40
27
|
componentDidMount() {
|
|
41
28
|
if (this.input) {
|
|
42
29
|
this.input.indeterminate = this.props.indeterminate;
|
|
@@ -50,21 +37,28 @@ class Checkbox extends PureComponent {
|
|
|
50
37
|
this.input.indeterminate = this.props.indeterminate;
|
|
51
38
|
}
|
|
52
39
|
}
|
|
40
|
+
input;
|
|
41
|
+
inputRef = el => {
|
|
42
|
+
if (el) {
|
|
43
|
+
el.indeterminate = this.props.indeterminate;
|
|
44
|
+
}
|
|
45
|
+
this.input = el;
|
|
46
|
+
};
|
|
47
|
+
composedInputRef = createComposedRef();
|
|
53
48
|
render() {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
49
|
+
const {
|
|
50
|
+
children,
|
|
51
|
+
label,
|
|
52
|
+
className,
|
|
53
|
+
containerClassName,
|
|
54
|
+
containerStyle,
|
|
55
|
+
cellClassName,
|
|
56
|
+
labelClassName,
|
|
57
|
+
indeterminate,
|
|
58
|
+
inputRef,
|
|
59
|
+
help,
|
|
60
|
+
...restProps
|
|
61
|
+
} = this.props;
|
|
68
62
|
const classes = classNames(styles.input, className);
|
|
69
63
|
const containerClasses = classNames(styles.checkbox, containerClassName);
|
|
70
64
|
const cellClasses = classNames(styles.cell, cellClassName);
|
|
@@ -73,12 +67,13 @@ class Checkbox extends PureComponent {
|
|
|
73
67
|
className: containerClasses,
|
|
74
68
|
style: containerStyle,
|
|
75
69
|
"data-test": 'ring-checkbox',
|
|
76
|
-
children: [jsx("input",
|
|
70
|
+
children: [jsx("input", {
|
|
71
|
+
...restProps,
|
|
77
72
|
"data-checked": restProps.checked,
|
|
78
73
|
ref: this.composedInputRef(this.inputRef, inputRef),
|
|
79
74
|
type: 'checkbox',
|
|
80
75
|
className: classes
|
|
81
|
-
})
|
|
76
|
+
}), jsx("div", {
|
|
82
77
|
className: styles.cellWrapper,
|
|
83
78
|
children: jsxs("span", {
|
|
84
79
|
className: cellClasses,
|
|
@@ -99,8 +94,5 @@ class Checkbox extends PureComponent {
|
|
|
99
94
|
});
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
|
-
_defineProperty(Checkbox, "defaultProps", {
|
|
103
|
-
indeterminate: false
|
|
104
|
-
});
|
|
105
97
|
|
|
106
98
|
export { Checkbox as default };
|
|
@@ -26,12 +26,12 @@ function copyHTMLToClipboard(str) {
|
|
|
26
26
|
const selection = document.getSelection();
|
|
27
27
|
// Should restore previous selection
|
|
28
28
|
const selected = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
|
29
|
-
selection
|
|
29
|
+
selection?.removeAllRanges();
|
|
30
30
|
const range = document.createRange();
|
|
31
31
|
range.selectNode(el);
|
|
32
|
-
selection
|
|
32
|
+
selection?.addRange(range);
|
|
33
33
|
document.execCommand('copy');
|
|
34
|
-
selection
|
|
34
|
+
selection?.removeAllRanges();
|
|
35
35
|
document.execCommand('copy');
|
|
36
36
|
document.body.removeChild(el);
|
|
37
37
|
if (selected && selection) {
|