sard-uniapp 1.1.1 → 1.1.3
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 +12 -0
- package/components/button/index.scss +6 -2
- package/components/input/index.scss +12 -4
- package/components/pull-down-refresh/common.d.ts +1 -1
- package/components/pull-down-refresh/pull-down-refresh.vue +7 -7
- package/components/pull-down-refresh/wx.wxs +1 -5
- package/components/style/functions.scss +12 -1
- package/components/style/mixins/button.scss +6 -8
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## <small>1.1.3 (2024-05-11)</small>
|
|
2
|
+
|
|
3
|
+
* fix: 修复下拉刷新组件有时不触发的问题 close #18 ([3bbe3a9](https://github.com/sutras/sard-uniapp/commit/3bbe3a9)), closes [#18](https://github.com/sutras/sard-uniapp/issues/18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## <small>1.1.2 (2024-05-10)</small>
|
|
8
|
+
|
|
9
|
+
* fix: 移除属性选择器 close #23 ([89ef3fc](https://github.com/sutras/sard-uniapp/commit/89ef3fc)), closes [#23](https://github.com/sutras/sard-uniapp/issues/23)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
1
13
|
## <small>1.1.1 (2024-05-05)</small>
|
|
2
14
|
|
|
3
15
|
* fix: 修复upload-preview的image在h5环境下,没有宽度导致图片显示不全 ([e155724](https://github.com/sutras/sard-uniapp/commit/e155724))
|
|
@@ -154,13 +154,17 @@
|
|
|
154
154
|
|
|
155
155
|
// # active 状态
|
|
156
156
|
@include m(default, pale, mild, outline, text) {
|
|
157
|
-
&:not(
|
|
157
|
+
&:not(#{bem($b: button, $m: disabled)}):not(
|
|
158
|
+
#{bem($b: button, $m: loading)}
|
|
159
|
+
):active::before {
|
|
158
160
|
opacity: 1;
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
@include m(pale-text) {
|
|
163
|
-
&:
|
|
165
|
+
&:not(#{bem($b: button, $m: disabled)}):not(
|
|
166
|
+
#{bem($b: button, $m: loading)}
|
|
167
|
+
):active {
|
|
164
168
|
opacity: var(--sar-button-active-opacity);
|
|
165
169
|
}
|
|
166
170
|
}
|
|
@@ -58,10 +58,6 @@
|
|
|
58
58
|
height: var(--sar-input-control-textarea-height);
|
|
59
59
|
min-height: var(--sar-input-control-textarea-height);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
:deep([type='password']::-ms-reveal) {
|
|
63
|
-
display: none;
|
|
64
|
-
}
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
@include e(placeholder) {
|
|
@@ -116,3 +112,15 @@
|
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
114
|
}
|
|
115
|
+
|
|
116
|
+
/* #ifdef H5 */
|
|
117
|
+
@include bem(input) {
|
|
118
|
+
@include b() {
|
|
119
|
+
@include e(control) {
|
|
120
|
+
:deep([type='password']::-ms-reveal) {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/* #endif */
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
:prop="status"
|
|
37
37
|
:change:prop="wxsswipe.statusYWatch"
|
|
38
38
|
:data-status="status"
|
|
39
|
-
:data-
|
|
39
|
+
:data-canrefresh="canRefresh"
|
|
40
40
|
:data-threshold="threshold"
|
|
41
41
|
:data-headerheight="headerHeight"
|
|
42
42
|
:data-duration="transitionDuration"
|
|
@@ -144,7 +144,7 @@ export default {
|
|
|
144
144
|
let lockDirection = "";
|
|
145
145
|
const isDragging = ref(false);
|
|
146
146
|
const onTouchStart = (event) => {
|
|
147
|
-
if (props.disabled || status.value !== "initial" ||
|
|
147
|
+
if (props.disabled || status.value !== "initial" || !canRefresh.value) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
startX = event.touches[0].clientX;
|
|
@@ -204,12 +204,12 @@ export default {
|
|
|
204
204
|
document.addEventListener("mouseup", upHandler);
|
|
205
205
|
// #endif
|
|
206
206
|
};
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
|
|
207
|
+
const canRefresh = ref(true);
|
|
208
|
+
const enableToRefresh = (can) => {
|
|
209
|
+
canRefresh.value = can;
|
|
210
210
|
};
|
|
211
211
|
expose({
|
|
212
|
-
|
|
212
|
+
enableToRefresh,
|
|
213
213
|
_setStatus: (newStatus) => {
|
|
214
214
|
status.value = newStatus;
|
|
215
215
|
},
|
|
@@ -251,7 +251,7 @@ export default {
|
|
|
251
251
|
pullDownRefreshStyle,
|
|
252
252
|
headerStyle,
|
|
253
253
|
loadingClass,
|
|
254
|
-
|
|
254
|
+
canRefresh
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
};
|
|
@@ -12,11 +12,7 @@ function setStyle(instance, offsetY, duration) {
|
|
|
12
12
|
|
|
13
13
|
function onTouchStart(event) {
|
|
14
14
|
var dataset = event.instance.getDataset()
|
|
15
|
-
if (
|
|
16
|
-
dataset.disabled ||
|
|
17
|
-
dataset.status !== 'initial' ||
|
|
18
|
-
dataset.scrolltop !== 0
|
|
19
|
-
) {
|
|
15
|
+
if (dataset.disabled || dataset.status !== 'initial' || !dataset.canrefresh) {
|
|
20
16
|
return
|
|
21
17
|
}
|
|
22
18
|
startX = event.touches[0].clientX
|
|
@@ -35,5 +35,16 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@function bem-ns($str) {
|
|
38
|
-
@return $sar-namespace +
|
|
38
|
+
@return $sar-namespace + $sar-block-separator + $str;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@function bem($b, $e: null, $m: null) {
|
|
42
|
+
$result: '.' + $sar-namespace + $sar-block-separator + $b;
|
|
43
|
+
@if $e {
|
|
44
|
+
$result: $result + $sar-element-separator + $e;
|
|
45
|
+
}
|
|
46
|
+
@if $m {
|
|
47
|
+
$result: $result + $sar-modifier-separator + $m;
|
|
48
|
+
}
|
|
49
|
+
@return $result;
|
|
39
50
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
@
|
|
2
|
-
&:not([disabled]):not(.sar-button-disabled):not(.sar-button-loading):active {
|
|
3
|
-
@content;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
1
|
+
@use '../functions' as *;
|
|
6
2
|
|
|
7
3
|
@mixin button-size(
|
|
8
4
|
$height,
|
|
@@ -31,8 +27,10 @@
|
|
|
31
27
|
|
|
32
28
|
@mixin button-set-theme {
|
|
33
29
|
&,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
&#{bem($b: button, $m: disabled)},
|
|
31
|
+
&#{bem($b: button, $m: loading)} {
|
|
32
|
+
&#{bem($b: button)} {
|
|
33
|
+
@content;
|
|
34
|
+
}
|
|
37
35
|
}
|
|
38
36
|
}
|