2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
@@ -0,0 +1,36 @@
import { buildProps } from '../../../../utils'
import { useFormSizeProps } from '../../composables/use-component-common-props'
import { checkboxCheckedShapes } from '../../types/checkbox'
export const checkboxBaseProps = buildProps({
/**
* @description 复选框尺寸
*/
size: useFormSizeProps,
/**
* @description 复选框的形状
*/
checkedShape: {
type: String,
values: checkboxCheckedShapes,
},
/**
* @description 是否禁用
*/
disabled: Boolean,
/**
* @description 是否禁用点击标签切换
*/
labelDisabled: Boolean,
/**
* @description 是否显示边框
*/
border: Boolean,
/**
* @description 激活时的颜色,以tn开头则使用图鸟内置的颜色只支持普通颜色
*/
activeColor: {
type: String,
default: '',
},
} as const)
@@ -0,0 +1,16 @@
import { buildProps } from '../../../../utils'
import { formComponentSizes } from '../../../../constants'
export const formMetaProps = buildProps({
/**
* @description 设置表单下组件的尺寸
*/
size: {
type: String,
values: formComponentSizes,
},
/**
* @description 是否禁用表单内的所有组件,优先级比组件自身的禁用属性高
*/
disabled: Boolean,
} as const)
@@ -0,0 +1,52 @@
import { buildProps } from '../../../../utils'
import { ZIndex } from '../../../../constants'
export const pickerBaseProps = buildProps({
/**
* @description 显示取消按钮
*/
showCancel: {
type: Boolean,
default: true,
},
/**
* @description 取消按钮的文本
*/
cancelText: {
type: String,
default: '取 消',
},
/**
* @description 取消按钮的字体颜色,支持图鸟内置的字体颜色
*/
cancelColor: String,
/**
* @description 显示确定按钮
*/
showConfirm: {
type: Boolean,
default: true,
},
/**
* @description 确定按钮的文本
*/
confirmText: {
type: String,
default: '确 定',
},
/**
* @description 确定按钮的字体颜色,支持图鸟内置的字体颜色
*/
confirmColor: String,
/**
* @description 显示遮罩
*/
mask: Boolean,
/**
* zIndex
*/
zIndex: {
type: Number,
default: ZIndex.popup,
},
} as const)
@@ -0,0 +1,34 @@
import { buildProps } from '../../../../utils'
import type { ExtractPropTypes } from 'vue'
export const propgressBaseProps = buildProps({
/**
* @description 当前进度百分比
*/
percent: {
type: Number,
default: 0,
},
/**
* @description 激活时的颜色,以tn开头则使用图鸟内置的颜色,在为圆环进度条是无法使用内置的颜色
*/
activeColor: String,
/**
* @description 未激活时的颜色,以tn开头则使用图鸟内置的颜色,在为圆环进度条是无法使用内置的颜色
*/
inactiveColor: String,
/**
* @description 显示当前进度
*/
showPercent: Boolean,
/**
* @description 动画执行时间,单位ms
*/
duration: {
type: Number,
default: 1500,
},
} as const)
export type ProgressBaseProps = ExtractPropTypes<typeof propgressBaseProps>
@@ -0,0 +1,28 @@
import { buildProps } from '../../../../utils'
import { useFormSizeProps } from '../../composables/use-component-common-props'
export const radioBaseProps = buildProps({
/**
* @description radio单选框尺寸
*/
size: useFormSizeProps,
/**
* @description radio单选框是否禁用
*/
disabled: Boolean,
/**
* @description radio禁止点击标签进行选择
*/
labelDisabled: Boolean,
/**
* @description 是否显示边框
*/
border: Boolean,
/**
* @description radio激活时的颜色,以tn开头则使用图鸟内置的颜色只支持普通颜色
*/
activeColor: {
type: String,
default: '',
},
} as const)
@@ -0,0 +1,16 @@
import { buildProps } from '../../../../utils'
export const stepsBaseProps = buildProps({
/**
* @description 默认颜色,以tn开头使用图鸟内置颜色
*/
color: String,
/**
* @description 激活时颜色,以tn开头使用图鸟内置颜色
*/
activeColor: String,
/**
* @description 禁止点击
*/
disabled: Boolean,
} as const)
@@ -0,0 +1,16 @@
import { buildProps } from '../../../../utils'
export const subsectionBaseProps = buildProps({
/**
* @description 默认颜色,以tn开头使用图鸟内置的颜色
*/
color: String,
/**
* @description 激活时的颜色,以tn开头使用图鸟内置的颜色
*/
activeColor: String,
/**
* @description 是否禁用
*/
disabled: Boolean,
} as const)
@@ -0,0 +1,11 @@
import { buildProps } from '../../../../utils'
export const swipeActionBaseProps = buildProps({
/**
* @description 自动关闭菜单
*/
autoClose: {
type: Boolean,
default: true,
},
} as const)
@@ -0,0 +1,20 @@
import { buildProps } from '../../../../utils'
export const tabbarBaseProps = buildProps({
/**
* @description 未选中时的颜色
*/
inactiveColor: String,
/**
* @description 选中时的颜色
*/
activeColor: String,
/**
* @description 图标大小
*/
iconSize: String,
/**
* @description 文字大小
*/
fontSize: String,
} as const)
@@ -0,0 +1,20 @@
import { buildProps } from '../../../../utils'
export const tabsBaseProps = buildProps({
/**
* @description 默认颜色,以tn开头时使用图鸟内置的颜色
*/
color: String,
/**
* @description 选中颜色,以tn开头时使用图鸟内置的颜色
*/
activeColor: String,
/**
* @description 字体大小
*/
fontSize: String,
/**
* @description 选中字体大小
*/
activeFontSize: String,
} as const)
@@ -0,0 +1,54 @@
import { buildProp, definePropType, generateId } from '../../../../utils'
import { componentSizes, formComponentSizes } from '../../../../constants'
export type ComponentIndex = string | number
/**
* @description 组件Boolean类型定义
*/
export const useComponentBoolean = buildProp({
type: [Boolean, undefined],
default: undefined,
})
/**
* @description 组件尺寸
*/
export const useComponentSizeProp = buildProp({
type: String,
values: componentSizes,
required: false,
} as const)
/**
* @description 表单组件尺寸
*/
export const useFormSizeProps = buildProp({
type: String,
values: formComponentSizes,
required: false,
} as const)
/**
* @description 组件自定义样式
*/
export const useComponentCustomStyleProp = buildProp({
type: Object,
default: () => ({}),
})
/**
* @description 组件自定义index
*/
export const useComponentIndexProp = buildProp({
type: definePropType<ComponentIndex>([String, Number]),
default: () => generateId(),
})
/**
* @description 组件是否开启底部安全区域
*/
export const useComponentSafeAreaInsetBottomProp = buildProp({
type: Boolean,
default: true,
})
@@ -0,0 +1,48 @@
import { ref, toRef, watch } from 'vue'
import { useComponentColor } from '../../../../hooks'
import type { ProgressBaseProps } from '../../common-props/progress'
interface ProgressPropsType extends ProgressBaseProps {
[key: string]: any
}
export const useProgressProps = (props: ProgressPropsType) => {
const [activeColorClass, activeColorStyle] = useComponentColor(
toRef(props, 'activeColor'),
'bg'
)
const [inactiveColorClass, inactiveColorStyle] = useComponentColor(
toRef(props, 'inactiveColor'),
'bg'
)
// 当前的进度百分比
const percent = ref(0)
let firstInitPercent = true
// 为了有动画效果,需要在下一次渲染时再设置进度条的长度
watch(
() => props.percent,
(val) => {
if (!firstInitPercent) {
percent.value = val
} else {
setTimeout(() => {
percent.value = val
firstInitPercent = false
}, 50)
}
},
{
immediate: true,
}
)
return {
percent,
activeColorClass,
activeColorStyle,
inactiveColorClass,
inactiveColorStyle,
}
}
@@ -0,0 +1,4 @@
export const checkboxCheckedShapes = ['square', 'circle'] as const
export type CheckboxCheckedShape = (typeof checkboxCheckedShapes)[number]
export type CheckboxValueType = string | number | boolean