sard-uniapp 1.1.0-alpha.2 → 1.1.0-rc.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/changelog.md +7 -1
- package/components/_template/{index.vue → _template.vue} +1 -1
- package/components/button/button.vue +1 -1
- package/components/calendar/calendar.vue +9 -3
- package/components/calendar/index.scss +4 -1
- package/components/config/index.d.ts +14 -0
- package/components/config/index.js +7 -0
- package/components/indexes-nav/indexes-nav.vue +2 -0
- package/components/input/input.vue +2 -0
- package/components/load-more/common.d.ts +33 -0
- package/components/load-more/common.js +12 -0
- package/components/load-more/index.d.ts +1 -0
- package/components/load-more/index.js +1 -0
- package/components/load-more/index.scss +17 -0
- package/components/load-more/load-more.vue +65 -0
- package/components/load-more/variables.scss +7 -0
- package/components/loading/common.d.ts +11 -0
- package/components/loading/common.js +10 -0
- package/components/loading/index.scss +31 -14
- package/components/loading/loading.vue +33 -4
- package/components/loading/variables.scss +3 -2
- package/components/locale/lang/zh-CN.d.ts +6 -0
- package/components/locale/lang/zh-CN.js +6 -0
- package/components/popout-input/popout-input.vue +2 -0
- package/components/popup/common.d.ts +1 -0
- package/components/popup/common.js +3 -0
- package/components/popup/index.d.ts +1 -1
- package/components/popup/index.js +1 -1
- package/components/pull-down-refresh/common.d.ts +55 -0
- package/components/pull-down-refresh/common.js +37 -0
- package/components/pull-down-refresh/index.d.ts +1 -0
- package/components/pull-down-refresh/index.js +1 -0
- package/components/pull-down-refresh/index.scss +26 -0
- package/components/pull-down-refresh/pull-down-refresh.vue +262 -0
- package/components/pull-down-refresh/variables.scss +8 -0
- package/components/pull-down-refresh/wx.wxs +84 -0
- package/components/rate/rate.vue +6 -8
- package/components/slider/slider.vue +5 -8
- package/components/stepper/common.d.ts +5 -0
- package/components/stepper/common.js +5 -0
- package/components/stepper/index.scss +15 -1
- package/components/stepper/stepper.vue +4 -1
- package/components/stepper/variables.scss +8 -4
- package/global.d.ts +4 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/index.scss +2 -0
- package/package.json +1 -1
- package/utils/dom.d.ts +1 -53
- package/utils/dom.js +11 -12
package/changelog.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
## 1.1.0-
|
|
1
|
+
## 1.1.0-rc.1 (2024-04-08)
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 1.1.0-beta.1 (2024-04-06)
|
|
7
|
+
|
|
8
|
+
* feat: 新增pull-down-refresh组件, slider组件新增时间, 重构loading组件, 其他优化 ([802816a](https://github.com/sutras/sard-uniapp/commit/802816a))
|
|
3
9
|
* docs: update quickstart.md ([fa280f6](https://github.com/sutras/sard-uniapp/commit/fa280f6))
|
|
4
10
|
* build: 新增changelog构建流程 ([e1e862d](https://github.com/sutras/sard-uniapp/commit/e1e862d))
|
|
5
11
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
:several-months="severalMonths"
|
|
57
57
|
:t="t"
|
|
58
58
|
:bem="bem"
|
|
59
|
-
@day-click="
|
|
59
|
+
@day-click="onDayClick"
|
|
60
60
|
/>
|
|
61
61
|
</scroll-view>
|
|
62
62
|
</view>
|
|
@@ -97,6 +97,7 @@ import {
|
|
|
97
97
|
sortDates,
|
|
98
98
|
weeksIndex
|
|
99
99
|
} from "./common";
|
|
100
|
+
import { useInPopup } from "../popup/common";
|
|
100
101
|
import SarButton from "../button/button.vue";
|
|
101
102
|
import SarIcon from "../icon/icon.vue";
|
|
102
103
|
import { useTranslate } from "../locale";
|
|
@@ -220,7 +221,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
220
221
|
}
|
|
221
222
|
return dates;
|
|
222
223
|
});
|
|
223
|
-
const
|
|
224
|
+
const onDayClick = (date) => {
|
|
224
225
|
let nextValue;
|
|
225
226
|
if (props.type === "single") {
|
|
226
227
|
nextValue = date;
|
|
@@ -267,17 +268,22 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
267
268
|
emit("update:model-value", nextValue);
|
|
268
269
|
}
|
|
269
270
|
};
|
|
271
|
+
const inPopup = useInPopup();
|
|
272
|
+
const preventPageScroll = computed(() => {
|
|
273
|
+
return inPopup && !props.severalMonths;
|
|
274
|
+
});
|
|
270
275
|
const calendarClass = computed(() => {
|
|
271
276
|
return classNames(
|
|
272
277
|
bem.b(),
|
|
273
278
|
bem.m("several", props.severalMonths),
|
|
279
|
+
bem.m("no-scroll", preventPageScroll.value),
|
|
274
280
|
props.rootClass
|
|
275
281
|
);
|
|
276
282
|
});
|
|
277
283
|
const calendarStyle = computed(() => {
|
|
278
284
|
return stringifyStyle(props.rootStyle);
|
|
279
285
|
});
|
|
280
|
-
const __returned__ = { props, emit, bem, t, minDate, maxDate, innerValue, getInitialCurrentDate, innerCurrentDate, startDate, onPrevMonthClick, onNextMonthClick, pickerVisible, pickerValue, onMonthClick, onPickerConfirm, weeks, months, todayNumber, currentDates,
|
|
286
|
+
const __returned__ = { props, emit, bem, t, minDate, maxDate, innerValue, getInitialCurrentDate, innerCurrentDate, startDate, onPrevMonthClick, onNextMonthClick, pickerVisible, pickerValue, onMonthClick, onPickerConfirm, weeks, months, todayNumber, currentDates, onDayClick, inPopup, preventPageScroll, calendarClass, calendarStyle, get toMonthNumber() {
|
|
281
287
|
return toMonthNumber;
|
|
282
288
|
}, SarButton, SarIcon, SarCalendarMonth, SarPopout, SarDatetimePicker };
|
|
283
289
|
return __returned__;
|
|
@@ -173,6 +173,12 @@ export declare const defaultConfig: {
|
|
|
173
173
|
percent: number;
|
|
174
174
|
thickness: number;
|
|
175
175
|
};
|
|
176
|
+
pullDownRefresh: {
|
|
177
|
+
threshold: number;
|
|
178
|
+
headerHeight: number;
|
|
179
|
+
transitionDuration: number;
|
|
180
|
+
doneDuration: number;
|
|
181
|
+
};
|
|
176
182
|
radioGroup: {
|
|
177
183
|
direction: string;
|
|
178
184
|
validateEvent: boolean;
|
|
@@ -212,6 +218,7 @@ export declare const defaultConfig: {
|
|
|
212
218
|
pressTime: number;
|
|
213
219
|
interval: number;
|
|
214
220
|
validateEvent: boolean;
|
|
221
|
+
size: string;
|
|
215
222
|
};
|
|
216
223
|
steps: {
|
|
217
224
|
current: number;
|
|
@@ -478,6 +485,12 @@ export declare function useConfigContext(): DeepPartial<{
|
|
|
478
485
|
percent: number;
|
|
479
486
|
thickness: number;
|
|
480
487
|
};
|
|
488
|
+
pullDownRefresh: {
|
|
489
|
+
threshold: number;
|
|
490
|
+
headerHeight: number;
|
|
491
|
+
transitionDuration: number;
|
|
492
|
+
doneDuration: number;
|
|
493
|
+
};
|
|
481
494
|
radioGroup: {
|
|
482
495
|
direction: string;
|
|
483
496
|
validateEvent: boolean;
|
|
@@ -517,6 +530,7 @@ export declare function useConfigContext(): DeepPartial<{
|
|
|
517
530
|
pressTime: number;
|
|
518
531
|
interval: number;
|
|
519
532
|
validateEvent: boolean;
|
|
533
|
+
size: string;
|
|
520
534
|
};
|
|
521
535
|
steps: {
|
|
522
536
|
current: number;
|
|
@@ -174,6 +174,12 @@ export const defaultConfig = {
|
|
|
174
174
|
percent: 0,
|
|
175
175
|
thickness: 4,
|
|
176
176
|
},
|
|
177
|
+
pullDownRefresh: {
|
|
178
|
+
threshold: 50,
|
|
179
|
+
headerHeight: 50,
|
|
180
|
+
transitionDuration: 300,
|
|
181
|
+
doneDuration: 0,
|
|
182
|
+
},
|
|
177
183
|
radioGroup: {
|
|
178
184
|
direction: 'vertical',
|
|
179
185
|
validateEvent: true,
|
|
@@ -213,6 +219,7 @@ export const defaultConfig = {
|
|
|
213
219
|
pressTime: 350,
|
|
214
220
|
interval: 150,
|
|
215
221
|
validateEvent: true,
|
|
222
|
+
size: 'medium',
|
|
216
223
|
},
|
|
217
224
|
steps: {
|
|
218
225
|
current: 0,
|
|
@@ -129,6 +129,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
129
129
|
currentItemIndex = null;
|
|
130
130
|
};
|
|
131
131
|
const onMouseDown = (event) => {
|
|
132
|
+
// #ifdef H5
|
|
132
133
|
const info = uni.getSystemInfoSync();
|
|
133
134
|
onTouchStart(toTouchEvent(event, info.windowTop));
|
|
134
135
|
const moveHandler = (event2) => {
|
|
@@ -142,6 +143,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
142
143
|
};
|
|
143
144
|
document.addEventListener("mousemove", moveHandler);
|
|
144
145
|
document.addEventListener("mouseup", upHandler);
|
|
146
|
+
// #endif
|
|
145
147
|
};
|
|
146
148
|
const navClass = computed(() => {
|
|
147
149
|
return classNames(bem.e("nav"));
|
|
@@ -185,12 +185,14 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
185
185
|
holdupClear.value = false;
|
|
186
186
|
};
|
|
187
187
|
const onClearMouseDown = () => {
|
|
188
|
+
// #ifdef H5
|
|
188
189
|
onClearTouchStart();
|
|
189
190
|
const upHandler = () => {
|
|
190
191
|
onClearTouchEnd();
|
|
191
192
|
document.removeEventListener("mouseup", upHandler);
|
|
192
193
|
};
|
|
193
194
|
document.addEventListener("mouseup", upHandler);
|
|
195
|
+
// #endif
|
|
194
196
|
};
|
|
195
197
|
const onClearClick = () => {
|
|
196
198
|
setInnerValue("");
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type PropType, type StyleValue } from 'vue';
|
|
2
|
+
export type LoadMoreStatus = 'incomplete' | 'loading' | 'complete' | 'error';
|
|
3
|
+
export interface LoadMoreProps {
|
|
4
|
+
rootStyle?: StyleValue;
|
|
5
|
+
rootClass?: string;
|
|
6
|
+
status?: LoadMoreStatus;
|
|
7
|
+
incompleteText?: string;
|
|
8
|
+
loadingText?: string;
|
|
9
|
+
completeText?: string;
|
|
10
|
+
errorText?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const loadMoreProps: {
|
|
13
|
+
rootStyle: PropType<StyleValue>;
|
|
14
|
+
rootClass: StringConstructor;
|
|
15
|
+
status: {
|
|
16
|
+
type: PropType<LoadMoreStatus>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
incompleteText: StringConstructor;
|
|
20
|
+
loadingText: StringConstructor;
|
|
21
|
+
completeText: StringConstructor;
|
|
22
|
+
errorText: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
export interface LoadMoreSlots {
|
|
25
|
+
incomplete(props: Record<string, never>): any;
|
|
26
|
+
loading(props: Record<string, never>): any;
|
|
27
|
+
complete(props: Record<string, never>): any;
|
|
28
|
+
error(props: Record<string, never>): any;
|
|
29
|
+
}
|
|
30
|
+
export interface LoadMoreEmits {
|
|
31
|
+
(e: 'load-more'): void;
|
|
32
|
+
(e: 'reload'): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { LoadMoreStatus, LoadMoreProps, LoadMoreSlots, LoadMoreEmits, } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use '../style/base' as *;
|
|
2
|
+
|
|
3
|
+
@include bem(load-more) {
|
|
4
|
+
@include b() {
|
|
5
|
+
@include universal;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
height: var(--sar-load-more-height);
|
|
10
|
+
font-size: var(--sar-load-more-font-size);
|
|
11
|
+
color: var(--sar-load-more-color);
|
|
12
|
+
|
|
13
|
+
@include m(incomplete, error) {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="loadMoreClass" :style="loadMoreStyle" @click="onClick">
|
|
3
|
+
<slot v-if="status === 'incomplete'" name="incomplete">
|
|
4
|
+
{{ incompleteText || t('incompleteText') }}
|
|
5
|
+
</slot>
|
|
6
|
+
<slot v-else-if="status === 'loading'" name="loading">
|
|
7
|
+
<sar-loading>
|
|
8
|
+
{{ loadingText || t('loadingText') }}
|
|
9
|
+
</sar-loading>
|
|
10
|
+
</slot>
|
|
11
|
+
<slot v-else-if="status === 'complete'" name="complete">
|
|
12
|
+
{{ completeText || t('completeText') }}
|
|
13
|
+
</slot>
|
|
14
|
+
<slot v-else-if="status === 'error'" name="error">
|
|
15
|
+
{{ errorText || t('errorText') }}
|
|
16
|
+
</slot>
|
|
17
|
+
</view>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
22
|
+
import { computed } from "vue";
|
|
23
|
+
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
24
|
+
import { loadMoreProps } from "./common";
|
|
25
|
+
import { useTranslate } from "../locale";
|
|
26
|
+
import SarLoading from "../loading/loading.vue";
|
|
27
|
+
const __default__ = {
|
|
28
|
+
options: {
|
|
29
|
+
virtualHost: true,
|
|
30
|
+
styleIsolation: "shared"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
34
|
+
...__default__,
|
|
35
|
+
__name: "load-more",
|
|
36
|
+
props: loadMoreProps,
|
|
37
|
+
emits: ["load-more", "reload"],
|
|
38
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
39
|
+
__expose();
|
|
40
|
+
const props = __props;
|
|
41
|
+
const emit = __emit;
|
|
42
|
+
const bem = createBem("load-more");
|
|
43
|
+
const { t } = useTranslate("loadMore");
|
|
44
|
+
const onClick = () => {
|
|
45
|
+
if (props.status === "incomplete") {
|
|
46
|
+
emit("load-more");
|
|
47
|
+
} else if (props.status === "error") {
|
|
48
|
+
emit("reload");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const loadMoreClass = computed(() => {
|
|
52
|
+
return classNames(bem.b(), bem.m(props.status), props.rootClass);
|
|
53
|
+
});
|
|
54
|
+
const loadMoreStyle = computed(() => {
|
|
55
|
+
return stringifyStyle(props.rootStyle);
|
|
56
|
+
});
|
|
57
|
+
const __returned__ = { props, emit, bem, t, onClick, loadMoreClass, loadMoreStyle, SarLoading };
|
|
58
|
+
return __returned__;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss">
|
|
64
|
+
@import './index.scss';
|
|
65
|
+
</style>
|
|
@@ -9,6 +9,8 @@ export interface LoadingProps {
|
|
|
9
9
|
textColor?: string;
|
|
10
10
|
textSize?: string;
|
|
11
11
|
vertical?: boolean;
|
|
12
|
+
animated?: boolean;
|
|
13
|
+
progress?: number;
|
|
12
14
|
}
|
|
13
15
|
export declare const loadingProps: {
|
|
14
16
|
rootStyle: PropType<StyleValue>;
|
|
@@ -23,7 +25,16 @@ export declare const loadingProps: {
|
|
|
23
25
|
textColor: StringConstructor;
|
|
24
26
|
textSize: StringConstructor;
|
|
25
27
|
vertical: BooleanConstructor;
|
|
28
|
+
animated: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
progress: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
26
36
|
};
|
|
27
37
|
export interface LoadingSlots {
|
|
28
38
|
default(props: Record<string, never>): any;
|
|
39
|
+
circular(props: Record<string, never>): any;
|
|
29
40
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defaultConfig } from '../config';
|
|
2
2
|
// const props = withDefaults(defineProps<LoadingProps>(), {
|
|
3
3
|
// type: 'circular',
|
|
4
|
+
// animated: true,
|
|
5
|
+
// progress: 1,
|
|
4
6
|
// })
|
|
5
7
|
export const loadingProps = {
|
|
6
8
|
rootStyle: [String, Object, Array],
|
|
@@ -15,4 +17,12 @@ export const loadingProps = {
|
|
|
15
17
|
textColor: String,
|
|
16
18
|
textSize: String,
|
|
17
19
|
vertical: Boolean,
|
|
20
|
+
animated: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true,
|
|
23
|
+
},
|
|
24
|
+
progress: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 1,
|
|
27
|
+
},
|
|
18
28
|
};
|
|
@@ -19,21 +19,23 @@ $sar-loading-scale-number: 12;
|
|
|
19
19
|
|
|
20
20
|
@include e(icon) {
|
|
21
21
|
@include universal;
|
|
22
|
-
width: 1em;
|
|
23
|
-
height: 1em;
|
|
24
|
-
min-width: var(--sar-loading-icon-min-width);
|
|
25
|
-
min-height: var(--sar-loading-icon-min-height);
|
|
26
22
|
|
|
27
|
-
@include m(circular) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
@include m(circular, clock) {
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 1em;
|
|
27
|
+
height: 1em;
|
|
28
|
+
min-width: var(--sar-loading-icon-min-width);
|
|
29
|
+
min-height: var(--sar-loading-icon-min-height);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include m-intersect(circular, animated) {
|
|
31
33
|
animation: #{bem-ns(loading-rotate)} var(
|
|
32
34
|
--sar-loading-icon-animation-duration
|
|
33
35
|
) linear infinite;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
@include m(clock) {
|
|
38
|
+
@include m-intersect(clock, animated) {
|
|
37
39
|
animation: #{bem-ns(loading-rotate)} var(
|
|
38
40
|
--sar-loading-icon-animation-duration
|
|
39
41
|
) steps(#{$sar-loading-scale-number}) infinite;
|
|
@@ -49,6 +51,19 @@ $sar-loading-scale-number: 12;
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
@include e(spinner) {
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
border-radius: 100%;
|
|
58
|
+
background: conic-gradient(
|
|
59
|
+
rgba(255, 255, 255, 0) 0deg,
|
|
60
|
+
rgba(255, 255, 255, 0) 60deg,
|
|
61
|
+
currentColor 330deg,
|
|
62
|
+
rgba(255, 255, 255, 0) 360deg
|
|
63
|
+
);
|
|
64
|
+
-webkit-mask: radial-gradient(transparent calc(55% - 1px), #fff 55%);
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
@include e(scale) {
|
|
53
68
|
position: absolute;
|
|
54
69
|
top: 0;
|
|
@@ -60,6 +75,7 @@ $sar-loading-scale-number: 12;
|
|
|
60
75
|
display: flex;
|
|
61
76
|
width: var(--sar-loading-scale-width);
|
|
62
77
|
min-width: var(--sar-loading-scale-min-width);
|
|
78
|
+
transform: scaleX(var(--sar-loading-scale-scale-x));
|
|
63
79
|
height: var(--sar-loading-scale-height);
|
|
64
80
|
margin: 0 auto;
|
|
65
81
|
border-radius: var(--sar-loading-scale-border-radius);
|
|
@@ -68,14 +84,15 @@ $sar-loading-scale-number: 12;
|
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
@for $i from 1 through $sar-loading-scale-number {
|
|
71
|
-
|
|
72
|
-
opacity: tofixed(
|
|
73
|
-
1 - math.div(1, $sar-loading-scale-number) * ($i - 1),
|
|
74
|
-
6
|
|
75
|
-
);
|
|
87
|
+
@include m(#{$i}) {
|
|
88
|
+
opacity: tofixed(math.div(1, $sar-loading-scale-number) * $i, 4);
|
|
76
89
|
transform: rotate(#{math.div(360, $sar-loading-scale-number) * $i}deg);
|
|
77
90
|
}
|
|
78
91
|
}
|
|
92
|
+
|
|
93
|
+
@include m(hidden) {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
79
96
|
}
|
|
80
97
|
|
|
81
98
|
@include e(text) {
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="loadingClass">
|
|
3
3
|
<view :class="iconClass" :style="iconStyle">
|
|
4
|
-
<
|
|
5
|
-
<view
|
|
4
|
+
<slot v-if="type === 'circular'" name="circular">
|
|
5
|
+
<view :class="bem.e('spinner')"></view>
|
|
6
|
+
</slot>
|
|
7
|
+
<template v-else-if="type === 'clock'">
|
|
8
|
+
<view
|
|
9
|
+
v-for="i in 12"
|
|
10
|
+
:key="i"
|
|
11
|
+
:class="
|
|
12
|
+
classNames(
|
|
13
|
+
bem.e('scale'),
|
|
14
|
+
bem.em('scale', i),
|
|
15
|
+
!props.animated
|
|
16
|
+
? {
|
|
17
|
+
[bem.em('scale', 'hidden')]: i > scaleShowNum,
|
|
18
|
+
}
|
|
19
|
+
: null,
|
|
20
|
+
)
|
|
21
|
+
"
|
|
22
|
+
></view>
|
|
6
23
|
</template>
|
|
7
24
|
</view>
|
|
8
25
|
|
|
@@ -42,11 +59,18 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
42
59
|
__expose();
|
|
43
60
|
const props = __props;
|
|
44
61
|
const bem = createBem("loading");
|
|
62
|
+
const scaleShowNum = computed(() => {
|
|
63
|
+
return Math.max(Math.floor(props.progress * 12), 1);
|
|
64
|
+
});
|
|
45
65
|
const loadingClass = computed(() => {
|
|
46
66
|
return classNames(bem.b(), bem.m("vertical", props.vertical));
|
|
47
67
|
});
|
|
48
68
|
const iconClass = computed(() => {
|
|
49
|
-
return classNames(
|
|
69
|
+
return classNames(
|
|
70
|
+
bem.e("icon"),
|
|
71
|
+
bem.em("icon", props.type),
|
|
72
|
+
bem.em("icon", "animated", props.animated)
|
|
73
|
+
);
|
|
50
74
|
});
|
|
51
75
|
const iconStyle = computed(() => {
|
|
52
76
|
return stringifyStyle(
|
|
@@ -54,6 +78,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
54
78
|
color: props.color,
|
|
55
79
|
fontSize: props.size
|
|
56
80
|
},
|
|
81
|
+
props.type === "circular" && !props.animated ? {
|
|
82
|
+
transform: `rotate(${props.progress * 360}deg)`
|
|
83
|
+
} : null,
|
|
57
84
|
props.rootClass
|
|
58
85
|
);
|
|
59
86
|
});
|
|
@@ -63,7 +90,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
63
90
|
props.rootStyle
|
|
64
91
|
);
|
|
65
92
|
});
|
|
66
|
-
const __returned__ = { props, bem, loadingClass, iconClass, iconStyle, loadingTextStyle, get
|
|
93
|
+
const __returned__ = { props, bem, scaleShowNum, loadingClass, iconClass, iconStyle, loadingTextStyle, get classNames() {
|
|
94
|
+
return classNames;
|
|
95
|
+
}, get isRenderVisible() {
|
|
67
96
|
return isRenderVisible;
|
|
68
97
|
} };
|
|
69
98
|
return __returned__;
|
|
@@ -4,8 +4,9 @@ page {
|
|
|
4
4
|
--sar-loading-icon-min-height: 32rpx;
|
|
5
5
|
--sar-loading-icon-animation-duration: 0.8s;
|
|
6
6
|
|
|
7
|
-
--sar-loading-scale-width:
|
|
8
|
-
--sar-loading-scale-min-width:
|
|
7
|
+
--sar-loading-scale-width: 9.38%;
|
|
8
|
+
--sar-loading-scale-min-width: 2px;
|
|
9
|
+
--sar-loading-scale-scale-x: 0.75;
|
|
9
10
|
--sar-loading-scale-height: 28%;
|
|
10
11
|
--sar-loading-scale-border-radius: 40%;
|
|
11
12
|
|
|
@@ -100,12 +100,14 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
const onSealMouseDown = () => {
|
|
103
|
+
// #ifdef H5
|
|
103
104
|
onSealTouchStart();
|
|
104
105
|
const upHandler = () => {
|
|
105
106
|
onSealTouchEnd();
|
|
106
107
|
document.removeEventListener("mouseup", upHandler);
|
|
107
108
|
};
|
|
108
109
|
document.addEventListener("mouseup", upHandler);
|
|
110
|
+
// #endif
|
|
109
111
|
};
|
|
110
112
|
const onClick = (event) => {
|
|
111
113
|
if (interoperable.value) {
|
|
@@ -54,3 +54,4 @@ export interface PopupContext {
|
|
|
54
54
|
export declare const popupContextSymbol: unique symbol;
|
|
55
55
|
export declare function usePopupVisibleHookProvide(): (name: TransitionHookName) => void;
|
|
56
56
|
export declare function usePopupEnter(callback: () => void): void;
|
|
57
|
+
export declare function useInPopup(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export { type PopupProps, type PopupSlots, type PopupEmits, type PopupContext, usePopupVisibleHookProvide, usePopupEnter, useInPopup, } from './common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { usePopupVisibleHookProvide, usePopupEnter, useInPopup, } from './common';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type PropType, type StyleValue } from 'vue';
|
|
2
|
+
export type PullDownRefreshStatus = 'initial' | 'unready' | 'ready' | 'loading' | 'done' | 'recovering';
|
|
3
|
+
export interface PullDownRefreshProps {
|
|
4
|
+
rootStyle?: StyleValue;
|
|
5
|
+
rootClass?: string;
|
|
6
|
+
threshold?: number;
|
|
7
|
+
headerHeight?: number;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
transitionDuration?: number;
|
|
10
|
+
doneDuration?: number;
|
|
11
|
+
disabled?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const pullDownRefreshProps: {
|
|
14
|
+
rootStyle: PropType<StyleValue>;
|
|
15
|
+
rootClass: StringConstructor;
|
|
16
|
+
threshold: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
headerHeight: {
|
|
21
|
+
type: NumberConstructor;
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
loading: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
transitionDuration: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
doneDuration: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export interface PullDownRefreshSlots {
|
|
42
|
+
default(props: Record<string, never>): any;
|
|
43
|
+
unready(props: {
|
|
44
|
+
progress: number;
|
|
45
|
+
}): any;
|
|
46
|
+
ready(props: Record<string, never>): any;
|
|
47
|
+
loading(props: Record<string, never>): any;
|
|
48
|
+
done(props: Record<string, never>): any;
|
|
49
|
+
}
|
|
50
|
+
export interface PullDownRefreshEmits {
|
|
51
|
+
(e: 'refresh'): void;
|
|
52
|
+
}
|
|
53
|
+
export interface PullDownRefreshExpose {
|
|
54
|
+
setScrollTop: (scrollTop: number) => void;
|
|
55
|
+
}
|