@ng-matero/ng-select 0.1.0

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.
@@ -0,0 +1,412 @@
1
+ /* stylelint-disable scss/no-global-function-names */
2
+ @import 'mixins';
3
+
4
+ $ng-select-highlight: #40a9ff !default;
5
+ $ng-select-primary-text: rgba(0, 0, 0, 0.65) !default;
6
+ $ng-select-disabled-text: rgba(0, 0, 0, 0.25) !default;
7
+ $ng-select-disabled-bg: #f5f5f5 !default;
8
+ $ng-select-border: #d9d9d9 !default;
9
+ $ng-select-bg: #fff !default;
10
+ $ng-select-selected: rgba(24, 144, 255, 0.2) !default;
11
+ $ng-select-marked: #e6f7ff !default;
12
+
13
+ .ng-select {
14
+ position: relative;
15
+
16
+ &.ng-select-opened {
17
+ &.ng-select-clearable .ng-select-container.ng-has-value:hover {
18
+ .ng-clear-wrapper {
19
+ opacity: 0;
20
+ pointer-events: none;
21
+ }
22
+
23
+ .ng-arrow-wrapper {
24
+ opacity: 1;
25
+ pointer-events: auto;
26
+ }
27
+ }
28
+
29
+ > .ng-select-container {
30
+ background: $ng-select-bg;
31
+ border-color: $ng-select-highlight;
32
+ box-shadow: 0 0 0 2px $ng-select-selected;
33
+
34
+ .ng-arrow-wrapper {
35
+ transform: rotate(180deg);
36
+ opacity: 1;
37
+ @include rtl {
38
+ transform: rotate(-180deg);
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ &.ng-select-focused {
45
+ .ng-select-container {
46
+ border-color: $ng-select-highlight;
47
+ }
48
+ }
49
+
50
+ &.ng-select-disabled {
51
+ > .ng-select-container {
52
+ background-color: $ng-select-disabled-bg;
53
+
54
+ &:hover {
55
+ border: 1px solid $ng-select-border;
56
+ cursor: not-allowed;
57
+ }
58
+
59
+ .ng-value-container {
60
+ .ng-value {
61
+ color: $ng-select-disabled-text;
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ .ng-has-value .ng-placeholder {
68
+ display: none;
69
+ }
70
+
71
+ &.ng-select-clearable .ng-select-container.ng-has-value:hover {
72
+ .ng-clear-wrapper {
73
+ opacity: 1;
74
+ }
75
+
76
+ .ng-arrow-wrapper {
77
+ opacity: 0;
78
+ pointer-events: none;
79
+ }
80
+ }
81
+
82
+ .ng-select-container {
83
+ color: $ng-select-primary-text;
84
+ background-color: $ng-select-bg;
85
+ border-radius: 4px;
86
+ border: 1px solid $ng-select-border;
87
+ min-height: 30px;
88
+ align-items: center;
89
+ transition: all 0.3s;
90
+ box-sizing: border-box;
91
+ padding-right: 11px;
92
+ padding-left: 11px;
93
+
94
+ .ng-input {
95
+ line-height: 22px;
96
+
97
+ input {
98
+ color: $ng-select-primary-text;
99
+ }
100
+ }
101
+
102
+ .ng-value-container {
103
+ align-items: center;
104
+
105
+ .ng-value {
106
+ font-size: 14px;
107
+ color: $ng-select-primary-text;
108
+ }
109
+
110
+ .ng-placeholder {
111
+ font-size: 14px;
112
+ color: lighten($ng-select-primary-text, 60);
113
+ }
114
+ }
115
+ }
116
+
117
+ &.ng-select-single {
118
+ &.ng-select-opened .ng-select-container .ng-value {
119
+ opacity: 0.4;
120
+ }
121
+
122
+ .ng-select-container {
123
+ .ng-value-container {
124
+ .ng-input {
125
+ top: 2px;
126
+ left: 0;
127
+ padding-left: 10px;
128
+ padding-right: 50px;
129
+ @include rtl {
130
+ padding-right: 10px;
131
+ padding-left: 50px;
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ &.ng-select-multiple {
139
+ &.ng-select-disabled {
140
+ > .ng-select-container .ng-value-container .ng-value {
141
+ background-color: $ng-select-disabled-bg;
142
+
143
+ .ng-value-label {
144
+ padding: 0 5px;
145
+ }
146
+ }
147
+ }
148
+
149
+ .ng-select-container {
150
+ min-height: 32px;
151
+ padding-left: 5px;
152
+
153
+ @include rtl {
154
+ padding-right: 5px;
155
+ padding-left: 11px;
156
+
157
+ .ng-value-container .ng-placeholder {
158
+ margin-left: 0;
159
+ margin-right: 6px;
160
+ }
161
+ }
162
+
163
+ .ng-value-container {
164
+ padding-bottom: 3px;
165
+
166
+ .ng-value {
167
+ margin-top: 3px;
168
+ margin-right: 4px;
169
+ font-size: 0.9em;
170
+ background-color: #fafafa;
171
+ border: 1px solid lighten($ng-select-border, 6);
172
+ border-radius: 2px;
173
+ height: 24px;
174
+ line-height: 22px;
175
+ @include rtl {
176
+ margin-right: 0;
177
+ margin-left: 4px;
178
+ }
179
+
180
+ &.ng-value-disabled {
181
+ background-color: $ng-select-disabled-bg;
182
+ color: $ng-select-disabled-text;
183
+
184
+ .ng-value-label {
185
+ padding-left: 5px;
186
+ @include rtl {
187
+ padding-left: 0;
188
+ padding-right: 5px;
189
+ }
190
+ }
191
+ }
192
+
193
+ .ng-value-label {
194
+ display: inline-block;
195
+ padding: 0 5px;
196
+ }
197
+
198
+ .ng-value-icon {
199
+ display: inline-block;
200
+ padding: 0 5px;
201
+ }
202
+ }
203
+
204
+ .ng-placeholder {
205
+ top: 50%;
206
+ height: 20px;
207
+ margin-top: -10px;
208
+ margin-left: 6px;
209
+ }
210
+
211
+ .ng-input {
212
+ height: 24px;
213
+ margin-top: 3px;
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ .ng-clear-wrapper {
220
+ opacity: 0;
221
+ color: darken($ng-select-border, 20);
222
+ background: rgba(0, 0, 0, 0.25);
223
+ width: 12px;
224
+ height: 12px;
225
+ text-align: center;
226
+ border-radius: 12px;
227
+ vertical-align: middle;
228
+ transition: color 0.3s ease;
229
+ position: absolute;
230
+ right: 13px;
231
+ @include rtl {
232
+ left: 13px;
233
+ right: auto;
234
+ }
235
+
236
+ &:hover {
237
+ background: rgba(0, 0, 0, 0.45);
238
+ }
239
+
240
+ &:focus {
241
+ background: rgba(0, 0, 0, 0.45);
242
+ outline: none;
243
+ }
244
+
245
+ .ng-clear {
246
+ color: #fff;
247
+ font-size: 9px;
248
+ position: absolute;
249
+ left: 3px;
250
+ line-height: 12px;
251
+ }
252
+ }
253
+
254
+ .ng-spinner-zone {
255
+ padding: 5px 5px 0 0;
256
+
257
+ @include rtl {
258
+ padding: 5px 0 0 5px;
259
+ }
260
+ }
261
+
262
+ .ng-arrow-wrapper {
263
+ width: 16px;
264
+ height: 26px;
265
+ transition: transform 0.3s;
266
+
267
+ .ng-arrow {
268
+ border-style: solid;
269
+ border-width: 0.1rem 0.1rem 0 0;
270
+ height: 8px;
271
+ width: 8px;
272
+ top: -2px;
273
+ transform: rotate(135deg);
274
+ color: $ng-select-disabled-text;
275
+ }
276
+ }
277
+ }
278
+
279
+ .ng-dropdown-panel {
280
+ background-color: $ng-select-bg;
281
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
282
+ border-radius: 4px;
283
+ margin-top: 4px;
284
+ margin-bottom: 4px;
285
+ left: 0;
286
+
287
+ &.ng-select-top {
288
+ bottom: 100%;
289
+ border-bottom-color: lighten($ng-select-border, 10);
290
+ }
291
+
292
+ &.ng-select-right {
293
+ left: 100%;
294
+ top: 0;
295
+ border-bottom-color: lighten($ng-select-border, 10);
296
+ margin-top: 0;
297
+ margin-left: 4px;
298
+ }
299
+
300
+ &.ng-select-bottom {
301
+ top: 100%;
302
+ border-top-color: lighten($ng-select-border, 10);
303
+ }
304
+
305
+ &.ng-select-left {
306
+ left: calc(-100% - 4px);
307
+ top: 0;
308
+ border-bottom-color: lighten($ng-select-border, 10);
309
+ margin-top: 0;
310
+ }
311
+
312
+ .ng-dropdown-header {
313
+ border-bottom: 1px solid $ng-select-border;
314
+ padding: 5px 7px;
315
+ }
316
+
317
+ .ng-dropdown-footer {
318
+ border-top: 1px solid $ng-select-border;
319
+ padding: 5px 7px;
320
+ }
321
+
322
+ .ng-dropdown-panel-items {
323
+ .ng-optgroup {
324
+ user-select: none;
325
+ padding: 4px 12px;
326
+ color: rgba(0, 0, 0, 0.45);
327
+ cursor: pointer;
328
+
329
+ &.ng-option-disabled {
330
+ cursor: default;
331
+ color: rgba(0, 0, 0, 0.45);
332
+ }
333
+
334
+ &.ng-option-marked {
335
+ background-color: $ng-select-marked;
336
+ }
337
+
338
+ &.ng-option-selected {
339
+ background-color: #fafafa;
340
+ font-weight: 600;
341
+ }
342
+
343
+ &.ng-option-selected.ng-option-marked {
344
+ background-color: $ng-select-marked;
345
+ }
346
+ }
347
+
348
+ .ng-option {
349
+ background-color: $ng-select-bg;
350
+ color: $ng-select-primary-text;
351
+ padding: 5px 12px;
352
+ transition: background 0.3s ease;
353
+
354
+ &:first-child {
355
+ border-top-right-radius: 4px;
356
+ border-top-left-radius: 4px;
357
+ }
358
+
359
+ &:last-child {
360
+ border-bottom-right-radius: 4px;
361
+ border-bottom-left-radius: 4px;
362
+ }
363
+
364
+ &.ng-option-selected {
365
+ background-color: #fafafa;
366
+ font-weight: 600;
367
+ }
368
+
369
+ &.ng-option-selected.ng-option-marked {
370
+ color: $ng-select-primary-text;
371
+ background-color: $ng-select-marked;
372
+ }
373
+
374
+ &.ng-option-marked {
375
+ background-color: $ng-select-marked;
376
+ color: $ng-select-primary-text;
377
+ }
378
+
379
+ &.ng-option-disabled {
380
+ color: $ng-select-disabled-text;
381
+ cursor: not-allowed;
382
+ }
383
+
384
+ &.ng-option-child {
385
+ padding-left: 20px;
386
+ @include rtl {
387
+ padding-right: 20px;
388
+ padding-left: 0;
389
+ }
390
+ }
391
+
392
+ .ng-option-label {
393
+ font-size: 14px;
394
+ }
395
+
396
+ .ng-tag-label {
397
+ font-size: 80%;
398
+ font-weight: 400;
399
+ padding-right: 5px;
400
+ @include rtl {
401
+ padding-left: 5px;
402
+ padding-right: 0;
403
+ }
404
+ }
405
+ }
406
+ }
407
+
408
+ @include rtl {
409
+ direction: rtl;
410
+ text-align: right;
411
+ }
412
+ }