@jetbrains/ring-ui 5.0.79 → 5.0.81
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.css +2 -1
- package/components/query-assist/query-assist.css +64 -45
- package/components/query-assist/query-assist.js +8 -4
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/query-assist/query-assist.js +8 -4
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
--ring-input-icon-offset: calc(unit * 2.5);
|
|
10
10
|
--ring-input-padding-inline: unit;
|
|
11
11
|
--ring-input-padding-block: 1px;
|
|
12
|
-
--ring-input-padding-start: var(--ring-input-padding-inline);
|
|
13
|
-
--ring-input-padding-end: var(--ring-input-padding-inline);
|
|
14
12
|
|
|
15
13
|
position: relative;
|
|
16
14
|
|
|
@@ -18,8 +16,11 @@
|
|
|
18
16
|
align-items: center;
|
|
19
17
|
|
|
20
18
|
box-sizing: border-box;
|
|
19
|
+
min-height: calc(var(--ring-input-padding-inline) * 3);
|
|
20
|
+
padding: var(--ring-input-padding-block) var(--ring-input-padding-inline);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
border: 1px solid var(--ring-borders-color);
|
|
23
|
+
border-radius: var(--ring-border-radius);
|
|
23
24
|
|
|
24
25
|
font-size: var(--ring-font-size);
|
|
25
26
|
line-height: var(--ring-line-height);
|
|
@@ -29,17 +30,39 @@
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
.queryAssistDisabled {
|
|
34
|
+
color: var(--ring-disabled-color);
|
|
35
|
+
border-color: var(--ring-border-disabled-color);
|
|
36
|
+
background-color: var(--ring-disabled-background-color);
|
|
37
|
+
|
|
38
|
+
-webkit-text-fill-color: var(--ring-disabled-color); /* Required for Safari, see RG-2063 for details */
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
.huge {
|
|
33
42
|
--ring-input-padding-block: 5px;
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
max-height: calc(var(--ring-input-padding-inline) * 4);
|
|
45
|
+
|
|
46
|
+
padding: 0 0 0 var(--ring-input-padding-inline);
|
|
47
|
+
|
|
48
|
+
border-right: 0;
|
|
40
49
|
|
|
41
50
|
& .actions {
|
|
42
|
-
right:
|
|
51
|
+
padding-right: var(--ring-input-padding-inline);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
& .placeholder {
|
|
55
|
+
padding-left: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@nest [dir=rtl] & {
|
|
59
|
+
padding: 0 var(--ring-input-padding-inline) 0 0;
|
|
60
|
+
|
|
61
|
+
border: 1px solid var(--ring-borders-color);
|
|
62
|
+
|
|
63
|
+
& .actions {
|
|
64
|
+
padding: 0 var(--ring-input-padding-inline);
|
|
65
|
+
}
|
|
43
66
|
}
|
|
44
67
|
}
|
|
45
68
|
|
|
@@ -47,12 +70,7 @@
|
|
|
47
70
|
overflow: auto;
|
|
48
71
|
|
|
49
72
|
width: 100%;
|
|
50
|
-
|
|
51
73
|
margin: 0;
|
|
52
|
-
padding-top: var(--ring-input-padding-block);
|
|
53
|
-
padding-right: var(--ring-input-padding-end);
|
|
54
|
-
padding-bottom: var(--ring-input-padding-block);
|
|
55
|
-
padding-left: var(--ring-input-padding-start);
|
|
56
74
|
|
|
57
75
|
cursor: text;
|
|
58
76
|
|
|
@@ -60,8 +78,6 @@
|
|
|
60
78
|
white-space: nowrap;
|
|
61
79
|
|
|
62
80
|
color: var(--ring-text-color);
|
|
63
|
-
border: 1px solid var(--ring-borders-color);
|
|
64
|
-
border-radius: var(--ring-border-radius);
|
|
65
81
|
outline: none;
|
|
66
82
|
background: transparent;
|
|
67
83
|
|
|
@@ -70,11 +86,6 @@
|
|
|
70
86
|
|
|
71
87
|
caret-color: var(--ring-main-color);
|
|
72
88
|
|
|
73
|
-
@nest [dir=rtl] & {
|
|
74
|
-
padding-right: var(--ring-input-padding-start);
|
|
75
|
-
padding-left: var(--ring-input-padding-end);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
89
|
&:hover {
|
|
79
90
|
transition: none;
|
|
80
91
|
|
|
@@ -91,14 +102,6 @@
|
|
|
91
102
|
border-color: var(--ring-main-color);
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
&[disabled] {
|
|
95
|
-
color: var(--ring-disabled-color);
|
|
96
|
-
border-color: var(--ring-border-disabled-color);
|
|
97
|
-
background-color: var(--ring-disabled-background-color);
|
|
98
|
-
|
|
99
|
-
-webkit-text-fill-color: var(--ring-disabled-color); /* Required for Safari, see RG-2063 for details */
|
|
100
|
-
}
|
|
101
|
-
|
|
102
105
|
/*
|
|
103
106
|
Kill yellow/blue webkit autocomplete
|
|
104
107
|
https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/
|
|
@@ -112,10 +115,6 @@
|
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
.withIcon {
|
|
116
|
-
--ring-input-padding-start: calc(var(--ring-input-padding-inline) + var(--ring-input-icon-offset));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
118
|
.letter-text {
|
|
120
119
|
color: var(--ring-warning-color);
|
|
121
120
|
}
|
|
@@ -151,13 +150,12 @@
|
|
|
151
150
|
composes: resetButton from "../global/global.css";
|
|
152
151
|
|
|
153
152
|
position: absolute;
|
|
154
|
-
left: 1px;
|
|
155
153
|
|
|
156
154
|
display: block;
|
|
157
155
|
overflow: hidden;
|
|
158
156
|
|
|
159
|
-
width: calc(100% -
|
|
160
|
-
padding-left: var(--ring-input-padding-
|
|
157
|
+
width: calc(100% - var(--ring-input-padding-inline) * 4);
|
|
158
|
+
padding-left: calc(var(--ring-input-padding-inline) * 3 - var(--ring-input-padding-block));
|
|
161
159
|
|
|
162
160
|
white-space: nowrap;
|
|
163
161
|
|
|
@@ -166,6 +164,12 @@
|
|
|
166
164
|
pointer-events: none;
|
|
167
165
|
|
|
168
166
|
color: var(--ring-disabled-color);
|
|
167
|
+
|
|
168
|
+
@nest [dir=rtl] & {
|
|
169
|
+
padding-right: calc(var(--ring-input-padding-inline) * 3 - var(--ring-input-padding-block));
|
|
170
|
+
|
|
171
|
+
text-align: right;
|
|
172
|
+
}
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
.letter {
|
|
@@ -173,28 +177,28 @@
|
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
.actions {
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
178
183
|
|
|
179
|
-
height:
|
|
184
|
+
height: 100%;
|
|
185
|
+
max-height: calc(var(--ring-input-padding-inline) * 2);
|
|
186
|
+
padding-left: var(--ring-input-padding-inline);
|
|
180
187
|
|
|
181
188
|
line-height: inherit;
|
|
182
189
|
|
|
183
190
|
@nest [dir=rtl] & {
|
|
184
|
-
|
|
185
|
-
left: unit;
|
|
191
|
+
padding: 0 var(--ring-input-padding-inline) 0 0;
|
|
186
192
|
}
|
|
187
193
|
}
|
|
188
194
|
|
|
189
195
|
.icon {
|
|
190
|
-
|
|
191
|
-
left: var(--ring-input-padding-inline);
|
|
196
|
+
padding-right: var(--ring-input-padding-inline);
|
|
192
197
|
|
|
193
198
|
color: var(--ring-icon-secondary-color);
|
|
194
199
|
|
|
195
200
|
@nest [dir=rtl] & {
|
|
196
|
-
|
|
197
|
-
left: auto;
|
|
201
|
+
padding: 0 0 0 var(--ring-input-padding-inline);
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
|
|
@@ -226,7 +230,14 @@
|
|
|
226
230
|
}
|
|
227
231
|
|
|
228
232
|
.clear {
|
|
233
|
+
top: 1px;
|
|
234
|
+
|
|
229
235
|
padding-right: 0;
|
|
236
|
+
|
|
237
|
+
@nest [dir=rtl] & {
|
|
238
|
+
padding-right: var(--ring-input-padding-inline);
|
|
239
|
+
padding-left: 0;
|
|
240
|
+
}
|
|
230
241
|
}
|
|
231
242
|
|
|
232
243
|
.loaderOnTheRight {
|
|
@@ -238,3 +249,11 @@
|
|
|
238
249
|
.input::-webkit-scrollbar {
|
|
239
250
|
display: none;
|
|
240
251
|
}
|
|
252
|
+
|
|
253
|
+
.withoutGlass {
|
|
254
|
+
padding-left: 0;
|
|
255
|
+
|
|
256
|
+
@nest [dir=rtl] & {
|
|
257
|
+
padding-right: 0;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -771,14 +771,18 @@ export default class QueryAssist extends Component {
|
|
|
771
771
|
const containerClasses = classNames(className, inputStyles[`size${huge ? Size.FULL : size}`], {
|
|
772
772
|
[styles.queryAssist]: true,
|
|
773
773
|
[styles.withIcon]: (renderGlass && !huge) || renderLoader,
|
|
774
|
-
[styles.huge]: huge
|
|
774
|
+
[styles.huge]: huge,
|
|
775
|
+
[styles.queryAssistDisabled]: this.props.disabled
|
|
775
776
|
});
|
|
776
777
|
const inputClasses = classNames(this.props.inputClassName, {
|
|
777
778
|
[`${styles.input} ring-js-shortcuts`]: true,
|
|
778
779
|
[styles.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
779
780
|
[styles.inputGap2]: actions.length === 2,
|
|
780
|
-
[styles.inputLeftGap]: this.isRenderingGlassOrLoader() && glass
|
|
781
|
-
|
|
781
|
+
[styles.inputLeftGap]: this.isRenderingGlassOrLoader() && glass
|
|
782
|
+
});
|
|
783
|
+
const placeholderStyles = classNames({
|
|
784
|
+
[styles.placeholder]: true,
|
|
785
|
+
[styles.withoutGlass]: !renderGlass
|
|
782
786
|
});
|
|
783
787
|
return (<ControlsHeightContext.Provider value={ControlsHeight.M}>
|
|
784
788
|
<div data-test={dataTests('ring-query-assist', dataTest)} className={containerClasses} role="presentation" ref={this.nodeRef}>
|
|
@@ -796,7 +800,7 @@ export default class QueryAssist extends Component {
|
|
|
796
800
|
onKeyUp={this.handleInput} // to handle input and key up
|
|
797
801
|
onKeyDown={this.handleEnter} onPaste={this.handlePaste} spellCheck="false">{this.state.query && <span>{this.renderQuery()}</span>}</ContentEditable>
|
|
798
802
|
|
|
799
|
-
{renderPlaceholder && (<button type="button" className={
|
|
803
|
+
{renderPlaceholder && (<button type="button" className={placeholderStyles} ref={this.placeholderRef} onClick={this.handleCaretMove} data-test="query-assist-placeholder">
|
|
800
804
|
{this.props.placeholder}
|
|
801
805
|
</button>)}
|
|
802
806
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import List from '../list/list.js';
|
|
3
3
|
|
|
4
|
-
var modules_da7ab055 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","height":"var(--ring-button-height)","loaderWidth":"64px","overInputZIndex":"2","inputGap":"24px","light":"light_rui_d22e","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","
|
|
4
|
+
var modules_da7ab055 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","height":"var(--ring-button-height)","loaderWidth":"64px","overInputZIndex":"2","inputGap":"24px","light":"light_rui_d22e","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","queryAssistDisabled":"queryAssistDisabled_rui_d22e","huge":"huge_rui_d22e","actions":"actions_rui_d22e","placeholder":"placeholder_rui_d22e resetButton_rui_8bff","input":"input_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","letter":"letter_rui_d22e","rightSearchButton":"rightSearchButton_rui_d22e","clear":"clear_rui_d22e","loaderOnTheRight":"loaderOnTheRight_rui_d22e","withoutGlass":"withoutGlass_rui_d22e"};
|
|
5
5
|
|
|
6
6
|
const ICON_ID_LENGTH = 44;
|
|
7
7
|
class QueryAssistSuggestions {
|
|
@@ -782,14 +782,18 @@ class QueryAssist extends Component {
|
|
|
782
782
|
const containerClasses = classNames(className, modules_88cfaf40[`size${huge ? Size.FULL : size}`], {
|
|
783
783
|
[modules_da7ab055.queryAssist]: true,
|
|
784
784
|
[modules_da7ab055.withIcon]: renderGlass && !huge || renderLoader,
|
|
785
|
-
[modules_da7ab055.huge]: huge
|
|
785
|
+
[modules_da7ab055.huge]: huge,
|
|
786
|
+
[modules_da7ab055.queryAssistDisabled]: this.props.disabled
|
|
786
787
|
});
|
|
787
788
|
const inputClasses = classNames(this.props.inputClassName, {
|
|
788
789
|
[`${modules_da7ab055.input} ring-js-shortcuts`]: true,
|
|
789
790
|
[modules_da7ab055.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
790
791
|
[modules_da7ab055.inputGap2]: actions.length === 2,
|
|
791
|
-
[modules_da7ab055.inputLeftGap]: this.isRenderingGlassOrLoader() && glass
|
|
792
|
-
|
|
792
|
+
[modules_da7ab055.inputLeftGap]: this.isRenderingGlassOrLoader() && glass
|
|
793
|
+
});
|
|
794
|
+
const placeholderStyles = classNames({
|
|
795
|
+
[modules_da7ab055.placeholder]: true,
|
|
796
|
+
[modules_da7ab055.withoutGlass]: !renderGlass
|
|
793
797
|
});
|
|
794
798
|
return /*#__PURE__*/React.createElement(ControlsHeightContext.Provider, {
|
|
795
799
|
value: ControlsHeight.M
|
|
@@ -835,7 +839,7 @@ class QueryAssist extends Component {
|
|
|
835
839
|
spellCheck: "false"
|
|
836
840
|
}, this.state.query && /*#__PURE__*/React.createElement("span", null, this.renderQuery())), renderPlaceholder && /*#__PURE__*/React.createElement("button", {
|
|
837
841
|
type: "button",
|
|
838
|
-
className:
|
|
842
|
+
className: placeholderStyles,
|
|
839
843
|
ref: this.placeholderRef,
|
|
840
844
|
onClick: this.handleCaretMove,
|
|
841
845
|
"data-test": "query-assist-placeholder"
|