@didaoktv/didaoui-uniapp 1.4.0 → 1.4.1
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 +5 -5
- package/components/dd-button/dd-button.vue +1 -1
- package/components/dd-cell/dd-cell.vue +3 -3
- package/components/dd-checkbox/dd-checkbox.vue +1 -1
- package/components/dd-field/dd-field.vue +5 -5
- package/components/dd-form/rules.ts +2 -2
- package/components/dd-price/dd-price.vue +1 -1
- package/components/dd-radio/dd-radio.vue +1 -1
- package/components/dd-submit-bar/dd-submit-bar.vue +1 -1
- package/components/dd-tree-select/dd-tree-select.vue +5 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ import { DdButton, DdInput } from '@didaoktv/didaoui-uniapp'
|
|
|
77
77
|
|
|
78
78
|
### 圆角
|
|
79
79
|
|
|
80
|
-
2 / 4 / 8 / 12 / 16 / 9999 px
|
|
80
|
+
2 / 4 / 8 / 12 / 16 / 9999 px
|
|
81
81
|
|
|
82
82
|
### 间距
|
|
83
83
|
|
|
@@ -144,13 +144,13 @@ $dd-primary: #d32f2f;
|
|
|
144
144
|
|
|
145
145
|
## 新增业务组件(2026-08-22 纳入设计系统)
|
|
146
146
|
|
|
147
|
-
>
|
|
147
|
+
> 新组件统一以主流组件库同名/同类组件为 API 设计基准,符合 uni-app 多端规范,只消费上层 `scss/_variables.scss` 既有 token。
|
|
148
148
|
|
|
149
149
|
| 组件 | 用途 | 参考基准 |
|
|
150
150
|
|------|------|---------|
|
|
151
|
-
| `dd-bill-detail` | 账单明细(商品项/小计/合计/支付状态/操作按钮 slot) |
|
|
152
|
-
| `dd-workorder-card` | 工单条目卡片(类型/状态/进度/布置 checklist/完成确认) |
|
|
153
|
-
| `dd-calendar` | 月历 + 时段(日期多选区间/禁选/时段格) |
|
|
151
|
+
| `dd-bill-detail` | 账单明细(商品项/小计/合计/支付状态/操作按钮 slot) | 卡片 + 底部操作条聚合 |
|
|
152
|
+
| `dd-workorder-card` | 工单条目卡片(类型/状态/进度/布置 checklist/完成确认) | 卡片 + 标签 + 清单聚合 |
|
|
153
|
+
| `dd-calendar` | 月历 + 时段(日期多选区间/禁选/时段格) | 主流日历组件 |
|
|
154
154
|
| `dd-qrcode` | 二维码渲染(canvas,内容/尺寸/前景色/背景色/logo) | 主流二维码组件 API |
|
|
155
155
|
|
|
156
156
|
## License
|
|
@@ -198,7 +198,7 @@ function onClick(e: Event) {
|
|
|
198
198
|
color: var(--dd-error-contrast, #{$dd-error-contrast});
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
// plain:线框按钮,透明底 + 保留各 type
|
|
201
|
+
// plain:线框按钮,透明底 + 保留各 type 的主题色文字/描边
|
|
202
202
|
.dd-btn--plain {
|
|
203
203
|
background: transparent;
|
|
204
204
|
border-color: currentColor;
|
|
@@ -124,12 +124,12 @@ function handleClick(e: Event) {
|
|
|
124
124
|
padding: 0 24rpx 0 $dd-space-4;
|
|
125
125
|
background: var(--dd-bg-elevated, #{$dd-bg-elevated});
|
|
126
126
|
font-size: $dd-font-size-body;
|
|
127
|
-
//
|
|
127
|
+
// 恒定行高(24px),title/value/label/icon 全部基线对齐
|
|
128
128
|
line-height: $dd-line-height-lead;
|
|
129
129
|
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
130
130
|
@include dd-hairline-bottom(var(--dd-border-subtle, #{$dd-border-subtle}));
|
|
131
131
|
|
|
132
|
-
//
|
|
132
|
+
// 高度 = 垂直 padding + 行高(12/16px × 2 + 23.8px ≈ 96/112rpx),内容天然居中
|
|
133
133
|
&--normal {
|
|
134
134
|
padding-top: $dd-space-3;
|
|
135
135
|
padding-bottom: $dd-space-3;
|
|
@@ -159,7 +159,7 @@ function handleClick(e: Event) {
|
|
|
159
159
|
margin-right: $dd-space-2;
|
|
160
160
|
display: flex;
|
|
161
161
|
align-items: center;
|
|
162
|
-
// ponytail: stretch 拉伸到兄弟 content 高度使图标居中于首行;title+label
|
|
162
|
+
// ponytail: stretch 拉伸到兄弟 content 高度使图标居中于首行;title+label 多行时会居中于整块而非首行,如需精确可改为固定行高盒
|
|
163
163
|
align-self: stretch;
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -43,7 +43,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
43
43
|
indeterminate: false,
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
// 必须配合 dd-checkbox-group
|
|
46
|
+
// 必须配合 dd-checkbox-group 使用
|
|
47
47
|
const group = inject<{
|
|
48
48
|
props: { modelValue: any[]; disabled: boolean }
|
|
49
49
|
isMaxed: { value: boolean }
|
|
@@ -388,7 +388,7 @@ function scrollIntoView() {
|
|
|
388
388
|
uni.pageScrollTo({ selector: `.${rootClass}`, duration: 300 })
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
/** 手动聚焦/失焦(
|
|
391
|
+
/** 手动聚焦/失焦(blur 经 uni.hideKeyboard 收起键盘) */
|
|
392
392
|
const focusState = ref(false)
|
|
393
393
|
|
|
394
394
|
function focusField() {
|
|
@@ -426,7 +426,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
426
426
|
@import '../../scss/variables';
|
|
427
427
|
@import '../../scss/mixins';
|
|
428
428
|
|
|
429
|
-
//
|
|
429
|
+
// 样式基准(cell:padding 10px 16px / line-height 24px / 16px 字号 / label 6.2em 主文本色)
|
|
430
430
|
// 颜色全部走 $dd-* 主题 token;1px 发丝线为刻意的例外
|
|
431
431
|
.dd-field {
|
|
432
432
|
position: relative;
|
|
@@ -442,7 +442,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
442
442
|
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
443
443
|
background: var(--dd-bg-elevated, #{$dd-bg-elevated});
|
|
444
444
|
|
|
445
|
-
//
|
|
445
|
+
// 发丝线:两侧缩进 32rpx
|
|
446
446
|
&::after {
|
|
447
447
|
position: absolute;
|
|
448
448
|
box-sizing: border-box;
|
|
@@ -626,7 +626,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
626
626
|
text-align: right;
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
-
// error:输入文字与 placeholder 变红,label
|
|
629
|
+
// error:输入文字与 placeholder 变红,label 不变
|
|
630
630
|
&--error {
|
|
631
631
|
.dd-field__control,
|
|
632
632
|
.dd-field__control::placeholder {
|
|
@@ -634,7 +634,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
-
// disabled
|
|
637
|
+
// disabled:仅文字变灰,不整体降透明度
|
|
638
638
|
&--disabled {
|
|
639
639
|
.dd-field__label,
|
|
640
640
|
.dd-field__left-icon {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dd-form
|
|
2
|
+
* dd-form 轻量校验引擎(自研无依赖)
|
|
3
3
|
* 规则分散在各 dd-field 上,dd-form 只做调度。
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -36,7 +36,7 @@ export interface DdFieldRule {
|
|
|
36
36
|
pattern?: RegExp
|
|
37
37
|
/**
|
|
38
38
|
* 自定义校验:返回 true=通过,false=用 message 报错,
|
|
39
|
-
* 返回 string
|
|
39
|
+
* 返回 string=直接以该字符串为错误消息;支持 Promise
|
|
40
40
|
*/
|
|
41
41
|
validator?: (value: any) => boolean | string | Promise<boolean | string>
|
|
42
42
|
/** 触发时机;缺省 = 任意触发都执行 */
|
|
@@ -52,7 +52,7 @@ const pricePair = computed<string[] | null>(() => {
|
|
|
52
52
|
.dd-price {
|
|
53
53
|
display: inline-flex;
|
|
54
54
|
align-items: baseline;
|
|
55
|
-
// ponytail: 颜色跟随使用方(inherit
|
|
55
|
+
// ponytail: 颜色跟随使用方(inherit),如 submit-bar 的红价由使用方控制
|
|
56
56
|
color: inherit;
|
|
57
57
|
font-weight: 600;
|
|
58
58
|
line-height: 1;
|
|
@@ -103,7 +103,7 @@ const slots = useSlots()
|
|
|
103
103
|
|
|
104
104
|
const hasTip = computed(() => !!props.tip || !!slots.tip)
|
|
105
105
|
|
|
106
|
-
//
|
|
106
|
+
// price 单位为分,除以 100 转元交给 dd-price 渲染
|
|
107
107
|
const priceYuan = computed(() => (typeof props.price === 'number' ? props.price / 100 : undefined))
|
|
108
108
|
const hasPrice = computed(() => priceYuan.value !== undefined)
|
|
109
109
|
|
|
@@ -164,12 +164,10 @@ function onItemClick(child: TreeSelectChild) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
&__item {
|
|
167
|
-
position: relative;
|
|
168
167
|
display: flex;
|
|
169
168
|
align-items: center;
|
|
170
|
-
justify-content: space-between;
|
|
171
169
|
min-height: 96rpx;
|
|
172
|
-
padding: 0
|
|
170
|
+
padding: 0 $dd-space-4;
|
|
173
171
|
font-weight: 600;
|
|
174
172
|
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
175
173
|
|
|
@@ -178,7 +176,8 @@ function onItemClick(child: TreeSelectChild) {
|
|
|
178
176
|
}
|
|
179
177
|
|
|
180
178
|
&--active {
|
|
181
|
-
|
|
179
|
+
background: var(--dd-primary, #{$dd-primary});
|
|
180
|
+
color: $dd-neutral-50;
|
|
182
181
|
}
|
|
183
182
|
|
|
184
183
|
&--disabled {
|
|
@@ -197,12 +196,9 @@ function onItemClick(child: TreeSelectChild) {
|
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
&__selected {
|
|
200
|
-
|
|
201
|
-
top: 50%;
|
|
202
|
-
right: $dd-space-4;
|
|
203
|
-
transform: translateY(-50%);
|
|
199
|
+
margin-left: $dd-space-2;
|
|
204
200
|
font-size: 32rpx;
|
|
205
|
-
color:
|
|
201
|
+
color: $dd-neutral-50;
|
|
206
202
|
}
|
|
207
203
|
}
|
|
208
204
|
</style>
|