@didaoktv/didaoui-uniapp 2.0.1 → 2.2.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.
- package/components/dd-button/dd-button.vue +9 -9
- package/components/dd-capsule-button/dd-capsule-button.vue +2 -2
- package/components/dd-empty-state/dd-empty-state.vue +1 -1
- package/components/dd-field/dd-field.vue +4 -2
- package/components/dd-input/dd-input.vue +2 -2
- package/components/dd-picker/dd-picker.vue +4 -4
- package/components/dd-popup/dd-popup.vue +14 -1
- package/components/dd-search-bar/dd-search-bar.vue +2 -2
- package/components/dd-stepper/dd-stepper.vue +4 -4
- package/package.json +2 -1
- package/scss/_variables.scss +6 -8
|
@@ -80,7 +80,7 @@ function onClick(e: Event) {
|
|
|
80
80
|
font-family: $dd-font-body;
|
|
81
81
|
white-space: nowrap;
|
|
82
82
|
user-select: none;
|
|
83
|
-
height: $dd-size-
|
|
83
|
+
height: $dd-size-control-md;
|
|
84
84
|
padding: 0 $dd-space-4;
|
|
85
85
|
font-size: $dd-font-size-body;
|
|
86
86
|
font-weight: 600;
|
|
@@ -97,7 +97,7 @@ function onClick(e: Event) {
|
|
|
97
97
|
|
|
98
98
|
&__loading {
|
|
99
99
|
width: 28rpx;
|
|
100
|
-
height: 28rpx;
|
|
100
|
+
height: 28rpx; // size-exempt: loading 圈内部件,非控件高度
|
|
101
101
|
border: 3rpx solid currentColor;
|
|
102
102
|
border-top-color: transparent;
|
|
103
103
|
border-radius: 50%;
|
|
@@ -106,7 +106,7 @@ function onClick(e: Event) {
|
|
|
106
106
|
|
|
107
107
|
.dd-btn--icon-only {
|
|
108
108
|
padding: 0;
|
|
109
|
-
width: $dd-size-
|
|
109
|
+
width: $dd-size-control-md;
|
|
110
110
|
gap: 0;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -127,28 +127,28 @@ function onClick(e: Event) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.dd-btn--sm {
|
|
130
|
-
height: $dd-size-
|
|
130
|
+
height: $dd-size-control-sm;
|
|
131
131
|
padding: 0 $dd-space-3;
|
|
132
132
|
font-size: $dd-font-size-caption;
|
|
133
133
|
&.dd-btn--icon-only {
|
|
134
|
-
width: $dd-size-
|
|
134
|
+
width: $dd-size-control-sm;
|
|
135
135
|
}
|
|
136
136
|
.dd-btn__loading {
|
|
137
137
|
width: 22rpx;
|
|
138
|
-
height: 22rpx;
|
|
138
|
+
height: 22rpx; // size-exempt: loading 圈内部件,非控件高度
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.dd-btn--lg {
|
|
143
|
-
height: $dd-size-
|
|
143
|
+
height: $dd-size-control-lg;
|
|
144
144
|
padding: 0 $dd-space-5;
|
|
145
145
|
font-size: $dd-font-size-h4;
|
|
146
146
|
&.dd-btn--icon-only {
|
|
147
|
-
width: $dd-size-
|
|
147
|
+
width: $dd-size-control-lg;
|
|
148
148
|
}
|
|
149
149
|
.dd-btn__loading {
|
|
150
150
|
width: 34rpx;
|
|
151
|
-
height: 34rpx;
|
|
151
|
+
height: 34rpx; // size-exempt: loading 圈内部件,非控件高度
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -56,7 +56,7 @@ function onMenu() {
|
|
|
56
56
|
// 微信小程序标准 87×32px → 174×64rpx (ponytail: 固定尺寸,H5 降级同样尺寸)
|
|
57
57
|
.dd-capsule-button {
|
|
58
58
|
width: 174rpx;
|
|
59
|
-
height: $dd-size-
|
|
59
|
+
height: $dd-size-control-sm;
|
|
60
60
|
border-radius: $dd-radius-full;
|
|
61
61
|
@include dd-glass;
|
|
62
62
|
display: flex;
|
|
@@ -77,7 +77,7 @@ function onMenu() {
|
|
|
77
77
|
// CSS 绘制返回箭头 "<": border-left+border-bottom + rotate(45deg) (无 SVG,MP 兼容)
|
|
78
78
|
&__arrow {
|
|
79
79
|
width: 20rpx;
|
|
80
|
-
height: 20rpx;
|
|
80
|
+
height: 20rpx; // size-exempt: CSS 绘制箭头内部件
|
|
81
81
|
border-left: $dd-space-1 solid var(--dd-text-secondary, #{$dd-text-secondary});
|
|
82
82
|
border-bottom: $dd-space-1 solid var(--dd-text-secondary, #{$dd-text-secondary});
|
|
83
83
|
transform: rotate(45deg);
|
|
@@ -114,7 +114,7 @@ function onAction() {
|
|
|
114
114
|
&__btn {
|
|
115
115
|
margin-top: $dd-space-5;
|
|
116
116
|
padding: 0 $dd-space-5;
|
|
117
|
-
height: $dd-size-
|
|
117
|
+
height: $dd-size-control-md;
|
|
118
118
|
border-radius: $dd-radius-full;
|
|
119
119
|
background: var(--dd-gradient-primary, #{$dd-gradient-primary});
|
|
120
120
|
@include dd-flex-center;
|
|
@@ -435,6 +435,8 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
435
435
|
flex-wrap: wrap; // extra 插槽独占第二行
|
|
436
436
|
box-sizing: border-box;
|
|
437
437
|
width: 100%;
|
|
438
|
+
// 单行/多行统一以 md 档为下限(border-box 下 padding 已含);textarea 靠内容自然增高,min-height 不限高
|
|
439
|
+
min-height: $dd-size-control-md;
|
|
438
440
|
padding: 20rpx $dd-space-4;
|
|
439
441
|
overflow: hidden;
|
|
440
442
|
font-size: $dd-font-size-body;
|
|
@@ -517,7 +519,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
517
519
|
align-items: center;
|
|
518
520
|
flex: 1;
|
|
519
521
|
min-width: 0;
|
|
520
|
-
min-height: 48rpx;
|
|
522
|
+
min-height: 48rpx; // size-exempt: 控件行内部最小高,非档位
|
|
521
523
|
}
|
|
522
524
|
|
|
523
525
|
&__control {
|
|
@@ -545,7 +547,7 @@ defineExpose({ validate, validateWithTrigger, resetValidation, scrollIntoView, f
|
|
|
545
547
|
}
|
|
546
548
|
|
|
547
549
|
&__textarea {
|
|
548
|
-
min-height: 48rpx;
|
|
550
|
+
min-height: 48rpx; // size-exempt: textarea 内部最小高,非档位
|
|
549
551
|
}
|
|
550
552
|
|
|
551
553
|
&__left-icon {
|
|
@@ -114,7 +114,7 @@ function toggleVisible() {
|
|
|
114
114
|
display: flex;
|
|
115
115
|
align-items: center;
|
|
116
116
|
gap: $dd-space-2;
|
|
117
|
-
height:
|
|
117
|
+
height: $dd-size-control-md;
|
|
118
118
|
padding: 0 $dd-space-4;
|
|
119
119
|
background: var(--dd-surface-container-low, #{$dd-surface-container-low});
|
|
120
120
|
border: 1px solid var(--dd-border-default, #{$dd-border-default});
|
|
@@ -141,7 +141,7 @@ function toggleVisible() {
|
|
|
141
141
|
&__clear {
|
|
142
142
|
@include dd-flex-center;
|
|
143
143
|
width: 36rpx;
|
|
144
|
-
height: 36rpx;
|
|
144
|
+
height: 36rpx; // size-exempt: clear 图标内部件
|
|
145
145
|
border-radius: 50%;
|
|
146
146
|
background: var(--dd-surface-container-high, #{$dd-surface-container-high});
|
|
147
147
|
color: var(--dd-text-secondary, #{$dd-text-secondary});
|
|
@@ -142,7 +142,7 @@ function onConfirm() {
|
|
|
142
142
|
// ponytail: H5 picker-view 吸附 itemSize 取 indicator 框高度(默认34px),必须与行高一致拖动松手才对齐。
|
|
143
143
|
// 需与下方 .dd-picker__item 的 88rpx 保持一致;改行高时必须同步改这里。小程序为原生组件此规则天然无效,安全。
|
|
144
144
|
:deep(.uni-picker-view-indicator) {
|
|
145
|
-
height: 88rpx;
|
|
145
|
+
height: 88rpx; // size-exempt: 滚轮选项行高(列表项),非控件高度
|
|
146
146
|
}
|
|
147
147
|
.dd-picker {
|
|
148
148
|
&__mask {
|
|
@@ -176,7 +176,7 @@ function onConfirm() {
|
|
|
176
176
|
|
|
177
177
|
&__toolbar {
|
|
178
178
|
@include dd-flex-between;
|
|
179
|
-
height: 96rpx;
|
|
179
|
+
height: 96rpx; // size-exempt: 弹层头部,非控件高度
|
|
180
180
|
padding: 0 32rpx;
|
|
181
181
|
@include dd-hairline-bottom(var(--dd-border-default, #{$dd-border-default}));
|
|
182
182
|
}
|
|
@@ -203,12 +203,12 @@ function onConfirm() {
|
|
|
203
203
|
}
|
|
204
204
|
&__wheels {
|
|
205
205
|
width: 100%;
|
|
206
|
-
height: 440rpx;
|
|
206
|
+
height: 440rpx; // size-exempt: 弹层滚轮区,非控件高度
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
&__item {
|
|
210
210
|
@include dd-flex-center;
|
|
211
|
-
height: 88rpx;
|
|
211
|
+
height: 88rpx; // size-exempt: 滚轮选项行高(列表项),非控件高度
|
|
212
212
|
}
|
|
213
213
|
&__item-text {
|
|
214
214
|
font-size: 28rpx;
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
<view v-if="closeable" class="dd-popup__close" :class="`dd-popup__close--${closeIconPosition}`" :style="{ zIndex: zIndexConfig.base + 1 }" @click="onCloseIcon">
|
|
23
23
|
<dd-icon name="cross" />
|
|
24
24
|
</view>
|
|
25
|
-
<view v-if="
|
|
25
|
+
<view v-if="title || $slots.title" class="dd-popup__title"><slot name="title">{{ title }}</slot></view>
|
|
26
26
|
<slot></slot>
|
|
27
|
+
<view v-if="position === 'bottom' && safeAreaInsetBottom" class="dd-popup__safe-bottom"></view>
|
|
27
28
|
</view>
|
|
28
29
|
</view>
|
|
29
30
|
</dd-portal>
|
|
@@ -38,6 +39,7 @@ import zIndexConfig from '../../libs/config/zIndex.js'
|
|
|
38
39
|
|
|
39
40
|
interface Props {
|
|
40
41
|
modelValue?: boolean
|
|
42
|
+
title?: string
|
|
41
43
|
position?: 'top' | 'bottom' | 'left' | 'right' | 'center'
|
|
42
44
|
round?: boolean
|
|
43
45
|
overlay?: boolean
|
|
@@ -52,6 +54,7 @@ interface Props {
|
|
|
52
54
|
|
|
53
55
|
const props = withDefaults(defineProps<Props>(), {
|
|
54
56
|
modelValue: false,
|
|
57
|
+
title: '',
|
|
55
58
|
position: 'bottom',
|
|
56
59
|
round: false,
|
|
57
60
|
overlay: true,
|
|
@@ -225,6 +228,16 @@ onUnmounted(() => {
|
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
|
|
231
|
+
&__title {
|
|
232
|
+
@include dd-flex-between;
|
|
233
|
+
padding: $dd-space-4 $dd-space-5;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
font-size: $dd-font-size-h4;
|
|
236
|
+
font-weight: $dd-font-weight-h4;
|
|
237
|
+
color: var(--dd-text-primary, #{$dd-text-primary});
|
|
238
|
+
@include dd-hairline-bottom(var(--dd-border-default, #{$dd-border-default}));
|
|
239
|
+
}
|
|
240
|
+
|
|
228
241
|
&__close {
|
|
229
242
|
position: absolute;
|
|
230
243
|
width: 56rpx;
|
|
@@ -107,7 +107,7 @@ function onCancel() {
|
|
|
107
107
|
display: flex;
|
|
108
108
|
align-items: center;
|
|
109
109
|
gap: $dd-space-2;
|
|
110
|
-
height:
|
|
110
|
+
height: $dd-size-control-md;
|
|
111
111
|
padding: 0 $dd-space-3;
|
|
112
112
|
background: var(--dd-surface-container-low, #{$dd-surface-container-low});
|
|
113
113
|
border: 1px solid var(--dd-border-default, #{$dd-border-default});
|
|
@@ -149,7 +149,7 @@ function onCancel() {
|
|
|
149
149
|
&__clear {
|
|
150
150
|
@include dd-flex-center;
|
|
151
151
|
width: 36rpx;
|
|
152
|
-
height: 36rpx;
|
|
152
|
+
height: 36rpx; // size-exempt: clear 图标内部件
|
|
153
153
|
border-radius: 50%;
|
|
154
154
|
background: var(--dd-surface-container-high, #{$dd-surface-container-high});
|
|
155
155
|
color: var(--dd-text-secondary, #{$dd-text-secondary});
|
|
@@ -140,10 +140,10 @@ function onPlus() {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.dd-stepper--md {
|
|
143
|
-
height:
|
|
143
|
+
height: $dd-size-control-compact;
|
|
144
144
|
.dd-stepper__btn {
|
|
145
145
|
width: 56rpx;
|
|
146
|
-
height: 56rpx;
|
|
146
|
+
height: 56rpx; // size-exempt: 步进器内部按钮
|
|
147
147
|
}
|
|
148
148
|
.dd-stepper__icon {
|
|
149
149
|
font-size: $dd-font-size-h4;
|
|
@@ -155,10 +155,10 @@ function onPlus() {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.dd-stepper--sm {
|
|
158
|
-
height: 56rpx;
|
|
158
|
+
height: 56rpx; // size-exempt: sm 档变体,档位体系外(本轮仅 md→compact 入档)
|
|
159
159
|
.dd-stepper__btn {
|
|
160
160
|
width: 44rpx;
|
|
161
|
-
height: 44rpx;
|
|
161
|
+
height: 44rpx; // size-exempt: 步进器内部按钮
|
|
162
162
|
}
|
|
163
163
|
.dd-stepper__icon {
|
|
164
164
|
font-size: 26rpx;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@didaoktv/didaoui-uniapp",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "帝到KTV UniApp 组件库",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.ts",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dev:h5": "cd ../DidaoUI-uniapp-docs/h5-demo && npm run dev:h5",
|
|
25
25
|
"build:docs": "cd ../DidaoUI-uniapp-docs && npm run build",
|
|
26
26
|
"type-check": "vue-tsc --noEmit",
|
|
27
|
+
"size-selfcheck": "npx tsc scripts/size-selfcheck.ts --module commonjs --target es2020 --lib es2020 --outDir .check --skipLibCheck && node .check/size-selfcheck.js",
|
|
27
28
|
"bump:consumers": "node scripts/bump-consumers.mjs",
|
|
28
29
|
"prepublishOnly": "node -e \"const p=require('./package.json');if(p.publishConfig&&p.publishConfig.access==='public'){process.exit(0)}console.error('publishConfig.access must be public');process.exit(1)\""
|
|
29
30
|
},
|
package/scss/_variables.scss
CHANGED
|
@@ -267,19 +267,17 @@ $dd-size-icon-sm: 16px !default;
|
|
|
267
267
|
$dd-size-icon-md: 20px !default;
|
|
268
268
|
$dd-size-icon-lg: 24px !default;
|
|
269
269
|
$dd-size-icon-xl: 32px !default;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
$dd-size-
|
|
273
|
-
$dd-size-
|
|
270
|
+
|
|
271
|
+
// 控件高度档位真源(ADR 0019):输入类与按钮类同档消费同一变量;值 = css.json size × 2(1px=2rpx)
|
|
272
|
+
$dd-size-control-sm: 64rpx !default;
|
|
273
|
+
$dd-size-control-compact: 72rpx !default;
|
|
274
|
+
$dd-size-control-md: 88rpx !default;
|
|
275
|
+
$dd-size-control-lg: 100rpx !default;
|
|
274
276
|
|
|
275
277
|
// 按钮内边距
|
|
276
278
|
$dd-button-padding-x-sm: 12px !default;
|
|
277
279
|
$dd-button-padding-x-md: 16px !default;
|
|
278
280
|
$dd-button-padding-x-lg: 24px !default;
|
|
279
|
-
$dd-button-height-sm: $dd-size-button-sm !default;
|
|
280
|
-
$dd-button-height-md: $dd-size-button-md !default;
|
|
281
|
-
$dd-button-height-lg: $dd-size-button-lg !default;
|
|
282
|
-
$dd-input-height: $dd-size-input-height !default;
|
|
283
281
|
|
|
284
282
|
// === 阴影 (from css.json shadow) ===
|
|
285
283
|
$dd-shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3) !default;
|