bkui-vue 0.0.1-beta.393 → 0.0.1-beta.394

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.
Files changed (155) hide show
  1. package/dist/index.cjs.js +36 -36
  2. package/dist/index.esm.js +33 -3
  3. package/dist/index.umd.js +35 -35
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2581
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2587
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,873 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("../icon"), require("vue-types"), require("lodash"), require("../directives"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "../icon", "vue-types", "lodash", "../directives"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../icon"), require("vue-types"), require("lodash"), require("../directives")) : factory(root["../shared"], root["vue"], root["../icon"], root["vue-types"], root["lodash"], root["../directives"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__6870__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__467__, __WEBPACK_EXTERNAL_MODULE__4061__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 5458:
16
- /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
17
-
18
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9601);
19
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
20
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2609);
21
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
22
- // Imports
23
-
24
-
25
- var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
26
- // Module
27
- ___CSS_LOADER_EXPORT___.push([module.id, ".bk-image-viewer-wrapper {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background: rgba(0, 0, 0, 0.6);\n flex-direction: column;\n}\n.bk-image-viewer-mask {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.bk-image-viewer-header {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 9;\n display: flex;\n width: 100%;\n height: 52px;\n color: #c4c6cc;\n background: rgba(0, 0, 0, 0.7);\n justify-content: space-between;\n align-items: center;\n}\n.bk-image-viewer-header > div {\n padding: 0 25px;\n overflow: hidden;\n font-size: 14px;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n.bk-image-viewer-header .quit-box {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n.bk-image-viewer-header .quit-tips {\n font-size: 14px;\n color: #979ba5;\n}\n.bk-image-viewer-btn {\n position: absolute;\n z-index: 1;\n display: flex;\n color: #dcdee5;\n background-color: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n opacity: 0.8;\n box-sizing: border-box;\n user-select: none;\n align-items: center;\n justify-content: center;\n}\n.bk-image-viewer-btn:hover {\n color: #fff;\n background-color: rgba(0, 0, 0, 0.4);\n}\n.bk-image-viewer-close {\n height: 52px;\n font-size: 32px;\n line-height: 48px;\n color: #c4c6cc;\n text-align: center;\n cursor: pointer;\n}\n.bk-image-viewer-close:hover {\n color: #fff;\n}\n.bk-image-viewer-canvas {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n.bk-image-viewer-has-header {\n padding-top: 52px;\n}\n.bk-image-viewer-error {\n font-size: 14px;\n color: #313238;\n text-align: center;\n}\n.bk-image-viewer-error .bk-icon {\n margin-bottom: 15px;\n font-size: 85px;\n line-height: 1;\n}\n.bk-image-viewer-actions {\n bottom: 30px;\n left: 50%;\n width: 282px;\n height: 44px;\n padding: 0 23px;\n background-color: rgba(0, 0, 0, 0.4);\n border-color: #fff;\n border-radius: 22px;\n transform: translateX(-50%);\n}\n.bk-image-viewer-actions:hover {\n background: rgba(0, 0, 0, 0.5);\n}\n.bk-image-viewer-actions-inner {\n display: flex;\n width: 100%;\n height: 100%;\n font-size: 23px;\n color: #c4c6cc;\n text-align: justify;\n align-items: center;\n justify-content: space-around;\n}\n.bk-image-viewer-actions-inner .bk-icon {\n cursor: pointer;\n}\n.bk-image-viewer-actions-inner .bk-icon:hover {\n color: #fff;\n}\n.bk-image-viewer-next,\n.bk-image-viewer-prev {\n top: 50%;\n width: 80px;\n height: 80px;\n font-size: 40px;\n cursor: pointer;\n}\n.bk-image-viewer-prev {\n left: 40px;\n transform: translateY(-50%);\n}\n.bk-image-viewer-next {\n right: 40px;\n text-indent: 2px;\n transform: translateY(-50%);\n}\n", ""]);
28
- // Exports
29
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (___CSS_LOADER_EXPORT___)));
30
-
31
-
32
- /***/ }),
33
-
34
- /***/ 2609:
35
- /***/ ((module) => {
36
-
37
-
38
-
39
- /*
40
- MIT License http://www.opensource.org/licenses/mit-license.php
41
- Author Tobias Koppers @sokra
42
- */
43
- module.exports = function (cssWithMappingToString) {
44
- var list = []; // return the list of modules as css string
45
-
46
- list.toString = function toString() {
47
- return this.map(function (item) {
48
- var content = "";
49
- var needLayer = typeof item[5] !== "undefined";
50
-
51
- if (item[4]) {
52
- content += "@supports (".concat(item[4], ") {");
53
- }
54
-
55
- if (item[2]) {
56
- content += "@media ".concat(item[2], " {");
57
- }
58
-
59
- if (needLayer) {
60
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
61
- }
62
-
63
- content += cssWithMappingToString(item);
64
-
65
- if (needLayer) {
66
- content += "}";
67
- }
68
-
69
- if (item[2]) {
70
- content += "}";
71
- }
72
-
73
- if (item[4]) {
74
- content += "}";
75
- }
76
-
77
- return content;
78
- }).join("");
79
- }; // import a list of modules into the list
80
-
81
-
82
- list.i = function i(modules, media, dedupe, supports, layer) {
83
- if (typeof modules === "string") {
84
- modules = [[null, modules, undefined]];
85
- }
86
-
87
- var alreadyImportedModules = {};
88
-
89
- if (dedupe) {
90
- for (var k = 0; k < this.length; k++) {
91
- var id = this[k][0];
92
-
93
- if (id != null) {
94
- alreadyImportedModules[id] = true;
95
- }
96
- }
97
- }
98
-
99
- for (var _k = 0; _k < modules.length; _k++) {
100
- var item = [].concat(modules[_k]);
101
-
102
- if (dedupe && alreadyImportedModules[item[0]]) {
103
- continue;
104
- }
105
-
106
- if (typeof layer !== "undefined") {
107
- if (typeof item[5] === "undefined") {
108
- item[5] = layer;
109
- } else {
110
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
111
- item[5] = layer;
112
- }
113
- }
114
-
115
- if (media) {
116
- if (!item[2]) {
117
- item[2] = media;
118
- } else {
119
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
120
- item[2] = media;
121
- }
122
- }
123
-
124
- if (supports) {
125
- if (!item[4]) {
126
- item[4] = "".concat(supports);
127
- } else {
128
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
129
- item[4] = supports;
130
- }
131
- }
132
-
133
- list.push(item);
134
- }
135
- };
136
-
137
- return list;
138
- };
139
-
140
- /***/ }),
141
-
142
- /***/ 9601:
143
- /***/ ((module) => {
144
-
145
-
146
-
147
- module.exports = function (i) {
148
- return i[1];
149
- };
150
-
151
- /***/ }),
152
-
153
- /***/ 4061:
154
- /***/ ((module) => {
155
-
156
- module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
157
-
158
- /***/ }),
159
-
160
- /***/ 6870:
161
- /***/ ((module) => {
162
-
163
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
164
-
165
- /***/ }),
166
-
167
- /***/ 4212:
168
- /***/ ((module) => {
169
-
170
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
171
-
172
- /***/ }),
173
-
174
- /***/ 467:
175
- /***/ ((module) => {
176
-
177
- module.exports = __WEBPACK_EXTERNAL_MODULE__467__;
178
-
179
- /***/ }),
180
-
181
- /***/ 748:
182
- /***/ ((module) => {
183
-
184
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
185
-
186
- /***/ }),
187
-
188
- /***/ 210:
189
- /***/ ((module) => {
190
-
191
- module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
192
-
193
- /***/ })
194
-
195
- /******/ });
196
- /************************************************************************/
197
- /******/ // The module cache
198
- /******/ var __webpack_module_cache__ = {};
199
- /******/
200
- /******/ // The require function
201
- /******/ function __webpack_require__(moduleId) {
202
- /******/ // Check if module is in cache
203
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
204
- /******/ if (cachedModule !== undefined) {
205
- /******/ return cachedModule.exports;
206
- /******/ }
207
- /******/ // Create a new module (and put it into the cache)
208
- /******/ var module = __webpack_module_cache__[moduleId] = {
209
- /******/ id: moduleId,
210
- /******/ // no module.loaded needed
211
- /******/ exports: {}
212
- /******/ };
213
- /******/
214
- /******/ // Execute the module function
215
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
216
- /******/
217
- /******/ // Return the exports of the module
218
- /******/ return module.exports;
219
- /******/ }
220
- /******/
221
- /************************************************************************/
222
- /******/ /* webpack/runtime/compat get default export */
223
- /******/ (() => {
224
- /******/ // getDefaultExport function for compatibility with non-harmony modules
225
- /******/ __webpack_require__.n = (module) => {
226
- /******/ var getter = module && module.__esModule ?
227
- /******/ () => (module['default']) :
228
- /******/ () => (module);
229
- /******/ __webpack_require__.d(getter, { a: getter });
230
- /******/ return getter;
231
- /******/ };
232
- /******/ })();
233
- /******/
234
- /******/ /* webpack/runtime/define property getters */
235
- /******/ (() => {
236
- /******/ // define getter functions for harmony exports
237
- /******/ __webpack_require__.d = (exports, definition) => {
238
- /******/ for(var key in definition) {
239
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
240
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
241
- /******/ }
242
- /******/ }
243
- /******/ };
244
- /******/ })();
245
- /******/
246
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
247
- /******/ (() => {
248
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
249
- /******/ })();
250
- /******/
251
- /******/ /* webpack/runtime/make namespace object */
252
- /******/ (() => {
253
- /******/ // define __esModule on exports
254
- /******/ __webpack_require__.r = (exports) => {
255
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
256
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
257
- /******/ }
258
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
259
- /******/ };
260
- /******/ })();
261
- /******/
262
- /************************************************************************/
263
- var __webpack_exports__ = {};
264
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
265
- (() => {
266
- // ESM COMPAT FLAG
267
- __webpack_require__.r(__webpack_exports__);
268
-
269
- // EXPORTS
270
- __webpack_require__.d(__webpack_exports__, {
271
- "Image": () => (/* reexport */ src_image),
272
- "ImageViewer": () => (/* reexport */ src_image_viewer),
273
- "default": () => (/* binding */ src)
274
- });
275
-
276
- // EXTERNAL MODULE: external "../shared"
277
- var external_shared_ = __webpack_require__(4212);
278
- // EXTERNAL MODULE: external "vue"
279
- var external_vue_ = __webpack_require__(748);
280
- // EXTERNAL MODULE: external "../icon"
281
- var external_icon_ = __webpack_require__(6870);
282
- // EXTERNAL MODULE: external "vue-types"
283
- var external_vue_types_ = __webpack_require__(210);
284
- ;// CONCATENATED MODULE: ../../packages/image/src/props.ts
285
-
286
-
287
- var FitEnum;
288
-
289
- (function (FitEnum) {
290
- FitEnum["FILL"] = "fill";
291
- FitEnum["CONTAIN"] = "contain";
292
- FitEnum["COVER"] = "cover";
293
- FitEnum["NONE"] = "none";
294
- FitEnum["SCALE_DOWN"] = "scale-down";
295
- })(FitEnum || (FitEnum = {}));
296
-
297
- var propsImage = {
298
- src: external_shared_.PropTypes.string.def(''),
299
- fallback: external_shared_.PropTypes.string.def(''),
300
- placeholder: external_shared_.PropTypes.any,
301
- fit: (0,external_vue_types_.toType)('fit', {}).def(FitEnum.FILL),
302
- lazy: external_shared_.PropTypes.bool,
303
- urlList: external_shared_.PropTypes.array.def([]),
304
- isShowPreviewTitle: external_shared_.PropTypes.bool.def(true),
305
- maskClose: external_shared_.PropTypes.bool.def(true),
306
- zIndex: external_shared_.PropTypes.number.def(2000)
307
- };
308
- var propsImageViever = {
309
- urlList: {
310
- type: Array,
311
- "default": function _default() {
312
- return [];
313
- }
314
- },
315
- zIndex: external_shared_.PropTypes.number.def(2000),
316
- initialIndex: external_shared_.PropTypes.number.def(0),
317
- isShowTitle: external_shared_.PropTypes.bool.def(true),
318
- loops: external_shared_.PropTypes.bool.def(true),
319
- maskClose: external_shared_.PropTypes.bool.def(true)
320
- };
321
- // EXTERNAL MODULE: ../../packages/image/src/image-viewer.less
322
- var image_viewer = __webpack_require__(5458);
323
- ;// CONCATENATED MODULE: ../../packages/image/src/image.tsx
324
-
325
-
326
- /*
327
- * Tencent is pleased to support the open source community by making
328
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
329
- *
330
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
331
- *
332
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
333
- *
334
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
335
- *
336
- * ---------------------------------------------------
337
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
338
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
339
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
340
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
341
- *
342
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
343
- * the Software.
344
- *
345
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
346
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
347
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
348
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
349
- * IN THE SOFTWARE.
350
- */
351
-
352
-
353
-
354
-
355
-
356
- /* harmony default export */ const src_image = ((0,external_vue_.defineComponent)({
357
- name: 'Image',
358
- props: propsImage,
359
- emits: ['loaded', 'error', 'close', 'change'],
360
- setup: function setup(props, _ref) {
361
- var emit = _ref.emit,
362
- slots = _ref.slots;
363
- var loading = (0,external_vue_.ref)(true);
364
- var hasError = (0,external_vue_.ref)(true);
365
- var isShowViewer = (0,external_vue_.ref)(false);
366
- var prevOverflow = (0,external_vue_.ref)('');
367
- var imageSrc = (0,external_vue_.ref)('');
368
-
369
- function clickHandler() {}
370
-
371
- (0,external_vue_.watch)(function () {
372
- return props.src;
373
- }, function () {
374
- loadImage();
375
- });
376
- var preview = (0,external_vue_.computed)(function () {
377
- var _a;
378
-
379
- return ((_a = props === null || props === void 0 ? void 0 : props.urlList) === null || _a === void 0 ? void 0 : _a.length) > 0;
380
- });
381
-
382
- function closeViewer() {
383
- document.body.style.overflow = prevOverflow.value;
384
- isShowViewer.value = false;
385
- emit('close');
386
- }
387
-
388
- function change(val) {
389
- emit('change', val);
390
- }
391
-
392
- function loadImage() {
393
- loading.value = true;
394
- hasError.value = false;
395
- imageSrc.value = props.src;
396
- }
397
-
398
- return function () {
399
- function getContent() {
400
- if (loading.value) {
401
- return (0,external_vue_.createVNode)("div", {
402
- "class": "bk-image-placeholder"
403
- }, [(0,external_vue_.createVNode)(external_icon_.Spinner, null, null)]);
404
- }
405
-
406
- if (hasError.value) {
407
- if (slots.error) {
408
- if (typeof slots.error === 'function') {
409
- return slots.error();
410
- }
411
-
412
- return slots.error;
413
- }
414
-
415
- return (0,external_vue_.createVNode)("div", {
416
- "class": "bk-image-placeholder"
417
- }, [props.fallback ? (0,external_vue_.createVNode)("img", {
418
- "src": props.fallback,
419
- "alt": '图片加载错误'
420
- }, null) : '', (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("i", {
421
- "class": "bk-icon icon-image-fail"
422
- }, null), [[(0,external_vue_.resolveDirective)("else")]])]);
423
- } // @ts-ignore
424
-
425
-
426
- return (0,external_vue_.createVNode)("img", {
427
- "src": props.src,
428
- "onClick": clickHandler,
429
- "style": {
430
- objectFit: fit
431
- }
432
- }, null);
433
- }
434
-
435
- return (0,external_vue_.createVNode)("div", {
436
- "class": "bk-image"
437
- }, [getContent(), preview.value && isShowViewer.value ? (0,external_vue_.createVNode)(src_image_viewer, {
438
- "zIndex": props.zIndex,
439
- "maskClose": props.maskClose,
440
- "is-show-title": props.isShowPreviewTitle,
441
- "url-list": props.urlList,
442
- "onClose": closeViewer,
443
- "onChange": change
444
- }, null) : '']);
445
- };
446
- }
447
- }));
448
- // EXTERNAL MODULE: external "lodash"
449
- var external_lodash_ = __webpack_require__(467);
450
- // EXTERNAL MODULE: external "../directives"
451
- var external_directives_ = __webpack_require__(4061);
452
- ;// CONCATENATED MODULE: ../../packages/image/src/image-viewer.tsx
453
-
454
-
455
- /*
456
- * Tencent is pleased to support the open source community by making
457
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
458
- *
459
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
460
- *
461
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
462
- *
463
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
464
- *
465
- * ---------------------------------------------------
466
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
467
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
468
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
469
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
470
- *
471
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
472
- * the Software.
473
- *
474
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
475
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
476
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
477
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
478
- * IN THE SOFTWARE.
479
- */
480
-
481
-
482
-
483
-
484
-
485
-
486
- /* harmony default export */ const src_image_viewer = ((0,external_vue_.defineComponent)({
487
- name: 'ImageViewer',
488
- directives: {
489
- bkTooltips: external_directives_.bkTooltips
490
- },
491
- props: propsImageViever,
492
- emits: ['close', 'change'],
493
- setup: function setup(props, _ref) {
494
- var emit = _ref.emit;
495
- var scopeEventListener = (0,external_vue_.effectScope)(); // @ts-ignore
496
-
497
- var wrapper = (0,external_vue_.ref)();
498
- var imgRefs = (0,external_vue_.ref)([]);
499
- var mode = (0,external_vue_.ref)('');
500
- var index = (0,external_vue_.ref)(props.initialIndex);
501
- var loading = (0,external_vue_.ref)(false);
502
- var error = (0,external_vue_.ref)(false);
503
- var transform = (0,external_vue_.shallowRef)({
504
- scale: 1,
505
- deg: 0,
506
- offsetX: 0,
507
- offsetY: 0,
508
- enableTransition: false
509
- });
510
- var isSingle = (0,external_vue_.computed)(function () {
511
- var _a;
512
-
513
- return ((_a = props === null || props === void 0 ? void 0 : props.urlList) === null || _a === void 0 ? void 0 : _a.length) < 2;
514
- });
515
- var isFirst = (0,external_vue_.computed)(function () {
516
- return index.value === 0;
517
- });
518
- var isLast = (0,external_vue_.computed)(function () {
519
- return index.value === props.urlList.length - 1;
520
- });
521
- var currentImg = (0,external_vue_.computed)(function () {
522
- return props.urlList[index.value];
523
- });
524
- var currentName = (0,external_vue_.computed)(function () {
525
- var arr = currentImg.value.split('/');
526
- return arr[arr.length - 1];
527
- });
528
- var imgStyle = (0,external_vue_.computed)(function () {
529
- var _transform$value = transform.value,
530
- scale = _transform$value.scale,
531
- deg = _transform$value.deg,
532
- offsetX = _transform$value.offsetX,
533
- offsetY = _transform$value.offsetY,
534
- enableTransition = _transform$value.enableTransition;
535
- var translateX = offsetX / scale;
536
- var translateY = offsetY / scale;
537
-
538
- switch (deg % 360) {
539
- case 90:
540
- case -270:
541
- ;
542
- var _ref2 = [translateY, -translateX];
543
- translateX = _ref2[0];
544
- translateY = _ref2[1];
545
- break;
546
-
547
- case 180:
548
- case -180:
549
- ;
550
- var _ref3 = [-translateX, -translateY];
551
- translateX = _ref3[0];
552
- translateY = _ref3[1];
553
- break;
554
-
555
- case 270:
556
- case -90:
557
- ;
558
- var _ref4 = [-translateY, translateX];
559
- translateX = _ref4[0];
560
- translateY = _ref4[1];
561
- break;
562
- }
563
-
564
- var style = {
565
- transform: "scale(".concat(scale, ") rotate(").concat(deg, "deg) translate(").concat(translateX, "px, ").concat(translateY, "px)"),
566
- transition: enableTransition ? 'transform .3s' : ''
567
- };
568
-
569
- if (mode.value === 'contain') {
570
- style.maxWidth = '100%';
571
- style.maxHeight = '100%';
572
- }
573
-
574
- return style;
575
- });
576
- var wrapStyles = (0,external_vue_.computed)(function () {
577
- var zIndex = 2000;
578
-
579
- if (props.zIndex) {
580
- zIndex = props.zIndex;
581
- } else {
582
- zIndex += external_shared_.bkZIndexManager.getModalNextIndex() || 1;
583
- }
584
-
585
- return {
586
- zIndex: zIndex
587
- };
588
- });
589
- var keydownHandler = (0,external_lodash_.throttle)(function (e) {
590
- switch (Number(e.code)) {
591
- // ESC
592
- case 27:
593
- hide();
594
- break;
595
- // SPACE
596
-
597
- case 32:
598
- toggleMode('original');
599
- break;
600
- // LEFT_ARROW
601
-
602
- case 37:
603
- prev();
604
- break;
605
- // UP_ARROW
606
-
607
- case 38:
608
- handleActions('zoomIn');
609
- break;
610
- // RIGHT_ARROW
611
-
612
- case 39:
613
- next();
614
- break;
615
- // DOWN_ARROW
616
-
617
- case 40:
618
- handleActions('zoomOut');
619
- break;
620
- }
621
- });
622
- var mousewheelHandler = (0,external_lodash_.throttle)(function (e
623
- /* TODO: wheelDelta is deprecated */
624
- ) {
625
- var delta = e.wheelDelta ? e.wheelDelta : -e.detail;
626
-
627
- if (delta > 0) {
628
- handleActions('zoomIn', {
629
- zoomRate: 1.2,
630
- enableTransition: false
631
- });
632
- } else {
633
- handleActions('zoomOut', {
634
- zoomRate: 1.2,
635
- enableTransition: false
636
- });
637
- }
638
- });
639
- scopeEventListener.run(function () {
640
- document.addEventListener('keydown', keydownHandler);
641
- document.addEventListener('mousewheel', mousewheelHandler);
642
- });
643
-
644
- function hide() {
645
- document.removeEventListener('keydown', keydownHandler);
646
- document.removeEventListener('mousewheel', mousewheelHandler);
647
- scopeEventListener.stop();
648
- emit('close');
649
- }
650
-
651
- function toggleMode(modeNames) {
652
- if (loading.value) return;
653
- mode.value = modeNames;
654
- reset();
655
- }
656
-
657
- function reset() {
658
- transform.value = {
659
- scale: 1,
660
- deg: 0,
661
- offsetX: 0,
662
- offsetY: 0,
663
- enableTransition: false
664
- };
665
- }
666
-
667
- function prev() {
668
- if (isFirst.value && !props.loops) return;
669
- var len = props.urlList.length;
670
- index.value = (index.value - 1 + len) % len;
671
- }
672
-
673
- function next() {
674
- if (isLast.value && !props.loops) return;
675
- var len = props.urlList.length;
676
- index.value = (index.value + 1) % len;
677
- }
678
-
679
- function handleActions(action) {
680
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
681
- if (loading.value) return;
682
-
683
- var _Object$assign = Object.assign({
684
- zoomRate: 0.2,
685
- rotateDeg: 90,
686
- enableTransition: true
687
- }, options),
688
- zoomRate = _Object$assign.zoomRate,
689
- rotateDeg = _Object$assign.rotateDeg,
690
- enableTransition = _Object$assign.enableTransition;
691
-
692
- switch (action) {
693
- case 'zoomOut':
694
- if (transform.value.scale > 0.2) {
695
- transform.value.scale = Number.parseFloat((transform.value.scale - zoomRate).toFixed(3));
696
- }
697
-
698
- break;
699
-
700
- case 'zoomIn':
701
- if (transform.value.scale < 7) {
702
- transform.value.scale = Number.parseFloat((transform.value.scale + zoomRate).toFixed(3));
703
- }
704
-
705
- break;
706
-
707
- case 'clockwise':
708
- transform.value.deg += rotateDeg;
709
- break;
710
-
711
- case 'anticlockwise':
712
- transform.value.deg -= rotateDeg;
713
- break;
714
- }
715
-
716
- transform.value.enableTransition = enableTransition;
717
- }
718
-
719
- function handleImgLoad() {
720
- error.value = false;
721
- loading.value = false;
722
- }
723
-
724
- function handleImgError(e) {
725
- error.value = true;
726
- loading.value = false;
727
- e.target.alt = '加载失败';
728
- }
729
-
730
- function handleMouseDown(e) {
731
- if (loading.value || e.button !== 0 || !wrapper.value) return;
732
- transform.value.enableTransition = false;
733
- var _transform$value2 = transform.value,
734
- offsetX = _transform$value2.offsetX,
735
- offsetY = _transform$value2.offsetY;
736
- var startX = e.pageX;
737
- var startY = e.pageY;
738
- var mousemove = (0,external_lodash_.throttle)(function (ev) {
739
- transform.value = Object.assign(Object.assign({}, transform.value), {
740
- offsetX: offsetX + ev.pageX - startX,
741
- offsetY: offsetY + ev.pageY - startY
742
- });
743
- });
744
-
745
- var mouseup = function mouseup() {
746
- document.removeEventListener('mousemove', mousemove);
747
- document.removeEventListener('mouseup', mouseup);
748
- };
749
-
750
- document.addEventListener('mousemove', mousemove);
751
- document.addEventListener('mouseup', mouseup);
752
- e.preventDefault();
753
- }
754
-
755
- return function () {
756
- return (0,external_vue_.createVNode)(external_vue_.Teleport, {
757
- "to": 'body'
758
- }, {
759
- "default": function _default() {
760
- return [(0,external_vue_.createVNode)(external_vue_.Transition, null, {
761
- "default": function _default() {
762
- return [(0,external_vue_.createVNode)("div", {
763
- "tabindex": '-1',
764
- "ref": 'wrapper',
765
- "class": 'bk-image-viewer-wrapper',
766
- "style": wrapStyles.value
767
- }, [(0,external_vue_.createVNode)("div", {
768
- "class": 'bk-image-viewer-mask',
769
- "onClick": function onClick() {
770
- props.maskClose && hide();
771
- }
772
- }, null), props.isShowTitle && props.urlList.length ? (0,external_vue_.createVNode)("div", {
773
- "class": 'bk-image-viewer-header'
774
- }, [(0,external_vue_.createVNode)("div", null, [currentName]), (0,external_vue_.createVNode)("div", {
775
- "class": 'tc '
776
- }, [index.value + 1, (0,external_vue_.createTextVNode)("/"), props.urlList.length]), (0,external_vue_.createVNode)("div", {
777
- "class": 'quit-box tr'
778
- }, [(0,external_vue_.createVNode)("div", {
779
- "class": 'quit-tips mr10'
780
- }, [(0,external_vue_.createTextVNode)("ESC \u53EF\u4EE5\u9000\u51FA\u5168\u5C4F")]), (0,external_vue_.createVNode)("div", {
781
- "class": 'bk-image-viewer-close',
782
- "onClick": hide
783
- }, [(0,external_vue_.createVNode)(external_icon_.Close, null, null)])])]) : '', !isSingle.value ? (0,external_vue_.createVNode)(external_vue_.Fragment, null, [(0,external_vue_.createVNode)("div", {
784
- "onClick": prev,
785
- "class": "bk-image-viewer-btn bk-image-viewer-prev ".concat(!props.loops && isFirst ? 'is-disabled' : '')
786
- }, [(0,external_vue_.createVNode)(external_icon_.AngleLeft, null, null)]), (0,external_vue_.createVNode)("div", {
787
- "onClick": next,
788
- "class": "bk-image-viewer-btn bk-image-viewer-prev ".concat(!props.loops && isLast ? 'is-disabled' : '')
789
- }, [(0,external_vue_.createVNode)(external_icon_.AngleRight, null, null)]), (0,external_vue_.createVNode)("div", {
790
- "class": "bk-image-viewer-actions-inner"
791
- }, [(0,external_vue_.withDirectives)((0,external_vue_.createVNode)(external_icon_.AngleLeft, {
792
- "onClick": function onClick() {
793
- return handleActions('zoomOut');
794
- }
795
- }, null), [[(0,external_vue_.resolveDirective)("bk-tooltips"), "{content: '提示信息', placement: 'top'}"]]), (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("i", {
796
- "class": "",
797
- "onClick": function onClick() {
798
- return handleActions('zoomOut');
799
- }
800
- }, null), [[(0,external_vue_.resolveDirective)("bk-tooltips"), "{content: '提示信息', placement: 'top'}"]]), (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("i", {
801
- "class": "bk-icon icon-narrow-line",
802
- "onClick": function onClick() {
803
- return handleActions('zoomOut');
804
- }
805
- }, null), [[(0,external_vue_.resolveDirective)("bk-tooltips"), "{content: '提示信息', placement: 'top'}"]])])]) : '', (0,external_vue_.createVNode)("div", {
806
- "class": "bk-image-viewer-canvas ".concat(props.isShowTitle ? 'bk-image-viewer-has-header' : '')
807
- }, [error.value ? (0,external_vue_.createVNode)("div", {
808
- "class": "bk-image-viewer-error"
809
- }, [(0,external_vue_.createVNode)("div", null, [(0,external_vue_.createVNode)("i", {
810
- "class": "bk-icon icon-image-fail"
811
- }, null)]), (0,external_vue_.createVNode)("div", null, [(0,external_vue_.createTextVNode)("\u62B1\u6B49\uFF0C\u56FE\u7247\u52A0\u8F7D\u5931\u8D25")])]) : props.urlList.map(function (url, i) {
812
- if (i === index.value) {
813
- return '';
814
- }
815
-
816
- return (0,external_vue_.createVNode)("img", {
817
- "key": i,
818
- "ref": function ref(el) {
819
- return imgRefs[i] = el;
820
- },
821
- "class": "bk-image-viewer-img",
822
- "style": imgStyle.value,
823
- "src": url,
824
- "onLoad": handleImgLoad,
825
- "onError": handleImgError,
826
- "onMousedown": handleMouseDown
827
- }, null);
828
- })])])];
829
- }
830
- })];
831
- }
832
- });
833
- };
834
- }
835
- }));
836
- ;// CONCATENATED MODULE: ../../packages/image/src/index.ts
837
- /*
838
- * Tencent is pleased to support the open source community by making
839
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
840
- *
841
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
842
- *
843
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
844
- *
845
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
846
- *
847
- * ---------------------------------------------------
848
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
849
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
850
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
851
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
852
- *
853
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
854
- * the Software.
855
- *
856
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
857
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
858
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
859
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
860
- * IN THE SOFTWARE.
861
- */
862
-
863
-
864
-
865
-
866
- var BkImage = (0,external_shared_.withInstall)(src_image);
867
- /* harmony default export */ const src = (BkImage);
868
- })();
869
-
870
- /******/ return __webpack_exports__;
871
- /******/ })()
872
- ;
873
- });
1
+ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("vue"),require("../icon"),require("vue-types"),require("lodash"),require("../directives"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon","vue-types","lodash","../directives"],n);else{var t="object"==typeof exports?n(require("../shared"),require("vue"),require("../icon"),require("vue-types"),require("lodash"),require("../directives")):n(e["../shared"],e.vue,e["../icon"],e["vue-types"],e.lodash,e["../directives"]);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(self,((e,n,t,o,r,i)=>(()=>{"use strict";var a={5458:(e,n,t)=>{var o=t(9601),r=t.n(o),i=t(2609);t.n(i)()(r()).push([e.id,".bk-image-viewer-wrapper {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background: rgba(0, 0, 0, 0.6);\n flex-direction: column;\n}\n.bk-image-viewer-mask {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.bk-image-viewer-header {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 9;\n display: flex;\n width: 100%;\n height: 52px;\n color: #c4c6cc;\n background: rgba(0, 0, 0, 0.7);\n justify-content: space-between;\n align-items: center;\n}\n.bk-image-viewer-header > div {\n padding: 0 25px;\n overflow: hidden;\n font-size: 14px;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n.bk-image-viewer-header .quit-box {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n.bk-image-viewer-header .quit-tips {\n font-size: 14px;\n color: #979ba5;\n}\n.bk-image-viewer-btn {\n position: absolute;\n z-index: 1;\n display: flex;\n color: #dcdee5;\n background-color: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n opacity: 0.8;\n box-sizing: border-box;\n user-select: none;\n align-items: center;\n justify-content: center;\n}\n.bk-image-viewer-btn:hover {\n color: #fff;\n background-color: rgba(0, 0, 0, 0.4);\n}\n.bk-image-viewer-close {\n height: 52px;\n font-size: 32px;\n line-height: 48px;\n color: #c4c6cc;\n text-align: center;\n cursor: pointer;\n}\n.bk-image-viewer-close:hover {\n color: #fff;\n}\n.bk-image-viewer-canvas {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n.bk-image-viewer-has-header {\n padding-top: 52px;\n}\n.bk-image-viewer-error {\n font-size: 14px;\n color: #313238;\n text-align: center;\n}\n.bk-image-viewer-error .bk-icon {\n margin-bottom: 15px;\n font-size: 85px;\n line-height: 1;\n}\n.bk-image-viewer-actions {\n bottom: 30px;\n left: 50%;\n width: 282px;\n height: 44px;\n padding: 0 23px;\n background-color: rgba(0, 0, 0, 0.4);\n border-color: #fff;\n border-radius: 22px;\n transform: translateX(-50%);\n}\n.bk-image-viewer-actions:hover {\n background: rgba(0, 0, 0, 0.5);\n}\n.bk-image-viewer-actions-inner {\n display: flex;\n width: 100%;\n height: 100%;\n font-size: 23px;\n color: #c4c6cc;\n text-align: justify;\n align-items: center;\n justify-content: space-around;\n}\n.bk-image-viewer-actions-inner .bk-icon {\n cursor: pointer;\n}\n.bk-image-viewer-actions-inner .bk-icon:hover {\n color: #fff;\n}\n.bk-image-viewer-next,\n.bk-image-viewer-prev {\n top: 50%;\n width: 80px;\n height: 80px;\n font-size: 40px;\n cursor: pointer;\n}\n.bk-image-viewer-prev {\n left: 40px;\n transform: translateY(-50%);\n}\n.bk-image-viewer-next {\n right: 40px;\n text-indent: 2px;\n transform: translateY(-50%);\n}\n",""])},2609:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t="",o=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),o&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),o&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t})).join("")},n.i=function(e,t,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(a[c]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);o&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),t&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=t):u[2]=t),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),n.push(u))}},n}},9601:e=>{e.exports=function(e){return e[1]}},4061:e=>{e.exports=i},6870:e=>{e.exports=t},4212:n=>{n.exports=e},467:e=>{e.exports=r},748:e=>{e.exports=n},210:e=>{e.exports=o}},l={};function c(e){var n=l[e];if(void 0!==n)return n.exports;var t=l[e]={id:e,exports:{}};return a[e](t,t.exports,c),t.exports}c.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return c.d(n,{a:n}),n},c.d=(e,n)=>{for(var t in n)c.o(n,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},c.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{c.r(s),c.d(s,{Image:()=>l,ImageViewer:()=>v,default:()=>f});var e,n=c(4212),t=c(748),o=c(6870),r=c(210);!function(e){e.FILL="fill",e.CONTAIN="contain",e.COVER="cover",e.NONE="none",e.SCALE_DOWN="scale-down"}(e||(e={}));var i={src:n.PropTypes.string.def(""),fallback:n.PropTypes.string.def(""),placeholder:n.PropTypes.any,fit:(0,r.toType)("fit",{}).def(e.FILL),lazy:n.PropTypes.bool,urlList:n.PropTypes.array.def([]),isShowPreviewTitle:n.PropTypes.bool.def(!0),maskClose:n.PropTypes.bool.def(!0),zIndex:n.PropTypes.number.def(2e3)},a={urlList:{type:Array,default:function(){return[]}},zIndex:n.PropTypes.number.def(2e3),initialIndex:n.PropTypes.number.def(0),isShowTitle:n.PropTypes.bool.def(!0),loops:n.PropTypes.bool.def(!0),maskClose:n.PropTypes.bool.def(!0)};c(5458);const l=(0,t.defineComponent)({name:"Image",props:i,emits:["loaded","error","close","change"],setup:function(e,n){var r=n.emit,i=n.slots,a=(0,t.ref)(!0),l=(0,t.ref)(!0),c=(0,t.ref)(!1),s=(0,t.ref)(""),u=(0,t.ref)("");function d(){}(0,t.watch)((function(){return e.src}),(function(){a.value=!0,l.value=!1,u.value=e.src}));var f=(0,t.computed)((function(){var n;return(null===(n=null==e?void 0:e.urlList)||void 0===n?void 0:n.length)>0}));function p(){document.body.style.overflow=s.value,c.value=!1,r("close")}function m(e){r("change",e)}return function(){return(0,t.createVNode)("div",{class:"bk-image"},[a.value?(0,t.createVNode)("div",{class:"bk-image-placeholder"},[(0,t.createVNode)(o.Spinner,null,null)]):l.value?i.error?"function"==typeof i.error?i.error():i.error:(0,t.createVNode)("div",{class:"bk-image-placeholder"},[e.fallback?(0,t.createVNode)("img",{src:e.fallback,alt:"图片加载错误"},null):"",(0,t.withDirectives)((0,t.createVNode)("i",{class:"bk-icon icon-image-fail"},null),[[(0,t.resolveDirective)("else")]])]):(0,t.createVNode)("img",{src:e.src,onClick:d,style:{objectFit:fit}},null),f.value&&c.value?(0,t.createVNode)(v,{zIndex:e.zIndex,maskClose:e.maskClose,"is-show-title":e.isShowPreviewTitle,"url-list":e.urlList,onClose:p,onChange:m},null):""])}}});var u=c(467),d=c(4061);const v=(0,t.defineComponent)({name:"ImageViewer",directives:{bkTooltips:d.bkTooltips},props:a,emits:["close","change"],setup:function(e,r){var i=r.emit,a=(0,t.effectScope)(),l=(0,t.ref)(),c=(0,t.ref)([]),s=(0,t.ref)(""),d=(0,t.ref)(e.initialIndex),v=(0,t.ref)(!1),f=(0,t.ref)(!1),p=(0,t.shallowRef)({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),m=(0,t.computed)((function(){var n;return(null===(n=null==e?void 0:e.urlList)||void 0===n?void 0:n.length)<2})),b=(0,t.computed)((function(){return 0===d.value})),g=(0,t.computed)((function(){return d.value===e.urlList.length-1})),h=(0,t.computed)((function(){return e.urlList[d.value]})),k=(0,t.computed)((function(){var e=h.value.split("/");return e[e.length-1]})),x=(0,t.computed)((function(){var e=p.value,n=e.scale,t=e.deg,o=e.offsetX,r=e.offsetY,i=e.enableTransition,a=o/n,l=r/n;switch(t%360){case 90:case-270:var c=[l,-a];a=c[0],l=c[1];break;case 180:case-180:var u=[-a,-l];a=u[0],l=u[1];break;case 270:case-90:var d=[-l,a];a=d[0],l=d[1]}var v={transform:"scale(".concat(n,") rotate(").concat(t,"deg) translate(").concat(a,"px, ").concat(l,"px)"),transition:i?"transform .3s":""};return"contain"===s.value&&(v.maxWidth="100%",v.maxHeight="100%"),v})),w=(0,t.computed)((function(){var t=2e3;return e.zIndex?t=e.zIndex:t+=n.bkZIndexManager.getModalNextIndex()||1,{zIndex:t}})),y=(0,u.throttle)((function(e){switch(Number(e.code)){case 27:V();break;case 32:v.value||(s.value="original",p.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1});break;case 37:T();break;case 38:L("zoomIn");break;case 39:z();break;case 40:L("zoomOut")}})),N=(0,u.throttle)((function(e){L((e.wheelDelta?e.wheelDelta:-e.detail)>0?"zoomIn":"zoomOut",{zoomRate:1.2,enableTransition:!1})}));function V(){document.removeEventListener("keydown",y),document.removeEventListener("mousewheel",N),a.stop(),i("close")}function T(){if(!b.value||e.loops){var n=e.urlList.length;d.value=(d.value-1+n)%n}}function z(){if(!g.value||e.loops){var n=e.urlList.length;d.value=(d.value+1)%n}}function L(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!v.value){var t=Object.assign({zoomRate:.2,rotateDeg:90,enableTransition:!0},n),o=t.zoomRate,r=t.rotateDeg,i=t.enableTransition;switch(e){case"zoomOut":p.value.scale>.2&&(p.value.scale=Number.parseFloat((p.value.scale-o).toFixed(3)));break;case"zoomIn":p.value.scale<7&&(p.value.scale=Number.parseFloat((p.value.scale+o).toFixed(3)));break;case"clockwise":p.value.deg+=r;break;case"anticlockwise":p.value.deg-=r}p.value.enableTransition=i}}function C(){f.value=!1,v.value=!1}function I(e){f.value=!0,v.value=!1,e.target.alt="加载失败"}function j(e){if(!v.value&&0===e.button&&l.value){p.value.enableTransition=!1;var n=p.value,t=n.offsetX,o=n.offsetY,r=e.pageX,i=e.pageY,a=(0,u.throttle)((function(e){p.value=Object.assign(Object.assign({},p.value),{offsetX:t+e.pageX-r,offsetY:o+e.pageY-i})}));document.addEventListener("mousemove",a),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",e)})),e.preventDefault()}}return a.run((function(){document.addEventListener("keydown",y),document.addEventListener("mousewheel",N)})),function(){return(0,t.createVNode)(t.Teleport,{to:"body"},{default:function(){return[(0,t.createVNode)(t.Transition,null,{default:function(){return[(0,t.createVNode)("div",{tabindex:"-1",ref:"wrapper",class:"bk-image-viewer-wrapper",style:w.value},[(0,t.createVNode)("div",{class:"bk-image-viewer-mask",onClick:function(){e.maskClose&&V()}},null),e.isShowTitle&&e.urlList.length?(0,t.createVNode)("div",{class:"bk-image-viewer-header"},[(0,t.createVNode)("div",null,[k]),(0,t.createVNode)("div",{class:"tc "},[d.value+1,(0,t.createTextVNode)("/"),e.urlList.length]),(0,t.createVNode)("div",{class:"quit-box tr"},[(0,t.createVNode)("div",{class:"quit-tips mr10"},[(0,t.createTextVNode)("ESC 可以退出全屏")]),(0,t.createVNode)("div",{class:"bk-image-viewer-close",onClick:V},[(0,t.createVNode)(o.Close,null,null)])])]):"",m.value?"":(0,t.createVNode)(t.Fragment,null,[(0,t.createVNode)("div",{onClick:T,class:"bk-image-viewer-btn bk-image-viewer-prev ".concat(!e.loops&&b?"is-disabled":"")},[(0,t.createVNode)(o.AngleLeft,null,null)]),(0,t.createVNode)("div",{onClick:z,class:"bk-image-viewer-btn bk-image-viewer-prev ".concat(!e.loops&&g?"is-disabled":"")},[(0,t.createVNode)(o.AngleRight,null,null)]),(0,t.createVNode)("div",{class:"bk-image-viewer-actions-inner"},[(0,t.withDirectives)((0,t.createVNode)(o.AngleLeft,{onClick:function(){return L("zoomOut")}},null),[[(0,t.resolveDirective)("bk-tooltips"),"{content: '提示信息', placement: 'top'}"]]),(0,t.withDirectives)((0,t.createVNode)("i",{class:"",onClick:function(){return L("zoomOut")}},null),[[(0,t.resolveDirective)("bk-tooltips"),"{content: '提示信息', placement: 'top'}"]]),(0,t.withDirectives)((0,t.createVNode)("i",{class:"bk-icon icon-narrow-line",onClick:function(){return L("zoomOut")}},null),[[(0,t.resolveDirective)("bk-tooltips"),"{content: '提示信息', placement: 'top'}"]])])]),(0,t.createVNode)("div",{class:"bk-image-viewer-canvas ".concat(e.isShowTitle?"bk-image-viewer-has-header":"")},[f.value?(0,t.createVNode)("div",{class:"bk-image-viewer-error"},[(0,t.createVNode)("div",null,[(0,t.createVNode)("i",{class:"bk-icon icon-image-fail"},null)]),(0,t.createVNode)("div",null,[(0,t.createTextVNode)("抱歉,图片加载失败")])]):e.urlList.map((function(e,n){return n===d.value?"":(0,t.createVNode)("img",{key:n,ref:function(e){return c[n]=e},class:"bk-image-viewer-img",style:x.value,src:e,onLoad:C,onError:I,onMousedown:j},null)}))])])]}})]}})}}}),f=(0,n.withInstall)(l)})(),s})()));