@ng-matero/ng-select 0.6.0 → 1.0.1

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,219 @@
1
+ @mixin wrap-text() {
2
+ white-space: nowrap;
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ }
6
+
7
+ .ng-select {
8
+ position: relative;
9
+ display: block;
10
+ }
11
+
12
+ .ng-select-control {
13
+ box-sizing: border-box;
14
+ position: relative;
15
+ display: flex;
16
+ width: 100%;
17
+ outline: none;
18
+ overflow: hidden;
19
+
20
+ .ng-select-opened & {
21
+ z-index: 1010;
22
+ }
23
+ }
24
+
25
+ .ng-select-value-container {
26
+ position: relative;
27
+ display: flex;
28
+ flex: 1;
29
+ flex-wrap: wrap;
30
+ align-items: center;
31
+ }
32
+
33
+ .ng-select-input-container {
34
+ position: relative;
35
+ box-sizing: border-box;
36
+ }
37
+
38
+ .ng-select-value-remove {
39
+ svg {
40
+ width: 14px;
41
+ height: 14px;
42
+ }
43
+ }
44
+
45
+ .ng-select-input {
46
+ width: 100%;
47
+ padding: 0;
48
+ background: transparent;
49
+ border: none;
50
+ box-shadow: none;
51
+ outline: none;
52
+ cursor: default;
53
+
54
+ &[readonly] {
55
+ width: 0;
56
+ user-select: unset;
57
+ }
58
+ }
59
+
60
+ .ng-select-clear,
61
+ .ng-select-arrow {
62
+ position: relative;
63
+ user-select: none;
64
+
65
+ svg {
66
+ width: 20px;
67
+ height: 20px;
68
+ }
69
+ }
70
+
71
+ .ng-select-visually-hidden {
72
+ position: absolute;
73
+ width: 1px;
74
+ height: 1px;
75
+ padding: 0;
76
+ margin: -1px;
77
+ border: 0;
78
+ overflow: hidden;
79
+ white-space: nowrap;
80
+ clip-path: inset(50%);
81
+ }
82
+
83
+ // status
84
+
85
+ .ng-select-disabled {
86
+ .ng-select-placeholder,
87
+ .ng-select-value {
88
+ user-select: none;
89
+ }
90
+
91
+ .ng-select-clear,
92
+ .ng-select-arrow {
93
+ pointer-events: none;
94
+ }
95
+ }
96
+
97
+ .ng-select-filtered,
98
+ .ng-select-has-value {
99
+ .ng-select-placeholder {
100
+ display: none;
101
+ }
102
+ }
103
+
104
+ .ng-select-single {
105
+ &.ng-select-filtered .ng-select-value {
106
+ visibility: hidden;
107
+ }
108
+
109
+ .ng-select-value {
110
+ @include wrap-text;
111
+ }
112
+
113
+ .ng-select-input-container {
114
+ position: absolute;
115
+ left: 0;
116
+ right: 0;
117
+ }
118
+ }
119
+
120
+ .ng-select-multiple {
121
+ .ng-select-placeholder {
122
+ position: absolute;
123
+ }
124
+
125
+ .ng-select-value {
126
+ display: inline-flex;
127
+ align-items: center;
128
+ overflow: hidden;
129
+
130
+ &.ng-select-value-disabled {
131
+ user-select: none;
132
+ }
133
+ }
134
+
135
+ &.ng-select-disabled,
136
+ .ng-select-value-disabled {
137
+ .ng-select-value-remove {
138
+ display: none;
139
+ }
140
+ }
141
+
142
+ .ng-select-input-container {
143
+ flex: 1;
144
+ }
145
+ }
146
+
147
+ // select panel
148
+
149
+ .ng-select-panel {
150
+ box-sizing: border-box;
151
+ position: absolute;
152
+ z-index: 1080;
153
+ width: 100%;
154
+ opacity: 0;
155
+ -webkit-overflow-scrolling: touch;
156
+ }
157
+
158
+ .ng-select-listbox {
159
+ max-height: 300px;
160
+ overflow-y: auto;
161
+ }
162
+
163
+ .ng-select-option,
164
+ .ng-select-optgroup {
165
+ @include wrap-text();
166
+ }
167
+
168
+ .ng-select-option-highlighted {
169
+ font-weight: bold;
170
+ text-decoration: underline;
171
+ }
172
+
173
+ .ng-select-option-label:empty::before {
174
+ content: '\200b';
175
+ }
176
+
177
+ // virtual scroll
178
+
179
+ .ng-select-virtual-scroll-host {
180
+ position: relative;
181
+ overflow: hidden auto;
182
+ -webkit-overflow-scrolling: touch;
183
+ }
184
+
185
+ .ng-select-virtual-scroll-content {
186
+ position: absolute;
187
+ top: 0;
188
+ left: 0;
189
+ width: 100%;
190
+ contain: content;
191
+ }
192
+
193
+ .ng-select-virtual-scroll-spacer {
194
+ width: 1px;
195
+ opacity: 0;
196
+ }
197
+
198
+ // loading
199
+
200
+ .ng-select-spinner {
201
+ position: relative;
202
+ width: 16px;
203
+ height: 16px;
204
+ margin: auto 4px;
205
+ border-radius: 50%;
206
+ border: 2px solid rgba(66, 66, 66, 0.2);
207
+ border-left-color: #666;
208
+ animation: ng-select-spinning 0.8s infinite linear;
209
+ }
210
+
211
+ @keyframes ng-select-spinning {
212
+ 0% {
213
+ transform: rotate(0deg);
214
+ }
215
+
216
+ 100% {
217
+ transform: rotate(360deg);
218
+ }
219
+ }
package/scss/_mixins.scss DELETED
@@ -1,5 +0,0 @@
1
- @mixin rtl {
2
- @at-root [dir='rtl'] #{&} {
3
- @content;
4
- }
5
- }
@@ -1,412 +0,0 @@
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-remove {
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
- }