@stackline/angular-multiselect-dropdown 2.0.4 → 2.0.5

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.
@@ -1,119 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const glob = require('glob');
6
-
7
-
8
- /**
9
- * Simple Promiseify function that takes a Node API and return a version that supports promises.
10
- * We use promises instead of synchronized functions to make the process less I/O bound and
11
- * faster. It also simplifies the code.
12
- */
13
- function promiseify(fn) {
14
- return function () {
15
- const args = [].slice.call(arguments, 0);
16
- return new Promise((resolve, reject) => {
17
- fn.apply(this, args.concat([function (err, value) {
18
- if (err) {
19
- reject(err);
20
- } else {
21
- resolve(value);
22
- }
23
- }]));
24
- });
25
- };
26
- }
27
-
28
- const readFile = promiseify(fs.readFile);
29
- const writeFile = promiseify(fs.writeFile);
30
-
31
- /**
32
- * Inline resources in a tsc/ngc compilation.
33
- * @param projectPath {string} Path to the project.
34
- */
35
- function inlineResources(projectPath) {
36
-
37
- // Match only TypeScript files in projectPath.
38
- const files = glob.sync('**/*.ts', {cwd: projectPath});
39
-
40
- // For each file, inline the templates and styles under it and write the new file.
41
- return Promise.all(files.map(filePath => {
42
- const fullFilePath = path.join(projectPath, filePath);
43
- return readFile(fullFilePath, 'utf-8')
44
- .then(content => inlineResourcesFromString(content, url => {
45
- // Resolve the template url.
46
- return path.join(path.dirname(fullFilePath), url);
47
- }))
48
- .then(content => writeFile(fullFilePath, content))
49
- .catch(err => {
50
- console.error('An error occured: ', err);
51
- });
52
- }));
53
- }
54
-
55
- /**
56
- * Inline resources from a string content.
57
- * @param content {string} The source file's content.
58
- * @param urlResolver {Function} A resolver that takes a URL and return a path.
59
- * @returns {string} The content with resources inlined.
60
- */
61
- function inlineResourcesFromString(content, urlResolver) {
62
- // Curry through the inlining functions.
63
- return [
64
- inlineTemplate,
65
- inlineStyle
66
- ].reduce((content, fn) => fn(content, urlResolver), content);
67
- }
68
-
69
- /**
70
- * Inline the templates for a source file. Simply search for instances of `templateUrl: ...` and
71
- * replace with `template: ...` (with the content of the file included).
72
- * @param content {string} The source file's content.
73
- * @param urlResolver {Function} A resolver that takes a URL and return a path.
74
- * @return {string} The content with all templates inlined.
75
- */
76
- function inlineTemplate(content, urlResolver) {
77
- return content.replace(/templateUrl:\s*'([^']+?\.html)'/g, function (m, templateUrl) {
78
- const templateFile = urlResolver(templateUrl);
79
- const templateContent = fs.readFileSync(templateFile, 'utf-8');
80
- const shortenedTemplate = templateContent
81
- .replace(/([\n\r]\s*)+/gm, ' ')
82
- .replace(/"/g, '\\"');
83
- return `template: "${shortenedTemplate}"`;
84
- });
85
- }
86
-
87
-
88
- /**
89
- * Inline the styles for a source file. Simply search for instances of `styleUrls: [...]` and
90
- * replace with `styles: [...]` (with the content of the file included).
91
- * @param urlResolver {Function} A resolver that takes a URL and return a path.
92
- * @param content {string} The source file's content.
93
- * @return {string} The content with all styles inlined.
94
- */
95
- function inlineStyle(content, urlResolver) {
96
- return content.replace(/styleUrls:\s*(\[[\s\S]*?\])/gm, function (m, styleUrls) {
97
- const urls = eval(styleUrls);
98
- return 'styles: ['
99
- + urls.map(styleUrl => {
100
- const styleFile = urlResolver(styleUrl);
101
- const styleContent = fs.readFileSync(styleFile, 'utf-8');
102
- const shortenedStyle = styleContent
103
- .replace(/([\n\r]\s*)+/gm, ' ')
104
- .replace(/"/g, '\\"');
105
- return `"${shortenedStyle}"`;
106
- })
107
- .join(',\n')
108
- + ']';
109
- });
110
- }
111
-
112
- module.exports = inlineResources;
113
- module.exports.inlineResourcesFromString = inlineResourcesFromString;
114
-
115
- // Run inlineResources if module is being called directly from the CLI with arguments.
116
- if (require.main === module && process.argv.length > 2) {
117
- console.log('Inlining resources from project:', process.argv[2]);
118
- return inlineResources(process.argv[2]);
119
- }
@@ -1,618 +0,0 @@
1
- .stackline-dropdown {
2
- position: relative;
3
- }
4
-
5
- .c-btn {
6
- display: inline-block;
7
- background: #fff;
8
- border: 1px solid #ccc;
9
- border-radius: 3px;
10
- font-size: 14px;
11
- color: #333;
12
- }
13
-
14
- .c-btn.disabled {
15
- background: #ccc;
16
- }
17
-
18
- .c-btn:focus {
19
- outline: none;
20
- }
21
-
22
- .selected-list .c-list {
23
- display: flex;
24
- flex: 1 1 auto;
25
- align-items: center;
26
- flex-wrap: wrap;
27
- min-width: 0;
28
- float: none;
29
- padding: 0px;
30
- margin: 0px;
31
- width: auto;
32
- }
33
- .selected-list .c-list .c-token {
34
- list-style: none;
35
- padding: 0px 5px;
36
- background: #0079FE;
37
- color: #fff;
38
- border-radius: 2px;
39
- margin-right: 4px;
40
- margin-top: 2px;
41
- float: left;
42
- }
43
- .selected-list .c-list .c-token .c-label {
44
- display: block;
45
- float: left;
46
- /*width: 50px;
47
- white-space: nowrap;
48
- text-overflow: ellipsis;
49
- overflow: hidden;*/
50
- }
51
- .selected-list .c-list .c-token .fa-remove {
52
- margin-left: 1px;
53
- font-size: 12px;
54
- }
55
- .selected-list .fa-angle-down, .selected-list .fa-angle-up {
56
- font-size: 15pt;
57
- position: absolute;
58
- right: 10px;
59
- top: 50%;
60
- transform: translateY(-50%);
61
- }
62
- .selected-list .countplaceholder {
63
- display: inline-flex;
64
- flex: 0 0 auto;
65
- align-items: center;
66
- justify-content: center;
67
- align-self: center;
68
- margin: 0 0 0 6px;
69
- line-height: 1;
70
- }
71
- .selected-list .c-btn {
72
- box-sizing: border-box;
73
- width: 100%;
74
- box-shadow: 0px 1px 5px #959595;
75
- padding: 10px 36px 10px 10px;
76
- cursor: pointer;
77
- display: flex;
78
- align-items: center;
79
- flex-wrap: nowrap;
80
- position: relative;
81
- }
82
-
83
- .dropdown-list {
84
- position: absolute;
85
- padding-top: 14px;
86
- width: 100%;
87
- z-index: 9999;
88
- }
89
- .dropdown-list ul {
90
- padding: 0px;
91
- list-style: none;
92
- overflow: auto;
93
- margin: 0px;
94
- }
95
- .dropdown-list ul li {
96
- padding: 10px 10px;
97
- cursor: pointer;
98
- text-align: left;
99
- }
100
- .dropdown-list ul li:first-child {
101
- padding-top: 10px;
102
- }
103
- .dropdown-list ul li:last-child {
104
- padding-bottom: 10px;
105
- }
106
- .dropdown-list ul li:hover {
107
- background: #f5f5f5;
108
- }
109
- .dropdown-list ::-webkit-scrollbar {
110
- width: 8px;
111
- }
112
- .dropdown-list ::-webkit-scrollbar-thumb {
113
- background: #cccccc;
114
- border-radius: 5px;
115
- }
116
- .dropdown-list ::-webkit-scrollbar-track {
117
- background: #f2f2f2;
118
- }
119
-
120
- .arrow-up {
121
- width: 0;
122
- height: 0;
123
- border-left: 13px solid transparent;
124
- border-right: 13px solid transparent;
125
- border-bottom: 15px solid #fff;
126
- margin-left: 15px;
127
- position: absolute;
128
- top: 0;
129
- }
130
-
131
- .arrow-2 {
132
- border-bottom: 15px solid #ccc;
133
- top: -1px;
134
- }
135
-
136
- .list-area {
137
- border: 1px solid #ccc;
138
- border-radius: 3px;
139
- background: #fff;
140
- margin: 0px;
141
- box-shadow: 0px 1px 5px #959595;
142
- }
143
-
144
- .select-all {
145
- padding: 10px;
146
- border-bottom: 1px solid #ccc;
147
- text-align: left;
148
- }
149
-
150
- .list-filter {
151
- border-bottom: 1px solid #ccc;
152
- position: relative;
153
- }
154
- .list-filter input {
155
- border: 0px;
156
- width: 100%;
157
- height: 35px;
158
- padding: 0px 0px 0px 35px;
159
- }
160
- .list-filter input:focus {
161
- outline: none;
162
- }
163
- .list-filter .fa {
164
- position: absolute;
165
- top: 10px;
166
- left: 13px;
167
- color: #888;
168
- }
169
-
170
- .pure-checkbox input[type=checkbox] {
171
- border: 0;
172
- clip: rect(0 0 0 0);
173
- height: 1px;
174
- margin: -1px;
175
- overflow: hidden;
176
- padding: 0;
177
- position: absolute;
178
- width: 1px;
179
- }
180
-
181
- .pure-checkbox input[type=checkbox]:focus + label:before,
182
- .pure-checkbox input[type=checkbox]:hover + label:before {
183
- border-color: #0079FE;
184
- background-color: #f2f2f2;
185
- }
186
-
187
- .pure-checkbox input[type=checkbox]:active + label:before {
188
- transition-duration: 0s;
189
- }
190
-
191
- .pure-checkbox input[type=checkbox] + label {
192
- position: relative;
193
- padding-left: 2em;
194
- vertical-align: middle;
195
- user-select: none;
196
- cursor: pointer;
197
- margin: 0px;
198
- color: #000;
199
- font-weight: 300;
200
- }
201
-
202
- .pure-checkbox input[type=checkbox] + label:before {
203
- box-sizing: content-box;
204
- content: "";
205
- color: #0079FE;
206
- position: absolute;
207
- top: 50%;
208
- left: 0;
209
- width: 14px;
210
- height: 14px;
211
- margin-top: -9px;
212
- border: 2px solid #0079FE;
213
- text-align: center;
214
- transition: all 0.4s ease;
215
- }
216
-
217
- .pure-checkbox input[type=checkbox] + label:after {
218
- box-sizing: content-box;
219
- content: "";
220
- background-color: #0079FE;
221
- position: absolute;
222
- top: 50%;
223
- left: 4px;
224
- width: 10px;
225
- height: 10px;
226
- margin-top: -5px;
227
- transform: scale(0);
228
- transform-origin: 50%;
229
- transition: transform 200ms ease-out;
230
- }
231
-
232
- .pure-checkbox input[type=checkbox]:disabled + label:before {
233
- border-color: #cccccc;
234
- }
235
-
236
- .pure-checkbox input[type=checkbox]:disabled:focus + label:before .pure-checkbox input[type=checkbox]:disabled:hover + label:before {
237
- background-color: inherit;
238
- }
239
-
240
- .pure-checkbox input[type=checkbox]:disabled:checked + label:before {
241
- background-color: #cccccc;
242
- }
243
-
244
- .pure-checkbox input[type=checkbox] + label:after {
245
- background-color: transparent;
246
- top: 50%;
247
- left: 4px;
248
- width: 8px;
249
- height: 3px;
250
- margin-top: -4px;
251
- border-style: solid;
252
- border-color: #ffffff;
253
- border-width: 0 0 3px 3px;
254
- border-image: none;
255
- transform: rotate(-45deg) scale(0);
256
- }
257
-
258
- .pure-checkbox input[type=checkbox]:checked + label:after {
259
- content: "";
260
- transform: rotate(-45deg) scale(1);
261
- transition: transform 200ms ease-out;
262
- }
263
-
264
- .pure-checkbox input[type=radio]:checked + label:before {
265
- background-color: white;
266
- }
267
-
268
- .pure-checkbox input[type=radio]:checked + label:after {
269
- transform: scale(1);
270
- }
271
-
272
- .pure-checkbox input[type=radio] + label:before {
273
- border-radius: 50%;
274
- }
275
-
276
- .pure-checkbox input[type=checkbox]:checked + label:before {
277
- background: #0079FE;
278
- }
279
-
280
- .pure-checkbox input[type=checkbox]:checked + label:after {
281
- transform: rotate(-45deg) scale(1);
282
- }
283
-
284
- .list-message {
285
- text-align: center;
286
- }
287
-
288
- .list-grp {
289
- padding: 0 15px !important;
290
- }
291
-
292
- .list-grp h4 {
293
- text-transform: capitalize;
294
- margin: 15px 0px 0px 0px;
295
- font-size: 14px;
296
- font-weight: 700;
297
- }
298
-
299
- .list-grp > li {
300
- padding-left: 15px !important;
301
- }
302
-
303
- .stackline-dropdown.theme-material {
304
- --ms-primary: #3f51b5;
305
- --ms-primary-soft: rgba(63, 81, 181, 0.12);
306
- --ms-surface: #ffffff;
307
- --ms-surface-soft: #f5f7fb;
308
- --ms-surface-muted: #e8eaf6;
309
- --ms-outline: #c5cae9;
310
- --ms-outline-strong: #7986cb;
311
- --ms-on-surface: #212121;
312
- --ms-on-surface-muted: #5f6368;
313
- --ms-chip-bg: #e8eaf6;
314
- --ms-chip-text: #303f9f;
315
- --ms-chip-remove: #303f9f;
316
- --ms-shadow: 0 1px 2px rgba(33, 33, 33, 0.16), 0 12px 32px rgba(63, 81, 181, 0.12);
317
- --ms-shadow-soft: 0 1px 2px rgba(33, 33, 33, 0.12), 0 4px 12px rgba(33, 33, 33, 0.08);
318
- display: block;
319
- width: 100%;
320
- color: var(--ms-on-surface);
321
- font: inherit;
322
- }
323
-
324
- .stackline-dropdown.theme-material .selected-list {
325
- width: 100%;
326
- }
327
-
328
- .stackline-dropdown.theme-material .selected-list .c-btn {
329
- position: relative;
330
- display: flex;
331
- align-items: center;
332
- flex-wrap: nowrap;
333
- gap: 8px;
334
- width: 100%;
335
- min-height: 56px;
336
- padding: 11px 54px 11px 16px;
337
- border-radius: 18px;
338
- border: 1px solid var(--ms-outline);
339
- background: var(--ms-surface);
340
- box-shadow: var(--ms-shadow-soft);
341
- color: var(--ms-on-surface);
342
- cursor: pointer;
343
- font-size: inherit;
344
- line-height: 1.45;
345
- transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
346
- }
347
-
348
- .stackline-dropdown.theme-material .selected-list .c-btn:hover {
349
- border-color: var(--ms-outline-strong);
350
- }
351
-
352
- .stackline-dropdown.theme-material .selected-list .c-btn.disabled {
353
- background: var(--ms-surface);
354
- cursor: not-allowed;
355
- opacity: 0.72;
356
- }
357
-
358
- .stackline-dropdown.theme-material .selected-list .c-list {
359
- display: flex;
360
- flex: 1 1 auto;
361
- flex-wrap: wrap;
362
- gap: 8px;
363
- width: auto;
364
- min-width: 0;
365
- margin: 0;
366
- padding: 0;
367
- float: none;
368
- }
369
-
370
- .stackline-dropdown.theme-material .selected-list .c-list .c-token {
371
- position: relative;
372
- display: inline-block;
373
- vertical-align: middle;
374
- min-height: 32px;
375
- max-width: 100%;
376
- padding: 6px 30px 6px 12px;
377
- background: var(--ms-chip-bg);
378
- color: var(--ms-chip-text);
379
- border-radius: 999px;
380
- box-shadow: inset 0 0 0 1px rgba(103, 80, 164, 0.08);
381
- line-height: 1.35;
382
- white-space: normal;
383
- overflow-wrap: anywhere;
384
- margin: 0;
385
- float: none;
386
- }
387
-
388
- .stackline-dropdown.theme-material .selected-list .c-list .c-token .c-label {
389
- display: inline-flex;
390
- align-items: center;
391
- float: none;
392
- min-width: 0;
393
- max-width: 100%;
394
- line-height: 1.3;
395
- font-weight: 500;
396
- white-space: normal;
397
- overflow-wrap: anywhere;
398
- }
399
-
400
- .stackline-dropdown.theme-material .selected-list .c-list .c-token .fa-remove {
401
- position: absolute;
402
- right: 10px;
403
- top: 50%;
404
- display: inline-flex;
405
- align-items: center;
406
- justify-content: center;
407
- width: 16px;
408
- height: 16px;
409
- margin-left: 0;
410
- transform: translateY(-50%);
411
- color: var(--ms-chip-remove);
412
- cursor: pointer;
413
- }
414
-
415
- .stackline-dropdown.theme-material .selected-list .countplaceholder {
416
- display: inline-flex;
417
- flex: 0 0 auto;
418
- align-items: center;
419
- justify-content: center;
420
- align-self: center;
421
- margin: 0;
422
- line-height: 1;
423
- color: var(--ms-on-surface-muted);
424
- font-size: 0.8rem;
425
- font-weight: 600;
426
- }
427
-
428
- .stackline-dropdown.theme-material .selected-list .fa-angle-down,
429
- .stackline-dropdown.theme-material .selected-list .fa-angle-up {
430
- position: absolute;
431
- top: 50%;
432
- right: 16px;
433
- display: inline-flex;
434
- align-items: center;
435
- justify-content: center;
436
- width: 20px;
437
- height: 20px;
438
- transform: translateY(-50%);
439
- color: var(--ms-on-surface-muted);
440
- font-size: 15pt;
441
- pointer-events: none;
442
- }
443
-
444
- .stackline-dropdown.theme-material .dropdown-list {
445
- position: absolute;
446
- width: 100%;
447
- padding-top: 8px;
448
- z-index: 99999;
449
- }
450
-
451
- .stackline-dropdown.theme-material .arrow-up,
452
- .stackline-dropdown.theme-material .arrow-down,
453
- .stackline-dropdown.theme-material .arrow-2 {
454
- display: none;
455
- }
456
-
457
- .stackline-dropdown.theme-material .list-area {
458
- overflow: hidden;
459
- border-radius: 22px;
460
- background: var(--ms-surface);
461
- border: 1px solid var(--ms-outline);
462
- box-shadow: var(--ms-shadow);
463
- margin: 0;
464
- }
465
-
466
- .stackline-dropdown.theme-material .select-all {
467
- padding: 10px 14px;
468
- border-bottom: 1px solid rgba(125, 119, 134, 0.16);
469
- background: rgba(247, 242, 250, 0.76);
470
- text-align: left;
471
- }
472
-
473
- .stackline-dropdown.theme-material .list-filter {
474
- position: relative;
475
- display: flex;
476
- align-items: center;
477
- min-height: 52px;
478
- padding-left: 48px;
479
- padding-right: 44px;
480
- border-bottom: 1px solid rgba(125, 119, 134, 0.16);
481
- background: var(--ms-surface);
482
- }
483
-
484
- .stackline-dropdown.theme-material .list-filter input {
485
- width: 100%;
486
- height: 100%;
487
- border: 0;
488
- background: transparent;
489
- color: var(--ms-on-surface);
490
- font: inherit;
491
- padding: 0;
492
- }
493
-
494
- .stackline-dropdown.theme-material .list-filter input::placeholder {
495
- color: var(--ms-on-surface-muted);
496
- }
497
-
498
- .stackline-dropdown.theme-material .list-filter input:focus {
499
- outline: none;
500
- }
501
-
502
- .stackline-dropdown.theme-material .list-filter .fa {
503
- position: absolute;
504
- top: 50%;
505
- left: 16px;
506
- display: inline-flex;
507
- align-items: center;
508
- justify-content: center;
509
- width: 18px;
510
- height: 18px;
511
- transform: translateY(-50%);
512
- color: var(--ms-on-surface-muted);
513
- }
514
-
515
- .stackline-dropdown.theme-material .dropdown-list ul {
516
- list-style: none;
517
- margin: 0;
518
- padding: 8px;
519
- overflow: auto;
520
- }
521
-
522
- .stackline-dropdown.theme-material .dropdown-list ul li {
523
- align-items: center;
524
- min-height: 0;
525
- margin: 4px;
526
- padding: 12px 14px;
527
- border-radius: 14px;
528
- cursor: pointer;
529
- text-align: left;
530
- line-height: 1.35;
531
- transition: background-color 0.16s ease, color 0.16s ease;
532
- }
533
-
534
- .stackline-dropdown.theme-material .dropdown-list ul li:first-child {
535
- padding-top: 12px;
536
- }
537
-
538
- .stackline-dropdown.theme-material .dropdown-list ul li:last-child {
539
- padding-bottom: 12px;
540
- }
541
-
542
- .stackline-dropdown.theme-material .dropdown-list ul li:hover {
543
- background: var(--ms-surface-soft);
544
- }
545
-
546
- .stackline-dropdown.theme-material .pure-checkbox {
547
- position: relative;
548
- }
549
-
550
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox] + label {
551
- position: relative;
552
- display: block;
553
- width: 100%;
554
- margin: 0;
555
- padding-left: 32px;
556
- color: inherit;
557
- cursor: pointer;
558
- font-weight: 500;
559
- user-select: none;
560
- }
561
-
562
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox] + label:before {
563
- box-sizing: content-box;
564
- content: "";
565
- position: absolute;
566
- top: 50%;
567
- left: 0;
568
- width: 16px;
569
- height: 16px;
570
- margin-top: -10px;
571
- border: 2px solid var(--ms-outline-strong);
572
- border-radius: 5px;
573
- background: var(--ms-surface);
574
- transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
575
- }
576
-
577
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox] + label:after {
578
- box-sizing: content-box;
579
- content: "";
580
- position: absolute;
581
- top: 50%;
582
- left: 5px;
583
- width: 8px;
584
- height: 3px;
585
- margin-top: -4px;
586
- border-style: solid;
587
- border-color: #ffffff;
588
- border-width: 0 0 3px 3px;
589
- border-image: none;
590
- background: transparent;
591
- transform: rotate(-45deg) scale(0);
592
- transform-origin: 50%;
593
- transition: transform 0.16s ease;
594
- }
595
-
596
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox]:focus + label:before,
597
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox]:hover + label:before {
598
- border-color: var(--ms-primary);
599
- background: var(--ms-surface-soft);
600
- }
601
-
602
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox]:checked + label:before {
603
- border-color: var(--ms-primary);
604
- background: var(--ms-primary);
605
- }
606
-
607
- .stackline-dropdown.theme-material .pure-checkbox input[type=checkbox]:checked + label:after {
608
- transform: rotate(-45deg) scale(1);
609
- }
610
-
611
- .stackline-dropdown.theme-material .list-message {
612
- margin: 0;
613
- padding: 20px 14px;
614
- color: var(--ms-on-surface-muted);
615
- text-align: center;
616
- }
617
-
618
- /*# sourceMappingURL=multiselect.component.css.map */