cy-element-ui 1.0.74 → 1.0.76

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.
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 71);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 72);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 71:
195
+ /***/ 72:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/transfer.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 69);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 70);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -2220,7 +2220,29 @@ function _broadcast(componentName, eventName, params) {
2220
2220
 
2221
2221
  /***/ }),
2222
2222
 
2223
- /***/ 69:
2223
+ /***/ 7:
2224
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2225
+
2226
+ "use strict";
2227
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
2228
+ for (var i = 1, j = arguments.length; i < j; i++) {
2229
+ var source = arguments[i] || {};
2230
+ for (var prop in source) {
2231
+ if (source.hasOwnProperty(prop)) {
2232
+ var value = source[prop];
2233
+ if (value !== undefined) {
2234
+ target[prop] = value;
2235
+ }
2236
+ }
2237
+ }
2238
+ }
2239
+
2240
+ return target;
2241
+ });;
2242
+
2243
+ /***/ }),
2244
+
2245
+ /***/ 70:
2224
2246
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2225
2247
 
2226
2248
  "use strict";
@@ -2971,28 +2993,6 @@ main.install = function (Vue) {
2971
2993
 
2972
2994
  /* harmony default export */ var transfer = __webpack_exports__["default"] = (main);
2973
2995
 
2974
- /***/ }),
2975
-
2976
- /***/ 7:
2977
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2978
-
2979
- "use strict";
2980
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
2981
- for (var i = 1, j = arguments.length; i < j; i++) {
2982
- var source = arguments[i] || {};
2983
- for (var prop in source) {
2984
- if (source.hasOwnProperty(prop)) {
2985
- var value = source[prop];
2986
- if (value !== undefined) {
2987
- target[prop] = value;
2988
- }
2989
- }
2990
- }
2991
- }
2992
-
2993
- return target;
2994
- });;
2995
-
2996
2996
  /***/ })
2997
2997
 
2998
2998
  /******/ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cy-element-ui",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "基于ElementUI开发的组件",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -1,78 +1,82 @@
1
- <script>
2
-
3
- export default {
4
- props: {
5
- isAutoWidth: Boolean,
6
- updateAll: Boolean
7
- },
8
-
9
- inject: ['elForm', 'elFormItem'],
10
-
11
- render() {
12
- const slots = this.$slots.default;
13
- if (!slots) return null;
14
- if (this.isAutoWidth) {
15
- const autoLabelWidth = this.elForm.autoLabelWidth;
16
- const style = {};
17
- if (autoLabelWidth && autoLabelWidth !== 'auto') {
18
- const marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
19
- if (marginLeft) {
20
- style.marginLeft = marginLeft + 'px';
21
- }
22
- }
23
- return (<div class="el-form-item__label-wrap" style={style}>
24
- { slots }
25
- </div>);
26
- } else {
27
- return slots[0];
28
- }
29
- },
30
-
31
- methods: {
32
- getLabelWidth() {
33
- if (this.$el && this.$el.firstElementChild) {
34
- const computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
35
- return Math.ceil(parseFloat(computedWidth));
36
- } else {
37
- return 0;
38
- }
39
- },
40
- updateLabelWidth(action = 'update') {
41
- if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
42
- if (action === 'update') {
43
- this.computedWidth = this.getLabelWidth();
44
- } else if (action === 'remove') {
45
- this.elForm.deregisterLabelWidth(this.computedWidth);
46
- }
47
- }
48
- }
49
- },
50
-
51
- watch: {
52
- computedWidth(val, oldVal) {
53
- if (this.updateAll) {
54
- this.elForm.registerLabelWidth(val, oldVal);
55
- this.elFormItem.updateComputedLabelWidth(val);
56
- }
57
- }
58
- },
59
-
60
- data() {
61
- return {
62
- computedWidth: 0
63
- };
64
- },
65
-
66
- mounted() {
67
- this.updateLabelWidth('update');
68
- },
69
-
70
- updated() {
71
- this.updateLabelWidth('update');
72
- },
73
-
74
- beforeDestroy() {
75
- this.updateLabelWidth('remove');
76
- }
77
- };
78
- </script>
1
+ <template></template>
2
+ <script>
3
+
4
+ export default {
5
+ props: {
6
+ isAutoWidth: Boolean,
7
+ updateAll: Boolean
8
+ },
9
+
10
+ inject: ['elForm', 'elFormItem'],
11
+
12
+ render: function(h) {
13
+ var slots = this.$slots.default;
14
+ if (!slots) return null;
15
+ if (this.isAutoWidth) {
16
+ var autoLabelWidth = this.elForm.autoLabelWidth;
17
+ var style = {};
18
+ if (autoLabelWidth && autoLabelWidth !== 'auto') {
19
+ var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
20
+ if (marginLeft) {
21
+ style.marginLeft = marginLeft + 'px';
22
+ }
23
+ }
24
+ return h(
25
+ 'div',
26
+ { 'class': 'el-form-item__label-wrap', style: style },
27
+ [slots]
28
+ );
29
+ } else {
30
+ return slots[0];
31
+ }
32
+ },
33
+
34
+ methods: {
35
+ getLabelWidth: function() {
36
+ if (this.$el && this.$el.firstElementChild) {
37
+ var computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
38
+ return Math.ceil(parseFloat(computedWidth));
39
+ } else {
40
+ return 0;
41
+ }
42
+ },
43
+ updateLabelWidth: function(action) {
44
+ action = action || 'update';
45
+ if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
46
+ if (action === 'update') {
47
+ this.computedWidth = this.getLabelWidth();
48
+ } else if (action === 'remove') {
49
+ this.elForm.deregisterLabelWidth(this.computedWidth);
50
+ }
51
+ }
52
+ }
53
+ },
54
+
55
+ watch: {
56
+ computedWidth: function(val, oldVal) {
57
+ if (this.updateAll) {
58
+ this.elForm.registerLabelWidth(val, oldVal);
59
+ this.elFormItem.updateComputedLabelWidth(val);
60
+ }
61
+ }
62
+ },
63
+
64
+ data: function() {
65
+ return {
66
+ computedWidth: 0
67
+ };
68
+ },
69
+
70
+ mounted: function() {
71
+ this.updateLabelWidth('update');
72
+ },
73
+
74
+ updated: function() {
75
+ this.updateLabelWidth('update');
76
+ },
77
+
78
+ beforeDestroy: function() {
79
+ this.updateLabelWidth('remove');
80
+ }
81
+ };
82
+ </script>
package/src/index.js CHANGED
@@ -94,8 +94,8 @@ import SubTitle from '../packages/subTitle/index.js';
94
94
  import TabDialog from '../packages/tabDialog/index.js';
95
95
  import FileUpload from '../packages/fileUpload/index.js';
96
96
  import SelectDisplayInput from '../packages/selectDisplayInput/index.js';
97
- import locale from 'element-ui/src/locale';
98
- import CollapseTransition from 'element-ui/src/transitions/collapse-transition';
97
+ import locale from './locale';
98
+ import CollapseTransition from './transitions/collapse-transition';
99
99
 
100
100
  const components = [
101
101
  Pagination,
@@ -221,7 +221,7 @@ if (typeof window !== 'undefined' && window.Vue) {
221
221
  }
222
222
 
223
223
  export default {
224
- version: '1.0.74',
224
+ version: '1.0.76',
225
225
  locale: locale.use,
226
226
  i18n: locale.i18n,
227
227
  install,