@jetbrains/ring-ui 7.0.10 → 7.0.12
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/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +8 -14
- package/components/alert/container.js +3 -4
- package/components/alert-service/alert-service.d.ts +1 -1
- package/components/alert-service/alert-service.js +5 -8
- package/components/auth/down-notification.js +4 -12
- package/components/auth/iframe-flow.js +2 -3
- package/components/auth-dialog/auth-dialog.d.ts +1 -1
- package/components/auth-dialog/auth-dialog.js +2 -18
- package/components/auth-dialog-service/auth-dialog-service.js +2 -3
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.js +4 -8
- package/components/avatar/fallback-avatar.d.ts +1 -1
- package/components/avatar/fallback-avatar.js +2 -18
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.js +2 -4
- package/components/button/button.css +1 -1
- package/components/button/button.d.ts +1 -1
- package/components/button/button.js +4 -11
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +2 -5
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-set/button-set.js +2 -3
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/checkbox/checkbox.css +11 -3
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +2 -13
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -8
- package/components/collapse/collapse-content.js +3 -7
- package/components/collapse/collapse-control.js +3 -5
- package/components/collapse/collapse.js +8 -12
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +2 -15
- package/components/confirm-service/confirm-service.js +2 -3
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +2 -6
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/content-layout/sidebar.js +2 -11
- package/components/contenteditable/contenteditable.d.ts +2 -2
- package/components/contenteditable/contenteditable.js +6 -5
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-help/control-help.js +2 -1
- package/components/control-label/control-label.js +3 -5
- package/components/data-list/data-list.d.ts +3 -3
- package/components/data-list/data-list.js +8 -17
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +27 -72
- package/components/data-list/item.d.ts +2 -2
- package/components/data-list/item.js +7 -23
- package/components/data-list/title.d.ts +1 -1
- package/components/data-list/title.js +2 -11
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/date-picker.js +11 -23
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +9 -20
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +3 -4
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.d.ts +1 -1
- package/components/date-picker/month-slider.js +3 -4
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/month.js +3 -4
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +5 -8
- package/components/date-picker/weekdays.d.ts +1 -1
- package/components/date-picker/weekdays.js +3 -6
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +5 -8
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +12 -33
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/anchor.js +2 -3
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.js +7 -10
- package/components/dropdown-menu/dropdown-menu.js +4 -9
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +2 -30
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.js +2 -8
- package/components/error-message/error-message.d.ts +1 -1
- package/components/error-message/error-message.js +2 -10
- package/components/footer/footer.js +7 -14
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/create-stateful-context.js +2 -3
- package/components/global/focus-sensor-hoc.js +2 -1
- package/components/global/react-dom-renderer.d.ts +1 -1
- package/components/global/react-dom-renderer.js +2 -1
- package/components/global/rerender-hoc.js +3 -2
- package/components/global/theme.js +3 -11
- package/components/global/variables.css +2 -0
- package/components/global/variables_dark.css +2 -0
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +2 -3
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +2 -3
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +2 -3
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +2 -3
- package/components/header/header-icon.d.ts +1 -1
- package/components/header/header-icon.js +2 -1
- package/components/header/header.d.ts +1 -1
- package/components/header/header.js +3 -4
- package/components/header/links.d.ts +1 -1
- package/components/header/links.js +2 -1
- package/components/header/logo.d.ts +1 -1
- package/components/header/logo.js +2 -3
- package/components/header/profile.d.ts +1 -1
- package/components/header/profile.js +6 -19
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +5 -6
- package/components/header/services.d.ts +1 -1
- package/components/header/services.js +10 -15
- package/components/header/smart-profile.d.ts +1 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.d.ts +1 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray.d.ts +1 -1
- package/components/header/tray.js +3 -4
- package/components/heading/heading.js +6 -7
- package/components/i18n/i18n-context.js +2 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/icon.js +2 -3
- package/components/icon/icon__svg.d.ts +1 -1
- package/components/icon/icon__svg.js +3 -2
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +2 -15
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/adaptive-island-hoc.js +2 -5
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +5 -12
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +5 -12
- package/components/island/island.d.ts +3 -3
- package/components/island/island.js +2 -3
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/clickableLink.js +2 -4
- package/components/link/link.d.ts +4 -4
- package/components/link/link.js +3 -6
- package/components/list/list.d.ts +6 -6
- package/components/list/list.js +18 -38
- package/components/list/list__custom.d.ts +1 -1
- package/components/list/list__custom.js +2 -4
- package/components/list/list__hint.d.ts +1 -1
- package/components/list/list__hint.js +2 -3
- package/components/list/list__item.d.ts +1 -1
- package/components/list/list__item.js +3 -31
- package/components/list/list__link.d.ts +1 -1
- package/components/list/list__link.js +2 -3
- package/components/list/list__separator.d.ts +1 -1
- package/components/list/list__separator.js +2 -3
- package/components/list/list__title.d.ts +1 -1
- package/components/list/list__title.js +2 -8
- package/components/loader/loader.d.ts +1 -1
- package/components/loader/loader.js +2 -1
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-inline/loader-inline.js +3 -5
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/loader-screen/loader-screen.js +2 -3
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +2 -9
- package/components/login-dialog/service.js +2 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +2 -3
- package/components/message/message.d.ts +1 -1
- package/components/message/message.js +2 -21
- package/components/pager/pager.d.ts +5 -5
- package/components/pager/pager.js +11 -55
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +2 -3
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +13 -25
- package/components/popup/popup.target.js +3 -6
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/popup-menu/popup-menu.js +2 -3
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +2 -3
- package/components/query-assist/query-assist.d.ts +2 -2
- package/components/query-assist/query-assist.js +7 -45
- package/components/query-assist/query-assist__suggestions.d.ts +1 -1
- package/components/query-assist/query-assist__suggestions.js +5 -10
- package/components/radio/radio.css +3 -2
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.d.ts +1 -1
- package/components/radio/radio__item.js +3 -11
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +3 -2
- package/components/select/select.d.ts +3 -3
- package/components/select/select.js +43 -91
- package/components/select/select__filter.d.ts +1 -1
- package/components/select/select__filter.js +2 -5
- package/components/select/select__popup.d.ts +7 -7
- package/components/select/select__popup.js +13 -43
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts-hoc.js +2 -3
- package/components/slider/slider.css +3 -3
- package/components/slider/slider.js +31 -49
- package/components/tab-trap/tab-trap.js +9 -15
- package/components/table/cell.d.ts +1 -1
- package/components/table/cell.js +2 -3
- package/components/table/disable-hover-hoc.d.ts +2 -2
- package/components/table/disable-hover-hoc.js +2 -1
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +2 -12
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +5 -18
- package/components/table/multitable.d.ts +1 -1
- package/components/table/multitable.js +3 -4
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/row-with-focus-sensor.js +2 -1
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +5 -24
- package/components/table/selection-shortcuts-hoc.js +2 -1
- package/components/table/simple-table.d.ts +1 -1
- package/components/table/simple-table.js +2 -1
- package/components/table/smart-table.d.ts +1 -1
- package/components/table/smart-table.js +2 -1
- package/components/table/table.d.ts +4 -4
- package/components/table/table.js +8 -29
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +6 -13
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/collapsible-tab.js +3 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +2 -10
- package/components/tabs/dumb-tabs.d.ts +2 -3
- package/components/tabs/dumb-tabs.js +3 -9
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/smart-tabs.js +2 -3
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab-link.js +2 -9
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tab.js +2 -3
- package/components/tag/tag.d.ts +5 -5
- package/components/tag/tag.js +15 -23
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +4 -12
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +4 -8
- package/components/text/text.d.ts +1 -1
- package/components/text/text.js +2 -3
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +2 -17
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/tooltip.js +2 -11
- package/components/user-agreement/service.js +3 -12
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +2 -29
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +4 -37
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +3 -6
- package/components/user-card/tooltip.d.ts +2 -2
- package/components/user-card/tooltip.js +9 -12
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* @name Pager
|
|
3
4
|
*/
|
|
4
5
|
import { PureComponent } from 'react';
|
|
5
|
-
import * as React from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import chevronLeftIcon from '@jetbrains/icons/chevron-left';
|
|
8
8
|
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
@@ -75,9 +75,7 @@ export default class Pager extends PureComponent {
|
|
|
75
75
|
this.props.onLoadPage(i);
|
|
76
76
|
});
|
|
77
77
|
getButton(page, content, key, active) {
|
|
78
|
-
return (
|
|
79
|
-
{content}
|
|
80
|
-
</Button>);
|
|
78
|
+
return (_jsx(Button, { href: this.generateHref(page), active: active, disabled: this.props.loader && !active && !this.props.loaderNavigation, loader: this.props.loader && active, ...this.getClickProps(this.handlePageChange(page)), children: content }, key));
|
|
81
79
|
}
|
|
82
80
|
getClickProps(onClick) {
|
|
83
81
|
const { hrefFunc, onPageChange } = this.props;
|
|
@@ -93,41 +91,25 @@ export default class Pager extends PureComponent {
|
|
|
93
91
|
}
|
|
94
92
|
getPageSizeSelector() {
|
|
95
93
|
const selectOptions = this.getSelectOptions();
|
|
96
|
-
return (!this.props.disablePageSizeSelector && (
|
|
97
|
-
<Select data={selectOptions.data} selected={selectOptions.selected} onSelect={this.handlePageSizeChange} type={Select.Type.INLINE} disabled={this.props.loader}/>
|
|
98
|
-
</div>));
|
|
94
|
+
return (!this.props.disablePageSizeSelector && (_jsx("div", { "data-test": "ring-pager-page-size-selector", className: style.pageSize, children: _jsx(Select, { data: selectOptions.data, selected: selectOptions.selected, onSelect: this.handlePageSizeChange, type: Select.Type.INLINE, disabled: this.props.loader }) })));
|
|
99
95
|
}
|
|
100
96
|
getPagerLinks() {
|
|
101
97
|
const { translate } = this.context;
|
|
102
98
|
const prevLinkAvailable = this.props.currentPage !== 1;
|
|
103
99
|
const nextLinkAvailable = this.props.openTotal || this.props.currentPage !== this.getTotalPages();
|
|
104
|
-
const nextIcon =
|
|
105
|
-
const prevIcon =
|
|
100
|
+
const nextIcon = _jsx(Icon, { glyph: chevronRightIcon }, "icon");
|
|
101
|
+
const prevIcon = _jsx(Icon, { glyph: chevronLeftIcon }, "icon");
|
|
106
102
|
const prevText = this.props.translations?.previousPage ?? translate('previousPage');
|
|
107
103
|
const nextText = this.props.translations?.nextPage ?? translate('nextPage');
|
|
108
|
-
const nextLinkContent = [
|
|
109
|
-
const prevLinkContent = [prevIcon,
|
|
104
|
+
const nextLinkContent = [_jsx("span", { children: nextText }, "text"), nextIcon];
|
|
105
|
+
const prevLinkContent = [prevIcon, _jsx("span", { children: prevText }, "text")];
|
|
110
106
|
const prevLinkHref = this.generateHref(this.props.currentPage - 1);
|
|
111
107
|
const nextLinkHref = this.generateHref(this.props.currentPage + 1);
|
|
112
108
|
const disabledLinkClasses = classNames({
|
|
113
109
|
[style.link]: true,
|
|
114
110
|
[style.linkDisabled]: true,
|
|
115
111
|
});
|
|
116
|
-
return (
|
|
117
|
-
{prevLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? (<Link href={prevLinkHref} className={style.link} {...this.getClickProps(this.handlePrevClick)}>
|
|
118
|
-
{prevLinkContent}
|
|
119
|
-
</Link>) : (<span className={disabledLinkClasses}>
|
|
120
|
-
{prevIcon}
|
|
121
|
-
<span key="text">{prevText}</span>
|
|
122
|
-
</span>)}
|
|
123
|
-
|
|
124
|
-
{nextLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? (<Link href={nextLinkHref} className={style.link} {...this.getClickProps(this.handleNextClick)}>
|
|
125
|
-
{nextLinkContent}
|
|
126
|
-
</Link>) : (<span className={disabledLinkClasses}>
|
|
127
|
-
<span key="text">{nextText}</span>
|
|
128
|
-
{nextIcon}
|
|
129
|
-
</span>)}
|
|
130
|
-
</div>);
|
|
112
|
+
return (_jsxs("div", { className: style.links, children: [prevLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? (_jsx(Link, { href: prevLinkHref, className: style.link, ...this.getClickProps(this.handlePrevClick), children: prevLinkContent })) : (_jsxs("span", { className: disabledLinkClasses, children: [prevIcon, _jsx("span", { children: prevText }, "text")] })), nextLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? (_jsx(Link, { href: nextLinkHref, className: style.link, ...this.getClickProps(this.handleNextClick), children: nextLinkContent })) : (_jsxs("span", { className: disabledLinkClasses, children: [_jsx("span", { children: nextText }, "text"), nextIcon] }))] }));
|
|
131
113
|
}
|
|
132
114
|
generateHref(page) {
|
|
133
115
|
if (this.props.hrefFunc === undefined) {
|
|
@@ -170,37 +152,11 @@ export default class Pager extends PureComponent {
|
|
|
170
152
|
}
|
|
171
153
|
const lastPageButtonAvailable = (!this.props.disableLastPageButton && end < totalPages && !this.props.openTotal) ||
|
|
172
154
|
(this.props.openTotal && this.props.canLoadLastPageWithOpenTotal);
|
|
173
|
-
return (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<div className={style.actions}>
|
|
177
|
-
<ButtonToolbar>
|
|
178
|
-
{start > 1 && this.getButton(1, this.props.translations?.firstPage ?? translate('firstPage'))}
|
|
179
|
-
|
|
180
|
-
<ButtonGroup>
|
|
181
|
-
{start > 1 && this.getButton(start - 1, '...')}
|
|
182
|
-
|
|
183
|
-
{buttons}
|
|
184
|
-
|
|
185
|
-
{end < totalPages && this.getButton(end + 1, '...')}
|
|
186
|
-
|
|
187
|
-
{end === totalPages && this.props.openTotal && (<Button href={this.generateHref(end + 1)} disabled={this.props.loader} {...this.getClickProps(this.handleLoadMore(end + 1))}>
|
|
188
|
-
{'...'}
|
|
189
|
-
</Button>)}
|
|
190
|
-
</ButtonGroup>
|
|
191
|
-
|
|
192
|
-
{lastPageButtonAvailable &&
|
|
193
|
-
this.getButton(this.props.openTotal ? -1 : totalPages, this.props.translations?.lastPage ?? translate('lastPage'))}
|
|
194
|
-
</ButtonToolbar>
|
|
195
|
-
|
|
196
|
-
{this.getPageSizeSelector()}
|
|
197
|
-
</div>
|
|
198
|
-
</div>);
|
|
155
|
+
return (_jsxs("div", { children: [this.getPagerLinks(), _jsxs("div", { className: style.actions, children: [_jsxs(ButtonToolbar, { children: [start > 1 && this.getButton(1, this.props.translations?.firstPage ?? translate('firstPage')), _jsxs(ButtonGroup, { children: [start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && (_jsx(Button, { href: this.generateHref(end + 1), disabled: this.props.loader, ...this.getClickProps(this.handleLoadMore(end + 1)), children: '...' }))] }), lastPageButtonAvailable &&
|
|
156
|
+
this.getButton(this.props.openTotal ? -1 : totalPages, this.props.translations?.lastPage ?? translate('lastPage'))] }), this.getPageSizeSelector()] })] }));
|
|
199
157
|
}
|
|
200
158
|
render() {
|
|
201
159
|
const classes = classNames(style.pager, this.props.className);
|
|
202
|
-
return (
|
|
203
|
-
{this.getTotalPages() > 1 || this.props.openTotal ? this.getPagerContent() : this.getPageSizeSelector()}
|
|
204
|
-
</div>);
|
|
160
|
+
return (_jsx("div", { "data-test": "ring-pager", className: classes, children: this.getTotalPages() > 1 || this.props.openTotal ? this.getPagerContent() : this.getPageSizeSelector() }));
|
|
205
161
|
}
|
|
206
162
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './panel.css';
|
|
@@ -8,8 +9,6 @@ export default class Panel extends PureComponent {
|
|
|
8
9
|
render() {
|
|
9
10
|
const { className, children, ...props } = this.props;
|
|
10
11
|
const classes = classNames(styles.panel, className);
|
|
11
|
-
return (
|
|
12
|
-
{children}
|
|
13
|
-
</div>);
|
|
12
|
+
return (_jsx("div", { "data-test": "ring-panel", ...props, className: classes, children: children }));
|
|
14
13
|
}
|
|
15
14
|
}
|
|
@@ -138,12 +138,12 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
138
138
|
* @private
|
|
139
139
|
*/
|
|
140
140
|
private _onDocumentClick;
|
|
141
|
-
getInternalContent():
|
|
141
|
+
getInternalContent(): import("react/jsx-runtime").JSX.Element | P["children"] | undefined;
|
|
142
142
|
shortcutsScope: string;
|
|
143
143
|
shortcutsMap: {
|
|
144
144
|
esc: (evt: KeyboardEvent) => void;
|
|
145
145
|
};
|
|
146
|
-
render():
|
|
146
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
147
147
|
}
|
|
148
148
|
export type PopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
|
|
149
149
|
export type BasePopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* @name Popup
|
|
3
4
|
*/
|
|
4
5
|
import { PureComponent } from 'react';
|
|
5
|
-
import * as React from 'react';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import getUID from '../global/get-uid';
|
|
@@ -247,9 +247,7 @@ export default class Popup extends PureComponent {
|
|
|
247
247
|
};
|
|
248
248
|
getInternalContent() {
|
|
249
249
|
const { trapFocus, autoFocusFirst, children } = this.props;
|
|
250
|
-
return trapFocus ? (
|
|
251
|
-
{children}
|
|
252
|
-
</TabTrap>) : (children);
|
|
250
|
+
return trapFocus ? (_jsx(TabTrap, { autoFocusFirst: autoFocusFirst, focusBackOnExit: true, children: children })) : (children);
|
|
253
251
|
}
|
|
254
252
|
shortcutsScope = this.uid;
|
|
255
253
|
shortcutsMap = {
|
|
@@ -265,27 +263,17 @@ export default class Popup extends PureComponent {
|
|
|
265
263
|
[styles.largeBorderRadius]: largeBorderRadius,
|
|
266
264
|
});
|
|
267
265
|
const direction = (this.state.direction || '').toLowerCase().replace(/[_]/g, '-');
|
|
268
|
-
return (
|
|
269
|
-
{value => {
|
|
266
|
+
return (_jsx(PopupTargetContext.Consumer, { children: value => {
|
|
270
267
|
this.ringPopupTarget = value;
|
|
271
|
-
return (
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
<div data-test={dataTests('ring-popup', dataTest)} data-test-shown={!hidden && !showing} data-test-direction={direction} ref={this.popupRef} className={classes} style={style} onMouseDown={onMouseDown} onMouseUp={onMouseUp}
|
|
282
|
-
// mouse handlers are used to track clicking on inner elements
|
|
283
|
-
role="presentation">
|
|
284
|
-
{this.getInternalContent()}
|
|
285
|
-
</div>
|
|
286
|
-
</PopupTarget>, this.getContainer() || document.body)}
|
|
287
|
-
</span>);
|
|
288
|
-
}}
|
|
289
|
-
</PopupTargetContext.Consumer>);
|
|
268
|
+
return (_jsxs("span", {
|
|
269
|
+
// prevent bubbling through portal
|
|
270
|
+
onClick: stop,
|
|
271
|
+
// This handler only blocks bubbling through React portal
|
|
272
|
+
role: "presentation", ref: this.portalRef, children: [this.shouldUseShortcuts() && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), (client || this.state.client) &&
|
|
273
|
+
(keepMounted || !hidden) &&
|
|
274
|
+
createPortal(_jsx(PopupTarget, { id: this.uid, ref: this.containerRef, onMouseOver: onMouseOver, onFocus: onMouseOver, onMouseOut: onMouseOut, onBlur: onMouseOut, onContextMenu: onContextMenu, children: _jsx("div", { "data-test": dataTests('ring-popup', dataTest), "data-test-shown": !hidden && !showing, "data-test-direction": direction, ref: this.popupRef, className: classes, style: style, onMouseDown: onMouseDown, onMouseUp: onMouseUp,
|
|
275
|
+
// mouse handlers are used to track clicking on inner elements
|
|
276
|
+
role: "presentation", children: this.getInternalContent() }) }), this.getContainer() || document.body)] }));
|
|
277
|
+
} }));
|
|
290
278
|
}
|
|
291
279
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { createContext, forwardRef } from 'react';
|
|
2
3
|
export const PopupTargetContext = createContext(undefined);
|
|
3
4
|
export const PopupTarget = forwardRef(function PopupTarget({ id, children, ...restProps }, ref) {
|
|
4
|
-
const target = (
|
|
5
|
-
|
|
6
|
-
</div>);
|
|
7
|
-
return (<PopupTargetContext.Provider value={id}>
|
|
8
|
-
{typeof children === 'function' ? children(target) : target}
|
|
9
|
-
</PopupTargetContext.Provider>);
|
|
5
|
+
const target = (_jsx("div", { ...restProps, "data-portaltarget": id, ref: ref, children: typeof children !== 'function' && children }));
|
|
6
|
+
return (_jsx(PopupTargetContext.Provider, { value: id, children: typeof children === 'function' ? children(target) : target }));
|
|
10
7
|
});
|
|
@@ -62,7 +62,7 @@ export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
|
|
|
62
62
|
list?: List<T> | null;
|
|
63
63
|
listRef: (el: List<T> | null) => void;
|
|
64
64
|
/** @override */
|
|
65
|
-
getInternalContent(): import("react").JSX.Element;
|
|
65
|
+
getInternalContent(): import("react/jsx-runtime").JSX.Element;
|
|
66
66
|
}
|
|
67
67
|
export type PopupMenuAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof PopupMenu, PopupMenuProps<T>>;
|
|
68
68
|
export declare const ListProps: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import Popup from '../popup/popup';
|
|
2
3
|
import List from '../list/list';
|
|
3
4
|
/**
|
|
@@ -26,9 +27,7 @@ export default class PopupMenu extends Popup {
|
|
|
26
27
|
/** @override */
|
|
27
28
|
getInternalContent() {
|
|
28
29
|
const { className, ...props } = this.props;
|
|
29
|
-
return (
|
|
30
|
-
<List ref={this.listRef} {...props} maxHeight={this.popup && parseFloat(this.popup.style.maxHeight)} shortcuts={this.shouldUseShortcuts()} onSelect={this.onSelect}/>
|
|
31
|
-
</div>);
|
|
30
|
+
return (_jsx("div", { children: _jsx(List, { ref: this.listRef, ...props, maxHeight: this.popup && parseFloat(this.popup.style.maxHeight), shortcuts: this.shouldUseShortcuts(), onSelect: this.onSelect }) }));
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
export const { ListProps } = List;
|
|
@@ -45,6 +45,6 @@ export default class ProgressBar extends PureComponent<ProgressBarProps> {
|
|
|
45
45
|
progressbarWrapperRef: (el: HTMLElement | null) => void;
|
|
46
46
|
progressbar?: HTMLElement | null;
|
|
47
47
|
progressbarRef: (el: HTMLElement | null) => void;
|
|
48
|
-
render(): import("react").JSX.Element;
|
|
48
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
}
|
|
50
50
|
export type ProgressBarAttrs = JSX.LibraryManagedAttributes<typeof ProgressBar, ProgressBarProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './progress-bar.css';
|
|
@@ -36,8 +37,6 @@ export default class ProgressBar extends PureComponent {
|
|
|
36
37
|
[styles.globalMode]: global,
|
|
37
38
|
[styles.staticLineColor]: staticColor,
|
|
38
39
|
});
|
|
39
|
-
return (
|
|
40
|
-
<div className={styles.line} ref={this.progressbarRef} role="progressbar" aria-label={label} aria-valuenow={value} aria-valuemin={0} aria-valuemax={max} style={{ width }}/>
|
|
41
|
-
</div>);
|
|
40
|
+
return (_jsx("div", { ...otherProps, className: classes, ref: this.progressbarWrapperRef, children: _jsx("div", { className: styles.line, ref: this.progressbarRef, role: "progressbar", "aria-label": label, "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, style: { width } }) }));
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -251,7 +251,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
251
251
|
setupRequestHandler(delay?: number | null): void;
|
|
252
252
|
private _renderSuggestion;
|
|
253
253
|
renderSuggestions(): import("../list/consts").ListDataItem<SuggestionItem>[];
|
|
254
|
-
renderQuery(): "" |
|
|
254
|
+
renderQuery(): "" | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
255
255
|
setFocus(focus: boolean | null | undefined): void;
|
|
256
256
|
input?: HTMLElement | null;
|
|
257
257
|
caret?: Caret;
|
|
@@ -270,7 +270,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
270
270
|
shortcutsMap: ShortcutsMap;
|
|
271
271
|
listShortcutsMap: ShortcutsMap;
|
|
272
272
|
renderActions(): ReactNode[];
|
|
273
|
-
render():
|
|
273
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
274
274
|
}
|
|
275
275
|
export type QueryAssistAttrs = JSX.LibraryManagedAttributes<typeof QueryAssist, QueryAssistProps>;
|
|
276
276
|
export declare const RerenderableQueryAssist: React.ForwardRefExoticComponent<QueryAssistProps & React.RefAttributes<QueryAssist>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Component } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import debounce from 'just-debounce-it';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { dequal } from 'dequal';
|
|
@@ -603,11 +603,7 @@ export default class QueryAssist extends Component {
|
|
|
603
603
|
const className = classNames(styles.letter, classes[index] || LETTER_DEFAULT_CLASS);
|
|
604
604
|
const dataTest = letters.length - 1 === index ? 'ring-query-assist-last-letter' : null;
|
|
605
605
|
// \u00a0 ===
|
|
606
|
-
return (
|
|
607
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
608
|
-
key={index + letter} className={className} data-test={dataTest}>
|
|
609
|
-
{letter === ' ' ? '\u00a0' : letter}
|
|
610
|
-
</span>);
|
|
606
|
+
return (_jsx("span", { className: className, "data-test": dataTest, children: letter === ' ' ? '\u00a0' : letter }, index + letter));
|
|
611
607
|
}));
|
|
612
608
|
}
|
|
613
609
|
setFocus(focus) {
|
|
@@ -674,9 +670,7 @@ export default class QueryAssist extends Component {
|
|
|
674
670
|
const actions = [...(this.props.actions || [])];
|
|
675
671
|
const renderClear = this.props.clear && !!this.state.query;
|
|
676
672
|
if (renderClear) {
|
|
677
|
-
actions.push(
|
|
678
|
-
{({ translate }) => (<Button icon={closeIcon} className={styles.clear} title={this.props.translations?.clearTitle ?? translate('clearTitle')} ref={this.clearRef} onClick={this.clearQuery} data-test="query-assist-clear-icon"/>)}
|
|
679
|
-
</I18nContext.Consumer>);
|
|
673
|
+
actions.push(_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(Button, { icon: closeIcon, className: styles.clear, title: this.props.translations?.clearTitle ?? translate('clearTitle'), ref: this.clearRef, onClick: this.clearQuery, "data-test": "query-assist-clear-icon" })) }, 'clearAction'));
|
|
680
674
|
}
|
|
681
675
|
return actions;
|
|
682
676
|
}
|
|
@@ -703,42 +697,10 @@ export default class QueryAssist extends Component {
|
|
|
703
697
|
[styles.hugePlaceholder]: huge,
|
|
704
698
|
[styles.withoutGlass]: !glass || (!renderLoader && huge),
|
|
705
699
|
});
|
|
706
|
-
return (
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
{renderGlass && !huge && (<Icon glyph={searchIcon} className={styles.icon} title={translations?.searchTitle ?? translate('searchTitle')} ref={this.glassRef} data-test="query-assist-search-icon"/>)}
|
|
712
|
-
|
|
713
|
-
{renderLoader && (<div className={classNames(styles.icon, styles.loader, {
|
|
714
|
-
[styles.loaderOnTheRight]: !glass && !huge,
|
|
715
|
-
[styles.loaderActive]: renderLoader,
|
|
716
|
-
})} ref={this.loaderRef}>
|
|
717
|
-
<LoaderInline />
|
|
718
|
-
</div>)}
|
|
719
|
-
|
|
720
|
-
<ContentEditable aria-label={translations?.searchTitle ?? translate('searchTitle')} className={inputClasses} data-test="ring-query-assist-input" inputRef={this.inputRef} disabled={this.props.disabled} onComponentUpdate={() => this.setCaretPosition({ fromContentEditable: true })} onBlur={this.handleFocusChange} onClick={this.handleCaretMove} onCompositionStart={this.trackCompositionState} onCompositionEnd={this.trackCompositionState} onFocus={this.handleFocusChange} onInput={this.handleInput} // To support IE use the same method
|
|
721
|
-
onKeyUp={this.handleInput} // to handle input and key up
|
|
722
|
-
onKeyDown={this.handleEnter} onPaste={this.handlePaste} spellCheck="false">
|
|
723
|
-
{this.state.query && <span>{this.renderQuery()}</span>}
|
|
724
|
-
</ContentEditable>
|
|
725
|
-
|
|
726
|
-
{renderPlaceholder && (<button type="button" className={placeholderStyles} ref={this.placeholderRef} onClick={this.handleCaretMove} data-test="query-assist-placeholder" disabled={this.props.disabled} tabIndex={-1}>
|
|
727
|
-
{this.props.placeholder}
|
|
728
|
-
</button>)}
|
|
729
|
-
|
|
730
|
-
{actions.length ? (<div data-test="ring-query-assist-actions" className={styles.actions}>
|
|
731
|
-
{actions}
|
|
732
|
-
</div>) : null}
|
|
733
|
-
|
|
734
|
-
<PopupMenu hidden={!this.state.showPopup} onCloseAttempt={this.closePopup} ref={this.popupRef} anchorElement={this.node} keepMounted attached className={this.props.popupClassName} directions={[PopupMenu.PopupProps.Directions.BOTTOM_RIGHT]} data={useCustomItemRender ? this.state.suggestions : this.renderSuggestions()} data-test="ring-query-assist-popup" hint={this.props.hint} shortcutsMap={this.listShortcutsMap} hintOnSelection={this.props.hintOnSelection} left={this.getPopupOffset(this.state.suggestions)} maxHeight={PopupMenu.PopupProps.MaxHeight.SCREEN} onMouseDown={this.trackPopupMouseState} onMouseUp={this.trackPopupMouseState} onSelect={item => this.handleComplete(item)}/>
|
|
735
|
-
|
|
736
|
-
{glass && huge && (<div className={styles.rightSearchButton} data-test="query-assist-search-button">
|
|
737
|
-
<Icon glyph={searchIcon} className={styles.rightSearchIcon} title={translations?.searchTitle ?? translate('searchTitle')} onClick={this.handleApply} ref={this.glassRef} data-test="query-assist-search-icon"/>
|
|
738
|
-
</div>)}
|
|
739
|
-
</div>)}
|
|
740
|
-
</I18nContext.Consumer>
|
|
741
|
-
</ControlsHeightContext.Provider>);
|
|
700
|
+
return (_jsx(ControlsHeightContext.Provider, { value: ControlsHeight.M, children: _jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { "data-test": dataTests('ring-query-assist', dataTest), className: containerClasses, role: "presentation", ref: this.nodeRef, children: [this.state.shortcuts && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), renderGlass && !huge && (_jsx(Icon, { glyph: searchIcon, className: styles.icon, title: translations?.searchTitle ?? translate('searchTitle'), ref: this.glassRef, "data-test": "query-assist-search-icon" })), renderLoader && (_jsx("div", { className: classNames(styles.icon, styles.loader, {
|
|
701
|
+
[styles.loaderOnTheRight]: !glass && !huge,
|
|
702
|
+
[styles.loaderActive]: renderLoader,
|
|
703
|
+
}), ref: this.loaderRef, children: _jsx(LoaderInline, {}) })), _jsx(ContentEditable, { "aria-label": translations?.searchTitle ?? translate('searchTitle'), className: inputClasses, "data-test": "ring-query-assist-input", inputRef: this.inputRef, disabled: this.props.disabled, onComponentUpdate: () => this.setCaretPosition({ fromContentEditable: true }), onBlur: this.handleFocusChange, onClick: this.handleCaretMove, onCompositionStart: this.trackCompositionState, onCompositionEnd: this.trackCompositionState, onFocus: this.handleFocusChange, onInput: this.handleInput, onKeyUp: this.handleInput, onKeyDown: this.handleEnter, onPaste: this.handlePaste, spellCheck: "false", children: this.state.query && _jsx("span", { children: this.renderQuery() }) }), renderPlaceholder && (_jsx("button", { type: "button", className: placeholderStyles, ref: this.placeholderRef, onClick: this.handleCaretMove, "data-test": "query-assist-placeholder", disabled: this.props.disabled, tabIndex: -1, children: this.props.placeholder })), actions.length ? (_jsx("div", { "data-test": "ring-query-assist-actions", className: styles.actions, children: actions })) : null, _jsx(PopupMenu, { hidden: !this.state.showPopup, onCloseAttempt: this.closePopup, ref: this.popupRef, anchorElement: this.node, keepMounted: true, attached: true, className: this.props.popupClassName, directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT], data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(), "data-test": "ring-query-assist-popup", hint: this.props.hint, shortcutsMap: this.listShortcutsMap, hintOnSelection: this.props.hintOnSelection, left: this.getPopupOffset(this.state.suggestions), maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN, onMouseDown: this.trackPopupMouseState, onMouseUp: this.trackPopupMouseState, onSelect: item => this.handleComplete(item) }), glass && huge && (_jsx("div", { className: styles.rightSearchButton, "data-test": "query-assist-search-button", children: _jsx(Icon, { glyph: searchIcon, className: styles.rightSearchIcon, title: translations?.searchTitle ?? translate('searchTitle'), onClick: this.handleApply, ref: this.glassRef, "data-test": "query-assist-search-icon" }) }))] })) }) }));
|
|
742
704
|
}
|
|
743
705
|
}
|
|
744
706
|
export const RerenderableQueryAssist = rerenderHOC(QueryAssist);
|
|
@@ -18,7 +18,7 @@ export interface SuggestionItem {
|
|
|
18
18
|
}
|
|
19
19
|
export default class QueryAssistSuggestions {
|
|
20
20
|
static createKey(suggestion: QueryAssistSuggestion): string;
|
|
21
|
-
static renderLabel(suggestion: QueryAssistSuggestion): import("react").JSX.Element;
|
|
21
|
+
static renderLabel(suggestion: QueryAssistSuggestion): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
static renderGroupSeparator(suggestion: QueryAssistSuggestion, prevSuggestion: string): {
|
|
23
23
|
key: string;
|
|
24
24
|
description: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import List from '../list/list';
|
|
2
3
|
import styles from './query-assist.css';
|
|
3
4
|
const ICON_ID_LENGTH = 44;
|
|
@@ -17,21 +18,15 @@ export default class QueryAssistSuggestions {
|
|
|
17
18
|
let after = '';
|
|
18
19
|
if (matchingStart !== matchingEnd) {
|
|
19
20
|
before = option.substring(0, matchingStart);
|
|
20
|
-
wrappedOption =
|
|
21
|
+
wrappedOption = _jsx("span", { className: styles.highlight, children: option.substring(matchingStart, matchingEnd) });
|
|
21
22
|
after = option.substring(matchingEnd);
|
|
22
23
|
}
|
|
23
24
|
else {
|
|
24
25
|
wrappedOption = option;
|
|
25
26
|
}
|
|
26
|
-
const wrappedPrefix = prefix &&
|
|
27
|
-
const wrappedSuffix = suffix &&
|
|
28
|
-
return (
|
|
29
|
-
{wrappedPrefix}
|
|
30
|
-
{before}
|
|
31
|
-
{wrappedOption}
|
|
32
|
-
{after}
|
|
33
|
-
{wrappedSuffix}
|
|
34
|
-
</span>);
|
|
27
|
+
const wrappedPrefix = prefix && _jsx("span", { className: styles.service, children: prefix });
|
|
28
|
+
const wrappedSuffix = suffix && _jsx("span", { className: styles.service, children: suffix });
|
|
29
|
+
return (_jsxs("span", { className: className, children: [wrappedPrefix, before, wrappedOption, after, wrappedSuffix] }));
|
|
35
30
|
}
|
|
36
31
|
static renderGroupSeparator(suggestion, prevSuggestion) {
|
|
37
32
|
const { group, option } = suggestion;
|
|
@@ -106,11 +106,12 @@
|
|
|
106
106
|
|
|
107
107
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
108
108
|
&[disabled]:checked + .circle {
|
|
109
|
-
border-color: var(--ring-border-
|
|
109
|
+
border-color: var(--ring-border-disabled-active-color);
|
|
110
|
+
background-color: var(--ring-content-background-color);
|
|
110
111
|
|
|
111
112
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
112
113
|
&::after {
|
|
113
|
-
background-color: var(--ring-border-
|
|
114
|
+
background-color: var(--ring-border-disabled-active-color);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
|
|
@@ -6,5 +6,5 @@ import { RadioProps } from './radio__item';
|
|
|
6
6
|
export default class Radio extends Component<RadioProps> {
|
|
7
7
|
static Item: import("react").ForwardRefExoticComponent<import("./radio__item").RadioItemProps & import("react").RefAttributes<import("./radio__item").RadioItemInner>>;
|
|
8
8
|
uid: string;
|
|
9
|
-
render(): import("react").JSX.Element;
|
|
9
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import getUID from '../global/get-uid';
|
|
3
4
|
import RadioItem, { RadioContext } from './radio__item';
|
|
@@ -8,6 +9,6 @@ export default class Radio extends Component {
|
|
|
8
9
|
static Item = RadioItem;
|
|
9
10
|
uid = getUID('ring-radio-');
|
|
10
11
|
render() {
|
|
11
|
-
return
|
|
12
|
+
return _jsx(RadioContext.Provider, { value: { name: this.uid, ...this.props }, children: this.props.children });
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -13,7 +13,7 @@ export declare class RadioItemInner extends Component<RadioItemInnerProps> {
|
|
|
13
13
|
inputRef: (el: HTMLElement | null) => void;
|
|
14
14
|
label?: HTMLElement | null;
|
|
15
15
|
labelRef: (el: HTMLElement | null) => void;
|
|
16
|
-
render(): import("react").JSX.Element;
|
|
16
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
}
|
|
18
18
|
export interface RadioItemProps extends RadioItemInnerProps {
|
|
19
19
|
value: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Component, createContext, forwardRef } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import getUID from '../global/get-uid';
|
|
@@ -17,19 +18,10 @@ export class RadioItemInner extends Component {
|
|
|
17
18
|
render() {
|
|
18
19
|
const { className, children, help, ...restProps } = this.props;
|
|
19
20
|
const classes = classNames(styles.radio, className);
|
|
20
|
-
return (
|
|
21
|
-
<input id={this.uid} {...restProps} ref={this.inputRef} className={styles.input} type="radio"/>
|
|
22
|
-
<span className={styles.circle}/>
|
|
23
|
-
<span className={styles.label}>
|
|
24
|
-
{children}
|
|
25
|
-
{help && <ControlHelp>{help}</ControlHelp>}
|
|
26
|
-
</span>
|
|
27
|
-
</label>);
|
|
21
|
+
return (_jsxs("label", { ref: this.labelRef, className: classes, htmlFor: this.uid, children: [_jsx("input", { id: this.uid, ...restProps, ref: this.inputRef, className: styles.input, type: "radio" }), _jsx("span", { className: styles.circle }), _jsxs("span", { className: styles.label, children: [children, help && _jsx(ControlHelp, { children: help })] })] }));
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
24
|
const RadioItem = forwardRef(function RadioItem(props, ref) {
|
|
31
|
-
return (
|
|
32
|
-
{({ value, onChange, ...restContext }) => (<RadioItemInner ref={ref} {...restContext} checked={value != null ? value === props.value : undefined} onChange={onChange != null ? () => onChange(props.value) : undefined} {...props}/>)}
|
|
33
|
-
</RadioContext.Consumer>);
|
|
25
|
+
return (_jsx(RadioContext.Consumer, { children: ({ value, onChange, ...restContext }) => (_jsx(RadioItemInner, { ref: ref, ...restContext, checked: value != null ? value === props.value : undefined, onChange: onChange != null ? () => onChange(props.value) : undefined, ...props })) }));
|
|
34
26
|
});
|
|
35
27
|
export default RadioItem;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
export default function ScrollableSection({ className, ...restProps }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
2
|
+
export default function ScrollableSection({ className, ...restProps }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './scrollable-section.css';
|
|
@@ -21,10 +22,10 @@ export default function ScrollableSection({ className, ...restProps }) {
|
|
|
21
22
|
window.addEventListener('resize', calculateScrollPosition);
|
|
22
23
|
return () => window.removeEventListener('resize', calculateScrollPosition);
|
|
23
24
|
}, [calculateScrollPosition]);
|
|
24
|
-
return (
|
|
25
|
+
return (_jsx("div", { ...restProps, className: classNames(styles.scrollableSection, className, {
|
|
25
26
|
[styles.withTopBorder]: !scrolledToTop,
|
|
26
27
|
[styles.withRightBorder]: !scrolledToRight,
|
|
27
28
|
[styles.withBottomBorder]: !scrolledToBottom,
|
|
28
29
|
[styles.withLeftBorder]: !scrolledToLeft,
|
|
29
|
-
})
|
|
30
|
+
}), ref: ref, onScroll: calculateScrollPosition }));
|
|
30
31
|
}
|
|
@@ -234,7 +234,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
234
234
|
_showPopup: () => void;
|
|
235
235
|
_hidePopup: (tryFocusAnchor?: boolean) => void;
|
|
236
236
|
addHandler: () => void;
|
|
237
|
-
getToolbar():
|
|
237
|
+
getToolbar(): import("react/jsx-runtime").JSX.Element | null;
|
|
238
238
|
getTopbar(): ReactNode;
|
|
239
239
|
getLowerCaseLabel: typeof getLowerCaseLabel;
|
|
240
240
|
doesLabelMatch: typeof doesLabelMatch;
|
|
@@ -274,8 +274,8 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
274
274
|
'shift+down': typeof noop;
|
|
275
275
|
space: typeof noop;
|
|
276
276
|
};
|
|
277
|
-
renderSelect(activeItemId: string | undefined):
|
|
278
|
-
render():
|
|
277
|
+
renderSelect(activeItemId: string | undefined): import("react/jsx-runtime").JSX.Element;
|
|
278
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
279
279
|
}
|
|
280
280
|
export type SingleSelectAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof Select, SingleSelectProps<T>>;
|
|
281
281
|
export type MultipleSelectAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof Select, MultipleSelectProps<T>>;
|