@kengic/uni 0.3.2-beta.4 → 0.3.2-beta.6

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 (255) hide show
  1. package/dist/kengic-uni.js +2 -1527
  2. package/dist/src/index.d.ts +0 -1
  3. package/dist/uni-ui/index.ts +5 -0
  4. package/dist/uni-ui/uni-badge/uni-badge.vue +253 -0
  5. package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
  6. package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +121 -0
  7. package/dist/uni-ui/uni-calendar/calendar.js +546 -0
  8. package/dist/uni-ui/uni-calendar/i18n/en.json +12 -0
  9. package/dist/uni-ui/uni-calendar/i18n/index.js +8 -0
  10. package/dist/uni-ui/uni-calendar/i18n/zh-Hans.json +12 -0
  11. package/dist/uni-ui/uni-calendar/i18n/zh-Hant.json +12 -0
  12. package/dist/uni-ui/uni-calendar/uni-calendar-item.vue +187 -0
  13. package/dist/uni-ui/uni-calendar/uni-calendar.vue +566 -0
  14. package/dist/uni-ui/uni-calendar/util.js +360 -0
  15. package/dist/uni-ui/uni-card/uni-card.vue +281 -0
  16. package/dist/uni-ui/uni-col/uni-col.vue +317 -0
  17. package/dist/uni-ui/uni-collapse/uni-collapse.vue +147 -0
  18. package/dist/uni-ui/uni-collapse-item/uni-collapse-item.vue +402 -0
  19. package/dist/uni-ui/uni-combox/uni-combox.vue +294 -0
  20. package/dist/uni-ui/uni-countdown/i18n/en.json +6 -0
  21. package/dist/uni-ui/uni-countdown/i18n/index.js +8 -0
  22. package/dist/uni-ui/uni-countdown/i18n/zh-Hans.json +6 -0
  23. package/dist/uni-ui/uni-countdown/i18n/zh-Hant.json +6 -0
  24. package/dist/uni-ui/uni-countdown/uni-countdown.vue +267 -0
  25. package/dist/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +821 -0
  26. package/dist/uni-ui/uni-data-picker/keypress.js +45 -0
  27. package/dist/uni-ui/uni-data-picker/uni-data-picker.vue +551 -0
  28. package/dist/uni-ui/uni-data-pickerview/uni-data-picker.js +622 -0
  29. package/dist/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +323 -0
  30. package/dist/uni-ui/uni-data-select/uni-data-select.vue +517 -0
  31. package/dist/uni-ui/uni-dateformat/date-format.js +200 -0
  32. package/dist/uni-ui/uni-dateformat/uni-dateformat.vue +88 -0
  33. package/dist/uni-ui/uni-datetime-picker/calendar-item.vue +177 -0
  34. package/dist/uni-ui/uni-datetime-picker/calendar.vue +928 -0
  35. package/dist/uni-ui/uni-datetime-picker/i18n/en.json +22 -0
  36. package/dist/uni-ui/uni-datetime-picker/i18n/index.js +8 -0
  37. package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +22 -0
  38. package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +22 -0
  39. package/dist/uni-ui/uni-datetime-picker/time-picker.vue +934 -0
  40. package/dist/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1026 -0
  41. package/dist/uni-ui/uni-datetime-picker/util.js +403 -0
  42. package/dist/uni-ui/uni-drawer/keypress.js +45 -0
  43. package/dist/uni-ui/uni-drawer/uni-drawer.vue +181 -0
  44. package/dist/uni-ui/uni-easyinput/common.js +56 -0
  45. package/dist/uni-ui/uni-easyinput/uni-easyinput.vue +660 -0
  46. package/dist/uni-ui/uni-fab/uni-fab.vue +491 -0
  47. package/dist/uni-ui/uni-fav/i18n/en.json +4 -0
  48. package/dist/uni-ui/uni-fav/i18n/index.js +8 -0
  49. package/dist/uni-ui/uni-fav/i18n/zh-Hans.json +4 -0
  50. package/dist/uni-ui/uni-fav/i18n/zh-Hant.json +4 -0
  51. package/dist/uni-ui/uni-fav/uni-fav.vue +161 -0
  52. package/dist/uni-ui/uni-file-picker/choose-and-upload-file.js +224 -0
  53. package/dist/uni-ui/uni-file-picker/uni-file-picker.vue +667 -0
  54. package/dist/uni-ui/uni-file-picker/upload-file.vue +325 -0
  55. package/dist/uni-ui/uni-file-picker/upload-image.vue +292 -0
  56. package/dist/uni-ui/uni-file-picker/utils.js +109 -0
  57. package/dist/uni-ui/uni-forms/uni-forms.vue +398 -0
  58. package/dist/uni-ui/uni-forms/utils.js +293 -0
  59. package/dist/uni-ui/uni-forms/validate.js +486 -0
  60. package/dist/uni-ui/uni-forms-item/uni-forms-item.vue +601 -0
  61. package/dist/uni-ui/uni-goods-nav/i18n/en.json +6 -0
  62. package/dist/uni-ui/uni-goods-nav/i18n/index.js +8 -0
  63. package/dist/uni-ui/uni-goods-nav/i18n/zh-Hans.json +6 -0
  64. package/dist/uni-ui/uni-goods-nav/i18n/zh-Hant.json +6 -0
  65. package/dist/uni-ui/uni-goods-nav/uni-goods-nav.vue +229 -0
  66. package/dist/uni-ui/uni-grid/uni-grid.vue +143 -0
  67. package/dist/uni-ui/uni-grid-item/uni-grid-item.vue +129 -0
  68. package/dist/uni-ui/uni-group/uni-group.vue +134 -0
  69. package/dist/uni-ui/uni-icons/icons.js +1169 -0
  70. package/dist/uni-ui/uni-icons/uni-icons.vue +96 -0
  71. package/dist/uni-ui/uni-icons/uniicons.css +663 -0
  72. package/dist/uni-ui/uni-icons/uniicons.ttf +0 -0
  73. package/dist/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +144 -0
  74. package/dist/uni-ui/uni-indexed-list/uni-indexed-list.vue +367 -0
  75. package/dist/uni-ui/uni-link/uni-link.vue +128 -0
  76. package/dist/uni-ui/uni-list/uni-list.vue +123 -0
  77. package/dist/uni-ui/uni-list/uni-refresh.vue +65 -0
  78. package/dist/uni-ui/uni-list/uni-refresh.wxs +87 -0
  79. package/dist/uni-ui/uni-list-ad/uni-list-ad.vue +107 -0
  80. package/dist/uni-ui/uni-list-chat/uni-list-chat.scss +58 -0
  81. package/dist/uni-ui/uni-list-chat/uni-list-chat.vue +593 -0
  82. package/dist/uni-ui/uni-list-item/uni-list-item.vue +534 -0
  83. package/dist/uni-ui/uni-load-more/i18n/en.json +5 -0
  84. package/dist/uni-ui/uni-load-more/i18n/index.js +8 -0
  85. package/dist/uni-ui/uni-load-more/i18n/zh-Hans.json +5 -0
  86. package/dist/uni-ui/uni-load-more/i18n/zh-Hant.json +5 -0
  87. package/dist/uni-ui/uni-load-more/uni-load-more.vue +399 -0
  88. package/dist/uni-ui/uni-nav-bar/uni-nav-bar.vue +357 -0
  89. package/dist/uni-ui/uni-nav-bar/uni-status-bar.vue +24 -0
  90. package/dist/uni-ui/uni-notice-bar/uni-notice-bar.vue +426 -0
  91. package/dist/uni-ui/uni-number-box/uni-number-box.vue +221 -0
  92. package/dist/uni-ui/uni-pagination/i18n/en.json +5 -0
  93. package/dist/uni-ui/uni-pagination/i18n/es.json +5 -0
  94. package/dist/uni-ui/uni-pagination/i18n/fr.json +5 -0
  95. package/dist/uni-ui/uni-pagination/i18n/index.js +12 -0
  96. package/dist/uni-ui/uni-pagination/i18n/zh-Hans.json +5 -0
  97. package/dist/uni-ui/uni-pagination/i18n/zh-Hant.json +5 -0
  98. package/dist/uni-ui/uni-pagination/uni-pagination.vue +465 -0
  99. package/dist/uni-ui/uni-popup/i18n/en.json +7 -0
  100. package/dist/uni-ui/uni-popup/i18n/index.js +8 -0
  101. package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
  102. package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
  103. package/dist/uni-ui/uni-popup/keypress.js +45 -0
  104. package/dist/uni-ui/uni-popup/popup.js +26 -0
  105. package/dist/uni-ui/uni-popup/uni-popup.vue +473 -0
  106. package/dist/uni-ui/uni-popup-dialog/keypress.js +45 -0
  107. package/dist/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +275 -0
  108. package/dist/uni-ui/uni-popup-message/uni-popup-message.vue +143 -0
  109. package/dist/uni-ui/uni-popup-share/uni-popup-share.vue +187 -0
  110. package/dist/uni-ui/uni-rate/uni-rate.vue +365 -0
  111. package/dist/uni-ui/uni-row/uni-row.vue +190 -0
  112. package/dist/uni-ui/uni-scss/changelog.md +8 -0
  113. package/dist/uni-ui/uni-scss/index.scss +1 -0
  114. package/dist/uni-ui/uni-scss/package.json +82 -0
  115. package/dist/uni-ui/uni-scss/readme.md +4 -0
  116. package/dist/uni-ui/uni-scss/styles/index.scss +7 -0
  117. package/dist/uni-ui/uni-scss/styles/setting/_border.scss +3 -0
  118. package/dist/uni-ui/uni-scss/styles/setting/_color.scss +66 -0
  119. package/dist/uni-ui/uni-scss/styles/setting/_radius.scss +55 -0
  120. package/dist/uni-ui/uni-scss/styles/setting/_space.scss +56 -0
  121. package/dist/uni-ui/uni-scss/styles/setting/_styles.scss +167 -0
  122. package/dist/uni-ui/uni-scss/styles/setting/_text.scss +24 -0
  123. package/dist/uni-ui/uni-scss/styles/setting/_variables.scss +146 -0
  124. package/dist/uni-ui/uni-scss/styles/tools/functions.scss +19 -0
  125. package/dist/uni-ui/uni-scss/theme.scss +31 -0
  126. package/dist/uni-ui/uni-scss/variables.scss +62 -0
  127. package/dist/uni-ui/uni-search-bar/i18n/en.json +4 -0
  128. package/dist/uni-ui/uni-search-bar/i18n/index.js +8 -0
  129. package/dist/uni-ui/uni-search-bar/i18n/zh-Hans.json +4 -0
  130. package/dist/uni-ui/uni-search-bar/i18n/zh-Hant.json +4 -0
  131. package/dist/uni-ui/uni-search-bar/uni-search-bar.vue +298 -0
  132. package/dist/uni-ui/uni-section/uni-section.vue +167 -0
  133. package/dist/uni-ui/uni-segmented-control/uni-segmented-control.vue +145 -0
  134. package/dist/uni-ui/uni-steps/uni-steps.vue +269 -0
  135. package/dist/uni-ui/uni-swipe-action/uni-swipe-action.vue +60 -0
  136. package/dist/uni-ui/uni-swipe-action-item/bindingx.js +302 -0
  137. package/dist/uni-ui/uni-swipe-action-item/isPC.js +12 -0
  138. package/dist/uni-ui/uni-swipe-action-item/mpalipay.js +195 -0
  139. package/dist/uni-ui/uni-swipe-action-item/mpother.js +260 -0
  140. package/dist/uni-ui/uni-swipe-action-item/mpwxs.js +84 -0
  141. package/dist/uni-ui/uni-swipe-action-item/render.js +270 -0
  142. package/dist/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +347 -0
  143. package/dist/uni-ui/uni-swipe-action-item/wx.wxs +341 -0
  144. package/dist/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +218 -0
  145. package/dist/uni-ui/uni-table/uni-table.vue +455 -0
  146. package/dist/uni-ui/uni-tag/uni-tag.vue +252 -0
  147. package/dist/uni-ui/uni-tbody/uni-tbody.vue +29 -0
  148. package/dist/uni-ui/uni-td/uni-td.vue +90 -0
  149. package/dist/uni-ui/uni-th/filter-dropdown.vue +511 -0
  150. package/dist/uni-ui/uni-th/uni-th.vue +285 -0
  151. package/dist/uni-ui/uni-thead/uni-thead.vue +129 -0
  152. package/dist/uni-ui/uni-title/uni-title.vue +171 -0
  153. package/dist/uni-ui/uni-tooltip/uni-tooltip.vue +68 -0
  154. package/dist/uni-ui/uni-tr/table-checkbox.vue +179 -0
  155. package/dist/uni-ui/uni-tr/uni-tr.vue +171 -0
  156. package/dist/uni-ui/uni-transition/createAnimation.js +131 -0
  157. package/dist/uni-ui/uni-transition/uni-transition.vue +281 -0
  158. package/package.json +3 -2
  159. package/dist/index.css +0 -1
  160. package/dist/src/components/index.d.ts +0 -5
  161. package/dist/src/components/uni-ui/uni-badge/uni-badge.vue.d.ts +0 -108
  162. package/dist/src/components/uni-ui/uni-breadcrumb/uni-breadcrumb.vue.d.ts +0 -23
  163. package/dist/src/components/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue.d.ts +0 -30
  164. package/dist/src/components/uni-ui/uni-calendar/calendar.d.ts +0 -67
  165. package/dist/src/components/uni-ui/uni-calendar/i18n/index.d.ts +0 -39
  166. package/dist/src/components/uni-ui/uni-calendar/uni-calendar-item.vue.d.ts +0 -47
  167. package/dist/src/components/uni-ui/uni-calendar/uni-calendar.vue.d.ts +0 -166
  168. package/dist/src/components/uni-ui/uni-calendar/util.d.ts +0 -211
  169. package/dist/src/components/uni-ui/uni-card/uni-card.vue.d.ts +0 -117
  170. package/dist/src/components/uni-ui/uni-col/uni-col.vue.d.ts +0 -70
  171. package/dist/src/components/uni-ui/uni-collapse/uni-collapse.vue.d.ts +0 -45
  172. package/dist/src/components/uni-ui/uni-collapse-item/uni-collapse-item.vue.d.ts +0 -102
  173. package/dist/src/components/uni-ui/uni-combox/uni-combox.vue.d.ts +0 -95
  174. package/dist/src/components/uni-ui/uni-countdown/i18n/index.d.ts +0 -21
  175. package/dist/src/components/uni-ui/uni-countdown/uni-countdown.vue.d.ts +0 -158
  176. package/dist/src/components/uni-ui/uni-data-checkbox/uni-data-checkbox.vue.d.ts +0 -192
  177. package/dist/src/components/uni-ui/uni-data-picker/uni-data-picker.vue.d.ts +0 -244
  178. package/dist/src/components/uni-ui/uni-data-pickerview/uni-data-picker.d.ts +0 -178
  179. package/dist/src/components/uni-ui/uni-data-pickerview/uni-data-pickerview.vue.d.ts +0 -169
  180. package/dist/src/components/uni-ui/uni-data-select/uni-data-select.vue.d.ts +0 -125
  181. package/dist/src/components/uni-ui/uni-dateformat/date-format.d.ts +0 -6
  182. package/dist/src/components/uni-ui/uni-dateformat/uni-dateformat.vue.d.ts +0 -57
  183. package/dist/src/components/uni-ui/uni-datetime-picker/calendar-item.vue.d.ts +0 -44
  184. package/dist/src/components/uni-ui/uni-datetime-picker/calendar.vue.d.ts +0 -253
  185. package/dist/src/components/uni-ui/uni-datetime-picker/i18n/index.d.ts +0 -69
  186. package/dist/src/components/uni-ui/uni-datetime-picker/time-picker.vue.d.ts +0 -225
  187. package/dist/src/components/uni-ui/uni-datetime-picker/uni-datetime-picker.vue.d.ts +0 -236
  188. package/dist/src/components/uni-ui/uni-datetime-picker/util.d.ts +0 -171
  189. package/dist/src/components/uni-ui/uni-drawer/keypress.d.ts +0 -13
  190. package/dist/src/components/uni-ui/uni-drawer/uni-drawer.vue.d.ts +0 -78
  191. package/dist/src/components/uni-ui/uni-easyinput/uni-easyinput.vue.d.ts +0 -269
  192. package/dist/src/components/uni-ui/uni-fab/uni-fab.vue.d.ts +0 -109
  193. package/dist/src/components/uni-ui/uni-fav/i18n/index.d.ts +0 -15
  194. package/dist/src/components/uni-ui/uni-fav/uni-fav.vue.d.ts +0 -99
  195. package/dist/src/components/uni-ui/uni-file-picker/choose-and-upload-file.d.ts +0 -4
  196. package/dist/src/components/uni-ui/uni-file-picker/uni-file-picker.vue.d.ts +0 -254
  197. package/dist/src/components/uni-ui/uni-file-picker/upload-file.vue.d.ts +0 -81
  198. package/dist/src/components/uni-ui/uni-file-picker/upload-image.vue.d.ts +0 -90
  199. package/dist/src/components/uni-ui/uni-file-picker/utils.d.ts +0 -22
  200. package/dist/src/components/uni-ui/uni-forms/uni-forms.vue.d.ts +0 -160
  201. package/dist/src/components/uni-ui/uni-forms/utils.d.ts +0 -20
  202. package/dist/src/components/uni-ui/uni-forms/validate.d.ts +0 -42
  203. package/dist/src/components/uni-ui/uni-forms-item/uni-forms-item.vue.d.ts +0 -127
  204. package/dist/src/components/uni-ui/uni-goods-nav/i18n/index.d.ts +0 -21
  205. package/dist/src/components/uni-ui/uni-goods-nav/uni-goods-nav.vue.d.ts +0 -61
  206. package/dist/src/components/uni-ui/uni-grid/uni-grid.vue.d.ts +0 -59
  207. package/dist/src/components/uni-ui/uni-grid-item/uni-grid-item.vue.d.ts +0 -26
  208. package/dist/src/components/uni-ui/uni-group/uni-group.vue.d.ts +0 -52
  209. package/dist/src/components/uni-ui/uni-icons/icons.d.ts +0 -15
  210. package/dist/src/components/uni-ui/uni-icons/uni-icons.vue.d.ts +0 -56
  211. package/dist/src/components/uni-ui/uni-indexed-list/uni-indexed-list-item.vue.d.ts +0 -45
  212. package/dist/src/components/uni-ui/uni-indexed-list/uni-indexed-list.vue.d.ts +0 -49
  213. package/dist/src/components/uni-ui/uni-link/uni-link.vue.d.ts +0 -75
  214. package/dist/src/components/uni-ui/uni-list/uni-list.vue.d.ts +0 -53
  215. package/dist/src/components/uni-ui/uni-list/uni-refresh.vue.d.ts +0 -22
  216. package/dist/src/components/uni-ui/uni-list-ad/uni-list-ad.vue.d.ts +0 -25
  217. package/dist/src/components/uni-ui/uni-list-chat/uni-list-chat.vue.d.ts +0 -123
  218. package/dist/src/components/uni-ui/uni-list-item/uni-list-item.vue.d.ts +0 -248
  219. package/dist/src/components/uni-ui/uni-load-more/i18n/index.d.ts +0 -18
  220. package/dist/src/components/uni-ui/uni-load-more/uni-load-more.vue.d.ts +0 -89
  221. package/dist/src/components/uni-ui/uni-nav-bar/uni-nav-bar.vue.d.ts +0 -163
  222. package/dist/src/components/uni-ui/uni-nav-bar/uni-status-bar.vue.d.ts +0 -4
  223. package/dist/src/components/uni-ui/uni-notice-bar/uni-notice-bar.vue.d.ts +0 -138
  224. package/dist/src/components/uni-ui/uni-number-box/uni-number-box.vue.d.ts +0 -90
  225. package/dist/src/components/uni-ui/uni-pagination/i18n/index.d.ts +0 -28
  226. package/dist/src/components/uni-ui/uni-pagination/uni-pagination.vue.d.ts +0 -127
  227. package/dist/src/components/uni-ui/uni-popup/i18n/index.d.ts +0 -24
  228. package/dist/src/components/uni-ui/uni-popup/keypress.d.ts +0 -13
  229. package/dist/src/components/uni-ui/uni-popup/popup.d.ts +0 -11
  230. package/dist/src/components/uni-ui/uni-popup/uni-popup.vue.d.ts +0 -136
  231. package/dist/src/components/uni-ui/uni-popup-dialog/uni-popup-dialog.vue.d.ts +0 -123
  232. package/dist/src/components/uni-ui/uni-popup-message/uni-popup-message.vue.d.ts +0 -67
  233. package/dist/src/components/uni-ui/uni-popup-share/uni-popup-share.vue.d.ts +0 -49
  234. package/dist/src/components/uni-ui/uni-rate/uni-rate.vue.d.ts +0 -154
  235. package/dist/src/components/uni-ui/uni-row/uni-row.vue.d.ts +0 -41
  236. package/dist/src/components/uni-ui/uni-search-bar/i18n/index.d.ts +0 -15
  237. package/dist/src/components/uni-ui/uni-search-bar/uni-search-bar.vue.d.ts +0 -126
  238. package/dist/src/components/uni-ui/uni-section/uni-section.vue.d.ts +0 -85
  239. package/dist/src/components/uni-ui/uni-segmented-control/uni-segmented-control.vue.d.ts +0 -47
  240. package/dist/src/components/uni-ui/uni-steps/uni-steps.vue.d.ts +0 -59
  241. package/dist/src/components/uni-ui/uni-swipe-action/uni-swipe-action.vue.d.ts +0 -6
  242. package/dist/src/components/uni-ui/uni-swiper-dot/uni-swiper-dot.vue.d.ts +0 -65
  243. package/dist/src/components/uni-ui/uni-table/uni-table.vue.d.ts +0 -99
  244. package/dist/src/components/uni-ui/uni-tag/uni-tag.vue.d.ts +0 -84
  245. package/dist/src/components/uni-ui/uni-tbody/uni-tbody.vue.d.ts +0 -2
  246. package/dist/src/components/uni-ui/uni-td/uni-td.vue.d.ts +0 -48
  247. package/dist/src/components/uni-ui/uni-th/filter-dropdown.vue.d.ts +0 -99
  248. package/dist/src/components/uni-ui/uni-th/uni-th.vue.d.ts +0 -97
  249. package/dist/src/components/uni-ui/uni-thead/uni-thead.vue.d.ts +0 -15
  250. package/dist/src/components/uni-ui/uni-title/uni-title.vue.d.ts +0 -54
  251. package/dist/src/components/uni-ui/uni-tooltip/uni-tooltip.vue.d.ts +0 -23
  252. package/dist/src/components/uni-ui/uni-tr/table-checkbox.vue.d.ts +0 -58
  253. package/dist/src/components/uni-ui/uni-tr/uni-tr.vue.d.ts +0 -39
  254. package/dist/src/components/uni-ui/uni-transition/createAnimation.d.ts +0 -16
  255. package/dist/src/components/uni-ui/uni-transition/uni-transition.vue.d.ts +0 -240
@@ -0,0 +1,473 @@
1
+ <template>
2
+ <view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
3
+ <view @touchstart="touchstart">
4
+ <uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
5
+ :duration="duration" :show="showTrans" @click="onTap" />
6
+ <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
7
+ :show="showTrans" @click="onTap">
8
+ <view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
9
+ <slot />
10
+ </view>
11
+ </uni-transition>
12
+ </view>
13
+ <!-- #ifdef H5 -->
14
+ <keypress v-if="maskShow" @esc="onTap" />
15
+ <!-- #endif -->
16
+ </view>
17
+ </template>
18
+
19
+ <script>
20
+ // #ifdef H5
21
+ import keypress from './keypress.js'
22
+ // #endif
23
+
24
+ /**
25
+ * PopUp 弹出层
26
+ * @description 弹出层组件,为了解决遮罩弹层的问题
27
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
28
+ * @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
29
+ * @value top 顶部弹出
30
+ * @value center 中间弹出
31
+ * @value bottom 底部弹出
32
+ * @value left 左侧弹出
33
+ * @value right 右侧弹出
34
+ * @value message 消息提示
35
+ * @value dialog 对话框
36
+ * @value share 底部分享示例
37
+ * @property {Boolean} animation = [true|false] 是否开启动画
38
+ * @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
39
+ * @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
40
+ * @property {String} backgroundColor 主窗口背景色
41
+ * @property {String} maskBackgroundColor 蒙版颜色
42
+ * @property {Boolean} safeArea 是否适配底部安全区
43
+ * @event {Function} change 打开关闭弹窗触发,e={show: false}
44
+ * @event {Function} maskClick 点击遮罩触发
45
+ */
46
+
47
+ export default {
48
+ name: 'uniPopup',
49
+ components: {
50
+ // #ifdef H5
51
+ keypress
52
+ // #endif
53
+ },
54
+ emits: ['change', 'maskClick'],
55
+ props: {
56
+ // 开启动画
57
+ animation: {
58
+ type: Boolean,
59
+ default: true
60
+ },
61
+ // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
62
+ // message: 消息提示 ; dialog : 对话框
63
+ type: {
64
+ type: String,
65
+ default: 'center'
66
+ },
67
+ // maskClick
68
+ isMaskClick: {
69
+ type: Boolean,
70
+ default: null
71
+ },
72
+ // TODO 2 个版本后废弃属性 ,使用 isMaskClick
73
+ maskClick: {
74
+ type: Boolean,
75
+ default: null
76
+ },
77
+ backgroundColor: {
78
+ type: String,
79
+ default: 'none'
80
+ },
81
+ safeArea: {
82
+ type: Boolean,
83
+ default: true
84
+ },
85
+ maskBackgroundColor: {
86
+ type: String,
87
+ default: 'rgba(0, 0, 0, 0.4)'
88
+ },
89
+ },
90
+
91
+ watch: {
92
+ /**
93
+ * 监听type类型
94
+ */
95
+ type: {
96
+ handler: function(type) {
97
+ if (!this.config[type]) return
98
+ this[this.config[type]](true)
99
+ },
100
+ immediate: true
101
+ },
102
+ isDesktop: {
103
+ handler: function(newVal) {
104
+ if (!this.config[newVal]) return
105
+ this[this.config[this.type]](true)
106
+ },
107
+ immediate: true
108
+ },
109
+ /**
110
+ * 监听遮罩是否可点击
111
+ * @param {Object} val
112
+ */
113
+ maskClick: {
114
+ handler: function(val) {
115
+ this.mkclick = val
116
+ },
117
+ immediate: true
118
+ },
119
+ isMaskClick: {
120
+ handler: function(val) {
121
+ this.mkclick = val
122
+ },
123
+ immediate: true
124
+ },
125
+ // H5 下禁止底部滚动
126
+ showPopup(show) {
127
+ // #ifdef H5
128
+ // fix by mehaotian 处理 h5 滚动穿透的问题
129
+ document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
130
+ // #endif
131
+ }
132
+ },
133
+ data() {
134
+ return {
135
+ duration: 300,
136
+ ani: [],
137
+ showPopup: false,
138
+ showTrans: false,
139
+ popupWidth: 0,
140
+ popupHeight: 0,
141
+ config: {
142
+ top: 'top',
143
+ bottom: 'bottom',
144
+ center: 'center',
145
+ left: 'left',
146
+ right: 'right',
147
+ message: 'top',
148
+ dialog: 'center',
149
+ share: 'bottom'
150
+ },
151
+ maskClass: {
152
+ position: 'fixed',
153
+ bottom: 0,
154
+ top: 0,
155
+ left: 0,
156
+ right: 0,
157
+ backgroundColor: 'rgba(0, 0, 0, 0.4)'
158
+ },
159
+ transClass: {
160
+ position: 'fixed',
161
+ left: 0,
162
+ right: 0
163
+ },
164
+ maskShow: true,
165
+ mkclick: true,
166
+ popupstyle: this.isDesktop ? 'fixforpc-top' : 'top'
167
+ }
168
+ },
169
+ computed: {
170
+ isDesktop() {
171
+ return this.popupWidth >= 500 && this.popupHeight >= 500
172
+ },
173
+ bg() {
174
+ if (this.backgroundColor === '' || this.backgroundColor === 'none') {
175
+ return 'transparent'
176
+ }
177
+ return this.backgroundColor
178
+ }
179
+ },
180
+ mounted() {
181
+ const fixSize = () => {
182
+ const {
183
+ windowWidth,
184
+ windowHeight,
185
+ windowTop,
186
+ safeArea,
187
+ screenHeight,
188
+ safeAreaInsets
189
+ } = uni.getSystemInfoSync()
190
+ this.popupWidth = windowWidth
191
+ this.popupHeight = windowHeight + (windowTop || 0)
192
+ // TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
193
+ if (safeArea && this.safeArea) {
194
+ // #ifdef MP-WEIXIN
195
+ this.safeAreaInsets = screenHeight - safeArea.bottom
196
+ // #endif
197
+ // #ifndef MP-WEIXIN
198
+ this.safeAreaInsets = safeAreaInsets.bottom
199
+ // #endif
200
+ } else {
201
+ this.safeAreaInsets = 0
202
+ }
203
+ }
204
+ fixSize()
205
+ // #ifdef H5
206
+ // window.addEventListener('resize', fixSize)
207
+ // this.$once('hook:beforeDestroy', () => {
208
+ // window.removeEventListener('resize', fixSize)
209
+ // })
210
+ // #endif
211
+ },
212
+ // #ifndef VUE3
213
+ // TODO vue2
214
+ destroyed() {
215
+ this.setH5Visible()
216
+ },
217
+ // #endif
218
+ // #ifdef VUE3
219
+ // TODO vue3
220
+ unmounted() {
221
+ this.setH5Visible()
222
+ },
223
+ // #endif
224
+ created() {
225
+ // this.mkclick = this.isMaskClick || this.maskClick
226
+ if (this.isMaskClick === null && this.maskClick === null) {
227
+ this.mkclick = true
228
+ } else {
229
+ this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick
230
+ }
231
+ if (this.animation) {
232
+ this.duration = 300
233
+ } else {
234
+ this.duration = 0
235
+ }
236
+ // TODO 处理 message 组件生命周期异常的问题
237
+ this.messageChild = null
238
+ // TODO 解决头条冒泡的问题
239
+ this.clearPropagation = false
240
+ this.maskClass.backgroundColor = this.maskBackgroundColor
241
+ },
242
+ methods: {
243
+ setH5Visible() {
244
+ // #ifdef H5
245
+ // fix by mehaotian 处理 h5 滚动穿透的问题
246
+ document.getElementsByTagName('body')[0].style.overflow = 'visible'
247
+ // #endif
248
+ },
249
+ /**
250
+ * 公用方法,不显示遮罩层
251
+ */
252
+ closeMask() {
253
+ this.maskShow = false
254
+ },
255
+ /**
256
+ * 公用方法,遮罩层禁止点击
257
+ */
258
+ disableMask() {
259
+ this.mkclick = false
260
+ },
261
+ // TODO nvue 取消冒泡
262
+ clear(e) {
263
+ // #ifndef APP-NVUE
264
+ e.stopPropagation()
265
+ // #endif
266
+ this.clearPropagation = true
267
+ },
268
+
269
+ open(direction) {
270
+ // fix by mehaotian 处理快速打开关闭的情况
271
+ if (this.showPopup) {
272
+ return
273
+ }
274
+ let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
275
+ if (!(direction && innerType.indexOf(direction) !== -1)) {
276
+ direction = this.type
277
+ }
278
+ if (!this.config[direction]) {
279
+ console.error('缺少类型:', direction)
280
+ return
281
+ }
282
+ this[this.config[direction]]()
283
+ this.$emit('change', {
284
+ show: true,
285
+ type: direction
286
+ })
287
+ },
288
+ close(type) {
289
+ this.showTrans = false
290
+ this.$emit('change', {
291
+ show: false,
292
+ type: this.type
293
+ })
294
+ clearTimeout(this.timer)
295
+ // // 自定义关闭事件
296
+ // this.customOpen && this.customClose()
297
+ this.timer = setTimeout(() => {
298
+ this.showPopup = false
299
+ }, 300)
300
+ },
301
+ // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
302
+ touchstart() {
303
+ this.clearPropagation = false
304
+ },
305
+
306
+ onTap() {
307
+ if (this.clearPropagation) {
308
+ // fix by mehaotian 兼容 nvue
309
+ this.clearPropagation = false
310
+ return
311
+ }
312
+ this.$emit('maskClick')
313
+ if (!this.mkclick) return
314
+ this.close()
315
+ },
316
+ /**
317
+ * 顶部弹出样式处理
318
+ */
319
+ top(type) {
320
+ this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
321
+ this.ani = ['slide-top']
322
+ this.transClass = {
323
+ position: 'fixed',
324
+ left: 0,
325
+ right: 0,
326
+ backgroundColor: this.bg
327
+ }
328
+ // TODO 兼容 type 属性 ,后续会废弃
329
+ if (type) return
330
+ this.showPopup = true
331
+ this.showTrans = true
332
+ this.$nextTick(() => {
333
+ if (this.messageChild && this.type === 'message') {
334
+ this.messageChild.timerClose()
335
+ }
336
+ })
337
+ },
338
+ /**
339
+ * 底部弹出样式处理
340
+ */
341
+ bottom(type) {
342
+ this.popupstyle = 'bottom'
343
+ this.ani = ['slide-bottom']
344
+ this.transClass = {
345
+ position: 'fixed',
346
+ left: 0,
347
+ right: 0,
348
+ bottom: 0,
349
+ paddingBottom: this.safeAreaInsets + 'px',
350
+ backgroundColor: this.bg
351
+ }
352
+ // TODO 兼容 type 属性 ,后续会废弃
353
+ if (type) return
354
+ this.showPopup = true
355
+ this.showTrans = true
356
+ },
357
+ /**
358
+ * 中间弹出样式处理
359
+ */
360
+ center(type) {
361
+ this.popupstyle = 'center'
362
+ this.ani = ['zoom-out', 'fade']
363
+ this.transClass = {
364
+ position: 'fixed',
365
+ /* #ifndef APP-NVUE */
366
+ display: 'flex',
367
+ flexDirection: 'column',
368
+ /* #endif */
369
+ bottom: 0,
370
+ left: 0,
371
+ right: 0,
372
+ top: 0,
373
+ justifyContent: 'center',
374
+ alignItems: 'center'
375
+ }
376
+ // TODO 兼容 type 属性 ,后续会废弃
377
+ if (type) return
378
+ this.showPopup = true
379
+ this.showTrans = true
380
+ },
381
+ left(type) {
382
+ this.popupstyle = 'left'
383
+ this.ani = ['slide-left']
384
+ this.transClass = {
385
+ position: 'fixed',
386
+ left: 0,
387
+ bottom: 0,
388
+ top: 0,
389
+ backgroundColor: this.bg,
390
+ /* #ifndef APP-NVUE */
391
+ display: 'flex',
392
+ flexDirection: 'column'
393
+ /* #endif */
394
+ }
395
+ // TODO 兼容 type 属性 ,后续会废弃
396
+ if (type) return
397
+ this.showPopup = true
398
+ this.showTrans = true
399
+ },
400
+ right(type) {
401
+ this.popupstyle = 'right'
402
+ this.ani = ['slide-right']
403
+ this.transClass = {
404
+ position: 'fixed',
405
+ bottom: 0,
406
+ right: 0,
407
+ top: 0,
408
+ backgroundColor: this.bg,
409
+ /* #ifndef APP-NVUE */
410
+ display: 'flex',
411
+ flexDirection: 'column'
412
+ /* #endif */
413
+ }
414
+ // TODO 兼容 type 属性 ,后续会废弃
415
+ if (type) return
416
+ this.showPopup = true
417
+ this.showTrans = true
418
+ }
419
+ }
420
+ }
421
+ </script>
422
+ <style lang="scss">
423
+ .uni-popup {
424
+ position: fixed;
425
+ /* #ifndef APP-NVUE */
426
+ z-index: 99;
427
+
428
+ /* #endif */
429
+ &.top,
430
+ &.left,
431
+ &.right {
432
+ /* #ifdef H5 */
433
+ top: var(--window-top);
434
+ /* #endif */
435
+ /* #ifndef H5 */
436
+ top: 0;
437
+ /* #endif */
438
+ }
439
+
440
+ .uni-popup__wrapper {
441
+ /* #ifndef APP-NVUE */
442
+ display: block;
443
+ /* #endif */
444
+ position: relative;
445
+
446
+ /* iphonex 等安全区设置,底部安全区适配 */
447
+ /* #ifndef APP-NVUE */
448
+ // padding-bottom: constant(safe-area-inset-bottom);
449
+ // padding-bottom: env(safe-area-inset-bottom);
450
+ /* #endif */
451
+ &.left,
452
+ &.right {
453
+ /* #ifdef H5 */
454
+ padding-top: var(--window-top);
455
+ /* #endif */
456
+ /* #ifndef H5 */
457
+ padding-top: 0;
458
+ /* #endif */
459
+ flex: 1;
460
+ }
461
+ }
462
+ }
463
+
464
+ .fixforpc-z-index {
465
+ /* #ifndef APP-NVUE */
466
+ z-index: 999;
467
+ /* #endif */
468
+ }
469
+
470
+ .fixforpc-top {
471
+ top: 0;
472
+ }
473
+ </style>
@@ -0,0 +1,45 @@
1
+ // #ifdef H5
2
+ export default {
3
+ name: 'Keypress',
4
+ props: {
5
+ disable: {
6
+ type: Boolean,
7
+ default: false
8
+ }
9
+ },
10
+ mounted () {
11
+ const keyNames = {
12
+ esc: ['Esc', 'Escape'],
13
+ tab: 'Tab',
14
+ enter: 'Enter',
15
+ space: [' ', 'Spacebar'],
16
+ up: ['Up', 'ArrowUp'],
17
+ left: ['Left', 'ArrowLeft'],
18
+ right: ['Right', 'ArrowRight'],
19
+ down: ['Down', 'ArrowDown'],
20
+ delete: ['Backspace', 'Delete', 'Del']
21
+ }
22
+ const listener = ($event) => {
23
+ if (this.disable) {
24
+ return
25
+ }
26
+ const keyName = Object.keys(keyNames).find(key => {
27
+ const keyName = $event.key
28
+ const value = keyNames[key]
29
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
+ })
31
+ if (keyName) {
32
+ // 避免和其他按键事件冲突
33
+ setTimeout(() => {
34
+ this.$emit(keyName, {})
35
+ }, 0)
36
+ }
37
+ }
38
+ document.addEventListener('keyup', listener)
39
+ this.$once('hook:beforeDestroy', () => {
40
+ document.removeEventListener('keyup', listener)
41
+ })
42
+ },
43
+ render: () => {}
44
+ }
45
+ // #endif