@fortawesome/vue-fontawesome 3.0.0-1 → 3.0.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.
- package/.github/workflows/ci.yml +1 -1
- package/.tool-versions +1 -1
- package/CHANGELOG.md +32 -0
- package/DEVELOPMENT.md +21 -2
- package/README.md +23 -32
- package/index.es.js +65 -3427
- package/index.js +552 -3915
- package/package.json +7 -5
- package/rollup.config.js +2 -1
- package/src/components/FontAwesomeIcon.js +20 -19
- package/src/components/FontAwesomeLayers.js +4 -4
- package/src/components/FontAwesomeLayersText.js +14 -11
- package/src/components/__tests__/FontAwesomeIcon.test.js +14 -0
- package/src/components/__tests__/FontAwesomeLayers.test.js +17 -0
- package/src/components/__tests__/FontAwesomeLayersText.test.js +17 -0
- package/src/converter.js +15 -18
- package/fortawesome-vue-fontawesome-3.0.0-1.tgz +0 -0
package/index.js
CHANGED
|
@@ -1,3918 +1,555 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, (function (exports,fontawesomeSvgCore) { 'use strict';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
const shallowReactiveHandlers = extend({}, mutableHandlers, {
|
|
557
|
-
get: shallowGet,
|
|
558
|
-
set: shallowSet
|
|
559
|
-
});
|
|
560
|
-
// Props handlers are special in the sense that it should not unwrap top-level
|
|
561
|
-
// refs (in order to allow refs to be explicitly passed down), but should
|
|
562
|
-
// retain the reactivity of the normal readonly object.
|
|
563
|
-
const shallowReadonlyHandlers = extend({}, readonlyHandlers, {
|
|
564
|
-
get: shallowReadonlyGet
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
568
|
-
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
569
|
-
const toShallow = (value) => value;
|
|
570
|
-
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
571
|
-
function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
572
|
-
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
573
|
-
// of the value
|
|
574
|
-
target = target["__v_raw" /* RAW */];
|
|
575
|
-
const rawTarget = toRaw(target);
|
|
576
|
-
const rawKey = toRaw(key);
|
|
577
|
-
if (key !== rawKey) {
|
|
578
|
-
!isReadonly && track(rawTarget, "get" /* GET */, key);
|
|
579
|
-
}
|
|
580
|
-
!isReadonly && track(rawTarget, "get" /* GET */, rawKey);
|
|
581
|
-
const { has } = getProto(rawTarget);
|
|
582
|
-
const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;
|
|
583
|
-
if (has.call(rawTarget, key)) {
|
|
584
|
-
return wrap(target.get(key));
|
|
585
|
-
}
|
|
586
|
-
else if (has.call(rawTarget, rawKey)) {
|
|
587
|
-
return wrap(target.get(rawKey));
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
function has$1(key, isReadonly = false) {
|
|
591
|
-
const target = this["__v_raw" /* RAW */];
|
|
592
|
-
const rawTarget = toRaw(target);
|
|
593
|
-
const rawKey = toRaw(key);
|
|
594
|
-
if (key !== rawKey) {
|
|
595
|
-
!isReadonly && track(rawTarget, "has" /* HAS */, key);
|
|
596
|
-
}
|
|
597
|
-
!isReadonly && track(rawTarget, "has" /* HAS */, rawKey);
|
|
598
|
-
return target.has(key) || target.has(rawKey);
|
|
599
|
-
}
|
|
600
|
-
function size(target, isReadonly = false) {
|
|
601
|
-
target = target["__v_raw" /* RAW */];
|
|
602
|
-
!isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
|
|
603
|
-
return Reflect.get(target, 'size', target);
|
|
604
|
-
}
|
|
605
|
-
function add(value) {
|
|
606
|
-
value = toRaw(value);
|
|
607
|
-
const target = toRaw(this);
|
|
608
|
-
const proto = getProto(target);
|
|
609
|
-
const hadKey = proto.has.call(target, value);
|
|
610
|
-
const result = proto.add.call(target, value);
|
|
611
|
-
if (!hadKey) {
|
|
612
|
-
trigger(target, "add" /* ADD */, value, value);
|
|
613
|
-
}
|
|
614
|
-
return result;
|
|
615
|
-
}
|
|
616
|
-
function set$1(key, value) {
|
|
617
|
-
value = toRaw(value);
|
|
618
|
-
const target = toRaw(this);
|
|
619
|
-
const { has, get, set } = getProto(target);
|
|
620
|
-
let hadKey = has.call(target, key);
|
|
621
|
-
if (!hadKey) {
|
|
622
|
-
key = toRaw(key);
|
|
623
|
-
hadKey = has.call(target, key);
|
|
624
|
-
}
|
|
625
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
626
|
-
checkIdentityKeys(target, has, key);
|
|
627
|
-
}
|
|
628
|
-
const oldValue = get.call(target, key);
|
|
629
|
-
const result = set.call(target, key, value);
|
|
630
|
-
if (!hadKey) {
|
|
631
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
632
|
-
}
|
|
633
|
-
else if (hasChanged(value, oldValue)) {
|
|
634
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
635
|
-
}
|
|
636
|
-
return result;
|
|
637
|
-
}
|
|
638
|
-
function deleteEntry(key) {
|
|
639
|
-
const target = toRaw(this);
|
|
640
|
-
const { has, get, delete: del } = getProto(target);
|
|
641
|
-
let hadKey = has.call(target, key);
|
|
642
|
-
if (!hadKey) {
|
|
643
|
-
key = toRaw(key);
|
|
644
|
-
hadKey = has.call(target, key);
|
|
645
|
-
}
|
|
646
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
647
|
-
checkIdentityKeys(target, has, key);
|
|
648
|
-
}
|
|
649
|
-
const oldValue = get ? get.call(target, key) : undefined;
|
|
650
|
-
// forward the operation before queueing reactions
|
|
651
|
-
const result = del.call(target, key);
|
|
652
|
-
if (hadKey) {
|
|
653
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
654
|
-
}
|
|
655
|
-
return result;
|
|
656
|
-
}
|
|
657
|
-
function clear() {
|
|
658
|
-
const target = toRaw(this);
|
|
659
|
-
const hadItems = target.size !== 0;
|
|
660
|
-
const oldTarget = (process.env.NODE_ENV !== 'production')
|
|
661
|
-
? target instanceof Map
|
|
662
|
-
? new Map(target)
|
|
663
|
-
: new Set(target)
|
|
664
|
-
: undefined;
|
|
665
|
-
// forward the operation before queueing reactions
|
|
666
|
-
const result = getProto(target).clear.call(target);
|
|
667
|
-
if (hadItems) {
|
|
668
|
-
trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
|
|
669
|
-
}
|
|
670
|
-
return result;
|
|
671
|
-
}
|
|
672
|
-
function createForEach(isReadonly, isShallow) {
|
|
673
|
-
return function forEach(callback, thisArg) {
|
|
674
|
-
const observed = this;
|
|
675
|
-
const target = toRaw(observed);
|
|
676
|
-
const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;
|
|
677
|
-
!isReadonly && track(target, "iterate" /* ITERATE */, ITERATE_KEY);
|
|
678
|
-
// important: create sure the callback is
|
|
679
|
-
// 1. invoked with the reactive map as `this` and 3rd arg
|
|
680
|
-
// 2. the value received should be a corresponding reactive/readonly.
|
|
681
|
-
function wrappedCallback(value, key) {
|
|
682
|
-
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
683
|
-
}
|
|
684
|
-
return getProto(target).forEach.call(target, wrappedCallback);
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
function createIterableMethod(method, isReadonly, isShallow) {
|
|
688
|
-
return function (...args) {
|
|
689
|
-
const target = this["__v_raw" /* RAW */];
|
|
690
|
-
const rawTarget = toRaw(target);
|
|
691
|
-
const isMap = rawTarget instanceof Map;
|
|
692
|
-
const isPair = method === 'entries' || (method === Symbol.iterator && isMap);
|
|
693
|
-
const isKeyOnly = method === 'keys' && isMap;
|
|
694
|
-
const innerIterator = target[method](...args);
|
|
695
|
-
const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;
|
|
696
|
-
!isReadonly &&
|
|
697
|
-
track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
698
|
-
// return a wrapped iterator which returns observed versions of the
|
|
699
|
-
// values emitted from the real iterator
|
|
700
|
-
return {
|
|
701
|
-
// iterator protocol
|
|
702
|
-
next() {
|
|
703
|
-
const { value, done } = innerIterator.next();
|
|
704
|
-
return done
|
|
705
|
-
? { value, done }
|
|
706
|
-
: {
|
|
707
|
-
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
708
|
-
done
|
|
709
|
-
};
|
|
710
|
-
},
|
|
711
|
-
// iterable protocol
|
|
712
|
-
[Symbol.iterator]() {
|
|
713
|
-
return this;
|
|
714
|
-
}
|
|
715
|
-
};
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
function createReadonlyMethod(type) {
|
|
719
|
-
return function (...args) {
|
|
720
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
721
|
-
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
722
|
-
console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
723
|
-
}
|
|
724
|
-
return type === "delete" /* DELETE */ ? false : this;
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
const mutableInstrumentations = {
|
|
728
|
-
get(key) {
|
|
729
|
-
return get$1(this, key);
|
|
730
|
-
},
|
|
731
|
-
get size() {
|
|
732
|
-
return size(this);
|
|
733
|
-
},
|
|
734
|
-
has: has$1,
|
|
735
|
-
add,
|
|
736
|
-
set: set$1,
|
|
737
|
-
delete: deleteEntry,
|
|
738
|
-
clear,
|
|
739
|
-
forEach: createForEach(false, false)
|
|
740
|
-
};
|
|
741
|
-
const shallowInstrumentations = {
|
|
742
|
-
get(key) {
|
|
743
|
-
return get$1(this, key, false, true);
|
|
744
|
-
},
|
|
745
|
-
get size() {
|
|
746
|
-
return size(this);
|
|
747
|
-
},
|
|
748
|
-
has: has$1,
|
|
749
|
-
add,
|
|
750
|
-
set: set$1,
|
|
751
|
-
delete: deleteEntry,
|
|
752
|
-
clear,
|
|
753
|
-
forEach: createForEach(false, true)
|
|
754
|
-
};
|
|
755
|
-
const readonlyInstrumentations = {
|
|
756
|
-
get(key) {
|
|
757
|
-
return get$1(this, key, true);
|
|
758
|
-
},
|
|
759
|
-
get size() {
|
|
760
|
-
return size(this, true);
|
|
761
|
-
},
|
|
762
|
-
has(key) {
|
|
763
|
-
return has$1.call(this, key, true);
|
|
764
|
-
},
|
|
765
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
766
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
767
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
768
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
769
|
-
forEach: createForEach(true, false)
|
|
770
|
-
};
|
|
771
|
-
const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
|
|
772
|
-
iteratorMethods.forEach(method => {
|
|
773
|
-
mutableInstrumentations[method] = createIterableMethod(method, false, false);
|
|
774
|
-
readonlyInstrumentations[method] = createIterableMethod(method, true, false);
|
|
775
|
-
shallowInstrumentations[method] = createIterableMethod(method, false, true);
|
|
776
|
-
});
|
|
777
|
-
function createInstrumentationGetter(isReadonly, shallow) {
|
|
778
|
-
const instrumentations = shallow
|
|
779
|
-
? shallowInstrumentations
|
|
780
|
-
: isReadonly
|
|
781
|
-
? readonlyInstrumentations
|
|
782
|
-
: mutableInstrumentations;
|
|
783
|
-
return (target, key, receiver) => {
|
|
784
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
785
|
-
return !isReadonly;
|
|
786
|
-
}
|
|
787
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
788
|
-
return isReadonly;
|
|
789
|
-
}
|
|
790
|
-
else if (key === "__v_raw" /* RAW */) {
|
|
791
|
-
return target;
|
|
792
|
-
}
|
|
793
|
-
return Reflect.get(hasOwn(instrumentations, key) && key in target
|
|
794
|
-
? instrumentations
|
|
795
|
-
: target, key, receiver);
|
|
796
|
-
};
|
|
797
|
-
}
|
|
798
|
-
const mutableCollectionHandlers = {
|
|
799
|
-
get: createInstrumentationGetter(false, false)
|
|
800
|
-
};
|
|
801
|
-
const readonlyCollectionHandlers = {
|
|
802
|
-
get: createInstrumentationGetter(true, false)
|
|
803
|
-
};
|
|
804
|
-
function checkIdentityKeys(target, has, key) {
|
|
805
|
-
const rawKey = toRaw(key);
|
|
806
|
-
if (rawKey !== key && has.call(target, rawKey)) {
|
|
807
|
-
const type = toRawType(target);
|
|
808
|
-
console.warn(`Reactive ${type} contains both the raw and reactive ` +
|
|
809
|
-
`versions of the same object${type === `Map` ? `as keys` : ``}, ` +
|
|
810
|
-
`which can lead to inconsistencies. ` +
|
|
811
|
-
`Avoid differentiating between the raw and reactive versions ` +
|
|
812
|
-
`of an object and only use the reactive version if possible.`);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
function targetTypeMap(rawType) {
|
|
817
|
-
switch (rawType) {
|
|
818
|
-
case 'Object':
|
|
819
|
-
case 'Array':
|
|
820
|
-
return 1 /* COMMON */;
|
|
821
|
-
case 'Map':
|
|
822
|
-
case 'Set':
|
|
823
|
-
case 'WeakMap':
|
|
824
|
-
case 'WeakSet':
|
|
825
|
-
return 2 /* COLLECTION */;
|
|
826
|
-
default:
|
|
827
|
-
return 0 /* INVALID */;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
function getTargetType(value) {
|
|
831
|
-
return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
|
|
832
|
-
? 0 /* INVALID */
|
|
833
|
-
: targetTypeMap(toRawType(value));
|
|
834
|
-
}
|
|
835
|
-
function reactive(target) {
|
|
836
|
-
// if trying to observe a readonly proxy, return the readonly version.
|
|
837
|
-
if (target && target["__v_isReadonly" /* IS_READONLY */]) {
|
|
838
|
-
return target;
|
|
839
|
-
}
|
|
840
|
-
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers);
|
|
841
|
-
}
|
|
842
|
-
function readonly(target) {
|
|
843
|
-
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers);
|
|
844
|
-
}
|
|
845
|
-
// Return a reactive-copy of the original object, where only the root level
|
|
846
|
-
// properties are readonly, and does NOT unwrap refs nor recursively convert
|
|
847
|
-
// returned properties.
|
|
848
|
-
// This is used for creating the props proxy object for stateful components.
|
|
849
|
-
function shallowReadonly(target) {
|
|
850
|
-
return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);
|
|
851
|
-
}
|
|
852
|
-
function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers) {
|
|
853
|
-
if (!isObject(target)) {
|
|
854
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
855
|
-
console.warn(`value cannot be made reactive: ${String(target)}`);
|
|
856
|
-
}
|
|
857
|
-
return target;
|
|
858
|
-
}
|
|
859
|
-
// target is already a Proxy, return it.
|
|
860
|
-
// exception: calling readonly() on a reactive object
|
|
861
|
-
if (target["__v_raw" /* RAW */] &&
|
|
862
|
-
!(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
|
|
863
|
-
return target;
|
|
864
|
-
}
|
|
865
|
-
// target already has corresponding Proxy
|
|
866
|
-
const reactiveFlag = isReadonly
|
|
867
|
-
? "__v_readonly" /* READONLY */
|
|
868
|
-
: "__v_reactive" /* REACTIVE */;
|
|
869
|
-
if (hasOwn(target, reactiveFlag)) {
|
|
870
|
-
return target[reactiveFlag];
|
|
871
|
-
}
|
|
872
|
-
// only a whitelist of value types can be observed.
|
|
873
|
-
const targetType = getTargetType(target);
|
|
874
|
-
if (targetType === 0 /* INVALID */) {
|
|
875
|
-
return target;
|
|
876
|
-
}
|
|
877
|
-
const observed = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
878
|
-
def(target, reactiveFlag, observed);
|
|
879
|
-
return observed;
|
|
880
|
-
}
|
|
881
|
-
function isReactive(value) {
|
|
882
|
-
if (isReadonly(value)) {
|
|
883
|
-
return isReactive(value["__v_raw" /* RAW */]);
|
|
884
|
-
}
|
|
885
|
-
return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
|
|
886
|
-
}
|
|
887
|
-
function isReadonly(value) {
|
|
888
|
-
return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
|
|
889
|
-
}
|
|
890
|
-
function isProxy(value) {
|
|
891
|
-
return isReactive(value) || isReadonly(value);
|
|
892
|
-
}
|
|
893
|
-
function toRaw(observed) {
|
|
894
|
-
return ((observed && toRaw(observed["__v_raw" /* RAW */])) || observed);
|
|
895
|
-
}
|
|
896
|
-
function isRef(r) {
|
|
897
|
-
return r ? r.__v_isRef === true : false;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
const stack = [];
|
|
901
|
-
function pushWarningContext(vnode) {
|
|
902
|
-
stack.push(vnode);
|
|
903
|
-
}
|
|
904
|
-
function popWarningContext() {
|
|
905
|
-
stack.pop();
|
|
906
|
-
}
|
|
907
|
-
function warn(msg, ...args) {
|
|
908
|
-
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
909
|
-
// during patch, leading to infinite recursion.
|
|
910
|
-
pauseTracking();
|
|
911
|
-
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
912
|
-
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
913
|
-
const trace = getComponentTrace();
|
|
914
|
-
if (appWarnHandler) {
|
|
915
|
-
callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
|
|
916
|
-
msg + args.join(''),
|
|
917
|
-
instance && instance.proxy,
|
|
918
|
-
trace
|
|
919
|
-
.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)
|
|
920
|
-
.join('\n'),
|
|
921
|
-
trace
|
|
922
|
-
]);
|
|
923
|
-
}
|
|
924
|
-
else {
|
|
925
|
-
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
926
|
-
/* istanbul ignore if */
|
|
927
|
-
if (trace.length &&
|
|
928
|
-
// avoid spamming console during tests
|
|
929
|
-
!false) {
|
|
930
|
-
warnArgs.push(`\n`, ...formatTrace(trace));
|
|
931
|
-
}
|
|
932
|
-
console.warn(...warnArgs);
|
|
933
|
-
}
|
|
934
|
-
resetTracking();
|
|
935
|
-
}
|
|
936
|
-
function getComponentTrace() {
|
|
937
|
-
let currentVNode = stack[stack.length - 1];
|
|
938
|
-
if (!currentVNode) {
|
|
939
|
-
return [];
|
|
940
|
-
}
|
|
941
|
-
// we can't just use the stack because it will be incomplete during updates
|
|
942
|
-
// that did not start from the root. Re-construct the parent chain using
|
|
943
|
-
// instance parent pointers.
|
|
944
|
-
const normalizedStack = [];
|
|
945
|
-
while (currentVNode) {
|
|
946
|
-
const last = normalizedStack[0];
|
|
947
|
-
if (last && last.vnode === currentVNode) {
|
|
948
|
-
last.recurseCount++;
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
normalizedStack.push({
|
|
952
|
-
vnode: currentVNode,
|
|
953
|
-
recurseCount: 0
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
957
|
-
currentVNode = parentInstance && parentInstance.vnode;
|
|
958
|
-
}
|
|
959
|
-
return normalizedStack;
|
|
960
|
-
}
|
|
961
|
-
/* istanbul ignore next */
|
|
962
|
-
function formatTrace(trace) {
|
|
963
|
-
const logs = [];
|
|
964
|
-
trace.forEach((entry, i) => {
|
|
965
|
-
logs.push(...(i === 0 ? [] : [`\n`]), ...formatTraceEntry(entry));
|
|
966
|
-
});
|
|
967
|
-
return logs;
|
|
968
|
-
}
|
|
969
|
-
function formatTraceEntry({ vnode, recurseCount }) {
|
|
970
|
-
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
971
|
-
const isRoot = vnode.component ? vnode.component.parent == null : false;
|
|
972
|
-
const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
|
|
973
|
-
const close = `>` + postfix;
|
|
974
|
-
return vnode.props
|
|
975
|
-
? [open, ...formatProps(vnode.props), close]
|
|
976
|
-
: [open + close];
|
|
977
|
-
}
|
|
978
|
-
/* istanbul ignore next */
|
|
979
|
-
function formatProps(props) {
|
|
980
|
-
const res = [];
|
|
981
|
-
const keys = Object.keys(props);
|
|
982
|
-
keys.slice(0, 3).forEach(key => {
|
|
983
|
-
res.push(...formatProp(key, props[key]));
|
|
984
|
-
});
|
|
985
|
-
if (keys.length > 3) {
|
|
986
|
-
res.push(` ...`);
|
|
987
|
-
}
|
|
988
|
-
return res;
|
|
989
|
-
}
|
|
990
|
-
/* istanbul ignore next */
|
|
991
|
-
function formatProp(key, value, raw) {
|
|
992
|
-
if (isString(value)) {
|
|
993
|
-
value = JSON.stringify(value);
|
|
994
|
-
return raw ? value : [`${key}=${value}`];
|
|
995
|
-
}
|
|
996
|
-
else if (typeof value === 'number' ||
|
|
997
|
-
typeof value === 'boolean' ||
|
|
998
|
-
value == null) {
|
|
999
|
-
return raw ? value : [`${key}=${value}`];
|
|
1000
|
-
}
|
|
1001
|
-
else if (isRef(value)) {
|
|
1002
|
-
value = formatProp(key, toRaw(value.value), true);
|
|
1003
|
-
return raw ? value : [`${key}=Ref<`, value, `>`];
|
|
1004
|
-
}
|
|
1005
|
-
else if (isFunction(value)) {
|
|
1006
|
-
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
1007
|
-
}
|
|
1008
|
-
else {
|
|
1009
|
-
value = toRaw(value);
|
|
1010
|
-
return raw ? value : [`${key}=`, value];
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
const ErrorTypeStrings = {
|
|
1015
|
-
["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1016
|
-
["c" /* CREATED */]: 'created hook',
|
|
1017
|
-
["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1018
|
-
["m" /* MOUNTED */]: 'mounted hook',
|
|
1019
|
-
["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1020
|
-
["u" /* UPDATED */]: 'updated',
|
|
1021
|
-
["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1022
|
-
["um" /* UNMOUNTED */]: 'unmounted hook',
|
|
1023
|
-
["a" /* ACTIVATED */]: 'activated hook',
|
|
1024
|
-
["da" /* DEACTIVATED */]: 'deactivated hook',
|
|
1025
|
-
["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1026
|
-
["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
|
|
1027
|
-
["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1028
|
-
[0 /* SETUP_FUNCTION */]: 'setup function',
|
|
1029
|
-
[1 /* RENDER_FUNCTION */]: 'render function',
|
|
1030
|
-
[2 /* WATCH_GETTER */]: 'watcher getter',
|
|
1031
|
-
[3 /* WATCH_CALLBACK */]: 'watcher callback',
|
|
1032
|
-
[4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1033
|
-
[5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1034
|
-
[6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1035
|
-
[7 /* VNODE_HOOK */]: 'vnode hook',
|
|
1036
|
-
[8 /* DIRECTIVE_HOOK */]: 'directive hook',
|
|
1037
|
-
[9 /* TRANSITION_HOOK */]: 'transition hook',
|
|
1038
|
-
[10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1039
|
-
[11 /* APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1040
|
-
[12 /* FUNCTION_REF */]: 'ref function',
|
|
1041
|
-
[13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1042
|
-
[14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1043
|
-
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'
|
|
1044
|
-
};
|
|
1045
|
-
function callWithErrorHandling(fn, instance, type, args) {
|
|
1046
|
-
let res;
|
|
1047
|
-
try {
|
|
1048
|
-
res = args ? fn(...args) : fn();
|
|
1049
|
-
}
|
|
1050
|
-
catch (err) {
|
|
1051
|
-
handleError(err, instance, type);
|
|
1052
|
-
}
|
|
1053
|
-
return res;
|
|
1054
|
-
}
|
|
1055
|
-
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
1056
|
-
if (isFunction(fn)) {
|
|
1057
|
-
const res = callWithErrorHandling(fn, instance, type, args);
|
|
1058
|
-
if (res && isPromise(res)) {
|
|
1059
|
-
res.catch(err => {
|
|
1060
|
-
handleError(err, instance, type);
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
return res;
|
|
1064
|
-
}
|
|
1065
|
-
const values = [];
|
|
1066
|
-
for (let i = 0; i < fn.length; i++) {
|
|
1067
|
-
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
1068
|
-
}
|
|
1069
|
-
return values;
|
|
1070
|
-
}
|
|
1071
|
-
function handleError(err, instance, type) {
|
|
1072
|
-
const contextVNode = instance ? instance.vnode : null;
|
|
1073
|
-
if (instance) {
|
|
1074
|
-
let cur = instance.parent;
|
|
1075
|
-
// the exposed instance is the render proxy to keep it consistent with 2.x
|
|
1076
|
-
const exposedInstance = instance.proxy;
|
|
1077
|
-
// in production the hook receives only the error code
|
|
1078
|
-
const errorInfo = (process.env.NODE_ENV !== 'production') ? ErrorTypeStrings[type] : type;
|
|
1079
|
-
while (cur) {
|
|
1080
|
-
const errorCapturedHooks = cur.ec;
|
|
1081
|
-
if (errorCapturedHooks) {
|
|
1082
|
-
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
1083
|
-
if (errorCapturedHooks[i](err, exposedInstance, errorInfo)) {
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
cur = cur.parent;
|
|
1089
|
-
}
|
|
1090
|
-
// app-level handling
|
|
1091
|
-
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
1092
|
-
if (appErrorHandler) {
|
|
1093
|
-
callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1094
|
-
return;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
logError(err, type, contextVNode);
|
|
1098
|
-
}
|
|
1099
|
-
function logError(err, type, contextVNode) {
|
|
1100
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1101
|
-
const info = ErrorTypeStrings[type];
|
|
1102
|
-
if (contextVNode) {
|
|
1103
|
-
pushWarningContext(contextVNode);
|
|
1104
|
-
}
|
|
1105
|
-
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1106
|
-
if (contextVNode) {
|
|
1107
|
-
popWarningContext();
|
|
1108
|
-
}
|
|
1109
|
-
// crash in dev so it's more noticeable
|
|
1110
|
-
throw err;
|
|
1111
|
-
}
|
|
1112
|
-
else {
|
|
1113
|
-
// recover in prod to reduce the impact on end-user
|
|
1114
|
-
console.error(err);
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
let isFlushing = false;
|
|
1119
|
-
let isFlushPending = false;
|
|
1120
|
-
const queue = [];
|
|
1121
|
-
let flushIndex = 0;
|
|
1122
|
-
const pendingPreFlushCbs = [];
|
|
1123
|
-
let activePreFlushCbs = null;
|
|
1124
|
-
let preFlushIndex = 0;
|
|
1125
|
-
const pendingPostFlushCbs = [];
|
|
1126
|
-
let activePostFlushCbs = null;
|
|
1127
|
-
let postFlushIndex = 0;
|
|
1128
|
-
const resolvedPromise = Promise.resolve();
|
|
1129
|
-
let currentFlushPromise = null;
|
|
1130
|
-
let currentPreFlushParentJob = null;
|
|
1131
|
-
const RECURSION_LIMIT = 100;
|
|
1132
|
-
function nextTick(fn) {
|
|
1133
|
-
const p = currentFlushPromise || resolvedPromise;
|
|
1134
|
-
return fn ? p.then(fn) : p;
|
|
1135
|
-
}
|
|
1136
|
-
function queueJob(job) {
|
|
1137
|
-
// the dedupe search uses the startIndex argument of Array.includes()
|
|
1138
|
-
// by default the search index includes the current job that is being run
|
|
1139
|
-
// so it cannot recursively trigger itself again.
|
|
1140
|
-
// if the job is a watch() callback, the search will start with a +1 index to
|
|
1141
|
-
// allow it recursively trigger itself - it is the user's responsibility to
|
|
1142
|
-
// ensure it doesn't end up in an infinite loop.
|
|
1143
|
-
if ((!queue.length ||
|
|
1144
|
-
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&
|
|
1145
|
-
job !== currentPreFlushParentJob) {
|
|
1146
|
-
queue.push(job);
|
|
1147
|
-
queueFlush();
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
function queueFlush() {
|
|
1151
|
-
if (!isFlushing && !isFlushPending) {
|
|
1152
|
-
isFlushPending = true;
|
|
1153
|
-
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
function queueCb(cb, activeQueue, pendingQueue, index) {
|
|
1157
|
-
if (!isArray(cb)) {
|
|
1158
|
-
if (!activeQueue ||
|
|
1159
|
-
!activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
|
|
1160
|
-
pendingQueue.push(cb);
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
else {
|
|
1164
|
-
// if cb is an array, it is a component lifecycle hook which can only be
|
|
1165
|
-
// triggered by a job, which is already deduped in the main queue, so
|
|
1166
|
-
// we can skip duplicate check here to improve perf
|
|
1167
|
-
pendingQueue.push(...cb);
|
|
1168
|
-
}
|
|
1169
|
-
queueFlush();
|
|
1170
|
-
}
|
|
1171
|
-
function queuePreFlushCb(cb) {
|
|
1172
|
-
queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
|
|
1173
|
-
}
|
|
1174
|
-
function queuePostFlushCb(cb) {
|
|
1175
|
-
queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
|
|
1176
|
-
}
|
|
1177
|
-
function flushPreFlushCbs(seen, parentJob = null) {
|
|
1178
|
-
if (pendingPreFlushCbs.length) {
|
|
1179
|
-
currentPreFlushParentJob = parentJob;
|
|
1180
|
-
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
1181
|
-
pendingPreFlushCbs.length = 0;
|
|
1182
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1183
|
-
seen = seen || new Map();
|
|
1184
|
-
}
|
|
1185
|
-
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
1186
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1187
|
-
checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex]);
|
|
1188
|
-
}
|
|
1189
|
-
activePreFlushCbs[preFlushIndex]();
|
|
1190
|
-
}
|
|
1191
|
-
activePreFlushCbs = null;
|
|
1192
|
-
preFlushIndex = 0;
|
|
1193
|
-
currentPreFlushParentJob = null;
|
|
1194
|
-
// recursively flush until it drains
|
|
1195
|
-
flushPreFlushCbs(seen, parentJob);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
function flushPostFlushCbs(seen) {
|
|
1199
|
-
if (pendingPostFlushCbs.length) {
|
|
1200
|
-
activePostFlushCbs = [...new Set(pendingPostFlushCbs)];
|
|
1201
|
-
pendingPostFlushCbs.length = 0;
|
|
1202
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1203
|
-
seen = seen || new Map();
|
|
1204
|
-
}
|
|
1205
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
1206
|
-
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
1207
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1208
|
-
checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex]);
|
|
1209
|
-
}
|
|
1210
|
-
activePostFlushCbs[postFlushIndex]();
|
|
1211
|
-
}
|
|
1212
|
-
activePostFlushCbs = null;
|
|
1213
|
-
postFlushIndex = 0;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
1217
|
-
function flushJobs(seen) {
|
|
1218
|
-
isFlushPending = false;
|
|
1219
|
-
isFlushing = true;
|
|
1220
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1221
|
-
seen = seen || new Map();
|
|
1222
|
-
}
|
|
1223
|
-
flushPreFlushCbs(seen);
|
|
1224
|
-
// Sort queue before flush.
|
|
1225
|
-
// This ensures that:
|
|
1226
|
-
// 1. Components are updated from parent to child. (because parent is always
|
|
1227
|
-
// created before the child so its render effect will have smaller
|
|
1228
|
-
// priority number)
|
|
1229
|
-
// 2. If a component is unmounted during a parent component's update,
|
|
1230
|
-
// its update can be skipped.
|
|
1231
|
-
// Jobs can never be null before flush starts, since they are only invalidated
|
|
1232
|
-
// during execution of another flushed job.
|
|
1233
|
-
queue.sort((a, b) => getId(a) - getId(b));
|
|
1234
|
-
try {
|
|
1235
|
-
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
1236
|
-
const job = queue[flushIndex];
|
|
1237
|
-
if (job) {
|
|
1238
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1239
|
-
checkRecursiveUpdates(seen, job);
|
|
1240
|
-
}
|
|
1241
|
-
callWithErrorHandling(job, null, 14 /* SCHEDULER */);
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
finally {
|
|
1246
|
-
flushIndex = 0;
|
|
1247
|
-
queue.length = 0;
|
|
1248
|
-
flushPostFlushCbs(seen);
|
|
1249
|
-
isFlushing = false;
|
|
1250
|
-
currentFlushPromise = null;
|
|
1251
|
-
// some postFlushCb queued jobs!
|
|
1252
|
-
// keep flushing until it drains.
|
|
1253
|
-
if (queue.length || pendingPostFlushCbs.length) {
|
|
1254
|
-
flushJobs(seen);
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
function checkRecursiveUpdates(seen, fn) {
|
|
1259
|
-
if (!seen.has(fn)) {
|
|
1260
|
-
seen.set(fn, 1);
|
|
1261
|
-
}
|
|
1262
|
-
else {
|
|
1263
|
-
const count = seen.get(fn);
|
|
1264
|
-
if (count > RECURSION_LIMIT) {
|
|
1265
|
-
throw new Error(`Maximum recursive updates exceeded. ` +
|
|
1266
|
-
`This means you have a reactive effect that is mutating its own ` +
|
|
1267
|
-
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
1268
|
-
`include component template, render function, updated hook or ` +
|
|
1269
|
-
`watcher source function.`);
|
|
1270
|
-
}
|
|
1271
|
-
else {
|
|
1272
|
-
seen.set(fn, count + 1);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
const hmrDirtyComponents = new Set();
|
|
1277
|
-
// Expose the HMR runtime on the global object
|
|
1278
|
-
// This makes it entirely tree-shakable without polluting the exports and makes
|
|
1279
|
-
// it easier to be used in toolings like vue-loader
|
|
1280
|
-
// Note: for a component to be eligible for HMR it also needs the __hmrId option
|
|
1281
|
-
// to be set so that its instances can be registered / removed.
|
|
1282
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1283
|
-
const globalObject = typeof global !== 'undefined'
|
|
1284
|
-
? global
|
|
1285
|
-
: typeof self !== 'undefined'
|
|
1286
|
-
? self
|
|
1287
|
-
: typeof window !== 'undefined'
|
|
1288
|
-
? window
|
|
1289
|
-
: {};
|
|
1290
|
-
globalObject.__VUE_HMR_RUNTIME__ = {
|
|
1291
|
-
createRecord: tryWrap(createRecord),
|
|
1292
|
-
rerender: tryWrap(rerender),
|
|
1293
|
-
reload: tryWrap(reload)
|
|
1294
|
-
};
|
|
1295
|
-
}
|
|
1296
|
-
const map = new Map();
|
|
1297
|
-
function createRecord(id) {
|
|
1298
|
-
if (map.has(id)) {
|
|
1299
|
-
return false;
|
|
1300
|
-
}
|
|
1301
|
-
map.set(id, new Set());
|
|
1302
|
-
return true;
|
|
1303
|
-
}
|
|
1304
|
-
function rerender(id, newRender) {
|
|
1305
|
-
const record = map.get(id);
|
|
1306
|
-
if (!record)
|
|
1307
|
-
return;
|
|
1308
|
-
// Array.from creates a snapshot which avoids the set being mutated during
|
|
1309
|
-
// updates
|
|
1310
|
-
Array.from(record).forEach(instance => {
|
|
1311
|
-
if (newRender) {
|
|
1312
|
-
instance.render = newRender;
|
|
1313
|
-
}
|
|
1314
|
-
instance.renderCache = [];
|
|
1315
|
-
instance.update();
|
|
1316
|
-
});
|
|
1317
|
-
}
|
|
1318
|
-
function reload(id, newComp) {
|
|
1319
|
-
const record = map.get(id);
|
|
1320
|
-
if (!record)
|
|
1321
|
-
return;
|
|
1322
|
-
// Array.from creates a snapshot which avoids the set being mutated during
|
|
1323
|
-
// updates
|
|
1324
|
-
Array.from(record).forEach(instance => {
|
|
1325
|
-
const comp = instance.type;
|
|
1326
|
-
if (!hmrDirtyComponents.has(comp)) {
|
|
1327
|
-
// 1. Update existing comp definition to match new one
|
|
1328
|
-
extend(comp, newComp);
|
|
1329
|
-
for (const key in comp) {
|
|
1330
|
-
if (!(key in newComp)) {
|
|
1331
|
-
delete comp[key];
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
// 2. Mark component dirty. This forces the renderer to replace the component
|
|
1335
|
-
// on patch.
|
|
1336
|
-
hmrDirtyComponents.add(comp);
|
|
1337
|
-
// 3. Make sure to unmark the component after the reload.
|
|
1338
|
-
queuePostFlushCb(() => {
|
|
1339
|
-
hmrDirtyComponents.delete(comp);
|
|
1340
|
-
});
|
|
1341
|
-
}
|
|
1342
|
-
if (instance.parent) {
|
|
1343
|
-
// 4. Force the parent instance to re-render. This will cause all updated
|
|
1344
|
-
// components to be unmounted and re-mounted. Queue the update so that we
|
|
1345
|
-
// don't end up forcing the same parent to re-render multiple times.
|
|
1346
|
-
queueJob(instance.parent.update);
|
|
1347
|
-
}
|
|
1348
|
-
else if (instance.appContext.reload) {
|
|
1349
|
-
// root instance mounted via createApp() has a reload method
|
|
1350
|
-
instance.appContext.reload();
|
|
1351
|
-
}
|
|
1352
|
-
else if (typeof window !== 'undefined') {
|
|
1353
|
-
// root instance inside tree created via raw render(). Force reload.
|
|
1354
|
-
window.location.reload();
|
|
1355
|
-
}
|
|
1356
|
-
else {
|
|
1357
|
-
console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
|
|
1358
|
-
}
|
|
1359
|
-
});
|
|
1360
|
-
}
|
|
1361
|
-
function tryWrap(fn) {
|
|
1362
|
-
return (id, arg) => {
|
|
1363
|
-
try {
|
|
1364
|
-
return fn(id, arg);
|
|
1365
|
-
}
|
|
1366
|
-
catch (e) {
|
|
1367
|
-
console.error(e);
|
|
1368
|
-
console.warn(`[HMR] Something went wrong during Vue component hot-reload. ` +
|
|
1369
|
-
`Full reload required.`);
|
|
1370
|
-
}
|
|
1371
|
-
};
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
// mark the current rendering instance for asset resolution (e.g.
|
|
1375
|
-
// resolveComponent, resolveDirective) during render
|
|
1376
|
-
let currentRenderingInstance = null;
|
|
1377
|
-
function markAttrsAccessed() {
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
const isSuspense = (type) => type.__isSuspense;
|
|
1381
|
-
function queueEffectWithSuspense(fn, suspense) {
|
|
1382
|
-
if (suspense && !suspense.isResolved) {
|
|
1383
|
-
if (isArray(fn)) {
|
|
1384
|
-
suspense.effects.push(...fn);
|
|
1385
|
-
}
|
|
1386
|
-
else {
|
|
1387
|
-
suspense.effects.push(fn);
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
else {
|
|
1391
|
-
queuePostFlushCb(fn);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
// SFC scoped style ID management.
|
|
1396
|
-
let currentScopeId = null;
|
|
1397
|
-
|
|
1398
|
-
const isTeleport = (type) => type.__isTeleport;
|
|
1399
|
-
const NULL_DYNAMIC_COMPONENT = Symbol();
|
|
1400
|
-
|
|
1401
|
-
let isRenderingTemplateSlot = false;
|
|
1402
|
-
|
|
1403
|
-
const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined);
|
|
1404
|
-
const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined);
|
|
1405
|
-
const Comment = Symbol((process.env.NODE_ENV !== 'production') ? 'Comment' : undefined);
|
|
1406
|
-
const Static = Symbol((process.env.NODE_ENV !== 'production') ? 'Static' : undefined);
|
|
1407
|
-
let currentBlock = null;
|
|
1408
|
-
// Whether we should be tracking dynamic child nodes inside a block.
|
|
1409
|
-
// Only tracks when this value is > 0
|
|
1410
|
-
// We are not using a simple boolean because this value may need to be
|
|
1411
|
-
// incremented/decremented by nested usage of v-once (see below)
|
|
1412
|
-
let shouldTrack$1 = 1;
|
|
1413
|
-
function isVNode(value) {
|
|
1414
|
-
return value ? value.__v_isVNode === true : false;
|
|
1415
|
-
}
|
|
1416
|
-
function isSameVNodeType(n1, n2) {
|
|
1417
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
1418
|
-
n2.shapeFlag & 6 /* COMPONENT */ &&
|
|
1419
|
-
hmrDirtyComponents.has(n2.type)) {
|
|
1420
|
-
// HMR only: if the component has been hot-updated, force a reload.
|
|
1421
|
-
return false;
|
|
1422
|
-
}
|
|
1423
|
-
return n1.type === n2.type && n1.key === n2.key;
|
|
1424
|
-
}
|
|
1425
|
-
let vnodeArgsTransformer;
|
|
1426
|
-
const createVNodeWithArgsTransform = (...args) => {
|
|
1427
|
-
return _createVNode(...(vnodeArgsTransformer
|
|
1428
|
-
? vnodeArgsTransformer(args, currentRenderingInstance)
|
|
1429
|
-
: args));
|
|
1430
|
-
};
|
|
1431
|
-
const InternalObjectKey = `__vInternal`;
|
|
1432
|
-
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
1433
|
-
const normalizeRef = ({ ref: ref$$1 }) => {
|
|
1434
|
-
return (ref$$1 != null
|
|
1435
|
-
? isArray(ref$$1)
|
|
1436
|
-
? ref$$1
|
|
1437
|
-
: [currentRenderingInstance, ref$$1]
|
|
1438
|
-
: null);
|
|
1439
|
-
};
|
|
1440
|
-
const createVNode = ((process.env.NODE_ENV !== 'production')
|
|
1441
|
-
? createVNodeWithArgsTransform
|
|
1442
|
-
: _createVNode);
|
|
1443
|
-
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
1444
|
-
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
1445
|
-
if ((process.env.NODE_ENV !== 'production') && !type) {
|
|
1446
|
-
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
1447
|
-
}
|
|
1448
|
-
type = Comment;
|
|
1449
|
-
}
|
|
1450
|
-
if (isVNode(type)) {
|
|
1451
|
-
const cloned = cloneVNode(type, props);
|
|
1452
|
-
if (children) {
|
|
1453
|
-
normalizeChildren(cloned, children);
|
|
1454
|
-
}
|
|
1455
|
-
return cloned;
|
|
1456
|
-
}
|
|
1457
|
-
// class component normalization.
|
|
1458
|
-
if (isFunction(type) && '__vccOpts' in type) {
|
|
1459
|
-
type = type.__vccOpts;
|
|
1460
|
-
}
|
|
1461
|
-
// class & style normalization.
|
|
1462
|
-
if (props) {
|
|
1463
|
-
// for reactive or proxy objects, we need to clone it to enable mutation.
|
|
1464
|
-
if (isProxy(props) || InternalObjectKey in props) {
|
|
1465
|
-
props = extend({}, props);
|
|
1466
|
-
}
|
|
1467
|
-
let { class: klass, style } = props;
|
|
1468
|
-
if (klass && !isString(klass)) {
|
|
1469
|
-
props.class = normalizeClass(klass);
|
|
1470
|
-
}
|
|
1471
|
-
if (isObject(style)) {
|
|
1472
|
-
// reactive state objects need to be cloned since they are likely to be
|
|
1473
|
-
// mutated
|
|
1474
|
-
if (isProxy(style) && !isArray(style)) {
|
|
1475
|
-
style = extend({}, style);
|
|
1476
|
-
}
|
|
1477
|
-
props.style = normalizeStyle(style);
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
// encode the vnode type information into a bitmap
|
|
1481
|
-
const shapeFlag = isString(type)
|
|
1482
|
-
? 1 /* ELEMENT */
|
|
1483
|
-
: isSuspense(type)
|
|
1484
|
-
? 128 /* SUSPENSE */
|
|
1485
|
-
: isTeleport(type)
|
|
1486
|
-
? 64 /* TELEPORT */
|
|
1487
|
-
: isObject(type)
|
|
1488
|
-
? 4 /* STATEFUL_COMPONENT */
|
|
1489
|
-
: isFunction(type)
|
|
1490
|
-
? 2 /* FUNCTIONAL_COMPONENT */
|
|
1491
|
-
: 0;
|
|
1492
|
-
if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
1493
|
-
type = toRaw(type);
|
|
1494
|
-
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
1495
|
-
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
1496
|
-
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
1497
|
-
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
1498
|
-
}
|
|
1499
|
-
const vnode = {
|
|
1500
|
-
__v_isVNode: true,
|
|
1501
|
-
__v_skip: true,
|
|
1502
|
-
type,
|
|
1503
|
-
props,
|
|
1504
|
-
key: props && normalizeKey(props),
|
|
1505
|
-
ref: props && normalizeRef(props),
|
|
1506
|
-
scopeId: currentScopeId,
|
|
1507
|
-
children: null,
|
|
1508
|
-
component: null,
|
|
1509
|
-
suspense: null,
|
|
1510
|
-
dirs: null,
|
|
1511
|
-
transition: null,
|
|
1512
|
-
el: null,
|
|
1513
|
-
anchor: null,
|
|
1514
|
-
target: null,
|
|
1515
|
-
targetAnchor: null,
|
|
1516
|
-
staticCount: 0,
|
|
1517
|
-
shapeFlag,
|
|
1518
|
-
patchFlag,
|
|
1519
|
-
dynamicProps,
|
|
1520
|
-
dynamicChildren: null,
|
|
1521
|
-
appContext: null
|
|
1522
|
-
};
|
|
1523
|
-
// validate key
|
|
1524
|
-
if ((process.env.NODE_ENV !== 'production') && vnode.key !== vnode.key) {
|
|
1525
|
-
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
1526
|
-
}
|
|
1527
|
-
normalizeChildren(vnode, children);
|
|
1528
|
-
if ((shouldTrack$1 > 0 || isRenderingTemplateSlot) &&
|
|
1529
|
-
// avoid a block node from tracking itself
|
|
1530
|
-
!isBlockNode &&
|
|
1531
|
-
// has current parent block
|
|
1532
|
-
currentBlock &&
|
|
1533
|
-
// presence of a patch flag indicates this node needs patching on updates.
|
|
1534
|
-
// component nodes also should always be patched, because even if the
|
|
1535
|
-
// component doesn't need to update, it needs to persist the instance on to
|
|
1536
|
-
// the next vnode so that it can be properly unmounted later.
|
|
1537
|
-
(patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
|
|
1538
|
-
// the EVENTS flag is only for hydration and if it is the only flag, the
|
|
1539
|
-
// vnode should not be considered dynamic due to handler caching.
|
|
1540
|
-
patchFlag !== 32 /* HYDRATE_EVENTS */) {
|
|
1541
|
-
currentBlock.push(vnode);
|
|
1542
|
-
}
|
|
1543
|
-
return vnode;
|
|
1544
|
-
}
|
|
1545
|
-
function cloneVNode(vnode, extraProps) {
|
|
1546
|
-
// This is intentionally NOT using spread or extend to avoid the runtime
|
|
1547
|
-
// key enumeration cost.
|
|
1548
|
-
const { props, patchFlag } = vnode;
|
|
1549
|
-
const mergedProps = extraProps
|
|
1550
|
-
? props
|
|
1551
|
-
? mergeProps(props, extraProps)
|
|
1552
|
-
: extend({}, extraProps)
|
|
1553
|
-
: props;
|
|
1554
|
-
return {
|
|
1555
|
-
__v_isVNode: true,
|
|
1556
|
-
__v_skip: true,
|
|
1557
|
-
type: vnode.type,
|
|
1558
|
-
props: mergedProps,
|
|
1559
|
-
key: mergedProps && normalizeKey(mergedProps),
|
|
1560
|
-
ref: extraProps && extraProps.ref ? normalizeRef(extraProps) : vnode.ref,
|
|
1561
|
-
scopeId: vnode.scopeId,
|
|
1562
|
-
children: vnode.children,
|
|
1563
|
-
target: vnode.target,
|
|
1564
|
-
targetAnchor: vnode.targetAnchor,
|
|
1565
|
-
staticCount: vnode.staticCount,
|
|
1566
|
-
shapeFlag: vnode.shapeFlag,
|
|
1567
|
-
// if the vnode is cloned with extra props, we can no longer assume its
|
|
1568
|
-
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
1569
|
-
// note: perserve flag for fragments since they use the flag for children
|
|
1570
|
-
// fast paths only.
|
|
1571
|
-
patchFlag: extraProps && vnode.type !== Fragment
|
|
1572
|
-
? patchFlag === -1 // hoisted node
|
|
1573
|
-
? 16 /* FULL_PROPS */
|
|
1574
|
-
: patchFlag | 16 /* FULL_PROPS */
|
|
1575
|
-
: patchFlag,
|
|
1576
|
-
dynamicProps: vnode.dynamicProps,
|
|
1577
|
-
dynamicChildren: vnode.dynamicChildren,
|
|
1578
|
-
appContext: vnode.appContext,
|
|
1579
|
-
dirs: vnode.dirs,
|
|
1580
|
-
transition: vnode.transition,
|
|
1581
|
-
// These should technically only be non-null on mounted VNodes. However,
|
|
1582
|
-
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
1583
|
-
// them since them being non-null during a mount doesn't affect the logic as
|
|
1584
|
-
// they will simply be overwritten.
|
|
1585
|
-
component: vnode.component,
|
|
1586
|
-
suspense: vnode.suspense,
|
|
1587
|
-
el: vnode.el,
|
|
1588
|
-
anchor: vnode.anchor
|
|
1589
|
-
};
|
|
1590
|
-
}
|
|
1591
|
-
/**
|
|
1592
|
-
* @private
|
|
1593
|
-
*/
|
|
1594
|
-
function createTextVNode(text = ' ', flag = 0) {
|
|
1595
|
-
return createVNode(Text, null, text, flag);
|
|
1596
|
-
}
|
|
1597
|
-
function normalizeChildren(vnode, children) {
|
|
1598
|
-
let type = 0;
|
|
1599
|
-
const { shapeFlag } = vnode;
|
|
1600
|
-
if (children == null) {
|
|
1601
|
-
children = null;
|
|
1602
|
-
}
|
|
1603
|
-
else if (isArray(children)) {
|
|
1604
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
1605
|
-
}
|
|
1606
|
-
else if (typeof children === 'object') {
|
|
1607
|
-
// Normalize slot to plain children
|
|
1608
|
-
if ((shapeFlag & 1 /* ELEMENT */ || shapeFlag & 64 /* TELEPORT */) &&
|
|
1609
|
-
children.default) {
|
|
1610
|
-
normalizeChildren(vnode, children.default());
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
else {
|
|
1614
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
1615
|
-
const slotFlag = children._;
|
|
1616
|
-
if (!slotFlag && !(InternalObjectKey in children)) {
|
|
1617
|
-
children._ctx = currentRenderingInstance;
|
|
1618
|
-
}
|
|
1619
|
-
else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
|
|
1620
|
-
// a child component receives forwarded slots from the parent.
|
|
1621
|
-
// its slot type is determined by its parent's slot type.
|
|
1622
|
-
if (currentRenderingInstance.vnode.patchFlag & 1024 /* DYNAMIC_SLOTS */) {
|
|
1623
|
-
children._ = 2 /* DYNAMIC */;
|
|
1624
|
-
vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
|
|
1625
|
-
}
|
|
1626
|
-
else {
|
|
1627
|
-
children._ = 1 /* STABLE */;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
else if (isFunction(children)) {
|
|
1633
|
-
children = { default: children, _ctx: currentRenderingInstance };
|
|
1634
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
1635
|
-
}
|
|
1636
|
-
else {
|
|
1637
|
-
children = String(children);
|
|
1638
|
-
// force teleport children to array so it can be moved around
|
|
1639
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
1640
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
1641
|
-
children = [createTextVNode(children)];
|
|
1642
|
-
}
|
|
1643
|
-
else {
|
|
1644
|
-
type = 8 /* TEXT_CHILDREN */;
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
vnode.children = children;
|
|
1648
|
-
vnode.shapeFlag |= type;
|
|
1649
|
-
}
|
|
1650
|
-
function mergeProps(...args) {
|
|
1651
|
-
const ret = extend({}, args[0]);
|
|
1652
|
-
for (let i = 1; i < args.length; i++) {
|
|
1653
|
-
const toMerge = args[i];
|
|
1654
|
-
for (const key in toMerge) {
|
|
1655
|
-
if (key === 'class') {
|
|
1656
|
-
if (ret.class !== toMerge.class) {
|
|
1657
|
-
ret.class = normalizeClass([ret.class, toMerge.class]);
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
else if (key === 'style') {
|
|
1661
|
-
ret.style = normalizeStyle([ret.style, toMerge.style]);
|
|
1662
|
-
}
|
|
1663
|
-
else if (isOn(key)) {
|
|
1664
|
-
const existing = ret[key];
|
|
1665
|
-
const incoming = toMerge[key];
|
|
1666
|
-
if (existing !== incoming) {
|
|
1667
|
-
ret[key] = existing
|
|
1668
|
-
? [].concat(existing, toMerge[key])
|
|
1669
|
-
: incoming;
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
else {
|
|
1673
|
-
ret[key] = toMerge[key];
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
return ret;
|
|
1678
|
-
}
|
|
1679
|
-
function normalizePropsOptions(comp) {
|
|
1680
|
-
if (comp.__props) {
|
|
1681
|
-
return comp.__props;
|
|
1682
|
-
}
|
|
1683
|
-
const raw = comp.props;
|
|
1684
|
-
const normalized = {};
|
|
1685
|
-
const needCastKeys = [];
|
|
1686
|
-
// apply mixin/extends props
|
|
1687
|
-
let hasExtends = false;
|
|
1688
|
-
if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
|
|
1689
|
-
const extendProps = (raw) => {
|
|
1690
|
-
const [props, keys] = normalizePropsOptions(raw);
|
|
1691
|
-
extend(normalized, props);
|
|
1692
|
-
if (keys)
|
|
1693
|
-
needCastKeys.push(...keys);
|
|
1694
|
-
};
|
|
1695
|
-
if (comp.extends) {
|
|
1696
|
-
hasExtends = true;
|
|
1697
|
-
extendProps(comp.extends);
|
|
1698
|
-
}
|
|
1699
|
-
if (comp.mixins) {
|
|
1700
|
-
hasExtends = true;
|
|
1701
|
-
comp.mixins.forEach(extendProps);
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
if (!raw && !hasExtends) {
|
|
1705
|
-
return (comp.__props = EMPTY_ARR);
|
|
1706
|
-
}
|
|
1707
|
-
if (isArray(raw)) {
|
|
1708
|
-
for (let i = 0; i < raw.length; i++) {
|
|
1709
|
-
if ((process.env.NODE_ENV !== 'production') && !isString(raw[i])) {
|
|
1710
|
-
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
1711
|
-
}
|
|
1712
|
-
const normalizedKey = camelize(raw[i]);
|
|
1713
|
-
if (validatePropName(normalizedKey)) {
|
|
1714
|
-
normalized[normalizedKey] = EMPTY_OBJ;
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
else if (raw) {
|
|
1719
|
-
if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {
|
|
1720
|
-
warn(`invalid props options`, raw);
|
|
1721
|
-
}
|
|
1722
|
-
for (const key in raw) {
|
|
1723
|
-
const normalizedKey = camelize(key);
|
|
1724
|
-
if (validatePropName(normalizedKey)) {
|
|
1725
|
-
const opt = raw[key];
|
|
1726
|
-
const prop = (normalized[normalizedKey] =
|
|
1727
|
-
isArray(opt) || isFunction(opt) ? { type: opt } : opt);
|
|
1728
|
-
if (prop) {
|
|
1729
|
-
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
1730
|
-
const stringIndex = getTypeIndex(String, prop.type);
|
|
1731
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
1732
|
-
prop[1 /* shouldCastTrue */] =
|
|
1733
|
-
stringIndex < 0 || booleanIndex < stringIndex;
|
|
1734
|
-
// if the prop needs boolean casting or default value
|
|
1735
|
-
if (booleanIndex > -1 || hasOwn(prop, 'default')) {
|
|
1736
|
-
needCastKeys.push(normalizedKey);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
const normalizedEntry = [normalized, needCastKeys];
|
|
1743
|
-
comp.__props = normalizedEntry;
|
|
1744
|
-
return normalizedEntry;
|
|
1745
|
-
}
|
|
1746
|
-
// use function string name to check type constructors
|
|
1747
|
-
// so that it works across vms / iframes.
|
|
1748
|
-
function getType(ctor) {
|
|
1749
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
1750
|
-
return match ? match[1] : '';
|
|
1751
|
-
}
|
|
1752
|
-
function isSameType(a, b) {
|
|
1753
|
-
return getType(a) === getType(b);
|
|
1754
|
-
}
|
|
1755
|
-
function getTypeIndex(type, expectedTypes) {
|
|
1756
|
-
if (isArray(expectedTypes)) {
|
|
1757
|
-
for (let i = 0, len = expectedTypes.length; i < len; i++) {
|
|
1758
|
-
if (isSameType(expectedTypes[i], type)) {
|
|
1759
|
-
return i;
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
else if (isFunction(expectedTypes)) {
|
|
1764
|
-
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
1765
|
-
}
|
|
1766
|
-
return -1;
|
|
1767
|
-
}
|
|
1768
|
-
/**
|
|
1769
|
-
* dev only
|
|
1770
|
-
*/
|
|
1771
|
-
function validatePropName(key) {
|
|
1772
|
-
if (key[0] !== '$') {
|
|
1773
|
-
return true;
|
|
1774
|
-
}
|
|
1775
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
1776
|
-
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
1777
|
-
}
|
|
1778
|
-
return false;
|
|
1779
|
-
}
|
|
1780
|
-
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol');
|
|
1781
|
-
|
|
1782
|
-
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
1783
|
-
if (target) {
|
|
1784
|
-
const hooks = target[type] || (target[type] = []);
|
|
1785
|
-
// cache the error handling wrapper for injected hooks so the same hook
|
|
1786
|
-
// can be properly deduped by the scheduler. "__weh" stands for "with error
|
|
1787
|
-
// handling".
|
|
1788
|
-
const wrappedHook = hook.__weh ||
|
|
1789
|
-
(hook.__weh = (...args) => {
|
|
1790
|
-
if (target.isUnmounted) {
|
|
1791
|
-
return;
|
|
1792
|
-
}
|
|
1793
|
-
// disable tracking inside all lifecycle hooks
|
|
1794
|
-
// since they can potentially be called inside effects.
|
|
1795
|
-
pauseTracking();
|
|
1796
|
-
// Set currentInstance during hook invocation.
|
|
1797
|
-
// This assumes the hook does not synchronously trigger other hooks, which
|
|
1798
|
-
// can only be false when the user does something really funky.
|
|
1799
|
-
setCurrentInstance(target);
|
|
1800
|
-
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
1801
|
-
setCurrentInstance(null);
|
|
1802
|
-
resetTracking();
|
|
1803
|
-
return res;
|
|
1804
|
-
});
|
|
1805
|
-
if (prepend) {
|
|
1806
|
-
hooks.unshift(wrappedHook);
|
|
1807
|
-
}
|
|
1808
|
-
else {
|
|
1809
|
-
hooks.push(wrappedHook);
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
1813
|
-
const apiName = `on${capitalize(ErrorTypeStrings[type].replace(/ hook$/, ''))}`;
|
|
1814
|
-
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
1815
|
-
`associated with. ` +
|
|
1816
|
-
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
1817
|
-
( ` If you are using async setup(), make sure to register lifecycle ` +
|
|
1818
|
-
`hooks before the first await statement.`
|
|
1819
|
-
));
|
|
1820
|
-
}
|
|
1821
|
-
}
|
|
1822
|
-
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
1823
|
-
// post-create lifecycle registrations are noops during SSR
|
|
1824
|
-
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
|
|
1825
|
-
const onMounted = createHook("m" /* MOUNTED */);
|
|
1826
|
-
const onUpdated = createHook("u" /* UPDATED */);
|
|
1827
|
-
const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
|
|
1828
|
-
|
|
1829
|
-
function useTransitionState() {
|
|
1830
|
-
const state = {
|
|
1831
|
-
isMounted: false,
|
|
1832
|
-
isLeaving: false,
|
|
1833
|
-
isUnmounting: false,
|
|
1834
|
-
leavingVNodes: new Map()
|
|
1835
|
-
};
|
|
1836
|
-
onMounted(() => {
|
|
1837
|
-
state.isMounted = true;
|
|
1838
|
-
});
|
|
1839
|
-
onBeforeUnmount(() => {
|
|
1840
|
-
state.isUnmounting = true;
|
|
1841
|
-
});
|
|
1842
|
-
return state;
|
|
1843
|
-
}
|
|
1844
|
-
const TransitionHookValidator = [Function, Array];
|
|
1845
|
-
const BaseTransitionImpl = {
|
|
1846
|
-
name: `BaseTransition`,
|
|
1847
|
-
props: {
|
|
1848
|
-
mode: String,
|
|
1849
|
-
appear: Boolean,
|
|
1850
|
-
persisted: Boolean,
|
|
1851
|
-
// enter
|
|
1852
|
-
onBeforeEnter: TransitionHookValidator,
|
|
1853
|
-
onEnter: TransitionHookValidator,
|
|
1854
|
-
onAfterEnter: TransitionHookValidator,
|
|
1855
|
-
onEnterCancelled: TransitionHookValidator,
|
|
1856
|
-
// leave
|
|
1857
|
-
onBeforeLeave: TransitionHookValidator,
|
|
1858
|
-
onLeave: TransitionHookValidator,
|
|
1859
|
-
onAfterLeave: TransitionHookValidator,
|
|
1860
|
-
onLeaveCancelled: TransitionHookValidator,
|
|
1861
|
-
// appear
|
|
1862
|
-
onBeforeAppear: TransitionHookValidator,
|
|
1863
|
-
onAppear: TransitionHookValidator,
|
|
1864
|
-
onAfterAppear: TransitionHookValidator,
|
|
1865
|
-
onAppearCancelled: TransitionHookValidator
|
|
1866
|
-
},
|
|
1867
|
-
setup(props, { slots }) {
|
|
1868
|
-
const instance = getCurrentInstance();
|
|
1869
|
-
const state = useTransitionState();
|
|
1870
|
-
let prevTransitionKey;
|
|
1871
|
-
return () => {
|
|
1872
|
-
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
1873
|
-
if (!children || !children.length) {
|
|
1874
|
-
return;
|
|
1875
|
-
}
|
|
1876
|
-
// warn multiple elements
|
|
1877
|
-
if ((process.env.NODE_ENV !== 'production') && children.length > 1) {
|
|
1878
|
-
warn('<transition> can only be used on a single element or component. Use ' +
|
|
1879
|
-
'<transition-group> for lists.');
|
|
1880
|
-
}
|
|
1881
|
-
// there's no need to track reactivity for these props so use the raw
|
|
1882
|
-
// props for a bit better perf
|
|
1883
|
-
const rawProps = toRaw(props);
|
|
1884
|
-
const { mode } = rawProps;
|
|
1885
|
-
// check mode
|
|
1886
|
-
if ((process.env.NODE_ENV !== 'production') && mode && !['in-out', 'out-in', 'default'].includes(mode)) {
|
|
1887
|
-
warn(`invalid <transition> mode: ${mode}`);
|
|
1888
|
-
}
|
|
1889
|
-
// at this point children has a guaranteed length of 1.
|
|
1890
|
-
const child = children[0];
|
|
1891
|
-
if (state.isLeaving) {
|
|
1892
|
-
return emptyPlaceholder(child);
|
|
1893
|
-
}
|
|
1894
|
-
// in the case of <transition><keep-alive/></transition>, we need to
|
|
1895
|
-
// compare the type of the kept-alive children.
|
|
1896
|
-
const innerChild = getKeepAliveChild(child);
|
|
1897
|
-
if (!innerChild) {
|
|
1898
|
-
return emptyPlaceholder(child);
|
|
1899
|
-
}
|
|
1900
|
-
const enterHooks = (innerChild.transition = resolveTransitionHooks(innerChild, rawProps, state, instance));
|
|
1901
|
-
const oldChild = instance.subTree;
|
|
1902
|
-
const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
|
|
1903
|
-
let transitionKeyChanged = false;
|
|
1904
|
-
const { getTransitionKey } = innerChild.type;
|
|
1905
|
-
if (getTransitionKey) {
|
|
1906
|
-
const key = getTransitionKey();
|
|
1907
|
-
if (prevTransitionKey === undefined) {
|
|
1908
|
-
prevTransitionKey = key;
|
|
1909
|
-
}
|
|
1910
|
-
else if (key !== prevTransitionKey) {
|
|
1911
|
-
prevTransitionKey = key;
|
|
1912
|
-
transitionKeyChanged = true;
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
// handle mode
|
|
1916
|
-
if (oldInnerChild &&
|
|
1917
|
-
oldInnerChild.type !== Comment &&
|
|
1918
|
-
(!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
|
|
1919
|
-
const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
1920
|
-
// update old tree's hooks in case of dynamic transition
|
|
1921
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
1922
|
-
// switching between different views
|
|
1923
|
-
if (mode === 'out-in') {
|
|
1924
|
-
state.isLeaving = true;
|
|
1925
|
-
// return placeholder node and queue update when leave finishes
|
|
1926
|
-
leavingHooks.afterLeave = () => {
|
|
1927
|
-
state.isLeaving = false;
|
|
1928
|
-
instance.update();
|
|
1929
|
-
};
|
|
1930
|
-
return emptyPlaceholder(child);
|
|
1931
|
-
}
|
|
1932
|
-
else if (mode === 'in-out') {
|
|
1933
|
-
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1934
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
1935
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
1936
|
-
// early removal callback
|
|
1937
|
-
el._leaveCb = () => {
|
|
1938
|
-
earlyRemove();
|
|
1939
|
-
el._leaveCb = undefined;
|
|
1940
|
-
delete enterHooks.delayedLeave;
|
|
1941
|
-
};
|
|
1942
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
1943
|
-
};
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
return child;
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
// export the public type for h/tsx inference
|
|
1951
|
-
// also to avoid inline import() in generated d.ts files
|
|
1952
|
-
const BaseTransition = BaseTransitionImpl;
|
|
1953
|
-
function getLeavingNodesForType(state, vnode) {
|
|
1954
|
-
const { leavingVNodes } = state;
|
|
1955
|
-
let leavingVNodesCache = leavingVNodes.get(vnode.type);
|
|
1956
|
-
if (!leavingVNodesCache) {
|
|
1957
|
-
leavingVNodesCache = Object.create(null);
|
|
1958
|
-
leavingVNodes.set(vnode.type, leavingVNodesCache);
|
|
1959
|
-
}
|
|
1960
|
-
return leavingVNodesCache;
|
|
1961
|
-
}
|
|
1962
|
-
// The transition hooks are attached to the vnode as vnode.transition
|
|
1963
|
-
// and will be called at appropriate timing in the renderer.
|
|
1964
|
-
function resolveTransitionHooks(vnode, { appear, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled }, state, instance) {
|
|
1965
|
-
const key = String(vnode.key);
|
|
1966
|
-
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1967
|
-
const callHook = (hook, args) => {
|
|
1968
|
-
hook &&
|
|
1969
|
-
callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
|
|
1970
|
-
};
|
|
1971
|
-
const hooks = {
|
|
1972
|
-
persisted,
|
|
1973
|
-
beforeEnter(el) {
|
|
1974
|
-
let hook = onBeforeEnter;
|
|
1975
|
-
if (!state.isMounted) {
|
|
1976
|
-
if (appear) {
|
|
1977
|
-
hook = onBeforeAppear || onBeforeEnter;
|
|
1978
|
-
}
|
|
1979
|
-
else {
|
|
1980
|
-
return;
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
// for same element (v-show)
|
|
1984
|
-
if (el._leaveCb) {
|
|
1985
|
-
el._leaveCb(true /* cancelled */);
|
|
1986
|
-
}
|
|
1987
|
-
// for toggled element with same key (v-if)
|
|
1988
|
-
const leavingVNode = leavingVNodesCache[key];
|
|
1989
|
-
if (leavingVNode &&
|
|
1990
|
-
isSameVNodeType(vnode, leavingVNode) &&
|
|
1991
|
-
leavingVNode.el._leaveCb) {
|
|
1992
|
-
// force early removal (not cancelled)
|
|
1993
|
-
leavingVNode.el._leaveCb();
|
|
1994
|
-
}
|
|
1995
|
-
callHook(hook, [el]);
|
|
1996
|
-
},
|
|
1997
|
-
enter(el) {
|
|
1998
|
-
let hook = onEnter;
|
|
1999
|
-
let afterHook = onAfterEnter;
|
|
2000
|
-
let cancelHook = onEnterCancelled;
|
|
2001
|
-
if (!state.isMounted) {
|
|
2002
|
-
if (appear) {
|
|
2003
|
-
hook = onAppear || onEnter;
|
|
2004
|
-
afterHook = onAfterAppear || onAfterEnter;
|
|
2005
|
-
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
2006
|
-
}
|
|
2007
|
-
else {
|
|
2008
|
-
return;
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
let called = false;
|
|
2012
|
-
const done = (el._enterCb = (cancelled) => {
|
|
2013
|
-
if (called)
|
|
2014
|
-
return;
|
|
2015
|
-
called = true;
|
|
2016
|
-
if (cancelled) {
|
|
2017
|
-
callHook(cancelHook, [el]);
|
|
2018
|
-
}
|
|
2019
|
-
else {
|
|
2020
|
-
callHook(afterHook, [el]);
|
|
2021
|
-
}
|
|
2022
|
-
if (hooks.delayedLeave) {
|
|
2023
|
-
hooks.delayedLeave();
|
|
2024
|
-
}
|
|
2025
|
-
el._enterCb = undefined;
|
|
2026
|
-
});
|
|
2027
|
-
if (hook) {
|
|
2028
|
-
hook(el, done);
|
|
2029
|
-
if (hook.length <= 1) {
|
|
2030
|
-
done();
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
else {
|
|
2034
|
-
done();
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
leave(el, remove$$1) {
|
|
2038
|
-
const key = String(vnode.key);
|
|
2039
|
-
if (el._enterCb) {
|
|
2040
|
-
el._enterCb(true /* cancelled */);
|
|
2041
|
-
}
|
|
2042
|
-
if (state.isUnmounting) {
|
|
2043
|
-
return remove$$1();
|
|
2044
|
-
}
|
|
2045
|
-
callHook(onBeforeLeave, [el]);
|
|
2046
|
-
let called = false;
|
|
2047
|
-
const done = (el._leaveCb = (cancelled) => {
|
|
2048
|
-
if (called)
|
|
2049
|
-
return;
|
|
2050
|
-
called = true;
|
|
2051
|
-
remove$$1();
|
|
2052
|
-
if (cancelled) {
|
|
2053
|
-
callHook(onLeaveCancelled, [el]);
|
|
2054
|
-
}
|
|
2055
|
-
else {
|
|
2056
|
-
callHook(onAfterLeave, [el]);
|
|
2057
|
-
}
|
|
2058
|
-
el._leaveCb = undefined;
|
|
2059
|
-
if (leavingVNodesCache[key] === vnode) {
|
|
2060
|
-
delete leavingVNodesCache[key];
|
|
2061
|
-
}
|
|
2062
|
-
});
|
|
2063
|
-
leavingVNodesCache[key] = vnode;
|
|
2064
|
-
if (onLeave) {
|
|
2065
|
-
onLeave(el, done);
|
|
2066
|
-
if (onLeave.length <= 1) {
|
|
2067
|
-
done();
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
else {
|
|
2071
|
-
done();
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
};
|
|
2075
|
-
return hooks;
|
|
2076
|
-
}
|
|
2077
|
-
// the placeholder really only handles one special case: KeepAlive
|
|
2078
|
-
// in the case of a KeepAlive in a leave phase we need to return a KeepAlive
|
|
2079
|
-
// placeholder with empty content to avoid the KeepAlive instance from being
|
|
2080
|
-
// unmounted.
|
|
2081
|
-
function emptyPlaceholder(vnode) {
|
|
2082
|
-
if (isKeepAlive(vnode)) {
|
|
2083
|
-
vnode = cloneVNode(vnode);
|
|
2084
|
-
vnode.children = null;
|
|
2085
|
-
return vnode;
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
function getKeepAliveChild(vnode) {
|
|
2089
|
-
return isKeepAlive(vnode)
|
|
2090
|
-
? vnode.children
|
|
2091
|
-
? vnode.children[0]
|
|
2092
|
-
: undefined
|
|
2093
|
-
: vnode;
|
|
2094
|
-
}
|
|
2095
|
-
function setTransitionHooks(vnode, hooks) {
|
|
2096
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
|
|
2097
|
-
setTransitionHooks(vnode.component.subTree, hooks);
|
|
2098
|
-
}
|
|
2099
|
-
else {
|
|
2100
|
-
vnode.transition = hooks;
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
function getTransitionRawChildren(children, keepComment = false) {
|
|
2104
|
-
let ret = [];
|
|
2105
|
-
let keyedFragmentCount = 0;
|
|
2106
|
-
for (let i = 0; i < children.length; i++) {
|
|
2107
|
-
const child = children[i];
|
|
2108
|
-
// handle fragment children case, e.g. v-for
|
|
2109
|
-
if (child.type === Fragment) {
|
|
2110
|
-
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
2111
|
-
keyedFragmentCount++;
|
|
2112
|
-
ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
|
|
2113
|
-
}
|
|
2114
|
-
// comment placeholders should be skipped, e.g. v-if
|
|
2115
|
-
else if (keepComment || child.type !== Comment) {
|
|
2116
|
-
ret.push(child);
|
|
2117
|
-
}
|
|
2118
|
-
}
|
|
2119
|
-
// #1126 if a transition children list contains multiple sub fragments, these
|
|
2120
|
-
// fragments will be merged into a flat children array. Since each v-for
|
|
2121
|
-
// fragment may contain different static bindings inside, we need to de-top
|
|
2122
|
-
// these children to force full diffs to ensure correct behavior.
|
|
2123
|
-
if (keyedFragmentCount > 1) {
|
|
2124
|
-
for (let i = 0; i < ret.length; i++) {
|
|
2125
|
-
ret[i].patchFlag = -2 /* BAIL */;
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
return ret;
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2132
|
-
|
|
2133
|
-
/**
|
|
2134
|
-
Runtime helper for applying directives to a vnode. Example usage:
|
|
2135
|
-
|
|
2136
|
-
const comp = resolveComponent('comp')
|
|
2137
|
-
const foo = resolveDirective('foo')
|
|
2138
|
-
const bar = resolveDirective('bar')
|
|
2139
|
-
|
|
2140
|
-
return withDirectives(h(comp), [
|
|
2141
|
-
[foo, this.x],
|
|
2142
|
-
[bar, this.y]
|
|
2143
|
-
])
|
|
2144
|
-
*/
|
|
2145
|
-
const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');
|
|
2146
|
-
function setDevtoolsHook(hook) {
|
|
2147
|
-
}
|
|
2148
|
-
const queuePostRenderEffect = queueEffectWithSuspense
|
|
2149
|
-
;
|
|
2150
|
-
// initial value for watchers to trigger on undefined initial values
|
|
2151
|
-
const INITIAL_WATCHER_VALUE = {};
|
|
2152
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {
|
|
2153
|
-
if ((process.env.NODE_ENV !== 'production') && !cb) {
|
|
2154
|
-
if (immediate !== undefined) {
|
|
2155
|
-
warn(`watch() "immediate" option is only respected when using the ` +
|
|
2156
|
-
`watch(source, callback, options?) signature.`);
|
|
2157
|
-
}
|
|
2158
|
-
if (deep !== undefined) {
|
|
2159
|
-
warn(`watch() "deep" option is only respected when using the ` +
|
|
2160
|
-
`watch(source, callback, options?) signature.`);
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
const warnInvalidSource = (s) => {
|
|
2164
|
-
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
2165
|
-
`a reactive object, or an array of these types.`);
|
|
2166
|
-
};
|
|
2167
|
-
let getter;
|
|
2168
|
-
const isRefSource = isRef(source);
|
|
2169
|
-
if (isRefSource) {
|
|
2170
|
-
getter = () => source.value;
|
|
2171
|
-
}
|
|
2172
|
-
else if (isReactive(source)) {
|
|
2173
|
-
getter = () => source;
|
|
2174
|
-
deep = true;
|
|
2175
|
-
}
|
|
2176
|
-
else if (isArray(source)) {
|
|
2177
|
-
getter = () => source.map(s => {
|
|
2178
|
-
if (isRef(s)) {
|
|
2179
|
-
return s.value;
|
|
2180
|
-
}
|
|
2181
|
-
else if (isReactive(s)) {
|
|
2182
|
-
return traverse(s);
|
|
2183
|
-
}
|
|
2184
|
-
else if (isFunction(s)) {
|
|
2185
|
-
return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
|
|
2186
|
-
}
|
|
2187
|
-
else {
|
|
2188
|
-
(process.env.NODE_ENV !== 'production') && warnInvalidSource(s);
|
|
2189
|
-
}
|
|
2190
|
-
});
|
|
2191
|
-
}
|
|
2192
|
-
else if (isFunction(source)) {
|
|
2193
|
-
if (cb) {
|
|
2194
|
-
// getter with cb
|
|
2195
|
-
getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
|
|
2196
|
-
}
|
|
2197
|
-
else {
|
|
2198
|
-
// no cb -> simple effect
|
|
2199
|
-
getter = () => {
|
|
2200
|
-
if (instance && instance.isUnmounted) {
|
|
2201
|
-
return;
|
|
2202
|
-
}
|
|
2203
|
-
if (cleanup) {
|
|
2204
|
-
cleanup();
|
|
2205
|
-
}
|
|
2206
|
-
return callWithErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);
|
|
2207
|
-
};
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
else {
|
|
2211
|
-
getter = NOOP;
|
|
2212
|
-
(process.env.NODE_ENV !== 'production') && warnInvalidSource(source);
|
|
2213
|
-
}
|
|
2214
|
-
if (cb && deep) {
|
|
2215
|
-
const baseGetter = getter;
|
|
2216
|
-
getter = () => traverse(baseGetter());
|
|
2217
|
-
}
|
|
2218
|
-
let cleanup;
|
|
2219
|
-
const onInvalidate = (fn) => {
|
|
2220
|
-
cleanup = runner.options.onStop = () => {
|
|
2221
|
-
callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
|
|
2222
|
-
};
|
|
2223
|
-
};
|
|
2224
|
-
let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;
|
|
2225
|
-
const job = () => {
|
|
2226
|
-
if (!runner.active) {
|
|
2227
|
-
return;
|
|
2228
|
-
}
|
|
2229
|
-
if (cb) {
|
|
2230
|
-
// watch(source, cb)
|
|
2231
|
-
const newValue = runner();
|
|
2232
|
-
if (deep || isRefSource || hasChanged(newValue, oldValue)) {
|
|
2233
|
-
// cleanup before running cb again
|
|
2234
|
-
if (cleanup) {
|
|
2235
|
-
cleanup();
|
|
2236
|
-
}
|
|
2237
|
-
callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
|
|
2238
|
-
newValue,
|
|
2239
|
-
// pass undefined as the old value when it's changed for the first time
|
|
2240
|
-
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
|
|
2241
|
-
onInvalidate
|
|
2242
|
-
]);
|
|
2243
|
-
oldValue = newValue;
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
else {
|
|
2247
|
-
// watchEffect
|
|
2248
|
-
runner();
|
|
2249
|
-
}
|
|
2250
|
-
};
|
|
2251
|
-
// important: mark the job as a watcher callback so that scheduler knows it
|
|
2252
|
-
// it is allowed to self-trigger (#1727)
|
|
2253
|
-
job.allowRecurse = !!cb;
|
|
2254
|
-
let scheduler;
|
|
2255
|
-
if (flush === 'sync') {
|
|
2256
|
-
scheduler = job;
|
|
2257
|
-
}
|
|
2258
|
-
else if (flush === 'pre') {
|
|
2259
|
-
// ensure it's queued before component updates (which have positive ids)
|
|
2260
|
-
job.id = -1;
|
|
2261
|
-
scheduler = () => {
|
|
2262
|
-
if (!instance || instance.isMounted) {
|
|
2263
|
-
queuePreFlushCb(job);
|
|
2264
|
-
}
|
|
2265
|
-
else {
|
|
2266
|
-
// with 'pre' option, the first call must happen before
|
|
2267
|
-
// the component is mounted so it is called synchronously.
|
|
2268
|
-
job();
|
|
2269
|
-
}
|
|
2270
|
-
};
|
|
2271
|
-
}
|
|
2272
|
-
else {
|
|
2273
|
-
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
2274
|
-
}
|
|
2275
|
-
const runner = effect(getter, {
|
|
2276
|
-
lazy: true,
|
|
2277
|
-
onTrack,
|
|
2278
|
-
onTrigger,
|
|
2279
|
-
scheduler
|
|
2280
|
-
});
|
|
2281
|
-
recordInstanceBoundEffect(runner);
|
|
2282
|
-
// initial run
|
|
2283
|
-
if (cb) {
|
|
2284
|
-
if (immediate) {
|
|
2285
|
-
job();
|
|
2286
|
-
}
|
|
2287
|
-
else {
|
|
2288
|
-
oldValue = runner();
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
else {
|
|
2292
|
-
runner();
|
|
2293
|
-
}
|
|
2294
|
-
return () => {
|
|
2295
|
-
stop(runner);
|
|
2296
|
-
if (instance) {
|
|
2297
|
-
remove(instance.effects, runner);
|
|
2298
|
-
}
|
|
2299
|
-
};
|
|
2300
|
-
}
|
|
2301
|
-
// this.$watch
|
|
2302
|
-
function instanceWatch(source, cb, options) {
|
|
2303
|
-
const publicThis = this.proxy;
|
|
2304
|
-
const getter = isString(source)
|
|
2305
|
-
? () => publicThis[source]
|
|
2306
|
-
: source.bind(publicThis);
|
|
2307
|
-
return doWatch(getter, cb.bind(publicThis), options, this);
|
|
2308
|
-
}
|
|
2309
|
-
function traverse(value, seen = new Set()) {
|
|
2310
|
-
if (!isObject(value) || seen.has(value)) {
|
|
2311
|
-
return value;
|
|
2312
|
-
}
|
|
2313
|
-
seen.add(value);
|
|
2314
|
-
if (isArray(value)) {
|
|
2315
|
-
for (let i = 0; i < value.length; i++) {
|
|
2316
|
-
traverse(value[i], seen);
|
|
2317
|
-
}
|
|
2318
|
-
}
|
|
2319
|
-
else if (value instanceof Map) {
|
|
2320
|
-
value.forEach((v, key) => {
|
|
2321
|
-
// to register mutation dep for existing keys
|
|
2322
|
-
traverse(value.get(key), seen);
|
|
2323
|
-
});
|
|
2324
|
-
}
|
|
2325
|
-
else if (value instanceof Set) {
|
|
2326
|
-
value.forEach(v => {
|
|
2327
|
-
traverse(v, seen);
|
|
2328
|
-
});
|
|
2329
|
-
}
|
|
2330
|
-
else {
|
|
2331
|
-
for (const key in value) {
|
|
2332
|
-
traverse(value[key], seen);
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
return value;
|
|
2336
|
-
}
|
|
2337
|
-
let isInBeforeCreate = false;
|
|
2338
|
-
function resolveMergedOptions(instance) {
|
|
2339
|
-
const raw = instance.type;
|
|
2340
|
-
const { __merged, mixins, extends: extendsOptions } = raw;
|
|
2341
|
-
if (__merged)
|
|
2342
|
-
return __merged;
|
|
2343
|
-
const globalMixins = instance.appContext.mixins;
|
|
2344
|
-
if (!globalMixins.length && !mixins && !extendsOptions)
|
|
2345
|
-
return raw;
|
|
2346
|
-
const options = {};
|
|
2347
|
-
globalMixins.forEach(m => mergeOptions(options, m, instance));
|
|
2348
|
-
extendsOptions && mergeOptions(options, extendsOptions, instance);
|
|
2349
|
-
mixins && mixins.forEach(m => mergeOptions(options, m, instance));
|
|
2350
|
-
mergeOptions(options, raw, instance);
|
|
2351
|
-
return (raw.__merged = options);
|
|
2352
|
-
}
|
|
2353
|
-
function mergeOptions(to, from, instance) {
|
|
2354
|
-
const strats = instance.appContext.config.optionMergeStrategies;
|
|
2355
|
-
for (const key in from) {
|
|
2356
|
-
if (strats && hasOwn(strats, key)) {
|
|
2357
|
-
to[key] = strats[key](to[key], from[key], instance.proxy, key);
|
|
2358
|
-
}
|
|
2359
|
-
else if (!hasOwn(to, key)) {
|
|
2360
|
-
to[key] = from[key];
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
const publicPropertiesMap = extend(Object.create(null), {
|
|
2366
|
-
$: i => i,
|
|
2367
|
-
$el: i => i.vnode.el,
|
|
2368
|
-
$data: i => i.data,
|
|
2369
|
-
$props: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.props) : i.props),
|
|
2370
|
-
$attrs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.attrs) : i.attrs),
|
|
2371
|
-
$slots: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.slots) : i.slots),
|
|
2372
|
-
$refs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.refs) : i.refs),
|
|
2373
|
-
$parent: i => i.parent && i.parent.proxy,
|
|
2374
|
-
$root: i => i.root && i.root.proxy,
|
|
2375
|
-
$emit: i => i.emit,
|
|
2376
|
-
$options: i => (__VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),
|
|
2377
|
-
$forceUpdate: i => () => queueJob(i.update),
|
|
2378
|
-
$nextTick: () => nextTick,
|
|
2379
|
-
$watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
|
|
2380
|
-
});
|
|
2381
|
-
const PublicInstanceProxyHandlers = {
|
|
2382
|
-
get({ _: instance }, key) {
|
|
2383
|
-
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
2384
|
-
// let @vue/reactivity know it should never observe Vue public instances.
|
|
2385
|
-
if (key === "__v_skip" /* SKIP */) {
|
|
2386
|
-
return true;
|
|
2387
|
-
}
|
|
2388
|
-
// data / props / ctx
|
|
2389
|
-
// This getter gets called for every property access on the render context
|
|
2390
|
-
// during render and is a major hotspot. The most expensive part of this
|
|
2391
|
-
// is the multiple hasOwn() calls. It's much faster to do a simple property
|
|
2392
|
-
// access on a plain object, so we use an accessCache object (with null
|
|
2393
|
-
// prototype) to memoize what access type a key corresponds to.
|
|
2394
|
-
let normalizedProps;
|
|
2395
|
-
if (key[0] !== '$') {
|
|
2396
|
-
const n = accessCache[key];
|
|
2397
|
-
if (n !== undefined) {
|
|
2398
|
-
switch (n) {
|
|
2399
|
-
case 0 /* SETUP */:
|
|
2400
|
-
return setupState[key];
|
|
2401
|
-
case 1 /* DATA */:
|
|
2402
|
-
return data[key];
|
|
2403
|
-
case 3 /* CONTEXT */:
|
|
2404
|
-
return ctx[key];
|
|
2405
|
-
case 2 /* PROPS */:
|
|
2406
|
-
return props[key];
|
|
2407
|
-
// default: just fallthrough
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
2411
|
-
accessCache[key] = 0 /* SETUP */;
|
|
2412
|
-
return setupState[key];
|
|
2413
|
-
}
|
|
2414
|
-
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2415
|
-
accessCache[key] = 1 /* DATA */;
|
|
2416
|
-
return data[key];
|
|
2417
|
-
}
|
|
2418
|
-
else if (
|
|
2419
|
-
// only cache other properties when instance has declared (thus stable)
|
|
2420
|
-
// props
|
|
2421
|
-
(normalizedProps = normalizePropsOptions(type)[0]) &&
|
|
2422
|
-
hasOwn(normalizedProps, key)) {
|
|
2423
|
-
accessCache[key] = 2 /* PROPS */;
|
|
2424
|
-
return props[key];
|
|
2425
|
-
}
|
|
2426
|
-
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2427
|
-
accessCache[key] = 3 /* CONTEXT */;
|
|
2428
|
-
return ctx[key];
|
|
2429
|
-
}
|
|
2430
|
-
else if (!__VUE_OPTIONS_API__ || !isInBeforeCreate) {
|
|
2431
|
-
accessCache[key] = 4 /* OTHER */;
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
const publicGetter = publicPropertiesMap[key];
|
|
2435
|
-
let cssModule, globalProperties;
|
|
2436
|
-
// public $xxx properties
|
|
2437
|
-
if (publicGetter) {
|
|
2438
|
-
if (key === '$attrs') {
|
|
2439
|
-
track(instance, "get" /* GET */, key);
|
|
2440
|
-
(process.env.NODE_ENV !== 'production') && markAttrsAccessed();
|
|
2441
|
-
}
|
|
2442
|
-
return publicGetter(instance);
|
|
2443
|
-
}
|
|
2444
|
-
else if (
|
|
2445
|
-
// css module (injected by vue-loader)
|
|
2446
|
-
(cssModule = type.__cssModules) &&
|
|
2447
|
-
(cssModule = cssModule[key])) {
|
|
2448
|
-
return cssModule;
|
|
2449
|
-
}
|
|
2450
|
-
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
2451
|
-
// user may set custom properties to `this` that start with `$`
|
|
2452
|
-
accessCache[key] = 3 /* CONTEXT */;
|
|
2453
|
-
return ctx[key];
|
|
2454
|
-
}
|
|
2455
|
-
else if (
|
|
2456
|
-
// global properties
|
|
2457
|
-
(globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key))) {
|
|
2458
|
-
return globalProperties[key];
|
|
2459
|
-
}
|
|
2460
|
-
else if ((process.env.NODE_ENV !== 'production') &&
|
|
2461
|
-
currentRenderingInstance &&
|
|
2462
|
-
(!isString(key) ||
|
|
2463
|
-
// #1091 avoid internal isRef/isVNode checks on component instance leading
|
|
2464
|
-
// to infinite warning loop
|
|
2465
|
-
key.indexOf('__v') !== 0)) {
|
|
2466
|
-
if (data !== EMPTY_OBJ && key[0] === '$' && hasOwn(data, key)) {
|
|
2467
|
-
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
2468
|
-
`character and is not proxied on the render context.`);
|
|
2469
|
-
}
|
|
2470
|
-
else {
|
|
2471
|
-
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
2472
|
-
`but is not defined on instance.`);
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
|
-
},
|
|
2476
|
-
set({ _: instance }, key, value) {
|
|
2477
|
-
const { data, setupState, ctx } = instance;
|
|
2478
|
-
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
2479
|
-
setupState[key] = value;
|
|
2480
|
-
}
|
|
2481
|
-
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
2482
|
-
data[key] = value;
|
|
2483
|
-
}
|
|
2484
|
-
else if (key in instance.props) {
|
|
2485
|
-
(process.env.NODE_ENV !== 'production') &&
|
|
2486
|
-
warn(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
2487
|
-
return false;
|
|
2488
|
-
}
|
|
2489
|
-
if (key[0] === '$' && key.slice(1) in instance) {
|
|
2490
|
-
(process.env.NODE_ENV !== 'production') &&
|
|
2491
|
-
warn(`Attempting to mutate public property "${key}". ` +
|
|
2492
|
-
`Properties starting with $ are reserved and readonly.`, instance);
|
|
2493
|
-
return false;
|
|
2494
|
-
}
|
|
2495
|
-
else {
|
|
2496
|
-
if ((process.env.NODE_ENV !== 'production') && key in instance.appContext.config.globalProperties) {
|
|
2497
|
-
Object.defineProperty(ctx, key, {
|
|
2498
|
-
enumerable: true,
|
|
2499
|
-
configurable: true,
|
|
2500
|
-
value
|
|
2501
|
-
});
|
|
2502
|
-
}
|
|
2503
|
-
else {
|
|
2504
|
-
ctx[key] = value;
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
return true;
|
|
2508
|
-
},
|
|
2509
|
-
has({ _: { data, setupState, accessCache, ctx, type, appContext } }, key) {
|
|
2510
|
-
let normalizedProps;
|
|
2511
|
-
return (accessCache[key] !== undefined ||
|
|
2512
|
-
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
2513
|
-
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
2514
|
-
((normalizedProps = normalizePropsOptions(type)[0]) &&
|
|
2515
|
-
hasOwn(normalizedProps, key)) ||
|
|
2516
|
-
hasOwn(ctx, key) ||
|
|
2517
|
-
hasOwn(publicPropertiesMap, key) ||
|
|
2518
|
-
hasOwn(appContext.config.globalProperties, key));
|
|
2519
|
-
}
|
|
2520
|
-
};
|
|
2521
|
-
if ((process.env.NODE_ENV !== 'production') && !false) {
|
|
2522
|
-
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
2523
|
-
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
2524
|
-
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
2525
|
-
return Reflect.ownKeys(target);
|
|
2526
|
-
};
|
|
2527
|
-
}
|
|
2528
|
-
const RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {
|
|
2529
|
-
get(target, key) {
|
|
2530
|
-
// fast path for unscopables when using `with` block
|
|
2531
|
-
if (key === Symbol.unscopables) {
|
|
2532
|
-
return;
|
|
2533
|
-
}
|
|
2534
|
-
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
2535
|
-
},
|
|
2536
|
-
has(_, key) {
|
|
2537
|
-
const has = key[0] !== '_' && !isGloballyWhitelisted(key);
|
|
2538
|
-
if ((process.env.NODE_ENV !== 'production') && !has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
2539
|
-
warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
|
|
2540
|
-
}
|
|
2541
|
-
return has;
|
|
2542
|
-
}
|
|
2543
|
-
});
|
|
2544
|
-
let currentInstance = null;
|
|
2545
|
-
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
2546
|
-
const setCurrentInstance = (instance) => {
|
|
2547
|
-
currentInstance = instance;
|
|
2548
|
-
};
|
|
2549
|
-
const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
2550
|
-
let isInSSRComponentSetup = false;
|
|
2551
|
-
// record effects created during a component's setup() so that they can be
|
|
2552
|
-
// stopped when the component unmounts
|
|
2553
|
-
function recordInstanceBoundEffect(effect$$1) {
|
|
2554
|
-
if (currentInstance) {
|
|
2555
|
-
(currentInstance.effects || (currentInstance.effects = [])).push(effect$$1);
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
2559
|
-
const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
|
|
2560
|
-
/* istanbul ignore next */
|
|
2561
|
-
function formatComponentName(instance, Component, isRoot = false) {
|
|
2562
|
-
let name = isFunction(Component)
|
|
2563
|
-
? Component.displayName || Component.name
|
|
2564
|
-
: Component.name;
|
|
2565
|
-
if (!name && Component.__file) {
|
|
2566
|
-
const match = Component.__file.match(/([^/\\]+)\.vue$/);
|
|
2567
|
-
if (match) {
|
|
2568
|
-
name = match[1];
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
if (!name && instance && instance.parent) {
|
|
2572
|
-
// try to infer the name based on reverse resolution
|
|
2573
|
-
const inferFromRegistry = (registry) => {
|
|
2574
|
-
for (const key in registry) {
|
|
2575
|
-
if (registry[key] === Component) {
|
|
2576
|
-
return key;
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
name =
|
|
2581
|
-
inferFromRegistry(instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
|
|
2582
|
-
}
|
|
2583
|
-
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
|
-
// implementation, close to no-op
|
|
2587
|
-
function defineComponent(options) {
|
|
2588
|
-
return isFunction(options) ? { setup: options, name: options.name } : options;
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
|
-
// Actual implementation
|
|
2592
|
-
function h(type, propsOrChildren, children) {
|
|
2593
|
-
if (arguments.length === 2) {
|
|
2594
|
-
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
|
|
2595
|
-
// single vnode without props
|
|
2596
|
-
if (isVNode(propsOrChildren)) {
|
|
2597
|
-
return createVNode(type, null, [propsOrChildren]);
|
|
2598
|
-
}
|
|
2599
|
-
// props without children
|
|
2600
|
-
return createVNode(type, propsOrChildren);
|
|
2601
|
-
}
|
|
2602
|
-
else {
|
|
2603
|
-
// omit props
|
|
2604
|
-
return createVNode(type, null, propsOrChildren);
|
|
2605
|
-
}
|
|
2606
|
-
}
|
|
2607
|
-
else {
|
|
2608
|
-
if (isVNode(children)) {
|
|
2609
|
-
children = [children];
|
|
2610
|
-
}
|
|
2611
|
-
return createVNode(type, propsOrChildren, children);
|
|
2612
|
-
}
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
const ssrContextKey = Symbol((process.env.NODE_ENV !== 'production') ? `ssrContext` : ``);
|
|
2616
|
-
|
|
2617
|
-
const svgNS = 'http://www.w3.org/2000/svg';
|
|
2618
|
-
const doc = (typeof document !== 'undefined' ? document : null);
|
|
2619
|
-
let tempContainer;
|
|
2620
|
-
let tempSVGContainer;
|
|
2621
|
-
const nodeOps = {
|
|
2622
|
-
insert: (child, parent, anchor) => {
|
|
2623
|
-
parent.insertBefore(child, anchor || null);
|
|
2624
|
-
},
|
|
2625
|
-
remove: child => {
|
|
2626
|
-
const parent = child.parentNode;
|
|
2627
|
-
if (parent) {
|
|
2628
|
-
parent.removeChild(child);
|
|
2629
|
-
}
|
|
2630
|
-
},
|
|
2631
|
-
createElement: (tag, isSVG, is) => isSVG
|
|
2632
|
-
? doc.createElementNS(svgNS, tag)
|
|
2633
|
-
: doc.createElement(tag, is ? { is } : undefined),
|
|
2634
|
-
createText: text => doc.createTextNode(text),
|
|
2635
|
-
createComment: text => doc.createComment(text),
|
|
2636
|
-
setText: (node, text) => {
|
|
2637
|
-
node.nodeValue = text;
|
|
2638
|
-
},
|
|
2639
|
-
setElementText: (el, text) => {
|
|
2640
|
-
el.textContent = text;
|
|
2641
|
-
},
|
|
2642
|
-
parentNode: node => node.parentNode,
|
|
2643
|
-
nextSibling: node => node.nextSibling,
|
|
2644
|
-
querySelector: selector => doc.querySelector(selector),
|
|
2645
|
-
setScopeId(el, id) {
|
|
2646
|
-
el.setAttribute(id, '');
|
|
2647
|
-
},
|
|
2648
|
-
cloneNode(el) {
|
|
2649
|
-
return el.cloneNode(true);
|
|
2650
|
-
},
|
|
2651
|
-
// __UNSAFE__
|
|
2652
|
-
// Reason: innerHTML.
|
|
2653
|
-
// Static content here can only come from compiled templates.
|
|
2654
|
-
// As long as the user only uses trusted templates, this is safe.
|
|
2655
|
-
insertStaticContent(content, parent, anchor, isSVG) {
|
|
2656
|
-
const temp = isSVG
|
|
2657
|
-
? tempSVGContainer ||
|
|
2658
|
-
(tempSVGContainer = doc.createElementNS(svgNS, 'svg'))
|
|
2659
|
-
: tempContainer || (tempContainer = doc.createElement('div'));
|
|
2660
|
-
temp.innerHTML = content;
|
|
2661
|
-
const first = temp.firstChild;
|
|
2662
|
-
let node = first;
|
|
2663
|
-
let last = node;
|
|
2664
|
-
while (node) {
|
|
2665
|
-
last = node;
|
|
2666
|
-
nodeOps.insert(node, parent, anchor);
|
|
2667
|
-
node = temp.firstChild;
|
|
2668
|
-
}
|
|
2669
|
-
return [first, last];
|
|
2670
|
-
}
|
|
2671
|
-
};
|
|
2672
|
-
|
|
2673
|
-
// compiler should normalize class + :class bindings on the same element
|
|
2674
|
-
// into a single binding ['staticClass', dynamic]
|
|
2675
|
-
function patchClass(el, value, isSVG) {
|
|
2676
|
-
if (value == null) {
|
|
2677
|
-
value = '';
|
|
2678
|
-
}
|
|
2679
|
-
if (isSVG) {
|
|
2680
|
-
el.setAttribute('class', value);
|
|
2681
|
-
}
|
|
2682
|
-
else {
|
|
2683
|
-
// directly setting className should be faster than setAttribute in theory
|
|
2684
|
-
// if this is an element during a transition, take the temporary transition
|
|
2685
|
-
// classes into account.
|
|
2686
|
-
const transitionClasses = el._vtc;
|
|
2687
|
-
if (transitionClasses) {
|
|
2688
|
-
value = (value
|
|
2689
|
-
? [value, ...transitionClasses]
|
|
2690
|
-
: [...transitionClasses]).join(' ');
|
|
2691
|
-
}
|
|
2692
|
-
el.className = value;
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
function patchStyle(el, prev, next) {
|
|
2697
|
-
const style = el.style;
|
|
2698
|
-
if (!next) {
|
|
2699
|
-
el.removeAttribute('style');
|
|
2700
|
-
}
|
|
2701
|
-
else if (isString(next)) {
|
|
2702
|
-
if (prev !== next) {
|
|
2703
|
-
style.cssText = next;
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
else {
|
|
2707
|
-
for (const key in next) {
|
|
2708
|
-
setStyle(style, key, next[key]);
|
|
2709
|
-
}
|
|
2710
|
-
if (prev && !isString(prev)) {
|
|
2711
|
-
for (const key in prev) {
|
|
2712
|
-
if (next[key] == null) {
|
|
2713
|
-
setStyle(style, key, '');
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
const importantRE = /\s*!important$/;
|
|
2720
|
-
function setStyle(style, name, val) {
|
|
2721
|
-
if (isArray(val)) {
|
|
2722
|
-
val.forEach(v => setStyle(style, name, v));
|
|
2723
|
-
}
|
|
2724
|
-
else {
|
|
2725
|
-
if (name.startsWith('--')) {
|
|
2726
|
-
// custom property definition
|
|
2727
|
-
style.setProperty(name, val);
|
|
2728
|
-
}
|
|
2729
|
-
else {
|
|
2730
|
-
const prefixed = autoPrefix(style, name);
|
|
2731
|
-
if (importantRE.test(val)) {
|
|
2732
|
-
// !important
|
|
2733
|
-
style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important');
|
|
2734
|
-
}
|
|
2735
|
-
else {
|
|
2736
|
-
style[prefixed] = val;
|
|
2737
|
-
}
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
}
|
|
2741
|
-
const prefixes = ['Webkit', 'Moz', 'ms'];
|
|
2742
|
-
const prefixCache = {};
|
|
2743
|
-
function autoPrefix(style, rawName) {
|
|
2744
|
-
const cached = prefixCache[rawName];
|
|
2745
|
-
if (cached) {
|
|
2746
|
-
return cached;
|
|
2747
|
-
}
|
|
2748
|
-
let name = camelize(rawName);
|
|
2749
|
-
if (name !== 'filter' && name in style) {
|
|
2750
|
-
return (prefixCache[rawName] = name);
|
|
2751
|
-
}
|
|
2752
|
-
name = capitalize(name);
|
|
2753
|
-
for (let i = 0; i < prefixes.length; i++) {
|
|
2754
|
-
const prefixed = prefixes[i] + name;
|
|
2755
|
-
if (prefixed in style) {
|
|
2756
|
-
return (prefixCache[rawName] = prefixed);
|
|
2757
|
-
}
|
|
2758
|
-
}
|
|
2759
|
-
return rawName;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
|
-
const xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
2763
|
-
function patchAttr(el, key, value, isSVG) {
|
|
2764
|
-
if (isSVG && key.startsWith('xlink:')) {
|
|
2765
|
-
if (value == null) {
|
|
2766
|
-
el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
2767
|
-
}
|
|
2768
|
-
else {
|
|
2769
|
-
el.setAttributeNS(xlinkNS, key, value);
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
else {
|
|
2773
|
-
// note we are only checking boolean attributes that don't have a
|
|
2774
|
-
// corresponding dom prop of the same name here.
|
|
2775
|
-
const isBoolean = isSpecialBooleanAttr(key);
|
|
2776
|
-
if (value == null || (isBoolean && value === false)) {
|
|
2777
|
-
el.removeAttribute(key);
|
|
2778
|
-
}
|
|
2779
|
-
else {
|
|
2780
|
-
el.setAttribute(key, isBoolean ? '' : value);
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
|
-
|
|
2785
|
-
// __UNSAFE__
|
|
2786
|
-
// functions. The user is responsible for using them with only trusted content.
|
|
2787
|
-
function patchDOMProp(el, key, value,
|
|
2788
|
-
// the following args are passed only due to potential innerHTML/textContent
|
|
2789
|
-
// overriding existing VNodes, in which case the old tree must be properly
|
|
2790
|
-
// unmounted.
|
|
2791
|
-
prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
2792
|
-
if (key === 'innerHTML' || key === 'textContent') {
|
|
2793
|
-
if (prevChildren) {
|
|
2794
|
-
unmountChildren(prevChildren, parentComponent, parentSuspense);
|
|
2795
|
-
}
|
|
2796
|
-
el[key] = value == null ? '' : value;
|
|
2797
|
-
return;
|
|
2798
|
-
}
|
|
2799
|
-
if (key === 'value' && el.tagName !== 'PROGRESS') {
|
|
2800
|
-
// store value as _value as well since
|
|
2801
|
-
// non-string values will be stringified.
|
|
2802
|
-
el._value = value;
|
|
2803
|
-
el.value = value == null ? '' : value;
|
|
2804
|
-
return;
|
|
2805
|
-
}
|
|
2806
|
-
if (value === '' && typeof el[key] === 'boolean') {
|
|
2807
|
-
// e.g. <select multiple> compiles to { multiple: '' }
|
|
2808
|
-
el[key] = true;
|
|
2809
|
-
}
|
|
2810
|
-
else if (value == null && typeof el[key] === 'string') {
|
|
2811
|
-
// e.g. <div :id="null">
|
|
2812
|
-
el[key] = '';
|
|
2813
|
-
el.removeAttribute(key);
|
|
2814
|
-
}
|
|
2815
|
-
else {
|
|
2816
|
-
// some properties perform value validation and throw
|
|
2817
|
-
try {
|
|
2818
|
-
el[key] = value;
|
|
2819
|
-
}
|
|
2820
|
-
catch (e) {
|
|
2821
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
2822
|
-
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
2823
|
-
`value ${value} is invalid.`, e);
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
|
|
2829
|
-
// Async edge case fix requires storing an event listener's attach timestamp.
|
|
2830
|
-
let _getNow = Date.now;
|
|
2831
|
-
// Determine what event timestamp the browser is using. Annoyingly, the
|
|
2832
|
-
// timestamp can either be hi-res (relative to page load) or low-res
|
|
2833
|
-
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
2834
|
-
// same timestamp type when saving the flush timestamp.
|
|
2835
|
-
if (typeof document !== 'undefined' &&
|
|
2836
|
-
_getNow() > document.createEvent('Event').timeStamp) {
|
|
2837
|
-
// if the low-res timestamp which is bigger than the event timestamp
|
|
2838
|
-
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
2839
|
-
// and we need to use the hi-res version for event listeners as well.
|
|
2840
|
-
_getNow = () => performance.now();
|
|
2841
|
-
}
|
|
2842
|
-
// To avoid the overhead of repeatedly calling performance.now(), we cache
|
|
2843
|
-
// and use the same timestamp for all event listeners attached in the same tick.
|
|
2844
|
-
let cachedNow = 0;
|
|
2845
|
-
const p = Promise.resolve();
|
|
2846
|
-
const reset = () => {
|
|
2847
|
-
cachedNow = 0;
|
|
2848
|
-
};
|
|
2849
|
-
const getNow = () => cachedNow || (p.then(reset), cachedNow = _getNow());
|
|
2850
|
-
function addEventListener(el, event, handler, options) {
|
|
2851
|
-
el.addEventListener(event, handler, options);
|
|
2852
|
-
}
|
|
2853
|
-
function removeEventListener(el, event, handler, options) {
|
|
2854
|
-
el.removeEventListener(event, handler, options);
|
|
2855
|
-
}
|
|
2856
|
-
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
2857
|
-
// vei = vue event invokers
|
|
2858
|
-
const invokers = el._vei || (el._vei = {});
|
|
2859
|
-
const existingInvoker = invokers[rawName];
|
|
2860
|
-
if (nextValue && existingInvoker) {
|
|
2861
|
-
// patch
|
|
2862
|
-
existingInvoker.value = nextValue;
|
|
2863
|
-
}
|
|
2864
|
-
else {
|
|
2865
|
-
const [name, options] = parseName(rawName);
|
|
2866
|
-
if (nextValue) {
|
|
2867
|
-
// add
|
|
2868
|
-
const invoker = (invokers[rawName] = createInvoker(nextValue, instance));
|
|
2869
|
-
addEventListener(el, name, invoker, options);
|
|
2870
|
-
}
|
|
2871
|
-
else if (existingInvoker) {
|
|
2872
|
-
// remove
|
|
2873
|
-
removeEventListener(el, name, existingInvoker, options);
|
|
2874
|
-
invokers[rawName] = undefined;
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
|
|
2879
|
-
function parseName(name) {
|
|
2880
|
-
let options;
|
|
2881
|
-
if (optionsModifierRE.test(name)) {
|
|
2882
|
-
options = {};
|
|
2883
|
-
let m;
|
|
2884
|
-
while ((m = name.match(optionsModifierRE))) {
|
|
2885
|
-
name = name.slice(0, name.length - m[0].length);
|
|
2886
|
-
options[m[0].toLowerCase()] = true;
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
return [name.slice(2).toLowerCase(), options];
|
|
2890
|
-
}
|
|
2891
|
-
function createInvoker(initialValue, instance) {
|
|
2892
|
-
const invoker = (e) => {
|
|
2893
|
-
// async edge case #6566: inner click event triggers patch, event handler
|
|
2894
|
-
// attached to outer element during patch, and triggered again. This
|
|
2895
|
-
// happens because browsers fire microtask ticks between event propagation.
|
|
2896
|
-
// the solution is simple: we save the timestamp when a handler is attached,
|
|
2897
|
-
// and the handler would only fire if the event passed to it was fired
|
|
2898
|
-
// AFTER it was attached.
|
|
2899
|
-
const timeStamp = e.timeStamp || _getNow();
|
|
2900
|
-
if (timeStamp >= invoker.attached - 1) {
|
|
2901
|
-
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
|
|
2902
|
-
}
|
|
2903
|
-
};
|
|
2904
|
-
invoker.value = initialValue;
|
|
2905
|
-
invoker.attached = getNow();
|
|
2906
|
-
return invoker;
|
|
2907
|
-
}
|
|
2908
|
-
function patchStopImmediatePropagation(e, value) {
|
|
2909
|
-
if (isArray(value)) {
|
|
2910
|
-
const originalStop = e.stopImmediatePropagation;
|
|
2911
|
-
e.stopImmediatePropagation = () => {
|
|
2912
|
-
originalStop.call(e);
|
|
2913
|
-
e._stopped = true;
|
|
2914
|
-
};
|
|
2915
|
-
return value.map(fn => (e) => !e._stopped && fn(e));
|
|
2916
|
-
}
|
|
2917
|
-
else {
|
|
2918
|
-
return value;
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
|
|
2922
|
-
const nativeOnRE = /^on[a-z]/;
|
|
2923
|
-
const forcePatchProp = (_, key) => key === 'value';
|
|
2924
|
-
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
2925
|
-
switch (key) {
|
|
2926
|
-
// special
|
|
2927
|
-
case 'class':
|
|
2928
|
-
patchClass(el, nextValue, isSVG);
|
|
2929
|
-
break;
|
|
2930
|
-
case 'style':
|
|
2931
|
-
patchStyle(el, prevValue, nextValue);
|
|
2932
|
-
break;
|
|
2933
|
-
default:
|
|
2934
|
-
if (isOn(key)) {
|
|
2935
|
-
// ignore v-model listeners
|
|
2936
|
-
if (!isModelListener(key)) {
|
|
2937
|
-
patchEvent(el, key, prevValue, nextValue, parentComponent);
|
|
2938
|
-
}
|
|
2939
|
-
}
|
|
2940
|
-
else if (shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
2941
|
-
patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);
|
|
2942
|
-
}
|
|
2943
|
-
else {
|
|
2944
|
-
// special case for <input v-model type="checkbox"> with
|
|
2945
|
-
// :true-value & :false-value
|
|
2946
|
-
// store value as dom properties since non-string values will be
|
|
2947
|
-
// stringified.
|
|
2948
|
-
if (key === 'true-value') {
|
|
2949
|
-
el._trueValue = nextValue;
|
|
2950
|
-
}
|
|
2951
|
-
else if (key === 'false-value') {
|
|
2952
|
-
el._falseValue = nextValue;
|
|
2953
|
-
}
|
|
2954
|
-
patchAttr(el, key, nextValue, isSVG);
|
|
2955
|
-
}
|
|
2956
|
-
break;
|
|
2957
|
-
}
|
|
2958
|
-
};
|
|
2959
|
-
function shouldSetAsProp(el, key, value, isSVG) {
|
|
2960
|
-
if (isSVG) {
|
|
2961
|
-
// most keys must be set as attribute on svg elements to work
|
|
2962
|
-
// ...except innerHTML
|
|
2963
|
-
if (key === 'innerHTML') {
|
|
2964
|
-
return true;
|
|
2965
|
-
}
|
|
2966
|
-
// or native onclick with function values
|
|
2967
|
-
if (key in el && nativeOnRE.test(key) && isFunction(value)) {
|
|
2968
|
-
return true;
|
|
2969
|
-
}
|
|
2970
|
-
return false;
|
|
2971
|
-
}
|
|
2972
|
-
// spellcheck and draggable are numerated attrs, however their
|
|
2973
|
-
// corresponding DOM properties are actually booleans - this leads to
|
|
2974
|
-
// setting it with a string "false" value leading it to be coerced to
|
|
2975
|
-
// `true`, so we need to always treat them as attributes.
|
|
2976
|
-
// Note that `contentEditable` doesn't have this problem: its DOM
|
|
2977
|
-
// property is also enumerated string values.
|
|
2978
|
-
if (key === 'spellcheck' || key === 'draggable') {
|
|
2979
|
-
return false;
|
|
2980
|
-
}
|
|
2981
|
-
// #1787 form as an attribute must be a string, while it accepts an Element as
|
|
2982
|
-
// a prop
|
|
2983
|
-
if (key === 'form' && typeof value === 'string') {
|
|
2984
|
-
return false;
|
|
2985
|
-
}
|
|
2986
|
-
// #1526 <input list> must be set as attribute
|
|
2987
|
-
if (key === 'list' && el.tagName === 'INPUT') {
|
|
2988
|
-
return false;
|
|
2989
|
-
}
|
|
2990
|
-
// native onclick with string value, must be set as attribute
|
|
2991
|
-
if (nativeOnRE.test(key) && isString(value)) {
|
|
2992
|
-
return false;
|
|
2993
|
-
}
|
|
2994
|
-
return key in el;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
|
-
const TRANSITION = 'transition';
|
|
2998
|
-
const ANIMATION = 'animation';
|
|
2999
|
-
// DOM Transition is a higher-order-component based on the platform-agnostic
|
|
3000
|
-
// base Transition component, with DOM-specific logic.
|
|
3001
|
-
const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
|
|
3002
|
-
Transition.displayName = 'Transition';
|
|
3003
|
-
const DOMTransitionPropsValidators = {
|
|
3004
|
-
name: String,
|
|
3005
|
-
type: String,
|
|
3006
|
-
css: {
|
|
3007
|
-
type: Boolean,
|
|
3008
|
-
default: true
|
|
3009
|
-
},
|
|
3010
|
-
duration: [String, Number, Object],
|
|
3011
|
-
enterFromClass: String,
|
|
3012
|
-
enterActiveClass: String,
|
|
3013
|
-
enterToClass: String,
|
|
3014
|
-
appearFromClass: String,
|
|
3015
|
-
appearActiveClass: String,
|
|
3016
|
-
appearToClass: String,
|
|
3017
|
-
leaveFromClass: String,
|
|
3018
|
-
leaveActiveClass: String,
|
|
3019
|
-
leaveToClass: String
|
|
3020
|
-
};
|
|
3021
|
-
const TransitionPropsValidators = (Transition.props = /*#__PURE__*/ extend({}, BaseTransition.props, DOMTransitionPropsValidators));
|
|
3022
|
-
function resolveTransitionProps(rawProps) {
|
|
3023
|
-
let { name = 'v', type, css = true, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
|
|
3024
|
-
const baseProps = {};
|
|
3025
|
-
for (const key in rawProps) {
|
|
3026
|
-
if (!(key in DOMTransitionPropsValidators)) {
|
|
3027
|
-
baseProps[key] = rawProps[key];
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
if (!css) {
|
|
3031
|
-
return baseProps;
|
|
3032
|
-
}
|
|
3033
|
-
const durations = normalizeDuration(duration);
|
|
3034
|
-
const enterDuration = durations && durations[0];
|
|
3035
|
-
const leaveDuration = durations && durations[1];
|
|
3036
|
-
const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;
|
|
3037
|
-
const finishEnter = (el, isAppear, done) => {
|
|
3038
|
-
removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
3039
|
-
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
3040
|
-
done && done();
|
|
3041
|
-
};
|
|
3042
|
-
const finishLeave = (el, done) => {
|
|
3043
|
-
removeTransitionClass(el, leaveToClass);
|
|
3044
|
-
removeTransitionClass(el, leaveActiveClass);
|
|
3045
|
-
done && done();
|
|
3046
|
-
};
|
|
3047
|
-
const makeEnterHook = (isAppear) => {
|
|
3048
|
-
return (el, done) => {
|
|
3049
|
-
const hook = isAppear ? onAppear : onEnter;
|
|
3050
|
-
const resolve = () => finishEnter(el, isAppear, done);
|
|
3051
|
-
hook && hook(el, resolve);
|
|
3052
|
-
nextFrame(() => {
|
|
3053
|
-
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
3054
|
-
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
3055
|
-
if (!(hook && hook.length > 1)) {
|
|
3056
|
-
if (enterDuration) {
|
|
3057
|
-
setTimeout(resolve, enterDuration);
|
|
3058
|
-
}
|
|
3059
|
-
else {
|
|
3060
|
-
whenTransitionEnds(el, type, resolve);
|
|
3061
|
-
}
|
|
3062
|
-
}
|
|
3063
|
-
});
|
|
3064
|
-
};
|
|
3065
|
-
};
|
|
3066
|
-
return extend(baseProps, {
|
|
3067
|
-
onBeforeEnter(el) {
|
|
3068
|
-
onBeforeEnter && onBeforeEnter(el);
|
|
3069
|
-
addTransitionClass(el, enterActiveClass);
|
|
3070
|
-
addTransitionClass(el, enterFromClass);
|
|
3071
|
-
},
|
|
3072
|
-
onBeforeAppear(el) {
|
|
3073
|
-
onBeforeAppear && onBeforeAppear(el);
|
|
3074
|
-
addTransitionClass(el, appearActiveClass);
|
|
3075
|
-
addTransitionClass(el, appearFromClass);
|
|
3076
|
-
},
|
|
3077
|
-
onEnter: makeEnterHook(false),
|
|
3078
|
-
onAppear: makeEnterHook(true),
|
|
3079
|
-
onLeave(el, done) {
|
|
3080
|
-
const resolve = () => finishLeave(el, done);
|
|
3081
|
-
addTransitionClass(el, leaveActiveClass);
|
|
3082
|
-
addTransitionClass(el, leaveFromClass);
|
|
3083
|
-
nextFrame(() => {
|
|
3084
|
-
removeTransitionClass(el, leaveFromClass);
|
|
3085
|
-
addTransitionClass(el, leaveToClass);
|
|
3086
|
-
if (!(onLeave && onLeave.length > 1)) {
|
|
3087
|
-
if (leaveDuration) {
|
|
3088
|
-
setTimeout(resolve, leaveDuration);
|
|
3089
|
-
}
|
|
3090
|
-
else {
|
|
3091
|
-
whenTransitionEnds(el, type, resolve);
|
|
3092
|
-
}
|
|
3093
|
-
}
|
|
3094
|
-
});
|
|
3095
|
-
onLeave && onLeave(el, resolve);
|
|
3096
|
-
},
|
|
3097
|
-
onEnterCancelled(el) {
|
|
3098
|
-
finishEnter(el, false);
|
|
3099
|
-
onEnterCancelled && onEnterCancelled(el);
|
|
3100
|
-
},
|
|
3101
|
-
onAppearCancelled(el) {
|
|
3102
|
-
finishEnter(el, true);
|
|
3103
|
-
onAppearCancelled && onAppearCancelled(el);
|
|
3104
|
-
},
|
|
3105
|
-
onLeaveCancelled(el) {
|
|
3106
|
-
finishLeave(el);
|
|
3107
|
-
onLeaveCancelled && onLeaveCancelled(el);
|
|
3108
|
-
}
|
|
3109
|
-
});
|
|
3110
|
-
}
|
|
3111
|
-
function normalizeDuration(duration) {
|
|
3112
|
-
if (duration == null) {
|
|
3113
|
-
return null;
|
|
3114
|
-
}
|
|
3115
|
-
else if (isObject(duration)) {
|
|
3116
|
-
return [NumberOf(duration.enter), NumberOf(duration.leave)];
|
|
3117
|
-
}
|
|
3118
|
-
else {
|
|
3119
|
-
const n = NumberOf(duration);
|
|
3120
|
-
return [n, n];
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
function NumberOf(val) {
|
|
3124
|
-
const res = toNumber(val);
|
|
3125
|
-
if ((process.env.NODE_ENV !== 'production'))
|
|
3126
|
-
validateDuration(res);
|
|
3127
|
-
return res;
|
|
3128
|
-
}
|
|
3129
|
-
function validateDuration(val) {
|
|
3130
|
-
if (typeof val !== 'number') {
|
|
3131
|
-
warn(`<transition> explicit duration is not a valid number - ` +
|
|
3132
|
-
`got ${JSON.stringify(val)}.`);
|
|
3133
|
-
}
|
|
3134
|
-
else if (isNaN(val)) {
|
|
3135
|
-
warn(`<transition> explicit duration is NaN - ` +
|
|
3136
|
-
'the duration expression might be incorrect.');
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
function addTransitionClass(el, cls) {
|
|
3140
|
-
cls.split(/\s+/).forEach(c => c && el.classList.add(c));
|
|
3141
|
-
(el._vtc ||
|
|
3142
|
-
(el._vtc = new Set())).add(cls);
|
|
3143
|
-
}
|
|
3144
|
-
function removeTransitionClass(el, cls) {
|
|
3145
|
-
cls.split(/\s+/).forEach(c => c && el.classList.remove(c));
|
|
3146
|
-
const { _vtc } = el;
|
|
3147
|
-
if (_vtc) {
|
|
3148
|
-
_vtc.delete(cls);
|
|
3149
|
-
if (!_vtc.size) {
|
|
3150
|
-
el._vtc = undefined;
|
|
3151
|
-
}
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
function nextFrame(cb) {
|
|
3155
|
-
requestAnimationFrame(() => {
|
|
3156
|
-
requestAnimationFrame(cb);
|
|
3157
|
-
});
|
|
3158
|
-
}
|
|
3159
|
-
function whenTransitionEnds(el, expectedType, cb) {
|
|
3160
|
-
const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
|
|
3161
|
-
if (!type) {
|
|
3162
|
-
return cb();
|
|
3163
|
-
}
|
|
3164
|
-
const endEvent = type + 'end';
|
|
3165
|
-
let ended = 0;
|
|
3166
|
-
const end = () => {
|
|
3167
|
-
el.removeEventListener(endEvent, onEnd);
|
|
3168
|
-
cb();
|
|
3169
|
-
};
|
|
3170
|
-
const onEnd = (e) => {
|
|
3171
|
-
if (e.target === el) {
|
|
3172
|
-
if (++ended >= propCount) {
|
|
3173
|
-
end();
|
|
3174
|
-
}
|
|
3175
|
-
}
|
|
3176
|
-
};
|
|
3177
|
-
setTimeout(() => {
|
|
3178
|
-
if (ended < propCount) {
|
|
3179
|
-
end();
|
|
3180
|
-
}
|
|
3181
|
-
}, timeout + 1);
|
|
3182
|
-
el.addEventListener(endEvent, onEnd);
|
|
3183
|
-
}
|
|
3184
|
-
function getTransitionInfo(el, expectedType) {
|
|
3185
|
-
const styles = window.getComputedStyle(el);
|
|
3186
|
-
// JSDOM may return undefined for transition properties
|
|
3187
|
-
const getStyleProperties = (key) => (styles[key] || '').split(', ');
|
|
3188
|
-
const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
|
|
3189
|
-
const transitionDurations = getStyleProperties(TRANSITION + 'Duration');
|
|
3190
|
-
const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
|
3191
|
-
const animationDelays = getStyleProperties(ANIMATION + 'Delay');
|
|
3192
|
-
const animationDurations = getStyleProperties(ANIMATION + 'Duration');
|
|
3193
|
-
const animationTimeout = getTimeout(animationDelays, animationDurations);
|
|
3194
|
-
let type = null;
|
|
3195
|
-
let timeout = 0;
|
|
3196
|
-
let propCount = 0;
|
|
3197
|
-
/* istanbul ignore if */
|
|
3198
|
-
if (expectedType === TRANSITION) {
|
|
3199
|
-
if (transitionTimeout > 0) {
|
|
3200
|
-
type = TRANSITION;
|
|
3201
|
-
timeout = transitionTimeout;
|
|
3202
|
-
propCount = transitionDurations.length;
|
|
3203
|
-
}
|
|
3204
|
-
}
|
|
3205
|
-
else if (expectedType === ANIMATION) {
|
|
3206
|
-
if (animationTimeout > 0) {
|
|
3207
|
-
type = ANIMATION;
|
|
3208
|
-
timeout = animationTimeout;
|
|
3209
|
-
propCount = animationDurations.length;
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
else {
|
|
3213
|
-
timeout = Math.max(transitionTimeout, animationTimeout);
|
|
3214
|
-
type =
|
|
3215
|
-
timeout > 0
|
|
3216
|
-
? transitionTimeout > animationTimeout
|
|
3217
|
-
? TRANSITION
|
|
3218
|
-
: ANIMATION
|
|
3219
|
-
: null;
|
|
3220
|
-
propCount = type
|
|
3221
|
-
? type === TRANSITION
|
|
3222
|
-
? transitionDurations.length
|
|
3223
|
-
: animationDurations.length
|
|
3224
|
-
: 0;
|
|
3225
|
-
}
|
|
3226
|
-
const hasTransform = type === TRANSITION &&
|
|
3227
|
-
/\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);
|
|
3228
|
-
return {
|
|
3229
|
-
type,
|
|
3230
|
-
timeout,
|
|
3231
|
-
propCount,
|
|
3232
|
-
hasTransform
|
|
3233
|
-
};
|
|
3234
|
-
}
|
|
3235
|
-
function getTimeout(delays, durations) {
|
|
3236
|
-
while (delays.length < durations.length) {
|
|
3237
|
-
delays = delays.concat(delays);
|
|
3238
|
-
}
|
|
3239
|
-
return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
|
|
3240
|
-
}
|
|
3241
|
-
// Old versions of Chromium (below 61.0.3163.100) formats floating pointer
|
|
3242
|
-
// numbers in a locale-dependent way, using a comma instead of a dot.
|
|
3243
|
-
// If comma is not replaced with a dot, the input will be rounded down
|
|
3244
|
-
// (i.e. acting as a floor function) causing unexpected behaviors
|
|
3245
|
-
function toMs(s) {
|
|
3246
|
-
return Number(s.slice(0, -1).replace(',', '.')) * 1000;
|
|
3247
|
-
}
|
|
3248
|
-
|
|
3249
|
-
function toRaw$1(observed) {
|
|
3250
|
-
return ((observed && toRaw$1(observed["__v_raw" /* RAW */])) || observed);
|
|
3251
|
-
}
|
|
3252
|
-
|
|
3253
|
-
const positionMap = new WeakMap();
|
|
3254
|
-
const newPositionMap = new WeakMap();
|
|
3255
|
-
const TransitionGroupImpl = {
|
|
3256
|
-
name: 'TransitionGroup',
|
|
3257
|
-
props: /*#__PURE__*/ extend({}, TransitionPropsValidators, {
|
|
3258
|
-
tag: String,
|
|
3259
|
-
moveClass: String
|
|
3260
|
-
}),
|
|
3261
|
-
setup(props, { slots }) {
|
|
3262
|
-
const instance = getCurrentInstance();
|
|
3263
|
-
const state = useTransitionState();
|
|
3264
|
-
let prevChildren;
|
|
3265
|
-
let children;
|
|
3266
|
-
onUpdated(() => {
|
|
3267
|
-
// children is guaranteed to exist after initial render
|
|
3268
|
-
if (!prevChildren.length) {
|
|
3269
|
-
return;
|
|
3270
|
-
}
|
|
3271
|
-
const moveClass = props.moveClass || `${props.name || 'v'}-move`;
|
|
3272
|
-
if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
|
|
3273
|
-
return;
|
|
3274
|
-
}
|
|
3275
|
-
// we divide the work into three loops to avoid mixing DOM reads and writes
|
|
3276
|
-
// in each iteration - which helps prevent layout thrashing.
|
|
3277
|
-
prevChildren.forEach(callPendingCbs);
|
|
3278
|
-
prevChildren.forEach(recordPosition);
|
|
3279
|
-
const movedChildren = prevChildren.filter(applyTranslation);
|
|
3280
|
-
// force reflow to put everything in position
|
|
3281
|
-
forceReflow();
|
|
3282
|
-
movedChildren.forEach(c => {
|
|
3283
|
-
const el = c.el;
|
|
3284
|
-
const style = el.style;
|
|
3285
|
-
addTransitionClass(el, moveClass);
|
|
3286
|
-
style.transform = style.webkitTransform = style.transitionDuration = '';
|
|
3287
|
-
const cb = (el._moveCb = (e) => {
|
|
3288
|
-
if (e && e.target !== el) {
|
|
3289
|
-
return;
|
|
3290
|
-
}
|
|
3291
|
-
if (!e || /transform$/.test(e.propertyName)) {
|
|
3292
|
-
el.removeEventListener('transitionend', cb);
|
|
3293
|
-
el._moveCb = null;
|
|
3294
|
-
removeTransitionClass(el, moveClass);
|
|
3295
|
-
}
|
|
3296
|
-
});
|
|
3297
|
-
el.addEventListener('transitionend', cb);
|
|
3298
|
-
});
|
|
3299
|
-
});
|
|
3300
|
-
return () => {
|
|
3301
|
-
const rawProps = toRaw$1(props);
|
|
3302
|
-
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
3303
|
-
const tag = rawProps.tag || Fragment;
|
|
3304
|
-
prevChildren = children;
|
|
3305
|
-
children = slots.default ? getTransitionRawChildren(slots.default()) : [];
|
|
3306
|
-
for (let i = 0; i < children.length; i++) {
|
|
3307
|
-
const child = children[i];
|
|
3308
|
-
if (child.key != null) {
|
|
3309
|
-
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
3310
|
-
}
|
|
3311
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
3312
|
-
warn(`<TransitionGroup> children must be keyed.`);
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
if (prevChildren) {
|
|
3316
|
-
for (let i = 0; i < prevChildren.length; i++) {
|
|
3317
|
-
const child = prevChildren[i];
|
|
3318
|
-
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
3319
|
-
positionMap.set(child, child.el.getBoundingClientRect());
|
|
3320
|
-
}
|
|
3321
|
-
}
|
|
3322
|
-
return createVNode(tag, null, children);
|
|
3323
|
-
};
|
|
3324
|
-
}
|
|
3325
|
-
};
|
|
3326
|
-
function callPendingCbs(c) {
|
|
3327
|
-
const el = c.el;
|
|
3328
|
-
if (el._moveCb) {
|
|
3329
|
-
el._moveCb();
|
|
3330
|
-
}
|
|
3331
|
-
if (el._enterCb) {
|
|
3332
|
-
el._enterCb();
|
|
3333
|
-
}
|
|
3334
|
-
}
|
|
3335
|
-
function recordPosition(c) {
|
|
3336
|
-
newPositionMap.set(c, c.el.getBoundingClientRect());
|
|
3337
|
-
}
|
|
3338
|
-
function applyTranslation(c) {
|
|
3339
|
-
const oldPos = positionMap.get(c);
|
|
3340
|
-
const newPos = newPositionMap.get(c);
|
|
3341
|
-
const dx = oldPos.left - newPos.left;
|
|
3342
|
-
const dy = oldPos.top - newPos.top;
|
|
3343
|
-
if (dx || dy) {
|
|
3344
|
-
const s = c.el.style;
|
|
3345
|
-
s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
|
|
3346
|
-
s.transitionDuration = '0s';
|
|
3347
|
-
return c;
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
// this is put in a dedicated function to avoid the line from being treeshaken
|
|
3351
|
-
function forceReflow() {
|
|
3352
|
-
return document.body.offsetHeight;
|
|
3353
|
-
}
|
|
3354
|
-
function hasCSSTransform(el, root, moveClass) {
|
|
3355
|
-
// Detect whether an element with the move class applied has
|
|
3356
|
-
// CSS transitions. Since the element may be inside an entering
|
|
3357
|
-
// transition at this very moment, we make a clone of it and remove
|
|
3358
|
-
// all other transition classes applied to ensure only the move class
|
|
3359
|
-
// is applied.
|
|
3360
|
-
const clone = el.cloneNode();
|
|
3361
|
-
if (el._vtc) {
|
|
3362
|
-
el._vtc.forEach(cls => {
|
|
3363
|
-
cls.split(/\s+/).forEach(c => c && clone.classList.remove(c));
|
|
3364
|
-
});
|
|
3365
|
-
}
|
|
3366
|
-
moveClass.split(/\s+/).forEach(c => c && clone.classList.add(c));
|
|
3367
|
-
clone.style.display = 'none';
|
|
3368
|
-
const container = (root.nodeType === 1
|
|
3369
|
-
? root
|
|
3370
|
-
: root.parentNode);
|
|
3371
|
-
container.appendChild(clone);
|
|
3372
|
-
const { hasTransform } = getTransitionInfo(clone);
|
|
3373
|
-
container.removeChild(clone);
|
|
3374
|
-
return hasTransform;
|
|
3375
|
-
}
|
|
3376
|
-
|
|
3377
|
-
const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);
|
|
3378
|
-
|
|
3379
|
-
function initDev() {
|
|
3380
|
-
const target = getGlobalThis();
|
|
3381
|
-
target.__VUE__ = true;
|
|
3382
|
-
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
|
|
3383
|
-
{
|
|
3384
|
-
console.info(`You are running a development build of Vue.\n` +
|
|
3385
|
-
`Make sure to use the production build (*.prod.js) when deploying for production.`);
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
|
-
// This entry exports the runtime only, and is built as
|
|
3390
|
-
(process.env.NODE_ENV !== 'production') && initDev();
|
|
3391
|
-
|
|
3392
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3393
|
-
|
|
3394
|
-
function createCommonjsModule(fn, module) {
|
|
3395
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
3396
|
-
}
|
|
3397
|
-
|
|
3398
|
-
var humps = createCommonjsModule(function (module) {
|
|
3399
|
-
(function(global) {
|
|
3400
|
-
|
|
3401
|
-
var _processKeys = function(convert, obj, options) {
|
|
3402
|
-
if(!_isObject(obj) || _isDate(obj) || _isRegExp(obj) || _isBoolean(obj) || _isFunction(obj)) {
|
|
3403
|
-
return obj;
|
|
3404
|
-
}
|
|
3405
|
-
|
|
3406
|
-
var output,
|
|
3407
|
-
i = 0,
|
|
3408
|
-
l = 0;
|
|
3409
|
-
|
|
3410
|
-
if(_isArray(obj)) {
|
|
3411
|
-
output = [];
|
|
3412
|
-
for(l=obj.length; i<l; i++) {
|
|
3413
|
-
output.push(_processKeys(convert, obj[i], options));
|
|
3414
|
-
}
|
|
3415
|
-
}
|
|
3416
|
-
else {
|
|
3417
|
-
output = {};
|
|
3418
|
-
for(var key in obj) {
|
|
3419
|
-
if(Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3420
|
-
output[convert(key, options)] = _processKeys(convert, obj[key], options);
|
|
3421
|
-
}
|
|
3422
|
-
}
|
|
3423
|
-
}
|
|
3424
|
-
return output;
|
|
3425
|
-
};
|
|
3426
|
-
|
|
3427
|
-
// String conversion methods
|
|
3428
|
-
|
|
3429
|
-
var separateWords = function(string, options) {
|
|
3430
|
-
options = options || {};
|
|
3431
|
-
var separator = options.separator || '_';
|
|
3432
|
-
var split = options.split || /(?=[A-Z])/;
|
|
3433
|
-
|
|
3434
|
-
return string.split(split).join(separator);
|
|
3435
|
-
};
|
|
3436
|
-
|
|
3437
|
-
var camelize = function(string) {
|
|
3438
|
-
if (_isNumerical(string)) {
|
|
3439
|
-
return string;
|
|
3440
|
-
}
|
|
3441
|
-
string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
|
|
3442
|
-
return chr ? chr.toUpperCase() : '';
|
|
3443
|
-
});
|
|
3444
|
-
// Ensure 1st char is always lowercase
|
|
3445
|
-
return string.substr(0, 1).toLowerCase() + string.substr(1);
|
|
3446
|
-
};
|
|
3447
|
-
|
|
3448
|
-
var pascalize = function(string) {
|
|
3449
|
-
var camelized = camelize(string);
|
|
3450
|
-
// Ensure 1st char is always uppercase
|
|
3451
|
-
return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
|
|
3452
|
-
};
|
|
3453
|
-
|
|
3454
|
-
var decamelize = function(string, options) {
|
|
3455
|
-
return separateWords(string, options).toLowerCase();
|
|
3456
|
-
};
|
|
3457
|
-
|
|
3458
|
-
// Utilities
|
|
3459
|
-
// Taken from Underscore.js
|
|
3460
|
-
|
|
3461
|
-
var toString = Object.prototype.toString;
|
|
3462
|
-
|
|
3463
|
-
var _isFunction = function(obj) {
|
|
3464
|
-
return typeof(obj) === 'function';
|
|
3465
|
-
};
|
|
3466
|
-
var _isObject = function(obj) {
|
|
3467
|
-
return obj === Object(obj);
|
|
3468
|
-
};
|
|
3469
|
-
var _isArray = function(obj) {
|
|
3470
|
-
return toString.call(obj) == '[object Array]';
|
|
3471
|
-
};
|
|
3472
|
-
var _isDate = function(obj) {
|
|
3473
|
-
return toString.call(obj) == '[object Date]';
|
|
3474
|
-
};
|
|
3475
|
-
var _isRegExp = function(obj) {
|
|
3476
|
-
return toString.call(obj) == '[object RegExp]';
|
|
3477
|
-
};
|
|
3478
|
-
var _isBoolean = function(obj) {
|
|
3479
|
-
return toString.call(obj) == '[object Boolean]';
|
|
3480
|
-
};
|
|
3481
|
-
|
|
3482
|
-
// Performant way to determine if obj coerces to a number
|
|
3483
|
-
var _isNumerical = function(obj) {
|
|
3484
|
-
obj = obj - 0;
|
|
3485
|
-
return obj === obj;
|
|
3486
|
-
};
|
|
3487
|
-
|
|
3488
|
-
// Sets up function which handles processing keys
|
|
3489
|
-
// allowing the convert function to be modified by a callback
|
|
3490
|
-
var _processor = function(convert, options) {
|
|
3491
|
-
var callback = options && 'process' in options ? options.process : options;
|
|
3492
|
-
|
|
3493
|
-
if(typeof(callback) !== 'function') {
|
|
3494
|
-
return convert;
|
|
3495
|
-
}
|
|
3496
|
-
|
|
3497
|
-
return function(string, options) {
|
|
3498
|
-
return callback(string, convert, options);
|
|
3499
|
-
}
|
|
3500
|
-
};
|
|
3501
|
-
|
|
3502
|
-
var humps = {
|
|
3503
|
-
camelize: camelize,
|
|
3504
|
-
decamelize: decamelize,
|
|
3505
|
-
pascalize: pascalize,
|
|
3506
|
-
depascalize: decamelize,
|
|
3507
|
-
camelizeKeys: function(object, options) {
|
|
3508
|
-
return _processKeys(_processor(camelize, options), object);
|
|
3509
|
-
},
|
|
3510
|
-
decamelizeKeys: function(object, options) {
|
|
3511
|
-
return _processKeys(_processor(decamelize, options), object, options);
|
|
3512
|
-
},
|
|
3513
|
-
pascalizeKeys: function(object, options) {
|
|
3514
|
-
return _processKeys(_processor(pascalize, options), object);
|
|
3515
|
-
},
|
|
3516
|
-
depascalizeKeys: function () {
|
|
3517
|
-
return this.decamelizeKeys.apply(this, arguments);
|
|
3518
|
-
}
|
|
3519
|
-
};
|
|
3520
|
-
|
|
3521
|
-
if (typeof undefined === 'function' && undefined.amd) {
|
|
3522
|
-
undefined(humps);
|
|
3523
|
-
} else if ('object' !== 'undefined' && module.exports) {
|
|
3524
|
-
module.exports = humps;
|
|
3525
|
-
} else {
|
|
3526
|
-
global.humps = humps;
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
})(commonjsGlobal);
|
|
3530
|
-
});
|
|
3531
|
-
|
|
3532
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
3533
|
-
return typeof obj;
|
|
3534
|
-
} : function (obj) {
|
|
3535
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
3536
|
-
};
|
|
3537
|
-
|
|
3538
|
-
var defineProperty = function (obj, key, value) {
|
|
3539
|
-
if (key in obj) {
|
|
3540
|
-
Object.defineProperty(obj, key, {
|
|
3541
|
-
value: value,
|
|
3542
|
-
enumerable: true,
|
|
3543
|
-
configurable: true,
|
|
3544
|
-
writable: true
|
|
3545
|
-
});
|
|
3546
|
-
} else {
|
|
3547
|
-
obj[key] = value;
|
|
3548
|
-
}
|
|
3549
|
-
|
|
3550
|
-
return obj;
|
|
3551
|
-
};
|
|
3552
|
-
|
|
3553
|
-
var _extends = Object.assign || function (target) {
|
|
3554
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
3555
|
-
var source = arguments[i];
|
|
3556
|
-
|
|
3557
|
-
for (var key in source) {
|
|
3558
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3559
|
-
target[key] = source[key];
|
|
3560
|
-
}
|
|
3561
|
-
}
|
|
3562
|
-
}
|
|
3563
|
-
|
|
3564
|
-
return target;
|
|
3565
|
-
};
|
|
3566
|
-
|
|
3567
|
-
var objectWithoutProperties = function (obj, keys) {
|
|
3568
|
-
var target = {};
|
|
3569
|
-
|
|
3570
|
-
for (var i in obj) {
|
|
3571
|
-
if (keys.indexOf(i) >= 0) continue;
|
|
3572
|
-
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
|
3573
|
-
target[i] = obj[i];
|
|
3574
|
-
}
|
|
3575
|
-
|
|
3576
|
-
return target;
|
|
3577
|
-
};
|
|
3578
|
-
|
|
3579
|
-
var toConsumableArray = function (arr) {
|
|
3580
|
-
if (Array.isArray(arr)) {
|
|
3581
|
-
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
3582
|
-
|
|
3583
|
-
return arr2;
|
|
3584
|
-
} else {
|
|
3585
|
-
return Array.from(arr);
|
|
3586
|
-
}
|
|
3587
|
-
};
|
|
3588
|
-
|
|
3589
|
-
/**
|
|
3590
|
-
* Converts a CSS style into a plain Javascript object.
|
|
3591
|
-
* @param {String} style The style to converts into a plain Javascript object.
|
|
3592
|
-
* @returns {Object}
|
|
3593
|
-
*/
|
|
3594
|
-
function styleToObject(style) {
|
|
3595
|
-
return style.split(';').map(function (s) {
|
|
3596
|
-
return s.trim();
|
|
3597
|
-
}).filter(function (s) {
|
|
3598
|
-
return s;
|
|
3599
|
-
}).reduce(function (output, pair) {
|
|
3600
|
-
var idx = pair.indexOf(':');
|
|
3601
|
-
var prop = humps.camelize(pair.slice(0, idx));
|
|
3602
|
-
var value = pair.slice(idx + 1).trim();
|
|
3603
|
-
|
|
3604
|
-
output[prop] = value;
|
|
3605
|
-
return output;
|
|
3606
|
-
}, {});
|
|
3607
|
-
}
|
|
3608
|
-
|
|
3609
|
-
/**
|
|
3610
|
-
* Converts a CSS class list into a plain Javascript object.
|
|
3611
|
-
* @param {Array<String>} classes The class list to convert.
|
|
3612
|
-
* @returns {Object}
|
|
3613
|
-
*/
|
|
3614
|
-
function classToObject(classes) {
|
|
3615
|
-
return classes.split(/\s+/).reduce(function (output, className) {
|
|
3616
|
-
output[className] = true;
|
|
3617
|
-
return output;
|
|
3618
|
-
}, {});
|
|
3619
|
-
}
|
|
3620
|
-
|
|
3621
|
-
/**
|
|
3622
|
-
* Converts a FontAwesome abstract element of an icon into a Vue render function.
|
|
3623
|
-
* @param {AbstractElement | String} abstractElement The element to convert.
|
|
3624
|
-
* @param {Object} props The user-defined props.
|
|
3625
|
-
* @param {Object} attrs The user-defined native HTML attributes.
|
|
3626
|
-
* @returns {Function | String}
|
|
3627
|
-
*/
|
|
3628
|
-
function convert$1(abstractElement) {
|
|
3629
|
-
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3630
|
-
var attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3631
|
-
|
|
3632
|
-
// If the abstract element is a string, we'll just return a string render function
|
|
3633
|
-
if (typeof abstractElement === 'string') {
|
|
3634
|
-
return abstractElement;
|
|
3635
|
-
}
|
|
3636
|
-
|
|
3637
|
-
// Converting abstract element children into Vue render functions, then we'll execute
|
|
3638
|
-
// them to retrieve VDOM elements
|
|
3639
|
-
var children = (abstractElement.children || []).map(function (child) {
|
|
3640
|
-
return convert$1(child);
|
|
3641
|
-
}).map(function (renderFn) {
|
|
3642
|
-
return typeof renderFn === 'string' ? renderFn : renderFn();
|
|
3643
|
-
});
|
|
3644
|
-
|
|
3645
|
-
// Converting abstract element attributes into valid Vue format
|
|
3646
|
-
var mixins = Object.keys(abstractElement.attributes || {}).reduce(function (mixins, key) {
|
|
3647
|
-
var value = abstractElement.attributes[key];
|
|
3648
|
-
|
|
3649
|
-
switch (key) {
|
|
3650
|
-
case 'class':
|
|
3651
|
-
mixins.class = classToObject(value);
|
|
3652
|
-
break;
|
|
3653
|
-
case 'style':
|
|
3654
|
-
mixins.style = styleToObject(value);
|
|
3655
|
-
break;
|
|
3656
|
-
default:
|
|
3657
|
-
mixins.attrs[key] = value;
|
|
3658
|
-
}
|
|
3659
|
-
|
|
3660
|
-
return mixins;
|
|
3661
|
-
}, {
|
|
3662
|
-
attrs: {},
|
|
3663
|
-
class: {},
|
|
3664
|
-
style: {}
|
|
3665
|
-
});
|
|
3666
|
-
|
|
3667
|
-
// Now, we'll return the render function of the
|
|
3668
|
-
|
|
3669
|
-
var _attrs$class = attrs.class,
|
|
3670
|
-
_attrs$style = attrs.style,
|
|
3671
|
-
aStyle = _attrs$style === undefined ? {} : _attrs$style,
|
|
3672
|
-
otherAttrs = objectWithoutProperties(attrs, ['class', 'style']);
|
|
3673
|
-
|
|
3674
|
-
return function () {
|
|
3675
|
-
return h(abstractElement.tag, _extends({}, props, {
|
|
3676
|
-
class: mixins.class,
|
|
3677
|
-
style: _extends({}, mixins.style, aStyle)
|
|
3678
|
-
}, mixins.attrs, otherAttrs), children);
|
|
3679
|
-
};
|
|
3680
|
-
}
|
|
3681
|
-
|
|
3682
|
-
var PRODUCTION = false;
|
|
3683
|
-
|
|
3684
|
-
try {
|
|
3685
|
-
PRODUCTION = process.env.NODE_ENV === 'production';
|
|
3686
|
-
} catch (e) {}
|
|
3687
|
-
|
|
3688
|
-
function log () {
|
|
3689
|
-
if (!PRODUCTION && console && typeof console.error === 'function') {
|
|
3690
|
-
var _console;
|
|
3691
|
-
|
|
3692
|
-
(_console = console).error.apply(_console, arguments);
|
|
3693
|
-
}
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
|
-
function objectWithKey(key, value) {
|
|
3697
|
-
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? defineProperty({}, key, value) : {};
|
|
3698
|
-
}
|
|
3699
|
-
|
|
3700
|
-
function classList(props) {
|
|
3701
|
-
var _classes;
|
|
3702
|
-
|
|
3703
|
-
var classes = (_classes = {
|
|
3704
|
-
'fa-spin': props.spin,
|
|
3705
|
-
'fa-pulse': props.pulse,
|
|
3706
|
-
'fa-fw': props.fixedWidth,
|
|
3707
|
-
'fa-border': props.border,
|
|
3708
|
-
'fa-li': props.listItem,
|
|
3709
|
-
'fa-inverse': props.inverse,
|
|
3710
|
-
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
3711
|
-
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
3712
|
-
}, defineProperty(_classes, 'fa-' + props.size, props.size !== null), defineProperty(_classes, 'fa-rotate-' + props.rotation, props.rotation !== null), defineProperty(_classes, 'fa-pull-' + props.pull, props.pull !== null), defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes);
|
|
3713
|
-
|
|
3714
|
-
return Object.keys(classes).map(function (key) {
|
|
3715
|
-
return classes[key] ? key : null;
|
|
3716
|
-
}).filter(function (key) {
|
|
3717
|
-
return key;
|
|
3718
|
-
});
|
|
3719
|
-
}
|
|
3720
|
-
|
|
3721
|
-
function normalizeIconArgs(icon) {
|
|
3722
|
-
if (icon === null) {
|
|
3723
|
-
return null;
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3726
|
-
if ((typeof icon === 'undefined' ? 'undefined' : _typeof(icon)) === 'object' && icon.prefix && icon.iconName) {
|
|
3727
|
-
return icon;
|
|
3728
|
-
}
|
|
3729
|
-
|
|
3730
|
-
if (Array.isArray(icon) && icon.length === 2) {
|
|
3731
|
-
return { prefix: icon[0], iconName: icon[1] };
|
|
3732
|
-
}
|
|
3733
|
-
|
|
3734
|
-
if (typeof icon === 'string') {
|
|
3735
|
-
return { prefix: 'fas', iconName: icon };
|
|
3736
|
-
}
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
|
-
var FontAwesomeIcon = defineComponent({
|
|
3740
|
-
name: 'FontAwesomeIcon',
|
|
3741
|
-
|
|
3742
|
-
props: {
|
|
3743
|
-
border: {
|
|
3744
|
-
type: Boolean,
|
|
3745
|
-
default: false
|
|
3746
|
-
},
|
|
3747
|
-
fixedWidth: {
|
|
3748
|
-
type: Boolean,
|
|
3749
|
-
default: false
|
|
3750
|
-
},
|
|
3751
|
-
flip: {
|
|
3752
|
-
type: String,
|
|
3753
|
-
default: null,
|
|
3754
|
-
validator: function validator(value) {
|
|
3755
|
-
return ['horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
3756
|
-
}
|
|
3757
|
-
},
|
|
3758
|
-
icon: {
|
|
3759
|
-
type: [Object, Array, String],
|
|
3760
|
-
required: true
|
|
3761
|
-
},
|
|
3762
|
-
mask: {
|
|
3763
|
-
type: [Object, Array, String],
|
|
3764
|
-
default: null
|
|
3765
|
-
},
|
|
3766
|
-
listItem: {
|
|
3767
|
-
type: Boolean,
|
|
3768
|
-
default: false
|
|
3769
|
-
},
|
|
3770
|
-
pull: {
|
|
3771
|
-
type: String,
|
|
3772
|
-
default: null,
|
|
3773
|
-
validator: function validator(value) {
|
|
3774
|
-
return ['right', 'left'].indexOf(value) > -1;
|
|
3775
|
-
}
|
|
3776
|
-
},
|
|
3777
|
-
pulse: {
|
|
3778
|
-
type: Boolean,
|
|
3779
|
-
default: false
|
|
3780
|
-
},
|
|
3781
|
-
rotation: {
|
|
3782
|
-
type: [String, Number],
|
|
3783
|
-
default: null,
|
|
3784
|
-
validator: function validator(value) {
|
|
3785
|
-
return [90, 180, 270].indexOf(Number.parseInt(value, 10)) > -1;
|
|
3786
|
-
}
|
|
3787
|
-
},
|
|
3788
|
-
swapOpacity: {
|
|
3789
|
-
type: Boolean,
|
|
3790
|
-
default: false
|
|
3791
|
-
},
|
|
3792
|
-
size: {
|
|
3793
|
-
type: String,
|
|
3794
|
-
default: null,
|
|
3795
|
-
validator: function validator(value) {
|
|
3796
|
-
return ['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x'].indexOf(value) > -1;
|
|
3797
|
-
}
|
|
3798
|
-
},
|
|
3799
|
-
spin: {
|
|
3800
|
-
type: Boolean,
|
|
3801
|
-
default: false
|
|
3802
|
-
},
|
|
3803
|
-
transform: {
|
|
3804
|
-
type: [String, Object],
|
|
3805
|
-
default: null
|
|
3806
|
-
},
|
|
3807
|
-
symbol: {
|
|
3808
|
-
type: [Boolean, String],
|
|
3809
|
-
default: false
|
|
3810
|
-
},
|
|
3811
|
-
title: {
|
|
3812
|
-
type: String,
|
|
3813
|
-
default: null
|
|
3814
|
-
},
|
|
3815
|
-
inverse: {
|
|
3816
|
-
type: Boolean,
|
|
3817
|
-
default: false
|
|
3818
|
-
}
|
|
3819
|
-
},
|
|
3820
|
-
|
|
3821
|
-
setup: function setup(props, _ref) {
|
|
3822
|
-
var attrs = _ref.attrs;
|
|
3823
|
-
var symbol = props.symbol,
|
|
3824
|
-
title = props.title;
|
|
3825
|
-
|
|
3826
|
-
var icon = normalizeIconArgs(props.icon);
|
|
3827
|
-
var classes = objectWithKey('classes', classList(props));
|
|
3828
|
-
var transform = objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
3829
|
-
var mask = objectWithKey('mask', normalizeIconArgs(props.mask));
|
|
3830
|
-
|
|
3831
|
-
var renderedIcon = fontawesomeSvgCore.icon(icon, _extends({}, classes, transform, mask, {
|
|
3832
|
-
symbol: symbol,
|
|
3833
|
-
title: title
|
|
3834
|
-
}));
|
|
3835
|
-
|
|
3836
|
-
if (!renderedIcon) {
|
|
3837
|
-
return log('Could not find one or more icon(s)', icon, mask);
|
|
3838
|
-
}
|
|
3839
|
-
|
|
3840
|
-
var abstractElement = renderedIcon.abstract[0];
|
|
3841
|
-
return convert$1(abstractElement, {}, attrs);
|
|
3842
|
-
}
|
|
3843
|
-
});
|
|
3844
|
-
|
|
3845
|
-
var FontAwesomeLayers = defineComponent({
|
|
3846
|
-
name: 'FontAwesomeLayers',
|
|
3847
|
-
|
|
3848
|
-
props: {
|
|
3849
|
-
fixedWidth: {
|
|
3850
|
-
type: Boolean,
|
|
3851
|
-
default: false
|
|
3852
|
-
}
|
|
3853
|
-
},
|
|
3854
|
-
|
|
3855
|
-
setup: function setup(props, _ref) {
|
|
3856
|
-
var slots = _ref.slots;
|
|
3857
|
-
var familyPrefix = fontawesomeSvgCore.config.familyPrefix;
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
var className = [familyPrefix + '-layers'].concat(toConsumableArray(props.fixedWidth ? [familyPrefix + '-fw'] : []));
|
|
3861
|
-
|
|
3862
|
-
return function () {
|
|
3863
|
-
return h('div', { class: className }, slots.default ? slots.default() : []);
|
|
3864
|
-
};
|
|
3865
|
-
}
|
|
3866
|
-
});
|
|
3867
|
-
|
|
3868
|
-
var FontAwesomeLayersText = defineComponent({
|
|
3869
|
-
name: 'FontAwesomeLayersText',
|
|
3870
|
-
|
|
3871
|
-
props: {
|
|
3872
|
-
value: {
|
|
3873
|
-
type: [String, Number],
|
|
3874
|
-
default: ''
|
|
3875
|
-
},
|
|
3876
|
-
transform: {
|
|
3877
|
-
type: [String, Object],
|
|
3878
|
-
default: null
|
|
3879
|
-
},
|
|
3880
|
-
counter: {
|
|
3881
|
-
type: Boolean,
|
|
3882
|
-
default: false
|
|
3883
|
-
},
|
|
3884
|
-
position: {
|
|
3885
|
-
type: String,
|
|
3886
|
-
default: null,
|
|
3887
|
-
validator: function validator(value) {
|
|
3888
|
-
return ['bottom-left', 'bottom-right', 'top-left', 'top-right'].indexOf(value) > -1;
|
|
3889
|
-
}
|
|
3890
|
-
}
|
|
3891
|
-
},
|
|
3892
|
-
|
|
3893
|
-
setup: function setup(props, _ref) {
|
|
3894
|
-
var attrs = _ref.attrs;
|
|
3895
|
-
var familyPrefix = fontawesomeSvgCore.config.familyPrefix;
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
var classes = objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));
|
|
3899
|
-
var transform = objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
3900
|
-
var renderedText = fontawesomeSvgCore.text(props.value.toString(), _extends({}, transform, classes));
|
|
3901
|
-
|
|
3902
|
-
var abstract = renderedText.abstract;
|
|
3903
|
-
|
|
3904
|
-
if (props.counter) {
|
|
3905
|
-
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
3906
|
-
}
|
|
3907
|
-
|
|
3908
|
-
return convert$1(abstract[0], {}, attrs);
|
|
3909
|
-
}
|
|
3910
|
-
});
|
|
3911
|
-
|
|
3912
|
-
exports.FontAwesomeIcon = FontAwesomeIcon;
|
|
3913
|
-
exports.FontAwesomeLayers = FontAwesomeLayers;
|
|
3914
|
-
exports.FontAwesomeLayersText = FontAwesomeLayersText;
|
|
3915
|
-
|
|
3916
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@fortawesome/fontawesome-svg-core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@fortawesome/fontawesome-svg-core'], factory) :
|
|
4
|
+
(factory((global['vue-fontawesome'] = {}),global.vue,global.FontAwesome));
|
|
5
|
+
}(this, (function (exports,vue,fontawesomeSvgCore) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
|
+
|
|
9
|
+
function createCommonjsModule(fn, module) {
|
|
10
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var humps = createCommonjsModule(function (module) {
|
|
14
|
+
(function(global) {
|
|
15
|
+
|
|
16
|
+
var _processKeys = function(convert, obj, options) {
|
|
17
|
+
if(!_isObject(obj) || _isDate(obj) || _isRegExp(obj) || _isBoolean(obj) || _isFunction(obj)) {
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var output,
|
|
22
|
+
i = 0,
|
|
23
|
+
l = 0;
|
|
24
|
+
|
|
25
|
+
if(_isArray(obj)) {
|
|
26
|
+
output = [];
|
|
27
|
+
for(l=obj.length; i<l; i++) {
|
|
28
|
+
output.push(_processKeys(convert, obj[i], options));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
output = {};
|
|
33
|
+
for(var key in obj) {
|
|
34
|
+
if(Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
35
|
+
output[convert(key, options)] = _processKeys(convert, obj[key], options);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return output;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// String conversion methods
|
|
43
|
+
|
|
44
|
+
var separateWords = function(string, options) {
|
|
45
|
+
options = options || {};
|
|
46
|
+
var separator = options.separator || '_';
|
|
47
|
+
var split = options.split || /(?=[A-Z])/;
|
|
48
|
+
|
|
49
|
+
return string.split(split).join(separator);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var camelize = function(string) {
|
|
53
|
+
if (_isNumerical(string)) {
|
|
54
|
+
return string;
|
|
55
|
+
}
|
|
56
|
+
string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
|
|
57
|
+
return chr ? chr.toUpperCase() : '';
|
|
58
|
+
});
|
|
59
|
+
// Ensure 1st char is always lowercase
|
|
60
|
+
return string.substr(0, 1).toLowerCase() + string.substr(1);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var pascalize = function(string) {
|
|
64
|
+
var camelized = camelize(string);
|
|
65
|
+
// Ensure 1st char is always uppercase
|
|
66
|
+
return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var decamelize = function(string, options) {
|
|
70
|
+
return separateWords(string, options).toLowerCase();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Utilities
|
|
74
|
+
// Taken from Underscore.js
|
|
75
|
+
|
|
76
|
+
var toString = Object.prototype.toString;
|
|
77
|
+
|
|
78
|
+
var _isFunction = function(obj) {
|
|
79
|
+
return typeof(obj) === 'function';
|
|
80
|
+
};
|
|
81
|
+
var _isObject = function(obj) {
|
|
82
|
+
return obj === Object(obj);
|
|
83
|
+
};
|
|
84
|
+
var _isArray = function(obj) {
|
|
85
|
+
return toString.call(obj) == '[object Array]';
|
|
86
|
+
};
|
|
87
|
+
var _isDate = function(obj) {
|
|
88
|
+
return toString.call(obj) == '[object Date]';
|
|
89
|
+
};
|
|
90
|
+
var _isRegExp = function(obj) {
|
|
91
|
+
return toString.call(obj) == '[object RegExp]';
|
|
92
|
+
};
|
|
93
|
+
var _isBoolean = function(obj) {
|
|
94
|
+
return toString.call(obj) == '[object Boolean]';
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Performant way to determine if obj coerces to a number
|
|
98
|
+
var _isNumerical = function(obj) {
|
|
99
|
+
obj = obj - 0;
|
|
100
|
+
return obj === obj;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// Sets up function which handles processing keys
|
|
104
|
+
// allowing the convert function to be modified by a callback
|
|
105
|
+
var _processor = function(convert, options) {
|
|
106
|
+
var callback = options && 'process' in options ? options.process : options;
|
|
107
|
+
|
|
108
|
+
if(typeof(callback) !== 'function') {
|
|
109
|
+
return convert;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return function(string, options) {
|
|
113
|
+
return callback(string, convert, options);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var humps = {
|
|
118
|
+
camelize: camelize,
|
|
119
|
+
decamelize: decamelize,
|
|
120
|
+
pascalize: pascalize,
|
|
121
|
+
depascalize: decamelize,
|
|
122
|
+
camelizeKeys: function(object, options) {
|
|
123
|
+
return _processKeys(_processor(camelize, options), object);
|
|
124
|
+
},
|
|
125
|
+
decamelizeKeys: function(object, options) {
|
|
126
|
+
return _processKeys(_processor(decamelize, options), object, options);
|
|
127
|
+
},
|
|
128
|
+
pascalizeKeys: function(object, options) {
|
|
129
|
+
return _processKeys(_processor(pascalize, options), object);
|
|
130
|
+
},
|
|
131
|
+
depascalizeKeys: function () {
|
|
132
|
+
return this.decamelizeKeys.apply(this, arguments);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
if (typeof undefined === 'function' && undefined.amd) {
|
|
137
|
+
undefined(humps);
|
|
138
|
+
} else if ('object' !== 'undefined' && module.exports) {
|
|
139
|
+
module.exports = humps;
|
|
140
|
+
} else {
|
|
141
|
+
global.humps = humps;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
})(commonjsGlobal);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
148
|
+
return typeof obj;
|
|
149
|
+
} : function (obj) {
|
|
150
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var defineProperty = function (obj, key, value) {
|
|
154
|
+
if (key in obj) {
|
|
155
|
+
Object.defineProperty(obj, key, {
|
|
156
|
+
value: value,
|
|
157
|
+
enumerable: true,
|
|
158
|
+
configurable: true,
|
|
159
|
+
writable: true
|
|
160
|
+
});
|
|
161
|
+
} else {
|
|
162
|
+
obj[key] = value;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return obj;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var _extends = Object.assign || function (target) {
|
|
169
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
170
|
+
var source = arguments[i];
|
|
171
|
+
|
|
172
|
+
for (var key in source) {
|
|
173
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
174
|
+
target[key] = source[key];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return target;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var objectWithoutProperties = function (obj, keys) {
|
|
183
|
+
var target = {};
|
|
184
|
+
|
|
185
|
+
for (var i in obj) {
|
|
186
|
+
if (keys.indexOf(i) >= 0) continue;
|
|
187
|
+
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
|
188
|
+
target[i] = obj[i];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return target;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
var toConsumableArray = function (arr) {
|
|
195
|
+
if (Array.isArray(arr)) {
|
|
196
|
+
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
197
|
+
|
|
198
|
+
return arr2;
|
|
199
|
+
} else {
|
|
200
|
+
return Array.from(arr);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Converts a CSS style into a plain Javascript object.
|
|
206
|
+
* @param {String} style The style to converts into a plain Javascript object.
|
|
207
|
+
* @returns {Object}
|
|
208
|
+
*/
|
|
209
|
+
function styleToObject(style) {
|
|
210
|
+
return style.split(';').map(function (s) {
|
|
211
|
+
return s.trim();
|
|
212
|
+
}).filter(function (s) {
|
|
213
|
+
return s;
|
|
214
|
+
}).reduce(function (output, pair) {
|
|
215
|
+
var idx = pair.indexOf(':');
|
|
216
|
+
var prop = humps.camelize(pair.slice(0, idx));
|
|
217
|
+
var value = pair.slice(idx + 1).trim();
|
|
218
|
+
|
|
219
|
+
output[prop] = value;
|
|
220
|
+
return output;
|
|
221
|
+
}, {});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Converts a CSS class list into a plain Javascript object.
|
|
226
|
+
* @param {Array<String>} classes The class list to convert.
|
|
227
|
+
* @returns {Object}
|
|
228
|
+
*/
|
|
229
|
+
function classToObject(classes) {
|
|
230
|
+
return classes.split(/\s+/).reduce(function (output, className) {
|
|
231
|
+
output[className] = true;
|
|
232
|
+
return output;
|
|
233
|
+
}, {});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Converts a FontAwesome abstract element of an icon into a Vue VNode.
|
|
238
|
+
* @param {AbstractElement | String} abstractElement The element to convert.
|
|
239
|
+
* @param {Object} props The user-defined props.
|
|
240
|
+
* @param {Object} attrs The user-defined native HTML attributes.
|
|
241
|
+
* @returns {VNode}
|
|
242
|
+
*/
|
|
243
|
+
function convert(abstractElement) {
|
|
244
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
245
|
+
var attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
246
|
+
|
|
247
|
+
// If the abstract element is a string, we'll just return a string render function
|
|
248
|
+
if (typeof abstractElement === 'string') {
|
|
249
|
+
return abstractElement;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Converting abstract element children into Vue VNodes
|
|
253
|
+
var children = (abstractElement.children || []).map(function (child) {
|
|
254
|
+
return convert(child);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// Converting abstract element attributes into valid Vue format
|
|
258
|
+
var mixins = Object.keys(abstractElement.attributes || {}).reduce(function (mixins, key) {
|
|
259
|
+
var value = abstractElement.attributes[key];
|
|
260
|
+
|
|
261
|
+
switch (key) {
|
|
262
|
+
case 'class':
|
|
263
|
+
mixins.class = classToObject(value);
|
|
264
|
+
break;
|
|
265
|
+
case 'style':
|
|
266
|
+
mixins.style = styleToObject(value);
|
|
267
|
+
break;
|
|
268
|
+
default:
|
|
269
|
+
mixins.attrs[key] = value;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return mixins;
|
|
273
|
+
}, {
|
|
274
|
+
attrs: {},
|
|
275
|
+
class: {},
|
|
276
|
+
style: {}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
// Now, we'll return the VNode
|
|
280
|
+
|
|
281
|
+
var _attrs$class = attrs.class,
|
|
282
|
+
_attrs$style = attrs.style,
|
|
283
|
+
aStyle = _attrs$style === undefined ? {} : _attrs$style,
|
|
284
|
+
otherAttrs = objectWithoutProperties(attrs, ['class', 'style']);
|
|
285
|
+
|
|
286
|
+
return vue.h(abstractElement.tag, _extends({}, props, {
|
|
287
|
+
class: mixins.class,
|
|
288
|
+
style: _extends({}, mixins.style, aStyle)
|
|
289
|
+
}, mixins.attrs, otherAttrs), children);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
var PRODUCTION = false;
|
|
293
|
+
|
|
294
|
+
try {
|
|
295
|
+
PRODUCTION = process.env.NODE_ENV === 'production';
|
|
296
|
+
} catch (e) {}
|
|
297
|
+
|
|
298
|
+
function log () {
|
|
299
|
+
if (!PRODUCTION && console && typeof console.error === 'function') {
|
|
300
|
+
var _console;
|
|
301
|
+
|
|
302
|
+
(_console = console).error.apply(_console, arguments);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function objectWithKey(key, value) {
|
|
307
|
+
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? defineProperty({}, key, value) : {};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function classList(props) {
|
|
311
|
+
var _classes;
|
|
312
|
+
|
|
313
|
+
var classes = (_classes = {
|
|
314
|
+
'fa-spin': props.spin,
|
|
315
|
+
'fa-pulse': props.pulse,
|
|
316
|
+
'fa-fw': props.fixedWidth,
|
|
317
|
+
'fa-border': props.border,
|
|
318
|
+
'fa-li': props.listItem,
|
|
319
|
+
'fa-inverse': props.inverse,
|
|
320
|
+
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
321
|
+
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
322
|
+
}, defineProperty(_classes, 'fa-' + props.size, props.size !== null), defineProperty(_classes, 'fa-rotate-' + props.rotation, props.rotation !== null), defineProperty(_classes, 'fa-pull-' + props.pull, props.pull !== null), defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes);
|
|
323
|
+
|
|
324
|
+
return Object.keys(classes).map(function (key) {
|
|
325
|
+
return classes[key] ? key : null;
|
|
326
|
+
}).filter(function (key) {
|
|
327
|
+
return key;
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function normalizeIconArgs(icon) {
|
|
332
|
+
if (icon === null) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if ((typeof icon === 'undefined' ? 'undefined' : _typeof(icon)) === 'object' && icon.prefix && icon.iconName) {
|
|
337
|
+
return icon;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (Array.isArray(icon) && icon.length === 2) {
|
|
341
|
+
return { prefix: icon[0], iconName: icon[1] };
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (typeof icon === 'string') {
|
|
345
|
+
return { prefix: 'fas', iconName: icon };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
var FontAwesomeIcon = vue.defineComponent({
|
|
350
|
+
name: 'FontAwesomeIcon',
|
|
351
|
+
|
|
352
|
+
props: {
|
|
353
|
+
border: {
|
|
354
|
+
type: Boolean,
|
|
355
|
+
default: false
|
|
356
|
+
},
|
|
357
|
+
fixedWidth: {
|
|
358
|
+
type: Boolean,
|
|
359
|
+
default: false
|
|
360
|
+
},
|
|
361
|
+
flip: {
|
|
362
|
+
type: String,
|
|
363
|
+
default: null,
|
|
364
|
+
validator: function validator(value) {
|
|
365
|
+
return ['horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
icon: {
|
|
369
|
+
type: [Object, Array, String],
|
|
370
|
+
required: true
|
|
371
|
+
},
|
|
372
|
+
mask: {
|
|
373
|
+
type: [Object, Array, String],
|
|
374
|
+
default: null
|
|
375
|
+
},
|
|
376
|
+
listItem: {
|
|
377
|
+
type: Boolean,
|
|
378
|
+
default: false
|
|
379
|
+
},
|
|
380
|
+
pull: {
|
|
381
|
+
type: String,
|
|
382
|
+
default: null,
|
|
383
|
+
validator: function validator(value) {
|
|
384
|
+
return ['right', 'left'].indexOf(value) > -1;
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
pulse: {
|
|
388
|
+
type: Boolean,
|
|
389
|
+
default: false
|
|
390
|
+
},
|
|
391
|
+
rotation: {
|
|
392
|
+
type: [String, Number],
|
|
393
|
+
default: null,
|
|
394
|
+
validator: function validator(value) {
|
|
395
|
+
return [90, 180, 270].indexOf(Number.parseInt(value, 10)) > -1;
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
swapOpacity: {
|
|
399
|
+
type: Boolean,
|
|
400
|
+
default: false
|
|
401
|
+
},
|
|
402
|
+
size: {
|
|
403
|
+
type: String,
|
|
404
|
+
default: null,
|
|
405
|
+
validator: function validator(value) {
|
|
406
|
+
return ['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x'].indexOf(value) > -1;
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
spin: {
|
|
410
|
+
type: Boolean,
|
|
411
|
+
default: false
|
|
412
|
+
},
|
|
413
|
+
transform: {
|
|
414
|
+
type: [String, Object],
|
|
415
|
+
default: null
|
|
416
|
+
},
|
|
417
|
+
symbol: {
|
|
418
|
+
type: [Boolean, String],
|
|
419
|
+
default: false
|
|
420
|
+
},
|
|
421
|
+
title: {
|
|
422
|
+
type: String,
|
|
423
|
+
default: null
|
|
424
|
+
},
|
|
425
|
+
inverse: {
|
|
426
|
+
type: Boolean,
|
|
427
|
+
default: false
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
setup: function setup(props, _ref) {
|
|
432
|
+
var attrs = _ref.attrs;
|
|
433
|
+
|
|
434
|
+
var icon = vue.computed(function () {
|
|
435
|
+
return normalizeIconArgs(props.icon);
|
|
436
|
+
});
|
|
437
|
+
var classes = vue.computed(function () {
|
|
438
|
+
return objectWithKey('classes', classList(props));
|
|
439
|
+
});
|
|
440
|
+
var transform = vue.computed(function () {
|
|
441
|
+
return objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
442
|
+
});
|
|
443
|
+
var mask = vue.computed(function () {
|
|
444
|
+
return objectWithKey('mask', normalizeIconArgs(props.mask));
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
var renderedIcon = vue.computed(function () {
|
|
448
|
+
return fontawesomeSvgCore.icon(icon.value, _extends({}, classes.value, transform.value, mask.value, {
|
|
449
|
+
symbol: props.symbol,
|
|
450
|
+
title: props.title
|
|
451
|
+
}));
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
vue.watch(renderedIcon, function (value) {
|
|
455
|
+
if (!value) {
|
|
456
|
+
return log('Could not find one or more icon(s)', icon.value, mask.value);
|
|
457
|
+
}
|
|
458
|
+
}, { immediate: true });
|
|
459
|
+
|
|
460
|
+
var vnode = vue.computed(function () {
|
|
461
|
+
return renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null;
|
|
462
|
+
});
|
|
463
|
+
return function () {
|
|
464
|
+
return vnode.value;
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
var FontAwesomeLayers = vue.defineComponent({
|
|
470
|
+
name: 'FontAwesomeLayers',
|
|
471
|
+
|
|
472
|
+
props: {
|
|
473
|
+
fixedWidth: {
|
|
474
|
+
type: Boolean,
|
|
475
|
+
default: false
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
|
|
479
|
+
setup: function setup(props, _ref) {
|
|
480
|
+
var slots = _ref.slots;
|
|
481
|
+
var familyPrefix = fontawesomeSvgCore.config.familyPrefix;
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
var className = vue.computed(function () {
|
|
485
|
+
return [familyPrefix + '-layers'].concat(toConsumableArray(props.fixedWidth ? [familyPrefix + '-fw'] : []));
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
return function () {
|
|
489
|
+
return vue.h('div', { class: className.value }, slots.default ? slots.default() : []);
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
var FontAwesomeLayersText = vue.defineComponent({
|
|
495
|
+
name: 'FontAwesomeLayersText',
|
|
496
|
+
|
|
497
|
+
props: {
|
|
498
|
+
value: {
|
|
499
|
+
type: [String, Number],
|
|
500
|
+
default: ''
|
|
501
|
+
},
|
|
502
|
+
transform: {
|
|
503
|
+
type: [String, Object],
|
|
504
|
+
default: null
|
|
505
|
+
},
|
|
506
|
+
counter: {
|
|
507
|
+
type: Boolean,
|
|
508
|
+
default: false
|
|
509
|
+
},
|
|
510
|
+
position: {
|
|
511
|
+
type: String,
|
|
512
|
+
default: null,
|
|
513
|
+
validator: function validator(value) {
|
|
514
|
+
return ['bottom-left', 'bottom-right', 'top-left', 'top-right'].indexOf(value) > -1;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
|
|
519
|
+
setup: function setup(props, _ref) {
|
|
520
|
+
var attrs = _ref.attrs;
|
|
521
|
+
var familyPrefix = fontawesomeSvgCore.config.familyPrefix;
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
var classes = vue.computed(function () {
|
|
525
|
+
return objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));
|
|
526
|
+
});
|
|
527
|
+
var transform = vue.computed(function () {
|
|
528
|
+
return objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
529
|
+
});
|
|
530
|
+
var abstractElement = vue.computed(function () {
|
|
531
|
+
var _text = fontawesomeSvgCore.text(props.value.toString(), _extends({}, transform.value, classes.value)),
|
|
532
|
+
abstract = _text.abstract;
|
|
533
|
+
|
|
534
|
+
if (props.counter) {
|
|
535
|
+
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
536
|
+
}
|
|
537
|
+
return abstract[0];
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
var vnode = vue.computed(function () {
|
|
541
|
+
return convert(abstractElement.value, {}, attrs);
|
|
542
|
+
});
|
|
543
|
+
return function () {
|
|
544
|
+
return vnode.value;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
exports.FontAwesomeIcon = FontAwesomeIcon;
|
|
550
|
+
exports.FontAwesomeLayers = FontAwesomeLayers;
|
|
551
|
+
exports.FontAwesomeLayersText = FontAwesomeLayersText;
|
|
552
|
+
|
|
553
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3917
554
|
|
|
3918
555
|
})));
|