@didaoktv/didaoui-uniapp 2.13.0 → 2.14.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.
- package/README.md +6 -6
- package/components/dd-album/dd-album.vue +280 -228
- package/components/dd-avatar/dd-avatar.vue +132 -75
- package/components/dd-avatar-group/dd-avatar-group.vue +52 -30
- package/components/dd-barcode/dd-barcode.vue +884 -947
- package/components/dd-button/dd-button.vue +47 -21
- package/components/dd-canvas/dd-canvas.vue +1156 -985
- package/components/dd-car-keyboard/dd-car-keyboard.vue +12 -12
- package/components/dd-champion-card/dd-champion-card.vue +49 -21
- package/components/dd-checkbox-group/dd-checkbox-group.vue +2 -0
- package/components/dd-copy/dd-copy.vue +51 -56
- package/components/dd-cropper/dd-cropper.vue +1224 -1135
- package/components/dd-divider/dd-divider.vue +9 -2
- package/components/dd-form/dd-form.vue +2 -0
- package/components/dd-icon/dd-icon.vue +1 -1
- package/components/dd-keyboard/dd-keyboard.vue +95 -46
- package/components/dd-link/dd-link.vue +72 -49
- package/components/dd-markdown/dd-markdown.vue +154 -154
- package/components/dd-number-keyboard/dd-number-keyboard.vue +109 -94
- package/components/dd-parse/dd-parse.vue +473 -442
- package/components/dd-poster/dd-poster.vue +579 -567
- package/components/dd-pull-refresh/dd-pull-refresh.vue +1 -9
- package/components/dd-qrcode/dd-qrcode.vue +431 -405
- package/components/dd-radio-group/dd-radio-group.vue +1 -1
- package/components/dd-segmented-tab/dd-segmented-tab.vue +22 -14
- package/components/dd-signature/dd-signature.vue +377 -357
- package/components/dd-step/dd-step.vue +1 -1
- package/components/dd-sticky/dd-sticky.vue +5 -10
- package/components/dd-swipe-action/dd-swipe-action.vue +1 -9
- package/components/dd-swipe-item/dd-swipe-item.vue +2 -0
- package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -5
- package/components/dd-switch/dd-switch.vue +1 -1
- package/components/dd-text/dd-text.vue +304 -82
- package/components/dd-waterfall/dd-waterfall.vue +89 -0
- package/index.ts +4 -3
- package/libs/function/index.d.ts +88 -0
- package/libs/function/index.js +14 -0
- package/libs/function/test.d.ts +65 -0
- package/package.json +1 -1
- package/scss/_mixins.scss +8 -0
- package/scss/_theme-tokens.scss +7 -0
- package/scss/_variables.scss +283 -156
- package/components/dd-album/album.js +0 -19
- package/components/dd-album/props.js +0 -89
- package/components/dd-avatar/avatar.js +0 -19
- package/components/dd-avatar/props.js +0 -84
- package/components/dd-avatar-group/avatarGroup.js +0 -14
- package/components/dd-avatar-group/props.js +0 -57
- package/components/dd-keyboard/keyboard.js +0 -19
- package/components/dd-keyboard/props.js +0 -79
- package/components/dd-link/link.js +0 -17
- package/components/dd-link/props.js +0 -44
- package/components/dd-number-keyboard/numberKeyboard.js +0 -8
- package/components/dd-number-keyboard/props.js +0 -24
- package/components/dd-parse/props.js +0 -57
- package/components/dd-text/props.js +0 -120
- package/components/dd-text/text.js +0 -30
- package/components/dd-text/value.js +0 -87
- package/scss/_dd-shared.scss +0 -40
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// libs/function/index.js 的类型声明(allowJs 未开启,TS 侧导入 .js 需要此声明)
|
|
2
|
+
// ponytail: 只声明导出签名,实现仍以 JS 为准;返回值宽泛标注以免与运行时用法冲突。
|
|
3
|
+
|
|
4
|
+
export interface NodeInfo {
|
|
5
|
+
width: number
|
|
6
|
+
height: number
|
|
7
|
+
top: number
|
|
8
|
+
left: number
|
|
9
|
+
right: number
|
|
10
|
+
bottom: number
|
|
11
|
+
[key: string]: any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function getRect(selector: string, all?: false, comp?: any): Promise<NodeInfo>
|
|
15
|
+
export function getRect(selector: string, all: true, comp?: any): Promise<NodeInfo[]>
|
|
16
|
+
export function range(min?: number, max?: number, value?: number): number
|
|
17
|
+
export function getPx(value: number | string, unit?: boolean): any
|
|
18
|
+
export function rpx2px(value: number): number
|
|
19
|
+
export function rpxToPx(rpx: number): number
|
|
20
|
+
export function sleep(value?: number): Promise<void>
|
|
21
|
+
export function os(): string
|
|
22
|
+
export function sys(): any
|
|
23
|
+
export function getWindowInfo(): any
|
|
24
|
+
export function getDeviceInfo(): any
|
|
25
|
+
export function random(min: number, max: number): number
|
|
26
|
+
export function guid(len?: number, firstU?: boolean, radix?: number | null): string
|
|
27
|
+
export function $parent(name?: string): any
|
|
28
|
+
export function addStyle(customStyle: any, target?: 'object' | 'string'): any
|
|
29
|
+
export function addUnit(value?: number | string, unit?: string): any
|
|
30
|
+
export function deepClone<T>(obj: T): T
|
|
31
|
+
export function deepMerge<T = any>(targetOrigin?: any, source?: any): T
|
|
32
|
+
export function shallowMerge<T = any>(target: any, source?: any): T
|
|
33
|
+
export function error(err: any): void
|
|
34
|
+
export function randomArray<T>(array?: T[]): T[]
|
|
35
|
+
export function timeFormat(dateTime?: any, formatStr?: string): string
|
|
36
|
+
export function timeFrom(timestamp?: any, format?: string): string
|
|
37
|
+
export function trim(str: string, pos?: 'both' | 'left' | 'right' | 'all'): string
|
|
38
|
+
export function queryParams(data?: Record<string, any>, isPrefix?: boolean, arrayFormat?: string): string
|
|
39
|
+
export function toast(title: string, duration?: number): void
|
|
40
|
+
export function type2icon(type?: string, fill?: boolean): string
|
|
41
|
+
export function priceFormat(number: number | string, decimals?: number, decimalPoint?: string, thousandsSeparator?: string): string
|
|
42
|
+
export function getDuration(value: any, unit?: boolean): any
|
|
43
|
+
export function padZero(value: number): string
|
|
44
|
+
export function formValidate(instance: any, event: any): any
|
|
45
|
+
export function getProperty(obj: any, key: string): any
|
|
46
|
+
export function setProperty(obj: any, key: string, value: any): void
|
|
47
|
+
export function page(): any
|
|
48
|
+
export function pages(): any
|
|
49
|
+
export function getValueByPath(obj: any, path: string): any
|
|
50
|
+
export function genLightColor(textColor: string, lightness?: number): string
|
|
51
|
+
|
|
52
|
+
declare const _default: {
|
|
53
|
+
getRect: typeof getRect
|
|
54
|
+
range: typeof range
|
|
55
|
+
getPx: typeof getPx
|
|
56
|
+
sleep: typeof sleep
|
|
57
|
+
os: typeof os
|
|
58
|
+
sys: typeof sys
|
|
59
|
+
getWindowInfo: typeof getWindowInfo
|
|
60
|
+
random: typeof random
|
|
61
|
+
guid: typeof guid
|
|
62
|
+
$parent: typeof $parent
|
|
63
|
+
addStyle: typeof addStyle
|
|
64
|
+
addUnit: typeof addUnit
|
|
65
|
+
deepClone: typeof deepClone
|
|
66
|
+
deepMerge: typeof deepMerge
|
|
67
|
+
shallowMerge: typeof shallowMerge
|
|
68
|
+
error: typeof error
|
|
69
|
+
randomArray: typeof randomArray
|
|
70
|
+
timeFormat: typeof timeFormat
|
|
71
|
+
timeFrom: typeof timeFrom
|
|
72
|
+
trim: typeof trim
|
|
73
|
+
queryParams: typeof queryParams
|
|
74
|
+
toast: typeof toast
|
|
75
|
+
type2icon: typeof type2icon
|
|
76
|
+
priceFormat: typeof priceFormat
|
|
77
|
+
getDuration: typeof getDuration
|
|
78
|
+
padZero: typeof padZero
|
|
79
|
+
formValidate: typeof formValidate
|
|
80
|
+
getProperty: typeof getProperty
|
|
81
|
+
setProperty: typeof setProperty
|
|
82
|
+
page: typeof page
|
|
83
|
+
pages: typeof pages
|
|
84
|
+
getValueByPath: typeof getValueByPath
|
|
85
|
+
genLightColor: typeof genLightColor
|
|
86
|
+
rpx2px: typeof rpx2px
|
|
87
|
+
}
|
|
88
|
+
export default _default
|
package/libs/function/index.js
CHANGED
|
@@ -111,6 +111,20 @@ export function rpx2px(value) {
|
|
|
111
111
|
// #endif
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* @description rpx 转 px(按 750 设计稿宽度等比缩放),取不到窗口宽度时按 2 倍换算兜底
|
|
116
|
+
* @param {number} rpx 设计稿 rpx 值
|
|
117
|
+
* @returns {number}
|
|
118
|
+
*/
|
|
119
|
+
export function rpxToPx(rpx) {
|
|
120
|
+
try {
|
|
121
|
+
const info = uni.getWindowInfo()
|
|
122
|
+
return (Number(rpx) / 750) * info.windowWidth
|
|
123
|
+
} catch {
|
|
124
|
+
return Number(rpx) / 2
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
114
128
|
/**
|
|
115
129
|
* @description 进行延时,以达到可以简写代码的目的 比如: await sleep(20)将会阻塞20ms
|
|
116
130
|
* @param {number} value 堵塞时间 单位ms 毫秒
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// libs/function/test.js 的类型声明(allowJs 未开启,TS 侧导入 .js 需要此声明)
|
|
2
|
+
// ponytail: 校验函数统一 `(value: any, ...) => boolean`,实现细节以 JS 为准。
|
|
3
|
+
|
|
4
|
+
export function email(value: any): boolean
|
|
5
|
+
export function mobile(value: any): boolean
|
|
6
|
+
export function url(value: any): boolean
|
|
7
|
+
export function date(value: any): boolean
|
|
8
|
+
export function dateISO(value: any): boolean
|
|
9
|
+
export function number(value: any): boolean
|
|
10
|
+
export function string(value: any): boolean
|
|
11
|
+
export function digits(value: any): boolean
|
|
12
|
+
export function idCard(value: any): boolean
|
|
13
|
+
export function carNo(value: any): boolean
|
|
14
|
+
export function amount(value: any): boolean
|
|
15
|
+
export function chinese(value: any): boolean
|
|
16
|
+
export function letter(value: any): boolean
|
|
17
|
+
export function enOrNum(value: any): boolean
|
|
18
|
+
export function contains(value: any, param: any): boolean
|
|
19
|
+
export function range(value: any, param: [number, number]): boolean
|
|
20
|
+
export function rangeLength(value: any, param: [number, number]): boolean
|
|
21
|
+
export function landline(value: any): boolean
|
|
22
|
+
export function empty(value: any): boolean
|
|
23
|
+
export function jsonString(value: any): boolean
|
|
24
|
+
export function array(value: any): boolean
|
|
25
|
+
export function object(value: any): boolean
|
|
26
|
+
export function objectPromise(value: any): boolean
|
|
27
|
+
export function code(value: any, len?: number): boolean
|
|
28
|
+
export function func(value: any): boolean
|
|
29
|
+
export function promise(value: any): boolean
|
|
30
|
+
export function image(value: any): boolean
|
|
31
|
+
export function video(value: any): boolean
|
|
32
|
+
export function regExp(o: any): boolean
|
|
33
|
+
|
|
34
|
+
declare const _default: {
|
|
35
|
+
email: typeof email
|
|
36
|
+
mobile: typeof mobile
|
|
37
|
+
url: typeof url
|
|
38
|
+
date: typeof date
|
|
39
|
+
dateISO: typeof dateISO
|
|
40
|
+
number: typeof number
|
|
41
|
+
digits: typeof digits
|
|
42
|
+
idCard: typeof idCard
|
|
43
|
+
carNo: typeof carNo
|
|
44
|
+
amount: typeof amount
|
|
45
|
+
chinese: typeof chinese
|
|
46
|
+
letter: typeof letter
|
|
47
|
+
enOrNum: typeof enOrNum
|
|
48
|
+
contains: typeof contains
|
|
49
|
+
range: typeof range
|
|
50
|
+
rangeLength: typeof rangeLength
|
|
51
|
+
empty: typeof empty
|
|
52
|
+
isEmpty: typeof empty
|
|
53
|
+
jsonString: typeof jsonString
|
|
54
|
+
landline: typeof landline
|
|
55
|
+
object: typeof object
|
|
56
|
+
array: typeof array
|
|
57
|
+
code: typeof code
|
|
58
|
+
func: typeof func
|
|
59
|
+
promise: typeof promise
|
|
60
|
+
video: typeof video
|
|
61
|
+
image: typeof image
|
|
62
|
+
regExp: typeof regExp
|
|
63
|
+
string: typeof string
|
|
64
|
+
}
|
|
65
|
+
export default _default
|
package/package.json
CHANGED
package/scss/_mixins.scss
CHANGED
|
@@ -122,6 +122,14 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// flex 布局(nvue 下由默认 flex 兜底,显式声明方向)
|
|
126
|
+
@mixin dd-flex($direction: row) {
|
|
127
|
+
/* #ifndef APP-NVUE */
|
|
128
|
+
display: flex;
|
|
129
|
+
/* #endif */
|
|
130
|
+
flex-direction: $direction;
|
|
131
|
+
}
|
|
132
|
+
|
|
125
133
|
// flex 居中
|
|
126
134
|
@mixin dd-flex-center {
|
|
127
135
|
display: flex;
|
package/scss/_theme-tokens.scss
CHANGED
|
@@ -28,6 +28,13 @@ $dd-vars-base: (
|
|
|
28
28
|
'error': $dd-error,
|
|
29
29
|
'info': $dd-info,
|
|
30
30
|
'vip': $dd-vip-500,
|
|
31
|
+
// 排行榜奖牌色(明暗不翻转)
|
|
32
|
+
'medal-gold': $dd-medal-gold,
|
|
33
|
+
'medal-gold-deep': $dd-medal-gold-deep,
|
|
34
|
+
'medal-silver': $dd-medal-silver,
|
|
35
|
+
'medal-silver-deep': $dd-medal-silver-deep,
|
|
36
|
+
'medal-bronze': $dd-medal-bronze,
|
|
37
|
+
'medal-bronze-deep': $dd-medal-bronze-deep,
|
|
31
38
|
// 对比色(明暗不翻转;品牌主题可覆盖,如红金主题配白字)
|
|
32
39
|
'primary-contrast': $dd-primary-contrast,
|
|
33
40
|
'accent-contrast': $dd-accent-contrast,
|