@tdesign/uniapp 0.7.1 → 0.7.2
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/CHANGELOG.md +13 -0
- package/dist/action-sheet/action-sheet.vue +3 -5
- package/dist/avatar/avatar.vue +6 -6
- package/dist/avatar-group/avatar-group.vue +1 -3
- package/dist/back-top/back-top.vue +13 -15
- package/dist/badge/badge.vue +1 -3
- package/dist/button/button.vue +15 -14
- package/dist/calendar/README.en-US.md +1 -0
- package/dist/calendar/README.md +1 -0
- package/dist/calendar/calendar-header.vue +1 -3
- package/dist/calendar/calendar.vue +28 -19
- package/dist/calendar/props.ts +5 -0
- package/dist/calendar/template.vue +1 -3
- package/dist/calendar/type.ts +6 -0
- package/dist/cascader/cascader.vue +1 -3
- package/dist/cell/cell.vue +51 -35
- package/dist/cell-group/cell-group.vue +1 -3
- package/dist/check-tag/check-tag.vue +12 -15
- package/dist/checkbox/checkbox.vue +13 -15
- package/dist/col/col.vue +1 -3
- package/dist/collapse/collapse.vue +1 -3
- package/dist/collapse-panel/collapse-panel.vue +1 -3
- package/dist/color-picker/color-picker.vue +2 -4
- package/dist/color-picker/template.vue +1 -3
- package/dist/common/src/instantiationDecorator.js +6 -0
- package/dist/count-down/count-down.vue +2 -4
- package/dist/date-time-picker/date-time-picker.vue +1 -3
- package/dist/dialog/dialog.vue +67 -69
- package/dist/divider/divider.vue +1 -3
- package/dist/draggable/draggable.vue +1 -3
- package/dist/drawer/drawer.vue +1 -3
- package/dist/dropdown-item/dropdown-item.vue +1 -3
- package/dist/dropdown-menu/dropdown-menu.vue +12 -14
- package/dist/empty/empty.vue +1 -3
- package/dist/fab/fab.vue +1 -3
- package/dist/footer/footer.vue +1 -3
- package/dist/form/form.vue +1 -3
- package/dist/form-item/form-item.css +16 -11
- package/dist/form-item/form-item.vue +2 -7
- package/dist/grid/grid.vue +1 -3
- package/dist/grid-item/grid-item.vue +1 -3
- package/dist/guide/content.vue +1 -3
- package/dist/guide/guide.vue +3 -8
- package/dist/icon/icon.vue +1 -3
- package/dist/image/image.vue +1 -3
- package/dist/image-viewer/image-viewer.vue +27 -30
- package/dist/indexes/indexes.vue +5 -7
- package/dist/indexes-anchor/indexes-anchor.vue +1 -3
- package/dist/input/input.vue +31 -31
- package/dist/link/link.vue +25 -26
- package/dist/loading/loading.vue +2 -2
- package/dist/message/index.d.ts +1 -1
- package/dist/message/message.interface.ts +2 -1
- package/dist/message-item/message-item.vue +34 -36
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/navbar/navbar.vue +46 -33
- package/dist/notice-bar/notice-bar.vue +24 -26
- package/dist/overlay/overlay.vue +5 -7
- package/dist/picker/picker.vue +3 -4
- package/dist/picker-item/picker-item.vue +2 -4
- package/dist/popover/popover.vue +1 -3
- package/dist/popup/popup.vue +1 -3
- package/dist/progress/progress.vue +1 -3
- package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
- package/dist/qrcode/qrcode.vue +1 -3
- package/dist/radio/radio.vue +17 -19
- package/dist/rate/rate.vue +1 -3
- package/dist/result/result.vue +1 -3
- package/dist/row/row.vue +1 -3
- package/dist/search/search.vue +8 -3
- package/dist/side-bar/side-bar.vue +1 -3
- package/dist/side-bar-item/side-bar-item.vue +12 -15
- package/dist/skeleton/skeleton.vue +2 -4
- package/dist/slider/slider.vue +1 -3
- package/dist/step-item/step-item.vue +1 -3
- package/dist/stepper/stepper.vue +1 -3
- package/dist/steps/steps.vue +1 -2
- package/dist/sticky/sticky.vue +1 -3
- package/dist/swipe-cell/swipe-cell.vue +2 -5
- package/dist/swiper/swiper.vue +1 -3
- package/dist/swiper-nav/swiper-nav.vue +1 -3
- package/dist/switch/switch.vue +1 -3
- package/dist/tab-bar/tab-bar.vue +2 -1
- package/dist/tab-bar-item/tab-bar-item.vue +22 -25
- package/dist/tab-panel/tab-panel.vue +1 -3
- package/dist/tabs/tabs.vue +1 -2
- package/dist/tag/tag.vue +23 -26
- package/dist/textarea/textarea.vue +1 -3
- package/dist/toast/toast.vue +12 -14
- package/dist/transition/transition.vue +1 -3
- package/dist/tree-select/tree-select.vue +6 -9
- package/dist/upload/upload.vue +1 -3
- package/dist/watermark/watermark.vue +1 -2
- package/package.json +1 -1
package/dist/navbar/navbar.vue
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<script>
|
|
50
50
|
import TIcon from '../icon/icon';
|
|
51
51
|
import { uniComponent } from '../common/src/index';
|
|
52
|
-
import { getRect,
|
|
52
|
+
import { getRect, getWindowInfo } from '../common/utils';
|
|
53
53
|
import { prefix } from '../common/config';
|
|
54
54
|
import props from './props';
|
|
55
55
|
import tools from '../common/utils.wxs';
|
|
@@ -61,7 +61,7 @@ const BASE_MENU_RECT = {
|
|
|
61
61
|
width: 87,
|
|
62
62
|
height: 32,
|
|
63
63
|
top: 24,
|
|
64
|
-
right:
|
|
64
|
+
right: 10, // 距离右侧的间距,实际 right 值在 getMenuRect 中动态计算
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
|
|
@@ -104,9 +104,9 @@ export default uniComponent({
|
|
|
104
104
|
showTitle: '',
|
|
105
105
|
hideLeft: false,
|
|
106
106
|
hideCenter: false,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
iMenuRect: null,
|
|
108
|
+
iLeftRect: null,
|
|
109
|
+
iBoxStyle: {},
|
|
110
110
|
tools,
|
|
111
111
|
|
|
112
112
|
visibleClass: '',
|
|
@@ -143,32 +143,43 @@ export default uniComponent({
|
|
|
143
143
|
this.initStyle();
|
|
144
144
|
this.getLeftRect();
|
|
145
145
|
this.onMenuButtonBoundingClientRectWeightChange();
|
|
146
|
+
|
|
147
|
+
this.onWindowResizeCallback = () => {
|
|
148
|
+
this.initStyle();
|
|
149
|
+
this.getLeftRect();
|
|
150
|
+
};
|
|
151
|
+
uni.onWindowResize(this.onWindowResizeCallback);
|
|
146
152
|
},
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
beforeUnmount() {
|
|
149
155
|
this.offMenuButtonBoundingClientRectWeightChange();
|
|
156
|
+
if (this.onWindowResizeCallback) {
|
|
157
|
+
uni.offWindowResize(this.onWindowResizeCallback);
|
|
158
|
+
}
|
|
150
159
|
},
|
|
151
160
|
methods: {
|
|
152
161
|
initStyle() {
|
|
153
|
-
|
|
162
|
+
// 每次重新获取最新的窗口信息,避免 H5 下窗口大小变化后使用缓存值
|
|
163
|
+
const windowInfo = getWindowInfo();
|
|
164
|
+
this.getMenuRect(windowInfo);
|
|
154
165
|
|
|
155
|
-
const {
|
|
166
|
+
const { iMenuRect, iLeftRect } = this;
|
|
156
167
|
|
|
157
|
-
if (!
|
|
168
|
+
if (!iMenuRect || !iLeftRect || !windowInfo) return;
|
|
158
169
|
|
|
159
|
-
const
|
|
160
|
-
'--td-navbar-padding-top': `${
|
|
161
|
-
'--td-navbar-right': `${
|
|
162
|
-
'--td-navbar-left-max-width': `${
|
|
163
|
-
'--td-navbar-capsule-height': `${
|
|
164
|
-
'--td-navbar-capsule-width': `${
|
|
165
|
-
'--td-navbar-height': `${(
|
|
170
|
+
const iBoxStyle = {
|
|
171
|
+
'--td-navbar-padding-top': `${windowInfo.statusBarHeight}px`,
|
|
172
|
+
'--td-navbar-right': `${windowInfo.windowWidth - iMenuRect.left}px`, // 导航栏右侧小程序胶囊按钮宽度
|
|
173
|
+
'--td-navbar-left-max-width': `${iMenuRect.left}px`, // 左侧内容最大宽度
|
|
174
|
+
'--td-navbar-capsule-height': `${iMenuRect.height}px`, // 胶囊高度
|
|
175
|
+
'--td-navbar-capsule-width': `${iMenuRect.width}px`, // 胶囊宽度
|
|
176
|
+
'--td-navbar-height': `${(iMenuRect.top - windowInfo.statusBarHeight) * 2 + iMenuRect.height}px`,
|
|
166
177
|
};
|
|
167
178
|
// #ifdef H5 || APP-PLUS
|
|
168
|
-
delete
|
|
179
|
+
delete iBoxStyle['--td-navbar-height'];
|
|
169
180
|
// #endif
|
|
170
181
|
|
|
171
|
-
this.calcCenterStyle(
|
|
182
|
+
this.calcCenterStyle(iLeftRect, iMenuRect, iBoxStyle, windowInfo);
|
|
172
183
|
},
|
|
173
184
|
onWatchTitle() {
|
|
174
185
|
const { title } = this;
|
|
@@ -183,48 +194,52 @@ export default uniComponent({
|
|
|
183
194
|
leftRect,
|
|
184
195
|
menuRect,
|
|
185
196
|
defaultStyle,
|
|
197
|
+
windowInfo,
|
|
186
198
|
) {
|
|
187
|
-
const
|
|
188
|
-
const
|
|
199
|
+
const curWindowInfo = windowInfo || getWindowInfo();
|
|
200
|
+
const maxSpacing = Math.max(leftRect.right, curWindowInfo.windowWidth - menuRect.left);
|
|
201
|
+
const iBoxStyle = {
|
|
189
202
|
...defaultStyle,
|
|
190
203
|
'z-index': this.zIndex,
|
|
191
204
|
'--td-navbar-center-left': `${maxSpacing}px`, // 标题左侧距离
|
|
192
205
|
'--td-navbar-center-width': `${Math.max(menuRect.left - maxSpacing, 0)}px`, // 标题宽度
|
|
193
206
|
};
|
|
194
207
|
|
|
195
|
-
const boxStyle = Object.entries(
|
|
208
|
+
const boxStyle = Object.entries(iBoxStyle)
|
|
196
209
|
.map(([k, v]) => `${k}: ${v}`)
|
|
197
210
|
.join('; ');
|
|
198
211
|
|
|
199
212
|
this.boxStyle = boxStyle;
|
|
200
|
-
this.
|
|
213
|
+
this.iBoxStyle = iBoxStyle;
|
|
201
214
|
},
|
|
202
215
|
|
|
203
216
|
getLeftRect() {
|
|
204
217
|
getRect(this, `.${name}__left`).then((res) => {
|
|
205
|
-
if (res.right > this.
|
|
206
|
-
this.calcCenterStyle(res, this.
|
|
218
|
+
if (res.right > this.iLeftRect.right) {
|
|
219
|
+
this.calcCenterStyle(res, this.iMenuRect, this.iBoxStyle);
|
|
207
220
|
}
|
|
208
221
|
});
|
|
209
222
|
},
|
|
210
223
|
|
|
211
|
-
getMenuRect() {
|
|
224
|
+
getMenuRect(windowInfo) {
|
|
225
|
+
const curWindowInfo = windowInfo || getWindowInfo();
|
|
212
226
|
// 场景值为1177(视频号直播间)和1175 (视频号profile页)时,小程序禁用了 uni.getMenuButtonBoundingClientRect
|
|
213
227
|
let rect = {
|
|
214
228
|
...BASE_MENU_RECT,
|
|
229
|
+
right: curWindowInfo.windowWidth - BASE_MENU_RECT.right, // 动态计算,避免 H5 下缓存
|
|
215
230
|
bottom: BASE_MENU_RECT.top + BASE_MENU_RECT.height,
|
|
216
|
-
left: BASE_MENU_RECT.right - BASE_MENU_RECT.width,
|
|
231
|
+
left: curWindowInfo.windowWidth - BASE_MENU_RECT.right - BASE_MENU_RECT.width,
|
|
217
232
|
};
|
|
218
233
|
if (uni.getMenuButtonBoundingClientRect
|
|
219
234
|
&& typeof uni.getMenuButtonBoundingClientRect === 'function'
|
|
220
|
-
&& typeof uni.getMenuButtonBoundingClientRect()
|
|
235
|
+
&& typeof uni.getMenuButtonBoundingClientRect() === 'object'
|
|
221
236
|
) {
|
|
222
237
|
rect = uni.getMenuButtonBoundingClientRect() || {};
|
|
223
238
|
}
|
|
224
239
|
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
227
|
-
right:
|
|
240
|
+
this.iMenuRect = rect;
|
|
241
|
+
this.iLeftRect = {
|
|
242
|
+
right: curWindowInfo.windowWidth - rect.left,
|
|
228
243
|
};
|
|
229
244
|
},
|
|
230
245
|
|
|
@@ -288,6 +303,4 @@ export default uniComponent({
|
|
|
288
303
|
},
|
|
289
304
|
});
|
|
290
305
|
</script>
|
|
291
|
-
<style scoped>
|
|
292
|
-
@import './navbar.css';
|
|
293
|
-
</style>
|
|
306
|
+
<style scoped src="./navbar.css"></style>
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
>
|
|
14
14
|
<slot name="prefix-icon" />
|
|
15
15
|
<block
|
|
16
|
-
v-if="
|
|
16
|
+
v-if="iPrefixIcon"
|
|
17
17
|
name="icon"
|
|
18
18
|
>
|
|
19
19
|
<t-icon
|
|
20
|
-
:custom-style="
|
|
20
|
+
:custom-style="iPrefixIcon.style || ''"
|
|
21
21
|
:t-class="tClassPrefixIcon"
|
|
22
|
-
:prefix="
|
|
23
|
-
:name="
|
|
24
|
-
:size="
|
|
25
|
-
:color="
|
|
26
|
-
:aria-hidden="!!
|
|
27
|
-
:aria-label="
|
|
28
|
-
:aria-role="
|
|
29
|
-
@click="
|
|
22
|
+
:prefix="iPrefixIcon.prefix"
|
|
23
|
+
:name="iPrefixIcon.name"
|
|
24
|
+
:size="iPrefixIcon.size"
|
|
25
|
+
:color="iPrefixIcon.color"
|
|
26
|
+
:aria-hidden="!!iPrefixIcon.ariaHidden"
|
|
27
|
+
:aria-label="iPrefixIcon.ariaLabel"
|
|
28
|
+
:aria-role="iPrefixIcon.ariaRole"
|
|
29
|
+
@click="iPrefixIcon.bindclick || ''"
|
|
30
30
|
/>
|
|
31
31
|
</block>
|
|
32
32
|
</view>
|
|
@@ -82,20 +82,20 @@
|
|
|
82
82
|
>
|
|
83
83
|
<slot name="suffix-icon" />
|
|
84
84
|
<block
|
|
85
|
-
v-if="
|
|
85
|
+
v-if="iSuffixIcon"
|
|
86
86
|
name="icon"
|
|
87
87
|
>
|
|
88
88
|
<t-icon
|
|
89
|
-
:custom-style="
|
|
89
|
+
:custom-style="iSuffixIcon.style || ''"
|
|
90
90
|
:t-class="tClassSuffixIcon"
|
|
91
|
-
:prefix="
|
|
92
|
-
:name="
|
|
93
|
-
:size="
|
|
94
|
-
:color="
|
|
95
|
-
:aria-hidden="!!
|
|
96
|
-
:aria-label="
|
|
97
|
-
:aria-role="
|
|
98
|
-
@click="
|
|
91
|
+
:prefix="iSuffixIcon.prefix"
|
|
92
|
+
:name="iSuffixIcon.name"
|
|
93
|
+
:size="iSuffixIcon.size"
|
|
94
|
+
:color="iSuffixIcon.color"
|
|
95
|
+
:aria-hidden="!!iSuffixIcon.ariaHidden"
|
|
96
|
+
:aria-label="iSuffixIcon.ariaLabel"
|
|
97
|
+
:aria-role="iSuffixIcon.ariaRole"
|
|
98
|
+
@click="iSuffixIcon.bindclick || ''"
|
|
99
99
|
/>
|
|
100
100
|
</block>
|
|
101
101
|
</view>
|
|
@@ -185,7 +185,7 @@ export default uniComponent({
|
|
|
185
185
|
|
|
186
186
|
suffixIcon: {
|
|
187
187
|
handler(v) {
|
|
188
|
-
this.
|
|
188
|
+
this.iSuffixIcon = calcIcon(v);
|
|
189
189
|
},
|
|
190
190
|
immediate: true,
|
|
191
191
|
},
|
|
@@ -209,7 +209,7 @@ export default uniComponent({
|
|
|
209
209
|
this.show();
|
|
210
210
|
this.__ready = true;
|
|
211
211
|
},
|
|
212
|
-
|
|
212
|
+
beforeUnmount() {
|
|
213
213
|
this.clearNoticeBarAnimation();
|
|
214
214
|
},
|
|
215
215
|
methods: {
|
|
@@ -295,7 +295,7 @@ export default uniComponent({
|
|
|
295
295
|
|
|
296
296
|
setPrefixIcon(v) {
|
|
297
297
|
const { theme } = this;
|
|
298
|
-
this.
|
|
298
|
+
this.iPrefixIcon = calcIcon(v, THEME_ICON[theme]);
|
|
299
299
|
},
|
|
300
300
|
|
|
301
301
|
onChange(e) {
|
|
@@ -321,6 +321,4 @@ export default uniComponent({
|
|
|
321
321
|
},
|
|
322
322
|
});
|
|
323
323
|
</script>
|
|
324
|
-
<style scoped>
|
|
325
|
-
@import './notice-bar.css';
|
|
326
|
-
</style>
|
|
324
|
+
<style scoped src="./notice-bar.css"></style>
|
package/dist/overlay/overlay.vue
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="prefix + '-overlay ' + transitionClass"
|
|
6
6
|
:style="tools._style([
|
|
7
7
|
'--td-overlay-transition-duration:' + duration + 'ms',
|
|
8
|
-
'z-index:' +
|
|
8
|
+
'z-index:' + iZIndex, 'top:' + distanceTop + 'px',
|
|
9
9
|
computedStyle,
|
|
10
10
|
customStyle
|
|
11
11
|
])"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
v-else-if="realVisible"
|
|
23
23
|
:class="prefix + '-overlay ' + transitionClass "
|
|
24
24
|
:style="tools._style([
|
|
25
|
-
'z-index:' +
|
|
25
|
+
'z-index:' + iZIndex,
|
|
26
26
|
'top:' + distanceTop + 'px',
|
|
27
27
|
computedStyle,
|
|
28
28
|
customStyle
|
|
@@ -69,7 +69,7 @@ export default uniComponent({
|
|
|
69
69
|
prefix,
|
|
70
70
|
classPrefix: name,
|
|
71
71
|
computedStyle: '',
|
|
72
|
-
|
|
72
|
+
iZIndex: 11000,
|
|
73
73
|
tools,
|
|
74
74
|
};
|
|
75
75
|
},
|
|
@@ -83,7 +83,7 @@ export default uniComponent({
|
|
|
83
83
|
zIndex: {
|
|
84
84
|
handler(v) {
|
|
85
85
|
if (v !== 0) {
|
|
86
|
-
this.
|
|
86
|
+
this.iZIndex = v;
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
immediate: true,
|
|
@@ -100,6 +100,4 @@ export default uniComponent({
|
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
102
|
</script>
|
|
103
|
-
<style scoped>
|
|
104
|
-
@import './overlay.css';
|
|
105
|
-
</style>
|
|
103
|
+
<style scoped src="./overlay.css"></style>
|
package/dist/picker/picker.vue
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:using-custom-navbar="usingCustomNavbar || (popupProps && popupProps.usingCustomNavbar)"
|
|
10
10
|
:custom-navbar-height="coalesce(customNavbarHeight, popupProps && popupProps.usingCustomNavbar)"
|
|
11
11
|
:z-index="(popupProps && popupProps.zIndex) || defaultPopUpzIndex"
|
|
12
|
-
:overlay-props="(popupProps && popupProps.overlayProps) ||
|
|
12
|
+
:overlay-props="(popupProps && popupProps.overlayProps) || defaultOverlayProps"
|
|
13
13
|
@visible-change="onPopupChange"
|
|
14
14
|
>
|
|
15
15
|
<template #content>
|
|
@@ -147,7 +147,7 @@ export default uniComponent({
|
|
|
147
147
|
return {
|
|
148
148
|
prefix,
|
|
149
149
|
classPrefix: name,
|
|
150
|
-
|
|
150
|
+
defaultOverlayProps: {},
|
|
151
151
|
defaultPopUpzIndex: 11500,
|
|
152
152
|
indicatorTop: 72, // 默认indicator位置,会动态计算
|
|
153
153
|
|
|
@@ -302,9 +302,8 @@ export default uniComponent({
|
|
|
302
302
|
},
|
|
303
303
|
});
|
|
304
304
|
</script>
|
|
305
|
+
<style scoped src="./picker.css"></style>
|
|
305
306
|
<style scoped>
|
|
306
|
-
@import './picker.css';
|
|
307
|
-
|
|
308
307
|
/* #ifndef MP-WEIXIN */
|
|
309
308
|
/* 适配 qq 小程序等 */
|
|
310
309
|
:deep(t-picker-item) {
|
|
@@ -185,7 +185,7 @@ export default uniComponent({
|
|
|
185
185
|
|
|
186
186
|
},
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
beforeUnmount() {
|
|
189
189
|
// 清理定时器,防止内存泄漏
|
|
190
190
|
if (this._animationTimer) {
|
|
191
191
|
clearInterval(this._animationTimer);
|
|
@@ -441,6 +441,4 @@ export default uniComponent({
|
|
|
441
441
|
},
|
|
442
442
|
});
|
|
443
443
|
</script>
|
|
444
|
-
<style scoped>
|
|
445
|
-
@import './picker-item.css';
|
|
446
|
-
</style>
|
|
444
|
+
<style scoped src="./picker-item.css"></style>
|
package/dist/popover/popover.vue
CHANGED
package/dist/popup/popup.vue
CHANGED
|
@@ -122,8 +122,8 @@ export default uniComponent({
|
|
|
122
122
|
loosing: false,
|
|
123
123
|
enableToRefresh: true,
|
|
124
124
|
scrollTop: 0,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
iMaxBarHeight: 0,
|
|
126
|
+
iLoadingBarHeight: 0,
|
|
127
127
|
|
|
128
128
|
pixelRatio: 1,
|
|
129
129
|
startPoint: null,
|
|
@@ -171,15 +171,15 @@ export default uniComponent({
|
|
|
171
171
|
}, 240);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
this.tipsHeight = Math.min(val, this.
|
|
174
|
+
this.tipsHeight = Math.min(val, this.iLoadingBarHeight);
|
|
175
175
|
},
|
|
176
176
|
|
|
177
177
|
maxBarHeight(v) {
|
|
178
|
-
this.
|
|
178
|
+
this.iMaxBarHeight = unitConvert(v);
|
|
179
179
|
},
|
|
180
180
|
|
|
181
181
|
loadingBarHeight(v) {
|
|
182
|
-
this.
|
|
182
|
+
this.iLoadingBarHeight = unitConvert(v);
|
|
183
183
|
},
|
|
184
184
|
},
|
|
185
185
|
mounted() {
|
|
@@ -187,8 +187,8 @@ export default uniComponent({
|
|
|
187
187
|
const { loadingTexts, maxBarHeight, loadingBarHeight } = this;
|
|
188
188
|
const isCustomLoadingTexts = Array.isArray(loadingTexts) && loadingTexts.length >= 4;
|
|
189
189
|
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
190
|
+
this.iMaxBarHeight = unitConvert(maxBarHeight);
|
|
191
|
+
this.iLoadingBarHeight = unitConvert(loadingBarHeight);
|
|
192
192
|
this.dataLoadingTexts = isCustomLoadingTexts ? loadingTexts : defaultLoadingTexts;
|
|
193
193
|
|
|
194
194
|
this.pixelRatio = 750 / screenWidth;
|
|
@@ -196,7 +196,7 @@ export default uniComponent({
|
|
|
196
196
|
this.updateDistanceTop();
|
|
197
197
|
},
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
beforeUnmount() {
|
|
200
200
|
clearTimeout(this.maxRefreshAnimateTimeFlag);
|
|
201
201
|
clearTimeout(this.closingAnimateTimeFlag);
|
|
202
202
|
this.resetTimer();
|
|
@@ -287,7 +287,7 @@ export default uniComponent({
|
|
|
287
287
|
this.loosing = true;
|
|
288
288
|
|
|
289
289
|
// 松开时高度超过阈值则触发刷新
|
|
290
|
-
if (barHeight > this.
|
|
290
|
+
if (barHeight > this.iLoadingBarHeight) {
|
|
291
291
|
this._trigger('change', { value: true });
|
|
292
292
|
this.$emit('refresh');
|
|
293
293
|
} else {
|
|
@@ -299,7 +299,7 @@ export default uniComponent({
|
|
|
299
299
|
|
|
300
300
|
doRefresh() {
|
|
301
301
|
if (this.disabled) return;
|
|
302
|
-
this.barHeight = this.
|
|
302
|
+
this.barHeight = this.iLoadingBarHeight;
|
|
303
303
|
this.refreshStatus = REFRESH_STATUS_MAP.LOADING;
|
|
304
304
|
this.loosing = true;
|
|
305
305
|
|
|
@@ -315,10 +315,10 @@ export default uniComponent({
|
|
|
315
315
|
},
|
|
316
316
|
|
|
317
317
|
setRefreshBarHeight(value) {
|
|
318
|
-
const barHeight = Math.min(value, this.
|
|
318
|
+
const barHeight = Math.min(value, this.iMaxBarHeight);
|
|
319
319
|
const data = { barHeight };
|
|
320
320
|
|
|
321
|
-
if (barHeight >= this.
|
|
321
|
+
if (barHeight >= this.iLoadingBarHeight) {
|
|
322
322
|
data.refreshStatus = REFRESH_STATUS_MAP.LOSING;
|
|
323
323
|
} else {
|
|
324
324
|
data.refreshStatus = REFRESH_STATUS_MAP.PULLING;
|
|
@@ -361,6 +361,4 @@ export default uniComponent({
|
|
|
361
361
|
},
|
|
362
362
|
});
|
|
363
363
|
</script>
|
|
364
|
-
<style scoped>
|
|
365
|
-
@import './pull-down-refresh.css';
|
|
366
|
-
</style>
|
|
364
|
+
<style scoped src="./pull-down-refresh.css"></style>
|
package/dist/qrcode/qrcode.vue
CHANGED
package/dist/radio/radio.vue
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<view
|
|
3
3
|
:id="tId"
|
|
4
4
|
:style="tools._style([customStyle])"
|
|
5
|
-
:class="tools.cls(classPrefix, [innerPlacement, ['block', block], ['disabled',
|
|
6
|
-
:disabled="
|
|
5
|
+
:class="tools.cls(classPrefix, [innerPlacement, ['block', block], ['disabled', iDisabled]]) + ' ' + tClass"
|
|
6
|
+
:disabled="iDisabled"
|
|
7
7
|
aria-role="radio"
|
|
8
8
|
:aria-checked="dataChecked"
|
|
9
9
|
:aria-label="label + content"
|
|
10
|
-
:aria-disabled="
|
|
10
|
+
:aria-disabled="iDisabled"
|
|
11
11
|
@click.stop="handleTap"
|
|
12
12
|
>
|
|
13
|
-
<view :class="tools.cls(classPrefix + '__icon', [innerPlacement, ['checked', dataChecked], ['disabled',
|
|
13
|
+
<view :class="tools.cls(classPrefix + '__icon', [innerPlacement, ['checked', dataChecked], ['disabled', iDisabled]]) + ' ' + tClassIcon">
|
|
14
14
|
<slot
|
|
15
15
|
v-if="slotIcon"
|
|
16
16
|
name="icon"
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
/>
|
|
34
34
|
<view
|
|
35
35
|
v-if="dataChecked && icon == 'dot'"
|
|
36
|
-
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled',
|
|
36
|
+
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled', iDisabled]])"
|
|
37
37
|
/>
|
|
38
38
|
<view
|
|
39
39
|
v-if="!dataChecked && (icon == 'circle' || icon == 'dot')"
|
|
40
|
-
:class="tools.cls(classPrefix + '__icon-circle', [['disabled',
|
|
40
|
+
:class="tools.cls(classPrefix + '__icon-circle', [['disabled', iDisabled]])"
|
|
41
41
|
/>
|
|
42
42
|
<view
|
|
43
43
|
v-if="!dataChecked && icon == 'line'"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<view
|
|
54
54
|
:class="
|
|
55
55
|
tools.cls(classPrefix + '__title', [
|
|
56
|
-
['disabled',
|
|
56
|
+
['disabled', iDisabled],
|
|
57
57
|
['checked', dataChecked]
|
|
58
58
|
]) +
|
|
59
59
|
' ' +
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<view
|
|
71
71
|
:class="
|
|
72
72
|
tools.cls(classPrefix + '__description', [
|
|
73
|
-
['disabled',
|
|
73
|
+
['disabled', iDisabled],
|
|
74
74
|
['checked', dataChecked]
|
|
75
75
|
]) +
|
|
76
76
|
' ' +
|
|
@@ -143,8 +143,8 @@ export default uniComponent({
|
|
|
143
143
|
optionLinked: false,
|
|
144
144
|
iconVal: [],
|
|
145
145
|
innerPlacement: '',
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
iDisabled: false,
|
|
147
|
+
iReadonly: false,
|
|
148
148
|
tools,
|
|
149
149
|
|
|
150
150
|
dataChecked: coalesce(this.checked, this.defaultChecked),
|
|
@@ -164,13 +164,13 @@ export default uniComponent({
|
|
|
164
164
|
},
|
|
165
165
|
disabled: {
|
|
166
166
|
handler(v) {
|
|
167
|
-
this.
|
|
167
|
+
this.iDisabled = v;
|
|
168
168
|
},
|
|
169
169
|
immediate: true,
|
|
170
170
|
},
|
|
171
171
|
readonly: {
|
|
172
172
|
handler(v) {
|
|
173
|
-
this.
|
|
173
|
+
this.iReadonly = v;
|
|
174
174
|
},
|
|
175
175
|
immediate: true,
|
|
176
176
|
},
|
|
@@ -180,10 +180,10 @@ export default uniComponent({
|
|
|
180
180
|
},
|
|
181
181
|
methods: {
|
|
182
182
|
handleTap(e) {
|
|
183
|
-
const {
|
|
183
|
+
const { iDisabled, iReadonly, contentDisabled } = this;
|
|
184
184
|
const { target } = e.currentTarget.dataset;
|
|
185
185
|
|
|
186
|
-
if (
|
|
186
|
+
if (iDisabled || iReadonly || (target === 'text' && contentDisabled)) return;
|
|
187
187
|
|
|
188
188
|
this.doChange();
|
|
189
189
|
},
|
|
@@ -213,15 +213,13 @@ export default uniComponent({
|
|
|
213
213
|
setDisabled(disabled) {
|
|
214
214
|
if (this.isIsolated) return;
|
|
215
215
|
|
|
216
|
-
this.
|
|
216
|
+
this.iDisabled = this.disabled || disabled;
|
|
217
217
|
},
|
|
218
218
|
|
|
219
219
|
setReadonly(readonly) {
|
|
220
|
-
this.
|
|
220
|
+
this.iReadonly = this.readonly || readonly;
|
|
221
221
|
},
|
|
222
222
|
},
|
|
223
223
|
});
|
|
224
224
|
</script>
|
|
225
|
-
<style scoped>
|
|
226
|
-
@import './radio.css';
|
|
227
|
-
</style>
|
|
225
|
+
<style scoped src="./radio.css"></style>
|
package/dist/rate/rate.vue
CHANGED
package/dist/result/result.vue
CHANGED
package/dist/row/row.vue
CHANGED
package/dist/search/search.vue
CHANGED
|
@@ -170,6 +170,13 @@ export default uniComponent({
|
|
|
170
170
|
immediate: true,
|
|
171
171
|
},
|
|
172
172
|
|
|
173
|
+
value: {
|
|
174
|
+
handler(val) {
|
|
175
|
+
this.dataValue = val;
|
|
176
|
+
},
|
|
177
|
+
immediate: true,
|
|
178
|
+
},
|
|
179
|
+
|
|
173
180
|
dataValue: {
|
|
174
181
|
handler() {
|
|
175
182
|
// this.updateInnerMaxLen();
|
|
@@ -287,6 +294,4 @@ export default uniComponent({
|
|
|
287
294
|
|
|
288
295
|
|
|
289
296
|
</script>
|
|
290
|
-
<style scoped>
|
|
291
|
-
@import './search.css';
|
|
292
|
-
</style>
|
|
297
|
+
<style scoped src="./search.css"></style>
|