bk-magic-vue 2.5.6 → 2.5.7
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/dist/bk-magic-vue.css +240 -2
- package/dist/bk-magic-vue.js +1137 -182
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/dist/fonts/iconcool.eot +0 -0
- package/dist/fonts/iconcool.svg +27 -0
- package/dist/fonts/iconcool.ttf +0 -0
- package/dist/fonts/iconcool.woff +0 -0
- package/lib/cascade.js +35 -32
- package/lib/locale/lang/en-US.js +5 -1
- package/lib/locale/lang/zh-CN.js +5 -1
- package/lib/message.js +1182 -623
- package/lib/option.js +692 -63
- package/lib/pagination.js +383 -105
- package/lib/search-select.js +1604 -1288
- package/lib/select.js +321 -43
- package/lib/table.js +17 -2
- package/lib/ui/bk-magic-vue.css +240 -2
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/common.css +36 -0
- package/lib/ui/common.min.css +1 -1
- package/lib/ui/common.min.css.map +1 -1
- package/lib/ui/fonts/iconcool.eot +0 -0
- package/lib/ui/fonts/iconcool.svg +27 -0
- package/lib/ui/fonts/iconcool.ttf +0 -0
- package/lib/ui/fonts/iconcool.woff +0 -0
- package/lib/ui/iconfont.css +36 -0
- package/lib/ui/iconfont.min.css +1 -1
- package/lib/ui/iconfont.min.css.map +1 -1
- package/lib/ui/message.css +233 -1
- package/lib/ui/message.min.css +1 -1
- package/lib/ui/message.min.css.map +1 -1
- package/lib/ui/search-select-menu.css +7 -1
- package/lib/ui/search-select-menu.min.css +1 -1
- package/lib/ui/search-select-menu.min.css.map +1 -1
- package/lib/ui/search-select.css +5 -0
- package/lib/ui/search-select.min.css +1 -1
- package/lib/ui/search-select.min.css.map +1 -1
- package/lib/ui/select.css +4 -0
- package/lib/ui/select.min.css +1 -1
- package/lib/ui/select.min.css.map +1 -1
- package/package.json +4 -2
package/lib/message.js
CHANGED
|
@@ -1,626 +1,1185 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, function (exports, Vue, locale) { '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
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('bk-magic-vue/lib/locale'), require('json-formatter-js'), require('clipboard')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'bk-magic-vue/lib/locale', 'json-formatter-js', 'clipboard'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}, global.Vue, global.locale, global.JSONFormatter, global.ClipboardJS));
|
|
5
|
+
}(this, function (exports, Vue, locale, JSONFormatter, ClipboardJS) { 'use strict';
|
|
6
|
+
|
|
7
|
+
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
8
|
+
locale = locale && locale.hasOwnProperty('default') ? locale['default'] : locale;
|
|
9
|
+
JSONFormatter = JSONFormatter && JSONFormatter.hasOwnProperty('default') ? JSONFormatter['default'] : JSONFormatter;
|
|
10
|
+
ClipboardJS = ClipboardJS && ClipboardJS.hasOwnProperty('default') ? ClipboardJS['default'] : ClipboardJS;
|
|
11
|
+
|
|
12
|
+
function createCommonjsModule(fn, module) {
|
|
13
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var _global = createCommonjsModule(function (module) {
|
|
17
|
+
var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
|
18
|
+
? window : typeof self != 'undefined' && self.Math == Math ? self
|
|
19
|
+
: Function('return this')();
|
|
20
|
+
if (typeof __g == 'number') __g = global;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
var _core = createCommonjsModule(function (module) {
|
|
24
|
+
var core = module.exports = { version: '2.6.12' };
|
|
25
|
+
if (typeof __e == 'number') __e = core;
|
|
26
|
+
});
|
|
27
|
+
var _core_1 = _core.version;
|
|
28
|
+
|
|
29
|
+
var _aFunction = function (it) {
|
|
30
|
+
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
|
31
|
+
return it;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var _ctx = function (fn, that, length) {
|
|
35
|
+
_aFunction(fn);
|
|
36
|
+
if (that === undefined) return fn;
|
|
37
|
+
switch (length) {
|
|
38
|
+
case 1: return function (a) {
|
|
39
|
+
return fn.call(that, a);
|
|
40
|
+
};
|
|
41
|
+
case 2: return function (a, b) {
|
|
42
|
+
return fn.call(that, a, b);
|
|
43
|
+
};
|
|
44
|
+
case 3: return function (a, b, c) {
|
|
45
|
+
return fn.call(that, a, b, c);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return function () {
|
|
49
|
+
return fn.apply(that, arguments);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var _isObject = function (it) {
|
|
54
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var _anObject = function (it) {
|
|
58
|
+
if (!_isObject(it)) throw TypeError(it + ' is not an object!');
|
|
59
|
+
return it;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var _fails = function (exec) {
|
|
63
|
+
try {
|
|
64
|
+
return !!exec();
|
|
65
|
+
} catch (e) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var _descriptors = !_fails(function () {
|
|
71
|
+
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
var document$1 = _global.document;
|
|
75
|
+
var is = _isObject(document$1) && _isObject(document$1.createElement);
|
|
76
|
+
var _domCreate = function (it) {
|
|
77
|
+
return is ? document$1.createElement(it) : {};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var _ie8DomDefine = !_descriptors && !_fails(function () {
|
|
81
|
+
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
var _toPrimitive = function (it, S) {
|
|
85
|
+
if (!_isObject(it)) return it;
|
|
86
|
+
var fn, val;
|
|
87
|
+
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
88
|
+
if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
89
|
+
if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
90
|
+
throw TypeError("Can't convert object to primitive value");
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var dP = Object.defineProperty;
|
|
94
|
+
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
|
95
|
+
_anObject(O);
|
|
96
|
+
P = _toPrimitive(P, true);
|
|
97
|
+
_anObject(Attributes);
|
|
98
|
+
if (_ie8DomDefine) try {
|
|
99
|
+
return dP(O, P, Attributes);
|
|
100
|
+
} catch (e) { }
|
|
101
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
|
102
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
103
|
+
return O;
|
|
104
|
+
};
|
|
105
|
+
var _objectDp = {
|
|
106
|
+
f: f
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
var _propertyDesc = function (bitmap, value) {
|
|
110
|
+
return {
|
|
111
|
+
enumerable: !(bitmap & 1),
|
|
112
|
+
configurable: !(bitmap & 2),
|
|
113
|
+
writable: !(bitmap & 4),
|
|
114
|
+
value: value
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var _hide = _descriptors ? function (object, key, value) {
|
|
119
|
+
return _objectDp.f(object, key, _propertyDesc(1, value));
|
|
120
|
+
} : function (object, key, value) {
|
|
121
|
+
object[key] = value;
|
|
122
|
+
return object;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
126
|
+
var _has = function (it, key) {
|
|
127
|
+
return hasOwnProperty.call(it, key);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
var PROTOTYPE = 'prototype';
|
|
131
|
+
var $export = function (type, name, source) {
|
|
132
|
+
var IS_FORCED = type & $export.F;
|
|
133
|
+
var IS_GLOBAL = type & $export.G;
|
|
134
|
+
var IS_STATIC = type & $export.S;
|
|
135
|
+
var IS_PROTO = type & $export.P;
|
|
136
|
+
var IS_BIND = type & $export.B;
|
|
137
|
+
var IS_WRAP = type & $export.W;
|
|
138
|
+
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
|
|
139
|
+
var expProto = exports[PROTOTYPE];
|
|
140
|
+
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
|
|
141
|
+
var key, own, out;
|
|
142
|
+
if (IS_GLOBAL) source = name;
|
|
143
|
+
for (key in source) {
|
|
144
|
+
own = !IS_FORCED && target && target[key] !== undefined;
|
|
145
|
+
if (own && _has(exports, key)) continue;
|
|
146
|
+
out = own ? target[key] : source[key];
|
|
147
|
+
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
|
148
|
+
: IS_BIND && own ? _ctx(out, _global)
|
|
149
|
+
: IS_WRAP && target[key] == out ? (function (C) {
|
|
150
|
+
var F = function (a, b, c) {
|
|
151
|
+
if (this instanceof C) {
|
|
152
|
+
switch (arguments.length) {
|
|
153
|
+
case 0: return new C();
|
|
154
|
+
case 1: return new C(a);
|
|
155
|
+
case 2: return new C(a, b);
|
|
156
|
+
} return new C(a, b, c);
|
|
157
|
+
} return C.apply(this, arguments);
|
|
158
|
+
};
|
|
159
|
+
F[PROTOTYPE] = C[PROTOTYPE];
|
|
160
|
+
return F;
|
|
161
|
+
})(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
|
|
162
|
+
if (IS_PROTO) {
|
|
163
|
+
(exports.virtual || (exports.virtual = {}))[key] = out;
|
|
164
|
+
if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
$export.F = 1;
|
|
169
|
+
$export.G = 2;
|
|
170
|
+
$export.S = 4;
|
|
171
|
+
$export.P = 8;
|
|
172
|
+
$export.B = 16;
|
|
173
|
+
$export.W = 32;
|
|
174
|
+
$export.U = 64;
|
|
175
|
+
$export.R = 128;
|
|
176
|
+
var _export = $export;
|
|
177
|
+
|
|
178
|
+
var _defined = function (it) {
|
|
179
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
180
|
+
return it;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
var _stringWs = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
|
|
184
|
+
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
185
|
+
|
|
186
|
+
var space = '[' + _stringWs + ']';
|
|
187
|
+
var non = '\u200b\u0085';
|
|
188
|
+
var ltrim = RegExp('^' + space + space + '*');
|
|
189
|
+
var rtrim = RegExp(space + space + '*$');
|
|
190
|
+
var exporter = function (KEY, exec, ALIAS) {
|
|
191
|
+
var exp = {};
|
|
192
|
+
var FORCE = _fails(function () {
|
|
193
|
+
return !!_stringWs[KEY]() || non[KEY]() != non;
|
|
194
|
+
});
|
|
195
|
+
var fn = exp[KEY] = FORCE ? exec(trim) : _stringWs[KEY];
|
|
196
|
+
if (ALIAS) exp[ALIAS] = fn;
|
|
197
|
+
_export(_export.P + _export.F * FORCE, 'String', exp);
|
|
198
|
+
};
|
|
199
|
+
var trim = exporter.trim = function (string, TYPE) {
|
|
200
|
+
string = String(_defined(string));
|
|
201
|
+
if (TYPE & 1) string = string.replace(ltrim, '');
|
|
202
|
+
if (TYPE & 2) string = string.replace(rtrim, '');
|
|
203
|
+
return string;
|
|
204
|
+
};
|
|
205
|
+
var _stringTrim = exporter;
|
|
206
|
+
|
|
207
|
+
var $parseInt = _global.parseInt;
|
|
208
|
+
var $trim = _stringTrim.trim;
|
|
209
|
+
var hex = /^[-+]?0[xX]/;
|
|
210
|
+
var _parseInt = $parseInt(_stringWs + '08') !== 8 || $parseInt(_stringWs + '0x16') !== 22 ? function parseInt(str, radix) {
|
|
211
|
+
var string = $trim(String(str), 3);
|
|
212
|
+
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
|
|
213
|
+
} : $parseInt;
|
|
214
|
+
|
|
215
|
+
_export(_export.G + _export.F * (parseInt != _parseInt), { parseInt: _parseInt });
|
|
216
|
+
|
|
217
|
+
var _parseInt$1 = _core.parseInt;
|
|
218
|
+
|
|
219
|
+
var _parseInt$2 = _parseInt$1;
|
|
220
|
+
|
|
221
|
+
_export(_export.S, 'Date', { now: function () { return new Date().getTime(); } });
|
|
222
|
+
|
|
223
|
+
var now = _core.Date.now;
|
|
224
|
+
|
|
225
|
+
var now$1 = now;
|
|
226
|
+
|
|
227
|
+
var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
|
|
228
|
+
var stringify = function stringify(it) {
|
|
229
|
+
return $JSON.stringify.apply($JSON, arguments);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
var stringify$1 = stringify;
|
|
233
|
+
|
|
234
|
+
function _typeof(obj) {
|
|
235
|
+
"@babel/helpers - typeof";
|
|
236
|
+
|
|
237
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
238
|
+
return typeof obj;
|
|
239
|
+
} : function (obj) {
|
|
240
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
241
|
+
}, _typeof(obj);
|
|
242
|
+
}
|
|
243
|
+
function _defineProperty(obj, key, value) {
|
|
244
|
+
if (key in obj) {
|
|
245
|
+
Object.defineProperty(obj, key, {
|
|
246
|
+
value: value,
|
|
247
|
+
enumerable: true,
|
|
248
|
+
configurable: true,
|
|
249
|
+
writable: true
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
obj[key] = value;
|
|
253
|
+
}
|
|
254
|
+
return obj;
|
|
255
|
+
}
|
|
256
|
+
function _extends() {
|
|
257
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
258
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
259
|
+
var source = arguments[i];
|
|
260
|
+
for (var key in source) {
|
|
261
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
262
|
+
target[key] = source[key];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return target;
|
|
267
|
+
};
|
|
268
|
+
return _extends.apply(this, arguments);
|
|
269
|
+
}
|
|
270
|
+
function _toConsumableArray(arr) {
|
|
271
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
272
|
+
}
|
|
273
|
+
function _arrayWithoutHoles(arr) {
|
|
274
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
275
|
+
}
|
|
276
|
+
function _iterableToArray(iter) {
|
|
277
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
278
|
+
}
|
|
279
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
280
|
+
if (!o) return;
|
|
281
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
282
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
283
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
284
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
285
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
286
|
+
}
|
|
287
|
+
function _arrayLikeToArray(arr, len) {
|
|
288
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
289
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
290
|
+
return arr2;
|
|
291
|
+
}
|
|
292
|
+
function _nonIterableSpread() {
|
|
293
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
var $parseFloat = _global.parseFloat;
|
|
297
|
+
var $trim$1 = _stringTrim.trim;
|
|
298
|
+
var _parseFloat = 1 / $parseFloat(_stringWs + '-0') !== -Infinity ? function parseFloat(str) {
|
|
299
|
+
var string = $trim$1(String(str), 3);
|
|
300
|
+
var result = $parseFloat(string);
|
|
301
|
+
return result === 0 && string.charAt(0) == '-' ? -0 : result;
|
|
302
|
+
} : $parseFloat;
|
|
303
|
+
|
|
304
|
+
_export(_export.G + _export.F * (parseFloat != _parseFloat), { parseFloat: _parseFloat });
|
|
305
|
+
|
|
306
|
+
var _parseFloat$1 = _core.parseFloat;
|
|
307
|
+
|
|
308
|
+
var _parseFloat$2 = _parseFloat$1;
|
|
309
|
+
|
|
310
|
+
var toString = {}.toString;
|
|
311
|
+
var _cof = function (it) {
|
|
312
|
+
return toString.call(it).slice(8, -1);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
var _isArray = Array.isArray || function isArray(arg) {
|
|
316
|
+
return _cof(arg) == 'Array';
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
_export(_export.S, 'Array', { isArray: _isArray });
|
|
320
|
+
|
|
321
|
+
var isArray = _core.Array.isArray;
|
|
322
|
+
|
|
323
|
+
var isArray$1 = isArray;
|
|
324
|
+
|
|
325
|
+
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
|
|
326
|
+
window.setTimeout(callback, 1000 / 60);
|
|
327
|
+
};
|
|
328
|
+
var cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {
|
|
329
|
+
window.clearTimeout(id);
|
|
330
|
+
};
|
|
331
|
+
var copyText = function copyText(text) {
|
|
332
|
+
var textarea = document.createElement('textarea');
|
|
333
|
+
document.body.appendChild(textarea);
|
|
334
|
+
textarea.value = text;
|
|
335
|
+
textarea.select();
|
|
336
|
+
if (document.execCommand('copy')) {
|
|
337
|
+
document.execCommand('copy');
|
|
338
|
+
} else {
|
|
339
|
+
console.warn('unsupported this function, please use Google Chrome.');
|
|
340
|
+
}
|
|
341
|
+
document.body.removeChild(textarea);
|
|
342
|
+
};
|
|
343
|
+
function checkOverflow(el) {
|
|
344
|
+
if (!el) return false;
|
|
345
|
+
var createDom = function createDom(el, css) {
|
|
346
|
+
var dom = document.createElement('div');
|
|
347
|
+
var width = _parseFloat$2(css['width']) ? Math.ceil(_parseFloat$2(css['width'])) + 'px' : css['width'];
|
|
348
|
+
dom.style.cssText = "\n width: ".concat(width, ";\n line-height: ").concat(css['line-height'], ";\n font-size: ").concat(css['font-size'], ";\n word-break: ").concat(css['word-break'], ";\n padding: ").concat(css['padding'], ";\n ");
|
|
349
|
+
dom.textContent = el.textContent;
|
|
350
|
+
return dom;
|
|
351
|
+
};
|
|
352
|
+
var isOverflow = false;
|
|
353
|
+
try {
|
|
354
|
+
var css = window.getComputedStyle(el, null);
|
|
355
|
+
var lineClamp = css.webkitLineClamp;
|
|
356
|
+
if (lineClamp !== 'none') {
|
|
357
|
+
var targetHeight = _parseFloat$2(css.height);
|
|
358
|
+
var dom = createDom(el, css);
|
|
359
|
+
document.body.appendChild(dom);
|
|
360
|
+
var domHeight = window.getComputedStyle(dom, null)['height'];
|
|
361
|
+
document.body.removeChild(dom);
|
|
362
|
+
isOverflow = targetHeight < _parseFloat$2(domHeight);
|
|
363
|
+
} else {
|
|
364
|
+
isOverflow = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
|
|
365
|
+
}
|
|
366
|
+
} catch (e) {
|
|
367
|
+
console.warn('There is an error when check element overflow state: ', e);
|
|
368
|
+
}
|
|
369
|
+
return isOverflow;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
var _toObject = function (it) {
|
|
373
|
+
return Object(_defined(it));
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
377
|
+
return _cof(it) == 'String' ? it.split('') : Object(it);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
var _toIobject = function (it) {
|
|
381
|
+
return _iobject(_defined(it));
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
var ceil = Math.ceil;
|
|
385
|
+
var floor = Math.floor;
|
|
386
|
+
var _toInteger = function (it) {
|
|
387
|
+
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
var min = Math.min;
|
|
391
|
+
var _toLength = function (it) {
|
|
392
|
+
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
var max = Math.max;
|
|
396
|
+
var min$1 = Math.min;
|
|
397
|
+
var _toAbsoluteIndex = function (index, length) {
|
|
398
|
+
index = _toInteger(index);
|
|
399
|
+
return index < 0 ? max(index + length, 0) : min$1(index, length);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
var _arrayIncludes = function (IS_INCLUDES) {
|
|
403
|
+
return function ($this, el, fromIndex) {
|
|
404
|
+
var O = _toIobject($this);
|
|
405
|
+
var length = _toLength(O.length);
|
|
406
|
+
var index = _toAbsoluteIndex(fromIndex, length);
|
|
407
|
+
var value;
|
|
408
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
409
|
+
value = O[index++];
|
|
410
|
+
if (value != value) return true;
|
|
411
|
+
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
412
|
+
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
413
|
+
} return !IS_INCLUDES && -1;
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
var _shared = createCommonjsModule(function (module) {
|
|
418
|
+
var SHARED = '__core-js_shared__';
|
|
419
|
+
var store = _global[SHARED] || (_global[SHARED] = {});
|
|
420
|
+
(module.exports = function (key, value) {
|
|
421
|
+
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
422
|
+
})('versions', []).push({
|
|
423
|
+
version: _core.version,
|
|
424
|
+
mode: 'pure' ,
|
|
425
|
+
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
var id = 0;
|
|
430
|
+
var px = Math.random();
|
|
431
|
+
var _uid = function (key) {
|
|
432
|
+
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
var shared = _shared('keys');
|
|
436
|
+
var _sharedKey = function (key) {
|
|
437
|
+
return shared[key] || (shared[key] = _uid(key));
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
var arrayIndexOf = _arrayIncludes(false);
|
|
441
|
+
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
442
|
+
var _objectKeysInternal = function (object, names) {
|
|
443
|
+
var O = _toIobject(object);
|
|
444
|
+
var i = 0;
|
|
445
|
+
var result = [];
|
|
446
|
+
var key;
|
|
447
|
+
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
|
|
448
|
+
while (names.length > i) if (_has(O, key = names[i++])) {
|
|
449
|
+
~arrayIndexOf(result, key) || result.push(key);
|
|
450
|
+
}
|
|
451
|
+
return result;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
var _enumBugKeys = (
|
|
455
|
+
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
456
|
+
).split(',');
|
|
457
|
+
|
|
458
|
+
var _objectKeys = Object.keys || function keys(O) {
|
|
459
|
+
return _objectKeysInternal(O, _enumBugKeys);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
var _objectSap = function (KEY, exec) {
|
|
463
|
+
var fn = (_core.Object || {})[KEY] || Object[KEY];
|
|
464
|
+
var exp = {};
|
|
465
|
+
exp[KEY] = exec(fn);
|
|
466
|
+
_export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
_objectSap('keys', function () {
|
|
470
|
+
return function keys(it) {
|
|
471
|
+
return _objectKeys(_toObject(it));
|
|
472
|
+
};
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
var keys = _core.Object.keys;
|
|
476
|
+
|
|
477
|
+
var keys$1 = keys;
|
|
478
|
+
|
|
479
|
+
var rApply = (_global.Reflect || {}).apply;
|
|
480
|
+
var fApply = Function.apply;
|
|
481
|
+
_export(_export.S + _export.F * !_fails(function () {
|
|
482
|
+
rApply(function () { });
|
|
483
|
+
}), 'Reflect', {
|
|
484
|
+
apply: function apply(target, thisArgument, argumentsList) {
|
|
485
|
+
var T = _aFunction(target);
|
|
486
|
+
var L = _anObject(argumentsList);
|
|
487
|
+
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
var apply = _core.Reflect.apply;
|
|
492
|
+
|
|
493
|
+
var apply$1 = apply;
|
|
494
|
+
|
|
495
|
+
var IMessageActionType = {
|
|
496
|
+
ASSISTANT: 'assistant',
|
|
497
|
+
DETAILS: 'details',
|
|
498
|
+
FIX: 'fix',
|
|
499
|
+
CLOSE: 'close'
|
|
500
|
+
};
|
|
501
|
+
var MessageContentType = {
|
|
502
|
+
KEY_VALUE: 'key-value',
|
|
503
|
+
JSON: 'json'
|
|
504
|
+
};
|
|
505
|
+
var sortActionIdList = [IMessageActionType.ASSISTANT, IMessageActionType.DETAILS, IMessageActionType.FIX, IMessageActionType.CLOSE];
|
|
506
|
+
var MessageAdvanced = {
|
|
507
|
+
name: 'bk-message-advanced',
|
|
508
|
+
mixins: [locale.mixin],
|
|
509
|
+
props: {
|
|
510
|
+
message: {
|
|
511
|
+
type: Object,
|
|
512
|
+
default: function _default() {
|
|
513
|
+
return {};
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
actions: {
|
|
517
|
+
type: Array,
|
|
518
|
+
default: function _default() {
|
|
519
|
+
return [];
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
tipsIcon: {
|
|
523
|
+
type: String,
|
|
524
|
+
default: ''
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
data: function data() {
|
|
528
|
+
return {
|
|
529
|
+
toolOperation: {
|
|
530
|
+
isFix: false,
|
|
531
|
+
isDetailShow: false
|
|
532
|
+
},
|
|
533
|
+
isInstallClipboardJS: false,
|
|
534
|
+
copyStatus: '',
|
|
535
|
+
copyStatusTimer: null
|
|
536
|
+
};
|
|
537
|
+
},
|
|
538
|
+
computed: {
|
|
539
|
+
defActionList: function defActionList() {
|
|
540
|
+
var _this = this,
|
|
541
|
+
_ref;
|
|
542
|
+
return _ref = {}, _defineProperty(_ref, IMessageActionType.ASSISTANT, {
|
|
543
|
+
id: IMessageActionType.ASSISTANT,
|
|
544
|
+
icon: function icon(h) {
|
|
545
|
+
return h('span', {
|
|
546
|
+
class: 'bk-icon icon-weixin-pro'
|
|
547
|
+
});
|
|
548
|
+
},
|
|
549
|
+
text: function text() {
|
|
550
|
+
return _this.t('bk.message.assistant');
|
|
551
|
+
},
|
|
552
|
+
onClick: function onClick(e) {
|
|
553
|
+
return _this.handleHeplerClick(e);
|
|
554
|
+
}
|
|
555
|
+
}), _defineProperty(_ref, IMessageActionType.DETAILS, {
|
|
556
|
+
id: IMessageActionType.DETAILS,
|
|
557
|
+
icon: function icon(h) {
|
|
558
|
+
return _this.toolOperation.isDetailShow ? h('span', {
|
|
559
|
+
class: 'bk-icon icon-angle-double-up'
|
|
560
|
+
}) : h('span', {
|
|
561
|
+
class: 'bk-icon icon-angle-double-down'
|
|
562
|
+
});
|
|
563
|
+
},
|
|
564
|
+
text: function text() {
|
|
565
|
+
return _this.t('bk.message.details');
|
|
566
|
+
},
|
|
567
|
+
onClick: function onClick(e) {
|
|
568
|
+
return _this.setDetailsShow(e);
|
|
569
|
+
}
|
|
570
|
+
}), _defineProperty(_ref, IMessageActionType.FIX, {
|
|
571
|
+
id: IMessageActionType.FIX,
|
|
572
|
+
icon: function icon(h) {
|
|
573
|
+
return _this.toolOperation.isFix ? h('span', {
|
|
574
|
+
class: 'bk-icon icon-fix-shape'
|
|
575
|
+
}) : h('span', {
|
|
576
|
+
class: 'bk-icon icon-fix-line'
|
|
577
|
+
});
|
|
578
|
+
},
|
|
579
|
+
classList: this.toolOperation.isFix ? 'fixed' : '',
|
|
580
|
+
onClick: function onClick(e) {
|
|
581
|
+
return _this.fixMesage(e);
|
|
582
|
+
}
|
|
583
|
+
}), _defineProperty(_ref, IMessageActionType.CLOSE, {
|
|
584
|
+
id: IMessageActionType.CLOSE,
|
|
585
|
+
classList: 'normal-color',
|
|
586
|
+
icon: function icon(h) {
|
|
587
|
+
return h('span', {
|
|
588
|
+
class: 'bk-message-close'
|
|
589
|
+
}, [h('i', {
|
|
590
|
+
class: 'bk-icon icon-close'
|
|
591
|
+
})]);
|
|
592
|
+
},
|
|
593
|
+
onClick: this.handleCloseClick
|
|
594
|
+
}), _ref;
|
|
595
|
+
},
|
|
596
|
+
actionList: function actionList() {
|
|
597
|
+
var _this2 = this;
|
|
598
|
+
if (this.actions && this.actions.length > 0) {
|
|
599
|
+
var resultList = this.actions.map(function (action) {
|
|
600
|
+
var id = action.id.toLocaleLowerCase();
|
|
601
|
+
var defAction = _this2.defActionList[id];
|
|
602
|
+
var defClickFn = defAction.onClick;
|
|
603
|
+
var target = _extends({}, _this2.defActionList[id] || {}, action);
|
|
604
|
+
target.id = id;
|
|
605
|
+
if (action.classList !== undefined) {
|
|
606
|
+
var classList = isArray$1(action.classList) ? action.classList : [action.classList];
|
|
607
|
+
var defClassList = [];
|
|
608
|
+
if (defAction.classList !== undefined) {
|
|
609
|
+
defClassList = isArray$1(defAction.classList) ? defAction.classList : [defAction.classList];
|
|
610
|
+
}
|
|
611
|
+
target.classList = [].concat(_toConsumableArray(defClassList), _toConsumableArray(classList));
|
|
612
|
+
}
|
|
613
|
+
if (typeof action.onClick === 'function') {
|
|
614
|
+
target.onClick = function () {
|
|
615
|
+
var resp = apply$1(action.onClick, _this2, []);
|
|
616
|
+
if ((typeof resp === 'undefined' || resp) && typeof defClickFn === 'function') {
|
|
617
|
+
apply$1(defClickFn, _this2, []);
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
return target;
|
|
621
|
+
}
|
|
622
|
+
target.onClick = defClickFn;
|
|
623
|
+
return target;
|
|
624
|
+
});
|
|
625
|
+
var appendList = sortActionIdList.filter(function (id) {
|
|
626
|
+
return !resultList.some(function (action) {
|
|
627
|
+
return action.id === id;
|
|
628
|
+
});
|
|
629
|
+
}).map(function (id) {
|
|
630
|
+
return _this2.defActionList[id];
|
|
631
|
+
});
|
|
632
|
+
resultList.push.apply(resultList, _toConsumableArray(appendList));
|
|
633
|
+
return resultList;
|
|
634
|
+
}
|
|
635
|
+
return sortActionIdList.map(function (id) {
|
|
636
|
+
return _this2.defActionList[id];
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
methods: {
|
|
641
|
+
handleCloseClick: function handleCloseClick() {
|
|
642
|
+
this.$emit('close');
|
|
643
|
+
},
|
|
644
|
+
handleHeplerClick: function handleHeplerClick(e) {
|
|
645
|
+
if (this.message.assistant) {
|
|
646
|
+
window.open(this.message.assistant, '_blank');
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
setDetailsShow: function setDetailsShow(e, isShow) {
|
|
650
|
+
var _this3 = this;
|
|
651
|
+
this.toolOperation.isDetailShow = isShow !== undefined ? isShow : !this.toolOperation.isDetailShow;
|
|
652
|
+
this.fixMesage(e, this.toolOperation.isDetailShow);
|
|
653
|
+
if (this.toolOperation.isDetailShow && _typeof(this.message) === 'object' && (this.message.type === MessageContentType.JSON || !this.message.type)) {
|
|
654
|
+
var targetJson = this.parseJson(this.message.details);
|
|
655
|
+
var formatter = new JSONFormatter(targetJson);
|
|
656
|
+
setTimeout(function () {
|
|
657
|
+
if (_this3.$refs.refJsonContent) {
|
|
658
|
+
_this3.$refs.refJsonContent.innerHTML = '';
|
|
659
|
+
_this3.$refs.refJsonContent.append(formatter.render());
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
fixMesage: function fixMesage(e, isFix) {
|
|
665
|
+
this.toolOperation.isFix = isFix !== undefined ? isFix : !this.toolOperation.isFix;
|
|
666
|
+
this.$emit('fix-message', this.toolOperation.isFix);
|
|
667
|
+
},
|
|
668
|
+
parseJson: function parseJson(value) {
|
|
669
|
+
var targetJson = value;
|
|
670
|
+
if (typeof value === 'string') {
|
|
671
|
+
try {
|
|
672
|
+
targetJson = JSON.parse(value);
|
|
673
|
+
} catch (e) {
|
|
674
|
+
console.error("Format Json Error: ".concat(e));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return targetJson;
|
|
678
|
+
},
|
|
679
|
+
copyMessage: function copyMessage() {
|
|
680
|
+
var _this4 = this;
|
|
681
|
+
if (this.isInstallClipboardJS) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
var copyInstance = new ClipboardJS(this.$refs.refCopyMsgDiv, {
|
|
685
|
+
text: function text() {
|
|
686
|
+
return _this4.message.details;
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
['success', 'error'].forEach(function (theme) {
|
|
690
|
+
copyInstance.on(theme, function () {
|
|
691
|
+
var target = _this4.$refs.refCopyStatus;
|
|
692
|
+
_this4.copyStatus = theme;
|
|
693
|
+
if (target) {
|
|
694
|
+
var _target$classList, _target$classList2;
|
|
695
|
+
(_target$classList = target.classList).remove.apply(_target$classList, ['success', 'error', 'is-hidden']);
|
|
696
|
+
(_target$classList2 = target.classList).add.apply(_target$classList2, [theme, 'is-show']);
|
|
697
|
+
_this4.copyStatusTimer && clearTimeout(_this4.copyStatusTimer);
|
|
698
|
+
_this4.copyStatusTimer = setTimeout(function () {
|
|
699
|
+
var _target$classList3, _target$classList4;
|
|
700
|
+
(_target$classList3 = target.classList).remove.apply(_target$classList3, ['is-show']);
|
|
701
|
+
(_target$classList4 = target.classList).add.apply(_target$classList4, ['is-hidden']);
|
|
702
|
+
}, 2000);
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
_this4.isInstallClipboardJS = true;
|
|
706
|
+
setTimeout(function () {
|
|
707
|
+
_this4.$refs.refCopyMsgDiv.click();
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
render: function render(h) {
|
|
713
|
+
var _this5 = this;
|
|
714
|
+
var renderMsgDetail = function renderMsgDetail(msg) {
|
|
715
|
+
if (msg.type === MessageContentType.KEY_VALUE) {
|
|
716
|
+
var target = _this5.parseJson(msg.details || {});
|
|
717
|
+
var keys = keys$1(target);
|
|
718
|
+
return keys.map(function (key) {
|
|
719
|
+
return h('div', {
|
|
720
|
+
class: 'message-row'
|
|
721
|
+
}, [h('label', key), target[key]]);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
return null;
|
|
725
|
+
};
|
|
726
|
+
var renderMessageActions = function renderMessageActions() {
|
|
727
|
+
var renderIcon = function renderIcon(_ref2) {
|
|
728
|
+
var icon = _ref2.icon;
|
|
729
|
+
if (typeof icon === 'function') {
|
|
730
|
+
return apply$1(icon, _this5, [h]);
|
|
731
|
+
}
|
|
732
|
+
return h('span', {
|
|
733
|
+
class: icon
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
var renderText = function renderText(_ref3) {
|
|
737
|
+
var text = _ref3.text;
|
|
738
|
+
var content;
|
|
739
|
+
if (typeof text === 'function') {
|
|
740
|
+
content = apply$1(text, _this5, [h]);
|
|
741
|
+
}
|
|
742
|
+
if (content === undefined) {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
if (typeof content === 'string') {
|
|
746
|
+
return h('span', {
|
|
747
|
+
class: 'message-action-text'
|
|
748
|
+
}, [content]);
|
|
749
|
+
}
|
|
750
|
+
return content;
|
|
751
|
+
};
|
|
752
|
+
var handleActionClick = function handleActionClick(e, action) {
|
|
753
|
+
if (action.readonly || action.disabled) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
if (typeof action.onClick === 'function') {
|
|
757
|
+
apply$1(action.onClick, _this5, [e, action]);
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
var renderActionList = function renderActionList() {
|
|
761
|
+
return _this5.actionList.map(function (action) {
|
|
762
|
+
if (action.disabled) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
if (typeof action.render === 'function') {
|
|
766
|
+
return apply$1(action.render, _this5, []);
|
|
767
|
+
}
|
|
768
|
+
var classList = isArray$1(action.classList) ? action.classList.join(' ') : action.classList;
|
|
769
|
+
return h('div', {
|
|
770
|
+
class: ['tool', action.id, classList],
|
|
771
|
+
on: {
|
|
772
|
+
click: function click(e) {
|
|
773
|
+
return handleActionClick(e, action);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}, [renderIcon(action), renderText(action)]);
|
|
777
|
+
});
|
|
778
|
+
};
|
|
779
|
+
return renderActionList();
|
|
780
|
+
};
|
|
781
|
+
var iconMap = {
|
|
782
|
+
success: 'bk-icon icon-check-circle-shape',
|
|
783
|
+
error: 'bk-icon icon-close-circle-shape'
|
|
784
|
+
};
|
|
785
|
+
return h('div', {
|
|
786
|
+
class: 'bk-message-content multi'
|
|
787
|
+
}, [h('div', {
|
|
788
|
+
class: 'overview'
|
|
789
|
+
}, [h('div', {
|
|
790
|
+
class: 'left-content'
|
|
791
|
+
}, [h('div', {
|
|
792
|
+
class: 'bk-message-icon'
|
|
793
|
+
}, [h('i', {
|
|
794
|
+
class: ['bk-icon', this.tipsIcon]
|
|
795
|
+
})]), h('div', {
|
|
796
|
+
class: 'describe'
|
|
797
|
+
}, this.message.title || "\u3010".concat(this.message.code, "\u3011").concat(this.message.overview, " ").concat(this.message.suggestion))]), h('div', {
|
|
798
|
+
class: 'tools'
|
|
799
|
+
}, [renderMessageActions()])]), this.toolOperation.isDetailShow ? h('div', {
|
|
800
|
+
class: 'message-detail'
|
|
801
|
+
}, [h('div', {
|
|
802
|
+
class: 'message-copy',
|
|
803
|
+
ref: 'refCopyMsgDiv',
|
|
804
|
+
on: {
|
|
805
|
+
click: this.copyMessage
|
|
806
|
+
}
|
|
807
|
+
}, [h('span', {
|
|
808
|
+
class: 'bk-icon icon-copy-shape'
|
|
809
|
+
}), h('div', {
|
|
810
|
+
class: ['copy-status', this.copyStatus],
|
|
811
|
+
ref: 'refCopyStatus'
|
|
812
|
+
}, [h('div', {
|
|
813
|
+
class: 'inner'
|
|
814
|
+
}, [h('span', {
|
|
815
|
+
class: [iconMap[this.copyStatus], this.copyStatus]
|
|
816
|
+
}), this.copyStatus === 'success' ? this.t('bk.message.copySuccess') : this.t('bk.message.copyFailed')])])]), h('div', {
|
|
817
|
+
class: 'message-tree',
|
|
818
|
+
ref: 'refJsonContent'
|
|
819
|
+
}, [renderMsgDetail(this.message)])]) : null]);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
var ICONS = {
|
|
824
|
+
primary: 'icon-info-circle-shape',
|
|
825
|
+
error: 'icon-close-circle-shape',
|
|
826
|
+
warning: 'icon-exclamation-circle-shape',
|
|
827
|
+
success: 'icon-check-circle-shape'
|
|
828
|
+
};
|
|
829
|
+
var script = {
|
|
830
|
+
name: 'bk-message',
|
|
831
|
+
components: {
|
|
832
|
+
MessageAdvanced: MessageAdvanced
|
|
833
|
+
},
|
|
834
|
+
mixins: [locale.mixin],
|
|
835
|
+
data: function data() {
|
|
836
|
+
return {
|
|
837
|
+
theme: 'primary',
|
|
838
|
+
message: '',
|
|
839
|
+
delay: 3000,
|
|
840
|
+
icon: '',
|
|
841
|
+
dismissable: true,
|
|
842
|
+
verticalOffset: 0,
|
|
843
|
+
zIndex: 2500,
|
|
844
|
+
horizonOffset: 0,
|
|
845
|
+
visible: false,
|
|
846
|
+
countID: null,
|
|
847
|
+
onClose: function onClose() {},
|
|
848
|
+
extCls: '',
|
|
849
|
+
copied: false,
|
|
850
|
+
ellipsisCopy: false,
|
|
851
|
+
showCopyText: false,
|
|
852
|
+
showAdvanced: false,
|
|
853
|
+
actions: [],
|
|
854
|
+
isFixed: false,
|
|
855
|
+
width: 560
|
|
856
|
+
};
|
|
857
|
+
},
|
|
858
|
+
computed: {
|
|
859
|
+
themeClass: function themeClass() {
|
|
860
|
+
return "bk-message-".concat(this.theme);
|
|
861
|
+
},
|
|
862
|
+
verticalStyle: function verticalStyle() {
|
|
863
|
+
return {
|
|
864
|
+
top: "".concat(this.verticalOffset, "px"),
|
|
865
|
+
width: "".concat(this.width, "px"),
|
|
866
|
+
zIndex: this.zIndex
|
|
867
|
+
};
|
|
868
|
+
},
|
|
869
|
+
tipsIcon: function tipsIcon() {
|
|
870
|
+
return this.icon || ICONS[this.theme];
|
|
871
|
+
},
|
|
872
|
+
singleEllipsis: function singleEllipsis() {
|
|
873
|
+
return this.ellipsisLine === 1;
|
|
874
|
+
},
|
|
875
|
+
multiEllipsis: function multiEllipsis() {
|
|
876
|
+
return this.ellipsisLine > 1;
|
|
877
|
+
},
|
|
878
|
+
ellipsisStyle: function ellipsisStyle() {
|
|
879
|
+
return {
|
|
880
|
+
'--line': this.ellipsisLine
|
|
881
|
+
};
|
|
882
|
+
},
|
|
883
|
+
localeCopyText: function localeCopyText() {
|
|
884
|
+
return this.copied ? this.t('bk.message.copied') : this.t('bk.message.copy');
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
mounted: function mounted() {
|
|
888
|
+
this.startCountDown();
|
|
889
|
+
},
|
|
890
|
+
methods: {
|
|
891
|
+
handleFixMessage: function handleFixMessage(isFixed) {
|
|
892
|
+
this.isFixed = isFixed;
|
|
893
|
+
console.log('handleFixMessage', isFixed);
|
|
894
|
+
if (isFixed) {
|
|
895
|
+
this.stopCountDown();
|
|
896
|
+
} else {
|
|
897
|
+
this.startCountDown();
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
destroyEl: function destroyEl() {
|
|
901
|
+
this.$destroy();
|
|
902
|
+
this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
|
|
903
|
+
},
|
|
904
|
+
startCountDown: function startCountDown() {
|
|
905
|
+
var _this = this;
|
|
906
|
+
if (this.delay > 0 && !this.isFixed) {
|
|
907
|
+
this.countID = setTimeout(function () {
|
|
908
|
+
console.log('--Close');
|
|
909
|
+
_this.visible && _this.close();
|
|
910
|
+
}, this.delay);
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
stopCountDown: function stopCountDown() {
|
|
914
|
+
console.log('--stopCountDown');
|
|
915
|
+
clearTimeout(this.countID);
|
|
916
|
+
},
|
|
917
|
+
close: function close() {
|
|
918
|
+
this.visible = false;
|
|
919
|
+
typeof this.onClose === 'function' && this.onClose();
|
|
920
|
+
},
|
|
921
|
+
copyContent: function copyContent() {
|
|
922
|
+
if (!this.$refs.content || this.copied) return;
|
|
923
|
+
var text = this.$refs.content.textContent;
|
|
924
|
+
copyText(text);
|
|
925
|
+
this.copied = true;
|
|
926
|
+
},
|
|
927
|
+
setShowCopyText: function setShowCopyText() {
|
|
928
|
+
this.showCopyText = this.ellipsisCopy && checkOverflow(this.$refs.content);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
934
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
935
|
+
if (typeof shadowMode !== 'boolean') {
|
|
936
|
+
createInjectorSSR = createInjector;
|
|
937
|
+
createInjector = shadowMode;
|
|
938
|
+
shadowMode = false;
|
|
939
|
+
}
|
|
940
|
+
var options = typeof script === 'function' ? script.options : script;
|
|
941
|
+
if (template && template.render) {
|
|
942
|
+
options.render = template.render;
|
|
943
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
944
|
+
options._compiled = true;
|
|
945
|
+
if (isFunctionalTemplate) {
|
|
946
|
+
options.functional = true;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
if (scopeId) {
|
|
950
|
+
options._scopeId = scopeId;
|
|
951
|
+
}
|
|
952
|
+
var hook;
|
|
953
|
+
if (moduleIdentifier) {
|
|
954
|
+
hook = function hook(context) {
|
|
955
|
+
context = context ||
|
|
956
|
+
this.$vnode && this.$vnode.ssrContext ||
|
|
957
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
958
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
959
|
+
context = __VUE_SSR_CONTEXT__;
|
|
960
|
+
}
|
|
961
|
+
if (style) {
|
|
962
|
+
style.call(this, createInjectorSSR(context));
|
|
963
|
+
}
|
|
964
|
+
if (context && context._registeredComponents) {
|
|
965
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
options._ssrRegister = hook;
|
|
969
|
+
} else if (style) {
|
|
970
|
+
hook = shadowMode ? function () {
|
|
971
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
972
|
+
} : function (context) {
|
|
973
|
+
style.call(this, createInjector(context));
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
if (hook) {
|
|
977
|
+
if (options.functional) {
|
|
978
|
+
var originalRender = options.render;
|
|
979
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
980
|
+
hook.call(context);
|
|
981
|
+
return originalRender(h, context);
|
|
982
|
+
};
|
|
983
|
+
} else {
|
|
984
|
+
var existing = options.beforeCreate;
|
|
985
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return script;
|
|
989
|
+
}
|
|
990
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
991
|
+
|
|
992
|
+
/* script */
|
|
993
|
+
var __vue_script__ = script;
|
|
994
|
+
/* template */
|
|
995
|
+
var __vue_render__ = function __vue_render__() {
|
|
996
|
+
var _vm = this;
|
|
997
|
+
var _h = _vm.$createElement;
|
|
998
|
+
var _c = _vm._self._c || _h;
|
|
999
|
+
return _c('transition', {
|
|
1000
|
+
attrs: {
|
|
1001
|
+
"name": "vertical-move"
|
|
1002
|
+
},
|
|
1003
|
+
on: {
|
|
1004
|
+
"after-leave": _vm.destroyEl,
|
|
1005
|
+
"enter": _vm.setShowCopyText
|
|
1006
|
+
}
|
|
1007
|
+
}, [_c('div', {
|
|
1008
|
+
directives: [{
|
|
1009
|
+
name: "show",
|
|
1010
|
+
rawName: "v-show",
|
|
1011
|
+
value: _vm.visible,
|
|
1012
|
+
expression: "visible"
|
|
1013
|
+
}],
|
|
1014
|
+
class: ['bk-message', _vm.themeClass, _vm.extCls],
|
|
1015
|
+
style: _vm.verticalStyle,
|
|
1016
|
+
on: {
|
|
1017
|
+
"mouseenter": _vm.stopCountDown,
|
|
1018
|
+
"mouseleave": _vm.startCountDown
|
|
1019
|
+
}
|
|
1020
|
+
}, [_vm.showAdvanced ? [_c('message-advanced', {
|
|
1021
|
+
attrs: {
|
|
1022
|
+
"message": _vm.message,
|
|
1023
|
+
"actions": _vm.actions,
|
|
1024
|
+
"tips-icon": _vm.tipsIcon
|
|
1025
|
+
},
|
|
1026
|
+
on: {
|
|
1027
|
+
"fix-message": _vm.handleFixMessage,
|
|
1028
|
+
"close": _vm.close
|
|
1029
|
+
}
|
|
1030
|
+
})] : [_c('div', {
|
|
1031
|
+
staticClass: "bk-message-icon"
|
|
1032
|
+
}, [_c('i', {
|
|
1033
|
+
class: ['bk-icon', _vm.tipsIcon]
|
|
1034
|
+
})]), _c('div', {
|
|
1035
|
+
ref: "content",
|
|
1036
|
+
class: ['bk-message-content', {
|
|
1037
|
+
'multi-ellipsis': _vm.multiEllipsis,
|
|
1038
|
+
'ellipsis': _vm.singleEllipsis
|
|
1039
|
+
}],
|
|
1040
|
+
style: _vm.ellipsisStyle
|
|
1041
|
+
}, [_vm._t("default", function () {
|
|
1042
|
+
return [_vm._v(_vm._s(_vm.message))];
|
|
1043
|
+
})], 2), _vm.showCopyText ? _c('div', {
|
|
1044
|
+
class: ['bk-message-copy', {
|
|
1045
|
+
'copied': _vm.copied
|
|
1046
|
+
}],
|
|
1047
|
+
on: {
|
|
1048
|
+
"click": _vm.copyContent
|
|
1049
|
+
}
|
|
1050
|
+
}, [_vm._v("\n " + _vm._s(_vm.localeCopyText) + "\n ")]) : _vm._e(), _vm.dismissable ? _c('div', {
|
|
1051
|
+
staticClass: "bk-message-close"
|
|
1052
|
+
}, [_c('i', {
|
|
1053
|
+
class: ['bk-icon icon-close', _vm.showCopyText ? 'ml10' : 'ml30'],
|
|
1054
|
+
on: {
|
|
1055
|
+
"click": function click($event) {
|
|
1056
|
+
$event.stopPropagation();
|
|
1057
|
+
return _vm.close.apply(null, arguments);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
})]) : _vm._e()]], 2)]);
|
|
1061
|
+
};
|
|
1062
|
+
var __vue_staticRenderFns__ = [];
|
|
1063
|
+
|
|
1064
|
+
/* style */
|
|
1065
|
+
var __vue_inject_styles__ = undefined;
|
|
1066
|
+
/* scoped */
|
|
1067
|
+
var __vue_scope_id__ = undefined;
|
|
1068
|
+
/* module identifier */
|
|
1069
|
+
var __vue_module_identifier__ = undefined;
|
|
1070
|
+
/* functional template */
|
|
1071
|
+
var __vue_is_functional_template__ = false;
|
|
1072
|
+
/* style inject */
|
|
1073
|
+
|
|
1074
|
+
/* style inject SSR */
|
|
1075
|
+
|
|
1076
|
+
/* style inject shadow dom */
|
|
1077
|
+
|
|
1078
|
+
var __vue_component__ = /*#__PURE__*/normalizeComponent_1({
|
|
1079
|
+
render: __vue_render__,
|
|
1080
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
1081
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
1082
|
+
|
|
1083
|
+
var MessageComponent = Vue.extend(__vue_component__);
|
|
1084
|
+
var messageList = [];
|
|
1085
|
+
var seed = 0;
|
|
1086
|
+
var BkMessage = function BkMessage(config) {
|
|
1087
|
+
var originConfig = _typeof(config) === 'object' ? JSON.parse(stringify$1(config)) : config;
|
|
1088
|
+
if (config.limit === 0) {
|
|
1089
|
+
BkMessage.batchClose();
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (config.limit > 0) {
|
|
1093
|
+
BkMessage.batchClose(config.limit);
|
|
1094
|
+
}
|
|
1095
|
+
var instanceId = "messageInstance_".concat(now$1(), "_").concat(seed++);
|
|
1096
|
+
var offsetY = _parseInt$2(config.offsetY) || 30;
|
|
1097
|
+
var spacing = _parseInt$2(config.spacing) || 10;
|
|
1098
|
+
if (config.ellipsisLine === null || config.ellipsisLine === undefined || config.ellipsisLine === '' || isNaN(config.ellipsisLine)) {
|
|
1099
|
+
config.ellipsisLine = 1;
|
|
1100
|
+
}
|
|
1101
|
+
var ellipsisLine = config.ellipsisLine;
|
|
1102
|
+
var verticalOffset = offsetY;
|
|
1103
|
+
if (typeof config === 'string' || typeof config === 'number') {
|
|
1104
|
+
config = {
|
|
1105
|
+
message: config
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
var configClose = config.onClose;
|
|
1109
|
+
config.onClose = function () {
|
|
1110
|
+
BkMessage.close(instanceId, configClose);
|
|
1111
|
+
};
|
|
1112
|
+
var instance = new MessageComponent({
|
|
1113
|
+
data: config
|
|
1114
|
+
});
|
|
1115
|
+
if (originConfig.message !== null && _typeof(originConfig.message) === 'object' && originConfig.message.hasOwnProperty('componentOptions')) {
|
|
1116
|
+
instance.$slots.default = [config.message];
|
|
1117
|
+
instance.message = null;
|
|
1118
|
+
}
|
|
1119
|
+
if (!originConfig.width) {
|
|
1120
|
+
instance.width = 560;
|
|
1121
|
+
}
|
|
1122
|
+
if (originConfig.message !== null && _typeof(originConfig.message) === 'object' && !originConfig.message.hasOwnProperty('componentOptions')) {
|
|
1123
|
+
instance.showAdvanced = true;
|
|
1124
|
+
instance.actions = originConfig.actions || [];
|
|
1125
|
+
if (!originConfig.width) {
|
|
1126
|
+
instance.width = 800;
|
|
1127
|
+
}
|
|
1128
|
+
if (!originConfig.delay) {
|
|
1129
|
+
instance.delay = 8000;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
instance.id = instanceId;
|
|
1133
|
+
instance.spacing = spacing;
|
|
1134
|
+
instance.ellipsisLine = ellipsisLine;
|
|
1135
|
+
instance.verticalOffset = 0;
|
|
1136
|
+
instance.$mount();
|
|
1137
|
+
instance.dom = instance.$el;
|
|
1138
|
+
document.body.appendChild(instance.$el);
|
|
1139
|
+
messageList.forEach(function (item) {
|
|
1140
|
+
verticalOffset += _parseInt$2(item.$el.offsetHeight) + _parseInt$2(spacing);
|
|
1141
|
+
});
|
|
1142
|
+
instance.verticalOffset = verticalOffset;
|
|
1143
|
+
instance.horizonOffset = spacing;
|
|
1144
|
+
instance.visible = true;
|
|
1145
|
+
messageList.push(instance);
|
|
1146
|
+
return instance;
|
|
1147
|
+
};
|
|
1148
|
+
BkMessage.close = function (id, configClose) {
|
|
1149
|
+
var instanceIndex = -1;
|
|
1150
|
+
messageList.some(function (item, index) {
|
|
1151
|
+
if (item.id === id) {
|
|
1152
|
+
instanceIndex = index;
|
|
1153
|
+
return true;
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
if (instanceIndex > -1) {
|
|
1157
|
+
var instance = messageList[instanceIndex];
|
|
1158
|
+
if (typeof configClose === 'function') {
|
|
1159
|
+
configClose(instance);
|
|
1160
|
+
}
|
|
1161
|
+
messageList.forEach(function (item, i) {
|
|
1162
|
+
if (i > instanceIndex) {
|
|
1163
|
+
item.verticalOffset -= instance.dom.offsetHeight + instance.spacing;
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
messageList.splice(instanceIndex, 1);
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
BkMessage.batchClose = function () {
|
|
1170
|
+
var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1171
|
+
var len = messageList.length;
|
|
1172
|
+
if (limit <= len) {
|
|
1173
|
+
var InstancesShouldClose = messageList.slice(0, len - limit + 1);
|
|
1174
|
+
InstancesShouldClose.forEach(function (item) {
|
|
1175
|
+
item.close();
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
Vue.prototype.$bkMessage = BkMessage;
|
|
1180
|
+
|
|
1181
|
+
exports.default = BkMessage;
|
|
1182
|
+
|
|
1183
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
625
1184
|
|
|
626
1185
|
}));
|