@cloudscape-design/components-themeable 3.0.725 → 3.0.727
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/skeleton/styles.scss +8 -3
- package/lib/internal/scss/property-filter/styles.scss +87 -0
- package/lib/internal/scss/property-filter/test-classes/styles.scss +20 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +16 -16
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +28 -31
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +16 -16
- package/lib/internal/template/autosuggest/options-controller.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/options-controller.js +11 -4
- package/lib/internal/template/autosuggest/options-controller.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/property-filter/index.d.ts.map +1 -1
- package/lib/internal/template/property-filter/index.js +4 -14
- package/lib/internal/template/property-filter/index.js.map +1 -1
- package/lib/internal/template/property-filter/styles.css.js +46 -31
- package/lib/internal/template/property-filter/styles.scoped.css +134 -33
- package/lib/internal/template/property-filter/styles.selectors.js +46 -31
- package/lib/internal/template/property-filter/test-classes/styles.css.js +16 -14
- package/lib/internal/template/property-filter/test-classes/styles.scoped.css +22 -14
- package/lib/internal/template/property-filter/test-classes/styles.selectors.js +16 -14
- package/lib/internal/template/property-filter/token-editor-grouped.d.ts +32 -0
- package/lib/internal/template/property-filter/token-editor-grouped.d.ts.map +1 -0
- package/lib/internal/template/property-filter/token-editor-grouped.js +114 -0
- package/lib/internal/template/property-filter/token-editor-grouped.js.map +1 -0
- package/lib/internal/template/property-filter/token-editor.d.ts +34 -3
- package/lib/internal/template/property-filter/token-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor.js +8 -13
- package/lib/internal/template/property-filter/token-editor.js.map +1 -1
- package/lib/internal/template/property-filter/token.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token.js +6 -1
- package/lib/internal/template/property-filter/token.js.map +1 -1
- package/lib/internal/template/test-utils/dom/property-filter/index.d.ts +12 -0
- package/lib/internal/template/test-utils/dom/property-filter/index.js +40 -1
- package/lib/internal/template/test-utils/dom/property-filter/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/property-filter/index.d.ts +12 -0
- package/lib/internal/template/test-utils/selectors/property-filter/index.js +40 -1
- package/lib/internal/template/test-utils/selectors/property-filter/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
@mixin mobile-only {
|
|
17
|
+
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
|
|
18
|
+
@content;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
.root {
|
|
17
23
|
@include styles.styles-reset;
|
|
18
24
|
color: awsui.$color-text-body-default;
|
|
@@ -152,8 +158,7 @@
|
|
|
152
158
|
|
|
153
159
|
/* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
|
|
154
160
|
.unfocusable-mobile * {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
visibility: visible;
|
|
161
|
+
@include mobile-only {
|
|
162
|
+
visibility: hidden;
|
|
158
163
|
}
|
|
159
164
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
@use '../internal/styles/index' as styles;
|
|
7
7
|
@use '../internal/styles/tokens' as awsui;
|
|
8
8
|
|
|
9
|
+
$operator-field-width: 120px;
|
|
10
|
+
|
|
9
11
|
.root {
|
|
10
12
|
@include styles.styles-reset;
|
|
11
13
|
}
|
|
@@ -83,6 +85,91 @@
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
.token-editor-grouped {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: awsui.$space-s;
|
|
92
|
+
user-select: text;
|
|
93
|
+
margin-block: awsui.$space-xxs;
|
|
94
|
+
margin-inline: awsui.$space-xxs;
|
|
95
|
+
|
|
96
|
+
&-form {
|
|
97
|
+
margin-block-end: awsui.$space-scaled-l;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&-field-property {
|
|
101
|
+
flex-grow: 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-field-operator {
|
|
105
|
+
flex-grow: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&-field-value {
|
|
109
|
+
flex-grow: 2;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&-cancel {
|
|
113
|
+
margin-inline-end: awsui.$space-xs;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&-submit {
|
|
117
|
+
/* used in test-utils */
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&-actions {
|
|
121
|
+
display: flex;
|
|
122
|
+
justify-content: flex-end;
|
|
123
|
+
padding-block-start: awsui.$space-s;
|
|
124
|
+
border-block-start: 1px solid #{awsui.$color-border-dropdown-item-default};
|
|
125
|
+
|
|
126
|
+
// The below code cancels horizontal padding of the popover and horizontal margin of the token-editor.
|
|
127
|
+
padding-inline-end: calc(#{awsui.$space-m} + #{awsui.$space-xxs});
|
|
128
|
+
margin-inline: calc(-1 * #{awsui.$space-m} + -1 * #{awsui.$space-xxs});
|
|
129
|
+
margin-block-start: awsui.$space-s;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&-grid {
|
|
133
|
+
@include styles.styles-reset;
|
|
134
|
+
|
|
135
|
+
display: grid;
|
|
136
|
+
gap: awsui.$space-s;
|
|
137
|
+
grid-template-columns: 2fr $operator-field-width 3fr min-content;
|
|
138
|
+
|
|
139
|
+
&-group {
|
|
140
|
+
display: contents;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.token-editor-narrow {
|
|
144
|
+
grid-template-columns: 1fr;
|
|
145
|
+
gap: awsui.$space-m;
|
|
146
|
+
|
|
147
|
+
> .token-editor-grouped-group {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
gap: awsui.$space-s;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&-header {
|
|
155
|
+
color: awsui.$color-text-column-header;
|
|
156
|
+
font-weight: awsui.$font-weight-heading-s;
|
|
157
|
+
padding-block: awsui.$space-scaled-xxs;
|
|
158
|
+
text-align: start;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&-cell {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: flex-end;
|
|
164
|
+
justify-content: flex-end;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&-add-token {
|
|
169
|
+
margin-block-start: awsui.$space-s;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
86
173
|
.property-editor {
|
|
87
174
|
padding-block: awsui.$space-m;
|
|
88
175
|
padding-inline: awsui.$space-m;
|
|
@@ -6,27 +6,35 @@
|
|
|
6
6
|
.filtering-token {
|
|
7
7
|
/* used in test-utils */
|
|
8
8
|
}
|
|
9
|
+
|
|
9
10
|
.filtering-token-dismiss-button {
|
|
10
11
|
/* used in test-utils */
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
.filtering-token-select {
|
|
13
15
|
/* used in test-utils */
|
|
14
16
|
}
|
|
17
|
+
|
|
15
18
|
.filtering-token-content {
|
|
16
19
|
/* used in test-utils */
|
|
17
20
|
}
|
|
21
|
+
|
|
18
22
|
.filtering-token-inner {
|
|
19
23
|
/* used in test-utils */
|
|
20
24
|
}
|
|
25
|
+
|
|
21
26
|
.filtering-token-inner-dismiss-button {
|
|
22
27
|
/* used in test-utils */
|
|
23
28
|
}
|
|
29
|
+
|
|
24
30
|
.filtering-token-inner-select {
|
|
25
31
|
/* used in test-utils */
|
|
26
32
|
}
|
|
33
|
+
|
|
27
34
|
.filtering-token-inner-content {
|
|
28
35
|
/* used in test-utils */
|
|
29
36
|
}
|
|
37
|
+
|
|
30
38
|
.filtering-token-edit-button {
|
|
31
39
|
/* used in test-utils */
|
|
32
40
|
}
|
|
@@ -34,15 +42,27 @@
|
|
|
34
42
|
.token-editor-field-property {
|
|
35
43
|
/* used in test-utils */
|
|
36
44
|
}
|
|
45
|
+
|
|
37
46
|
.token-editor-field-operator {
|
|
38
47
|
/* used in test-utils */
|
|
39
48
|
}
|
|
49
|
+
|
|
40
50
|
.token-editor-field-value {
|
|
41
51
|
/* used in test-utils */
|
|
42
52
|
}
|
|
53
|
+
|
|
54
|
+
.token-editor-token-remove-actions {
|
|
55
|
+
/* used in test-utils */
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.token-editor-token-add-actions {
|
|
59
|
+
/* used in test-utils */
|
|
60
|
+
}
|
|
61
|
+
|
|
43
62
|
.token-editor-cancel {
|
|
44
63
|
/* used in test-utils */
|
|
45
64
|
}
|
|
65
|
+
|
|
46
66
|
.token-editor-submit {
|
|
47
67
|
/* used in test-utils */
|
|
48
68
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"has-adaptive-widths-default": "awsui_has-adaptive-widths-
|
|
6
|
-
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-
|
|
7
|
-
"navigation": "
|
|
8
|
-
"tools": "
|
|
9
|
-
"split-panel-side": "awsui_split-panel-
|
|
10
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
11
|
-
"panel-hidden": "awsui_panel-
|
|
12
|
-
"toolbar-container": "awsui_toolbar-
|
|
13
|
-
"notifications-container": "awsui_notifications-
|
|
14
|
-
"main-landmark": "awsui_main-
|
|
15
|
-
"main": "
|
|
16
|
-
"main-disable-paddings": "awsui_main-disable-
|
|
17
|
-
"content-header": "awsui_content-
|
|
18
|
-
"content": "
|
|
19
|
-
"unfocusable-mobile": "awsui_unfocusable-
|
|
4
|
+
"root": "awsui_root_7nfqu_l0bvq_101",
|
|
5
|
+
"has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_l0bvq_150",
|
|
6
|
+
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_l0bvq_165",
|
|
7
|
+
"navigation": "awsui_navigation_7nfqu_l0bvq_180",
|
|
8
|
+
"tools": "awsui_tools_7nfqu_l0bvq_181",
|
|
9
|
+
"split-panel-side": "awsui_split-panel-side_7nfqu_l0bvq_205",
|
|
10
|
+
"split-panel-bottom": "awsui_split-panel-bottom_7nfqu_l0bvq_211",
|
|
11
|
+
"panel-hidden": "awsui_panel-hidden_7nfqu_l0bvq_224",
|
|
12
|
+
"toolbar-container": "awsui_toolbar-container_7nfqu_l0bvq_228",
|
|
13
|
+
"notifications-container": "awsui_notifications-container_7nfqu_l0bvq_234",
|
|
14
|
+
"main-landmark": "awsui_main-landmark_7nfqu_l0bvq_241",
|
|
15
|
+
"main": "awsui_main_7nfqu_l0bvq_241",
|
|
16
|
+
"main-disable-paddings": "awsui_main-disable-paddings_7nfqu_l0bvq_250",
|
|
17
|
+
"content-header": "awsui_content-header_7nfqu_l0bvq_260",
|
|
18
|
+
"content": "awsui_content_7nfqu_l0bvq_260",
|
|
19
|
+
"unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_l0bvq_270"
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -98,7 +98,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
98
98
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
99
99
|
SPDX-License-Identifier: Apache-2.0
|
|
100
100
|
*/
|
|
101
|
-
.
|
|
101
|
+
.awsui_root_7nfqu_l0bvq_101:not(#\9) {
|
|
102
102
|
border-collapse: separate;
|
|
103
103
|
border-spacing: 0;
|
|
104
104
|
box-sizing: border-box;
|
|
@@ -141,45 +141,45 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
141
141
|
grid-template-rows: min-content min-content 1fr;
|
|
142
142
|
}
|
|
143
143
|
@media (min-width: 689px) {
|
|
144
|
-
.
|
|
144
|
+
.awsui_root_7nfqu_l0bvq_101:not(#\9) {
|
|
145
145
|
grid-template-areas: "navigation toolbar toolbar toolbar toolbar tools" "navigation . notifications . sideSplitPanel tools" "navigation . main . sideSplitPanel tools";
|
|
146
146
|
grid-template-columns: min-content minmax(var(--space-layout-content-horizontal-sin989, 40px), 1fr) minmax(0, var(--awsui-max-content-width-g964ok)) minmax(var(--space-layout-content-horizontal-sin989, 40px), 1fr) min-content min-content;
|
|
147
147
|
grid-template-rows: min-content min-content 1fr min-content;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
@media (min-width: 689px) and (min-width: 1401px) {
|
|
151
|
-
.
|
|
151
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-default_7nfqu_l0bvq_150:not(#\9) {
|
|
152
152
|
--awsui-max-content-width-g964ok: 1280px;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
@media (min-width: 689px) and (min-width: 1921px) {
|
|
156
|
-
.
|
|
156
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-default_7nfqu_l0bvq_150:not(#\9) {
|
|
157
157
|
--awsui-max-content-width-g964ok: 1440px;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
@media (min-width: 689px) and (min-width: 2541px) {
|
|
161
|
-
.
|
|
161
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-default_7nfqu_l0bvq_150:not(#\9) {
|
|
162
162
|
--awsui-max-content-width-g964ok: 1620px;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
@media (min-width: 689px) and (min-width: 1401px) {
|
|
166
|
-
.
|
|
166
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-dashboard_7nfqu_l0bvq_165:not(#\9) {
|
|
167
167
|
--awsui-max-content-width-g964ok: 1280px;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
@media (min-width: 689px) and (min-width: 1921px) {
|
|
171
|
-
.
|
|
171
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-dashboard_7nfqu_l0bvq_165:not(#\9) {
|
|
172
172
|
--awsui-max-content-width-g964ok: 1620px;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
@media (min-width: 689px) and (min-width: 2541px) {
|
|
176
|
-
.
|
|
176
|
+
.awsui_root_7nfqu_l0bvq_101.awsui_has-adaptive-widths-dashboard_7nfqu_l0bvq_165:not(#\9) {
|
|
177
177
|
--awsui-max-content-width-g964ok: 2160px;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.
|
|
182
|
-
.
|
|
181
|
+
.awsui_navigation_7nfqu_l0bvq_180:not(#\9),
|
|
182
|
+
.awsui_tools_7nfqu_l0bvq_181:not(#\9) {
|
|
183
183
|
grid-row: 1/-1;
|
|
184
184
|
grid-column: 1/-1;
|
|
185
185
|
background: var(--color-background-container-content-il2pe5, #ffffff);
|
|
@@ -187,7 +187,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
@media (min-width: 689px) {
|
|
190
|
-
.
|
|
190
|
+
.awsui_navigation_7nfqu_l0bvq_180:not(#\9) {
|
|
191
191
|
grid-area: navigation;
|
|
192
192
|
inline-size: var(--awsui-navigation-width-g964ok);
|
|
193
193
|
border-inline-end: 1px solid var(--color-border-divider-panel-side-btgups, transparent);
|
|
@@ -195,7 +195,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
@media (min-width: 689px) {
|
|
198
|
-
.
|
|
198
|
+
.awsui_tools_7nfqu_l0bvq_181:not(#\9) {
|
|
199
199
|
grid-area: tools;
|
|
200
200
|
inline-size: var(--awsui-tools-width-g964ok);
|
|
201
201
|
border-inline-start: 1px solid var(--color-border-divider-panel-side-btgups, transparent);
|
|
@@ -203,13 +203,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
@media (min-width: 689px) {
|
|
206
|
-
.awsui_split-panel-
|
|
206
|
+
.awsui_split-panel-side_7nfqu_l0bvq_205:not(#\9) {
|
|
207
207
|
grid-area: sideSplitPanel;
|
|
208
208
|
border-inline-start: 1px solid var(--color-border-divider-panel-side-btgups, transparent);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
.awsui_split-panel-
|
|
212
|
+
.awsui_split-panel-bottom_7nfqu_l0bvq_211:not(#\9) {
|
|
213
213
|
position: sticky;
|
|
214
214
|
z-index: 840;
|
|
215
215
|
align-self: end;
|
|
@@ -217,61 +217,58 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
217
217
|
grid-column: 1/-1;
|
|
218
218
|
}
|
|
219
219
|
@media (min-width: 689px) {
|
|
220
|
-
.awsui_split-panel-
|
|
220
|
+
.awsui_split-panel-bottom_7nfqu_l0bvq_211:not(#\9) {
|
|
221
221
|
grid-column: 2/span 3;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
.awsui_panel-
|
|
225
|
+
.awsui_panel-hidden_7nfqu_l0bvq_224:not(#\9) {
|
|
226
226
|
display: none;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.awsui_toolbar-
|
|
229
|
+
.awsui_toolbar-container_7nfqu_l0bvq_228:not(#\9) {
|
|
230
230
|
grid-area: toolbar;
|
|
231
231
|
block-size: 48px;
|
|
232
232
|
border-block-end: 1px solid var(--color-border-divider-panel-bottom-sc2k0v, rgba(0, 28, 36, 0.15));
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
.awsui_notifications-
|
|
235
|
+
.awsui_notifications-container_7nfqu_l0bvq_234:not(#\9) {
|
|
236
236
|
grid-area: notifications;
|
|
237
237
|
}
|
|
238
|
-
.awsui_notifications-
|
|
238
|
+
.awsui_notifications-container_7nfqu_l0bvq_234:not(#\9):not(:empty) {
|
|
239
239
|
padding-block-start: var(--space-scaled-xs-x91h81, 8px);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
.awsui_main-
|
|
242
|
+
.awsui_main-landmark_7nfqu_l0bvq_241:not(#\9) {
|
|
243
243
|
display: contents;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
.
|
|
246
|
+
.awsui_main_7nfqu_l0bvq_241:not(#\9) {
|
|
247
247
|
grid-area: main;
|
|
248
248
|
margin-block-start: var(--space-scaled-s-9q8n2q, 12px);
|
|
249
249
|
margin-block-end: var(--space-layout-content-bottom-ve4osc, 20px);
|
|
250
250
|
}
|
|
251
|
-
.awsui_main-disable-
|
|
251
|
+
.awsui_main-disable-paddings_7nfqu_l0bvq_250:not(#\9) {
|
|
252
252
|
grid-column: 1/-1;
|
|
253
253
|
margin-block: 0;
|
|
254
254
|
}
|
|
255
255
|
@media (min-width: 689px) {
|
|
256
|
-
.awsui_main-disable-
|
|
256
|
+
.awsui_main-disable-paddings_7nfqu_l0bvq_250:not(#\9) {
|
|
257
257
|
grid-column: 2/span 3;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
.awsui_content-
|
|
261
|
+
.awsui_content-header_7nfqu_l0bvq_260:not(#\9) {
|
|
262
262
|
margin-block-end: var(--space-content-header-padding-bottom-d3iv03, 16px);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
.
|
|
265
|
+
.awsui_content_7nfqu_l0bvq_260:not(#\9) {
|
|
266
266
|
display: contents;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
/* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
@media (min-width: 689px) {
|
|
274
|
-
.awsui_unfocusable-mobile_7nfqu_18aiq_269 *:not(#\9) {
|
|
275
|
-
visibility: visible;
|
|
270
|
+
@media (max-width: 688px) {
|
|
271
|
+
.awsui_unfocusable-mobile_7nfqu_l0bvq_270 *:not(#\9) {
|
|
272
|
+
visibility: hidden;
|
|
276
273
|
}
|
|
277
274
|
}
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"has-adaptive-widths-default": "awsui_has-adaptive-widths-
|
|
7
|
-
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-
|
|
8
|
-
"navigation": "
|
|
9
|
-
"tools": "
|
|
10
|
-
"split-panel-side": "awsui_split-panel-
|
|
11
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
12
|
-
"panel-hidden": "awsui_panel-
|
|
13
|
-
"toolbar-container": "awsui_toolbar-
|
|
14
|
-
"notifications-container": "awsui_notifications-
|
|
15
|
-
"main-landmark": "awsui_main-
|
|
16
|
-
"main": "
|
|
17
|
-
"main-disable-paddings": "awsui_main-disable-
|
|
18
|
-
"content-header": "awsui_content-
|
|
19
|
-
"content": "
|
|
20
|
-
"unfocusable-mobile": "awsui_unfocusable-
|
|
5
|
+
"root": "awsui_root_7nfqu_l0bvq_101",
|
|
6
|
+
"has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_l0bvq_150",
|
|
7
|
+
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_l0bvq_165",
|
|
8
|
+
"navigation": "awsui_navigation_7nfqu_l0bvq_180",
|
|
9
|
+
"tools": "awsui_tools_7nfqu_l0bvq_181",
|
|
10
|
+
"split-panel-side": "awsui_split-panel-side_7nfqu_l0bvq_205",
|
|
11
|
+
"split-panel-bottom": "awsui_split-panel-bottom_7nfqu_l0bvq_211",
|
|
12
|
+
"panel-hidden": "awsui_panel-hidden_7nfqu_l0bvq_224",
|
|
13
|
+
"toolbar-container": "awsui_toolbar-container_7nfqu_l0bvq_228",
|
|
14
|
+
"notifications-container": "awsui_notifications-container_7nfqu_l0bvq_234",
|
|
15
|
+
"main-landmark": "awsui_main-landmark_7nfqu_l0bvq_241",
|
|
16
|
+
"main": "awsui_main_7nfqu_l0bvq_241",
|
|
17
|
+
"main-disable-paddings": "awsui_main-disable-paddings_7nfqu_l0bvq_250",
|
|
18
|
+
"content-header": "awsui_content-header_7nfqu_l0bvq_260",
|
|
19
|
+
"content": "awsui_content_7nfqu_l0bvq_260",
|
|
20
|
+
"unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_l0bvq_270"
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-controller.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/options-controller.ts"],"names":[],"mappings":"AASA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EAEvB,MAAM,gEAAgE,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGjE,KAAK,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAExC,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAC9C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACrD,oBAAoB,CAA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K,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB,CAAC,eAAe,CAAC;IACpF,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,SAAS,GAAG,gBAAgB,CAAC,WAAW,CAAC;CACnF;AAED,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB,CAAC,eAAe,CAAC;IAC1F,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,mCAAmC,IAAI,OAAO,CAAC;IAC/C,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACnD;AAQD,eAAO,MAAM,mBAAmB,+GAQ7B,wBAAwB,KAAG,CAAC,qBAAqB,EAAE,wBAAwB,CAsE7E,CAAC"}
|
|
@@ -37,11 +37,18 @@ export const useAutosuggestItems = ({ options, filterValue, filterText, filterin
|
|
|
37
37
|
isHighlightable,
|
|
38
38
|
});
|
|
39
39
|
const selectHighlightedOptionWithKeyboard = () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
if (highlightedOptionState.highlightedOption && !isInteractive(highlightedOptionState.highlightedOption)) {
|
|
42
|
+
// skip selection when a non-interactive item is active
|
|
43
|
+
return false;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
onSelectItem((_a = highlightedOptionState.highlightedOption) !== null && _a !== void 0 ? _a : {
|
|
46
|
+
// put use-entered item as a fallback
|
|
47
|
+
value: filterValue,
|
|
48
|
+
type: 'use-entered',
|
|
49
|
+
option: { value: filterValue },
|
|
50
|
+
});
|
|
51
|
+
return true;
|
|
45
52
|
};
|
|
46
53
|
const highlightVisibleOptionWithMouse = (index) => {
|
|
47
54
|
if (filteredItems[index] && isHighlightable(filteredItems[index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AI,iCAAM,MAAM,KAAE,MAAM,IAAG,CAAC;SACnC;KACF;IAED,SAAS,YAAY,CAAC,KAAmC;QACvD,MAAM,EAAE,OAAO,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA5B,WAAoB,CAAQ,CAAC;QAEnC,IAAI,uBAAuB,GAAG,IAAI,CAAC;QAEnC,MAAM,SAAS,mCAAyB,IAAI,KAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC;QAE9E,MAAM,KAAK,GAAsB,CAAC,SAAS,CAAC,CAAC;QAE7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACpB,uBAAuB,GAAG,KAAK,CAAC;aACjC;YAED,MAAM,WAAW,mCACZ,MAAM,KACT,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAC1C,MAAM,GACP,CAAC;YAEF,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAExB,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;SACzC;QAED,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,uBAAuB,CAAC;QAEjE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAChD,CAAC;AAED,SAAS,OAAO,CAAC,aAAsC;IACrD,OAAO,SAAS,IAAI,aAAa,CAAC;AACpC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useMemo, useState } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { generateTestIndexes } from '../internal/components/options-list/utils/test-indexes';\nimport {\n HighlightedOptionHandlers,\n HighlightedOptionState,\n useHighlightedOption,\n} from '../internal/components/options-list/utils/use-highlight-option';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { filterOptions } from './utils/utils';\n\ntype Options = AutosuggestProps.Options;\n\nexport interface UseAutosuggestItemsProps {\n options: Options;\n filterValue: string;\n filterText: string;\n filteringType: AutosuggestProps.FilteringType;\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n hideEnteredTextLabel?: boolean;\n onSelectItem: (option: AutosuggestItem) => void;\n}\n\nexport interface AutosuggestItemsState extends HighlightedOptionState<AutosuggestItem> {\n items: readonly AutosuggestItem[];\n showAll: boolean;\n getItemGroup: (item: AutosuggestItem) => undefined | AutosuggestProps.OptionGroup;\n}\n\nexport interface AutosuggestItemsHandlers extends HighlightedOptionHandlers<AutosuggestItem> {\n setShowAll(value: boolean): void;\n selectHighlightedOptionWithKeyboard(): boolean;\n highlightVisibleOptionWithMouse(index: number): void;\n selectVisibleOptionWithMouse(index: number): void;\n}\n\nconst isHighlightable = (option?: AutosuggestItem) => {\n return !!option && option.type !== 'parent';\n};\n\nconst isInteractive = (option?: AutosuggestItem) => !!option && !option.disabled && option.type !== 'parent';\n\nexport const useAutosuggestItems = ({\n options,\n filterValue,\n filterText,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel,\n onSelectItem,\n}: UseAutosuggestItemsProps): [AutosuggestItemsState, AutosuggestItemsHandlers] => {\n const i18n = useInternalI18n('autosuggest');\n const [showAll, setShowAll] = useState(false);\n\n const { items, getItemGroup, getItemParent } = useMemo(() => createItems(options), [options]);\n\n const enteredItemLabel = i18n('enteredTextLabel', enteredTextLabel?.(filterValue), format =>\n format({ value: filterValue })\n );\n if (!enteredItemLabel) {\n warnOnce('Autosuggest', 'A value for enteredTextLabel must be provided.');\n }\n\n const filteredItems = useMemo(() => {\n const filteredItems = filteringType === 'auto' && !showAll ? filterOptions(items, filterText) : [...items];\n if (filterValue && !hideEnteredTextLabel) {\n filteredItems.unshift({\n value: filterValue,\n type: 'use-entered',\n label: enteredItemLabel,\n option: { value: filterValue },\n });\n }\n generateTestIndexes(filteredItems, getItemParent);\n return filteredItems;\n }, [filteringType, showAll, items, filterText, filterValue, hideEnteredTextLabel, getItemParent, enteredItemLabel]);\n\n const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({\n options: filteredItems,\n isHighlightable,\n });\n\n const selectHighlightedOptionWithKeyboard = () => {\n if (highlightedOptionState.highlightedOption && isInteractive(highlightedOptionState.highlightedOption)) {\n onSelectItem(highlightedOptionState.highlightedOption);\n return true;\n }\n return false;\n };\n\n const highlightVisibleOptionWithMouse = (index: number) => {\n if (filteredItems[index] && isHighlightable(filteredItems[index])) {\n highlightedOptionHandlers.setHighlightedIndexWithMouse(index);\n }\n };\n\n const selectVisibleOptionWithMouse = (index: number) => {\n if (filteredItems[index] && isInteractive(filteredItems[index])) {\n onSelectItem(filteredItems[index]);\n }\n };\n\n return [\n { ...highlightedOptionState, items: filteredItems, showAll, getItemGroup },\n {\n ...highlightedOptionHandlers,\n setShowAll,\n selectHighlightedOptionWithKeyboard,\n highlightVisibleOptionWithMouse,\n selectVisibleOptionWithMouse,\n },\n ];\n};\n\nfunction createItems(options: Options) {\n const items: AutosuggestItem[] = [];\n const itemToGroup = new WeakMap<AutosuggestItem, AutosuggestItem>();\n const getItemParent = (item: AutosuggestItem) => itemToGroup.get(item);\n const getItemGroup = (item: AutosuggestItem) => getItemParent(item)?.option as AutosuggestProps.OptionGroup;\n\n for (const option of options) {\n if (isGroup(option)) {\n for (const item of flattenGroup(option)) {\n items.push(item);\n }\n } else {\n items.push({ ...option, option });\n }\n }\n\n function flattenGroup(group: AutosuggestProps.OptionGroup) {\n const { options, ...rest } = group;\n\n let hasOnlyDisabledChildren = true;\n\n const groupItem: AutosuggestItem = { ...rest, type: 'parent', option: group };\n\n const items: AutosuggestItem[] = [groupItem];\n\n for (const option of options) {\n if (!option.disabled) {\n hasOnlyDisabledChildren = false;\n }\n\n const childOption: AutosuggestItem = {\n ...option,\n type: 'child',\n disabled: option.disabled || rest.disabled,\n option,\n };\n\n items.push(childOption);\n\n itemToGroup.set(childOption, groupItem);\n }\n\n items[0].disabled = items[0].disabled || hasOnlyDisabledChildren;\n\n return items;\n }\n\n return { items, getItemGroup, getItemParent };\n}\n\nfunction isGroup(optionOrGroup: AutosuggestProps.Option): optionOrGroup is AutosuggestProps.OptionGroup {\n return 'options' in optionOrGroup;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"options-controller.js","sourceRoot":"","sources":["../../../src/autosuggest/options-controller.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAGL,oBAAoB,GACrB,MAAM,gEAAgE,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA2B9C,MAAM,eAAe,GAAG,CAAC,MAAwB,EAAE,EAAE;IACnD,OAAO,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAAwB,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAE7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,OAAO,EACP,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,GACa,EAAqD,EAAE;IAChF,MAAM,IAAI,GAAG,eAAe,CAAC,aAAa,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CAAC,CAAC,CAAC,QAAQ,IAAI,uBAAuB,CAAC;QAEjE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAChD,CAAC;AAED,SAAS,OAAO,CAAC,aAAsC;IACrD,OAAO,SAAS,IAAI,aAAa,CAAC;AACpC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useMemo, useState } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { generateTestIndexes } from '../internal/components/options-list/utils/test-indexes';\nimport {\n HighlightedOptionHandlers,\n HighlightedOptionState,\n useHighlightedOption,\n} from '../internal/components/options-list/utils/use-highlight-option';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { filterOptions } from './utils/utils';\n\ntype Options = AutosuggestProps.Options;\n\nexport interface UseAutosuggestItemsProps {\n options: Options;\n filterValue: string;\n filterText: string;\n filteringType: AutosuggestProps.FilteringType;\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n hideEnteredTextLabel?: boolean;\n onSelectItem: (option: AutosuggestItem) => void;\n}\n\nexport interface AutosuggestItemsState extends HighlightedOptionState<AutosuggestItem> {\n items: readonly AutosuggestItem[];\n showAll: boolean;\n getItemGroup: (item: AutosuggestItem) => undefined | AutosuggestProps.OptionGroup;\n}\n\nexport interface AutosuggestItemsHandlers extends HighlightedOptionHandlers<AutosuggestItem> {\n setShowAll(value: boolean): void;\n selectHighlightedOptionWithKeyboard(): boolean;\n highlightVisibleOptionWithMouse(index: number): void;\n selectVisibleOptionWithMouse(index: number): void;\n}\n\nconst isHighlightable = (option?: AutosuggestItem) => {\n return !!option && option.type !== 'parent';\n};\n\nconst isInteractive = (option?: AutosuggestItem) => !!option && !option.disabled && option.type !== 'parent';\n\nexport const useAutosuggestItems = ({\n options,\n filterValue,\n filterText,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel,\n onSelectItem,\n}: UseAutosuggestItemsProps): [AutosuggestItemsState, AutosuggestItemsHandlers] => {\n const i18n = useInternalI18n('autosuggest');\n const [showAll, setShowAll] = useState(false);\n\n const { items, getItemGroup, getItemParent } = useMemo(() => createItems(options), [options]);\n\n const enteredItemLabel = i18n('enteredTextLabel', enteredTextLabel?.(filterValue), format =>\n format({ value: filterValue })\n );\n if (!enteredItemLabel) {\n warnOnce('Autosuggest', 'A value for enteredTextLabel must be provided.');\n }\n\n const filteredItems = useMemo(() => {\n const filteredItems = filteringType === 'auto' && !showAll ? filterOptions(items, filterText) : [...items];\n if (filterValue && !hideEnteredTextLabel) {\n filteredItems.unshift({\n value: filterValue,\n type: 'use-entered',\n label: enteredItemLabel,\n option: { value: filterValue },\n });\n }\n generateTestIndexes(filteredItems, getItemParent);\n return filteredItems;\n }, [filteringType, showAll, items, filterText, filterValue, hideEnteredTextLabel, getItemParent, enteredItemLabel]);\n\n const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({\n options: filteredItems,\n isHighlightable,\n });\n\n const selectHighlightedOptionWithKeyboard = () => {\n if (highlightedOptionState.highlightedOption && !isInteractive(highlightedOptionState.highlightedOption)) {\n // skip selection when a non-interactive item is active\n return false;\n }\n onSelectItem(\n highlightedOptionState.highlightedOption ?? {\n // put use-entered item as a fallback\n value: filterValue,\n type: 'use-entered',\n option: { value: filterValue },\n }\n );\n return true;\n };\n\n const highlightVisibleOptionWithMouse = (index: number) => {\n if (filteredItems[index] && isHighlightable(filteredItems[index])) {\n highlightedOptionHandlers.setHighlightedIndexWithMouse(index);\n }\n };\n\n const selectVisibleOptionWithMouse = (index: number) => {\n if (filteredItems[index] && isInteractive(filteredItems[index])) {\n onSelectItem(filteredItems[index]);\n }\n };\n\n return [\n { ...highlightedOptionState, items: filteredItems, showAll, getItemGroup },\n {\n ...highlightedOptionHandlers,\n setShowAll,\n selectHighlightedOptionWithKeyboard,\n highlightVisibleOptionWithMouse,\n selectVisibleOptionWithMouse,\n },\n ];\n};\n\nfunction createItems(options: Options) {\n const items: AutosuggestItem[] = [];\n const itemToGroup = new WeakMap<AutosuggestItem, AutosuggestItem>();\n const getItemParent = (item: AutosuggestItem) => itemToGroup.get(item);\n const getItemGroup = (item: AutosuggestItem) => getItemParent(item)?.option as AutosuggestProps.OptionGroup;\n\n for (const option of options) {\n if (isGroup(option)) {\n for (const item of flattenGroup(option)) {\n items.push(item);\n }\n } else {\n items.push({ ...option, option });\n }\n }\n\n function flattenGroup(group: AutosuggestProps.OptionGroup) {\n const { options, ...rest } = group;\n\n let hasOnlyDisabledChildren = true;\n\n const groupItem: AutosuggestItem = { ...rest, type: 'parent', option: group };\n\n const items: AutosuggestItem[] = [groupItem];\n\n for (const option of options) {\n if (!option.disabled) {\n hasOnlyDisabledChildren = false;\n }\n\n const childOption: AutosuggestItem = {\n ...option,\n type: 'child',\n disabled: option.disabled || rest.disabled,\n option,\n };\n\n items.push(childOption);\n\n itemToGroup.set(childOption, groupItem);\n }\n\n items[0].disabled = items[0].disabled || hasOnlyDisabledChildren;\n\n return items;\n }\n\n return { items, getItemGroup, getItemParent };\n}\n\nfunction isGroup(optionOrGroup: AutosuggestProps.Option): optionOrGroup is AutosuggestProps.OptionGroup {\n return 'options' in optionOrGroup;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAmBrE,OAAO,EASL,mBAAmB,EAGpB,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGAsYnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -10,7 +10,6 @@ import TokenList from '../internal/components/token-list';
|
|
|
10
10
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
11
11
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
12
12
|
import { useUniqueId } from '../internal/hooks/use-unique-id/index';
|
|
13
|
-
import { KeyCode } from '../internal/keycode';
|
|
14
13
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
15
14
|
import { joinStrings } from '../internal/utils/strings';
|
|
16
15
|
import InternalSpaceBetween from '../space-between/internal';
|
|
@@ -117,12 +116,6 @@ const PropertyFilter = React.forwardRef((_a, ref) => {
|
|
|
117
116
|
addToken(newToken);
|
|
118
117
|
setFilteringText('');
|
|
119
118
|
};
|
|
120
|
-
const ignoreKeyDown = useRef(false);
|
|
121
|
-
const handleKeyDown = event => {
|
|
122
|
-
if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {
|
|
123
|
-
createToken(filteringText);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
119
|
const getLoadMoreDetail = (parsedText, filteringText) => {
|
|
127
120
|
const loadMoreDetail = {
|
|
128
121
|
filteringProperty: undefined,
|
|
@@ -150,14 +143,11 @@ const PropertyFilter = React.forwardRef((_a, ref) => {
|
|
|
150
143
|
? Object.assign(Object.assign({}, inputLoadItemsHandlers), asyncProps) : {};
|
|
151
144
|
const handleSelected = event => {
|
|
152
145
|
var _a;
|
|
153
|
-
// The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,
|
|
154
|
-
// when an item is selected from the list using "enter" key.
|
|
155
|
-
ignoreKeyDown.current = true;
|
|
156
|
-
setTimeout(() => {
|
|
157
|
-
ignoreKeyDown.current = false;
|
|
158
|
-
}, 0);
|
|
159
146
|
const { detail: option } = event;
|
|
160
147
|
const value = option.value || '';
|
|
148
|
+
if (!value) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
161
151
|
if (!('keepOpenOnSelect' in option)) {
|
|
162
152
|
createToken(value);
|
|
163
153
|
return;
|
|
@@ -187,7 +177,7 @@ const PropertyFilter = React.forwardRef((_a, ref) => {
|
|
|
187
177
|
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(baseProps.className, styles.root), ref: __internalRootRef }),
|
|
188
178
|
React.createElement("div", { className: styles['search-field'] },
|
|
189
179
|
customControl && React.createElement("div", { className: styles['custom-control'] }, customControl),
|
|
190
|
-
React.createElement(PropertyFilterAutosuggest, Object.assign({ ref: inputRef, virtualScroll: virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, ariaLabel: filteringAriaLabel !== null && filteringAriaLabel !== void 0 ? filteringAriaLabel : i18nStrings.filteringAriaLabel, placeholder: filteringPlaceholder !== null && filteringPlaceholder !== void 0 ? filteringPlaceholder : i18nStrings.filteringPlaceholder, ariaLabelledby: rest.ariaLabelledby, ariaDescribedby: textboxAriaDescribedBy, controlId: rest.controlId, value: filteringText, disabled: disabled
|
|
180
|
+
React.createElement(PropertyFilterAutosuggest, Object.assign({ ref: inputRef, virtualScroll: virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, ariaLabel: filteringAriaLabel !== null && filteringAriaLabel !== void 0 ? filteringAriaLabel : i18nStrings.filteringAriaLabel, placeholder: filteringPlaceholder !== null && filteringPlaceholder !== void 0 ? filteringPlaceholder : i18nStrings.filteringPlaceholder, ariaLabelledby: rest.ariaLabelledby, ariaDescribedby: textboxAriaDescribedBy, controlId: rest.controlId, value: filteringText, disabled: disabled }, autosuggestOptions, { onChange: event => setFilteringText(event.detail.value), empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport: expandToViewport, onOptionClick: handleSelected, customForm: operatorForm && (React.createElement(PropertyEditor, { property: parsedText.property, operator: parsedText.operator, filter: parsedText.value, operatorForm: operatorForm, i18nStrings: i18nStrings, onCancel: () => {
|
|
191
181
|
var _a, _b;
|
|
192
182
|
setFilteringText('');
|
|
193
183
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.close();
|