@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.
Files changed (59) 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-icon/dd-icon.vue +1 -1
  16. package/components/dd-keyboard/dd-keyboard.vue +95 -46
  17. package/components/dd-link/dd-link.vue +72 -49
  18. package/components/dd-markdown/dd-markdown.vue +154 -154
  19. package/components/dd-number-keyboard/dd-number-keyboard.vue +109 -94
  20. package/components/dd-parse/dd-parse.vue +473 -442
  21. package/components/dd-poster/dd-poster.vue +579 -567
  22. package/components/dd-pull-refresh/dd-pull-refresh.vue +1 -9
  23. package/components/dd-qrcode/dd-qrcode.vue +431 -405
  24. package/components/dd-radio-group/dd-radio-group.vue +1 -1
  25. package/components/dd-segmented-tab/dd-segmented-tab.vue +22 -14
  26. package/components/dd-signature/dd-signature.vue +377 -357
  27. package/components/dd-step/dd-step.vue +1 -1
  28. package/components/dd-sticky/dd-sticky.vue +5 -10
  29. package/components/dd-swipe-action/dd-swipe-action.vue +1 -9
  30. package/components/dd-swipe-item/dd-swipe-item.vue +2 -0
  31. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -5
  32. package/components/dd-switch/dd-switch.vue +1 -1
  33. package/components/dd-text/dd-text.vue +304 -82
  34. package/components/dd-waterfall/dd-waterfall.vue +89 -0
  35. package/index.ts +4 -3
  36. package/libs/function/index.d.ts +88 -0
  37. package/libs/function/index.js +14 -0
  38. package/libs/function/test.d.ts +65 -0
  39. package/package.json +1 -1
  40. package/scss/_mixins.scss +8 -0
  41. package/scss/_theme-tokens.scss +7 -0
  42. package/scss/_variables.scss +283 -156
  43. package/components/dd-album/album.js +0 -19
  44. package/components/dd-album/props.js +0 -89
  45. package/components/dd-avatar/avatar.js +0 -19
  46. package/components/dd-avatar/props.js +0 -84
  47. package/components/dd-avatar-group/avatarGroup.js +0 -14
  48. package/components/dd-avatar-group/props.js +0 -57
  49. package/components/dd-keyboard/keyboard.js +0 -19
  50. package/components/dd-keyboard/props.js +0 -79
  51. package/components/dd-link/link.js +0 -17
  52. package/components/dd-link/props.js +0 -44
  53. package/components/dd-number-keyboard/numberKeyboard.js +0 -8
  54. package/components/dd-number-keyboard/props.js +0 -24
  55. package/components/dd-parse/props.js +0 -57
  56. package/components/dd-text/props.js +0 -120
  57. package/components/dd-text/text.js +0 -30
  58. package/components/dd-text/value.js +0 -87
  59. package/scss/_dd-shared.scss +0 -40
@@ -36,7 +36,7 @@ provide('dd-radio-group', {
36
36
 
37
37
  <style lang="scss" scoped>
38
38
  @import '../../scss/variables';
39
-
39
+ @import '../../scss/mixins';
40
40
  .dd-radio-group {
41
41
  display: flex;
42
42
  flex-wrap: wrap;
@@ -4,10 +4,7 @@
4
4
  class="dd-seg dd-seg--pill"
5
5
  :class="{ 'dd-seg--sm': size === 'sm' }"
6
6
  >
7
- <view
8
- ref="trackRef"
9
- class="dd-seg__track"
10
- >
7
+ <view class="dd-seg__track">
11
8
  <view
12
9
  v-for="(opt, index) in options"
13
10
  :key="index"
@@ -43,8 +40,7 @@
43
40
  </template>
44
41
 
45
42
  <script setup lang="ts">
46
- import { nextTick, onMounted, ref, watch } from 'vue'
47
- import { getCurrentInstance } from 'vue'
43
+ import { getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
48
44
  // z-index 统一取 libs/config/zIndex.js(分段项盖住滑块指示器取 base 档)
49
45
  import zIndexConfig from '../../libs/config/zIndex.js'
50
46
 
@@ -95,7 +91,9 @@ function measure() {
95
91
  const track = res[1] as UniApp.NodeInfo
96
92
  if (!items.length || !track) return
97
93
  const target = items[props.modelValue]
98
- if (!target) return
94
+ // 宽为 0 说明此刻容器不可见(弹层/抽屉/未激活 tab 内挂载),此时不写入几何:
95
+ // 否则指示块会被钉成 0 宽且再无重测触发(可见性变化不会经过本组件的 watch)
96
+ if (!target || !target.width || !track.width) return
99
97
  const left = (target.left || 0) - (track.left || 0)
100
98
  indicatorStyle.value = {
101
99
  width: (target.width || 0) + 'px',
@@ -106,8 +104,12 @@ function measure() {
106
104
  }
107
105
 
108
106
  onMounted(measure)
109
- watch(() => props.modelValue, measure)
110
- watch(() => props.options, measure)
107
+ // modelValue(停靠位)/ options(标签改动或引用变化)/ size(sm↔md 档位,改项宽)三者都影响几何,
108
+ // 统一监听;deep 用于捕捉 options 元素 label 被就地改写(数组引用不变的场景)
109
+ watch([() => props.modelValue, () => props.options, () => props.size], measure, { deep: true })
110
+
111
+ // 隐藏态挂载的补测入口:父级容器变可见后(弹层打开 / tab 切换)调用一次即可收敛
112
+ defineExpose({ refresh: measure })
111
113
  </script>
112
114
 
113
115
  <style lang="scss" scoped>
@@ -122,16 +124,21 @@ watch(() => props.options, measure)
122
124
  .dd-seg--pill {
123
125
  .dd-seg__track {
124
126
  position: relative;
125
- display: inline-flex;
127
+ display: flex;
128
+ width: 100%;
129
+ box-sizing: border-box;
126
130
  padding: $dd-space-1;
127
131
  background: var(--dd-surface-container-high, #{$dd-surface-container-high});
128
132
  border: 1px solid var(--dd-border-default, #{$dd-border-default});
129
133
  border-radius: $dd-radius-full;
130
134
  }
131
135
 
136
+ // 等分填充父容器(antd-mobile Segmented 的做法):项按 flex 等分,标签超长省略而非撑破容器
132
137
  .dd-seg__item {
133
138
  position: relative;
134
- min-width: 120rpx;
139
+ flex: 1 1 0;
140
+ min-width: 0;
141
+ overflow: hidden;
135
142
  padding: 12rpx $dd-space-4;
136
143
  @include dd-flex-center;
137
144
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
@@ -148,7 +155,6 @@ watch(() => props.options, measure)
148
155
  // sm 小号:字号 caption(12px=24rpx)、更紧内边距,整体高度对齐页面 24rpx 字号胶囊
149
156
  &.dd-seg--sm {
150
157
  .dd-seg__item {
151
- min-width: 96rpx;
152
158
  padding: $dd-space-1;
153
159
  font-size: $dd-font-size-caption;
154
160
  }
@@ -161,7 +167,7 @@ watch(() => props.options, measure)
161
167
  left: 0;
162
168
  background: $dd-color-white;
163
169
  border-radius: $dd-radius-full;
164
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
170
+ box-shadow: var(--dd-shadow-1, #{$dd-shadow-1});
165
171
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
166
172
  width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
167
173
  }
@@ -171,7 +177,9 @@ watch(() => props.options, measure)
171
177
  .dd-seg--text {
172
178
  display: flex;
173
179
  flex-direction: row;
174
- gap: $dd-space-6;
180
+ flex-wrap: wrap;
181
+ column-gap: $dd-space-6;
182
+ row-gap: $dd-space-2;
175
183
 
176
184
  &.dd-seg--sm {
177
185
  .dd-seg-text__item {