zartui 2.0.79 → 2.0.80-beta.1

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 (304) hide show
  1. package/es/action-sheet/index.js +15 -26
  2. package/es/area/index.js +5 -41
  3. package/es/avatar/index.js +3 -16
  4. package/es/back-top/index.js +4 -19
  5. package/es/badge/index.js +4 -12
  6. package/es/button/index.js +20 -40
  7. package/es/calendar/components/Header.js +3 -12
  8. package/es/calendar/components/Month.js +12 -65
  9. package/es/calendar/index.js +23 -94
  10. package/es/calendar/types.js +0 -6
  11. package/es/calendar/utils.js +5 -16
  12. package/es/cascader/index.js +4 -37
  13. package/es/cell/index.js +19 -37
  14. package/es/cell-group/index.js +5 -8
  15. package/es/checkbox/index.js +4 -11
  16. package/es/checkbox-group/index.js +4 -9
  17. package/es/col/index.js +6 -11
  18. package/es/collapse/index.js +2 -5
  19. package/es/collapse-item/index.js +19 -35
  20. package/es/count-down/index.js +2 -15
  21. package/es/count-down/utils.js +3 -10
  22. package/es/datetime-picker/DatePicker.js +12 -70
  23. package/es/datetime-picker/TimePicker.js +10 -23
  24. package/es/datetime-picker/index.js +2 -4
  25. package/es/datetime-picker/shared.js +5 -19
  26. package/es/datetime-picker/utils.js +0 -5
  27. package/es/dialog/Dialog.js +6 -21
  28. package/es/dialog/index.js +0 -16
  29. package/es/divider/index.js +5 -6
  30. package/es/dropdown-item/index.js +22 -35
  31. package/es/dropdown-menu/index.js +4 -9
  32. package/es/empty/index.js +3 -11
  33. package/es/field/index.js +20 -83
  34. package/es/fold-dialog/index.js +5 -20
  35. package/es/form/index.js +2 -18
  36. package/es/grid/index.js +2 -6
  37. package/es/grid-item/index.js +17 -30
  38. package/es/hierarchy-select/breadcrumb.js +2 -6
  39. package/es/hierarchy-select/index.js +3 -12
  40. package/es/hierarchy-select/markList.js +2 -25
  41. package/es/hierarchy-select/svg/SubIcon.js +0 -1
  42. package/es/icon/index.js +9 -13
  43. package/es/image/index.js +2 -17
  44. package/es/image-preview/ImagePreview.js +4 -8
  45. package/es/image-preview/ImagePreviewItem.js +14 -30
  46. package/es/image-preview/index.js +0 -12
  47. package/es/image-preview/shared.js +2 -4
  48. package/es/index-anchor/index.js +2 -6
  49. package/es/index-bar/IndexIndicate.js +0 -1
  50. package/es/index-bar/index.js +7 -28
  51. package/es/index.js +1 -4
  52. package/es/info/index.js +6 -8
  53. package/es/list/index.js +11 -27
  54. package/es/loading/index.js +7 -15
  55. package/es/locale/index.js +0 -2
  56. package/es/media-picker/index.js +33 -117
  57. package/es/media-picker/media-util.js +2 -5
  58. package/es/media-picker/type.js +0 -5
  59. package/es/media-player/index.js +7 -17
  60. package/es/mixins/bind-event.js +0 -3
  61. package/es/mixins/checkbox.js +5 -11
  62. package/es/mixins/click-outside.js +0 -2
  63. package/es/mixins/close-on-popstate.js +0 -1
  64. package/es/mixins/field.js +0 -2
  65. package/es/mixins/popup/index.js +12 -28
  66. package/es/mixins/popup/overlay.js +1 -11
  67. package/es/mixins/portal.js +2 -8
  68. package/es/mixins/relation.js +0 -8
  69. package/es/mixins/slots.js +1 -4
  70. package/es/mixins/touch.js +4 -9
  71. package/es/multiple-picker/MultiplePickerOptions.js +2 -18
  72. package/es/multiple-picker/index.js +5 -17
  73. package/es/nav-bar/index.js +4 -12
  74. package/es/notice-bar/index.js +10 -28
  75. package/es/number-keyboard/Key.js +2 -10
  76. package/es/number-keyboard/index.js +4 -19
  77. package/es/overlay/index.js +5 -8
  78. package/es/password-input/index.js +10 -16
  79. package/es/picker/PickerColumn.js +20 -54
  80. package/es/picker/index.js +13 -42
  81. package/es/popover/index.js +11 -20
  82. package/es/popup/index.js +5 -21
  83. package/es/pull-refresh/index.js +15 -32
  84. package/es/radio/index.js +2 -4
  85. package/es/radio-group/index.js +2 -4
  86. package/es/rate/index.js +12 -26
  87. package/es/row/index.js +3 -9
  88. package/es/search/index.js +8 -13
  89. package/es/signature/bezier.js +5 -12
  90. package/es/signature/force-landscape.js +0 -5
  91. package/es/signature/index.js +5 -24
  92. package/es/signature/point.js +1 -6
  93. package/es/signature/throttle.js +1 -10
  94. package/es/skeleton/index.js +5 -15
  95. package/es/slider/index.js +19 -55
  96. package/es/step/index.js +5 -12
  97. package/es/stepper/index.js +10 -37
  98. package/es/steps/index.js +2 -4
  99. package/es/sticky/index.js +8 -50
  100. package/es/swipe/index.js +19 -62
  101. package/es/swipe-cell/index.js +7 -23
  102. package/es/swipe-item/index.js +9 -19
  103. package/es/switch/index.js +8 -10
  104. package/es/switch/shared.js +1 -0
  105. package/es/switch-cell/index.js +7 -7
  106. package/es/tab/index.js +4 -15
  107. package/es/tabbar/index.js +4 -14
  108. package/es/tabbar-item/index.js +7 -15
  109. package/es/table/index.js +10 -35
  110. package/es/tabs/Content.js +5 -9
  111. package/es/tabs/Title.js +11 -19
  112. package/es/tabs/index.js +16 -51
  113. package/es/tabs/utils.js +0 -8
  114. package/es/tag/index.js +13 -17
  115. package/es/timeline/index.js +2 -25
  116. package/es/toast/Toast.js +11 -23
  117. package/es/toast/index.js +6 -33
  118. package/es/toast/lock-click.js +0 -2
  119. package/es/uploader/index.js +11 -62
  120. package/es/uploader/utils.js +0 -10
  121. package/es/utils/constant.js +2 -1
  122. package/es/utils/create/bem.js +1 -5
  123. package/es/utils/create/component.js +4 -7
  124. package/es/utils/create/i18n.js +0 -2
  125. package/es/utils/deep-assign.js +0 -4
  126. package/es/utils/deep-clone.js +0 -3
  127. package/es/utils/dom/event.js +2 -5
  128. package/es/utils/dom/node.js +0 -1
  129. package/es/utils/dom/raf.js +7 -6
  130. package/es/utils/dom/reset-scroll.js +2 -1
  131. package/es/utils/dom/scroll.js +8 -17
  132. package/es/utils/dom/style.js +3 -2
  133. package/es/utils/easings.js +2 -4
  134. package/es/utils/format/date-util.js +54 -122
  135. package/es/utils/format/number.js +2 -11
  136. package/es/utils/format/string.js +0 -3
  137. package/es/utils/format/unit.js +2 -12
  138. package/es/utils/functional.js +6 -9
  139. package/es/utils/getScroll.js +0 -5
  140. package/es/utils/index.js +3 -5
  141. package/es/utils/interceptor.js +2 -4
  142. package/es/utils/media/image-util.js +7 -19
  143. package/es/utils/raf.js +4 -12
  144. package/es/utils/router.js +7 -6
  145. package/es/utils/scrollTo.js +7 -12
  146. package/es/utils/validate/number.js +2 -2
  147. package/es/utils/vnodes.js +2 -8
  148. package/lib/action-sheet/index.js +11 -35
  149. package/lib/area/index.js +5 -45
  150. package/lib/avatar/index.js +3 -18
  151. package/lib/back-top/index.js +4 -25
  152. package/lib/badge/index.js +4 -15
  153. package/lib/button/index.js +19 -50
  154. package/lib/calendar/components/Header.js +3 -18
  155. package/lib/calendar/components/Month.js +12 -71
  156. package/lib/calendar/index.js +21 -106
  157. package/lib/calendar/types.js +0 -7
  158. package/lib/calendar/utils.js +5 -32
  159. package/lib/cascader/index.js +4 -46
  160. package/lib/cell/index.js +18 -48
  161. package/lib/cell-group/index.js +5 -15
  162. package/lib/checkbox/index.js +4 -14
  163. package/lib/checkbox-group/index.js +4 -13
  164. package/lib/col/index.js +6 -14
  165. package/lib/collapse/index.js +2 -8
  166. package/lib/collapse-item/index.js +18 -43
  167. package/lib/count-down/index.js +2 -19
  168. package/lib/count-down/utils.js +3 -15
  169. package/lib/datetime-picker/DatePicker.js +12 -81
  170. package/lib/datetime-picker/TimePicker.js +10 -30
  171. package/lib/datetime-picker/index.js +2 -10
  172. package/lib/datetime-picker/shared.js +5 -27
  173. package/lib/datetime-picker/utils.js +0 -9
  174. package/lib/dialog/Dialog.js +6 -28
  175. package/lib/dialog/index.js +0 -22
  176. package/lib/divider/index.js +5 -12
  177. package/lib/dropdown-item/index.js +21 -44
  178. package/lib/dropdown-menu/index.js +4 -15
  179. package/lib/empty/index.js +3 -23
  180. package/lib/field/index.js +20 -96
  181. package/lib/fold-dialog/index.js +5 -22
  182. package/lib/form/index.js +2 -21
  183. package/lib/grid/index.js +2 -10
  184. package/lib/grid-item/index.js +16 -37
  185. package/lib/hierarchy-select/breadcrumb.js +3 -10
  186. package/lib/hierarchy-select/index.js +4 -20
  187. package/lib/hierarchy-select/markList.js +3 -31
  188. package/lib/hierarchy-select/svg/SubIcon.js +0 -1
  189. package/lib/icon/index.js +8 -19
  190. package/lib/image/index.js +2 -22
  191. package/lib/image-preview/ImagePreview.js +0 -16
  192. package/lib/image-preview/ImagePreviewItem.js +13 -36
  193. package/lib/image-preview/index.js +0 -16
  194. package/lib/image-preview/shared.js +2 -5
  195. package/lib/index-anchor/index.js +2 -11
  196. package/lib/index-bar/IndexIndicate.js +0 -1
  197. package/lib/index-bar/index.js +7 -37
  198. package/lib/index.js +1 -157
  199. package/lib/info/index.js +6 -14
  200. package/lib/lazyload/index.js +0 -3
  201. package/lib/list/index.js +10 -33
  202. package/lib/loading/index.js +7 -21
  203. package/lib/locale/index.js +0 -7
  204. package/lib/media-picker/index.js +27 -153
  205. package/lib/media-picker/media-util.js +2 -15
  206. package/lib/media-picker/type.js +0 -5
  207. package/lib/media-player/index.js +6 -22
  208. package/lib/mixins/bind-event.js +1 -6
  209. package/lib/mixins/checkbox.js +6 -18
  210. package/lib/mixins/click-outside.js +1 -5
  211. package/lib/mixins/close-on-popstate.js +0 -4
  212. package/lib/mixins/field.js +0 -2
  213. package/lib/mixins/popup/index.js +11 -36
  214. package/lib/mixins/popup/overlay.js +1 -23
  215. package/lib/mixins/portal.js +2 -9
  216. package/lib/mixins/relation.js +0 -11
  217. package/lib/mixins/slots.js +1 -5
  218. package/lib/mixins/touch.js +4 -11
  219. package/lib/multiple-picker/MultiplePickerOptions.js +2 -23
  220. package/lib/multiple-picker/index.js +5 -26
  221. package/lib/nav-bar/index.js +4 -16
  222. package/lib/notice-bar/index.js +10 -40
  223. package/lib/number-keyboard/Key.js +2 -17
  224. package/lib/number-keyboard/index.js +4 -26
  225. package/lib/overlay/index.js +5 -16
  226. package/lib/password-input/index.js +10 -23
  227. package/lib/picker/PickerColumn.js +19 -63
  228. package/lib/picker/index.js +13 -53
  229. package/lib/popover/index.js +9 -27
  230. package/lib/popup/index.js +5 -27
  231. package/lib/pull-refresh/index.js +14 -38
  232. package/lib/radio/index.js +2 -7
  233. package/lib/radio-group/index.js +2 -8
  234. package/lib/rate/index.js +11 -31
  235. package/lib/row/index.js +3 -12
  236. package/lib/search/index.js +7 -21
  237. package/lib/signature/bezier.js +5 -15
  238. package/lib/signature/force-landscape.js +0 -11
  239. package/lib/signature/index.js +6 -31
  240. package/lib/signature/point.js +0 -8
  241. package/lib/signature/throttle.js +1 -11
  242. package/lib/skeleton/index.js +5 -21
  243. package/lib/slider/index.js +19 -63
  244. package/lib/step/index.js +5 -18
  245. package/lib/stepper/index.js +10 -46
  246. package/lib/steps/index.js +2 -7
  247. package/lib/sticky/index.js +8 -59
  248. package/lib/swipe/index.js +19 -70
  249. package/lib/swipe-cell/index.js +7 -29
  250. package/lib/swipe-item/index.js +9 -24
  251. package/lib/switch/index.js +7 -14
  252. package/lib/switch/shared.js +1 -1
  253. package/lib/switch-cell/index.js +6 -16
  254. package/lib/tab/index.js +4 -21
  255. package/lib/tabbar/index.js +4 -19
  256. package/lib/tabbar-item/index.js +5 -21
  257. package/lib/table/index.js +10 -38
  258. package/lib/tabs/Content.js +5 -15
  259. package/lib/tabs/Title.js +11 -23
  260. package/lib/tabs/index.js +15 -65
  261. package/lib/tabs/utils.js +0 -13
  262. package/lib/tag/index.js +12 -23
  263. package/lib/timeline/index.js +2 -32
  264. package/lib/toast/Toast.js +10 -30
  265. package/lib/toast/index.js +6 -38
  266. package/lib/toast/lock-click.js +0 -3
  267. package/lib/uploader/index.js +10 -72
  268. package/lib/uploader/utils.js +0 -17
  269. package/lib/utils/constant.js +2 -1
  270. package/lib/utils/create/bem.js +1 -6
  271. package/lib/utils/create/component.js +5 -14
  272. package/lib/utils/create/i18n.js +0 -8
  273. package/lib/utils/create/index.js +0 -4
  274. package/lib/utils/deep-assign.js +0 -6
  275. package/lib/utils/deep-clone.js +0 -5
  276. package/lib/utils/device.js +0 -2
  277. package/lib/utils/dom/event.js +2 -10
  278. package/lib/utils/dom/node.js +0 -2
  279. package/lib/utils/dom/raf.js +7 -11
  280. package/lib/utils/dom/reset-scroll.js +2 -4
  281. package/lib/utils/dom/scroll.js +8 -28
  282. package/lib/utils/dom/style.js +3 -3
  283. package/lib/utils/easings.js +2 -5
  284. package/lib/utils/format/date-util.js +54 -168
  285. package/lib/utils/format/number.js +2 -13
  286. package/lib/utils/format/string.js +0 -5
  287. package/lib/utils/format/unit.js +2 -16
  288. package/lib/utils/functional.js +6 -14
  289. package/lib/utils/getScroll.js +0 -7
  290. package/lib/utils/index.js +3 -19
  291. package/lib/utils/interceptor.js +2 -6
  292. package/lib/utils/media/image-util.js +7 -25
  293. package/lib/utils/raf.js +4 -13
  294. package/lib/utils/router.js +7 -9
  295. package/lib/utils/scrollTo.js +9 -21
  296. package/lib/utils/validate/date.js +0 -2
  297. package/lib/utils/validate/email.js +0 -1
  298. package/lib/utils/validate/mobile.js +0 -1
  299. package/lib/utils/validate/number.js +2 -4
  300. package/lib/utils/validate/system.js +0 -3
  301. package/lib/utils/vnodes.js +2 -9
  302. package/lib/zart.js +57 -18
  303. package/lib/zart.min.js +1 -1
  304. package/package.json +17 -18
@@ -1,18 +1,18 @@
1
1
  // Utils
2
2
  import { bem } from './shared';
3
3
  import { range } from '../utils/format/number';
4
- import { preventDefault } from '../utils/dom/event'; // Mixins
4
+ import { preventDefault } from '../utils/dom/event';
5
5
 
6
- import { TouchMixin } from '../mixins/touch'; // Component
6
+ // Mixins
7
+ import { TouchMixin } from '../mixins/touch';
7
8
 
9
+ // Component
8
10
  import Image from '../image';
9
11
  import Loading from '../loading';
10
12
  import SwipeItem from '../swipe-item';
11
-
12
13
  function getDistance(touches) {
13
14
  return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
14
15
  }
15
-
16
16
  export default {
17
17
  mixins: [TouchMixin],
18
18
  props: {
@@ -39,7 +39,7 @@ export default {
39
39
  computed: {
40
40
  vertical: function vertical() {
41
41
  var rootWidth = this.rootWidth,
42
- rootHeight = this.rootHeight;
42
+ rootHeight = this.rootHeight;
43
43
  var rootRatio = rootHeight / rootWidth;
44
44
  return this.imageRatio > rootRatio;
45
45
  },
@@ -48,13 +48,11 @@ export default {
48
48
  var style = {
49
49
  transitionDuration: this.zooming || this.moving ? '0s' : '.3s'
50
50
  };
51
-
52
51
  if (scale !== 1) {
53
52
  var offsetX = this.moveX / scale;
54
53
  var offsetY = this.moveY / scale;
55
54
  style.transform = "scale(" + scale + ", " + scale + ") translate(" + offsetX + "px, " + offsetY + "px)";
56
55
  }
57
-
58
56
  return style;
59
57
  },
60
58
  maxMoveX: function maxMoveX() {
@@ -62,7 +60,6 @@ export default {
62
60
  var displayWidth = this.vertical ? this.rootHeight / this.imageRatio : this.rootWidth;
63
61
  return Math.max(0, (this.scale * displayWidth - this.rootWidth) / 2);
64
62
  }
65
-
66
63
  return 0;
67
64
  },
68
65
  maxMoveY: function maxMoveY() {
@@ -70,7 +67,6 @@ export default {
70
67
  var displayHeight = this.vertical ? this.rootHeight : this.rootWidth * this.imageRatio;
71
68
  return Math.max(0, (this.scale * displayHeight - this.rootHeight) / 2);
72
69
  }
73
-
74
70
  return 0;
75
71
  }
76
72
  },
@@ -93,7 +89,6 @@ export default {
93
89
  },
94
90
  setScale: function setScale(scale) {
95
91
  scale = range(scale, +this.minZoom, +this.maxZoom);
96
-
97
92
  if (scale !== this.scale) {
98
93
  this.scale = scale;
99
94
  this.$emit('scale', {
@@ -111,14 +106,13 @@ export default {
111
106
  onTouchStart: function onTouchStart(event) {
112
107
  var touches = event.touches;
113
108
  var _this$offsetX = this.offsetX,
114
- offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
109
+ offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
115
110
  this.touchStart(event);
116
111
  this.touchStartTime = new Date();
117
112
  this.startMoveX = this.moveX;
118
113
  this.startMoveY = this.moveY;
119
114
  this.moving = touches.length === 1 && this.scale !== 1;
120
115
  this.zooming = touches.length === 2 && !offsetX;
121
-
122
116
  if (this.zooming) {
123
117
  this.startScale = this.scale;
124
118
  this.startDistance = getDistance(event.touches);
@@ -127,18 +121,15 @@ export default {
127
121
  onTouchMove: function onTouchMove(event) {
128
122
  var touches = event.touches;
129
123
  this.touchMove(event);
130
-
131
124
  if (this.moving || this.zooming) {
132
125
  preventDefault(event, true);
133
126
  }
134
-
135
127
  if (this.moving) {
136
128
  var moveX = this.deltaX + this.startMoveX;
137
129
  var moveY = this.deltaY + this.startMoveY;
138
130
  this.moveX = range(moveX, -this.maxMoveX, this.maxMoveX);
139
131
  this.moveY = range(moveY, -this.maxMoveY, this.maxMoveY);
140
132
  }
141
-
142
133
  if (this.zooming && touches.length === 2) {
143
134
  var distance = getDistance(touches);
144
135
  var scale = this.startScale * distance / this.startDistance;
@@ -147,49 +138,43 @@ export default {
147
138
  },
148
139
  onTouchEnd: function onTouchEnd(event) {
149
140
  var stopPropagation = false;
150
- /* istanbul ignore else */
151
141
 
142
+ /* istanbul ignore else */
152
143
  if (this.moving || this.zooming) {
153
144
  stopPropagation = true;
154
-
155
145
  if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {
156
146
  stopPropagation = false;
157
147
  }
158
-
159
148
  if (!event.touches.length) {
160
149
  if (this.zooming) {
161
150
  this.moveX = range(this.moveX, -this.maxMoveX, this.maxMoveX);
162
151
  this.moveY = range(this.moveY, -this.maxMoveY, this.maxMoveY);
163
152
  this.zooming = false;
164
153
  }
165
-
166
154
  this.moving = false;
167
155
  this.startMoveX = 0;
168
156
  this.startMoveY = 0;
169
157
  this.startScale = 1;
170
-
171
158
  if (this.scale < 1) {
172
159
  this.resetScale();
173
160
  }
174
161
  }
175
- } // eliminate tap delay on safari
176
-
162
+ }
177
163
 
164
+ // eliminate tap delay on safari
178
165
  preventDefault(event, stopPropagation);
179
166
  this.checkTap();
180
167
  this.resetTouchStatus();
181
168
  },
182
169
  checkTap: function checkTap() {
183
170
  var _this = this;
184
-
185
171
  var _this$offsetX2 = this.offsetX,
186
- offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
187
- _this$offsetY = this.offsetY,
188
- offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
172
+ offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
173
+ _this$offsetY = this.offsetY,
174
+ offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
189
175
  var deltaTime = new Date() - this.touchStartTime;
190
176
  var TAP_TIME = 250;
191
177
  var TAP_OFFSET = 10;
192
-
193
178
  if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {
194
179
  if (this.doubleTapTimer) {
195
180
  clearTimeout(this.doubleTapTimer);
@@ -198,7 +183,6 @@ export default {
198
183
  } else {
199
184
  this.doubleTapTimer = setTimeout(function () {
200
185
  _this.$emit('close');
201
-
202
186
  _this.doubleTapTimer = null;
203
187
  }, TAP_TIME);
204
188
  }
@@ -206,8 +190,8 @@ export default {
206
190
  },
207
191
  onLoad: function onLoad(event) {
208
192
  var _event$target = event.target,
209
- naturalWidth = _event$target.naturalWidth,
210
- naturalHeight = _event$target.naturalHeight;
193
+ naturalWidth = _event$target.naturalWidth,
194
+ naturalHeight = _event$target.naturalHeight;
211
195
  this.imageRatio = naturalHeight / naturalWidth;
212
196
  }
213
197
  },
@@ -24,7 +24,6 @@ var defaultConfig = {
24
24
  closeOnPopstate: true,
25
25
  closeIconPosition: 'top-right'
26
26
  };
27
-
28
27
  var initInstance = function initInstance() {
29
28
  instance = new (Vue.extend(VueImagePreview))({
30
29
  el: document.createElement('div')
@@ -41,47 +40,36 @@ var initInstance = function initInstance() {
41
40
  }
42
41
  });
43
42
  };
44
-
45
43
  var ImagePreview = function ImagePreview(images, startPosition) {
46
44
  if (startPosition === void 0) {
47
45
  startPosition = 0;
48
46
  }
49
-
50
47
  /* istanbul ignore if */
51
48
  if (isServer) {
52
49
  return;
53
50
  }
54
-
55
51
  if (!instance) {
56
52
  initInstance();
57
53
  }
58
-
59
54
  var options = Array.isArray(images) ? {
60
55
  images: images,
61
56
  startPosition: startPosition
62
57
  } : images;
63
-
64
58
  _extends(instance, defaultConfig, options);
65
-
66
59
  instance.$once('input', function (show) {
67
60
  instance.value = show;
68
61
  });
69
62
  instance.$once('closed', function () {
70
63
  instance.images = [];
71
64
  });
72
-
73
65
  if (options.onClose) {
74
66
  instance.$off('close');
75
67
  instance.$once('close', options.onClose);
76
68
  }
77
-
78
69
  return instance;
79
70
  };
80
-
81
71
  ImagePreview.Component = VueImagePreview;
82
-
83
72
  ImagePreview.install = function () {
84
73
  Vue.use(VueImagePreview);
85
74
  };
86
-
87
75
  export default ImagePreview;
@@ -1,7 +1,5 @@
1
1
  import { createNamespace } from '../utils';
2
-
3
2
  var _createNamespace = createNamespace('image-preview'),
4
- createComponent = _createNamespace[0],
5
- bem = _createNamespace[1];
6
-
3
+ createComponent = _createNamespace[0],
4
+ bem = _createNamespace[1];
7
5
  export { createComponent, bem };
@@ -2,11 +2,9 @@ import { createNamespace } from '../utils';
2
2
  import { ChildrenMixin } from '../mixins/relation';
3
3
  import { BORDER_BOTTOM, BORDER_TOP_BOTTOM, BORDER_UNSET_TOP_BOTTOM } from '../utils/constant';
4
4
  import { getScrollTop, getRootScrollTop } from '../utils/dom/scroll';
5
-
6
5
  var _createNamespace = createNamespace('index-anchor'),
7
- createComponent = _createNamespace[0],
8
- bem = _createNamespace[1];
9
-
6
+ createComponent = _createNamespace[0],
7
+ bem = _createNamespace[1];
10
8
  export default createComponent({
11
9
  mixins: [ChildrenMixin('ztIndexBar', {
12
10
  indexKey: 'childrenIndex'
@@ -54,13 +52,11 @@ export default createComponent({
54
52
  var el = this.$el;
55
53
  var elRect = el.getBoundingClientRect();
56
54
  this.rect.height = elRect.height;
57
-
58
55
  if (scroller === window || scroller === document.body) {
59
56
  this.rect.top = elRect.top + getRootScrollTop();
60
57
  } else {
61
58
  this.rect.top = elRect.top + getScrollTop(scroller) - scrollerRect.top;
62
59
  }
63
-
64
60
  return this.rect;
65
61
  }
66
62
  },
@@ -1,7 +1,6 @@
1
1
  export default {
2
2
  render: function render() {
3
3
  var _attrs;
4
-
5
4
  var h = arguments[0];
6
5
  return h("svg", {
7
6
  "attrs": (_attrs = {
@@ -3,33 +3,28 @@ import { createNamespace, isDef } from '../utils';
3
3
  import { isHidden } from '../utils/dom/style';
4
4
  import { preventDefault } from '../utils/dom/event';
5
5
  import { getScroller, getScrollTop, getRootScrollTop, setRootScrollTop } from '../utils/dom/scroll';
6
- import IndexIndicate from './IndexIndicate'; // Mixins
6
+ import IndexIndicate from './IndexIndicate';
7
7
 
8
+ // Mixins
8
9
  import { TouchMixin } from '../mixins/touch';
9
10
  import { ParentMixin } from '../mixins/relation';
10
11
  import { BindEventMixin } from '../mixins/bind-event';
11
-
12
12
  function genAlphabet() {
13
13
  var indexList = [];
14
14
  var charCodeOfA = 'A'.charCodeAt(0);
15
-
16
15
  for (var i = 0; i < 26; i++) {
17
16
  indexList.push(String.fromCharCode(charCodeOfA + i));
18
17
  }
19
-
20
18
  return indexList;
21
19
  }
22
-
23
20
  var _createNamespace = createNamespace('index-bar'),
24
- createComponent = _createNamespace[0],
25
- bem = _createNamespace[1];
26
-
21
+ createComponent = _createNamespace[0],
22
+ bem = _createNamespace[1];
27
23
  export default createComponent({
28
24
  mixins: [TouchMixin, ParentMixin('ztIndexBar'), BindEventMixin(function (bind) {
29
25
  if (!this.scroller) {
30
26
  this.scroller = getScroller(this.$el);
31
27
  }
32
-
33
28
  bind(this.scroller, 'scroll', this.onScroll);
34
29
  })],
35
30
  props: {
@@ -64,7 +59,6 @@ export default createComponent({
64
59
  },
65
60
  highlightStyle: function highlightStyle() {
66
61
  var highlightColor = this.highlightColor;
67
-
68
62
  if (highlightColor) {
69
63
  return {
70
64
  color: highlightColor
@@ -85,11 +79,9 @@ export default createComponent({
85
79
  methods: {
86
80
  onScroll: function onScroll() {
87
81
  var _this = this;
88
-
89
82
  if (isHidden(this.$el)) {
90
83
  return;
91
84
  }
92
-
93
85
  var scrollTop = getScrollTop(this.scroller);
94
86
  var scrollerRect = this.getScrollerRect();
95
87
  var rects = this.children.map(function (item) {
@@ -97,11 +89,9 @@ export default createComponent({
97
89
  });
98
90
  var active = this.getActiveAnchorIndex(scrollTop, rects);
99
91
  this.activeAnchorIndex = this.indexList[active];
100
-
101
92
  if (this.touchAnchorIndex && this.touchAnchorIndex !== this.activeAnchorIndex) {
102
93
  this.touchAnchorIndex = this.activeAnchorIndex;
103
94
  }
104
-
105
95
  if (this.sticky) {
106
96
  this.children.forEach(function (item, index) {
107
97
  if (index === active || index === active - 1) {
@@ -112,7 +102,6 @@ export default createComponent({
112
102
  item.left = null;
113
103
  item.width = null;
114
104
  }
115
-
116
105
  if (index === active) {
117
106
  item.active = true;
118
107
  item.top = Math.max(_this.stickyOffsetTop, rects[index].top - scrollTop) + scrollerRect.top;
@@ -130,7 +119,6 @@ export default createComponent({
130
119
  if (this.scroller.getBoundingClientRect) {
131
120
  return this.scroller.getBoundingClientRect();
132
121
  }
133
-
134
122
  return {
135
123
  top: 0,
136
124
  left: 0
@@ -140,12 +128,10 @@ export default createComponent({
140
128
  for (var i = this.children.length - 1; i >= 0; i--) {
141
129
  var prevHeight = i > 0 ? rects[i - 1].height : 0;
142
130
  var reachTop = this.sticky ? prevHeight + this.stickyOffsetTop : 0;
143
-
144
131
  if (scrollTop + reachTop >= rects[i].top) {
145
132
  return i;
146
133
  }
147
134
  }
148
-
149
135
  return -1;
150
136
  },
151
137
  onClick: function onClick(event) {
@@ -153,18 +139,16 @@ export default createComponent({
153
139
  },
154
140
  onTouchMove: function onTouchMove(event) {
155
141
  this.touchMove(event);
156
-
157
142
  if (this.direction === 'vertical') {
158
143
  preventDefault(event);
159
144
  var _event$touches$ = event.touches[0],
160
- clientX = _event$touches$.clientX,
161
- clientY = _event$touches$.clientY;
145
+ clientX = _event$touches$.clientX,
146
+ clientY = _event$touches$.clientY;
162
147
  var target = document.elementFromPoint(clientX, clientY);
163
-
164
148
  if (target) {
165
149
  var index = target.dataset.index;
166
- /* istanbul ignore else */
167
150
 
151
+ /* istanbul ignore else */
168
152
  if (this.touchActiveIndex !== index) {
169
153
  this.touchActiveIndex = index;
170
154
  this.scrollToElement(target);
@@ -176,14 +160,11 @@ export default createComponent({
176
160
  var match = this.children.filter(function (item) {
177
161
  return String(item.index) === index;
178
162
  });
179
-
180
163
  if (match[0]) {
181
164
  match[0].scrollIntoView();
182
-
183
165
  if (this.sticky && this.stickyOffsetTop) {
184
166
  setRootScrollTop(getRootScrollTop() - this.stickyOffsetTop);
185
167
  }
186
-
187
168
  this.$emit('select', match[0].index);
188
169
  }
189
170
  },
@@ -198,7 +179,6 @@ export default createComponent({
198
179
  },
199
180
  onTouchEnd: function onTouchEnd() {
200
181
  var _this2 = this;
201
-
202
182
  setTimeout(function () {
203
183
  _this2.touchAnchorIndex = null;
204
184
  }, 300);
@@ -213,7 +193,6 @@ export default createComponent({
213
193
  },
214
194
  render: function render() {
215
195
  var _this3 = this;
216
-
217
196
  var h = arguments[0];
218
197
  var Indexes = this.indexList.map(function (index) {
219
198
  var active = index === _this3.activeAnchorIndex;
package/es/index.js CHANGED
@@ -74,8 +74,7 @@ import Tag from './tag';
74
74
  import Timeline from './timeline';
75
75
  import Toast from './toast';
76
76
  import Uploader from './uploader';
77
- var version = '2.0.79';
78
-
77
+ var version = '2.0.80-beta.1';
79
78
  function install(Vue) {
80
79
  var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader];
81
80
  components.forEach(function (item) {
@@ -86,11 +85,9 @@ function install(Vue) {
86
85
  }
87
86
  });
88
87
  }
89
-
90
88
  if (typeof window !== 'undefined' && window.Vue) {
91
89
  install(window.Vue);
92
90
  }
93
-
94
91
  export { install, version, ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader };
95
92
  export default {
96
93
  install: install,
package/es/info/index.js CHANGED
@@ -1,28 +1,26 @@
1
1
  import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
2
2
  // Utils
3
3
  import { createNamespace, isDef } from '../utils';
4
- import { inherit } from '../utils/functional'; // Types
4
+ import { inherit } from '../utils/functional';
5
5
 
6
- var _createNamespace = createNamespace('info'),
7
- createComponent = _createNamespace[0],
8
- bem = _createNamespace[1];
6
+ // Types
9
7
 
8
+ var _createNamespace = createNamespace('info'),
9
+ createComponent = _createNamespace[0],
10
+ bem = _createNamespace[1];
10
11
  function Info(h, props, slots, ctx) {
11
12
  var dot = props.dot,
12
- info = props.info;
13
+ info = props.info;
13
14
  var showInfo = isDef(info) && info !== '';
14
-
15
15
  if (!dot && !showInfo) {
16
16
  return;
17
17
  }
18
-
19
18
  return h("div", _mergeJSXProps([{
20
19
  "class": bem({
21
20
  dot: dot
22
21
  })
23
22
  }, inherit(ctx, true)]), [dot ? '' : props.info]);
24
23
  }
25
-
26
24
  Info.props = {
27
25
  dot: Boolean,
28
26
  info: [Number, String]
package/es/list/index.js CHANGED
@@ -1,24 +1,23 @@
1
1
  // Utils
2
2
  import { createNamespace } from '../utils';
3
3
  import { isHidden } from '../utils/dom/style';
4
- import { getScroller } from '../utils/dom/scroll'; // Mixins
4
+ import { getScroller } from '../utils/dom/scroll';
5
5
 
6
- import { BindEventMixin } from '../mixins/bind-event'; // Components
6
+ // Mixins
7
+ import { BindEventMixin } from '../mixins/bind-event';
7
8
 
9
+ // Components
8
10
  import Loading from '../loading';
9
11
  import Divider from '../divider';
10
-
11
12
  var _createNamespace = createNamespace('list'),
12
- createComponent = _createNamespace[0],
13
- bem = _createNamespace[1],
14
- t = _createNamespace[2];
15
-
13
+ createComponent = _createNamespace[0],
14
+ bem = _createNamespace[1],
15
+ t = _createNamespace[2];
16
16
  export default createComponent({
17
17
  mixins: [BindEventMixin(function (bind) {
18
18
  if (!this.scroller) {
19
19
  this.scroller = getScroller(this.$el);
20
20
  }
21
-
22
21
  bind(this.scroller, 'scroll', this.check);
23
22
  })],
24
23
  model: {
@@ -66,18 +65,15 @@ export default createComponent({
66
65
  // @exposed-api
67
66
  check: function check() {
68
67
  var _this = this;
69
-
70
68
  this.$nextTick(function () {
71
69
  if (_this.innerLoading || _this.finished || _this.error) {
72
70
  return;
73
71
  }
74
-
75
72
  var el = _this.$el,
76
- scroller = _this.scroller,
77
- offset = _this.offset,
78
- direction = _this.direction;
73
+ scroller = _this.scroller,
74
+ offset = _this.offset,
75
+ direction = _this.direction;
79
76
  var scrollerRect;
80
-
81
77
  if (scroller.getBoundingClientRect) {
82
78
  scrollerRect = scroller.getBoundingClientRect();
83
79
  } else {
@@ -86,29 +82,22 @@ export default createComponent({
86
82
  bottom: scroller.innerHeight
87
83
  };
88
84
  }
89
-
90
85
  var scrollerHeight = scrollerRect.bottom - scrollerRect.top;
91
- /* istanbul ignore next */
92
86
 
87
+ /* istanbul ignore next */
93
88
  if (!scrollerHeight || isHidden(el)) {
94
89
  return false;
95
90
  }
96
-
97
91
  var isReachEdge = false;
98
-
99
92
  var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();
100
-
101
93
  if (direction === 'up') {
102
94
  isReachEdge = scrollerRect.top - placeholderRect.top <= offset;
103
95
  } else {
104
96
  isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;
105
97
  }
106
-
107
98
  if (isReachEdge) {
108
99
  _this.innerLoading = true;
109
-
110
100
  _this.$emit('input', true);
111
-
112
101
  _this.$emit('load');
113
102
  }
114
103
  });
@@ -119,7 +108,6 @@ export default createComponent({
119
108
  },
120
109
  genLoading: function genLoading() {
121
110
  var h = this.$createElement;
122
-
123
111
  if (this.innerLoading && !this.finished) {
124
112
  return h("div", {
125
113
  "key": "loading",
@@ -133,10 +121,8 @@ export default createComponent({
133
121
  },
134
122
  genFinishedText: function genFinishedText() {
135
123
  var h = this.$createElement;
136
-
137
124
  if (this.finished) {
138
125
  var text = this.slots('finished') || this.finishedText;
139
-
140
126
  if (text) {
141
127
  return h(Divider, {
142
128
  "style": {
@@ -149,10 +135,8 @@ export default createComponent({
149
135
  },
150
136
  genErrorText: function genErrorText() {
151
137
  var h = this.$createElement;
152
-
153
138
  if (this.error) {
154
139
  var text = this.slots('error') || this.errorText;
155
-
156
140
  if (text) {
157
141
  return h("div", {
158
142
  "on": {
@@ -1,22 +1,20 @@
1
1
  import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
2
2
  // Utils
3
3
  import { createNamespace, addUnit } from '../utils';
4
- import { inherit } from '../utils/functional'; // Types
4
+ import { inherit } from '../utils/functional';
5
5
 
6
- var _createNamespace = createNamespace('loading'),
7
- createComponent = _createNamespace[0],
8
- bem = _createNamespace[1];
6
+ // Types
9
7
 
8
+ var _createNamespace = createNamespace('loading'),
9
+ createComponent = _createNamespace[0],
10
+ bem = _createNamespace[1];
10
11
  var svgElementId = 0;
11
-
12
12
  function LoadingIcon(h, props) {
13
13
  if (props.type === 'spinner') {
14
14
  var Spin = [];
15
-
16
15
  for (var i = 0; i < 12; i++) {
17
16
  Spin.push(h("i"));
18
17
  }
19
-
20
18
  return Spin;
21
19
  } else if (props.type === 'circular') {
22
20
  return h("svg", {
@@ -99,11 +97,9 @@ function LoadingIcon(h, props) {
99
97
  })])]);
100
98
  }
101
99
  }
102
-
103
100
  function LoadingText(h, props, slots) {
104
101
  if (slots.default) {
105
102
  var _props$textColor;
106
-
107
103
  var style = {
108
104
  fontSize: addUnit(props.textSize),
109
105
  color: (_props$textColor = props.textColor) != null ? _props$textColor : props.color
@@ -114,21 +110,18 @@ function LoadingText(h, props, slots) {
114
110
  }, [slots.default()]);
115
111
  }
116
112
  }
117
-
118
113
  function Loading(h, props, slots, ctx) {
119
114
  var color = props.color,
120
- size = props.size,
121
- type = props.type;
115
+ size = props.size,
116
+ type = props.type;
122
117
  var style = {
123
118
  color: color
124
119
  };
125
-
126
120
  if (size) {
127
121
  var iconSize = addUnit(size);
128
122
  style.width = iconSize;
129
123
  style.height = iconSize;
130
124
  }
131
-
132
125
  return h("div", _mergeJSXProps([{
133
126
  "class": bem([type, {
134
127
  vertical: props.vertical,
@@ -139,7 +132,6 @@ function Loading(h, props, slots, ctx) {
139
132
  "style": style
140
133
  }, [LoadingIcon(h, props)]), LoadingText(h, props, slots)]);
141
134
  }
142
-
143
135
  Loading.props = {
144
136
  color: String,
145
137
  size: [Number, String],
@@ -13,7 +13,6 @@ export default {
13
13
  },
14
14
  use: function use(lang, messages) {
15
15
  var _this$add;
16
-
17
16
  proto.$zartLang = lang;
18
17
  this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
19
18
  },
@@ -21,7 +20,6 @@ export default {
21
20
  if (messages === void 0) {
22
21
  messages = {};
23
22
  }
24
-
25
23
  deepAssign(proto.$zartMessages, messages);
26
24
  }
27
25
  };