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
|
@@ -976,6 +976,16 @@ $-text-error-color: var(--oxy-text-error-color, $-color-danger) !default;
|
|
|
976
976
|
$-text-warning-color: var(--oxy-text-warning-color, $-color-warning) !default;
|
|
977
977
|
$-text-success-color: var(--oxy-text-success-color, $-color-success) !default;
|
|
978
978
|
|
|
979
|
+
/* link */
|
|
980
|
+
$-link-info-color: var(--oxy-link-info-color, $-color-content) !default;
|
|
981
|
+
$-link-primary-color: var(--oxy-link-primary-color, $-color-theme) !default;
|
|
982
|
+
$-link-error-color: var(--oxy-link-error-color, $-color-danger) !default;
|
|
983
|
+
$-link-warning-color: var(--oxy-link-warning-color, $-color-warning) !default;
|
|
984
|
+
$-link-success-color: var(--oxy-link-success-color, $-color-success) !default;
|
|
985
|
+
$-link-font-size-small: var(--oxy-link-font-size-small, $-fs-content) !default;
|
|
986
|
+
$-link-font-size-medium: var(--oxy-link-font-size-medium, $-fs-title) !default;
|
|
987
|
+
$-link-font-size-large: var(--oxy-link-font-size-large, $-fs-important) !default;
|
|
988
|
+
|
|
979
989
|
/* video-preview */
|
|
980
990
|
$-video-preview-bg: var(--oxy-video-preview-bg, rgba(0, 0, 0, 0.8)) !default; // 背景色
|
|
981
991
|
$-video-preview-close-color: var(--oxy-video-preview-close-color, #fff) !default; // 图标颜色
|
|
@@ -1005,6 +1015,46 @@ $-signature-button-margin-left: var(--oxy-signature-button-margin-left, 8px) !de
|
|
|
1005
1015
|
|
|
1006
1016
|
|
|
1007
1017
|
/* tree */
|
|
1008
|
-
$-tree-node-current-bg:var(--oxy-tree-node-current-bg,
|
|
1018
|
+
$-tree-node-current-bg:var(--oxy-tree-node-current-bg, #4d80ef1a);
|
|
1009
1019
|
$-tree-node-current-color:var(--oxy-tree-node-current-color, $-text-primary-color);
|
|
1010
1020
|
$-tree-node-disabled-color:var(--oxy-tree-node-disabled-color, $-color-icon-disabled);
|
|
1021
|
+
$-tree-search-input-color:var(--oxy-tree-search-input-color, #f6f6f6);
|
|
1022
|
+
|
|
1023
|
+
/* rich-text */
|
|
1024
|
+
$-rich-text-primary-color: var(--oxy-rich-text-primary-color, $-color-content);
|
|
1025
|
+
$-rich-text-title-color: var(--oxy-rich-text-title-color, $-color-title);
|
|
1026
|
+
$-rich-text-blockquote-border-color: var(--oxy-rich-text-blockquote-border-color, $-color-theme);
|
|
1027
|
+
$-rich-text-blockquote-color: var(--oxy-rich-text-blockquote-color, #555);
|
|
1028
|
+
$-rich-text-blockquote-bg: var(--oxy-rich-text-blockquote-bg, #f7f8fa);
|
|
1029
|
+
$-rich-text-list-color: var(--oxy-rich-text-list-color, #444);
|
|
1030
|
+
$-rich-text-a-color: var(--oxy-rich-text-a-color, $-color-theme);
|
|
1031
|
+
$-rich-text-strong-color: var(--oxy-rich-text-strong-color, #222);
|
|
1032
|
+
$-rich-text-em-color: var(--oxy-rich-text-em-color, #222);
|
|
1033
|
+
$-rich-text-hr-color: var(--oxy-rich-text-hr-color, #e5e6eb);
|
|
1034
|
+
$-rich-text-table-border-color: var(--oxy-rich-text-table-border-color, #e5e6eb);
|
|
1035
|
+
$-rich-text-table-head-bg: var(--oxy-rich-text-table-head-bg, #f7f8fa);
|
|
1036
|
+
$-rich-text-table-head-color: var(--oxy-rich-text-table-head-color, #333);
|
|
1037
|
+
$-rich-text-table-text-color: var(--oxy-rich-text-table-text-color, #444);
|
|
1038
|
+
$-rich-text-code-bg: var(--oxy-rich-text-code-bg, #2d2d2d);
|
|
1039
|
+
$-rich-text-code-color: var(--oxy-rich-text-code-color, #f8f8f2);
|
|
1040
|
+
$-rich-text-editable-border-color: var(--oxy-rich-text-editable-border-color, #e9e9e9);
|
|
1041
|
+
$-rich-text-toolbox-bg: var(--oxy-rich-text-toolbox-bg, #ededed);
|
|
1042
|
+
$-rich-text-popup-divider-color: var(--oxy-rich-text-popup-divider-color, gray);
|
|
1043
|
+
|
|
1044
|
+
/* date-strip */
|
|
1045
|
+
$-date-strip-bg-color: var(--oxy-date-strip-bg-color, $-color-white);
|
|
1046
|
+
$-date-strip-height: var(--oxy-date-strip-height, 86px);
|
|
1047
|
+
$-date-strip-padding-x: var(--oxy-date-strip-padding-x, 0);
|
|
1048
|
+
$-date-strip-padding-y: var(--oxy-date-strip-padding-y, 8px);
|
|
1049
|
+
$-date-strip-font-size: var(--oxy-date-strip-font-size, 16px);
|
|
1050
|
+
$-date-strip-color: var(--oxy-date-strip-color, $-color-content);
|
|
1051
|
+
$-date-strip-prefix-color: var(--oxy-date-strip-prefix-color, $-font-gray-2);
|
|
1052
|
+
$-date-strip-prefix-font-size: var(--oxy-date-strip-prefix-font-size, 14px);
|
|
1053
|
+
$-date-strip-suffix-color: var(--oxy-date-strip-color, $-font-gray-2);
|
|
1054
|
+
$-date-strip-suffix-font-size: var(--oxy-date-strip-suffix-font-size, 14px);
|
|
1055
|
+
$-date-strip-active-color: var(--oxy-date-strip-active-color, $-color-theme);
|
|
1056
|
+
$-date-strip-square-radius: var(--oxy-date-strip-square-radius, 4px);
|
|
1057
|
+
$-date-strip-grid-width: var(--oxy-date-strip-grid-width, 50px);
|
|
1058
|
+
$-date-strip-grid-square-padding-x: var(--oxy-date-strip-grid-square-padding-x, 0);
|
|
1059
|
+
$-date-strip-grid-square-padding-y: var(--oxy-date-strip-grid-square-padding-y, 6px);
|
|
1060
|
+
$-date-strip-grid-circle-radius: var(--oxy-date-strip-grid-circle-radius, 50%);
|
|
@@ -25,6 +25,39 @@ export function addUnit(num: number | string) {
|
|
|
25
25
|
return Number.isNaN(Number(num)) ? `${num}` : `${num}px`
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* 单位转换函数,将字符串数字或带有单位的字符串转换为数字
|
|
30
|
+
* @param value 要转换的值,可以是字符串数字或带有单位的字符串
|
|
31
|
+
* @returns 转换后的数字,如果无法转换则返回0
|
|
32
|
+
*/
|
|
33
|
+
export function unitConvert(value: string | number | null | undefined, base: number = 0): number {
|
|
34
|
+
// 如果是字符串数字
|
|
35
|
+
if (isNumeric(value)) {
|
|
36
|
+
return Number(value)
|
|
37
|
+
}
|
|
38
|
+
// 如果有单位
|
|
39
|
+
if (isString(value)) {
|
|
40
|
+
const reg = /^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g
|
|
41
|
+
const results = reg.exec(value)
|
|
42
|
+
if (!value || !results) {
|
|
43
|
+
return 0
|
|
44
|
+
}
|
|
45
|
+
const unit = results[3]
|
|
46
|
+
const _value = parseFloat(value)
|
|
47
|
+
if (unit === 'rpx') {
|
|
48
|
+
return uni.upx2px(_value)
|
|
49
|
+
}
|
|
50
|
+
if (unit === 'px') {
|
|
51
|
+
return _value * 1
|
|
52
|
+
}
|
|
53
|
+
if (unit == '%') {
|
|
54
|
+
return (_value / 100) * base
|
|
55
|
+
}
|
|
56
|
+
// 如果是其他单位,可以继续添加对应的转换逻辑
|
|
57
|
+
}
|
|
58
|
+
return 0
|
|
59
|
+
}
|
|
60
|
+
|
|
28
61
|
/**
|
|
29
62
|
* @description 判断target是否对象
|
|
30
63
|
* @param value
|
|
@@ -335,6 +368,15 @@ export function isNumber(value: any): value is number {
|
|
|
335
368
|
return getType(value) === 'number'
|
|
336
369
|
}
|
|
337
370
|
|
|
371
|
+
/**
|
|
372
|
+
* 检查一个值是否为数字类型或表示数字的字符串
|
|
373
|
+
* @param value 要检查的值,可以是 string 类型或 number 类型
|
|
374
|
+
* @returns 如果值是数字类型或表示数字的字符串,则返回 true;否则返回 false
|
|
375
|
+
*/
|
|
376
|
+
export function isNumeric(value: any): boolean {
|
|
377
|
+
return /^(-)?\d+(\.\d+)?$/.test(value)
|
|
378
|
+
}
|
|
379
|
+
|
|
338
380
|
/**
|
|
339
381
|
* 检查给定值是否为 Promise 对象。
|
|
340
382
|
* @param {unknown} value 要检查的值
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ToastOptions } from '../oxy-toast/types'
|
|
2
|
+
import { deepMerge } from '../common/util'
|
|
3
|
+
import { getCurrentPath } from '../common/path'
|
|
4
|
+
|
|
5
|
+
import { defineStore } from 'pinia'
|
|
6
|
+
|
|
7
|
+
interface GlobalLoading {
|
|
8
|
+
loadingOptions: ToastOptions
|
|
9
|
+
currentPage: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const defaultOptions: ToastOptions = {
|
|
13
|
+
show: false
|
|
14
|
+
}
|
|
15
|
+
export const useGlobalLoading = defineStore('global-loading', {
|
|
16
|
+
state: (): GlobalLoading => ({
|
|
17
|
+
loadingOptions: defaultOptions,
|
|
18
|
+
currentPage: ''
|
|
19
|
+
}),
|
|
20
|
+
getters: {},
|
|
21
|
+
actions: {
|
|
22
|
+
// 加载提示
|
|
23
|
+
loading(option: ToastOptions | string) {
|
|
24
|
+
this.currentPage = getCurrentPath()
|
|
25
|
+
this.loadingOptions = deepMerge(
|
|
26
|
+
{
|
|
27
|
+
iconName: 'loading',
|
|
28
|
+
duration: 0,
|
|
29
|
+
cover: true,
|
|
30
|
+
position: 'middle',
|
|
31
|
+
show: true
|
|
32
|
+
},
|
|
33
|
+
typeof option === 'string' ? { msg: option } : option
|
|
34
|
+
) as ToastOptions
|
|
35
|
+
},
|
|
36
|
+
// 关闭Toast
|
|
37
|
+
close() {
|
|
38
|
+
this.loadingOptions = defaultOptions
|
|
39
|
+
this.currentPage = ''
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { MessageOptions, MessageResult } from '../oxy-message-box/types'
|
|
2
|
+
import { deepMerge, isString } from '../common/util'
|
|
3
|
+
import { defineStore } from 'pinia'
|
|
4
|
+
import { getCurrentPath } from '../common/path'
|
|
5
|
+
|
|
6
|
+
export type GlobalMessageOptions = MessageOptions & {
|
|
7
|
+
success?: (res: MessageResult) => void
|
|
8
|
+
fail?: (res: MessageResult) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface GlobalMessage {
|
|
12
|
+
messageOptions: GlobalMessageOptions | null
|
|
13
|
+
currentPage: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useGlobalMessage = defineStore('global-message', {
|
|
17
|
+
state: (): GlobalMessage => ({
|
|
18
|
+
messageOptions: null,
|
|
19
|
+
currentPage: ''
|
|
20
|
+
}),
|
|
21
|
+
actions: {
|
|
22
|
+
show(option: GlobalMessageOptions | string) {
|
|
23
|
+
this.currentPage = getCurrentPath()
|
|
24
|
+
this.messageOptions = {
|
|
25
|
+
...(isString(option) ? { title: option } : option)
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
alert(option: GlobalMessageOptions | string) {
|
|
29
|
+
const messageOptions = deepMerge({ type: 'alert' }, isString(option) ? { title: option } : option) as MessageOptions
|
|
30
|
+
messageOptions.showCancelButton = false
|
|
31
|
+
this.show(messageOptions)
|
|
32
|
+
},
|
|
33
|
+
confirm(option: GlobalMessageOptions | string) {
|
|
34
|
+
const messageOptions = deepMerge({ type: 'confirm' }, isString(option) ? { title: option } : option) as MessageOptions
|
|
35
|
+
messageOptions.showCancelButton = true
|
|
36
|
+
this.show(messageOptions)
|
|
37
|
+
},
|
|
38
|
+
prompt(option: GlobalMessageOptions | string) {
|
|
39
|
+
const messageOptions = deepMerge({ type: 'prompt' }, isString(option) ? { title: option } : option) as MessageOptions
|
|
40
|
+
messageOptions.showCancelButton = true
|
|
41
|
+
this.show(messageOptions)
|
|
42
|
+
},
|
|
43
|
+
close() {
|
|
44
|
+
this.messageOptions = null
|
|
45
|
+
this.currentPage = ''
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ToastOptions } from '../oxy-toast/types'
|
|
2
|
+
import { deepMerge } from '../common/util'
|
|
3
|
+
import { defineStore } from 'pinia'
|
|
4
|
+
|
|
5
|
+
import { getCurrentPath } from '../common/path'
|
|
6
|
+
|
|
7
|
+
interface GlobalToast {
|
|
8
|
+
toastOptions: ToastOptions
|
|
9
|
+
currentPage: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const defaultOptions: ToastOptions = {
|
|
13
|
+
duration: 2000,
|
|
14
|
+
show: false
|
|
15
|
+
}
|
|
16
|
+
export const useGlobalToast = defineStore('global-toast', {
|
|
17
|
+
state: (): GlobalToast => ({
|
|
18
|
+
toastOptions: defaultOptions,
|
|
19
|
+
currentPage: ''
|
|
20
|
+
}),
|
|
21
|
+
getters: {},
|
|
22
|
+
actions: {
|
|
23
|
+
// 打开Toast
|
|
24
|
+
show(option: ToastOptions | string) {
|
|
25
|
+
this.currentPage = getCurrentPath()
|
|
26
|
+
const options = deepMerge(defaultOptions, typeof option === 'string' ? { msg: option } : option) as ToastOptions
|
|
27
|
+
this.toastOptions = deepMerge(options, {
|
|
28
|
+
show: true,
|
|
29
|
+
position: options.position || 'middle'
|
|
30
|
+
}) as ToastOptions
|
|
31
|
+
},
|
|
32
|
+
// 成功提示
|
|
33
|
+
success(option: ToastOptions | string) {
|
|
34
|
+
this.show(
|
|
35
|
+
deepMerge(
|
|
36
|
+
{
|
|
37
|
+
iconName: 'success',
|
|
38
|
+
duration: 1500
|
|
39
|
+
},
|
|
40
|
+
typeof option === 'string' ? { msg: option } : option
|
|
41
|
+
) as ToastOptions
|
|
42
|
+
)
|
|
43
|
+
},
|
|
44
|
+
// 关闭提示
|
|
45
|
+
error(option: ToastOptions | string) {
|
|
46
|
+
this.show(
|
|
47
|
+
deepMerge(
|
|
48
|
+
{
|
|
49
|
+
iconName: 'error',
|
|
50
|
+
direction: 'vertical'
|
|
51
|
+
},
|
|
52
|
+
typeof option === 'string' ? { msg: option } : option
|
|
53
|
+
) as ToastOptions
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
// 常规提示
|
|
57
|
+
info(option: ToastOptions | string) {
|
|
58
|
+
this.show(
|
|
59
|
+
deepMerge(
|
|
60
|
+
{
|
|
61
|
+
iconName: 'info'
|
|
62
|
+
},
|
|
63
|
+
typeof option === 'string' ? { msg: option } : option
|
|
64
|
+
) as ToastOptions
|
|
65
|
+
)
|
|
66
|
+
},
|
|
67
|
+
// 警告提示
|
|
68
|
+
warning(option: ToastOptions | string) {
|
|
69
|
+
this.show(
|
|
70
|
+
deepMerge(
|
|
71
|
+
{
|
|
72
|
+
iconName: 'warning'
|
|
73
|
+
},
|
|
74
|
+
typeof option === 'string' ? { msg: option } : option
|
|
75
|
+
) as ToastOptions
|
|
76
|
+
)
|
|
77
|
+
},
|
|
78
|
+
// 关闭Toast
|
|
79
|
+
close() {
|
|
80
|
+
this.toastOptions = defaultOptions
|
|
81
|
+
this.currentPage = ''
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
})
|
|
@@ -41,6 +41,7 @@ export function useVirtualScroll(options: UseVirtualScrollOptions): UseVirtualSc
|
|
|
41
41
|
|
|
42
42
|
// 响应式数据
|
|
43
43
|
const scrollTop = ref<number>(0)
|
|
44
|
+
const _scrollTop = ref<number>(0)
|
|
44
45
|
const showBackTopBtn = ref<boolean>(false)
|
|
45
46
|
const virtualData = ref<any[]>([])
|
|
46
47
|
const startIndex = ref<number>(0)
|
|
@@ -99,7 +100,7 @@ export function useVirtualScroll(options: UseVirtualScrollOptions): UseVirtualSc
|
|
|
99
100
|
if (!virtual.value) return // 非虚拟模式不处理
|
|
100
101
|
|
|
101
102
|
if (virtualEngine.value) {
|
|
102
|
-
const { visibleData, offsetY } = virtualEngine.value.updateVisibleData(
|
|
103
|
+
const { visibleData, offsetY } = virtualEngine.value.updateVisibleData(_scrollTop.value || 0)
|
|
103
104
|
virtualData.value = visibleData
|
|
104
105
|
virtualOffsetY.value = offsetY
|
|
105
106
|
}
|
|
@@ -107,7 +108,7 @@ export function useVirtualScroll(options: UseVirtualScrollOptions): UseVirtualSc
|
|
|
107
108
|
|
|
108
109
|
// 滚动事件处理
|
|
109
110
|
function onScroll(scrollTopValue: number) {
|
|
110
|
-
|
|
111
|
+
_scrollTop.value = scrollTopValue
|
|
111
112
|
showBackTopBtn.value = scrollTopValue > parseFloat(backToTopThreshold.value)
|
|
112
113
|
updateVisibleData()
|
|
113
114
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@click="onClick"
|
|
8
8
|
>
|
|
9
9
|
<view :class="['oxy-cell__wrapper', vertical ? 'is-vertical' : '']">
|
|
10
|
-
<view v-if="showLeft" class="oxy-cell__left" :style="
|
|
10
|
+
<view v-if="showLeft" class="oxy-cell__left" :style="leftStyle">
|
|
11
11
|
<text v-if="isRequired && markerSide === 'before'" class="oxy-cell__required oxy-cell__required--left">*</text>
|
|
12
12
|
<!--左侧icon部位-->
|
|
13
13
|
<slot name="icon">
|
|
@@ -65,7 +65,7 @@ import { useCell } from '../composables/useCell'
|
|
|
65
65
|
import { useParent } from '../composables/useParent'
|
|
66
66
|
import { FORM_KEY } from '../oxy-form/types'
|
|
67
67
|
import { cellProps } from './types'
|
|
68
|
-
import { isDef } from '../common/util'
|
|
68
|
+
import { isDef, objToStyle } from '../common/util'
|
|
69
69
|
|
|
70
70
|
const props = defineProps(cellProps)
|
|
71
71
|
const emit = defineEmits(['click'])
|
|
@@ -116,6 +116,19 @@ const showLeft = computed(() => {
|
|
|
116
116
|
return hasIcon || hasTitle || hasLabel
|
|
117
117
|
})
|
|
118
118
|
|
|
119
|
+
const leftStyle = computed(() => {
|
|
120
|
+
const leftStyle: Record<string, any> = {}
|
|
121
|
+
if (props.titleWidth) {
|
|
122
|
+
leftStyle['min-width'] = props.titleWidth
|
|
123
|
+
leftStyle['max-width'] = props.titleWidth
|
|
124
|
+
}
|
|
125
|
+
if (props.titlePercent) {
|
|
126
|
+
leftStyle['flex'] = 'none'
|
|
127
|
+
leftStyle['width'] = props.titlePercent
|
|
128
|
+
}
|
|
129
|
+
return objToStyle(leftStyle)
|
|
130
|
+
})
|
|
131
|
+
|
|
119
132
|
/**
|
|
120
133
|
* @description 点击cell的handle
|
|
121
134
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
:class="`oxy-checkbox__shape ${innerShape === 'square' ? 'is-square' : ''} ${customShapeClass}`"
|
|
15
15
|
:style="isChecked && !innerDisabled && innerCheckedColor ? 'color :' + innerCheckedColor : ''"
|
|
16
16
|
>
|
|
17
|
-
<oxy-icon custom-class="oxy-checkbox__indeterminate" name="decrease" />
|
|
18
|
-
<oxy-icon custom-class="oxy-checkbox__check" name="check-bold" />
|
|
17
|
+
<oxy-icon v-if="indeterminate" custom-class="oxy-checkbox__indeterminate" name="decrease" />
|
|
18
|
+
<oxy-icon v-else custom-class="oxy-checkbox__check" name="check-bold" />
|
|
19
19
|
</view>
|
|
20
20
|
<!--shape为button时只保留oxy-checkbox__label-->
|
|
21
21
|
<view
|
|
@@ -294,6 +294,9 @@ function showPicker() {
|
|
|
294
294
|
const { disabled, readonly } = props
|
|
295
295
|
|
|
296
296
|
if (disabled || readonly) return
|
|
297
|
+
if (isFunction(props.beforeOpen) && !props.beforeOpen()) {
|
|
298
|
+
return
|
|
299
|
+
}
|
|
297
300
|
pickerShow.value = true
|
|
298
301
|
lastPickerColSelected.value = pickerColSelected.value.slice(0)
|
|
299
302
|
lastSelectList.value = selectList.value.slice(0)
|
|
@@ -152,7 +152,11 @@ export const colPickerProps = {
|
|
|
152
152
|
/**
|
|
153
153
|
* 必填标记位置,可选值:before、after
|
|
154
154
|
*/
|
|
155
|
-
markerSide: makeStringProp<'before' | 'after'>('before')
|
|
155
|
+
markerSide: makeStringProp<'before' | 'after'>('before'),
|
|
156
|
+
/**
|
|
157
|
+
* 打开pop之前的校验
|
|
158
|
+
*/
|
|
159
|
+
beforeOpen: Function as PropType<() => boolean>
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
export type ColPickerProps = ExtractPropTypes<typeof colPickerProps>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="oxy-corner">
|
|
2
|
+
<view :class="`oxy-corner ${customClass}`" :style="customStyle">
|
|
3
3
|
<slot />
|
|
4
4
|
<view v-if="text || $slots.text" :class="textClass">
|
|
5
|
-
<view class="oxy-corner__text">
|
|
5
|
+
<view class="oxy-corner__text" :style="textStyle">
|
|
6
6
|
<slot name="text">
|
|
7
7
|
<span>{{ text }}</span>
|
|
8
8
|
</slot>
|
|
@@ -22,6 +22,7 @@ export default {
|
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
24
24
|
<script lang="ts" setup>
|
|
25
|
+
import { objToStyle } from '../common/util'
|
|
25
26
|
import { computed, ref, watch } from 'vue'
|
|
26
27
|
import { cornerProps } from './types'
|
|
27
28
|
|
|
@@ -49,7 +50,18 @@ watch(
|
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
const textClass = computed(() => {
|
|
52
|
-
return `oxy-corner__box ${
|
|
53
|
+
return `oxy-corner__box ${cornerClass.value}`
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const textStyle = computed(() => {
|
|
57
|
+
const textStyle: Record<string, any> = {}
|
|
58
|
+
if (props.color) {
|
|
59
|
+
textStyle['color'] = props.color
|
|
60
|
+
}
|
|
61
|
+
if (props.bgColor) {
|
|
62
|
+
textStyle['background'] = props.bgColor
|
|
63
|
+
}
|
|
64
|
+
return objToStyle(textStyle)
|
|
53
65
|
})
|
|
54
66
|
|
|
55
67
|
function computeCornerClass() {
|
|
@@ -44,7 +44,21 @@ export const cornerProps = {
|
|
|
44
44
|
* 类型:string
|
|
45
45
|
* 默认值:空字符串
|
|
46
46
|
*/
|
|
47
|
-
text: makeStringProp('')
|
|
47
|
+
text: makeStringProp(''),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 文字颜色
|
|
51
|
+
* 类型:string
|
|
52
|
+
* 默认值:空字符串
|
|
53
|
+
*/
|
|
54
|
+
color: makeStringProp(''),
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 背景色和边框色
|
|
58
|
+
* 类型:string
|
|
59
|
+
* 默认值:空字符串
|
|
60
|
+
*/
|
|
61
|
+
bgColor: makeStringProp('')
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
export type CornerProps = ExtractPropTypes<typeof cornerProps>
|