oxy-uni-ui 1.2.0 → 2.0.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 (306) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +396 -321
  3. package/components/common/path.ts +9 -0
  4. package/components/common/util.ts +200 -5
  5. package/components/composables/index.ts +1 -0
  6. package/components/composables/useGlobalLoading.ts +42 -0
  7. package/components/composables/useGlobalMessage.ts +48 -0
  8. package/components/composables/useGlobalToast.ts +84 -0
  9. package/components/composables/usePopover.ts +24 -20
  10. package/components/composables/useVirtualScroll.ts +13 -11
  11. package/components/composables/useWindowResize.ts +35 -0
  12. package/components/oxy-action-sheet/index.scss +24 -11
  13. package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
  14. package/components/oxy-action-sheet/types.ts +7 -0
  15. package/components/oxy-backtop/index.scss +3 -3
  16. package/components/oxy-backtop/oxy-backtop.vue +9 -6
  17. package/components/oxy-backtop/types.ts +7 -7
  18. package/components/oxy-badge/index.scss +4 -4
  19. package/components/oxy-badge/oxy-badge.vue +3 -3
  20. package/components/oxy-badge/types.ts +2 -2
  21. package/components/oxy-button/index.scss +5 -5
  22. package/components/oxy-button/oxy-button.vue +5 -1
  23. package/components/oxy-calendar/index.scss +11 -11
  24. package/components/oxy-calendar/oxy-calendar.vue +1 -0
  25. package/components/oxy-calendar/types.ts +5 -0
  26. package/components/oxy-calendar-view/month/index.scss +4 -4
  27. package/components/oxy-calendar-view/month/types.ts +36 -0
  28. package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
  29. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  30. package/components/oxy-calendar-view/year/index.scss +4 -4
  31. package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
  32. package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
  33. package/components/oxy-card/index.scss +2 -2
  34. package/components/oxy-cell/index.scss +8 -8
  35. package/components/oxy-cell/oxy-cell.vue +15 -2
  36. package/components/oxy-cell/types.ts +4 -0
  37. package/components/oxy-checkbox/index.scss +8 -8
  38. package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
  39. package/components/oxy-checkbox-group/index.scss +2 -2
  40. package/components/oxy-circle/oxy-circle.vue +10 -7
  41. package/components/oxy-circle/types.ts +5 -5
  42. package/components/oxy-col/oxy-col.vue +2 -2
  43. package/components/oxy-col-picker/index.scss +4 -4
  44. package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
  45. package/components/oxy-col-picker/types.ts +12 -3
  46. package/components/oxy-collapse/index.scss +2 -2
  47. package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
  48. package/components/oxy-corner/index.scss +32 -32
  49. package/components/oxy-corner/oxy-corner.vue +15 -3
  50. package/components/oxy-corner/types.ts +15 -1
  51. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  52. package/components/oxy-curtain/index.scss +15 -15
  53. package/components/oxy-curtain/oxy-curtain.vue +4 -2
  54. package/components/oxy-curtain/types.ts +6 -1
  55. package/components/oxy-date-strip/index.scss +10 -0
  56. package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
  57. package/components/oxy-date-strip/types.ts +98 -0
  58. package/components/oxy-date-strip/utils.ts +67 -0
  59. package/components/oxy-date-strip-item/index.scss +94 -0
  60. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
  61. package/components/oxy-date-strip-item/types.ts +53 -0
  62. package/components/oxy-datetime-picker/index.scss +11 -11
  63. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
  64. package/components/oxy-datetime-picker/types.ts +10 -1
  65. package/components/oxy-drop-menu/index.scss +3 -3
  66. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  67. package/components/oxy-drop-menu-item/index.scss +1 -1
  68. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
  69. package/components/oxy-drop-menu-item/types.ts +5 -0
  70. package/components/oxy-echarts/index.scss +17 -0
  71. package/components/oxy-echarts/index.ts +1 -0
  72. package/components/oxy-echarts/oxy-echarts.vue +32 -0
  73. package/components/oxy-echarts/types.ts +18 -0
  74. package/components/oxy-fab/index.scss +8 -8
  75. package/components/oxy-fab/oxy-fab.vue +22 -3
  76. package/components/oxy-file-list/index.scss +42 -15
  77. package/components/oxy-file-list/oxy-file-list.vue +208 -34
  78. package/components/oxy-file-list/types.ts +58 -2
  79. package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
  80. package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
  81. package/components/oxy-footer/index.scss +19 -0
  82. package/components/oxy-footer/oxy-footer.vue +78 -0
  83. package/components/oxy-footer/types.ts +17 -0
  84. package/components/oxy-form-item/types.ts +22 -1
  85. package/components/oxy-gap/oxy-gap.vue +2 -2
  86. package/components/oxy-gap/types.ts +2 -2
  87. package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
  88. package/components/oxy-global-message/oxy-global-message.vue +64 -0
  89. package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
  90. package/components/oxy-grid/oxy-grid.vue +1 -1
  91. package/components/oxy-grid/types.ts +1 -1
  92. package/components/oxy-grid-item/index.scss +1 -1
  93. package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
  94. package/components/oxy-grid-item/types.ts +1 -1
  95. package/components/oxy-guidance/index.scss +75 -0
  96. package/components/oxy-guidance/oxy-guidance.vue +201 -0
  97. package/components/oxy-guidance/types.ts +33 -0
  98. package/components/oxy-icon/oxy-icon.vue +2 -2
  99. package/components/oxy-icon/types.ts +1 -1
  100. package/components/oxy-img/oxy-img.vue +4 -4
  101. package/components/oxy-img/types.ts +3 -3
  102. package/components/oxy-img-cropper/index.scss +12 -12
  103. package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
  104. package/components/oxy-img-cropper/types.ts +2 -2
  105. package/components/oxy-img-lazy/index.scss +17 -0
  106. package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
  107. package/components/oxy-img-lazy/types.ts +69 -0
  108. package/components/oxy-index-anchor/index.scss +2 -2
  109. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  110. package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
  111. package/components/oxy-index-bar/index.scss +3 -3
  112. package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
  113. package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
  114. package/components/oxy-input/index.scss +1 -1
  115. package/components/oxy-input-number/index.scss +5 -5
  116. package/components/oxy-input-number/oxy-input-number.vue +2 -2
  117. package/components/oxy-input-number/types.ts +3 -2
  118. package/components/oxy-keyboard/index.scss +5 -5
  119. package/components/oxy-keyboard/key/index.scss +3 -3
  120. package/components/oxy-keyboard/key/index.vue +2 -2
  121. package/components/oxy-keyboard/key/types.ts +15 -0
  122. package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
  123. package/components/oxy-keyboard/types.ts +5 -0
  124. package/components/oxy-link/index.scss +57 -0
  125. package/components/oxy-link/oxy-link.vue +130 -0
  126. package/components/oxy-link/types.ts +81 -0
  127. package/components/oxy-list/index.scss +7 -1
  128. package/components/oxy-list/oxy-list.vue +4 -3
  129. package/components/oxy-list/types.ts +1 -1
  130. package/components/oxy-loading/oxy-loading.vue +8 -4
  131. package/components/oxy-loading/types.ts +1 -1
  132. package/components/oxy-loadmore/index.scss +3 -3
  133. package/components/oxy-long-press-menu/index.scss +93 -0
  134. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
  135. package/components/oxy-long-press-menu/types.ts +34 -0
  136. package/components/oxy-message-box/index.scss +12 -11
  137. package/components/oxy-message-box/oxy-message-box.vue +11 -3
  138. package/components/oxy-message-box/types.ts +14 -0
  139. package/components/oxy-navbar/index.scss +2 -2
  140. package/components/oxy-navbar/oxy-navbar.vue +58 -13
  141. package/components/oxy-navbar/types.ts +8 -1
  142. package/components/oxy-navbar-capsule/types.ts +3 -0
  143. package/components/oxy-notice-bar/index.scss +3 -3
  144. package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
  145. package/components/oxy-notice-bar/types.ts +3 -3
  146. package/components/oxy-notify/index.ts +1 -0
  147. package/components/oxy-notify/oxy-notify.vue +3 -2
  148. package/components/oxy-notify/types.ts +7 -0
  149. package/components/oxy-pagination/index.scss +1 -1
  150. package/components/oxy-password-input/oxy-password-input.vue +2 -2
  151. package/components/oxy-password-input/types.ts +1 -1
  152. package/components/oxy-picker/index.scss +45 -2
  153. package/components/oxy-picker/oxy-picker.vue +103 -14
  154. package/components/oxy-picker/types.ts +33 -1
  155. package/components/oxy-picker-view/index.scss +3 -3
  156. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  157. package/components/oxy-popover/index.scss +9 -9
  158. package/components/oxy-popup/index.scss +2 -2
  159. package/components/oxy-popup/oxy-popup.vue +35 -2
  160. package/components/oxy-popup/types.ts +8 -1
  161. package/components/oxy-progress/index.scss +3 -3
  162. package/components/oxy-qrcode/draw.ts +398 -0
  163. package/components/oxy-qrcode/index.scss +2 -0
  164. package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
  165. package/components/oxy-qrcode/qrcode.ts +936 -0
  166. package/components/oxy-qrcode/types.ts +42 -0
  167. package/components/oxy-radio/index.scss +13 -13
  168. package/components/oxy-radio/oxy-radio.vue +1 -1
  169. package/components/oxy-radio-group/index.scss +2 -2
  170. package/components/oxy-rate/types.ts +4 -4
  171. package/components/oxy-resize/index.scss +2 -2
  172. package/components/oxy-resize/oxy-resize.vue +4 -4
  173. package/components/oxy-resize/types.ts +3 -0
  174. package/components/oxy-rich-text/icon/emjio.svg +1 -0
  175. package/components/oxy-rich-text/icon/quote.svg +1 -0
  176. package/components/oxy-rich-text/icon/text.svg +1 -0
  177. package/components/oxy-rich-text/icon/title.svg +1 -0
  178. package/components/oxy-rich-text/index.scss +160 -0
  179. package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
  180. package/components/oxy-rich-text/mp-html/card/index.js +7 -0
  181. package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
  182. package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
  183. package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
  184. package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
  185. package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
  186. package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
  187. package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
  188. package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
  189. package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
  190. package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
  191. package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
  192. package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
  193. package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
  194. package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
  195. package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
  196. package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
  197. package/components/oxy-rich-text/mp-html/parser.js +1428 -0
  198. package/components/oxy-rich-text/mp-html/search/index.js +132 -0
  199. package/components/oxy-rich-text/mp-html/style/index.js +129 -0
  200. package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
  201. package/components/oxy-rich-text/mp-html/template/index.js +67 -0
  202. package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
  203. package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
  204. package/components/oxy-rich-text/types.ts +76 -0
  205. package/components/oxy-row/oxy-row.vue +3 -3
  206. package/components/oxy-row/types.ts +1 -1
  207. package/components/oxy-search/index.scss +3 -3
  208. package/components/oxy-segmented/index.scss +16 -16
  209. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  210. package/components/oxy-select/index.scss +331 -0
  211. package/components/oxy-select/oxy-select.vue +456 -0
  212. package/components/oxy-select/types.ts +83 -0
  213. package/components/oxy-select-picker/index.scss +7 -7
  214. package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
  215. package/components/oxy-select-picker/types.ts +7 -1
  216. package/components/oxy-sidebar-item/index.scss +1 -1
  217. package/components/oxy-signature/oxy-signature.vue +18 -10
  218. package/components/oxy-signature/types.ts +106 -13
  219. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  220. package/components/oxy-skeleton/types.ts +1 -1
  221. package/components/oxy-slider/index.scss +3 -3
  222. package/components/oxy-sort-button/index.scss +8 -8
  223. package/components/oxy-status-tip/index.scss +4 -4
  224. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  225. package/components/oxy-status-tip/types.ts +3 -3
  226. package/components/oxy-step/index.scss +14 -14
  227. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  228. package/components/oxy-stream-render/index.scss +6 -0
  229. package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
  230. package/components/oxy-stream-render/types.ts +8 -0
  231. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  232. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  233. package/components/oxy-swiper/types.ts +5 -5
  234. package/components/oxy-switch/index.scss +8 -8
  235. package/components/oxy-switch/oxy-switch.vue +2 -2
  236. package/components/oxy-switch/types.ts +1 -1
  237. package/components/oxy-tab/index.scss +11 -1
  238. package/components/oxy-tabbar/index.scss +1 -1
  239. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  240. package/components/oxy-table/index.scss +5 -5
  241. package/components/oxy-table/oxy-table.vue +8 -6
  242. package/components/oxy-table/types.ts +2 -2
  243. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  244. package/components/oxy-table-col/types.ts +2 -2
  245. package/components/oxy-tabs/index.scss +43 -15
  246. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  247. package/components/oxy-tabs/types.ts +15 -3
  248. package/components/oxy-tag/index.scss +15 -15
  249. package/components/oxy-text/index.scss +5 -1
  250. package/components/oxy-text/oxy-text.vue +76 -7
  251. package/components/oxy-text/types.ts +12 -0
  252. package/components/oxy-textarea/index.scss +6 -6
  253. package/components/oxy-toast/oxy-toast.vue +24 -8
  254. package/components/oxy-tooltip/index.scss +9 -9
  255. package/components/oxy-tree/index.scss +61 -9
  256. package/components/oxy-tree/oxy-tree.vue +102 -17
  257. package/components/oxy-tree/types.ts +23 -10
  258. package/components/oxy-upload/index.scss +21 -21
  259. package/components/oxy-upload/types.ts +2 -2
  260. package/components/oxy-verification-code/index.scss +6 -0
  261. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  262. package/components/oxy-verification-code/types.ts +82 -0
  263. package/components/oxy-video-preview/index.scss +4 -4
  264. package/components/oxy-virtual-scroll/index.scss +4 -4
  265. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  266. package/components/oxy-virtual-scroll/types.ts +14 -14
  267. package/components/oxy-voice-player/index.scss +908 -0
  268. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  269. package/components/oxy-voice-player/types.ts +567 -0
  270. package/components/oxy-waterfall/index.scss +18 -0
  271. package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
  272. package/components/oxy-waterfall/types.ts +90 -0
  273. package/components/oxy-waterfall-item/index.scss +8 -0
  274. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
  275. package/components/oxy-waterfall-item/types.ts +16 -0
  276. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  277. package/components/oxy-watermark/types.ts +14 -14
  278. package/global.d.ts +9 -0
  279. package/index.ts +3 -0
  280. package/locale/lang/ar-SA.ts +3 -0
  281. package/locale/lang/en-US.ts +29 -0
  282. package/locale/lang/zh-CN.ts +29 -0
  283. package/package.json +97 -1
  284. package/tags.json +1 -1
  285. package/uni-echarts/changelog.md +2 -0
  286. package/uni-echarts/components/index.js +1 -0
  287. package/uni-echarts/components/uni-echarts/events.js +95 -0
  288. package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
  289. package/uni-echarts/components/uni-echarts/types.js +1 -0
  290. package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
  291. package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
  292. package/uni-echarts/global.d.ts +7 -0
  293. package/uni-echarts/index.d.ts +440 -0
  294. package/uni-echarts/index.js +2 -0
  295. package/uni-echarts/package.json +105 -0
  296. package/uni-echarts/shared-core.d.ts +269 -0
  297. package/uni-echarts/shared-core.js +900 -0
  298. package/web-types.json +1 -1
  299. package/components/oxy-number-keyboard/index.scss +0 -78
  300. package/components/oxy-number-keyboard/key/index.scss +0 -81
  301. package/components/oxy-number-keyboard/key/index.vue +0 -78
  302. package/components/oxy-number-keyboard/key/types.ts +0 -11
  303. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  304. package/components/oxy-number-keyboard/types.ts +0 -83
  305. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  306. package/components/oxy-tree/index.ts +0 -51
@@ -0,0 +1,67 @@
1
+ import type { WeekRange, DateType, DisableDate } from './types'
2
+
3
+ /**
4
+ * 获取指定日期所在周的日期范围。
5
+ * @param {Date} date - 指定日期。
6
+ * @param {number} firstDayOfWeek - 一周的第一天,0 表示周日,1 表示周一,以此类推。
7
+ * @returns {WeekRange} 返回一个包含周起始和结束日期的对象。
8
+ */
9
+
10
+ export function getWeekRange(date: Date, firstDayOfWeek: number): WeekRange {
11
+ const start = new Date(date.getTime())
12
+ const dayOffset = (date.getDay() - firstDayOfWeek + 7) % 7
13
+ start.setDate(start.getDate() - dayOffset)
14
+
15
+ const end = new Date(start.getTime())
16
+ end.setDate(end.getDate() + 6)
17
+ return { start, end } as WeekRange
18
+ }
19
+
20
+ /**
21
+ * 向指定日期添加天数。
22
+ * @param {Date} date - 基础日期。
23
+ * @param {number} days - 要添加的天数,可以是正数或负数。
24
+ * @returns {Date} 返回一个新的日期对象,该对象是基础日期加上指定天数后的结果。
25
+ */
26
+ export function addDays(date: Date, days: number): Date {
27
+ const result = new Date(date.getTime())
28
+ result.setDate(result.getDate() + days)
29
+ return result
30
+ }
31
+
32
+ export function addWeeks(date: Date, weeks: number): Date {
33
+ const result = new Date(date.getTime())
34
+ result.setDate(result.getDate() + weeks * 7)
35
+ return result
36
+ }
37
+
38
+ /**
39
+ * 判断两个日期是否表示同一天(忽略时间部分)。
40
+ *
41
+ * @param date1 - 第一个日期。
42
+ * @param date2 - 第二个日期。
43
+ * @returns 如果两个日期是同一天,返回 true;否则返回 false。
44
+ */
45
+ function isSameDay(date1: Date, date2: Date): boolean {
46
+ return date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() == date2.getDate()
47
+ }
48
+ export function calcType(date: Date, minDate: Date, maxDate: Date, selectedDate: Date | null, disableDate?: DisableDate): DateType {
49
+ // 检查日期是否早于 minDate 或晚于 maxDate
50
+ if (date.getTime() < minDate.getTime() || date.getTime() > maxDate.getTime()) {
51
+ return 'disabled'
52
+ }
53
+ if (disableDate && disableDate(date)) {
54
+ return 'disabled'
55
+ }
56
+ // 如果 selectedDate 不为 null,检查日期是否等于 selectedDate
57
+ if (selectedDate != null && isSameDay(date, selectedDate)) {
58
+ return 'selected'
59
+ }
60
+ return ''
61
+ }
62
+
63
+ export function daysBetween(date1: Date, date2: Date): number {
64
+ // 将两个日期转换为毫秒
65
+ const diffInMilliseconds = Math.abs(date2.getTime() - date1.getTime())
66
+ return Math.floor(diffInMilliseconds / (1000 * 3600 * 24))
67
+ }
@@ -0,0 +1,94 @@
1
+ @import '../common/abstracts/variable';
2
+ @import '../common/abstracts/mixin';
3
+
4
+ @include b(date-strip-item) {
5
+ display: flex;
6
+ flex-direction: row;
7
+ padding: $-date-strip-padding-y $-date-strip-padding-x;
8
+ box-sizing: border-box;
9
+ /* #ifndef UNI-APP-X && APP */
10
+ height: 100%;
11
+ /* #endif */
12
+ &--week {
13
+ flex: 1;
14
+ .oxy-date-strip-item__grid {
15
+ flex: 1;
16
+ }
17
+ }
18
+ &--none {
19
+ .oxy-date-strip-item__grid {
20
+ width: $-date-strip-grid-width;
21
+ }
22
+ }
23
+ &__grid {
24
+ /* #ifndef UNI-APP-X && APP */
25
+ flex-shrink: 0;
26
+ /* #endif */
27
+ display: flex;
28
+ flex-direction: column;
29
+ margin: 0 4rpx;
30
+ transition-duration: 300ms;
31
+ transition-property: background-color, color;
32
+ transition-timing-function: linear;
33
+
34
+ &-prefix,&-day,&-suffix {
35
+ text-align: center;
36
+ transition-duration: 200ms;
37
+ transition-property: color;
38
+ transition-timing-function: linear;
39
+ }
40
+ &-prefix {
41
+ font-size: $-date-strip-prefix-font-size;
42
+ color: $-date-strip-prefix-color;
43
+ }
44
+ &--none {
45
+ .oxy-date-strip-item__grid-prefix {
46
+ padding-bottom: 8rpx;
47
+ padding-top: 8rpx;
48
+ }
49
+ }
50
+ &--circle {
51
+ .oxy-date-strip-item__grid-prefix {
52
+ padding-bottom: 8rpx;
53
+ }
54
+ .oxy-date-strip-item__grid-info {
55
+ border-radius: $-date-strip-grid-circle-radius;
56
+ }
57
+ }
58
+ &--square {
59
+ border-radius: $-date-strip-square-radius;
60
+ padding: $-date-strip-grid-square-padding-y $-date-strip-grid-square-padding-x;
61
+ }
62
+ &-suffix {
63
+ position: absolute;
64
+ top: 50%;
65
+ transform: translateY(60%);
66
+ font-size: $-date-strip-suffix-font-size;
67
+ color: $-date-strip-suffix-color;
68
+ }
69
+ &-day {
70
+ font-size: $-date-strip-font-size;
71
+ color: $-date-strip-color;
72
+ font-weight: bold;
73
+ }
74
+ &-info {
75
+ display: flex;
76
+ flex: 1;
77
+ justify-content: center;
78
+ align-items: center;
79
+ position: relative;
80
+ }
81
+ &--active-bg {
82
+ background-color: $-date-strip-active-color;
83
+ }
84
+ &--active-text {
85
+ color: white;
86
+ &-none {
87
+ color: $-date-strip-active-color;
88
+ }
89
+ }
90
+ &--disabled {
91
+ opacity: 0.4;
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <view :class="`oxy-date-strip-item oxy-date-strip-item--${switchMode} ${customClass}`" :style="customStyle">
3
+ <view
4
+ class="oxy-date-strip-item__grid"
5
+ v-for="item in dates"
6
+ :style="[
7
+ styles,
8
+ item.type == 'selected' && shape == 'square' && activeBgColor != null ? { background: activeBgColor } : {},
9
+ shape == 'square' && radius != null ? { 'border-radius': radius } : {}
10
+ ]"
11
+ :class="[
12
+ 'oxy-date-strip-item__grid--' + shape,
13
+ {
14
+ 'oxy-date-strip-item__grid--active-bg': shape == 'square' && item.type == 'selected',
15
+ 'oxy-date-strip-item__grid--disabled': item.type == 'disabled',
16
+ 'oxy-date-strip-item__grid--selected': item.type == 'selected'
17
+ }
18
+ ]"
19
+ @click="onClick(item)"
20
+ :key="item.key"
21
+ >
22
+ <text
23
+ class="oxy-date-strip-item__grid-prefix"
24
+ :class="{
25
+ 'oxy-date-strip-item__grid--active-text': item.type == 'selected' && shape == 'square',
26
+ 'oxy-date-strip-item__grid--active-text-none': item.type == 'selected' && shape == 'none'
27
+ }"
28
+ :style="[item.type == 'selected' && activeColor ? { color: activeColor } : {}]"
29
+ >
30
+ {{ item.prefix }}
31
+ </text>
32
+ <view
33
+ class="oxy-date-strip-item__grid-info"
34
+ :class="{
35
+ 'oxy-date-strip-item__grid--active-bg': shape == 'circle' && item.type == 'selected'
36
+ }"
37
+ :style="[
38
+ item.type == 'selected' && shape == 'circle' && activeBgColor ? { background: activeBgColor } : {},
39
+ shape == 'square' && radius ? { 'border-radius': radius } : {}
40
+ ]"
41
+ >
42
+ <text
43
+ class="oxy-date-strip-item__grid-day"
44
+ :class="{
45
+ 'oxy-date-strip-item__grid--active-text': item.type == 'selected' && shape != 'none',
46
+ 'oxy-date-strip-item__grid--active-text-none': item.type == 'selected' && shape == 'none'
47
+ }"
48
+ :style="[item.type == 'selected' && activeColor ? { color: activeColor } : {}]"
49
+ >
50
+ {{ item.text }}
51
+ </text>
52
+ <text
53
+ class="oxy-date-strip-item__grid-suffix"
54
+ :class="{
55
+ 'oxy-date-strip-item__grid--active-text': item.type == 'selected' && shape != 'none',
56
+ 'oxy-date-strip-item__grid--active-text-none': item.type == 'selected' && shape == 'none'
57
+ }"
58
+ :style="[item.type == 'selected' && activeColor ? { color: activeColor } : {}]"
59
+ v-if="item.suffix"
60
+ >
61
+ {{ item.suffix }}
62
+ </text>
63
+ </view>
64
+ </view>
65
+ </view>
66
+ </template>
67
+
68
+ <script lang="ts">
69
+ export default {
70
+ name: 'oxy-date-strip-item',
71
+ options: {
72
+ addGlobalClass: true,
73
+ virtualHost: true,
74
+ styleIsolation: 'shared'
75
+ }
76
+ }
77
+ </script>
78
+
79
+ <script lang="ts" setup>
80
+ import { ref, computed } from 'vue'
81
+ import { dateStripItemProps } from './types'
82
+ import type { DateStriPDay } from '../oxy-date-strip/types'
83
+
84
+ const props = defineProps(dateStripItemProps)
85
+ const emit = defineEmits(['click'])
86
+
87
+ const styles = computed(() => {
88
+ const style: Record<string, any> = {}
89
+ if (props.gridWidth && props.switchMode == 'none') {
90
+ style['width'] = props.gridWidth
91
+ }
92
+ return style
93
+ })
94
+
95
+ const onClick = (day: DateStriPDay) => {
96
+ emit('click', day)
97
+ }
98
+ </script>
99
+
100
+ <style lang="scss" scoped>
101
+ @import './index.scss';
102
+ </style>
@@ -0,0 +1,53 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue'
2
+ import { baseProps } from '../common/props'
3
+ import type { DateStriPDay, DateStripShape, DateStripSwitchMode } from '../oxy-date-strip/types'
4
+
5
+ export const dateStripItemProps = {
6
+ ...baseProps,
7
+ dates: {
8
+ type: Array as PropType<DateStriPDay[]>,
9
+ default: () => []
10
+ },
11
+ // 网格宽度
12
+ gridWidth: {
13
+ type: String,
14
+ default: null
15
+ },
16
+ // 主题色,对底部按钮和选中日期生效
17
+ color: {
18
+ type: String,
19
+ default: null
20
+ },
21
+ // 选中日期的背景色
22
+ activeBgColor: {
23
+ type: String,
24
+ default: null
25
+ },
26
+ // 选中日期的文字颜色
27
+ activeColor: {
28
+ type: String,
29
+ default: null
30
+ },
31
+ // 背景色
32
+ bgColor: {
33
+ type: String,
34
+ default: null
35
+ },
36
+ // 圆角半径
37
+ radius: {
38
+ type: String,
39
+ default: null
40
+ },
41
+ // 切换模式,'week' 或 'none'
42
+ switchMode: {
43
+ type: String as PropType<DateStripSwitchMode>,
44
+ default: 'week'
45
+ },
46
+ // 形状,'square'、'circle' 或 'none'
47
+ shape: {
48
+ type: String as PropType<DateStripShape>,
49
+ default: 'square'
50
+ }
51
+ }
52
+
53
+ export type DateStripItemProps = ExtractPropTypes<typeof dateStripItemProps>
@@ -21,7 +21,7 @@
21
21
 
22
22
  @include e(region) {
23
23
  color: $-dark-color;
24
-
24
+
25
25
  @include when(active) {
26
26
  background: $-picker-region-bg-active-color;
27
27
  color: $-dark-color;
@@ -29,7 +29,7 @@
29
29
  }
30
30
  }
31
31
  }
32
-
32
+
33
33
 
34
34
  @include b(datetime-picker) {
35
35
  @include edeep(cell) {
@@ -52,13 +52,13 @@
52
52
  font-size: $-cell-icon-size-large;
53
53
  }
54
54
  }
55
-
55
+
56
56
  .oxy-cell__value--ellipsis {
57
57
  view {
58
58
  @include lineEllipsis;
59
59
  width: 100%;
60
60
  }
61
-
61
+
62
62
  text {
63
63
  @include lineEllipsis;
64
64
  max-width: 100%;
@@ -69,7 +69,7 @@
69
69
  @include e(placeholder) {
70
70
  color: $-input-placeholder-color;
71
71
  }
72
-
72
+
73
73
  @include edeep(arrow) {
74
74
  display: block;
75
75
  font-size: $-cell-icon-size;
@@ -85,7 +85,7 @@
85
85
  }
86
86
 
87
87
  @include edeep(popup) {
88
- border-radius: 16px 16px 0px 0px;
88
+ border-radius: 32rpx 32rpx 0 0;
89
89
  }
90
90
 
91
91
  @include e(wraper) {
@@ -110,7 +110,7 @@
110
110
  font-size: $-picker-toolbar-fs;
111
111
  color: $-picker-toolbar-finish-color;
112
112
  background: transparent;
113
- padding: 24px 15px 14px 15px;
113
+ padding: 48rpx 30rpx 28rpx 30rpx;
114
114
 
115
115
  @include m(cancel) {
116
116
  color: $-picker-toolbar-cancel-color;
@@ -135,9 +135,9 @@
135
135
  display: inline-block;
136
136
  color: $-picker-region-color;
137
137
  text-align: center;
138
- padding: 14px 0;
138
+ padding: 28rpx 0;
139
139
  font-size: $-picker-region-fs;
140
- line-height: 16px;
140
+ line-height: 32rpx;
141
141
  transition: all 0.15s ease-out;
142
142
 
143
143
  @include when(active) {
@@ -147,8 +147,8 @@
147
147
  }
148
148
 
149
149
  @include e(region-time) {
150
- font-size: 16px;
151
- margin-top: 2px;
150
+ font-size: 32rpx;
151
+ margin-top: 4rpx;
152
152
  }
153
153
 
154
154
  @include e(hidden) {
@@ -57,6 +57,7 @@
57
57
  position="bottom"
58
58
  :hide-when-close="false"
59
59
  :close-on-click-modal="closeOnClickModal"
60
+ :max-width="popupMaxWidth"
60
61
  :safe-area-inset-bottom="safeAreaInsetBottom"
61
62
  :z-index="zIndex"
62
63
  :root-portal="rootPortal"
@@ -512,7 +513,9 @@ function close() {
512
513
 
513
514
  function showPopup() {
514
515
  if (props.disabled || props.readonly) return
515
-
516
+ if (isFunction(props.beforeOpen) && !props.beforeOpen()) {
517
+ return
518
+ }
516
519
  emit('open')
517
520
  if (region.value) {
518
521
  popupShow.value = true
@@ -157,6 +157,11 @@ export const datetimePickerProps = {
157
157
  * 弹窗层级
158
158
  */
159
159
  zIndex: makeNumberProp(15),
160
+ /**
161
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
162
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
163
+ */
164
+ popupMaxWidth: makeStringProp('1200rpx'),
160
165
  /**
161
166
  * 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
162
167
  */
@@ -196,7 +201,11 @@ export const datetimePickerProps = {
196
201
  /**
197
202
  * 必填标记位置,可选值:before、after
198
203
  */
199
- markerSide: makeStringProp<'before' | 'after'>('before')
204
+ markerSide: makeStringProp<'before' | 'after'>('before'),
205
+ /**
206
+ * 打开pop之前的校验
207
+ */
208
+ beforeOpen: Function as PropType<() => boolean>
200
209
  }
201
210
 
202
211
  export type DatetimePickerDisplayFormat = (items: Record<string, any>[]) => string
@@ -66,9 +66,9 @@
66
66
  &::after {
67
67
  position: absolute;
68
68
  content: '';
69
- width: 19px;
69
+ width: 38rpx;
70
70
  height: $-drop-menu-line-height;
71
- bottom: 6px;
71
+ bottom: 12rpx;
72
72
  left: 50%;
73
73
  transform: translate(-50%, 0);
74
74
  background: $-drop-menu-line-color;
@@ -85,6 +85,6 @@
85
85
 
86
86
  @include edeep(arrow) {
87
87
  font-size: $-drop-menu-arrow-fs;
88
- margin-left: 2px;
88
+ margin-left: 4rpx;
89
89
  }
90
90
  }
@@ -47,7 +47,7 @@ export default {
47
47
  import { computed, getCurrentInstance, inject, onBeforeMount, ref, watch } from 'vue'
48
48
  import { closeOther } from '../common/clickoutside'
49
49
  import { type Queue, queueKey } from '../composables/useQueue'
50
- import { getRect, uuid } from '../common/util'
50
+ import { getRect, unitConvert, uuid } from '../common/util'
51
51
  import { useChildren } from '../composables/useChildren'
52
52
  import { DROP_MENU_KEY, dropMenuProps } from './types'
53
53
  import OxyOverlay from '../oxy-overlay/oxy-overlay.vue'
@@ -59,10 +59,10 @@ const offset = ref<number>(0)
59
59
  const windowHeight = ref<number>(0)
60
60
  const modalStyle = computed(() => {
61
61
  return props.direction === 'down'
62
- ? `top: calc(var(--window-top) + ${offset.value}px); bottom: 0;`
62
+ ? `top: calc(var(--window-top) + ${unitConvert(offset.value, 0, { output: 'px' })}); bottom: 0;`
63
63
  : props.direction === 'bottom'
64
64
  ? 'top: var(--window-top); bottom: 0;'
65
- : `top: 0; bottom: calc(var(--window-bottom) + ${offset.value}px)`
65
+ : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(offset.value, 0, { output: 'px' })})`
66
66
  })
67
67
 
68
68
  const { proxy } = getCurrentInstance() as any
@@ -48,7 +48,7 @@
48
48
  display: inline-block;
49
49
  color: $-drop-menu-item-color-tip;
50
50
  font-size: $-drop-menu-item-fs-tip;
51
- margin-left: 2px;
51
+ margin-left: 4rpx;
52
52
  }
53
53
 
54
54
  @include edeep(icon) {
@@ -9,6 +9,7 @@
9
9
  :z-index="zIndex"
10
10
  :duration="duration"
11
11
  :position="position"
12
+ :max-width="popupMaxWidth"
12
13
  :custom-style="`position: absolute; pointer-events: auto; max-height: ${popupHeight ? popupHeight : '80%'}; ${customPopupStyle}`"
13
14
  :custom-class="customPopupClass"
14
15
  :modal="false"
@@ -61,7 +62,7 @@ import { type Queue, queueKey } from '../composables/useQueue'
61
62
  import type { PopupType } from '../oxy-popup/types'
62
63
  import { useParent } from '../composables/useParent'
63
64
  import { DROP_MENU_KEY } from '../oxy-drop-menu/types'
64
- import { isDef, isFunction } from '../common/util'
65
+ import { isDef, isFunction, unitConvert } from '../common/util'
65
66
  import { dorpMenuItemProps, type DropMenuItemExpose } from './types'
66
67
 
67
68
  const props = defineProps(dorpMenuItemProps)
@@ -90,10 +91,10 @@ const positionStyle = computed(() => {
90
91
  if (showWrapper.value && dropMenu) {
91
92
  style =
92
93
  dropMenu.props.direction === 'down'
93
- ? `top: calc(var(--window-top) + ${dropMenu.offset.value}px); bottom: 0;`
94
+ ? `top: calc(var(--window-top) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })}); bottom: 0;`
94
95
  : dropMenu.props.direction === 'bottom'
95
96
  ? 'top: calc(var(--window-top); bottom: 0;'
96
- : `top: 0; bottom: calc(var(--window-bottom) + ${dropMenu.offset.value}px)`
97
+ : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })})`
97
98
  } else {
98
99
  style = ''
99
100
  }
@@ -76,6 +76,11 @@ export const dorpMenuItemProps = {
76
76
  * 弹出层高度 这里设置了 就取这里的
77
77
  */
78
78
  popupHeight: makeStringProp(''),
79
+ /**
80
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
81
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
82
+ */
83
+ popupMaxWidth: makeStringProp('1200rpx'),
79
84
  /**
80
85
  * 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
81
86
  */
@@ -0,0 +1,17 @@
1
+ .uni-echarts {
2
+ position: relative;
3
+ }
4
+
5
+ .uni-echarts__canvas {
6
+ width: 100%;
7
+ height: 100%;
8
+ }
9
+
10
+ .uni-echarts__mask {
11
+ position: absolute;
12
+ top: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: 1;
17
+ }
@@ -0,0 +1 @@
1
+ export * from '../../uni-echarts'
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <uni-echarts ref="echartsRef" v-bind="$attrs">
3
+ <slot></slot>
4
+ </uni-echarts>
5
+ </template>
6
+ <script lang="ts">
7
+ import { ref } from 'vue'
8
+ import { echartsProps } from './types'
9
+ import UniEcharts from '../../../../uni_modules/oxy-uni-ui/uni-echarts/components/uni-echarts/uni-echarts.vue'
10
+ import type { UniEchartsInst } from '../../../../uni_modules/oxy-uni-ui/uni-echarts'
11
+
12
+ export default {
13
+ name: 'oxy-echarts',
14
+ options: {
15
+ virtualHost: true,
16
+ addGlobalClass: true,
17
+ styleIsolation: 'shared'
18
+ }
19
+ }
20
+ </script>
21
+
22
+ <script lang="ts" setup>
23
+ const props = defineProps(echartsProps)
24
+ const echartsRef = ref<UniEchartsInst | null>(null)
25
+ defineExpose({
26
+ echartsInstance: echartsRef
27
+ })
28
+ </script>
29
+
30
+ <style lang="scss" scoped>
31
+ @import './index.scss';
32
+ </style>
@@ -0,0 +1,18 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import { type ComponentPublicInstance } from 'vue'
3
+ import { type UniEchartsInst } from '../../uni-echarts'
4
+
5
+ /**
6
+ * Echarts 组件属性
7
+ */
8
+ export const echartsProps = {}
9
+
10
+ export type EchartsProps = ExtractPropTypes<typeof echartsProps>
11
+ export type EchartsExpose = {
12
+ /**
13
+ * 当前图表实例
14
+ */
15
+ echartsInstance: UniEchartsInst | null
16
+ }
17
+
18
+ export type EchartsInstance = ComponentPublicInstance<EchartsProps, EchartsExpose>
@@ -67,44 +67,44 @@
67
67
  @include e(transition-enter) {
68
68
  @include m(top) {
69
69
  opacity: 0;
70
- transform: translateY(40px);
70
+ transform: translateY(80rpx);
71
71
  }
72
72
 
73
73
  @include m(bottom) {
74
74
  opacity: 0;
75
- transform: translateY(-40px);
75
+ transform: translateY(-80rpx);
76
76
  }
77
77
 
78
78
  @include m(left) {
79
79
  opacity: 0;
80
- transform: translateX(40px);
80
+ transform: translateX(80rpx);
81
81
  }
82
82
 
83
83
  @include m(right) {
84
84
  opacity: 0;
85
- transform: translateX(-40px);
85
+ transform: translateX(-80rpx);
86
86
  }
87
87
  }
88
88
 
89
89
  @include e(transition-leave-to) {
90
90
  @include m(top) {
91
91
  opacity: 0;
92
- transform: translateY(40px);
92
+ transform: translateY(80rpx);
93
93
  }
94
94
 
95
95
  @include m(bottom) {
96
96
  opacity: 0;
97
- transform: translateY(-40px);
97
+ transform: translateY(-80rpx);
98
98
  }
99
99
 
100
100
  @include m(left) {
101
101
  opacity: 0;
102
- transform: translateX(40px);
102
+ transform: translateX(80rpx);
103
103
  }
104
104
 
105
105
  @include m(right) {
106
106
  opacity: 0;
107
- transform: translateX(-40px);
107
+ transform: translateX(-80rpx);
108
108
  }
109
109
  }
110
110