Skip to content

Commit

Permalink
[stdf]Add JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dufu1991 committed Nov 16, 2023
1 parent d7d9376 commit 7c1bc17
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 33 deletions.
66 changes: 49 additions & 17 deletions packages/stdf/components/loading/Loading.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,68 @@
import { Loading2_0, Loading2_1, Loading2_2, Loading2_3, Loading2_4, Loading2_5 } from './loadings/twoColor';
import { Loading4_0, Loading4_1, Loading4_2, Loading4_3 } from './loadings/fourColor';
// 编号
// type
/**
* 编号
* Number
* @type {string}
* @default '1_0'
*/
export let type = '1_0';
// 容器高度
// container height
/**
* 容器高度
* container height
* @type {'2'|'4'|'6'|'8'|'12'|'16'|'20'|'28'|'36'|'48'|'56'|'64'|'72'|'80'|'96'|'full'}
* @default '8'
*/
export let height = '8';
// 容器宽度
// container width
/**
* 容器宽度
* container width
* @type {'2'|'4'|'6'|'8'|'12'|'16'|'20'|'28'|'36'|'48'|'56'|'64'|'72'|'80'|'96'|'full'}
* @default '8'
*/
export let width = '8';
// 是否使用主题色
// use theme color
/**
* 是否使用主题色
* use theme color
* @type {boolean}
* @default false
*/
export let theme = false;
// 是否反色
// inverse color
/**
* 是否反色
* inverse color
* @type {boolean}
* @default false
*/
export let inverse = false;
// 自定义颜色
// custom color
/**
* 自定义颜色
* custom color
* @type {string[]}
* @default []
*/
export let customColor = [];
// 是否开启懒动画
// lazy animation
/**
* 是否开启懒动画
* lazy animation
* @type {boolean}
* @default true
*/
export let lazyAnimation = true;
// 速度系数,基础为1,数值越大,速度越快
// speed coefficient, the basic is 1, the larger the number, the faster the speed
/**
* 速度系数,基础为1,数值越大,速度越快
* speed coefficient, the basic is 1, the larger the number, the faster the speed
* @type {number}
* @default 1
*/
export let speed = 1;
// loading 元素
Expand Down Expand Up @@ -156,7 +188,7 @@
</script>
<div bind:this={loadingDom}>
<!--oneÏ-->
<!--one-->
{#if type === '1_0'}
<Loading1_0 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
{:else if type === '1_1'}
Expand Down
65 changes: 49 additions & 16 deletions packages/stdf/components/mask/Mask.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,68 @@
// Define event dispatcher
const dispatch = createEventDispatcher();
// 是否显示
// Whether to show
/**
* 是否显示
* Whether to show
* @type {boolean}
* @default false
*/
export let visible = false;
// 遮罩透明度
// Mask opacity
/**
* 遮罩透明度
* Mask opacity
* @type {number}
* @range 0 - 1
* @default 0.5
*/
export let opacity = 0.5;
// 遮罩是否可点击穿透
// Whether the mask can be clicked through
/**
* 遮罩是否可点击穿透
* Whether the mask can be clicked through
* @type {boolean}
* @default false
*/
export let clickable = false;
// 是否反色
// Whether to reverse color
/**
* 是否反色
* Whether to reverse color
* @type {boolean}
* @default false
*/
export let inverse = false;
// 模糊度,默认不模糊
// Blur degree, default no blur
/**
* 模糊度
* Blur degree
* @type {'none'|'sm'|'base'|'md'|'lg'|'xl'|'2xl'|'3xl'}
* @default 'none'
*/
export let backdropBlur = 'none';
// 出现动画过渡时长
// Transition duration of appearance animation
/**
* 出现动画过渡时长,单位毫秒
* Transition duration of appearance animation, in milliseconds
* @type {number}
* @default 150
*/
export let duration = 150;
// 消失动画过渡时长
// Transition duration of disappearance animation
export let outDuration = 0; //消失动画过渡时长
/**
* 消失动画过渡时长,单位毫秒
* Transition duration of disappearance animation, in milliseconds
* @type {number}
* @default 0
*/
export let outDuration = 0;
// z-index
/**
* z-index
* @type {number}
* @default 500
*/
export let zIndex = 500;
//遮罩模糊度样式
Expand Down

0 comments on commit 7c1bc17

Please sign in to comment.