@jetbrains/ring-ui 7.0.62 → 7.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alert/alert.css +1 -1
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +3 -3
- package/components/alert/container.css +2 -2
- package/components/alert/container.d.ts +1 -1
- package/components/alert/container.js +1 -1
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/analytics/{analytics__custom-plugin.d.ts → analytics-custom-plugin.d.ts} +1 -1
- package/components/analytics/{analytics__custom-plugin.js → analytics-custom-plugin.js} +2 -2
- package/components/auth/{auth__core.d.ts → auth-core.d.ts} +9 -8
- package/components/auth/{auth__core.js → auth-core.js} +14 -18
- package/components/auth/auth.d.ts +2 -2
- package/components/auth/auth.js +2 -2
- package/components/auth/background-flow.d.ts +2 -2
- package/components/auth/background-flow.js +0 -1
- package/components/auth/down-notification.css +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.d.ts +3 -3
- package/components/auth/iframe-flow.js +3 -5
- package/components/auth/request-builder.d.ts +2 -1
- package/components/auth/request-builder.js +1 -2
- package/components/auth/storage.d.ts +3 -3
- package/components/auth/storage.js +4 -8
- package/components/auth/token-validator.d.ts +2 -1
- package/components/auth/token-validator.js +6 -1
- package/components/auth/window-flow.d.ts +3 -3
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.css +2 -2
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
- package/components/avatar/avatar-info.d.ts +1 -1
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.figma.js +1 -1
- package/components/avatar/avatar.js +5 -7
- package/components/avatar/fallback-avatar.js +4 -8
- package/components/avatar-stack/avatar-stack.css +1 -1
- package/components/avatar-stack/avatar-stack.d.ts +3 -3
- package/components/avatar-stack/avatar-stack.figma.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.css +2 -2
- package/components/banner/banner.js +1 -1
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.figma.js +1 -1
- package/components/button/{button__classes.d.ts → button.classes.d.ts} +1 -1
- package/components/button/button.css +19 -16
- package/components/button/button.d.ts +4 -4
- package/components/button/button.figma.js +1 -1
- package/components/button/button.js +6 -6
- package/components/button-group/button-group.css +6 -6
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-set/button-set.css +2 -2
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.css +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/caret/caret.js +23 -18
- package/components/checkbox/checkbox-group.figma.js +1 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.figma.js +1 -1
- package/components/checkbox/checkbox.js +5 -5
- package/components/clipboard/clipboard.js +2 -2
- package/components/code/code.css +1 -1
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -3
- package/components/collapse/collapse-content.d.ts +3 -3
- package/components/collapse/collapse-control.d.ts +2 -2
- package/components/collapse/collapse.css +1 -1
- package/components/collapse/collapse.d.ts +3 -3
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.d.ts +3 -3
- package/components/content-layout/content-layout.css +2 -2
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +2 -2
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/contenteditable/contenteditable.js +2 -1
- package/components/control-help/control-help.css +1 -1
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-label/control-label.d.ts +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/data-list/data-list.d.ts +5 -5
- package/components/data-list/data-list.js +2 -2
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/data-list.mock.js +20 -20
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/item.js +2 -2
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +8 -1
- package/components/data-list/title.d.ts +2 -2
- package/components/date-picker/consts.d.ts +1 -1
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +2 -2
- package/components/date-picker/date-picker.css +15 -15
- package/components/date-picker/date-picker.d.ts +5 -5
- package/components/date-picker/date-picker.js +17 -19
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +5 -3
- package/components/date-picker/day.d.ts +2 -2
- package/components/date-picker/day.js +4 -5
- package/components/date-picker/formats.js +1 -0
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +2 -2
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +2 -2
- package/components/dialog/{dialog__body-scroll-preventer.js → dialog-body-scroll-preventer.js} +6 -2
- package/components/dialog/dialog.css +5 -5
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +7 -7
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/dropdown.css +1 -1
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +2 -2
- package/components/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/components/dropdown-menu/dropdown-menu.js +1 -1
- package/components/editable-heading/editable-heading.css +6 -8
- package/components/editable-heading/editable-heading.d.ts +1 -1
- package/components/editable-heading/editable-heading.js +3 -2
- package/components/error-bubble/error-bubble-legacy.css +3 -3
- package/components/error-bubble/error-bubble.css +5 -5
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.figma.js +1 -1
- package/components/error-bubble/error-bubble.js +2 -2
- package/components/error-message/error-message.css +1 -1
- package/components/error-message/error-message.d.ts +2 -2
- package/components/error-message/error-message.js +2 -2
- package/components/error-page/error-page.css +3 -3
- package/components/footer/footer.css +2 -2
- package/components/footer/footer.d.ts +1 -1
- package/components/footer/footer.js +1 -1
- package/components/form/form.css +3 -3
- package/components/global/compose-refs.d.ts +2 -0
- package/components/global/compose-refs.js +14 -0
- package/components/global/composeRefs.d.ts +6 -2
- package/components/global/composeRefs.js +7 -14
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/dom.d.ts +1 -1
- package/components/global/dom.js +2 -4
- package/components/global/focus-sensor-hoc.d.ts +1 -1
- package/components/global/focus-sensor-hoc.js +2 -2
- package/components/global/fuzzy-highlight.d.ts +2 -2
- package/components/global/get-event-key.d.ts +1 -1
- package/components/global/global.css +2 -2
- package/components/global/memoize.js +1 -1
- package/components/global/rerender-hoc.d.ts +1 -1
- package/components/global/rerender-hoc.js +2 -2
- package/components/global/theme.d.ts +1 -1
- package/components/global/theme.js +2 -2
- package/components/global/url.js +3 -3
- package/components/global/use-event-callback.js +1 -1
- package/components/global/variables.css +1 -1
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +1 -1
- package/components/grid/grid.css +4 -4
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +1 -1
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +1 -1
- package/components/group/group.css +1 -1
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +1 -1
- package/components/header/header-icon.d.ts +2 -2
- package/components/header/header.css +4 -4
- package/components/header/header.d.ts +1 -1
- package/components/header/links.d.ts +1 -1
- package/components/header/logo.d.ts +1 -1
- package/components/header/profile.d.ts +5 -5
- package/components/header/profile.js +3 -3
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +3 -3
- package/components/header/services.css +1 -1
- package/components/header/services.d.ts +2 -2
- package/components/header/services.js +3 -3
- package/components/header/smart-profile.d.ts +3 -3
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.d.ts +3 -3
- package/components/header/tray.d.ts +1 -1
- package/components/heading/heading.css +2 -2
- package/components/heading/heading.d.ts +1 -1
- package/components/http/http.mock.d.ts +1 -1
- package/components/hub-source/{hub-source__user.d.ts → hub-source-user.d.ts} +3 -2
- package/components/hub-source/{hub-source__users-groups.d.ts → hub-source-users-groups.d.ts} +3 -2
- package/components/hub-source/hub-source.d.ts +2 -2
- package/components/icon/{icon__svg.d.ts → icon-svg.d.ts} +1 -1
- package/components/icon/icon.css +5 -5
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +3 -3
- package/components/input/input-legacy.css +2 -2
- package/components/input/input.css +5 -5
- package/components/input/input.d.ts +3 -3
- package/components/input/input.figma.js +1 -1
- package/components/input/input.js +8 -8
- package/components/input-size/input-size.css +1 -1
- package/components/island/adaptive-island-hoc.d.ts +1 -1
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +2 -2
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +4 -4
- package/components/island/island.css +3 -3
- package/components/island/island.d.ts +1 -1
- package/components/line/line.css +1 -1
- package/components/link/clickable-link.d.ts +12 -0
- package/components/link/clickable-link.js +25 -0
- package/components/link/clickableLink.d.ts +11 -12
- package/components/link/clickableLink.js +4 -25
- package/components/link/link.css +1 -1
- package/components/link/link.d.ts +2 -2
- package/components/link/link.js +4 -4
- package/components/list/consts.d.ts +4 -5
- package/components/list/{list__custom.d.ts → list-custom.d.ts} +1 -1
- package/components/list/{list__custom.js → list-custom.js} +1 -1
- package/components/list/{list__hint.d.ts → list-hint.d.ts} +1 -1
- package/components/list/{list__hint.js → list-hint.js} +1 -1
- package/components/list/{list__item.d.ts → list-item.d.ts} +2 -2
- package/components/list/{list__item.js → list-item.js} +6 -5
- package/components/list/{list__separator.d.ts → list-separator.d.ts} +1 -1
- package/components/list/{list__separator.js → list-separator.js} +1 -1
- package/components/list/{list__title.d.ts → list-title.d.ts} +1 -1
- package/components/list/{list__title.js → list-title.js} +1 -1
- package/components/list/{list__users-groups-source.d.ts → list-users-groups-source.d.ts} +3 -2
- package/components/list/{list__users-groups-source.js → list-users-groups-source.js} +1 -1
- package/components/list/{list__classes.d.ts → list.classes.d.ts} +1 -1
- package/components/list/list.css +5 -5
- package/components/list/list.d.ts +7 -7
- package/components/list/list.js +34 -28
- package/components/loader/{loader__core.js → loader-core.js} +2 -2
- package/components/loader/loader.css +1 -1
- package/components/loader/loader.d.ts +2 -2
- package/components/loader/loader.js +1 -1
- package/components/loader-inline/loader-inline.css +2 -2
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-screen/loader-screen.css +2 -2
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/login-dialog/login-dialog.css +2 -2
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.d.ts +1 -1
- package/components/markdown/markdown.css +3 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +1 -1
- package/components/message/message.css +3 -3
- package/components/message/message.d.ts +4 -4
- package/components/message/message.js +3 -3
- package/components/old-browsers-message/old-browsers-message.css +2 -2
- package/components/old-browsers-message/old-browsers-message.js +1 -1
- package/components/pager/pager.css +1 -1
- package/components/pager/pager.d.ts +2 -2
- package/components/pager/pager.js +11 -12
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +1 -1
- package/components/permissions/{permissions__cache.js → permissions-cache.js} +4 -5
- package/components/permissions/permissions.d.ts +2 -2
- package/components/permissions/permissions.js +2 -4
- package/components/popup/popup.css +3 -3
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +6 -5
- package/components/popup/popup.target.d.ts +1 -1
- package/components/popup/position-css.js +6 -10
- package/components/popup/position.js +10 -10
- package/components/popup-menu/popup-menu.d.ts +4 -4
- package/components/progress-bar/progress-bar.css +6 -8
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +1 -1
- package/components/query-assist/{query-assist__suggestions.d.ts → query-assist-suggestions.d.ts} +1 -1
- package/components/query-assist/query-assist.css +11 -11
- package/components/query-assist/query-assist.d.ts +4 -4
- package/components/query-assist/query-assist.js +11 -11
- package/components/radio/{radio__item.d.ts → radio-item.d.ts} +1 -1
- package/components/radio/{radio__item.js → radio-item.js} +2 -2
- package/components/radio/radio.css +2 -2
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +1 -1
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/{select__filter.d.ts → select-filter.d.ts} +2 -2
- package/components/select/{select__filter.js → select-filter.js} +1 -1
- package/components/select/select-popup.css +5 -5
- package/components/select/{select__popup.d.ts → select-popup.d.ts} +8 -8
- package/components/select/{select__popup.js → select-popup.js} +11 -7
- package/components/select/select.css +10 -9
- package/components/select/select.d.ts +6 -6
- package/components/select/select.js +27 -25
- package/components/shortcuts/core.js +7 -7
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/sidebar/sidebar.css +1 -1
- package/components/slider/slider.css +2 -2
- package/components/slider/slider.d.ts +5 -5
- package/components/slider/slider.js +5 -5
- package/components/slider/slider.utils.d.ts +1 -1
- package/components/slider/slider.utils.js +2 -4
- package/components/storage/{storage__local.d.ts → storage-local.d.ts} +1 -1
- package/components/storage/{storage__local.js → storage-local.js} +7 -7
- package/components/storage/storage.d.ts +1 -1
- package/components/storage/storage.js +1 -1
- package/components/tab-trap/tab-trap.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/tab-trap/tab-trap.js +2 -5
- package/components/table/cell.d.ts +1 -1
- package/components/table/disable-hover-hoc.d.ts +1 -1
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +1 -1
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +2 -2
- package/components/table/multitable.d.ts +3 -3
- package/components/table/multitable.js +1 -1
- package/components/table/row-with-focus-sensor.d.ts +3 -3
- package/components/table/row.d.ts +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-adapter.d.ts +2 -1
- package/components/table/selection-shortcuts-hoc.d.ts +4 -3
- package/components/table/selection-shortcuts-hoc.js +1 -3
- package/components/table/selection.js +4 -8
- package/components/table/simple-table.d.ts +2 -2
- package/components/table/smart-table.d.ts +2 -2
- package/components/table/table.css +6 -6
- package/components/table/table.d.ts +7 -7
- package/components/table/table.js +3 -3
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +2 -2
- package/components/tabs/collapsible-tab.d.ts +2 -2
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +6 -8
- package/components/tabs/custom-item.d.ts +2 -2
- package/components/tabs/dumb-tabs.d.ts +3 -3
- package/components/tabs/dumb-tabs.js +3 -3
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/tab-link.d.ts +2 -2
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tabs.css +6 -6
- package/components/tag/tag.css +5 -5
- package/components/tag/tag.d.ts +2 -2
- package/components/tag/tag.js +2 -2
- package/components/tags-input/tags-input.css +3 -3
- package/components/tags-input/tags-input.d.ts +8 -8
- package/components/tags-input/tags-input.js +13 -7
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +1 -1
- package/components/text/text.css +1 -1
- package/components/text/text.d.ts +1 -1
- package/components/toggle/toggle.css +2 -2
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.d.ts +2 -2
- package/components/tooltip/tooltip.js +1 -1
- package/components/upload/upload.css +1 -1
- package/components/upload/upload.d.ts +3 -3
- package/components/upload/upload.js +2 -2
- package/components/user-agreement/service.d.ts +2 -2
- package/components/user-agreement/service.js +3 -5
- package/components/user-agreement/user-agreement.css +2 -2
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +3 -2
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.d.ts +3 -3
- package/components/user-card/user-card.css +1 -1
- package/package.json +4 -1
- /package/components/button/{button__classes.js → button.classes.js} +0 -0
- /package/components/dialog/{dialog__body-scroll-preventer.d.ts → dialog-body-scroll-preventer.d.ts} +0 -0
- /package/components/global/{variables.d.ts → variables.interface.d.ts} +0 -0
- /package/components/global/{variables.js → variables.interface.js} +0 -0
- /package/components/hub-source/{hub-source__user.js → hub-source-user.js} +0 -0
- /package/components/hub-source/{hub-source__users-groups.js → hub-source-users-groups.js} +0 -0
- /package/components/icon/{icon__svg.js → icon-svg.js} +0 -0
- /package/components/icon/{icon__constants.d.ts → icon.constants.d.ts} +0 -0
- /package/components/icon/{icon__constants.js → icon.constants.js} +0 -0
- /package/components/list/{list__classes.js → list.classes.js} +0 -0
- /package/components/loader/{loader__core.d.ts → loader-core.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.d.ts → old-browsers-message-stop.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.js → old-browsers-message-stop.js} +0 -0
- /package/components/permissions/{permissions__cache.d.ts → permissions-cache.d.ts} +0 -0
- /package/components/query-assist/{query-assist__suggestions.js → query-assist-suggestions.js} +0 -0
|
@@ -5,7 +5,7 @@ import styles from './tabs.css';
|
|
|
5
5
|
import TabLink from './tab-link';
|
|
6
6
|
import { CustomItem } from './custom-item';
|
|
7
7
|
const TabTitle = React.memo(function TabTitle({ selected, child, handleSelect, collapsed = false, tabIndex, }) {
|
|
8
|
-
if (child
|
|
8
|
+
if (child === null || typeof child !== 'object' || child.type === CustomItem) {
|
|
9
9
|
return child;
|
|
10
10
|
}
|
|
11
11
|
const { title, titleProps, disabled, href, className, activeClassName, collapsedClassName, collapsedActiveClassName } = child.props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { TabProps } from './tab';
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type TabProps } from './tab';
|
|
3
3
|
export interface CollapsibleTabsProps {
|
|
4
4
|
children: ReactElement<TabProps>[];
|
|
5
5
|
selected?: string | undefined;
|
|
@@ -37,12 +37,10 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
37
37
|
if (preparedElements.ready) {
|
|
38
38
|
return preparedElements.hidden;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
if (initialVisibleItems) {
|
|
41
41
|
return children.filter(item => !visibleElements.some(visibleItem => visibleItem.props.child === item));
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
43
|
+
return [];
|
|
46
44
|
}, [children, preparedElements.hidden, preparedElements.ready, visibleElements, initialVisibleItems]);
|
|
47
45
|
const adjustTabs = useCallback((entry) => {
|
|
48
46
|
const containerWidth = entry.contentRect.width;
|
|
@@ -102,10 +100,10 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
102
100
|
accumulator.hidden.push(tab);
|
|
103
101
|
}
|
|
104
102
|
return accumulator;
|
|
105
|
-
}, { visible: [], hidden: [], ready: elements.lastVisibleIndex
|
|
103
|
+
}, { visible: [], hidden: [], ready: !!elements.lastVisibleIndex });
|
|
106
104
|
if (selectedIndex > (elements.lastVisibleIndex ?? 0)) {
|
|
107
105
|
const selectedItem = children.find(tab => !tab.props.alwaysHidden && tab.props.id === selected);
|
|
108
|
-
if (selectedItem
|
|
106
|
+
if (selectedItem) {
|
|
109
107
|
res.visible.push(selectedItem);
|
|
110
108
|
}
|
|
111
109
|
}
|
|
@@ -128,7 +126,7 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
128
126
|
}, [children]);
|
|
129
127
|
// Initial measure for tabs and more button sizes
|
|
130
128
|
useEffect(() => {
|
|
131
|
-
if (measureRef.current
|
|
129
|
+
if (measureRef.current === null) {
|
|
132
130
|
return undefined;
|
|
133
131
|
}
|
|
134
132
|
const measureTask = fastdom.measure(() => {
|
|
@@ -173,7 +171,7 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
173
171
|
resizeObserver.disconnect();
|
|
174
172
|
};
|
|
175
173
|
}, [adjustTabs]);
|
|
176
|
-
const isAdjusted = (elements.lastVisibleIndex
|
|
174
|
+
const isAdjusted = (!!elements.lastVisibleIndex && preparedElements.ready) || initialVisibleItems;
|
|
177
175
|
const className = classNames(styles.titles, styles.autoCollapse, isAdjusted && styles.adjusted);
|
|
178
176
|
return (_jsxs("div", { className: styles.autoCollapseContainer, children: [_jsxs("div", { className: classNames(className, styles.rendered), children: [visibleElements, _jsx(MoreButton, { moreClassName: moreClassName, moreActiveClassName: moreActiveClassName, morePopupClassName: morePopupClassName, morePopupBeforeEnd: morePopupBeforeEnd, morePopupItemClassName: morePopupItemClassName, items: hiddenElements, selected: selected, onSelect: onSelect })] }), _jsxs("div", { ref: measureRef, className: classNames(className, styles.measure), children: [childrenToMeasure, _jsx(FakeMoreButton, { hasActiveChildren: hiddenElements.some(item => item.props.alwaysHidden && item.props.id === selected), moreClassName: moreClassName, moreActiveClassName: moreActiveClassName })] })] }));
|
|
179
177
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { TabProps } from './tab';
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type TabProps } from './tab';
|
|
3
3
|
export declare const CustomItem: ({ children }: TabProps) => ReactElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PureComponent, ReactElement } from 'react';
|
|
1
|
+
import { PureComponent, type ReactElement } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { CollapsibleTabsProps } from './collapsible-tabs';
|
|
3
|
+
import { type CollapsibleTabsProps } from './collapsible-tabs';
|
|
4
4
|
import { CustomItem } from './custom-item';
|
|
5
|
-
import { TabProps } from './tab';
|
|
5
|
+
import { type TabProps } from './tab';
|
|
6
6
|
export { CustomItem };
|
|
7
7
|
export type Children = readonly (Children | null | boolean)[] | ReactElement<TabProps> | null | boolean;
|
|
8
8
|
export interface TabsProps extends Omit<CollapsibleTabsProps, 'onSelect' | 'children'> {
|
|
@@ -12,7 +12,7 @@ export { CustomItem };
|
|
|
12
12
|
class Tabs extends PureComponent {
|
|
13
13
|
handleSelect = memoize((key) => () => this.props.onSelect?.(key));
|
|
14
14
|
getTabTitle = (child, i) => {
|
|
15
|
-
if (child
|
|
15
|
+
if (child === null || typeof child !== 'object' || child.type === CustomItem) {
|
|
16
16
|
return child;
|
|
17
17
|
}
|
|
18
18
|
const { selected, onSelect } = this.props;
|
|
@@ -22,13 +22,13 @@ class Tabs extends PureComponent {
|
|
|
22
22
|
const titleClasses = classNames(styles.title, className, isSelected && activeClassName, {
|
|
23
23
|
[styles.selected]: isSelected,
|
|
24
24
|
});
|
|
25
|
-
return (_jsx(TabLink, { title: title, isSelected: isSelected, href: href, className: titleClasses, disabled: disabled, onPlainLeftClick: onSelect
|
|
25
|
+
return (_jsx(TabLink, { title: title, isSelected: isSelected, href: href, className: titleClasses, disabled: disabled, onPlainLeftClick: onSelect ? this.handleSelect(key) : undefined, ...titleProps }, key));
|
|
26
26
|
};
|
|
27
27
|
render() {
|
|
28
28
|
const { className, tabContainerClassName, children, selected, autoCollapse, 'data-test': dataTest, onSelect, ...restProps } = this.props;
|
|
29
29
|
const classes = classNames(styles.tabs, className);
|
|
30
30
|
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
31
|
-
return (_jsxs("div", { className: classes, "data-test": dataTests('ring-dumb-tabs', dataTest), children: [autoCollapse === true ? (_jsx(CollapsibleTabs, { ...restProps, onSelect: onSelect
|
|
31
|
+
return (_jsxs("div", { className: classes, "data-test": dataTests('ring-dumb-tabs', dataTest), children: [autoCollapse === true ? (_jsx(CollapsibleTabs, { ...restProps, onSelect: onSelect ? this.handleSelect : undefined, selected: selected, children: childrenArray })) : (_jsx("div", { className: styles.titles, children: childrenArray.map(this.getTabTitle) })), _jsx("div", { className: classNames(tabContainerClassName), children: childrenArray.find(({ props }, i) => (props.id || String(i)) === selected) })] }));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
export default Tabs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { TabsAttrs, Children } from './dumb-tabs';
|
|
2
|
+
import { type TabsAttrs, type Children } from './dumb-tabs';
|
|
3
3
|
export interface SmartTabsProps extends TabsAttrs {
|
|
4
4
|
children: Children;
|
|
5
5
|
initSelected?: string | null | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { LinkProps } from '../link/link';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type LinkProps } from '../link/link';
|
|
3
3
|
export interface TabLinkProps extends Omit<LinkProps, 'title' | 'children'> {
|
|
4
4
|
isSelected: boolean;
|
|
5
5
|
collapsed?: boolean;
|
package/components/tabs/tab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PureComponent, ReactNode } from 'react';
|
|
2
|
-
import { TabLinkProps } from './tab-link';
|
|
1
|
+
import { PureComponent, type ReactNode } from 'react';
|
|
2
|
+
import { type TabLinkProps } from './tab-link';
|
|
3
3
|
export interface TabProps {
|
|
4
4
|
title?: ReactNode | ((isSelected: boolean, collapsed: boolean | undefined) => ReactNode);
|
|
5
5
|
titleProps?: Partial<TabLinkProps>;
|
package/components/tabs/tabs.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
/* ensure styles order */
|
|
4
|
-
@import
|
|
4
|
+
@import '../link/link.css';
|
|
5
5
|
|
|
6
6
|
:root,
|
|
7
7
|
:host {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
--ring-tabs-line-shadow: inset 0 -1px 0 0;
|
|
17
17
|
--ring-tabs-selected-line-shadow: inset 0 -2px 0 0;
|
|
18
18
|
|
|
19
|
-
composes: font from
|
|
19
|
+
composes: font from '../global/global.css';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.titles {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.title {
|
|
37
|
-
composes: font from
|
|
37
|
+
composes: font from '../global/global.css';
|
|
38
38
|
|
|
39
39
|
position: relative;
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
color: inherit;
|
|
48
48
|
|
|
49
|
-
border:
|
|
49
|
+
border: 0;
|
|
50
50
|
border-radius: 0;
|
|
51
51
|
background: none;
|
|
52
52
|
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
.collapsed.collapsed {
|
|
192
192
|
width: 100%;
|
|
193
193
|
|
|
194
|
-
border-bottom:
|
|
194
|
+
border-bottom: 0;
|
|
195
195
|
box-shadow: none;
|
|
196
196
|
|
|
197
197
|
line-height: calc(var(--ring-unit) * 3);
|
package/components/tag/tag.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
/* ensure styles order */
|
|
4
|
-
@import
|
|
4
|
+
@import '../link/link.css';
|
|
5
5
|
|
|
6
6
|
:root,
|
|
7
7
|
:host {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
.tag {
|
|
16
16
|
--ring-tag-max-height: 20px;
|
|
17
17
|
|
|
18
|
-
composes: resetButton from
|
|
18
|
+
composes: resetButton from '../global/global.css';
|
|
19
19
|
|
|
20
20
|
position: relative;
|
|
21
21
|
z-index: 1;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
color: var(--ring-tag-text-color);
|
|
36
36
|
|
|
37
|
-
border:
|
|
37
|
+
border: 0;
|
|
38
38
|
border-radius: var(--ring-border-radius);
|
|
39
39
|
|
|
40
40
|
font-size: 12px;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.content {
|
|
158
|
-
composes: ellipsis from
|
|
158
|
+
composes: ellipsis from '../global/global.css';
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.disabled.tag {
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes, PureComponent, ReactNode, RefCallback } from 'react';
|
|
1
|
+
import { type HTMLAttributes, PureComponent, type ReactNode, type RefCallback } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { IconType } from '../icon/icon';
|
|
3
|
+
import { type IconType } from '../icon/icon';
|
|
4
4
|
export interface TagRenderProps extends HTMLAttributes<HTMLElement> {
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
ref: RefCallback<HTMLElement>;
|
package/components/tag/tag.js
CHANGED
|
@@ -24,7 +24,7 @@ export default class Tag extends PureComponent {
|
|
|
24
24
|
readOnly: false,
|
|
25
25
|
disabled: false,
|
|
26
26
|
focused: false,
|
|
27
|
-
render: props => _jsx("button", { type:
|
|
27
|
+
render: props => _jsx("button", { type: 'button', ...props }),
|
|
28
28
|
tagType: TagType.DEFAULT,
|
|
29
29
|
};
|
|
30
30
|
state = {
|
|
@@ -88,7 +88,7 @@ export default class Tag extends PureComponent {
|
|
|
88
88
|
}
|
|
89
89
|
renderRemoveIcon() {
|
|
90
90
|
if (!this.props.readOnly && this.props.onRemove) {
|
|
91
|
-
return (_jsx(Button, { title:
|
|
91
|
+
return (_jsx(Button, { title: 'Remove', icon: closeIcon, "data-test": 'ring-tag-remove', className: styles.remove, onClick: this.props.onRemove, style: { '--ring-secondary-color': this.props.textColor }, height: ControlsHeight.M }));
|
|
92
92
|
}
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
|
-
@value outerContainer, container, input from
|
|
3
|
+
@value outerContainer, container, input from '../input/input.css';
|
|
4
4
|
|
|
5
5
|
.tagsInput {
|
|
6
6
|
--ring-input-icon-offset: calc(var(--ring-unit) * 2.5);
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
caret-color: var(--ring-main-color);
|
|
62
62
|
|
|
63
|
-
[dir=
|
|
63
|
+
[dir='rtl'] & {
|
|
64
64
|
padding-right: var(--ring-input-padding-start);
|
|
65
65
|
padding-left: var(--ring-input-padding-end);
|
|
66
66
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PureComponent, SyntheticEvent, ReactNode, ComponentType } from 'react';
|
|
1
|
+
import { PureComponent, type SyntheticEvent, type ReactNode, type ComponentType } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import Select, { SelectItem } from '../select/select';
|
|
4
|
-
import { TagType } from '../tags-list/tags-list';
|
|
3
|
+
import Select, { type SelectItem } from '../select/select';
|
|
4
|
+
import { type TagType } from '../tags-list/tags-list';
|
|
5
5
|
import Caret from '../caret/caret';
|
|
6
6
|
import { Size } from '../input/input';
|
|
7
|
-
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
8
|
-
import { Filter } from '../select/
|
|
9
|
-
import { TagAttrs } from '../tag/tag';
|
|
10
|
-
import { LabelType } from '../control-label/control-label';
|
|
7
|
+
import { type ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
8
|
+
import { type Filter } from '../select/select-popup';
|
|
9
|
+
import { type TagAttrs } from '../tag/tag';
|
|
10
|
+
import { type LabelType } from '../control-label/control-label';
|
|
11
11
|
declare function noop(): void;
|
|
12
12
|
export interface ToggleTagParams {
|
|
13
13
|
tag: TagType;
|
|
@@ -104,7 +104,7 @@ export default class TagsInput extends PureComponent<TagsInputProps, TagsInputSt
|
|
|
104
104
|
handleKeyDown: (event: React.KeyboardEvent) => boolean;
|
|
105
105
|
handleClick: (arg: TagType) => () => void;
|
|
106
106
|
handleRemove: (arg: TagType) => () => Promise<void | TagType[]>;
|
|
107
|
-
handleTagCreation: (label: string) => void;
|
|
107
|
+
handleTagCreation: (label: string | undefined) => void;
|
|
108
108
|
select?: Select | null;
|
|
109
109
|
selectRef: (el: Select | null) => void;
|
|
110
110
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable max-lines */
|
|
2
3
|
import { PureComponent } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import getEventKey from '../global/get-event-key';
|
|
@@ -50,8 +51,8 @@ export default class TagsInput extends PureComponent {
|
|
|
50
51
|
};
|
|
51
52
|
static getDerivedStateFromProps({ tags }, { prevTags }) {
|
|
52
53
|
const nextState = { prevTags: tags };
|
|
53
|
-
if (tags
|
|
54
|
-
Object.assign(nextState, { tags, activeIndex: tags
|
|
54
|
+
if (tags && tags !== prevTags) {
|
|
55
|
+
Object.assign(nextState, { tags, activeIndex: tags?.length });
|
|
55
56
|
}
|
|
56
57
|
return nextState;
|
|
57
58
|
}
|
|
@@ -59,6 +60,7 @@ export default class TagsInput extends PureComponent {
|
|
|
59
60
|
if (this.props.autoOpen && !this.props.disabled) {
|
|
60
61
|
this.focusInput();
|
|
61
62
|
this.loadSuggestions();
|
|
63
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
62
64
|
this.select?._showPopup();
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -91,7 +93,7 @@ export default class TagsInput extends PureComponent {
|
|
|
91
93
|
this.focusInput();
|
|
92
94
|
};
|
|
93
95
|
addTag = (tag) => {
|
|
94
|
-
if (tag
|
|
96
|
+
if (tag === null) {
|
|
95
97
|
return;
|
|
96
98
|
}
|
|
97
99
|
const isUniqueTag = this.state.tags.filter(item => tag.key === item.key).length === 0;
|
|
@@ -119,6 +121,7 @@ export default class TagsInput extends PureComponent {
|
|
|
119
121
|
if (event.target !== this.node && event.target.parentElement !== this.node) {
|
|
120
122
|
return;
|
|
121
123
|
}
|
|
124
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
122
125
|
this.select?._clickHandler();
|
|
123
126
|
};
|
|
124
127
|
filterExistingTags = (suggestions) => {
|
|
@@ -158,22 +161,24 @@ export default class TagsInput extends PureComponent {
|
|
|
158
161
|
this.setActiveIndex(newActiveIndex);
|
|
159
162
|
}
|
|
160
163
|
};
|
|
164
|
+
// eslint-disable-next-line complexity
|
|
161
165
|
handleKeyDown = (event) => {
|
|
162
166
|
const key = getEventKey(event);
|
|
163
167
|
const isInputFocused = () => event.target instanceof Element && event.target.matches(this.getInputNode()?.tagName ?? '');
|
|
164
168
|
if (key === ' ' && this.props.allowAddNewTags) {
|
|
165
169
|
event.stopPropagation();
|
|
166
170
|
const value = this.getInputNode()?.value;
|
|
167
|
-
if (value
|
|
171
|
+
if (value) {
|
|
168
172
|
this.handleTagCreation(value);
|
|
169
173
|
}
|
|
170
174
|
return true;
|
|
171
175
|
}
|
|
176
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
172
177
|
if (this.select?._popup?.isVisible()) {
|
|
173
178
|
return true;
|
|
174
179
|
}
|
|
175
180
|
if (key === 'ArrowLeft') {
|
|
176
|
-
if (this.getInputNode() && this.caret
|
|
181
|
+
if (this.getInputNode() && this.caret && Number(this.caret?.getPosition()) > 0) {
|
|
177
182
|
return true;
|
|
178
183
|
}
|
|
179
184
|
this.selectTag();
|
|
@@ -195,12 +200,13 @@ export default class TagsInput extends PureComponent {
|
|
|
195
200
|
if (key === 'Backspace' && !this.getInputNode()?.value) {
|
|
196
201
|
event.preventDefault();
|
|
197
202
|
const tagsLength = this.state.tags.length;
|
|
203
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
198
204
|
this.select?._hidePopup(true); // otherwise confirmation may be overlapped by popup
|
|
199
205
|
this.onRemoveTag(this.state.tags[tagsLength - 1]);
|
|
200
206
|
return false;
|
|
201
207
|
}
|
|
202
208
|
if ((key === 'Delete' || key === 'Backspace') &&
|
|
203
|
-
this.state.activeIndex
|
|
209
|
+
this.state.activeIndex &&
|
|
204
210
|
this.state.tags[this.state.activeIndex]) {
|
|
205
211
|
this.onRemoveTag(this.state.tags[this.state.activeIndex]).then(() => this.selectTag(true));
|
|
206
212
|
return false;
|
|
@@ -228,7 +234,7 @@ export default class TagsInput extends PureComponent {
|
|
|
228
234
|
}, this.props.className);
|
|
229
235
|
return (_jsxs("div", {
|
|
230
236
|
// it transfers focus to input
|
|
231
|
-
role:
|
|
237
|
+
role: 'presentation', className: classes, onKeyDown: this.handleKeyDown, onClick: this.clickHandler, ref: this.nodeRef, children: [label && (_jsx(ControlLabel, { htmlFor: this.id, disabled: disabled, type: labelType, children: label })), _jsx(TagsList, { tags: tags, activeIndex: activeIndex, disabled: disabled, canNotBeEmpty: canNotBeEmpty, handleRemove: this.handleRemove, className: styles.tagsList, tagClassName: styles.tag, handleClick: this.handleClick, customTagComponent: this.props.customTagComponent, children: _jsx(Select, { id: this.id, ref: this.selectRef, size: Select.Size.AUTO, type: Select.Type.INPUT_WITHOUT_CONTROLS, inputPlaceholder: this.props.placeholder, data: this.state.suggestions, className: classNames(styles.tagsSelect), onSelect: this.addTag, onFocus: this._focusHandler, onBlur: this._blurHandler, renderOptimization: this.props.renderOptimization, add: allowAddNewTags ? { prefix: 'Add new tag' } : undefined, onAdd: allowAddNewTags ? this.handleTagCreation : undefined, filter: filter, maxHeight: this.props.maxPopupHeight, minWidth: this.props.minPopupWidth, top: POPUP_VERTICAL_SHIFT, loading: this.state.loading, onFilter: this.loadSuggestions, onBeforeOpen: this.loadSuggestions, onKeyDown: this.handleKeyDown, disabled: this.props.disabled, loadingMessage: this.props.loadingMessage, notFoundMessage: this.props.notFoundMessage, hint: this.props.hint }) })] }));
|
|
232
238
|
}
|
|
233
239
|
}
|
|
234
240
|
export const RerenderableTagsInput = rerenderHOC(TagsInput);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component, ComponentType, HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { Component, type ComponentType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { TagAttrs } from '../tag/tag';
|
|
3
|
+
import { type TagAttrs } from '../tag/tag';
|
|
4
4
|
declare function noop(): void;
|
|
5
5
|
export interface TagType extends Omit<TagAttrs, 'onClick' | 'children'> {
|
|
6
6
|
label?: ReactNode;
|
|
@@ -25,6 +25,6 @@ export default class TagsList extends Component {
|
|
|
25
25
|
const { children, className, customTagComponent, canNotBeEmpty, handleClick, tagClassName, handleRemove, tags, activeIndex, ...props } = this.props;
|
|
26
26
|
const classes = classNames('ring-js-shortcuts', className);
|
|
27
27
|
const tagsList = (this.props.tags || []).map((tag, index) => this.renderTag(tag, this.props.activeIndex === index));
|
|
28
|
-
return (_jsxs("div", { "data-test":
|
|
28
|
+
return (_jsxs("div", { "data-test": 'ring-tags-list', className: classes, ...props, children: [tagsList, children] }));
|
|
29
29
|
}
|
|
30
30
|
}
|
package/components/text/text.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
.toggle {
|
|
4
4
|
--ring-toggle-padding: 2px;
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
width: calc(var(--ring-unit) * 1.5);
|
|
95
95
|
height: calc(var(--ring-unit) * 1.5);
|
|
96
96
|
|
|
97
|
-
content:
|
|
97
|
+
content: '';
|
|
98
98
|
|
|
99
99
|
transition: transform var(--ring-toggle-timing-function) var(--ring-toggle-duration);
|
|
100
100
|
|
|
@@ -16,7 +16,7 @@ class Toggle extends PureComponent {
|
|
|
16
16
|
render() {
|
|
17
17
|
const { className, children, disabled, title, leftLabel, size = Size.Size16, 'data-test': dataTest, help, onTransitionEnd, ...restProps } = this.props;
|
|
18
18
|
const classes = classNames(className, size, styles.toggle, disabled && styles.disabled);
|
|
19
|
-
return (_jsxs("label", { className: classes, title: title, "data-test": dataTests('ring-toggle', dataTest), children: [leftLabel && (_jsxs("span", { className: styles.leftLabel, children: [leftLabel, help && _jsx(ControlHelp, { className: styles.help, children: help })] })), _jsxs("span", { className: styles.switchWrapper, children: [_jsx("input", { "data-test":
|
|
19
|
+
return (_jsxs("label", { className: classes, title: title, "data-test": dataTests('ring-toggle', dataTest), children: [leftLabel && (_jsxs("span", { className: styles.leftLabel, children: [leftLabel, help && _jsx(ControlHelp, { className: styles.help, children: help })] })), _jsxs("span", { className: styles.switchWrapper, children: [_jsx("input", { "data-test": 'ring-toggle-input', ...restProps, type: 'checkbox', disabled: disabled, className: styles.input }), _jsx("span", { className: styles.switch, onTransitionEnd: onTransitionEnd })] }), children && (_jsxs("div", { className: styles.label, children: [children, help && _jsx(ControlHelp, { className: styles.help, children: help })] }))] }));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export default Toggle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AllHTMLAttributes, Component, ReactNode } from 'react';
|
|
3
|
-
import Popup, { PopupAttrs } from '../popup/popup';
|
|
2
|
+
import { type AllHTMLAttributes, Component, type ReactNode } from 'react';
|
|
3
|
+
import Popup, { type PopupAttrs } from '../popup/popup';
|
|
4
4
|
import { Listeners } from '../global/dom';
|
|
5
5
|
import Theme from '../global/theme';
|
|
6
6
|
interface Context {
|
|
@@ -89,7 +89,7 @@ export default class Tooltip extends Component {
|
|
|
89
89
|
this.setState({ showPopup: false });
|
|
90
90
|
};
|
|
91
91
|
addListeners() {
|
|
92
|
-
if (this.containerNode
|
|
92
|
+
if (this.containerNode) {
|
|
93
93
|
this.listeners.add(this.containerNode, 'mouseenter', this.tryToShowPopup);
|
|
94
94
|
this.listeners.add(this.containerNode, 'mouseleave', ev => {
|
|
95
95
|
if (ev.relatedTarget && this.popup?.container?.contains(ev.relatedTarget)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export type UploadVariant = 'empty' | 'error' | 'success';
|
|
3
3
|
interface Props {
|
|
4
4
|
className?: string;
|
|
@@ -12,8 +12,8 @@ interface Props {
|
|
|
12
12
|
variant?: UploadVariant;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export interface UploadHandle {
|
|
16
16
|
openFilePicker: () => void;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
export declare const Upload: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<UploadHandle>>;
|
|
19
19
|
export default Upload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef, useState, } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import attachmentIcon from '@jetbrains/icons/attachment';
|
|
5
5
|
import Icon from '../icon';
|
|
@@ -33,6 +33,6 @@ export const Upload = forwardRef(function Upload({ children, className, onFilesS
|
|
|
33
33
|
[styles.dragOver]: dragOver,
|
|
34
34
|
[styles.success]: variant === 'success',
|
|
35
35
|
[styles.error]: variant === 'error',
|
|
36
|
-
}), "data-test":
|
|
36
|
+
}), "data-test": 'ring-upload', children: [_jsx("input", { onDragEnter: onDragEnter, onDragOver: onDragOver, onDragLeave: onDragLeave, disabled: disabled, ref: fileInputRef, "data-test": 'ring-file-input', multiple: multiple, accept: accept, onChange: onInputChange, type: 'file', autoComplete: 'off', "aria-label": 'file-picker', className: styles.invisibleFileInput }), renderIcon(), children] }));
|
|
37
37
|
});
|
|
38
38
|
export default Upload;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import Storage from '../storage/storage';
|
|
3
|
-
import { UserAgreementAttrs, UserAgreementTranslations } from './user-agreement';
|
|
3
|
+
import { type UserAgreementAttrs, type UserAgreementTranslations } from './user-agreement';
|
|
4
4
|
export declare const showMessage = "userAgreementShow";
|
|
5
5
|
export declare const hideMessage = "userAgreementHide";
|
|
6
6
|
export interface Consent {
|
|
@@ -71,7 +71,7 @@ export default class UserAgreementService {
|
|
|
71
71
|
this.hideDialog();
|
|
72
72
|
};
|
|
73
73
|
onStorageEvent = (event) => {
|
|
74
|
-
if (event.key === storageKey && event.newValue
|
|
74
|
+
if (event.key === storageKey && event.newValue) {
|
|
75
75
|
const { tabId, command } = JSON.parse(event.newValue);
|
|
76
76
|
if (tabId !== this.tabId) {
|
|
77
77
|
if (command === showMessage) {
|
|
@@ -108,9 +108,7 @@ export default class UserAgreementService {
|
|
|
108
108
|
if (await this.checkConsent()) {
|
|
109
109
|
return this.hideDialogAndAlert(withoutNotifications);
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
return this.showDialogOrAlert(withoutNotifications);
|
|
113
|
-
}
|
|
111
|
+
return this.showDialogOrAlert(withoutNotifications);
|
|
114
112
|
};
|
|
115
113
|
checkConsent = async () => {
|
|
116
114
|
if (!this.checkingPromise) {
|
|
@@ -138,7 +136,7 @@ export default class UserAgreementService {
|
|
|
138
136
|
this.hideAlert(withoutNotifications);
|
|
139
137
|
resolve();
|
|
140
138
|
};
|
|
141
|
-
const message = (_jsxs(Group, { children: [_jsx("span", { children: userAgreement || 'User Agreement' }), _jsx(Link, { onClick: onReview, "data-test":
|
|
139
|
+
const message = (_jsxs(Group, { children: [_jsx("span", { children: userAgreement || 'User Agreement' }), _jsx(Link, { onClick: onReview, "data-test": 'review', children: reviewNow || 'Review now' }), _jsx(Link, { onClick: onRemind, "data-test": 'later', children: remindLater || 'Remind me later' })] }));
|
|
142
140
|
this.alertKey = alertService.addAlert(message, Alert.Type.WARNING, 0, { closeable: false });
|
|
143
141
|
});
|
|
144
142
|
if (!withoutNotifications) {
|
|
@@ -28,6 +28,6 @@ export default class UserAgreement extends PureComponent {
|
|
|
28
28
|
render() {
|
|
29
29
|
const { scrolledDown } = this.state;
|
|
30
30
|
const { translations, onAccept, onDecline, onClose, onRemindLater, children, show, preview, className } = this.props;
|
|
31
|
-
return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs(Dialog, { label: translations?.userAgreement ?? translate('userAgreement'), show: show, className: classNames(style.agreementDialog, className), contentClassName: style.dialogContent, trapFocus: true, autoFocusFirst: false, "data-test":
|
|
31
|
+
return (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs(Dialog, { label: translations?.userAgreement ?? translate('userAgreement'), show: show, className: classNames(style.agreementDialog, className), contentClassName: style.dialogContent, trapFocus: true, autoFocusFirst: false, "data-test": 'user-agreement', children: [_jsx(Header, { children: translations?.userAgreement ?? translate('userAgreement') }), _jsx(Content, { tabIndex: 0, fade: true, onScrollToBottom: this.onScrollToBottom, children: children }), !preview && (_jsxs(Panel, { children: [onRemindLater && !scrolledDown && (_jsx("div", { className: style.suggestion, children: translations?.scrollToAccept ?? translate('scrollToAccept') })), _jsx(Button, { primary: true, disabled: !scrolledDown, onClick: onAccept, "data-test": 'accept', children: translations?.accept ?? translate('accept') }), _jsx(Button, { onClick: onDecline, autoFocus: true, "data-test": 'decline', children: translations?.decline ?? translate('decline') }), !onRemindLater && !scrolledDown && (_jsx("span", { className: style.suggestion, children: translations?.scrollToAccept ?? translate('scrollToAccept') })), onRemindLater && (_jsx(Button, { className: style.remindLaterButton, onClick: onRemindLater, "data-test": 'later', children: translations?.remindLater ?? translate('remindLater') }))] })), preview && (_jsx(Panel, { children: _jsx(Button, { onClick: onClose, autoFocus: true, "data-test": 'close', children: translations?.close ?? translate('close') }) }))] })) }));
|
|
32
32
|
}
|
|
33
33
|
}
|