ai.touchui-vue 1.31.3 → 1.32.0

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 (753) hide show
  1. package/README.md +21 -21
  2. package/lib/ai.touchui-vue.common.js +1416 -1401
  3. package/lib/cascader.js +15 -3
  4. package/lib/chat.js +5 -5
  5. package/lib/collapse.js +1 -2
  6. package/lib/color.js +5 -5
  7. package/lib/date-picker.js +1 -2
  8. package/lib/date-range.js +16 -15
  9. package/lib/export.js +3 -3
  10. package/lib/index.js +1 -1
  11. package/lib/locale/format.js +10 -10
  12. package/lib/menu-icon.js +295 -295
  13. package/lib/mixins/migrating.js +20 -20
  14. package/lib/mixins/transition.js +14 -14
  15. package/lib/org.js +1 -2
  16. package/lib/page.js +1 -2
  17. package/lib/range.js +3 -3
  18. package/lib/scroll.js +8 -4
  19. package/lib/static/{net-mix.dc6e414.svg → net-mix.293a4b6.svg} +7 -7
  20. package/lib/tab.js +5 -5
  21. package/lib/table.js +22 -22
  22. package/lib/theme/css/theme/B-Design.css +1 -1
  23. package/lib/theme/css/theme/aiplan.css +1 -1
  24. package/lib/theme/css/theme/aiplangd.css +1 -1
  25. package/lib/theme/css/theme/chbn.css +1 -1
  26. package/lib/theme/css/theme/default.css +1 -1
  27. package/lib/theme/css/theme/dt.css +1 -1
  28. package/lib/theme/css/theme/ecloud.css +1 -1
  29. package/lib/theme/css/theme/hongkong.css +1 -1
  30. package/lib/theme/css/theme/narrow.css +1 -1
  31. package/lib/theme/css/theme/sdpf.css +1 -1
  32. package/lib/theme/css/theme/upc.css +1 -1
  33. package/lib/theme/css/theme/website.css +1 -1
  34. package/lib/theme/css/theme/zj.css +1 -1
  35. package/lib/utils/clickoutside.js +11 -11
  36. package/lib/utils/dom.js +13 -13
  37. package/lib/utils/filetransfer.js +4 -4
  38. package/lib/utils/jsencrypt/JSEncrypt.js +77 -77
  39. package/lib/utils/jsencrypt/JSEncryptRSAKey.js +115 -115
  40. package/lib/utils/jsencrypt/jselib/asn1js/asn1.js +4 -4
  41. package/lib/utils/jsencrypt/jselib/jsrsasign/asn1-1.0.js +734 -734
  42. package/lib/utils/jsencrypt/jselib/jsrsasign/yahoo.js +22 -22
  43. package/lib/utils/jsencrypt.js +260 -260
  44. package/lib/utils/md5.js +3 -3
  45. package/lib/utils/mime.js +2 -2
  46. package/lib/utils/ratio.js +53 -54
  47. package/lib/utils/sign.js +12 -12
  48. package/lib/utils/util.js +3 -3
  49. package/lib/utils/validate.js +11 -11
  50. package/package.json +159 -159
  51. package/packages/.DS_Store +0 -0
  52. package/packages/affix/index.js +8 -8
  53. package/packages/affix/src/affix.vue +139 -139
  54. package/packages/align/index.js +8 -8
  55. package/packages/align/src/directive.js +29 -29
  56. package/packages/animation/index.js +8 -8
  57. package/packages/animation/src/animation.vue +68 -68
  58. package/packages/article/.DS_Store +0 -0
  59. package/packages/article/index.js +8 -8
  60. package/packages/article/src/article.vue +23 -23
  61. package/packages/box/index.js +8 -8
  62. package/packages/box/src/box.vue +170 -170
  63. package/packages/button/index.js +8 -8
  64. package/packages/button/src/button.vue +162 -162
  65. package/packages/calendar/index.js +8 -8
  66. package/packages/calendar/src/calendar.vue +1142 -1142
  67. package/packages/card/index.js +10 -10
  68. package/packages/card/src/card-item.vue +92 -92
  69. package/packages/card/src/card.vue +175 -175
  70. package/packages/card-item/index.js +8 -8
  71. package/packages/cascader/index.js +8 -8
  72. package/packages/cascader/src/cascader.vue +818 -814
  73. package/packages/center-scroll/index.js +8 -8
  74. package/packages/center-scroll/src/center-scroll.vue +147 -147
  75. package/packages/chat/.DS_Store +0 -0
  76. package/packages/chat/index.js +12 -12
  77. package/packages/chat/src/.DS_Store +0 -0
  78. package/packages/chat/src/chat.vue +116 -116
  79. package/packages/checkbox/index.js +8 -8
  80. package/packages/checkbox/src/checkbox.vue +262 -262
  81. package/packages/checkboxes/index.js +8 -8
  82. package/packages/checkboxes/src/checkboxes.vue +97 -97
  83. package/packages/collapse/index.js +10 -10
  84. package/packages/collapse/src/collapse-item.vue +188 -188
  85. package/packages/collapse/src/collapse.vue +100 -100
  86. package/packages/color/index.js +8 -8
  87. package/packages/color/src/directive.js +42 -42
  88. package/packages/countdown/index.js +8 -8
  89. package/packages/countdown/src/countdown.vue +128 -128
  90. package/packages/date-picker/.DS_Store +0 -0
  91. package/packages/date-picker/index.js +8 -8
  92. package/packages/date-picker/src/date-picker.vue +438 -438
  93. package/packages/date-picker/src/picker.vue +342 -342
  94. package/packages/date-range/index.js +8 -8
  95. package/packages/date-range/src/date-range.vue +384 -384
  96. package/packages/dialog/index.js +8 -8
  97. package/packages/dialog/src/dialog.vue +313 -313
  98. package/packages/dis/.DS_Store +0 -0
  99. package/packages/dis/index.js +8 -8
  100. package/packages/dis/src/directive.js +42 -42
  101. package/packages/ellipsis/index.js +8 -8
  102. package/packages/ellipsis/src/ellipsis.vue +306 -306
  103. package/packages/emote/.DS_Store +0 -0
  104. package/packages/emote/index.js +8 -8
  105. package/packages/emote/src/emote.vue +38 -38
  106. package/packages/export/index.js +8 -8
  107. package/packages/export/src/ajax.js +73 -73
  108. package/packages/export/src/export.vue +289 -289
  109. package/packages/filter/.DS_Store +0 -0
  110. package/packages/filter/index.js +8 -8
  111. package/packages/filter/src/.DS_Store +0 -0
  112. package/packages/filter/src/filter.vue +245 -245
  113. package/packages/fix/index.js +8 -8
  114. package/packages/fix/src/fix.vue +221 -221
  115. package/packages/float/.DS_Store +0 -0
  116. package/packages/float/index.js +16 -16
  117. package/packages/float/src/directive.js +20 -20
  118. package/packages/float/src/main.vue +642 -642
  119. package/packages/float/src/trigger.vue +31 -31
  120. package/packages/flow/.DS_Store +0 -0
  121. package/packages/flow/index.js +8 -8
  122. package/packages/flow/src/flow.vue +234 -234
  123. package/packages/flow/src/flowItem.vue +61 -61
  124. package/packages/flow/src/flowLine.vue +168 -168
  125. package/packages/form/index.js +10 -10
  126. package/packages/form/src/form-item.vue +96 -96
  127. package/packages/form/src/form.vue +184 -184
  128. package/packages/grid/index.js +10 -10
  129. package/packages/grid/src/grid-item.vue +65 -65
  130. package/packages/grid/src/grid.vue +190 -190
  131. package/packages/grid-item/index.js +8 -8
  132. package/packages/guider/.DS_Store +0 -0
  133. package/packages/guider/index.js +8 -8
  134. package/packages/guider/src/guider.vue +168 -168
  135. package/packages/header/index.js +8 -8
  136. package/packages/header/src/header.vue +110 -110
  137. package/packages/hide/index.js +8 -8
  138. package/packages/hide/src/directive.js +57 -57
  139. package/packages/icon/index.js +8 -8
  140. package/packages/icon/src/icon.vue +79 -79
  141. package/packages/import/index.js +8 -8
  142. package/packages/import/src/import.vue +279 -279
  143. package/packages/input/index.js +8 -8
  144. package/packages/input/src/calcTextareaHeight.js +104 -104
  145. package/packages/input/src/input.vue +653 -653
  146. package/packages/ip/.DS_Store +0 -0
  147. package/packages/ip/index.js +8 -8
  148. package/packages/ip/src/ip.vue +143 -143
  149. package/packages/line/index.js +8 -8
  150. package/packages/line/src/line.vue +29 -29
  151. package/packages/loading/index.js +8 -8
  152. package/packages/loading/src/loading.js +58 -58
  153. package/packages/longtap/index.js +8 -8
  154. package/packages/longtap/src/longtap.js +95 -95
  155. package/packages/menu-icon/index.js +8 -8
  156. package/packages/menu-icon/src/menu-icon.vue +206 -206
  157. package/packages/message/index.js +8 -8
  158. package/packages/message/src/message.vue +9 -9
  159. package/packages/msg/index.js +8 -8
  160. package/packages/msg/src/msg.vue +227 -227
  161. package/packages/org/.DS_Store +0 -0
  162. package/packages/org/index.js +8 -8
  163. package/packages/org/src/org.vue +113 -113
  164. package/packages/org/src/orgItem.vue +63 -63
  165. package/packages/padding/index.js +8 -8
  166. package/packages/padding/src/padding.vue +105 -105
  167. package/packages/page/.DS_Store +0 -0
  168. package/packages/page/index.js +8 -8
  169. package/packages/page/src/.DS_Store +0 -0
  170. package/packages/page/src/page.vue +297 -297
  171. package/packages/param/index.js +8 -8
  172. package/packages/param/src/param.vue +226 -226
  173. package/packages/pic/.DS_Store +0 -0
  174. package/packages/pic/index.js +8 -8
  175. package/packages/pic/src/pic-viewer.vue +331 -331
  176. package/packages/pic/src/pic.vue +144 -144
  177. package/packages/popup/index.js +12 -12
  178. package/packages/popup/src/popup-group.vue +47 -47
  179. package/packages/popup/src/popup-item.vue +163 -163
  180. package/packages/popup/src/popup.vue +350 -350
  181. package/packages/progress/index.js +8 -8
  182. package/packages/progress/src/progress.vue +306 -306
  183. package/packages/range/index.js +8 -8
  184. package/packages/range/src/range.vue +612 -612
  185. package/packages/rate/.DS_Store +0 -0
  186. package/packages/rate/index.js +8 -8
  187. package/packages/rate/src/rate.vue +129 -129
  188. package/packages/reverser/.DS_Store +0 -0
  189. package/packages/reverser/index.js +8 -8
  190. package/packages/reverser/src/.DS_Store +0 -0
  191. package/packages/reverser/src/reverser.vue +49 -49
  192. package/packages/scroll/index.js +12 -12
  193. package/packages/scroll/src/scroll-point.vue +24 -24
  194. package/packages/scroll/src/scroll-sticky.vue +60 -60
  195. package/packages/scroll/src/scroll.vue +385 -381
  196. package/packages/segment/.DS_Store +0 -0
  197. package/packages/segment/index.js +8 -8
  198. package/packages/segment/src/segment.vue +618 -618
  199. package/packages/select/index.js +8 -8
  200. package/packages/select/src/select.vue +1445 -1445
  201. package/packages/size/index.js +8 -8
  202. package/packages/size/src/directive.js +33 -33
  203. package/packages/skeleton/index.js +8 -8
  204. package/packages/skeleton/src/skeleton.vue +179 -179
  205. package/packages/slide/.DS_Store +0 -0
  206. package/packages/slide/index.js +8 -8
  207. package/packages/slide/src/slide.vue +147 -147
  208. package/packages/space/index.js +8 -8
  209. package/packages/space/src/space.vue +53 -53
  210. package/packages/step/index.js +8 -8
  211. package/packages/step/src/step.vue +122 -122
  212. package/packages/submit/index.js +8 -8
  213. package/packages/submit/src/submit.vue +103 -103
  214. package/packages/switch/index.js +9 -9
  215. package/packages/switch/src/component.vue +131 -131
  216. package/packages/tab/.DS_Store +0 -0
  217. package/packages/tab/index.js +10 -10
  218. package/packages/tab/src/tab-item.vue +85 -85
  219. package/packages/tab/src/tab.vue +599 -599
  220. package/packages/table/.DS_Store +0 -0
  221. package/packages/table/index.js +8 -8
  222. package/packages/table/src/table-body.vue +301 -301
  223. package/packages/table/src/table-config.vue +139 -139
  224. package/packages/table/src/table-head.vue +242 -242
  225. package/packages/table/src/table.vue +1458 -1458
  226. package/packages/tag/index.js +8 -8
  227. package/packages/tag/src/tag.vue +129 -129
  228. package/packages/theme/lib/css/theme/B-Design.css +1 -1
  229. package/packages/theme/lib/css/theme/aiplan.css +1 -1
  230. package/packages/theme/lib/css/theme/aiplangd.css +1 -1
  231. package/packages/theme/lib/css/theme/chbn.css +1 -1
  232. package/packages/theme/lib/css/theme/default.css +1 -1
  233. package/packages/theme/lib/css/theme/dt.css +1 -1
  234. package/packages/theme/lib/css/theme/ecloud.css +1 -1
  235. package/packages/theme/lib/css/theme/hongkong.css +1 -1
  236. package/packages/theme/lib/css/theme/narrow.css +1 -1
  237. package/packages/theme/lib/css/theme/sdpf.css +1 -1
  238. package/packages/theme/lib/css/theme/upc.css +1 -1
  239. package/packages/theme/lib/css/theme/website.css +1 -1
  240. package/packages/theme/lib/css/theme/zj.css +1 -1
  241. package/packages/theme/package.json +33 -33
  242. package/packages/theme/src/.DS_Store +0 -0
  243. package/packages/theme/src/global/mixin.less +416 -416
  244. package/packages/theme/src/global/reset.less +27 -27
  245. package/packages/theme/src/img/.DS_Store +0 -0
  246. package/packages/theme/src/img/emote/.DS_Store +0 -0
  247. package/packages/theme/src/less/.DS_Store +0 -0
  248. package/packages/theme/src/less/component/affix.less +8 -8
  249. package/packages/theme/src/less/component/article-dark.less +6 -6
  250. package/packages/theme/src/less/component/article.less +39 -39
  251. package/packages/theme/src/less/component/box-dark.less +85 -85
  252. package/packages/theme/src/less/component/box.less +272 -272
  253. package/packages/theme/src/less/component/calendar-dark.less +111 -111
  254. package/packages/theme/src/less/component/calendar.less +282 -282
  255. package/packages/theme/src/less/component/card-dark.less +17 -17
  256. package/packages/theme/src/less/component/card.less +89 -89
  257. package/packages/theme/src/less/component/chat-dark.less +47 -47
  258. package/packages/theme/src/less/component/chat.less +71 -71
  259. package/packages/theme/src/less/component/code-dark.less +41 -41
  260. package/packages/theme/src/less/component/code.less +33 -33
  261. package/packages/theme/src/less/component/cover.less +4 -4
  262. package/packages/theme/src/less/component/dialog-dark.less +54 -54
  263. package/packages/theme/src/less/component/dialog.less +75 -75
  264. package/packages/theme/src/less/component/filter-dark.less +31 -31
  265. package/packages/theme/src/less/component/filter.less +97 -97
  266. package/packages/theme/src/less/component/float-dark.less +26 -26
  267. package/packages/theme/src/less/component/float.less +61 -61
  268. package/packages/theme/src/less/component/form-dark.less +45 -45
  269. package/packages/theme/src/less/component/form.less +322 -322
  270. package/packages/theme/src/less/component/gantt-dark.less +44 -44
  271. package/packages/theme/src/less/component/gantt.less +52 -52
  272. package/packages/theme/src/less/component/guider-dark.less +6 -6
  273. package/packages/theme/src/less/component/guider.less +15 -15
  274. package/packages/theme/src/less/component/header-dark.less +41 -41
  275. package/packages/theme/src/less/component/header.less +121 -121
  276. package/packages/theme/src/less/component/keyboard-dark.less +15 -15
  277. package/packages/theme/src/less/component/keyboard.less +21 -21
  278. package/packages/theme/src/less/component/line-dark.less +20 -20
  279. package/packages/theme/src/less/component/line.less +21 -21
  280. package/packages/theme/src/less/component/msg-dark.less +42 -42
  281. package/packages/theme/src/less/component/msg.less +102 -102
  282. package/packages/theme/src/less/component/page-dark.less +26 -26
  283. package/packages/theme/src/less/component/page.less +26 -26
  284. package/packages/theme/src/less/component/param-dark.less +31 -31
  285. package/packages/theme/src/less/component/param.less +136 -136
  286. package/packages/theme/src/less/component/popup-dark.less +20 -20
  287. package/packages/theme/src/less/component/popup.less +85 -85
  288. package/packages/theme/src/less/component/print.less +121 -121
  289. package/packages/theme/src/less/component/scroll-dark.less +19 -19
  290. package/packages/theme/src/less/component/scroll.less +47 -47
  291. package/packages/theme/src/less/component/skeleton-dark.less +29 -29
  292. package/packages/theme/src/less/component/skeleton.less +78 -78
  293. package/packages/theme/src/less/component/slide.less +70 -70
  294. package/packages/theme/src/less/component/space.less +2 -2
  295. package/packages/theme/src/less/component/step-dark.less +165 -165
  296. package/packages/theme/src/less/component/step.less +147 -147
  297. package/packages/theme/src/less/component/submit.less +40 -40
  298. package/packages/theme/src/less/component/tab-dark.less +221 -221
  299. package/packages/theme/src/less/component/tab.less +469 -462
  300. package/packages/theme/src/less/component/table-dark.less +196 -196
  301. package/packages/theme/src/less/component/table.less +435 -435
  302. package/packages/theme/src/less/component/timeline-dark.less +13 -13
  303. package/packages/theme/src/less/component/timeline.less +114 -114
  304. package/packages/theme/src/less/component/tip-dark.less +76 -76
  305. package/packages/theme/src/less/component/tip.less +139 -139
  306. package/packages/theme/src/less/component/tooltip-dark.less +105 -105
  307. package/packages/theme/src/less/component/tooltip.less +159 -159
  308. package/packages/theme/src/less/component/tree-dark.less +56 -56
  309. package/packages/theme/src/less/component/tree.less +148 -148
  310. package/packages/theme/src/less/element/align.less +32 -32
  311. package/packages/theme/src/less/element/animation.less +5 -5
  312. package/packages/theme/src/less/element/button-dark.less +29 -29
  313. package/packages/theme/src/less/element/button.less +65 -65
  314. package/packages/theme/src/less/element/center-scroll-dark.less +3 -3
  315. package/packages/theme/src/less/element/center-scroll.less +6 -6
  316. package/packages/theme/src/less/element/checkbox-dark.less +68 -68
  317. package/packages/theme/src/less/element/checkbox.less +73 -73
  318. package/packages/theme/src/less/element/color-dark.less +15 -15
  319. package/packages/theme/src/less/element/color.less +33 -33
  320. package/packages/theme/src/less/element/dis.less +9 -9
  321. package/packages/theme/src/less/element/ellipsis.less +35 -35
  322. package/packages/theme/src/less/element/emote.less +5 -5
  323. package/packages/theme/src/less/element/font-dark.less +9 -9
  324. package/packages/theme/src/less/element/font.less +8 -8
  325. package/packages/theme/src/less/element/hide-dark.less +114 -114
  326. package/packages/theme/src/less/element/hide.less +114 -114
  327. package/packages/theme/src/less/element/icon.less +297 -297
  328. package/packages/theme/src/less/element/input-dark.less +205 -205
  329. package/packages/theme/src/less/element/input.less +405 -405
  330. package/packages/theme/src/less/element/menu-icon.less +1 -1
  331. package/packages/theme/src/less/element/pic.less +18 -18
  332. package/packages/theme/src/less/element/progress-dark.less +37 -37
  333. package/packages/theme/src/less/element/progress.less +82 -82
  334. package/packages/theme/src/less/element/radio-dark.less +18 -18
  335. package/packages/theme/src/less/element/radio.less +11 -11
  336. package/packages/theme/src/less/element/range-dark.less +24 -24
  337. package/packages/theme/src/less/element/range.less +56 -56
  338. package/packages/theme/src/less/element/rate.less +17 -17
  339. package/packages/theme/src/less/element/segment-dark.less +119 -119
  340. package/packages/theme/src/less/element/segment.less +197 -197
  341. package/packages/theme/src/less/element/select-dark.less +167 -167
  342. package/packages/theme/src/less/element/select.less +431 -431
  343. package/packages/theme/src/less/element/size.less +10 -10
  344. package/packages/theme/src/less/element/switch-dark.less +7 -7
  345. package/packages/theme/src/less/element/switch.less +37 -37
  346. package/packages/theme/src/less/element/tag-dark.less +115 -115
  347. package/packages/theme/src/less/element/tag.less +159 -159
  348. package/packages/theme/src/less/element/upload-dark.less +26 -26
  349. package/packages/theme/src/less/element/upload.less +64 -64
  350. package/packages/theme/src/less/layout/fix.less +2 -2
  351. package/packages/theme/src/less/layout/flow.less +47 -47
  352. package/packages/theme/src/less/layout/grid-dark.less +28 -28
  353. package/packages/theme/src/less/layout/grid.less +172 -172
  354. package/packages/theme/src/less/layout/org-dark.less +2 -2
  355. package/packages/theme/src/less/layout/org.less +72 -72
  356. package/packages/theme/src/less/layout/padding.less +1 -1
  357. package/packages/theme/src/less/layout/reverser.less +8 -8
  358. package/packages/theme/src/less/theme/.DS_Store +0 -0
  359. package/packages/theme/src/less/theme/B-Design.less +159 -159
  360. package/packages/theme/src/less/theme/aiplan.less +159 -159
  361. package/packages/theme/src/less/theme/aiplangd.less +159 -159
  362. package/packages/theme/src/less/theme/chbn.less +159 -159
  363. package/packages/theme/src/less/theme/default.less +160 -160
  364. package/packages/theme/src/less/theme/dt.less +159 -159
  365. package/packages/theme/src/less/theme/ecloud.less +159 -159
  366. package/packages/theme/src/less/theme/hongkong.less +159 -159
  367. package/packages/theme/src/less/theme/narrow.less +160 -160
  368. package/packages/theme/src/less/theme/sdpf.less +160 -160
  369. package/packages/theme/src/less/theme/upc.less +159 -159
  370. package/packages/theme/src/less/theme/website.less +159 -159
  371. package/packages/theme/src/less/theme/zj.less +159 -159
  372. package/packages/timeline/index.js +8 -8
  373. package/packages/timeline/src/timeline.vue +84 -84
  374. package/packages/tip/index.js +8 -8
  375. package/packages/tip/src/tip.vue +226 -226
  376. package/packages/tooltip/.DS_Store +0 -0
  377. package/packages/tooltip/index.js +8 -8
  378. package/packages/tooltip/src/directive.js +180 -180
  379. package/packages/tooltip/src/tooltip.vue +467 -467
  380. package/packages/transfer/index.js +8 -8
  381. package/packages/transfer/src/transfer.vue +293 -293
  382. package/packages/tree/.DS_Store +0 -0
  383. package/packages/tree/index.js +8 -8
  384. package/packages/tree/src/tree.vue +518 -518
  385. package/packages/tree/src/treeItem.vue +443 -443
  386. package/packages/upload/.DS_Store +0 -0
  387. package/packages/upload/index.js +8 -8
  388. package/packages/upload/src/upload.vue +860 -860
  389. package/src/.DS_Store +0 -0
  390. package/src/index.js +207 -207
  391. package/src/locale/format.js +46 -46
  392. package/src/locale/index.js +48 -48
  393. package/src/locale/lang/en.js +207 -207
  394. package/src/locale/lang/zh-CN.js +207 -207
  395. package/src/mixins/blur.js +9 -9
  396. package/src/mixins/emitter.js +33 -33
  397. package/src/mixins/focus.js +9 -9
  398. package/src/mixins/locale.js +9 -9
  399. package/src/mixins/migrating.js +54 -54
  400. package/src/mixins/tip.js +10 -10
  401. package/src/mixins/transition.js +130 -130
  402. package/src/msg/index.js +107 -107
  403. package/src/svg/.DS_Store +0 -0
  404. package/src/svg/menu/.DS_Store +0 -0
  405. package/src/svg/menu/main/abnormal-mix.svg +5 -5
  406. package/src/svg/menu/main/abnormal.svg +5 -5
  407. package/src/svg/menu/main/accountManager-mix.svg +5 -5
  408. package/src/svg/menu/main/accountManager.svg +5 -5
  409. package/src/svg/menu/main/agreement-mix.svg +7 -7
  410. package/src/svg/menu/main/agreement.svg +7 -7
  411. package/src/svg/menu/main/ai-mix.svg +5 -5
  412. package/src/svg/menu/main/archives-mix.svg +6 -6
  413. package/src/svg/menu/main/arrearsReport-mix.svg +17 -17
  414. package/src/svg/menu/main/arrearsReport.svg +17 -17
  415. package/src/svg/menu/main/bill-mix.svg +13 -13
  416. package/src/svg/menu/main/bill.svg +13 -13
  417. package/src/svg/menu/main/box-mix.svg +5 -5
  418. package/src/svg/menu/main/broadband-mix.svg +4 -4
  419. package/src/svg/menu/main/broadband.svg +4 -4
  420. package/src/svg/menu/main/card-mix.svg +5 -5
  421. package/src/svg/menu/main/card.svg +5 -5
  422. package/src/svg/menu/main/cash-mix.svg +5 -5
  423. package/src/svg/menu/main/cash.svg +5 -5
  424. package/src/svg/menu/main/cloud-mix.svg +4 -4
  425. package/src/svg/menu/main/cloud.svg +4 -4
  426. package/src/svg/menu/main/clue-mix.svg +10 -10
  427. package/src/svg/menu/main/clue.svg +10 -10
  428. package/src/svg/menu/main/commonUse-mix.svg +4 -4
  429. package/src/svg/menu/main/commonUse.svg +4 -4
  430. package/src/svg/menu/main/construction-mix.svg +7 -7
  431. package/src/svg/menu/main/construction.svg +7 -7
  432. package/src/svg/menu/main/contract-mix.svg +8 -8
  433. package/src/svg/menu/main/contract.svg +8 -8
  434. package/src/svg/menu/main/credit-mix.svg +5 -5
  435. package/src/svg/menu/main/credit.svg +5 -5
  436. package/src/svg/menu/main/data-mix.svg +5 -5
  437. package/src/svg/menu/main/data.svg +5 -5
  438. package/src/svg/menu/main/date-mix.svg +7 -7
  439. package/src/svg/menu/main/deposit-mix.svg +4 -4
  440. package/src/svg/menu/main/device-mix.svg +4 -4
  441. package/src/svg/menu/main/device.svg +4 -4
  442. package/src/svg/menu/main/discrepancy-mix.svg +5 -5
  443. package/src/svg/menu/main/door-mix.svg +6 -6
  444. package/src/svg/menu/main/fault-mix.svg +12 -12
  445. package/src/svg/menu/main/fault.svg +16 -16
  446. package/src/svg/menu/main/finance-mix.svg +11 -11
  447. package/src/svg/menu/main/finance.svg +13 -13
  448. package/src/svg/menu/main/flow-mix.svg +4 -4
  449. package/src/svg/menu/main/flow.svg +4 -4
  450. package/src/svg/menu/main/folder-mix.svg +4 -4
  451. package/src/svg/menu/main/folder.svg +4 -4
  452. package/src/svg/menu/main/friendly-mix.svg +5 -5
  453. package/src/svg/menu/main/fusion-mix.svg +5 -5
  454. package/src/svg/menu/main/fusion.svg +5 -5
  455. package/src/svg/menu/main/gift-mix.svg +8 -8
  456. package/src/svg/menu/main/gift.svg +8 -8
  457. package/src/svg/menu/main/gps-mix.svg +6 -6
  458. package/src/svg/menu/main/gps.svg +6 -6
  459. package/src/svg/menu/main/grid-mix.svg +7 -7
  460. package/src/svg/menu/main/grid.svg +7 -7
  461. package/src/svg/menu/main/group-mix.svg +4 -4
  462. package/src/svg/menu/main/group.svg +4 -4
  463. package/src/svg/menu/main/home-mix.svg +5 -5
  464. package/src/svg/menu/main/home.svg +8 -8
  465. package/src/svg/menu/main/ict-mix.svg +4 -4
  466. package/src/svg/menu/main/industry-mix.svg +5 -5
  467. package/src/svg/menu/main/industry.svg +5 -5
  468. package/src/svg/menu/main/info-mix.svg +9 -9
  469. package/src/svg/menu/main/info.svg +9 -9
  470. package/src/svg/menu/main/integral-mix.svg +5 -5
  471. package/src/svg/menu/main/integral.svg +5 -5
  472. package/src/svg/menu/main/internet-mix.svg +5 -5
  473. package/src/svg/menu/main/internet.svg +5 -5
  474. package/src/svg/menu/main/inventory-mix.svg +5 -5
  475. package/src/svg/menu/main/invoice-mix.svg +6 -6
  476. package/src/svg/menu/main/invoice.svg +14 -14
  477. package/src/svg/menu/main/iot-mix.svg +5 -5
  478. package/src/svg/menu/main/iot.svg +5 -5
  479. package/src/svg/menu/main/label-mix.svg +4 -4
  480. package/src/svg/menu/main/label.svg +4 -4
  481. package/src/svg/menu/main/love-mix.svg +6 -6
  482. package/src/svg/menu/main/love.svg +13 -13
  483. package/src/svg/menu/main/m1-mix.svg +4 -4
  484. package/src/svg/menu/main/m1.svg +4 -4
  485. package/src/svg/menu/main/m2-mix.svg +12 -12
  486. package/src/svg/menu/main/m2.svg +11 -11
  487. package/src/svg/menu/main/m3-mix.svg +6 -6
  488. package/src/svg/menu/main/m3.svg +7 -7
  489. package/src/svg/menu/main/m4-mix.svg +5 -5
  490. package/src/svg/menu/main/m4.svg +7 -7
  491. package/src/svg/menu/main/m5-mix.svg +8 -8
  492. package/src/svg/menu/main/m5.svg +10 -10
  493. package/src/svg/menu/main/mail-mix.svg +5 -5
  494. package/src/svg/menu/main/manual-mix.svg +11 -11
  495. package/src/svg/menu/main/manual.svg +11 -11
  496. package/src/svg/menu/main/market-mix.svg +4 -4
  497. package/src/svg/menu/main/market.svg +4 -4
  498. package/src/svg/menu/main/member-mix.svg +6 -6
  499. package/src/svg/menu/main/member.svg +6 -6
  500. package/src/svg/menu/main/menu-mix.svg +4 -4
  501. package/src/svg/menu/main/menu.svg +4 -4
  502. package/src/svg/menu/main/message-mix.svg +11 -11
  503. package/src/svg/menu/main/message.svg +11 -11
  504. package/src/svg/menu/main/namelist-mix.svg +4 -4
  505. package/src/svg/menu/main/namelist.svg +4 -4
  506. package/src/svg/menu/main/net-mix.svg +7 -7
  507. package/src/svg/menu/main/niche-mix.svg +12 -12
  508. package/src/svg/menu/main/niche.svg +12 -12
  509. package/src/svg/menu/main/notice-mix.svg +4 -4
  510. package/src/svg/menu/main/notice.svg +4 -4
  511. package/src/svg/menu/main/number-mix.svg +6 -6
  512. package/src/svg/menu/main/operations-mix.svg +4 -4
  513. package/src/svg/menu/main/operations.svg +4 -4
  514. package/src/svg/menu/main/order-mix.svg +8 -8
  515. package/src/svg/menu/main/order.svg +8 -8
  516. package/src/svg/menu/main/person-mix.svg +6 -6
  517. package/src/svg/menu/main/person.svg +6 -6
  518. package/src/svg/menu/main/phone-mix.svg +4 -4
  519. package/src/svg/menu/main/phone.svg +4 -4
  520. package/src/svg/menu/main/phoneBill-mix.svg +6 -6
  521. package/src/svg/menu/main/phoneBill.svg +6 -6
  522. package/src/svg/menu/main/preferential-mix.svg +5 -5
  523. package/src/svg/menu/main/preferential.svg +5 -5
  524. package/src/svg/menu/main/print-mix.svg +5 -5
  525. package/src/svg/menu/main/problem-mix.svg +4 -4
  526. package/src/svg/menu/main/problem.svg +4 -4
  527. package/src/svg/menu/main/process-mix.svg +4 -4
  528. package/src/svg/menu/main/process.svg +4 -4
  529. package/src/svg/menu/main/product-mix.svg +5 -5
  530. package/src/svg/menu/main/product.svg +6 -6
  531. package/src/svg/menu/main/qrCode-mix.svg +8 -8
  532. package/src/svg/menu/main/qrCode.svg +8 -8
  533. package/src/svg/menu/main/refuelingBag-mix-mix.svg +4 -4
  534. package/src/svg/menu/main/refuelingBag-mix.svg +4 -4
  535. package/src/svg/menu/main/reportForm-mix.svg +8 -8
  536. package/src/svg/menu/main/reportForm.svg +8 -8
  537. package/src/svg/menu/main/risk-mix.svg +16 -16
  538. package/src/svg/menu/main/risk.svg +17 -17
  539. package/src/svg/menu/main/robot-mix.svg +9 -9
  540. package/src/svg/menu/main/robot.svg +9 -9
  541. package/src/svg/menu/main/satisfaction-mix.svg +4 -4
  542. package/src/svg/menu/main/satisfaction.svg +4 -4
  543. package/src/svg/menu/main/scratchCard-mix.svg +4 -4
  544. package/src/svg/menu/main/sim-mix.svg +4 -4
  545. package/src/svg/menu/main/sim.svg +4 -4
  546. package/src/svg/menu/main/staging-mix.svg +4 -4
  547. package/src/svg/menu/main/staging.svg +4 -4
  548. package/src/svg/menu/main/survey-mix.svg +5 -5
  549. package/src/svg/menu/main/survey.svg +5 -5
  550. package/src/svg/menu/main/tasks-mix.svg +8 -8
  551. package/src/svg/menu/main/tasks.svg +8 -8
  552. package/src/svg/menu/main/telephone-mix.svg +4 -4
  553. package/src/svg/menu/main/topUp-mix.svg +5 -5
  554. package/src/svg/menu/main/trajectory-mix.svg +11 -11
  555. package/src/svg/menu/main/trajectory.svg +23 -23
  556. package/src/svg/menu/main/transmit-mix.svg +5 -5
  557. package/src/svg/menu/main/tv-mix.svg +6 -6
  558. package/src/svg/menu/main/unlock-mix.svg +4 -4
  559. package/src/svg/menu/main/unlock.svg +4 -4
  560. package/src/svg/menu/main/view-mix.svg +5 -5
  561. package/src/svg/menu/main/view.svg +5 -5
  562. package/src/svg/menu/main/visits-mix.svg +19 -19
  563. package/src/svg/menu/main/visits.svg +19 -19
  564. package/src/svg/menu/main/voice-mix.svg +4 -4
  565. package/src/svg/menu/main/voice.svg +4 -4
  566. package/src/svg/menu/main/wiki-mix.svg +4 -4
  567. package/src/svg/menu/main/wiki.svg +4 -4
  568. package/src/svg/menu/main/workOrder-mix.svg +6 -6
  569. package/src/svg/menu/main/workOrder.svg +14 -14
  570. package/src/svg/menu/patch/Mo-space.svg +2 -2
  571. package/src/svg/menu/patch/Mo.svg +3 -3
  572. package/src/svg/menu/patch/add-space.svg +3 -3
  573. package/src/svg/menu/patch/add.svg +3 -3
  574. package/src/svg/menu/patch/address-space.svg +3 -3
  575. package/src/svg/menu/patch/address.svg +3 -3
  576. package/src/svg/menu/patch/approve-space.svg +3 -3
  577. package/src/svg/menu/patch/approve.svg +4 -4
  578. package/src/svg/menu/patch/avoid-space.svg +3 -3
  579. package/src/svg/menu/patch/avoid.svg +3 -3
  580. package/src/svg/menu/patch/batch-space.svg +3 -3
  581. package/src/svg/menu/patch/batch.svg +5 -5
  582. package/src/svg/menu/patch/broadband-space.svg +3 -3
  583. package/src/svg/menu/patch/broadband.svg +4 -4
  584. package/src/svg/menu/patch/cancellation-space.svg +3 -3
  585. package/src/svg/menu/patch/cancellation.svg +3 -3
  586. package/src/svg/menu/patch/center-space.svg +3 -3
  587. package/src/svg/menu/patch/center.svg +5 -5
  588. package/src/svg/menu/patch/change-space.svg +3 -3
  589. package/src/svg/menu/patch/change.svg +4 -4
  590. package/src/svg/menu/patch/click-space.svg +3 -3
  591. package/src/svg/menu/patch/click.svg +4 -4
  592. package/src/svg/menu/patch/close-1-space.svg +3 -3
  593. package/src/svg/menu/patch/close-1.svg +3 -3
  594. package/src/svg/menu/patch/close-space.svg +2 -2
  595. package/src/svg/menu/patch/close.svg +3 -3
  596. package/src/svg/menu/patch/collect-space.svg +3 -3
  597. package/src/svg/menu/patch/collect.svg +3 -3
  598. package/src/svg/menu/patch/comment-space.svg +3 -3
  599. package/src/svg/menu/patch/comment.svg +3 -3
  600. package/src/svg/menu/patch/confirm-space.svg +3 -3
  601. package/src/svg/menu/patch/confirm.svg +3 -3
  602. package/src/svg/menu/patch/contract-space.svg +3 -3
  603. package/src/svg/menu/patch/contract.svg +3 -3
  604. package/src/svg/menu/patch/credit-space.svg +3 -3
  605. package/src/svg/menu/patch/credit.svg +5 -5
  606. package/src/svg/menu/patch/dataMonitoring-space.svg +3 -3
  607. package/src/svg/menu/patch/dataMonitoring.svg +3 -3
  608. package/src/svg/menu/patch/dedicatedCircuit-space.svg +3 -3
  609. package/src/svg/menu/patch/dedicatedCircuit.svg +3 -3
  610. package/src/svg/menu/patch/detail-space.svg +3 -3
  611. package/src/svg/menu/patch/detail.svg +3 -3
  612. package/src/svg/menu/patch/disassemb-space.svg +3 -3
  613. package/src/svg/menu/patch/disassemb.svg +3 -3
  614. package/src/svg/menu/patch/earnestMoney-space.svg +3 -3
  615. package/src/svg/menu/patch/earnestMoney.svg +3 -3
  616. package/src/svg/menu/patch/empower-space.svg +3 -3
  617. package/src/svg/menu/patch/empower.svg +3 -3
  618. package/src/svg/menu/patch/entrust-space.svg +3 -3
  619. package/src/svg/menu/patch/entrust.svg +3 -3
  620. package/src/svg/menu/patch/expedite-space.svg +4 -4
  621. package/src/svg/menu/patch/expedite.svg +4 -4
  622. package/src/svg/menu/patch/flow-space.svg +3 -3
  623. package/src/svg/menu/patch/flow.svg +3 -3
  624. package/src/svg/menu/patch/folder-space.svg +3 -3
  625. package/src/svg/menu/patch/folder.svg +3 -3
  626. package/src/svg/menu/patch/forbidden-space.svg +3 -3
  627. package/src/svg/menu/patch/forbidden.svg +3 -3
  628. package/src/svg/menu/patch/forward-space.svg +3 -3
  629. package/src/svg/menu/patch/forward.svg +3 -3
  630. package/src/svg/menu/patch/fusion-space.svg +3 -3
  631. package/src/svg/menu/patch/fusion.svg +6 -6
  632. package/src/svg/menu/patch/history-space.svg +3 -3
  633. package/src/svg/menu/patch/history.svg +3 -3
  634. package/src/svg/menu/patch/information-space.svg +3 -3
  635. package/src/svg/menu/patch/information.svg +3 -3
  636. package/src/svg/menu/patch/insert-space.svg +3 -3
  637. package/src/svg/menu/patch/insert.svg +3 -3
  638. package/src/svg/menu/patch/letv-space.svg +3 -3
  639. package/src/svg/menu/patch/letv.svg +3 -3
  640. package/src/svg/menu/patch/link-space.svg +3 -3
  641. package/src/svg/menu/patch/link.svg +3 -3
  642. package/src/svg/menu/patch/location-space.svg +3 -3
  643. package/src/svg/menu/patch/location.svg +3 -3
  644. package/src/svg/menu/patch/message-space.svg +3 -3
  645. package/src/svg/menu/patch/message.svg +4 -4
  646. package/src/svg/menu/patch/minus-space.svg +3 -3
  647. package/src/svg/menu/patch/minus.svg +3 -3
  648. package/src/svg/menu/patch/mms-space.svg +3 -3
  649. package/src/svg/menu/patch/mms.svg +3 -3
  650. package/src/svg/menu/patch/monitor-space.svg +3 -3
  651. package/src/svg/menu/patch/monitor.svg +3 -3
  652. package/src/svg/menu/patch/move-space.svg +3 -3
  653. package/src/svg/menu/patch/move.svg +3 -3
  654. package/src/svg/menu/patch/negative-space.svg +2 -2
  655. package/src/svg/menu/patch/negative.svg +3 -3
  656. package/src/svg/menu/patch/net-space.svg +2 -2
  657. package/src/svg/menu/patch/net.svg +3 -3
  658. package/src/svg/menu/patch/news-space.svg +3 -3
  659. package/src/svg/menu/patch/news.svg +3 -3
  660. package/src/svg/menu/patch/notice-space.svg +4 -4
  661. package/src/svg/menu/patch/notice.svg +5 -5
  662. package/src/svg/menu/patch/officialBusiness-space.svg +3 -3
  663. package/src/svg/menu/patch/officialBusiness.svg +4 -4
  664. package/src/svg/menu/patch/pay-space.svg +3 -3
  665. package/src/svg/menu/patch/pay.svg +3 -3
  666. package/src/svg/menu/patch/phone-space.svg +3 -3
  667. package/src/svg/menu/patch/phone.svg +5 -5
  668. package/src/svg/menu/patch/print-space.svg +3 -3
  669. package/src/svg/menu/patch/print.svg +5 -5
  670. package/src/svg/menu/patch/product-space.svg +3 -3
  671. package/src/svg/menu/patch/product.svg +5 -5
  672. package/src/svg/menu/patch/reservation-space.svg +3 -3
  673. package/src/svg/menu/patch/reservation.svg +3 -3
  674. package/src/svg/menu/patch/sale-space.svg +3 -3
  675. package/src/svg/menu/patch/sale.svg +5 -5
  676. package/src/svg/menu/patch/search-space.svg +3 -3
  677. package/src/svg/menu/patch/search.svg +3 -3
  678. package/src/svg/menu/patch/secure-space.svg +3 -3
  679. package/src/svg/menu/patch/secure.svg +5 -5
  680. package/src/svg/menu/patch/setup-space.svg +3 -3
  681. package/src/svg/menu/patch/setup.svg +3 -3
  682. package/src/svg/menu/patch/shift-space.svg +3 -3
  683. package/src/svg/menu/patch/shift.svg +3 -3
  684. package/src/svg/menu/patch/situation-space.svg +3 -3
  685. package/src/svg/menu/patch/situation.svg +3 -3
  686. package/src/svg/menu/patch/special-space.svg +3 -3
  687. package/src/svg/menu/patch/special.svg +3 -3
  688. package/src/svg/menu/patch/tabulation-space.svg +3 -3
  689. package/src/svg/menu/patch/tabulation.svg +8 -8
  690. package/src/svg/menu/patch/track-space.svg +3 -3
  691. package/src/svg/menu/patch/track.svg +5 -5
  692. package/src/svg/menu/patch/transaction-space.svg +3 -3
  693. package/src/svg/menu/patch/transaction.svg +6 -6
  694. package/src/svg/menu/patch/user-space.svg +3 -3
  695. package/src/svg/menu/patch/user.svg +3 -3
  696. package/src/svg/menu/patch/visualize-space.svg +3 -3
  697. package/src/svg/menu/patch/visualize.svg +4 -4
  698. package/src/svg/menu/patch/vnet-space.svg +3 -3
  699. package/src/svg/menu/patch/vnet.svg +3 -3
  700. package/src/tip/tip.js +160 -160
  701. package/src/utils/after-leave.js +27 -27
  702. package/src/utils/ajax.js +59 -59
  703. package/src/utils/array.js +24 -24
  704. package/src/utils/clickoutside.js +105 -105
  705. package/src/utils/compare.js +16 -16
  706. package/src/utils/date.js +55 -55
  707. package/src/utils/disabledArea.js +18 -18
  708. package/src/utils/dom.js +301 -301
  709. package/src/utils/filetransfer.js +287 -287
  710. package/src/utils/isModified.js +20 -20
  711. package/src/utils/jsencrypt/JSEncrypt.js +192 -192
  712. package/src/utils/jsencrypt/JSEncryptRSAKey.js +320 -320
  713. package/src/utils/jsencrypt/index.js +3 -3
  714. package/src/utils/jsencrypt/jselib/asn1js/asn1.d.ts +51 -51
  715. package/src/utils/jsencrypt/jselib/asn1js/asn1.js +565 -565
  716. package/src/utils/jsencrypt/jselib/asn1js/base64.d.ts +5 -5
  717. package/src/utils/jsencrypt/jselib/asn1js/base64.js +88 -88
  718. package/src/utils/jsencrypt/jselib/asn1js/hex.d.ts +3 -3
  719. package/src/utils/jsencrypt/jselib/asn1js/hex.js +64 -64
  720. package/src/utils/jsencrypt/jselib/asn1js/int10.d.ts +9 -9
  721. package/src/utils/jsencrypt/jselib/asn1js/int10.js +87 -87
  722. package/src/utils/jsencrypt/jselib/asn1js/oids.d.ts +9778 -9778
  723. package/src/utils/jsencrypt/jselib/asn1js/oids.js +1962 -1962
  724. package/src/utils/jsencrypt/jselib/jsbn/base64.d.ts +3 -3
  725. package/src/utils/jsencrypt/jselib/jsbn/base64.js +76 -76
  726. package/src/utils/jsencrypt/jselib/jsbn/jsbn.d.ts +98 -98
  727. package/src/utils/jsencrypt/jselib/jsbn/jsbn.js +1754 -1754
  728. package/src/utils/jsencrypt/jselib/jsbn/prng4.d.ts +10 -10
  729. package/src/utils/jsencrypt/jselib/jsbn/prng4.js +46 -46
  730. package/src/utils/jsencrypt/jselib/jsbn/rng.d.ts +3 -3
  731. package/src/utils/jsencrypt/jselib/jsbn/rng.js +78 -78
  732. package/src/utils/jsencrypt/jselib/jsbn/rsa.d.ts +23 -23
  733. package/src/utils/jsencrypt/jselib/jsbn/rsa.js +373 -373
  734. package/src/utils/jsencrypt/jselib/jsbn/util.d.ts +7 -7
  735. package/src/utils/jsencrypt/jselib/jsbn/util.js +58 -58
  736. package/src/utils/jsencrypt/jselib/jsrsasign/asn1-1.0.js +1593 -1593
  737. package/src/utils/jsencrypt/jselib/jsrsasign/yahoo.js +63 -63
  738. package/src/utils/jsencrypt/util.js +58 -58
  739. package/src/utils/jsencrypt.js +263 -263
  740. package/src/utils/md5.js +203 -203
  741. package/src/utils/merge.js +15 -15
  742. package/src/utils/mime.js +75 -75
  743. package/src/utils/print.js +39 -39
  744. package/src/utils/ratio.js +230 -230
  745. package/src/utils/respo.js +9 -9
  746. package/src/utils/shared.js +7 -7
  747. package/src/utils/sign.js +185 -185
  748. package/src/utils/string.js +13 -13
  749. package/src/utils/theme.js +91 -91
  750. package/src/utils/types.js +40 -40
  751. package/src/utils/util.js +286 -286
  752. package/src/utils/uuid.js +12 -12
  753. package/src/utils/validate.js +373 -373
@@ -1,612 +1,612 @@
1
- <template>
2
- <span class="to-range to-form-readonly" :style="setStyle" @touchmove="moveHandle($event)" @touchend="endHandle($event)">
3
- <span class="to-rangeMain">
4
- <span class="to-rangeBar" @click.stop="rangeBarClick($event)">
5
- <span class="to-rangeProgress" :style="{width:(rangeProgress - startProgress) + '%',left: startProgress + '%'}">
6
- <span v-if="start" ref="touchStartBar" :style="{zIndex: String(startProgress) === '100'?'100':'99'}" class="to-rangeStart" @mousedown="onStartButtonDown" @touchstart="startHandle($event)"></span>
7
- <span ref="touchBar" class="to-rangeEnd" @mousedown="onButtonDown" @touchstart="endStartHandle($event)"></span>
8
- </span>
9
- </span>
10
- <span v-if="showInput" class="to-rangeValue">
11
- <span v-if="start" :class="setClass" class="to-input">
12
- <to-input ref="rangeStartInput" v-model="refStartVal" type="number" mode="none" v-bind="inputProps" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputStartHandle"></to-input>
13
- <span class="to-inputText to-inputText-narrow">~</span>
14
- <to-input ref="rangeEndInput" v-model="refEndVal" type="number" mode="none" v-bind="inputProps" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputEndHandle"></to-input>
15
- </span>
16
- <!-- <to-input ref="rangeInput" v-model="refVal" v-bind="inputProps" fillet="normal" :min="min" :max="max" :clearable="false" :width="6" :readonly="readonly" @blur="inputHandle"></to-input>-->
17
- <to-input v-else ref="rangeInput" v-model="refVal" v-bind="inputProps" type="number" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputHandle"></to-input>
18
- </span>
19
- </span>
20
- </span>
21
- </template>
22
- <script>
23
- export default {
24
- name: 'ToRange',
25
- componentName: 'ToRange',
26
- model: {
27
- event: 'change'
28
- },
29
- props: {
30
- value: {
31
- type: [Number, String],
32
- default: 0
33
- },
34
- readonly: {
35
- type: Boolean,
36
- default: false
37
- },
38
- inputable: {
39
- type: Boolean,
40
- default: true
41
- },
42
- max: {
43
- type: [Number, String],
44
- default: 100
45
- },
46
- min: {
47
- type: [Number, String],
48
- default: 0
49
- },
50
- ruler: {
51
- type: Boolean,
52
- default: false
53
- },
54
- start: {
55
- type: Boolean,
56
- default: false
57
- },
58
- step: {
59
- type: [String, Number],
60
- default: 1
61
- },
62
- width: {
63
- type: [Number, String],
64
- default: ''
65
- },
66
- valueWidth: {
67
- type: [Number, String],
68
- default: 0
69
- },
70
- showInput: Boolean,
71
- inputProps: {
72
- type: Object,
73
- default() {
74
- return {}
75
- }
76
- }
77
- },
78
- data() {
79
- return {
80
- disabled: this.readonly,
81
- length: 0,
82
- isStart: false,
83
- progress: 0,
84
- sProgress: 0,
85
- dragging: true,
86
- startX: 0,
87
- endStartX: 0,
88
- startMoveX: 0,
89
- startPosition: 0,
90
- currentX: 0,
91
- moveX: 0,
92
- endX: 0,
93
- x: 0,
94
- sx: 0,
95
- isStartMove: 'start',
96
- rangeProgress: 0,
97
- sStartMoveX: 0,
98
- sStartPosition: 0,
99
- startProgress: 0,
100
- startValue: 0
101
- }
102
- },
103
- computed: {
104
- val: {
105
- get: function() {
106
- return Math.round(this.progress / this.range * this.range) || 0
107
- },
108
- set: function(newVal) {
109
- this.progress = newVal
110
- this.x = this.length * this.progress / this.range
111
- }
112
- },
113
- startVal: {
114
- get: function() {
115
- return Math.round(this.sProgress / this.range * this.range) || 0
116
- },
117
- set: function(newVal) {
118
- this.sProgress = newVal
119
- this.sx = this.length * this.sProgress / this.range
120
- }
121
- },
122
- refVal: {
123
- get: function() {
124
- if (this.start) {
125
- return (this.startVal + this.min) + ',' + (this.val + this.min)
126
- } else {
127
- return this.val + this.min
128
- }
129
- },
130
- set: function(newVal) {
131
- }
132
- },
133
- refStartVal: {
134
- get: function() {
135
- if (this.start) {
136
- return (this.startVal + this.min)
137
- } else {
138
- return this.val + this.min
139
- }
140
- },
141
- set: function(newVal) {
142
- }
143
- },
144
- refEndVal: {
145
- get: function() {
146
- if (this.start) {
147
- return (this.val + this.min)
148
- } else {
149
- return this.val + this.min
150
- }
151
- },
152
- set: function(newVal) {
153
- }
154
- },
155
- rangeValue: {
156
- get: function() {
157
- if (this.start) {
158
- return (this.sProgress || 0).toFixed(0) + ',' + (this.progress || 0).toFixed(0)
159
- } else {
160
- return (this.progress || 0).toFixed(0)
161
- }
162
- },
163
- set: function(newVal) {
164
- }
165
- },
166
- range() {
167
- return Number(this.max) - Number(this.min)
168
- },
169
- part() {
170
- return 100 / this.range
171
- },
172
- setStyle() {
173
- var obj = {};
174
- if (this.width) {
175
- if (!isNaN(this.width)) {
176
- obj.width = this.width + 'em';
177
- } else if (this.width === 'full') {
178
- obj.width = '100%';
179
- } else {
180
- obj.width = this.width;
181
- }
182
- }
183
- return obj;
184
- },
185
- setClass() {
186
- let arr = [];
187
- if (this.inputProps.color) {
188
- if (this.inputProps.color !== 'radam') {
189
- arr.push(`to-input-color-${this.inputProps.color}`);
190
- } else {
191
- let colors = this.inputProps.$TouchUI.colors
192
- let number = Math.round(Math.random() * 6)
193
- arr.push(`to-input-color-${ colors[number]}`);
194
- }
195
- }
196
- if (this.inputProps.placeholderColor) {
197
- arr.push(`to-input-placeholder-color-${this.inputProps.placeholderColor}`);
198
- }
199
- if (this.inputProps.fillet !== 'none') {
200
- arr.push(`to-input-fillet-${this.inputProps.fillet}`);
201
- }
202
- if (this.inputProps.filletPosition) {
203
- arr.push(`to-input-fillet-position-${this.filletPosition}`);
204
- }
205
- if (this.inputProps.mode) {
206
- arr.push(`to-input-mode-${this.inputProps.mode}`);
207
- } else if (this.ToForm && this.ToForm.type === 'list') {
208
- arr.push('to-input-mode-none')
209
- } else {
210
- arr.push('to-input-mode-default');
211
- }
212
- if (this.inputProps.stepIconMode === 'arrow') {
213
- arr.push(`to-input-step-icon-mode-${this.inputProps.stepIconMode}`);
214
- }
215
- if (this.inputProps.readonly) {
216
- arr.push('to-input-state-readonly');
217
- }
218
- if (this.inputProps.focused && !this.inputProps.preventFocus) {
219
- arr.push('to-input-state-focus');
220
- }
221
- if (this.inputProps.changed) {
222
- arr.push('to-input-changed')
223
- }
224
- if ((this.ToForm && this.ToForm.comparable) || this.inputProps.comparable) {
225
- arr.push('to-compare')
226
- }
227
- return arr;
228
- }
229
- },
230
- watch: {
231
- readonly(val) {
232
- this.disabled = val
233
- },
234
- value(val) {
235
- if (this.start) {
236
- if (val && String(val).split(',').length > 1) {
237
- let value = val.split(',')
238
- if (Number(value[0]) >= this.range) {
239
- this.startVal = this.range
240
- } else {
241
- this.startVal = Number(value[0])
242
- }
243
- if (Number(value[1]) >= this.range) {
244
- this.val = this.range
245
- } else {
246
- this.val = Number(value[1])
247
- }
248
- }
249
- } else {
250
- if (Number(val) >= this.range) {
251
- this.val = this.range
252
- } else {
253
- this.val = Number(val)
254
- }
255
- }
256
- this.initRangeVal()
257
- }
258
- },
259
- mounted() {
260
- // 这里注意range的value改变不会触发视图刷新
261
- this.$nextTick(()=>{
262
- this.length = this.$el.querySelector('.to-rangeBar').offsetWidth
263
- this.initRangeVal()
264
- })
265
- },
266
- methods: {
267
- initRangeVal() {
268
- if (this.start) {
269
- if (this.value) {
270
- let value = this.value.split(',')
271
- this.startVal = Number(value[0]) < 0 ? 0 : (Number(value[0]) / this.range * this.range) - this.min || 0
272
- this.val = Number(value[1]) < 0 ? 0 : (Number(value[1]) / this.range * this.range) - this.min || 0
273
- } else {
274
- this.startVal = 0
275
- this.val = 0
276
- }
277
- this.startProgress = ((this.startVal) / this.range) * 100
278
- this.rangeProgress = ((this.val) / this.range) * 100
279
- } else {
280
- this.val = Number(this.value) < 0 ? 0 : (Number(this.value) / this.range * this.range) - this.min || 0
281
- this.rangeProgress = ((this.val) / this.range) * 100
282
- }
283
- },
284
- rangeBarClick(e) {
285
- if (this.disabled) return
286
- if (this.dragging) {
287
- let leftX = e.offsetX
288
- this.x = e.clientX - leftX
289
- if (this.start) {
290
- let startLeft = this.startProgress / this.range * this.length
291
- let endLeft = this.rangeProgress / this.range * this.length
292
- let startLeftAbs = Math.abs(startLeft - leftX)
293
- let endLeftAbs = Math.abs(endLeft - leftX)
294
- if (startLeftAbs >= endLeftAbs) {
295
- this.progress = leftX / this.length * this.range
296
- this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
297
- if (this.progress <= 0) {
298
- this.progress = 0
299
- } else if (this.progress >= this.max) {
300
- this.progress = this.max
301
- }
302
- let progress = ((this.val) / this.range) * 100
303
- if (progress < 0) {
304
- progress = 0
305
- } else if (progress > 100) {
306
- progress = 100
307
- }
308
- this.rangeProgress = progress
309
- } else {
310
- this.sProgress = leftX / this.length * this.range
311
- this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress
312
- if (this.sProgress <= 0) {
313
- this.sProgress = 0
314
- } else if (this.sProgress >= this.max) {
315
- this.sProgress = this.max
316
- }
317
- let progress = ((this.startVal) / this.range) * 100
318
- if (progress < 0) {
319
- progress = 0
320
- } else if (progress > 100) {
321
- progress = 100
322
- }
323
- this.startProgress = progress
324
- }
325
- } else {
326
- this.progress = leftX / this.length * this.range
327
- this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
328
- if (this.progress <= 0) {
329
- this.progress = 0
330
- } else if (this.progress >= this.max) {
331
- this.progress = this.max
332
- }
333
- }
334
- this.$emit('change', this.rangeValue)
335
- }
336
- },
337
- startHandle: function(e) {
338
- if (this.disabled) return
339
- this.isStart = true
340
- this.isStartMove = 'start'
341
- if (this.isStart) { this.startX = e.touches[0].clientX }
342
- },
343
- endStartHandle: function(e) {
344
- if (this.disabled) return
345
- this.isStart = true
346
- this.isStartMove = 'end'
347
- if (this.isStart) { this.endStartX = e.touches[0].clientX }
348
- },
349
- moveHandle: function(e) {
350
- if (this.disabled) return
351
- if (this.isStart) {
352
- this.moveX = e.touches[0].clientX
353
- if (this.isStartMove === 'end') {
354
- this.progress = (this.x + this.moveX - this.endStartX) / this.length * this.range
355
- if (this.progress <= 0) {
356
- this.progress = 0
357
- } else if (this.progress >= this.range) {
358
- this.progress = this.range
359
- }
360
- let progress = ((this.progress) / this.range) * 100
361
- if (progress < 0) {
362
- progress = 0
363
- } else if (progress > 100) {
364
- progress = 100
365
- }
366
- this.rangeProgress = progress
367
- } else if (this.isStartMove === 'start') {
368
- this.sProgress = (this.sx + this.moveX - this.startX) / this.length * this.range
369
- if (this.sProgress <= 0) {
370
- this.sProgress = 0
371
- } else if (this.sProgress >= this.range) {
372
- this.sProgress = this.range
373
- }
374
- let progress = ((this.sProgress) / this.range) * 100
375
- if (progress < 0) {
376
- progress = 0
377
- } else if (progress > 100) {
378
- progress = 100
379
- }
380
- this.startProgress = progress
381
- }
382
- }
383
- },
384
- endHandle: function(e) {
385
- if (this.disabled) return
386
- if (this.isStart) {
387
- if (this.isStartMove === 'end') {
388
- this.x += this.moveX - this.startX
389
- if (this.progress <= 0) {
390
- this.x = 0
391
- } else if (this.progress >= this.range) {
392
- this.x = this.length
393
- }
394
- } else if (this.isStartMove === 'start') {
395
- this.sx += this.moveX - this.endStartX
396
- if (this.sProgress <= 0) {
397
- this.sx = 0
398
- } else if (this.sProgress >= this.range) {
399
- this.sx = this.length
400
- }
401
- }
402
- this.isStart = false
403
- }
404
- this.$emit('change', this.rangeValue)
405
- },
406
- inputStartHandle(e) {
407
- const startVal = e.target.value
408
- this.sProgress = startVal
409
- this.startVal = (Number(startVal) / this.range * this.range) - this.min || 0
410
- const that = this
411
- let timer = null
412
- timer = setTimeout(function() {
413
- if (startVal < 0) {
414
- that.sProgress = 0
415
- that.startVal = 0
416
- }
417
- if (startVal > that.range) {
418
- that.sProgress = that.range
419
- that.startVal = that.range
420
- }
421
- that.startProgress = ((that.startVal) / that.range) * 100
422
- that.$emit('change', that.rangeValue)
423
- clearTimeout(timer)
424
- timer = null
425
- }, 0)
426
- },
427
- inputEndHandle(e) {
428
- const endVal = e.target.value
429
- this.progress = endVal
430
- this.val = (Number(endVal) / this.range * this.range) - this.min || 0
431
- this.startProgress = ((this.startVal) / this.range) * 100
432
- this.rangeProgress = ((this.val) / this.range) * 100
433
- const that = this
434
- let timer = null
435
- timer = setTimeout(function() {
436
- if (endVal < 0) {
437
- that.progress = 0
438
- that.val = 0
439
- }
440
- if (endVal > that.range) {
441
- that.progress = that.range
442
- that.val = that.range
443
- }
444
- that.rangeProgress = ((that.val) / that.range) * 100
445
- that.$emit('change', that.rangeValue)
446
- clearTimeout(timer)
447
- timer = null
448
- }, 0)
449
- },
450
- inputHandle(e) {
451
- if (!this.start) {
452
- this.progress = e.target.value
453
- if (Number(e.target.value) < 0) {
454
- this.progress = 0
455
- } else if (Number(e.target.value) > 100) {
456
- this.progress = 100
457
- }
458
- this.val = Number(e.target.value) < 0 ? 0 : (Number(e.target.value) / this.range * this.range) - this.min || 0
459
- this.rangeProgress = ((this.val) / this.range) * 100
460
- const that = this
461
- let timer = null
462
- timer = setTimeout(function() {
463
- if (e.target.value < 0) {
464
- that.progress = 0
465
- that.val = 0
466
- }
467
- if (e.target.value > that.range) {
468
- that.progress = that.range
469
- that.val = that.range
470
- }
471
- that.rangeProgress = ((that.val) / that.range) * 100
472
- // that.value = that.rangeProgress
473
- that.$emit('change', that.rangeValue)
474
- clearTimeout(timer)
475
- timer = null
476
- }, 0)
477
- }
478
- },
479
-
480
- onButtonDown(event) {
481
- if (this.disabled) return;
482
- event.preventDefault();
483
- this.isStartMove = 'end'
484
- this.onDragStart(event);
485
- window.addEventListener('mousemove', this.onDragging);
486
- window.addEventListener('touchmove', this.onDragging);
487
- window.addEventListener('mouseup', this.onDragEnd);
488
- window.addEventListener('touchend', this.onDragEnd);
489
- window.addEventListener('contextmenu', this.onDragEnd);
490
- },
491
- onStartButtonDown(event) {
492
- if (this.disabled) return;
493
- event.preventDefault();
494
- this.isStartMove = 'start'
495
- this.onDragStart(event);
496
- window.addEventListener('mousemove', this.onDragging);
497
- window.addEventListener('touchmove', this.onDragging);
498
- window.addEventListener('mouseup', this.onDragEnd);
499
- window.addEventListener('touchend', this.onDragEnd);
500
- window.addEventListener('contextmenu', this.onDragEnd);
501
- },
502
- onDragging(event) {
503
- if (this.dragging) {
504
- if (event.type === 'touchmove') {
505
- event.clientY = event.touches[0].clientY;
506
- event.clientX = event.touches[0].clientX;
507
- }
508
- var currentX = event.clientX;
509
- if (this.isStartMove === 'end') {
510
- let diff = (currentX - this.startMoveX) / this.length * this.range
511
- this.progress = this.startPosition + diff;
512
- if (this.progress <= 0) {
513
- this.progress = 0
514
- } else if (this.progress >= this.range) {
515
- this.progress = this.range
516
- }
517
- if (this.startProgress >= this.progress) {
518
- this.progress = this.startProgress
519
- }
520
- let progress = ((this.progress) / this.range) * 100
521
- if (progress < 0) {
522
- progress = 0
523
- } else if (progress > 100) {
524
- progress = 100
525
- }
526
- this.rangeProgress = progress
527
- } else if (this.isStartMove === 'start') {
528
- let diff = (currentX - this.sStartMoveX) / this.length * this.range
529
- this.sProgress = this.sStartPosition + diff;
530
- if (this.sProgress <= 0) {
531
- this.sProgress = 0
532
- } else if (this.sProgress >= this.rangeProgress) {
533
- this.sProgress = this.rangeProgress
534
- } else if (this.sProgress >= this.range) {
535
- this.sProgress = this.range
536
- }
537
- let progress = ((this.sProgress) / this.range) * 100
538
- if (progress < 0) {
539
- progress = 0
540
- } else if (progress > 100) {
541
- progress = 100
542
- }
543
- this.startProgress = progress
544
- }
545
- this.$emit('change', this.rangeValue)
546
- }
547
- },
548
- onDragStart(event) {
549
- this.dragging = true;
550
- if (event.type === 'touchstart') {
551
- event.clientY = event.touches[0].clientY;
552
- event.clientX = event.touches[0].clientX;
553
- }
554
- if (this.isStartMove === 'end') {
555
- this.startMoveX = event.clientX;
556
- this.startPosition = parseFloat(this.progress);
557
- } else if (this.isStartMove === 'start') {
558
- this.sStartMoveX = event.clientX;
559
- this.sStartPosition = parseFloat(this.sProgress);
560
- }
561
- },
562
- onDragEnd() {
563
- if (this.dragging) {
564
- if (this.isStartMove === 'end') {
565
- this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
566
- let progress = ((this.val) / this.range) * 100
567
- if (progress < 0) {
568
- progress = 0
569
- } else if (progress > 100) {
570
- progress = 100
571
- }
572
- if (this.startProgress >= progress) {
573
- progress = this.startProgress
574
- }
575
- this.rangeProgress = progress
576
- } else if (this.isStartMove === 'start') {
577
- this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress
578
- let progress = ((this.startVal) / this.range) * 100
579
- if (progress < 0) {
580
- progress = 0
581
- } else if (progress >= this.rangeProgress) {
582
- progress = this.rangeProgress
583
- } else if (progress > 100) {
584
- progress = 100
585
- }
586
- this.startProgress = progress
587
- }
588
-
589
- /*
590
- * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
591
- * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
592
- */
593
- this.dragging = false;
594
- let timer = null
595
- timer = setTimeout(() => {
596
- this.dragging = true;
597
- clearTimeout(timer)
598
- timer = null
599
- }, 200)
600
- window.removeEventListener('mousemove', this.onDragging);
601
- window.removeEventListener('touchmove', this.onDragging);
602
- window.removeEventListener('mouseup', this.onDragEnd);
603
- window.removeEventListener('touchend', this.onDragEnd);
604
- window.removeEventListener('contextmenu', this.onDragEnd);
605
- }
606
- },
607
- setDisabled(f) {
608
- this.disabled = f
609
- }
610
- }
611
- }
612
- </script>
1
+ <template>
2
+ <span class="to-range to-form-readonly" :style="setStyle" @touchmove="moveHandle($event)" @touchend="endHandle($event)">
3
+ <span class="to-rangeMain">
4
+ <span class="to-rangeBar" @click.stop="rangeBarClick($event)">
5
+ <span class="to-rangeProgress" :style="{width:(rangeProgress - startProgress) + '%',left: startProgress + '%'}">
6
+ <span v-if="start" ref="touchStartBar" :style="{zIndex: String(startProgress) === '100'?'100':'99'}" class="to-rangeStart" @mousedown="onStartButtonDown" @touchstart="startHandle($event)"></span>
7
+ <span ref="touchBar" class="to-rangeEnd" @mousedown="onButtonDown" @touchstart="endStartHandle($event)"></span>
8
+ </span>
9
+ </span>
10
+ <span v-if="showInput" class="to-rangeValue">
11
+ <span v-if="start" :class="setClass" class="to-input">
12
+ <to-input ref="rangeStartInput" v-model="refStartVal" type="number" mode="none" v-bind="inputProps" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputStartHandle"></to-input>
13
+ <span class="to-inputText to-inputText-narrow">~</span>
14
+ <to-input ref="rangeEndInput" v-model="refEndVal" type="number" mode="none" v-bind="inputProps" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputEndHandle"></to-input>
15
+ </span>
16
+ <!-- <to-input ref="rangeInput" v-model="refVal" v-bind="inputProps" fillet="normal" :min="min" :max="max" :clearable="false" :width="6" :readonly="readonly" @blur="inputHandle"></to-input>-->
17
+ <to-input v-else ref="rangeInput" v-model="refVal" v-bind="inputProps" type="number" :min="min" :max="max" :clearable="false" :width="6" :readonly="disabled || !inputable" @blur="inputHandle"></to-input>
18
+ </span>
19
+ </span>
20
+ </span>
21
+ </template>
22
+ <script>
23
+ export default {
24
+ name: 'ToRange',
25
+ componentName: 'ToRange',
26
+ model: {
27
+ event: 'change'
28
+ },
29
+ props: {
30
+ value: {
31
+ type: [Number, String],
32
+ default: 0
33
+ },
34
+ readonly: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ inputable: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ max: {
43
+ type: [Number, String],
44
+ default: 100
45
+ },
46
+ min: {
47
+ type: [Number, String],
48
+ default: 0
49
+ },
50
+ ruler: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ start: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ step: {
59
+ type: [String, Number],
60
+ default: 1
61
+ },
62
+ width: {
63
+ type: [Number, String],
64
+ default: ''
65
+ },
66
+ valueWidth: {
67
+ type: [Number, String],
68
+ default: 0
69
+ },
70
+ showInput: Boolean,
71
+ inputProps: {
72
+ type: Object,
73
+ default() {
74
+ return {}
75
+ }
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ disabled: this.readonly,
81
+ length: 0,
82
+ isStart: false,
83
+ progress: 0,
84
+ sProgress: 0,
85
+ dragging: true,
86
+ startX: 0,
87
+ endStartX: 0,
88
+ startMoveX: 0,
89
+ startPosition: 0,
90
+ currentX: 0,
91
+ moveX: 0,
92
+ endX: 0,
93
+ x: 0,
94
+ sx: 0,
95
+ isStartMove: 'start',
96
+ rangeProgress: 0,
97
+ sStartMoveX: 0,
98
+ sStartPosition: 0,
99
+ startProgress: 0,
100
+ startValue: 0
101
+ }
102
+ },
103
+ computed: {
104
+ val: {
105
+ get: function() {
106
+ return Math.round(this.progress / this.range * this.range) || 0
107
+ },
108
+ set: function(newVal) {
109
+ this.progress = newVal
110
+ this.x = this.length * this.progress / this.range
111
+ }
112
+ },
113
+ startVal: {
114
+ get: function() {
115
+ return Math.round(this.sProgress / this.range * this.range) || 0
116
+ },
117
+ set: function(newVal) {
118
+ this.sProgress = newVal
119
+ this.sx = this.length * this.sProgress / this.range
120
+ }
121
+ },
122
+ refVal: {
123
+ get: function() {
124
+ if (this.start) {
125
+ return (this.startVal + this.min) + ',' + (this.val + this.min)
126
+ } else {
127
+ return this.val + this.min
128
+ }
129
+ },
130
+ set: function(newVal) {
131
+ }
132
+ },
133
+ refStartVal: {
134
+ get: function() {
135
+ if (this.start) {
136
+ return (this.startVal + this.min)
137
+ } else {
138
+ return this.val + this.min
139
+ }
140
+ },
141
+ set: function(newVal) {
142
+ }
143
+ },
144
+ refEndVal: {
145
+ get: function() {
146
+ if (this.start) {
147
+ return (this.val + this.min)
148
+ } else {
149
+ return this.val + this.min
150
+ }
151
+ },
152
+ set: function(newVal) {
153
+ }
154
+ },
155
+ rangeValue: {
156
+ get: function() {
157
+ if (this.start) {
158
+ return (this.sProgress || 0).toFixed(0) + ',' + (this.progress || 0).toFixed(0)
159
+ } else {
160
+ return (this.progress || 0).toFixed(0)
161
+ }
162
+ },
163
+ set: function(newVal) {
164
+ }
165
+ },
166
+ range() {
167
+ return Number(this.max) - Number(this.min)
168
+ },
169
+ part() {
170
+ return 100 / this.range
171
+ },
172
+ setStyle() {
173
+ var obj = {};
174
+ if (this.width) {
175
+ if (!isNaN(this.width)) {
176
+ obj.width = this.width + 'em';
177
+ } else if (this.width === 'full') {
178
+ obj.width = '100%';
179
+ } else {
180
+ obj.width = this.width;
181
+ }
182
+ }
183
+ return obj;
184
+ },
185
+ setClass() {
186
+ let arr = [];
187
+ if (this.inputProps.color) {
188
+ if (this.inputProps.color !== 'radam') {
189
+ arr.push(`to-input-color-${this.inputProps.color}`);
190
+ } else {
191
+ let colors = this.inputProps.$TouchUI.colors
192
+ let number = Math.round(Math.random() * 6)
193
+ arr.push(`to-input-color-${ colors[number]}`);
194
+ }
195
+ }
196
+ if (this.inputProps.placeholderColor) {
197
+ arr.push(`to-input-placeholder-color-${this.inputProps.placeholderColor}`);
198
+ }
199
+ if (this.inputProps.fillet !== 'none') {
200
+ arr.push(`to-input-fillet-${this.inputProps.fillet}`);
201
+ }
202
+ if (this.inputProps.filletPosition) {
203
+ arr.push(`to-input-fillet-position-${this.filletPosition}`);
204
+ }
205
+ if (this.inputProps.mode) {
206
+ arr.push(`to-input-mode-${this.inputProps.mode}`);
207
+ } else if (this.ToForm && this.ToForm.type === 'list') {
208
+ arr.push('to-input-mode-none')
209
+ } else {
210
+ arr.push('to-input-mode-default');
211
+ }
212
+ if (this.inputProps.stepIconMode === 'arrow') {
213
+ arr.push(`to-input-step-icon-mode-${this.inputProps.stepIconMode}`);
214
+ }
215
+ if (this.inputProps.readonly) {
216
+ arr.push('to-input-state-readonly');
217
+ }
218
+ if (this.inputProps.focused && !this.inputProps.preventFocus) {
219
+ arr.push('to-input-state-focus');
220
+ }
221
+ if (this.inputProps.changed) {
222
+ arr.push('to-input-changed')
223
+ }
224
+ if ((this.ToForm && this.ToForm.comparable) || this.inputProps.comparable) {
225
+ arr.push('to-compare')
226
+ }
227
+ return arr;
228
+ }
229
+ },
230
+ watch: {
231
+ readonly(val) {
232
+ this.disabled = val
233
+ },
234
+ value(val) {
235
+ if (this.start) {
236
+ if (val && String(val).split(',').length > 1) {
237
+ let value = val.split(',')
238
+ if (Number(value[0]) >= this.range) {
239
+ this.startVal = this.range
240
+ } else {
241
+ this.startVal = Number(value[0])
242
+ }
243
+ if (Number(value[1]) >= this.range) {
244
+ this.val = this.range
245
+ } else {
246
+ this.val = Number(value[1])
247
+ }
248
+ }
249
+ } else {
250
+ if (Number(val) >= this.range) {
251
+ this.val = this.range
252
+ } else {
253
+ this.val = Number(val)
254
+ }
255
+ }
256
+ this.initRangeVal()
257
+ }
258
+ },
259
+ mounted() {
260
+ // 这里注意range的value改变不会触发视图刷新
261
+ this.$nextTick(()=>{
262
+ this.length = this.$el.querySelector('.to-rangeBar').offsetWidth
263
+ this.initRangeVal()
264
+ })
265
+ },
266
+ methods: {
267
+ initRangeVal() {
268
+ if (this.start) {
269
+ if (this.value) {
270
+ let value = this.value.split(',')
271
+ this.startVal = Number(value[0]) < 0 ? 0 : (Number(value[0]) / this.range * this.range) - this.min || 0
272
+ this.val = Number(value[1]) < 0 ? 0 : (Number(value[1]) / this.range * this.range) - this.min || 0
273
+ } else {
274
+ this.startVal = 0
275
+ this.val = 0
276
+ }
277
+ this.startProgress = ((this.startVal) / this.range) * 100
278
+ this.rangeProgress = ((this.val) / this.range) * 100
279
+ } else {
280
+ this.val = Number(this.value) < 0 ? 0 : (Number(this.value) / this.range * this.range) - this.min || 0
281
+ this.rangeProgress = ((this.val) / this.range) * 100
282
+ }
283
+ },
284
+ rangeBarClick(e) {
285
+ if (this.disabled) return
286
+ if (this.dragging) {
287
+ let leftX = e.offsetX
288
+ this.x = e.clientX - leftX
289
+ if (this.start) {
290
+ let startLeft = this.startProgress / this.range * this.length
291
+ let endLeft = this.rangeProgress / this.range * this.length
292
+ let startLeftAbs = Math.abs(startLeft - leftX)
293
+ let endLeftAbs = Math.abs(endLeft - leftX)
294
+ if (startLeftAbs >= endLeftAbs) {
295
+ this.progress = leftX / this.length * this.range
296
+ this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
297
+ if (this.progress <= 0) {
298
+ this.progress = 0
299
+ } else if (this.progress >= this.max) {
300
+ this.progress = this.max
301
+ }
302
+ let progress = ((this.val) / this.range) * 100
303
+ if (progress < 0) {
304
+ progress = 0
305
+ } else if (progress > 100) {
306
+ progress = 100
307
+ }
308
+ this.rangeProgress = progress
309
+ } else {
310
+ this.sProgress = leftX / this.length * this.range
311
+ this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress
312
+ if (this.sProgress <= 0) {
313
+ this.sProgress = 0
314
+ } else if (this.sProgress >= this.max) {
315
+ this.sProgress = this.max
316
+ }
317
+ let progress = ((this.startVal) / this.range) * 100
318
+ if (progress < 0) {
319
+ progress = 0
320
+ } else if (progress > 100) {
321
+ progress = 100
322
+ }
323
+ this.startProgress = progress
324
+ }
325
+ } else {
326
+ this.progress = leftX / this.length * this.range
327
+ this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
328
+ if (this.progress <= 0) {
329
+ this.progress = 0
330
+ } else if (this.progress >= this.max) {
331
+ this.progress = this.max
332
+ }
333
+ }
334
+ this.$emit('change', this.rangeValue)
335
+ }
336
+ },
337
+ startHandle: function(e) {
338
+ if (this.disabled) return
339
+ this.isStart = true
340
+ this.isStartMove = 'start'
341
+ if (this.isStart) { this.startX = e.touches[0].clientX }
342
+ },
343
+ endStartHandle: function(e) {
344
+ if (this.disabled) return
345
+ this.isStart = true
346
+ this.isStartMove = 'end'
347
+ if (this.isStart) { this.endStartX = e.touches[0].clientX }
348
+ },
349
+ moveHandle: function(e) {
350
+ if (this.disabled) return
351
+ if (this.isStart) {
352
+ this.moveX = e.touches[0].clientX
353
+ if (this.isStartMove === 'end') {
354
+ this.progress = (this.x + this.moveX - this.endStartX) / this.length * this.range
355
+ if (this.progress <= 0) {
356
+ this.progress = 0
357
+ } else if (this.progress >= this.range) {
358
+ this.progress = this.range
359
+ }
360
+ let progress = ((this.progress) / this.range) * 100
361
+ if (progress < 0) {
362
+ progress = 0
363
+ } else if (progress > 100) {
364
+ progress = 100
365
+ }
366
+ this.rangeProgress = progress
367
+ } else if (this.isStartMove === 'start') {
368
+ this.sProgress = (this.sx + this.moveX - this.startX) / this.length * this.range
369
+ if (this.sProgress <= 0) {
370
+ this.sProgress = 0
371
+ } else if (this.sProgress >= this.range) {
372
+ this.sProgress = this.range
373
+ }
374
+ let progress = ((this.sProgress) / this.range) * 100
375
+ if (progress < 0) {
376
+ progress = 0
377
+ } else if (progress > 100) {
378
+ progress = 100
379
+ }
380
+ this.startProgress = progress
381
+ }
382
+ }
383
+ },
384
+ endHandle: function(e) {
385
+ if (this.disabled) return
386
+ if (this.isStart) {
387
+ if (this.isStartMove === 'end') {
388
+ this.x += this.moveX - this.startX
389
+ if (this.progress <= 0) {
390
+ this.x = 0
391
+ } else if (this.progress >= this.range) {
392
+ this.x = this.length
393
+ }
394
+ } else if (this.isStartMove === 'start') {
395
+ this.sx += this.moveX - this.endStartX
396
+ if (this.sProgress <= 0) {
397
+ this.sx = 0
398
+ } else if (this.sProgress >= this.range) {
399
+ this.sx = this.length
400
+ }
401
+ }
402
+ this.isStart = false
403
+ }
404
+ this.$emit('change', this.rangeValue)
405
+ },
406
+ inputStartHandle(e) {
407
+ const startVal = e.target.value
408
+ this.sProgress = startVal
409
+ this.startVal = (Number(startVal) / this.range * this.range) - this.min || 0
410
+ const that = this
411
+ let timer = null
412
+ timer = setTimeout(function() {
413
+ if (startVal < 0) {
414
+ that.sProgress = 0
415
+ that.startVal = 0
416
+ }
417
+ if (startVal > that.range) {
418
+ that.sProgress = that.range
419
+ that.startVal = that.range
420
+ }
421
+ that.startProgress = ((that.startVal) / that.range) * 100
422
+ that.$emit('change', that.rangeValue)
423
+ clearTimeout(timer)
424
+ timer = null
425
+ }, 0)
426
+ },
427
+ inputEndHandle(e) {
428
+ const endVal = e.target.value
429
+ this.progress = endVal
430
+ this.val = (Number(endVal) / this.range * this.range) - this.min || 0
431
+ this.startProgress = ((this.startVal) / this.range) * 100
432
+ this.rangeProgress = ((this.val) / this.range) * 100
433
+ const that = this
434
+ let timer = null
435
+ timer = setTimeout(function() {
436
+ if (endVal < 0) {
437
+ that.progress = 0
438
+ that.val = 0
439
+ }
440
+ if (endVal > that.range) {
441
+ that.progress = that.range
442
+ that.val = that.range
443
+ }
444
+ that.rangeProgress = ((that.val) / that.range) * 100
445
+ that.$emit('change', that.rangeValue)
446
+ clearTimeout(timer)
447
+ timer = null
448
+ }, 0)
449
+ },
450
+ inputHandle(e) {
451
+ if (!this.start) {
452
+ this.progress = e.target.value
453
+ if (Number(e.target.value) < 0) {
454
+ this.progress = 0
455
+ } else if (Number(e.target.value) > 100) {
456
+ this.progress = 100
457
+ }
458
+ this.val = Number(e.target.value) < 0 ? 0 : (Number(e.target.value) / this.range * this.range) - this.min || 0
459
+ this.rangeProgress = ((this.val) / this.range) * 100
460
+ const that = this
461
+ let timer = null
462
+ timer = setTimeout(function() {
463
+ if (e.target.value < 0) {
464
+ that.progress = 0
465
+ that.val = 0
466
+ }
467
+ if (e.target.value > that.range) {
468
+ that.progress = that.range
469
+ that.val = that.range
470
+ }
471
+ that.rangeProgress = ((that.val) / that.range) * 100
472
+ // that.value = that.rangeProgress
473
+ that.$emit('change', that.rangeValue)
474
+ clearTimeout(timer)
475
+ timer = null
476
+ }, 0)
477
+ }
478
+ },
479
+
480
+ onButtonDown(event) {
481
+ if (this.disabled) return;
482
+ event.preventDefault();
483
+ this.isStartMove = 'end'
484
+ this.onDragStart(event);
485
+ window.addEventListener('mousemove', this.onDragging);
486
+ window.addEventListener('touchmove', this.onDragging);
487
+ window.addEventListener('mouseup', this.onDragEnd);
488
+ window.addEventListener('touchend', this.onDragEnd);
489
+ window.addEventListener('contextmenu', this.onDragEnd);
490
+ },
491
+ onStartButtonDown(event) {
492
+ if (this.disabled) return;
493
+ event.preventDefault();
494
+ this.isStartMove = 'start'
495
+ this.onDragStart(event);
496
+ window.addEventListener('mousemove', this.onDragging);
497
+ window.addEventListener('touchmove', this.onDragging);
498
+ window.addEventListener('mouseup', this.onDragEnd);
499
+ window.addEventListener('touchend', this.onDragEnd);
500
+ window.addEventListener('contextmenu', this.onDragEnd);
501
+ },
502
+ onDragging(event) {
503
+ if (this.dragging) {
504
+ if (event.type === 'touchmove') {
505
+ event.clientY = event.touches[0].clientY;
506
+ event.clientX = event.touches[0].clientX;
507
+ }
508
+ var currentX = event.clientX;
509
+ if (this.isStartMove === 'end') {
510
+ let diff = (currentX - this.startMoveX) / this.length * this.range
511
+ this.progress = this.startPosition + diff;
512
+ if (this.progress <= 0) {
513
+ this.progress = 0
514
+ } else if (this.progress >= this.range) {
515
+ this.progress = this.range
516
+ }
517
+ if (this.startProgress >= this.progress) {
518
+ this.progress = this.startProgress
519
+ }
520
+ let progress = ((this.progress) / this.range) * 100
521
+ if (progress < 0) {
522
+ progress = 0
523
+ } else if (progress > 100) {
524
+ progress = 100
525
+ }
526
+ this.rangeProgress = progress
527
+ } else if (this.isStartMove === 'start') {
528
+ let diff = (currentX - this.sStartMoveX) / this.length * this.range
529
+ this.sProgress = this.sStartPosition + diff;
530
+ if (this.sProgress <= 0) {
531
+ this.sProgress = 0
532
+ } else if (this.sProgress >= this.rangeProgress) {
533
+ this.sProgress = this.rangeProgress
534
+ } else if (this.sProgress >= this.range) {
535
+ this.sProgress = this.range
536
+ }
537
+ let progress = ((this.sProgress) / this.range) * 100
538
+ if (progress < 0) {
539
+ progress = 0
540
+ } else if (progress > 100) {
541
+ progress = 100
542
+ }
543
+ this.startProgress = progress
544
+ }
545
+ this.$emit('change', this.rangeValue)
546
+ }
547
+ },
548
+ onDragStart(event) {
549
+ this.dragging = true;
550
+ if (event.type === 'touchstart') {
551
+ event.clientY = event.touches[0].clientY;
552
+ event.clientX = event.touches[0].clientX;
553
+ }
554
+ if (this.isStartMove === 'end') {
555
+ this.startMoveX = event.clientX;
556
+ this.startPosition = parseFloat(this.progress);
557
+ } else if (this.isStartMove === 'start') {
558
+ this.sStartMoveX = event.clientX;
559
+ this.sStartPosition = parseFloat(this.sProgress);
560
+ }
561
+ },
562
+ onDragEnd() {
563
+ if (this.dragging) {
564
+ if (this.isStartMove === 'end') {
565
+ this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress
566
+ let progress = ((this.val) / this.range) * 100
567
+ if (progress < 0) {
568
+ progress = 0
569
+ } else if (progress > 100) {
570
+ progress = 100
571
+ }
572
+ if (this.startProgress >= progress) {
573
+ progress = this.startProgress
574
+ }
575
+ this.rangeProgress = progress
576
+ } else if (this.isStartMove === 'start') {
577
+ this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress
578
+ let progress = ((this.startVal) / this.range) * 100
579
+ if (progress < 0) {
580
+ progress = 0
581
+ } else if (progress >= this.rangeProgress) {
582
+ progress = this.rangeProgress
583
+ } else if (progress > 100) {
584
+ progress = 100
585
+ }
586
+ this.startProgress = progress
587
+ }
588
+
589
+ /*
590
+ * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
591
+ * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
592
+ */
593
+ this.dragging = false;
594
+ let timer = null
595
+ timer = setTimeout(() => {
596
+ this.dragging = true;
597
+ clearTimeout(timer)
598
+ timer = null
599
+ }, 200)
600
+ window.removeEventListener('mousemove', this.onDragging);
601
+ window.removeEventListener('touchmove', this.onDragging);
602
+ window.removeEventListener('mouseup', this.onDragEnd);
603
+ window.removeEventListener('touchend', this.onDragEnd);
604
+ window.removeEventListener('contextmenu', this.onDragEnd);
605
+ }
606
+ },
607
+ setDisabled(f) {
608
+ this.disabled = f
609
+ }
610
+ }
611
+ }
612
+ </script>