sard-uniapp 1.11.1 → 1.12.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/CHANGELOG.md +34 -0
- package/README.md +5 -3
- package/components/action-sheet/action-sheet.vue +8 -2
- package/components/action-sheet/index.scss +1 -1
- package/components/back-top/back-top.d.ts +1 -1
- package/components/badge/badge.vue +1 -1
- package/components/button/button.d.ts +1 -0
- package/components/button/button.vue +2 -0
- package/components/button/common.d.ts +2 -0
- package/components/button/index.scss +6 -1
- package/components/calendar/calendar.d.ts +1 -1
- package/components/calendar/calendar.vue +49 -22
- package/components/calendar/index.scss +5 -5
- package/components/calendar/variables.scss +1 -1
- package/components/calendar-input/calendar-input.d.ts +1 -1
- package/components/calendar-month/index.scss +1 -0
- package/components/cascader/cascader.d.ts +6 -6
- package/components/cascader/cascader.vue +9 -4
- package/components/cascader/common.d.ts +3 -3
- package/components/cascader/index.scss +1 -0
- package/components/checkbox-input/checkbox-input.vue +59 -32
- package/components/checkbox-input/index.scss +4 -0
- package/components/config/index.d.ts +23 -0
- package/components/config/index.js +47 -18
- package/components/crop-image/common.d.ts +32 -0
- package/components/crop-image/common.js +2 -0
- package/components/crop-image/crop-image.d.ts +19 -0
- package/components/crop-image/crop-image.vue +671 -0
- package/components/crop-image/index.d.ts +1 -0
- package/components/crop-image/index.scss +81 -0
- package/components/crop-image-agent/common.d.ts +19 -0
- package/components/crop-image-agent/common.js +16 -0
- package/components/crop-image-agent/crop-image-agent.d.ts +9 -0
- package/components/crop-image-agent/crop-image-agent.vue +70 -0
- package/components/crop-image-agent/index.d.ts +1 -0
- package/components/crop-image-agent/index.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.vue +4 -4
- package/components/datetime-range-picker/datetime-range-picker.vue +4 -3
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +4 -4
- package/components/dialog/common.d.ts +2 -3
- package/components/dialog/dialog.d.ts +6 -13
- package/components/dialog/dialog.vue +15 -4
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dropdown-item/dropdown-item.vue +6 -6
- package/components/fab/fab.d.ts +1 -1
- package/components/floating-bubble/floating-bubble.vue +14 -19
- package/components/form-item/form-item.vue +4 -3
- package/components/grid/common.d.ts +4 -0
- package/components/grid-item/grid-item.vue +33 -18
- package/components/grid-item/index.scss +12 -4
- package/components/icon/index.scss +1 -0
- package/components/icon/sari.scss +9 -1
- package/components/indexes/common.d.ts +3 -5
- package/components/indexes/indexes.d.ts +2 -0
- package/components/indexes/indexes.vue +45 -109
- package/components/indexes-anchor/indexes-anchor.vue +9 -9
- package/components/indexes-nav/indexes-nav.vue +26 -22
- package/components/input/input.d.ts +4 -4
- package/components/loading/index.scss +1 -1
- package/components/locale/lang/en-US.d.ts +9 -0
- package/components/locale/lang/en-US.js +9 -0
- package/components/locale/lang/zh-CN.d.ts +9 -0
- package/components/locale/lang/zh-CN.js +9 -0
- package/components/navbar/common.d.ts +12 -0
- package/components/navbar/index.scss +17 -10
- package/components/navbar/navbar.d.ts +5 -1
- package/components/navbar/navbar.vue +45 -15
- package/components/navbar/variables.scss +4 -1
- package/components/navbar-item/index.scss +10 -0
- package/components/navbar-item/navbar-item.vue +27 -4
- package/components/navbar-pit/navbar-pit.d.ts +2 -0
- package/components/navbar-pit/navbar-pit.vue +22 -0
- package/components/notify/common.d.ts +1 -0
- package/components/notify/index.scss +12 -7
- package/components/notify/notify.vue +9 -3
- package/components/notify-agent/notify-agent.vue +9 -11
- package/components/pagination/pagination.d.ts +1 -1
- package/components/picker-input/picker-input.vue +4 -4
- package/components/popout/common.d.ts +2 -3
- package/components/popout/popout.d.ts +5 -12
- package/components/popout/popout.vue +16 -5
- package/components/popover/utils.js +2 -4
- package/components/popover-reference/popover-reference.vue +3 -3
- package/components/popup/common.d.ts +5 -3
- package/components/popup/index.scss +25 -3
- package/components/popup/popup.d.ts +1 -1
- package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
- package/components/qrcode/qrcode.d.ts +1 -1
- package/components/qrcode/qrcode.vue +4 -7
- package/components/radio-input/index.scss +5 -1
- package/components/radio-input/radio-input.vue +59 -32
- package/components/scroll-spy/common.d.ts +29 -0
- package/components/scroll-spy/common.js +1 -0
- package/components/scroll-spy/index.d.ts +1 -0
- package/components/scroll-spy/index.js +1 -0
- package/components/scroll-spy/scroll-spy.d.ts +28 -0
- package/components/scroll-spy/scroll-spy.vue +120 -0
- package/components/scroll-spy-anchor/common.d.ts +13 -0
- package/components/scroll-spy-anchor/index.d.ts +1 -0
- package/components/scroll-spy-anchor/index.js +1 -0
- package/components/scroll-spy-anchor/scroll-spy-anchor.d.ts +10 -0
- package/components/scroll-spy-anchor/scroll-spy-anchor.vue +50 -0
- package/components/search/search.vue +2 -0
- package/components/share-sheet/share-sheet.vue +3 -2
- package/components/sidebar/common.d.ts +28 -0
- package/components/sidebar/common.js +1 -0
- package/components/sidebar/index.d.ts +1 -0
- package/components/sidebar/index.js +1 -0
- package/components/sidebar/index.scss +15 -0
- package/components/sidebar/sidebar.d.ts +16 -0
- package/components/sidebar/sidebar.vue +136 -0
- package/components/sidebar/variables.scss +20 -0
- package/components/sidebar-item/common.d.ts +16 -0
- package/components/sidebar-item/common.js +1 -0
- package/components/sidebar-item/index.d.ts +1 -0
- package/components/sidebar-item/index.js +1 -0
- package/components/sidebar-item/index.scss +70 -0
- package/components/sidebar-item/sidebar-item.d.ts +14 -0
- package/components/sidebar-item/sidebar-item.vue +111 -0
- package/components/signature/common.d.ts +41 -0
- package/components/signature/common.js +2 -0
- package/components/signature/index.d.ts +1 -0
- package/components/signature/index.js +1 -0
- package/components/signature/index.scss +109 -0
- package/components/signature/signature.d.ts +32 -0
- package/components/signature/signature.vue +580 -0
- package/components/signature/variables-dark.scss +7 -0
- package/components/signature/variables.scss +9 -0
- package/components/status-bar/common.d.ts +17 -0
- package/components/status-bar/common.js +2 -0
- package/components/status-bar/index.d.ts +1 -0
- package/components/status-bar/index.js +1 -0
- package/components/status-bar/index.scss +7 -0
- package/components/status-bar/status-bar.d.ts +12 -0
- package/components/status-bar/status-bar.vue +56 -0
- package/components/style/mixins/ellipsis.scss +7 -0
- package/components/style/mixins/scroll-shadow.scss +40 -0
- package/components/style/mixins.scss +1 -0
- package/components/style/variables.scss +3 -0
- package/components/swiper-dot/swiper-dot.d.ts +1 -1
- package/components/tab/tab.vue +4 -3
- package/components/tabbar/common.d.ts +1 -0
- package/components/tabbar/tabbar.d.ts +2 -0
- package/components/tabbar/tabbar.vue +2 -1
- package/components/table-cell/index.scss +1 -2
- package/components/table-fixation/table-fixation.vue +16 -8
- package/components/tree/tree.vue +6 -4
- package/components/tree-node/tree-node.vue +12 -10
- package/components/upload/upload.vue +3 -2
- package/dark.scss +1 -0
- package/global.d.ts +9 -0
- package/index.d.ts +8 -0
- package/index.js +8 -0
- package/index.scss +2 -0
- package/package.json +28 -24
- package/use/index.d.ts +4 -0
- package/use/index.js +4 -0
- package/use/useDragPinch.d.ts +15 -0
- package/use/useDragPinch.js +88 -0
- package/use/useImperative.js +1 -0
- package/use/useInitialVelocity.d.ts +13 -0
- package/use/useInitialVelocity.js +65 -0
- package/use/useMouseDown.js +3 -4
- package/use/useScrollSide.d.ts +6 -0
- package/use/useScrollSide.js +34 -0
- package/use/useScrollSpy.d.ts +19 -0
- package/use/useScrollSpy.js +99 -0
- package/use/useTimeoutLoading.d.ts +6 -0
- package/use/useTimeoutLoading.js +53 -0
- package/use/useZIndex.js +7 -3
- package/utils/bem.d.ts +8 -8
- package/utils/dom.d.ts +3 -69
- package/utils/dom.js +32 -109
- package/utils/file.d.ts +1 -0
- package/utils/file.js +14 -0
- package/utils/geometry.d.ts +67 -0
- package/utils/geometry.js +127 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/inertialAnimate.d.ts +10 -0
- package/utils/inertialAnimate.js +42 -0
- package/utils/is.d.ts +8 -0
- package/utils/is.js +8 -0
- package/utils/system.d.ts +2 -0
- package/utils/system.js +6 -3
- package/utils/utils.d.ts +7 -0
- package/utils/utils.js +13 -0
- package/components/_template/_template.d.ts +0 -16
- package/components/_template/_template.vue +0 -45
- package/components/_template/common.d.ts +0 -14
- package/components/_template/index.d.ts +0 -1
- package/components/_template/index.scss +0 -17
- package/components/_template/variables.scss +0 -5
- /package/components/{_template → crop-image}/index.js +0 -0
- /package/components/{_template → scroll-spy-anchor}/common.js +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@use '../style/base' as *;
|
|
2
|
+
|
|
3
|
+
@include bem(crop-image) {
|
|
4
|
+
@include b() {
|
|
5
|
+
@include universal;
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
background-color: #000;
|
|
12
|
+
touch-action: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include e(sensor) {
|
|
16
|
+
position: absolute;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@include e(focus) {
|
|
22
|
+
position: absolute;
|
|
23
|
+
transition: transform 0.15s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include e(puppet) {
|
|
27
|
+
position: relative;
|
|
28
|
+
transform-origin: top left;
|
|
29
|
+
transition: transform 0.15s;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include e(image) {
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
left: 50%;
|
|
37
|
+
top: 50%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@include e(mask) {
|
|
41
|
+
position: absolute;
|
|
42
|
+
z-index: 10;
|
|
43
|
+
box-shadow: 0 0 0 9999vh rgba(45, 45, 45, 0.8);
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include e(toolbar) {
|
|
48
|
+
@include universal;
|
|
49
|
+
position: absolute;
|
|
50
|
+
left: 32rpx;
|
|
51
|
+
right: 32rpx;
|
|
52
|
+
bottom: calc(env(safe-area-inset-bottom) + 32rpx);
|
|
53
|
+
z-index: 20;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include e(canvas-wrapper) {
|
|
60
|
+
position: fixed;
|
|
61
|
+
left: 200vw;
|
|
62
|
+
width: 9999px;
|
|
63
|
+
height: 9999px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@include e(loading) {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
z-index: 30;
|
|
71
|
+
display: flex;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
font-size: 60rpx;
|
|
77
|
+
color: #fff;
|
|
78
|
+
background-color: var(--sar-mask-illegible);
|
|
79
|
+
touch-action: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CropImageProps } from '../crop-image/common';
|
|
2
|
+
export interface CropImageAgentProps extends CropImageProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
export type CropImageOptions = Omit<CropImageAgentProps, 'src'> & Required<Pick<CropImageAgentProps, 'src'>>;
|
|
6
|
+
export declare const defaultCropImageAgentProps: () => {
|
|
7
|
+
id: string;
|
|
8
|
+
duration: number;
|
|
9
|
+
cropScale: string;
|
|
10
|
+
type: "png";
|
|
11
|
+
quality: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const imperativeName = "cropImage";
|
|
14
|
+
export interface CropImageImperative {
|
|
15
|
+
show(newProps: Record<string, any>): void;
|
|
16
|
+
hide(): void;
|
|
17
|
+
}
|
|
18
|
+
declare const cropImage: (options: CropImageOptions) => void;
|
|
19
|
+
export { cropImage };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getAvailableImperative } from '../../use/useImperative';
|
|
2
|
+
import { defaultConfig } from '../config';
|
|
3
|
+
import { defaultCropImageProps } from '../crop-image/common';
|
|
4
|
+
export const defaultCropImageAgentProps = () => ({
|
|
5
|
+
...defaultCropImageProps,
|
|
6
|
+
...defaultConfig.cropImageAgent,
|
|
7
|
+
});
|
|
8
|
+
export const imperativeName = 'cropImage';
|
|
9
|
+
const cropImage = (options) => {
|
|
10
|
+
const { id = defaultConfig.cropImageAgent.id } = options;
|
|
11
|
+
const imperative = getAvailableImperative(imperativeName, id);
|
|
12
|
+
if (imperative) {
|
|
13
|
+
imperative.show(options);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export { cropImage };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CropImageAgentProps } from './common';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<CropImageAgentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CropImageAgentProps> & Readonly<{}>, {
|
|
3
|
+
type: "png" | "jpg";
|
|
4
|
+
id: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
cropScale: string;
|
|
7
|
+
quality: number;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sar-crop-image v-bind="innerProps" v-model:visible="innerProps.visible" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { computed, ref } from "vue";
|
|
8
|
+
import SarCropImage from "../crop-image/crop-image.vue";
|
|
9
|
+
import {
|
|
10
|
+
defaultCropImageAgentProps,
|
|
11
|
+
imperativeName
|
|
12
|
+
} from "./common";
|
|
13
|
+
import { useImperative } from "../../use/useImperative";
|
|
14
|
+
export default _defineComponent({
|
|
15
|
+
components: {
|
|
16
|
+
SarCropImage,
|
|
17
|
+
},
|
|
18
|
+
...{
|
|
19
|
+
options: {
|
|
20
|
+
virtualHost: true,
|
|
21
|
+
styleIsolation: "shared"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
__name: "crop-image-agent",
|
|
25
|
+
props: _mergeDefaults({
|
|
26
|
+
id: { type: String, required: false },
|
|
27
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
28
|
+
rootClass: { type: String, required: false },
|
|
29
|
+
visible: { type: Boolean, required: false },
|
|
30
|
+
src: { type: String, required: false },
|
|
31
|
+
cropScale: { type: String, required: false },
|
|
32
|
+
type: { type: String, required: false },
|
|
33
|
+
quality: { type: Number, required: false },
|
|
34
|
+
duration: { type: Number, required: false },
|
|
35
|
+
success: { type: Function, required: false },
|
|
36
|
+
fail: { type: Function, required: false },
|
|
37
|
+
complete: { type: Function, required: false },
|
|
38
|
+
beforeCrop: { type: Function, required: false },
|
|
39
|
+
cancelText: { type: String, required: false },
|
|
40
|
+
confirmText: { type: String, required: false }
|
|
41
|
+
}, defaultCropImageAgentProps()),
|
|
42
|
+
setup(__props, { expose: __expose }) {
|
|
43
|
+
__expose();
|
|
44
|
+
const props = __props;
|
|
45
|
+
const innerProps = ref({ ...props });
|
|
46
|
+
const imperative = {
|
|
47
|
+
show(newProps) {
|
|
48
|
+
innerProps.value = {
|
|
49
|
+
...props,
|
|
50
|
+
...newProps,
|
|
51
|
+
visible: true
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
hide() {
|
|
55
|
+
innerProps.value = {
|
|
56
|
+
...innerProps.value,
|
|
57
|
+
visible: false
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
useImperative(
|
|
62
|
+
imperativeName,
|
|
63
|
+
imperative,
|
|
64
|
+
computed(() => innerProps.value.id)
|
|
65
|
+
);
|
|
66
|
+
const __returned__ = { props, innerProps, imperative, SarCropImage };
|
|
67
|
+
return __returned__;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CropImageAgentProps, type CropImageOptions, cropImage, } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cropImage, } from './common';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@update:visible="onVisible"
|
|
18
18
|
:title="title ?? placeholder"
|
|
19
19
|
@confirm="onConfirm"
|
|
20
|
-
@
|
|
20
|
+
@enter="onEnter"
|
|
21
21
|
>
|
|
22
22
|
<template #visible="{ already }">
|
|
23
23
|
<sar-datetime-picker
|
|
@@ -105,8 +105,8 @@ export default _defineComponent({
|
|
|
105
105
|
const onChange = (value) => {
|
|
106
106
|
popoutValue.value = value;
|
|
107
107
|
};
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
108
|
+
const onEnter = () => {
|
|
109
|
+
if (!isNullish(innerValue.value) && popoutValue.value !== innerValue.value) {
|
|
110
110
|
popoutValue.value = innerValue.value;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
@@ -190,7 +190,7 @@ export default _defineComponent({
|
|
|
190
190
|
innerVisible.value = true;
|
|
191
191
|
emit("update:visible", true);
|
|
192
192
|
};
|
|
193
|
-
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange,
|
|
193
|
+
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange, onEnter, minDate, maxDate, normalizeValue, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarDatetimePicker };
|
|
194
194
|
return __returned__;
|
|
195
195
|
}
|
|
196
196
|
});
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<script>
|
|
35
35
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
36
|
-
import { computed, watch } from "vue";
|
|
36
|
+
import { computed, watch, ref } from "vue";
|
|
37
37
|
import {
|
|
38
38
|
classNames,
|
|
39
39
|
stringifyStyle,
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
toDate
|
|
43
43
|
} from "../../utils";
|
|
44
44
|
import SarDatetimePicker from "../datetime-picker/datetime-picker.vue";
|
|
45
|
+
import SarTabs from "../tabs/tabs.vue";
|
|
45
46
|
import {
|
|
46
47
|
defaultDatetimeRangePickerProps
|
|
47
48
|
} from "./common";
|
|
48
|
-
import { ref } from "vue";
|
|
49
49
|
import {
|
|
50
50
|
getInitialValue,
|
|
51
51
|
getMaxDate,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
export default _defineComponent({
|
|
55
55
|
components: {
|
|
56
56
|
SarDatetimePicker,
|
|
57
|
+
SarTabs,
|
|
57
58
|
},
|
|
58
59
|
...{
|
|
59
60
|
options: {
|
|
@@ -132,7 +133,7 @@ export default _defineComponent({
|
|
|
132
133
|
});
|
|
133
134
|
const __returned__ = { props, emit, bem, datetimePickerProps, tabsList, tabsCurrent, minDate, maxDate, startValue, endValue, parseValue, onChange, datetimeRangePickerClass, datetimeRangePickerStyle, get stringifyStyle() {
|
|
134
135
|
return stringifyStyle;
|
|
135
|
-
}, SarDatetimePicker };
|
|
136
|
+
}, SarDatetimePicker, SarTabs };
|
|
136
137
|
return __returned__;
|
|
137
138
|
}
|
|
138
139
|
});
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@update:visible="onVisible"
|
|
18
18
|
:title="title ?? placeholder"
|
|
19
19
|
@confirm="onConfirm"
|
|
20
|
-
@
|
|
20
|
+
@enter="onEnter"
|
|
21
21
|
>
|
|
22
22
|
<template #visible="{ already }">
|
|
23
23
|
<sar-datetime-range-picker
|
|
@@ -108,8 +108,8 @@ export default _defineComponent({
|
|
|
108
108
|
const onChange = (value) => {
|
|
109
109
|
popoutValue.value = value;
|
|
110
110
|
};
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
111
|
+
const onEnter = () => {
|
|
112
|
+
if (!isNullish(innerValue.value) && popoutValue.value !== innerValue.value) {
|
|
113
113
|
popoutValue.value = innerValue.value;
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -187,7 +187,7 @@ export default _defineComponent({
|
|
|
187
187
|
innerVisible.value = true;
|
|
188
188
|
emit("update:visible", true);
|
|
189
189
|
};
|
|
190
|
-
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange,
|
|
190
|
+
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange, onEnter, minDate, maxDate, onConfirm, inputValue, t, getOutletTextMayByStr, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarDatetimeRangePicker };
|
|
191
191
|
return __returned__;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type StyleValue } from 'vue';
|
|
2
|
-
import { type TransitionHookName } from '../../use';
|
|
3
2
|
import { type ButtonProps } from '../button';
|
|
3
|
+
import { type TransitionHookEmits } from '../popup/common';
|
|
4
4
|
export interface DialogProps {
|
|
5
5
|
rootStyle?: StyleValue;
|
|
6
6
|
rootClass?: string;
|
|
@@ -31,10 +31,9 @@ export declare const defaultDialogProps: {
|
|
|
31
31
|
export interface DialogSlots {
|
|
32
32
|
default?(props: Record<string, never>): any;
|
|
33
33
|
}
|
|
34
|
-
export interface DialogEmits {
|
|
34
|
+
export interface DialogEmits extends TransitionHookEmits {
|
|
35
35
|
(e: 'update:visible', visible: boolean): void;
|
|
36
36
|
(e: 'close'): void;
|
|
37
37
|
(e: 'cancel'): void;
|
|
38
38
|
(e: 'confirm'): void;
|
|
39
|
-
(e: 'visible-hook', name: TransitionHookName): void;
|
|
40
39
|
}
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import { type DialogProps, type DialogSlots } from './common';
|
|
2
|
-
import { type TransitionHookName } from '../../use';
|
|
3
2
|
declare function __VLS_template(): Readonly<DialogSlots> & DialogSlots;
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<DialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"update:visible": (visible: boolean) => any;
|
|
9
|
-
"visible-hook": (name: TransitionHookName) => any;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<DialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
} & {
|
|
6
|
+
[x: string]: any;
|
|
10
7
|
}, string, import("vue").PublicProps, Readonly<DialogProps> & Readonly<{
|
|
11
|
-
|
|
12
|
-
onClose?: (() => any) | undefined;
|
|
13
|
-
onConfirm?: (() => any) | undefined;
|
|
14
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
15
|
-
"onVisible-hook"?: ((name: TransitionHookName) => any) | undefined;
|
|
8
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
16
9
|
}>, {
|
|
17
10
|
buttonType: "round" | "text";
|
|
18
11
|
duration: number;
|
|
19
12
|
overlayClosable: boolean;
|
|
13
|
+
showCancel: boolean;
|
|
20
14
|
showConfirm: boolean;
|
|
21
15
|
headed: boolean;
|
|
22
|
-
showCancel: boolean;
|
|
23
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
25
18
|
export default _default;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
type="pale-text"
|
|
18
18
|
theme="neutral"
|
|
19
19
|
size="large"
|
|
20
|
+
block
|
|
20
21
|
@click="onClose"
|
|
21
22
|
>
|
|
22
23
|
<sar-icon name="close" />
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
:theme="buttonProps.cancel.theme"
|
|
44
45
|
:size="buttonProps.cancel.size"
|
|
45
46
|
:round="buttonProps.confirm.round"
|
|
47
|
+
block
|
|
46
48
|
v-bind="cancelProps"
|
|
47
49
|
@click="onCancel"
|
|
48
50
|
>
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
:theme="buttonProps.confirm.theme"
|
|
61
63
|
:size="buttonProps.confirm.size"
|
|
62
64
|
:round="buttonProps.confirm.round"
|
|
65
|
+
block
|
|
63
66
|
v-bind="confirmProps"
|
|
64
67
|
@click="onConfirm"
|
|
65
68
|
>
|
|
@@ -73,7 +76,14 @@
|
|
|
73
76
|
<script>
|
|
74
77
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
75
78
|
import { computed, ref, watch } from "vue";
|
|
76
|
-
import {
|
|
79
|
+
import {
|
|
80
|
+
classNames,
|
|
81
|
+
stringifyStyle,
|
|
82
|
+
createBem,
|
|
83
|
+
noop,
|
|
84
|
+
isObject,
|
|
85
|
+
isFunction
|
|
86
|
+
} from "../../utils";
|
|
77
87
|
import { useTranslate } from "../locale";
|
|
78
88
|
import SarPopup from "../popup/popup.vue";
|
|
79
89
|
import SarButton from "../button/button.vue";
|
|
@@ -113,7 +123,7 @@ export default _defineComponent({
|
|
|
113
123
|
confirmProps: { type: Object, required: false },
|
|
114
124
|
id: { type: String, required: false }
|
|
115
125
|
}, defaultDialogProps),
|
|
116
|
-
emits: ["update:visible", "close", "cancel", "confirm", "visible-hook"],
|
|
126
|
+
emits: ["update:visible", "close", "cancel", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
117
127
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
118
128
|
__expose();
|
|
119
129
|
const props = __props;
|
|
@@ -134,9 +144,9 @@ export default _defineComponent({
|
|
|
134
144
|
});
|
|
135
145
|
const perhapsClose = (type) => {
|
|
136
146
|
emit(type);
|
|
137
|
-
if (
|
|
147
|
+
if (isFunction(props.beforeClose)) {
|
|
138
148
|
const result = props.beforeClose(type);
|
|
139
|
-
if (result
|
|
149
|
+
if (isObject(result) && isFunction(result.then)) {
|
|
140
150
|
loading.value[type] = true;
|
|
141
151
|
return result.then(() => {
|
|
142
152
|
innerVisible.value = false;
|
|
@@ -195,6 +205,7 @@ export default _defineComponent({
|
|
|
195
205
|
});
|
|
196
206
|
const onVisibleHook = (name) => {
|
|
197
207
|
emit("visible-hook", name);
|
|
208
|
+
emit(name);
|
|
198
209
|
};
|
|
199
210
|
const dialogClass = computed(() => {
|
|
200
211
|
return classNames(
|
|
@@ -4,8 +4,8 @@ declare const _default: import("vue").DefineComponent<DialogAgentProps, {}, {},
|
|
|
4
4
|
buttonType: "round" | "text";
|
|
5
5
|
duration: number;
|
|
6
6
|
overlayClosable: boolean;
|
|
7
|
+
showCancel: boolean;
|
|
7
8
|
showConfirm: boolean;
|
|
8
9
|
headed: boolean;
|
|
9
|
-
showCancel: boolean;
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
export default _default;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<view
|
|
3
3
|
:class="dropdownItemClass"
|
|
4
4
|
:style="dropdownItemStyle"
|
|
5
|
-
:id="itemId"
|
|
6
5
|
@click="onItemClick"
|
|
7
6
|
>
|
|
8
7
|
<view v-if="label" :class="bem.e('label')">
|
|
@@ -173,8 +172,8 @@ export default _defineComponent({
|
|
|
173
172
|
const popupInset = ref("");
|
|
174
173
|
const awayInset = ref("");
|
|
175
174
|
const setPosition = async () => {
|
|
176
|
-
const
|
|
177
|
-
const itemRect = await getBoundingClientRect(
|
|
175
|
+
const { windowHeight } = getWindowInfo();
|
|
176
|
+
const itemRect = await getBoundingClientRect(`.${itemId}`, instance);
|
|
178
177
|
const nextPopupInset = {
|
|
179
178
|
left: 0,
|
|
180
179
|
right: 0,
|
|
@@ -191,10 +190,10 @@ export default _defineComponent({
|
|
|
191
190
|
nextPopupInset.top = `calc(${itemRect.bottom}px + var(--window-top))`;
|
|
192
191
|
nextPopupInset.bottom = 0;
|
|
193
192
|
nextAwayInset.top = 0;
|
|
194
|
-
nextAwayInset.bottom = `calc(${
|
|
193
|
+
nextAwayInset.bottom = `calc(${windowHeight - itemRect.bottom}px + var(--window-top))`;
|
|
195
194
|
} else {
|
|
196
195
|
nextPopupInset.top = 0;
|
|
197
|
-
nextPopupInset.bottom = `${
|
|
196
|
+
nextPopupInset.bottom = `${windowHeight - itemRect.top}px`;
|
|
198
197
|
nextAwayInset.top = `calc(${itemRect.bottom}px + var(--window-top))`;
|
|
199
198
|
nextAwayInset.bottom = 0;
|
|
200
199
|
}
|
|
@@ -259,7 +258,8 @@ export default _defineComponent({
|
|
|
259
258
|
bem.m(context.direction),
|
|
260
259
|
bem.m("show", wholeVisible.value),
|
|
261
260
|
bem.m("disabled", context.disabled || props.disabled),
|
|
262
|
-
props.rootClass
|
|
261
|
+
props.rootClass,
|
|
262
|
+
itemId
|
|
263
263
|
);
|
|
264
264
|
});
|
|
265
265
|
const dropdownItemStyle = computed(() => {
|
package/components/fab/fab.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<FabProps, {}, {}, {}, {},
|
|
|
8
8
|
}>, {
|
|
9
9
|
duration: number;
|
|
10
10
|
overlayClosable: boolean;
|
|
11
|
-
hideName: boolean;
|
|
12
11
|
itemList: FabItem[];
|
|
12
|
+
hideName: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
|
-
:id="bubbleId"
|
|
4
3
|
:class="floatingBubbleClass"
|
|
5
4
|
:style="floatingBubbleStyle"
|
|
6
5
|
@touchstart="onTouchStart"
|
|
@@ -56,7 +55,7 @@ export default _defineComponent({
|
|
|
56
55
|
const instance = getCurrentInstance();
|
|
57
56
|
const bubbleId = uniqid();
|
|
58
57
|
let bubbleRect;
|
|
59
|
-
|
|
58
|
+
const { windowWidth, windowHeight } = getWindowInfo();
|
|
60
59
|
let downCoord = {
|
|
61
60
|
x: 0,
|
|
62
61
|
y: 0
|
|
@@ -82,17 +81,16 @@ export default _defineComponent({
|
|
|
82
81
|
return props.gapX;
|
|
83
82
|
}
|
|
84
83
|
function getMaxX() {
|
|
85
|
-
return
|
|
84
|
+
return windowWidth - props.gapX - bubbleRect.width;
|
|
86
85
|
}
|
|
87
86
|
function getMinY() {
|
|
88
|
-
return props.gapY +
|
|
87
|
+
return props.gapY + 44 + 25;
|
|
89
88
|
}
|
|
90
89
|
function getMaxY() {
|
|
91
|
-
return
|
|
90
|
+
return windowHeight - props.gapY - bubbleRect.height;
|
|
92
91
|
}
|
|
93
92
|
onMounted(async () => {
|
|
94
|
-
|
|
95
|
-
bubbleRect = await getBoundingClientRect(`#${bubbleId}`, instance);
|
|
93
|
+
bubbleRect = await getBoundingClientRect(`.${bubbleId}`, instance);
|
|
96
94
|
position.value = props.offset ?? {
|
|
97
95
|
x: getMaxX(),
|
|
98
96
|
y: getMaxY()
|
|
@@ -107,10 +105,10 @@ export default _defineComponent({
|
|
|
107
105
|
x: event.touches[0].clientX,
|
|
108
106
|
y: event.touches[0].clientY
|
|
109
107
|
};
|
|
110
|
-
bubbleRect = await getBoundingClientRect(
|
|
108
|
+
bubbleRect = await getBoundingClientRect(`.${bubbleId}`, instance);
|
|
111
109
|
};
|
|
112
110
|
const onTouchMove = (event) => {
|
|
113
|
-
if (!bubbleRect
|
|
111
|
+
if (!bubbleRect) {
|
|
114
112
|
return;
|
|
115
113
|
}
|
|
116
114
|
let x = 0;
|
|
@@ -122,7 +120,7 @@ export default _defineComponent({
|
|
|
122
120
|
const deltaX = event.touches[0].clientX - downCoord.x;
|
|
123
121
|
const deltaY = event.touches[0].clientY - downCoord.y;
|
|
124
122
|
x = bubbleRect.left + deltaX;
|
|
125
|
-
y = bubbleRect.top + deltaY
|
|
123
|
+
y = bubbleRect.top + deltaY;
|
|
126
124
|
x = minmax(x, getMinX(), getMaxX());
|
|
127
125
|
y = minmax(y, getMinY(), getMaxY());
|
|
128
126
|
if (props.axis === "y") {
|
|
@@ -139,13 +137,13 @@ export default _defineComponent({
|
|
|
139
137
|
emit("update:offset", offset);
|
|
140
138
|
};
|
|
141
139
|
const onTouchEnd = () => {
|
|
142
|
-
if (
|
|
140
|
+
if (bubbleRect) {
|
|
143
141
|
if (props.magnet) {
|
|
144
142
|
let { x, y } = position.value;
|
|
145
143
|
if (props.magnet === "x") {
|
|
146
|
-
x = x < (
|
|
144
|
+
x = x < (windowWidth - bubbleRect.width) / 2 ? getMinX() : getMaxX();
|
|
147
145
|
} else if (props.magnet === "y") {
|
|
148
|
-
y = y < (
|
|
146
|
+
y = y < (windowHeight - bubbleRect.height) / 2 ? getMinY() : getMaxY();
|
|
149
147
|
}
|
|
150
148
|
const offset = {
|
|
151
149
|
x,
|
|
@@ -168,7 +166,8 @@ export default _defineComponent({
|
|
|
168
166
|
bem.b(),
|
|
169
167
|
bem.m("animated", animated.value),
|
|
170
168
|
bem.m("initialized", initialized.value),
|
|
171
|
-
props.rootClass
|
|
169
|
+
props.rootClass,
|
|
170
|
+
bubbleId
|
|
172
171
|
);
|
|
173
172
|
});
|
|
174
173
|
const floatingBubbleStyle = computed(() => {
|
|
@@ -180,11 +179,7 @@ export default _defineComponent({
|
|
|
180
179
|
return bubbleRect;
|
|
181
180
|
}, set bubbleRect(v) {
|
|
182
181
|
bubbleRect = v;
|
|
183
|
-
}, get
|
|
184
|
-
return windowInfo;
|
|
185
|
-
}, set windowInfo(v) {
|
|
186
|
-
windowInfo = v;
|
|
187
|
-
}, get downCoord() {
|
|
182
|
+
}, windowWidth, windowHeight, get downCoord() {
|
|
188
183
|
return downCoord;
|
|
189
184
|
}, set downCoord(v) {
|
|
190
185
|
downCoord = v;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view :class="formItemClass" :style="formItemStyle"
|
|
2
|
+
<view :class="formItemClass" :style="formItemStyle">
|
|
3
3
|
<view
|
|
4
4
|
v-if="$slots.label || !isNullish(label)"
|
|
5
5
|
:class="bem.e('label')"
|
|
@@ -213,7 +213,7 @@ export default _defineComponent({
|
|
|
213
213
|
const scrollToField = async () => {
|
|
214
214
|
const [scrollInfo, fieldRect, windowInfo] = await Promise.all([
|
|
215
215
|
getViewportScrollInfo(),
|
|
216
|
-
getBoundingClientRect(
|
|
216
|
+
getBoundingClientRect(`.${fieldId}`, instance),
|
|
217
217
|
getWindowInfo()
|
|
218
218
|
]);
|
|
219
219
|
const scrollTop = getScrollIntoViewValue(
|
|
@@ -272,7 +272,8 @@ export default _defineComponent({
|
|
|
272
272
|
bem.m(`align-${props.labelAlign || formContext.labelAlign}`),
|
|
273
273
|
bem.m(`valign-${props.labelValign || formContext.labelValign}`),
|
|
274
274
|
bem.m(`star-${props.starPosition || formContext.starPosition}`),
|
|
275
|
-
props.rootClass
|
|
275
|
+
props.rootClass,
|
|
276
|
+
fieldId
|
|
276
277
|
);
|
|
277
278
|
});
|
|
278
279
|
const formItemStyle = computed(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type StyleValue } from 'vue';
|
|
2
|
+
import { type BadgeProps } from '../badge';
|
|
2
3
|
export interface GridProps {
|
|
3
4
|
rootStyle?: StyleValue;
|
|
4
5
|
rootClass?: string;
|
|
@@ -27,6 +28,9 @@ export interface GridItemProps {
|
|
|
27
28
|
iconSize?: string;
|
|
28
29
|
iconColor?: string;
|
|
29
30
|
iconFamily?: string;
|
|
31
|
+
dot?: boolean;
|
|
32
|
+
badge?: number | string;
|
|
33
|
+
badgeProps?: BadgeProps;
|
|
30
34
|
}
|
|
31
35
|
export interface GridItemSlots {
|
|
32
36
|
default?(props: Record<string, never>): any;
|