@puresnake/snake-ui 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/changelog.md +1 -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 +130 -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,48 @@
|
|
|
1
|
+
import type { UnitValue } from '../../libs/function/unit';
|
|
2
|
+
import type { StyleValue } from '../../types/global';
|
|
3
|
+
/** DropMenuToggleContext 类型定义。 */
|
|
4
|
+
export interface DropMenuToggleContext {
|
|
5
|
+
/** resolve 配置。 */
|
|
6
|
+
resolve: (allow: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
/** DropMenuBeforeToggle 类型定义。 */
|
|
9
|
+
export type DropMenuBeforeToggle = (context: DropMenuToggleContext) => void;
|
|
10
|
+
/** DropMenu 可选项。 */
|
|
11
|
+
export interface DropMenuOption {
|
|
12
|
+
/** 展示标签文本。 */
|
|
13
|
+
label: string;
|
|
14
|
+
/** 当前值。 */
|
|
15
|
+
value: unknown;
|
|
16
|
+
/** 是否禁用交互。 */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** DropMenuItem 组件的公开属性。 */
|
|
20
|
+
export interface DropMenuItemProps {
|
|
21
|
+
/** 双向绑定的当前值。 */
|
|
22
|
+
modelValue?: unknown;
|
|
23
|
+
/** 标题文本。 */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** options 配置。 */
|
|
26
|
+
options?: DropMenuOption[];
|
|
27
|
+
/** 是否禁用交互。 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** 组件高度。 */
|
|
30
|
+
height?: UnitValue | 'auto';
|
|
31
|
+
/** 是否显示组件。 */
|
|
32
|
+
show?: boolean;
|
|
33
|
+
/** before toggle 配置。 */
|
|
34
|
+
beforeToggle?: DropMenuBeforeToggle;
|
|
35
|
+
/** 根节点自定义样式。 */
|
|
36
|
+
customStyle?: StyleValue;
|
|
37
|
+
}
|
|
38
|
+
/** DropMenuItem 组件的事件契约。 */
|
|
39
|
+
export type DropMenuItemEmits = {
|
|
40
|
+
/** update:modelValue 事件携带的参数。 */
|
|
41
|
+
'update:modelValue': [value: unknown];
|
|
42
|
+
/** change 事件携带的参数。 */
|
|
43
|
+
change: [value: unknown];
|
|
44
|
+
/** open 事件携带的参数。 */
|
|
45
|
+
open: [];
|
|
46
|
+
/** close 事件携带的参数。 */
|
|
47
|
+
close: [];
|
|
48
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="show" class="snake-empty" :class="customClass" :style="rootStyle">
|
|
3
|
+
<slot name="icon">
|
|
4
|
+
<image v-if="isImage" class="snake-empty__image" :src="iconName" mode="aspectFit" :style="imageStyle" />
|
|
5
|
+
<snake-icon v-else :name="iconName" :color="iconColor" :size="iconSize ?? 'inherit'" />
|
|
6
|
+
</slot>
|
|
7
|
+
<slot>
|
|
8
|
+
<text class="snake-empty__text" :style="textStyle">{{ displayText }}</text>
|
|
9
|
+
</slot>
|
|
10
|
+
<view v-if="$slots.bottom" class="snake-empty__bottom"><slot name="bottom" /></view>
|
|
11
|
+
</view>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
/**
|
|
16
|
+
* @component Empty
|
|
17
|
+
* @description 用于列表、搜索结果或异常页面没有内容时提供统一反馈。内置多种语义模式,也支持图片、图标和插槽定制。
|
|
18
|
+
* @see /components/empty
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { computed } from 'vue';
|
|
22
|
+
import { addUnit } from '../../libs/function/unit';
|
|
23
|
+
import { translate } from '../../locale';
|
|
24
|
+
import Icon from '../snake-icon/snake-icon.vue';
|
|
25
|
+
import type { EmptyProps } from './types';
|
|
26
|
+
|
|
27
|
+
defineOptions({ name: 'Empty', options: { virtualHost: true, styleIsolation: 'shared' } });
|
|
28
|
+
const props = withDefaults(defineProps<EmptyProps>(), {
|
|
29
|
+
show: true,
|
|
30
|
+
mode: 'data',
|
|
31
|
+
src: '',
|
|
32
|
+
icon: '',
|
|
33
|
+
iconColor: 'var(--snake-color-text-light, #c0c4cc)',
|
|
34
|
+
iconSize: 120,
|
|
35
|
+
text: '',
|
|
36
|
+
color: '',
|
|
37
|
+
textColor: 'var(--snake-color-text-muted, #909399)',
|
|
38
|
+
fontSize: 26,
|
|
39
|
+
marginTop: 0,
|
|
40
|
+
customClass: '',
|
|
41
|
+
customStyle: ''
|
|
42
|
+
});
|
|
43
|
+
const modeTexts: Record<string, string> = {
|
|
44
|
+
data: '暂无数据',
|
|
45
|
+
list: '暂无内容',
|
|
46
|
+
search: '未找到相关内容',
|
|
47
|
+
page: '页面不存在',
|
|
48
|
+
order: '暂无订单',
|
|
49
|
+
coupon: '暂无优惠券',
|
|
50
|
+
favor: '暂无收藏',
|
|
51
|
+
permission: '暂无权限',
|
|
52
|
+
history: '暂无历史记录',
|
|
53
|
+
message: '暂无消息',
|
|
54
|
+
wifi: '网络连接异常',
|
|
55
|
+
address: '暂无地址',
|
|
56
|
+
car: '购物车是空的'
|
|
57
|
+
};
|
|
58
|
+
const displayText = computed(() => props.text || modeTexts[props.mode] || translate('common.empty'));
|
|
59
|
+
const source = computed(() => props.src || props.icon);
|
|
60
|
+
const isImage = computed(() => /^(https?:|data:|\/|\.\/|\.\.\/)/i.test(source.value));
|
|
61
|
+
const modeIcons: Record<string, string> = {
|
|
62
|
+
data: 'empty-data',
|
|
63
|
+
list: 'empty-list',
|
|
64
|
+
search: 'empty-search',
|
|
65
|
+
page: 'empty-page',
|
|
66
|
+
order: 'empty-order',
|
|
67
|
+
coupon: 'empty-coupon',
|
|
68
|
+
favor: 'empty-favor',
|
|
69
|
+
permission: 'empty-permission',
|
|
70
|
+
history: 'empty-history',
|
|
71
|
+
message: 'empty-message',
|
|
72
|
+
wifi: 'empty-wifi',
|
|
73
|
+
address: 'empty-address',
|
|
74
|
+
car: 'empty-car'
|
|
75
|
+
};
|
|
76
|
+
const iconName = computed(() => source.value || modeIcons[props.mode] || 'image');
|
|
77
|
+
const rootStyle = computed(() => [{ marginTop: addUnit(props.marginTop, 'rpx') }, props.customStyle]);
|
|
78
|
+
const imageStyle = computed(() => ({ width: addUnit(props.iconSize, 'rpx'), height: addUnit(props.iconSize, 'rpx') }));
|
|
79
|
+
const textStyle = computed(() => ({ color: props.color || props.textColor, fontSize: addUnit(props.fontSize, 'rpx') }));
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style scoped>
|
|
83
|
+
.snake-empty {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
padding: 40rpx 24rpx;
|
|
89
|
+
}
|
|
90
|
+
.snake-empty__image {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
.snake-empty__text {
|
|
94
|
+
margin-top: 20rpx;
|
|
95
|
+
line-height: 1.5;
|
|
96
|
+
}
|
|
97
|
+
.snake-empty__bottom {
|
|
98
|
+
margin-top: 28rpx;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { UnitValue } from '../../libs/function/unit';
|
|
2
|
+
import type { StyleValue } from '../../types/global';
|
|
3
|
+
|
|
4
|
+
/** EmptyMode 类型定义。 */
|
|
5
|
+
export type EmptyMode =
|
|
6
|
+
| 'data'
|
|
7
|
+
| 'list'
|
|
8
|
+
| 'search'
|
|
9
|
+
| 'page'
|
|
10
|
+
| 'order'
|
|
11
|
+
| 'coupon'
|
|
12
|
+
| 'favor'
|
|
13
|
+
| 'permission'
|
|
14
|
+
| 'history'
|
|
15
|
+
| 'message'
|
|
16
|
+
| 'wifi'
|
|
17
|
+
| 'address'
|
|
18
|
+
| 'car';
|
|
19
|
+
|
|
20
|
+
/** Empty 组件的公开属性。 */
|
|
21
|
+
export interface EmptyProps {
|
|
22
|
+
/** 是否显示组件。 */
|
|
23
|
+
show?: boolean;
|
|
24
|
+
/** 组件展示模式。 */
|
|
25
|
+
mode?: EmptyMode;
|
|
26
|
+
/** 资源地址。 */
|
|
27
|
+
src?: string;
|
|
28
|
+
/** 图标名称。 */
|
|
29
|
+
icon?: string;
|
|
30
|
+
/** 图标颜色。 */
|
|
31
|
+
iconColor?: string;
|
|
32
|
+
/** 图标尺寸,数值按 rpx 处理。 */
|
|
33
|
+
iconSize?: UnitValue;
|
|
34
|
+
/** 展示文本。 */
|
|
35
|
+
text?: string;
|
|
36
|
+
/** 内容颜色。 */
|
|
37
|
+
color?: string;
|
|
38
|
+
/** 文字颜色。 */
|
|
39
|
+
textColor?: string;
|
|
40
|
+
/** 文字尺寸,数值按 rpx 处理。 */
|
|
41
|
+
fontSize?: UnitValue;
|
|
42
|
+
/** 组件顶部外边距。 */
|
|
43
|
+
marginTop?: UnitValue;
|
|
44
|
+
/** 根节点自定义类名。 */
|
|
45
|
+
customClass?: string;
|
|
46
|
+
/** 根节点自定义样式。 */
|
|
47
|
+
customStyle?: StyleValue;
|
|
48
|
+
}
|