dpzvc-ui 1.2.3 → 1.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.
package/dist/dpzvc.esm.js CHANGED
@@ -2615,7 +2615,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
2615
2615
  justify-content: center;
2616
2616
  flex-direction: column;
2617
2617
  }
2618
- `, "",{"version":3,"sources":["webpack://./src/components/checkBox/checkbox-group.vue"],"names":[],"mappings":";AA4EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"['dpzvc-checkBoxGroup',vertical?'dpzvc-checkBoxGroup-vertical':'']\" >\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from '../../utils/util'\n import Emitter from '../../mixin/emitter'\n export default {\n name:'checkBoxGroup',\n mixins:[Emitter],\n props:{\n value:{\n type:Array,\n default:()=>[]\n },\n single:{\n type:Boolean,\n default:false\n },\n vertical:{\n type:Boolean,\n default:false\n }\n\n },\n data(){\n return {\n currentValue:this.value,\n childrens:[]\n }\n },\n methods:{\n change(data){\n console.log(data)\n this.currentValue = data;\n this.$emit('input', data);\n this.$emit('on-change',data);\n this.dispatch('on-form-change',data)\n },\n updateModel(){\n let model = this.value;\n this.childrens = findComponentsDownward(this,'checkBox');\n if(this.childrens) {\n this.childrens.forEach((child)=>{\n\n child.model = model;\n child.currentValue = model.indexOf(child.label) >= 0;\n child.isGroup = true;\n })\n }\n\n }\n },\n mounted(){\n\n this.updateModel()\n },\n watch:{\n value(){\n this.updateModel()\n }\n }\n }\n</script>\n\n\n<style scoped>\n .dpzvc-checkBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
2618
+ `, "",{"version":3,"sources":["webpack://./checkbox-group.vue"],"names":[],"mappings":";AA4EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"['dpzvc-checkBoxGroup',vertical?'dpzvc-checkBoxGroup-vertical':'']\" >\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from '../../utils/util'\n import Emitter from '../../mixin/emitter'\n export default {\n name:'checkBoxGroup',\n mixins:[Emitter],\n props:{\n value:{\n type:Array,\n default:()=>[]\n },\n single:{\n type:Boolean,\n default:false\n },\n vertical:{\n type:Boolean,\n default:false\n }\n\n },\n data(){\n return {\n currentValue:this.value,\n childrens:[]\n }\n },\n methods:{\n change(data){\n console.log(data)\n this.currentValue = data;\n this.$emit('input', data);\n this.$emit('on-change',data);\n this.dispatch('on-form-change',data)\n },\n updateModel(){\n let model = this.value;\n this.childrens = findComponentsDownward(this,'checkBox');\n if(this.childrens) {\n this.childrens.forEach((child)=>{\n\n child.model = model;\n child.currentValue = model.indexOf(child.label) >= 0;\n child.isGroup = true;\n })\n }\n\n }\n },\n mounted(){\n\n this.updateModel()\n },\n watch:{\n value(){\n this.updateModel()\n }\n }\n }\n</script>\n\n\n<style scoped>\n .dpzvc-checkBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
2619
2619
  // Exports
2620
2620
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
2621
2621
 
@@ -3751,7 +3751,7 @@ var prefixCls = 'dpzvc-upload';
3751
3751
  var _this = this;
3752
3752
  var data = null;
3753
3753
  var img = new Image();
3754
- var mpImg = new _lib_MegaPixImage__WEBPACK_IMPORTED_MODULE_1__(file);
3754
+ var mpImg = new _lib_MegaPixImage__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A(file);
3755
3755
  mpImg.render(img, {
3756
3756
  maxWidth: 600,
3757
3757
  quality: 0.8
@@ -3937,6 +3937,29 @@ var prefixCls = 'dpzvc-radiobox';
3937
3937
  }
3938
3938
  });
3939
3939
 
3940
+ /***/ },
3941
+
3942
+ /***/ 2901
3943
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3944
+
3945
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3946
+ /* harmony export */ A: () => (/* binding */ _createClass)
3947
+ /* harmony export */ });
3948
+ /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9922);
3949
+
3950
+ function _defineProperties(e, r) {
3951
+ for (var t = 0; t < r.length; t++) {
3952
+ var o = r[t];
3953
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(o.key), o);
3954
+ }
3955
+ }
3956
+ function _createClass(e, r, t) {
3957
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
3958
+ writable: !1
3959
+ }), e;
3960
+ }
3961
+
3962
+
3940
3963
  /***/ },
3941
3964
 
3942
3965
  /***/ 2924
@@ -4032,6 +4055,19 @@ var prefixCls = 'dpzvc-textBar';
4032
4055
  /* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_picker_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73);
4033
4056
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_picker_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);
4034
4057
 
4058
+ /***/ },
4059
+
4060
+ /***/ 3029
4061
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
4062
+
4063
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4064
+ /* harmony export */ A: () => (/* binding */ _classCallCheck)
4065
+ /* harmony export */ });
4066
+ function _classCallCheck(a, n) {
4067
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
4068
+ }
4069
+
4070
+
4035
4071
  /***/ },
4036
4072
 
4037
4073
  /***/ 3055
@@ -4605,40 +4641,6 @@ var prefixCls = 'dpzvc-date-picker';
4605
4641
 
4606
4642
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_card__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);
4607
4643
 
4608
- /***/ },
4609
-
4610
- /***/ 3610
4611
- (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4612
-
4613
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4614
- /* harmony export */ X: () => (/* binding */ render),
4615
- /* harmony export */ Y: () => (/* binding */ staticRenderFns)
4616
- /* harmony export */ });
4617
- var render = function render() {
4618
- var _vm = this,
4619
- _c = _vm._self._c;
4620
- return _c('div', {
4621
- "class": _vm.classes,
4622
- style: _vm.styles
4623
- }, [_vm._t("default", function () {
4624
- return [_c('div', {
4625
- "class": _vm.wrapperClasses
4626
- }, [_vm._v("图片上传")])];
4627
- }), _vm._v(" "), _c('input', {
4628
- ref: "upload",
4629
- attrs: {
4630
- "type": "file",
4631
- "accept": _vm.accept,
4632
- "multiple": _vm.multiple
4633
- },
4634
- on: {
4635
- "change": _vm.showPhoto
4636
- }
4637
- })], 2);
4638
- };
4639
- var staticRenderFns = [];
4640
-
4641
-
4642
4644
  /***/ },
4643
4645
 
4644
4646
  /***/ 3649
@@ -6073,6 +6075,40 @@ var render = function render() {
6073
6075
  var staticRenderFns = [];
6074
6076
 
6075
6077
 
6078
+ /***/ },
6079
+
6080
+ /***/ 4708
6081
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6082
+
6083
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6084
+ /* harmony export */ X: () => (/* binding */ render),
6085
+ /* harmony export */ Y: () => (/* binding */ staticRenderFns)
6086
+ /* harmony export */ });
6087
+ var render = function render() {
6088
+ var _vm = this,
6089
+ _c = _vm._self._c;
6090
+ return _c('div', {
6091
+ "class": _vm.classes,
6092
+ style: _vm.styles
6093
+ }, [_vm._t("default", function () {
6094
+ return [_c('div', {
6095
+ "class": _vm.wrapperClasses
6096
+ }, [_vm._v("图片上传")])];
6097
+ }), _vm._v(" "), _c('input', {
6098
+ ref: "upload",
6099
+ attrs: {
6100
+ "type": "file",
6101
+ "accept": _vm.accept,
6102
+ "multiple": _vm.multiple
6103
+ },
6104
+ on: {
6105
+ "change": _vm.showPhoto
6106
+ }
6107
+ })], 2);
6108
+ };
6109
+ var staticRenderFns = [];
6110
+
6111
+
6076
6112
  /***/ },
6077
6113
 
6078
6114
  /***/ 4783
@@ -12201,7 +12237,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
12201
12237
  justify-content: center;
12202
12238
  flex-direction: column;
12203
12239
  }
12204
- `, "",{"version":3,"sources":["webpack://./src/components/radioBox/radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
12240
+ `, "",{"version":3,"sources":["webpack://./radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
12205
12241
  // Exports
12206
12242
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
12207
12243
 
@@ -13677,239 +13713,221 @@ var staticRenderFns = [];
13677
13713
  /***/ },
13678
13714
 
13679
13715
  /***/ 8037
13680
- (module, __webpack_exports__, __webpack_require__) {
13716
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13681
13717
 
13682
- __webpack_require__.r(__webpack_exports__);
13683
- /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2284);
13684
- /* module decorator */ module = __webpack_require__.hmd(module);
13718
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13719
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
13720
+ /* harmony export */ });
13721
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4467);
13722
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3029);
13723
+ /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2901);
13685
13724
 
13725
+
13726
+
13727
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13728
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13686
13729
  // MegaPixImage.js
13687
- (function (global, factory) {
13688
- if (( false ? 0 : (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(module)) === 'object' && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(module.exports) === 'object') {
13689
- module.exports = factory(); // CommonJS
13690
- } else if (typeof define === 'function' && __webpack_require__.amdO) {
13691
- define([], factory); // AMD
13692
- } else {
13693
- global.MegaPixImage = factory(); // Browser global
13694
- }
13695
- })(typeof window !== 'undefined' ? window : undefined, function () {
13696
- // -------------------------
13697
- // Helper functions
13698
- // -------------------------
13699
- function detectSubsampling(img) {
13700
- var iw = img.naturalWidth,
13701
- ih = img.naturalHeight;
13702
- if (iw * ih > 1024 * 1024) {
13703
- var canvas = document.createElement('canvas');
13704
- canvas.width = canvas.height = 1;
13705
- var ctx = canvas.getContext('2d');
13706
- ctx.drawImage(img, -iw + 1, 0);
13707
- return ctx.getImageData(0, 0, 1, 1).data[3] === 0;
13708
- } else {
13709
- return false;
13710
- }
13711
- }
13712
- function detectVerticalSquash(img, iw, ih) {
13730
+ // 将原先的 UMD/CommonJS 改为 ESM export default
13731
+
13732
+ // -------------------------
13733
+ // Helper functions
13734
+ // -------------------------
13735
+ function detectSubsampling(img) {
13736
+ var iw = img.naturalWidth,
13737
+ ih = img.naturalHeight;
13738
+ if (iw * ih > 1024 * 1024) {
13713
13739
  var canvas = document.createElement('canvas');
13714
- canvas.width = 1;
13715
- canvas.height = ih;
13740
+ canvas.width = canvas.height = 1;
13716
13741
  var ctx = canvas.getContext('2d');
13717
- ctx.drawImage(img, 0, 0);
13718
- var data = ctx.getImageData(0, 0, 1, ih).data;
13719
- var sy = 0,
13720
- ey = ih,
13721
- py = ih;
13722
- while (py > sy) {
13723
- var alpha = data[(py - 1) * 4 + 3];
13724
- if (alpha === 0) {
13725
- ey = py;
13726
- } else {
13727
- sy = py;
13728
- }
13729
- py = ey + sy >> 1;
13730
- }
13731
- var ratio = py / ih;
13732
- return ratio === 0 ? 1 : ratio;
13742
+ ctx.drawImage(img, -iw + 1, 0);
13743
+ return ctx.getImageData(0, 0, 1, 1).data[3] === 0;
13733
13744
  }
13734
- function renderImageToDataURL(img, options, doSquash) {
13735
- var canvas = document.createElement('canvas');
13736
- renderImageToCanvas(img, canvas, options, doSquash);
13737
- return canvas.toDataURL("image/jpeg", options.quality || 0.8);
13745
+ return false;
13746
+ }
13747
+ function detectVerticalSquash(img, iw, ih) {
13748
+ var canvas = document.createElement('canvas');
13749
+ canvas.width = 1;
13750
+ canvas.height = ih;
13751
+ var ctx = canvas.getContext('2d');
13752
+ ctx.drawImage(img, 0, 0);
13753
+ var data = ctx.getImageData(0, 0, 1, ih).data;
13754
+ var sy = 0,
13755
+ ey = ih,
13756
+ py = ih;
13757
+ while (py > sy) {
13758
+ var alpha = data[(py - 1) * 4 + 3];
13759
+ if (alpha === 0) ey = py;else sy = py;
13760
+ py = ey + sy >> 1;
13738
13761
  }
13739
- function renderImageToCanvas(img, canvas, options, doSquash) {
13740
- var iw = img.naturalWidth,
13741
- ih = img.naturalHeight;
13742
- if (!(iw + ih)) return;
13743
- var width = options.width,
13744
- height = options.height;
13745
- var ctx = canvas.getContext('2d');
13746
- ctx.save();
13747
- transformCoordinate(canvas, ctx, width, height, options.orientation);
13748
- var subsampled = detectSubsampling(img);
13749
- if (subsampled) {
13750
- iw /= 2;
13751
- ih /= 2;
13752
- }
13753
- var d = 1024;
13754
- var tmpCanvas = document.createElement('canvas');
13755
- tmpCanvas.width = tmpCanvas.height = d;
13756
- var tmpCtx = tmpCanvas.getContext('2d');
13757
- var vertSquashRatio = doSquash ? detectVerticalSquash(img, iw, ih) : 1;
13758
- var dw = Math.ceil(d * width / iw);
13759
- var dh = Math.ceil(d * height / ih / vertSquashRatio);
13760
- var sy = 0,
13761
- dy = 0;
13762
- while (sy < ih) {
13763
- var sx = 0,
13764
- dx = 0;
13765
- while (sx < iw) {
13766
- tmpCtx.clearRect(0, 0, d, d);
13767
- tmpCtx.drawImage(img, -sx, -sy);
13768
- ctx.drawImage(tmpCanvas, 0, 0, d, d, dx, dy, dw, dh);
13769
- sx += d;
13770
- dx += dw;
13771
- }
13772
- sy += d;
13773
- dy += dh;
13774
- }
13775
- ctx.restore();
13776
- tmpCanvas = tmpCtx = null;
13762
+ var ratio = py / ih;
13763
+ return ratio === 0 ? 1 : ratio;
13764
+ }
13765
+ function renderImageToDataURL(img, options, doSquash) {
13766
+ var canvas = document.createElement('canvas');
13767
+ renderImageToCanvas(img, canvas, options, doSquash);
13768
+ return canvas.toDataURL("image/jpeg", options.quality || 0.8);
13769
+ }
13770
+ function renderImageToCanvas(img, canvas, options, doSquash) {
13771
+ var iw = img.naturalWidth,
13772
+ ih = img.naturalHeight;
13773
+ if (!(iw + ih)) return;
13774
+ var width = options.width,
13775
+ height = options.height;
13776
+ var ctx = canvas.getContext('2d');
13777
+ ctx.save();
13778
+ transformCoordinate(canvas, ctx, width, height, options.orientation);
13779
+ var subsampled = detectSubsampling(img);
13780
+ if (subsampled) {
13781
+ iw /= 2;
13782
+ ih /= 2;
13777
13783
  }
13778
- function transformCoordinate(canvas, ctx, width, height, orientation) {
13779
- switch (orientation) {
13780
- case 5:
13781
- case 6:
13782
- case 7:
13783
- case 8:
13784
- canvas.width = height;
13785
- canvas.height = width;
13786
- break;
13787
- default:
13788
- canvas.width = width;
13789
- canvas.height = height;
13790
- }
13791
- switch (orientation) {
13792
- case 2:
13793
- ctx.translate(width, 0);
13794
- ctx.scale(-1, 1);
13795
- break;
13796
- case 3:
13797
- ctx.translate(width, height);
13798
- ctx.rotate(Math.PI);
13799
- break;
13800
- case 4:
13801
- ctx.translate(0, height);
13802
- ctx.scale(1, -1);
13803
- break;
13804
- case 5:
13805
- ctx.rotate(0.5 * Math.PI);
13806
- ctx.scale(1, -1);
13807
- break;
13808
- case 6:
13809
- ctx.rotate(0.5 * Math.PI);
13810
- ctx.translate(0, -height);
13811
- break;
13812
- case 7:
13813
- ctx.rotate(0.5 * Math.PI);
13814
- ctx.translate(width, -height);
13815
- ctx.scale(-1, 1);
13816
- break;
13817
- case 8:
13818
- ctx.rotate(-0.5 * Math.PI);
13819
- ctx.translate(-width, 0);
13820
- break;
13821
- }
13784
+ var d = 1024;
13785
+ var tmpCanvas = document.createElement('canvas');
13786
+ tmpCanvas.width = tmpCanvas.height = d;
13787
+ var tmpCtx = tmpCanvas.getContext('2d');
13788
+ var vertSquashRatio = doSquash ? detectVerticalSquash(img, iw, ih) : 1;
13789
+ var dw = Math.ceil(d * width / iw);
13790
+ var dh = Math.ceil(d * height / ih / vertSquashRatio);
13791
+ var sy = 0,
13792
+ dy = 0;
13793
+ while (sy < ih) {
13794
+ var sx = 0,
13795
+ dx = 0;
13796
+ while (sx < iw) {
13797
+ tmpCtx.clearRect(0, 0, d, d);
13798
+ tmpCtx.drawImage(img, -sx, -sy);
13799
+ ctx.drawImage(tmpCanvas, 0, 0, d, d, dx, dy, dw, dh);
13800
+ sx += d;
13801
+ dx += dw;
13802
+ }
13803
+ sy += d;
13804
+ dy += dh;
13805
+ }
13806
+ ctx.restore();
13807
+ }
13808
+ function transformCoordinate(canvas, ctx, width, height, orientation) {
13809
+ switch (orientation) {
13810
+ case 5:
13811
+ case 6:
13812
+ case 7:
13813
+ case 8:
13814
+ canvas.width = height;
13815
+ canvas.height = width;
13816
+ break;
13817
+ default:
13818
+ canvas.width = width;
13819
+ canvas.height = height;
13822
13820
  }
13823
- var URL = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null;
13821
+ switch (orientation) {
13822
+ case 2:
13823
+ ctx.translate(width, 0);
13824
+ ctx.scale(-1, 1);
13825
+ break;
13826
+ case 3:
13827
+ ctx.translate(width, height);
13828
+ ctx.rotate(Math.PI);
13829
+ break;
13830
+ case 4:
13831
+ ctx.translate(0, height);
13832
+ ctx.scale(1, -1);
13833
+ break;
13834
+ case 5:
13835
+ ctx.rotate(0.5 * Math.PI);
13836
+ ctx.scale(1, -1);
13837
+ break;
13838
+ case 6:
13839
+ ctx.rotate(0.5 * Math.PI);
13840
+ ctx.translate(0, -height);
13841
+ break;
13842
+ case 7:
13843
+ ctx.rotate(0.5 * Math.PI);
13844
+ ctx.translate(width, -height);
13845
+ ctx.scale(-1, 1);
13846
+ break;
13847
+ case 8:
13848
+ ctx.rotate(-0.5 * Math.PI);
13849
+ ctx.translate(-width, 0);
13850
+ break;
13851
+ }
13852
+ }
13853
+ var URL = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null;
13824
13854
 
13825
- // -------------------------
13826
- // MegaPixImage class
13827
- // -------------------------
13855
+ // -------------------------
13856
+ // MegaPixImage class
13857
+ // -------------------------
13858
+ var MegaPixImage = /*#__PURE__*/function () {
13828
13859
  function MegaPixImage(srcImage) {
13860
+ (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(this, MegaPixImage);
13829
13861
  if (window.Blob && srcImage instanceof Blob) {
13830
- if (!URL) {
13831
- throw Error("No createObjectURL function found");
13832
- }
13862
+ if (!URL) throw Error("No createObjectURL function found");
13833
13863
  var img = new Image();
13834
13864
  img.src = URL.createObjectURL(srcImage);
13835
13865
  this.blob = srcImage;
13836
13866
  srcImage = img;
13837
13867
  }
13838
13868
  if (!srcImage.naturalWidth && !srcImage.naturalHeight) {
13869
+ this.imageLoadListeners = [];
13839
13870
  var _this = this;
13840
13871
  srcImage.onload = srcImage.onerror = function () {
13841
13872
  var listeners = _this.imageLoadListeners;
13842
13873
  if (listeners) {
13843
13874
  _this.imageLoadListeners = null;
13844
- for (var i = 0; i < listeners.length; i++) {
13845
- listeners[i]();
13846
- }
13875
+ listeners.forEach(function (fn) {
13876
+ return fn();
13877
+ });
13847
13878
  }
13848
13879
  };
13849
- this.imageLoadListeners = [];
13850
13880
  }
13851
13881
  this.srcImage = srcImage;
13852
13882
  }
13853
- MegaPixImage.prototype.render = function (target, options, callback) {
13854
- if (this.imageLoadListeners) {
13855
- var _this = this;
13856
- this.imageLoadListeners.push(function () {
13857
- _this.render(target, options, callback);
13858
- });
13859
- return;
13860
- }
13861
- options = options || {};
13862
- var imgWidth = this.srcImage.naturalWidth,
13863
- imgHeight = this.srcImage.naturalHeight,
13864
- width = options.width,
13865
- height = options.height,
13866
- maxWidth = options.maxWidth,
13867
- maxHeight = options.maxHeight,
13868
- doSquash = !this.blob || this.blob.type === 'image/jpeg';
13869
- if (width && !height) {
13870
- height = imgHeight * width / imgWidth << 0;
13871
- } else if (height && !width) {
13872
- width = imgWidth * height / imgHeight << 0;
13873
- } else {
13874
- width = imgWidth;
13875
- height = imgHeight;
13876
- }
13877
- if (maxWidth && width > maxWidth) {
13878
- width = maxWidth;
13879
- height = imgHeight * width / imgWidth << 0;
13880
- }
13881
- if (maxHeight && height > maxHeight) {
13882
- height = maxHeight;
13883
- width = imgWidth * height / imgHeight << 0;
13884
- }
13885
- var opt = {
13886
- width: width,
13887
- height: height
13888
- };
13889
- for (var k in options) opt[k] = options[k];
13890
- var tagName = target.tagName.toLowerCase();
13891
- if (tagName === 'img') {
13892
- target.src = renderImageToDataURL(this.srcImage, opt, doSquash);
13893
- } else if (tagName === 'canvas') {
13894
- renderImageToCanvas(this.srcImage, target, opt, doSquash);
13895
- }
13896
- if (typeof this.onrender === 'function') {
13897
- this.onrender(target);
13898
- }
13899
- if (callback) {
13900
- callback();
13901
- }
13902
- if (this.blob) {
13903
- this.blob = null;
13904
- URL.revokeObjectURL(this.srcImage.src);
13883
+ return (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(MegaPixImage, [{
13884
+ key: "render",
13885
+ value: function render(target, options, callback) {
13886
+ var _this2 = this;
13887
+ if (this.imageLoadListeners) {
13888
+ this.imageLoadListeners.push(function () {
13889
+ _this2.render(target, options, callback);
13890
+ });
13891
+ return;
13892
+ }
13893
+ options = options || {};
13894
+ var imgWidth = this.srcImage.naturalWidth,
13895
+ imgHeight = this.srcImage.naturalHeight;
13896
+ var width = options.width,
13897
+ height = options.height;
13898
+ var maxWidth = options.maxWidth,
13899
+ maxHeight = options.maxHeight;
13900
+ var doSquash = !this.blob || this.blob.type === 'image/jpeg';
13901
+ if (width && !height) height = imgHeight * width / imgWidth << 0;else if (height && !width) width = imgWidth * height / imgHeight << 0;else {
13902
+ width = imgWidth;
13903
+ height = imgHeight;
13904
+ }
13905
+ if (maxWidth && width > maxWidth) {
13906
+ width = maxWidth;
13907
+ height = imgHeight * width / imgWidth << 0;
13908
+ }
13909
+ if (maxHeight && height > maxHeight) {
13910
+ height = maxHeight;
13911
+ width = imgWidth * height / imgHeight << 0;
13912
+ }
13913
+ var opt = _objectSpread({
13914
+ width: width,
13915
+ height: height
13916
+ }, options);
13917
+ var tagName = target.tagName.toLowerCase();
13918
+ if (tagName === 'img') target.src = renderImageToDataURL(this.srcImage, opt, doSquash);else if (tagName === 'canvas') renderImageToCanvas(this.srcImage, target, opt, doSquash);
13919
+ if (typeof this.onrender === 'function') this.onrender(target);
13920
+ if (callback) callback();
13921
+ if (this.blob) {
13922
+ this.blob = null;
13923
+ URL.revokeObjectURL(this.srcImage.src);
13924
+ }
13905
13925
  }
13906
- };
13907
-
13908
- // -------------------------
13909
- // Export as ESM default
13910
- // -------------------------
13911
- return MegaPixImage;
13912
- });
13926
+ }]);
13927
+ }(); // -------------------------
13928
+ // ESM export default
13929
+ // -------------------------
13930
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MegaPixImage);
13913
13931
 
13914
13932
  /***/ },
13915
13933
 
@@ -13999,7 +14017,7 @@ _textBar__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Number = _Number__WEBP
13999
14017
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14000
14018
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
14001
14019
  /* harmony export */ });
14002
- /* harmony import */ var _upload_vue_vue_type_template_id_b2513a8a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3610);
14020
+ /* harmony import */ var _upload_vue_vue_type_template_id_23492f0b__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4708);
14003
14021
  /* harmony import */ var _upload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7426);
14004
14022
  /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4486);
14005
14023
 
@@ -14011,8 +14029,8 @@ _textBar__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Number = _Number__WEBP
14011
14029
  ;
14012
14030
  var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(
14013
14031
  _upload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A,
14014
- _upload_vue_vue_type_template_id_b2513a8a__WEBPACK_IMPORTED_MODULE_0__/* .render */ .X,
14015
- _upload_vue_vue_type_template_id_b2513a8a__WEBPACK_IMPORTED_MODULE_0__/* .staticRenderFns */ .Y,
14032
+ _upload_vue_vue_type_template_id_23492f0b__WEBPACK_IMPORTED_MODULE_0__/* .render */ .X,
14033
+ _upload_vue_vue_type_template_id_23492f0b__WEBPACK_IMPORTED_MODULE_0__/* .staticRenderFns */ .Y,
14016
14034
  false,
14017
14035
  null,
14018
14036
  null,
@@ -15216,26 +15234,18 @@ _confirm__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.remove = function () {
15216
15234
  /******/ // Create a new module (and put it into the cache)
15217
15235
  /******/ var module = __webpack_module_cache__[moduleId] = {
15218
15236
  /******/ id: moduleId,
15219
- /******/ loaded: false,
15237
+ /******/ // no module.loaded needed
15220
15238
  /******/ exports: {}
15221
15239
  /******/ };
15222
15240
  /******/
15223
15241
  /******/ // Execute the module function
15224
15242
  /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
15225
15243
  /******/
15226
- /******/ // Flag the module as loaded
15227
- /******/ module.loaded = true;
15228
- /******/
15229
15244
  /******/ // Return the exports of the module
15230
15245
  /******/ return module.exports;
15231
15246
  /******/ }
15232
15247
  /******/
15233
15248
  /************************************************************************/
15234
- /******/ /* webpack/runtime/amd options */
15235
- /******/ (() => {
15236
- /******/ __webpack_require__.amdO = {};
15237
- /******/ })();
15238
- /******/
15239
15249
  /******/ /* webpack/runtime/compat get default export */
15240
15250
  /******/ (() => {
15241
15251
  /******/ // getDefaultExport function for compatibility with non-harmony modules
@@ -15260,21 +15270,6 @@ _confirm__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.remove = function () {
15260
15270
  /******/ };
15261
15271
  /******/ })();
15262
15272
  /******/
15263
- /******/ /* webpack/runtime/harmony module decorator */
15264
- /******/ (() => {
15265
- /******/ __webpack_require__.hmd = (module) => {
15266
- /******/ module = Object.create(module);
15267
- /******/ if (!module.children) module.children = [];
15268
- /******/ Object.defineProperty(module, 'exports', {
15269
- /******/ enumerable: true,
15270
- /******/ set: () => {
15271
- /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
15272
- /******/ }
15273
- /******/ });
15274
- /******/ return module;
15275
- /******/ };
15276
- /******/ })();
15277
- /******/
15278
15273
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
15279
15274
  /******/ (() => {
15280
15275
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))