@puresnake/snake-ui 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/changelog.md +83 -0
- package/components/snake-activity-list/snake-activity-list.vue +365 -0
- package/components/snake-activity-list/types.ts +29 -0
- package/components/snake-auxiliary-segmentation/snake-auxiliary-segmentation.vue +44 -0
- package/components/snake-auxiliary-segmentation/types.ts +5 -0
- package/components/snake-button/snake-button.vue +357 -0
- package/components/snake-button/types.ts +103 -0
- package/components/snake-button-sort/snake-button-sort.vue +72 -0
- package/components/snake-button-sort/types.ts +22 -0
- package/components/snake-calendar/snake-calendar.vue +998 -0
- package/components/snake-calendar/types.ts +189 -0
- package/components/snake-cell-group/snake-cell-group.vue +55 -0
- package/components/snake-cell-group/types.ts +19 -0
- package/components/snake-cell-item/snake-cell-item.vue +159 -0
- package/components/snake-cell-item/types.ts +66 -0
- package/components/snake-checkbox/snake-checkbox.vue +264 -0
- package/components/snake-checkbox/types.ts +70 -0
- package/components/snake-checkbox-group/snake-checkbox-group.vue +154 -0
- package/components/snake-checkbox-group/types.ts +52 -0
- package/components/snake-cms/blocks/v2/cms-v2-carousel.vue +87 -0
- package/components/snake-cms/blocks/v2/cms-v2-coupon.vue +25 -0
- package/components/snake-cms/blocks/v2/cms-v2-custom.vue +12 -0
- package/components/snake-cms/blocks/v2/cms-v2-divider.vue +33 -0
- package/components/snake-cms/blocks/v2/cms-v2-floatbutton.vue +28 -0
- package/components/snake-cms/blocks/v2/cms-v2-goods-list.vue +150 -0
- package/components/snake-cms/blocks/v2/cms-v2-hotzone.vue +41 -0
- package/components/snake-cms/blocks/v2/cms-v2-images.vue +41 -0
- package/components/snake-cms/blocks/v2/cms-v2-magiccube.vue +93 -0
- package/components/snake-cms/blocks/v2/cms-v2-notice.vue +80 -0
- package/components/snake-cms/blocks/v2/cms-v2-popup.vue +46 -0
- package/components/snake-cms/blocks/v2/cms-v2-richtext.vue +18 -0
- package/components/snake-cms/blocks/v2/cms-v2-search.vue +115 -0
- package/components/snake-cms/blocks/v2/cms-v2-video.vue +25 -0
- package/components/snake-cms/blocks/v2/shared.ts +84 -0
- package/components/snake-cms/snake-cms.vue +409 -0
- package/components/snake-cms/types.ts +50 -0
- package/components/snake-commodity-search/snake-commodity-search.vue +234 -0
- package/components/snake-commodity-search/types.ts +11 -0
- package/components/snake-config-provider/snake-config-provider.vue +61 -0
- package/components/snake-config-provider/types.ts +22 -0
- package/components/snake-count-down/snake-count-down.vue +231 -0
- package/components/snake-count-down/types.ts +103 -0
- package/components/snake-coupon/snake-coupon.vue +209 -0
- package/components/snake-coupon/types.ts +21 -0
- package/components/snake-custom-module/snake-custom-module.vue +25 -0
- package/components/snake-custom-module/types.ts +11 -0
- package/components/snake-drop-menu/snake-drop-menu.vue +123 -0
- package/components/snake-drop-menu/types.ts +95 -0
- package/components/snake-drop-menu-item/snake-drop-menu-item.vue +181 -0
- package/components/snake-drop-menu-item/types.ts +48 -0
- package/components/snake-empty/snake-empty.vue +100 -0
- package/components/snake-empty/types.ts +48 -0
- package/components/snake-filter-sorts/filter-page.vue +695 -0
- package/components/snake-filter-sorts/snake-filter-sorts.vue +185 -0
- package/components/snake-filter-sorts/types.ts +57 -0
- package/components/snake-floating-bubble/snake-floating-bubble.vue +157 -0
- package/components/snake-floating-bubble/types.ts +43 -0
- package/components/snake-follow/snake-follow.vue +18 -0
- package/components/snake-follow/types.ts +2 -0
- package/components/snake-form/snake-form.vue +124 -0
- package/components/snake-form/types.ts +96 -0
- package/components/snake-form-item/snake-form-item.vue +331 -0
- package/components/snake-form-item/types.ts +70 -0
- package/components/snake-goods-list/snake-goods-list.vue +792 -0
- package/components/snake-goods-list/types.ts +55 -0
- package/components/snake-graphic-navigation/snake-graphic-navigation.vue +198 -0
- package/components/snake-graphic-navigation/types.ts +43 -0
- package/components/snake-icon/icon-names.ts +222 -0
- package/components/snake-icon/snake-icon.vue +220 -0
- package/components/snake-icon/types.ts +45 -0
- package/components/snake-image/snake-image.vue +230 -0
- package/components/snake-image/types.ts +70 -0
- package/components/snake-images/snake-images.vue +80 -0
- package/components/snake-images/types.ts +5 -0
- package/components/snake-index-anchor/snake-index-anchor.vue +83 -0
- package/components/snake-index-anchor/types.ts +14 -0
- package/components/snake-index-list/anchor-registry.ts +80 -0
- package/components/snake-index-list/snake-index-list.vue +259 -0
- package/components/snake-index-list/types.ts +115 -0
- package/components/snake-index-list-panel/snake-index-list-panel.vue +277 -0
- package/components/snake-index-list-panel/types.ts +10 -0
- package/components/snake-input/snake-input.vue +225 -0
- package/components/snake-input/types.ts +99 -0
- package/components/snake-jump-applet/snake-jump-applet.vue +99 -0
- package/components/snake-jump-applet/types.ts +17 -0
- package/components/snake-line/snake-line.vue +42 -0
- package/components/snake-line/types.ts +30 -0
- package/components/snake-line-progress/snake-line-progress.vue +105 -0
- package/components/snake-line-progress/types.ts +26 -0
- package/components/snake-link/snake-link.vue +74 -0
- package/components/snake-link/types.ts +30 -0
- package/components/snake-list-switching/components/tree-select/index.vue +156 -0
- package/components/snake-list-switching/snake-list-switching.vue +1285 -0
- package/components/snake-list-switching/types.ts +11 -0
- package/components/snake-loading/snake-loading.vue +241 -0
- package/components/snake-loading/types.ts +34 -0
- package/components/snake-loadmore/snake-loadmore.vue +103 -0
- package/components/snake-loadmore/types.ts +56 -0
- package/components/snake-magic-cube/snake-magic-cube.vue +622 -0
- package/components/snake-magic-cube/types.ts +5 -0
- package/components/snake-modal/snake-modal.vue +434 -0
- package/components/snake-modal/types.ts +71 -0
- package/components/snake-navbar/snake-navbar.vue +194 -0
- package/components/snake-navbar/types.ts +54 -0
- package/components/snake-no-network/snake-no-network.vue +125 -0
- package/components/snake-no-network/types.ts +27 -0
- package/components/snake-notice/snake-notice.vue +44 -0
- package/components/snake-notice/types.ts +5 -0
- package/components/snake-notice-bar/snake-notice-bar.vue +336 -0
- package/components/snake-notice-bar/types.ts +82 -0
- package/components/snake-overlay/snake-overlay.vue +73 -0
- package/components/snake-overlay/types.ts +35 -0
- package/components/snake-page-popup/snake-page-popup.vue +146 -0
- package/components/snake-page-popup/types.ts +28 -0
- package/components/snake-parse/audio/audio.vue +286 -0
- package/components/snake-parse/audio/context.js +11 -0
- package/components/snake-parse/audio/index.js +34 -0
- package/components/snake-parse/node/node.vue +830 -0
- package/components/snake-parse/parser.js +1480 -0
- package/components/snake-parse/snake-parse.vue +548 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/handler.js +109 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.js +0 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.min.js +1 -0
- package/components/snake-parse/static/app-plus/snake-parse/local.html +3 -0
- package/components/snake-parse/style/index.js +132 -0
- package/components/snake-parse/style/parser.js +175 -0
- package/components/snake-parse/types.ts +49 -0
- package/components/snake-picture-ads/snake-picture-ads.vue +292 -0
- package/components/snake-picture-ads/types.ts +5 -0
- package/components/snake-popup/snake-popup.vue +348 -0
- package/components/snake-popup/types.ts +88 -0
- package/components/snake-qr-code/qrcode.ts +1214 -0
- package/components/snake-qr-code/snake-qr-code.vue +408 -0
- package/components/snake-qr-code/types.ts +78 -0
- package/components/snake-radio/snake-radio.vue +271 -0
- package/components/snake-radio/types.ts +64 -0
- package/components/snake-radio-group/snake-radio-group.vue +98 -0
- package/components/snake-radio-group/types.ts +48 -0
- package/components/snake-read-more/snake-read-more.vue +140 -0
- package/components/snake-read-more/types.ts +53 -0
- package/components/snake-rich-text/snake-rich-text.vue +24 -0
- package/components/snake-rich-text/types.ts +5 -0
- package/components/snake-root-portal/snake-root-portal.vue +92 -0
- package/components/snake-root-portal/types.ts +9 -0
- package/components/snake-search/snake-search.vue +202 -0
- package/components/snake-search/types.ts +84 -0
- package/components/snake-select/snake-select.vue +371 -0
- package/components/snake-select/types.ts +75 -0
- package/components/snake-skeleton/snake-skeleton.vue +104 -0
- package/components/snake-skeleton/types.ts +32 -0
- package/components/snake-skeleton-item/snake-skeleton-item.vue +90 -0
- package/components/snake-skeleton-item/types.ts +30 -0
- package/components/snake-slider/snake-slider.vue +249 -0
- package/components/snake-slider/types.ts +59 -0
- package/components/snake-sticky/snake-sticky.vue +178 -0
- package/components/snake-sticky/types.ts +48 -0
- package/components/snake-subsection/snake-subsection.vue +188 -0
- package/components/snake-subsection/types.ts +54 -0
- package/components/snake-swiper/snake-swiper.vue +229 -0
- package/components/snake-swiper/types.ts +79 -0
- package/components/snake-switch/snake-switch.vue +100 -0
- package/components/snake-switch/types.ts +41 -0
- package/components/snake-tabbar/snake-tabbar.vue +306 -0
- package/components/snake-tabbar/types.ts +93 -0
- package/components/snake-tabs/snake-tabs.vue +305 -0
- package/components/snake-tabs/types.ts +79 -0
- package/components/snake-text/snake-text.vue +292 -0
- package/components/snake-text/types.ts +100 -0
- package/components/snake-textarea/snake-textarea.vue +171 -0
- package/components/snake-textarea/types.ts +79 -0
- package/components/snake-toast/snake-toast.vue +330 -0
- package/components/snake-toast/types.ts +55 -0
- package/components/snake-tooltip/position.ts +33 -0
- package/components/snake-tooltip/snake-tooltip.vue +339 -0
- package/components/snake-tooltip/types.ts +80 -0
- package/components/snake-transition/snake-transition.vue +315 -0
- package/components/snake-transition/types.ts +65 -0
- package/components/snake-upload/snake-upload.vue +1801 -0
- package/components/snake-upload/types.ts +256 -0
- package/components/snake-videos/snake-videos.vue +122 -0
- package/components/snake-videos/types.ts +7 -0
- package/iconfont.css +881 -0
- package/index.d.ts +7 -0
- package/index.scss +26 -0
- package/index.ts +94 -0
- package/libs/cms/blocks.ts +103 -0
- package/libs/cms/config.ts +25 -0
- package/libs/cms/index.ts +7 -0
- package/libs/cms/normalize.ts +135 -0
- package/libs/cms/resolve.ts +12 -0
- package/libs/cms/types.ts +164 -0
- package/libs/cms/use-commerce.ts +385 -0
- package/libs/cms/v2.ts +193 -0
- package/libs/config/index.ts +4 -0
- package/libs/config/modal.ts +93 -0
- package/libs/config/state.ts +33 -0
- package/libs/config/theme.ts +351 -0
- package/libs/config/toast.ts +71 -0
- package/libs/config/types.ts +135 -0
- package/libs/config/zIndex.ts +44 -0
- package/libs/css/color.scss +105 -0
- package/libs/css/common.scss +171 -0
- package/libs/css/style.h5.scss +7 -0
- package/libs/css/style.mp.scss +7 -0
- package/libs/css/style.theme.scss +70 -0
- package/libs/css/style.vue.scss +140 -0
- package/libs/form/async-validator.min.d.ts +75 -0
- package/libs/form/async-validator.min.js +3 -0
- package/libs/form/index.ts +3 -0
- package/libs/form/path.ts +40 -0
- package/libs/form/types.ts +51 -0
- package/libs/form/validate.ts +149 -0
- package/libs/foundation.ts +96 -0
- package/libs/function/$parent.ts +33 -0
- package/libs/function/clipboard.ts +13 -0
- package/libs/function/color.ts +55 -0
- package/libs/function/debounce.ts +34 -0
- package/libs/function/deepClone.ts +30 -0
- package/libs/function/deepMerge.ts +25 -0
- package/libs/function/emitter.ts +30 -0
- package/libs/function/format.ts +27 -0
- package/libs/function/getParent.ts +53 -0
- package/libs/function/getRect.ts +29 -0
- package/libs/function/guid.ts +11 -0
- package/libs/function/index.ts +31 -0
- package/libs/function/queryParams.ts +73 -0
- package/libs/function/random.ts +6 -0
- package/libs/function/randomArray.ts +14 -0
- package/libs/function/route.ts +155 -0
- package/libs/function/sleep.ts +7 -0
- package/libs/function/style.ts +58 -0
- package/libs/function/styleUtils.ts +83 -0
- package/libs/function/system.ts +14 -0
- package/libs/function/test.ts +202 -0
- package/libs/function/throttle.ts +36 -0
- package/libs/function/timeFormat.ts +27 -0
- package/libs/function/timeFrom.ts +27 -0
- package/libs/function/toast.ts +10 -0
- package/libs/function/trim.ts +11 -0
- package/libs/function/type2icon.ts +11 -0
- package/libs/function/unit.ts +45 -0
- package/libs/hooks/index.ts +11 -0
- package/libs/hooks/useChildren.ts +125 -0
- package/libs/hooks/useColor.ts +5 -0
- package/libs/hooks/useDebounce.ts +5 -0
- package/libs/hooks/useLocale.ts +13 -0
- package/libs/hooks/useModal.ts +131 -0
- package/libs/hooks/useParent.ts +62 -0
- package/libs/hooks/useRect.ts +44 -0
- package/libs/hooks/useRouter.ts +5 -0
- package/libs/hooks/useTheme.ts +31 -0
- package/libs/hooks/useThrottle.ts +5 -0
- package/libs/hooks/useToast.ts +116 -0
- package/libs/index.ts +18 -0
- package/libs/request/auto-http.ts +1 -0
- package/libs/request/index.ts +343 -0
- package/libs/runtime/accessors.ts +55 -0
- package/libs/runtime/context.ts +40 -0
- package/libs/runtime/index.ts +18 -0
- package/libs/runtime/types.ts +49 -0
- package/libs/util/calendar.ts +6 -0
- package/locale/index.ts +130 -0
- package/locale/lang/en-US.ts +67 -0
- package/locale/lang/zh-CN.ts +67 -0
- package/package.json +134 -5
- package/plugins/index.ts +1 -0
- package/plugins/root/README.md +86 -0
- package/plugins/root/index.ts +123 -0
- package/plugins/root/page.ts +77 -0
- package/plugins/root/root.ts +53 -0
- package/plugins/root/utils.ts +137 -0
- package/readme.md +79 -0
- package/theme.scss +118 -0
- package/types/components.d.ts +236 -0
- package/types/global.d.ts +21 -0
- package/types/index.d.ts +6 -0
- package/types/uni-app.d.ts +16 -0
- package/README.md +0 -3
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
id="snake-wave-btn"
|
|
4
|
+
class="snake-button snake-line-1 snake-fix-ios-appearance"
|
|
5
|
+
data-eventsync="true"
|
|
6
|
+
:class="[
|
|
7
|
+
`snake-size-${size}`,
|
|
8
|
+
plain ? `snake-button--${type}--plain` : '',
|
|
9
|
+
loading ? 'snake-loading' : '',
|
|
10
|
+
shape === 'circle' ? 'snake-round-circle' : '',
|
|
11
|
+
hairLine ? hairLineClass : 'snake-button--bold-border',
|
|
12
|
+
`snake-button--${type}`,
|
|
13
|
+
disabled ? `snake-button--${type}--disabled` : '',
|
|
14
|
+
customClass
|
|
15
|
+
]"
|
|
16
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
17
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
:form-type="formType || undefined"
|
|
20
|
+
:open-type="disabled || loading ? undefined : openType || undefined"
|
|
21
|
+
:app-parameter="appParameter"
|
|
22
|
+
:hover-stop-propagation="hoverStopPropagation"
|
|
23
|
+
:send-message-title="sendMessageTitle"
|
|
24
|
+
:send-message-path="sendMessagePath"
|
|
25
|
+
:lang="lang"
|
|
26
|
+
:data-name="dataName"
|
|
27
|
+
:session-from="sessionFrom"
|
|
28
|
+
:send-message-img="sendMessageImg"
|
|
29
|
+
:show-message-card="showMessageCard"
|
|
30
|
+
:style="rootStyle"
|
|
31
|
+
:hover-class="hoverClassName"
|
|
32
|
+
:loading="loading"
|
|
33
|
+
@tap.stop="click"
|
|
34
|
+
@getauthorize="getAuthorize"
|
|
35
|
+
@getuserinfo="forward('getuserinfo', $event)"
|
|
36
|
+
@contact="forward('contact', $event)"
|
|
37
|
+
@getphonenumber="forward('getphonenumber', $event)"
|
|
38
|
+
@error="forward('error', $event)"
|
|
39
|
+
@launchapp="forward('launchapp', $event)"
|
|
40
|
+
@opensetting="forward('opensetting', $event)"
|
|
41
|
+
@chooseavatar="forward('chooseavatar', $event)"
|
|
42
|
+
@agreeprivacyauthorization="forward('agreeprivacyauthorization', $event)"
|
|
43
|
+
>
|
|
44
|
+
<slot>{{ text }}</slot>
|
|
45
|
+
<view
|
|
46
|
+
v-if="ripple"
|
|
47
|
+
class="snake-wave-ripple"
|
|
48
|
+
:class="{ 'snake-wave-active': waveActive }"
|
|
49
|
+
:style="{
|
|
50
|
+
top: `${rippleTop}px`,
|
|
51
|
+
left: `${rippleLeft}px`,
|
|
52
|
+
width: `${targetWidth}px`,
|
|
53
|
+
height: `${targetWidth}px`,
|
|
54
|
+
backgroundColor: rippleBgColor || 'rgba(0, 0, 0, 0.15)'
|
|
55
|
+
}"
|
|
56
|
+
/>
|
|
57
|
+
</button>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
/**
|
|
62
|
+
* @component Button
|
|
63
|
+
* @description 跨端按钮。
|
|
64
|
+
* @see /components/button
|
|
65
|
+
*/
|
|
66
|
+
import { computed, getCurrentInstance, nextTick, ref } from 'vue';
|
|
67
|
+
import { toStyle } from '../../libs/function/style';
|
|
68
|
+
import { buttonProps } from './types';
|
|
69
|
+
import type { ButtonEmits } from './types';
|
|
70
|
+
|
|
71
|
+
defineOptions({ name: 'SnakeButton', options: { addGlobalClass: true, virtualHost: true, styleIsolation: 'shared' } });
|
|
72
|
+
|
|
73
|
+
const props = defineProps(buttonProps);
|
|
74
|
+
const emit = defineEmits<ButtonEmits>();
|
|
75
|
+
const emitNative = emit as unknown as (name: Exclude<keyof ButtonEmits, 'click'>, event: unknown) => void;
|
|
76
|
+
const instance = getCurrentInstance();
|
|
77
|
+
const rippleTop = ref(0);
|
|
78
|
+
const rippleLeft = ref(0);
|
|
79
|
+
const targetWidth = ref(0);
|
|
80
|
+
const waveActive = ref(false);
|
|
81
|
+
let lastClickTime = 0;
|
|
82
|
+
|
|
83
|
+
const hoverClassName = computed(() => {
|
|
84
|
+
if (props.loading || props.disabled || props.ripple) return '';
|
|
85
|
+
if (props.hoverClass) return props.hoverClass;
|
|
86
|
+
return props.plain ? `snake-${props.type}-plain-hover` : `snake-${props.type}-hover`;
|
|
87
|
+
});
|
|
88
|
+
const hairLineClass = computed(() =>
|
|
89
|
+
['primary', 'success', 'error', 'warning'].includes(props.type) && !props.plain ? '' : 'snake-hairline-border'
|
|
90
|
+
);
|
|
91
|
+
const rootStyle = computed(() => toStyle({ overflow: props.ripple ? 'hidden' : 'visible' }, props.customStyle));
|
|
92
|
+
|
|
93
|
+
function click(event: unknown) {
|
|
94
|
+
const wait = Number(props.throttleTime);
|
|
95
|
+
if (wait) {
|
|
96
|
+
const now = Date.now();
|
|
97
|
+
if (now - lastClickTime < wait) return;
|
|
98
|
+
lastClickTime = now;
|
|
99
|
+
}
|
|
100
|
+
if (props.loading || props.disabled) return;
|
|
101
|
+
if (props.ripple) {
|
|
102
|
+
waveActive.value = false;
|
|
103
|
+
nextTick(() => getWaveQuery(event));
|
|
104
|
+
}
|
|
105
|
+
emit('click', event);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
type TouchPoint = { clientX?: number; clientY?: number };
|
|
109
|
+
type TouchEventLike = { touches?: TouchPoint[]; changedTouches?: TouchPoint[]; detail?: TouchPoint };
|
|
110
|
+
|
|
111
|
+
function getWaveQuery(event: unknown) {
|
|
112
|
+
uni.createSelectorQuery()
|
|
113
|
+
.in(instance?.proxy ?? null)
|
|
114
|
+
.select('.snake-button')
|
|
115
|
+
.boundingClientRect(rect => {
|
|
116
|
+
if (!rect || Array.isArray(rect) || !rect.width || !rect.height) return;
|
|
117
|
+
const source = event as TouchEventLike;
|
|
118
|
+
const touch = source.changedTouches?.[0] ?? source.touches?.[0] ?? source.detail;
|
|
119
|
+
if (!touch) return;
|
|
120
|
+
targetWidth.value = Math.max(rect.height, rect.width);
|
|
121
|
+
rippleTop.value = Number(touch.clientY) - (rect.top ?? 0) - targetWidth.value / 2;
|
|
122
|
+
rippleLeft.value = Number(touch.clientX) - (rect.left ?? 0) - targetWidth.value / 2;
|
|
123
|
+
nextTick(() => (waveActive.value = true));
|
|
124
|
+
})
|
|
125
|
+
.exec();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function forward(name: Exclude<keyof ButtonEmits, 'click'>, event: unknown) {
|
|
129
|
+
emitNative(name, event);
|
|
130
|
+
}
|
|
131
|
+
function getAuthorize(event: unknown) {
|
|
132
|
+
if (props.scope === 'phoneNumber') emit('getphonenumber', event);
|
|
133
|
+
else if (props.scope === 'userInfo') emit('getuserinfo', event);
|
|
134
|
+
}
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style scoped>
|
|
138
|
+
.snake-button::after {
|
|
139
|
+
border: none;
|
|
140
|
+
}
|
|
141
|
+
.snake-button {
|
|
142
|
+
position: relative;
|
|
143
|
+
z-index: 1;
|
|
144
|
+
box-sizing: border-box;
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
overflow: visible;
|
|
149
|
+
padding: 0 40rpx;
|
|
150
|
+
border: 0;
|
|
151
|
+
line-height: 1;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
transition: all 0.15s;
|
|
154
|
+
}
|
|
155
|
+
.snake-button--bold-border {
|
|
156
|
+
border: 1px solid var(--snake-color-white, #fff);
|
|
157
|
+
}
|
|
158
|
+
.snake-button--default {
|
|
159
|
+
color: var(--snake-color-text, #606266);
|
|
160
|
+
border-color: var(--snake-color-border-light, #c8c9cc);
|
|
161
|
+
background-color: var(--snake-color-surface, #fff);
|
|
162
|
+
}
|
|
163
|
+
.snake-button--primary {
|
|
164
|
+
color: var(--snake-color-white, #fff);
|
|
165
|
+
border-color: var(--snake-color-primary, #06d290);
|
|
166
|
+
background-color: var(--snake-color-primary, #06d290);
|
|
167
|
+
}
|
|
168
|
+
.snake-button--success {
|
|
169
|
+
color: var(--snake-color-white, #fff);
|
|
170
|
+
border-color: var(--snake-color-success, #19be6b);
|
|
171
|
+
background-color: var(--snake-color-success, #19be6b);
|
|
172
|
+
}
|
|
173
|
+
.snake-button--error {
|
|
174
|
+
color: var(--snake-color-white, #fff);
|
|
175
|
+
border-color: var(--snake-color-error, #fa3534);
|
|
176
|
+
background-color: var(--snake-color-error, #fa3534);
|
|
177
|
+
}
|
|
178
|
+
.snake-button--warning {
|
|
179
|
+
color: var(--snake-color-white, #fff);
|
|
180
|
+
border-color: var(--snake-color-warning, #ff9900);
|
|
181
|
+
background-color: var(--snake-color-warning, #ff9900);
|
|
182
|
+
}
|
|
183
|
+
.snake-button--default--disabled {
|
|
184
|
+
color: var(--snake-color-white, #fff);
|
|
185
|
+
border-color: var(--snake-color-border, #e4e7ed);
|
|
186
|
+
background-color: var(--snake-color-surface, #fff);
|
|
187
|
+
}
|
|
188
|
+
.snake-button--primary--disabled {
|
|
189
|
+
color: var(--snake-color-white, #fff) !important;
|
|
190
|
+
border-color: var(--snake-color-primary-disabled, #71d5a1) !important;
|
|
191
|
+
background-color: var(--snake-color-primary-disabled, #71d5a1) !important;
|
|
192
|
+
}
|
|
193
|
+
.snake-button--success--disabled {
|
|
194
|
+
color: var(--snake-color-white, #fff) !important;
|
|
195
|
+
border-color: var(--snake-color-success-disabled, #71d5a1) !important;
|
|
196
|
+
background-color: var(--snake-color-success-disabled, #71d5a1) !important;
|
|
197
|
+
}
|
|
198
|
+
.snake-button--error--disabled {
|
|
199
|
+
color: var(--snake-color-white, #fff) !important;
|
|
200
|
+
border-color: var(--snake-color-error-disabled, #fab6b6) !important;
|
|
201
|
+
background-color: var(--snake-color-error-disabled, #fab6b6) !important;
|
|
202
|
+
}
|
|
203
|
+
.snake-button--warning--disabled {
|
|
204
|
+
color: var(--snake-color-white, #fff) !important;
|
|
205
|
+
border-color: var(--snake-color-warning-disabled, #fcbd71) !important;
|
|
206
|
+
background-color: var(--snake-color-warning-disabled, #fcbd71) !important;
|
|
207
|
+
}
|
|
208
|
+
.snake-button--primary--plain {
|
|
209
|
+
color: var(--snake-color-primary, #06d290) !important;
|
|
210
|
+
border-color: var(--snake-color-primary-disabled, #71d5a1) !important;
|
|
211
|
+
background-color: var(--snake-color-primary-light, #ecf5ff) !important;
|
|
212
|
+
}
|
|
213
|
+
.snake-button--success--plain {
|
|
214
|
+
color: var(--snake-color-success, #19be6b) !important;
|
|
215
|
+
border-color: var(--snake-color-success-disabled, #71d5a1) !important;
|
|
216
|
+
background-color: var(--snake-color-success-light, #dbf1e1) !important;
|
|
217
|
+
}
|
|
218
|
+
.snake-button--error--plain {
|
|
219
|
+
color: var(--snake-color-error, #fa3534) !important;
|
|
220
|
+
border-color: var(--snake-color-error-disabled, #fab6b6) !important;
|
|
221
|
+
background-color: var(--snake-color-error-light, #fef0f0) !important;
|
|
222
|
+
}
|
|
223
|
+
.snake-button--warning--plain {
|
|
224
|
+
color: var(--snake-color-warning, #ff9900) !important;
|
|
225
|
+
border-color: var(--snake-color-warning-disabled, #fcbd71) !important;
|
|
226
|
+
background-color: var(--snake-color-warning-light, #fdf6ec) !important;
|
|
227
|
+
}
|
|
228
|
+
.snake-hairline-border::after {
|
|
229
|
+
content: ' ';
|
|
230
|
+
position: absolute;
|
|
231
|
+
z-index: 1;
|
|
232
|
+
top: 0;
|
|
233
|
+
left: 0;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
width: 199.8%;
|
|
236
|
+
height: 199.7%;
|
|
237
|
+
border: 1px solid currentColor;
|
|
238
|
+
transform: scale(0.5);
|
|
239
|
+
transform-origin: 0 0;
|
|
240
|
+
pointer-events: none;
|
|
241
|
+
}
|
|
242
|
+
.snake-wave-ripple {
|
|
243
|
+
position: absolute;
|
|
244
|
+
z-index: 0;
|
|
245
|
+
border-radius: 100%;
|
|
246
|
+
opacity: 1;
|
|
247
|
+
background-clip: padding-box;
|
|
248
|
+
transform: scale(0);
|
|
249
|
+
transform-origin: center;
|
|
250
|
+
pointer-events: none;
|
|
251
|
+
user-select: none;
|
|
252
|
+
}
|
|
253
|
+
.snake-wave-ripple.snake-wave-active {
|
|
254
|
+
opacity: 0;
|
|
255
|
+
transform: scale(2);
|
|
256
|
+
transition:
|
|
257
|
+
opacity 1s linear,
|
|
258
|
+
transform 0.4s linear;
|
|
259
|
+
}
|
|
260
|
+
.snake-round-circle,
|
|
261
|
+
.snake-round-circle::after {
|
|
262
|
+
border-radius: 100rpx;
|
|
263
|
+
}
|
|
264
|
+
.snake-loading::after {
|
|
265
|
+
background-color: hsla(0, 0%, 100%, 0.35);
|
|
266
|
+
}
|
|
267
|
+
.snake-size-large {
|
|
268
|
+
height: 100rpx;
|
|
269
|
+
font-size: 36rpx;
|
|
270
|
+
line-height: 100rpx;
|
|
271
|
+
}
|
|
272
|
+
.snake-size-default {
|
|
273
|
+
height: 80rpx;
|
|
274
|
+
font-size: 30rpx;
|
|
275
|
+
line-height: 80rpx;
|
|
276
|
+
}
|
|
277
|
+
.snake-size-medium {
|
|
278
|
+
display: inline-flex;
|
|
279
|
+
width: auto;
|
|
280
|
+
height: 70rpx;
|
|
281
|
+
padding: 0 80rpx;
|
|
282
|
+
font-size: 26rpx;
|
|
283
|
+
line-height: 70rpx;
|
|
284
|
+
}
|
|
285
|
+
.snake-size-small {
|
|
286
|
+
display: inline-flex;
|
|
287
|
+
width: auto;
|
|
288
|
+
height: 60rpx;
|
|
289
|
+
padding: 0 30rpx;
|
|
290
|
+
font-size: 24rpx;
|
|
291
|
+
line-height: 60rpx;
|
|
292
|
+
}
|
|
293
|
+
.snake-size-mini {
|
|
294
|
+
display: inline-flex;
|
|
295
|
+
width: auto;
|
|
296
|
+
height: 50rpx;
|
|
297
|
+
padding: 0 20rpx;
|
|
298
|
+
padding-top: 1px;
|
|
299
|
+
font-size: 22rpx;
|
|
300
|
+
line-height: 50rpx;
|
|
301
|
+
}
|
|
302
|
+
.snake-primary-plain-hover {
|
|
303
|
+
color: var(--snake-color-white, #fff) !important;
|
|
304
|
+
border-color: var(--snake-color-primary-dark, #18b566) !important;
|
|
305
|
+
background-color: var(--snake-color-primary-dark, #18b566) !important;
|
|
306
|
+
}
|
|
307
|
+
.snake-default-plain-hover {
|
|
308
|
+
color: var(--snake-color-white, #fff) !important;
|
|
309
|
+
border-color: var(--snake-color-primary-dark, #18b566) !important;
|
|
310
|
+
background-color: var(--snake-color-primary-dark, #18b566) !important;
|
|
311
|
+
}
|
|
312
|
+
.snake-success-plain-hover {
|
|
313
|
+
color: var(--snake-color-white, #fff) !important;
|
|
314
|
+
border-color: var(--snake-color-success-dark, #18b566) !important;
|
|
315
|
+
background-color: var(--snake-color-success-dark, #18b566) !important;
|
|
316
|
+
}
|
|
317
|
+
.snake-warning-plain-hover {
|
|
318
|
+
color: var(--snake-color-white, #fff) !important;
|
|
319
|
+
border-color: var(--snake-color-warning-dark, #f29100) !important;
|
|
320
|
+
background-color: var(--snake-color-warning-dark, #f29100) !important;
|
|
321
|
+
}
|
|
322
|
+
.snake-error-plain-hover {
|
|
323
|
+
color: var(--snake-color-white, #fff) !important;
|
|
324
|
+
border-color: var(--snake-color-error-dark, #dd6161) !important;
|
|
325
|
+
background-color: var(--snake-color-error-dark, #dd6161) !important;
|
|
326
|
+
}
|
|
327
|
+
.snake-info-plain-hover {
|
|
328
|
+
color: var(--snake-color-white, #fff) !important;
|
|
329
|
+
border-color: var(--snake-color-info-dark, #767a82) !important;
|
|
330
|
+
background-color: var(--snake-color-info-dark, #767a82) !important;
|
|
331
|
+
}
|
|
332
|
+
.snake-default-hover {
|
|
333
|
+
color: var(--snake-color-primary-dark, #18b566) !important;
|
|
334
|
+
border-color: var(--snake-color-primary-dark, #18b566) !important;
|
|
335
|
+
background-color: var(--snake-color-primary-light, #ecf5ff) !important;
|
|
336
|
+
}
|
|
337
|
+
.snake-primary-hover {
|
|
338
|
+
color: var(--snake-color-white, #fff);
|
|
339
|
+
background: var(--snake-color-primary-dark, #18b566) !important;
|
|
340
|
+
}
|
|
341
|
+
.snake-success-hover {
|
|
342
|
+
color: var(--snake-color-white, #fff);
|
|
343
|
+
background: var(--snake-color-success-dark, #18b566) !important;
|
|
344
|
+
}
|
|
345
|
+
.snake-info-hover {
|
|
346
|
+
color: var(--snake-color-white, #fff);
|
|
347
|
+
background: var(--snake-color-info-dark, #767a82) !important;
|
|
348
|
+
}
|
|
349
|
+
.snake-warning-hover {
|
|
350
|
+
color: var(--snake-color-white, #fff);
|
|
351
|
+
background: var(--snake-color-warning-dark, #f29100) !important;
|
|
352
|
+
}
|
|
353
|
+
.snake-error-hover {
|
|
354
|
+
color: var(--snake-color-white, #fff);
|
|
355
|
+
background: var(--snake-color-error-dark, #dd6161) !important;
|
|
356
|
+
}
|
|
357
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/** 按钮主题类型。 */
|
|
4
|
+
export type ButtonType = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'error' | (string & {});
|
|
5
|
+
/** 按钮尺寸。 */
|
|
6
|
+
export type ButtonSize = 'large' | 'default' | 'medium' | 'small' | 'mini';
|
|
7
|
+
/** 按钮形状。 */
|
|
8
|
+
export type ButtonShape = 'square' | 'circle';
|
|
9
|
+
/** 原生表单行为。 */
|
|
10
|
+
export type ButtonFormType = 'submit' | 'reset' | '';
|
|
11
|
+
/** 支付宝授权范围。 */
|
|
12
|
+
export type ButtonScope = '' | 'phoneNumber' | 'userInfo';
|
|
13
|
+
|
|
14
|
+
/** snake-button 运行时属性。 */
|
|
15
|
+
export const buttonProps = {
|
|
16
|
+
/** 根节点自定义样式。 */ customStyle: {
|
|
17
|
+
type: [String, Object] as PropType<string | Record<string, unknown>>,
|
|
18
|
+
default: () => ({})
|
|
19
|
+
},
|
|
20
|
+
/** 根节点自定义类名。 */ customClass: { type: String, default: '' },
|
|
21
|
+
/** 按钮文本。 */ text: { type: String, default: '' },
|
|
22
|
+
/** 是否使用半像素细边框。 */ hairLine: { type: Boolean, default: true },
|
|
23
|
+
/** 按钮主题。 */ type: { type: String as PropType<ButtonType>, default: 'default' },
|
|
24
|
+
/** 按钮尺寸。 */ size: { type: String as PropType<ButtonSize>, default: 'default' },
|
|
25
|
+
/** 按钮形状。 */ shape: { type: String as PropType<ButtonShape>, default: 'square' },
|
|
26
|
+
/** 是否为镂空按钮。 */ plain: { type: Boolean, default: false },
|
|
27
|
+
/** 是否禁用。 */ disabled: { type: Boolean, default: false },
|
|
28
|
+
/** 是否显示原生加载状态。 */ loading: { type: Boolean, default: false },
|
|
29
|
+
/** 支付宝小程序授权范围。 */ scope: { type: String as PropType<ButtonScope>, default: '' },
|
|
30
|
+
/** uni-app 原生开放能力类型。 */ openType: { type: String, default: '' },
|
|
31
|
+
/** 原生表单行为类型。 */ formType: { type: String as PropType<ButtonFormType>, default: '' },
|
|
32
|
+
/** 打开 App 时传递的参数。 */ appParameter: { type: String, default: '' },
|
|
33
|
+
/** 是否阻止祖先节点出现点击态。 */ hoverStopPropagation: { type: Boolean, default: false },
|
|
34
|
+
/** 用户信息语言。 */ lang: { type: String, default: 'en' },
|
|
35
|
+
/** 客服会话来源。 */ sessionFrom: { type: String, default: '' },
|
|
36
|
+
/** 客服消息卡片标题。 */ sendMessageTitle: { type: String, default: '' },
|
|
37
|
+
/** 客服消息卡片路径。 */ sendMessagePath: { type: String, default: '' },
|
|
38
|
+
/** 客服消息卡片图片。 */ sendMessageImg: { type: String, default: '' },
|
|
39
|
+
/** 是否显示客服消息卡片。 */ showMessageCard: { type: Boolean, default: false },
|
|
40
|
+
/** 按下时的背景色。 */ hoverBgColor: { type: String, default: '' },
|
|
41
|
+
/** 水波纹背景色。 */ rippleBgColor: { type: String, default: '' },
|
|
42
|
+
/** 是否开启水波纹。 */ ripple: { type: Boolean, default: false },
|
|
43
|
+
/** 自定义按下类名。 */ hoverClass: { type: String, default: '' },
|
|
44
|
+
/** 透传到 dataset 的 name。 */ dataName: { type: String, default: '' },
|
|
45
|
+
/** 点击节流间隔,单位毫秒。 */ throttleTime: { type: [String, Number] as PropType<string | number>, default: 0 },
|
|
46
|
+
/** 按住后出现点击态的时间,单位毫秒。 */ hoverStartTime: {
|
|
47
|
+
type: [String, Number] as PropType<string | number>,
|
|
48
|
+
default: 20
|
|
49
|
+
},
|
|
50
|
+
/** 松开后点击态保留时间,单位毫秒。 */ hoverStayTime: {
|
|
51
|
+
type: [String, Number] as PropType<string | number>,
|
|
52
|
+
default: 150
|
|
53
|
+
}
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
/** snake-button 解析后的属性。 */
|
|
57
|
+
export type ButtonResolvedProps = ExtractPropTypes<typeof buttonProps>;
|
|
58
|
+
|
|
59
|
+
/** snake-button 对外属性。 */
|
|
60
|
+
export interface ButtonProps {
|
|
61
|
+
/** 根节点自定义样式。 */ customStyle?: string | Record<string, unknown>;
|
|
62
|
+
/** 根节点自定义类名。 */ customClass?: string;
|
|
63
|
+
/** 按钮文本。 */ text?: string;
|
|
64
|
+
/** 是否使用半像素细边框。 */ hairLine?: boolean;
|
|
65
|
+
/** 按钮主题。 */ type?: ButtonType;
|
|
66
|
+
/** 按钮尺寸。 */ size?: ButtonSize;
|
|
67
|
+
/** 按钮形状。 */ shape?: ButtonShape;
|
|
68
|
+
/** 是否为镂空按钮。 */ plain?: boolean;
|
|
69
|
+
/** 是否禁用。 */ disabled?: boolean;
|
|
70
|
+
/** 是否显示原生加载状态。 */ loading?: boolean;
|
|
71
|
+
/** 支付宝小程序授权范围。 */ scope?: ButtonScope;
|
|
72
|
+
/** uni-app 原生开放能力类型。 */ openType?: string;
|
|
73
|
+
/** 原生表单行为类型。 */ formType?: ButtonFormType;
|
|
74
|
+
/** 打开 App 时传递的参数。 */ appParameter?: string;
|
|
75
|
+
/** 是否阻止祖先节点出现点击态。 */ hoverStopPropagation?: boolean;
|
|
76
|
+
/** 用户信息语言。 */ lang?: string;
|
|
77
|
+
/** 客服会话来源。 */ sessionFrom?: string;
|
|
78
|
+
/** 客服消息卡片标题。 */ sendMessageTitle?: string;
|
|
79
|
+
/** 客服消息卡片路径。 */ sendMessagePath?: string;
|
|
80
|
+
/** 客服消息卡片图片。 */ sendMessageImg?: string;
|
|
81
|
+
/** 是否显示客服消息卡片。 */ showMessageCard?: boolean;
|
|
82
|
+
/** 按下时的背景色。 */ hoverBgColor?: string;
|
|
83
|
+
/** 水波纹背景色。 */ rippleBgColor?: string;
|
|
84
|
+
/** 是否开启水波纹。 */ ripple?: boolean;
|
|
85
|
+
/** 自定义按下类名。 */ hoverClass?: string;
|
|
86
|
+
/** 透传到 dataset 的 name。 */ dataName?: string;
|
|
87
|
+
/** 点击节流间隔,单位毫秒。 */ throttleTime?: string | number;
|
|
88
|
+
/** 按住后出现点击态的时间,单位毫秒。 */ hoverStartTime?: string | number;
|
|
89
|
+
/** 松开后点击态保留时间,单位毫秒。 */ hoverStayTime?: string | number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** snake-button 事件。 */
|
|
93
|
+
export type ButtonEmits = {
|
|
94
|
+
/** 点击事件。 */ click: [event: unknown];
|
|
95
|
+
/** 用户信息回调。 */ getuserinfo: [event: unknown];
|
|
96
|
+
/** 客服消息回调。 */ contact: [event: unknown];
|
|
97
|
+
/** 手机号回调。 */ getphonenumber: [event: unknown];
|
|
98
|
+
/** 开放能力错误回调。 */ error: [event: unknown];
|
|
99
|
+
/** 打开 App 回调。 */ launchapp: [event: unknown];
|
|
100
|
+
/** 打开设置回调。 */ opensetting: [event: unknown];
|
|
101
|
+
/** 头像选择回调。 */ chooseavatar: [event: unknown];
|
|
102
|
+
/** 隐私授权回调。 */ agreeprivacyauthorization: [event: unknown];
|
|
103
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="snake-sort" @click="toggle">
|
|
3
|
+
<text class="snake-sort__label" :style="labelStyle">{{ title }}</text>
|
|
4
|
+
<view class="snake-sort__arrows" aria-hidden="true">
|
|
5
|
+
<view class="snake-sort__arrow-up" :class="{ 'is-active': value === 'asc' }" />
|
|
6
|
+
<view class="snake-sort__arrow-down" :class="{ 'is-active': value === 'desc' }" />
|
|
7
|
+
</view>
|
|
8
|
+
</view>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
/**
|
|
13
|
+
* @component ButtonSort
|
|
14
|
+
* @description 用于在默认、升序和降序状态之间循环切换。
|
|
15
|
+
* @see /components/button-sort
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { computed, ref } from 'vue';
|
|
19
|
+
import type { ButtonSortEmits, ButtonSortProps, ButtonSortValue } from './types';
|
|
20
|
+
|
|
21
|
+
defineOptions({ name: 'snake-button-sort', options: { virtualHost: true, styleIsolation: 'shared' } });
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<ButtonSortProps>(), { title: '', titleColor: '' });
|
|
24
|
+
const emit = defineEmits<ButtonSortEmits>();
|
|
25
|
+
const value = ref<ButtonSortValue>('');
|
|
26
|
+
|
|
27
|
+
// 标题颜色默认走 scoped 里的主题文字色,仅当传入 titleColor 时覆盖。
|
|
28
|
+
const labelStyle = computed(() => (props.titleColor ? { color: props.titleColor } : undefined));
|
|
29
|
+
|
|
30
|
+
function toggle() {
|
|
31
|
+
value.value = value.value === '' ? 'asc' : value.value === 'asc' ? 'desc' : '';
|
|
32
|
+
emit('change', { value: value.value });
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.snake-sort {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex: 1;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
gap: 6rpx;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
padding: 0;
|
|
45
|
+
font-size: 26rpx;
|
|
46
|
+
line-height: 1;
|
|
47
|
+
color: var(--snake-color-text, #26273a);
|
|
48
|
+
}
|
|
49
|
+
.snake-sort__arrows {
|
|
50
|
+
transition: transform 0.3s;
|
|
51
|
+
}
|
|
52
|
+
.snake-sort__arrow-up,
|
|
53
|
+
.snake-sort__arrow-down {
|
|
54
|
+
width: 0;
|
|
55
|
+
height: 0;
|
|
56
|
+
border: 10rpx solid transparent;
|
|
57
|
+
border-radius: 2rpx;
|
|
58
|
+
}
|
|
59
|
+
.snake-sort__arrow-up {
|
|
60
|
+
border-bottom-color: var(--snake-color-text-muted, #888891);
|
|
61
|
+
}
|
|
62
|
+
.snake-sort__arrow-down {
|
|
63
|
+
margin-top: 4rpx;
|
|
64
|
+
border-top-color: var(--snake-color-text-muted, #888891);
|
|
65
|
+
}
|
|
66
|
+
.snake-sort__arrow-up.is-active {
|
|
67
|
+
border-bottom-color: var(--snake-color-primary, #06d290);
|
|
68
|
+
}
|
|
69
|
+
.snake-sort__arrow-down.is-active {
|
|
70
|
+
border-top-color: var(--snake-color-primary, #06d290);
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** ButtonSortValue 类型定义。 */
|
|
2
|
+
export type ButtonSortValue = '' | 'asc' | 'desc';
|
|
3
|
+
|
|
4
|
+
/** ButtonSort 组件的公开属性。 */
|
|
5
|
+
export interface ButtonSortProps {
|
|
6
|
+
/** 标题文本。 */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** 标题颜色。 */
|
|
9
|
+
titleColor?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** ButtonSortChange 事件详情。 */
|
|
13
|
+
export interface ButtonSortChangeDetail {
|
|
14
|
+
/** 当前值。 */
|
|
15
|
+
value: ButtonSortValue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** ButtonSort 组件的事件契约。 */
|
|
19
|
+
export type ButtonSortEmits = {
|
|
20
|
+
/** change 事件携带的参数。 */
|
|
21
|
+
change: [payload: ButtonSortChangeDetail];
|
|
22
|
+
};
|