bkui-vue 2.0.1 → 2.0.2-beta.10
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/index.cjs.js +23 -23
- package/dist/index.esm.js +5684 -5650
- package/dist/index.umd.js +27 -27
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/cascader/index.js +1669 -181
- package/lib/color-picker/index.js +1613 -170
- package/lib/components.d.ts +1 -2
- package/lib/components.js +1 -2
- package/lib/date-picker/date-picker.css +220 -4
- package/lib/date-picker/date-picker.less +5 -5
- package/lib/date-picker/date-picker.variable.css +237 -21
- package/lib/date-picker/index.js +1882 -470
- package/lib/directives/index.js +228 -111
- package/lib/form/index.js +1570 -162
- package/lib/image/index.js +1468 -164
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -2
- package/lib/input/index.js +1301 -13
- package/lib/pop-confirm/index.d.ts +16 -2
- package/lib/pop-confirm/index.js +13 -5
- package/lib/pop-confirm/pop-confirm.d.ts +5 -1
- package/lib/popover/index.js +1356 -68
- package/lib/search-select/index.js +1329 -108
- package/lib/select/index.js +1237 -16
- package/lib/slider/index.js +2 -1
- package/lib/tab/index.js +1277 -10
- package/lib/table/index.js +1346 -125
- package/lib/tag-input/index.js +1278 -16
- package/lib/tree/index.d.ts +4 -0
- package/lib/tree/index.js +47 -23
- package/lib/tree/props.d.ts +1 -0
- package/lib/tree/tree.css +18 -0
- package/lib/tree/tree.d.ts +2 -0
- package/lib/tree/tree.less +24 -0
- package/lib/tree/tree.variable.css +18 -0
- package/lib/tree/use-node-action.d.ts +1 -1
- package/package.json +1 -1
- package/lib/plugin-popover/index.d.ts +0 -27
- package/lib/plugin-popover/index.js +0 -65
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.js +0 -64
package/lib/image/index.js
CHANGED
@@ -3,13 +3,658 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../sh
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
6
|
-
import * as
|
7
|
-
import * as
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__ from "@popperjs/core";
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__overflow_title_f9bafa47__ from "../overflow-title";
|
8
10
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
9
|
-
|
10
|
-
/******/ var
|
11
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
12
|
+
/******/ var __webpack_modules__ = ({
|
13
|
+
|
14
|
+
/***/ 2439:
|
15
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
16
|
+
|
17
|
+
module.exports = __webpack_require__(2527);
|
18
|
+
|
19
|
+
|
20
|
+
/***/ }),
|
21
|
+
|
22
|
+
/***/ 7430:
|
23
|
+
/***/ ((module) => {
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Copyright (c) 2015, Facebook, Inc.
|
27
|
+
* All rights reserved.
|
28
|
+
*
|
29
|
+
* This source code is licensed under the BSD-style license found in the
|
30
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
31
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
32
|
+
*
|
33
|
+
* @providesModule ExecutionEnvironment
|
34
|
+
*/
|
35
|
+
|
36
|
+
/*jslint evil: true */
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
var canUseDOM = !!(
|
41
|
+
typeof window !== 'undefined' &&
|
42
|
+
window.document &&
|
43
|
+
window.document.createElement
|
44
|
+
);
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Simple, lightweight module assisting with the detection and context of
|
48
|
+
* Worker. Helps avoid circular dependencies and allows code to reason about
|
49
|
+
* whether or not they are in a Worker, even if they never include the main
|
50
|
+
* `ReactWorker` dependency.
|
51
|
+
*/
|
52
|
+
var ExecutionEnvironment = {
|
53
|
+
|
54
|
+
canUseDOM: canUseDOM,
|
55
|
+
|
56
|
+
canUseWorkers: typeof Worker !== 'undefined',
|
57
|
+
|
58
|
+
canUseEventListeners:
|
59
|
+
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
60
|
+
|
61
|
+
canUseViewport: canUseDOM && !!window.screen,
|
62
|
+
|
63
|
+
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
64
|
+
|
65
|
+
};
|
66
|
+
|
67
|
+
module.exports = ExecutionEnvironment;
|
68
|
+
|
69
|
+
|
70
|
+
/***/ }),
|
71
|
+
|
72
|
+
/***/ 6377:
|
73
|
+
/***/ ((module) => {
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Copyright 2004-present Facebook. All Rights Reserved.
|
77
|
+
*
|
78
|
+
* @providesModule UserAgent_DEPRECATED
|
79
|
+
*/
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Provides entirely client-side User Agent and OS detection. You should prefer
|
83
|
+
* the non-deprecated UserAgent module when possible, which exposes our
|
84
|
+
* authoritative server-side PHP-based detection to the client.
|
85
|
+
*
|
86
|
+
* Usage is straightforward:
|
87
|
+
*
|
88
|
+
* if (UserAgent_DEPRECATED.ie()) {
|
89
|
+
* // IE
|
90
|
+
* }
|
91
|
+
*
|
92
|
+
* You can also do version checks:
|
93
|
+
*
|
94
|
+
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
95
|
+
* // IE7 or better
|
96
|
+
* }
|
97
|
+
*
|
98
|
+
* The browser functions will return NaN if the browser does not match, so
|
99
|
+
* you can also do version compares the other way:
|
100
|
+
*
|
101
|
+
* if (UserAgent_DEPRECATED.ie() < 7) {
|
102
|
+
* // IE6 or worse
|
103
|
+
* }
|
104
|
+
*
|
105
|
+
* Note that the version is a float and may include a minor version number,
|
106
|
+
* so you should always use range operators to perform comparisons, not
|
107
|
+
* strict equality.
|
108
|
+
*
|
109
|
+
* **Note:** You should **strongly** prefer capability detection to browser
|
110
|
+
* version detection where it's reasonable:
|
111
|
+
*
|
112
|
+
* http://www.quirksmode.org/js/support.html
|
113
|
+
*
|
114
|
+
* Further, we have a large number of mature wrapper functions and classes
|
115
|
+
* which abstract away many browser irregularities. Check the documentation,
|
116
|
+
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
117
|
+
* another copy of "event || window.event".
|
118
|
+
*
|
119
|
+
*/
|
120
|
+
|
121
|
+
var _populated = false;
|
122
|
+
|
123
|
+
// Browsers
|
124
|
+
var _ie, _firefox, _opera, _webkit, _chrome;
|
125
|
+
|
126
|
+
// Actual IE browser for compatibility mode
|
127
|
+
var _ie_real_version;
|
128
|
+
|
129
|
+
// Platforms
|
130
|
+
var _osx, _windows, _linux, _android;
|
131
|
+
|
132
|
+
// Architectures
|
133
|
+
var _win64;
|
134
|
+
|
135
|
+
// Devices
|
136
|
+
var _iphone, _ipad, _native;
|
137
|
+
|
138
|
+
var _mobile;
|
139
|
+
|
140
|
+
function _populate() {
|
141
|
+
if (_populated) {
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
|
145
|
+
_populated = true;
|
146
|
+
|
147
|
+
// To work around buggy JS libraries that can't handle multi-digit
|
148
|
+
// version numbers, Opera 10's user agent string claims it's Opera
|
149
|
+
// 9, then later includes a Version/X.Y field:
|
150
|
+
//
|
151
|
+
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
152
|
+
var uas = navigator.userAgent;
|
153
|
+
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
154
|
+
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
155
|
+
|
156
|
+
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
157
|
+
_ipad = /\b(iP[ao]d)/.exec(uas);
|
158
|
+
_android = /Android/i.exec(uas);
|
159
|
+
_native = /FBAN\/\w+;/i.exec(uas);
|
160
|
+
_mobile = /Mobile/i.exec(uas);
|
161
|
+
|
162
|
+
// Note that the IE team blog would have you believe you should be checking
|
163
|
+
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
164
|
+
// from either x64 or ia64; so ultimately, you should just check for Win64
|
165
|
+
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
166
|
+
// Windows will send 'WOW64' instead.
|
167
|
+
_win64 = !!(/Win64/.exec(uas));
|
168
|
+
|
169
|
+
if (agent) {
|
170
|
+
_ie = agent[1] ? parseFloat(agent[1]) : (
|
171
|
+
agent[5] ? parseFloat(agent[5]) : NaN);
|
172
|
+
// IE compatibility mode
|
173
|
+
if (_ie && document && document.documentMode) {
|
174
|
+
_ie = document.documentMode;
|
175
|
+
}
|
176
|
+
// grab the "true" ie version from the trident token if available
|
177
|
+
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
178
|
+
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
179
|
+
|
180
|
+
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
181
|
+
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
182
|
+
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
183
|
+
if (_webkit) {
|
184
|
+
// We do not add the regexp to the above test, because it will always
|
185
|
+
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
186
|
+
// the userAgent string.
|
187
|
+
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
188
|
+
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
189
|
+
} else {
|
190
|
+
_chrome = NaN;
|
191
|
+
}
|
192
|
+
} else {
|
193
|
+
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
194
|
+
}
|
195
|
+
|
196
|
+
if (os) {
|
197
|
+
if (os[1]) {
|
198
|
+
// Detect OS X version. If no version number matches, set _osx to true.
|
199
|
+
// Version examples: 10, 10_6_1, 10.7
|
200
|
+
// Parses version number as a float, taking only first two sets of
|
201
|
+
// digits. If only one set of digits is found, returns just the major
|
202
|
+
// version number.
|
203
|
+
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
204
|
+
|
205
|
+
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
|
206
|
+
} else {
|
207
|
+
_osx = false;
|
208
|
+
}
|
209
|
+
_windows = !!os[2];
|
210
|
+
_linux = !!os[3];
|
211
|
+
} else {
|
212
|
+
_osx = _windows = _linux = false;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
var UserAgent_DEPRECATED = {
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Check if the UA is Internet Explorer.
|
220
|
+
*
|
221
|
+
*
|
222
|
+
* @return float|NaN Version number (if match) or NaN.
|
223
|
+
*/
|
224
|
+
ie: function() {
|
225
|
+
return _populate() || _ie;
|
226
|
+
},
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Check if we're in Internet Explorer compatibility mode.
|
230
|
+
*
|
231
|
+
* @return bool true if in compatibility mode, false if
|
232
|
+
* not compatibility mode or not ie
|
233
|
+
*/
|
234
|
+
ieCompatibilityMode: function() {
|
235
|
+
return _populate() || (_ie_real_version > _ie);
|
236
|
+
},
|
237
|
+
|
238
|
+
|
239
|
+
/**
|
240
|
+
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
|
241
|
+
* only need this because Skype can't handle 64-bit IE yet. We need to remove
|
242
|
+
* this when we don't need it -- tracked by #601957.
|
243
|
+
*/
|
244
|
+
ie64: function() {
|
245
|
+
return UserAgent_DEPRECATED.ie() && _win64;
|
246
|
+
},
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Check if the UA is Firefox.
|
250
|
+
*
|
251
|
+
*
|
252
|
+
* @return float|NaN Version number (if match) or NaN.
|
253
|
+
*/
|
254
|
+
firefox: function() {
|
255
|
+
return _populate() || _firefox;
|
256
|
+
},
|
257
|
+
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Check if the UA is Opera.
|
261
|
+
*
|
262
|
+
*
|
263
|
+
* @return float|NaN Version number (if match) or NaN.
|
264
|
+
*/
|
265
|
+
opera: function() {
|
266
|
+
return _populate() || _opera;
|
267
|
+
},
|
268
|
+
|
269
|
+
|
270
|
+
/**
|
271
|
+
* Check if the UA is WebKit.
|
272
|
+
*
|
273
|
+
*
|
274
|
+
* @return float|NaN Version number (if match) or NaN.
|
275
|
+
*/
|
276
|
+
webkit: function() {
|
277
|
+
return _populate() || _webkit;
|
278
|
+
},
|
279
|
+
|
280
|
+
/**
|
281
|
+
* For Push
|
282
|
+
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
|
283
|
+
*/
|
284
|
+
safari: function() {
|
285
|
+
return UserAgent_DEPRECATED.webkit();
|
286
|
+
},
|
287
|
+
|
288
|
+
/**
|
289
|
+
* Check if the UA is a Chrome browser.
|
290
|
+
*
|
291
|
+
*
|
292
|
+
* @return float|NaN Version number (if match) or NaN.
|
293
|
+
*/
|
294
|
+
chrome : function() {
|
295
|
+
return _populate() || _chrome;
|
296
|
+
},
|
297
|
+
|
298
|
+
|
299
|
+
/**
|
300
|
+
* Check if the user is running Windows.
|
301
|
+
*
|
302
|
+
* @return bool `true' if the user's OS is Windows.
|
303
|
+
*/
|
304
|
+
windows: function() {
|
305
|
+
return _populate() || _windows;
|
306
|
+
},
|
307
|
+
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Check if the user is running Mac OS X.
|
311
|
+
*
|
312
|
+
* @return float|bool Returns a float if a version number is detected,
|
313
|
+
* otherwise true/false.
|
314
|
+
*/
|
315
|
+
osx: function() {
|
316
|
+
return _populate() || _osx;
|
317
|
+
},
|
318
|
+
|
319
|
+
/**
|
320
|
+
* Check if the user is running Linux.
|
321
|
+
*
|
322
|
+
* @return bool `true' if the user's OS is some flavor of Linux.
|
323
|
+
*/
|
324
|
+
linux: function() {
|
325
|
+
return _populate() || _linux;
|
326
|
+
},
|
327
|
+
|
328
|
+
/**
|
329
|
+
* Check if the user is running on an iPhone or iPod platform.
|
330
|
+
*
|
331
|
+
* @return bool `true' if the user is running some flavor of the
|
332
|
+
* iPhone OS.
|
333
|
+
*/
|
334
|
+
iphone: function() {
|
335
|
+
return _populate() || _iphone;
|
336
|
+
},
|
337
|
+
|
338
|
+
mobile: function() {
|
339
|
+
return _populate() || (_iphone || _ipad || _android || _mobile);
|
340
|
+
},
|
341
|
+
|
342
|
+
nativeApp: function() {
|
343
|
+
// webviews inside of the native apps
|
344
|
+
return _populate() || _native;
|
345
|
+
},
|
346
|
+
|
347
|
+
android: function() {
|
348
|
+
return _populate() || _android;
|
349
|
+
},
|
350
|
+
|
351
|
+
ipad: function() {
|
352
|
+
return _populate() || _ipad;
|
353
|
+
}
|
354
|
+
};
|
355
|
+
|
356
|
+
module.exports = UserAgent_DEPRECATED;
|
357
|
+
|
358
|
+
|
359
|
+
/***/ }),
|
360
|
+
|
361
|
+
/***/ 3541:
|
362
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
363
|
+
|
364
|
+
/**
|
365
|
+
* Copyright 2013-2015, Facebook, Inc.
|
366
|
+
* All rights reserved.
|
367
|
+
*
|
368
|
+
* This source code is licensed under the BSD-style license found in the
|
369
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
370
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
371
|
+
*
|
372
|
+
* @providesModule isEventSupported
|
373
|
+
*/
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
var ExecutionEnvironment = __webpack_require__(7430);
|
378
|
+
|
379
|
+
var useHasFeature;
|
380
|
+
if (ExecutionEnvironment.canUseDOM) {
|
381
|
+
useHasFeature =
|
382
|
+
document.implementation &&
|
383
|
+
document.implementation.hasFeature &&
|
384
|
+
// always returns true in newer browsers as per the standard.
|
385
|
+
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
386
|
+
document.implementation.hasFeature('', '') !== true;
|
387
|
+
}
|
388
|
+
|
389
|
+
/**
|
390
|
+
* Checks if an event is supported in the current execution environment.
|
391
|
+
*
|
392
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
393
|
+
* `reset`, `load`, `error`, and `select`.
|
394
|
+
*
|
395
|
+
* Borrows from Modernizr.
|
396
|
+
*
|
397
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
398
|
+
* @param {?boolean} capture Check if the capture phase is supported.
|
399
|
+
* @return {boolean} True if the event is supported.
|
400
|
+
* @internal
|
401
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
402
|
+
*/
|
403
|
+
function isEventSupported(eventNameSuffix, capture) {
|
404
|
+
if (!ExecutionEnvironment.canUseDOM ||
|
405
|
+
capture && !('addEventListener' in document)) {
|
406
|
+
return false;
|
407
|
+
}
|
408
|
+
|
409
|
+
var eventName = 'on' + eventNameSuffix;
|
410
|
+
var isSupported = eventName in document;
|
411
|
+
|
412
|
+
if (!isSupported) {
|
413
|
+
var element = document.createElement('div');
|
414
|
+
element.setAttribute(eventName, 'return;');
|
415
|
+
isSupported = typeof element[eventName] === 'function';
|
416
|
+
}
|
417
|
+
|
418
|
+
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
419
|
+
// This is the only way to test support for the `wheel` event in IE9+.
|
420
|
+
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
421
|
+
}
|
422
|
+
|
423
|
+
return isSupported;
|
424
|
+
}
|
425
|
+
|
426
|
+
module.exports = isEventSupported;
|
427
|
+
|
428
|
+
|
429
|
+
/***/ }),
|
430
|
+
|
431
|
+
/***/ 2527:
|
432
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
433
|
+
|
434
|
+
/**
|
435
|
+
* Copyright (c) 2015, Facebook, Inc.
|
436
|
+
* All rights reserved.
|
437
|
+
*
|
438
|
+
* This source code is licensed under the BSD-style license found in the
|
439
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
440
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
441
|
+
*
|
442
|
+
* @providesModule normalizeWheel
|
443
|
+
* @typechecks
|
444
|
+
*/
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
var UserAgent_DEPRECATED = __webpack_require__(6377);
|
449
|
+
|
450
|
+
var isEventSupported = __webpack_require__(3541);
|
451
|
+
|
452
|
+
|
453
|
+
// Reasonable defaults
|
454
|
+
var PIXEL_STEP = 10;
|
455
|
+
var LINE_HEIGHT = 40;
|
456
|
+
var PAGE_HEIGHT = 800;
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
|
460
|
+
* complicated, thus this doc is long and (hopefully) detailed enough to answer
|
461
|
+
* your questions.
|
462
|
+
*
|
463
|
+
* If you need to react to the mouse wheel in a predictable way, this code is
|
464
|
+
* like your bestest friend. * hugs *
|
465
|
+
*
|
466
|
+
* As of today, there are 4 DOM event types you can listen to:
|
467
|
+
*
|
468
|
+
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
|
469
|
+
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
|
470
|
+
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
|
471
|
+
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
|
472
|
+
*
|
473
|
+
* So what to do? The is the best:
|
474
|
+
*
|
475
|
+
* normalizeWheel.getEventType();
|
476
|
+
*
|
477
|
+
* In your event callback, use this code to get sane interpretation of the
|
478
|
+
* deltas. This code will return an object with properties:
|
479
|
+
*
|
480
|
+
* spinX -- normalized spin speed (use for zoom) - x plane
|
481
|
+
* spinY -- " - y plane
|
482
|
+
* pixelX -- normalized distance (to pixels) - x plane
|
483
|
+
* pixelY -- " - y plane
|
484
|
+
*
|
485
|
+
* Wheel values are provided by the browser assuming you are using the wheel to
|
486
|
+
* scroll a web page by a number of lines or pixels (or pages). Values can vary
|
487
|
+
* significantly on different platforms and browsers, forgetting that you can
|
488
|
+
* scroll at different speeds. Some devices (like trackpads) emit more events
|
489
|
+
* at smaller increments with fine granularity, and some emit massive jumps with
|
490
|
+
* linear speed or acceleration.
|
491
|
+
*
|
492
|
+
* This code does its best to normalize the deltas for you:
|
493
|
+
*
|
494
|
+
* - spin is trying to normalize how far the wheel was spun (or trackpad
|
495
|
+
* dragged). This is super useful for zoom support where you want to
|
496
|
+
* throw away the chunky scroll steps on the PC and make those equal to
|
497
|
+
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
|
498
|
+
* resolve a single slow step on a wheel to 1.
|
499
|
+
*
|
500
|
+
* - pixel is normalizing the desired scroll delta in pixel units. You'll
|
501
|
+
* get the crazy differences between browsers, but at least it'll be in
|
502
|
+
* pixels!
|
503
|
+
*
|
504
|
+
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
|
505
|
+
* should translate to positive value zooming IN, negative zooming OUT.
|
506
|
+
* This matches the newer 'wheel' event.
|
507
|
+
*
|
508
|
+
* Why are there spinX, spinY (or pixels)?
|
509
|
+
*
|
510
|
+
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
|
511
|
+
* with a mouse. It results in side-scrolling in the browser by default.
|
512
|
+
*
|
513
|
+
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
|
514
|
+
*
|
515
|
+
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
|
516
|
+
* probably is by browsers in conjunction with fancy 3D controllers .. but
|
517
|
+
* you know.
|
518
|
+
*
|
519
|
+
* Implementation info:
|
520
|
+
*
|
521
|
+
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
|
522
|
+
* average mouse:
|
523
|
+
*
|
524
|
+
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
|
525
|
+
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
|
526
|
+
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
|
527
|
+
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
|
528
|
+
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
|
529
|
+
*
|
530
|
+
* On the trackpad:
|
531
|
+
*
|
532
|
+
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
|
533
|
+
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
|
534
|
+
*
|
535
|
+
* On other/older browsers.. it's more complicated as there can be multiple and
|
536
|
+
* also missing delta values.
|
537
|
+
*
|
538
|
+
* The 'wheel' event is more standard:
|
539
|
+
*
|
540
|
+
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
|
541
|
+
*
|
542
|
+
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
|
543
|
+
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
|
544
|
+
* backward compatibility with older events. Those other values help us
|
545
|
+
* better normalize spin speed. Example of what the browsers provide:
|
546
|
+
*
|
547
|
+
* | event.wheelDelta | event.detail
|
548
|
+
* ------------------+------------------+--------------
|
549
|
+
* Safari v5/OS X | -120 | 0
|
550
|
+
* Safari v5/Win7 | -120 | 0
|
551
|
+
* Chrome v17/OS X | -120 | 0
|
552
|
+
* Chrome v17/Win7 | -120 | 0
|
553
|
+
* IE9/Win7 | -120 | undefined
|
554
|
+
* Firefox v4/OS X | undefined | 1
|
555
|
+
* Firefox v4/Win7 | undefined | 3
|
556
|
+
*
|
557
|
+
*/
|
558
|
+
function normalizeWheel(/*object*/ event) /*object*/ {
|
559
|
+
var sX = 0, sY = 0, // spinX, spinY
|
560
|
+
pX = 0, pY = 0; // pixelX, pixelY
|
561
|
+
|
562
|
+
// Legacy
|
563
|
+
if ('detail' in event) { sY = event.detail; }
|
564
|
+
if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; }
|
565
|
+
if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; }
|
566
|
+
if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; }
|
567
|
+
|
568
|
+
// side scrolling on FF with DOMMouseScroll
|
569
|
+
if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
|
570
|
+
sX = sY;
|
571
|
+
sY = 0;
|
572
|
+
}
|
573
|
+
|
574
|
+
pX = sX * PIXEL_STEP;
|
575
|
+
pY = sY * PIXEL_STEP;
|
576
|
+
|
577
|
+
if ('deltaY' in event) { pY = event.deltaY; }
|
578
|
+
if ('deltaX' in event) { pX = event.deltaX; }
|
579
|
+
|
580
|
+
if ((pX || pY) && event.deltaMode) {
|
581
|
+
if (event.deltaMode == 1) { // delta in LINE units
|
582
|
+
pX *= LINE_HEIGHT;
|
583
|
+
pY *= LINE_HEIGHT;
|
584
|
+
} else { // delta in PAGE units
|
585
|
+
pX *= PAGE_HEIGHT;
|
586
|
+
pY *= PAGE_HEIGHT;
|
587
|
+
}
|
588
|
+
}
|
589
|
+
|
590
|
+
// Fall-back if spin cannot be determined
|
591
|
+
if (pX && !sX) { sX = (pX < 1) ? -1 : 1; }
|
592
|
+
if (pY && !sY) { sY = (pY < 1) ? -1 : 1; }
|
593
|
+
|
594
|
+
return { spinX : sX,
|
595
|
+
spinY : sY,
|
596
|
+
pixelX : pX,
|
597
|
+
pixelY : pY };
|
598
|
+
}
|
599
|
+
|
600
|
+
|
601
|
+
/**
|
602
|
+
* The best combination if you prefer spinX + spinY normalization. It favors
|
603
|
+
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
|
604
|
+
* 'wheel' event, making spin speed determination impossible.
|
605
|
+
*/
|
606
|
+
normalizeWheel.getEventType = function() /*string*/ {
|
607
|
+
return (UserAgent_DEPRECATED.firefox())
|
608
|
+
? 'DOMMouseScroll'
|
609
|
+
: (isEventSupported('wheel'))
|
610
|
+
? 'wheel'
|
611
|
+
: 'mousewheel';
|
612
|
+
};
|
613
|
+
|
614
|
+
module.exports = normalizeWheel;
|
615
|
+
|
616
|
+
|
617
|
+
/***/ })
|
618
|
+
|
619
|
+
/******/ });
|
620
|
+
/************************************************************************/
|
621
|
+
/******/ // The module cache
|
622
|
+
/******/ var __webpack_module_cache__ = {};
|
623
|
+
/******/
|
624
|
+
/******/ // The require function
|
625
|
+
/******/ function __webpack_require__(moduleId) {
|
626
|
+
/******/ // Check if module is in cache
|
627
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
628
|
+
/******/ if (cachedModule !== undefined) {
|
629
|
+
/******/ return cachedModule.exports;
|
630
|
+
/******/ }
|
631
|
+
/******/ // Create a new module (and put it into the cache)
|
632
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
633
|
+
/******/ // no module.id needed
|
634
|
+
/******/ // no module.loaded needed
|
635
|
+
/******/ exports: {}
|
636
|
+
/******/ };
|
637
|
+
/******/
|
638
|
+
/******/ // Execute the module function
|
639
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
640
|
+
/******/
|
641
|
+
/******/ // Return the exports of the module
|
642
|
+
/******/ return module.exports;
|
643
|
+
/******/ }
|
11
644
|
/******/
|
12
645
|
/************************************************************************/
|
646
|
+
/******/ /* webpack/runtime/compat get default export */
|
647
|
+
/******/ (() => {
|
648
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
649
|
+
/******/ __webpack_require__.n = (module) => {
|
650
|
+
/******/ var getter = module && module.__esModule ?
|
651
|
+
/******/ () => (module['default']) :
|
652
|
+
/******/ () => (module);
|
653
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
654
|
+
/******/ return getter;
|
655
|
+
/******/ };
|
656
|
+
/******/ })();
|
657
|
+
/******/
|
13
658
|
/******/ /* webpack/runtime/define property getters */
|
14
659
|
/******/ (() => {
|
15
660
|
/******/ // define getter functions for harmony exports
|
@@ -29,6 +674,8 @@ import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/th
|
|
29
674
|
/******/
|
30
675
|
/************************************************************************/
|
31
676
|
var __webpack_exports__ = {};
|
677
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
678
|
+
(() => {
|
32
679
|
|
33
680
|
// EXPORTS
|
34
681
|
__webpack_require__.d(__webpack_exports__, {
|
@@ -40,11 +687,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
40
687
|
;// CONCATENATED MODULE: external "../shared"
|
41
688
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
42
689
|
var y = x => () => x
|
43
|
-
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["getFullscreenRoot"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.getFullscreenRoot, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
|
690
|
+
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["getFullscreenRoot"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.getFullscreenRoot, ["resolveClassName"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.resolveClassName, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
|
44
691
|
;// CONCATENATED MODULE: external "vue"
|
45
692
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
46
693
|
var external_vue_y = x => () => x
|
47
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["effectScope"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.effectScope, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
694
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["effectScope"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.effectScope, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
48
695
|
;// CONCATENATED MODULE: external "../config-provider"
|
49
696
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
50
697
|
var config_provider_y = x => () => x
|
@@ -53,46 +700,182 @@ const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () =>
|
|
53
700
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
54
701
|
var icon_y = x => () => x
|
55
702
|
const icon_namespaceObject = icon_x({ ["AngleLeft"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AngleLeft, ["AngleRight"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AngleRight, ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Spinner"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Spinner });
|
56
|
-
;// CONCATENATED MODULE:
|
57
|
-
|
58
|
-
|
59
|
-
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
60
|
-
;// CONCATENATED MODULE: ../../packages/image/src/props.ts
|
703
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
704
|
+
function _typeof(o) {
|
705
|
+
"@babel/helpers - typeof";
|
61
706
|
|
707
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
708
|
+
return typeof o;
|
709
|
+
} : function (o) {
|
710
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
711
|
+
}, _typeof(o);
|
712
|
+
}
|
713
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
62
714
|
|
63
|
-
|
64
|
-
(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
715
|
+
function toPrimitive(t, r) {
|
716
|
+
if ("object" != _typeof(t) || !t) return t;
|
717
|
+
var e = t[Symbol.toPrimitive];
|
718
|
+
if (void 0 !== e) {
|
719
|
+
var i = e.call(t, r || "default");
|
720
|
+
if ("object" != _typeof(i)) return i;
|
721
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
722
|
+
}
|
723
|
+
return ("string" === r ? String : Number)(t);
|
724
|
+
}
|
725
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
726
|
+
|
727
|
+
|
728
|
+
function toPropertyKey(t) {
|
729
|
+
var i = toPrimitive(t, "string");
|
730
|
+
return "symbol" == _typeof(i) ? i : String(i);
|
731
|
+
}
|
732
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
733
|
+
|
734
|
+
function _defineProperty(obj, key, value) {
|
735
|
+
key = toPropertyKey(key);
|
736
|
+
if (key in obj) {
|
737
|
+
Object.defineProperty(obj, key, {
|
738
|
+
value: value,
|
739
|
+
enumerable: true,
|
740
|
+
configurable: true,
|
741
|
+
writable: true
|
742
|
+
});
|
743
|
+
} else {
|
744
|
+
obj[key] = value;
|
745
|
+
}
|
746
|
+
return obj;
|
747
|
+
}
|
748
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
749
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
750
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
751
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
752
|
+
/*
|
753
|
+
* Tencent is pleased to support the open source community by making
|
754
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
755
|
+
*
|
756
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
757
|
+
*
|
758
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
759
|
+
*
|
760
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
761
|
+
*
|
762
|
+
* ---------------------------------------------------
|
763
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
764
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
765
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
766
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
767
|
+
*
|
768
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
769
|
+
* the Software.
|
770
|
+
*
|
771
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
772
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
773
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
774
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
775
|
+
* IN THE SOFTWARE.
|
776
|
+
*/
|
777
|
+
var isElement = function isElement(e) {
|
778
|
+
if (typeof Element === 'undefined') return false;
|
779
|
+
return e instanceof Element;
|
81
780
|
};
|
82
|
-
var
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
781
|
+
var nodeList = new Map();
|
782
|
+
var startClick;
|
783
|
+
document.addEventListener('mousedown', function (e) {
|
784
|
+
return startClick = e;
|
785
|
+
});
|
786
|
+
document.addEventListener('mouseup', function (e) {
|
787
|
+
var _iterator = _createForOfIteratorHelper(nodeList.values()),
|
788
|
+
_step;
|
789
|
+
try {
|
790
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
791
|
+
var handlers = _step.value;
|
792
|
+
var _iterator2 = _createForOfIteratorHelper(handlers),
|
793
|
+
_step2;
|
794
|
+
try {
|
795
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
796
|
+
var documentHandler = _step2.value.documentHandler;
|
797
|
+
documentHandler(e, startClick);
|
798
|
+
}
|
799
|
+
} catch (err) {
|
800
|
+
_iterator2.e(err);
|
801
|
+
} finally {
|
802
|
+
_iterator2.f();
|
803
|
+
}
|
87
804
|
}
|
805
|
+
} catch (err) {
|
806
|
+
_iterator.e(err);
|
807
|
+
} finally {
|
808
|
+
_iterator.f();
|
809
|
+
}
|
810
|
+
});
|
811
|
+
function createDocumentHandler(el, binding) {
|
812
|
+
var excludes = [];
|
813
|
+
if (Array.isArray(binding.arg)) {
|
814
|
+
excludes = binding.arg;
|
815
|
+
} else if (isElement(binding.arg)) {
|
816
|
+
excludes.push(binding.arg);
|
817
|
+
}
|
818
|
+
return function (mouseup, mousedown) {
|
819
|
+
var popperRef = binding.instance.popperRef;
|
820
|
+
var mouseUpTarget = mouseup.target;
|
821
|
+
var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
|
822
|
+
var isBound = !binding || !binding.instance;
|
823
|
+
var isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
824
|
+
var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
825
|
+
var isSelf = el === mouseUpTarget;
|
826
|
+
var isTargetExcluded = excludes.length && excludes.some(function (item) {
|
827
|
+
return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
|
828
|
+
}) || excludes.length && excludes.includes(mouseDownTarget);
|
829
|
+
var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
830
|
+
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
831
|
+
return;
|
832
|
+
}
|
833
|
+
binding.value(mouseup, mousedown);
|
834
|
+
};
|
835
|
+
}
|
836
|
+
var ClickOutside = {
|
837
|
+
beforeMount: function beforeMount(el, binding) {
|
838
|
+
if (!nodeList.has(el)) {
|
839
|
+
nodeList.set(el, []);
|
840
|
+
}
|
841
|
+
nodeList.get(el).push({
|
842
|
+
documentHandler: createDocumentHandler(el, binding),
|
843
|
+
bindingFn: binding.value
|
844
|
+
});
|
88
845
|
},
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
846
|
+
updated: function updated(el, binding) {
|
847
|
+
if (!nodeList.has(el)) {
|
848
|
+
nodeList.set(el, []);
|
849
|
+
}
|
850
|
+
var handlers = nodeList.get(el);
|
851
|
+
var oldHandlerIndex = handlers.findIndex(function (item) {
|
852
|
+
return item.bindingFn === binding.oldValue;
|
853
|
+
});
|
854
|
+
var newHandler = {
|
855
|
+
documentHandler: createDocumentHandler(el, binding),
|
856
|
+
bindingFn: binding.value
|
857
|
+
};
|
858
|
+
if (oldHandlerIndex >= 0) {
|
859
|
+
// replace the old handler to the new handler
|
860
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
861
|
+
} else {
|
862
|
+
handlers.push(newHandler);
|
863
|
+
}
|
864
|
+
},
|
865
|
+
unmounted: function unmounted(el) {
|
866
|
+
// remove all listeners when a component unmounted
|
867
|
+
nodeList["delete"](el);
|
868
|
+
}
|
94
869
|
};
|
95
|
-
|
870
|
+
ClickOutside.install = function (app) {
|
871
|
+
app.directive('bkTooltips', ClickOutside);
|
872
|
+
};
|
873
|
+
/* harmony default export */ const clickoutside = ((/* unused pure expression or super */ null && (ClickOutside)));
|
874
|
+
;// CONCATENATED MODULE: external "../popover"
|
875
|
+
var popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
876
|
+
var popover_y = x => () => x
|
877
|
+
const popover_namespaceObject = popover_x({ ["$bkPopover"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__.$bkPopover });
|
878
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/ellipsis.ts
|
96
879
|
|
97
880
|
/*
|
98
881
|
* Tencent is pleased to support the open source community by making
|
@@ -120,146 +903,555 @@ var propsImageViever = {
|
|
120
903
|
* IN THE SOFTWARE.
|
121
904
|
*/
|
122
905
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
var emit = _ref.emit,
|
133
|
-
slots = _ref.slots;
|
134
|
-
var loading = (0,external_vue_namespaceObject.ref)(true);
|
135
|
-
var hasError = (0,external_vue_namespaceObject.ref)(true);
|
136
|
-
var isShowViewer = (0,external_vue_namespaceObject.ref)(false);
|
137
|
-
var prevOverflow = (0,external_vue_namespaceObject.ref)('');
|
138
|
-
var imageSrc = (0,external_vue_namespaceObject.ref)('');
|
139
|
-
function clickHandler() {}
|
140
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
141
|
-
return props.src;
|
142
|
-
}, function () {
|
143
|
-
loadImage();
|
144
|
-
});
|
145
|
-
var preview = (0,external_vue_namespaceObject.computed)(function () {
|
146
|
-
var _props$urlList;
|
147
|
-
return (props === null || props === void 0 || (_props$urlList = props.urlList) === null || _props$urlList === void 0 ? void 0 : _props$urlList.length) > 0;
|
148
|
-
});
|
149
|
-
function closeViewer() {
|
150
|
-
document.body.style.overflow = prevOverflow.value;
|
151
|
-
isShowViewer.value = false;
|
152
|
-
emit('close');
|
153
|
-
}
|
154
|
-
function change(val) {
|
155
|
-
emit('change', val);
|
906
|
+
var resolveOptions = function resolveOptions(el, binding) {
|
907
|
+
var options = {
|
908
|
+
content: '',
|
909
|
+
target: el
|
910
|
+
};
|
911
|
+
if (_typeof(binding) === 'object') {
|
912
|
+
Object.assign(options, binding);
|
913
|
+
if (Object.prototype.hasOwnProperty.call(binding, 'popoverOption')) {
|
914
|
+
Object.assign(options, binding.popoverOption);
|
156
915
|
}
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
916
|
+
} else {
|
917
|
+
options.content = binding;
|
918
|
+
}
|
919
|
+
return options;
|
920
|
+
};
|
921
|
+
var createInstance = function createInstance(el, binding) {
|
922
|
+
var instance = null;
|
923
|
+
var createTimer = null;
|
924
|
+
var hidePopTimer = null;
|
925
|
+
var options = resolveOptions(el, binding);
|
926
|
+
var disabled = options.disabled;
|
927
|
+
if (disabled || instance) {
|
928
|
+
return;
|
929
|
+
}
|
930
|
+
var handleContentEnter = function handleContentEnter() {
|
931
|
+
hidePopTimer && clearTimeout(hidePopTimer);
|
932
|
+
hidePopTimer = null;
|
933
|
+
};
|
934
|
+
var handleContentLeave = function handleContentLeave() {
|
935
|
+
var _instance, _instance2;
|
936
|
+
if (createTimer) {
|
937
|
+
clearTimeout(createTimer);
|
161
938
|
}
|
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
|
-
return (0,external_vue_namespaceObject.createVNode)("img", {
|
188
|
-
"src": props.src,
|
189
|
-
"onClick": clickHandler
|
190
|
-
}, null);
|
939
|
+
(_instance = instance) === null || _instance === void 0 || _instance.hide();
|
940
|
+
(_instance2 = instance) === null || _instance2 === void 0 || _instance2.close();
|
941
|
+
instance = null;
|
942
|
+
};
|
943
|
+
var handleMouseEnter = function handleMouseEnter() {
|
944
|
+
handleContentLeave();
|
945
|
+
createTimer && clearTimeout(createTimer);
|
946
|
+
createTimer = setTimeout(function () {
|
947
|
+
var targetOptions = resolveOptions(el, binding);
|
948
|
+
targetOptions.isShow = true;
|
949
|
+
targetOptions.content = typeof targetOptions.content === 'function' ? targetOptions.content() : targetOptions.content || el.innerText;
|
950
|
+
targetOptions.allowHtml = true;
|
951
|
+
Object.assign(targetOptions, {
|
952
|
+
onContentMouseenter: handleContentEnter,
|
953
|
+
onContentMouseleave: handleContentLeave
|
954
|
+
});
|
955
|
+
instance = (0,popover_namespaceObject.$bkPopover)(targetOptions);
|
956
|
+
}, 300);
|
957
|
+
};
|
958
|
+
var handleMouseLeave = function handleMouseLeave() {
|
959
|
+
hidePopTimer = setTimeout(function () {
|
960
|
+
var _instance3, _instance4;
|
961
|
+
if (createTimer) {
|
962
|
+
clearTimeout(createTimer);
|
191
963
|
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
964
|
+
(_instance3 = instance) === null || _instance3 === void 0 || _instance3.hide();
|
965
|
+
(_instance4 = instance) === null || _instance4 === void 0 || _instance4.close();
|
966
|
+
instance = null;
|
967
|
+
}, 120);
|
968
|
+
};
|
969
|
+
el.addEventListener('mouseenter', handleMouseEnter);
|
970
|
+
el.addEventListener('mouseleave', handleMouseLeave);
|
971
|
+
var destroyInstance = function destroyInstance(element) {
|
972
|
+
var _ref, _ref2;
|
973
|
+
handleMouseLeave();
|
974
|
+
(_ref = element !== null && element !== void 0 ? element : el) === null || _ref === void 0 || _ref.removeEventListener('mouseenter', handleMouseEnter);
|
975
|
+
(_ref2 = element !== null && element !== void 0 ? element : el) === null || _ref2 === void 0 || _ref2.removeEventListener('mouseleave', handleMouseLeave);
|
976
|
+
};
|
977
|
+
return {
|
978
|
+
destroyInstance: destroyInstance,
|
979
|
+
instance: instance
|
980
|
+
};
|
981
|
+
};
|
982
|
+
var ellipsis = {
|
983
|
+
mounted: function mounted(el, binding) {
|
984
|
+
createInstance(el, binding);
|
203
985
|
}
|
204
|
-
}
|
205
|
-
|
206
|
-
|
207
|
-
|
986
|
+
};
|
987
|
+
/* harmony default export */ const src_ellipsis = ((/* unused pure expression or super */ null && (ellipsis)));
|
988
|
+
// EXTERNAL MODULE: ../../node_modules/normalize-wheel/index.js
|
989
|
+
var normalize_wheel = __webpack_require__(2439);
|
990
|
+
var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel);
|
991
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/mousewheel.ts
|
992
|
+
/*
|
993
|
+
* Tencent is pleased to support the open source community by making
|
994
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
995
|
+
*
|
996
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
997
|
+
*
|
998
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
999
|
+
*
|
1000
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1001
|
+
*
|
1002
|
+
* ---------------------------------------------------
|
1003
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1004
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1005
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1006
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1007
|
+
*
|
1008
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1009
|
+
* the Software.
|
1010
|
+
*
|
1011
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1012
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1013
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1014
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1015
|
+
* IN THE SOFTWARE.
|
1016
|
+
*/
|
1017
|
+
|
1018
|
+
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
1019
|
+
var mousewheelHandler = function mousewheelHandler(element, callback) {
|
1020
|
+
if (element !== null && element !== void 0 && element.addEventListener) {
|
1021
|
+
element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function (e) {
|
1022
|
+
var normalized = normalize_wheel_default()(e);
|
1023
|
+
callback === null || callback === void 0 || callback.apply(this, [e, normalized]);
|
1024
|
+
});
|
1025
|
+
}
|
1026
|
+
};
|
1027
|
+
var mousewheel = {
|
1028
|
+
beforeMount: function beforeMount(el, binding) {
|
1029
|
+
mousewheelHandler(el, binding.value);
|
1030
|
+
}
|
1031
|
+
};
|
1032
|
+
/* harmony default export */ const src_mousewheel = ((/* unused pure expression or super */ null && (mousewheel)));
|
1033
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
1034
|
+
function arrayLikeToArray_arrayLikeToArray(arr, len) {
|
1035
|
+
if (len == null || len > arr.length) len = arr.length;
|
1036
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
1037
|
+
return arr2;
|
1038
|
+
}
|
1039
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
1040
|
+
|
1041
|
+
function _arrayWithoutHoles(arr) {
|
1042
|
+
if (Array.isArray(arr)) return arrayLikeToArray_arrayLikeToArray(arr);
|
1043
|
+
}
|
1044
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
1045
|
+
function _iterableToArray(iter) {
|
1046
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
1047
|
+
}
|
1048
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
1049
|
+
|
1050
|
+
function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
|
1051
|
+
if (!o) return;
|
1052
|
+
if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1053
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1054
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1055
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
1056
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1057
|
+
}
|
1058
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
1059
|
+
function _nonIterableSpread() {
|
1060
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1061
|
+
}
|
1062
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
1063
|
+
|
1064
|
+
|
1065
|
+
|
1066
|
+
|
1067
|
+
function _toConsumableArray(arr) {
|
1068
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || unsupportedIterableToArray_unsupportedIterableToArray(arr) || _nonIterableSpread();
|
1069
|
+
}
|
1070
|
+
;// CONCATENATED MODULE: external "@popperjs/core"
|
1071
|
+
var core_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1072
|
+
var core_y = x => () => x
|
1073
|
+
const core_namespaceObject = core_x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
1074
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/tooltips.ts
|
1075
|
+
|
1076
|
+
|
1077
|
+
|
1078
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
1079
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
1080
|
+
/*
|
1081
|
+
* Tencent is pleased to support the open source community by making
|
1082
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1083
|
+
*
|
1084
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1085
|
+
*
|
1086
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1087
|
+
*
|
1088
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1089
|
+
*
|
1090
|
+
* ---------------------------------------------------
|
1091
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1092
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1093
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1094
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1095
|
+
*
|
1096
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1097
|
+
* the Software.
|
1098
|
+
*
|
1099
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1100
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1101
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1102
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1103
|
+
* IN THE SOFTWARE.
|
1104
|
+
*/
|
208
1105
|
|
209
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
210
|
-
return typeof o;
|
211
|
-
} : function (o) {
|
212
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
213
|
-
}, _typeof(o);
|
214
|
-
}
|
215
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
216
1106
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
var
|
222
|
-
|
223
|
-
|
1107
|
+
|
1108
|
+
var tooltips_nodeList = new WeakMap();
|
1109
|
+
var tooltips = {
|
1110
|
+
beforeMount: function beforeMount(el, binding) {
|
1111
|
+
var opts = getOpts(binding);
|
1112
|
+
var trigger = opts.trigger,
|
1113
|
+
showOnInit = opts.showOnInit;
|
1114
|
+
var popper = renderContent(opts);
|
1115
|
+
var delayTimeout = null;
|
1116
|
+
if (showOnInit) {
|
1117
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
1118
|
+
show(el);
|
1119
|
+
});
|
1120
|
+
}
|
1121
|
+
if (trigger === 'hover') {
|
1122
|
+
var hideTimeout = null;
|
1123
|
+
el.addEventListener('mouseenter', function () {
|
1124
|
+
delayTimeout = setTimeout(function () {
|
1125
|
+
show(el);
|
1126
|
+
clearTimeout(hideTimeout);
|
1127
|
+
clearTimeout(delayTimeout);
|
1128
|
+
}, opts.delay);
|
1129
|
+
});
|
1130
|
+
popper.addEventListener('mouseenter', function () {
|
1131
|
+
clearTimeout(hideTimeout);
|
1132
|
+
});
|
1133
|
+
el.addEventListener('mouseleave', function () {
|
1134
|
+
clearTimeout(delayTimeout);
|
1135
|
+
hideTimeout = setTimeout(function () {
|
1136
|
+
hide(el);
|
1137
|
+
}, 100);
|
1138
|
+
});
|
1139
|
+
el.addEventListener('click', function () {
|
1140
|
+
hide(el);
|
1141
|
+
});
|
1142
|
+
popper.addEventListener('mouseleave', function () {
|
1143
|
+
clearTimeout(delayTimeout);
|
1144
|
+
hideTimeout = setTimeout(function () {
|
1145
|
+
hide(el);
|
1146
|
+
}, 100);
|
1147
|
+
});
|
1148
|
+
} else if (trigger === 'click') {
|
1149
|
+
document.body.addEventListener('click', function (event) {
|
1150
|
+
if (el.contains(event.target) && !popper.hasAttribute('data-show')) {
|
1151
|
+
delayTimeout = setTimeout(function () {
|
1152
|
+
show(el);
|
1153
|
+
clearTimeout(delayTimeout);
|
1154
|
+
}, opts.delay);
|
1155
|
+
} else if (popper.hasAttribute('data-show')) {
|
1156
|
+
hide(el);
|
1157
|
+
}
|
1158
|
+
});
|
1159
|
+
}
|
1160
|
+
tooltips_nodeList.set(el, {
|
1161
|
+
opts: opts,
|
1162
|
+
popper: popper,
|
1163
|
+
popperInstance: null
|
1164
|
+
});
|
1165
|
+
},
|
1166
|
+
updated: function updated(el, binding) {
|
1167
|
+
if (tooltips_nodeList.get(el)) {
|
1168
|
+
tooltips_nodeList.get(el).opts = getOpts(binding);
|
1169
|
+
}
|
1170
|
+
},
|
1171
|
+
unmounted: function unmounted(el) {
|
1172
|
+
hide(el);
|
1173
|
+
tooltips_nodeList["delete"](el);
|
224
1174
|
}
|
225
|
-
|
1175
|
+
};
|
1176
|
+
/**
|
1177
|
+
* 初始化配置
|
1178
|
+
* @returns tooltips配置
|
1179
|
+
*/
|
1180
|
+
function initOptions() {
|
1181
|
+
var defaultOpts = {
|
1182
|
+
arrow: true,
|
1183
|
+
disabled: false,
|
1184
|
+
trigger: 'hover',
|
1185
|
+
theme: 'dark',
|
1186
|
+
content: '',
|
1187
|
+
showOnInit: false,
|
1188
|
+
placement: 'top',
|
1189
|
+
distance: 8,
|
1190
|
+
extCls: '',
|
1191
|
+
sameWidth: false,
|
1192
|
+
delay: 0,
|
1193
|
+
onShow: function onShow() {},
|
1194
|
+
onHide: function onHide() {}
|
1195
|
+
};
|
1196
|
+
return defaultOpts;
|
226
1197
|
}
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
1198
|
+
/**
|
1199
|
+
* 获取配置
|
1200
|
+
* @returns tooltips配置
|
1201
|
+
*/
|
1202
|
+
function getOpts(binding) {
|
1203
|
+
var opts = initOptions();
|
1204
|
+
if (_typeof(binding.value) === 'object') {
|
1205
|
+
Object.assign(opts, binding.value);
|
1206
|
+
} else {
|
1207
|
+
opts.content = binding.value;
|
1208
|
+
}
|
1209
|
+
return opts;
|
233
1210
|
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
configurable: true,
|
243
|
-
writable: true
|
244
|
-
});
|
1211
|
+
/**
|
1212
|
+
* 创建tooltips DOM
|
1213
|
+
* @param opts
|
1214
|
+
* @returns
|
1215
|
+
*/
|
1216
|
+
function renderContext(value, content) {
|
1217
|
+
if (typeof value === 'string') {
|
1218
|
+
content.innerText = value;
|
245
1219
|
} else {
|
246
|
-
|
1220
|
+
// 如果 content 是 Vue 组件的实例,则挂载它
|
1221
|
+
var container = document.createElement('div');
|
1222
|
+
var vnode = (0,external_vue_namespaceObject.h)(value);
|
1223
|
+
(0,external_vue_namespaceObject.render)(vnode, container);
|
1224
|
+
content.innerHTML = container.innerHTML;
|
247
1225
|
}
|
248
|
-
return obj;
|
249
1226
|
}
|
250
|
-
|
251
|
-
var
|
252
|
-
|
253
|
-
|
1227
|
+
function renderContent(opts) {
|
1228
|
+
var value = opts.content,
|
1229
|
+
hasArrow = opts.arrow,
|
1230
|
+
theme = opts.theme,
|
1231
|
+
extCls = opts.extCls;
|
1232
|
+
var isLight = theme === 'light';
|
1233
|
+
var zIndex = shared_namespaceObject.bkZIndexManager.getPopperIndex();
|
1234
|
+
var content = document.createElement('div');
|
1235
|
+
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1236
|
+
content.className = "".concat((0,shared_namespaceObject.resolveClassName)('popper', prefix), " ").concat(isLight ? 'light' : 'dark', " ").concat(extCls);
|
1237
|
+
content.innerText = value;
|
1238
|
+
content.style.zIndex = String(zIndex);
|
1239
|
+
renderContext(value, content);
|
1240
|
+
if (hasArrow) {
|
1241
|
+
var arrow = renderArrow();
|
1242
|
+
content.appendChild(arrow);
|
1243
|
+
}
|
1244
|
+
return content;
|
1245
|
+
}
|
1246
|
+
/**
|
1247
|
+
* 渲染箭头dom
|
1248
|
+
* @returns arrow DOM
|
1249
|
+
*/
|
1250
|
+
function renderArrow() {
|
1251
|
+
var arrow = document.createElement('div');
|
1252
|
+
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1253
|
+
arrow.className = (0,shared_namespaceObject.resolveClassName)('popper-arrow', prefix);
|
1254
|
+
arrow.setAttribute('data-popper-arrow', '');
|
1255
|
+
return arrow;
|
1256
|
+
}
|
1257
|
+
/**
|
1258
|
+
* 创建popper实例
|
1259
|
+
* @param el
|
1260
|
+
* @param popper
|
1261
|
+
* @returns popper实例
|
1262
|
+
*/
|
1263
|
+
function createPopperInstance(el, popper) {
|
1264
|
+
var _nodeList$get = tooltips_nodeList.get(el),
|
1265
|
+
opts = _nodeList$get.opts;
|
1266
|
+
var placement = opts.placement,
|
1267
|
+
distance = opts.distance,
|
1268
|
+
sameWidth = opts.sameWidth;
|
1269
|
+
var popperInstance = (0,core_namespaceObject.createPopper)(el, popper, {
|
1270
|
+
placement: placement,
|
1271
|
+
modifiers: [{
|
1272
|
+
name: 'offset',
|
1273
|
+
options: {
|
1274
|
+
offset: [0, distance]
|
1275
|
+
}
|
1276
|
+
}, {
|
1277
|
+
name: 'arrow',
|
1278
|
+
options: {
|
1279
|
+
padding: 5
|
1280
|
+
}
|
1281
|
+
}].concat(_toConsumableArray(sameWidth ? [{
|
1282
|
+
name: 'sameWidth',
|
1283
|
+
enabled: true,
|
1284
|
+
phase: 'beforeWrite',
|
1285
|
+
requires: ['computeStyles'],
|
1286
|
+
fn: function fn(_ref) {
|
1287
|
+
var state = _ref.state;
|
1288
|
+
state.styles.popper.width = "".concat(state.rects.reference.width, "px");
|
1289
|
+
},
|
1290
|
+
effect: function effect(_ref2) {
|
1291
|
+
var state = _ref2.state;
|
1292
|
+
state.elements.popper.style.overflowWrap = 'break-word';
|
1293
|
+
state.elements.popper.style.width = "".concat(state.elements.reference.offsetWidth, "px");
|
1294
|
+
}
|
1295
|
+
}] : []))
|
1296
|
+
});
|
1297
|
+
return popperInstance;
|
1298
|
+
}
|
1299
|
+
/**
|
1300
|
+
* 显示
|
1301
|
+
* @param el
|
1302
|
+
*/
|
1303
|
+
function show(el) {
|
1304
|
+
var _nodeList$get2 = tooltips_nodeList.get(el),
|
1305
|
+
popper = _nodeList$get2.popper,
|
1306
|
+
opts = _nodeList$get2.opts;
|
1307
|
+
var disabled = opts.disabled,
|
1308
|
+
content = opts.content,
|
1309
|
+
hasArrow = opts.arrow,
|
1310
|
+
onShow = opts.onShow,
|
1311
|
+
boundary = opts.boundary,
|
1312
|
+
_opts$modifiers = opts.modifiers,
|
1313
|
+
modifiers = _opts$modifiers === void 0 ? [] : _opts$modifiers;
|
1314
|
+
if (disabled) return;
|
1315
|
+
renderContext(content, popper);
|
1316
|
+
if (hasArrow) {
|
1317
|
+
var arrow = renderArrow();
|
1318
|
+
popper.appendChild(arrow);
|
1319
|
+
}
|
1320
|
+
var container = document.body;
|
1321
|
+
if (boundary) {
|
1322
|
+
if (boundary === 'parent') {
|
1323
|
+
container = el.parentElement;
|
1324
|
+
} else if (boundary instanceof HTMLElement) {
|
1325
|
+
container = boundary;
|
1326
|
+
}
|
1327
|
+
}
|
1328
|
+
container.appendChild(popper);
|
1329
|
+
var popperInstance = createPopperInstance(el, popper);
|
1330
|
+
onShow();
|
1331
|
+
// Make the tooltip visible
|
1332
|
+
popper.setAttribute('data-show', '');
|
1333
|
+
// Enable the event listeners
|
1334
|
+
popperInstance.setOptions(function (options) {
|
1335
|
+
return _objectSpread(_objectSpread({}, options), {}, {
|
1336
|
+
modifiers: [].concat(_toConsumableArray(options.modifiers), _toConsumableArray(modifiers), [{
|
1337
|
+
name: 'eventListeners',
|
1338
|
+
enabled: true
|
1339
|
+
}])
|
1340
|
+
});
|
1341
|
+
});
|
1342
|
+
// Update its position
|
1343
|
+
popperInstance.forceUpdate();
|
1344
|
+
tooltips_nodeList.get(el).popperInstance = popperInstance;
|
1345
|
+
}
|
1346
|
+
/**
|
1347
|
+
* 隐藏
|
1348
|
+
* @param el
|
1349
|
+
*/
|
1350
|
+
function hide(el) {
|
1351
|
+
if (!tooltips_nodeList.get(el)) return;
|
1352
|
+
var _nodeList$get3 = tooltips_nodeList.get(el),
|
1353
|
+
popper = _nodeList$get3.popper,
|
1354
|
+
popperInstance = _nodeList$get3.popperInstance,
|
1355
|
+
opts = _nodeList$get3.opts;
|
1356
|
+
var onHide = opts.onHide;
|
1357
|
+
if (popper && document.body.contains(popper)) {
|
1358
|
+
var _popper$parentNode;
|
1359
|
+
popper.removeAttribute('data-show');
|
1360
|
+
popperInstance === null || popperInstance === void 0 || popperInstance.destroy();
|
1361
|
+
popper === null || popper === void 0 || (_popper$parentNode = popper.parentNode) === null || _popper$parentNode === void 0 || _popper$parentNode.removeChild(popper);
|
1362
|
+
onHide();
|
1363
|
+
}
|
1364
|
+
}
|
1365
|
+
/* harmony default export */ const src_tooltips = (tooltips);
|
1366
|
+
;// CONCATENATED MODULE: external "../loading"
|
1367
|
+
var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1368
|
+
var external_loading_y = x => () => x
|
1369
|
+
const external_loading_namespaceObject = external_loading_x({ });
|
1370
|
+
;// CONCATENATED MODULE: external "../overflow-title"
|
1371
|
+
var external_overflow_title_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1372
|
+
var external_overflow_title_y = x => () => x
|
1373
|
+
const external_overflow_title_namespaceObject = external_overflow_title_x({ });
|
1374
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/index.ts
|
1375
|
+
/*
|
1376
|
+
* Tencent is pleased to support the open source community by making
|
1377
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1378
|
+
*
|
1379
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1380
|
+
*
|
1381
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1382
|
+
*
|
1383
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1384
|
+
*
|
1385
|
+
* ---------------------------------------------------
|
1386
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1387
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1388
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1389
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1390
|
+
*
|
1391
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1392
|
+
* the Software.
|
1393
|
+
*
|
1394
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1395
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1396
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1397
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1398
|
+
* IN THE SOFTWARE.
|
1399
|
+
*/
|
1400
|
+
|
1401
|
+
|
1402
|
+
|
1403
|
+
|
1404
|
+
|
1405
|
+
|
1406
|
+
// export { createInstance as bkEllipsisInstance } from './ellipsis';
|
254
1407
|
;// CONCATENATED MODULE: external "lodash/throttle"
|
255
1408
|
var throttle_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
256
1409
|
var throttle_y = x => () => x
|
257
1410
|
const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__["default"] });
|
1411
|
+
;// CONCATENATED MODULE: external "vue-types"
|
1412
|
+
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1413
|
+
var external_vue_types_y = x => () => x
|
1414
|
+
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
1415
|
+
;// CONCATENATED MODULE: ../../packages/image/src/props.ts
|
1416
|
+
|
1417
|
+
|
1418
|
+
var FitEnum;
|
1419
|
+
(function (FitEnum) {
|
1420
|
+
FitEnum["CONTAIN"] = "contain";
|
1421
|
+
FitEnum["COVER"] = "cover";
|
1422
|
+
FitEnum["FILL"] = "fill";
|
1423
|
+
FitEnum["NONE"] = "none";
|
1424
|
+
FitEnum["SCALE_DOWN"] = "scale-down";
|
1425
|
+
})(FitEnum || (FitEnum = {}));
|
1426
|
+
var propsImage = {
|
1427
|
+
src: shared_namespaceObject.PropTypes.string.def(''),
|
1428
|
+
fallback: shared_namespaceObject.PropTypes.string.def(''),
|
1429
|
+
placeholder: shared_namespaceObject.PropTypes.any,
|
1430
|
+
fit: (0,external_vue_types_namespaceObject.toType)('fit', {}).def(FitEnum.FILL),
|
1431
|
+
lazy: shared_namespaceObject.PropTypes.bool,
|
1432
|
+
urlList: shared_namespaceObject.PropTypes.array.def([]),
|
1433
|
+
isShowPreviewTitle: shared_namespaceObject.PropTypes.bool.def(true),
|
1434
|
+
maskClose: shared_namespaceObject.PropTypes.bool.def(true),
|
1435
|
+
zIndex: shared_namespaceObject.PropTypes.number.def(2000)
|
1436
|
+
};
|
1437
|
+
var propsImageViever = {
|
1438
|
+
urlList: {
|
1439
|
+
type: Array,
|
1440
|
+
"default": function _default() {
|
1441
|
+
return [];
|
1442
|
+
}
|
1443
|
+
},
|
1444
|
+
zIndex: shared_namespaceObject.PropTypes.number.def(2000),
|
1445
|
+
initialIndex: shared_namespaceObject.PropTypes.number.def(0),
|
1446
|
+
isShowTitle: shared_namespaceObject.PropTypes.bool.def(true),
|
1447
|
+
loops: shared_namespaceObject.PropTypes.bool.def(true),
|
1448
|
+
maskClose: shared_namespaceObject.PropTypes.bool.def(true)
|
1449
|
+
};
|
258
1450
|
;// CONCATENATED MODULE: ../../packages/image/src/image-viewer.tsx
|
259
1451
|
|
260
1452
|
|
261
|
-
function
|
262
|
-
function
|
1453
|
+
function image_viewer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
1454
|
+
function image_viewer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? image_viewer_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : image_viewer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
263
1455
|
/*
|
264
1456
|
* Tencent is pleased to support the open source community by making
|
265
1457
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -295,7 +1487,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
295
1487
|
/* harmony default export */ const image_viewer = ((0,external_vue_namespaceObject.defineComponent)({
|
296
1488
|
name: 'ImageViewer',
|
297
1489
|
directives: {
|
298
|
-
bkTooltips:
|
1490
|
+
bkTooltips: src_tooltips
|
299
1491
|
},
|
300
1492
|
props: propsImageViever,
|
301
1493
|
emits: ['close', 'change'],
|
@@ -462,7 +1654,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
462
1654
|
function handleActions(action) {
|
463
1655
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
464
1656
|
if (loading.value) return;
|
465
|
-
var _zoomRate$rotateDeg$e =
|
1657
|
+
var _zoomRate$rotateDeg$e = image_viewer_objectSpread({
|
466
1658
|
zoomRate: 0.2,
|
467
1659
|
rotateDeg: 90,
|
468
1660
|
enableTransition: true
|
@@ -508,7 +1700,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
508
1700
|
var startX = e.pageX;
|
509
1701
|
var startY = e.pageY;
|
510
1702
|
var mousemove = (0,throttle_namespaceObject["default"])(function (ev) {
|
511
|
-
transform.value =
|
1703
|
+
transform.value = image_viewer_objectSpread(image_viewer_objectSpread({}, transform.value), {}, {
|
512
1704
|
offsetX: offsetX + ev.pageX - startX,
|
513
1705
|
offsetY: offsetY + ev.pageY - startY
|
514
1706
|
});
|
@@ -606,6 +1798,116 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
606
1798
|
};
|
607
1799
|
}
|
608
1800
|
}));
|
1801
|
+
;// CONCATENATED MODULE: ../../packages/image/src/image.tsx
|
1802
|
+
|
1803
|
+
/*
|
1804
|
+
* Tencent is pleased to support the open source community by making
|
1805
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1806
|
+
*
|
1807
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1808
|
+
*
|
1809
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1810
|
+
*
|
1811
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1812
|
+
*
|
1813
|
+
* ---------------------------------------------------
|
1814
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1815
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1816
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1817
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1818
|
+
*
|
1819
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1820
|
+
* the Software.
|
1821
|
+
*
|
1822
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1823
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1824
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1825
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1826
|
+
* IN THE SOFTWARE.
|
1827
|
+
*/
|
1828
|
+
|
1829
|
+
|
1830
|
+
|
1831
|
+
|
1832
|
+
|
1833
|
+
/* harmony default export */ const src_image = ((0,external_vue_namespaceObject.defineComponent)({
|
1834
|
+
name: 'Image',
|
1835
|
+
props: propsImage,
|
1836
|
+
emits: ['loaded', 'error', 'close', 'change'],
|
1837
|
+
setup: function setup(props, _ref) {
|
1838
|
+
var emit = _ref.emit,
|
1839
|
+
slots = _ref.slots;
|
1840
|
+
var loading = (0,external_vue_namespaceObject.ref)(true);
|
1841
|
+
var hasError = (0,external_vue_namespaceObject.ref)(true);
|
1842
|
+
var isShowViewer = (0,external_vue_namespaceObject.ref)(false);
|
1843
|
+
var prevOverflow = (0,external_vue_namespaceObject.ref)('');
|
1844
|
+
var imageSrc = (0,external_vue_namespaceObject.ref)('');
|
1845
|
+
function clickHandler() {}
|
1846
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
1847
|
+
return props.src;
|
1848
|
+
}, function () {
|
1849
|
+
loadImage();
|
1850
|
+
});
|
1851
|
+
var preview = (0,external_vue_namespaceObject.computed)(function () {
|
1852
|
+
var _props$urlList;
|
1853
|
+
return (props === null || props === void 0 || (_props$urlList = props.urlList) === null || _props$urlList === void 0 ? void 0 : _props$urlList.length) > 0;
|
1854
|
+
});
|
1855
|
+
function closeViewer() {
|
1856
|
+
document.body.style.overflow = prevOverflow.value;
|
1857
|
+
isShowViewer.value = false;
|
1858
|
+
emit('close');
|
1859
|
+
}
|
1860
|
+
function change(val) {
|
1861
|
+
emit('change', val);
|
1862
|
+
}
|
1863
|
+
function loadImage() {
|
1864
|
+
loading.value = true;
|
1865
|
+
hasError.value = false;
|
1866
|
+
imageSrc.value = props.src;
|
1867
|
+
}
|
1868
|
+
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
1869
|
+
resolveClassName = _usePrefix.resolveClassName;
|
1870
|
+
return function () {
|
1871
|
+
function getContent() {
|
1872
|
+
if (loading.value) {
|
1873
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1874
|
+
"class": "".concat(resolveClassName('image-placeholder'))
|
1875
|
+
}, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Spinner, null, null)]);
|
1876
|
+
}
|
1877
|
+
if (hasError.value) {
|
1878
|
+
if (slots.error) {
|
1879
|
+
if (typeof slots.error === 'function') {
|
1880
|
+
return slots.error();
|
1881
|
+
}
|
1882
|
+
return slots.error;
|
1883
|
+
}
|
1884
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1885
|
+
"class": "".concat(resolveClassName('image-placeholder'))
|
1886
|
+
}, [props.fallback ? (0,external_vue_namespaceObject.createVNode)("img", {
|
1887
|
+
"alt": "\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF",
|
1888
|
+
"src": props.fallback
|
1889
|
+
}, null) : '', (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("i", {
|
1890
|
+
"class": "".concat(resolveClassName('icon'), " icon-image-fail")
|
1891
|
+
}, null), [[(0,external_vue_namespaceObject.resolveDirective)("else")]])]);
|
1892
|
+
}
|
1893
|
+
return (0,external_vue_namespaceObject.createVNode)("img", {
|
1894
|
+
"src": props.src,
|
1895
|
+
"onClick": clickHandler
|
1896
|
+
}, null);
|
1897
|
+
}
|
1898
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1899
|
+
"class": "".concat(resolveClassName('image'))
|
1900
|
+
}, [getContent(), preview.value && isShowViewer.value ? (0,external_vue_namespaceObject.createVNode)(image_viewer, {
|
1901
|
+
"is-show-title": props.isShowPreviewTitle,
|
1902
|
+
"maskClose": props.maskClose,
|
1903
|
+
"url-list": props.urlList,
|
1904
|
+
"zIndex": props.zIndex,
|
1905
|
+
"onChange": change,
|
1906
|
+
"onClose": closeViewer
|
1907
|
+
}, null) : '']);
|
1908
|
+
};
|
1909
|
+
}
|
1910
|
+
}));
|
609
1911
|
;// CONCATENATED MODULE: ../../packages/image/src/index.ts
|
610
1912
|
/*
|
611
1913
|
* Tencent is pleased to support the open source community by making
|
@@ -638,6 +1940,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
638
1940
|
|
639
1941
|
var BkImage = (0,shared_namespaceObject.withInstall)(src_image);
|
640
1942
|
/* harmony default export */ const src = (BkImage);
|
1943
|
+
})();
|
1944
|
+
|
641
1945
|
var __webpack_exports__Image = __webpack_exports__.Image;
|
642
1946
|
var __webpack_exports__ImageViewer = __webpack_exports__.ImageViewer;
|
643
1947
|
var __webpack_exports__default = __webpack_exports__["default"];
|