@jetbrains/ring-ui 5.0.36 → 5.0.38
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/editable-heading/editable-heading.d.ts +4 -2
- package/components/editable-heading/editable-heading.js +3 -3
- package/components/input/input.css +2 -0
- package/components/query-assist/query-assist.js +1 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -4
- package/dist/_helpers/anchor.js +0 -1
- package/dist/_helpers/card.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -11
- package/dist/_helpers/footer.js +2 -13
- package/dist/_helpers/query-assist__suggestions.js +0 -10
- package/dist/_helpers/select__filter.js +0 -11
- package/dist/_helpers/services-link.js +0 -2
- package/dist/_helpers/sidebar.js +0 -12
- package/dist/_helpers/theme.js +0 -3
- package/dist/_helpers/title.js +0 -9
- package/dist/alert/alert.js +2 -32
- package/dist/alert/container.js +0 -5
- package/dist/alert-service/alert-service.js +0 -26
- package/dist/analytics/analytics.js +0 -22
- package/dist/analytics/analytics__custom-plugin.js +0 -38
- package/dist/analytics/analytics__fus-plugin.js +0 -20
- package/dist/analytics/analytics__ga-plugin.js +0 -13
- package/dist/analytics/analytics__plugin-utils.js +0 -8
- package/dist/analytics-ng/analytics-ng.js +3 -9
- package/dist/auth/auth.js +2 -3
- package/dist/auth/auth__core.js +30 -243
- package/dist/auth/background-flow.js +2 -25
- package/dist/auth/down-notification.js +0 -7
- package/dist/auth/iframe-flow.js +2 -26
- package/dist/auth/landing.js +2 -6
- package/dist/auth/request-builder.js +0 -11
- package/dist/auth/response-parser.js +4 -26
- package/dist/auth/storage.js +4 -60
- package/dist/auth/token-validator.js +6 -42
- package/dist/auth/window-flow.js +2 -34
- package/dist/auth-dialog/auth-dialog.js +2 -12
- package/dist/auth-dialog-service/auth-dialog-service.js +2 -4
- package/dist/auth-ng/auth-ng.js +6 -22
- package/dist/auth-ng/auth-ng.mock.js +0 -4
- package/dist/autofocus-ng/autofocus-ng.js +0 -5
- package/dist/avatar/avatar.js +4 -17
- package/dist/avatar/fallback-avatar.js +2 -9
- package/dist/avatar-editor-ng/avatar-editor-ng.js +1 -17
- package/dist/badge/badge.js +0 -3
- package/dist/button/button.js +0 -8
- package/dist/button-group/button-group.js +0 -3
- package/dist/button-group/caption.js +0 -2
- package/dist/button-group-ng/button-group-ng.js +0 -4
- package/dist/button-ng/button-ng.js +3 -21
- package/dist/button-set/button-set.js +0 -3
- package/dist/button-set-ng/button-set-ng.js +0 -2
- package/dist/button-toolbar/button-toolbar.js +0 -3
- package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -2
- package/dist/caret/caret.js +2 -53
- package/dist/checkbox/checkbox.js +0 -12
- package/dist/code/code.js +3 -25
- package/dist/compiler-ng/compiler-ng.js +0 -5
- package/dist/confirm/confirm.js +0 -6
- package/dist/confirm-service/confirm-service.js +10 -8
- package/dist/content-layout/content-layout.js +0 -7
- package/dist/contenteditable/contenteditable.js +6 -13
- package/dist/data-list/data-list.js +4 -28
- package/dist/data-list/item.js +0 -15
- package/dist/data-list/selection.js +0 -27
- package/dist/date-picker/consts.js +0 -7
- package/dist/date-picker/date-input.js +0 -20
- package/dist/date-picker/date-picker.js +2 -36
- package/dist/date-picker/date-popup.js +18 -71
- package/dist/date-picker/day.js +0 -14
- package/dist/date-picker/month-names.js +0 -9
- package/dist/date-picker/month-slider.js +0 -10
- package/dist/date-picker/month.js +2 -4
- package/dist/date-picker/months.js +6 -13
- package/dist/date-picker/years.js +0 -14
- package/dist/dialog/dialog.js +0 -19
- package/dist/dialog-ng/dialog-ng.js +17 -105
- package/dist/docked-panel-ng/docked-panel-ng.js +6 -29
- package/dist/dropdown/dropdown.js +2 -33
- package/dist/dropdown-menu/dropdown-menu.js +4 -8
- package/dist/editable-heading/editable-heading.d.ts +4 -2
- package/dist/editable-heading/editable-heading.js +7 -6
- package/dist/error-bubble/error-bubble.js +2 -4
- package/dist/error-message/error-message.js +0 -3
- package/dist/footer-ng/footer-ng.js +0 -13
- package/dist/form-ng/form-ng.js +1 -21
- package/dist/global/angular-component-factory.js +0 -10
- package/dist/global/compose.js +0 -1
- package/dist/global/composeRefs.js +0 -1
- package/dist/global/controls-height.js +0 -2
- package/dist/global/create-stateful-context.js +0 -5
- package/dist/global/data-tests.js +0 -4
- package/dist/global/dom.js +2 -11
- package/dist/global/focus-sensor-hoc.js +4 -33
- package/dist/global/fuzzy-highlight.js +2 -16
- package/dist/global/get-event-key.js +8 -17
- package/dist/global/get-uid.js +0 -2
- package/dist/global/linear-function.js +0 -2
- package/dist/global/listeners.js +0 -13
- package/dist/global/memoize.js +0 -2
- package/dist/global/normalize-indent.js +2 -5
- package/dist/global/react-dom-renderer.js +0 -8
- package/dist/global/react-render-adapter.js +0 -7
- package/dist/global/rerender-hoc.js +0 -7
- package/dist/global/ring-angular-component.js +0 -5
- package/dist/global/schedule-raf.js +0 -5
- package/dist/global/trivial-template-tag.js +2 -3
- package/dist/global/url.js +0 -27
- package/dist/grid/col.js +0 -4
- package/dist/grid/grid.js +0 -3
- package/dist/grid/row.js +0 -5
- package/dist/group/group.js +0 -3
- package/dist/header/header.js +0 -5
- package/dist/header/logo.js +0 -4
- package/dist/header/profile.js +0 -7
- package/dist/header/services.js +0 -11
- package/dist/header/smart-profile.js +4 -18
- package/dist/header/smart-services.js +0 -17
- package/dist/header/tray-icon.js +2 -3
- package/dist/header/tray.js +0 -3
- package/dist/heading/heading.js +0 -5
- package/dist/http/http.js +20 -65
- package/dist/http/http.mock.js +2 -14
- package/dist/hub-source/hub-source.js +0 -32
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +0 -12
- package/dist/icon/icon.js +0 -13
- package/dist/icon/icon__constants.js +0 -4
- package/dist/icon/icon__svg.js +0 -10
- package/dist/icon-ng/icon-ng.js +2 -7
- package/dist/input/input.js +0 -30
- package/dist/input-ng/input-ng.js +0 -17
- package/dist/island/adaptive-island-hoc.js +0 -7
- package/dist/island/content.js +0 -25
- package/dist/island/header.js +0 -7
- package/dist/island/island.js +0 -4
- package/dist/island-legacy/content-legacy.js +0 -2
- package/dist/island-legacy/header-legacy.js +0 -2
- package/dist/island-legacy/island-legacy.js +0 -2
- package/dist/island-ng/island-content-ng.js +0 -3
- package/dist/link/clickableLink.js +2 -10
- package/dist/link/link.js +2 -9
- package/dist/link-ng/link-ng.js +0 -2
- package/dist/list/consts.js +0 -4
- package/dist/list/list.js +6 -128
- package/dist/list/list__custom.js +0 -4
- package/dist/list/list__hint.js +0 -3
- package/dist/list/list__item.js +0 -8
- package/dist/list/list__link.js +2 -3
- package/dist/list/list__separator.js +0 -1
- package/dist/list/list__title.js +0 -1
- package/dist/list/list__users-groups-source.js +4 -17
- package/dist/loader/loader.js +0 -10
- package/dist/loader/loader__core.js +6 -70
- package/dist/loader-inline/loader-inline.js +0 -3
- package/dist/loader-ng/loader-ng.js +0 -7
- package/dist/loader-screen/loader-screen.js +0 -3
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -14
- package/dist/login-dialog/login-dialog.js +0 -15
- package/dist/login-dialog/service.js +2 -4
- package/dist/markdown/code.js +0 -2
- package/dist/markdown/heading.js +0 -1
- package/dist/markdown/link.js +0 -1
- package/dist/markdown/markdown.js +0 -2
- package/dist/message/message.js +0 -24
- package/dist/message-bundle-ng/message-bundle-ng.js +2 -45
- package/dist/old-browsers-message/old-browsers-message.js +2 -21
- package/dist/old-browsers-message/white-list.js +2 -6
- package/dist/pager/pager.js +2 -39
- package/dist/panel/panel.js +0 -3
- package/dist/permissions/permissions.js +1 -43
- package/dist/permissions/permissions__cache.js +12 -63
- package/dist/permissions-ng/permissions-ng.js +11 -19
- package/dist/place-under-ng/place-under-ng.js +0 -19
- package/dist/popup/popup.consts.js +0 -11
- package/dist/popup/popup.js +6 -68
- package/dist/popup/position.js +8 -30
- package/dist/popup-menu/popup-menu.js +4 -13
- package/dist/progress-bar/progress-bar.js +0 -14
- package/dist/promised-click-ng/promised-click-ng.js +3 -22
- package/dist/query-assist/query-assist.js +17 -201
- package/dist/radio/radio.js +0 -6
- package/dist/radio/radio__item.js +0 -9
- package/dist/radio-ng/radio-ng.js +0 -4
- package/dist/save-field-ng/save-field-ng.js +1 -37
- package/dist/select/select.js +18 -208
- package/dist/select/select__popup.js +4 -76
- package/dist/select-ng/select-ng.js +18 -74
- package/dist/select-ng/select-ng__lazy.js +2 -17
- package/dist/select-ng/select-ng__options.js +3 -29
- package/dist/shortcuts/core.js +4 -56
- package/dist/shortcuts/shortcuts-hoc.js +0 -4
- package/dist/shortcuts/shortcuts.js +0 -10
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -13
- package/dist/shortcuts-ng/shortcuts-ng.js +16 -46
- package/dist/sidebar-ng/sidebar-ng.js +2 -12
- package/dist/storage/storage.js +2 -5
- package/dist/storage/storage__fallback.js +2 -48
- package/dist/storage/storage__local.js +0 -23
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +0 -37
- package/dist/table/cell.js +0 -2
- package/dist/table/disable-hover-hoc.js +0 -9
- package/dist/table/header-cell.js +0 -8
- package/dist/table/header.js +0 -16
- package/dist/table/multitable.js +0 -23
- package/dist/table/row-with-focus-sensor.js +0 -12
- package/dist/table/row.js +0 -18
- package/dist/table/selection-adapter.js +0 -2
- package/dist/table/selection-shortcuts-hoc.js +8 -42
- package/dist/table/selection.js +0 -50
- package/dist/table/smart-table.js +0 -9
- package/dist/table/table.js +6 -37
- package/dist/table-legacy-ng/table-legacy-ng.js +12 -42
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -31
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -32
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -5
- package/dist/tabs/collapsible-more.js +0 -5
- package/dist/tabs/collapsible-tab.js +0 -4
- package/dist/tabs/collapsible-tabs.js +8 -28
- package/dist/tabs/dumb-tabs.js +0 -8
- package/dist/tabs/smart-tabs.js +0 -6
- package/dist/tabs/tab-link.js +0 -1
- package/dist/tabs/tab.js +0 -2
- package/dist/tabs-ng/tabs-ng.js +13 -29
- package/dist/tag/tag.js +0 -24
- package/dist/tags-input/tags-input.js +0 -76
- package/dist/tags-list/tags-list.js +0 -6
- package/dist/template-ng/template-ng.js +0 -12
- package/dist/text/text.js +0 -3
- package/dist/theme-ng/theme-ng.js +0 -8
- package/dist/title-ng/title-ng.js +6 -17
- package/dist/toggle/toggle.js +0 -4
- package/dist/tooltip/tooltip.js +4 -35
- package/dist/tooltip-ng/tooltip-ng.js +2 -8
- package/dist/user-agreement/service.js +0 -62
- package/dist/user-agreement/user-agreement.js +0 -8
- package/dist/user-card/smart-user-card-tooltip.js +2 -8
- package/dist/user-card/tooltip.js +0 -3
- package/package.json +37 -37
|
@@ -71,14 +71,11 @@ import '../_helpers/input.js';
|
|
|
71
71
|
|
|
72
72
|
const FILTER_HEIGHT = 35;
|
|
73
73
|
const TOOLBAR_HEIGHT = 49;
|
|
74
|
-
|
|
75
74
|
function noop() {}
|
|
76
|
-
|
|
77
75
|
const FilterWithShortcuts = shortcutsHOC(SelectFilter);
|
|
78
76
|
class SelectPopup extends PureComponent {
|
|
79
77
|
constructor() {
|
|
80
78
|
super(...arguments);
|
|
81
|
-
|
|
82
79
|
_defineProperty(this, "state", {
|
|
83
80
|
popupFilterShortcutsOptions: {
|
|
84
81
|
modal: true,
|
|
@@ -86,65 +83,47 @@ class SelectPopup extends PureComponent {
|
|
|
86
83
|
},
|
|
87
84
|
tagsActiveIndex: null
|
|
88
85
|
});
|
|
89
|
-
|
|
90
86
|
_defineProperty(this, "isClickingPopup", false);
|
|
91
|
-
|
|
92
87
|
_defineProperty(this, "filter", void 0);
|
|
93
|
-
|
|
94
88
|
_defineProperty(this, "caret", void 0);
|
|
95
|
-
|
|
96
89
|
_defineProperty(this, "onFilterFocus", () => {
|
|
97
90
|
this._togglePopupFilterShortcuts(false);
|
|
98
|
-
|
|
99
91
|
this.setState({
|
|
100
92
|
tagsActiveIndex: null
|
|
101
93
|
});
|
|
102
94
|
});
|
|
103
|
-
|
|
104
95
|
_defineProperty(this, "popupFilterOnBlur", () => {
|
|
105
96
|
if (this.state.tagsActiveIndex === null) {
|
|
106
97
|
this._togglePopupFilterShortcuts(true);
|
|
107
98
|
}
|
|
108
99
|
});
|
|
109
|
-
|
|
110
100
|
_defineProperty(this, "mouseDownHandler", () => {
|
|
111
101
|
this.isClickingPopup = true;
|
|
112
102
|
});
|
|
113
|
-
|
|
114
103
|
_defineProperty(this, "mouseUpHandler", () => {
|
|
115
104
|
this.isClickingPopup = false;
|
|
116
105
|
});
|
|
117
|
-
|
|
118
106
|
_defineProperty(this, "popup", void 0);
|
|
119
|
-
|
|
120
107
|
_defineProperty(this, "onListSelect", (selected, event, opts) => {
|
|
121
108
|
const getSelectItemEvent = () => {
|
|
122
109
|
const customEvent = document.createEvent('Event');
|
|
123
110
|
customEvent.initEvent('select', true, false);
|
|
124
|
-
|
|
125
111
|
if (event && 'persist' in event) {
|
|
126
112
|
event.persist();
|
|
127
113
|
}
|
|
128
|
-
|
|
129
114
|
customEvent.originalEvent = event;
|
|
130
115
|
return customEvent;
|
|
131
116
|
};
|
|
132
|
-
|
|
133
117
|
this.props.onSelect(selected, getSelectItemEvent(), opts);
|
|
134
118
|
});
|
|
135
|
-
|
|
136
119
|
_defineProperty(this, "tabPress", event => {
|
|
137
120
|
this.props.onCloseAttempt(event, true);
|
|
138
121
|
});
|
|
139
|
-
|
|
140
122
|
_defineProperty(this, "onClickHandler", () => {
|
|
141
123
|
var _this$filter;
|
|
142
|
-
|
|
143
124
|
return (_this$filter = this.filter) === null || _this$filter === void 0 ? void 0 : _this$filter.focus();
|
|
144
125
|
});
|
|
145
|
-
|
|
146
126
|
_defineProperty(this, "handleRemoveTag", memoize(tag => event => this.removeTag(tag, event)));
|
|
147
|
-
|
|
148
127
|
_defineProperty(this, "handleTagClick", memoize(tag => () => {
|
|
149
128
|
if (Array.isArray(this.props.selected)) {
|
|
150
129
|
this.setState({
|
|
@@ -152,20 +131,16 @@ class SelectPopup extends PureComponent {
|
|
|
152
131
|
});
|
|
153
132
|
}
|
|
154
133
|
}));
|
|
155
|
-
|
|
156
134
|
_defineProperty(this, "handleListResize", () => {
|
|
157
135
|
this.forceUpdate();
|
|
158
136
|
});
|
|
159
|
-
|
|
160
137
|
_defineProperty(this, "handleSelectAll", () => {
|
|
161
138
|
if (Array.isArray(this.props.selected)) {
|
|
162
139
|
this.props.onSelectAll(this.props.data.filter(item => !item.disabled).length !== this.props.selected.length);
|
|
163
140
|
}
|
|
164
141
|
});
|
|
165
|
-
|
|
166
142
|
_defineProperty(this, "getSelectAll", () => {
|
|
167
143
|
var _multiple$renderSelec;
|
|
168
|
-
|
|
169
144
|
const multiple = this.props.multiple;
|
|
170
145
|
const activeFilters = this.props.data.filter(item => !item.disabled);
|
|
171
146
|
return Array.isArray(this.props.selected) && /*#__PURE__*/React.createElement("div", {
|
|
@@ -178,50 +153,40 @@ class SelectPopup extends PureComponent {
|
|
|
178
153
|
info: true
|
|
179
154
|
}, `${this.props.selected.length} selected`));
|
|
180
155
|
});
|
|
181
|
-
|
|
182
156
|
_defineProperty(this, "_adjustListMaxHeight", memoizeOne((hidden, userDefinedMaxHeight, ringPopupTarget) => {
|
|
183
157
|
if (hidden) {
|
|
184
158
|
return userDefinedMaxHeight;
|
|
185
|
-
}
|
|
159
|
+
}
|
|
160
|
+
// Calculate list's maximum height that can't
|
|
186
161
|
// get beyond the screen
|
|
187
162
|
// @see RG-1838, JT-48358
|
|
188
|
-
|
|
189
|
-
|
|
190
163
|
const minMaxHeight = 100;
|
|
191
|
-
const directions = this.props.directions || DEFAULT_DIRECTIONS;
|
|
164
|
+
const directions = this.props.directions || DEFAULT_DIRECTIONS;
|
|
165
|
+
// Note:
|
|
192
166
|
// Create a method which'll be called only when the popup opens and before
|
|
193
167
|
// render the list would be a better way
|
|
194
|
-
|
|
195
168
|
const anchorNode = this.props.anchorElement;
|
|
196
169
|
const containerNode = getPopupContainer(ringPopupTarget) || document.documentElement;
|
|
197
170
|
return anchorNode != null ? Math.min(directions.reduce((maxHeight, direction) => {
|
|
198
171
|
var _maxHeightForDirectio;
|
|
199
|
-
|
|
200
172
|
return Math.max(maxHeight, (_maxHeightForDirectio = maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null)) !== null && _maxHeightForDirectio !== void 0 ? _maxHeightForDirectio : 0);
|
|
201
173
|
}, minMaxHeight), userDefinedMaxHeight) : userDefinedMaxHeight;
|
|
202
174
|
}));
|
|
203
|
-
|
|
204
175
|
_defineProperty(this, "popupRef", el => {
|
|
205
176
|
this.popup = el;
|
|
206
177
|
});
|
|
207
|
-
|
|
208
178
|
_defineProperty(this, "list", void 0);
|
|
209
|
-
|
|
210
179
|
_defineProperty(this, "listRef", el => {
|
|
211
180
|
this.list = el;
|
|
212
181
|
});
|
|
213
|
-
|
|
214
182
|
_defineProperty(this, "filterRef", el => {
|
|
215
183
|
this.filter = el;
|
|
216
184
|
this.caret = el && new Caret(el);
|
|
217
185
|
});
|
|
218
|
-
|
|
219
186
|
_defineProperty(this, "shortcutsScope", getUID('select-popup-'));
|
|
220
|
-
|
|
221
187
|
_defineProperty(this, "shortcutsMap", {
|
|
222
188
|
tab: this.tabPress
|
|
223
189
|
});
|
|
224
|
-
|
|
225
190
|
_defineProperty(this, "popupFilterShortcutsMap", {
|
|
226
191
|
up: event => this.list && this.list.upHandler(event),
|
|
227
192
|
down: event => this.list && this.list.downHandler(event),
|
|
@@ -236,57 +201,44 @@ class SelectPopup extends PureComponent {
|
|
|
236
201
|
right: event => this.handleNavigation(event)
|
|
237
202
|
});
|
|
238
203
|
}
|
|
239
|
-
|
|
240
204
|
componentDidMount() {
|
|
241
205
|
window.document.addEventListener('mouseup', this.mouseUpHandler);
|
|
242
206
|
}
|
|
243
|
-
|
|
244
207
|
componentWillUnmount() {
|
|
245
208
|
window.document.removeEventListener('mouseup', this.mouseUpHandler);
|
|
246
209
|
}
|
|
247
|
-
|
|
248
210
|
focusFilter() {
|
|
249
211
|
setTimeout(() => {
|
|
250
212
|
var _this$filter2;
|
|
251
|
-
|
|
252
213
|
return (_this$filter2 = this.filter) === null || _this$filter2 === void 0 ? void 0 : _this$filter2.focus();
|
|
253
214
|
});
|
|
254
215
|
}
|
|
255
|
-
|
|
256
216
|
isEventTargetFilter(event) {
|
|
257
217
|
return event.target instanceof Element && event.target.matches('input,textarea');
|
|
258
218
|
}
|
|
259
|
-
|
|
260
219
|
handleNavigation(event, navigateLeft) {
|
|
261
220
|
if (this.isEventTargetFilter(event) && this.caret != null && this.caret.getPosition() > 0 || !Array.isArray(this.props.selected)) {
|
|
262
221
|
return;
|
|
263
222
|
}
|
|
264
|
-
|
|
265
223
|
let newIndex = null;
|
|
266
|
-
|
|
267
224
|
if (navigateLeft) {
|
|
268
225
|
newIndex = this.state.tagsActiveIndex === null ? this.props.selected.length - 1 : this.state.tagsActiveIndex - 1;
|
|
269
226
|
} else if (this.state.tagsActiveIndex !== null) {
|
|
270
227
|
newIndex = this.state.tagsActiveIndex + 1;
|
|
271
228
|
}
|
|
272
|
-
|
|
273
229
|
if (newIndex !== null && (newIndex >= this.props.selected.length || newIndex < 0)) {
|
|
274
230
|
newIndex = null;
|
|
275
231
|
this.focusFilter();
|
|
276
232
|
}
|
|
277
|
-
|
|
278
233
|
this.setState({
|
|
279
234
|
tagsActiveIndex: newIndex
|
|
280
235
|
});
|
|
281
236
|
}
|
|
282
|
-
|
|
283
237
|
removeTag(tag, event) {
|
|
284
238
|
if (!Array.isArray(this.props.selected)) {
|
|
285
239
|
return;
|
|
286
240
|
}
|
|
287
|
-
|
|
288
241
|
const _tag = tag || this.props.selected.slice(0)[this.props.selected.length - 1];
|
|
289
|
-
|
|
290
242
|
if (_tag) {
|
|
291
243
|
this.onListSelect(_tag, event, {
|
|
292
244
|
tryKeepOpen: true
|
|
@@ -297,34 +249,27 @@ class SelectPopup extends PureComponent {
|
|
|
297
249
|
this.focusFilter();
|
|
298
250
|
}
|
|
299
251
|
}
|
|
300
|
-
|
|
301
252
|
removeSelectedTag() {
|
|
302
253
|
if (Array.isArray(this.props.selected) && this.state.tagsActiveIndex != null) {
|
|
303
254
|
this.removeTag(this.props.selected[this.state.tagsActiveIndex]);
|
|
304
255
|
return false;
|
|
305
256
|
}
|
|
306
|
-
|
|
307
257
|
return true;
|
|
308
258
|
}
|
|
309
|
-
|
|
310
259
|
handleBackspace(event) {
|
|
311
260
|
if (!this.props.tags) {
|
|
312
261
|
return true;
|
|
313
262
|
}
|
|
314
|
-
|
|
315
263
|
if (!this.isEventTargetFilter(event)) {
|
|
316
264
|
this.removeSelectedTag();
|
|
317
265
|
return false;
|
|
318
266
|
}
|
|
319
|
-
|
|
320
267
|
if ((event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement) && !event.target.value) {
|
|
321
268
|
this.removeTag();
|
|
322
269
|
return false;
|
|
323
270
|
}
|
|
324
|
-
|
|
325
271
|
return true;
|
|
326
272
|
}
|
|
327
|
-
|
|
328
273
|
_togglePopupFilterShortcuts(shortcutsDisabled) {
|
|
329
274
|
this.setState({
|
|
330
275
|
popupFilterShortcutsOptions: {
|
|
@@ -333,11 +278,9 @@ class SelectPopup extends PureComponent {
|
|
|
333
278
|
}
|
|
334
279
|
});
|
|
335
280
|
}
|
|
336
|
-
|
|
337
281
|
isVisible() {
|
|
338
282
|
return this.popup && this.popup.isVisible();
|
|
339
283
|
}
|
|
340
|
-
|
|
341
284
|
getFilter() {
|
|
342
285
|
if (this.props.filter || this.props.tags) {
|
|
343
286
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -364,10 +307,8 @@ class SelectPopup extends PureComponent {
|
|
|
364
307
|
enableShortcuts: Object.keys(this.popupFilterShortcutsMap)
|
|
365
308
|
}));
|
|
366
309
|
}
|
|
367
|
-
|
|
368
310
|
return null;
|
|
369
311
|
}
|
|
370
|
-
|
|
371
312
|
getTags() {
|
|
372
313
|
return Array.isArray(this.props.selected) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TagsList, {
|
|
373
314
|
tags: this.props.selected,
|
|
@@ -377,7 +318,6 @@ class SelectPopup extends PureComponent {
|
|
|
377
318
|
disabled: this.props.disabled
|
|
378
319
|
}));
|
|
379
320
|
}
|
|
380
|
-
|
|
381
321
|
getFilterWithTags() {
|
|
382
322
|
if (this.props.tags) {
|
|
383
323
|
const classes = classNames([modules_b607bec2.filterWithTags, {
|
|
@@ -387,10 +327,8 @@ class SelectPopup extends PureComponent {
|
|
|
387
327
|
className: classes
|
|
388
328
|
}, this.getTags(), this.getFilter());
|
|
389
329
|
}
|
|
390
|
-
|
|
391
330
|
return this.getFilter();
|
|
392
331
|
}
|
|
393
|
-
|
|
394
332
|
getBottomLine() {
|
|
395
333
|
const {
|
|
396
334
|
loading,
|
|
@@ -402,25 +340,20 @@ class SelectPopup extends PureComponent {
|
|
|
402
340
|
className: modules_b607bec2.message
|
|
403
341
|
}, message));
|
|
404
342
|
}
|
|
405
|
-
|
|
406
343
|
getList(ringPopupTarget) {
|
|
407
344
|
if (this.props.data.length) {
|
|
408
345
|
let {
|
|
409
346
|
maxHeight
|
|
410
347
|
} = this.props;
|
|
411
|
-
|
|
412
348
|
if (this.props.anchorElement) {
|
|
413
349
|
maxHeight = this._adjustListMaxHeight(this.props.hidden, maxHeight, ringPopupTarget);
|
|
414
350
|
}
|
|
415
|
-
|
|
416
351
|
if (this.props.filter) {
|
|
417
352
|
maxHeight -= FILTER_HEIGHT;
|
|
418
353
|
}
|
|
419
|
-
|
|
420
354
|
if (this.props.toolbar) {
|
|
421
355
|
maxHeight -= TOOLBAR_HEIGHT;
|
|
422
356
|
}
|
|
423
|
-
|
|
424
357
|
return /*#__PURE__*/React.createElement(List, {
|
|
425
358
|
id: this.props.listId,
|
|
426
359
|
maxHeight: maxHeight,
|
|
@@ -441,10 +374,8 @@ class SelectPopup extends PureComponent {
|
|
|
441
374
|
renderOptimization: this.props.renderOptimization
|
|
442
375
|
});
|
|
443
376
|
}
|
|
444
|
-
|
|
445
377
|
return null;
|
|
446
378
|
}
|
|
447
|
-
|
|
448
379
|
render() {
|
|
449
380
|
const {
|
|
450
381
|
toolbar,
|
|
@@ -494,9 +425,7 @@ class SelectPopup extends PureComponent {
|
|
|
494
425
|
}), hidden ? /*#__PURE__*/React.createElement("div", null) : filterWithTags, selectAll, list, bottomLine, toolbar));
|
|
495
426
|
});
|
|
496
427
|
}
|
|
497
|
-
|
|
498
428
|
}
|
|
499
|
-
|
|
500
429
|
_defineProperty(SelectPopup, "defaultProps", {
|
|
501
430
|
data: [],
|
|
502
431
|
activeIndex: null,
|
|
@@ -519,7 +448,6 @@ _defineProperty(SelectPopup, "defaultProps", {
|
|
|
519
448
|
onSelectAll: noop,
|
|
520
449
|
onEmptyPopupEnter: noop
|
|
521
450
|
});
|
|
522
|
-
|
|
523
451
|
SelectPopup.propTypes = {
|
|
524
452
|
activeIndex: PropTypes.number,
|
|
525
453
|
anchorElement: PropTypes.instanceOf(HTMLElement),
|