oxy-uni-ui 1.1.0 → 1.2.3

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 (123) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +59 -1
  3. package/components/common/path.ts +9 -0
  4. package/components/common/util.ts +42 -0
  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/useVirtualScroll.ts +173 -0
  10. package/components/oxy-cell/oxy-cell.vue +15 -2
  11. package/components/oxy-cell/types.ts +4 -0
  12. package/components/oxy-checkbox/index.scss +1 -1
  13. package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
  14. package/components/oxy-col-picker/oxy-col-picker.vue +3 -0
  15. package/components/oxy-col-picker/types.ts +5 -1
  16. package/components/oxy-corner/index.scss +121 -1
  17. package/components/oxy-corner/oxy-corner.vue +18 -5
  18. package/components/oxy-corner/types.ts +24 -3
  19. package/components/oxy-date-strip/index.scss +10 -0
  20. package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
  21. package/components/oxy-date-strip/types.ts +98 -0
  22. package/components/oxy-date-strip/utils.ts +67 -0
  23. package/components/oxy-date-strip-item/index.scss +94 -0
  24. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
  25. package/components/oxy-date-strip-item/types.ts +53 -0
  26. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +3 -1
  27. package/components/oxy-datetime-picker/types.ts +5 -1
  28. package/components/oxy-echarts/index.scss +17 -0
  29. package/components/oxy-echarts/index.ts +1 -0
  30. package/components/oxy-echarts/oxy-echarts.vue +32 -0
  31. package/components/oxy-echarts/types.ts +12 -0
  32. package/components/oxy-file-list/index.scss +26 -0
  33. package/components/oxy-file-list/oxy-file-list.vue +208 -34
  34. package/components/oxy-file-list/types.ts +58 -2
  35. package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
  36. package/components/oxy-global-message/oxy-global-message.vue +64 -0
  37. package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
  38. package/components/oxy-img-lazy/index.scss +17 -0
  39. package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
  40. package/components/oxy-img-lazy/types.ts +69 -0
  41. package/components/oxy-link/index.scss +57 -0
  42. package/components/oxy-link/oxy-link.vue +130 -0
  43. package/components/oxy-link/types.ts +81 -0
  44. package/components/oxy-list/index.scss +8 -1
  45. package/components/oxy-list/oxy-list.vue +121 -40
  46. package/components/oxy-list/types.ts +3 -15
  47. package/components/oxy-picker/oxy-picker.vue +3 -0
  48. package/components/oxy-picker/types.ts +5 -1
  49. package/components/oxy-radio/index.scss +3 -3
  50. package/components/oxy-radio/oxy-radio.vue +1 -1
  51. package/components/oxy-rich-text/icon/emjio.svg +1 -0
  52. package/components/oxy-rich-text/icon/quote.svg +1 -0
  53. package/components/oxy-rich-text/icon/text.svg +1 -0
  54. package/components/oxy-rich-text/icon/title.svg +1 -0
  55. package/components/oxy-rich-text/index.scss +159 -0
  56. package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
  57. package/components/oxy-rich-text/mp-html/card/index.js +7 -0
  58. package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
  59. package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
  60. package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
  61. package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
  62. package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
  63. package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
  64. package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
  65. package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
  66. package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
  67. package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
  68. package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
  69. package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
  70. package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
  71. package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
  72. package/components/oxy-rich-text/mp-html/mp-html.vue +675 -0
  73. package/components/oxy-rich-text/mp-html/node/node.vue +1161 -0
  74. package/components/oxy-rich-text/mp-html/parser.js +1428 -0
  75. package/components/oxy-rich-text/mp-html/search/index.js +132 -0
  76. package/components/oxy-rich-text/mp-html/style/index.js +129 -0
  77. package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
  78. package/components/oxy-rich-text/mp-html/template/index.js +67 -0
  79. package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
  80. package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
  81. package/components/oxy-rich-text/types.ts +71 -0
  82. package/components/oxy-select/index.scss +255 -0
  83. package/components/oxy-select/oxy-select.vue +421 -0
  84. package/components/oxy-select/types.ts +71 -0
  85. package/components/oxy-select-picker/oxy-select-picker.vue +3 -0
  86. package/components/oxy-select-picker/types.ts +5 -1
  87. package/components/oxy-stream-render/index.scss +6 -0
  88. package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
  89. package/components/oxy-stream-render/types.ts +5 -0
  90. package/components/oxy-tree/index.scss +43 -5
  91. package/components/oxy-tree/oxy-tree.vue +233 -35
  92. package/components/oxy-tree/types.ts +54 -7
  93. package/components/oxy-tree/utils.ts +51 -0
  94. package/components/oxy-virtual-scroll/index.scss +1 -1
  95. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +69 -110
  96. package/components/oxy-virtual-scroll/types.ts +95 -5
  97. package/components/oxy-waterfall/index.scss +18 -0
  98. package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
  99. package/components/oxy-waterfall/types.ts +90 -0
  100. package/components/oxy-waterfall-item/index.scss +8 -0
  101. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
  102. package/components/oxy-waterfall-item/types.ts +16 -0
  103. package/global.d.ts +7 -0
  104. package/index.ts +3 -0
  105. package/locale/lang/en-US.ts +35 -9
  106. package/locale/lang/zh-CN.ts +31 -5
  107. package/oxy-uni-ui.zip +0 -0
  108. package/package.json +1 -1
  109. package/tags.json +1 -1
  110. package/uni-echarts/changelog.md +2 -0
  111. package/uni-echarts/components/index.js +1 -0
  112. package/uni-echarts/components/uni-echarts/events.js +95 -0
  113. package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
  114. package/uni-echarts/components/uni-echarts/types.js +1 -0
  115. package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
  116. package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
  117. package/uni-echarts/global.d.ts +7 -0
  118. package/uni-echarts/index.d.ts +440 -0
  119. package/uni-echarts/index.js +2 -0
  120. package/uni-echarts/package.json +105 -0
  121. package/uni-echarts/shared-core.d.ts +269 -0
  122. package/uni-echarts/shared-core.js +900 -0
  123. package/web-types.json +1 -1
@@ -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: 4px;
47
+ padding-top: 4px;
48
+ }
49
+ }
50
+ &--circle {
51
+ .oxy-date-strip-item__grid-prefix {
52
+ padding-bottom: 4px;
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>
@@ -512,7 +512,9 @@ function close() {
512
512
 
513
513
  function showPopup() {
514
514
  if (props.disabled || props.readonly) return
515
-
515
+ if (isFunction(props.beforeOpen) && !props.beforeOpen()) {
516
+ return
517
+ }
516
518
  emit('open')
517
519
  if (region.value) {
518
520
  popupShow.value = true
@@ -196,7 +196,11 @@ export const datetimePickerProps = {
196
196
  /**
197
197
  * 必填标记位置,可选值:before、after
198
198
  */
199
- markerSide: makeStringProp<'before' | 'after'>('before')
199
+ markerSide: makeStringProp<'before' | 'after'>('before'),
200
+ /**
201
+ * 打开pop之前的校验
202
+ */
203
+ beforeOpen: Function as PropType<() => boolean>
200
204
  }
201
205
 
202
206
  export type DatetimePickerDisplayFormat = (items: Record<string, any>[]) => string
@@ -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,12 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import { type ComponentPublicInstance } from 'vue'
3
+ import { type UniEchartsInst } from '../../uni-echarts'
4
+
5
+ export const echartsProps = {}
6
+
7
+ export type EchartsProps = ExtractPropTypes<typeof echartsProps>
8
+ export type EchartsExpose = {
9
+ echartsInstance: UniEchartsInst | null
10
+ }
11
+
12
+ export type EchartsInstance = ComponentPublicInstance<EchartsProps, EchartsExpose>
@@ -21,6 +21,7 @@
21
21
  height: 100%;
22
22
  border: 1px solid $-color-border;
23
23
  border-radius: 8px;
24
+ position: relative;
24
25
  }
25
26
  @include e(picture) {
26
27
  position: relative;
@@ -75,9 +76,34 @@
75
76
  margin: 0;
76
77
  padding: 0;
77
78
  }
79
+ .oxy-file-list__download {
80
+ font-size: 18px;
81
+ color: $-cell-arrow-color;
82
+ }
83
+ .oxy-file-list__delete {
84
+ font-size: 18px;
85
+ color: $-cell-arrow-color;
86
+ margin-left: 12px;
87
+ }
78
88
  & + .oxy-file-list__list--item {
79
89
  margin-top: 8px;
80
90
  }
81
91
  }
82
92
  }
93
+
94
+ .oxy-file-list__download-btn {
95
+ position: absolute;
96
+ top: 6px;
97
+ right: 6px;
98
+ background: rgba(0, 0, 0, 0.45);
99
+ border-radius: 6px;
100
+ padding: 4px 5px;
101
+ }
102
+ .oxy-file-list__download {
103
+ color: $-color-white;
104
+ }
105
+ .oxy-file-list__delete {
106
+ color: $-color-white;
107
+ margin-left: 6px;
108
+ }
83
109
  }