cy-element-ui 1.0.28 → 1.0.30

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 (210) hide show
  1. package/README.md +23 -14
  2. package/lib/alert.js +4 -4
  3. package/lib/aside.js +2 -2
  4. package/lib/autocomplete.js +4 -4
  5. package/lib/avatar.js +2 -2
  6. package/lib/backtop.js +4 -4
  7. package/lib/badge.js +4 -4
  8. package/lib/breadcrumb-item.js +4 -4
  9. package/lib/breadcrumb.js +2 -2
  10. package/lib/button-group.js +2 -2
  11. package/lib/button.js +2 -2
  12. package/lib/calendar.js +6 -6
  13. package/lib/card.js +2 -2
  14. package/lib/carousel-item.js +4 -4
  15. package/lib/carousel.js +2 -2
  16. package/lib/cascader-panel.js +4 -4
  17. package/lib/cascader.js +4 -4
  18. package/lib/checkbox-button.js +4 -4
  19. package/lib/checkbox-group.js +2 -2
  20. package/lib/checkbox.js +4 -4
  21. package/lib/col.js +2 -2
  22. package/lib/collapse-item.js +4 -4
  23. package/lib/collapse.js +2 -2
  24. package/lib/color-picker.js +45 -45
  25. package/lib/container.js +2 -2
  26. package/lib/date-picker.js +49 -45
  27. package/lib/descriptions-item.js +2 -2
  28. package/lib/descriptions.js +2 -2
  29. package/lib/dialog.js +4 -4
  30. package/lib/divider.js +4 -4
  31. package/lib/drawer.js +6 -6
  32. package/lib/dropdown-item.js +2 -2
  33. package/lib/dropdown-menu.js +2 -2
  34. package/lib/dropdown.js +10 -10
  35. package/lib/element-ui.common.js +1801 -388
  36. package/lib/empty.js +4 -4
  37. package/lib/fileUpload.js +978 -0
  38. package/lib/footer.js +2 -2
  39. package/lib/form-item.js +4 -4
  40. package/lib/form.js +4 -4
  41. package/lib/header.js +2 -2
  42. package/lib/icon.js +2 -2
  43. package/lib/image.js +12 -12
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +2 -2
  46. package/lib/input-number.js +2 -2
  47. package/lib/input.js +4 -4
  48. package/lib/link.js +2 -2
  49. package/lib/loading.js +4 -4
  50. package/lib/locale/format.js +0 -1
  51. package/lib/main.js +2 -2
  52. package/lib/menu-item-group.js +4 -4
  53. package/lib/menu-item.js +2 -2
  54. package/lib/menu.js +3 -3
  55. package/lib/message-box.js +7 -7
  56. package/lib/message.js +4 -4
  57. package/lib/notification.js +4 -4
  58. package/lib/option-group.js +2 -2
  59. package/lib/option.js +2 -2
  60. package/lib/page-header.js +2 -2
  61. package/lib/pagination.js +4 -4
  62. package/lib/popconfirm.js +12 -12
  63. package/lib/popover.js +4 -4
  64. package/lib/progress.js +4 -4
  65. package/lib/radio-button.js +4 -4
  66. package/lib/radio-group.js +2 -2
  67. package/lib/radio.js +4 -4
  68. package/lib/rate.js +9 -9
  69. package/lib/result.js +2 -2
  70. package/lib/row.js +2 -2
  71. package/lib/scrollbar.js +2 -2
  72. package/lib/select.js +2 -2
  73. package/lib/skeleton-item.js +2 -2
  74. package/lib/skeleton.js +2 -2
  75. package/lib/slider.js +4 -4
  76. package/lib/spinner.js +2 -2
  77. package/lib/statistic.js +4 -4
  78. package/lib/step.js +4 -4
  79. package/lib/steps.js +11 -11
  80. package/lib/subTitle.js +293 -0
  81. package/lib/submenu.js +2 -3
  82. package/lib/switch.js +2 -2
  83. package/lib/tab-pane.js +2 -2
  84. package/lib/tabDialog.js +787 -0
  85. package/lib/table-column.js +4 -4
  86. package/lib/table.js +19 -16
  87. package/lib/tabs.js +4 -4
  88. package/lib/tag.js +2 -2
  89. package/lib/time-picker.js +2 -2
  90. package/lib/time-select.js +2 -2
  91. package/lib/timeline-item.js +4 -4
  92. package/lib/timeline.js +2 -2
  93. package/lib/tooltip.js +2 -2
  94. package/lib/transfer.js +7 -7
  95. package/lib/tree.js +11 -11
  96. package/lib/{treeselect.js → treeSelect.js} +31 -31
  97. package/lib/upload.js +14 -14
  98. package/package.json +5 -1
  99. package/packages/alert/src/main.vue +1 -1
  100. package/packages/autocomplete/src/autocomplete.vue +3 -3
  101. package/packages/avatar/src/main.vue +5 -5
  102. package/packages/backtop/src/main.vue +3 -3
  103. package/packages/badge/src/main.vue +1 -1
  104. package/packages/breadcrumb/src/breadcrumb-item.vue +1 -1
  105. package/packages/calendar/src/date-table.vue +3 -3
  106. package/packages/calendar/src/main.vue +5 -5
  107. package/packages/carousel/src/item.vue +1 -1
  108. package/packages/cascader/src/cascader.vue +2 -2
  109. package/packages/cascader-panel/src/cascader-menu.vue +4 -4
  110. package/packages/cascader-panel/src/node.js +3 -4
  111. package/packages/cascader-panel/src/store.js +1 -2
  112. package/packages/checkbox/src/checkbox-button.vue +8 -8
  113. package/packages/checkbox/src/checkbox.vue +1 -1
  114. package/packages/col/src/col.js +5 -5
  115. package/packages/collapse/src/collapse-item.vue +1 -1
  116. package/packages/color-picker/src/color.js +4 -4
  117. package/packages/color-picker/src/components/alpha-slider.vue +12 -12
  118. package/packages/color-picker/src/components/hue-slider.vue +6 -6
  119. package/packages/color-picker/src/components/picker-dropdown.vue +1 -1
  120. package/packages/color-picker/src/components/predefine.vue +4 -4
  121. package/packages/color-picker/src/components/sv-panel.vue +4 -4
  122. package/packages/color-picker/src/main.vue +8 -8
  123. package/packages/date-picker/src/basic/date-table.vue +19 -19
  124. package/packages/date-picker/src/basic/month-table.vue +8 -9
  125. package/packages/date-picker/src/basic/year-table.vue +38 -38
  126. package/packages/date-picker/src/panel/date-range.vue +1 -1
  127. package/packages/date-picker/src/panel/date.vue +5 -5
  128. package/packages/date-picker/src/panel/month-range.vue +1 -1
  129. package/packages/descriptions/src/descriptions-row.js +3 -3
  130. package/packages/descriptions/src/index.js +1 -1
  131. package/packages/divider/src/main.vue +1 -1
  132. package/packages/drawer/src/main.vue +2 -2
  133. package/packages/dropdown/src/dropdown.vue +1 -1
  134. package/packages/empty/src/index.vue +1 -1
  135. package/packages/fileUpload/index.js +8 -0
  136. package/packages/fileUpload/src/main.vue +430 -0
  137. package/packages/form/src/form-item.vue +3 -3
  138. package/packages/form/src/form.vue +1 -1
  139. package/packages/image/src/image-viewer.vue +4 -4
  140. package/packages/infinite-scroll/src/main.js +2 -3
  141. package/packages/input/src/calcTextareaHeight.js +2 -2
  142. package/packages/input/src/input.vue +15 -15
  143. package/packages/menu/src/menu-item-group.vue +1 -1
  144. package/packages/menu/src/menu.vue +4 -4
  145. package/packages/menu/src/submenu.vue +3 -4
  146. package/packages/message/src/main.js +1 -1
  147. package/packages/notification/src/main.js +1 -1
  148. package/packages/pagination/src/pager.vue +1 -1
  149. package/packages/popconfirm/src/main.vue +28 -28
  150. package/packages/popover/src/main.vue +1 -1
  151. package/packages/progress/src/progress.vue +10 -10
  152. package/packages/radio/src/radio-button.vue +2 -2
  153. package/packages/radio/src/radio.vue +1 -1
  154. package/packages/row/src/row.js +3 -3
  155. package/packages/scrollbar/src/main.js +2 -2
  156. package/packages/scrollbar/src/util.js +1 -1
  157. package/packages/slider/src/main.vue +2 -2
  158. package/packages/statistic/src/main.vue +6 -7
  159. package/packages/steps/src/step.vue +2 -2
  160. package/packages/steps/src/steps.vue +4 -4
  161. package/packages/subTitle/index.js +8 -0
  162. package/packages/subTitle/src/main.vue +33 -0
  163. package/packages/tabDialog/index.js +23 -0
  164. package/packages/tabDialog/src/dialog/drag.js +63 -0
  165. package/packages/tabDialog/src/dialog/dragHeight.js +34 -0
  166. package/packages/tabDialog/src/dialog/dragWidth.js +30 -0
  167. package/packages/tabDialog/src/main.vue +277 -0
  168. package/packages/table/src/filter-panel.vue +7 -7
  169. package/packages/table/src/store/index.js +1 -1
  170. package/packages/table/src/table-body.js +2 -2
  171. package/packages/table/src/table-column.js +1 -1
  172. package/packages/table/src/table-header.js +1 -1
  173. package/packages/table/src/table-layout.js +1 -1
  174. package/packages/table/src/table.vue +16 -16
  175. package/packages/tabs/src/tab-bar.vue +3 -3
  176. package/packages/tabs/src/tab-nav.vue +13 -13
  177. package/packages/tabs/src/tabs.vue +3 -3
  178. package/packages/tag/src/tag.vue +3 -3
  179. package/packages/theme-cy/lib/element.css +1 -0
  180. package/packages/theme-cy/lib/fileUpload.css +1 -0
  181. package/packages/theme-cy/lib/index.css +1 -1
  182. package/packages/theme-cy/lib/subTitle.css +1 -0
  183. package/packages/theme-cy/lib/tabDialog.css +1 -0
  184. package/packages/theme-cy/lib/treeSelect.css +1 -0
  185. package/packages/theme-cy/src/element.scss +45 -0
  186. package/packages/theme-cy/src/fileUpload.scss +30 -0
  187. package/packages/theme-cy/src/index.scss +5 -1
  188. package/packages/theme-cy/src/subTitle.scss +26 -0
  189. package/packages/theme-cy/src/tabDialog.scss +43 -0
  190. package/packages/theme-cy/src/{treeselect.scss → treeSelect.scss} +93 -87
  191. package/packages/timeline/src/item.vue +2 -2
  192. package/packages/tooltip/src/main.js +1 -1
  193. package/packages/tree/src/tree-node.vue +3 -3
  194. package/packages/treeSelect/index.js +8 -0
  195. package/packages/{treeselect → treeSelect}/src/main.vue +246 -243
  196. package/packages/upload/src/ajax.js +3 -3
  197. package/packages/upload/src/upload-list.vue +1 -1
  198. package/packages/upload/src/upload.vue +1 -1
  199. package/src/index.js +13 -5
  200. package/src/locale/format.js +1 -2
  201. package/src/mixins/migrating.js +2 -2
  202. package/src/utils/types.js +1 -1
  203. package/types/element-ui.d.ts +18 -5
  204. package/types/fileUpload.d.ts +5 -0
  205. package/types/subTitle.d.ts +5 -0
  206. package/types/tabDialog.d.ts +5 -0
  207. package/types/treeSelect.d.ts +5 -0
  208. package/packages/theme-cy/lib/treeselect.css +0 -1
  209. package/packages/treeselect/index.js +0 -8
  210. package/types/treeselect.d.ts +0 -5
@@ -4,35 +4,35 @@
4
4
  v-model="visible"
5
5
  trigger="click"
6
6
  >
7
- <div class="el-popconfirm">
8
- <p class="el-popconfirm__main">
9
- <i
10
- v-if="!hideIcon"
11
- :class="icon"
12
- class="el-popconfirm__icon"
13
- :style="{color: iconColor}"
14
- ></i>
15
- {{title}}
16
- </p>
17
- <div class="el-popconfirm__action">
18
- <el-button
19
- size="mini"
20
- :type="cancelButtonType"
21
- @click="cancel"
22
- >
23
- {{ displayCancelButtonText }}
24
- </el-button>
25
- <el-button
26
- size="mini"
27
- :type="confirmButtonType"
28
- @click="confirm"
29
- >
30
- {{ displayConfirmButtonText }}
31
- </el-button>
7
+ <div class="el-popconfirm">
8
+ <p class="el-popconfirm__main">
9
+ <i
10
+ v-if="!hideIcon"
11
+ :class="icon"
12
+ class="el-popconfirm__icon"
13
+ :style="{color: iconColor}"
14
+ ></i>
15
+ {{ title }}
16
+ </p>
17
+ <div class="el-popconfirm__action">
18
+ <el-button
19
+ size="mini"
20
+ :type="cancelButtonType"
21
+ @click="cancel"
22
+ >
23
+ {{ displayCancelButtonText }}
24
+ </el-button>
25
+ <el-button
26
+ size="mini"
27
+ :type="confirmButtonType"
28
+ @click="confirm"
29
+ >
30
+ {{ displayConfirmButtonText }}
31
+ </el-button>
32
+ </div>
32
33
  </div>
33
- </div>
34
- <slot name="reference" slot="reference"></slot>
35
- </el-popover>
34
+ <slot name="reference" slot="reference"></slot>
35
+ </el-popover>
36
36
  </template>
37
37
 
38
38
  <script>
@@ -73,7 +73,7 @@ export default {
73
73
 
74
74
  computed: {
75
75
  tooltipId() {
76
- return `el-popover-${generateId()}`;
76
+ return `el-popover-${ generateId() }`;
77
77
  }
78
78
  },
79
79
  watch: {
@@ -17,7 +17,7 @@
17
17
  <div class="el-progress-bar" v-if="type === 'line'">
18
18
  <div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px', backgroundColor:defineBackColor}">
19
19
  <div class="el-progress-bar__inner" :style="barStyle">
20
- <div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{content}}</div>
20
+ <div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{ content }}</div>
21
21
  </div>
22
22
  </div>
23
23
  </div>
@@ -45,7 +45,7 @@
45
45
  v-if="showText && !textInside"
46
46
  :style="{fontSize: progressTextSize + 'px', color:textColor}"
47
47
  >
48
- <template v-if="!status">{{content}}</template>
48
+ <template v-if="!status">{{ content }}</template>
49
49
  <i v-else :class="iconClass"></i>
50
50
  </div>
51
51
  </div>
@@ -125,9 +125,9 @@
125
125
  const isDashboard = this.type === 'dashboard';
126
126
  return `
127
127
  M 50 50
128
- m 0 ${isDashboard ? '' : '-'}${radius}
129
- a ${radius} ${radius} 0 1 1 0 ${isDashboard ? '-' : ''}${radius * 2}
130
- a ${radius} ${radius} 0 1 1 0 ${isDashboard ? '' : '-'}${radius * 2}
128
+ m 0 ${ isDashboard ? '' : '-' }${ radius }
129
+ a ${ radius } ${ radius } 0 1 1 0 ${ isDashboard ? '-' : '' }${ radius * 2 }
130
+ a ${ radius } ${ radius } 0 1 1 0 ${ isDashboard ? '' : '-' }${ radius * 2 }
131
131
  `;
132
132
  },
133
133
  perimeter() {
@@ -138,17 +138,17 @@
138
138
  },
139
139
  strokeDashoffset() {
140
140
  const offset = -1 * this.perimeter * (1 - this.rate) / 2;
141
- return `${offset}px`;
141
+ return `${ offset }px`;
142
142
  },
143
143
  trailPathStyle() {
144
144
  return {
145
- strokeDasharray: `${(this.perimeter * this.rate)}px, ${this.perimeter}px`,
145
+ strokeDasharray: `${ (this.perimeter * this.rate) }px, ${ this.perimeter }px`,
146
146
  strokeDashoffset: this.strokeDashoffset
147
147
  };
148
148
  },
149
149
  circlePathStyle() {
150
150
  return {
151
- strokeDasharray: `${this.perimeter * this.rate * (this.percentage / 100) }px, ${this.perimeter}px`,
151
+ strokeDasharray: `${ this.perimeter * this.rate * (this.percentage / 100) }px, ${ this.perimeter }px`,
152
152
  strokeDashoffset: this.strokeDashoffset,
153
153
  transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
154
154
  };
@@ -187,13 +187,13 @@
187
187
  progressTextSize() {
188
188
  return this.type === 'line'
189
189
  ? 12 + this.strokeWidth * 0.4
190
- : this.width * 0.111111 + 2 ;
190
+ : this.width * 0.111111 + 2;
191
191
  },
192
192
  content() {
193
193
  if (typeof this.format === 'function') {
194
194
  return this.format(this.percentage) || '';
195
195
  } else {
196
- return `${this.percentage}%`;
196
+ return `${ this.percentage }%`;
197
197
  }
198
198
  }
199
199
  },
@@ -31,7 +31,7 @@
31
31
  :style="value === label ? activeStyle : null"
32
32
  @keydown.stop>
33
33
  <slot></slot>
34
- <template v-if="!$slots.default">{{label}}</template>
34
+ <template v-if="!$slots.default">{{ label }}</template>
35
35
  </span>
36
36
  </label>
37
37
  </template>
@@ -86,7 +86,7 @@
86
86
  return {
87
87
  backgroundColor: this._radioGroup.fill || '',
88
88
  borderColor: this._radioGroup.fill || '',
89
- boxShadow: this._radioGroup.fill ? `-1px 0 0 0 ${this._radioGroup.fill}` : '',
89
+ boxShadow: this._radioGroup.fill ? `-1px 0 0 0 ${ this._radioGroup.fill }` : '',
90
90
  color: this._radioGroup.textColor || ''
91
91
  };
92
92
  },
@@ -39,7 +39,7 @@
39
39
  </span>
40
40
  <span class="el-radio__label" @keydown.stop>
41
41
  <slot></slot>
42
- <template v-if="!$slots.default">{{label}}</template>
42
+ <template v-if="!$slots.default">{{ label }}</template>
43
43
  </span>
44
44
  </label>
45
45
  </template>
@@ -22,7 +22,7 @@ export default {
22
22
  const ret = {};
23
23
 
24
24
  if (this.gutter) {
25
- ret.marginLeft = `-${this.gutter / 2}px`;
25
+ ret.marginLeft = `-${ this.gutter / 2 }px`;
26
26
  ret.marginRight = ret.marginLeft;
27
27
  }
28
28
 
@@ -34,8 +34,8 @@ export default {
34
34
  return h(this.tag, {
35
35
  class: [
36
36
  'el-row',
37
- this.justify !== 'start' ? `is-justify-${this.justify}` : '',
38
- this.align ? `is-align-${this.align}` : '',
37
+ this.justify !== 'start' ? `is-justify-${ this.justify }` : '',
38
+ this.align ? `is-align-${ this.align }` : '',
39
39
  { 'el-row--flex': this.type === 'flex' }
40
40
  ],
41
41
  style: this.style
@@ -44,8 +44,8 @@ export default {
44
44
  let style = this.wrapStyle;
45
45
 
46
46
  if (gutter) {
47
- const gutterWith = `-${gutter}px`;
48
- const gutterStyle = `margin-bottom: ${gutterWith}; margin-right: ${gutterWith};`;
47
+ const gutterWith = `-${ gutter }px`;
48
+ const gutterStyle = `margin-bottom: ${ gutterWith }; margin-right: ${ gutterWith };`;
49
49
 
50
50
  if (Array.isArray(this.wrapStyle)) {
51
51
  style = toObject(this.wrapStyle);
@@ -23,7 +23,7 @@ export const BAR_MAP = {
23
23
 
24
24
  export function renderThumbStyle({ move, size, bar }) {
25
25
  const style = {};
26
- const translate = `translate${bar.axis}(${ move }%)`;
26
+ const translate = `translate${ bar.axis }(${ move }%)`;
27
27
 
28
28
  style[bar.size] = size;
29
29
  style.transform = translate;
@@ -401,7 +401,7 @@
401
401
  this.secondValue = this.max;
402
402
  }
403
403
  this.oldValue = [this.firstValue, this.secondValue];
404
- valuetext = `${this.firstValue}-${this.secondValue}`;
404
+ valuetext = `${ this.firstValue }-${ this.secondValue }`;
405
405
  } else {
406
406
  if (typeof this.value !== 'number' || isNaN(this.value)) {
407
407
  this.firstValue = this.min;
@@ -414,7 +414,7 @@
414
414
  this.$el.setAttribute('aria-valuetext', valuetext);
415
415
 
416
416
  // label screen reader
417
- this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
417
+ this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${ this.min } and ${ this.max }`);
418
418
 
419
419
  this.resetSize();
420
420
  window.addEventListener('resize', this.resetSize);
@@ -109,8 +109,8 @@ export default {
109
109
  },
110
110
  magnification(num, mulriple = 1000, groupSeparator = ',') {
111
111
  // magnification factor
112
- const level = String(mulriple).length ;
113
- return num.replace(new RegExp(`(\\d)(?=(\\d{${level - 1}})+$)`, 'g'), `$1${groupSeparator}`);
112
+ const level = String(mulriple).length;
113
+ return num.replace(new RegExp(`(\\d)(?=(\\d{${ level - 1 }})+$)`, 'g'), `$1${ groupSeparator }`);
114
114
  },
115
115
  dispose() {
116
116
  let { value, rate, groupSeparator } = this;
@@ -123,7 +123,7 @@ export default {
123
123
  if (groupSeparator) {
124
124
  integer = this.magnification(integer, rate, groupSeparator);
125
125
  }
126
- let result = `${integer}${decimal ? this.decimalSeparator + decimal : ''}`;
126
+ let result = `${ integer }${ decimal ? this.decimalSeparator + decimal : '' }`;
127
127
  this.disposeValue = result;
128
128
  return result;
129
129
  },
@@ -158,7 +158,7 @@ export default {
158
158
  timeUnits,
159
159
  (con, item) => {
160
160
  const name = item[0];
161
- return con.replace(new RegExp(`${name}+`, 'g'), (match) => {
161
+ return con.replace(new RegExp(`${ name }+`, 'g'), (match) => {
162
162
  let sum = chain(time).divide(item[1]).floor(0).value();
163
163
  time -= multiply(sum, item[1]);
164
164
  return padStart(String(sum), String(match).length, 0);
@@ -189,15 +189,14 @@ export default {
189
189
  let { REFRESH_INTERVAL, timeTask, diffDate, formatTimeStr, stopTime, suspend } = this;
190
190
  if (timeTask) return;
191
191
  let than = this;
192
- this.timeTask = setInterval(()=> {
192
+ this.timeTask = setInterval(() => {
193
193
  let diffTiem = diffDate(timeVlaue, Date.now());
194
194
  than.disposeValue = formatTimeStr(diffTiem);
195
195
  stopTime(diffTiem);
196
196
  }, REFRESH_INTERVAL);
197
197
  this.$once('hook:beforeDestroy', () => {
198
198
  suspend(true);
199
- });
200
-
199
+ });
201
200
  }
202
201
  }
203
202
  };
@@ -7,7 +7,7 @@
7
7
  isSimple && 'is-simple',
8
8
  isLast && !space && !isCenter && 'is-flex',
9
9
  isCenter && !isVertical && !isSimple && 'is-center'
10
- ]">
10
+ ]">
11
11
  <!-- icon & line -->
12
12
  <div
13
13
  class="el-step__head"
@@ -110,7 +110,7 @@ export default {
110
110
  },
111
111
  space() {
112
112
  const { isSimple, $parent: { space } } = this;
113
- return isSimple ? '' : space ;
113
+ return isSimple ? '' : space;
114
114
  },
115
115
  style: function() {
116
116
  const style = {};
@@ -2,10 +2,10 @@
2
2
  <div
3
3
  class="el-steps"
4
4
  :class="[
5
- !simple && 'el-steps--' + direction,
6
- simple && 'el-steps--simple'
7
- ]">
8
- <slot></slot>
5
+ !simple && 'el-steps--' + direction,
6
+ simple && 'el-steps--simple'
7
+ ]">
8
+ <slot></slot>
9
9
  </div>
10
10
  </template>
11
11
 
@@ -0,0 +1,8 @@
1
+ import SubTitle from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ SubTitle.install = function(Vue) {
5
+ Vue.component(SubTitle.name, SubTitle);
6
+ };
7
+
8
+ export default SubTitle;
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div class="cy-sub-title" :style="lineColorStyle">
3
+ <div class="left">
4
+ <slot>{{ title }}</slot>
5
+ </div>
6
+
7
+ <div class="right">
8
+ <slot name="right"></slot>
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'CySubTitle',
16
+ props: {
17
+ title: {
18
+ type: String,
19
+ default: ''
20
+ },
21
+
22
+ lineColor: {
23
+ type: String,
24
+ default: ''
25
+ }
26
+ },
27
+ computed: {
28
+ lineColorStyle() {
29
+ return this.lineColor ? `border-color: ${ this.lineColor };` : ''
30
+ }
31
+ },
32
+ };
33
+ </script>
@@ -0,0 +1,23 @@
1
+ import TabDialog from './src/main';
2
+ import dialogDrag from './src/dialog/drag'
3
+ import dialogDragWidth from './src/dialog/dragWidth'
4
+ import dialogDragHeight from './src/dialog/dragHeight'
5
+
6
+ export const TabDialogDirective = (Vue) => {
7
+ // 注册指令
8
+ Vue.directive('dialogDrag', dialogDrag)
9
+ Vue.directive('dialogDragWidth', dialogDragWidth)
10
+ Vue.directive('dialogDragHeight', dialogDragHeight)
11
+ }
12
+
13
+ /* istanbul ignore next */
14
+ TabDialog.install = function(Vue) {
15
+ // 注册组件
16
+ Vue.component(TabDialog.name, TabDialog);
17
+ // 注册指令
18
+ Vue.directive('dialogDrag', dialogDrag)
19
+ Vue.directive('dialogDragWidth', dialogDragWidth)
20
+ Vue.directive('dialogDragHeight', dialogDragHeight)
21
+ };
22
+
23
+ export default TabDialog;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * v-dialogDrag 弹窗拖拽
3
+ * Copyright (c) 2019 ruoyi
4
+ */
5
+
6
+ export default {
7
+ bind(el, binding, vnode, oldVnode) {
8
+ const value = binding.value
9
+ if (value === false) return
10
+ // 获取拖拽内容头部
11
+ const dialogHeaderEl = el.querySelector('.el-dialog__header')
12
+ const dragDom = el.querySelector('.el-dialog')
13
+ dialogHeaderEl.style.cursor = 'move'
14
+ // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
15
+ const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
16
+ dragDom.style.position = 'absolute'
17
+ dragDom.style.marginTop = 0
18
+ let width = dragDom.style.width
19
+ if (width.includes('%')) {
20
+ width = +document.body.clientWidth * (+width.replace(/\%/g, '') / 100)
21
+ } else {
22
+ width = +width.replace(/\px/g, '')
23
+ }
24
+ dragDom.style.left = `${ (document.body.clientWidth - width) / 2 }px`
25
+ // 鼠标按下事件
26
+ dialogHeaderEl.onmousedown = (e) => {
27
+ // 鼠标按下,计算当前元素距离可视区的距离 (鼠标点击位置距离可视窗口的距离)
28
+ const disX = e.clientX - dialogHeaderEl.offsetLeft
29
+ const disY = e.clientY - dialogHeaderEl.offsetTop
30
+
31
+ // 获取到的值带px 正则匹配替换
32
+ let styL, styT
33
+
34
+ // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
35
+ if (sty.left.includes('%')) {
36
+ styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
37
+ styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
38
+ } else {
39
+ styL = +sty.left.replace(/\px/g, '')
40
+ styT = +sty.top.replace(/\px/g, '')
41
+ }
42
+
43
+ // 鼠标拖拽事件
44
+ document.onmousemove = function(e) {
45
+ // 通过事件委托,计算移动的距离 (开始拖拽至结束拖拽的距离)
46
+ const l = e.clientX - disX
47
+ const t = e.clientY - disY
48
+
49
+ let finallyL = l + styL
50
+ let finallyT = t + styT
51
+
52
+ // 移动当前元素
53
+ dragDom.style.left = `${ finallyL }px`
54
+ dragDom.style.top = `${ finallyT }px`
55
+ }
56
+
57
+ document.onmouseup = function(e) {
58
+ document.onmousemove = null
59
+ document.onmouseup = null
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * v-dialogDragWidth 可拖动弹窗高度(右下角)
3
+ * Copyright (c) 2019 ruoyi
4
+ */
5
+
6
+ export default {
7
+ bind(el) {
8
+ const dragDom = el.querySelector('.el-dialog')
9
+ const lineEl = document.createElement('div')
10
+ lineEl.style = 'width: 6px; background: inherit; height: 10px; position: absolute; right: 0; bottom: 0; margin: auto; z-index: 1; cursor: nwse-resize;'
11
+ lineEl.addEventListener('mousedown',
12
+ function(e) {
13
+ // 鼠标按下,计算当前元素距离可视区的距离
14
+ const disX = e.clientX - el.offsetLeft
15
+ const disY = e.clientY - el.offsetTop
16
+ // 当前宽度 高度
17
+ const curWidth = dragDom.offsetWidth
18
+ const curHeight = dragDom.offsetHeight
19
+ document.onmousemove = function(e) {
20
+ e.preventDefault() // 移动时禁用默认事件
21
+ // 通过事件委托,计算移动的距离
22
+ const xl = e.clientX - disX
23
+ const yl = e.clientY - disY
24
+ dragDom.style.width = `${ curWidth + xl }px`
25
+ dragDom.style.height = `${ curHeight + yl }px`
26
+ }
27
+ document.onmouseup = function(e) {
28
+ document.onmousemove = null
29
+ document.onmouseup = null
30
+ }
31
+ }, false)
32
+ dragDom.appendChild(lineEl)
33
+ }
34
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * v-dialogDragWidth 可拖动弹窗宽度(右侧边)
3
+ * Copyright (c) 2019 ruoyi
4
+ */
5
+
6
+ export default {
7
+ bind(el) {
8
+ const dragDom = el.querySelector('.el-dialog')
9
+ const lineEl = document.createElement('div')
10
+ lineEl.style = 'width: 5px; background: inherit; height: 80%; position: absolute; right: 0; top: 0; bottom: 0; margin: auto; z-index: 1; cursor: w-resize;'
11
+ lineEl.addEventListener('mousedown',
12
+ function(e) {
13
+ // 鼠标按下,计算当前元素距离可视区的距离
14
+ const disX = e.clientX - el.offsetLeft
15
+ // 当前宽度
16
+ const curWidth = dragDom.offsetWidth
17
+ document.onmousemove = function(e) {
18
+ e.preventDefault() // 移动时禁用默认事件
19
+ // 通过事件委托,计算移动的距离
20
+ const l = e.clientX - disX
21
+ dragDom.style.width = `${ curWidth + l }px`
22
+ }
23
+ document.onmouseup = function(e) {
24
+ document.onmousemove = null
25
+ document.onmouseup = null
26
+ }
27
+ }, false)
28
+ dragDom.appendChild(lineEl)
29
+ }
30
+ }