@didaoktv/didaoui-uniapp 2.12.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.
Files changed (60) hide show
  1. package/README.md +7 -7
  2. package/components/dd-album/dd-album.vue +280 -228
  3. package/components/dd-avatar/dd-avatar.vue +132 -75
  4. package/components/dd-avatar-group/dd-avatar-group.vue +52 -30
  5. package/components/dd-barcode/dd-barcode.vue +884 -947
  6. package/components/dd-button/dd-button.vue +47 -21
  7. package/components/dd-canvas/dd-canvas.vue +1156 -985
  8. package/components/dd-car-keyboard/dd-car-keyboard.vue +12 -12
  9. package/components/dd-champion-card/dd-champion-card.vue +49 -21
  10. package/components/dd-checkbox-group/dd-checkbox-group.vue +2 -0
  11. package/components/dd-copy/dd-copy.vue +51 -56
  12. package/components/dd-cropper/dd-cropper.vue +1224 -1135
  13. package/components/dd-divider/dd-divider.vue +9 -2
  14. package/components/dd-fold/dd-fold.vue +133 -0
  15. package/components/dd-form/dd-form.vue +2 -0
  16. package/components/dd-icon/dd-icon.vue +1 -1
  17. package/components/dd-keyboard/dd-keyboard.vue +95 -46
  18. package/components/dd-link/dd-link.vue +72 -49
  19. package/components/dd-markdown/dd-markdown.vue +154 -154
  20. package/components/dd-number-keyboard/dd-number-keyboard.vue +109 -94
  21. package/components/dd-parse/dd-parse.vue +473 -442
  22. package/components/dd-poster/dd-poster.vue +579 -567
  23. package/components/dd-pull-refresh/dd-pull-refresh.vue +1 -9
  24. package/components/dd-qrcode/dd-qrcode.vue +431 -405
  25. package/components/dd-radio-group/dd-radio-group.vue +1 -1
  26. package/components/dd-segmented-tab/dd-segmented-tab.vue +22 -14
  27. package/components/dd-signature/dd-signature.vue +377 -357
  28. package/components/dd-step/dd-step.vue +1 -1
  29. package/components/dd-sticky/dd-sticky.vue +5 -10
  30. package/components/dd-swipe-action/dd-swipe-action.vue +1 -9
  31. package/components/dd-swipe-item/dd-swipe-item.vue +2 -0
  32. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -5
  33. package/components/dd-switch/dd-switch.vue +1 -1
  34. package/components/dd-text/dd-text.vue +304 -82
  35. package/components/dd-waterfall/dd-waterfall.vue +89 -0
  36. package/index.ts +8 -6
  37. package/libs/function/index.d.ts +88 -0
  38. package/libs/function/index.js +14 -0
  39. package/libs/function/test.d.ts +65 -0
  40. package/package.json +1 -1
  41. package/scss/_mixins.scss +8 -0
  42. package/scss/_theme-tokens.scss +7 -0
  43. package/scss/_variables.scss +283 -156
  44. package/components/dd-album/album.js +0 -19
  45. package/components/dd-album/props.js +0 -89
  46. package/components/dd-avatar/avatar.js +0 -19
  47. package/components/dd-avatar/props.js +0 -84
  48. package/components/dd-avatar-group/avatarGroup.js +0 -14
  49. package/components/dd-avatar-group/props.js +0 -57
  50. package/components/dd-keyboard/keyboard.js +0 -19
  51. package/components/dd-keyboard/props.js +0 -79
  52. package/components/dd-link/link.js +0 -17
  53. package/components/dd-link/props.js +0 -44
  54. package/components/dd-number-keyboard/numberKeyboard.js +0 -8
  55. package/components/dd-number-keyboard/props.js +0 -24
  56. package/components/dd-parse/props.js +0 -57
  57. package/components/dd-text/props.js +0 -120
  58. package/components/dd-text/text.js +0 -30
  59. package/components/dd-text/value.js +0 -87
  60. package/scss/_dd-shared.scss +0 -40
package/index.ts CHANGED
@@ -43,11 +43,12 @@ import DdDropdownItem from './components/dd-dropdown-item/dd-dropdown-item.vue'
43
43
  import DdSidebar from './components/dd-sidebar/dd-sidebar.vue'
44
44
  import DdSidebarItem from './components/dd-sidebar-item/dd-sidebar-item.vue'
45
45
 
46
- // === Layout (11) ===
46
+ // === Layout (13) ===
47
47
  import DdCard from './components/dd-card/dd-card.vue'
48
48
  import DdRoomCard from './components/dd-room-card/dd-room-card.vue'
49
49
  import DdGoodsCard from './components/dd-goods-card/dd-goods-card.vue'
50
50
  import DdFeatureGrid from './components/dd-feature-grid/dd-feature-grid.vue'
51
+ import DdWaterfall from './components/dd-waterfall/dd-waterfall.vue'
51
52
  import DdSticky from './components/dd-sticky/dd-sticky.vue'
52
53
  import DdBillDetail from './components/dd-bill-detail/dd-bill-detail.vue'
53
54
  import DdWorkorderCard from './components/dd-workorder-card/dd-workorder-card.vue'
@@ -57,7 +58,7 @@ import DdQrcode from './components/dd-qrcode/dd-qrcode.vue'
57
58
  import DdSubmitBar from './components/dd-submit-bar/dd-submit-bar.vue'
58
59
  import DdCartBar from './components/dd-cart-bar/dd-cart-bar.vue'
59
60
 
60
- // === Display (25) ===
61
+ // === Display (26) ===
61
62
  import DdTag from './components/dd-tag/dd-tag.vue'
62
63
  import DdStatCard from './components/dd-stat-card/dd-stat-card.vue'
63
64
  import DdChampionCard from './components/dd-champion-card/dd-champion-card.vue'
@@ -67,6 +68,7 @@ import DdBadge from './components/dd-badge/dd-badge.vue'
67
68
  import DdListCell from './components/dd-list-cell/dd-list-cell.vue'
68
69
  import DdCell from './components/dd-cell/dd-cell.vue'
69
70
  import DdCellGroup from './components/dd-cell-group/dd-cell-group.vue'
71
+ import DdFold from './components/dd-fold/dd-fold.vue'
70
72
  import DdCountDown from './components/dd-count-down/dd-count-down.vue'
71
73
  import DdDivider from './components/dd-divider/dd-divider.vue'
72
74
  import DdImage from './components/dd-image/dd-image.vue'
@@ -124,11 +126,11 @@ const components = {
124
126
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
125
127
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
126
128
  DdSidebar, DdSidebarItem,
127
- DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
129
+ DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdWaterfall, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
128
130
  DdSubmitBar,
129
131
  DdCartBar,
130
132
  DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
131
- DdListCell, DdCell, DdCellGroup, DdCountDown, DdDivider,
133
+ DdListCell, DdCell, DdCellGroup, DdFold, DdCountDown, DdDivider,
132
134
  DdImage, DdProgress, DdSkeleton, DdEmptyState, DdStep, DdSteps,
133
135
  DdText, DdLink, DdCopy, DdAlbum, DdCoupon, DdParse, DdMarkdown, DdPrice,
134
136
  DdModal, DdActionSheet, DdToast, DdAlert, DdLoading,
@@ -157,11 +159,11 @@ export {
157
159
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
158
160
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
159
161
  DdSidebar, DdSidebarItem,
160
- DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
162
+ DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdWaterfall, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
161
163
  DdSubmitBar,
162
164
  DdCartBar,
163
165
  DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
164
- DdListCell, DdCell, DdCellGroup, DdCountDown, DdDivider,
166
+ DdListCell, DdCell, DdCellGroup, DdFold, DdCountDown, DdDivider,
165
167
  DdImage, DdProgress, DdSkeleton, DdEmptyState, DdStep, DdSteps,
166
168
  DdText, DdLink, DdCopy, DdAlbum, DdCoupon, DdParse, DdMarkdown, DdPrice,
167
169
  DdModal, DdActionSheet, DdToast, DdAlert, DdLoading,
@@ -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
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didaoktv/didaoui-uniapp",
3
- "version": "2.12.0",
3
+ "version": "2.14.0",
4
4
  "description": "帝到KTV UniApp 组件库",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
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;
@@ -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,