@jetbrains/ring-ui 5.0.127 → 5.0.129
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.js +2 -1
- package/components/alert/container.js +2 -1
- package/components/auth/auth__core.js +2 -1
- package/components/auth/request-builder.js +2 -1
- package/components/auth/response-parser.js +2 -1
- package/components/auth/token-validator.js +2 -1
- package/components/auth-dialog/auth-dialog.js +2 -1
- package/components/avatar/avatar.js +2 -1
- package/components/badge/badge.js +2 -1
- package/components/button/button.js +2 -1
- package/components/button-group/button-group.js +2 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.js +2 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/caret/caret.js +2 -1
- package/components/checkbox/checkbox.js +2 -1
- package/components/code/code.js +2 -1
- package/components/confirm/confirm.js +2 -1
- package/components/content-layout/content-layout.js +2 -1
- package/components/content-layout/sidebar.js +2 -1
- package/components/data-list/data-list.js +2 -1
- package/components/data-list/item.js +2 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.js +2 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.js +2 -1
- package/components/date-picker/month-slider.js +2 -1
- package/components/date-picker/years.js +2 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +6 -3
- package/components/dropdown/dropdown.js +2 -1
- package/components/error-bubble/error-bubble.js +2 -1
- package/components/error-message/error-message.js +2 -1
- package/components/footer/footer.js +1 -0
- package/components/global/react-dom-renderer.js +2 -1
- package/components/grid/col.js +2 -1
- package/components/grid/grid.js +2 -1
- package/components/grid/row.js +2 -1
- package/components/group/group.js +2 -1
- package/components/header/logo.js +2 -1
- package/components/header/profile.js +2 -1
- package/components/header/services-link.js +2 -1
- package/components/header/services.js +2 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray-icon.js +2 -1
- package/components/header/tray.js +2 -1
- package/components/hub-source/hub-source.js +2 -1
- package/components/icon/icon.js +2 -1
- package/components/input/input.js +2 -1
- package/components/island/island.js +2 -1
- package/components/island-legacy/content-legacy.js +2 -1
- package/components/island-legacy/header-legacy.js +2 -1
- package/components/island-legacy/island-legacy.js +2 -1
- package/components/link/clickableLink.js +2 -1
- package/components/list/list.js +2 -1
- package/components/list/list__hint.js +2 -1
- package/components/list/list__users-groups-source.js +2 -1
- package/components/loader/loader.js +2 -1
- package/components/loader/loader__core.js +2 -1
- package/components/loader-screen/loader-screen.js +2 -1
- package/components/login-dialog/login-dialog.js +2 -1
- package/components/message/message.js +2 -1
- package/components/pager/pager.js +2 -1
- package/components/panel/panel.js +2 -1
- package/components/permissions/permissions.js +2 -1
- package/components/permissions/permissions__cache.js +2 -1
- package/components/popup/popup.js +2 -1
- package/components/popup-menu/popup-menu.js +2 -1
- package/components/progress-bar/progress-bar.js +2 -1
- package/components/query-assist/query-assist.js +4 -3
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.js +2 -1
- package/components/select/select.js +2 -1
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +4 -2
- package/components/shortcuts/shortcuts.js +2 -1
- package/components/storage/storage__fallback.js +2 -1
- package/components/tab-trap/tab-trap.js +2 -1
- package/components/table/cell.js +2 -1
- package/components/table/header-cell.js +2 -1
- package/components/table/header.js +2 -1
- package/components/table/multitable.js +2 -1
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +6 -4
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +2 -0
- package/components/table/table.js +8 -4
- package/components/tabs/smart-tabs.js +2 -1
- package/components/tabs/tab.js +2 -1
- package/components/tag/tag.js +2 -1
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +3 -2
- package/components/tags-list/tags-list.js +2 -1
- package/components/text/text.js +2 -1
- package/components/tooltip/tooltip.js +2 -1
- package/components/user-agreement/user-agreement.js +2 -1
- package/components/user-card/card.js +2 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +2 -1
- package/components/user-card/tooltip.js +2 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
- package/dist/_helpers/anchor.js +1 -1
- package/dist/_helpers/card.js +44 -47
- package/dist/_helpers/footer.js +1 -0
- package/dist/_helpers/select__filter.js +10 -13
- package/dist/_helpers/services-link.js +10 -10
- package/dist/_helpers/sidebar.js +34 -37
- package/dist/_helpers/theme.js +1 -1
- package/dist/_helpers/title.js +12 -16
- package/dist/alert/alert.js +63 -66
- package/dist/alert/container.js +5 -5
- package/dist/alert-service/alert-service.js +5 -7
- package/dist/analytics/analytics.js +1 -2
- package/dist/analytics/analytics__custom-plugin.js +6 -8
- package/dist/auth/auth.js +1 -1
- package/dist/auth/auth__core.js +26 -26
- package/dist/auth/background-flow.js +4 -5
- package/dist/auth/iframe-flow.js +12 -12
- package/dist/auth/landing.js +1 -1
- package/dist/auth/request-builder.js +3 -5
- package/dist/auth/response-parser.js +5 -6
- package/dist/auth/storage.js +12 -12
- package/dist/auth/token-validator.js +13 -16
- package/dist/auth/window-flow.js +18 -19
- package/dist/auth-dialog/auth-dialog.js +54 -57
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +1 -1
- package/dist/avatar/avatar.js +30 -33
- package/dist/avatar-ng/avatar-ng.js +1 -1
- package/dist/badge/badge.js +10 -10
- package/dist/badge-ng/badge-ng.js +1 -1
- package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
- package/dist/button/button.js +24 -27
- package/dist/button-group/button-group.js +5 -5
- package/dist/button-group/caption.js +4 -4
- package/dist/button-ng/button-ng.js +68 -69
- package/dist/button-set/button-set.js +6 -6
- package/dist/button-toolbar/button-toolbar.js +6 -6
- package/dist/caret/caret.js +2 -4
- package/dist/checkbox/checkbox.js +27 -30
- package/dist/checkbox-ng/checkbox-ng.js +0 -1
- package/dist/code/code.js +17 -21
- package/dist/confirm/confirm.js +31 -34
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/content-layout/content-layout.js +17 -20
- package/dist/contenteditable/contenteditable.js +11 -11
- package/dist/data-list/data-list.js +49 -55
- package/dist/data-list/item.js +64 -67
- package/dist/data-list/selection.js +0 -1
- package/dist/data-list/title.js +1 -1
- package/dist/data-list-ng/data-list-ng.js +1 -1
- package/dist/date-picker/date-input.js +39 -42
- package/dist/date-picker/date-picker.js +162 -165
- package/dist/date-picker/date-popup.js +119 -119
- package/dist/date-picker/day.js +34 -38
- package/dist/date-picker/month-names.js +11 -14
- package/dist/date-picker/month-slider.js +24 -28
- package/dist/date-picker/month.js +1 -1
- package/dist/date-picker/months.js +1 -1
- package/dist/date-picker/years.js +9 -13
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +68 -65
- package/dist/dialog-ng/dialog-ng.js +21 -22
- package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
- package/dist/dropdown/dropdown.js +101 -104
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/editable-heading/editable-heading.js +1 -1
- package/dist/error-bubble/error-bubble.js +6 -6
- package/dist/error-message/error-message.js +10 -10
- package/dist/error-message-ng/error-message-ng.js +0 -1
- package/dist/footer-ng/footer-ng.js +19 -21
- package/dist/global/angular-component-factory.js +2 -3
- package/dist/global/dom.js +1 -5
- package/dist/global/focus-sensor-hoc.js +58 -61
- package/dist/global/listeners.js +1 -5
- package/dist/global/react-dom-renderer.js +8 -12
- package/dist/global/rerender-hoc.js +1 -5
- package/dist/global/ring-angular-component.js +1 -3
- package/dist/grid/col.js +13 -14
- package/dist/grid/grid.js +5 -5
- package/dist/grid/row.js +16 -17
- package/dist/group/group.js +5 -5
- package/dist/header/header.js +10 -10
- package/dist/header/logo.js +9 -9
- package/dist/header/profile.js +58 -58
- package/dist/header/services.js +19 -22
- package/dist/header/smart-profile.js +40 -43
- package/dist/header/smart-services.js +28 -31
- package/dist/header/tray-icon.js +6 -6
- package/dist/header/tray.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/heading-ng/heading-ng.js +1 -1
- package/dist/http/http.js +111 -107
- package/dist/http/http.mock.js +3 -4
- package/dist/hub-source/hub-source.js +7 -9
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +4 -5
- package/dist/icon/icon.js +18 -18
- package/dist/icon/icon__svg.js +1 -1
- package/dist/icon-ng/icon-ng.js +0 -1
- package/dist/input/input.js +35 -38
- package/dist/input-ng/input-ng.js +25 -26
- package/dist/island/adaptive-island-hoc.js +21 -25
- package/dist/island/content.js +62 -65
- package/dist/island/header.js +11 -11
- package/dist/island/island.js +8 -8
- package/dist/island-legacy/content-legacy.js +5 -5
- package/dist/island-legacy/header-legacy.js +5 -5
- package/dist/island-legacy/island-legacy.js +5 -5
- package/dist/link/clickableLink.js +27 -30
- package/dist/link/link.js +16 -16
- package/dist/list/list.js +389 -391
- package/dist/list/list__custom.js +6 -10
- package/dist/list/list__hint.js +3 -4
- package/dist/list/list__item.js +4 -7
- package/dist/list/list__link.js +1 -1
- package/dist/list/list__users-groups-source.js +3 -3
- package/dist/loader/loader.js +16 -19
- package/dist/loader/loader__core.js +62 -62
- package/dist/loader-inline/loader-inline.js +6 -6
- package/dist/loader-ng/loader-ng.js +3 -4
- package/dist/loader-screen/loader-screen.js +6 -6
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
- package/dist/login-dialog/login-dialog.js +55 -58
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.js +0 -1
- package/dist/markdown/markdown.js +1 -1
- package/dist/message/message.js +22 -25
- package/dist/old-browsers-message/white-list.js +2 -2
- package/dist/pager/pager.js +55 -58
- package/dist/pager-ng/pager-ng.js +1 -1
- package/dist/panel/panel.js +5 -5
- package/dist/panel-ng/panel-ng.js +0 -1
- package/dist/permissions/permissions.js +14 -16
- package/dist/permissions/permissions__cache.js +4 -6
- package/dist/permissions-ng/permissions-ng.js +1 -1
- package/dist/place-under-ng/place-under-ng.js +0 -1
- package/dist/popup/popup.js +118 -121
- package/dist/popup/popup.target.js +1 -1
- package/dist/popup/position.js +0 -1
- package/dist/popup-menu/popup-menu.js +19 -22
- package/dist/progress-bar/progress-bar.js +41 -44
- package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
- package/dist/promised-click-ng/promised-click-ng.js +0 -1
- package/dist/query-assist/query-assist.js +507 -501
- package/dist/query-assist/query-assist__suggestions.js +1 -1
- package/dist/query-assist-ng/query-assist-ng.js +1 -1
- package/dist/radio/radio.js +10 -13
- package/dist/radio/radio__item.js +19 -22
- package/dist/select/select.js +350 -349
- package/dist/select/select__popup.js +148 -152
- package/dist/select-ng/select-ng.js +1 -1
- package/dist/select-ng/select-ng__lazy.js +4 -4
- package/dist/select-ng/select-ng__options.js +14 -15
- package/dist/shortcuts/core.js +35 -36
- package/dist/shortcuts/shortcuts-hoc.js +7 -11
- package/dist/shortcuts/shortcuts.js +10 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
- package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
- package/dist/sidebar-ng/sidebar-ng.js +0 -1
- package/dist/storage/storage.js +1 -1
- package/dist/storage/storage__fallback.js +8 -10
- package/dist/storage/storage__local.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +84 -86
- package/dist/table/cell.js +6 -6
- package/dist/table/disable-hover-hoc.js +23 -25
- package/dist/table/header-cell.js +28 -31
- package/dist/table/header.js +58 -61
- package/dist/table/multitable.js +91 -95
- package/dist/table/row-with-focus-sensor.js +15 -18
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +54 -55
- package/dist/table/selection-shortcuts-hoc.js +145 -147
- package/dist/table/selection.js +7 -9
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +21 -24
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.js +107 -109
- package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +1 -1
- package/dist/tabs/dumb-tabs.js +46 -49
- package/dist/tabs/smart-tabs.js +10 -10
- package/dist/tabs/tab.js +7 -8
- package/dist/tag/tag.js +42 -45
- package/dist/tags-input/tags-input.d.ts +1 -1
- package/dist/tags-input/tags-input.js +214 -213
- package/dist/tags-input-ng/tags-input-ng.js +1 -1
- package/dist/tags-list/tags-list.js +20 -20
- package/dist/template-ng/template-ng.js +25 -26
- package/dist/text/text.js +6 -6
- package/dist/toggle/toggle.js +19 -19
- package/dist/toggle-ng/toggle-ng.js +1 -1
- package/dist/tooltip/tooltip.js +86 -89
- package/dist/tooltip-ng/tooltip-ng.js +1 -1
- package/dist/user-agreement/service.js +207 -205
- package/dist/user-agreement/user-agreement.js +39 -42
- package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/dist/user-card/smart-user-card-tooltip.js +32 -35
- package/dist/user-card/tooltip.js +26 -26
- package/dist/user-card-ng/user-card-ng.js +1 -1
- package/package.json +17 -17
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React, { PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import searchIcon from '@jetbrains/icons/search';
|
|
@@ -22,6 +21,7 @@ import Text from '../text/text.js';
|
|
|
22
21
|
import { ControlsHeight } from '../global/controls-height.js';
|
|
23
22
|
import { DEFAULT_DIRECTIONS } from '../popup/popup.consts.js';
|
|
24
23
|
import { S as SelectFilter, m as modules_b607bec2 } from '../_helpers/select__filter.js';
|
|
24
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
25
25
|
import 'util-deprecate';
|
|
26
26
|
import '../icon/icon__constants.js';
|
|
27
27
|
import '../_helpers/icon.js';
|
|
@@ -75,148 +75,52 @@ const TOOLBAR_HEIGHT = 49;
|
|
|
75
75
|
function noop() {}
|
|
76
76
|
const FilterWithShortcuts = shortcutsHOC(SelectFilter);
|
|
77
77
|
class SelectPopup extends PureComponent {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(this, "popup", void 0);
|
|
109
|
-
_defineProperty(this, "onListSelect", (selected, event, opts) => {
|
|
110
|
-
const getSelectItemEvent = () => {
|
|
111
|
-
const customEvent = document.createEvent('Event');
|
|
112
|
-
customEvent.initEvent('select', true, false);
|
|
113
|
-
if (event && 'persist' in event) {
|
|
114
|
-
event.persist();
|
|
115
|
-
}
|
|
116
|
-
customEvent.originalEvent = event;
|
|
117
|
-
return customEvent;
|
|
118
|
-
};
|
|
119
|
-
this.props.onSelect(selected, getSelectItemEvent(), opts);
|
|
120
|
-
});
|
|
121
|
-
_defineProperty(this, "tabPress", event => {
|
|
122
|
-
this.props.onCloseAttempt(event, true);
|
|
123
|
-
});
|
|
124
|
-
_defineProperty(this, "onClickHandler", () => this.filter?.focus());
|
|
125
|
-
_defineProperty(this, "handleRemoveTag", memoize(tag => event => this.removeTag(tag, event)));
|
|
126
|
-
_defineProperty(this, "handleTagClick", memoize(tag => () => {
|
|
127
|
-
if (Array.isArray(this.props.selected)) {
|
|
128
|
-
this.setState({
|
|
129
|
-
tagsActiveIndex: this.props.selected.indexOf(tag)
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}));
|
|
133
|
-
_defineProperty(this, "handleListResize", () => {
|
|
134
|
-
this.forceUpdate();
|
|
135
|
-
});
|
|
136
|
-
_defineProperty(this, "handleSelectAll", () => {
|
|
137
|
-
if (Array.isArray(this.props.selected)) {
|
|
138
|
-
this.props.onSelectAll(this.props.data.filter(item => !item.disabled).length !== this.props.selected.length);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
_defineProperty(this, "getSelectAll", () => {
|
|
142
|
-
const multiple = this.props.multiple;
|
|
143
|
-
const activeFilters = this.props.data.filter(item => !item.disabled);
|
|
144
|
-
return Array.isArray(this.props.selected) && /*#__PURE__*/React.createElement("div", {
|
|
145
|
-
className: modules_b607bec2.selectAll
|
|
146
|
-
}, activeFilters.length === 0 ? /*#__PURE__*/React.createElement("span", null) : /*#__PURE__*/React.createElement(Button, {
|
|
147
|
-
text: true,
|
|
148
|
-
inline: true,
|
|
149
|
-
onClick: this.handleSelectAll
|
|
150
|
-
}, activeFilters.length !== this.props.selected.length ? multiple.selectAllLabel || 'Select all' : multiple.deselectAllLabel || 'Deselect all'), multiple.renderSelectedItemsDescription?.(this.props.selected, activeFilters.length) || /*#__PURE__*/React.createElement(Text, {
|
|
151
|
-
info: true
|
|
152
|
-
}, `${this.props.selected.length} selected`));
|
|
153
|
-
});
|
|
154
|
-
// Cache the value because this method is called
|
|
155
|
-
// inside `render` function which can be called N times
|
|
156
|
-
// and should be fast as possible.
|
|
157
|
-
// Cache invalidates each time hidden or userDefinedMaxHeight changes
|
|
158
|
-
_defineProperty(this, "_adjustListMaxHeight", memoizeOne((hidden, userDefinedMaxHeight, ringPopupTarget) => {
|
|
159
|
-
if (hidden) {
|
|
160
|
-
return userDefinedMaxHeight;
|
|
161
|
-
}
|
|
162
|
-
// Calculate list's maximum height that can't
|
|
163
|
-
// get beyond the screen
|
|
164
|
-
// @see RG-1838, JT-48358
|
|
165
|
-
const minMaxHeight = 100;
|
|
166
|
-
const directions = this.props.directions || DEFAULT_DIRECTIONS;
|
|
167
|
-
// Note:
|
|
168
|
-
// Create a method which'll be called only when the popup opens and before
|
|
169
|
-
// render the list would be a better way
|
|
170
|
-
const anchorNode = this.props.anchorElement;
|
|
171
|
-
const containerNode = getPopupContainer(ringPopupTarget) || document.documentElement;
|
|
172
|
-
return anchorNode != null ? Math.min(directions.reduce((maxHeight, direction) => {
|
|
173
|
-
var _maxHeightForDirectio;
|
|
174
|
-
return Math.max(maxHeight, (_maxHeightForDirectio = maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null)) !== null && _maxHeightForDirectio !== void 0 ? _maxHeightForDirectio : 0);
|
|
175
|
-
}, minMaxHeight), userDefinedMaxHeight) : userDefinedMaxHeight;
|
|
176
|
-
}));
|
|
177
|
-
_defineProperty(this, "popupRef", el => {
|
|
178
|
-
this.popup = el;
|
|
179
|
-
});
|
|
180
|
-
_defineProperty(this, "list", void 0);
|
|
181
|
-
_defineProperty(this, "listRef", el => {
|
|
182
|
-
this.list = el;
|
|
183
|
-
});
|
|
184
|
-
_defineProperty(this, "filterRef", el => {
|
|
185
|
-
this.filter = el;
|
|
186
|
-
this.caret = el && new Caret(el);
|
|
187
|
-
});
|
|
188
|
-
_defineProperty(this, "shortcutsScope", getUID('select-popup-'));
|
|
189
|
-
_defineProperty(this, "shortcutsMap", {
|
|
190
|
-
tab: this.tabPress
|
|
191
|
-
});
|
|
192
|
-
_defineProperty(this, "popupFilterShortcutsMap", {
|
|
193
|
-
up: event => this.list && this.list.upHandler(event),
|
|
194
|
-
down: event => this.list && this.list.downHandler(event),
|
|
195
|
-
home: event => this.list && this.list.homeHandler(event),
|
|
196
|
-
end: event => this.list && this.list.endHandler(event),
|
|
197
|
-
enter: event => this.list ? this.list.enterHandler(event) : this.props.onEmptyPopupEnter(event),
|
|
198
|
-
esc: event => this.props.onCloseAttempt(event, true),
|
|
199
|
-
tab: event => this.tabPress(event),
|
|
200
|
-
backspace: event => this.handleBackspace(event),
|
|
201
|
-
del: () => this.removeSelectedTag(),
|
|
202
|
-
left: event => this.handleNavigation(event, true),
|
|
203
|
-
right: event => this.handleNavigation(event)
|
|
204
|
-
});
|
|
205
|
-
}
|
|
78
|
+
static defaultProps = {
|
|
79
|
+
data: [],
|
|
80
|
+
activeIndex: null,
|
|
81
|
+
toolbar: null,
|
|
82
|
+
filter: false,
|
|
83
|
+
multiple: false,
|
|
84
|
+
message: null,
|
|
85
|
+
anchorElement: null,
|
|
86
|
+
maxHeight: 600,
|
|
87
|
+
minWidth: 240,
|
|
88
|
+
loading: false,
|
|
89
|
+
onSelect: noop,
|
|
90
|
+
onCloseAttempt: noop,
|
|
91
|
+
onFilter: noop,
|
|
92
|
+
onClear: noop,
|
|
93
|
+
onLoadMore: noop,
|
|
94
|
+
selected: [],
|
|
95
|
+
tags: null,
|
|
96
|
+
ringPopupTarget: null,
|
|
97
|
+
onSelectAll: noop,
|
|
98
|
+
onEmptyPopupEnter: noop
|
|
99
|
+
};
|
|
100
|
+
state = {
|
|
101
|
+
popupFilterShortcutsOptions: {
|
|
102
|
+
modal: true,
|
|
103
|
+
disabled: true
|
|
104
|
+
},
|
|
105
|
+
tagsActiveIndex: null
|
|
106
|
+
};
|
|
206
107
|
componentDidMount() {
|
|
207
108
|
window.document.addEventListener('mouseup', this.mouseUpHandler);
|
|
208
109
|
}
|
|
209
110
|
componentWillUnmount() {
|
|
210
111
|
window.document.removeEventListener('mouseup', this.mouseUpHandler);
|
|
211
112
|
}
|
|
113
|
+
isClickingPopup = false; // This flag is set to true while an item in the popup is being clicked
|
|
114
|
+
filter;
|
|
212
115
|
focusFilter() {
|
|
213
116
|
setTimeout(() => this.filter?.focus());
|
|
214
117
|
}
|
|
215
118
|
isEventTargetFilter(event) {
|
|
216
119
|
return event.target instanceof Element && event.target.matches('input,textarea');
|
|
217
120
|
}
|
|
121
|
+
caret;
|
|
218
122
|
handleNavigation(event, navigateLeft) {
|
|
219
|
-
if (this.isEventTargetFilter(event) && this.caret != null && this.caret.getPosition() > 0 || !Array.isArray(this.props.selected)) {
|
|
123
|
+
if (this.isEventTargetFilter(event) && this.caret != null && Number(this.caret.getPosition()) > 0 || !Array.isArray(this.props.selected)) {
|
|
220
124
|
return;
|
|
221
125
|
}
|
|
222
126
|
let newIndex = null;
|
|
@@ -269,6 +173,17 @@ class SelectPopup extends PureComponent {
|
|
|
269
173
|
}
|
|
270
174
|
return true;
|
|
271
175
|
}
|
|
176
|
+
onFilterFocus = () => {
|
|
177
|
+
this._togglePopupFilterShortcuts(false);
|
|
178
|
+
this.setState({
|
|
179
|
+
tagsActiveIndex: null
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
popupFilterOnBlur = () => {
|
|
183
|
+
if (this.state.tagsActiveIndex === null) {
|
|
184
|
+
this._togglePopupFilterShortcuts(true);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
272
187
|
_togglePopupFilterShortcuts(shortcutsDisabled) {
|
|
273
188
|
this.setState({
|
|
274
189
|
popupFilterShortcutsOptions: {
|
|
@@ -277,9 +192,32 @@ class SelectPopup extends PureComponent {
|
|
|
277
192
|
}
|
|
278
193
|
});
|
|
279
194
|
}
|
|
195
|
+
mouseDownHandler = () => {
|
|
196
|
+
this.isClickingPopup = true;
|
|
197
|
+
};
|
|
198
|
+
mouseUpHandler = () => {
|
|
199
|
+
this.isClickingPopup = false;
|
|
200
|
+
};
|
|
201
|
+
popup;
|
|
280
202
|
isVisible() {
|
|
281
203
|
return this.popup && this.popup.isVisible();
|
|
282
204
|
}
|
|
205
|
+
onListSelect = (selected, event, opts) => {
|
|
206
|
+
const getSelectItemEvent = () => {
|
|
207
|
+
const customEvent = document.createEvent('Event');
|
|
208
|
+
customEvent.initEvent('select', true, false);
|
|
209
|
+
if (event && 'persist' in event) {
|
|
210
|
+
event.persist();
|
|
211
|
+
}
|
|
212
|
+
customEvent.originalEvent = event;
|
|
213
|
+
return customEvent;
|
|
214
|
+
};
|
|
215
|
+
this.props.onSelect(selected, getSelectItemEvent(), opts);
|
|
216
|
+
};
|
|
217
|
+
tabPress = event => {
|
|
218
|
+
this.props.onCloseAttempt(event, true);
|
|
219
|
+
};
|
|
220
|
+
onClickHandler = () => this.filter?.focus();
|
|
283
221
|
getFilter() {
|
|
284
222
|
if (this.props.filter || this.props.tags) {
|
|
285
223
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -312,6 +250,14 @@ class SelectPopup extends PureComponent {
|
|
|
312
250
|
}
|
|
313
251
|
return null;
|
|
314
252
|
}
|
|
253
|
+
handleRemoveTag = memoize(tag => event => this.removeTag(tag, event));
|
|
254
|
+
handleTagClick = memoize(tag => () => {
|
|
255
|
+
if (Array.isArray(this.props.selected)) {
|
|
256
|
+
this.setState({
|
|
257
|
+
tagsActiveIndex: this.props.selected.indexOf(tag)
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
315
261
|
getTags() {
|
|
316
262
|
return Array.isArray(this.props.selected) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TagsList, {
|
|
317
263
|
tags: this.props.selected,
|
|
@@ -343,6 +289,9 @@ class SelectPopup extends PureComponent {
|
|
|
343
289
|
className: modules_b607bec2.message
|
|
344
290
|
}, message));
|
|
345
291
|
}
|
|
292
|
+
handleListResize = () => {
|
|
293
|
+
this.forceUpdate();
|
|
294
|
+
};
|
|
346
295
|
getList(ringPopupTarget) {
|
|
347
296
|
if (this.props.data.length) {
|
|
348
297
|
let {
|
|
@@ -379,6 +328,75 @@ class SelectPopup extends PureComponent {
|
|
|
379
328
|
}
|
|
380
329
|
return null;
|
|
381
330
|
}
|
|
331
|
+
handleSelectAll = () => {
|
|
332
|
+
if (Array.isArray(this.props.selected)) {
|
|
333
|
+
this.props.onSelectAll(this.props.data.filter(item => !item.disabled).length !== this.props.selected.length);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
getSelectAll = () => {
|
|
337
|
+
const multiple = this.props.multiple;
|
|
338
|
+
const activeFilters = this.props.data.filter(item => !item.disabled);
|
|
339
|
+
return Array.isArray(this.props.selected) && /*#__PURE__*/React.createElement("div", {
|
|
340
|
+
className: modules_b607bec2.selectAll
|
|
341
|
+
}, activeFilters.length === 0 ? /*#__PURE__*/React.createElement("span", null) : /*#__PURE__*/React.createElement(Button, {
|
|
342
|
+
text: true,
|
|
343
|
+
inline: true,
|
|
344
|
+
onClick: this.handleSelectAll
|
|
345
|
+
}, activeFilters.length !== this.props.selected.length ? multiple.selectAllLabel || 'Select all' : multiple.deselectAllLabel || 'Deselect all'), multiple.renderSelectedItemsDescription?.(this.props.selected, activeFilters.length) || /*#__PURE__*/React.createElement(Text, {
|
|
346
|
+
info: true
|
|
347
|
+
}, `${this.props.selected.length} selected`));
|
|
348
|
+
};
|
|
349
|
+
// Cache the value because this method is called
|
|
350
|
+
// inside `render` function which can be called N times
|
|
351
|
+
// and should be fast as possible.
|
|
352
|
+
// Cache invalidates each time hidden or userDefinedMaxHeight changes
|
|
353
|
+
_adjustListMaxHeight = memoizeOne((hidden, userDefinedMaxHeight, ringPopupTarget) => {
|
|
354
|
+
if (hidden) {
|
|
355
|
+
return userDefinedMaxHeight;
|
|
356
|
+
}
|
|
357
|
+
// Calculate list's maximum height that can't
|
|
358
|
+
// get beyond the screen
|
|
359
|
+
// @see RG-1838, JT-48358
|
|
360
|
+
const minMaxHeight = 100;
|
|
361
|
+
const directions = this.props.directions || DEFAULT_DIRECTIONS;
|
|
362
|
+
// Note:
|
|
363
|
+
// Create a method which'll be called only when the popup opens and before
|
|
364
|
+
// render the list would be a better way
|
|
365
|
+
const anchorNode = this.props.anchorElement;
|
|
366
|
+
const containerNode = getPopupContainer(ringPopupTarget) || document.documentElement;
|
|
367
|
+
return anchorNode != null ? Math.min(directions.reduce((maxHeight, direction) => {
|
|
368
|
+
var _maxHeightForDirectio;
|
|
369
|
+
return Math.max(maxHeight, (_maxHeightForDirectio = maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null)) !== null && _maxHeightForDirectio !== void 0 ? _maxHeightForDirectio : 0);
|
|
370
|
+
}, minMaxHeight), userDefinedMaxHeight) : userDefinedMaxHeight;
|
|
371
|
+
});
|
|
372
|
+
popupRef = el => {
|
|
373
|
+
this.popup = el;
|
|
374
|
+
};
|
|
375
|
+
list;
|
|
376
|
+
listRef = el => {
|
|
377
|
+
this.list = el;
|
|
378
|
+
};
|
|
379
|
+
filterRef = el => {
|
|
380
|
+
this.filter = el;
|
|
381
|
+
this.caret = el && new Caret(el);
|
|
382
|
+
};
|
|
383
|
+
shortcutsScope = getUID('select-popup-');
|
|
384
|
+
shortcutsMap = {
|
|
385
|
+
tab: this.tabPress
|
|
386
|
+
};
|
|
387
|
+
popupFilterShortcutsMap = {
|
|
388
|
+
up: event => this.list && this.list.upHandler(event),
|
|
389
|
+
down: event => this.list && this.list.downHandler(event),
|
|
390
|
+
home: event => this.list && this.list.homeHandler(event),
|
|
391
|
+
end: event => this.list && this.list.endHandler(event),
|
|
392
|
+
enter: event => this.list ? this.list.enterHandler(event) : this.props.onEmptyPopupEnter(event),
|
|
393
|
+
esc: event => this.props.onCloseAttempt(event, true),
|
|
394
|
+
tab: event => this.tabPress(event),
|
|
395
|
+
backspace: event => this.handleBackspace(event),
|
|
396
|
+
del: () => this.removeSelectedTag(),
|
|
397
|
+
left: event => this.handleNavigation(event, true),
|
|
398
|
+
right: event => this.handleNavigation(event)
|
|
399
|
+
};
|
|
382
400
|
render() {
|
|
383
401
|
const {
|
|
384
402
|
toolbar,
|
|
@@ -429,28 +447,6 @@ class SelectPopup extends PureComponent {
|
|
|
429
447
|
});
|
|
430
448
|
}
|
|
431
449
|
}
|
|
432
|
-
_defineProperty(SelectPopup, "defaultProps", {
|
|
433
|
-
data: [],
|
|
434
|
-
activeIndex: null,
|
|
435
|
-
toolbar: null,
|
|
436
|
-
filter: false,
|
|
437
|
-
multiple: false,
|
|
438
|
-
message: null,
|
|
439
|
-
anchorElement: null,
|
|
440
|
-
maxHeight: 600,
|
|
441
|
-
minWidth: 240,
|
|
442
|
-
loading: false,
|
|
443
|
-
onSelect: noop,
|
|
444
|
-
onCloseAttempt: noop,
|
|
445
|
-
onFilter: noop,
|
|
446
|
-
onClear: noop,
|
|
447
|
-
onLoadMore: noop,
|
|
448
|
-
selected: [],
|
|
449
|
-
tags: null,
|
|
450
|
-
ringPopupTarget: null,
|
|
451
|
-
onSelectAll: noop,
|
|
452
|
-
onEmptyPopupEnter: noop
|
|
453
|
-
});
|
|
454
450
|
SelectPopup.propTypes = {
|
|
455
451
|
activeIndex: PropTypes.number,
|
|
456
452
|
anchorElement: PropTypes.instanceOf(HTMLElement),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import angular from 'angular';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { unmountComponentAtNode, render } from '../global/react-render-adapter.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import angular from 'angular';
|
|
3
3
|
import React, { cloneElement } from 'react';
|
|
4
4
|
import { render, hydrate } from '../global/react-render-adapter.js';
|
|
@@ -83,9 +83,6 @@ import '../_helpers/select__filter.js';
|
|
|
83
83
|
|
|
84
84
|
class SelectLazy {
|
|
85
85
|
constructor(container, props, ctrl, type, selectRef) {
|
|
86
|
-
_defineProperty(this, "onClick", () => {
|
|
87
|
-
this._clickHandler();
|
|
88
|
-
});
|
|
89
86
|
this.container = container;
|
|
90
87
|
this.ctrl = ctrl;
|
|
91
88
|
this.props = props || {};
|
|
@@ -102,6 +99,9 @@ class SelectLazy {
|
|
|
102
99
|
this.attachEvents();
|
|
103
100
|
this.render();
|
|
104
101
|
}
|
|
102
|
+
onClick = () => {
|
|
103
|
+
this._clickHandler();
|
|
104
|
+
};
|
|
105
105
|
rerender() {
|
|
106
106
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
107
107
|
for (const prop in props) {
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import angular from 'angular';
|
|
3
2
|
import deepEqual from 'deep-equal';
|
|
4
3
|
|
|
5
4
|
class Options {
|
|
5
|
+
static OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+select\s+as\s+(.*?))?(?:\s+describe\sas\s+(.*?))?(?:\s+for\s+)?([$\w]+)\s+in\s+(.*?)(?:\s+track\sby\s+(.*?))?$/;
|
|
6
|
+
static MATCHES = {
|
|
7
|
+
ITEM: 1,
|
|
8
|
+
LABEL: 2,
|
|
9
|
+
SELECTED_LABEL: 3,
|
|
10
|
+
DESCRIPTION: 4,
|
|
11
|
+
OPTION: 5,
|
|
12
|
+
ITEMS: 6,
|
|
13
|
+
TRACK: 7
|
|
14
|
+
};
|
|
15
|
+
static defaultKeyField = 'key';
|
|
16
|
+
static defaultLabelField = 'label';
|
|
17
|
+
static defaultSelectedLabelField = 'selectedLabel';
|
|
18
|
+
static defaultDescriptionField = 'description';
|
|
6
19
|
constructor(scope, optionsString) {
|
|
7
20
|
this.scope = scope;
|
|
8
21
|
const $parse = this.constructor.$parse;
|
|
@@ -95,20 +108,6 @@ class Options {
|
|
|
95
108
|
});
|
|
96
109
|
}
|
|
97
110
|
}
|
|
98
|
-
_defineProperty(Options, "OPTIONS_REGEXP", /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+select\s+as\s+(.*?))?(?:\s+describe\sas\s+(.*?))?(?:\s+for\s+)?([$\w]+)\s+in\s+(.*?)(?:\s+track\sby\s+(.*?))?$/);
|
|
99
|
-
_defineProperty(Options, "MATCHES", {
|
|
100
|
-
ITEM: 1,
|
|
101
|
-
LABEL: 2,
|
|
102
|
-
SELECTED_LABEL: 3,
|
|
103
|
-
DESCRIPTION: 4,
|
|
104
|
-
OPTION: 5,
|
|
105
|
-
ITEMS: 6,
|
|
106
|
-
TRACK: 7
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(Options, "defaultKeyField", 'key');
|
|
109
|
-
_defineProperty(Options, "defaultLabelField", 'label');
|
|
110
|
-
_defineProperty(Options, "defaultSelectedLabelField", 'selectedLabel');
|
|
111
|
-
_defineProperty(Options, "defaultDescriptionField", 'description');
|
|
112
111
|
const angularModule = angular.module('Ring.select.options', []);
|
|
113
112
|
angularModule.factory('SelectOptions', ["$parse", function SelectOptionsFactory($parse) {
|
|
114
113
|
Options.$parse = $parse;
|
package/dist/shortcuts/core.js
CHANGED
|
@@ -1,48 +1,39 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import Combokeys from 'combokeys';
|
|
3
2
|
import sniffr from '../global/sniffer.js';
|
|
4
3
|
import 'sniffr';
|
|
5
4
|
|
|
6
5
|
class Shortcuts {
|
|
6
|
+
ALLOW_SHORTCUTS_SELECTOR = '.ring-js-shortcuts';
|
|
7
|
+
ROOT_SCOPE = {
|
|
8
|
+
scopeId: 'ROOT',
|
|
9
|
+
options: {}
|
|
10
|
+
};
|
|
11
|
+
_scopes = {};
|
|
12
|
+
_scopeChain = [];
|
|
13
|
+
combokeys = new Combokeys(document.documentElement);
|
|
14
|
+
trigger = combo => this.combokeys.trigger(combo);
|
|
7
15
|
constructor() {
|
|
8
|
-
_defineProperty(this, "ALLOW_SHORTCUTS_SELECTOR", '.ring-js-shortcuts');
|
|
9
|
-
_defineProperty(this, "ROOT_SCOPE", {
|
|
10
|
-
scopeId: 'ROOT',
|
|
11
|
-
options: {}
|
|
12
|
-
});
|
|
13
|
-
_defineProperty(this, "_scopes", {});
|
|
14
|
-
_defineProperty(this, "_scopeChain", []);
|
|
15
|
-
_defineProperty(this, "combokeys", new Combokeys(document.documentElement));
|
|
16
|
-
_defineProperty(this, "trigger", combo => this.combokeys.trigger(combo));
|
|
17
|
-
_defineProperty(this, "_dispatcher", (e, key) => {
|
|
18
|
-
let currentScope;
|
|
19
|
-
for (let i = this._scopeChain.length - 1; i >= 0; i--) {
|
|
20
|
-
const scopeInChain = this._scopeChain[i];
|
|
21
|
-
currentScope = this._scopes[scopeInChain.scopeId];
|
|
22
|
-
if (currentScope && key != null && currentScope[key]) {
|
|
23
|
-
const ret = currentScope[key](e, key, scopeInChain.scopeId);
|
|
24
|
-
// Fall down in chain when returning true
|
|
25
|
-
if (ret !== true) {
|
|
26
|
-
return ret;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (scopeInChain.options.modal) {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
});
|
|
35
|
-
_defineProperty(this, "_defaultFilter", (e, element, key) => {
|
|
36
|
-
// if the element or its parents have the class "ring-js-shortcuts" then no need to stop
|
|
37
|
-
if (element === document || !(element instanceof HTMLElement) || key == null || element.matches(this.ALLOW_SHORTCUTS_SELECTOR) || (element.dataset.enabledShortcuts != null ? element.dataset.enabledShortcuts.split(',').includes(key) : element.closest(this.ALLOW_SHORTCUTS_SELECTOR) != null)) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
// stop for input, select, and textarea
|
|
41
|
-
return element.matches('input:not([type=checkbox]),select,textarea') || element.contentEditable === 'true';
|
|
42
|
-
});
|
|
43
16
|
this.setFilter();
|
|
44
17
|
this.setScope();
|
|
45
18
|
}
|
|
19
|
+
_dispatcher = (e, key) => {
|
|
20
|
+
let currentScope;
|
|
21
|
+
for (let i = this._scopeChain.length - 1; i >= 0; i--) {
|
|
22
|
+
const scopeInChain = this._scopeChain[i];
|
|
23
|
+
currentScope = this._scopes[scopeInChain.scopeId];
|
|
24
|
+
if (currentScope && key != null && currentScope[key]) {
|
|
25
|
+
const ret = currentScope[key](e, key, scopeInChain.scopeId);
|
|
26
|
+
// Fall down in chain when returning true
|
|
27
|
+
if (ret !== true) {
|
|
28
|
+
return ret;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (scopeInChain.options.modal) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
};
|
|
46
37
|
/**
|
|
47
38
|
* Binds a handler to a shortcut
|
|
48
39
|
*
|
|
@@ -169,6 +160,14 @@ class Shortcuts {
|
|
|
169
160
|
hasKey(key, scope) {
|
|
170
161
|
return !!this._scopes[scope]?.[key];
|
|
171
162
|
}
|
|
163
|
+
_defaultFilter = (e, element, key) => {
|
|
164
|
+
// if the element or its parents have the class "ring-js-shortcuts" then no need to stop
|
|
165
|
+
if (element === document || !(element instanceof HTMLElement) || key == null || element.matches(this.ALLOW_SHORTCUTS_SELECTOR) || (element.dataset.enabledShortcuts != null ? element.dataset.enabledShortcuts.split(',').includes(key) : element.closest(this.ALLOW_SHORTCUTS_SELECTOR) != null)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
// stop for input, select, and textarea
|
|
169
|
+
return element.matches('input:not([type=checkbox]),select,textarea') || element.contentEditable === 'true';
|
|
170
|
+
};
|
|
172
171
|
_getKeyboardEventType(params) {
|
|
173
172
|
if (!params.type && sniffr.os.name === 'windows') {
|
|
174
173
|
const isSystemShortcut = typeof params.key === 'string' && params.key.match(/ctrl/i) && params.key.match(/shift/i) && params.key.match(/[0-9]/);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import getUID from '../global/get-uid.js';
|
|
@@ -9,12 +8,12 @@ import '../global/sniffer.js';
|
|
|
9
8
|
import 'sniffr';
|
|
10
9
|
|
|
11
10
|
function shortcutsHOC(ComposedComponent) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
return class WithShortcuts extends React.Component {
|
|
12
|
+
static propTypes = {
|
|
13
|
+
rgShortcutsOptions: PropTypes.object,
|
|
14
|
+
rgShortcutsMap: PropTypes.object
|
|
15
|
+
};
|
|
16
|
+
_shortcutsScopeUid = getUID('rg-shortcuts-');
|
|
18
17
|
render() {
|
|
19
18
|
const {
|
|
20
19
|
rgShortcutsOptions,
|
|
@@ -28,10 +27,7 @@ function shortcutsHOC(ComposedComponent) {
|
|
|
28
27
|
disabled: rgShortcutsOptions.disabled
|
|
29
28
|
}, /*#__PURE__*/React.createElement(ComposedComponent, props));
|
|
30
29
|
}
|
|
31
|
-
}
|
|
32
|
-
rgShortcutsOptions: PropTypes.object,
|
|
33
|
-
rgShortcutsMap: PropTypes.object
|
|
34
|
-
}), _class;
|
|
30
|
+
};
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
export { shortcutsHOC as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import shortcuts from './core.js';
|
|
@@ -7,6 +6,16 @@ import '../global/sniffer.js';
|
|
|
7
6
|
import 'sniffr';
|
|
8
7
|
|
|
9
8
|
class Shortcuts extends PureComponent {
|
|
9
|
+
static propTypes = {
|
|
10
|
+
map: PropTypes.object.isRequired,
|
|
11
|
+
scope: PropTypes.string.isRequired,
|
|
12
|
+
options: PropTypes.object,
|
|
13
|
+
disabled: PropTypes.bool,
|
|
14
|
+
children: PropTypes.node
|
|
15
|
+
};
|
|
16
|
+
static defaultProps = {
|
|
17
|
+
options: {}
|
|
18
|
+
};
|
|
10
19
|
componentDidMount() {
|
|
11
20
|
if (!this.props.disabled) {
|
|
12
21
|
this.turnShorcutsOn();
|
|
@@ -52,15 +61,5 @@ class Shortcuts extends PureComponent {
|
|
|
52
61
|
return this.props.children || null;
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
|
-
_defineProperty(Shortcuts, "propTypes", {
|
|
56
|
-
map: PropTypes.object.isRequired,
|
|
57
|
-
scope: PropTypes.string.isRequired,
|
|
58
|
-
options: PropTypes.object,
|
|
59
|
-
disabled: PropTypes.bool,
|
|
60
|
-
children: PropTypes.node
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(Shortcuts, "defaultProps", {
|
|
63
|
-
options: {}
|
|
64
|
-
});
|
|
65
64
|
|
|
66
65
|
export { Shortcuts as default };
|
|
@@ -8,7 +8,6 @@ import IconNG from '../icon-ng/icon-ng.js';
|
|
|
8
8
|
import InputNg from '../input-ng/input-ng.js';
|
|
9
9
|
import { getShortcutTitle } from '../shortcuts/shortcut-title.js';
|
|
10
10
|
import HintPopupTpl from './shortcuts-hint-ng__template.js';
|
|
11
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
12
11
|
import 'focus-trap';
|
|
13
12
|
import '../global/dom.js';
|
|
14
13
|
import '../shortcuts/core.js';
|
|
@@ -10,7 +10,6 @@ import buttonTemplate from './sidebar-ng__button-template.js';
|
|
|
10
10
|
import 'just-debounce-it';
|
|
11
11
|
import 'element-resize-detector';
|
|
12
12
|
import '../global/dom.js';
|
|
13
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
14
13
|
import '../icon/icon__constants.js';
|
|
15
14
|
import '../template-ng/template-ng.js';
|
|
16
15
|
import '../_helpers/icon.js';
|
package/dist/storage/storage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import LocalStorage from './storage__local.js';
|
|
2
2
|
import FallbackStorage from './storage__fallback.js';
|
|
3
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
4
3
|
import '../alert-service/alert-service.js';
|
|
4
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../global/react-render-adapter.js';
|
|
7
7
|
import 'react-dom';
|