bkui-vue 0.0.1-beta.466 → 0.0.1-beta.468

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