@jetbrains/ring-ui 7.0.61 → 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 +5 -3
- package/components/global/variables_dark.css +8 -6
- 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 +7 -6
- package/components/select/select.js +32 -27
- 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 +94 -14
- package/components/tag/tag.d.ts +13 -2
- package/components/tag/tag.js +16 -3
- 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 +6 -3
- 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 +4 -3
- 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 -5
- package/package.json +12 -9
- /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
|
@@ -19,7 +19,7 @@ class Shortcuts {
|
|
|
19
19
|
for (let i = this._scopeChain.length - 1; i >= 0; i--) {
|
|
20
20
|
const scopeInChain = this._scopeChain[i];
|
|
21
21
|
currentScope = this._scopes[scopeInChain.scopeId];
|
|
22
|
-
if (currentScope && key
|
|
22
|
+
if (currentScope && key !== null && key !== undefined && currentScope[key]) {
|
|
23
23
|
const ret = currentScope[key](e, key, scopeInChain.scopeId);
|
|
24
24
|
// Fall down in chain when returning true
|
|
25
25
|
if (ret !== true) {
|
|
@@ -75,7 +75,7 @@ class Shortcuts {
|
|
|
75
75
|
throw new Error("Shortcuts map shouldn't be empty");
|
|
76
76
|
}
|
|
77
77
|
for (const key in map) {
|
|
78
|
-
if (
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(map, key)) {
|
|
79
79
|
this.bind(Object.assign({}, options || {}, { key, handler: map[key] }));
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -125,7 +125,7 @@ class Shortcuts {
|
|
|
125
125
|
setScope(scope) {
|
|
126
126
|
if (scope) {
|
|
127
127
|
let scopeChain;
|
|
128
|
-
if (typeof scope === 'string' || (!Array.isArray(scope) && typeof scope === 'object'
|
|
128
|
+
if (typeof scope === 'string' || (!Array.isArray(scope) && typeof scope === 'object')) {
|
|
129
129
|
scopeChain = [scope];
|
|
130
130
|
}
|
|
131
131
|
else {
|
|
@@ -154,11 +154,11 @@ class Shortcuts {
|
|
|
154
154
|
// if the element or its parents have the class "ring-js-shortcuts" then no need to stop
|
|
155
155
|
if (element === document ||
|
|
156
156
|
!(element instanceof HTMLElement) ||
|
|
157
|
-
key
|
|
157
|
+
key === null ||
|
|
158
158
|
element.matches(this.ALLOW_SHORTCUTS_SELECTOR) ||
|
|
159
|
-
(element.dataset.enabledShortcuts
|
|
160
|
-
? element.dataset.enabledShortcuts.split(',').includes(key)
|
|
161
|
-
: element.closest(this.ALLOW_SHORTCUTS_SELECTOR)
|
|
159
|
+
(element.dataset.enabledShortcuts
|
|
160
|
+
? key && element.dataset.enabledShortcuts.split(',').includes(key)
|
|
161
|
+
: !!element.closest(this.ALLOW_SHORTCUTS_SELECTOR))) {
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
164
|
const elementContentEditableAttribute = element.contentEditable;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentClass, ComponentType } from 'react';
|
|
2
|
-
import { ShortcutsMap, ShortcutsScopeOptions } from './core';
|
|
1
|
+
import { type ComponentClass, type ComponentType } from 'react';
|
|
2
|
+
import { type ShortcutsMap, type ShortcutsScopeOptions } from './core';
|
|
3
3
|
export interface ShortcutsHOCOptions extends ShortcutsScopeOptions {
|
|
4
4
|
disabled?: boolean | null | undefined;
|
|
5
5
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.thumb {
|
|
70
|
-
composes: resetButton from
|
|
70
|
+
composes: resetButton from '../global/global.css';
|
|
71
71
|
|
|
72
72
|
position: absolute;
|
|
73
73
|
z-index: 1;
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
top: 100%;
|
|
162
162
|
left: calc(50% - 3px);
|
|
163
163
|
|
|
164
|
-
content:
|
|
164
|
+
content: ' ';
|
|
165
165
|
|
|
166
166
|
border-top: 3px solid var(--ring-main-color);
|
|
167
167
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
|
|
3
|
+
interface Mark {
|
|
4
4
|
value: number;
|
|
5
5
|
label?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
8
|
defaultValue?: number | number[];
|
|
9
9
|
value?: number | number[];
|
|
10
10
|
min?: number;
|
|
@@ -17,6 +17,6 @@ type Props = {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
renderTag?: (value: number) => ReactNode;
|
|
19
19
|
onChange?: (value: number | number[]) => void;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
export declare const Slider: React.FC<Props>;
|
|
22
22
|
export {};
|
|
@@ -20,7 +20,7 @@ export const Slider = ({ defaultValue, value, min = 0, max = HUNDRED, step = 1,
|
|
|
20
20
|
if (isArray(marks)) {
|
|
21
21
|
return marks.map(mark => ({ ...mark, value: validateValue(mark.value, min, max) }));
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
if (marks) {
|
|
24
24
|
return calculateMarks(min, max, validStep);
|
|
25
25
|
}
|
|
26
26
|
return [];
|
|
@@ -78,7 +78,7 @@ export const Slider = ({ defaultValue, value, min = 0, max = HUNDRED, step = 1,
|
|
|
78
78
|
}
|
|
79
79
|
const index = e.currentTarget.getAttribute('data-index');
|
|
80
80
|
const nextValue = calculateValue(ref, e.pageX, min, max, validStep);
|
|
81
|
-
if (nextValue
|
|
81
|
+
if (nextValue && !isNaN(nextValue) && !index) {
|
|
82
82
|
const rangeIndex = Number(Math.abs(validValues[0] - nextValue) > Math.abs(validValues[1] - nextValue));
|
|
83
83
|
setDraggedIndex(isRange ? rangeIndex : 0);
|
|
84
84
|
}
|
|
@@ -123,7 +123,7 @@ export const Slider = ({ defaultValue, value, min = 0, max = HUNDRED, step = 1,
|
|
|
123
123
|
window.removeEventListener('mouseup', handleMouseUp);
|
|
124
124
|
};
|
|
125
125
|
}, [isDragging, handleMouseMove, handleMouseUp, disabled]);
|
|
126
|
-
return (_jsxs("div", { ref: ref, role:
|
|
126
|
+
return (_jsxs("div", { ref: ref, role: 'presentation' // contains interactive elements
|
|
127
127
|
, className: classNames(styles.slider, className, {
|
|
128
128
|
[styles.disabled]: disabled,
|
|
129
129
|
[styles.marked]: !!marks || showTag,
|
|
@@ -140,10 +140,10 @@ export const Slider = ({ defaultValue, value, min = 0, max = HUNDRED, step = 1,
|
|
|
140
140
|
const percent = toPercent(numValue, min, max);
|
|
141
141
|
return (
|
|
142
142
|
// eslint-disable-next-line react/no-array-index-key
|
|
143
|
-
_jsxs(Fragment, { children: [_jsx("div", { tabIndex: 0, "aria-label":
|
|
143
|
+
_jsxs(Fragment, { children: [_jsx("div", { tabIndex: 0, "aria-label": 'Pick value', role: 'slider', "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": numValue, "data-index": index, style: { left: `${percent}%` }, className: classNames(styles.thumb, {
|
|
144
144
|
[styles.disabled]: disabled,
|
|
145
145
|
[styles.dragged]: isDragging && draggedIndex === index,
|
|
146
|
-
}), onMouseDown: handleMouseDown }), showTag && (_jsx("div", { style: { left: `${percent}%` }, className: classNames(styles.tag, { [styles.disabled]: disabled }), role:
|
|
146
|
+
}), onMouseDown: handleMouseDown }), showTag && (_jsx("div", { style: { left: `${percent}%` }, className: classNames(styles.tag, { [styles.disabled]: disabled }), role: 'tooltip', children: renderTag ? renderTag(numValue) : numValue }))] }, index));
|
|
147
147
|
}), markValues.map(({ value: markValue, label }, index) => {
|
|
148
148
|
const percent = toPercent(markValue, min, max);
|
|
149
149
|
return (_jsx("div", { style: { left: `${percent}%` }, className: classNames(styles.markValue, { [styles.disabled]: disabled }), children: label ?? markValue }, index));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
2
|
export declare const HUNDRED = 100;
|
|
3
3
|
export declare function toPercent(value: number, min: number, max: number): number;
|
|
4
4
|
export declare function calculateValue(ref: RefObject<HTMLDivElement | null>, x: number, min: number, max: number, step: number): number | null;
|
|
@@ -35,14 +35,12 @@ export function toRange(value, min, max) {
|
|
|
35
35
|
}
|
|
36
36
|
return nextValues;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
return [validateValue(value, min, max)];
|
|
40
|
-
}
|
|
38
|
+
return [validateValue(value, min, max)];
|
|
41
39
|
}
|
|
42
40
|
export function adjustValues(values, ref, index, x, max, min, step) {
|
|
43
41
|
const nextValue = calculateValue(ref, x, min, max, step);
|
|
44
42
|
const nextValues = [...values];
|
|
45
|
-
if (nextValue
|
|
43
|
+
if (nextValue && !isNaN(nextValue)) {
|
|
46
44
|
nextValues[index] = validateValue(nextValue, min, max);
|
|
47
45
|
}
|
|
48
46
|
return nextValues;
|
|
@@ -29,7 +29,7 @@ export default class LocalStorage {
|
|
|
29
29
|
get(name) {
|
|
30
30
|
return LocalStorage.safePromise(resolve => {
|
|
31
31
|
const value = window[this.storageType].getItem(name);
|
|
32
|
-
if (value
|
|
32
|
+
if (value) {
|
|
33
33
|
try {
|
|
34
34
|
resolve(JSON.parse(value));
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ export default class LocalStorage {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
resolve(
|
|
41
|
+
resolve(null);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -60,7 +60,7 @@ export default class LocalStorage {
|
|
|
60
60
|
remove(name) {
|
|
61
61
|
const storageType = this.storageType;
|
|
62
62
|
return LocalStorage.safePromise(resolve => {
|
|
63
|
-
if (window[storageType]
|
|
63
|
+
if (Object.prototype.hasOwnProperty.call(window[storageType], name)) {
|
|
64
64
|
window[storageType].removeItem(name);
|
|
65
65
|
}
|
|
66
66
|
resolve();
|
|
@@ -75,10 +75,10 @@ export default class LocalStorage {
|
|
|
75
75
|
return LocalStorage.safePromise(resolve => {
|
|
76
76
|
const promises = [];
|
|
77
77
|
for (const item in window[storageType]) {
|
|
78
|
-
if (window[storageType]
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(window[storageType], item)) {
|
|
79
79
|
const value = window[storageType].getItem(item);
|
|
80
80
|
let resolvedValue = null;
|
|
81
|
-
if (value
|
|
81
|
+
if (value) {
|
|
82
82
|
try {
|
|
83
83
|
resolvedValue = JSON.parse(value);
|
|
84
84
|
}
|
|
@@ -100,7 +100,7 @@ export default class LocalStorage {
|
|
|
100
100
|
on(name, callback) {
|
|
101
101
|
function handleStorage(e) {
|
|
102
102
|
if (e.key === name) {
|
|
103
|
-
if (e.newValue
|
|
103
|
+
if (e.newValue) {
|
|
104
104
|
try {
|
|
105
105
|
callback(JSON.parse(e.newValue));
|
|
106
106
|
}
|
|
@@ -109,7 +109,7 @@ export default class LocalStorage {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
callback(
|
|
112
|
+
callback(null);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import LocalStorage from './
|
|
1
|
+
import LocalStorage from './storage-local';
|
|
2
2
|
export default LocalStorage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export declare const FOCUSABLE_ELEMENTS = "input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])";
|
|
4
4
|
export interface TabTrapProps extends HTMLAttributes<HTMLElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
3
3
|
import { isNodeInVisiblePartOfPage } from '../global/dom';
|
|
4
4
|
import styles from './tab-trap.css';
|
|
5
5
|
export const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
|
@@ -75,10 +75,7 @@ const TabTrap = forwardRef(function TabTrap({ children, trapDisabled = false, au
|
|
|
75
75
|
}
|
|
76
76
|
if (focusBackOnExit) {
|
|
77
77
|
const prevFocused = event.nativeEvent.relatedTarget;
|
|
78
|
-
if (prevFocused
|
|
79
|
-
nodeRef.current != null &&
|
|
80
|
-
prevFocused instanceof Element &&
|
|
81
|
-
nodeRef.current.contains(prevFocused)) {
|
|
78
|
+
if (prevFocused && nodeRef.current && prevFocused instanceof Element && nodeRef.current.contains(prevFocused)) {
|
|
82
79
|
restoreFocus();
|
|
83
80
|
}
|
|
84
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent, ReactNode, SyntheticEvent, ThHTMLAttributes } from 'react';
|
|
1
|
+
import { PureComponent, type ReactNode, type SyntheticEvent, type ThHTMLAttributes } from 'react';
|
|
2
2
|
export interface Column<T = never> {
|
|
3
3
|
id: string;
|
|
4
4
|
sortable?: boolean | null | undefined;
|
|
@@ -33,6 +33,6 @@ export default class HeaderCell extends PureComponent {
|
|
|
33
33
|
[style.sortedUp]: sortOrder && this.sorted,
|
|
34
34
|
[style.cellRight]: column.rightAlign,
|
|
35
35
|
});
|
|
36
|
-
return (_jsxs("th", { ...restProps, className: classes, onClick: this.onClick, "data-test": dataTests('ring-table-header-cell', dataTest), children: [_jsx("span", { onClick: this.onChildrenClick, role:
|
|
36
|
+
return (_jsxs("th", { ...restProps, className: classes, onClick: this.onClick, "data-test": dataTests('ring-table-header-cell', dataTest), children: [_jsx("span", { onClick: this.onChildrenClick, role: 'presentation', children: this.props.children }), column.getHeaderValue ? column.getHeaderValue() : column.title, this.sortable && (_jsx("span", { className: style.sorter, children: _jsx(Icon, { glyph: glyph, className: style.icon }) }))] }));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChangeEventHandler, PureComponent, SyntheticEvent } from 'react';
|
|
2
|
-
import { Column, SortParams } from './header-cell';
|
|
1
|
+
import { type ChangeEventHandler, PureComponent, type SyntheticEvent } from 'react';
|
|
2
|
+
import { type Column, type SortParams } from './header-cell';
|
|
3
3
|
export interface HeaderProps {
|
|
4
4
|
columns: readonly Column[];
|
|
5
5
|
selectable: boolean;
|
|
@@ -34,9 +34,9 @@ export default class Header extends PureComponent {
|
|
|
34
34
|
render() {
|
|
35
35
|
const { caption, sticky, topStickOffset } = this.props;
|
|
36
36
|
const regularCells = this.createCells();
|
|
37
|
-
return (_jsxs("thead", { id: this.id, "data-test":
|
|
37
|
+
return (_jsxs("thead", { id: this.id, "data-test": 'ring-table-header', style: { top: topStickOffset }, className: classNames({
|
|
38
38
|
[style.tableHead]: true,
|
|
39
39
|
[style.subHeaderSticky]: sticky,
|
|
40
|
-
}), children: [caption && (_jsx("tr", { "data-test":
|
|
40
|
+
}), children: [caption && (_jsx("tr", { "data-test": 'ring-table-header-row', children: _jsx("th", { className: classNames(style.headerCell, style.caption), colSpan: regularCells.length + 1, "data-test": 'ring-table-header-cell', children: caption }) })), _jsx("tr", { className: style.subHeader, "data-test": 'ring-table-header-row', children: regularCells })] }));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PureComponent, ReactElement } from 'react';
|
|
2
|
-
import { TableAttrs } from './table';
|
|
3
|
-
import { SelectionItem } from './selection';
|
|
1
|
+
import { PureComponent, type ReactElement } from 'react';
|
|
2
|
+
import { type TableAttrs } from './table';
|
|
3
|
+
import { type SelectionItem } from './selection';
|
|
4
4
|
type TableComponent = ReactElement<TableAttrs<SelectionItem>>;
|
|
5
5
|
export interface MultiTableProps {
|
|
6
6
|
children: TableComponent[];
|
|
@@ -70,7 +70,7 @@ export default class MultiTable extends PureComponent {
|
|
|
70
70
|
'ctrl+a': this.onCmdAPress,
|
|
71
71
|
};
|
|
72
72
|
render() {
|
|
73
|
-
return (_jsx("div", { "data-test":
|
|
73
|
+
return (_jsx("div", { "data-test": 'ring-multitable', children: Children.map(this.props.children, child => {
|
|
74
74
|
const props = { shortcuts: this.shortcuts };
|
|
75
75
|
return cloneElement(child, props);
|
|
76
76
|
}) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { FocusSensorProps } from '../global/focus-sensor-hoc';
|
|
3
|
-
import Row, { RowProps } from './row';
|
|
4
|
-
import { SelectionItem } from './selection';
|
|
2
|
+
import { type FocusSensorProps } from '../global/focus-sensor-hoc';
|
|
3
|
+
import Row, { type RowProps } from './row';
|
|
4
|
+
import { type SelectionItem } from './selection';
|
|
5
5
|
export interface RowWithFocusSensorCallbacksProps<T extends SelectionItem> extends Omit<FocusSensorProps<RowProps<T>, HTMLTableRowElement, typeof Row>, 'onFocus'> {
|
|
6
6
|
onFocus?: (item: T) => void;
|
|
7
7
|
onSelect?: (item: T, selected: boolean) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HTMLAttributes, PureComponent } from 'react';
|
|
1
|
+
import { type HTMLAttributes, PureComponent } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { FocusSensorAddProps } from '../global/focus-sensor-hoc';
|
|
4
|
-
import { Column } from './header-cell';
|
|
5
|
-
import { SelectionItem } from './selection';
|
|
3
|
+
import { type FocusSensorAddProps } from '../global/focus-sensor-hoc';
|
|
4
|
+
import { type Column } from './header-cell';
|
|
5
|
+
import { type SelectionItem } from './selection';
|
|
6
6
|
export interface RowProps<T extends SelectionItem> extends Omit<HTMLAttributes<HTMLTableRowElement>, 'onClick' | 'onDoubleClick' | 'onSelect'>, FocusSensorAddProps<HTMLTableRowElement> {
|
|
7
7
|
item: T;
|
|
8
8
|
columns: readonly Column<T>[] | ((item: T) => readonly Column<T>[]);
|
package/components/table/row.js
CHANGED
|
@@ -9,7 +9,7 @@ import Button from '../button/button';
|
|
|
9
9
|
import Tooltip from '../tooltip/tooltip';
|
|
10
10
|
import dataTests from '../global/data-tests';
|
|
11
11
|
import getUID from '../global/get-uid';
|
|
12
|
-
import { createComposedRef } from '../global/
|
|
12
|
+
import { createComposedRef } from '../global/compose-refs';
|
|
13
13
|
import Cell from './cell';
|
|
14
14
|
import style from './table.css';
|
|
15
15
|
const DragHandle = ({ alwaysShowDragHandle, dragHandleTitle = 'Drag to reorder' }) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import Selection
|
|
1
|
+
import type Selection from './selection';
|
|
2
|
+
import type { SelectionItem } from './selection';
|
|
2
3
|
export default function selectionAdapter(getSelection: () => Selection<SelectionItem>): {
|
|
3
4
|
readonly size: number;
|
|
4
5
|
readonly items: SelectionItem[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComponentClass } from 'react';
|
|
2
|
-
import { ShortcutsMap } from '../shortcuts/core';
|
|
3
|
-
import Selection
|
|
1
|
+
import { type ComponentClass } from 'react';
|
|
2
|
+
import { type ShortcutsMap } from '../shortcuts/core';
|
|
3
|
+
import type Selection from './selection';
|
|
4
|
+
import type { SelectionItem } from './selection';
|
|
4
5
|
export interface SelectionShortcutsOuterProps<T extends SelectionItem> {
|
|
5
6
|
selection: Selection<T>;
|
|
6
7
|
selectable?: boolean | undefined;
|
|
@@ -32,9 +32,7 @@ export default function selectionShortcutsHOC(ComposedComponent) {
|
|
|
32
32
|
if (this.shiftSelectionMode === 'addition') {
|
|
33
33
|
return selection.select();
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
return selection.deselect();
|
|
37
|
-
}
|
|
35
|
+
return selection.deselect();
|
|
38
36
|
};
|
|
39
37
|
onShiftUpPress = (e) => {
|
|
40
38
|
e.preventDefault();
|
|
@@ -107,9 +107,7 @@ export default class Selection {
|
|
|
107
107
|
if (this.isSelected(value)) {
|
|
108
108
|
return this.deselect(value);
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
return this.select(value);
|
|
112
|
-
}
|
|
110
|
+
return this.select(value);
|
|
113
111
|
}
|
|
114
112
|
selectAll() {
|
|
115
113
|
return this.cloneWith({ selected: [...this._data] });
|
|
@@ -127,7 +125,7 @@ export default class Selection {
|
|
|
127
125
|
return this._focused === value;
|
|
128
126
|
}
|
|
129
127
|
isSelected(value) {
|
|
130
|
-
return value
|
|
128
|
+
return value !== null && this._selected.has(value);
|
|
131
129
|
}
|
|
132
130
|
getFocused() {
|
|
133
131
|
return this._focused;
|
|
@@ -139,11 +137,9 @@ export default class Selection {
|
|
|
139
137
|
if (this._selected.size) {
|
|
140
138
|
return new Set(this._selected);
|
|
141
139
|
}
|
|
142
|
-
|
|
140
|
+
if (this._focused) {
|
|
143
141
|
return new Set([this._focused]);
|
|
144
142
|
}
|
|
145
|
-
|
|
146
|
-
return new Set();
|
|
147
|
-
}
|
|
143
|
+
return new Set();
|
|
148
144
|
}
|
|
149
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { TableAttrs } from './table';
|
|
3
|
-
import Selection, { SelectionItem } from './selection';
|
|
2
|
+
import { type TableAttrs } from './table';
|
|
3
|
+
import Selection, { type SelectionItem } from './selection';
|
|
4
4
|
export interface SimpleTableProps<T extends SelectionItem> extends Omit<TableAttrs<T>, 'selection' | 'onSelect' | 'selectable'> {
|
|
5
5
|
}
|
|
6
6
|
declare class SimpleTable<T extends SelectionItem> extends PureComponent<SimpleTableProps<T>> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { TableAttrs } from './table';
|
|
3
|
-
import Selection, { SelectionItem } from './selection';
|
|
2
|
+
import { type TableAttrs } from './table';
|
|
3
|
+
import Selection, { type SelectionItem } from './selection';
|
|
4
4
|
export interface SmartTableProps<T extends SelectionItem> extends Omit<TableAttrs<T>, 'selection' | 'onSelect'> {
|
|
5
5
|
onSelectionChange: (selection: Selection<T>) => void;
|
|
6
6
|
selection?: Selection<T>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
.tableWrapper {
|
|
4
4
|
--ring-table-compensate: 2px;
|
|
5
|
-
--ring-table-compensated:
|
|
5
|
+
--ring-table-compensated: calc(calc(4 * var(--ring-unit)) - var(--ring-table-compensate));
|
|
6
6
|
--ring-table-top: -3px;
|
|
7
7
|
|
|
8
8
|
position: relative;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.headerCell {
|
|
23
|
-
composes: font-smaller-lower from
|
|
23
|
+
composes: font-smaller-lower from '../global/global.css';
|
|
24
24
|
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
height: calc(var(--ring-unit) * 3);
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
padding-bottom: 6px;
|
|
82
82
|
|
|
83
83
|
color: var(--ring-text-color);
|
|
84
|
-
border-bottom:
|
|
84
|
+
border-bottom: 0;
|
|
85
85
|
|
|
86
86
|
font-size: var(--ring-font-size);
|
|
87
87
|
font-weight: var(--ring-font-weight-bold);
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
|
|
96
96
|
height: 1px;
|
|
97
97
|
|
|
98
|
-
content:
|
|
98
|
+
content: '';
|
|
99
99
|
|
|
100
100
|
background-color: var(--ring-line-color);
|
|
101
101
|
}
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
.cell {
|
|
150
|
-
composes: ellipsis from
|
|
150
|
+
composes: ellipsis from '../global/global.css';
|
|
151
151
|
|
|
152
152
|
box-sizing: content-box;
|
|
153
153
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name Table
|
|
3
3
|
*/
|
|
4
|
-
import { Component, PureComponent, ReactNode, SyntheticEvent } from 'react';
|
|
4
|
+
import { Component, PureComponent, type ReactNode, type SyntheticEvent } from 'react';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { OnChangeMeta } from 'react-movable/lib/types';
|
|
7
|
-
import { FocusSensorAddProps, FocusSensorProps } from '../global/focus-sensor-hoc';
|
|
8
|
-
import { SelectionItem } from './selection';
|
|
9
|
-
import { SelectionShortcutsAddProps, SelectionShortcutsProps } from './selection-shortcuts-hoc';
|
|
10
|
-
import { DisableHoverAddProps, DisableHoverProps } from './disable-hover-hoc';
|
|
6
|
+
import { type OnChangeMeta } from 'react-movable/lib/types';
|
|
7
|
+
import { type FocusSensorAddProps, type FocusSensorProps } from '../global/focus-sensor-hoc';
|
|
8
|
+
import { type SelectionItem } from './selection';
|
|
9
|
+
import { type SelectionShortcutsAddProps, type SelectionShortcutsProps } from './selection-shortcuts-hoc';
|
|
10
|
+
import { type DisableHoverAddProps, type DisableHoverProps } from './disable-hover-hoc';
|
|
11
11
|
import Row from './row-with-focus-sensor';
|
|
12
|
-
import { Column, SortParams } from './header-cell';
|
|
12
|
+
import { type Column, type SortParams } from './header-cell';
|
|
13
13
|
export interface ReorderParams<T> {
|
|
14
14
|
data: T[];
|
|
15
15
|
oldIndex: number;
|
|
@@ -142,17 +142,17 @@ export class Table extends PureComponent {
|
|
|
142
142
|
const renderList = ({ children, props }) => {
|
|
143
143
|
const empty = (_jsx("tr", { children: _jsx("td", { colSpan: columnsArray.length || 1, className: style.tableMessage, children: renderEmpty ? renderEmpty() : null }) }));
|
|
144
144
|
const tbody = Array.isArray(children) && children.length > 0 ? children : empty;
|
|
145
|
-
return (_jsxs("table", { className: classes, "data-test":
|
|
145
|
+
return (_jsxs("table", { className: classes, "data-test": 'ring-table', children: [_jsx(Header, { ...headerProps }), _jsx("tbody", { ...props, "data-test": 'ring-table-body', children: tbody })] }));
|
|
146
146
|
};
|
|
147
147
|
const renderItem = ({ value, props = {}, isDragged }) => {
|
|
148
|
-
if (value
|
|
148
|
+
if (value === null || value === undefined) {
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
151
|
const { ref, ...restProps } = props;
|
|
152
152
|
const row = (_createElement(RowComponent, { innerRef: ref, level: getItemLevel(value), item: value, showFocus: selection.isFocused(value), autofocus: selection.isFocused(value), focused: focused && selection.isFocused(value), selectable: selectable && isItemSelectable(value), selected: selectable && selection.isSelected(value), onFocus: this.onRowFocus, onSelect: this.onRowSelect, onDoubleClick: onItemDoubleClick, onClick: onItemClick, collapsible: isItemCollapsible(value), parentCollapsible: isParentCollapsible(value), collapsed: isItemCollapsed(value), onCollapse: onItemCollapse, onExpand: onItemExpand, showDisabledSelection: isDisabledSelectionVisible(value), checkboxTooltip: getCheckboxTooltip(value), className: classNames(getItemClassName(value), { [style.draggingRow]: isDragged }), metaColumnClassName: getMetaColumnClassName(value), draggable: draggable, alwaysShowDragHandle: alwaysShowDragHandle, dragHandleTitle: dragHandleTitle, columns: columns, "data-test": getItemDataTest(value), ...restProps, key: restProps.key ?? getItemKey(value) }));
|
|
153
153
|
return isDragged ? (_jsx("table", { style: { ...props.style }, className: style.draggingTable, children: _jsx("tbody", { children: row }) })) : (row);
|
|
154
154
|
};
|
|
155
|
-
return (_jsxs("div", { className: wrapperClasses, "data-test":
|
|
155
|
+
return (_jsxs("div", { className: wrapperClasses, "data-test": 'ring-table-wrapper', ref: this.props.innerRef, children: [focused && _jsx(Shortcuts, { map: this.props.shortcutsMap, scope: this.state.shortcutsScope }), _jsx("div", { role: 'presentation', onMouseDown: this.onMouseDown, children: draggable ? (_jsx(List, { values: data, renderList: renderList, renderItem: renderItem, onChange: this.onSortEnd })) : (renderList({ children: data.map((value, index) => renderItem({ value, index })) })) }), loading && (_jsx("div", { className: style.loadingOverlay, children: renderLoader ? renderLoader(loaderClassName) : _jsx(Loader, { className: loaderClassName }) }))] }));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { ButtonButtonProps, ContainerProps } from '../button/button';
|
|
3
|
-
import { TabProps } from './tab';
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonButtonProps, type ContainerProps } from '../button/button';
|
|
3
|
+
import { type TabProps } from './tab';
|
|
4
4
|
export interface FakeMoreButtonProps {
|
|
5
5
|
hasActiveChildren: boolean;
|
|
6
6
|
moreClassName?: string | null | undefined;
|
|
@@ -14,7 +14,7 @@ export const AnchorLink = ({ hasActiveChildren, moreClassName, moreActiveClassNa
|
|
|
14
14
|
};
|
|
15
15
|
const morePopupDirections = [Directions.BOTTOM_CENTER, Directions.BOTTOM_LEFT, Directions.BOTTOM_RIGHT];
|
|
16
16
|
export const MoreButton = memo(({ items, selected, onSelect, moreClassName, moreActiveClassName, morePopupClassName, morePopupItemClassName, morePopupBeforeEnd, }) => {
|
|
17
|
-
const onSelectHandler = useMemo(() => onSelect
|
|
17
|
+
const onSelectHandler = useMemo(() => (onSelect
|
|
18
18
|
? (listItem) => {
|
|
19
19
|
if (listItem.disabled === true || listItem.custom === true) {
|
|
20
20
|
return;
|
|
@@ -22,7 +22,7 @@ export const MoreButton = memo(({ items, selected, onSelect, moreClassName, more
|
|
|
22
22
|
const cb = onSelect(String(listItem.key));
|
|
23
23
|
cb();
|
|
24
24
|
}
|
|
25
|
-
: undefined, [onSelect]);
|
|
25
|
+
: undefined), [onSelect]);
|
|
26
26
|
const hasActiveChild = useMemo(() => items.some(item => item.props.alwaysHidden && item.props.id === selected), [items, selected]);
|
|
27
27
|
const data = useMemo(() => {
|
|
28
28
|
const popupItems = getTabTitles({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { TabProps } from './tab';
|
|
3
|
+
import { type TabProps } from './tab';
|
|
4
4
|
export interface TabTitleProps {
|
|
5
5
|
selected: boolean;
|
|
6
6
|
child: ReactElement<TabProps> | null;
|