misp-ui-library-test 0.0.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 (373) hide show
  1. package/README.md +113 -0
  2. package/dist/theme-chalk/alert/index.scss +152 -0
  3. package/dist/theme-chalk/avatar/index.scss +51 -0
  4. package/dist/theme-chalk/backtop/index.scss +38 -0
  5. package/dist/theme-chalk/badge/index.scss +63 -0
  6. package/dist/theme-chalk/breadcrumb/index.scss +36 -0
  7. package/dist/theme-chalk/breadcrumb-item/index.scss +36 -0
  8. package/dist/theme-chalk/button/index.scss +157 -0
  9. package/dist/theme-chalk/card/index.scss +38 -0
  10. package/dist/theme-chalk/chart/index.scss +21 -0
  11. package/dist/theme-chalk/checkbox/index.scss +358 -0
  12. package/dist/theme-chalk/col/index.scss +131 -0
  13. package/dist/theme-chalk/container/index.scss +40 -0
  14. package/dist/theme-chalk/css/alert.css +484 -0
  15. package/dist/theme-chalk/css/avatar.css +409 -0
  16. package/dist/theme-chalk/css/backtop.css +401 -0
  17. package/dist/theme-chalk/css/badge.css +419 -0
  18. package/dist/theme-chalk/css/breadcrumb-item.css +395 -0
  19. package/dist/theme-chalk/css/breadcrumb.css +395 -0
  20. package/dist/theme-chalk/css/button.css +587 -0
  21. package/dist/theme-chalk/css/card.css +397 -0
  22. package/dist/theme-chalk/css/chart.css +386 -0
  23. package/dist/theme-chalk/css/checkbox.css +648 -0
  24. package/dist/theme-chalk/css/col.css +2111 -0
  25. package/dist/theme-chalk/css/container.css +404 -0
  26. package/dist/theme-chalk/css/dialog.css +505 -0
  27. package/dist/theme-chalk/css/divider.css +405 -0
  28. package/dist/theme-chalk/css/drawer.css +546 -0
  29. package/dist/theme-chalk/css/empty.css +394 -0
  30. package/dist/theme-chalk/css/form.css +561 -0
  31. package/dist/theme-chalk/css/icon.css +1534 -0
  32. package/dist/theme-chalk/css/image.css +400 -0
  33. package/dist/theme-chalk/css/input-number.css +424 -0
  34. package/dist/theme-chalk/css/input.css +721 -0
  35. package/dist/theme-chalk/css/link.css +424 -0
  36. package/dist/theme-chalk/css/loading.css +483 -0
  37. package/dist/theme-chalk/css/message-box.css +479 -0
  38. package/dist/theme-chalk/css/message.css +456 -0
  39. package/dist/theme-chalk/css/no-data.css +397 -0
  40. package/dist/theme-chalk/css/notification.css +431 -0
  41. package/dist/theme-chalk/css/page-header.css +396 -0
  42. package/dist/theme-chalk/css/pagination.css +565 -0
  43. package/dist/theme-chalk/css/popover.css +421 -0
  44. package/dist/theme-chalk/css/popper.css +454 -0
  45. package/dist/theme-chalk/css/progress.css +451 -0
  46. package/dist/theme-chalk/css/radio.css +626 -0
  47. package/dist/theme-chalk/css/rate.css +414 -0
  48. package/dist/theme-chalk/css/result.css +403 -0
  49. package/dist/theme-chalk/css/row.css +433 -0
  50. package/dist/theme-chalk/css/scrollbar.css +422 -0
  51. package/dist/theme-chalk/css/select.css +1897 -0
  52. package/dist/theme-chalk/css/skeleton-item.css +407 -0
  53. package/dist/theme-chalk/css/skeleton.css +390 -0
  54. package/dist/theme-chalk/css/slider.css +460 -0
  55. package/dist/theme-chalk/css/spinner.css +403 -0
  56. package/dist/theme-chalk/css/statistic.css +396 -0
  57. package/dist/theme-chalk/css/status-timeline-chart.css +388 -0
  58. package/dist/theme-chalk/css/step.css +496 -0
  59. package/dist/theme-chalk/css/steps.css +496 -0
  60. package/dist/theme-chalk/css/switch.css +507 -0
  61. package/dist/theme-chalk/css/tab-pane.css +457 -0
  62. package/dist/theme-chalk/css/table.css +461 -0
  63. package/dist/theme-chalk/css/tabs-navigation.css +925 -0
  64. package/dist/theme-chalk/css/tabs.css +457 -0
  65. package/dist/theme-chalk/css/tag.css +599 -0
  66. package/dist/theme-chalk/css/time-picker.css +683 -0
  67. package/dist/theme-chalk/css/timeline-item.css +459 -0
  68. package/dist/theme-chalk/css/timeline.css +459 -0
  69. package/dist/theme-chalk/css/tooltip.css +485 -0
  70. package/dist/theme-chalk/css/tree.css +473 -0
  71. package/dist/theme-chalk/css/upload.css +665 -0
  72. package/dist/theme-chalk/dialog/index.scss +168 -0
  73. package/dist/theme-chalk/divider/index.scss +46 -0
  74. package/dist/theme-chalk/drawer/index.scss +172 -0
  75. package/dist/theme-chalk/empty/index.scss +36 -0
  76. package/dist/theme-chalk/fonts/element-icons.ttf +0 -0
  77. package/dist/theme-chalk/fonts/element-icons.woff +0 -0
  78. package/dist/theme-chalk/form/index.scss +220 -0
  79. package/dist/theme-chalk/icon/index.scss +1171 -0
  80. package/dist/theme-chalk/image/index.scss +39 -0
  81. package/dist/theme-chalk/index.scss +127 -0
  82. package/dist/theme-chalk/input/index.scss +363 -0
  83. package/dist/theme-chalk/input-number/index.scss +71 -0
  84. package/dist/theme-chalk/link/index.scss +75 -0
  85. package/dist/theme-chalk/loading/index.scss +131 -0
  86. package/dist/theme-chalk/message/index.scss +100 -0
  87. package/dist/theme-chalk/message-box/index.scss +131 -0
  88. package/dist/theme-chalk/mixins.scss +203 -0
  89. package/dist/theme-chalk/no-data/index.scss +36 -0
  90. package/dist/theme-chalk/notification/index.scss +76 -0
  91. package/dist/theme-chalk/page-header/index.scss +36 -0
  92. package/dist/theme-chalk/pagination/index.scss +225 -0
  93. package/dist/theme-chalk/popover/index.scss +56 -0
  94. package/dist/theme-chalk/popper/index.scss +89 -0
  95. package/dist/theme-chalk/progress/index.scss +105 -0
  96. package/dist/theme-chalk/radio/index.scss +328 -0
  97. package/dist/theme-chalk/rate/index.scss +56 -0
  98. package/dist/theme-chalk/reset.scss +262 -0
  99. package/dist/theme-chalk/result/index.scss +46 -0
  100. package/dist/theme-chalk/row/index.scss +88 -0
  101. package/dist/theme-chalk/scrollbar/index.scss +67 -0
  102. package/dist/theme-chalk/select/index.scss +223 -0
  103. package/dist/theme-chalk/skeleton/index.scss +30 -0
  104. package/dist/theme-chalk/skeleton-item/index.scss +49 -0
  105. package/dist/theme-chalk/slider/index.scss +113 -0
  106. package/dist/theme-chalk/spinner/index.scss +40 -0
  107. package/dist/theme-chalk/statistic/index.scss +38 -0
  108. package/dist/theme-chalk/status-timeline-chart/index.scss +23 -0
  109. package/dist/theme-chalk/step/index.scss +160 -0
  110. package/dist/theme-chalk/steps/index.scss +160 -0
  111. package/dist/theme-chalk/switch/index.scss +153 -0
  112. package/dist/theme-chalk/tab-pane/index.scss +112 -0
  113. package/dist/theme-chalk/table/index.scss +110 -0
  114. package/dist/theme-chalk/tabs/index.scss +112 -0
  115. package/dist/theme-chalk/tabs-navigation/index.scss +631 -0
  116. package/dist/theme-chalk/tag/index.scss +138 -0
  117. package/dist/theme-chalk/themes/blue.scss +76 -0
  118. package/dist/theme-chalk/themes/dark.scss +99 -0
  119. package/dist/theme-chalk/themes/index.scss +260 -0
  120. package/dist/theme-chalk/themes/light.scss +99 -0
  121. package/dist/theme-chalk/time-picker/index.scss +332 -0
  122. package/dist/theme-chalk/timeline/index.scss +119 -0
  123. package/dist/theme-chalk/timeline-item/index.scss +119 -0
  124. package/dist/theme-chalk/tooltip/index.scss +122 -0
  125. package/dist/theme-chalk/tree/index.scss +125 -0
  126. package/dist/theme-chalk/upload/index.scss +348 -0
  127. package/dist/theme-chalk/variables.scss +93 -0
  128. package/dist/vue2-ui-library.cjs.temp.js.map +1 -0
  129. package/dist/vue2-ui-library.common.js +28 -0
  130. package/dist/vue2-ui-library.common.js.map +1 -0
  131. package/dist/vue2-ui-library.esm.js +29 -0
  132. package/dist/vue2-ui-library.umd.js +27 -0
  133. package/package.json +161 -0
  134. package/src/directives/clickoutside/index.js +111 -0
  135. package/src/directives/init/index.js +50 -0
  136. package/src/directives/resize/index.js +69 -0
  137. package/src/index.js +174 -0
  138. package/src/mixins/emitter.js +47 -0
  139. package/src/mixins/focus.js +42 -0
  140. package/src/mixins/locale.js +24 -0
  141. package/src/mixins/migrating.js +46 -0
  142. package/src/packages/alert/index.js +12 -0
  143. package/src/packages/alert/src/main.vue +98 -0
  144. package/src/packages/aside/index.js +12 -0
  145. package/src/packages/aside/src/main.vue +20 -0
  146. package/src/packages/auto-grid-layout/index.js +18 -0
  147. package/src/packages/auto-grid-layout/prop.js +92 -0
  148. package/src/packages/auto-grid-layout/src/components/GridItem.vue +759 -0
  149. package/src/packages/auto-grid-layout/src/components/GridLayout.vue +367 -0
  150. package/src/packages/auto-grid-layout/src/main.vue +287 -0
  151. package/src/packages/auto-grid-layout/src/utils/DOM.js +46 -0
  152. package/src/packages/auto-grid-layout/src/utils/interact.js +333 -0
  153. package/src/packages/auto-grid-layout/src/utils/responsiveUtils.js +75 -0
  154. package/src/packages/auto-grid-layout/src/utils/utils.js +339 -0
  155. package/src/packages/autocomplete/index.js +12 -0
  156. package/src/packages/autocomplete/src/main.vue +170 -0
  157. package/src/packages/avatar/index.js +12 -0
  158. package/src/packages/avatar/src/main.vue +87 -0
  159. package/src/packages/backtop/index.js +12 -0
  160. package/src/packages/backtop/src/main.vue +120 -0
  161. package/src/packages/badge/index.js +12 -0
  162. package/src/packages/badge/src/main.vue +53 -0
  163. package/src/packages/breadcrumb/index.js +12 -0
  164. package/src/packages/breadcrumb/src/main.vue +34 -0
  165. package/src/packages/breadcrumb-item/index.js +12 -0
  166. package/src/packages/breadcrumb-item/src/main.vue +41 -0
  167. package/src/packages/button/index.js +13 -0
  168. package/src/packages/button/src/main.vue +106 -0
  169. package/src/packages/calendar/index.js +12 -0
  170. package/src/packages/calendar/src/main.vue +173 -0
  171. package/src/packages/card/index.js +12 -0
  172. package/src/packages/card/src/main.vue +26 -0
  173. package/src/packages/carousel/index.js +12 -0
  174. package/src/packages/carousel/src/main.vue +186 -0
  175. package/src/packages/carousel-item/index.js +12 -0
  176. package/src/packages/carousel-item/src/main.vue +34 -0
  177. package/src/packages/cascader/index.js +12 -0
  178. package/src/packages/cascader/src/main.vue +232 -0
  179. package/src/packages/chart/index.js +7 -0
  180. package/src/packages/chart/src/axis-chart.js +700 -0
  181. package/src/packages/chart/src/main.vue +828 -0
  182. package/src/packages/chart/src/utils.js +21 -0
  183. package/src/packages/checkbox/index.js +44 -0
  184. package/src/packages/checkbox/src/main.vue +312 -0
  185. package/src/packages/col/index.js +12 -0
  186. package/src/packages/col/src/main.vue +85 -0
  187. package/src/packages/collapse/index.js +12 -0
  188. package/src/packages/collapse/src/main.vue +69 -0
  189. package/src/packages/collapse-item/index.js +12 -0
  190. package/src/packages/collapse-item/src/main.vue +75 -0
  191. package/src/packages/color-picker/index.js +12 -0
  192. package/src/packages/color-picker/src/main.vue +206 -0
  193. package/src/packages/container/index.js +12 -0
  194. package/src/packages/container/src/main.vue +33 -0
  195. package/src/packages/date-picker/index.js +12 -0
  196. package/src/packages/date-picker/src/main.vue +246 -0
  197. package/src/packages/descriptions/index.js +12 -0
  198. package/src/packages/descriptions/src/main.vue +89 -0
  199. package/src/packages/descriptions-item/index.js +12 -0
  200. package/src/packages/descriptions-item/src/main.vue +26 -0
  201. package/src/packages/dialog/index.js +12 -0
  202. package/src/packages/dialog/src/main.vue +336 -0
  203. package/src/packages/divider/index.js +12 -0
  204. package/src/packages/divider/src/main.vue +37 -0
  205. package/src/packages/drawer/index.js +7 -0
  206. package/src/packages/drawer/src/main.vue +310 -0
  207. package/src/packages/dropdown/index.js +12 -0
  208. package/src/packages/dropdown/src/main.vue +82 -0
  209. package/src/packages/dropdown-menu-item/index.js +12 -0
  210. package/src/packages/dropdown-menu-item/src/main.vue +29 -0
  211. package/src/packages/empty/index.js +12 -0
  212. package/src/packages/empty/src/img-empty.vue +12 -0
  213. package/src/packages/empty/src/main.vue +49 -0
  214. package/src/packages/footer/index.js +12 -0
  215. package/src/packages/footer/src/main.vue +20 -0
  216. package/src/packages/form/index.js +13 -0
  217. package/src/packages/form/src/form-field.vue +790 -0
  218. package/src/packages/form/src/form-item.vue +464 -0
  219. package/src/packages/form/src/label-wrap.vue +127 -0
  220. package/src/packages/form/src/main.vue +442 -0
  221. package/src/packages/form-item/index.js +11 -0
  222. package/src/packages/header/index.js +12 -0
  223. package/src/packages/header/src/main.vue +20 -0
  224. package/src/packages/icon/index.js +12 -0
  225. package/src/packages/icon/src/main.vue +48 -0
  226. package/src/packages/image/index.js +12 -0
  227. package/src/packages/image/src/main.vue +224 -0
  228. package/src/packages/input/index.js +13 -0
  229. package/src/packages/input/src/calcTextareaHeight.js +123 -0
  230. package/src/packages/input/src/main.vue +510 -0
  231. package/src/packages/input-number/index.js +12 -0
  232. package/src/packages/input-number/src/main.vue +121 -0
  233. package/src/packages/link/index.js +12 -0
  234. package/src/packages/link/src/main.vue +53 -0
  235. package/src/packages/loading/index.js +17 -0
  236. package/src/packages/loading/src/directive.js +54 -0
  237. package/src/packages/loading/src/main.vue +38 -0
  238. package/src/packages/loading/src/service.js +63 -0
  239. package/src/packages/main/index.js +12 -0
  240. package/src/packages/main/src/main.vue +12 -0
  241. package/src/packages/menu/index.js +12 -0
  242. package/src/packages/menu/src/main.vue +117 -0
  243. package/src/packages/menu-item/index.js +12 -0
  244. package/src/packages/menu-item/src/main.vue +61 -0
  245. package/src/packages/message/index.js +95 -0
  246. package/src/packages/message/src/main.vue +131 -0
  247. package/src/packages/message-box/index.js +75 -0
  248. package/src/packages/message-box/src/main.vue +207 -0
  249. package/src/packages/no-data/index.js +8 -0
  250. package/src/packages/no-data/src/main.vue +23 -0
  251. package/src/packages/notification/index.js +72 -0
  252. package/src/packages/notification/src/main.vue +139 -0
  253. package/src/packages/option/index.js +13 -0
  254. package/src/packages/page-header/index.js +12 -0
  255. package/src/packages/page-header/src/main.vue +27 -0
  256. package/src/packages/pagination/index.js +12 -0
  257. package/src/packages/pagination/src/main.vue +255 -0
  258. package/src/packages/popconfirm/index.js +12 -0
  259. package/src/packages/popconfirm/src/main.vue +89 -0
  260. package/src/packages/popover/index.js +12 -0
  261. package/src/packages/popover/src/main.vue +452 -0
  262. package/src/packages/progress/index.js +12 -0
  263. package/src/packages/progress/src/main.vue +236 -0
  264. package/src/packages/radio/index.js +44 -0
  265. package/src/packages/radio/src/main.vue +291 -0
  266. package/src/packages/rate/index.js +12 -0
  267. package/src/packages/rate/src/main.vue +129 -0
  268. package/src/packages/result/index.js +12 -0
  269. package/src/packages/result/src/main.vue +52 -0
  270. package/src/packages/row/index.js +12 -0
  271. package/src/packages/row/src/main.vue +57 -0
  272. package/src/packages/scrollbar/index.js +12 -0
  273. package/src/packages/scrollbar/src/bar.vue +116 -0
  274. package/src/packages/scrollbar/src/main.vue +124 -0
  275. package/src/packages/select/index.js +15 -0
  276. package/src/packages/select/src/clickoutside.js +20 -0
  277. package/src/packages/select/src/main.vue +1055 -0
  278. package/src/packages/select/src/navigation-mixin.js +49 -0
  279. package/src/packages/select/src/option.vue +249 -0
  280. package/src/packages/select/src/select-dropdown.vue +95 -0
  281. package/src/packages/select/src/utils.js +5 -0
  282. package/src/packages/skeleton/index.js +12 -0
  283. package/src/packages/skeleton/src/main.vue +76 -0
  284. package/src/packages/skeleton-item/index.js +12 -0
  285. package/src/packages/skeleton-item/src/img-placeholder.vue +13 -0
  286. package/src/packages/skeleton-item/src/main.vue +22 -0
  287. package/src/packages/slider/index.js +12 -0
  288. package/src/packages/slider/src/main.vue +176 -0
  289. package/src/packages/spinner/index.js +12 -0
  290. package/src/packages/spinner/src/main.vue +27 -0
  291. package/src/packages/statistic/index.js +12 -0
  292. package/src/packages/statistic/src/main.vue +100 -0
  293. package/src/packages/status-timeline-chart/index.js +7 -0
  294. package/src/packages/status-timeline-chart/src/constants.js +20 -0
  295. package/src/packages/status-timeline-chart/src/main.vue +499 -0
  296. package/src/packages/status-timeline-chart/src/option-builder.js +475 -0
  297. package/src/packages/step/index.js +12 -0
  298. package/src/packages/step/src/main.vue +183 -0
  299. package/src/packages/steps/index.js +12 -0
  300. package/src/packages/steps/src/main.vue +57 -0
  301. package/src/packages/submenu/index.js +12 -0
  302. package/src/packages/submenu/src/main.vue +68 -0
  303. package/src/packages/switch/index.js +12 -0
  304. package/src/packages/switch/src/main.vue +166 -0
  305. package/src/packages/tab-pane/index.js +12 -0
  306. package/src/packages/tab-pane/src/main.vue +74 -0
  307. package/src/packages/table/index.js +8 -0
  308. package/src/packages/table/src/components/PagePagination.vue +82 -0
  309. package/src/packages/table/src/main.vue +153 -0
  310. package/src/packages/tabs/index.js +12 -0
  311. package/src/packages/tabs/src/main.vue +167 -0
  312. package/src/packages/tabs-navigation/index.js +7 -0
  313. package/src/packages/tabs-navigation/src/main.vue +462 -0
  314. package/src/packages/tag/index.js +12 -0
  315. package/src/packages/tag/src/main.vue +194 -0
  316. package/src/packages/time-picker/index.js +17 -0
  317. package/src/packages/time-picker/src/date-utils.js +455 -0
  318. package/src/packages/time-picker/src/main.vue +321 -0
  319. package/src/packages/time-picker/src/pane/date-range.vue +193 -0
  320. package/src/packages/time-picker/src/pane/date-time-range.vue +362 -0
  321. package/src/packages/time-picker/src/pane/date-time.vue +362 -0
  322. package/src/packages/time-picker/src/pane/date.vue +441 -0
  323. package/src/packages/time-picker/src/pane/time.vue +260 -0
  324. package/src/packages/time-picker/src/time-input.vue +203 -0
  325. package/src/packages/time-picker/src/time-range-input.vue +170 -0
  326. package/src/packages/timeline/index.js +12 -0
  327. package/src/packages/timeline/src/main.vue +24 -0
  328. package/src/packages/timeline-item/index.js +12 -0
  329. package/src/packages/timeline-item/src/main.vue +78 -0
  330. package/src/packages/tooltip/index.js +12 -0
  331. package/src/packages/tooltip/src/main.js +367 -0
  332. package/src/packages/transfer/index.js +8 -0
  333. package/src/packages/transfer/src/main.vue +229 -0
  334. package/src/packages/transfer/src/transfer-panel.vue +245 -0
  335. package/src/packages/transitions/collapse-transition.js +75 -0
  336. package/src/packages/tree/index.js +12 -0
  337. package/src/packages/tree/src/main.vue +322 -0
  338. package/src/packages/tree/src/model/node.js +348 -0
  339. package/src/packages/tree/src/model/tree-store.js +354 -0
  340. package/src/packages/tree/src/model/util.js +10 -0
  341. package/src/packages/tree/src/tree-node.vue +262 -0
  342. package/src/packages/upload/index.js +9 -0
  343. package/src/packages/upload/src/main.vue +415 -0
  344. package/src/playground/mixins/element.js +98 -0
  345. package/src/playground/types/element.js +197 -0
  346. package/src/playground/types/layout.js +80 -0
  347. package/src/plugins/i18n.js +125 -0
  348. package/src/styles/fonts/element-icons.ttf +0 -0
  349. package/src/styles/fonts/element-icons.woff +0 -0
  350. package/src/styles/index.scss +138 -0
  351. package/src/styles/reset.scss +257 -0
  352. package/src/styles/themes/blue.scss +75 -0
  353. package/src/styles/themes/dark.scss +98 -0
  354. package/src/styles/themes/index.scss +34 -0
  355. package/src/styles/themes/light.scss +98 -0
  356. package/src/styles/themes/variables.scss +233 -0
  357. package/src/styles/variables.scss +146 -0
  358. package/src/utils/async-validator/index.js +659 -0
  359. package/src/utils/browser/index.js +39 -0
  360. package/src/utils/color.js +76 -0
  361. package/src/utils/dom/index.js +421 -0
  362. package/src/utils/dom/scrollbar-width.js +49 -0
  363. package/src/utils/draggable/core.js +379 -0
  364. package/src/utils/draggable/draggable.js +478 -0
  365. package/src/utils/draggable/index.js +61 -0
  366. package/src/utils/draggable/sortable.js +751 -0
  367. package/src/utils/lodash/index.js +2395 -0
  368. package/src/utils/moment/index.js +909 -0
  369. package/src/utils/playground/index.js +37 -0
  370. package/src/utils/popper/index.js +308 -0
  371. package/src/utils/popper/popper.js +1132 -0
  372. package/src/utils/popper/popup-manager.js +288 -0
  373. package/src/utils/popper/popup.js +344 -0
@@ -0,0 +1,336 @@
1
+ <template>
2
+ <transition
3
+ name="ui-dialog-fade"
4
+ @after-enter="afterEnter"
5
+ @after-leave="afterLeave"
6
+ >
7
+ <div
8
+ v-show="dialogVisible"
9
+ class="ui-dialog__wrapper"
10
+ :class="{ 'is-with-modal': modal }"
11
+ @click.self="handleWrapperClick"
12
+ >
13
+ <div
14
+ role="dialog"
15
+ :key="key"
16
+ aria-modal="true"
17
+ :aria-label="title || 'dialog'"
18
+ :class="[
19
+ 'ui-dialog',
20
+ {
21
+ 'is-fullscreen': fullscreen,
22
+ 'ui-dialog--center': center
23
+ },
24
+ size ? 'ui-dialog--' + size : '',
25
+ customClass
26
+ ]"
27
+ ref="dialog"
28
+ :style="style"
29
+ >
30
+ <div class="ui-dialog__header">
31
+ <div class="ui-dialog__header-content">
32
+ <slot name="title-icon"></slot>
33
+ <slot name="title">
34
+ <span class="ui-dialog__title">{{ title }}</span>
35
+ </slot>
36
+ </div>
37
+ <button
38
+ type="button"
39
+ class="ui-dialog__headerbtn"
40
+ :class="{ 'is-disabled': !closePermission }"
41
+ aria-label="Close"
42
+ v-if="showClose"
43
+ @click="handleClose"
44
+ >
45
+ <i class="ui-dialog__close ui-icon-close"></i>
46
+ </button>
47
+ </div>
48
+ <div class="ui-dialog__body" v-if="rendered">
49
+ <slot>
50
+ <div class="ui-dialog__message" v-if="message">
51
+ {{ message }}
52
+ </div>
53
+ </slot>
54
+ </div>
55
+ <div class="ui-dialog__footer" v-if="$slots.footer || hasCancel || hasConfirm">
56
+ <slot name="footer">
57
+ <ui-button v-if="hasCancel" size="small" @click="cancelHandler">
58
+ {{ cancelBtnText || t('components.messageBox.cancel') || '取消' }}
59
+ </ui-button>
60
+ <ui-button v-if="hasConfirm" type="primary" size="small" @click="confirmHandler">
61
+ {{ confirmBtnText || t('components.messageBox.confirm') || '确定' }}
62
+ </ui-button>
63
+ </slot>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </transition>
68
+ </template>
69
+
70
+ <script>
71
+ import Emitter from '../../../mixins/emitter';
72
+ import Popup from '../../../utils/popper/popup';
73
+ import locale from '../../../mixins/locale';
74
+
75
+ /**
76
+ * Dialog 对话框组件
77
+ * @description 在保留当前页面状态的情况下,在此弹窗中进行操作。
78
+ * @property {Boolean} visible - 是否显示 Dialog,支持 .sync 修饰符和 v-model
79
+ * @property {String} title - Dialog 的标题,也可通过具名 slot 传入
80
+ * @property {String} message - 弹窗内文,支持字符串
81
+ * @property {String} width - Dialog 的宽度
82
+ * @property {Boolean} fullscreen - 是否为全屏 Dialog
83
+ * @property {String} top - Dialog CSS 中的 margin-top 值
84
+ * @property {Boolean} modal - 是否需要遮罩层
85
+ * @property {Boolean} append-to-body - Dialog 自身是否插入至 body 元素上。嵌套的 Dialog 必须指定该属性并赋值为 true
86
+ * @property {Boolean} lock-scroll - 是否在 Dialog 出现时将 body 滚动锁定
87
+ * @property {String} custom-class - Dialog 的自定义类名
88
+ * @property {Boolean} close-on-click-modal - 是否可以通过点击 modal 关闭 Dialog
89
+ * @property {Boolean} close-on-press-escape - 是否可以通过按下 ESC 关闭 Dialog
90
+ * @property {Boolean} show-close - 是否显示关闭按钮
91
+ * @property {Function} before-close - 关闭前的回调,会暂停 Dialog 的关闭
92
+ * @property {Boolean} center - 是否对头部和底部采用居中布局
93
+ * @property {Boolean} destroy-on-close - 关闭时销毁 Dialog 中的元素
94
+ * @property {String} cancelBtnText - 取消按钮文字
95
+ * @property {String} confirmBtnText - 确定按钮文字
96
+ * @property {Boolean} hasCancel - 是否显示取消按钮
97
+ * @property {Boolean} hasConfirm - 是否显示确定按钮
98
+ * @property {Boolean} closePermission - 是否允许关闭
99
+ */
100
+ export default {
101
+ name: 'UiDialog',
102
+
103
+ mixins: [Emitter, Popup, locale],
104
+
105
+ model: {
106
+ prop: 'visible',
107
+ event: 'visible-change'
108
+ },
109
+
110
+ props: {
111
+ visible: {
112
+ type: Boolean,
113
+ default: false
114
+ },
115
+
116
+ title: {
117
+ type: String,
118
+ default: ''
119
+ },
120
+
121
+ message: {
122
+ type: String,
123
+ default: ''
124
+ },
125
+
126
+ modal: {
127
+ type: Boolean,
128
+ default: true
129
+ },
130
+
131
+ appendToBody: {
132
+ type: Boolean,
133
+ default: false
134
+ },
135
+
136
+ lockScroll: {
137
+ type: Boolean,
138
+ default: true
139
+ },
140
+
141
+ closeOnClickModal: {
142
+ type: Boolean,
143
+ default: true
144
+ },
145
+
146
+ closeOnPressEscape: {
147
+ type: Boolean,
148
+ default: true
149
+ },
150
+
151
+ showClose: {
152
+ type: Boolean,
153
+ default: true
154
+ },
155
+
156
+ width: String,
157
+
158
+ fullscreen: Boolean,
159
+
160
+ customClass: {
161
+ type: String,
162
+ default: ''
163
+ },
164
+
165
+ top: {
166
+ type: String,
167
+ default: '15vh'
168
+ },
169
+
170
+ beforeClose: Function,
171
+
172
+ center: {
173
+ type: Boolean,
174
+ default: false
175
+ },
176
+
177
+ size: {
178
+ type: String,
179
+ validator(val) {
180
+ return ['small', 'large', 'mini'].indexOf(val) > -1;
181
+ }
182
+ },
183
+
184
+ destroyOnClose: Boolean,
185
+
186
+ cancelBtnText: String,
187
+ confirmBtnText: String,
188
+ hasCancel: Boolean,
189
+ hasConfirm: Boolean,
190
+ closePermission: {
191
+ type: Boolean,
192
+ default: true
193
+ }
194
+ },
195
+
196
+ data() {
197
+ return {
198
+ closed: false,
199
+ key: 0,
200
+ echoFunc: null,
201
+ echoOnConfirm: true,
202
+ dialogVisible: false
203
+ };
204
+ },
205
+
206
+ watch: {
207
+ visible: {
208
+ handler(val) {
209
+ this.dialogVisible = val;
210
+ },
211
+ immediate: true
212
+ },
213
+
214
+ dialogVisible(val) {
215
+ if (val) {
216
+ this.rendered = true;
217
+ this.closed = false;
218
+ this.$emit('open');
219
+ if (this.appendToBody) {
220
+ document.body.appendChild(this.$el);
221
+ }
222
+ this.$nextTick(() => {
223
+ if (this.$refs.dialog) {
224
+ this.$refs.dialog.scrollTop = 0;
225
+ }
226
+ });
227
+ // 显式触发 Popup mixin 的打开逻辑,以兼容 open() 命令式调用
228
+ if (typeof Popup.methods.open === 'function') {
229
+ Popup.methods.open.call(this);
230
+ }
231
+ } else {
232
+ if (!this.closed) this.$emit('close');
233
+ // 显式触发 Popup mixin 的关闭逻辑
234
+ if (typeof Popup.methods.close === 'function') {
235
+ Popup.methods.close.call(this);
236
+ }
237
+ }
238
+ this.$emit('update:visible', val);
239
+ this.$emit('visible-change', val);
240
+ }
241
+ },
242
+
243
+ computed: {
244
+ style() {
245
+ let style = {};
246
+ if (!this.fullscreen) {
247
+ style.marginTop = this.top;
248
+ if (this.width) {
249
+ style.width = this.width;
250
+ }
251
+ }
252
+ return style;
253
+ }
254
+ },
255
+
256
+ methods: {
257
+ open(cb, onConfirm = true) {
258
+ this.echoFunc = cb;
259
+ this.echoOnConfirm = onConfirm;
260
+ this.dialogVisible = true;
261
+ },
262
+
263
+ handleWrapperClick() {
264
+ if (!this.closeOnClickModal) return;
265
+ this.handleClose();
266
+ },
267
+
268
+ handleClose() {
269
+ if (!this.closePermission) return;
270
+ if (typeof this.beforeClose === 'function') {
271
+ this.beforeClose(this.hide);
272
+ } else {
273
+ this.hide();
274
+ }
275
+ },
276
+
277
+ cancelHandler() {
278
+ if (!this.closePermission) return;
279
+ this.hide();
280
+ if (!this.echoOnConfirm && typeof this.echoFunc === 'function') {
281
+ this.echoFunc();
282
+ } else {
283
+ this.$emit('manual-close', this.echoFunc);
284
+ }
285
+ },
286
+
287
+ confirmHandler() {
288
+ this.hide();
289
+ if (this.echoOnConfirm && typeof this.echoFunc === 'function') {
290
+ this.echoFunc();
291
+ } else {
292
+ this.$emit('confirm', this.echoFunc);
293
+ }
294
+ },
295
+
296
+ hide(cancel) {
297
+ if (cancel !== false) {
298
+ this.dialogVisible = false;
299
+ this.closed = true;
300
+ }
301
+ },
302
+
303
+ updatePopper() {
304
+ this.broadcast('UiSelectDropdown', 'updatePopper');
305
+ this.broadcast('UiDropdownMenu', 'updatePopper');
306
+ },
307
+
308
+ afterEnter() {
309
+ this.$emit('opened');
310
+ },
311
+
312
+ afterLeave() {
313
+ this.$emit('closed');
314
+ if (this.destroyOnClose) {
315
+ this.key++;
316
+ }
317
+ }
318
+ },
319
+
320
+ mounted() {
321
+ if (this.dialogVisible) {
322
+ this.rendered = true;
323
+ if (this.appendToBody) {
324
+ document.body.appendChild(this.$el);
325
+ }
326
+ }
327
+ },
328
+
329
+ beforeDestroy() {
330
+ if (this.appendToBody && this.$el && this.$el.parentNode) {
331
+ this.$el.parentNode.removeChild(this.$el);
332
+ }
333
+ }
334
+ };
335
+ </script>
336
+
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Divider 分割线组件
3
+ */
4
+
5
+ import UiDivider from './src/main.vue'
6
+
7
+ // 自动安装
8
+ UiDivider.install = function(Vue) {
9
+ Vue.component(UiDivider.name, UiDivider)
10
+ }
11
+
12
+ export default UiDivider
@@ -0,0 +1,37 @@
1
+ <template functional>
2
+ <div
3
+ v-bind="data.attrs"
4
+ v-on="listeners"
5
+ :class="[data.staticClass, 'ui-divider', `ui-divider--${props.direction}`]"
6
+ >
7
+ <div
8
+ v-if="slots().default && props.direction !== 'vertical'"
9
+ :class="['ui-divider__text', `is-${props.contentPosition}`]"
10
+ >
11
+ <slot />
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name: 'UiDivider',
19
+ props: {
20
+ direction: {
21
+ type: String,
22
+ default: 'horizontal',
23
+ validator(val) {
24
+ return ['horizontal', 'vertical'].indexOf(val) !== -1;
25
+ }
26
+ },
27
+ contentPosition: {
28
+ type: String,
29
+ default: 'center',
30
+ validator(val) {
31
+ return ['left', 'center', 'right'].indexOf(val) !== -1;
32
+ }
33
+ }
34
+ }
35
+ };
36
+
37
+ </script>
@@ -0,0 +1,7 @@
1
+ import UiDrawer from './src/main.vue'
2
+
3
+ UiDrawer.install = function(Vue) {
4
+ Vue.component(UiDrawer.name, UiDrawer)
5
+ }
6
+
7
+ export default UiDrawer
@@ -0,0 +1,310 @@
1
+ <template>
2
+ <transition
3
+ name="ui-drawer-fade"
4
+ @after-enter="afterEnter"
5
+ @after-leave="afterLeave">
6
+ <div
7
+ v-show="visible"
8
+ class="ui-drawer__wrapper"
9
+ tabindex="-1"
10
+ @click="handleWrapperClick"
11
+ role="presentation">
12
+ <div
13
+ v-if="modal"
14
+ class="ui-drawer__mask"
15
+ :style="{ zIndex: zIndex }"
16
+ ></div>
17
+ <div
18
+ class="ui-drawer"
19
+ :class="[
20
+ 'ui-drawer--' + direction,
21
+ customClass
22
+ ]"
23
+ :style="drawerStyle"
24
+ ref="drawer"
25
+ role="dialog"
26
+ :aria-modal="true"
27
+ aria-labelledby="ui-drawer__title"
28
+ @click.stop
29
+ >
30
+ <div class="ui-drawer__header" v-if="withHeader">
31
+ <slot name="title">
32
+ <span
33
+ id="ui-drawer__title"
34
+ class="ui-drawer__title"
35
+ role="heading"
36
+ :title="title"
37
+ >{{ title }}</span>
38
+ </slot>
39
+ <button
40
+ v-if="showClose"
41
+ type="button"
42
+ class="ui-drawer__close-btn"
43
+ @click="closeDrawer"
44
+ aria-label="close"
45
+ >
46
+ <i class="ui-drawer__close ui-icon-close"></i>
47
+ </button>
48
+ </div>
49
+ <section class="ui-drawer__body" v-if="rendered">
50
+ <slot></slot>
51
+ </section>
52
+ <div class="ui-drawer__footer" v-if="$slots.footer || (hasCancel || hasConfirm)">
53
+ <slot name="footer">
54
+ <div class="ui-drawer__footer-buttons">
55
+ <ui-button v-if="hasCancel" size="small" @click="handleCancel">{{ cancelBtnText || t('components.messageBox.cancel') || '取消' }}</ui-button>
56
+ <ui-button v-if="hasConfirm" type="primary" size="small" :loading="confirmLoading" :disabled="!completed" @click="handleConfirm">{{ confirmBtnText || t('components.messageBox.confirm') || '确定' }}</ui-button>
57
+ </div>
58
+ </slot>
59
+ </div>
60
+ </div>
61
+ <!-- 二次确认弹窗 -->
62
+ <ui-dialog
63
+ v-if="hasCancelConfirm"
64
+ ref="confirmDialog"
65
+ size="small"
66
+ :title="cancelConfirmTitle || t('components.messageBox.confirm') || '提示'"
67
+ :message="cancelConfirmMessage || t('components.drawer.cancelConfirm') || '确认关闭?未保存的数据可能丢失。'"
68
+ :cancel-btn-text="t('components.drawer.continueEditing') || '继续编辑'"
69
+ :confirm-btn-text="t('components.drawer.notSave') || '不保存'"
70
+ :has-cancel="true"
71
+ :has-confirm="true"
72
+ append-to-body
73
+ />
74
+ </div>
75
+ </transition>
76
+ </template>
77
+
78
+ <script>
79
+ import Popup from '../../../utils/popper/popup';
80
+ import UiButton from '../../button';
81
+ import UiDialog from '../../dialog';
82
+ import locale from '../../../mixins/locale';
83
+
84
+ export default {
85
+ name: 'UiDrawer',
86
+
87
+ mixins: [Popup, locale],
88
+
89
+ components: {
90
+ UiButton,
91
+ UiDialog
92
+ },
93
+
94
+ props: {
95
+ visible: {
96
+ type: Boolean,
97
+ default: false
98
+ },
99
+ title: {
100
+ type: String,
101
+ default: ''
102
+ },
103
+ direction: {
104
+ type: String,
105
+ default: 'rtl',
106
+ validator: value => ['ltr', 'rtl', 'ttb', 'btt'].indexOf(value) > -1
107
+ },
108
+ size: {
109
+ type: [String, Number],
110
+ default: '30%'
111
+ },
112
+ withHeader: {
113
+ type: Boolean,
114
+ default: true
115
+ },
116
+ modal: {
117
+ type: Boolean,
118
+ default: true
119
+ },
120
+ modalAppendToBody: {
121
+ type: Boolean,
122
+ default: true
123
+ },
124
+ appendToBody: {
125
+ type: Boolean,
126
+ default: false
127
+ },
128
+ lockScroll: {
129
+ type: Boolean,
130
+ default: true
131
+ },
132
+ closeOnClickModal: {
133
+ type: Boolean,
134
+ default: true
135
+ },
136
+ closeOnPressEscape: {
137
+ type: Boolean,
138
+ default: true
139
+ },
140
+ showClose: {
141
+ type: Boolean,
142
+ default: true
143
+ },
144
+ beforeClose: {
145
+ type: Function
146
+ },
147
+ customClass: {
148
+ type: String,
149
+ default: ''
150
+ },
151
+ zIndex: {
152
+ type: Number
153
+ },
154
+ destroyOnClose: {
155
+ type: Boolean,
156
+ default: false
157
+ },
158
+ // ---- Merged from MispDrawer ----
159
+ completed: {
160
+ type: Boolean,
161
+ default: true
162
+ },
163
+ confirmLoading: {
164
+ type: Boolean,
165
+ default: false
166
+ },
167
+ hasCancel: {
168
+ type: Boolean,
169
+ default: false
170
+ },
171
+ hasConfirm: {
172
+ type: Boolean,
173
+ default: false
174
+ },
175
+ cancelBtnText: {
176
+ type: String,
177
+ default: ''
178
+ },
179
+ confirmBtnText: {
180
+ type: String,
181
+ default: ''
182
+ },
183
+ hasCancelConfirm: {
184
+ type: Boolean,
185
+ default: false
186
+ },
187
+ cancelConfirmTitle: {
188
+ type: String,
189
+ default: ''
190
+ },
191
+ cancelConfirmMessage: {
192
+ type: String,
193
+ default: ''
194
+ }
195
+ },
196
+
197
+ data() {
198
+ return {
199
+ };
200
+ },
201
+
202
+ computed: {
203
+ drawerStyle() {
204
+ const style = {};
205
+ const isHorizontal = this.direction === 'rtl' || this.direction === 'ltr';
206
+
207
+ let sizeStr = this.size;
208
+ if (typeof this.size === 'number') {
209
+ sizeStr = `${this.size}px`;
210
+ } else {
211
+ const sizeMap = {
212
+ large: '50%',
213
+ medium: '40%',
214
+ small: '30%'
215
+ };
216
+ if (sizeMap[this.size]) {
217
+ sizeStr = sizeMap[this.size];
218
+ }
219
+ }
220
+
221
+ if (isHorizontal) {
222
+ style.width = sizeStr;
223
+ } else {
224
+ style.height = sizeStr;
225
+ }
226
+ return style;
227
+ }
228
+ },
229
+
230
+ watch: {
231
+ visible(val) {
232
+ if (val) {
233
+ this.$emit('open');
234
+ } else {
235
+ this.$emit('close');
236
+ }
237
+ }
238
+ },
239
+
240
+ methods: {
241
+ afterEnter() {
242
+ this.$emit('opened');
243
+ },
244
+ afterLeave() {
245
+ this.$emit('closed');
246
+ if (this.destroyOnClose) {
247
+ this.rendered = false;
248
+ }
249
+ },
250
+ hide(cancel) {
251
+ if (cancel !== false) {
252
+ this.$emit('update:visible', false);
253
+ }
254
+ },
255
+ handleClose() {
256
+ const close = () => {
257
+ if (typeof this.beforeClose === 'function') {
258
+ this.beforeClose(this.hide);
259
+ } else {
260
+ this.hide();
261
+ }
262
+ this.$emit('cancel');
263
+ };
264
+
265
+ if (this.hasCancelConfirm) {
266
+ if (this.$refs.confirmDialog && typeof this.$refs.confirmDialog.open === 'function') {
267
+ this.$refs.confirmDialog.open(() => {
268
+ close();
269
+ });
270
+ } else {
271
+ // Fallback if dialog is not available
272
+ close();
273
+ }
274
+ } else {
275
+ close();
276
+ }
277
+ },
278
+ closeDrawer() {
279
+ this.handleClose();
280
+ },
281
+ handleWrapperClick() {
282
+ if (this.closeOnClickModal) {
283
+ this.handleClose();
284
+ }
285
+ },
286
+ handleConfirm() {
287
+ this.$emit('confirm');
288
+ },
289
+ handleCancel() {
290
+ this.closeDrawer();
291
+ }
292
+ },
293
+
294
+ mounted() {
295
+ if (this.visible) {
296
+ this.rendered = true;
297
+ }
298
+ if (this.appendToBody) {
299
+ document.body.appendChild(this.$el);
300
+ }
301
+ },
302
+
303
+ beforeDestroy() {
304
+ if (this.appendToBody && this.$el && this.$el.parentNode) {
305
+ this.$el.parentNode.removeChild(this.$el);
306
+ }
307
+ }
308
+ };
309
+ </script>
310
+
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Dropdown 组件
3
+ */
4
+
5
+ import UiDropdown from './src/main.vue'
6
+
7
+ // 自动安装
8
+ UiDropdown.install = function(Vue) {
9
+ Vue.component(UiDropdown.name, UiDropdown)
10
+ }
11
+
12
+ export default UiDropdown