@jetbrains/ring-ui-built 6.0.35 → 6.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/_helpers/_rollupPluginBabelHelpers.js +1 -10
- package/components/_helpers/anchor.js +9 -6
- package/components/_helpers/caption.js +5 -4
- package/components/_helpers/card.js +65 -49
- package/components/_helpers/icon__svg.js +4 -3
- package/components/_helpers/input.js +45 -36
- package/components/_helpers/query-assist__suggestions.js +18 -14
- package/components/_helpers/select__filter.js +22 -17
- package/components/_helpers/services-link.js +14 -12
- package/components/_helpers/sidebar.js +20 -16
- package/components/_helpers/tab-link.js +21 -13
- package/components/_helpers/theme.js +18 -11
- package/components/_helpers/title.js +20 -16
- package/components/alert/alert.d.ts +2 -1
- package/components/alert/alert.js +20 -17
- package/components/alert/container.d.ts +2 -2
- package/components/alert/container.js +14 -11
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/alert-service/alert-service.js +14 -14
- package/components/analytics/analytics.js +1 -1
- package/components/analytics/analytics__custom-plugin.js +1 -1
- package/components/auth/auth.js +1 -0
- package/components/auth/auth__core.js +3 -2
- package/components/auth/background-flow.js +1 -1
- package/components/auth/down-notification.d.ts +1 -1
- package/components/auth/down-notification.js +21 -14
- package/components/auth/iframe-flow.js +7 -5
- package/components/auth/request-builder.d.ts +0 -1
- package/components/auth/request-builder.js +1 -1
- package/components/auth/response-parser.js +1 -1
- package/components/auth/storage.js +3 -2
- package/components/auth/token-validator.d.ts +1 -1
- package/components/auth/token-validator.js +1 -1
- package/components/auth/window-flow.js +1 -1
- package/components/auth-dialog/auth-dialog.d.ts +2 -2
- package/components/auth-dialog/auth-dialog.js +42 -32
- package/components/auth-dialog-service/auth-dialog-service.d.ts +0 -1
- package/components/auth-dialog-service/auth-dialog-service.js +6 -7
- package/components/avatar/avatar.d.ts +2 -2
- package/components/avatar/avatar.js +29 -28
- package/components/avatar/fallback-avatar.d.ts +1 -2
- package/components/avatar/fallback-avatar.js +50 -37
- package/components/badge/badge.d.ts +2 -2
- package/components/badge/badge.js +7 -8
- package/components/breadcrumbs/breadcrumbs.d.ts +6 -0
- package/components/breadcrumbs/breadcrumbs.js +27 -0
- package/components/button/button.d.ts +2 -1
- package/components/button/button.js +26 -25
- package/components/button-group/button-group.d.ts +4 -2
- package/components/button-group/button-group.js +19 -10
- package/components/button-group/caption.d.ts +2 -2
- package/components/button-group/caption.js +1 -0
- package/components/button-set/button-set.d.ts +2 -2
- package/components/button-set/button-set.js +7 -8
- package/components/button-toolbar/button-toolbar.d.ts +2 -2
- package/components/button-toolbar/button-toolbar.js +4 -6
- package/components/caret/caret.js +1 -1
- package/components/checkbox/checkbox.d.ts +3 -2
- package/components/checkbox/checkbox.js +33 -28
- package/components/clipboard/clipboard.js +3 -2
- package/components/code/code.d.ts +3 -4
- package/components/code/code.js +14 -11
- package/components/collapse/collapse-content.d.ts +2 -1
- package/components/collapse/collapse-content.js +13 -10
- package/components/collapse/collapse-context.d.ts +0 -1
- package/components/collapse/collapse-control.d.ts +1 -1
- package/components/collapse/collapse-control.js +10 -11
- package/components/collapse/collapse.d.ts +2 -1
- package/components/collapse/collapse.js +16 -16
- package/components/confirm/confirm.d.ts +2 -1
- package/components/confirm/confirm.js +29 -21
- package/components/confirm-service/confirm-service.js +6 -4
- package/components/content-layout/content-layout.d.ts +2 -2
- package/components/content-layout/content-layout.js +12 -12
- package/components/content-layout/sidebar.d.ts +2 -2
- package/components/content-layout/sidebar.js +1 -0
- package/components/contenteditable/contenteditable.d.ts +3 -3
- package/components/contenteditable/contenteditable.js +5 -7
- package/components/control-help/control-help.d.ts +4 -0
- package/components/control-help/control-help.js +16 -0
- package/components/control-label/control-label.d.ts +2 -1
- package/components/control-label/control-label.js +7 -4
- package/components/data-list/data-list.d.ts +15 -15
- package/components/data-list/data-list.js +44 -40
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/data-list.mock.js +165 -73
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/item.js +49 -40
- package/components/data-list/selection.js +1 -1
- package/components/data-list/title.d.ts +3 -3
- package/components/data-list/title.js +2 -0
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +5 -3
- package/components/date-picker/date-picker.d.ts +2 -1
- package/components/date-picker/date-picker.js +43 -34
- package/components/date-picker/date-popup.d.ts +2 -1
- package/components/date-picker/date-popup.js +51 -45
- package/components/date-picker/day.d.ts +3 -3
- package/components/date-picker/day.js +11 -8
- package/components/date-picker/month-names.d.ts +1 -2
- package/components/date-picker/month-names.js +27 -25
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month-slider.js +15 -13
- package/components/date-picker/month.d.ts +1 -2
- package/components/date-picker/month.js +18 -15
- package/components/date-picker/months.d.ts +1 -2
- package/components/date-picker/months.js +18 -15
- package/components/date-picker/weekdays.d.ts +1 -2
- package/components/date-picker/weekdays.js +14 -13
- package/components/date-picker/years.d.ts +3 -3
- package/components/date-picker/years.js +19 -17
- package/components/dialog/dialog.d.ts +2 -1
- package/components/dialog/dialog.js +48 -45
- package/components/dropdown/anchor.d.ts +2 -3
- package/components/dropdown/anchor.js +1 -0
- package/components/dropdown/dropdown.d.ts +2 -1
- package/components/dropdown/dropdown.js +12 -12
- package/components/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/components/dropdown-menu/dropdown-menu.js +41 -29
- package/components/editable-heading/editable-heading.d.ts +2 -1
- package/components/editable-heading/editable-heading.js +74 -58
- package/components/error-bubble/error-bubble.d.ts +2 -2
- package/components/error-bubble/error-bubble.js +20 -19
- package/components/error-message/error-message.d.ts +2 -2
- package/components/error-message/error-message.js +22 -20
- package/components/footer/footer.d.ts +2 -2
- package/components/footer/footer.js +31 -27
- package/components/form/form.js +1 -1
- package/components/global/controls-height.d.ts +0 -1
- package/components/global/create-stateful-context.d.ts +5 -5
- package/components/global/create-stateful-context.js +10 -7
- package/components/global/data-tests.js +1 -1
- package/components/global/dom.d.ts +2 -2
- package/components/global/dom.js +1 -1
- package/components/global/focus-sensor-hoc.js +4 -3
- package/components/global/fuzzy-highlight.js +1 -1
- package/components/global/get-event-key.d.ts +1 -1
- package/components/global/inject-styles.js +1 -1
- package/components/global/listeners.js +1 -1
- package/components/global/normalize-indent.js +1 -1
- package/components/global/react-dom-renderer.d.ts +2 -2
- package/components/global/react-dom-renderer.js +4 -3
- package/components/global/rerender-hoc.d.ts +2 -2
- package/components/global/rerender-hoc.js +5 -4
- package/components/global/theme.d.ts +3 -3
- package/components/global/theme.js +1 -0
- package/components/global/trivial-template-tag.js +1 -1
- package/components/global/typescript-utils.d.ts +1 -1
- package/components/grid/col.d.ts +2 -2
- package/components/grid/col.js +7 -5
- package/components/grid/grid.d.ts +2 -2
- package/components/grid/grid.js +7 -8
- package/components/grid/row.d.ts +2 -2
- package/components/grid/row.js +7 -5
- package/components/group/group.d.ts +2 -2
- package/components/group/group.js +7 -8
- package/components/header/header.d.ts +2 -2
- package/components/header/header.js +12 -14
- package/components/header/logo.d.ts +2 -2
- package/components/header/logo.js +7 -5
- package/components/header/profile.d.ts +4 -3
- package/components/header/profile.js +40 -29
- package/components/header/services-link.d.ts +2 -2
- package/components/header/services-link.js +1 -0
- package/components/header/services.d.ts +2 -2
- package/components/header/services.js +31 -31
- package/components/header/smart-profile.d.ts +2 -2
- package/components/header/smart-profile.js +5 -3
- package/components/header/smart-services.d.ts +2 -2
- package/components/header/smart-services.js +4 -3
- package/components/header/tray-icon.d.ts +2 -2
- package/components/header/tray-icon.js +4 -3
- package/components/header/tray.d.ts +2 -2
- package/components/header/tray.js +11 -8
- package/components/heading/heading.d.ts +6 -6
- package/components/heading/heading.js +8 -9
- package/components/http/http.js +1 -1
- package/components/http/http.mock.js +1 -1
- package/components/hub-source/hub-source.js +1 -1
- package/components/hub-source/hub-source__user.js +1 -1
- package/components/hub-source/hub-source__users-groups.js +1 -1
- package/components/i18n/i18n-context.d.ts +1 -1
- package/components/i18n/i18n-context.js +7 -4
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +12 -10
- package/components/icon/icon__svg.d.ts +3 -3
- package/components/icon/icon__svg.js +1 -0
- package/components/icon/index.js +1 -0
- package/components/input/input.d.ts +3 -2
- package/components/input/input.js +2 -0
- package/components/island/adaptive-island-hoc.d.ts +15 -15
- package/components/island/adaptive-island-hoc.js +10 -7
- package/components/island/content.d.ts +3 -3
- package/components/island/content.js +29 -23
- package/components/island/header.d.ts +2 -2
- package/components/island/header.js +18 -13
- package/components/island/island.d.ts +14 -14
- package/components/island/island.js +7 -8
- package/components/island-legacy/content-legacy.d.ts +2 -2
- package/components/island-legacy/content-legacy.js +7 -5
- package/components/island-legacy/header-legacy.d.ts +2 -2
- package/components/island-legacy/header-legacy.js +10 -7
- package/components/island-legacy/island-legacy.d.ts +2 -2
- package/components/island-legacy/island-legacy.js +7 -5
- package/components/link/clickableLink.d.ts +2 -1
- package/components/link/clickableLink.js +8 -6
- package/components/link/link.d.ts +23 -23
- package/components/link/link.js +12 -9
- package/components/list/consts.d.ts +2 -1
- package/components/list/list.d.ts +11 -11
- package/components/list/list.js +109 -95
- package/components/list/list__custom.d.ts +2 -1
- package/components/list/list__custom.js +7 -5
- package/components/list/list__hint.d.ts +2 -2
- package/components/list/list__hint.js +7 -9
- package/components/list/list__item.d.ts +2 -2
- package/components/list/list__item.js +73 -65
- package/components/list/list__link.d.ts +2 -2
- package/components/list/list__link.js +8 -10
- package/components/list/list__separator.d.ts +2 -2
- package/components/list/list__separator.js +7 -5
- package/components/list/list__title.d.ts +2 -2
- package/components/list/list__title.js +15 -11
- package/components/list/list__users-groups-source.js +3 -1
- package/components/loader/loader.d.ts +2 -2
- package/components/loader/loader.js +5 -10
- package/components/loader/loader__core.js +1 -1
- package/components/loader-inline/loader-inline.d.ts +2 -2
- package/components/loader-inline/loader-inline.js +10 -9
- package/components/loader-screen/loader-screen.d.ts +2 -2
- package/components/loader-screen/loader-screen.js +10 -11
- package/components/login-dialog/login-dialog.d.ts +2 -2
- package/components/login-dialog/login-dialog.js +21 -16
- package/components/login-dialog/service.js +6 -4
- package/components/markdown/markdown.d.ts +2 -2
- package/components/markdown/markdown.js +7 -8
- package/components/message/message.d.ts +2 -2
- package/components/message/message.js +50 -41
- package/components/old-browsers-message/white-list.js +1 -1
- package/components/pager/pager.d.ts +2 -1
- package/components/pager/pager.js +71 -53
- package/components/panel/panel.d.ts +2 -2
- package/components/panel/panel.js +7 -8
- package/components/permissions/permissions.js +1 -1
- package/components/permissions/permissions__cache.js +1 -1
- package/components/popup/popup.d.ts +4 -3
- package/components/popup/popup.js +46 -39
- package/components/popup/popup.target.d.ts +3 -3
- package/components/popup/popup.target.js +11 -8
- package/components/popup-menu/popup-menu.d.ts +2 -2
- package/components/popup-menu/popup-menu.js +13 -9
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/progress-bar/progress-bar.js +17 -18
- package/components/query-assist/query-assist.d.ts +3 -2
- package/components/query-assist/query-assist.js +122 -109
- package/components/query-assist/query-assist__suggestions.d.ts +1 -2
- package/components/query-assist/query-assist__suggestions.js +3 -1
- package/components/radio/radio.d.ts +3 -3
- package/components/radio/radio.js +8 -8
- package/components/radio/radio__item.d.ts +9 -6
- package/components/radio/radio__item.js +46 -37
- package/components/select/select.d.ts +5 -2
- package/components/select/select.js +201 -180
- package/components/select/select__filter.d.ts +2 -2
- package/components/select/select__filter.js +2 -0
- package/components/select/select__popup.d.ts +4 -35
- package/components/select/select__popup.js +101 -84
- package/components/shortcuts/core.d.ts +0 -1
- package/components/shortcuts/core.js +1 -1
- package/components/shortcuts/shortcuts-hoc.d.ts +12 -12
- package/components/shortcuts/shortcuts-hoc.js +10 -8
- package/components/shortcuts/shortcuts.js +1 -1
- package/components/slider/slider.d.ts +2 -1
- package/components/slider/slider.js +78 -78
- package/components/slider/slider.utils.js +1 -1
- package/components/storage/storage.js +2 -1
- package/components/storage/storage__fallback.js +1 -1
- package/components/storage/storage__local.js +3 -2
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +2 -1
- package/components/tab-trap/tab-trap.js +25 -20
- package/components/table/cell.d.ts +2 -2
- package/components/table/cell.js +7 -5
- package/components/table/disable-hover-hoc.d.ts +13 -13
- package/components/table/disable-hover-hoc.js +4 -3
- package/components/table/header-cell.d.ts +2 -2
- package/components/table/header-cell.js +17 -13
- package/components/table/header.d.ts +3 -3
- package/components/table/header.js +34 -26
- package/components/table/multitable.d.ts +2 -2
- package/components/table/multitable.js +12 -10
- package/components/table/row-with-focus-sensor.d.ts +3 -3
- package/components/table/row-with-focus-sensor.js +5 -3
- package/components/table/row.d.ts +2 -1
- package/components/table/row.js +50 -44
- package/components/table/selection-adapter.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +4 -3
- package/components/table/selection.js +1 -1
- package/components/table/smart-table.d.ts +44 -44
- package/components/table/smart-table.js +5 -3
- package/components/table/table.d.ts +6 -5
- package/components/table/table.js +55 -45
- package/components/tabs/collapsible-more.d.ts +4 -4
- package/components/tabs/collapsible-more.js +37 -30
- package/components/tabs/collapsible-tab.d.ts +2 -1
- package/components/tabs/collapsible-tab.js +6 -6
- package/components/tabs/collapsible-tabs.d.ts +4 -4
- package/components/tabs/collapsible-tabs.js +51 -46
- package/components/tabs/custom-item.d.ts +1 -1
- package/components/tabs/dumb-tabs.d.ts +2 -1
- package/components/tabs/dumb-tabs.js +24 -18
- package/components/tabs/smart-tabs.d.ts +2 -2
- package/components/tabs/smart-tabs.js +8 -4
- package/components/tabs/tab-link.d.ts +3 -3
- package/components/tabs/tab-link.js +1 -0
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tab.js +7 -5
- package/components/tabs/tabs.js +2 -0
- package/components/tag/tag.d.ts +2 -1
- package/components/tag/tag.js +31 -28
- package/components/tags-input/tags-input.d.ts +3 -2
- package/components/tags-input/tags-input.js +52 -47
- package/components/tags-list/tags-list.d.ts +2 -1
- package/components/tags-list/tags-list.js +8 -5
- package/components/text/text.d.ts +2 -2
- package/components/text/text.js +7 -4
- package/components/toggle/toggle.d.ts +2 -2
- package/components/toggle/toggle.js +25 -20
- package/components/tooltip/tooltip.d.ts +2 -1
- package/components/tooltip/tooltip.js +26 -21
- package/components/user-agreement/service.js +20 -12
- package/components/user-agreement/user-agreement.d.ts +2 -2
- package/components/user-agreement/user-agreement.js +56 -39
- package/components/user-card/card.d.ts +2 -1
- package/components/user-card/card.js +1 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +3 -3
- package/components/user-card/smart-user-card-tooltip.js +11 -7
- package/components/user-card/tooltip.d.ts +3 -3
- package/components/user-card/tooltip.js +15 -11
- package/components/user-card/user-card.js +1 -0
- package/package.json +5 -5
@@ -2,7 +2,6 @@ import 'core-js/modules/es.array.includes.js';
|
|
2
2
|
import 'core-js/modules/es.array.map.js';
|
3
3
|
import 'core-js/modules/es.object.values.js';
|
4
4
|
import 'core-js/modules/es.string.includes.js';
|
5
|
-
import React from 'react';
|
6
5
|
import classNames from 'classnames';
|
7
6
|
import { getDay } from 'date-fns/getDay';
|
8
7
|
import { format } from 'date-fns/format';
|
@@ -11,6 +10,7 @@ import { startOfDay } from 'date-fns/startOfDay';
|
|
11
10
|
import PropTypes from 'prop-types';
|
12
11
|
import { shiftWeekArray, getWeekStartsOn, weekdays } from './consts.js';
|
13
12
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
14
14
|
import 'core-js/modules/es.array.concat.js';
|
15
15
|
import 'core-js/modules/es.array.index-of.js';
|
16
16
|
import 'core-js/modules/es.array.slice.js';
|
@@ -22,18 +22,19 @@ function Weekdays(props) {
|
|
22
22
|
return startOfDay(setDay(new Date(), value));
|
23
23
|
});
|
24
24
|
var locale = props.locale;
|
25
|
-
return /*#__PURE__*/
|
26
|
-
className: modules_0c7b7d96.weekdays
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
return /*#__PURE__*/jsx("div", {
|
26
|
+
className: modules_0c7b7d96.weekdays,
|
27
|
+
children: days.map(function (day) {
|
28
|
+
return /*#__PURE__*/jsx("span", {
|
29
|
+
className: classNames(modules_0c7b7d96.weekday, {
|
30
|
+
[modules_0c7b7d96.weekend]: [weekdays.SA, weekdays.SU].includes(getDay(day))
|
31
|
+
}),
|
32
|
+
children: format(day, 'EEEEEE', {
|
33
|
+
locale
|
34
|
+
})
|
35
|
+
}, +day);
|
36
|
+
})
|
37
|
+
});
|
37
38
|
}
|
38
39
|
Weekdays.propTypes = {
|
39
40
|
locale: PropTypes.object
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { PureComponent } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { CalendarProps } from './consts';
|
4
4
|
interface YearsState {
|
@@ -18,8 +18,8 @@ export default class Years extends PureComponent<CalendarProps> {
|
|
18
18
|
componentWillUnmount(): void;
|
19
19
|
stoppedScrolling?: boolean;
|
20
20
|
setYear(date: number): void;
|
21
|
-
componentRef:
|
21
|
+
componentRef: import("react").RefObject<HTMLDivElement>;
|
22
22
|
handleWheel: (e: WheelEvent) => void;
|
23
|
-
render():
|
23
|
+
render(): import("react").JSX.Element;
|
24
24
|
}
|
25
25
|
export {};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { _ as _defineProperty, a as _inherits, b as _createClass,
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createClass, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
3
|
import 'core-js/modules/es.array.map.js';
|
4
|
-
import
|
4
|
+
import { PureComponent, createRef } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import { addYears } from 'date-fns/addYears';
|
@@ -15,6 +15,7 @@ import { subYears } from 'date-fns/subYears';
|
|
15
15
|
import linearFunction from '../global/linear-function.js';
|
16
16
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
17
17
|
import units, { dateType, DOUBLE, HALF, yearDuration } from './consts.js';
|
18
|
+
import { jsx } from 'react/jsx-runtime';
|
18
19
|
import 'core-js/modules/es.array.index-of.js';
|
19
20
|
import 'core-js/modules/es.array.slice.js';
|
20
21
|
import 'core-js/modules/es.object.values.js';
|
@@ -103,26 +104,27 @@ var Years = /*#__PURE__*/function (_PureComponent) {
|
|
103
104
|
years.push(year);
|
104
105
|
}
|
105
106
|
var pxToDate = linearFunction(0, Number(years[0]), yearDuration / yearHeight);
|
106
|
-
return /*#__PURE__*/
|
107
|
+
return /*#__PURE__*/jsx("div", {
|
107
108
|
className: modules_0c7b7d96.years,
|
108
109
|
ref: this.componentRef,
|
109
110
|
style: {
|
110
111
|
transition: this.stoppedScrolling ? 'top .2s ease-out 0s' : 'none',
|
111
112
|
top: Math.floor(calHeight * HALF - pxToDate.x(Number(date)))
|
112
|
-
}
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
113
|
+
},
|
114
|
+
children: years.map(function (item) {
|
115
|
+
return /*#__PURE__*/jsx("button", {
|
116
|
+
type: "button",
|
117
|
+
className: classNames(modules_0c7b7d96.year, {
|
118
|
+
[modules_0c7b7d96.currentYear]: isSameYear(item, date),
|
119
|
+
[modules_0c7b7d96.today]: isThisYear(item)
|
120
|
+
}),
|
121
|
+
onClick: function handleClick() {
|
122
|
+
onScrollChange(Number(setYear(scrollDate, getYear(item))));
|
123
|
+
},
|
124
|
+
children: format(item, 'yyyy')
|
125
|
+
}, +item);
|
126
|
+
})
|
127
|
+
});
|
126
128
|
}
|
127
129
|
}]);
|
128
130
|
}(PureComponent);
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import { PureComponent } from 'react';
|
2
|
+
import * as React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import TabTrap, { TabTrapProps } from '../tab-trap/tab-trap';
|
4
5
|
import type { ShortcutsScopeOptions } from '../shortcuts/core';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties,
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
|
-
import
|
3
|
+
import { PureComponent } from 'react';
|
4
4
|
import { createPortal } from 'react-dom';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
@@ -13,6 +13,7 @@ import TabTrap from '../tab-trap/tab-trap.js';
|
|
13
13
|
import { Button } from '../button/button.js';
|
14
14
|
import { PopupTarget } from '../popup/popup.target.js';
|
15
15
|
import { m as modules_5e9b8c03, p as preventerFactory } from '../_helpers/dialog__body-scroll-preventer.js';
|
16
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
16
17
|
import '../island/adaptive-island-hoc.js';
|
17
18
|
import '../global/linear-function.js';
|
18
19
|
import '../_helpers/island.js';
|
@@ -60,9 +61,6 @@ import '../_helpers/button__classes.js';
|
|
60
61
|
import 'scrollbar-width';
|
61
62
|
|
62
63
|
var _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions"];
|
63
|
-
/**
|
64
|
-
* @name Dialog
|
65
|
-
*/
|
66
64
|
function noop() {}
|
67
65
|
var Dialog = /*#__PURE__*/function (_PureComponent) {
|
68
66
|
function Dialog() {
|
@@ -140,7 +138,7 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
140
138
|
onCloseAttempt = _this$props.onCloseAttempt;
|
141
139
|
_this$props.onEscPress;
|
142
140
|
_this$props.onCloseClick;
|
143
|
-
var
|
141
|
+
var _children = _this$props.children,
|
144
142
|
className = _this$props.className,
|
145
143
|
contentClassName = _this$props.contentClassName,
|
146
144
|
trapFocus = _this$props.trapFocus,
|
@@ -154,46 +152,51 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
154
152
|
var restProps = _objectWithoutProperties(_this$props, _excluded);
|
155
153
|
var classes = classNames(modules_5e9b8c03.container, className);
|
156
154
|
var shortcutsMap = this.getShortcutsMap();
|
157
|
-
return show && /*#__PURE__*/createPortal( /*#__PURE__*/
|
155
|
+
return show && /*#__PURE__*/createPortal( /*#__PURE__*/jsx(PopupTarget, {
|
158
156
|
id: this.uid,
|
159
|
-
className: modules_5e9b8c03.popupTarget
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
157
|
+
className: modules_5e9b8c03.popupTarget,
|
158
|
+
children: function children(target) {
|
159
|
+
return /*#__PURE__*/jsxs(TabTrap, _objectSpread2(_objectSpread2({
|
160
|
+
trapDisabled: !trapFocus,
|
161
|
+
"data-test": joinDataTestAttributes('ring-dialog-container', dataTest),
|
162
|
+
ref: _this2.dialogRef,
|
163
|
+
className: classes,
|
164
|
+
role: "presentation"
|
165
|
+
}, restProps), {}, {
|
166
|
+
children: [/*#__PURE__*/jsx(Shortcuts, {
|
167
|
+
map: shortcutsMap,
|
168
|
+
scope: _this2.state.shortcutsScope,
|
169
|
+
options: _this2.props.shortcutOptions
|
170
|
+
}), (onOverlayClick !== noop || onCloseAttempt !== noop) && /*#__PURE__*/jsx("div", {
|
171
|
+
// click handler is duplicated in close button
|
172
|
+
role: "presentation",
|
173
|
+
className: modules_5e9b8c03.clickableOverlay,
|
174
|
+
onClick: _this2.handleClick
|
175
|
+
}), /*#__PURE__*/jsx("div", {
|
176
|
+
className: modules_5e9b8c03.innerContainer,
|
177
|
+
children: /*#__PURE__*/jsxs(AdaptiveIsland, {
|
178
|
+
className: classNames(modules_5e9b8c03.content, contentClassName, {
|
179
|
+
[modules_5e9b8c03.dense]: dense
|
180
|
+
}),
|
181
|
+
"data-test": "ring-dialog",
|
182
|
+
role: "dialog",
|
183
|
+
"aria-label": label,
|
184
|
+
children: [_children, showCloseButton && /*#__PURE__*/jsx(Button, {
|
185
|
+
icon: closeIcon,
|
186
|
+
"data-test": "ring-dialog-close-button",
|
187
|
+
className: classNames(modules_5e9b8c03.closeButton, {
|
188
|
+
[modules_5e9b8c03.closeButtonOutside]: !closeButtonInside,
|
189
|
+
[modules_5e9b8c03.closeButtonInside]: closeButtonInside
|
190
|
+
}),
|
191
|
+
iconClassName: modules_5e9b8c03.closeIcon,
|
192
|
+
onClick: _this2.onCloseClick,
|
193
|
+
title: closeButtonTitle,
|
194
|
+
"aria-label": closeButtonTitle || 'close dialog'
|
195
|
+
})]
|
196
|
+
})
|
197
|
+
}), target]
|
198
|
+
}));
|
199
|
+
}
|
197
200
|
}), portalTarget instanceof HTMLElement ? portalTarget : document.body);
|
198
201
|
}
|
199
202
|
}]);
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import PropTypes from 'prop-types';
|
3
2
|
import { ButtonAttrs } from '../button/button';
|
4
|
-
declare const _default:
|
5
|
-
({ children, className, ...restProps }: ButtonAttrs):
|
3
|
+
declare const _default: import("react").MemoExoticComponent<{
|
4
|
+
({ children, className, ...restProps }: ButtonAttrs): import("react").JSX.Element;
|
6
5
|
propTypes: {
|
7
6
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
8
7
|
className: PropTypes.Requireable<string>;
|
@@ -6,6 +6,7 @@ import 'classnames';
|
|
6
6
|
import '../icon/icon.js';
|
7
7
|
import '../button/button.js';
|
8
8
|
export { A as default } from '../_helpers/anchor.js';
|
9
|
+
import 'react/jsx-runtime';
|
9
10
|
import 'util-deprecate';
|
10
11
|
import '../icon/icon__constants.js';
|
11
12
|
import '../_helpers/icon__svg.js';
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import { Component, HTMLAttributes, ReactNode, ReactElement } from 'react';
|
2
|
+
import * as React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import { PopupAttrs } from '../popup/popup';
|
4
5
|
import Anchor from './anchor';
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties,
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
|
-
import
|
3
|
+
import { cloneElement, Component } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import joinDataTestAttributes from '../global/data-tests.js';
|
7
7
|
import { isArray } from '../global/typescript-utils.js';
|
8
8
|
import { m as modules_d9414203, A as Anchor } from '../_helpers/anchor.js';
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
9
10
|
import 'core-js/modules/es.array.reduce.js';
|
10
11
|
import 'core-js/modules/es.object.entries.js';
|
11
12
|
import 'core-js/modules/es.object.to-string.js';
|
@@ -28,9 +29,6 @@ import '../global/controls-height.js';
|
|
28
29
|
import '../_helpers/button__classes.js';
|
29
30
|
|
30
31
|
var _excluded = ["initShown", "onShow", "onHide", "hoverShowTimeOut", "hoverHideTimeOut", "children", "anchor", "className", "activeClassName", "hoverMode", "clickMode", "data-test", "disabled"];
|
31
|
-
/**
|
32
|
-
* @name Dropdown
|
33
|
-
*/
|
34
32
|
var Dropdown = /*#__PURE__*/function (_Component) {
|
35
33
|
function Dropdown() {
|
36
34
|
var _this;
|
@@ -168,9 +166,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
168
166
|
var active = hoverMode ? pinned : show;
|
169
167
|
switch (typeof anchor) {
|
170
168
|
case 'string':
|
171
|
-
anchorElement = /*#__PURE__*/
|
172
|
-
active: active
|
173
|
-
|
169
|
+
anchorElement = /*#__PURE__*/jsx(Anchor, {
|
170
|
+
active: active,
|
171
|
+
children: anchor
|
172
|
+
});
|
174
173
|
break;
|
175
174
|
case 'function':
|
176
175
|
anchorElement = anchor({
|
@@ -194,17 +193,18 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
194
193
|
onContextMenu: hoverMode ? this.handlePopupInteraction : undefined,
|
195
194
|
dontCloseOnAnchorClick: true
|
196
195
|
};
|
197
|
-
return /*#__PURE__*/
|
196
|
+
return /*#__PURE__*/jsxs("div", _objectSpread2(_objectSpread2({
|
198
197
|
"data-test": joinDataTestAttributes('ring-dropdown', dataTest)
|
199
|
-
}, restProps, {
|
198
|
+
}, restProps), {}, {
|
200
199
|
onClick: clickMode ? this.onClick : undefined
|
201
200
|
// anchorElement should be a `button` or an `a`
|
202
201
|
,
|
203
202
|
role: "presentation",
|
204
203
|
onMouseEnter: hoverMode ? this.onMouseEnter : undefined,
|
205
204
|
onMouseLeave: hoverMode ? this.onMouseLeave : undefined,
|
206
|
-
className: classes
|
207
|
-
|
205
|
+
className: classes,
|
206
|
+
children: [anchorElement, typeof children === 'function' ? children(childProps) : /*#__PURE__*/cloneElement(children, childProps)]
|
207
|
+
}));
|
208
208
|
}
|
209
209
|
}]);
|
210
210
|
}(Component);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { ReactElement, ReactNodeArray, HTMLAttributes, SyntheticEvent, Ref } from 'react';
|
2
2
|
import { SelectHandlerParams } from '../list/list';
|
3
3
|
import { AnchorProps, DropdownAttrs } from '../dropdown/dropdown';
|
4
4
|
import PopupMenu, { PopupMenuAttrs } from '../popup-menu/popup-menu';
|
@@ -16,8 +16,8 @@ export interface DropdownMenuProps<T = unknown> extends Omit<DropdownAttrs, 'anc
|
|
16
16
|
menuProps?: PopupMenuAttrs<T> | null | undefined;
|
17
17
|
}
|
18
18
|
declare const _default: (<T = unknown>(props: DropdownMenuProps<T> & {
|
19
|
-
ref?:
|
20
|
-
}) =>
|
19
|
+
ref?: Ref<PopupMenu>;
|
20
|
+
}) => ReactElement | null) & {
|
21
21
|
ListProps: {
|
22
22
|
Type: typeof import("../list/consts").Type;
|
23
23
|
Dimension: {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { c as _objectWithoutProperties, d as _objectSpread2
|
1
|
+
import { c as _objectWithoutProperties, d as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.object.assign.js';
|
3
|
-
import
|
3
|
+
import { forwardRef, useMemo, cloneElement } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import List, { ActiveItemContext } from '../list/list.js';
|
6
6
|
import Dropdown from '../dropdown/dropdown.js';
|
@@ -8,6 +8,7 @@ import PopupMenu from '../popup-menu/popup-menu.js';
|
|
8
8
|
import getUID from '../global/get-uid.js';
|
9
9
|
import { A as Anchor } from '../_helpers/anchor.js';
|
10
10
|
import { isArray } from '../global/typescript-utils.js';
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
11
12
|
import 'core-js/modules/es.symbol.js';
|
12
13
|
import 'core-js/modules/es.symbol.description.js';
|
13
14
|
import 'core-js/modules/es.array.concat.js';
|
@@ -70,6 +71,7 @@ import '../_helpers/icon__svg.js';
|
|
70
71
|
import 'core-js/modules/es.string.starts-with.js';
|
71
72
|
import '../global/prop-types.js';
|
72
73
|
import '../global/composeRefs.js';
|
74
|
+
import '../control-help/control-help.js';
|
73
75
|
import '../list/list__custom.js';
|
74
76
|
import '../global/get-event-key.js';
|
75
77
|
import '../list/list__title.js';
|
@@ -129,7 +131,9 @@ function DropdownAnchorWrapper(_ref3) {
|
|
129
131
|
});
|
130
132
|
}, [anchorProps]);
|
131
133
|
if (typeof anchor === 'string') {
|
132
|
-
return /*#__PURE__*/
|
134
|
+
return /*#__PURE__*/jsx(Anchor, _objectSpread2(_objectSpread2({}, anchorComponentProps), {}, {
|
135
|
+
children: anchor
|
136
|
+
}));
|
133
137
|
}
|
134
138
|
if (typeof anchor === 'function') {
|
135
139
|
return anchor(_objectSpread2({
|
@@ -140,7 +144,9 @@ function DropdownAnchorWrapper(_ref3) {
|
|
140
144
|
if (!isArray(anchor)) {
|
141
145
|
return /*#__PURE__*/cloneElement(anchor, typeof anchor.type === 'string' ? anchorAriaProps : anchorComponentProps);
|
142
146
|
}
|
143
|
-
return /*#__PURE__*/
|
147
|
+
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, anchorAriaProps), {}, {
|
148
|
+
children: anchor
|
149
|
+
}));
|
144
150
|
}
|
145
151
|
DropdownAnchorWrapper.propTypes = {
|
146
152
|
anchor: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.func]).isRequired,
|
@@ -149,7 +155,7 @@ DropdownAnchorWrapper.propTypes = {
|
|
149
155
|
activeListItemId: PropTypes.string,
|
150
156
|
listId: PropTypes.string
|
151
157
|
};
|
152
|
-
var DropdownMenu = /*#__PURE__*/
|
158
|
+
var DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref4, forwardedRef) {
|
153
159
|
var id = _ref4.id,
|
154
160
|
_anchor = _ref4.anchor,
|
155
161
|
ariaLabel = _ref4.ariaLabel,
|
@@ -160,30 +166,36 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function DropdownMenu(_ref4, fo
|
|
160
166
|
var listId = useMemo(function () {
|
161
167
|
return id || getUID('dropdown-menu-list');
|
162
168
|
}, [id]);
|
163
|
-
return /*#__PURE__*/
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
return /*#__PURE__*/
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
169
|
+
return /*#__PURE__*/jsx(ActiveItemContext.Provider, {
|
170
|
+
children: /*#__PURE__*/jsx(Dropdown, _objectSpread2(_objectSpread2({
|
171
|
+
anchor: function anchor(_ref5) {
|
172
|
+
var pinned = _ref5.pinned,
|
173
|
+
active = _ref5.active,
|
174
|
+
restAnchorProps = _objectWithoutProperties(_ref5, _excluded3);
|
175
|
+
return /*#__PURE__*/jsx(ActiveItemContext.ValueContext.Consumer, {
|
176
|
+
children: function children(activeItemId) {
|
177
|
+
return /*#__PURE__*/jsx(DropdownAnchorWrapper, _objectSpread2({
|
178
|
+
anchor: _anchor,
|
179
|
+
pinned: pinned,
|
180
|
+
active: active,
|
181
|
+
activeListItemId: activeItemId,
|
182
|
+
listId: listId
|
183
|
+
}, restAnchorProps));
|
184
|
+
}
|
185
|
+
});
|
186
|
+
}
|
187
|
+
}, restDropdownProps), {}, {
|
188
|
+
children: /*#__PURE__*/jsx(PopupMenu, _objectSpread2({
|
189
|
+
ref: forwardedRef,
|
190
|
+
id: listId,
|
191
|
+
ariaLabel: ariaLabel || defaultAriaLabel,
|
192
|
+
closeOnSelect: true,
|
193
|
+
activateFirstItem: true,
|
194
|
+
data: data,
|
195
|
+
onSelect: onSelect
|
196
|
+
}, menuProps))
|
197
|
+
}))
|
198
|
+
});
|
187
199
|
});
|
188
200
|
DropdownMenu.propTypes = _objectSpread2({
|
189
201
|
id: idPropType,
|