@jetbrains/ring-ui 7.0.72 → 7.0.73
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/babel.config.js +14 -8
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/{alert.js → alert.jsx} +14 -8
- package/components/alert/{container.js → container.jsx} +4 -3
- package/components/alert-service/alert-service.d.ts +1 -1
- package/components/alert-service/{alert-service.js → alert-service.jsx} +8 -5
- package/components/auth/auth-core.js +6 -7
- package/components/auth/{down-notification.js → down-notification.jsx} +12 -4
- package/components/auth/{iframe-flow.js → iframe-flow.jsx} +6 -5
- package/components/auth/storage.js +1 -1
- package/components/auth/token-validator.js +1 -1
- package/components/auth/window-flow.js +2 -2
- package/components/auth-dialog/auth-dialog.d.ts +1 -1
- package/components/auth-dialog/{auth-dialog.js → auth-dialog.jsx} +18 -2
- package/components/auth-dialog-service/{auth-dialog-service.js → auth-dialog-service.jsx} +3 -2
- package/components/avatar/avatar-info.d.ts +1 -1
- package/components/avatar/{avatar-info.js → avatar-info.jsx} +4 -3
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/{avatar.js → avatar.jsx} +11 -6
- package/components/avatar/fallback-avatar.d.ts +1 -1
- package/components/avatar/{fallback-avatar.js → fallback-avatar.jsx} +16 -2
- package/components/avatar-stack/avatar-stack.d.ts +1 -1
- package/components/avatar-stack/avatar-stack.jsx +24 -0
- package/components/banner/banner.d.ts +1 -1
- package/components/banner/{banner.js → banner.jsx} +15 -3
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/{breadcrumbs.js → breadcrumbs.jsx} +4 -2
- package/components/button/button.d.ts +1 -1
- package/components/button/{button.js → button.jsx} +13 -5
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/{button-group.js → button-group.jsx} +5 -2
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-group/{caption.js → caption.jsx} +1 -2
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-set/{button-set.js → button-set.jsx} +3 -2
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/{button-toolbar.js → button-toolbar.jsx} +1 -2
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/{checkbox.js → checkbox.jsx} +13 -2
- package/components/code/code.d.ts +1 -1
- package/components/code/{code.js → code.jsx} +8 -5
- package/components/collapse/collapse-content.jsx +65 -0
- package/components/collapse/{collapse-control.js → collapse-control.jsx} +6 -3
- package/components/collapse/{collapse.js → collapse.jsx} +12 -8
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/{confirm.js → confirm.jsx} +13 -2
- package/components/confirm-service/{confirm-service.js → confirm-service.jsx} +3 -2
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/{content-layout.js → content-layout.jsx} +6 -2
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/content-layout/{sidebar.js → sidebar.jsx} +11 -2
- package/components/contenteditable/contenteditable.d.ts +2 -2
- package/components/contenteditable/{contenteditable.js → contenteditable.jsx} +5 -6
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-help/{control-help.js → control-help.jsx} +1 -2
- package/components/control-label/{control-label.js → control-label.jsx} +5 -3
- package/components/data-list/data-list.d.ts +1 -1
- package/components/data-list/{data-list.js → data-list.jsx} +17 -8
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.jsx +215 -0
- package/components/data-list/item.d.ts +2 -2
- package/components/data-list/{item.js → item.jsx} +23 -7
- package/components/data-list/title.d.ts +1 -1
- package/components/data-list/{title.js → title.jsx} +11 -2
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/{date-input.js → date-input.jsx} +1 -2
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/{date-picker.js → date-picker.jsx} +24 -12
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/{date-popup.js → date-popup.jsx} +20 -9
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/{day.js → day.jsx} +4 -3
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/{month-names.js → month-names.jsx} +12 -7
- package/components/date-picker/month-slider.d.ts +1 -1
- package/components/date-picker/{month-slider.js → month-slider.jsx} +4 -3
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/{month.js → month.jsx} +4 -3
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/{months.js → months.jsx} +9 -6
- package/components/date-picker/weekdays.d.ts +1 -1
- package/components/date-picker/{weekdays.js → weekdays.jsx} +6 -3
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/{years.js → years.jsx} +9 -6
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/{dialog.js → dialog.jsx} +39 -16
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/anchor.jsx +8 -0
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/{dropdown.js → dropdown.jsx} +10 -7
- package/components/dropdown-menu/{dropdown-menu.js → dropdown-menu.jsx} +10 -5
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/{editable-heading.js → editable-heading.jsx} +31 -3
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.jsx +23 -0
- package/components/error-message/error-message.d.ts +1 -1
- package/components/error-message/error-message.jsx +25 -0
- package/components/footer/{footer.js → footer.jsx} +14 -7
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/{create-stateful-context.js → create-stateful-context.jsx} +3 -2
- package/components/global/{focus-sensor-hoc.js → focus-sensor-hoc.jsx} +1 -2
- package/components/global/get-uid.js +1 -1
- package/components/global/react-dom-renderer.d.ts +1 -1
- package/components/global/{react-dom-renderer.js → react-dom-renderer.jsx} +1 -2
- package/components/global/{rerender-hoc.js → rerender-hoc.jsx} +2 -3
- package/components/global/{theme.js → theme.jsx} +12 -4
- package/components/grid/col.d.ts +1 -1
- package/components/grid/{col.js → col.jsx} +3 -2
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/{grid.js → grid.jsx} +3 -2
- package/components/grid/row.d.ts +1 -1
- package/components/grid/{row.js → row.jsx} +3 -2
- package/components/group/group.d.ts +1 -1
- package/components/group/{group.js → group.jsx} +3 -2
- package/components/header/header-icon.d.ts +1 -1
- package/components/header/{header-icon.js → header-icon.jsx} +1 -2
- package/components/header/header.d.ts +1 -1
- package/components/header/{header.js → header.jsx} +4 -3
- package/components/header/links.d.ts +1 -1
- package/components/header/{links.js → links.jsx} +1 -2
- package/components/header/logo.d.ts +1 -1
- package/components/header/{logo.js → logo.jsx} +3 -2
- package/components/header/{profile.js → profile.jsx} +19 -6
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.jsx +16 -0
- package/components/header/services.d.ts +1 -1
- package/components/header/{services.js → services.jsx} +16 -11
- package/components/header/smart-profile.d.ts +1 -1
- package/components/header/{smart-profile.js → smart-profile.jsx} +1 -2
- package/components/header/smart-services.d.ts +1 -1
- package/components/header/{smart-services.js → smart-services.jsx} +1 -2
- package/components/header/tray.d.ts +1 -1
- package/components/header/{tray.js → tray.jsx} +4 -3
- package/components/heading/{heading.js → heading.jsx} +16 -9
- package/components/i18n/{i18n-context.js → i18n-context.jsx} +1 -2
- package/components/icon/icon-svg.d.ts +1 -1
- package/components/icon/{icon-svg.js → icon-svg.jsx} +2 -3
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/{icon.js → icon.jsx} +4 -3
- package/components/input/input.d.ts +1 -1
- package/components/input/{input.js → input.jsx} +16 -2
- package/components/island/{adaptive-island-hoc.js → adaptive-island-hoc.jsx} +5 -2
- package/components/island/content.d.ts +1 -1
- package/components/island/{content.js → content.jsx} +13 -6
- package/components/island/header.d.ts +1 -1
- package/components/island/{header.js → header.jsx} +13 -6
- package/components/island/island.d.ts +1 -1
- package/components/island/{island.js → island.jsx} +3 -2
- package/components/link/clickable-link.d.ts +1 -1
- package/components/link/{clickable-link.js → clickable-link.jsx} +4 -2
- package/components/link/{link.js → link.jsx} +6 -3
- package/components/list/list-custom.d.ts +1 -1
- package/components/list/{list-custom.js → list-custom.jsx} +4 -2
- package/components/list/list-hint.d.ts +1 -1
- package/components/list/{list-hint.js → list-hint.jsx} +3 -2
- package/components/list/list-item.d.ts +1 -1
- package/components/list/{list-item.js → list-item.jsx} +33 -5
- package/components/list/list-separator.d.ts +1 -1
- package/components/list/{list-separator.js → list-separator.jsx} +3 -2
- package/components/list/list-title.d.ts +1 -1
- package/components/list/list-title.jsx +19 -0
- package/components/list/list-users-groups-source.js +1 -1
- package/components/list/list.classes.js +1 -1
- package/components/list/list.d.ts +6 -6
- package/components/list/{list.js → list.jsx} +45 -23
- package/components/loader/loader.d.ts +1 -1
- package/components/loader/{loader.js → loader.jsx} +12 -6
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-inline/{loader-inline.js → loader-inline.jsx} +5 -3
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/loader-screen/{loader-screen.js → loader-screen.jsx} +3 -2
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/{login-dialog.js → login-dialog.jsx} +9 -2
- package/components/login-dialog/{service.js → service.jsx} +3 -2
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/{markdown.js → markdown.jsx} +3 -2
- package/components/message/message.d.ts +1 -1
- package/components/message/{message.js → message.jsx} +21 -2
- package/components/pager/pager.d.ts +5 -5
- package/components/pager/{pager.js → pager.jsx} +56 -12
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/{panel.js → panel.jsx} +3 -2
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/{popup.js → popup.jsx} +26 -14
- package/components/popup/popup.target.jsx +10 -0
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/popup-menu/{popup-menu.js → popup-menu.jsx} +3 -2
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/{progress-bar.js → progress-bar.jsx} +3 -2
- package/components/query-assist/query-assist-suggestions.d.ts +1 -1
- package/components/query-assist/{query-assist-suggestions.js → query-assist-suggestions.jsx} +10 -5
- package/components/query-assist/query-assist.d.ts +2 -2
- package/components/query-assist/{query-assist.js → query-assist.jsx} +46 -8
- package/components/radio/radio-item.d.ts +1 -1
- package/components/radio/{radio-item.js → radio-item.jsx} +11 -3
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/{radio.js → radio.jsx} +1 -2
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/{scrollable-section.js → scrollable-section.jsx} +2 -3
- package/components/select/select-filter.d.ts +1 -1
- package/components/select/{select-filter.js → select-filter.jsx} +5 -2
- package/components/select/select-popup.d.ts +7 -7
- package/components/select/{select-popup.js → select-popup.jsx} +43 -13
- package/components/select/select.d.ts +3 -3
- package/components/select/{select.js → select.jsx} +92 -44
- package/components/shortcuts/{shortcuts-hoc.js → shortcuts-hoc.jsx} +3 -2
- package/components/slider/{slider.js → slider.jsx} +50 -32
- package/components/tab-trap/{tab-trap.js → tab-trap.jsx} +39 -33
- package/components/table/cell.d.ts +1 -1
- package/components/table/{cell.js → cell.jsx} +3 -2
- package/components/table/{disable-hover-hoc.js → disable-hover-hoc.jsx} +2 -3
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/{header-cell.js → header-cell.jsx} +12 -2
- package/components/table/header.d.ts +2 -2
- package/components/table/{header.js → header.jsx} +19 -6
- package/components/table/multitable.d.ts +1 -1
- package/components/table/{multitable.js → multitable.jsx} +4 -3
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/{row-with-focus-sensor.js → row-with-focus-sensor.jsx} +1 -2
- package/components/table/row.d.ts +1 -1
- package/components/table/{row.js → row.jsx} +24 -5
- package/components/table/{selection-shortcuts-hoc.js → selection-shortcuts-hoc.jsx} +1 -2
- package/components/table/simple-table.d.ts +1 -1
- package/components/table/{simple-table.js → simple-table.jsx} +2 -3
- package/components/table/smart-table.d.ts +1 -1
- package/components/table/{smart-table.js → smart-table.jsx} +1 -2
- package/components/table/table.d.ts +2 -2
- package/components/table/{table.js → table.jsx} +30 -9
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/{collapsible-more.js → collapsible-more.jsx} +14 -7
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/{collapsible-tab.js → collapsible-tab.jsx} +3 -4
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/{collapsible-tabs.js → collapsible-tabs.jsx} +11 -3
- package/components/tabs/dumb-tabs.d.ts +2 -2
- package/components/tabs/{dumb-tabs.js → dumb-tabs.jsx} +10 -4
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/{smart-tabs.js → smart-tabs.jsx} +3 -2
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab-link.jsx +16 -0
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/{tab.js → tab.jsx} +3 -2
- package/components/tag/tag.d.ts +5 -5
- package/components/tag/{tag.js → tag.jsx} +24 -16
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/{tags-input.js → tags-input.jsx} +13 -5
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/{tags-list.js → tags-list.jsx} +8 -4
- package/components/text/text.d.ts +1 -1
- package/components/text/{text.js → text.jsx} +3 -2
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.jsx +37 -0
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/{tooltip.js → tooltip.jsx} +12 -3
- package/components/upload/{upload.js → upload.jsx} +7 -4
- package/components/user-agreement/{service.js → service.jsx} +13 -4
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.jsx +61 -0
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.jsx +64 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/{smart-user-card-tooltip.js → smart-user-card-tooltip.jsx} +6 -3
- package/components/user-card/tooltip.d.ts +2 -2
- package/components/user-card/{tooltip.js → tooltip.jsx} +12 -9
- package/package.json +28 -33
- package/components/avatar-stack/avatar-stack.js +0 -18
- package/components/collapse/collapse-content.js +0 -76
- package/components/data-list/data-list.mock.js +0 -170
- package/components/dropdown/anchor.js +0 -7
- package/components/error-bubble/error-bubble.js +0 -17
- package/components/error-message/error-message.js +0 -17
- package/components/header/services-link.js +0 -15
- package/components/list/list-title.js +0 -13
- package/components/popup/popup.target.js +0 -7
- package/components/tabs/tab-link.js +0 -9
- package/components/toggle/toggle.js +0 -22
- package/components/user-agreement/user-agreement.js +0 -33
- package/components/user-card/card.js +0 -31
- /package/components/global/{controls-height.js → controls-height.jsx} +0 -0
- /package/components/link/{clickableLink.js → clickableLink.jsx} +0 -0
- /package/components/tabs/{custom-item.js → custom-item.jsx} +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createElement as _createElement } from "react";
|
|
3
1
|
import { useEffect, useMemo, useRef } from 'react';
|
|
4
2
|
import { addMonths } from 'date-fns/addMonths';
|
|
5
3
|
import { getDay } from 'date-fns/getDay';
|
|
@@ -12,8 +10,8 @@ import linearFunction from '../global/linear-function';
|
|
|
12
10
|
import useEventCallback from '../global/use-event-callback';
|
|
13
11
|
import Month from './month';
|
|
14
12
|
import MonthNames from './month-names';
|
|
15
|
-
import styles from './date-picker.css';
|
|
16
13
|
import units, { DOUBLE, HALF, WEEK, weekdays } from './consts';
|
|
14
|
+
import styles from './date-picker.css';
|
|
17
15
|
const { unit, cellSize, calHeight } = units;
|
|
18
16
|
const FridayToSunday = WEEK + weekdays.SU - weekdays.FR;
|
|
19
17
|
const FIVELINES = 31;
|
|
@@ -83,7 +81,12 @@ export default function Months(props) {
|
|
|
83
81
|
}
|
|
84
82
|
};
|
|
85
83
|
}, [handleWheel]);
|
|
86
|
-
return (
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
return (<div className={styles.months} ref={componentRef}>
|
|
85
|
+
<div style={{
|
|
86
|
+
top: Math.floor(calHeight * HALF - monthHeight(months[0]) - monthHeight(months[1]) + offset),
|
|
87
|
+
}} className={styles.days}>
|
|
88
|
+
{months.map(date => (<Month {...props} month={date} key={+date}/>))}
|
|
89
|
+
</div>
|
|
90
|
+
<MonthNames {...props}/>
|
|
91
|
+
</div>);
|
|
89
92
|
}
|
|
@@ -2,5 +2,5 @@ import type { Locale } from 'date-fns';
|
|
|
2
2
|
interface WeekdaysProps {
|
|
3
3
|
locale: Locale | undefined;
|
|
4
4
|
}
|
|
5
|
-
export default function Weekdays(props: WeekdaysProps): import("react
|
|
5
|
+
export default function Weekdays(props: WeekdaysProps): import("react").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import classNames from 'classnames';
|
|
3
2
|
import { getDay } from 'date-fns/getDay';
|
|
4
3
|
import { format } from 'date-fns/format';
|
|
@@ -9,7 +8,11 @@ import styles from './date-picker.css';
|
|
|
9
8
|
export default function Weekdays(props) {
|
|
10
9
|
const days = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(props.locale)).map(value => startOfDay(setDay(new Date(), value)));
|
|
11
10
|
const { locale } = props;
|
|
12
|
-
return (
|
|
11
|
+
return (<div className={styles.weekdays}>
|
|
12
|
+
{days.map(day => (<span className={classNames(styles.weekday, {
|
|
13
13
|
[styles.weekend]: [weekdays.SA, weekdays.SU].includes(getDay(day)),
|
|
14
|
-
})
|
|
14
|
+
})} key={+day}>
|
|
15
|
+
{format(day, 'EEEEEE', { locale })}
|
|
16
|
+
</span>))}
|
|
17
|
+
</div>);
|
|
15
18
|
}
|
|
@@ -14,6 +14,6 @@ export default class Years extends PureComponent<CalendarProps> {
|
|
|
14
14
|
setYear(date: number): void;
|
|
15
15
|
componentRef: import("react").RefObject<HTMLDivElement | null>;
|
|
16
16
|
handleWheel: (e: WheelEvent) => void;
|
|
17
|
-
render(): import("react
|
|
17
|
+
render(): import("react").JSX.Element;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { createRef, PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import { addYears } from 'date-fns/addYears';
|
|
@@ -10,8 +9,8 @@ import { setYear } from 'date-fns/setYear';
|
|
|
10
9
|
import { startOfYear } from 'date-fns/startOfYear';
|
|
11
10
|
import { subYears } from 'date-fns/subYears';
|
|
12
11
|
import linearFunction from '../global/linear-function';
|
|
13
|
-
import styles from './date-picker.css';
|
|
14
12
|
import units, { DOUBLE, HALF, yearDuration } from './consts';
|
|
13
|
+
import styles from './date-picker.css';
|
|
15
14
|
const { yearHeight, calHeight } = units;
|
|
16
15
|
let scrollTO;
|
|
17
16
|
const YEARSBACK = 5;
|
|
@@ -65,14 +64,18 @@ export default class Years extends PureComponent {
|
|
|
65
64
|
years.push(year);
|
|
66
65
|
}
|
|
67
66
|
const pxToDate = linearFunction(0, Number(years[0]), yearDuration / yearHeight);
|
|
68
|
-
return (
|
|
67
|
+
return (<div className={styles.years} ref={this.componentRef} style={{
|
|
69
68
|
transition: this.stoppedScrolling ? 'top .2s ease-out 0s' : 'none',
|
|
70
69
|
top: Math.floor(calHeight * HALF - pxToDate.x(Number(date))),
|
|
71
|
-
}
|
|
70
|
+
}}>
|
|
71
|
+
{years.map(item => (<button type='button' key={+item} className={classNames(styles.year, {
|
|
72
72
|
[styles.currentYear]: isSameYear(item, date),
|
|
73
73
|
[styles.today]: isThisYear(item),
|
|
74
|
-
})
|
|
74
|
+
})} onClick={function handleClick() {
|
|
75
75
|
onScrollChange(Number(setYear(scrollDate, getYear(item))));
|
|
76
|
-
}
|
|
76
|
+
}}>
|
|
77
|
+
{format(item, 'yyyy')}
|
|
78
|
+
</button>))}
|
|
79
|
+
</div>);
|
|
77
80
|
}
|
|
78
81
|
}
|
|
@@ -45,6 +45,6 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
|
45
45
|
dialog?: HTMLElement | null;
|
|
46
46
|
dialogRef: (tabTrap: TabTrap | null) => void;
|
|
47
47
|
nativeDialog: React.RefObject<HTMLDialogElement | null>;
|
|
48
|
-
render(): false |
|
|
48
|
+
render(): false | React.JSX.Element;
|
|
49
49
|
}
|
|
50
50
|
export type DialogAttrs = React.JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import { createRef, PureComponent } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import closeIcon from '@jetbrains/icons/close';
|
|
@@ -112,21 +112,38 @@ export default class Dialog extends PureComponent {
|
|
|
112
112
|
const { show, showCloseButton, onOverlayClick, onCloseAttempt, onEscPress, onCloseClick, children, className, contentClassName, trapFocus, 'data-test': dataTest, closeButtonInside, portalTarget, label, closeButtonTitle, dense, shortcutOptions, native, modal, preventBodyScroll, ...restProps } = this.props;
|
|
113
113
|
const classes = classNames(styles.container, className);
|
|
114
114
|
const shortcutsMap = this.getShortcutsMap();
|
|
115
|
-
const content = (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
115
|
+
const content = (<>
|
|
116
|
+
<Shortcuts map={shortcutsMap} scope={this.state.shortcutsScope} options={this.props.shortcutOptions}/>
|
|
117
|
+
{(onOverlayClick !== noop || onCloseAttempt !== noop) && (<div
|
|
118
|
+
// click handler is duplicated in close button
|
|
119
|
+
role='presentation' className={styles.clickableOverlay} onClick={this.handleClick} data-test='ring-dialog-overlay'/>)}
|
|
120
|
+
<div className={styles.innerContainer}>
|
|
121
|
+
<AdaptiveIsland className={classNames(styles.content, contentClassName, {
|
|
122
|
+
[styles.dense]: dense,
|
|
123
|
+
})} data-test='ring-dialog' role='dialog' aria-label={label}>
|
|
124
|
+
{children}
|
|
125
|
+
{showCloseButton && (<Button icon={closeIcon} data-test='ring-dialog-close-button' className={classNames(styles.closeButton, {
|
|
126
|
+
[styles.closeButtonOutside]: !closeButtonInside,
|
|
127
|
+
[styles.closeButtonInside]: closeButtonInside,
|
|
128
|
+
})} iconClassName={classNames(styles.closeIcon, {
|
|
129
|
+
[styles.closeIconOutside]: !closeButtonInside,
|
|
130
|
+
[styles.closeIconInside]: closeButtonInside,
|
|
131
|
+
})} onClick={this.onCloseClick} title={closeButtonTitle} aria-label={closeButtonTitle || 'close dialog'}/>)}
|
|
132
|
+
</AdaptiveIsland>
|
|
133
|
+
</div>
|
|
134
|
+
</>);
|
|
126
135
|
if (native) {
|
|
127
|
-
return (
|
|
136
|
+
return (<dialog className={classNames(styles.nativeDialog, className)} ref={this.nativeDialog} data-rg-modal-dialog-container={modal ? '' : undefined}>
|
|
137
|
+
<PopupTarget id={this.uid} className={styles.popupTarget}>
|
|
138
|
+
{target => (<>
|
|
139
|
+
{content}
|
|
140
|
+
{target}
|
|
141
|
+
</>)}
|
|
142
|
+
</PopupTarget>
|
|
143
|
+
</dialog>);
|
|
128
144
|
}
|
|
129
|
-
return (show && (
|
|
145
|
+
return (show && (<PopupTargetContext.Consumer>
|
|
146
|
+
{contextTarget => {
|
|
130
147
|
let targetElement = document.body;
|
|
131
148
|
if (portalTarget instanceof HTMLElement) {
|
|
132
149
|
targetElement = portalTarget;
|
|
@@ -137,7 +154,13 @@ export default class Dialog extends PureComponent {
|
|
|
137
154
|
targetElement = container;
|
|
138
155
|
}
|
|
139
156
|
}
|
|
140
|
-
return createPortal(
|
|
141
|
-
|
|
157
|
+
return createPortal(<PopupTarget id={this.uid} className={styles.popupTarget}>
|
|
158
|
+
{target => (<TabTrap trapDisabled={!trapFocus} data-test={dataTests('ring-dialog-container', dataTest)} data-rg-modal-dialog-container='' ref={this.dialogRef} className={classes} role='presentation' {...restProps}>
|
|
159
|
+
{content}
|
|
160
|
+
{target}
|
|
161
|
+
</TabTrap>)}
|
|
162
|
+
</PopupTarget>, targetElement);
|
|
163
|
+
}}
|
|
164
|
+
</PopupTargetContext.Consumer>));
|
|
142
165
|
}
|
|
143
166
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ButtonAttrs } from '../button/button';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ children, className, ...restProps }: ButtonAttrs) => import("react
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ children, className, ...restProps }: ButtonAttrs) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Button from '../button/button';
|
|
4
|
+
import styles from './dropdown.css';
|
|
5
|
+
const Anchor = ({ children, className, ...restProps }) => (<Button data-test-ring-dropdown-anchor inline dropdown className={classNames(styles.anchor, className)} {...restProps}>
|
|
6
|
+
{children}
|
|
7
|
+
</Button>);
|
|
8
|
+
export default memo(Anchor);
|
|
@@ -66,7 +66,7 @@ export default class Dropdown extends Component<DropdownProps, DropdownState> {
|
|
|
66
66
|
toggle(show?: boolean): void;
|
|
67
67
|
_toggle(show: boolean, pinned?: boolean): void;
|
|
68
68
|
_clearTimer(): void;
|
|
69
|
-
render():
|
|
69
|
+
render(): React.JSX.Element;
|
|
70
70
|
}
|
|
71
71
|
export type DropdownAttrs = React.JSX.LibraryManagedAttributes<typeof Dropdown, DropdownProps>;
|
|
72
72
|
export { Anchor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cloneElement, Component } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import dataTests from '../global/data-tests';
|
|
5
5
|
import { isArray } from '../global/typescript-utils';
|
|
@@ -105,7 +105,7 @@ export default class Dropdown extends Component {
|
|
|
105
105
|
const active = hoverMode ? pinned : show;
|
|
106
106
|
switch (typeof anchor) {
|
|
107
107
|
case 'string':
|
|
108
|
-
anchorElement =
|
|
108
|
+
anchorElement = <Anchor active={active}>{anchor}</Anchor>;
|
|
109
109
|
break;
|
|
110
110
|
case 'function':
|
|
111
111
|
anchorElement = anchor({ active: show, pinned });
|
|
@@ -125,11 +125,14 @@ export default class Dropdown extends Component {
|
|
|
125
125
|
onContextMenu: hoverMode ? this.handlePopupInteraction : undefined,
|
|
126
126
|
dontCloseOnAnchorClick: true,
|
|
127
127
|
};
|
|
128
|
-
return (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
return (<div data-test={dataTests('ring-dropdown', dataTest)} {...restProps} onClick={clickMode ? this.onClick : undefined}
|
|
129
|
+
// anchorElement should be a `button` or an `a`
|
|
130
|
+
role='presentation' onMouseEnter={hoverMode ? this.onMouseEnter : undefined} onMouseLeave={hoverMode ? this.onMouseLeave : undefined} className={classes}>
|
|
131
|
+
{anchorElement}
|
|
132
|
+
{typeof children === 'function'
|
|
133
|
+
? children(childProps)
|
|
134
|
+
: cloneElement(children, childProps)}
|
|
135
|
+
</div>);
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
export { Anchor };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { forwardRef, useMemo, cloneElement, } from 'react';
|
|
3
2
|
import List, { ActiveItemContext } from '../list/list';
|
|
4
3
|
import Dropdown from '../dropdown/dropdown';
|
|
@@ -16,7 +15,7 @@ function DropdownAnchorWrapper({ anchor, pinned, active, activeListItemId, listI
|
|
|
16
15
|
const anchorProps = useMemo(() => ({ active, pinned, ...restProps, ...anchorAriaProps }), [pinned, active, restProps, anchorAriaProps]);
|
|
17
16
|
const anchorComponentProps = useMemo(() => ({ ...anchorProps, pinned: `${anchorProps.pinned}` }), [anchorProps]);
|
|
18
17
|
if (typeof anchor === 'string') {
|
|
19
|
-
return
|
|
18
|
+
return <Anchor {...anchorComponentProps}>{anchor}</Anchor>;
|
|
20
19
|
}
|
|
21
20
|
if (typeof anchor === 'function') {
|
|
22
21
|
return anchor({ active, pinned, ...restProps }, anchorAriaProps);
|
|
@@ -24,11 +23,11 @@ function DropdownAnchorWrapper({ anchor, pinned, active, activeListItemId, listI
|
|
|
24
23
|
if (!isArray(anchor)) {
|
|
25
24
|
return cloneElement(anchor, typeof anchor.type === 'string' ? anchorAriaProps : anchorComponentProps);
|
|
26
25
|
}
|
|
27
|
-
return
|
|
26
|
+
return <div {...anchorAriaProps}>{anchor}</div>;
|
|
28
27
|
}
|
|
29
28
|
function renderDropdownMenuChildren({ children, popupMenuProps }) {
|
|
30
29
|
if (!children) {
|
|
31
|
-
return
|
|
30
|
+
return <PopupMenu {...popupMenuProps}/>;
|
|
32
31
|
}
|
|
33
32
|
return (popupProps) => children({ ...popupProps, ...popupMenuProps });
|
|
34
33
|
}
|
|
@@ -44,6 +43,12 @@ const DropdownMenu = forwardRef(function DropdownMenu({ id, anchor, ariaLabel, d
|
|
|
44
43
|
onSelect,
|
|
45
44
|
...menuProps,
|
|
46
45
|
}), [ariaLabel, data, forwardedRef, listId, menuProps, onSelect]);
|
|
47
|
-
return (
|
|
46
|
+
return (<ActiveItemContext.Provider>
|
|
47
|
+
<Dropdown anchor={({ pinned, active, ...restAnchorProps }) => (<ActiveItemContext.ValueContext.Consumer>
|
|
48
|
+
{activeItemId => (<DropdownAnchorWrapper anchor={anchor} pinned={pinned} active={active} activeListItemId={activeItemId} listId={listId} {...restAnchorProps}/>)}
|
|
49
|
+
</ActiveItemContext.ValueContext.Consumer>)} {...restDropdownProps}>
|
|
50
|
+
{renderDropdownMenuChildren({ children, popupMenuProps })}
|
|
51
|
+
</Dropdown>
|
|
52
|
+
</ActiveItemContext.Provider>);
|
|
48
53
|
});
|
|
49
54
|
export default Object.assign(DropdownMenu, { ListProps: List.ListProps });
|
|
@@ -28,6 +28,6 @@ export type EditableHeadingProps = Omit<InputHTMLAttributes<HTMLInputElement | H
|
|
|
28
28
|
renderMenu?: () => React.ReactNode;
|
|
29
29
|
translations?: EditableHeadingTranslations;
|
|
30
30
|
};
|
|
31
|
-
export declare const EditableHeading: (props: EditableHeadingProps) =>
|
|
32
|
-
declare const _default: React.MemoExoticComponent<(props: EditableHeadingProps) =>
|
|
31
|
+
export declare const EditableHeading: (props: EditableHeadingProps) => React.JSX.Element;
|
|
32
|
+
declare const _default: React.MemoExoticComponent<(props: EditableHeadingProps) => React.JSX.Element>;
|
|
33
33
|
export default _default;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import { useCallback, useEffect } from 'react';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import Heading, { Levels } from '../heading/heading';
|
|
6
5
|
import Button from '../button/button';
|
|
7
6
|
import { Size } from '../input/input';
|
|
8
|
-
import inputStyles from '../input/input.css';
|
|
9
7
|
import getUID from '../global/get-uid';
|
|
10
8
|
import Shortcuts from '../shortcuts/shortcuts';
|
|
9
|
+
import inputStyles from '../input/input.css';
|
|
11
10
|
import styles from './editable-heading.css';
|
|
12
11
|
export { Levels };
|
|
13
12
|
export { Size };
|
|
@@ -112,6 +111,35 @@ export const EditableHeading = (props) => {
|
|
|
112
111
|
window.removeEventListener('mouseup', onMouseUp);
|
|
113
112
|
};
|
|
114
113
|
}, [onMouseMove, onMouseUp]);
|
|
115
|
-
return (
|
|
114
|
+
return (<>
|
|
115
|
+
<div className={classes}>
|
|
116
|
+
{!disabled && isEditing ? (<>
|
|
117
|
+
<Shortcuts map={shortcutsMap} scope={shortcutsScope} disabled={isShortcutsDisabled}/>
|
|
118
|
+
|
|
119
|
+
{!multiline ? (<input className={inputClasses} value={children} autoFocus={autoFocus} data-test={dataTest} disabled={isSaving} onChange={onChange} {...restProps} onFocus={onInputFocus} onBlur={onInputBlur}/>) : (<div className={classNames(styles.textareaWrapper, inputStyles[`size${size}`])}>
|
|
120
|
+
<textarea ref={textAreaRef} className={inputClasses} value={children} autoFocus={autoFocus} data-test={dataTest} disabled={isSaving} onChange={onInputChange} {...restProps} onFocus={onInputFocus} onBlur={onInputBlur} onScroll={onInputScroll} style={{ maxHeight: maxInputRows ? `${maxInputRows}lh` : '' }}/>
|
|
121
|
+
{!isScrolledToBottom && <div className={styles.textareaFade}/>}
|
|
122
|
+
</div>)}
|
|
123
|
+
</>) : (<button type='button' className={styles.headingWrapperButton} onMouseDown={onHeadingMouseDown}>
|
|
124
|
+
<Heading className={headingClasses} level={level} data-test={dataTest}>
|
|
125
|
+
{children}
|
|
126
|
+
</Heading>
|
|
127
|
+
</button>)}
|
|
128
|
+
|
|
129
|
+
{!isEditing && renderMenu()}
|
|
130
|
+
|
|
131
|
+
{isEditing && !embedded && (<>
|
|
132
|
+
<Button className={styles.button} primary disabled={isSaveDisabled} loader={isSaving} onClick={onSave}>
|
|
133
|
+
{translations.save}
|
|
134
|
+
</Button>
|
|
135
|
+
|
|
136
|
+
<Button className={styles.button} disabled={isCancelDisabled} onClick={onCancel}>
|
|
137
|
+
{translations.cancel}
|
|
138
|
+
</Button>
|
|
139
|
+
</>)}
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
{isEditing && error && <div className={classNames(styles.errorText, inputStyles[`size${size}`])}>{error}</div>}
|
|
143
|
+
</>);
|
|
116
144
|
};
|
|
117
145
|
export default React.memo(EditableHeading);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Children, cloneElement, PureComponent } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Popup from '../popup/popup';
|
|
4
|
+
import { Directions } from '../popup/popup.consts';
|
|
5
|
+
import styles from './error-bubble.css';
|
|
6
|
+
/**
|
|
7
|
+
* @name Error Bubble
|
|
8
|
+
*/
|
|
9
|
+
export default class ErrorBubble extends PureComponent {
|
|
10
|
+
render() {
|
|
11
|
+
const { children, className, ...restProps } = this.props;
|
|
12
|
+
const errorBubbleClasses = classNames(styles.errorBubble, className);
|
|
13
|
+
return (<div className={styles.errorBubbleWrapper} data-test='ring-error-bubble-wrapper'>
|
|
14
|
+
{children &&
|
|
15
|
+
Children.map(children, (child) => cloneElement(child, { ...child.props, ...restProps }))}
|
|
16
|
+
{restProps.error && (<Popup trapFocus={false} className={styles.errorBubblePopup} hidden={false} attached={false} directions={[Directions.RIGHT_CENTER, Directions.RIGHT_BOTTOM, Directions.RIGHT_TOP]}>
|
|
17
|
+
<div className={errorBubbleClasses} data-test='ring-error-bubble'>
|
|
18
|
+
{restProps.error}
|
|
19
|
+
</div>
|
|
20
|
+
</Popup>)}
|
|
21
|
+
</div>);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Icon from '../icon/icon';
|
|
4
|
+
import { Size } from '../icon/icon.constants';
|
|
5
|
+
import dataTests from '../global/data-tests';
|
|
6
|
+
import styles from './error-message.css';
|
|
7
|
+
/**
|
|
8
|
+
* @name Error Message
|
|
9
|
+
*/
|
|
10
|
+
export default class ErrorMessage extends Component {
|
|
11
|
+
render() {
|
|
12
|
+
const { className, icon, code, message, description, children, 'data-test': dataTest } = this.props;
|
|
13
|
+
const classes = classNames(styles.errorMessage, className);
|
|
14
|
+
return (<div className={classes} data-test={dataTests('ring-error-message', dataTest)}>
|
|
15
|
+
{icon && <Icon className={styles.icon} glyph={icon} size={Size.Size64} suppressSizeWarning/>}
|
|
16
|
+
<div className={styles.content}>
|
|
17
|
+
<div className={styles.title} data-test='ring-error-message-title'>
|
|
18
|
+
{code && `${code}:`} {message}
|
|
19
|
+
</div>
|
|
20
|
+
{description && <div className={styles.description}>{description}</div>}
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
</div>);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/**
|
|
3
2
|
* @name Footer
|
|
4
3
|
*/
|
|
@@ -12,7 +11,9 @@ const FooterColumn = memo(function FooterColumn({ position, children }) {
|
|
|
12
11
|
[styles.columnCenter]: position === 'center',
|
|
13
12
|
[styles.columnRight]: position === 'right',
|
|
14
13
|
});
|
|
15
|
-
return (
|
|
14
|
+
return (<div className={classes}>
|
|
15
|
+
<ul className={styles.columnItem}>{children}</ul>
|
|
16
|
+
</div>);
|
|
16
17
|
});
|
|
17
18
|
/**
|
|
18
19
|
* Return copyright string
|
|
@@ -44,24 +45,30 @@ const FooterLine = memo(function FooterLine(props) {
|
|
|
44
45
|
}
|
|
45
46
|
const element = (item.copyright ? copyright(item.copyright) : '') + (item.label || item);
|
|
46
47
|
if (item.url) {
|
|
47
|
-
return (
|
|
48
|
+
return (<Link href={item.url} target={item.target} key={item.url + item.title} title={item.title}>
|
|
49
|
+
{element}
|
|
50
|
+
</Link>);
|
|
48
51
|
}
|
|
49
52
|
return element;
|
|
50
53
|
}
|
|
51
|
-
return
|
|
54
|
+
return <li className={styles.line}>{items.map(renderItem)}</li>;
|
|
52
55
|
});
|
|
53
56
|
const Footer = memo(function Footer({ floating, className, left, center, right }) {
|
|
54
57
|
function content(elements, position) {
|
|
55
58
|
if (!elements) {
|
|
56
59
|
return false;
|
|
57
60
|
}
|
|
58
|
-
return (
|
|
61
|
+
return (<FooterColumn key={position} position={position}>
|
|
62
|
+
{elements.map((item, idx) => (<FooterLine
|
|
59
63
|
// eslint-disable-next-line react/no-array-index-key
|
|
60
|
-
|
|
64
|
+
key={idx} item={item}/>))}
|
|
65
|
+
</FooterColumn>);
|
|
61
66
|
}
|
|
62
67
|
const classes = classNames(styles.footer, className, {
|
|
63
68
|
[styles.footerFloating]: floating,
|
|
64
69
|
});
|
|
65
|
-
return (
|
|
70
|
+
return (<footer className={classes} data-test='ring-footer'>
|
|
71
|
+
{[content(left, 'left'), content(center, 'center'), content(right, 'right')]}
|
|
72
|
+
</footer>);
|
|
66
73
|
});
|
|
67
74
|
export default Footer;
|
|
@@ -11,7 +11,7 @@ export default function createStatefulContext<T>(initialValue: T, name?: string)
|
|
|
11
11
|
ValueContext: import("react").Context<T>;
|
|
12
12
|
UpdateContext: import("react").Context<Update<T>>;
|
|
13
13
|
Provider: {
|
|
14
|
-
({ children }: ProviderProps): import("react
|
|
14
|
+
({ children }: ProviderProps): import("react").JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
17
17
|
useUpdate: (value: T, skipUpdate?: boolean) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { createContext, memo, useContext, useEffect, useState } from 'react';
|
|
3
2
|
export default function createStatefulContext(initialValue, name = '') {
|
|
4
3
|
const ValueContext = createContext(initialValue);
|
|
5
4
|
const UpdateContext = createContext(() => { });
|
|
6
5
|
function Provider({ children }) {
|
|
7
6
|
const [value, update] = useState(initialValue);
|
|
8
|
-
return (
|
|
7
|
+
return (<ValueContext.Provider value={value}>
|
|
8
|
+
<UpdateContext.Provider value={update}>{children}</UpdateContext.Provider>
|
|
9
|
+
</ValueContext.Provider>);
|
|
9
10
|
}
|
|
10
11
|
Provider.displayName = `${name}Provider`;
|
|
11
12
|
function useUpdate(value, skipUpdate) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Component } from 'react';
|
|
3
2
|
import { createComposedRef } from './compose-refs';
|
|
4
3
|
export default function focusSensorHOC(ComposedComponent) {
|
|
@@ -72,7 +71,7 @@ export default function focusSensorHOC(ComposedComponent) {
|
|
|
72
71
|
};
|
|
73
72
|
render() {
|
|
74
73
|
const { autofocus, focused, onFocus, onBlur, innerRef, scrollOnTableFocus, ...rest } = this.props;
|
|
75
|
-
return (
|
|
74
|
+
return (<ComposedComponent {...rest} innerRef={this.composedRef(innerRef, this.onRefUpdate)} focused={this.state.focused} onFocusReset={this.onFocusReset} onFocusRestore={this.onFocusRestore}/>);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
FocusSensor.defaultProps = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Component } from 'react';
|
|
3
2
|
export default class Renderer extends Component {
|
|
4
3
|
componentDidMount() {
|
|
@@ -15,6 +14,6 @@ export default class Renderer extends Component {
|
|
|
15
14
|
};
|
|
16
15
|
render() {
|
|
17
16
|
const { className } = this.props;
|
|
18
|
-
return
|
|
17
|
+
return <div className={className} ref={this.nodeRef}/>;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Component, forwardRef } from 'react';
|
|
3
2
|
import { createComposedRef } from './compose-refs';
|
|
4
3
|
export default function rerenderHOC(ComposedComponent) {
|
|
@@ -7,10 +6,10 @@ export default function rerenderHOC(ComposedComponent) {
|
|
|
7
6
|
composedRef = createComposedRef();
|
|
8
7
|
render() {
|
|
9
8
|
const ref = this.composedRef(this.props.forwardedRef);
|
|
10
|
-
return (
|
|
9
|
+
return (<ComposedComponent {...this.state} ref={instance => ref(instance ? { ...instance, rerender: this.setState.bind(this) } : null)}/>);
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
return forwardRef(function RerendererForwardRef(props, ref) {
|
|
14
|
-
return
|
|
13
|
+
return <Rerenderer props={props} forwardedRef={ref}/>;
|
|
15
14
|
});
|
|
16
15
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { useMemo, useState, useEffect, forwardRef, useContext, createContext, } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import { createPortal } from 'react-dom';
|
|
5
4
|
import { PopupTarget, PopupTargetContext } from '../popup/popup.target';
|
|
6
5
|
import { getPopupContainer } from '../popup/popup';
|
|
6
|
+
import getUID from './get-uid';
|
|
7
7
|
import defaultStyles from './variables.css';
|
|
8
8
|
import styles from './variables_dark.css';
|
|
9
|
-
import getUID from './get-uid';
|
|
10
9
|
var Theme;
|
|
11
10
|
(function (Theme) {
|
|
12
11
|
Theme["AUTO"] = "auto";
|
|
@@ -51,7 +50,7 @@ export function applyTheme(theme, container) {
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
const DefaultWrapper = forwardRef(function Wrapper(props, ref) {
|
|
54
|
-
return
|
|
53
|
+
return <div {...props} ref={ref}/>;
|
|
55
54
|
});
|
|
56
55
|
export const ThemeProvider = forwardRef(function ThemeProvider({ theme = Theme.AUTO, className, passToPopups, children, WrapperComponent = DefaultWrapper, target, ...restProps }, ref) {
|
|
57
56
|
const systemTheme = useTheme();
|
|
@@ -65,6 +64,15 @@ export const ThemeProvider = forwardRef(function ThemeProvider({ theme = Theme.A
|
|
|
65
64
|
}, [resolvedTheme, target]);
|
|
66
65
|
const themeClasses = useThemeClasses(theme);
|
|
67
66
|
const parentTarget = useContext(PopupTargetContext);
|
|
68
|
-
return (
|
|
67
|
+
return (<ThemeContext.Provider value={themeValue}>
|
|
68
|
+
<WrapperComponent ref={ref} className={target ? undefined : classNames(className, themeClasses)} {...restProps}>
|
|
69
|
+
{passToPopups ? (<PopupTarget id={id}>
|
|
70
|
+
{popupTarget => (<>
|
|
71
|
+
{children}
|
|
72
|
+
{createPortal(<div className={themeClasses}>{popupTarget}</div>, (parentTarget && getPopupContainer(parentTarget)) || document.body)}
|
|
73
|
+
</>)}
|
|
74
|
+
</PopupTarget>) : (children)}
|
|
75
|
+
</WrapperComponent>
|
|
76
|
+
</ThemeContext.Provider>);
|
|
69
77
|
});
|
|
70
78
|
export default Theme;
|