@jetbrains/ring-ui-built 6.0.1
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/LICENSE.txt +202 -0
- package/README.md +103 -0
- package/components/_helpers/_rollupPluginBabelHelpers.js +648 -0
- package/components/_helpers/anchor.js +31 -0
- package/components/_helpers/badge.js +3 -0
- package/components/_helpers/button__classes.js +34 -0
- package/components/_helpers/caption.js +31 -0
- package/components/_helpers/card.js +132 -0
- package/components/_helpers/date-picker.js +3 -0
- package/components/_helpers/dialog__body-scroll-preventer.js +54 -0
- package/components/_helpers/grid.js +3 -0
- package/components/_helpers/header.js +3 -0
- package/components/_helpers/heading.js +3 -0
- package/components/_helpers/icon__svg.js +75 -0
- package/components/_helpers/input.js +235 -0
- package/components/_helpers/island.js +3 -0
- package/components/_helpers/link.js +3 -0
- package/components/_helpers/list.js +3 -0
- package/components/_helpers/query-assist__suggestions.js +102 -0
- package/components/_helpers/select__filter.js +94 -0
- package/components/_helpers/services-link.js +48 -0
- package/components/_helpers/sidebar.js +123 -0
- package/components/_helpers/tab-link.js +34 -0
- package/components/_helpers/table.js +3 -0
- package/components/_helpers/theme.js +95 -0
- package/components/_helpers/title.js +103 -0
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +294 -0
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +52 -0
- package/components/alert-service/alert-service.d.ts +36 -0
- package/components/alert-service/alert-service.js +220 -0
- package/components/analytics/analytics.d.ts +18 -0
- package/components/analytics/analytics.js +31 -0
- package/components/analytics/analytics__custom-plugin.d.ts +28 -0
- package/components/analytics/analytics__custom-plugin.js +89 -0
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +133 -0
- package/components/auth/auth__core.d.ts +236 -0
- package/components/auth/auth__core.js +1653 -0
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +147 -0
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +157 -0
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +196 -0
- package/components/auth/request-builder.d.ts +48 -0
- package/components/auth/request-builder.js +104 -0
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +138 -0
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +429 -0
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +269 -0
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +154 -0
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +221 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +6 -0
- package/components/auth-dialog-service/auth-dialog-service.js +92 -0
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +4 -0
- package/components/avatar/avatar.d.ts +52 -0
- package/components/avatar/avatar.js +183 -0
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +151 -0
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +59 -0
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +131 -0
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +2 -0
- package/components/button-group/button-group.d.ts +18 -0
- package/components/button-group/button-group.js +48 -0
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +5 -0
- package/components/button-set/button-set.d.ts +16 -0
- package/components/button-set/button-set.js +47 -0
- package/components/button-toolbar/button-toolbar.d.ts +16 -0
- package/components/button-toolbar/button-toolbar.js +46 -0
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +259 -0
- package/components/checkbox/checkbox.d.ts +45 -0
- package/components/checkbox/checkbox.js +130 -0
- package/components/clipboard/clipboard-fallback.d.ts +2 -0
- package/components/clipboard/clipboard-fallback.js +42 -0
- package/components/clipboard/clipboard.d.ts +5 -0
- package/components/clipboard/clipboard.js +185 -0
- package/components/code/code.d.ts +44 -0
- package/components/code/code.js +191 -0
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +153 -0
- package/components/confirm-service/confirm-service.d.ts +21 -0
- package/components/confirm-service/confirm-service.js +141 -0
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +79 -0
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +7 -0
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +84 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +36 -0
- package/components/data-list/data-list.d.ts +85 -0
- package/components/data-list/data-list.js +251 -0
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +192 -0
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +235 -0
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +148 -0
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +28 -0
- package/components/date-picker/consts.d.ts +98 -0
- package/components/date-picker/consts.js +46 -0
- package/components/date-picker/date-input.d.ts +47 -0
- package/components/date-picker/date-input.js +177 -0
- package/components/date-picker/date-picker.d.ts +77 -0
- package/components/date-picker/date-picker.js +404 -0
- package/components/date-picker/date-popup.d.ts +55 -0
- package/components/date-picker/date-popup.js +488 -0
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +133 -0
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/formats.js +3 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +110 -0
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +93 -0
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +58 -0
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +133 -0
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +39 -0
- package/components/date-picker/years.d.ts +25 -0
- package/components/date-picker/years.js +134 -0
- package/components/dialog/dialog.d.ts +64 -0
- package/components/dialog/dialog.js +240 -0
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +6 -0
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +24 -0
- package/components/dropdown/dropdown.d.ts +87 -0
- package/components/dropdown/dropdown.js +247 -0
- package/components/dropdown-menu/dropdown-menu.d.ts +36 -0
- package/components/dropdown-menu/dropdown-menu.js +199 -0
- package/components/editable-heading/editable-heading.d.ts +32 -0
- package/components/editable-heading/editable-heading.js +276 -0
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +88 -0
- package/components/error-message/error-message.d.ts +27 -0
- package/components/error-message/error-message.js +78 -0
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +118 -0
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +17 -0
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +19 -0
- package/components/global/controls-height.d.ts +9 -0
- package/components/global/controls-height.js +19 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +49 -0
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +30 -0
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +151 -0
- package/components/global/focus-sensor-hoc.d.ts +19 -0
- package/components/global/focus-sensor-hoc.js +165 -0
- package/components/global/fuzzy-highlight.d.ts +11 -0
- package/components/global/fuzzy-highlight.js +90 -0
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +101 -0
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +22 -0
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +22 -0
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +15 -0
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +58 -0
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +23 -0
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +60 -0
- package/components/global/promise-with-timeout.d.ts +5 -0
- package/components/global/promise-with-timeout.js +19 -0
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +9 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +54 -0
- package/components/global/react-render-adapter.d.ts +1 -0
- package/components/global/react-render-adapter.js +6 -0
- package/components/global/rerender-hoc.d.ts +10 -0
- package/components/global/rerender-hoc.js +46 -0
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +28 -0
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +6 -0
- package/components/global/theme.d.ts +21 -0
- package/components/global/theme.js +42 -0
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +21 -0
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +8 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +142 -0
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +17 -0
- package/components/global/variables.d.ts +89 -0
- package/components/global/variables.js +1 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +80 -0
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +46 -0
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +75 -0
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +39 -0
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +189 -0
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +51 -0
- package/components/header/profile.d.ts +75 -0
- package/components/header/profile.js +258 -0
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +13 -0
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +174 -0
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +303 -0
- package/components/header/smart-services.d.ts +26 -0
- package/components/header/smart-services.js +192 -0
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +57 -0
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +41 -0
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +69 -0
- package/components/http/http.d.ts +61 -0
- package/components/http/http.js +386 -0
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +113 -0
- package/components/hub-source/hub-source.d.ts +44 -0
- package/components/hub-source/hub-source.js +217 -0
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +60 -0
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +86 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +27 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +139 -0
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +109 -0
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +34 -0
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +14 -0
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +17 -0
- package/components/input/input.d.ts +77 -0
- package/components/input/input.js +35 -0
- package/components/island/adaptive-island-hoc.d.ts +61 -0
- package/components/island/adaptive-island-hoc.js +53 -0
- package/components/island/content.d.ts +43 -0
- package/components/island/content.js +151 -0
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +100 -0
- package/components/island/island.d.ts +78 -0
- package/components/island/island.js +60 -0
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +34 -0
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +36 -0
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +36 -0
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +69 -0
- package/components/link/link.d.ts +138 -0
- package/components/link/link.js +86 -0
- package/components/list/consts.d.ts +77 -0
- package/components/list/consts.js +27 -0
- package/components/list/list.d.ts +205 -0
- package/components/list/list.js +802 -0
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +92 -0
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +33 -0
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +237 -0
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +76 -0
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +39 -0
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +48 -0
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +195 -0
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +93 -0
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +327 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +50 -0
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +64 -0
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +216 -0
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +98 -0
- package/components/markdown/markdown.d.ts +12 -0
- package/components/markdown/markdown.js +43 -0
- package/components/message/message.d.ts +55 -0
- package/components/message/message.js +267 -0
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +92 -0
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +11 -0
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +37 -0
- package/components/pager/pager.d.ts +78 -0
- package/components/pager/pager.js +390 -0
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +39 -0
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +221 -0
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +257 -0
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +44 -0
- package/components/popup/popup.d.ts +147 -0
- package/components/popup/popup.js +424 -0
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +24 -0
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +271 -0
- package/components/popup-menu/popup-menu.d.ts +80 -0
- package/components/popup-menu/popup-menu.js +141 -0
- package/components/progress-bar/progress-bar.d.ts +64 -0
- package/components/progress-bar/progress-bar.js +120 -0
- package/components/query-assist/query-assist.d.ts +306 -0
- package/components/query-assist/query-assist.js +1098 -0
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +75 -0
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +48 -0
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +88 -0
- package/components/select/select.d.ts +276 -0
- package/components/select/select.js +1310 -0
- package/components/select/select__filter.d.ts +19 -0
- package/components/select/select__filter.js +85 -0
- package/components/select/select__popup.d.ts +166 -0
- package/components/select/select__popup.js +631 -0
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +249 -0
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +56 -0
- package/components/shortcuts/shortcuts-hoc.d.ts +65 -0
- package/components/shortcuts/shortcuts-hoc.js +61 -0
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +92 -0
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +92 -0
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +254 -0
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +217 -0
- package/components/style.css +1 -0
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +180 -0
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +37 -0
- package/components/table/disable-hover-hoc.d.ts +64 -0
- package/components/table/disable-hover-hoc.js +62 -0
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +109 -0
- package/components/table/header.d.ts +56 -0
- package/components/table/header.js +151 -0
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +140 -0
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +117 -0
- package/components/table/row.d.ts +59 -0
- package/components/table/row.js +299 -0
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +14 -0
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +205 -0
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +257 -0
- package/components/table/smart-table.d.ts +64 -0
- package/components/table/smart-table.js +149 -0
- package/components/table/table.d.ts +159 -0
- package/components/table/table.js +463 -0
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +222 -0
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +88 -0
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +354 -0
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +11 -0
- package/components/tabs/dumb-tabs.d.ts +35 -0
- package/components/tabs/dumb-tabs.js +189 -0
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +141 -0
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +13 -0
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +41 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +99 -0
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +213 -0
- package/components/tags-input/tags-input.d.ts +138 -0
- package/components/tags-input/tags-input.js +534 -0
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +102 -0
- package/components/text/text.d.ts +23 -0
- package/components/text/text.js +57 -0
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +86 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +229 -0
- package/components/user-agreement/service.d.ts +69 -0
- package/components/user-agreement/service.js +487 -0
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/toolbox.eula.js +3 -0
- package/components/user-agreement/user-agreement.d.ts +60 -0
- package/components/user-agreement/user-agreement.js +172 -0
- package/components/user-card/card.d.ts +70 -0
- package/components/user-card/card.js +80 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +172 -0
- package/components/user-card/tooltip.d.ts +36 -0
- package/components/user-card/tooltip.js +144 -0
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +85 -0
- package/package.json +118 -0
- package/typings.d.ts +43 -0
@@ -0,0 +1,205 @@
|
|
1
|
+
import { g as _objectSpread2, e as _objectWithoutProperties, a as _inherits, b as _createSuper, c as _classCallCheck, _ as _defineProperty, k as _assertThisInitialized, d as _createClass, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import React, { PureComponent } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import Selection from './selection.js';
|
6
|
+
import 'core-js/modules/es.array.iterator.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/es.set.js';
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
10
|
+
import 'core-js/modules/es.array.filter.js';
|
11
|
+
import 'core-js/modules/es.array.index-of.js';
|
12
|
+
|
13
|
+
var _excluded = ["selection", "selectable", "onSelect", "shortcutsMap"],
|
14
|
+
_excluded2 = ["selection", "selectable", "onSelect", "shortcuts"];
|
15
|
+
function extractPropTypes(_ref) {
|
16
|
+
var propTypes = _ref.propTypes;
|
17
|
+
if (propTypes == null) {
|
18
|
+
return propTypes;
|
19
|
+
}
|
20
|
+
propTypes.selection;
|
21
|
+
propTypes.selectable;
|
22
|
+
propTypes.onSelect;
|
23
|
+
propTypes.shortcutsMap;
|
24
|
+
var restPropTypes = _objectWithoutProperties(propTypes, _excluded);
|
25
|
+
return restPropTypes;
|
26
|
+
}
|
27
|
+
function selectionShortcutsHOC(ComposedComponent) {
|
28
|
+
var SelectionShortcuts = /*#__PURE__*/function (_PureComponent) {
|
29
|
+
_inherits(SelectionShortcuts, _PureComponent);
|
30
|
+
var _super = _createSuper(SelectionShortcuts);
|
31
|
+
function SelectionShortcuts() {
|
32
|
+
var _this;
|
33
|
+
_classCallCheck(this, SelectionShortcuts);
|
34
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
35
|
+
args[_key] = arguments[_key];
|
36
|
+
}
|
37
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "onUpPress", function () {
|
39
|
+
var _this$props = _this.props,
|
40
|
+
selection = _this$props.selection,
|
41
|
+
onSelect = _this$props.onSelect;
|
42
|
+
var newSelection = selection.moveUp();
|
43
|
+
if (newSelection) {
|
44
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
45
|
+
}
|
46
|
+
return false;
|
47
|
+
});
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "onDownPress", function () {
|
49
|
+
var _this$props2 = _this.props,
|
50
|
+
selection = _this$props2.selection,
|
51
|
+
onSelect = _this$props2.onSelect;
|
52
|
+
var newSelection = selection.moveDown();
|
53
|
+
if (newSelection) {
|
54
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
55
|
+
}
|
56
|
+
return false;
|
57
|
+
});
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "shiftSelectionMode", void 0);
|
59
|
+
_defineProperty(_assertThisInitialized(_this), "onShiftKeyDown", function () {
|
60
|
+
var selection = _this.props.selection;
|
61
|
+
if (selection.isSelected(selection.getFocused())) {
|
62
|
+
_this.shiftSelectionMode = 'deletion';
|
63
|
+
} else {
|
64
|
+
_this.shiftSelectionMode = 'addition';
|
65
|
+
}
|
66
|
+
});
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "shiftSelect", function (selection) {
|
68
|
+
if (_this.shiftSelectionMode === 'addition') {
|
69
|
+
return selection.select();
|
70
|
+
} else {
|
71
|
+
return selection.deselect();
|
72
|
+
}
|
73
|
+
});
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "onShiftUpPress", function (e) {
|
75
|
+
e.preventDefault();
|
76
|
+
var _this$props3 = _this.props,
|
77
|
+
selectable = _this$props3.selectable,
|
78
|
+
selection = _this$props3.selection,
|
79
|
+
onSelect = _this$props3.onSelect;
|
80
|
+
if (!selectable) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
var newSelection = _this.shiftSelect(selection);
|
84
|
+
var newMovedSelection = newSelection.moveUp();
|
85
|
+
if (newMovedSelection) {
|
86
|
+
onSelect === null || onSelect === void 0 || onSelect(newMovedSelection);
|
87
|
+
} else {
|
88
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
89
|
+
}
|
90
|
+
});
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "onShiftDownPress", function (e) {
|
92
|
+
e.preventDefault();
|
93
|
+
var _this$props4 = _this.props,
|
94
|
+
selectable = _this$props4.selectable,
|
95
|
+
selection = _this$props4.selection,
|
96
|
+
onSelect = _this$props4.onSelect;
|
97
|
+
if (!selectable) {
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
var newSelection = _this.shiftSelect(selection);
|
101
|
+
var newMovedSelection = newSelection.moveDown();
|
102
|
+
if (newMovedSelection) {
|
103
|
+
onSelect === null || onSelect === void 0 || onSelect(newMovedSelection);
|
104
|
+
} else {
|
105
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
106
|
+
}
|
107
|
+
});
|
108
|
+
_defineProperty(_assertThisInitialized(_this), "onHomePress", function () {
|
109
|
+
var _this$props5 = _this.props,
|
110
|
+
selection = _this$props5.selection,
|
111
|
+
onSelect = _this$props5.onSelect;
|
112
|
+
var newSelection = selection.moveStart();
|
113
|
+
if (newSelection) {
|
114
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
115
|
+
}
|
116
|
+
return false;
|
117
|
+
});
|
118
|
+
_defineProperty(_assertThisInitialized(_this), "onEndPress", function () {
|
119
|
+
var _this$props6 = _this.props,
|
120
|
+
selection = _this$props6.selection,
|
121
|
+
onSelect = _this$props6.onSelect;
|
122
|
+
var newSelection = selection.moveEnd();
|
123
|
+
if (newSelection) {
|
124
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
125
|
+
}
|
126
|
+
return false;
|
127
|
+
});
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "onSpacePress", function () {
|
129
|
+
var _this$props7 = _this.props,
|
130
|
+
selectable = _this$props7.selectable,
|
131
|
+
selection = _this$props7.selection,
|
132
|
+
onSelect = _this$props7.onSelect;
|
133
|
+
if (!selectable) {
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.toggleSelection());
|
137
|
+
return false;
|
138
|
+
});
|
139
|
+
_defineProperty(_assertThisInitialized(_this), "onEscPress", function () {
|
140
|
+
var _this$props8 = _this.props,
|
141
|
+
selection = _this$props8.selection,
|
142
|
+
onSelect = _this$props8.onSelect;
|
143
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.reset());
|
144
|
+
//this.restoreFocusWithoutScroll();
|
145
|
+
});
|
146
|
+
_defineProperty(_assertThisInitialized(_this), "onCmdAPress", function () {
|
147
|
+
var _this$props9 = _this.props,
|
148
|
+
selectable = _this$props9.selectable,
|
149
|
+
selection = _this$props9.selection,
|
150
|
+
onSelect = _this$props9.onSelect;
|
151
|
+
if (!selectable) {
|
152
|
+
return true;
|
153
|
+
}
|
154
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.selectAll());
|
155
|
+
return false;
|
156
|
+
});
|
157
|
+
_defineProperty(_assertThisInitialized(_this), "shortcutsMap", {
|
158
|
+
up: _this.onUpPress,
|
159
|
+
down: _this.onDownPress,
|
160
|
+
shift: _this.onShiftKeyDown,
|
161
|
+
'shift+up': _this.onShiftUpPress,
|
162
|
+
'shift+down': _this.onShiftDownPress,
|
163
|
+
home: _this.onHomePress,
|
164
|
+
end: _this.onEndPress,
|
165
|
+
space: _this.onSpacePress,
|
166
|
+
esc: _this.onEscPress,
|
167
|
+
'command+a': _this.onCmdAPress,
|
168
|
+
'ctrl+a': _this.onCmdAPress
|
169
|
+
});
|
170
|
+
return _this;
|
171
|
+
}
|
172
|
+
_createClass(SelectionShortcuts, [{
|
173
|
+
key: "render",
|
174
|
+
value: function render() {
|
175
|
+
var _this$props10 = this.props,
|
176
|
+
selection = _this$props10.selection,
|
177
|
+
selectable = _this$props10.selectable,
|
178
|
+
onSelect = _this$props10.onSelect;
|
179
|
+
_this$props10.shortcuts;
|
180
|
+
var restProps = _objectWithoutProperties(_this$props10, _excluded2);
|
181
|
+
return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, restProps, {
|
182
|
+
selection: selection,
|
183
|
+
selectable: selectable,
|
184
|
+
onSelect: onSelect,
|
185
|
+
shortcutsMap: _objectSpread2(_objectSpread2({}, this.shortcutsMap), this.props.shortcuts)
|
186
|
+
}));
|
187
|
+
}
|
188
|
+
}]);
|
189
|
+
return SelectionShortcuts;
|
190
|
+
}(PureComponent);
|
191
|
+
SelectionShortcuts.propTypes = _objectSpread2(_objectSpread2({}, extractPropTypes(ComposedComponent)), {}, {
|
192
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
193
|
+
selectable: PropTypes.bool,
|
194
|
+
onSelect: PropTypes.func,
|
195
|
+
shortcuts: PropTypes.object
|
196
|
+
});
|
197
|
+
SelectionShortcuts.defaultProps = _objectSpread2(_objectSpread2({}, ComposedComponent.defaultProps), {}, {
|
198
|
+
selectable: true,
|
199
|
+
onSelect: function onSelect() {},
|
200
|
+
shortcuts: {}
|
201
|
+
});
|
202
|
+
return SelectionShortcuts;
|
203
|
+
}
|
204
|
+
|
205
|
+
export { selectionShortcutsHOC as default };
|
@@ -0,0 +1,47 @@
|
|
1
|
+
export interface SelectionItem {
|
2
|
+
id: string | number;
|
3
|
+
[key: string]: unknown;
|
4
|
+
}
|
5
|
+
export interface TableSelectionConfig<T extends SelectionItem> {
|
6
|
+
data?: readonly T[] | undefined;
|
7
|
+
selected?: Set<T> | undefined;
|
8
|
+
focused?: T | null | undefined;
|
9
|
+
getKey?: ((item: T) => string | number) | undefined;
|
10
|
+
isItemSelectable?: ((item: T) => boolean | undefined) | undefined;
|
11
|
+
getChildren?: ((item: T) => readonly T[]) | undefined;
|
12
|
+
}
|
13
|
+
export interface CloneWithConfig<T> {
|
14
|
+
data?: readonly T[] | null | undefined;
|
15
|
+
selected?: Set<T> | readonly T[] | null | undefined;
|
16
|
+
focused?: T | null | undefined;
|
17
|
+
}
|
18
|
+
export default class Selection<T extends SelectionItem> {
|
19
|
+
private _rawData;
|
20
|
+
protected _getChildren: ((item: T) => readonly T[]);
|
21
|
+
protected _data: Set<T>;
|
22
|
+
protected _selected: Set<T>;
|
23
|
+
protected _focused: T | null;
|
24
|
+
private _getKey;
|
25
|
+
protected _isItemSelectable: (item: T) => boolean | undefined;
|
26
|
+
constructor({ data, selected, focused, getKey, getChildren, isItemSelectable }?: TableSelectionConfig<T>);
|
27
|
+
protected _buildData(data: readonly T[] | null | undefined): Set<T>;
|
28
|
+
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
29
|
+
cloneWith({ data, selected, focused }: CloneWithConfig<T>): Selection<T>;
|
30
|
+
focus(value: T | null | undefined): Selection<T>;
|
31
|
+
moveUp(): Selection<T> | undefined;
|
32
|
+
moveDown(): Selection<T> | undefined;
|
33
|
+
moveStart(): Selection<T> | undefined;
|
34
|
+
moveEnd(): Selection<T> | undefined;
|
35
|
+
select(value?: T | null): Selection<T>;
|
36
|
+
deselect(value?: T | null): Selection<T>;
|
37
|
+
toggleSelection(value?: T | null): Selection<T>;
|
38
|
+
selectAll(): Selection<T>;
|
39
|
+
resetFocus(): Selection<T>;
|
40
|
+
resetSelection(): Selection<T>;
|
41
|
+
reset(): Selection<T>;
|
42
|
+
isFocused(value: T | null): boolean;
|
43
|
+
isSelected(value: T | null): boolean;
|
44
|
+
getFocused(): T | null;
|
45
|
+
getSelected(): Set<T>;
|
46
|
+
getActive(): Set<T>;
|
47
|
+
}
|
@@ -0,0 +1,257 @@
|
|
1
|
+
import { d as _createClass, l as _toConsumableArray, c as _classCallCheck, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.iterator.js';
|
3
|
+
import 'core-js/modules/es.object.to-string.js';
|
4
|
+
import 'core-js/modules/es.set.js';
|
5
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
6
|
+
import 'core-js/modules/es.array.filter.js';
|
7
|
+
import 'core-js/modules/es.array.index-of.js';
|
8
|
+
|
9
|
+
var Selection = /*#__PURE__*/function () {
|
10
|
+
function Selection() {
|
11
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
12
|
+
_ref$data = _ref.data,
|
13
|
+
data = _ref$data === void 0 ? [] : _ref$data,
|
14
|
+
_ref$selected = _ref.selected,
|
15
|
+
selected = _ref$selected === void 0 ? new Set() : _ref$selected,
|
16
|
+
_ref$focused = _ref.focused,
|
17
|
+
focused = _ref$focused === void 0 ? null : _ref$focused,
|
18
|
+
_ref$getKey = _ref.getKey,
|
19
|
+
getKey = _ref$getKey === void 0 ? function (item) {
|
20
|
+
return item.id;
|
21
|
+
} : _ref$getKey,
|
22
|
+
_ref$getChildren = _ref.getChildren,
|
23
|
+
getChildren = _ref$getChildren === void 0 ? function () {
|
24
|
+
return [];
|
25
|
+
} : _ref$getChildren,
|
26
|
+
_ref$isItemSelectable = _ref.isItemSelectable,
|
27
|
+
isItemSelectable = _ref$isItemSelectable === void 0 ? function () {
|
28
|
+
return true;
|
29
|
+
} : _ref$isItemSelectable;
|
30
|
+
_classCallCheck(this, Selection);
|
31
|
+
_defineProperty(this, "_rawData", void 0);
|
32
|
+
_defineProperty(this, "_getChildren", void 0);
|
33
|
+
_defineProperty(this, "_data", void 0);
|
34
|
+
_defineProperty(this, "_selected", void 0);
|
35
|
+
_defineProperty(this, "_focused", void 0);
|
36
|
+
_defineProperty(this, "_getKey", void 0);
|
37
|
+
_defineProperty(this, "_isItemSelectable", void 0);
|
38
|
+
this._rawData = data;
|
39
|
+
this._getChildren = getChildren;
|
40
|
+
this._data = this._buildData(data);
|
41
|
+
this._selected = selected;
|
42
|
+
this._focused = focused;
|
43
|
+
this._getKey = getKey;
|
44
|
+
this._isItemSelectable = isItemSelectable;
|
45
|
+
}
|
46
|
+
_createClass(Selection, [{
|
47
|
+
key: "_buildData",
|
48
|
+
value: function _buildData(data) {
|
49
|
+
return new Set(data);
|
50
|
+
}
|
51
|
+
}, {
|
52
|
+
key: "_buildSelected",
|
53
|
+
value: function _buildSelected(data, selected) {
|
54
|
+
return new Set(selected);
|
55
|
+
}
|
56
|
+
}, {
|
57
|
+
key: "cloneWith",
|
58
|
+
value: function cloneWith(_ref2) {
|
59
|
+
var _this = this;
|
60
|
+
var data = _ref2.data,
|
61
|
+
selected = _ref2.selected,
|
62
|
+
focused = _ref2.focused;
|
63
|
+
var newData = data || this._rawData;
|
64
|
+
var newSelected;
|
65
|
+
if (data && !selected) {
|
66
|
+
newSelected = new Set(_toConsumableArray(this._buildData(newData)).filter(function (item) {
|
67
|
+
return _toConsumableArray(_this._selected).some(function (it) {
|
68
|
+
return _this._getKey(item) === _this._getKey(it);
|
69
|
+
});
|
70
|
+
}));
|
71
|
+
newSelected = this._buildSelected(this._buildData(newData), newSelected);
|
72
|
+
} else if (selected) {
|
73
|
+
newSelected = selected;
|
74
|
+
} else {
|
75
|
+
newSelected = this._selected;
|
76
|
+
}
|
77
|
+
newSelected = new Set(_toConsumableArray(newSelected).filter(function (item) {
|
78
|
+
return _this._isItemSelectable(item);
|
79
|
+
}));
|
80
|
+
var cloneFocus = function cloneFocus() {
|
81
|
+
return _toConsumableArray(_this._buildData(data)).filter(function (item) {
|
82
|
+
return _this._focused && _this._getKey(item) === _this._getKey(_this._focused);
|
83
|
+
})[0];
|
84
|
+
};
|
85
|
+
var newFocused = focused === undefined ? this._focused : focused;
|
86
|
+
return new this.constructor({
|
87
|
+
data: newData,
|
88
|
+
selected: newSelected,
|
89
|
+
focused: data && !focused ? cloneFocus() : newFocused,
|
90
|
+
getKey: this._getKey,
|
91
|
+
getChildren: this._getChildren,
|
92
|
+
isItemSelectable: this._isItemSelectable
|
93
|
+
});
|
94
|
+
}
|
95
|
+
}, {
|
96
|
+
key: "focus",
|
97
|
+
value: function focus(value) {
|
98
|
+
return this.cloneWith({
|
99
|
+
focused: value
|
100
|
+
});
|
101
|
+
}
|
102
|
+
}, {
|
103
|
+
key: "moveUp",
|
104
|
+
value: function moveUp() {
|
105
|
+
var focused = this._focused;
|
106
|
+
var data = _toConsumableArray(this._data);
|
107
|
+
if (!focused) {
|
108
|
+
return this.cloneWith({
|
109
|
+
focused: data[data.length - 1]
|
110
|
+
});
|
111
|
+
}
|
112
|
+
var nextItem = data[data.indexOf(focused) - 1];
|
113
|
+
if (nextItem) {
|
114
|
+
return this.cloneWith({
|
115
|
+
focused: nextItem
|
116
|
+
});
|
117
|
+
}
|
118
|
+
return undefined;
|
119
|
+
}
|
120
|
+
}, {
|
121
|
+
key: "moveDown",
|
122
|
+
value: function moveDown() {
|
123
|
+
var focused = this._focused;
|
124
|
+
var data = _toConsumableArray(this._data);
|
125
|
+
if (!focused) {
|
126
|
+
return this.cloneWith({
|
127
|
+
focused: data[0]
|
128
|
+
});
|
129
|
+
}
|
130
|
+
var nextItem = data[data.indexOf(focused) + 1];
|
131
|
+
if (nextItem) {
|
132
|
+
return this.cloneWith({
|
133
|
+
focused: nextItem
|
134
|
+
});
|
135
|
+
}
|
136
|
+
return undefined;
|
137
|
+
}
|
138
|
+
}, {
|
139
|
+
key: "moveStart",
|
140
|
+
value: function moveStart() {
|
141
|
+
var data = _toConsumableArray(this._data);
|
142
|
+
if (data.length) {
|
143
|
+
return this.cloneWith({
|
144
|
+
focused: data[0]
|
145
|
+
});
|
146
|
+
}
|
147
|
+
return undefined;
|
148
|
+
}
|
149
|
+
}, {
|
150
|
+
key: "moveEnd",
|
151
|
+
value: function moveEnd() {
|
152
|
+
var data = _toConsumableArray(this._data);
|
153
|
+
if (data.length) {
|
154
|
+
return this.cloneWith({
|
155
|
+
focused: data.pop()
|
156
|
+
});
|
157
|
+
}
|
158
|
+
return undefined;
|
159
|
+
}
|
160
|
+
}, {
|
161
|
+
key: "select",
|
162
|
+
value: function select() {
|
163
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
164
|
+
if (!value || !this._isItemSelectable(value)) {
|
165
|
+
return this;
|
166
|
+
}
|
167
|
+
var selected = new Set(this._selected);
|
168
|
+
selected.add(value);
|
169
|
+
return this.cloneWith({
|
170
|
+
selected
|
171
|
+
});
|
172
|
+
}
|
173
|
+
}, {
|
174
|
+
key: "deselect",
|
175
|
+
value: function deselect() {
|
176
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
177
|
+
if (!value || !this._isItemSelectable(value)) {
|
178
|
+
return this;
|
179
|
+
}
|
180
|
+
var selected = new Set(this._selected);
|
181
|
+
selected.delete(value);
|
182
|
+
return this.cloneWith({
|
183
|
+
selected
|
184
|
+
});
|
185
|
+
}
|
186
|
+
}, {
|
187
|
+
key: "toggleSelection",
|
188
|
+
value: function toggleSelection() {
|
189
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
190
|
+
if (this.isSelected(value)) {
|
191
|
+
return this.deselect(value);
|
192
|
+
} else {
|
193
|
+
return this.select(value);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}, {
|
197
|
+
key: "selectAll",
|
198
|
+
value: function selectAll() {
|
199
|
+
return this.cloneWith({
|
200
|
+
selected: _toConsumableArray(this._data)
|
201
|
+
});
|
202
|
+
}
|
203
|
+
}, {
|
204
|
+
key: "resetFocus",
|
205
|
+
value: function resetFocus() {
|
206
|
+
return this.cloneWith({
|
207
|
+
focused: null
|
208
|
+
});
|
209
|
+
}
|
210
|
+
}, {
|
211
|
+
key: "resetSelection",
|
212
|
+
value: function resetSelection() {
|
213
|
+
return this.cloneWith({
|
214
|
+
selected: new Set()
|
215
|
+
});
|
216
|
+
}
|
217
|
+
}, {
|
218
|
+
key: "reset",
|
219
|
+
value: function reset() {
|
220
|
+
return this.resetFocus().resetSelection();
|
221
|
+
}
|
222
|
+
}, {
|
223
|
+
key: "isFocused",
|
224
|
+
value: function isFocused(value) {
|
225
|
+
return this._focused === value;
|
226
|
+
}
|
227
|
+
}, {
|
228
|
+
key: "isSelected",
|
229
|
+
value: function isSelected(value) {
|
230
|
+
return value != null && this._selected.has(value);
|
231
|
+
}
|
232
|
+
}, {
|
233
|
+
key: "getFocused",
|
234
|
+
value: function getFocused() {
|
235
|
+
return this._focused;
|
236
|
+
}
|
237
|
+
}, {
|
238
|
+
key: "getSelected",
|
239
|
+
value: function getSelected() {
|
240
|
+
return new Set(this._selected);
|
241
|
+
}
|
242
|
+
}, {
|
243
|
+
key: "getActive",
|
244
|
+
value: function getActive() {
|
245
|
+
if (this._selected.size) {
|
246
|
+
return new Set(this._selected);
|
247
|
+
} else if (this._focused) {
|
248
|
+
return new Set([this._focused]);
|
249
|
+
} else {
|
250
|
+
return new Set();
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}]);
|
254
|
+
return Selection;
|
255
|
+
}();
|
256
|
+
|
257
|
+
export { Selection as default };
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import React, { PureComponent } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { TableAttrs } from './table';
|
4
|
+
import Selection, { SelectionItem } from './selection';
|
5
|
+
export interface SmartTableProps<T extends SelectionItem> extends Omit<TableAttrs<T>, 'selection' | 'onSelect'> {
|
6
|
+
onSelectionChange: (selection: Selection<T>) => void;
|
7
|
+
selection?: Selection<T>;
|
8
|
+
}
|
9
|
+
declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTableProps<T>> {
|
10
|
+
static propTypes: {
|
11
|
+
className?: React.Validator<string | null | undefined> | undefined;
|
12
|
+
onFocus?: React.Validator<(() => void) | null | undefined> | undefined;
|
13
|
+
onBlur?: React.Validator<(() => void) | null | undefined> | undefined;
|
14
|
+
caption?: React.Validator<string | null | undefined> | undefined;
|
15
|
+
data?: React.Validator<readonly SelectionItem[]> | undefined;
|
16
|
+
loading?: React.Validator<boolean | null | undefined> | undefined;
|
17
|
+
draggable?: React.Validator<boolean | null | undefined> | undefined;
|
18
|
+
columns?: React.Validator<readonly import("./header-cell").Column<SelectionItem>[]> | undefined;
|
19
|
+
focused?: React.Validator<boolean | null | undefined> | undefined;
|
20
|
+
isItemSelectable: PropTypes.Requireable<(...args: any[]) => any> | React.Validator<((item: SelectionItem) => boolean) | null | undefined>;
|
21
|
+
innerRef?: React.Validator<React.Ref<HTMLTableRowElement> | undefined> | undefined;
|
22
|
+
autofocus?: React.Validator<boolean | null | undefined> | undefined;
|
23
|
+
scrollOnTableFocus?: React.Validator<boolean | null | undefined> | undefined;
|
24
|
+
disabledHover?: React.Validator<boolean> | undefined;
|
25
|
+
remoteSelection?: React.Validator<boolean | null | undefined> | undefined;
|
26
|
+
onSort?: React.Validator<((params: import("./header-cell").SortParams) => void) | null | undefined> | undefined;
|
27
|
+
sortKey?: React.Validator<string | null | undefined> | undefined;
|
28
|
+
sortOrder?: React.Validator<boolean | null | undefined> | undefined;
|
29
|
+
alwaysShowDragHandle?: React.Validator<boolean | null | undefined> | undefined;
|
30
|
+
dragHandleTitle?: React.Validator<string | null | undefined> | undefined;
|
31
|
+
onReorder?: React.Validator<((params: import("./table").ReorderParams<SelectionItem>) => void) | null | undefined> | undefined;
|
32
|
+
getItemKey?: React.Validator<((item: SelectionItem) => string | number) | null | undefined> | undefined;
|
33
|
+
stickyHeader?: React.Validator<boolean | null | undefined> | undefined;
|
34
|
+
getItemLevel?: React.Validator<((item: SelectionItem) => number) | null | undefined> | undefined;
|
35
|
+
getItemClassName?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
36
|
+
getMetaColumnClassName?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
37
|
+
getItemDataTest?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
38
|
+
isItemCollapsible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
39
|
+
isParentCollapsible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
40
|
+
isItemCollapsed?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
41
|
+
onItemCollapse?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
42
|
+
onItemExpand?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
43
|
+
onItemDoubleClick?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
44
|
+
onItemClick?: React.Validator<((item: SelectionItem, e: React.MouseEvent<HTMLTableRowElement, MouseEvent>) => void) | null | undefined> | undefined;
|
45
|
+
isDisabledSelectionVisible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
46
|
+
getCheckboxTooltip?: React.Validator<((item: SelectionItem) => string | undefined) | null | undefined> | undefined;
|
47
|
+
loaderClassName?: React.Validator<string | null | undefined> | undefined;
|
48
|
+
stickyHeaderOffset?: React.Validator<string | null | undefined> | undefined;
|
49
|
+
renderEmpty?: React.Validator<(() => React.ReactNode) | null | undefined> | undefined;
|
50
|
+
selectable?: React.Validator<boolean | null | undefined> | undefined;
|
51
|
+
shortcuts?: React.Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
52
|
+
onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
53
|
+
};
|
54
|
+
static defaultProps: {
|
55
|
+
onSelectionChange: () => void;
|
56
|
+
};
|
57
|
+
state: {
|
58
|
+
selection: Selection<T>;
|
59
|
+
};
|
60
|
+
UNSAFE_componentWillReceiveProps(nextProps: SmartTableProps<T>): void;
|
61
|
+
onSelect: (selection: Selection<T>) => void;
|
62
|
+
render(): React.JSX.Element;
|
63
|
+
}
|
64
|
+
export default SmartTable;
|