@didaoktv/didaoui-uniapp 2.10.0 → 2.12.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.
@@ -51,7 +51,8 @@ interface Props {
51
51
  label?: string
52
52
  value?: string
53
53
  icon?: string
54
- size?: 'normal' | 'large'
54
+ /** 尺寸档:xs 紧凑展示 / sm 紧凑 / md 默认 / lg 宽松,同时改变行高与字号 */
55
+ size?: 'xs' | 'sm' | 'md' | 'lg'
55
56
  isLink?: boolean
56
57
  arrowDirection?: 'left' | 'right' | 'up' | 'down'
57
58
  required?: boolean | 'auto'
@@ -70,7 +71,7 @@ const props = withDefaults(defineProps<Props>(), {
70
71
  label: '',
71
72
  value: '',
72
73
  icon: '',
73
- size: 'normal',
74
+ size: 'md',
74
75
  isLink: false,
75
76
  arrowDirection: 'right',
76
77
  required: false,
@@ -129,15 +130,28 @@ function handleClick(e: Event) {
129
130
  color: var(--dd-text-primary, #{$dd-text-primary});
130
131
  @include dd-hairline-bottom(var(--dd-border-subtle, #{$dd-border-subtle}));
131
132
 
132
- // 高度 = 垂直 padding + 行高(12/16px × 2 + 23.8px ≈ 96/112rpx),内容天然居中
133
- &--normal {
134
- padding-top: $dd-space-3;
135
- padding-bottom: $dd-space-3;
133
+ // 尺寸档由竖直 padding(8/12/16px)+ 根字号(12/14/16px)派生,横向留白恒定;
134
+ // 子元素字号统一用 em 跟随根字号,避免逐档重复声明
135
+ padding-top: $dd-space-3;
136
+ padding-bottom: $dd-space-3;
137
+
138
+ // xs:最低档,竖直留白 4px,用于详情卡内的密集键值行;低于 44px 触控下限,仅限非交互展示
139
+ &--xs {
140
+ padding-top: $dd-space-1;
141
+ padding-bottom: $dd-space-1;
142
+ font-size: $dd-font-size-caption;
143
+ }
144
+
145
+ &--sm {
146
+ padding-top: $dd-space-2;
147
+ padding-bottom: $dd-space-2;
148
+ font-size: $dd-font-size-caption;
136
149
  }
137
150
 
138
- &--large {
151
+ &--lg {
139
152
  padding-top: $dd-space-4;
140
153
  padding-bottom: $dd-space-4;
154
+ font-size: $dd-font-size-lead;
141
155
  }
142
156
 
143
157
  &--center {
@@ -164,14 +178,14 @@ function handleClick(e: Event) {
164
178
  }
165
179
 
166
180
  &__icon-text {
167
- font-size: 36rpx;
181
+ font-size: 1.286em;
168
182
  line-height: 1;
169
183
  color: var(--dd-primary-400, #{$dd-primary-400});
170
184
  }
171
185
 
172
186
  &__required {
173
187
  color: var(--dd-error, #{$dd-error});
174
- font-size: $dd-font-size-body;
188
+ font-size: 1em;
175
189
  margin-right: 4rpx;
176
190
  line-height: inherit;
177
191
  text {
@@ -188,14 +202,14 @@ function handleClick(e: Event) {
188
202
  }
189
203
 
190
204
  &__title {
191
- font-size: $dd-font-size-body;
205
+ font-size: 1em;
192
206
  color: var(--dd-text-primary, #{$dd-text-primary});
193
207
  @include dd-ellipsis(1);
194
208
  }
195
209
 
196
210
  &__label {
197
211
  margin-top: 4rpx;
198
- font-size: $dd-font-size-caption;
212
+ font-size: 0.857em;
199
213
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
200
214
  @include dd-ellipsis(1);
201
215
  }
@@ -209,12 +223,12 @@ function handleClick(e: Event) {
209
223
  }
210
224
 
211
225
  &__value {
212
- font-size: $dd-font-size-body;
226
+ font-size: 1em;
213
227
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
214
228
  }
215
229
 
216
230
  &__arrow {
217
- font-size: $dd-font-size-h4;
231
+ font-size: 1.143em;
218
232
 
219
233
  &--right {
220
234
  transform: rotate(0deg);
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <view>
3
- <view v-if="title || $slots.title" class="dd-cell-group__title" :class="{ 'dd-cell-group__title--inset': inset }">
3
+ <view
4
+ v-if="title || $slots.title"
5
+ class="dd-cell-group__title"
6
+ :class="[`dd-cell-group__title--${size}`, { 'dd-cell-group__title--inset': inset }]"
7
+ >
4
8
  <slot name="title">{{ title }}</slot>
5
9
  </view>
6
10
  <view class="dd-cell-group" :class="{ 'dd-cell-group--inset': inset, 'dd-cell-group--border': border && !inset }">
@@ -16,12 +20,15 @@ interface Props {
16
20
  inset?: boolean
17
21
  /** 通栏模式下的首尾外框发丝线 */
18
22
  border?: boolean
23
+ /** 分节标题尺寸档,只影响标题排版,不向子 cell 传递 */
24
+ size?: 'xs' | 'sm' | 'md' | 'lg'
19
25
  }
20
26
 
21
27
  withDefaults(defineProps<Props>(), {
22
28
  title: '',
23
29
  inset: false,
24
30
  border: true,
31
+ size: 'md',
25
32
  })
26
33
  </script>
27
34
 
@@ -51,12 +58,32 @@ withDefaults(defineProps<Props>(), {
51
58
  }
52
59
 
53
60
  .dd-cell-group__title {
54
- padding: 32rpx 32rpx 16rpx;
61
+ padding: $dd-space-4 $dd-space-4 $dd-space-2;
55
62
  font-size: $dd-font-size-caption;
56
63
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
57
64
 
58
65
  &--inset {
59
- padding: 32rpx 24rpx 16rpx;
66
+ padding-left: $dd-space-3;
67
+ padding-right: $dd-space-3;
68
+ }
69
+
70
+ // 尺寸档只调标题排版(竖直 padding + 字号),不级联到子 cell
71
+ &--xs {
72
+ padding-top: $dd-space-2;
73
+ padding-bottom: 0;
74
+ font-size: $dd-font-size-overline;
75
+ }
76
+
77
+ &--sm {
78
+ padding-top: $dd-space-3;
79
+ padding-bottom: $dd-space-1;
80
+ font-size: $dd-font-size-overline;
81
+ }
82
+
83
+ &--lg {
84
+ padding-top: $dd-space-5;
85
+ padding-bottom: $dd-space-3;
86
+ font-size: $dd-font-size-body;
60
87
  }
61
88
  }
62
89
  </style>
@@ -3,6 +3,7 @@
3
3
  class="dd-field"
4
4
  :class="[
5
5
  rootClass,
6
+ `dd-field--${size}`,
6
7
  {
7
8
  'dd-field--error': errorState,
8
9
  'dd-field--disabled': disabledState,
@@ -11,7 +12,6 @@
11
12
  'dd-field--center': center,
12
13
  'dd-field--label-top': effectiveLabelPosition === 'top',
13
14
  'dd-field--clickable': clickableState,
14
- 'dd-field--large': size === 'large',
15
15
  },
16
16
  ]"
17
17
  :hover-class="clickableState ? 'dd-field--active' : ''"
@@ -140,8 +140,8 @@ interface Props {
140
140
  clickable?: boolean
141
141
  isLink?: boolean
142
142
  arrowDirection?: 'left' | 'right' | 'up' | 'down'
143
- /** 单元格尺寸,large 增大行高(与 dd-cell 对齐) */
144
- size?: 'normal' | 'large'
143
+ /** 单元格尺寸档,与 dd-cell 同一套竖直 rhythm(xs/sm/md/lg = 4/8/12/16px) */
144
+ size?: 'xs' | 'sm' | 'md' | 'lg'
145
145
  icon?: string
146
146
  leftIcon?: string
147
147
  rightIcon?: string
@@ -193,7 +193,7 @@ const props = withDefaults(defineProps<Props>(), {
193
193
  clickable: false,
194
194
  isLink: false,
195
195
  arrowDirection: 'right',
196
- size: 'normal',
196
+ size: 'md',
197
197
  icon: '',
198
198
  leftIcon: '',
199
199
  rightIcon: '',
@@ -437,7 +437,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
437
437
  width: 100%;
438
438
  // 单行/多行统一以 md 档为下限(border-box 下 padding 已含);textarea 靠内容自然增高,min-height 不限高
439
439
  min-height: $dd-size-control-md;
440
- padding: 20rpx $dd-space-4;
440
+ padding: $dd-space-3 $dd-space-4;
441
441
  overflow: hidden;
442
442
  font-size: $dd-font-size-body;
443
443
  line-height: $dd-line-height-lead;
@@ -457,9 +457,21 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
457
457
  transform: scaleY(0.5);
458
458
  }
459
459
 
460
- &--large {
461
- padding-top: $dd-space-3;
462
- padding-bottom: $dd-space-3;
460
+ // xs:36px 紧凑行(低于 44px 触控下限,仅限非交互展示),竖直留白 4px
461
+ &--xs {
462
+ min-height: $dd-size-control-compact;
463
+ padding-top: $dd-space-1;
464
+ padding-bottom: $dd-space-1;
465
+ }
466
+
467
+ &--sm {
468
+ padding-top: $dd-space-2;
469
+ padding-bottom: $dd-space-2;
470
+ }
471
+
472
+ &--lg {
473
+ padding-top: $dd-space-4;
474
+ padding-bottom: $dd-space-4;
463
475
  }
464
476
 
465
477
  &--center {
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <view
3
3
  class="dd-list-cell"
4
- :class="{ 'dd-list-cell--link': isLink || arrow, 'dd-list-cell--borderless': borderless }"
4
+ :class="[
5
+ `dd-list-cell--${size}`,
6
+ { 'dd-list-cell--link': isLink || arrow, 'dd-list-cell--borderless': borderless },
7
+ ]"
5
8
  :hover-class="isLink || arrow ? 'dd-list-cell--active' : ''"
6
9
  :hover-stay-time="100"
7
10
  @click="onClick"
@@ -38,6 +41,8 @@ interface Props {
38
41
  subtitle?: string
39
42
  value?: string
40
43
  icon?: string
44
+ /** 尺寸档:xs 紧凑展示 / sm 紧凑 / md 默认 / lg 宽松,同时改变行高与字号 */
45
+ size?: 'xs' | 'sm' | 'md' | 'lg'
41
46
  arrow?: boolean
42
47
  isLink?: boolean
43
48
  borderless?: boolean
@@ -48,6 +53,7 @@ const props = withDefaults(defineProps<Props>(), {
48
53
  subtitle: '',
49
54
  value: '',
50
55
  icon: '',
56
+ size: 'md',
51
57
  arrow: false,
52
58
  isLink: false,
53
59
  borderless: false,
@@ -71,12 +77,36 @@ function onClick(e: Event) {
71
77
  display: flex;
72
78
  flex-direction: row;
73
79
  align-items: center;
80
+ // 行高以 min-height 定档(md 48px = 原值),padding 只负责内容区留白与撑高
74
81
  min-height: $dd-space-7;
75
- padding: 0 $dd-space-4;
82
+ padding: $dd-space-3 $dd-space-4;
76
83
  box-sizing: border-box;
77
84
  background: var(--dd-bg-elevated, #{$dd-bg-elevated});
85
+ font-size: $dd-font-size-body;
78
86
  @include dd-hairline-bottom(var(--dd-border-default, #{$dd-border-default}));
79
87
 
88
+ // 四档:32/44/48/56px(md 48px = 原值;xs 32px 为紧凑元信息行,低于 44px 触控下限,仅限非交互展示),字号 12/12/14/16px
89
+ &--xs {
90
+ min-height: $dd-size-control-sm;
91
+ padding-top: $dd-space-1;
92
+ padding-bottom: $dd-space-1;
93
+ font-size: $dd-font-size-caption;
94
+ }
95
+
96
+ &--sm {
97
+ min-height: $dd-size-control-md;
98
+ padding-top: $dd-space-2;
99
+ padding-bottom: $dd-space-2;
100
+ font-size: $dd-font-size-caption;
101
+ }
102
+
103
+ &--lg {
104
+ min-height: $dd-space-7 + $dd-space-2;
105
+ padding-top: $dd-space-4;
106
+ padding-bottom: $dd-space-4;
107
+ font-size: $dd-font-size-lead;
108
+ }
109
+
80
110
  &__icon {
81
111
  flex-shrink: 0;
82
112
  width: 56rpx;
@@ -88,7 +118,7 @@ function onClick(e: Event) {
88
118
  }
89
119
 
90
120
  &__icon-text {
91
- font-size: $dd-font-size-h2;
121
+ font-size: 1.429em;
92
122
  line-height: 1;
93
123
  color: var(--dd-primary-400, #{$dd-primary-400});
94
124
  }
@@ -102,14 +132,14 @@ function onClick(e: Event) {
102
132
  }
103
133
 
104
134
  &__title {
105
- font-size: $dd-font-size-body;
135
+ font-size: 1em;
106
136
  font-weight: 500;
107
137
  color: var(--dd-text-primary, #{$dd-text-primary});
108
138
  @include dd-ellipsis(1);
109
139
  }
110
140
 
111
141
  &__subtitle {
112
- font-size: $dd-font-size-caption;
142
+ font-size: 0.857em;
113
143
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
114
144
  @include dd-ellipsis(1);
115
145
  }
@@ -123,13 +153,13 @@ function onClick(e: Event) {
123
153
  }
124
154
 
125
155
  &__value {
126
- font-size: $dd-font-size-body;
156
+ font-size: 1em;
127
157
  font-weight: 500;
128
158
  color: var(--dd-primary-400, #{$dd-primary-400});
129
159
  }
130
160
 
131
161
  &__arrow {
132
- font-size: $dd-font-size-h3;
162
+ font-size: 1.286em;
133
163
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
134
164
  line-height: 1;
135
165
  margin-left: $dd-space-1;
@@ -5,11 +5,11 @@
5
5
  :class="['dd-price--' + size, { 'dd-price--custom-color': color }]"
6
6
  :style="color ? { color } : undefined"
7
7
  >
8
- <text v-if="prefix" class="dd-price__prefix">{{ prefix }}</text>
8
+ <text v-if="prefix" class="dd-price__prefix" :style="prefixColor ? { color: prefixColor } : undefined">{{ prefix }}</text>
9
9
  <text class="dd-price__currency">{{ currency }}</text>
10
10
  <text class="dd-price__integer">{{ pricePair[0] }}</text>
11
11
  <text v-if="pricePair[1]" class="dd-price__decimal">{{ mark }}{{ pricePair[1] }}</text>
12
- <text v-if="suffix" class="dd-price__suffix">{{ suffix }}</text>
12
+ <text v-if="suffix" class="dd-price__suffix" :style="suffixColor ? { color: suffixColor } : undefined">{{ suffix }}</text>
13
13
  </view>
14
14
  </template>
15
15
 
@@ -31,8 +31,12 @@ interface Props {
31
31
  suffix?: string
32
32
  /** 尺寸:xxs 紧凑行最小号(房态卡片等 22rpx 正文旁)/ xs 最小号(一行四列小卡)/ sm 小号(购物车行/小卡)/ md 常规 / lg 大号(结算条/合计) */
33
33
  size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg'
34
- /** 主色(CSS 颜色/变量):整数、货币符、小数一起变色;不传则 inherit 跟随上下文(货币符/小数保持次级灰) */
34
+ /** 主色(CSS 颜色/变量):整数、货币符、小数、前缀、后缀一起变色;不传则 inherit 跟随上下文(货币符/小数/前后缀保持次级灰) */
35
35
  color?: string
36
+ /** 前缀颜色:不传默认跟随 color(color 也不传时保持次级灰) */
37
+ prefixColor?: string
38
+ /** 后缀颜色:不传默认跟随 color(color 也不传时保持次级灰) */
39
+ suffixColor?: string
36
40
  }
37
41
 
38
42
  const props = withDefaults(defineProps<Props>(), {
@@ -44,6 +48,8 @@ const props = withDefaults(defineProps<Props>(), {
44
48
  suffix: '',
45
49
  size: 'md',
46
50
  color: '',
51
+ prefixColor: '',
52
+ suffixColor: '',
47
53
  })
48
54
 
49
55
  const pricePair = computed<string[] | null>(() => {
@@ -88,8 +94,11 @@ const pricePair = computed<string[] | null>(() => {
88
94
  font-size: 24rpx;
89
95
  }
90
96
 
91
- // 自定义主色:货币符/小数默认是次级灰,传 color 时统一跟随主色
97
+ // 自定义主色:前后缀/货币符/小数默认是次级灰,传 color 时统一跟随主色
98
+ // prefixColor / suffixColor 单独传入时由行内 style 覆盖这里的 inherit
92
99
  &--custom-color {
100
+ .dd-price__prefix,
101
+ .dd-price__suffix,
93
102
  .dd-price__currency,
94
103
  .dd-price__decimal {
95
104
  color: inherit;
@@ -17,8 +17,12 @@
17
17
  </view>
18
18
  </view>
19
19
  <view class="dd-step__content">
20
- <text class="dd-step__title">{{ title }}</text>
21
- <text v-if="description" class="dd-step__desc">{{ description }}</text>
20
+ <!-- 默认插槽:传内容即整体接管标题/描述区(如自定义 tag、右对齐时间等富文本行);
21
+ 未传内容时渲染 title/description 兜底,保持既有用法不变 -->
22
+ <slot>
23
+ <text class="dd-step__title">{{ title }}</text>
24
+ <text v-if="description" class="dd-step__desc">{{ description }}</text>
25
+ </slot>
22
26
  </view>
23
27
  </template>
24
28
 
@@ -39,8 +43,10 @@
39
43
  ></view>
40
44
  </view>
41
45
  <view class="dd-step__content dd-step__content--vertical">
42
- <text class="dd-step__title">{{ title }}</text>
43
- <text v-if="description" class="dd-step__desc">{{ description }}</text>
46
+ <slot>
47
+ <text class="dd-step__title">{{ title }}</text>
48
+ <text v-if="description" class="dd-step__desc">{{ description }}</text>
49
+ </slot>
44
50
  </view>
45
51
  </template>
46
52
  </view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didaoktv/didaoui-uniapp",
3
- "version": "2.10.0",
3
+ "version": "2.12.0",
4
4
  "description": "帝到KTV UniApp 组件库",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",