@didaoktv/didaoui-uniapp 2.13.0 → 2.15.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 (69) hide show
  1. package/README.md +6 -6
  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-form/dd-form.vue +2 -0
  15. package/components/dd-goods-sku/dd-goods-sku.vue +6 -1
  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-package-sku/dd-package-sku.vue +24 -1
  22. package/components/dd-parse/dd-parse.vue +473 -442
  23. package/components/dd-poster/dd-poster.vue +579 -567
  24. package/components/dd-pull-refresh/dd-pull-refresh.vue +1 -9
  25. package/components/dd-qrcode/dd-qrcode.vue +431 -405
  26. package/components/dd-radio-group/dd-radio-group.vue +1 -1
  27. package/components/dd-segmented-tab/dd-segmented-tab.vue +61 -16
  28. package/components/dd-signature/dd-signature.vue +377 -357
  29. package/components/dd-step/dd-step.vue +1 -1
  30. package/components/dd-sticky/dd-sticky.vue +5 -10
  31. package/components/dd-swipe-action/dd-swipe-action.vue +1 -9
  32. package/components/dd-swipe-item/dd-swipe-item.vue +2 -0
  33. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -5
  34. package/components/dd-switch/dd-switch.vue +1 -1
  35. package/components/dd-text/dd-text.vue +304 -82
  36. package/components/dd-waterfall/dd-waterfall.vue +147 -0
  37. package/components/dd-waterfall/waterfall.ts +17 -0
  38. package/index.ts +4 -3
  39. package/libs/function/index.d.ts +88 -0
  40. package/libs/function/index.js +14 -0
  41. package/libs/function/test.d.ts +65 -0
  42. package/package.json +1 -1
  43. package/scss/_mixins.scss +8 -0
  44. package/scss/_theme-tokens.scss +7 -0
  45. package/scss/_variables.scss +283 -156
  46. package/components/dd-album/album.js +0 -19
  47. package/components/dd-album/props.js +0 -89
  48. package/components/dd-avatar/avatar.js +0 -19
  49. package/components/dd-avatar/props.js +0 -84
  50. package/components/dd-avatar-group/avatarGroup.js +0 -14
  51. package/components/dd-avatar-group/props.js +0 -57
  52. package/components/dd-keyboard/keyboard.js +0 -19
  53. package/components/dd-keyboard/props.js +0 -79
  54. package/components/dd-link/link.js +0 -17
  55. package/components/dd-link/props.js +0 -44
  56. package/components/dd-number-keyboard/numberKeyboard.js +0 -8
  57. package/components/dd-number-keyboard/props.js +0 -24
  58. package/components/dd-parse/props.js +0 -57
  59. package/components/dd-text/props.js +0 -120
  60. package/components/dd-text/text.js +0 -30
  61. package/components/dd-text/value.js +0 -87
  62. package/libs/config/color.js +0 -16
  63. package/libs/config/props.js +0 -184
  64. package/libs/mixin/button.js +0 -18
  65. package/libs/mixin/mixin.js +0 -44
  66. package/libs/mixin/mpMixin.js +0 -13
  67. package/libs/mixin/openType.js +0 -27
  68. package/libs/vue.js +0 -3
  69. package/scss/_dd-shared.scss +0 -40
@@ -1,184 +0,0 @@
1
- /**
2
- * Shared props configuration store.
3
- *
4
- * Component defaults are registered lazily by each component props.js file so
5
- * importing one component no longer pulls defaults for every component.
6
- */
7
- import config from './config'
8
- import zIndex from './zIndex.js'
9
- import color from './color.js'
10
- import { shallowMerge } from '../function/index.js'
11
-
12
- const componentKeys = [
13
- 'actionSheet',
14
- 'album',
15
- 'alert',
16
- 'avatar',
17
- 'avatarGroup',
18
- 'backtop',
19
- 'badge',
20
- 'box',
21
- 'button',
22
- 'calendar',
23
- 'calendarStrip',
24
- 'card',
25
- 'cell',
26
- 'cellGroup',
27
- 'checkbox',
28
- 'checkboxGroup',
29
- 'circleProgress',
30
- 'code',
31
- 'codeInput',
32
- 'col',
33
- 'collapse',
34
- 'collapseItem',
35
- 'columnNotice',
36
- 'countDown',
37
- 'countTo',
38
- 'datetimePicker',
39
- 'divider',
40
- 'dropdown',
41
- 'dropdownItem',
42
- 'empty',
43
- 'form',
44
- 'formItem',
45
- 'gap',
46
- 'grid',
47
- 'gridItem',
48
- 'guide',
49
- 'icon',
50
- 'image',
51
- 'indexAnchor',
52
- 'indexItem',
53
- 'indexList',
54
- 'input',
55
- 'keyboard',
56
- 'line',
57
- 'lineProgress',
58
- 'link',
59
- 'list',
60
- 'listItem',
61
- 'loadingIcon',
62
- 'loadingPage',
63
- 'loadmore',
64
- 'modal',
65
- 'navbar',
66
- 'navbarMini',
67
- 'noNetwork',
68
- 'noticeBar',
69
- 'notify',
70
- 'novelReader',
71
- 'numberBox',
72
- 'numberKeyboard',
73
- 'overlay',
74
- 'parse',
75
- 'pdfReader',
76
- 'picker',
77
- 'pickerColumn',
78
- 'popover',
79
- 'popup',
80
- 'radio',
81
- 'radioGroup',
82
- 'rate',
83
- 'readMore',
84
- 'row',
85
- 'rowNotice',
86
- 'safeBottom',
87
- 'scrollList',
88
- 'search',
89
- 'section',
90
- 'skeleton',
91
- 'slider',
92
- 'statusBar',
93
- 'steps',
94
- 'stepsItem',
95
- 'sticky',
96
- 'subsection',
97
- 'swipeAction',
98
- 'swipeActionItem',
99
- 'swiper',
100
- 'swiperIndicator',
101
- 'switch',
102
- 'tabbar',
103
- 'tabbarItem',
104
- 'table',
105
- 'tabs',
106
- 'tabsItem',
107
- 'tag',
108
- 'td',
109
- 'text',
110
- 'textarea',
111
- 'th',
112
- 'toast',
113
- 'toolbar',
114
- 'tooltip',
115
- 'tr',
116
- 'transition',
117
- 'upload'
118
- ]
119
-
120
- const props = {}
121
-
122
- function ensureComponentProps(key) {
123
- if (!props[key] || typeof props[key] !== 'object') {
124
- props[key] = {}
125
- }
126
- return props[key]
127
- }
128
-
129
- function isPlainObject(value) {
130
- return Object.prototype.toString.call(value) === '[object Object]'
131
- }
132
-
133
- function cloneDefaultValue(value) {
134
- if (Array.isArray(value)) {
135
- return value.slice()
136
- }
137
- if (isPlainObject(value)) {
138
- return mergeDefaults({}, value)
139
- }
140
- return value
141
- }
142
-
143
- function mergeDefaults(target, defaults = {}) {
144
- if (!target || typeof target !== 'object' || !defaults || typeof defaults !== 'object') {
145
- return target
146
- }
147
- Object.keys(defaults).forEach((key) => {
148
- const defaultValue = defaults[key]
149
- const targetValue = target[key]
150
- if (targetValue === undefined) {
151
- target[key] = cloneDefaultValue(defaultValue)
152
- } else if (isPlainObject(targetValue) && isPlainObject(defaultValue)) {
153
- mergeDefaults(targetValue, defaultValue)
154
- }
155
- })
156
- return target
157
- }
158
-
159
- componentKeys.forEach(ensureComponentProps)
160
-
161
- export function registerComponentProps(defaultProps = {}) {
162
- Object.keys(defaultProps || {}).forEach((key) => {
163
- const componentProps = ensureComponentProps(key)
164
- mergeDefaults(componentProps, defaultProps[key])
165
- })
166
- return props
167
- }
168
-
169
- export function setPropsConfig(configProps = {}) {
170
- Object.keys(configProps || {}).forEach((key) => {
171
- shallowMerge(ensureComponentProps(key), configProps[key])
172
- })
173
- return props
174
- }
175
-
176
- function setConfig(configs = {}) {
177
- shallowMerge(config, configs.config || {})
178
- setPropsConfig(configs.props || {})
179
- shallowMerge(color, configs.color || {})
180
- shallowMerge(zIndex, configs.zIndex || {})
181
- }
182
-
183
- // ponytail: 不提供全局配置注入入口(含 http 实例注册),DidaoUI 组件默认值由各组件 props.js 就地注册
184
- export default props
@@ -1,18 +0,0 @@
1
- import { defineMixin } from '../vue'
2
-
3
- export const buttonMixin = defineMixin({
4
- props: {
5
- lang: String,
6
- sessionFrom: String,
7
- sendMessageTitle: String,
8
- sendMessagePath: String,
9
- sendMessageImg: String,
10
- showMessageCard: Boolean,
11
- appParameter: String,
12
- formType: String,
13
- openType: String
14
- }
15
- })
16
-
17
- export default buttonMixin
18
-
@@ -1,44 +0,0 @@
1
- // ponytail: 组件库基础 mixin 的轻量版——只保留组件实际消费的能力
2
- // (props customStyle/customClass/url/linkType、getRect)。
3
- // 不携带运行时主题注入,DidaoUI 用 scss 变量体系,不需要。
4
- import { defineMixin } from '../vue'
5
-
6
- export const mixin = defineMixin({
7
- props: {
8
- customStyle: {
9
- type: [Object, String],
10
- default: () => ({})
11
- },
12
- customClass: {
13
- type: String,
14
- default: ''
15
- },
16
- url: {
17
- type: String,
18
- default: ''
19
- },
20
- linkType: {
21
- type: String,
22
- default: 'navigateTo'
23
- }
24
- },
25
- methods: {
26
- // 查询组件内节点信息
27
- async getRect(selector, all = false) {
28
- const inst = uni.createSelectorQuery().in(this)
29
- const q = all ? inst.selectAll(selector) : inst.select(selector)
30
- return new Promise((resolve) => {
31
- q.boundingClientRect((rect) => {
32
- resolve(all && Array.isArray(rect) && rect.length ? rect : rect)
33
- }).exec()
34
- })
35
- },
36
- // 空操作:键盘等组件模板 @touchmove.stop.prevent="noop" 依赖此方法,
37
- // 缺失时 handler 为 undefined 会在渲染期抛 _withMods 错误
38
- noop(e) {
39
- e && typeof e.stopPropagation === 'function' && e.stopPropagation()
40
- }
41
- }
42
- })
43
-
44
- export default mixin
@@ -1,13 +0,0 @@
1
- import { defineMixin } from '../vue'
2
-
3
- export const mpMixin = defineMixin({
4
- // #ifdef MP-WEIXIN
5
- // 将自定义节点设置成虚拟的,更加接近Vue组件的表现,能更好的使用flex属性
6
- options: {
7
- virtualHost: true
8
- }
9
- // #endif
10
- })
11
-
12
- export default mpMixin
13
-
@@ -1,27 +0,0 @@
1
- import { defineMixin } from '../vue'
2
-
3
- export const openType = defineMixin({
4
- props: {
5
- openType: String
6
- },
7
- methods: {
8
- onGetUserInfo(event) {
9
- this.$emit('getuserinfo', event.detail)
10
- },
11
- onContact(event) {
12
- this.$emit('contact', event.detail)
13
- },
14
- onGetPhoneNumber(event) {
15
- this.$emit('getphonenumber', event.detail)
16
- },
17
- onError(event) {
18
- this.$emit('error', event.detail)
19
- },
20
- onLaunchApp(event) {
21
- this.$emit('launchapp', event.detail)
22
- },
23
- onOpenSetting(event) {
24
- this.$emit('opensetting', event.detail)
25
- }
26
- }
27
- })
package/libs/vue.js DELETED
@@ -1,3 +0,0 @@
1
- export const defineMixin = (options) => {
2
- return options
3
- }
@@ -1,40 +0,0 @@
1
- // 通过scss的mixin功能,把原来需要写4行的css,变成一行
2
- // 目的是保持代码干净整洁,不至于在nvue下,到处都要写display:flex的条件编译
3
- @mixin flex($direction: row) {
4
- /* #ifndef APP-NVUE */
5
- display: flex;
6
- /* #endif */
7
- flex-direction: $direction;
8
- }
9
-
10
- // —— 以下为移植组件引用的工具类(就地生成,避免全局注入) ——
11
- // 按钮重置
12
- .dd-reset-button {
13
- padding: 0;
14
- background-color: transparent;
15
- font-size: inherit;
16
- line-height: inherit;
17
- color: inherit;
18
- }
19
-
20
- .dd-reset-button::after {
21
- border: none;
22
- }
23
-
24
- // 超出行数省略号(dd-line-N)
25
- @for $i from 1 through 10 {
26
- .dd-line-#{$i} {
27
- /* #ifdef APP-NVUE */
28
- lines: $i;
29
- text-overflow: ellipsis;
30
- overflow: hidden;
31
- flex: 1;
32
- /* #endif */
33
- /* #ifndef APP-NVUE */
34
- display: -webkit-box;
35
- -webkit-box-orient: vertical;
36
- -webkit-line-clamp: $i;
37
- overflow: hidden;
38
- /* #endif */
39
- }
40
- }