xt-element-ui 2.2.2 → 2.2.4

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 (153) hide show
  1. package/README.md +140 -192
  2. package/docs/README.md +162 -81
  3. package/docs/components/base/theme.md +248 -0
  4. package/docs/components/base/xt-button.md +11 -4
  5. package/docs/components/base/xt-card.md +5 -11
  6. package/docs/components/base/xt-config-provider.md +2 -0
  7. package/docs/components/base/xt-flow.md +404 -0
  8. package/docs/components/base/xt-list.md +1 -1
  9. package/docs/components/base/xt-multi.md +5 -5
  10. package/docs/components/base/xt-scroll-arrow.md +87 -1
  11. package/docs/components/base/xt-scroll.md +237 -0
  12. package/docs/components/business/xt-chart.md +1 -0
  13. package/docs/components/utils/config.md +18 -4
  14. package/docs/components/utils/theme.md +280 -183
  15. package/lib/index.common.1.js +4 -26
  16. package/lib/index.common.2.js +1 -1
  17. package/lib/index.common.js +4577 -109925
  18. package/lib/index.css +1 -1
  19. package/lib/index.umd.1.js +4 -26
  20. package/lib/index.umd.2.js +1 -1
  21. package/lib/index.umd.js +4583 -109930
  22. package/lib/index.umd.min.1.js +1 -1
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/theme/element-overrides.css +607 -0
  25. package/lib/theme/element-vars.css +280 -0
  26. package/lib/xt-badge/xt-badge.common.js +1 -1
  27. package/lib/xt-badge/xt-badge.css +1 -1
  28. package/lib/xt-badge/xt-badge.umd.js +1 -1
  29. package/lib/xt-button/xt-button.common.js +13 -8
  30. package/lib/xt-button/xt-button.css +1 -1
  31. package/lib/xt-button/xt-button.umd.js +13 -8
  32. package/lib/xt-button/xt-button.umd.min.js +1 -1
  33. package/lib/xt-card/xt-card.common.js +5 -5
  34. package/lib/xt-card/xt-card.umd.js +5 -5
  35. package/lib/xt-card/xt-card.umd.min.js +1 -1
  36. package/lib/xt-card-item/xt-card-item.common.js +4 -4
  37. package/lib/xt-card-item/xt-card-item.umd.js +4 -4
  38. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -1
  39. package/lib/xt-chart/xt-chart.common.js +1969 -108924
  40. package/lib/xt-chart/xt-chart.css +1 -1
  41. package/lib/xt-chart/xt-chart.umd.js +1975 -108929
  42. package/lib/xt-chart/xt-chart.umd.min.js +1 -1
  43. package/lib/xt-config-provider/xt-config-provider.common.js +561 -107504
  44. package/lib/xt-config-provider/xt-config-provider.css +1 -1
  45. package/lib/xt-config-provider/xt-config-provider.umd.js +567 -107509
  46. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -1
  47. package/lib/xt-date-picker/xt-date-picker.common.1.js +4 -26
  48. package/lib/xt-date-picker/xt-date-picker.common.2.js +1 -1
  49. package/lib/xt-date-picker/xt-date-picker.common.js +1 -47
  50. package/lib/xt-date-picker/xt-date-picker.css +1 -1
  51. package/lib/xt-date-picker/xt-date-picker.umd.1.js +4 -26
  52. package/lib/xt-date-picker/xt-date-picker.umd.2.js +1 -1
  53. package/lib/xt-date-picker/xt-date-picker.umd.js +1 -47
  54. package/lib/xt-date-picker/xt-date-picker.umd.min.1.js +1 -1
  55. package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -1
  56. package/lib/xt-flex-box/xt-flex-box.common.js +1 -1
  57. package/lib/xt-flex-box/xt-flex-box.umd.js +1 -1
  58. package/lib/xt-flow/demo.html +10 -0
  59. package/lib/xt-flow/index.js +1 -0
  60. package/lib/xt-flow/xt-flow.common.js +638 -0
  61. package/lib/xt-flow/xt-flow.css +1 -0
  62. package/lib/xt-flow/xt-flow.umd.js +648 -0
  63. package/lib/xt-flow/xt-flow.umd.min.js +1 -0
  64. package/lib/xt-form-schema/xt-form-schema.common.js +1 -1
  65. package/lib/xt-form-schema/xt-form-schema.umd.js +1 -1
  66. package/lib/xt-grid-box/xt-grid-box.common.js +1 -1
  67. package/lib/xt-grid-box/xt-grid-box.umd.js +1 -1
  68. package/lib/xt-grid-item/xt-grid-item.common.js +1 -1
  69. package/lib/xt-grid-item/xt-grid-item.umd.js +1 -1
  70. package/lib/xt-icon/xt-icon.common.js +1 -1
  71. package/lib/xt-icon/xt-icon.umd.js +1 -1
  72. package/lib/xt-input/xt-input.common.js +1 -1
  73. package/lib/xt-input/xt-input.umd.js +1 -1
  74. package/lib/xt-list/xt-list.common.js +457 -118
  75. package/lib/xt-list/xt-list.css +1 -1
  76. package/lib/xt-list/xt-list.umd.js +457 -118
  77. package/lib/xt-list/xt-list.umd.min.js +1 -1
  78. package/lib/xt-map/xt-map.common.js +1 -1
  79. package/lib/xt-map/xt-map.umd.js +1 -1
  80. package/lib/xt-map-provider/xt-map-provider.common.js +1 -1
  81. package/lib/xt-map-provider/xt-map-provider.umd.js +1 -1
  82. package/lib/xt-page/xt-page.common.js +1 -1
  83. package/lib/xt-page/xt-page.umd.js +1 -1
  84. package/lib/xt-progress/xt-progress.common.js +1 -1
  85. package/lib/xt-progress/xt-progress.umd.js +1 -1
  86. package/lib/xt-scroll/demo.html +10 -0
  87. package/lib/xt-scroll/index.js +1 -0
  88. package/lib/xt-scroll/xt-scroll.common.js +551 -0
  89. package/lib/xt-scroll/xt-scroll.css +1 -0
  90. package/lib/xt-scroll/xt-scroll.umd.js +561 -0
  91. package/lib/xt-scroll/xt-scroll.umd.min.js +1 -0
  92. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +591 -170
  93. package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -1
  94. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +591 -170
  95. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -1
  96. package/lib/xt-select-tree/xt-select-tree.common.js +1 -1
  97. package/lib/xt-select-tree/xt-select-tree.umd.js +1 -1
  98. package/lib/xt-step-price/xt-step-price.common.js +2 -2
  99. package/lib/xt-step-price/xt-step-price.umd.js +2 -2
  100. package/lib/xt-step-price-item/xt-step-price-item.common.js +1 -1
  101. package/lib/xt-step-price-item/xt-step-price-item.umd.js +1 -1
  102. package/lib/xt-tab-pane/xt-tab-pane.common.js +1 -1
  103. package/lib/xt-tab-pane/xt-tab-pane.umd.js +1 -1
  104. package/lib/xt-table/xt-table.common.js +2 -2
  105. package/lib/xt-table/xt-table.umd.js +2 -2
  106. package/lib/xt-tabs/xt-tabs.common.js +1 -1
  107. package/lib/xt-tabs/xt-tabs.umd.js +1 -1
  108. package/lib/xt-text/xt-text.common.js +1 -1
  109. package/lib/xt-text/xt-text.css +1 -1
  110. package/lib/xt-text/xt-text.umd.js +1 -1
  111. package/lib/xt-time/xt-time.common.js +1 -1
  112. package/lib/xt-time/xt-time.umd.js +1 -1
  113. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +1 -1
  114. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +1 -1
  115. package/lib/xt-upload/xt-upload.common.js +11 -11
  116. package/lib/xt-upload/xt-upload.umd.js +12 -12
  117. package/lib/xt-upload/xt-upload.umd.min.js +1 -1
  118. package/package.json +6 -5
  119. package/src/components/index.scss +7 -1
  120. package/src/components/theme/element-overrides.css +607 -0
  121. package/src/components/theme/element-vars.css +280 -0
  122. package/src/components/theme/iframe-injector.js +502 -0
  123. package/src/components/theme/index.js +64 -0
  124. package/src/components/xt-badge/style/index.scss +6 -6
  125. package/src/components/xt-button/index.vue +11 -6
  126. package/src/components/xt-button/style/index.scss +7 -5
  127. package/src/components/xt-card/index.vue +3 -3
  128. package/src/components/xt-card-item/index.vue +2 -2
  129. package/src/components/xt-chart/XtMulti.vue +8 -18
  130. package/src/components/xt-chart/XtPie.vue +1 -0
  131. package/src/components/xt-chart/utils.js +84 -50
  132. package/src/components/xt-config-provider/index.vue +56 -54
  133. package/src/components/xt-config-provider/style/index.scss +0 -11
  134. package/src/components/xt-date-picker/component/RangeDate.vue +1 -29
  135. package/src/components/xt-date-picker/style/index.scss +79 -54
  136. package/src/components/xt-flow/flowable-parser.js +244 -0
  137. package/src/components/xt-flow/index.js +8 -0
  138. package/src/components/xt-flow/index.vue +226 -0
  139. package/src/components/xt-flow/style/index.scss +359 -0
  140. package/src/components/xt-list/index.vue +23 -12
  141. package/src/components/xt-scroll/index.js +9 -0
  142. package/src/components/xt-scroll/index.vue +363 -0
  143. package/src/components/xt-scroll/style/index.scss +107 -0
  144. package/src/components/xt-scroll-arrow/index.vue +200 -83
  145. package/src/components/xt-scroll-arrow/style/index.scss +16 -5
  146. package/src/components/xt-text/style/index.scss +6 -6
  147. package/src/index.js +15 -13
  148. package/src/styles/css-variables.scss +73 -1
  149. package/src/utils/color.js +105 -0
  150. package/src/utils/index.js +456 -468
  151. package/src/utils/theme-vars.js +134 -0
  152. package/lib/css/1.87a493be.css +0 -1
  153. package/lib/xt-date-picker/css/1.87a493be.css +0 -1
@@ -2,7 +2,7 @@
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
3
  module.exports = factory(require("vue"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define([], factory);
5
+ define(["vue"], factory);
6
6
  else if(typeof exports === 'object')
7
7
  exports["xt-upload"] = factory(require("vue"));
8
8
  else
@@ -147,7 +147,7 @@ if (typeof window !== 'undefined') {
147
147
  // Indicate to webpack that this file can be concatenated
148
148
  /* harmony default export */ var setPublicPath = (null);
149
149
 
150
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-upload/index.vue?vue&type=template&id=03e2de58
150
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d9e3ae5-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-upload/index.vue?vue&type=template&id=03e2de58
151
151
  var render = function render(){var _vm=this,_c=_vm._self._c;return _c('XtFlexBox',{attrs:{"type":"inline-flex","gap":"5px"}},[(_vm.action)?_c('el-upload',{ref:"uploadFile",attrs:{"disabled":_vm.disabled || _vm.uploading,"action":_vm.YSSQP + _vm.action,"file-list":_vm.fileList,"data":{accessToken: _vm.accessToken,..._vm.data},"multiple":_vm.multiple,"limit":_vm.limit,"on-success":_vm.uploadSuccess,"show-file-list":false,"auto-upload":_vm.autoUpload,"before-upload":_vm.uploadBefore,"accept":_vm.accept}},[_c('span',{staticStyle:{"font-size":"20px","padding":"20px","background":"#f0f0f1","color":"#409EFF"},style:({padding: _vm.plusPx / 2 + 'px',cursor:_vm.disabled ? 'not-allowed':'pointer'})},[_vm._t("default",function(){return [_c('i',{class:_vm.icon})]})],2)]):_vm._e(),(_vm.fileList!==null&&_vm.fileList.length>0)?_c('XtFlexBox',{staticClass:"el-upload-list el-upload-list--picture-card",staticStyle:{"flex":"1"},attrs:{"gap":"5px","wrap":"wrap"}},_vm._l((_vm.fileList),function(ite,index){return _c('li',{key:index,staticClass:"el-upload-list__item is-ready",staticStyle:{"margin":"0","width":"62px","height":"62px"},style:({ width: (_vm.plusPx + 22)+ 'px',height: (_vm.plusPx + 22)+ 'px'})},[_c('el-image',{staticClass:"el-upload-list__item-thumbnail",attrs:{"src":_vm.YSSQP+'/'+ite,"alt":""},on:{"click":_vm.clickHandler}}),_c('span',{staticClass:"el-upload-list__item-actions",on:{"click":function($event){return _vm.preShowPicture(ite, index)}}},[_c('span',{staticClass:"el-upload-list__item-preview",on:{"click":function($event){$event.stopPropagation();return _vm.preShowPicture(ite, index)}}},[_c('i',{staticClass:"el-icon-zoom-in"})]),(!_vm.uploading&&!_vm.disabled)?_c('span',{staticClass:"el-upload-list__item-delete",staticStyle:{"margin-left":"0"},on:{"click":function($event){$event.stopPropagation();return _vm.handleRemove(index)}}},[_c('i',{staticClass:"el-icon-delete"})]):_vm._e()])],1)}),0):_vm._e(),(_vm.preview)?[(_vm.previewVisible)?_c('ImageViewer',{attrs:{"z-index":3000,"base-url":_vm.baseUrl + '/',"infiniteLoop":false,"initial-index":_vm.imageIndex,"url-list":_vm.allFileList || _vm.fileList,"on-close":_vm.closeViewer}}):_vm._e()]:_vm._e()],2)
152
152
  }
153
153
  var staticRenderFns = []
@@ -155,7 +155,7 @@ var staticRenderFns = []
155
155
 
156
156
  // CONCATENATED MODULE: ./src/components/xt-upload/index.vue?vue&type=template&id=03e2de58
157
157
 
158
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-upload/preview.vue?vue&type=template&id=236adf7f&scoped=true
158
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d9e3ae5-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-upload/preview.vue?vue&type=template&id=236adf7f&scoped=true
159
159
  var previewvue_type_template_id_236adf7f_scoped_true_render = function render(){var _vm=this,_c=_vm._self._c;return _c('transition',{attrs:{"name":"viewer-fade"}},[_c('div',{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:({ 'z-index': _vm.zIndex }),attrs:{"tabindex":"-1"}},[_c('div',{staticClass:"el-image-viewer__mask",on:{"click":_vm.hide}}),_c('span',{staticClass:"el-image-viewer__btn fix_close",on:{"click":_vm.hide}},[_c('i',{staticClass:"el-icon-close"})]),(!_vm.isSingle)?[_c('span',{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{ 'is-disabled': !_vm.infinite && _vm.isFirst },on:{"click":_vm.prev}},[_c('i',{staticClass:"el-icon-arrow-left"})]),_c('span',{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{ 'is-disabled': !_vm.infinite && _vm.isLast },on:{"click":_vm.next}},[_c('i',{staticClass:"el-icon-arrow-right"})])]:_vm._e(),_c('div',{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[_c('div',{staticClass:"el-image-viewer__actions__inner"},[_c('i',{staticClass:"el-icon-zoom-out",on:{"click":function($event){$event.stopPropagation();return _vm.handleActions('zoomOut')}}}),_c('i',{staticClass:"el-icon-zoom-in",on:{"click":function($event){$event.stopPropagation();return _vm.handleActions('zoomIn')}}}),_c('i',{staticClass:"el-image-viewer__actions__divider"}),_c('i',{class:_vm.mode.icon,on:{"click":function($event){$event.stopPropagation();return _vm.toggleMode.apply(null, arguments)}}}),_c('i',{staticClass:"el-image-viewer__actions__divider"}),_c('i',{staticClass:"el-icon-refresh-left",on:{"click":function($event){$event.stopPropagation();return _vm.handleActions('anticlocelise')}}}),_c('i',{staticClass:"el-icon-refresh-right",on:{"click":function($event){$event.stopPropagation();return _vm.handleActions('clocelise')}}})])]),_c('div',{staticClass:"el-image-viewer__canvas"},_vm._l((_vm.urlList),function(url,i){return (i === _vm.index)?_c('img',{key:url,ref:"img",refInFor:true,staticClass:"el-image-viewer__img",style:(_vm.imgStyle),attrs:{"src":_vm.currentImg},on:{"load":_vm.handleImgLoad,"error":_vm.handleImgError,"mousedown":_vm.handleMouseDown}}):_vm._e()}),0)],2)])
160
160
  }
161
161
  var previewvue_type_template_id_236adf7f_scoped_true_staticRenderFns = []
@@ -163,16 +163,16 @@ var previewvue_type_template_id_236adf7f_scoped_true_staticRenderFns = []
163
163
 
164
164
  // CONCATENATED MODULE: ./src/components/xt-upload/preview.vue?vue&type=template&id=236adf7f&scoped=true
165
165
 
166
- // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
167
- var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
168
- var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
166
+ // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","amd":"vue","root":"Vue"}
167
+ var external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_ = __webpack_require__("8bbf");
168
+ var external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_);
169
169
 
170
170
  // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/dom.js
171
171
  /* istanbul ignore next */
172
172
 
173
173
 
174
174
 
175
- const isServer = external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer;
175
+ const isServer = external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer;
176
176
  const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
177
177
  const MOZ_HACK_REGEXP = /^moz([A-Z])/;
178
178
  const ieVersion = isServer ? 0 : Number(document.documentMode);
@@ -420,7 +420,7 @@ let isFunction = (functionToCheck) => {
420
420
  return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
421
421
  };
422
422
 
423
- if ( true && typeof Int8Array !== 'object' && (external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
423
+ if ( true && typeof Int8Array !== 'object' && (external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
424
424
  isFunction = function(obj) {
425
425
  return typeof obj === 'function' || false;
426
426
  };
@@ -554,15 +554,15 @@ const coerceTruthyValueToArray = function(val) {
554
554
  };
555
555
 
556
556
  const isIE = function() {
557
- return !external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
557
+ return !external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
558
558
  };
559
559
 
560
560
  const isEdge = function() {
561
- return !external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
561
+ return !external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
562
562
  };
563
563
 
564
564
  const isFirefox = function() {
565
- return !external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
565
+ return !external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
566
566
  };
567
567
 
568
568
  const autoprefixer = function(style) {
@@ -680,7 +680,7 @@ function objToArray(obj) {
680
680
  }
681
681
 
682
682
  const isMac = function() {
683
- return !external_commonjs_vue_commonjs2_vue_root_Vue_default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
683
+ return !external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
684
684
  };
685
685
 
686
686
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-upload/preview.vue?vue&type=script&lang=js
@@ -1 +1 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["xt-upload"]=t(require("vue")):e["xt-upload"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="fb15")}({"2c86":function(e,t,i){"use strict";i("6d33")},"6d33":function(e,t,i){},"8bbf":function(t,i){t.exports=e},fb15:function(e,t,i){"use strict";if(i.r(t),i.d(t,"XtUpload",(function(){return I})),"undefined"!==typeof window){var n=window.document.currentScript,s=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);s&&(i.p=s[1])}var o=function(){var e=this,t=e._self._c;return t("XtFlexBox",{attrs:{type:"inline-flex",gap:"5px"}},[e.action?t("el-upload",{ref:"uploadFile",attrs:{disabled:e.disabled||e.uploading,action:e.YSSQP+e.action,"file-list":e.fileList,data:{accessToken:e.accessToken,...e.data},multiple:e.multiple,limit:e.limit,"on-success":e.uploadSuccess,"show-file-list":!1,"auto-upload":e.autoUpload,"before-upload":e.uploadBefore,accept:e.accept}},[t("span",{staticStyle:{"font-size":"20px",padding:"20px",background:"#f0f0f1",color:"#409EFF"},style:{padding:e.plusPx/2+"px",cursor:e.disabled?"not-allowed":"pointer"}},[e._t("default",(function(){return[t("i",{class:e.icon})]}))],2)]):e._e(),null!==e.fileList&&e.fileList.length>0?t("XtFlexBox",{staticClass:"el-upload-list el-upload-list--picture-card",staticStyle:{flex:"1"},attrs:{gap:"5px",wrap:"wrap"}},e._l(e.fileList,(function(i,n){return t("li",{key:n,staticClass:"el-upload-list__item is-ready",staticStyle:{margin:"0",width:"62px",height:"62px"},style:{width:e.plusPx+22+"px",height:e.plusPx+22+"px"}},[t("el-image",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:e.YSSQP+"/"+i,alt:""},on:{click:e.clickHandler}}),t("span",{staticClass:"el-upload-list__item-actions",on:{click:function(t){return e.preShowPicture(i,n)}}},[t("span",{staticClass:"el-upload-list__item-preview",on:{click:function(t){return t.stopPropagation(),e.preShowPicture(i,n)}}},[t("i",{staticClass:"el-icon-zoom-in"})]),e.uploading||e.disabled?e._e():t("span",{staticClass:"el-upload-list__item-delete",staticStyle:{"margin-left":"0"},on:{click:function(t){return t.stopPropagation(),e.handleRemove(n)}}},[t("i",{staticClass:"el-icon-delete"})])])],1)})),0):e._e(),e.preview?[e.previewVisible?t("ImageViewer",{attrs:{"z-index":3e3,"base-url":e.baseUrl+"/",infiniteLoop:!1,"initial-index":e.imageIndex,"url-list":e.allFileList||e.fileList,"on-close":e.closeViewer}}):e._e()]:e._e()],2)},a=[],r=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"viewer-fade"}},[t("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.zIndex},attrs:{tabindex:"-1"}},[t("div",{staticClass:"el-image-viewer__mask",on:{click:e.hide}}),t("span",{staticClass:"el-image-viewer__btn fix_close",on:{click:e.hide}},[t("i",{staticClass:"el-icon-close"})]),e.isSingle?e._e():[t("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[t("i",{staticClass:"el-icon-arrow-left"})]),t("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[t("i",{staticClass:"el-icon-arrow-right"})])],t("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[t("div",{staticClass:"el-image-viewer__actions__inner"},[t("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){return t.stopPropagation(),e.handleActions("zoomOut")}}}),t("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){return t.stopPropagation(),e.handleActions("zoomIn")}}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{class:e.mode.icon,on:{click:function(t){return t.stopPropagation(),e.toggleMode.apply(null,arguments)}}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){return t.stopPropagation(),e.handleActions("anticlocelise")}}}),t("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){return t.stopPropagation(),e.handleActions("clocelise")}}})])]),t("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(i,n){return n===e.index?t("img",{key:i,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},l=[],c=i("8bbf"),d=i.n(c);const u=d.a.prototype.$isServer,p=(u||Number(document.documentMode),function(){return!u&&document.addEventListener?function(e,t,i){e&&t&&i&&e.addEventListener(t,i,!1)}:function(e,t,i){e&&t&&i&&e.attachEvent("on"+t,i)}}()),f=function(){return!u&&document.removeEventListener?function(e,t,i){e&&t&&e.removeEventListener(t,i,!1)}:function(e,t,i){e&&t&&e.detachEvent("on"+t,i)}}();let h=e=>{var t={};return e&&"[object Function]"===t.toString.call(e)};"object"===typeof Int8Array||!d.a.prototype.$isServer&&"function"===typeof document.childNodes||(h=function(e){return"function"===typeof e||!1});Object.prototype.hasOwnProperty;const m=function(){return!d.a.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)};function g(e){let t=!1;return function(...i){t||(t=!0,window.requestAnimationFrame(n=>{e.apply(this,i),t=!1}))}}const _={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},v=m()?"DOMMouseScroll":"mousewheel";var y={name:"elImageViewer",props:{baseUrl:{type:String,default:""},urlList:{type:Array,default:()=>[]},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:()=>{}},onClose:{type:Function,default:()=>{}},initialIndex:{type:Number,default:0},infiniteLoop:{type:Boolean,default:!0}},data(){return{index:this.initialIndex,isShow:!1,infinite:this.infiniteLoop,loading:!1,mode:_.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle(){return this.urlList.length<=1},isFirst(){return 0===this.index},isLast(){return this.index===this.urlList.length-1},currentImg(){return this.baseUrl+this.urlList[this.index]},imgStyle(){const{scale:e,deg:t,offsetX:i,offsetY:n,enableTransition:s}=this.transform,o={transform:`scale(${1*e}) rotate(${t}deg)`,transition:s?"transform .3s":"","margin-left":i+"px","margin-top":n+"px"};return this.mode===_.CONTAIN&&(o.maxWidth=o.maxHeight="80%"),o}},watch:{index:{handler:function(e){this.reset(),this.onSwitch(e)}},currentImg(e){this.$nextTick(e=>{const t=this.$refs.img[0];t.complete||(this.loading=!0)})}},methods:{hide(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall(){this._keyDownHandler=g(e=>{const t=e.keyCode;switch(t){case 27:this.hide();break;case 32:this.toggleMode();break;case 37:this.prev();break;case 38:this.handleActions("zoomIn");break;case 39:this.next();break;case 40:this.handleActions("zoomOut");break}}),this._mouseWheelHandler=g(e=>{const t=e.wheelDelta?e.wheelDelta:-e.detail;t>0?this.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):this.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),p(document,"keydown",this._keyDownHandler),p(document,v,this._mouseWheelHandler)},deviceSupportUninstall(){f(document,"keydown",this._keyDownHandler),f(document,v,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad(e){this.loading=!1},handleImgError(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown(e){if(this.loading||0!==e.button)return;const{offsetX:t,offsetY:i}=this.transform,n=e.pageX,s=e.pageY;this._dragHandler=g(e=>{this.transform.offsetX=t+e.pageX-n,this.transform.offsetY=i+e.pageY-s}),p(document,"mousemove",this._dragHandler),p(document,"mouseup",e=>{f(document,"mousemove",this._dragHandler)}),e.preventDefault()},reset(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode(){if(this.loading)return;const e=Object.keys(_),t=Object.values(_),i=t.indexOf(this.mode),n=(i+1)%e.length;this.mode=_[e[n]],this.reset()},prev(){if(this.isFirst&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index-1+e)%e},next(){if(this.isLast&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index+1)%e},handleActions(e,t={}){if(this.loading)return;const{zoomRate:i,rotateDeg:n,enableTransition:s}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...t},{transform:o}=this;switch(e){case"zoomOut":o.scale>.2&&(o.scale=parseFloat((o.scale-i).toFixed(3)));break;case"zoomIn":o.scale<10&&(o.scale=parseFloat((o.scale+i).toFixed(3)));break;case"clocelise":o.deg+=n;break;case"anticlocelise":o.deg-=n;break}o.enableTransition=s}},mounted(){this.deviceSupportInstall(),this.$refs["el-image-viewer__wrapper"].focus()}},b=y;i("2c86");function w(e,t,i,n,s,o,a,r){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}var x=w(b,r,l,!1,null,"236adf7f",null),S=x.exports,k={name:"XtUpload",components:{ImageViewer:S},model:{prop:"src",event:"change"},props:{data:{type:Object,default:()=>({})},src:{type:String,default:"",required:!0},accessToken:{type:String,default:""},autoUpload:{type:Boolean,default:!0},action:{type:String,default:""},baseUrl:{type:String,default:""},multiple:{type:Boolean,default:!1},accept:{type:String,default:".jpg,.jpeg,.png"},limit:{type:Number,default:5},disabled:{type:Boolean,default:!1},size:{type:String,default:""},beforeEmitData:{type:Function,default:(e,t,i)=>200==e.code&&(e.data.Result?e.data.Data:e.data[0])},allFileList:{type:Array},icon:{type:String,default:"el-icon-camera"}},data(){return{YSSQP:this.baseUrl,previewVisible:!1,uploading:!1,imageUrl:"",fileList:[],imageIndex:0}},computed:{preview(){const{fileList:e}=this;return Array.isArray(e)&&e.length>0},plusPx(){const e="big"==this.size?100:20;return 2*e}},watch:{src:{immediate:!0,deep:!0,handler(e){this.fileList=e?e.split(","):[]}}},methods:{clickHandler(){this.preview&&(this.previewVisible=!0)},closeViewer(){this.previewVisible=!1},preShowPicture(e,t){if(this.allFileList&&0!=this.allFileList.length){const i=this.allFileList.findIndex(t=>t==e);this.imageIndex=i>-1?i:t}else this.imageIndex=t;e.indexOf(".pdf")>-1?window.open(e,"_blank"):(this.imageUrl=this.baseUrl+"/"+e,this.previewVisible=!0)},handleRemove(e,t){try{this.fileList.splice(e,1),this.$emit("change",this.fileList.join(","))}catch(i){console.log(i)}},getPathName(e){return e.split("/").pop().split(".")[0]},uploadBefore(e,t){console.log(e);const i="image/jpeg"===e.type||"image/jpg"===e.type||"image/png"===e.type||"application/pdf"===e.type,n=e.size/1024/1024<50;return i||this.$message.error("上传图片只能是jpg,jpeg,png,pdf格式!"),n||this.$message.error("上传图片大小不能超过50MB!"),i&&n},uploadSuccess(e,t,i){const n=this.beforeEmitData(e,t,i);if(n)return this.fileList.push(n),this.$emit("change",this.fileList.join(",")),this.$message({message:"上传成功",center:!0,type:"success"}),e.data[0];this.$message({message:"上传失败",center:!0,type:"error"})}}},C=k,L=w(C,o,a,!1,null,null,null),I=L.exports;I.install=function(e){e.component(I.name,I)};var j=I;t["default"]=j}})}));
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["xt-upload"]=t(require("vue")):e["xt-upload"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="fb15")}({"2c86":function(e,t,i){"use strict";i("6d33")},"6d33":function(e,t,i){},"8bbf":function(t,i){t.exports=e},fb15:function(e,t,i){"use strict";if(i.r(t),i.d(t,"XtUpload",(function(){return I})),"undefined"!==typeof window){var n=window.document.currentScript,s=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);s&&(i.p=s[1])}var o=function(){var e=this,t=e._self._c;return t("XtFlexBox",{attrs:{type:"inline-flex",gap:"5px"}},[e.action?t("el-upload",{ref:"uploadFile",attrs:{disabled:e.disabled||e.uploading,action:e.YSSQP+e.action,"file-list":e.fileList,data:{accessToken:e.accessToken,...e.data},multiple:e.multiple,limit:e.limit,"on-success":e.uploadSuccess,"show-file-list":!1,"auto-upload":e.autoUpload,"before-upload":e.uploadBefore,accept:e.accept}},[t("span",{staticStyle:{"font-size":"20px",padding:"20px",background:"#f0f0f1",color:"#409EFF"},style:{padding:e.plusPx/2+"px",cursor:e.disabled?"not-allowed":"pointer"}},[e._t("default",(function(){return[t("i",{class:e.icon})]}))],2)]):e._e(),null!==e.fileList&&e.fileList.length>0?t("XtFlexBox",{staticClass:"el-upload-list el-upload-list--picture-card",staticStyle:{flex:"1"},attrs:{gap:"5px",wrap:"wrap"}},e._l(e.fileList,(function(i,n){return t("li",{key:n,staticClass:"el-upload-list__item is-ready",staticStyle:{margin:"0",width:"62px",height:"62px"},style:{width:e.plusPx+22+"px",height:e.plusPx+22+"px"}},[t("el-image",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:e.YSSQP+"/"+i,alt:""},on:{click:e.clickHandler}}),t("span",{staticClass:"el-upload-list__item-actions",on:{click:function(t){return e.preShowPicture(i,n)}}},[t("span",{staticClass:"el-upload-list__item-preview",on:{click:function(t){return t.stopPropagation(),e.preShowPicture(i,n)}}},[t("i",{staticClass:"el-icon-zoom-in"})]),e.uploading||e.disabled?e._e():t("span",{staticClass:"el-upload-list__item-delete",staticStyle:{"margin-left":"0"},on:{click:function(t){return t.stopPropagation(),e.handleRemove(n)}}},[t("i",{staticClass:"el-icon-delete"})])])],1)})),0):e._e(),e.preview?[e.previewVisible?t("ImageViewer",{attrs:{"z-index":3e3,"base-url":e.baseUrl+"/",infiniteLoop:!1,"initial-index":e.imageIndex,"url-list":e.allFileList||e.fileList,"on-close":e.closeViewer}}):e._e()]:e._e()],2)},a=[],r=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"viewer-fade"}},[t("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.zIndex},attrs:{tabindex:"-1"}},[t("div",{staticClass:"el-image-viewer__mask",on:{click:e.hide}}),t("span",{staticClass:"el-image-viewer__btn fix_close",on:{click:e.hide}},[t("i",{staticClass:"el-icon-close"})]),e.isSingle?e._e():[t("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[t("i",{staticClass:"el-icon-arrow-left"})]),t("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[t("i",{staticClass:"el-icon-arrow-right"})])],t("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[t("div",{staticClass:"el-image-viewer__actions__inner"},[t("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){return t.stopPropagation(),e.handleActions("zoomOut")}}}),t("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){return t.stopPropagation(),e.handleActions("zoomIn")}}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{class:e.mode.icon,on:{click:function(t){return t.stopPropagation(),e.toggleMode.apply(null,arguments)}}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){return t.stopPropagation(),e.handleActions("anticlocelise")}}}),t("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){return t.stopPropagation(),e.handleActions("clocelise")}}})])]),t("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(i,n){return n===e.index?t("img",{key:i,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},l=[],c=i("8bbf"),d=i.n(c);const u=d.a.prototype.$isServer,p=(u||Number(document.documentMode),function(){return!u&&document.addEventListener?function(e,t,i){e&&t&&i&&e.addEventListener(t,i,!1)}:function(e,t,i){e&&t&&i&&e.attachEvent("on"+t,i)}}()),f=function(){return!u&&document.removeEventListener?function(e,t,i){e&&t&&e.removeEventListener(t,i,!1)}:function(e,t,i){e&&t&&e.detachEvent("on"+t,i)}}();let h=e=>{var t={};return e&&"[object Function]"===t.toString.call(e)};"object"===typeof Int8Array||!d.a.prototype.$isServer&&"function"===typeof document.childNodes||(h=function(e){return"function"===typeof e||!1});Object.prototype.hasOwnProperty;const m=function(){return!d.a.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)};function g(e){let t=!1;return function(...i){t||(t=!0,window.requestAnimationFrame(n=>{e.apply(this,i),t=!1}))}}const _={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},v=m()?"DOMMouseScroll":"mousewheel";var y={name:"elImageViewer",props:{baseUrl:{type:String,default:""},urlList:{type:Array,default:()=>[]},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:()=>{}},onClose:{type:Function,default:()=>{}},initialIndex:{type:Number,default:0},infiniteLoop:{type:Boolean,default:!0}},data(){return{index:this.initialIndex,isShow:!1,infinite:this.infiniteLoop,loading:!1,mode:_.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle(){return this.urlList.length<=1},isFirst(){return 0===this.index},isLast(){return this.index===this.urlList.length-1},currentImg(){return this.baseUrl+this.urlList[this.index]},imgStyle(){const{scale:e,deg:t,offsetX:i,offsetY:n,enableTransition:s}=this.transform,o={transform:`scale(${1*e}) rotate(${t}deg)`,transition:s?"transform .3s":"","margin-left":i+"px","margin-top":n+"px"};return this.mode===_.CONTAIN&&(o.maxWidth=o.maxHeight="80%"),o}},watch:{index:{handler:function(e){this.reset(),this.onSwitch(e)}},currentImg(e){this.$nextTick(e=>{const t=this.$refs.img[0];t.complete||(this.loading=!0)})}},methods:{hide(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall(){this._keyDownHandler=g(e=>{const t=e.keyCode;switch(t){case 27:this.hide();break;case 32:this.toggleMode();break;case 37:this.prev();break;case 38:this.handleActions("zoomIn");break;case 39:this.next();break;case 40:this.handleActions("zoomOut");break}}),this._mouseWheelHandler=g(e=>{const t=e.wheelDelta?e.wheelDelta:-e.detail;t>0?this.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):this.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),p(document,"keydown",this._keyDownHandler),p(document,v,this._mouseWheelHandler)},deviceSupportUninstall(){f(document,"keydown",this._keyDownHandler),f(document,v,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad(e){this.loading=!1},handleImgError(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown(e){if(this.loading||0!==e.button)return;const{offsetX:t,offsetY:i}=this.transform,n=e.pageX,s=e.pageY;this._dragHandler=g(e=>{this.transform.offsetX=t+e.pageX-n,this.transform.offsetY=i+e.pageY-s}),p(document,"mousemove",this._dragHandler),p(document,"mouseup",e=>{f(document,"mousemove",this._dragHandler)}),e.preventDefault()},reset(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode(){if(this.loading)return;const e=Object.keys(_),t=Object.values(_),i=t.indexOf(this.mode),n=(i+1)%e.length;this.mode=_[e[n]],this.reset()},prev(){if(this.isFirst&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index-1+e)%e},next(){if(this.isLast&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index+1)%e},handleActions(e,t={}){if(this.loading)return;const{zoomRate:i,rotateDeg:n,enableTransition:s}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...t},{transform:o}=this;switch(e){case"zoomOut":o.scale>.2&&(o.scale=parseFloat((o.scale-i).toFixed(3)));break;case"zoomIn":o.scale<10&&(o.scale=parseFloat((o.scale+i).toFixed(3)));break;case"clocelise":o.deg+=n;break;case"anticlocelise":o.deg-=n;break}o.enableTransition=s}},mounted(){this.deviceSupportInstall(),this.$refs["el-image-viewer__wrapper"].focus()}},b=y;i("2c86");function w(e,t,i,n,s,o,a,r){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}var x=w(b,r,l,!1,null,"236adf7f",null),S=x.exports,k={name:"XtUpload",components:{ImageViewer:S},model:{prop:"src",event:"change"},props:{data:{type:Object,default:()=>({})},src:{type:String,default:"",required:!0},accessToken:{type:String,default:""},autoUpload:{type:Boolean,default:!0},action:{type:String,default:""},baseUrl:{type:String,default:""},multiple:{type:Boolean,default:!1},accept:{type:String,default:".jpg,.jpeg,.png"},limit:{type:Number,default:5},disabled:{type:Boolean,default:!1},size:{type:String,default:""},beforeEmitData:{type:Function,default:(e,t,i)=>200==e.code&&(e.data.Result?e.data.Data:e.data[0])},allFileList:{type:Array},icon:{type:String,default:"el-icon-camera"}},data(){return{YSSQP:this.baseUrl,previewVisible:!1,uploading:!1,imageUrl:"",fileList:[],imageIndex:0}},computed:{preview(){const{fileList:e}=this;return Array.isArray(e)&&e.length>0},plusPx(){const e="big"==this.size?100:20;return 2*e}},watch:{src:{immediate:!0,deep:!0,handler(e){this.fileList=e?e.split(","):[]}}},methods:{clickHandler(){this.preview&&(this.previewVisible=!0)},closeViewer(){this.previewVisible=!1},preShowPicture(e,t){if(this.allFileList&&0!=this.allFileList.length){const i=this.allFileList.findIndex(t=>t==e);this.imageIndex=i>-1?i:t}else this.imageIndex=t;e.indexOf(".pdf")>-1?window.open(e,"_blank"):(this.imageUrl=this.baseUrl+"/"+e,this.previewVisible=!0)},handleRemove(e,t){try{this.fileList.splice(e,1),this.$emit("change",this.fileList.join(","))}catch(i){console.log(i)}},getPathName(e){return e.split("/").pop().split(".")[0]},uploadBefore(e,t){console.log(e);const i="image/jpeg"===e.type||"image/jpg"===e.type||"image/png"===e.type||"application/pdf"===e.type,n=e.size/1024/1024<50;return i||this.$message.error("上传图片只能是jpg,jpeg,png,pdf格式!"),n||this.$message.error("上传图片大小不能超过50MB!"),i&&n},uploadSuccess(e,t,i){const n=this.beforeEmitData(e,t,i);if(n)return this.fileList.push(n),this.$emit("change",this.fileList.join(",")),this.$message({message:"上传成功",center:!0,type:"success"}),e.data[0];this.$message({message:"上传失败",center:!0,type:"error"})}}},C=k,L=w(C,o,a,!1,null,null,null),I=L.exports;I.install=function(e){e.component(I.name,I)};var j=I;t["default"]=j}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xt-element-ui",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "基于 Vue 2.7 + ElementUI 的企业级组件库,提供丰富的自定义组件和扩展组件",
5
5
  "main": "lib/index.common.js",
6
6
  "unpkg": "lib/index.umd.min.js",
@@ -15,11 +15,14 @@
15
15
  "postinstall": "patch-package"
16
16
  },
17
17
  "peerDependencies": {
18
+ "echarts": "^4.0.0",
19
+ "element-ui": "^2.11.1",
18
20
  "vue": "^2.6.10"
19
21
  },
20
22
  "devDependencies": {
21
23
  "@vue/cli-service": "~4.5.19",
22
24
  "babel-plugin-component": "^1.1.1",
25
+ "raw-loader": "^4.0.2",
23
26
  "sass": "^1.56.0",
24
27
  "sass-loader": "^10.5.2",
25
28
  "vuepress": "^1.9.10",
@@ -29,6 +32,7 @@
29
32
  "files": [
30
33
  "lib",
31
34
  "src/components",
35
+ "src/components/theme",
32
36
  "src/styles",
33
37
  "src/utils",
34
38
  "src/index.js",
@@ -38,10 +42,7 @@
38
42
  "docs/README.md"
39
43
  ],
40
44
  "dependencies": {
41
- "echarts": "^4.0.0",
42
- "element-ui": "^2.11.1",
43
- "patch-package": "^8.0.1",
44
- "vue": "^2.6.10"
45
+ "patch-package": "^8.0.1"
45
46
  },
46
47
  "keywords": [
47
48
  "vue",
@@ -46,4 +46,10 @@
46
46
  @import './xt-badge/style/index.scss';
47
47
 
48
48
  // ScrollArrow 组件样式
49
- @import './xt-scroll-arrow/style/index.scss';
49
+ @import './xt-scroll-arrow/style/index.scss';
50
+
51
+ // Scroll 组件样式(虚拟滚动)
52
+ @import './xt-scroll/style/index.scss';
53
+
54
+ // Flow 审批流程组件样式
55
+ @import './xt-flow/style/index.scss';