@jetbrains/ring-ui 5.0.0-beta.9 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/components/alert/alert.css +1 -1
- package/components/alert-service/alert-service.js +1 -1
- package/components/analytics/analytics__ga-plugin.d.ts +1 -1
- package/components/analytics/analytics__ga-plugin.js +12 -3
- package/components/auth/auth__core.js +5 -1
- package/components/auth-dialog-service/auth-dialog-service.js +1 -1
- package/components/avatar/avatar.d.ts +1 -0
- package/components/avatar/fallback-avatar.js +2 -2
- package/components/button/button.css +2 -2
- package/components/button/button.d.ts +2 -1
- package/components/button-group/button-group.css +4 -2
- package/components/checkbox/checkbox.css +8 -12
- package/components/checkbox/checkbox.js +1 -1
- package/components/checkbox-ng/checkbox-ng.js +1 -1
- package/components/confirm-service/confirm-service.js +1 -1
- package/components/data-list/data-list.d.ts +4 -8
- package/components/date-picker/date-picker.css +1 -0
- package/components/date-picker/date-popup.js +0 -1
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/global/angular-component-factory.js +1 -1
- package/components/global/promise-with-timeout.d.ts +2 -1
- package/components/global/promise-with-timeout.js +5 -2
- package/components/global/react-render-adapter.d.ts +29 -0
- package/components/global/react-render-adapter.js +36 -0
- package/components/global/rerender-hoc.d.ts +5 -9
- package/components/global/rerender-hoc.js +4 -2
- package/components/global/theme.d.ts +1 -0
- package/components/global/theme.js +19 -4
- package/components/global/variables.css +0 -1
- package/components/global/variables.d.ts +0 -1
- package/components/global/variables_dark.css +0 -1
- package/components/header/profile.d.ts +3 -3
- package/components/input/input.css +1 -1
- package/components/input/input.d.ts +3 -1
- package/components/input/input.js +1 -1
- package/components/island/adaptive-island-hoc.d.ts +4 -8
- package/components/island/content.d.ts +33 -2
- package/components/island/content.js +5 -4
- package/components/island/island.d.ts +4 -8
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/link.d.ts +14 -22
- package/components/link/link.js +2 -2
- package/components/list/consts.d.ts +3 -1
- package/components/list/list.css +1 -0
- package/components/list/list.d.ts +2 -0
- package/components/list/list.js +12 -13
- package/components/list/list__link.js +2 -2
- package/components/login-dialog/service.js +1 -1
- package/components/message/message.css +12 -26
- package/components/message/message.js +27 -14
- package/components/popup/popup.d.ts +7 -1
- package/components/popup/popup.js +4 -3
- package/components/popup/popup.target.d.ts +1 -1
- package/components/popup/position.d.ts +1 -1
- package/components/popup/position.js +2 -2
- package/components/popup-menu/popup-menu.d.ts +1 -0
- package/components/query-assist/query-assist.d.ts +5 -9
- package/components/query-assist/query-assist.js +2 -2
- package/components/radio/radio.d.ts +1 -1
- package/components/select/select.css +4 -1
- package/components/select/select.d.ts +12 -14
- package/components/select/select.js +20 -17
- package/components/select/select__popup.d.ts +4 -1
- package/components/select/select__popup.js +4 -3
- package/components/select-ng/select-ng.js +16 -5
- package/components/select-ng/select-ng__lazy.js +19 -8
- package/components/select-ng/select-ng__lazy.test.js +3 -1
- package/components/shortcuts/shortcuts-hoc.d.ts +4 -8
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/table/disable-hover-hoc.d.ts +4 -8
- package/components/table/header.d.ts +8 -1
- package/components/table/row-with-focus-sensor.d.ts +4 -4
- package/components/table/row-with-focus-sensor.js +4 -4
- package/components/table/row.d.ts +1 -0
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/smart-table.js +7 -3
- package/components/table/table.d.ts +4 -8
- package/components/tabs/collapsible-more.js +2 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +1 -1
- package/components/tabs/custom-item.d.ts +1 -1
- package/components/tabs/dumb-tabs.d.ts +2 -2
- package/components/tabs/smart-tabs.d.ts +4 -4
- package/components/tabs/smart-tabs.js +9 -3
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tabs.css +10 -1
- package/components/tag/tag.css +1 -1
- package/components/tag/tag.js +1 -2
- package/components/tags-input/tags-input.d.ts +4 -8
- package/components/tags-list/tags-list.d.ts +1 -1
- package/components/tooltip-ng/tooltip-ng.js +13 -10
- package/components/user-agreement/service.d.ts +14 -62
- package/components/user-agreement/service.js +1 -1
- package/dist/_helpers/anchor.js +1 -1
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button-group.js +1 -1
- package/dist/_helpers/button-set.js +1 -1
- package/dist/_helpers/button-toolbar.js +1 -1
- package/dist/_helpers/button__classes.js +2 -2
- package/dist/_helpers/card.js +1 -1
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +3 -2
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +1 -1
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/group.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon.js +1 -1
- package/dist/_helpers/input.js +1 -1
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/link.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/loader-inline.js +1 -1
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +2 -1
- package/dist/_helpers/services-link.js +2 -2
- package/dist/_helpers/sidebar.js +3 -2
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +20 -8
- package/dist/_helpers/title.js +2 -1
- package/dist/alert/alert.js +15 -3
- package/dist/alert/container.js +1 -1
- package/dist/alert-service/alert-service.js +14 -1
- package/dist/analytics/analytics.js +4 -3
- package/dist/analytics/analytics__custom-plugin.js +2 -1
- package/dist/analytics/analytics__fus-plugin.js +1 -0
- package/dist/analytics/analytics__ga-plugin.d.ts +1 -1
- package/dist/analytics/analytics__ga-plugin.js +16 -7
- package/dist/analytics/analytics__plugin-utils.js +4 -3
- package/dist/analytics-ng/analytics-ng.js +3 -2
- package/dist/auth/auth.js +13 -0
- package/dist/auth/auth__core.js +29 -12
- package/dist/auth/background-flow.js +2 -1
- package/dist/auth/down-notification.js +14 -1
- package/dist/auth/iframe-flow.js +3 -0
- package/dist/auth/landing.js +17 -4
- package/dist/auth/request-builder.js +1 -0
- package/dist/auth/response-parser.js +1 -0
- package/dist/auth/storage.js +13 -0
- package/dist/auth/token-validator.js +2 -0
- package/dist/auth/window-flow.js +2 -1
- package/dist/auth-dialog/auth-dialog.js +4 -2
- package/dist/auth-dialog-service/auth-dialog-service.js +4 -1
- package/dist/auth-ng/auth-ng.js +14 -1
- package/dist/autofocus-ng/autofocus-ng.js +1 -0
- package/dist/avatar/avatar-example-datauri.js +1 -23
- package/dist/avatar/avatar.d.ts +1 -0
- package/dist/avatar/avatar.js +5 -3
- package/dist/avatar/fallback-avatar.js +6 -5
- package/dist/avatar-editor-ng/avatar-editor-ng.js +13 -0
- package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
- package/dist/avatar-ng/avatar-ng.js +3 -0
- package/dist/badge/badge.js +1 -0
- package/dist/badge-ng/badge-ng.js +2 -0
- package/dist/breadcrumb-ng/breadcrumb-ng.js +4 -28
- package/dist/button/button.d.ts +2 -1
- package/dist/button/button.js +2 -0
- package/dist/button-group-ng/button-group-ng.js +2 -1
- package/dist/button-ng/button-ng.js +5 -11
- package/dist/button-set-ng/button-set-ng.js +1 -1
- package/dist/button-toolbar-ng/button-toolbar-ng.js +1 -0
- package/dist/caret/caret.js +2 -0
- package/dist/checkbox/checkbox.js +3 -1
- package/dist/checkbox-ng/checkbox-ng.js +4 -21
- package/dist/code/code.js +4 -3
- package/dist/confirm/confirm.js +3 -1
- package/dist/confirm-ng/confirm-ng.js +3 -0
- package/dist/confirm-service/confirm-service.js +4 -1
- package/dist/content-layout/content-layout.js +1 -0
- package/dist/content-layout/sidebar.js +1 -0
- package/dist/data-list/data-list.d.ts +4 -8
- package/dist/data-list/data-list.js +3 -1
- package/dist/data-list/data-list.mock.js +1 -0
- package/dist/data-list/item.js +3 -1
- package/dist/data-list/selection.js +1 -0
- package/dist/data-list/title.js +3 -1
- package/dist/data-list-ng/data-list-ng.js +4 -1
- package/dist/date-picker/consts.js +1 -1
- package/dist/date-picker/date-input.js +4 -2
- package/dist/date-picker/date-picker.js +10 -8
- package/dist/date-picker/date-popup.js +4 -3
- package/dist/date-picker/day.js +1 -0
- package/dist/date-picker/month-names.js +1 -0
- package/dist/date-picker/month-slider.js +1 -0
- package/dist/date-picker/month.js +1 -0
- package/dist/date-picker/months.js +1 -0
- package/dist/date-picker/years.js +1 -0
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.js +2 -0
- package/dist/dialog/dialog__body-scroll-preventer.js +1 -0
- package/dist/dialog-ng/dialog-ng.js +7 -4
- package/dist/dialog-ng/dialog-ng__template.js +1 -70
- package/dist/docked-panel-ng/docked-panel-ng.js +2 -1
- package/dist/dropdown/anchor.js +2 -0
- package/dist/dropdown/dropdown.d.ts +2 -2
- package/dist/dropdown/dropdown.js +2 -0
- package/dist/dropdown-menu/dropdown-menu.js +4 -2
- package/dist/error-bubble/error-bubble.js +3 -1
- package/dist/error-message/error-message.js +3 -1
- package/dist/error-message-ng/error-message-ng.js +3 -21
- package/dist/footer/footer.js +1 -0
- package/dist/footer-ng/footer-ng.js +3 -14
- package/dist/form-ng/form-ng.js +2 -4
- package/dist/global/angular-component-factory.js +8 -6
- package/dist/global/create-stateful-context.js +3 -2
- package/dist/global/data-tests.js +2 -0
- package/dist/global/dom.js +1 -0
- package/dist/global/focus-sensor-hoc.js +1 -0
- package/dist/global/fuzzy-highlight.js +1 -1
- package/dist/global/inject-styles.js +5 -7
- package/dist/global/listeners.js +1 -0
- package/dist/global/memoize.js +2 -0
- package/dist/global/normalize-indent.js +2 -0
- package/dist/global/promise-with-timeout.d.ts +2 -1
- package/dist/global/promise-with-timeout.js +6 -2
- package/dist/global/react-dom-renderer.js +1 -0
- package/dist/global/react-render-adapter.d.ts +29 -0
- package/dist/global/react-render-adapter.js +41 -0
- package/dist/global/rerender-hoc.d.ts +5 -9
- package/dist/global/rerender-hoc.js +7 -3
- package/dist/global/theme.d.ts +1 -0
- package/dist/global/theme.js +16 -1
- package/dist/global/trivial-template-tag.js +2 -0
- package/dist/global/url.js +3 -1
- package/dist/global/variables.d.ts +0 -1
- package/dist/grid/col.js +2 -1
- package/dist/grid/grid.js +1 -0
- package/dist/grid/row.js +1 -1
- package/dist/group-ng/group-ng.js +1 -1
- package/dist/header/header.js +18 -14
- package/dist/header/logo.js +2 -0
- package/dist/header/profile.d.ts +3 -3
- package/dist/header/profile.js +3 -1
- package/dist/header/services-link.js +1 -0
- package/dist/header/services.js +2 -0
- package/dist/header/smart-profile.js +17 -13
- package/dist/header/smart-services.js +14 -11
- package/dist/header/tray-icon.js +2 -0
- package/dist/heading/heading.js +3 -3
- package/dist/http/http.js +4 -2
- package/dist/http/http.mock.js +2 -0
- package/dist/hub-source/hub-source.js +1 -1
- package/dist/hub-source/hub-source__user.js +4 -2
- package/dist/hub-source/hub-source__users-groups.js +3 -2
- package/dist/icon/icon.js +3 -3
- package/dist/icon/icon__svg.js +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon-ng/icon-ng.js +7 -5
- package/dist/input/input.d.ts +3 -1
- package/dist/input/input.js +5 -3
- package/dist/input-ng/input-ng.js +6 -59
- package/dist/island/adaptive-island-hoc.d.ts +4 -8
- package/dist/island/adaptive-island-hoc.js +4 -3
- package/dist/island/content.d.ts +33 -2
- package/dist/island/content.js +8 -4
- package/dist/island/header.js +3 -2
- package/dist/island/island.d.ts +4 -8
- package/dist/island/island.js +1 -0
- package/dist/island-ng/island-content-ng.js +2 -16
- package/dist/island-ng/island-header-ng.js +2 -8
- package/dist/island-ng/island-ng-class-fixer.js +2 -0
- package/dist/island-ng/island-ng.js +2 -8
- package/dist/link/clickableLink.d.ts +1 -1
- package/dist/link/clickableLink.js +1 -0
- package/dist/link/link.d.ts +14 -22
- package/dist/link/link.js +5 -4
- package/dist/link-ng/link-ng.js +1 -4
- package/dist/list/consts.d.ts +3 -1
- package/dist/list/list.d.ts +2 -0
- package/dist/list/list.js +30 -23
- package/dist/list/list__custom.js +1 -0
- package/dist/list/list__item.js +6 -4
- package/dist/list/list__link.js +3 -1
- package/dist/list/list__users-groups-source.js +4 -2
- package/dist/loader/loader.js +1 -0
- package/dist/loader/loader__core.js +5 -4
- package/dist/loader-inline/loader-inline.js +1 -0
- package/dist/loader-inline-ng/loader-inline-ng.js +1 -1
- package/dist/loader-ng/loader-ng.js +1 -0
- package/dist/loader-screen/loader-screen.js +1 -0
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -6
- package/dist/login-dialog/login-dialog.js +3 -1
- package/dist/login-dialog/service.js +4 -1
- package/dist/markdown/code.js +1 -0
- package/dist/markdown/link.js +1 -0
- package/dist/markdown/markdown.js +2 -1
- package/dist/message/message.js +39 -33
- package/dist/old-browsers-message/old-browsers-message.js +2 -1
- package/dist/old-browsers-message/old-browsers-message__stop.js +1 -0
- package/dist/old-browsers-message/white-list.js +1 -0
- package/dist/pager/pager.js +7 -4
- package/dist/pager-ng/pager-ng.js +5 -2
- package/dist/panel-ng/panel-ng.js +1 -0
- package/dist/permissions/permissions.js +1 -1
- package/dist/permissions-ng/permissions-ng.js +14 -1
- package/dist/place-under-ng/place-under-ng.js +3 -2
- package/dist/popup/popup.d.ts +7 -1
- package/dist/popup/popup.js +11 -7
- package/dist/popup/popup.target.d.ts +1 -1
- package/dist/popup/position.d.ts +1 -1
- package/dist/popup/position.js +3 -2
- package/dist/popup-menu/popup-menu.d.ts +1 -0
- package/dist/popup-menu/popup-menu.js +3 -1
- package/dist/progress-bar/progress-bar.js +3 -2
- package/dist/progress-bar-ng/progress-bar-ng.js +2 -0
- package/dist/promised-click-ng/promised-click-ng.js +2 -0
- package/dist/proxy-attrs/proxy-attrs.js +5 -3
- package/dist/query-assist/query-assist.d.ts +5 -9
- package/dist/query-assist/query-assist.js +9 -5
- package/dist/query-assist/query-assist__suggestions.js +3 -1
- package/dist/query-assist-ng/query-assist-ng.js +7 -3
- package/dist/radio/radio.d.ts +1 -1
- package/dist/radio/radio.js +1 -0
- package/dist/radio/radio__item.js +1 -0
- package/dist/radio-ng/radio-ng.js +2 -18
- package/dist/save-field-ng/save-field-ng.js +3 -1
- package/dist/save-field-ng/save-field-ng__template.js +1 -32
- package/dist/select/select.d.ts +12 -14
- package/dist/select/select.js +33 -22
- package/dist/select/select__filter.js +4 -2
- package/dist/select/select__popup.d.ts +4 -1
- package/dist/select/select__popup.js +9 -4
- package/dist/select-ng/select-ng.js +23 -8
- package/dist/select-ng/select-ng__lazy.js +30 -12
- package/dist/select-ng/select-ng__options.js +2 -2
- package/dist/shortcuts/shortcuts-hoc.d.ts +4 -8
- package/dist/shortcuts/shortcuts-hoc.js +4 -3
- package/dist/shortcuts/shortcuts.d.ts +1 -1
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +3 -0
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
- package/dist/shortcuts-ng/shortcuts-ng.js +4 -3
- package/dist/sidebar-ng/sidebar-ng.js +2 -0
- package/dist/sidebar-ng/sidebar-ng__button-template.js +1 -18
- package/dist/sidebar-ng/sidebar-ng__template.js +1 -10
- package/dist/storage/storage.js +13 -0
- package/dist/storage/storage__fallback.js +4 -3
- package/dist/storage/storage__local.js +13 -0
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.d.ts +1 -1
- package/dist/tab-trap/tab-trap.js +2 -1
- package/dist/table/cell.js +1 -0
- package/dist/table/disable-hover-hoc.d.ts +4 -8
- package/dist/table/disable-hover-hoc.js +4 -3
- package/dist/table/header-cell.js +2 -0
- package/dist/table/header.d.ts +8 -1
- package/dist/table/header.js +3 -1
- package/dist/table/multitable.js +1 -0
- package/dist/table/row-with-focus-sensor.d.ts +4 -4
- package/dist/table/row-with-focus-sensor.js +15 -5
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +4 -2
- package/dist/table/selection-adapter.js +2 -0
- package/dist/table/selection-shortcuts-hoc.js +1 -0
- package/dist/table/selection.js +1 -0
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +13 -7
- package/dist/table/table.d.ts +4 -8
- package/dist/table/table.js +3 -1
- package/dist/table-legacy-ng/table-legacy-ng.js +13 -47
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +6 -9
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -1
- package/dist/table-ng/smart-table-ng.js +4 -1
- package/dist/table-ng/table-ng.js +4 -1
- package/dist/tabs/collapsible-more.js +4 -2
- package/dist/tabs/collapsible-tab.js +1 -0
- package/dist/tabs/collapsible-tabs.d.ts +2 -2
- package/dist/tabs/collapsible-tabs.js +3 -1
- package/dist/tabs/custom-item.d.ts +1 -1
- package/dist/tabs/dumb-tabs.d.ts +2 -2
- package/dist/tabs/dumb-tabs.js +3 -1
- package/dist/tabs/smart-tabs.d.ts +4 -4
- package/dist/tabs/smart-tabs.js +10 -6
- package/dist/tabs/tab-link.d.ts +1 -1
- package/dist/tabs/tab-link.js +1 -0
- package/dist/tabs/tab.d.ts +1 -1
- package/dist/tabs/tab.js +1 -0
- package/dist/tabs/tabs.js +3 -1
- package/dist/tabs-ng/tabs-ng.js +1 -0
- package/dist/tabs-ng/tabs-ng__template.js +1 -38
- package/dist/tag/tag.js +4 -3
- package/dist/tags-input/tags-input.d.ts +4 -8
- package/dist/tags-input/tags-input.js +6 -3
- package/dist/tags-input-ng/tags-input-ng.js +5 -2
- package/dist/tags-list/tags-list.d.ts +1 -1
- package/dist/tags-list/tags-list.js +3 -1
- package/dist/template-ng/template-ng.js +1 -0
- package/dist/text/text.js +1 -1
- package/dist/theme-ng/theme-ng.js +1 -0
- package/dist/toggle/toggle.js +2 -1
- package/dist/toggle-ng/toggle-ng.js +2 -0
- package/dist/tooltip/tooltip.js +3 -1
- package/dist/tooltip-ng/tooltip-ng.js +12 -6
- package/dist/user-agreement/service.d.ts +14 -62
- package/dist/user-agreement/service.js +14 -8
- package/dist/user-agreement/toolbox.eula.js +1 -160
- package/dist/user-agreement/user-agreement.js +3 -1
- package/dist/user-card/card.js +2 -0
- package/dist/user-card/smart-user-card-tooltip.js +2 -0
- package/dist/user-card/tooltip.js +2 -0
- package/dist/user-card/user-card.js +2 -0
- package/dist/user-card-ng/user-card-ng.js +3 -0
- package/package.json +74 -66
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import closeIcon from '@jetbrains/icons/close';
|
|
4
|
+
import closeIcon from '@jetbrains/icons/close-12px';
|
|
5
5
|
import { refObject } from '../global/prop-types';
|
|
6
6
|
import Button from '../button/button';
|
|
7
7
|
import getUID from '../global/get-uid';
|
|
@@ -9,12 +9,10 @@ export default function adaptiveIslandHOC<P>(ComposedComponent: ComponentType<P>
|
|
|
9
9
|
};
|
|
10
10
|
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
|
11
11
|
render(): JSX.Element;
|
|
12
|
-
context:
|
|
12
|
+
context: unknown;
|
|
13
13
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
14
14
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
15
|
-
readonly props: Readonly<P
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
}>;
|
|
15
|
+
readonly props: Readonly<P>;
|
|
18
16
|
refs: {
|
|
19
17
|
[key: string]: React.ReactInstance;
|
|
20
18
|
};
|
|
@@ -37,12 +35,10 @@ export default function adaptiveIslandHOC<P>(ComposedComponent: ComponentType<P>
|
|
|
37
35
|
};
|
|
38
36
|
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
|
39
37
|
render(): JSX.Element;
|
|
40
|
-
context:
|
|
38
|
+
context: unknown;
|
|
41
39
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
42
40
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
43
|
-
readonly props: Readonly<P
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
}>;
|
|
41
|
+
readonly props: Readonly<P>;
|
|
46
42
|
refs: {
|
|
47
43
|
[key: string]: React.ReactInstance;
|
|
48
44
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import React, { Component, HTMLAttributes } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import createResizeDetector from 'element-resize-detector';
|
|
2
4
|
export interface IslandContentProps extends Omit<HTMLAttributes<HTMLElement>, 'onScroll'> {
|
|
3
5
|
fade?: boolean | null | undefined;
|
|
4
6
|
onScrollToBottom?: (() => void) | null | undefined;
|
|
@@ -8,5 +10,34 @@ export interface IslandContentInnerProps extends IslandContentProps {
|
|
|
8
10
|
onScroll: (node: HTMLElement) => void;
|
|
9
11
|
bottomBorder: boolean;
|
|
10
12
|
}
|
|
11
|
-
declare
|
|
13
|
+
declare class Content extends Component<IslandContentInnerProps> {
|
|
14
|
+
static propTypes: {
|
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
+
className: PropTypes.Requireable<string>;
|
|
17
|
+
scrollableWrapperClassName: PropTypes.Requireable<string>;
|
|
18
|
+
fade: PropTypes.Requireable<boolean>;
|
|
19
|
+
bottomBorder: PropTypes.Requireable<boolean>;
|
|
20
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
onScrollToBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
};
|
|
23
|
+
static defaultProps: {
|
|
24
|
+
fade: boolean;
|
|
25
|
+
bottomBorder: boolean;
|
|
26
|
+
onScroll: () => void;
|
|
27
|
+
onScrollToBottom: () => void;
|
|
28
|
+
};
|
|
29
|
+
state: {
|
|
30
|
+
scrolledToTop: boolean;
|
|
31
|
+
scrolledToBottom: boolean;
|
|
32
|
+
};
|
|
33
|
+
componentWillUnmount(): void;
|
|
34
|
+
resizeDetector: createResizeDetector.Erd;
|
|
35
|
+
wrapperNode?: HTMLElement | null;
|
|
36
|
+
setWrapper: (node: HTMLElement | null) => void;
|
|
37
|
+
calculateScrollPosition: () => void;
|
|
38
|
+
scrollableNode?: HTMLElement | null;
|
|
39
|
+
setScrollableNodeAndCalculatePosition: (node: HTMLElement | null) => void;
|
|
40
|
+
render(): JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
declare const ContentWrapper: React.ForwardRefExoticComponent<IslandContentProps & React.RefAttributes<Content>>;
|
|
12
43
|
export default ContentWrapper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { forwardRef, Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import createResizeDetector from 'element-resize-detector';
|
|
@@ -90,10 +90,11 @@ class Content extends Component {
|
|
|
90
90
|
</div>);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
const ContentWrapper = (props) => (<ScrollHandlerContext.Consumer>
|
|
93
|
+
const ContentWrapper = forwardRef((props, ref) => (<ScrollHandlerContext.Consumer>
|
|
94
94
|
{onScroll => {
|
|
95
95
|
const addProps = onScroll != null ? { onScroll, bottomBorder: true } : {};
|
|
96
|
-
return <Content {...props} {...addProps}/>;
|
|
96
|
+
return <Content {...props} {...addProps} ref={ref}/>;
|
|
97
97
|
}}
|
|
98
|
-
</ScrollHandlerContext.Consumer>);
|
|
98
|
+
</ScrollHandlerContext.Consumer>));
|
|
99
|
+
ContentWrapper.displayName = 'ContentWrapper';
|
|
99
100
|
export default ContentWrapper;
|
|
@@ -25,12 +25,10 @@ export declare const AdaptiveIsland: {
|
|
|
25
25
|
};
|
|
26
26
|
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
|
27
27
|
render(): JSX.Element;
|
|
28
|
-
context:
|
|
28
|
+
context: unknown;
|
|
29
29
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<IslandProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
30
30
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
31
|
-
readonly props: Readonly<IslandProps
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
}>;
|
|
31
|
+
readonly props: Readonly<IslandProps>;
|
|
34
32
|
refs: {
|
|
35
33
|
[key: string]: React.ReactInstance;
|
|
36
34
|
};
|
|
@@ -53,12 +51,10 @@ export declare const AdaptiveIsland: {
|
|
|
53
51
|
};
|
|
54
52
|
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
|
55
53
|
render(): JSX.Element;
|
|
56
|
-
context:
|
|
54
|
+
context: unknown;
|
|
57
55
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<IslandProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
58
56
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
59
|
-
readonly props: Readonly<IslandProps
|
|
60
|
-
children?: React.ReactNode;
|
|
61
|
-
}>;
|
|
57
|
+
readonly props: Readonly<IslandProps>;
|
|
62
58
|
refs: {
|
|
63
59
|
[key: string]: React.ReactInstance;
|
|
64
60
|
};
|
|
@@ -13,7 +13,7 @@ export default class ClickableLink extends PureComponent<ClickableLinkProps> {
|
|
|
13
13
|
onConditionalClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
activeClassName: PropTypes.Requireable<string>;
|
|
15
15
|
href: PropTypes.Validator<string>;
|
|
16
|
-
children: PropTypes.Validator<string | number | boolean |
|
|
16
|
+
children: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
17
17
|
};
|
|
18
18
|
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
19
19
|
render(): JSX.Element;
|
|
@@ -20,14 +20,12 @@ export interface LinkBaseProps {
|
|
|
20
20
|
export declare type LinkProps<P extends ClickableLinkProps = ClickableLinkProps> = Omit<P, keyof LinkBaseProps> & LinkBaseProps;
|
|
21
21
|
export declare function linkHOC<P extends ClickableLinkProps>(ComposedComponent: ComponentType<P> | string): {
|
|
22
22
|
new (props: LinkProps<P> | Readonly<LinkProps<P>>): {
|
|
23
|
-
getChildren(): React.
|
|
23
|
+
getChildren(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
24
24
|
render(): JSX.Element;
|
|
25
|
-
context:
|
|
25
|
+
context: unknown;
|
|
26
26
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<P>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
27
27
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
28
|
-
readonly props: Readonly<LinkProps<P
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
}>;
|
|
28
|
+
readonly props: Readonly<LinkProps<P>>;
|
|
31
29
|
state: Readonly<{}>;
|
|
32
30
|
refs: {
|
|
33
31
|
[key: string]: React.ReactInstance;
|
|
@@ -46,14 +44,12 @@ export declare function linkHOC<P extends ClickableLinkProps>(ComposedComponent:
|
|
|
46
44
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
47
45
|
};
|
|
48
46
|
new (props: LinkProps<P>, context: any): {
|
|
49
|
-
getChildren(): React.
|
|
47
|
+
getChildren(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
50
48
|
render(): JSX.Element;
|
|
51
|
-
context:
|
|
49
|
+
context: unknown;
|
|
52
50
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<P>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
53
51
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
54
|
-
readonly props: Readonly<LinkProps<P
|
|
55
|
-
children?: React.ReactNode;
|
|
56
|
-
}>;
|
|
52
|
+
readonly props: Readonly<LinkProps<P>>;
|
|
57
53
|
state: Readonly<{}>;
|
|
58
54
|
refs: {
|
|
59
55
|
[key: string]: React.ReactInstance;
|
|
@@ -78,7 +74,7 @@ export declare function linkHOC<P extends ClickableLinkProps>(ComposedComponent:
|
|
|
78
74
|
inherit: PropTypes.Requireable<boolean>;
|
|
79
75
|
pseudo: PropTypes.Requireable<boolean>;
|
|
80
76
|
hover: PropTypes.Requireable<boolean>;
|
|
81
|
-
children: PropTypes.Requireable<string | number | boolean |
|
|
77
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray | ((...args: any[]) => any)>;
|
|
82
78
|
'data-test': PropTypes.Requireable<string>;
|
|
83
79
|
href: PropTypes.Requireable<string>;
|
|
84
80
|
onPlainLeftClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -88,14 +84,12 @@ export declare function linkHOC<P extends ClickableLinkProps>(ComposedComponent:
|
|
|
88
84
|
};
|
|
89
85
|
declare const _default: {
|
|
90
86
|
new (props: LinkProps<ClickableLinkProps> | Readonly<LinkProps<ClickableLinkProps>>): {
|
|
91
|
-
getChildren(): React.
|
|
87
|
+
getChildren(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
92
88
|
render(): JSX.Element;
|
|
93
|
-
context:
|
|
89
|
+
context: unknown;
|
|
94
90
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<ClickableLinkProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
95
91
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
96
|
-
readonly props: Readonly<LinkProps<ClickableLinkProps
|
|
97
|
-
children?: React.ReactNode;
|
|
98
|
-
}>;
|
|
92
|
+
readonly props: Readonly<LinkProps<ClickableLinkProps>>;
|
|
99
93
|
state: Readonly<{}>;
|
|
100
94
|
refs: {
|
|
101
95
|
[key: string]: React.ReactInstance;
|
|
@@ -114,14 +108,12 @@ declare const _default: {
|
|
|
114
108
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
115
109
|
};
|
|
116
110
|
new (props: LinkProps<ClickableLinkProps>, context: any): {
|
|
117
|
-
getChildren(): React.
|
|
111
|
+
getChildren(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
118
112
|
render(): JSX.Element;
|
|
119
|
-
context:
|
|
113
|
+
context: unknown;
|
|
120
114
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<ClickableLinkProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
121
115
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
122
|
-
readonly props: Readonly<LinkProps<ClickableLinkProps
|
|
123
|
-
children?: React.ReactNode;
|
|
124
|
-
}>;
|
|
116
|
+
readonly props: Readonly<LinkProps<ClickableLinkProps>>;
|
|
125
117
|
state: Readonly<{}>;
|
|
126
118
|
refs: {
|
|
127
119
|
[key: string]: React.ReactInstance;
|
|
@@ -146,7 +138,7 @@ declare const _default: {
|
|
|
146
138
|
inherit: PropTypes.Requireable<boolean>;
|
|
147
139
|
pseudo: PropTypes.Requireable<boolean>;
|
|
148
140
|
hover: PropTypes.Requireable<boolean>;
|
|
149
|
-
children: PropTypes.Requireable<string | number | boolean |
|
|
141
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray | ((...args: any[]) => any)>;
|
|
150
142
|
'data-test': PropTypes.Requireable<string>;
|
|
151
143
|
href: PropTypes.Requireable<string>;
|
|
152
144
|
onPlainLeftClick: PropTypes.Requireable<(...args: any[]) => any>;
|
package/components/link/link.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'focus-visible';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { PureComponent, memo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import memoize from '../global/memoize';
|
|
@@ -26,7 +26,7 @@ const makeWrapText = memoize((innerClassName) => {
|
|
|
26
26
|
});
|
|
27
27
|
export function linkHOC(ComposedComponent) {
|
|
28
28
|
const isCustom = typeof ComposedComponent !== 'string' && ComposedComponent !== ClickableLink;
|
|
29
|
-
return class Link extends
|
|
29
|
+
return class Link extends PureComponent {
|
|
30
30
|
static propTypes = {
|
|
31
31
|
className: PropTypes.string,
|
|
32
32
|
innerClassName: PropTypes.string,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ComponentType, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import { LinkProps } from '../link/link';
|
|
3
3
|
import { IconType, Size } from '../icon/icon';
|
|
4
|
+
import { ClickableLinkProps } from '../link/clickableLink';
|
|
4
5
|
/**
|
|
5
6
|
* @enum {number}
|
|
6
7
|
*/
|
|
@@ -52,8 +53,9 @@ export declare type ListDataItem<T = unknown> = T & Partial<Omit<LinkProps, 'onC
|
|
|
52
53
|
tagName?: keyof JSX.IntrinsicElements | null | undefined;
|
|
53
54
|
selectedLabel?: string | null | undefined;
|
|
54
55
|
originalModel?: never;
|
|
55
|
-
LinkComponent?: ComponentType<
|
|
56
|
+
LinkComponent?: ComponentType<ClickableLinkProps> | string | null | undefined;
|
|
56
57
|
template?: ReactNode | ((props: ListDataItemProps<T>) => ReactNode);
|
|
58
|
+
custom?: boolean | null | undefined;
|
|
57
59
|
onClick?: ((item: ListDataItem<T>, event: Event | SyntheticEvent) => void) | null | undefined;
|
|
58
60
|
onMouseUp?: ((item: ListDataItem<T>, event: Event | SyntheticEvent) => void) | null | undefined;
|
|
59
61
|
};
|
package/components/list/list.css
CHANGED
|
@@ -136,6 +136,8 @@ export default class List<T = unknown> extends Component<ListProps<T>, ListState
|
|
|
136
136
|
shouldComponentUpdate(nextProps: ListProps<T>, nextState: ListState<T>): boolean;
|
|
137
137
|
componentDidUpdate(prevProps: ListProps<T>): void;
|
|
138
138
|
componentWillUnmount(): void;
|
|
139
|
+
scheduleScrollListener: (cb: () => void) => void;
|
|
140
|
+
scheduleHoverListener: (cb: () => void) => void;
|
|
139
141
|
static isItemType: typeof isItemType;
|
|
140
142
|
static ListHint: typeof ListHint;
|
|
141
143
|
static ListProps: {
|
package/components/list/list.js
CHANGED
|
@@ -25,8 +25,6 @@ import ListSeparator from './list__separator';
|
|
|
25
25
|
import ListHint from './list__hint';
|
|
26
26
|
import { DEFAULT_ITEM_TYPE, Dimension, Type } from './consts';
|
|
27
27
|
import styles from './list.css';
|
|
28
|
-
const scheduleScrollListener = scheduleRAF();
|
|
29
|
-
const scheduleHoverListener = scheduleRAF();
|
|
30
28
|
function noop() { }
|
|
31
29
|
const warnEmptyKey = deprecate(() => { }, 'No key passed for list item with non-string label. It is considered as a bad practice and has been deprecated, please provide a key.');
|
|
32
30
|
/**
|
|
@@ -141,23 +139,22 @@ export default class List extends Component {
|
|
|
141
139
|
});
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
return nextState;
|
|
143
|
+
}
|
|
144
|
+
componentDidMount() {
|
|
145
|
+
document.addEventListener('mousemove', this.onDocumentMouseMove);
|
|
146
|
+
document.addEventListener('keydown', this.onDocumentKeyDown, true);
|
|
147
|
+
const { data, activeIndex } = this.props;
|
|
148
|
+
if (activeIndex == null && shouldActivateFirstItem(this.props)) {
|
|
147
149
|
const firstActivatableIndex = data.findIndex(isActivatable);
|
|
148
150
|
if (firstActivatableIndex >= 0) {
|
|
149
|
-
|
|
151
|
+
this.setState({
|
|
150
152
|
activeIndex: firstActivatableIndex,
|
|
151
153
|
activeItem: data[firstActivatableIndex],
|
|
152
154
|
needScrollToActive: true
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
|
-
return nextState;
|
|
157
|
-
}
|
|
158
|
-
componentDidMount() {
|
|
159
|
-
document.addEventListener('mousemove', this.onDocumentMouseMove);
|
|
160
|
-
document.addEventListener('keydown', this.onDocumentKeyDown, true);
|
|
161
158
|
}
|
|
162
159
|
shouldComponentUpdate(nextProps, nextState) {
|
|
163
160
|
return nextProps !== this.props ||
|
|
@@ -175,6 +172,8 @@ export default class List extends Component {
|
|
|
175
172
|
document.removeEventListener('mousemove', this.onDocumentMouseMove);
|
|
176
173
|
document.removeEventListener('keydown', this.onDocumentKeyDown, true);
|
|
177
174
|
}
|
|
175
|
+
scheduleScrollListener = scheduleRAF();
|
|
176
|
+
scheduleHoverListener = scheduleRAF();
|
|
178
177
|
static isItemType = isItemType;
|
|
179
178
|
static ListHint = ListHint;
|
|
180
179
|
static ListProps = {
|
|
@@ -184,7 +183,7 @@ export default class List extends Component {
|
|
|
184
183
|
virtualizedList;
|
|
185
184
|
unmounted;
|
|
186
185
|
container;
|
|
187
|
-
hoverHandler = memoize((index) => () => scheduleHoverListener(() => {
|
|
186
|
+
hoverHandler = memoize((index) => () => this.scheduleHoverListener(() => {
|
|
188
187
|
if (this.state.disabledHover) {
|
|
189
188
|
return;
|
|
190
189
|
}
|
|
@@ -367,7 +366,7 @@ export default class List extends Component {
|
|
|
367
366
|
defaultItemHeight() {
|
|
368
367
|
return this.props.compact ? Dimension.COMPACT_ITEM_HEIGHT : Dimension.ITEM_HEIGHT;
|
|
369
368
|
}
|
|
370
|
-
scrollEndHandler = () => scheduleScrollListener(() => {
|
|
369
|
+
scrollEndHandler = () => this.scheduleScrollListener(() => {
|
|
371
370
|
const innerContainer = this.inner;
|
|
372
371
|
if (innerContainer) {
|
|
373
372
|
const maxScrollingPosition = innerContainer.scrollHeight;
|
|
@@ -10,7 +10,7 @@ import styles from './list.css';
|
|
|
10
10
|
*/
|
|
11
11
|
export default class ListLink extends PureComponent {
|
|
12
12
|
render() {
|
|
13
|
-
const { scrolling, 'data-test': dataTest, className, label, hover, description, rgItemType, url, onCheckboxChange, disabled, LinkComponent, compact, hoverClassName, ...restProps } = this.props;
|
|
13
|
+
const { scrolling, 'data-test': dataTest, className, label, hover, description, rgItemType, url, onCheckboxChange, disabled, LinkComponent, compact, hoverClassName, children, ...restProps } = this.props;
|
|
14
14
|
const classes = classNames(styles.item, className, {
|
|
15
15
|
[styles.actionLink]: !disabled,
|
|
16
16
|
[styles.compact]: compact,
|
|
@@ -18,7 +18,7 @@ export default class ListLink extends PureComponent {
|
|
|
18
18
|
});
|
|
19
19
|
const Comp = LinkComponent ? linkHOC(LinkComponent) : Link;
|
|
20
20
|
return (<Comp pseudo={!this.props.href} {...restProps} hover={hover && !disabled} className={classes} data-test={dataTests('ring-list-link', dataTest)}>
|
|
21
|
-
{label}
|
|
21
|
+
{label ?? children}
|
|
22
22
|
</Comp>);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, unmountComponentAtNode } from 'react-
|
|
2
|
+
import { render, unmountComponentAtNode } from '../global/react-render-adapter';
|
|
3
3
|
import LoginDialog from './login-dialog';
|
|
4
4
|
const containerElement = document.createElement('div');
|
|
5
5
|
/**
|
|
@@ -18,26 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
color: var(--ring-active-text-color);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
background-color: var(--ring-message-background-color);
|
|
24
|
-
|
|
25
|
-
box-shadow: none;
|
|
26
|
-
|
|
27
|
-
&::before {
|
|
28
|
-
position: absolute;
|
|
29
|
-
z-index: var(--ring-invisible-element-z-index);
|
|
30
|
-
top: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
|
|
35
|
-
content: "";
|
|
36
|
-
|
|
37
|
-
border-radius: var(--ring-border-radius);
|
|
38
|
-
|
|
39
|
-
box-shadow: var(--ring-popup-shadow);
|
|
40
|
-
}
|
|
21
|
+
background-color: var(--ring-popup-background-color);
|
|
41
22
|
}
|
|
42
23
|
|
|
43
24
|
.icon {
|
|
@@ -55,11 +36,12 @@
|
|
|
55
36
|
}
|
|
56
37
|
|
|
57
38
|
.description {
|
|
58
|
-
composes: font-smaller-lower from "../global/global.css";
|
|
59
|
-
|
|
60
39
|
margin: calc(unit / 2) 0 0;
|
|
61
40
|
|
|
62
41
|
color: var(--ring-text-color);
|
|
42
|
+
|
|
43
|
+
font-size: var(--ring-font-size-smaller);
|
|
44
|
+
line-height: var(--ring-line-height-lowest);
|
|
63
45
|
}
|
|
64
46
|
|
|
65
47
|
.button {
|
|
@@ -69,10 +51,14 @@
|
|
|
69
51
|
.tail {
|
|
70
52
|
position: absolute;
|
|
71
53
|
|
|
72
|
-
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
width: 11px;
|
|
56
|
+
height: 11px;
|
|
57
|
+
|
|
58
|
+
transform-origin: 0 0;
|
|
73
59
|
|
|
74
|
-
border
|
|
75
|
-
border-
|
|
60
|
+
border: 1px solid;
|
|
61
|
+
border-color: transparent transparent var(--ring-popup-border-color) var(--ring-popup-border-color);
|
|
76
62
|
|
|
77
|
-
|
|
63
|
+
background-color: var(--ring-popup-background-color);
|
|
78
64
|
}
|
|
@@ -13,19 +13,32 @@ import styles from './message.css';
|
|
|
13
13
|
* @name Message
|
|
14
14
|
*/
|
|
15
15
|
const UNIT = 8;
|
|
16
|
+
const TAIL_SIZE = 11;
|
|
16
17
|
const getTailOffsets = (offset) => ({
|
|
17
|
-
[Directions.BOTTOM_RIGHT]: { top: 0, left: offset
|
|
18
|
-
[Directions.BOTTOM_LEFT]: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[Directions.
|
|
24
|
-
[Directions.
|
|
25
|
-
[Directions.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
[Directions.BOTTOM_RIGHT]: { top: 0, left: offset + UNIT, transform: 'rotate(135deg)' },
|
|
19
|
+
[Directions.BOTTOM_LEFT]: {
|
|
20
|
+
top: 0,
|
|
21
|
+
right: offset - UNIT - TAIL_SIZE,
|
|
22
|
+
transform: 'rotate(135deg)'
|
|
23
|
+
},
|
|
24
|
+
[Directions.BOTTOM_CENTER]: { top: 0, left: offset + UNIT, transform: 'rotate(135deg)' },
|
|
25
|
+
[Directions.TOP_RIGHT]: { bottom: -TAIL_SIZE, left: offset - UNIT, transform: 'rotate(-45deg)' },
|
|
26
|
+
[Directions.TOP_LEFT]: {
|
|
27
|
+
bottom: -TAIL_SIZE,
|
|
28
|
+
right: offset + UNIT - TAIL_SIZE,
|
|
29
|
+
transform: 'rotate(-45deg)'
|
|
30
|
+
},
|
|
31
|
+
[Directions.TOP_CENTER]: { bottom: -TAIL_SIZE, left: offset - UNIT, transform: 'rotate(-45deg)' },
|
|
32
|
+
[Directions.RIGHT_TOP]: { bottom: offset + UNIT - TAIL_SIZE, left: 0, transform: 'rotate(45deg)' },
|
|
33
|
+
[Directions.RIGHT_BOTTOM]: { top: offset - UNIT, left: 0, transform: 'rotate(45deg)' },
|
|
34
|
+
[Directions.RIGHT_CENTER]: { top: offset - UNIT, left: 0, transform: 'rotate(45deg)' },
|
|
35
|
+
[Directions.LEFT_TOP]: {
|
|
36
|
+
bottom: offset - UNIT - TAIL_SIZE,
|
|
37
|
+
right: -TAIL_SIZE,
|
|
38
|
+
transform: 'rotate(-135deg)'
|
|
39
|
+
},
|
|
40
|
+
[Directions.LEFT_BOTTOM]: { top: offset + UNIT, right: -TAIL_SIZE, transform: 'rotate(-135deg)' },
|
|
41
|
+
[Directions.LEFT_CENTER]: { top: offset + UNIT, right: -TAIL_SIZE, transform: 'rotate(-135deg)' }
|
|
29
42
|
});
|
|
30
43
|
/**
|
|
31
44
|
* Displays a popup containing a message.
|
|
@@ -88,7 +101,7 @@ export default class Message extends Component {
|
|
|
88
101
|
{direction && (<div className={tailClasses} style={getTailOffsets(this.getTailOffset())[direction]}/>)}
|
|
89
102
|
|
|
90
103
|
{icon && <Icon className={styles.icon} glyph={icon}/>}
|
|
91
|
-
<h1 data-test="rgMessageTitle" className={styles.title}>{title}</h1>
|
|
104
|
+
{title && <h1 data-test="rgMessageTitle" className={styles.title}>{title}</h1>}
|
|
92
105
|
{children && <div className={styles.description}>{children}</div>}
|
|
93
106
|
{(onClose || buttonProps) && (<Button className={styles.button} onClick={onClose} primary {...buttonProps}>{translations.gotIt}</Button>)}
|
|
94
107
|
{onDismiss && <Button onClick={onDismiss} text>{translations.dismiss}</Button>}
|
|
@@ -100,7 +113,7 @@ Message.propTypes = {
|
|
|
100
113
|
children: PropTypes.node,
|
|
101
114
|
className: PropTypes.string,
|
|
102
115
|
tailClassName: PropTypes.string,
|
|
103
|
-
title: PropTypes.string
|
|
116
|
+
title: PropTypes.string,
|
|
104
117
|
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
105
118
|
directions: PropTypes.arrayOf(PropTypes.string),
|
|
106
119
|
direction: PropTypes.string,
|
|
@@ -18,6 +18,7 @@ export interface BasePopupProps {
|
|
|
18
18
|
keepMounted: boolean;
|
|
19
19
|
directions: readonly Directions[];
|
|
20
20
|
autoPositioning: boolean;
|
|
21
|
+
autoPositioningOnScroll: boolean;
|
|
21
22
|
autoCorrectTopOverflow: boolean;
|
|
22
23
|
left: number;
|
|
23
24
|
top: number;
|
|
@@ -27,6 +28,8 @@ export interface BasePopupProps {
|
|
|
27
28
|
autoFocusFirst: boolean;
|
|
28
29
|
offset: number;
|
|
29
30
|
legacy: boolean;
|
|
31
|
+
withTail?: boolean;
|
|
32
|
+
tailOffset?: number;
|
|
30
33
|
anchorElement?: HTMLElement | null | undefined;
|
|
31
34
|
target?: string | Element | null | undefined;
|
|
32
35
|
className?: string | null | undefined;
|
|
@@ -42,6 +45,7 @@ export interface BasePopupProps {
|
|
|
42
45
|
onContextMenu?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
43
46
|
onDirectionChange?: ((direction: Directions) => void) | null | undefined;
|
|
44
47
|
onShow?: (() => void) | null | undefined;
|
|
48
|
+
children?: ReactNode;
|
|
45
49
|
}
|
|
46
50
|
export interface PopupProps extends BasePopupProps {
|
|
47
51
|
children: ReactNode;
|
|
@@ -67,6 +71,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
67
71
|
keepMounted: boolean;
|
|
68
72
|
directions: Directions[];
|
|
69
73
|
autoPositioning: boolean;
|
|
74
|
+
autoPositioningOnScroll: boolean;
|
|
70
75
|
autoCorrectTopOverflow: boolean;
|
|
71
76
|
left: number;
|
|
72
77
|
top: number;
|
|
@@ -131,7 +136,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
131
136
|
* @private
|
|
132
137
|
*/
|
|
133
138
|
private _onDocumentClick;
|
|
134
|
-
getInternalContent():
|
|
139
|
+
getInternalContent(): JSX.Element | P["children"] | undefined;
|
|
135
140
|
shortcutsScope: string;
|
|
136
141
|
shortcutsMap: {
|
|
137
142
|
esc: (evt: KeyboardEvent) => void;
|
|
@@ -139,3 +144,4 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
|
139
144
|
render(): JSX.Element;
|
|
140
145
|
}
|
|
141
146
|
export declare type PopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
|
|
147
|
+
export declare type BasePopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
|
|
@@ -34,6 +34,7 @@ export default class Popup extends PureComponent {
|
|
|
34
34
|
keepMounted: false,
|
|
35
35
|
directions: DEFAULT_DIRECTIONS,
|
|
36
36
|
autoPositioning: true,
|
|
37
|
+
autoPositioningOnScroll: true,
|
|
37
38
|
autoCorrectTopOverflow: true,
|
|
38
39
|
left: 0,
|
|
39
40
|
top: 0,
|
|
@@ -49,7 +50,6 @@ export default class Popup extends PureComponent {
|
|
|
49
50
|
};
|
|
50
51
|
componentDidMount() {
|
|
51
52
|
if (!this.props.client) {
|
|
52
|
-
// eslint-disable-next-line react/no-did-mount-set-state
|
|
53
53
|
this.setState({ client: true });
|
|
54
54
|
}
|
|
55
55
|
if (!this.props.hidden) {
|
|
@@ -73,7 +73,6 @@ export default class Popup extends PureComponent {
|
|
|
73
73
|
}
|
|
74
74
|
componentWillUnmount() {
|
|
75
75
|
this._setListenersEnabled(false);
|
|
76
|
-
this.popup = null;
|
|
77
76
|
}
|
|
78
77
|
popup;
|
|
79
78
|
node;
|
|
@@ -183,7 +182,9 @@ export default class Popup extends PureComponent {
|
|
|
183
182
|
setTimeout(() => {
|
|
184
183
|
this._listenersEnabled = true;
|
|
185
184
|
this.listeners.add(window, 'resize', this._redraw);
|
|
186
|
-
this.
|
|
185
|
+
if (this.props.autoPositioningOnScroll) {
|
|
186
|
+
this.listeners.add(window, 'scroll', this._redraw);
|
|
187
|
+
}
|
|
187
188
|
this.listeners.add(document, 'pointerdown', this._onDocumentClick, true);
|
|
188
189
|
let el = this._getAnchor();
|
|
189
190
|
while (el) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export declare const PopupTargetContext: React.Context<string | undefined>;
|
|
2
|
+
export declare const PopupTargetContext: React.Context<string | Element | undefined>;
|
|
3
3
|
export interface PopupTargetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
4
|
id: string;
|
|
5
5
|
children: ReactNode | ((target: ReactNode) => ReactNode);
|
|
@@ -9,7 +9,7 @@ export interface PositionStyles extends Position {
|
|
|
9
9
|
minWidth?: number;
|
|
10
10
|
}
|
|
11
11
|
export interface PositionAttrs {
|
|
12
|
-
popup:
|
|
12
|
+
popup: HTMLElement | null | undefined;
|
|
13
13
|
anchor: Element | null | undefined;
|
|
14
14
|
container: Element | null;
|
|
15
15
|
directions: readonly Directions[];
|
|
@@ -14,8 +14,8 @@ function getScrollingCoordinates(container) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
function getPositionStyles(popup, anchorRect, anchorLeft, anchorTop, offset) {
|
|
17
|
-
const popupWidth = popup.
|
|
18
|
-
const popupHeight = popup.
|
|
17
|
+
const popupWidth = popup.offsetWidth;
|
|
18
|
+
const popupHeight = popup.offsetHeight;
|
|
19
19
|
const anchorBottom = anchorTop + anchorRect.height;
|
|
20
20
|
const anchorRight = anchorLeft + anchorRect.width;
|
|
21
21
|
const popupLeft = anchorLeft - popupWidth;
|
|
@@ -26,6 +26,7 @@ export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
|
|
|
26
26
|
keepMounted: boolean;
|
|
27
27
|
directions: import("../popup/popup.consts").Directions[];
|
|
28
28
|
autoPositioning: boolean;
|
|
29
|
+
autoPositioningOnScroll: boolean;
|
|
29
30
|
autoCorrectTopOverflow: boolean;
|
|
30
31
|
left: number;
|
|
31
32
|
top: number;
|