codecheck
216 строк · 4.7 Кб
1@use "sass:math";
2
3// core
4.p-autocomplete {
5display: inline-flex;
6}
7
8.p-autocomplete-loader {
9position: absolute;
10top: 50%;
11margin-top: -0.5rem;
12}
13
14.p-autocomplete-dd .p-autocomplete-input {
15flex: 1 1 auto;
16width: 1%;
17}
18
19.p-autocomplete-dd .p-autocomplete-input,
20.p-autocomplete-dd .p-autocomplete-multiple-container {
21border-top-right-radius: 0;
22border-bottom-right-radius: 0;
23}
24
25.p-autocomplete-dd .p-autocomplete-dropdown {
26border-top-left-radius: 0;
27border-bottom-left-radius: 0px;
28}
29
30.p-autocomplete .p-autocomplete-panel {
31min-width: 100%;
32}
33
34.p-autocomplete-panel {
35position: absolute;
36overflow: auto;
37top: 0;
38left: 0;
39}
40
41.p-autocomplete-items {
42margin: 0;
43padding: 0;
44list-style-type: none;
45}
46
47.p-autocomplete-item {
48cursor: pointer;
49white-space: nowrap;
50position: relative;
51overflow: hidden;
52}
53
54.p-autocomplete-multiple-container {
55margin: 0;
56padding: 0;
57list-style-type: none;
58cursor: text;
59overflow: hidden;
60display: flex;
61align-items: center;
62flex-wrap: wrap;
63}
64
65.p-autocomplete-token {
66cursor: default;
67display: inline-flex;
68align-items: center;
69flex: 0 0 auto;
70}
71
72.p-autocomplete-token-icon {
73cursor: pointer;
74}
75
76.p-autocomplete-input-token {
77flex: 1 1 auto;
78display: inline-flex;
79}
80
81.p-autocomplete-input-token input {
82border: 0 none;
83outline: 0 none;
84background-color: transparent;
85margin: 0;
86padding: 0;
87box-shadow: none;
88border-radius: 0;
89width: 100%;
90}
91
92.p-fluid .p-autocomplete {
93display: flex;
94}
95
96.p-fluid .p-autocomplete-dd .p-autocomplete-input {
97width: 1%;
98}
99
100// theme
101.p-autocomplete {
102.p-autocomplete-loader {
103right: nth($inputPadding, 2);
104}
105
106&.p-autocomplete-dd {
107.p-autocomplete-loader {
108right: nth($inputPadding, 2) + $buttonIconOnlyWidth;
109}
110}
111
112&:not(.p-disabled):hover {
113.p-autocomplete-multiple-container {
114border-color: $inputHoverBorderColor;
115}
116}
117
118&:not(.p-disabled).p-focus {
119.p-autocomplete-multiple-container {
120@include focused-input();
121}
122}
123
124.p-autocomplete-multiple-container {
125padding: math.div(nth($inputPadding, 1), 2) nth($inputPadding, 2);
126gap: $inlineSpacing;
127outline-color: transparent;
128
129.p-autocomplete-input-token {
130padding: math.div(nth($inputPadding, 1), 2) 0;
131
132input {
133font-family: var(--font-family);
134font-feature-settings: var(--font-feature-settings, normal);
135font-size: $inputTextFontSize;
136color: $textColor;
137padding: 0;
138margin: 0;
139}
140}
141
142.p-autocomplete-token {
143padding: math.div(nth($inputPadding, 1), 2) nth($inputPadding, 2);
144background: $chipBg;
145color: $chipTextColor;
146border-radius: $chipBorderRadius;
147
148.p-autocomplete-token-icon {
149margin-left: $inlineSpacing;
150}
151
152&.p-focus {
153background: $chipFocusBg;
154color: $chipFocusTextColor;
155}
156}
157}
158
159&.p-invalid.p-component > .p-inputtext {
160@include invalid-input();
161}
162}
163
164.p-autocomplete-panel {
165background: $inputOverlayBg;
166color: $inputListTextColor;
167border: $inputOverlayBorder;
168border-radius: $borderRadius;
169box-shadow: $inputOverlayShadow;
170
171.p-autocomplete-items {
172padding: $inputListPadding;
173
174.p-autocomplete-item {
175margin: $inputListItemMargin;
176padding: $inputListItemPadding;
177border: $inputListItemBorder;
178color: $inputListItemTextColor;
179background: $inputListItemBg;
180transition: $listItemTransition;
181border-radius: $inputListItemBorderRadius;
182
183&:first-child {
184margin-top: 0;
185}
186
187&:last-child {
188margin-bottom: 0;
189}
190
191&.p-highlight {
192color: $highlightTextColor;
193background: $highlightBg;
194
195&.p-focus {
196background: $highlightFocusBg;
197}
198}
199
200&:not(.p-highlight):not(.p-disabled) {
201&.p-focus {
202color: $inputListItemTextHoverColor;
203background: $inputListItemHoverBg;
204}
205}
206}
207
208.p-autocomplete-item-group {
209margin: $submenuHeaderMargin;
210padding: $submenuHeaderPadding;
211color: $submenuHeaderTextColor;
212background: $submenuHeaderBg;
213font-weight: $submenuHeaderFontWeight;
214}
215}
216}
217