@jetbrains/ring-ui 5.0.17 → 5.0.18
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/button-ng/button-ng.js +1 -1
- package/components/pager/pager.js +3 -0
- package/components/query-assist/query-assist.css +132 -221
- package/components/query-assist/query-assist.d.ts +5 -2
- package/components/query-assist/query-assist.js +22 -11
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/button-ng/button-ng.js +1 -1
- package/dist/pager/pager.js +6 -0
- package/dist/query-assist/query-assist.d.ts +5 -2
- package/dist/query-assist/query-assist.js +27 -16
- package/dist/query-assist-ng/query-assist-ng.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +15 -15
- package/CHANGELOG.md +0 -995
|
@@ -108,7 +108,7 @@ class ButtonController extends RingAngularComponent {
|
|
|
108
108
|
this.element.className = classNames(
|
|
109
109
|
foreignClasses,
|
|
110
110
|
getButtonClasses({
|
|
111
|
-
height: ControlsHeight.S,
|
|
111
|
+
height: $attrs.height || ControlsHeight.S,
|
|
112
112
|
className: styles.button,
|
|
113
113
|
active: this.getAttrValue($attrs.active),
|
|
114
114
|
disabled: this.getAttrValue($attrs.disabled),
|
|
@@ -147,6 +147,9 @@ export default class Pager extends PureComponent {
|
|
|
147
147
|
getPagerContent() {
|
|
148
148
|
const { currentPage, visiblePagesLimit } = this.props;
|
|
149
149
|
const totalPages = this.getTotal();
|
|
150
|
+
if (totalPages < this.props.currentPage) {
|
|
151
|
+
this.props.onPageChange?.(totalPages);
|
|
152
|
+
}
|
|
150
153
|
if (totalPages < 2 && !this.props.openTotal) {
|
|
151
154
|
return null;
|
|
152
155
|
}
|
|
@@ -1,273 +1,162 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
|
+
@import "../button/button.css";
|
|
2
3
|
|
|
3
|
-
@value dark from "../global/variables_dark.css";
|
|
4
4
|
@value unit from "../global/global.css";
|
|
5
5
|
@value overInputZIndex: 2;
|
|
6
6
|
@value inputGap: calc(unit * 3);
|
|
7
7
|
|
|
8
8
|
.queryAssist {
|
|
9
|
-
|
|
9
|
+
--ring-input-icon-offset: calc(unit * 2.5);
|
|
10
|
+
--ring-input-padding-inline: unit;
|
|
11
|
+
--ring-input-padding-block: 3px;
|
|
12
|
+
--ring-input-padding-start: var(--ring-input-padding-inline);
|
|
13
|
+
--ring-input-padding-end: var(--ring-input-padding-inline);
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.input {
|
|
15
|
-
height: calc(unit * 3 - 2px);
|
|
16
|
-
|
|
17
|
-
box-shadow: 0 0 0 1px var(--ring-borders-color);
|
|
18
|
-
|
|
19
|
-
/* stylelint-disable-next-line selector-max-specificity */
|
|
20
|
-
&:not([disabled]):active,
|
|
21
|
-
&:not([disabled]):focus {
|
|
22
|
-
border-color: transparent;
|
|
23
|
-
box-shadow: 0 0 0 1px var(--ring-main-color);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.placeholder {
|
|
28
|
-
color: var(--ring-secondary-color);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.letter-text {
|
|
32
|
-
color: var(--ring-warning-color);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.letterDefault,
|
|
36
|
-
.letter-field-name {
|
|
37
|
-
color: var(--ring-text-color);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.letter-field-value {
|
|
41
|
-
color: var(--ring-link-color);
|
|
42
|
-
}
|
|
15
|
+
position: relative;
|
|
43
16
|
|
|
44
|
-
|
|
45
|
-
color: var(--ring-secondary-color);
|
|
46
|
-
}
|
|
17
|
+
display: flex;
|
|
47
18
|
|
|
48
|
-
|
|
49
|
-
padding-bottom: 1px;
|
|
19
|
+
box-sizing: border-box;
|
|
50
20
|
|
|
51
|
-
|
|
52
|
-
|
|
21
|
+
font-size: var(--ring-font-size);
|
|
22
|
+
line-height: var(--ring-line-height);
|
|
53
23
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.highlight {
|
|
59
|
-
font-weight: 600;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.service {
|
|
63
|
-
color: var(--ring-secondary-color);
|
|
24
|
+
& * {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
64
27
|
}
|
|
65
28
|
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
height: calc(unit * 4);
|
|
69
|
-
|
|
70
|
-
font-size: 16px;
|
|
71
|
-
}
|
|
29
|
+
.huge {
|
|
30
|
+
--ring-input-padding-block: 5px;
|
|
72
31
|
|
|
73
32
|
& .input {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
color: var(--ring-search-color);
|
|
79
|
-
|
|
80
|
-
border-top-width: 5px;
|
|
81
|
-
background: var(--ring-selected-background-color);
|
|
82
|
-
|
|
83
|
-
&:active,
|
|
84
|
-
&:focus {
|
|
85
|
-
border-color: var(--ring-navigation-background-color);
|
|
86
|
-
|
|
87
|
-
background-color: var(--ring-navigation-background-color);
|
|
88
|
-
}
|
|
33
|
+
border-right: 0;
|
|
34
|
+
border-top-right-radius: 0;
|
|
35
|
+
border-bottom-right-radius: 0;
|
|
89
36
|
}
|
|
90
37
|
|
|
91
|
-
& .
|
|
92
|
-
|
|
38
|
+
& .actions {
|
|
39
|
+
right: calc(var(--ring-input-padding-inline) + 34px);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
93
42
|
|
|
94
|
-
|
|
43
|
+
.input {
|
|
44
|
+
width: 100%;
|
|
95
45
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding-top: var(--ring-input-padding-block);
|
|
48
|
+
padding-right: var(--ring-input-padding-end);
|
|
49
|
+
padding-bottom: var(--ring-input-padding-block);
|
|
50
|
+
padding-left: var(--ring-input-padding-start);
|
|
100
51
|
|
|
101
|
-
|
|
102
|
-
& {
|
|
103
|
-
top: 7px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
52
|
+
transition: border-color var(--ring-ease);
|
|
107
53
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
54
|
+
color: var(--ring-text-color);
|
|
55
|
+
border: 1px solid var(--ring-borders-color);
|
|
56
|
+
border-radius: var(--ring-border-radius);
|
|
57
|
+
outline: none;
|
|
58
|
+
background: transparent;
|
|
111
59
|
|
|
112
|
-
|
|
113
|
-
& .letter-field-name {
|
|
114
|
-
color: var(--ring-search-color);
|
|
115
|
-
}
|
|
60
|
+
font: inherit;
|
|
116
61
|
|
|
117
|
-
|
|
118
|
-
color: var(--ring-active-text-color);
|
|
119
|
-
}
|
|
62
|
+
caret-color: var(--ring-main-color);
|
|
120
63
|
|
|
121
|
-
&
|
|
122
|
-
|
|
64
|
+
@nest [dir=rtl] & {
|
|
65
|
+
padding-right: var(--ring-input-padding-start);
|
|
66
|
+
padding-left: var(--ring-input-padding-end);
|
|
123
67
|
}
|
|
124
68
|
|
|
125
|
-
|
|
126
|
-
|
|
69
|
+
&:hover {
|
|
70
|
+
transition: none;
|
|
127
71
|
|
|
128
|
-
border-
|
|
72
|
+
border-color: var(--ring-border-hover-color);
|
|
129
73
|
}
|
|
130
74
|
|
|
131
|
-
|
|
132
|
-
|
|
75
|
+
@nest .error & {
|
|
76
|
+
border-color: var(--ring-icon-error-color);
|
|
133
77
|
}
|
|
134
78
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
& .loader {
|
|
140
|
-
top: 6px;
|
|
141
|
-
}
|
|
79
|
+
&:focus {
|
|
80
|
+
transition: none;
|
|
142
81
|
|
|
143
|
-
|
|
144
|
-
font-weight: 600;
|
|
82
|
+
border-color: var(--ring-main-color);
|
|
145
83
|
}
|
|
146
84
|
|
|
147
|
-
&
|
|
148
|
-
color: var(--ring-
|
|
149
|
-
|
|
85
|
+
&[disabled] {
|
|
86
|
+
color: var(--ring-disabled-color);
|
|
87
|
+
border-color: var(--ring-border-disabled-color);
|
|
88
|
+
background-color: var(--ring-disabled-background-color);
|
|
150
89
|
|
|
151
|
-
|
|
152
|
-
background-color: var(--ring-selected-background-color);
|
|
90
|
+
-webkit-text-fill-color: var(--ring-disabled-color); /* Required for Safari, see RG-2063 for details */
|
|
153
91
|
}
|
|
154
92
|
|
|
155
|
-
/*
|
|
156
|
-
|
|
157
|
-
|
|
93
|
+
/*
|
|
94
|
+
Kill yellow/blue webkit autocomplete
|
|
95
|
+
https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/
|
|
96
|
+
*/
|
|
97
|
+
&:-webkit-autofill {
|
|
98
|
+
&,
|
|
99
|
+
&:hover,
|
|
100
|
+
&:focus {
|
|
101
|
+
transition: background-color 50000s ease-in-out 0s;
|
|
102
|
+
}
|
|
158
103
|
}
|
|
159
104
|
}
|
|
160
105
|
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
position: relative;
|
|
165
|
-
|
|
166
|
-
box-sizing: border-box;
|
|
167
|
-
|
|
168
|
-
line-height: normal;
|
|
106
|
+
.withIcon {
|
|
107
|
+
--ring-input-padding-start: calc(var(--ring-input-padding-inline) + var(--ring-input-icon-offset));
|
|
169
108
|
}
|
|
170
109
|
|
|
171
|
-
.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
top: 1px;
|
|
175
|
-
left: 1px;
|
|
176
|
-
|
|
177
|
-
overflow: auto;
|
|
178
|
-
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
|
|
181
|
-
width: calc(100% - 2px);
|
|
182
|
-
margin: 0;
|
|
183
|
-
|
|
184
|
-
padding: 2px calc(unit / 2) 3px;
|
|
185
|
-
|
|
186
|
-
white-space: nowrap;
|
|
187
|
-
|
|
188
|
-
border-width: 0;
|
|
189
|
-
border-style: solid;
|
|
190
|
-
border-color: transparent;
|
|
191
|
-
background: transparent;
|
|
192
|
-
|
|
193
|
-
line-height: 16px;
|
|
194
|
-
|
|
195
|
-
scrollbar-width: none;
|
|
196
|
-
|
|
197
|
-
&:active,
|
|
198
|
-
&:focus {
|
|
199
|
-
outline: 0;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
@nest & :-ms-input-placeholder,
|
|
203
|
-
:root & {
|
|
204
|
-
line-height: 17px;
|
|
205
|
-
}
|
|
110
|
+
.letter-text {
|
|
111
|
+
color: var(--ring-warning-color);
|
|
112
|
+
}
|
|
206
113
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
114
|
+
.letterDefault,
|
|
115
|
+
.letter-field-name {
|
|
116
|
+
color: var(--ring-text-color);
|
|
117
|
+
}
|
|
212
118
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
119
|
+
.letter-field-value {
|
|
120
|
+
color: var(--ring-link-color);
|
|
121
|
+
}
|
|
216
122
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
123
|
+
.letter-operator {
|
|
124
|
+
color: var(--ring-secondary-color);
|
|
125
|
+
}
|
|
220
126
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
127
|
+
.letter-error {
|
|
128
|
+
padding-bottom: 1px;
|
|
224
129
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
130
|
+
border-bottom: 1px solid var(--ring-icon-error-color);
|
|
131
|
+
}
|
|
228
132
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
133
|
+
.highlight {
|
|
134
|
+
font-weight: 600;
|
|
135
|
+
}
|
|
233
136
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
137
|
+
.service {
|
|
138
|
+
color: var(--ring-secondary-color);
|
|
237
139
|
}
|
|
238
140
|
|
|
239
141
|
.placeholder {
|
|
240
142
|
composes: resetButton from "../global/global.css";
|
|
241
143
|
|
|
242
144
|
position: absolute;
|
|
243
|
-
top:
|
|
244
|
-
|
|
245
|
-
left: 5px;
|
|
145
|
+
top: calc(var(--ring-input-padding-block) + 1px);
|
|
146
|
+
left: 1px;
|
|
246
147
|
|
|
247
148
|
display: block;
|
|
248
149
|
|
|
249
150
|
overflow: hidden;
|
|
250
151
|
|
|
251
152
|
width: calc(100% - unit * 4);
|
|
153
|
+
padding-left: var(--ring-input-padding-start);
|
|
252
154
|
|
|
253
155
|
text-overflow: ellipsis;
|
|
254
156
|
|
|
255
157
|
pointer-events: none;
|
|
256
158
|
|
|
257
|
-
|
|
258
|
-
left: calc(unit * 3 + 5px);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@nest & :-ms-input-placeholder,
|
|
262
|
-
:root & {
|
|
263
|
-
top: 4px;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
@supports (-ms-ime-align:auto) {
|
|
267
|
-
& {
|
|
268
|
-
top: 4px;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
159
|
+
color: var(--ring-disabled-color);
|
|
271
160
|
}
|
|
272
161
|
|
|
273
162
|
.letter {
|
|
@@ -276,41 +165,63 @@
|
|
|
276
165
|
|
|
277
166
|
.actions {
|
|
278
167
|
position: absolute;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
right: 1px;
|
|
168
|
+
top: calc(var(--ring-input-padding-block) - 2px);
|
|
169
|
+
right: var(--ring-input-padding-inline);
|
|
282
170
|
|
|
283
|
-
|
|
171
|
+
height: auto;
|
|
172
|
+
|
|
173
|
+
line-height: inherit;
|
|
174
|
+
|
|
175
|
+
@nest [dir=rtl] & {
|
|
176
|
+
right: auto;
|
|
177
|
+
left: unit;
|
|
178
|
+
}
|
|
284
179
|
}
|
|
285
180
|
|
|
286
181
|
.icon {
|
|
287
182
|
position: absolute;
|
|
288
|
-
|
|
289
|
-
|
|
183
|
+
top: calc(var(--ring-input-padding-block) + 1px);
|
|
184
|
+
left: var(--ring-input-padding-inline);
|
|
290
185
|
|
|
291
|
-
|
|
186
|
+
color: var(--ring-icon-secondary-color);
|
|
292
187
|
|
|
293
|
-
|
|
294
|
-
|
|
188
|
+
@nest [dir=rtl] & {
|
|
189
|
+
right: unit;
|
|
190
|
+
left: auto;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
295
193
|
|
|
296
|
-
|
|
194
|
+
.rightSearchButton {
|
|
195
|
+
padding: 5px 9px;
|
|
297
196
|
|
|
298
197
|
cursor: pointer;
|
|
299
|
-
user-select: none;
|
|
300
198
|
|
|
301
|
-
|
|
199
|
+
transition: border-color var(--ring-ease);
|
|
200
|
+
|
|
201
|
+
color: var(--ring-icon-secondary-color);
|
|
202
|
+
|
|
203
|
+
border: 1px solid var(--ring-borders-color);
|
|
204
|
+
border-radius: var(--ring-border-radius);
|
|
205
|
+
border-top-left-radius: 0;
|
|
206
|
+
border-bottom-left-radius: 0;
|
|
302
207
|
|
|
303
|
-
&
|
|
304
|
-
|
|
208
|
+
@nest .queryAssist.queryAssist:focus-within & {
|
|
209
|
+
transition: none;
|
|
210
|
+
|
|
211
|
+
border-color: var(--ring-main-color);
|
|
305
212
|
}
|
|
306
213
|
|
|
307
|
-
@nest .
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
214
|
+
@nest .queryAssist:hover & {
|
|
215
|
+
transition: none;
|
|
216
|
+
|
|
217
|
+
border-color: var(--ring-border-hover-color);
|
|
311
218
|
}
|
|
312
219
|
}
|
|
313
220
|
|
|
221
|
+
.clear {
|
|
222
|
+
padding-right: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
314
225
|
.loaderOnTheRight {
|
|
315
226
|
right: 1px;
|
|
316
227
|
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Caret, { Position } from '../caret/caret';
|
|
4
4
|
import PopupMenu from '../popup-menu/popup-menu';
|
|
5
5
|
import Button from '../button/button';
|
|
6
|
+
import Icon from '../icon/icon';
|
|
6
7
|
import { ShortcutsMap } from '../shortcuts/core';
|
|
7
8
|
import { QueryAssistSuggestion, SuggestionItem } from './query-assist__suggestions';
|
|
8
9
|
declare function noop(): void;
|
|
@@ -57,6 +58,7 @@ export interface QueryAssistProps {
|
|
|
57
58
|
useCustomItemRender?: boolean | null | undefined;
|
|
58
59
|
actions?: ReactNode[] | null | undefined;
|
|
59
60
|
'data-test'?: string | null | undefined;
|
|
61
|
+
huge?: boolean | null | undefined;
|
|
60
62
|
}
|
|
61
63
|
export interface StyleRange {
|
|
62
64
|
style: string;
|
|
@@ -207,6 +209,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
207
209
|
translations: PropTypes.Requireable<object>;
|
|
208
210
|
actions: PropTypes.Requireable<any[]>;
|
|
209
211
|
'data-test': PropTypes.Requireable<string>;
|
|
212
|
+
huge: PropTypes.Requireable<boolean>;
|
|
210
213
|
};
|
|
211
214
|
static defaultProps: {
|
|
212
215
|
onApply: typeof noop;
|
|
@@ -280,8 +283,8 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
280
283
|
popupRef: (node: PopupMenu<SuggestionItem> | null) => void;
|
|
281
284
|
placeholder?: HTMLElement | null;
|
|
282
285
|
placeholderRef: (node: HTMLElement | null) => void;
|
|
283
|
-
glass?: ComponentRef<typeof
|
|
284
|
-
glassRef: (node: ComponentRef<typeof
|
|
286
|
+
glass?: ComponentRef<typeof Icon> | null;
|
|
287
|
+
glassRef: (node: ComponentRef<typeof Icon> | null) => void;
|
|
285
288
|
loader?: HTMLElement | null;
|
|
286
289
|
loaderRef: (node: HTMLElement | null) => void;
|
|
287
290
|
clear?: ComponentRef<typeof Button> | null;
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import debounce from 'just-debounce-it';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import deepEqual from 'deep-equal';
|
|
6
|
-
import searchIcon from '@jetbrains/icons/search
|
|
6
|
+
import searchIcon from '@jetbrains/icons/search';
|
|
7
7
|
import closeIcon from '@jetbrains/icons/close-12px';
|
|
8
8
|
import getUID from '../global/get-uid';
|
|
9
9
|
import dataTests from '../global/data-tests';
|
|
@@ -15,6 +15,7 @@ import LoaderInline from '../loader-inline/loader-inline';
|
|
|
15
15
|
import Shortcuts from '../shortcuts/shortcuts';
|
|
16
16
|
import rerenderHOC from '../global/rerender-hoc';
|
|
17
17
|
import Button from '../button/button';
|
|
18
|
+
import Icon from '../icon/icon';
|
|
18
19
|
import QueryAssistSuggestions from './query-assist__suggestions';
|
|
19
20
|
import styles from './query-assist.css';
|
|
20
21
|
const POPUP_COMPENSATION = PopupMenu.ListProps.Dimension.ITEM_PADDING +
|
|
@@ -148,7 +149,8 @@ export default class QueryAssist extends Component {
|
|
|
148
149
|
useCustomItemRender: PropTypes.bool,
|
|
149
150
|
translations: PropTypes.object,
|
|
150
151
|
actions: PropTypes.array,
|
|
151
|
-
'data-test': PropTypes.string
|
|
152
|
+
'data-test': PropTypes.string,
|
|
153
|
+
huge: PropTypes.bool
|
|
152
154
|
};
|
|
153
155
|
static defaultProps = {
|
|
154
156
|
onApply: noop,
|
|
@@ -747,16 +749,21 @@ export default class QueryAssist extends Component {
|
|
|
747
749
|
const actions = [...(this.props.actions || [])];
|
|
748
750
|
const renderClear = this.props.clear && !!this.state.query;
|
|
749
751
|
if (renderClear) {
|
|
750
|
-
actions.push(<Button icon={closeIcon} key={'clearAction'} className={styles.
|
|
752
|
+
actions.push(<Button icon={closeIcon} key={'clearAction'} className={styles.clear} title={this.props.translations.clearTitle} ref={this.clearRef} onClick={this.clearQuery} data-test="query-assist-clear-icon"/>);
|
|
751
753
|
}
|
|
752
754
|
return actions;
|
|
753
755
|
}
|
|
754
756
|
render() {
|
|
755
|
-
const { glass, 'data-test': dataTest, className, useCustomItemRender } = this.props;
|
|
757
|
+
const { glass, 'data-test': dataTest, className, useCustomItemRender, huge } = this.props;
|
|
756
758
|
const renderPlaceholder = !!this.props.placeholder && this.state.placeholderEnabled;
|
|
757
759
|
const renderLoader = this.props.loader !== false && this.state.loading;
|
|
758
760
|
const renderGlass = glass && !renderLoader;
|
|
759
761
|
const actions = this.renderActions();
|
|
762
|
+
const containerClasses = classNames(className, {
|
|
763
|
+
[styles.queryAssist]: true,
|
|
764
|
+
[styles.withIcon]: (renderGlass && !huge) || renderLoader,
|
|
765
|
+
[styles.huge]: huge
|
|
766
|
+
});
|
|
760
767
|
const inputClasses = classNames({
|
|
761
768
|
[`${styles.input} ring-js-shortcuts`]: true,
|
|
762
769
|
[styles.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
@@ -764,11 +771,12 @@ export default class QueryAssist extends Component {
|
|
|
764
771
|
[styles.inputLeftGap]: this.isRenderingGlassOrLoader() && glass,
|
|
765
772
|
[styles.inputDisabled]: this.props.disabled
|
|
766
773
|
});
|
|
767
|
-
return (<div data-test={dataTests('ring-query-assist', dataTest)} className={
|
|
774
|
+
return (<div data-test={dataTests('ring-query-assist', dataTest)} className={containerClasses} role="presentation" ref={this.nodeRef}>
|
|
768
775
|
{this.state.shortcuts &&
|
|
769
776
|
(<Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
770
777
|
|
|
771
|
-
{renderGlass && (<
|
|
778
|
+
{renderGlass && !huge && (<Icon glyph={searchIcon} className={styles.icon} title={this.props.translations.searchTitle} ref={this.glassRef} data-test="query-assist-search-icon"/>)}
|
|
779
|
+
|
|
772
780
|
{renderLoader && (<div className={classNames(styles.icon, styles.loader, {
|
|
773
781
|
[styles.loaderOnTheRight]: !glass
|
|
774
782
|
})} ref={this.loaderRef}>
|
|
@@ -779,14 +787,17 @@ export default class QueryAssist extends Component {
|
|
|
779
787
|
onKeyUp={this.handleInput} // to handle input and key up
|
|
780
788
|
onKeyDown={this.handleEnter} onPaste={this.handlePaste} spellCheck="false">{this.state.query && <span>{this.renderQuery()}</span>}</ContentEditable>
|
|
781
789
|
|
|
782
|
-
{renderPlaceholder && (<button type="button" className={
|
|
783
|
-
[styles.placeholderSpaced]: glass
|
|
784
|
-
})} ref={this.placeholderRef} onClick={this.handleCaretMove} data-test="query-assist-placeholder">
|
|
790
|
+
{renderPlaceholder && (<button type="button" className={styles.placeholder} ref={this.placeholderRef} onClick={this.handleCaretMove} data-test="query-assist-placeholder">
|
|
785
791
|
{this.props.placeholder}
|
|
786
792
|
</button>)}
|
|
787
|
-
|
|
788
|
-
|
|
793
|
+
|
|
794
|
+
{actions && (<div data-test="ring-query-assist-actions" className={styles.actions}>{actions}</div>)}
|
|
795
|
+
|
|
789
796
|
<PopupMenu hidden={!this.state.showPopup} onCloseAttempt={this.closePopup} ref={this.popupRef} anchorElement={this.node} keepMounted attached className={this.props.popupClassName} directions={[PopupMenu.PopupProps.Directions.BOTTOM_RIGHT]} data={useCustomItemRender ? this.state.suggestions : this.renderSuggestions()} data-test="ring-query-assist-popup" hint={this.props.hint} hintOnSelection={this.props.hintOnSelection} left={this.getPopupOffset(this.state.suggestions)} maxHeight={PopupMenu.PopupProps.MaxHeight.SCREEN} onMouseDown={this.trackPopupMouseState} onMouseUp={this.trackPopupMouseState} onSelect={item => this.handleComplete(item)}/>
|
|
797
|
+
|
|
798
|
+
{glass && huge && (<div className={styles.rightSearchButton}>
|
|
799
|
+
<Icon glyph={searchIcon} className={styles.rightSearchIcon} title={this.props.translations.searchTitle} onClick={this.handleApply} ref={this.glassRef} data-test="query-assist-search-icon"/>
|
|
800
|
+
</div>)}
|
|
790
801
|
</div>);
|
|
791
802
|
}
|
|
792
803
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import List from '../list/list.js';
|
|
3
3
|
|
|
4
|
-
var modules_da7ab055 = {"
|
|
4
|
+
var modules_da7ab055 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","height":"var(--ring-button-height)","loaderWidth":"64px","overInputZIndex":"2","inputGap":"24px","heightS":"heightS_rui_d22e","heightM":"heightM_rui_d22e","heightL":"heightL_rui_d22e","button":"button_rui_d22e","active":"active_rui_d22e","withIcon":"withIcon_rui_d22e","icon":"icon_rui_d22e","primary":"primary_rui_d22e","loader":"loader_rui_d22e","loaderBackground":"loaderBackground_rui_d22e","danger":"danger_rui_d22e","text":"text_rui_d22e","content":"content_rui_d22e","text-loading":"text-loading_rui_d22e","inline":"inline_rui_d22e","withNormalIcon":"withNormalIcon_rui_d22e","withDangerIcon":"withDangerIcon_rui_d22e","progress":"progress_rui_d22e","delayed":"delayed_rui_d22e","short":"short_rui_d22e","dropdownIcon":"dropdownIcon_rui_d22e","queryAssist":"queryAssist_rui_d22e","huge":"huge_rui_d22e","input":"input_rui_d22e","actions":"actions_rui_d22e","error":"error_rui_d22e","letter-text":"letter-text_rui_d22e","letterDefault":"letterDefault_rui_d22e","letter-field-name":"letter-field-name_rui_d22e","letter-field-value":"letter-field-value_rui_d22e","letter-operator":"letter-operator_rui_d22e","letter-error":"letter-error_rui_d22e","highlight":"highlight_rui_d22e","service":"service_rui_d22e","placeholder":"placeholder_rui_d22e resetButton_rui_8bff","letter":"letter_rui_d22e","rightSearchButton":"rightSearchButton_rui_d22e","clear":"clear_rui_d22e","loaderOnTheRight":"loaderOnTheRight_rui_d22e"};
|
|
5
5
|
|
|
6
6
|
const ICON_ID_LENGTH = 44;
|
|
7
7
|
class QueryAssistSuggestions {
|
|
@@ -44,7 +44,7 @@ class ButtonController extends RingAngularComponent {
|
|
|
44
44
|
} = this.$inject;
|
|
45
45
|
const foreignClasses = [...this.element.classList].filter(name => !buttonClassesMap[name]);
|
|
46
46
|
this.element.className = classNames(foreignClasses, getButtonClasses({
|
|
47
|
-
height: ControlsHeight.S,
|
|
47
|
+
height: $attrs.height || ControlsHeight.S,
|
|
48
48
|
className: modules_e81895c9.button,
|
|
49
49
|
active: this.getAttrValue($attrs.active),
|
|
50
50
|
disabled: this.getAttrValue($attrs.disabled),
|
package/dist/pager/pager.js
CHANGED
|
@@ -273,6 +273,12 @@ class Pager extends PureComponent {
|
|
|
273
273
|
} = this.props;
|
|
274
274
|
const totalPages = this.getTotal();
|
|
275
275
|
|
|
276
|
+
if (totalPages < this.props.currentPage) {
|
|
277
|
+
var _this$props$onPageCha4, _this$props4;
|
|
278
|
+
|
|
279
|
+
(_this$props$onPageCha4 = (_this$props4 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 ? void 0 : _this$props$onPageCha4.call(_this$props4, totalPages);
|
|
280
|
+
}
|
|
281
|
+
|
|
276
282
|
if (totalPages < 2 && !this.props.openTotal) {
|
|
277
283
|
return null;
|
|
278
284
|
}
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Caret, { Position } from '../caret/caret';
|
|
4
4
|
import PopupMenu from '../popup-menu/popup-menu';
|
|
5
5
|
import Button from '../button/button';
|
|
6
|
+
import Icon from '../icon/icon';
|
|
6
7
|
import { ShortcutsMap } from '../shortcuts/core';
|
|
7
8
|
import { QueryAssistSuggestion, SuggestionItem } from './query-assist__suggestions';
|
|
8
9
|
declare function noop(): void;
|
|
@@ -57,6 +58,7 @@ export interface QueryAssistProps {
|
|
|
57
58
|
useCustomItemRender?: boolean | null | undefined;
|
|
58
59
|
actions?: ReactNode[] | null | undefined;
|
|
59
60
|
'data-test'?: string | null | undefined;
|
|
61
|
+
huge?: boolean | null | undefined;
|
|
60
62
|
}
|
|
61
63
|
export interface StyleRange {
|
|
62
64
|
style: string;
|
|
@@ -207,6 +209,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
207
209
|
translations: PropTypes.Requireable<object>;
|
|
208
210
|
actions: PropTypes.Requireable<any[]>;
|
|
209
211
|
'data-test': PropTypes.Requireable<string>;
|
|
212
|
+
huge: PropTypes.Requireable<boolean>;
|
|
210
213
|
};
|
|
211
214
|
static defaultProps: {
|
|
212
215
|
onApply: typeof noop;
|
|
@@ -280,8 +283,8 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
280
283
|
popupRef: (node: PopupMenu<SuggestionItem> | null) => void;
|
|
281
284
|
placeholder?: HTMLElement | null;
|
|
282
285
|
placeholderRef: (node: HTMLElement | null) => void;
|
|
283
|
-
glass?: ComponentRef<typeof
|
|
284
|
-
glassRef: (node: ComponentRef<typeof
|
|
286
|
+
glass?: ComponentRef<typeof Icon> | null;
|
|
287
|
+
glassRef: (node: ComponentRef<typeof Icon> | null) => void;
|
|
285
288
|
loader?: HTMLElement | null;
|
|
286
289
|
loaderRef: (node: HTMLElement | null) => void;
|
|
287
290
|
clear?: ComponentRef<typeof Button> | null;
|