oxy-uni-ui 1.2.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.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +51 -1
- package/components/common/path.ts +9 -0
- package/components/common/util.ts +42 -0
- package/components/composables/useGlobalLoading.ts +42 -0
- package/components/composables/useGlobalMessage.ts +48 -0
- package/components/composables/useGlobalToast.ts +84 -0
- package/components/composables/useVirtualScroll.ts +3 -2
- package/components/oxy-cell/oxy-cell.vue +15 -2
- package/components/oxy-cell/types.ts +4 -0
- package/components/oxy-checkbox/index.scss +1 -1
- package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
- package/components/oxy-col-picker/oxy-col-picker.vue +3 -0
- package/components/oxy-col-picker/types.ts +5 -1
- package/components/oxy-corner/oxy-corner.vue +15 -3
- package/components/oxy-corner/types.ts +15 -1
- package/components/oxy-date-strip/index.scss +10 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
- package/components/oxy-date-strip/types.ts +98 -0
- package/components/oxy-date-strip/utils.ts +67 -0
- package/components/oxy-date-strip-item/index.scss +94 -0
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
- package/components/oxy-date-strip-item/types.ts +53 -0
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +3 -1
- package/components/oxy-datetime-picker/types.ts +5 -1
- package/components/oxy-echarts/index.scss +17 -0
- package/components/oxy-echarts/index.ts +1 -0
- package/components/oxy-echarts/oxy-echarts.vue +32 -0
- package/components/oxy-echarts/types.ts +12 -0
- package/components/oxy-file-list/index.scss +26 -0
- package/components/oxy-file-list/oxy-file-list.vue +208 -34
- package/components/oxy-file-list/types.ts +58 -2
- package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
- package/components/oxy-global-message/oxy-global-message.vue +64 -0
- package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
- package/components/oxy-img-lazy/index.scss +17 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
- package/components/oxy-img-lazy/types.ts +69 -0
- package/components/oxy-link/index.scss +57 -0
- package/components/oxy-link/oxy-link.vue +130 -0
- package/components/oxy-link/types.ts +81 -0
- package/components/oxy-list/index.scss +7 -1
- package/components/oxy-list/types.ts +1 -1
- package/components/oxy-picker/oxy-picker.vue +3 -0
- package/components/oxy-picker/types.ts +5 -1
- package/components/oxy-radio/index.scss +3 -3
- package/components/oxy-radio/oxy-radio.vue +1 -1
- package/components/oxy-rich-text/icon/emjio.svg +1 -0
- package/components/oxy-rich-text/icon/quote.svg +1 -0
- package/components/oxy-rich-text/icon/text.svg +1 -0
- package/components/oxy-rich-text/icon/title.svg +1 -0
- package/components/oxy-rich-text/index.scss +159 -0
- package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
- package/components/oxy-rich-text/mp-html/card/index.js +7 -0
- package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
- package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
- package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
- package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
- package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
- package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
- package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
- package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
- package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
- package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
- package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +675 -0
- package/components/oxy-rich-text/mp-html/node/node.vue +1161 -0
- package/components/oxy-rich-text/mp-html/parser.js +1428 -0
- package/components/oxy-rich-text/mp-html/search/index.js +132 -0
- package/components/oxy-rich-text/mp-html/style/index.js +129 -0
- package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
- package/components/oxy-rich-text/mp-html/template/index.js +67 -0
- package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
- package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
- package/components/oxy-rich-text/types.ts +71 -0
- package/components/oxy-select/index.scss +255 -0
- package/components/oxy-select/oxy-select.vue +421 -0
- package/components/oxy-select/types.ts +71 -0
- package/components/oxy-select-picker/oxy-select-picker.vue +3 -0
- package/components/oxy-select-picker/types.ts +5 -1
- package/components/oxy-stream-render/index.scss +6 -0
- package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
- package/components/oxy-stream-render/types.ts +5 -0
- package/components/oxy-tree/index.scss +17 -1
- package/components/oxy-tree/oxy-tree.vue +89 -8
- package/components/oxy-tree/types.ts +11 -1
- package/components/oxy-waterfall/index.scss +18 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
- package/components/oxy-waterfall/types.ts +90 -0
- package/components/oxy-waterfall-item/index.scss +8 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
- package/components/oxy-waterfall-item/types.ts +16 -0
- package/global.d.ts +7 -0
- package/index.ts +3 -0
- package/locale/lang/en-US.ts +26 -0
- package/locale/lang/zh-CN.ts +26 -0
- package/oxy-uni-ui.zip +0 -0
- package/package.json +1 -1
- package/tags.json +1 -1
- package/uni-echarts/changelog.md +2 -0
- package/uni-echarts/components/index.js +1 -0
- package/uni-echarts/components/uni-echarts/events.js +95 -0
- package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
- package/uni-echarts/components/uni-echarts/types.js +1 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
- package/uni-echarts/global.d.ts +7 -0
- package/uni-echarts/index.d.ts +440 -0
- package/uni-echarts/index.js +2 -0
- package/uni-echarts/package.json +105 -0
- package/uni-echarts/shared-core.d.ts +269 -0
- package/uni-echarts/shared-core.js +900 -0
- package/web-types.json +1 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`oxy-waterfall ${customClass}`" :style="waterfallStyle">
|
|
3
|
+
<scroll-view
|
|
4
|
+
class="oxy-waterfall__wrapper"
|
|
5
|
+
:scroll-y="true"
|
|
6
|
+
:refresher-enabled="refresherEnabled"
|
|
7
|
+
:refresher-triggered="triggered"
|
|
8
|
+
@scroll="handleScroll"
|
|
9
|
+
@scrolltolower="handleScrolltolower"
|
|
10
|
+
@refresherrefresh="handleRefresherrefresh"
|
|
11
|
+
>
|
|
12
|
+
<view class="oxy-waterfall__container" :style="`${containerStyle}`">
|
|
13
|
+
<view v-for="(column, index) in columns" :key="index" class="oxy-waterfall__column" :style="index ? `${columnStyle}` : ''">
|
|
14
|
+
<oxy-waterfall-item
|
|
15
|
+
v-for="(item, cindex) in column"
|
|
16
|
+
:key="item[idKey]"
|
|
17
|
+
:col-index="index"
|
|
18
|
+
:custom-style="cindex ? `${itemStyle}` : ''"
|
|
19
|
+
:report-height-time="item.reportHeightTime"
|
|
20
|
+
@height="reportHeight"
|
|
21
|
+
>
|
|
22
|
+
<slot name="item" :item="item" :col-index="index" :item-index="cindex"></slot>
|
|
23
|
+
</oxy-waterfall-item>
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
<slot name="bottom">
|
|
27
|
+
<oxy-loadmore
|
|
28
|
+
v-if="loadmoreState"
|
|
29
|
+
:state="loadmoreState"
|
|
30
|
+
:loading-text="loadingText"
|
|
31
|
+
:finished-text="finishedText"
|
|
32
|
+
:error-text="errorText"
|
|
33
|
+
:loading-props="loadingProps"
|
|
34
|
+
@reload="onReload"
|
|
35
|
+
/>
|
|
36
|
+
</slot>
|
|
37
|
+
</scroll-view>
|
|
38
|
+
</view>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts">
|
|
42
|
+
export default {
|
|
43
|
+
name: 'oxy-waterfall',
|
|
44
|
+
options: {
|
|
45
|
+
addGlobalClass: true,
|
|
46
|
+
virtualHost: true,
|
|
47
|
+
styleIsolation: 'shared'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
<script lang="ts" setup>
|
|
52
|
+
import type { ScrollViewOnRefresherrefreshEvent, ScrollViewOnScrollEvent } from '@uni-helper/uni-app-types/index'
|
|
53
|
+
import { objToStyle, isDef, addUnit } from '../common/util'
|
|
54
|
+
import { computed, ref, watch, nextTick } from 'vue'
|
|
55
|
+
import { waterfallProps } from './types'
|
|
56
|
+
|
|
57
|
+
const emit = defineEmits(['scroll', 'scroll-to-lower', 'refresh', 'reload'])
|
|
58
|
+
|
|
59
|
+
const props = defineProps(waterfallProps)
|
|
60
|
+
|
|
61
|
+
const columns = ref<any>([])
|
|
62
|
+
const loadedIndex = ref(0)
|
|
63
|
+
const columnHeights = ref<any>([])
|
|
64
|
+
|
|
65
|
+
watch(
|
|
66
|
+
() => props.data,
|
|
67
|
+
() => {
|
|
68
|
+
loadColumn()
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
deep: true,
|
|
72
|
+
immediate: true
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
watch(
|
|
77
|
+
() => props.triggered,
|
|
78
|
+
(val) => {
|
|
79
|
+
if (val) {
|
|
80
|
+
loadedIndex.value = 0
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
deep: true,
|
|
85
|
+
immediate: true
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
function loadColumn() {
|
|
90
|
+
if (!loadedIndex.value || !columns.value.length) {
|
|
91
|
+
clearColumn()
|
|
92
|
+
columns.value = Array(props.columnCount)
|
|
93
|
+
.fill(null)
|
|
94
|
+
.map(() => [])
|
|
95
|
+
columnHeights.value = Array(props.columnCount)
|
|
96
|
+
.fill(null)
|
|
97
|
+
.map(() => 0)
|
|
98
|
+
}
|
|
99
|
+
nextTick(() => {
|
|
100
|
+
addRenderData()
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function addRenderData() {
|
|
105
|
+
if (loadedIndex.value > props.data.length - 1) return
|
|
106
|
+
const current = props.data[loadedIndex.value]
|
|
107
|
+
pushRender(current)
|
|
108
|
+
loadedIndex.value += 1
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function pushRender(data: Record<string, any>) {
|
|
112
|
+
const columnIndex = findSmallColIndex()
|
|
113
|
+
columns.value[columnIndex].push({
|
|
114
|
+
...data,
|
|
115
|
+
reportHeightTime: Date.now()
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function findSmallColIndex() {
|
|
120
|
+
let col = 0
|
|
121
|
+
let size = columnHeights.value[col]
|
|
122
|
+
columnHeights.value.forEach((item: number, index: number) => {
|
|
123
|
+
if (item < size) {
|
|
124
|
+
col = index
|
|
125
|
+
size = item
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
return col
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function reportHeight(params: any) {
|
|
132
|
+
const { colIndex, height, reportHeightTimeChange } = params
|
|
133
|
+
columnHeights.value[colIndex] += height
|
|
134
|
+
|
|
135
|
+
if (reportHeightTimeChange) {
|
|
136
|
+
return
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
addRenderData()
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 更新
|
|
143
|
+
const update = (params: any) => {
|
|
144
|
+
const { colIndex, itemIndex, data = {}, reportHeight = false } = params
|
|
145
|
+
const item = columns.value[colIndex][itemIndex]
|
|
146
|
+
Object.keys(data).forEach((k) => {
|
|
147
|
+
item[k] = data[k]
|
|
148
|
+
})
|
|
149
|
+
// 当需要重新上报高度时,更新渲染时间
|
|
150
|
+
if (reportHeight) {
|
|
151
|
+
item.reportHeightTime = Date.now()
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function clearColumn() {
|
|
156
|
+
loadedIndex.value = 0
|
|
157
|
+
columns.value = []
|
|
158
|
+
columnHeights.value = []
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const waterfallStyle = computed(() => {
|
|
162
|
+
const style: Record<string, any> = {}
|
|
163
|
+
if (isDef(props.height)) {
|
|
164
|
+
style['height'] = addUnit(props.height)
|
|
165
|
+
}
|
|
166
|
+
return `${objToStyle(style)}${props.customStyle}`
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
const containerStyle = computed(() => {
|
|
170
|
+
const style: Record<string, any> = {}
|
|
171
|
+
if (props.leftGap) {
|
|
172
|
+
style['padding-left'] = addUnit(props.leftGap)
|
|
173
|
+
}
|
|
174
|
+
if (props.rightGap) {
|
|
175
|
+
style['padding-right'] = addUnit(props.rightGap)
|
|
176
|
+
}
|
|
177
|
+
return objToStyle(style)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
const columnStyle = computed(() => {
|
|
181
|
+
const style: Record<string, any> = {}
|
|
182
|
+
if (props.columnGap) {
|
|
183
|
+
style['margin-left'] = addUnit(props.columnGap)
|
|
184
|
+
}
|
|
185
|
+
return objToStyle(style)
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
const itemStyle = computed(() => {
|
|
189
|
+
const style: Record<string, any> = {}
|
|
190
|
+
if (props.columnGap) {
|
|
191
|
+
style['margin-top'] = addUnit(props.columnGap)
|
|
192
|
+
}
|
|
193
|
+
return objToStyle(style)
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
const handleScroll = (event: ScrollViewOnScrollEvent) => {
|
|
197
|
+
emit('scroll', event)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const handleScrolltolower = () => {
|
|
201
|
+
emit('scroll-to-lower')
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const handleRefresherrefresh = (e: ScrollViewOnRefresherrefreshEvent) => {
|
|
205
|
+
emit('refresh', e)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const onReload = () => {
|
|
209
|
+
emit('reload')
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
defineExpose({
|
|
213
|
+
update
|
|
214
|
+
})
|
|
215
|
+
</script>
|
|
216
|
+
<style lang="scss" scoped>
|
|
217
|
+
@import './index.scss';
|
|
218
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeRequiredProp, makeStringProp, makeNumberProp, numericProp, makeBooleanProp } from '../common/props'
|
|
3
|
+
import { type LoadMoreState } from '../oxy-loadmore/types'
|
|
4
|
+
import { type LoadingProps } from '../oxy-loading/types'
|
|
5
|
+
|
|
6
|
+
export const waterfallProps = {
|
|
7
|
+
...baseProps,
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 瀑布流数据
|
|
11
|
+
* 类型:array
|
|
12
|
+
*/
|
|
13
|
+
data: makeRequiredProp(Array<Record<string, any>>),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 数据的唯一标识
|
|
17
|
+
* 类型:string
|
|
18
|
+
* 默认值:'id'
|
|
19
|
+
*/
|
|
20
|
+
idKey: makeStringProp('id'),
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 容器的高度
|
|
24
|
+
*/
|
|
25
|
+
height: numericProp,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 瀑布流的列数
|
|
29
|
+
* 类型:number
|
|
30
|
+
* 默认值:2
|
|
31
|
+
*/
|
|
32
|
+
columnCount: makeNumberProp(2),
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 列与列的间隙
|
|
36
|
+
* 类型:number
|
|
37
|
+
* 默认值:20
|
|
38
|
+
*/
|
|
39
|
+
columnGap: makeNumberProp(20),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 左边和列表的间隙
|
|
43
|
+
* 类型:number
|
|
44
|
+
* 默认值:0
|
|
45
|
+
*/
|
|
46
|
+
leftGap: makeNumberProp(0),
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 右边和列表的间隙
|
|
50
|
+
* 类型:number
|
|
51
|
+
* 默认值:0
|
|
52
|
+
*/
|
|
53
|
+
rightGap: makeNumberProp(0),
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 开启下拉刷新
|
|
57
|
+
* 类型:boolean
|
|
58
|
+
* 默认值:false
|
|
59
|
+
*/
|
|
60
|
+
refresherEnabled: makeBooleanProp(false),
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 下拉刷新状态
|
|
64
|
+
* 类型:boolean
|
|
65
|
+
* 默认值:false
|
|
66
|
+
*/
|
|
67
|
+
triggered: makeBooleanProp(false),
|
|
68
|
+
|
|
69
|
+
loadmoreState: String as PropType<LoadMoreState | ''>,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 加载提示文案
|
|
73
|
+
*/
|
|
74
|
+
loadingText: String,
|
|
75
|
+
/**
|
|
76
|
+
* 全部加载完的提示文案
|
|
77
|
+
*/
|
|
78
|
+
finishedText: String,
|
|
79
|
+
/**
|
|
80
|
+
* 加载失败的提示文案
|
|
81
|
+
*/
|
|
82
|
+
errorText: String,
|
|
83
|
+
/**
|
|
84
|
+
* 加载中loading组件的属性
|
|
85
|
+
* 参考loading组件
|
|
86
|
+
*/
|
|
87
|
+
loadingProps: Object as PropType<Partial<LoadingProps>>
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type WaterfallProps = ExtractPropTypes<typeof waterfallProps>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`oxy-waterfall-item ${customClass}`" :style="customStyle">
|
|
3
|
+
<slot name="default"></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default {
|
|
9
|
+
name: 'oxy-waterfall-item',
|
|
10
|
+
options: {
|
|
11
|
+
addGlobalClass: true,
|
|
12
|
+
virtualHost: true,
|
|
13
|
+
styleIsolation: 'shared'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ref, getCurrentInstance, watch, onMounted } from 'vue'
|
|
19
|
+
import { waterfallItemProps } from './types'
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits(['height'])
|
|
22
|
+
|
|
23
|
+
const props = defineProps(waterfallItemProps)
|
|
24
|
+
const instance = getCurrentInstance()
|
|
25
|
+
|
|
26
|
+
const displayHeight = ref(0)
|
|
27
|
+
|
|
28
|
+
watch(
|
|
29
|
+
() => props.reportHeightTime,
|
|
30
|
+
(newValue, oldValue) => {
|
|
31
|
+
if (newValue !== oldValue) {
|
|
32
|
+
postHeight({
|
|
33
|
+
reportHeightTimeChange: true
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const wait = (time = 100) => {
|
|
40
|
+
return new Promise<void>((resolve) => {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
resolve()
|
|
43
|
+
}, time)
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function postHeight(params: any) {
|
|
48
|
+
const { reportHeightTimeChange = false } = params
|
|
49
|
+
// 添加一个异步的宏任务,部分低性能的移动设备会因为渲染问题导致上报的高度存在错误问题
|
|
50
|
+
await wait(10)
|
|
51
|
+
// 当前高度
|
|
52
|
+
const currentHeight = await getHeight()
|
|
53
|
+
// 上报高度
|
|
54
|
+
let height = currentHeight - displayHeight.value
|
|
55
|
+
// 上报高度为0时,取消上报。防止用户调用 update 函数时错误的reportHeight参数情况
|
|
56
|
+
if (height === 0) {
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
emit('height', {
|
|
60
|
+
colIndex: props.colIndex,
|
|
61
|
+
height,
|
|
62
|
+
reportHeightTimeChange
|
|
63
|
+
})
|
|
64
|
+
// 缓存渲染高度
|
|
65
|
+
displayHeight.value = currentHeight
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getHeight(): Promise<number> {
|
|
69
|
+
const query = uni.createSelectorQuery().in(instance)
|
|
70
|
+
return new Promise((resolve, reject) => {
|
|
71
|
+
query
|
|
72
|
+
.select('.oxy-waterfall-item')
|
|
73
|
+
.boundingClientRect((data) => {
|
|
74
|
+
const nodeHieght = (data as UniApp.NodeInfo).height
|
|
75
|
+
// 节点高度
|
|
76
|
+
const height = nodeHieght ? Math.floor(nodeHieght) : 0
|
|
77
|
+
resolve(height)
|
|
78
|
+
})
|
|
79
|
+
.exec()
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
onMounted(() => {
|
|
84
|
+
postHeight({})
|
|
85
|
+
})
|
|
86
|
+
</script>
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
@import './index.scss';
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeNumberProp, numericProp } from '../common/props'
|
|
3
|
+
|
|
4
|
+
export const waterfallItemProps = {
|
|
5
|
+
...baseProps,
|
|
6
|
+
/**
|
|
7
|
+
* 列索引
|
|
8
|
+
*/
|
|
9
|
+
colIndex: makeNumberProp(0),
|
|
10
|
+
/**
|
|
11
|
+
* 上报时间
|
|
12
|
+
*/
|
|
13
|
+
reportHeightTime: numericProp
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type WaterfallItemProps = ExtractPropTypes<typeof waterfallItemProps>
|
package/global.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare module 'vue' {
|
|
|
27
27
|
OxyIcon: typeof import('./components/oxy-icon/oxy-icon.vue')['default']
|
|
28
28
|
OxyImg: typeof import('./components/oxy-img/oxy-img.vue')['default']
|
|
29
29
|
OxyImgCropper: typeof import('./components/oxy-img-cropper/oxy-img-cropper.vue')['default']
|
|
30
|
+
OxyImgLazy: typeof import('./components/oxy-img-lazy/oxy-img-lazy.vue')['default']
|
|
30
31
|
OxyInput: typeof import('./components/oxy-input/oxy-input.vue')['default']
|
|
31
32
|
OxyInputNumber: typeof import('./components/oxy-input-number/oxy-input-number.vue')['default']
|
|
32
33
|
OxyLoading: typeof import('./components/oxy-loading/oxy-loading.vue')['default']
|
|
@@ -98,6 +99,12 @@ declare module 'vue' {
|
|
|
98
99
|
OxyFloatingPanel: typeof import('./components/oxy-floating-panel/oxy-floating-panel.vue')['default']
|
|
99
100
|
OxySignature: typeof import('./components/oxy-signature/oxy-signature.vue')['default']
|
|
100
101
|
OxyRootPortal: typeof import('./components/oxy-root-portal/oxy-root-portal.vue')['default']
|
|
102
|
+
OxyStreamRender: typeof import('./components/oxy-stream-render/oxy-stream-render.vue')['default']
|
|
103
|
+
OxyWaterfall: typeof import('./components/oxy-waterfall/oxy-waterfall.vue')['default']
|
|
104
|
+
OxyWaterfallItem: typeof import('./components/oxy-waterfall/oxy-waterfall-item.vue')['default']
|
|
105
|
+
OxyDateStrip: typeof import('./components/oxy-date-strip/oxy-date-strip.vue')['default']
|
|
106
|
+
OxyDateStripItem: typeof import('./components/oxy-date-strip-item/oxy-date-strip-item.vue')['default']
|
|
107
|
+
OxySelect: typeof import('./components/oxy-select/oxy-select.vue')['default']
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
|
package/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { useToast } from './components/oxy-toast'
|
|
2
2
|
export { useMessage } from './components/oxy-message-box'
|
|
3
|
+
export { useGlobalLoading } from './components/composables/useGlobalLoading'
|
|
4
|
+
export { useGlobalMessage } from './components/composables/useGlobalMessage'
|
|
5
|
+
export { useGlobalToast } from './components/composables/useGlobalToast'
|
|
3
6
|
export * from './components/composables'
|
|
4
7
|
export * from './components/oxy-notify'
|
|
5
8
|
|
package/locale/lang/en-US.ts
CHANGED
|
@@ -130,5 +130,31 @@ export default {
|
|
|
130
130
|
clearText: 'Clear',
|
|
131
131
|
revokeText: 'Undo',
|
|
132
132
|
restoreText: 'Restore'
|
|
133
|
+
},
|
|
134
|
+
richText: {
|
|
135
|
+
insertEmoji: 'Insert Emoji',
|
|
136
|
+
insertTemplate: 'Insert Template',
|
|
137
|
+
insertLink: 'Insert Link',
|
|
138
|
+
emoji: 'Emoji',
|
|
139
|
+
template: 'Template',
|
|
140
|
+
largeTitle: 'Large Title',
|
|
141
|
+
mediumTitle: 'Medium Title',
|
|
142
|
+
smallTitle: 'Small Title',
|
|
143
|
+
localSelect: 'Local Select',
|
|
144
|
+
remoteLink: 'Remote Link',
|
|
145
|
+
imageLink: 'Image Link',
|
|
146
|
+
videoLink: 'Video Link',
|
|
147
|
+
audioLink: 'Audio Link',
|
|
148
|
+
linkAddress: 'Link Address',
|
|
149
|
+
linkText: 'Link Text',
|
|
150
|
+
linkTextPlaceholder: 'Please enter the link display text',
|
|
151
|
+
linkAddressPlaceholder: 'Please enter the link address',
|
|
152
|
+
uploading: 'Uploading',
|
|
153
|
+
insertTable: 'Insert Table',
|
|
154
|
+
row: 'Row',
|
|
155
|
+
column: 'Column',
|
|
156
|
+
clearConfirm: 'Are you sure to clear the content?',
|
|
157
|
+
confirm: 'Confirm',
|
|
158
|
+
cancel: 'Cancel'
|
|
133
159
|
}
|
|
134
160
|
}
|
package/locale/lang/zh-CN.ts
CHANGED
|
@@ -134,5 +134,31 @@ export default {
|
|
|
134
134
|
clearText: '清空',
|
|
135
135
|
revokeText: '撤销',
|
|
136
136
|
restoreText: '恢复'
|
|
137
|
+
},
|
|
138
|
+
richText: {
|
|
139
|
+
insertEmoji: '插入表情',
|
|
140
|
+
insertTemplate: '插入模板',
|
|
141
|
+
insertLink: '插入链接',
|
|
142
|
+
emoji: '表情',
|
|
143
|
+
template: '模板',
|
|
144
|
+
largeTitle: '大标题',
|
|
145
|
+
mediumTitle: '中标题',
|
|
146
|
+
smallTitle: '小标题',
|
|
147
|
+
localSelect: '本地选取',
|
|
148
|
+
remoteLink: '远程链接',
|
|
149
|
+
imageLink: '图片链接',
|
|
150
|
+
videoLink: '视频链接',
|
|
151
|
+
audioLink: '音频链接',
|
|
152
|
+
linkAddress: '链接地址',
|
|
153
|
+
linkText: '链接文本',
|
|
154
|
+
linkTextPlaceholder: '请输入链接显示的文本',
|
|
155
|
+
linkAddressPlaceholder: '请输入链接地址',
|
|
156
|
+
uploading: '上传中',
|
|
157
|
+
insertTable: '插入表格',
|
|
158
|
+
row: '行',
|
|
159
|
+
column: '列',
|
|
160
|
+
clearConfirm: '确定清空内容吗?',
|
|
161
|
+
confirm: '确认',
|
|
162
|
+
cancel: '取消'
|
|
137
163
|
}
|
|
138
164
|
}
|
package/oxy-uni-ui.zip
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"oxy-uni-ui","name":"oxy-uni-ui","displayName":"oxy-uni-ui 基于vue3+Typescript的高颜值组件库","version":"1.2.
|
|
1
|
+
{"id":"oxy-uni-ui","name":"oxy-uni-ui","displayName":"oxy-uni-ui 基于vue3+Typescript的高颜值组件库","version":"1.2.3","license":"MIT","description":"一个基于Vue3+TS开发的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。","keywords":["oxy-uni-ui","国际化","组件库","vue3","暗黑模式"],"main":"index.ts","engines":{"HBuilderX":"^3.8.7"},"dcloudext":{"type":"component-vue","sale":{"regular":{"price":"0.00"},"sourcecode":{"price":"0.00"}},"contact":{"qq":""},"declaration":{"ads":"无","data":"插件不采集任何数据","permissions":"无"},"npmurl":"https://www.npmjs.com/package/oxy-uni-ui"},"vetur":{"tags":"tags.json","attributes":"attributes.json"},"web-types":"web-types.json","uni_modules":{"dependencies":[],"encrypt":[],"platforms":{"cloud":{"tcb":"y","aliyun":"y","alipay":"n"},"client":{"Vue":{"vue2":"n","vue3":"y"},"App":{"app-vue":"y","app-nvue":"n","app-uvue":"n"},"H5-mobile":{"Safari":"y","Android Browser":"y","微信浏览器(Android)":"y","QQ浏览器(Android)":"y"},"H5-pc":{"Chrome":"y","IE":"u","Edge":"y","Firefox":"y","Safari":"y"},"小程序":{"微信":"y","阿里":"y","百度":"u","字节跳动":"u","QQ":"y","钉钉":"y","快手":"u","飞书":"u","京东":"u"},"快应用":{"华为":"u","联盟":"u"}}}},"peerDependencies":{"vue":">=3.2.47"}}
|