Browse Source

[stdf] 更新版本至1.0.7,修复类型错误和`id_ID`语言文件问题,优化组件属性类型定义。

dufu1991 1 year ago
parent
commit
d06b8c7ae2

+ 5 - 0
docs/mds/guide/changelog.md

@@ -1,3 +1,8 @@
+## 1.0.7 <font size=1>2025-04-30</font>
+
+- 修复部分类型错误。
+- 修复 `id_ID` 语言文件错误。
+
 ## 1.0.6 <font size=1>2025-04-27</font>
 
 - 修复 Input 组件,详见 [Input](https://stdf.design/components?nav=input&tab=4)。

+ 5 - 0
docs/mds/guide/changelog_en.md

@@ -1,3 +1,8 @@
+## 1.0.7 <font size=1>2025-04-30</font>
+
+- Fixed some type errors.
+- Fixed `id_ID` language file error.
+
 ## 1.0.6 <font size=1>2025-04-27</font>
 
 - Fixed Input component, please see [Input](https://stdf.design/components?nav=input&tab=4).

+ 1 - 1
packages/stdf/package.json

@@ -1,6 +1,6 @@
 {
 	"name": "stdf",
-	"version": "1.0.6",
+	"version": "1.0.7",
 	"description": "Mobile web component library based on Svelte and Tailwind",
 	"author": "any-tdf",
 	"funding": "https://stdf.design?fund",

+ 1 - 1
packages/stdf/src/lib/components/calendar/Calendar.svelte

@@ -390,7 +390,7 @@
 								class:!rounded-r-sm={radius === 'sm' &&
 									mode === 'range' &&
 									(selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8 || day.end)}
-								class:!rounded-sm={radius === 'sn' && mode !== 'range'}
+								class:!rounded-sm={radius === 'sm' && mode !== 'range'}
 							>
 								<div
 									class="{radiusClass[radius] || 'rounded-xl'} relative flex h-full w-full flex-col justify-center {day.info

+ 1 - 1
packages/stdf/src/lib/components/icon/Icon.svelte

@@ -18,7 +18,7 @@
 	{#if children}
 		{@render children()}
 	{:else}
-		<svg width={size} height={size === 'full' ? '100%' : size} style="fill: currentColor;fill-opacity: {alpha};display: inline;">
+		<svg width={size} height={size === 'full' ? '100%' : size} class="inline fill-current" style="fill-opacity: {alpha};">
 			<use xlink:href="/{path}#{name}" />
 		</svg>
 	{/if}

+ 1 - 1
packages/stdf/src/lib/components/noticeBar/NoticeBar.svelte

@@ -57,7 +57,7 @@
 
 	//垂直滚动时的处理
 	//Processing when scrolling vertically
-	let times: number | null = null;
+	let times: NodeJS.Timeout | null = null;
 	let currentIndex = $state(0);
 	let textListVertical = [...textList, textList[0]];
 	let isTransition = $state(true);

+ 2 - 2
packages/stdf/src/lib/components/pagination/SecondPageNext.svelte

@@ -5,8 +5,8 @@
 		pageCol: number;
 		Pages: number[];
 		maxShowPage: number;
-		radius: string;
-		type: string;
+		radius: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'none';
+		type: 'border' | 'block' | 'bold';
 		onclickItem: (index: number) => void;
 	};
 	let { pageCol = 3, Pages = [], maxShowPage = 9, radius = 'md', type = 'bold', onclickItem }: Props = $props();

+ 2 - 2
packages/stdf/src/lib/components/pagination/SecondPagePre.svelte

@@ -5,8 +5,8 @@
 		pageCol: number;
 		Pages: number[];
 		maxShowPage: number;
-		radius: string;
-		type: string;
+		radius: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'none';
+		type: 'border' | 'block' | 'bold';
 		onclickItem: (index: number) => void;
 	};
 	let { pageCol = 3, Pages = [], maxShowPage = 7, radius = 'md', type = 'bold', onclickItem }: Props = $props();

+ 1 - 1
packages/stdf/src/lib/components/skeleton/Skeleton.svelte

@@ -63,7 +63,7 @@
 		<div class="flex flex-col space-y-2">
 			<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
 			{#each new Array(lines - 1) as _}
-				<div class="bg-black/20 dark:bg-white/20 w-full{heightObj[height] || heightObj['6']}{radiusObj[radius] || radiusObj.base}"></div>
+				<div class="bg-black/20 dark:bg-white/20 w-full{heightObj[height] || heightObj['6']}{radiusObj[radius] || radiusObj.sm}"></div>
 			{/each}
 			<div
 				class="bg-black/20 dark:bg-white/20 {randomArr[Math.floor(Math.random() * randomArr.length)]}{heightObj[height] ||

+ 1 - 1
packages/stdf/src/lib/components/swiper/Swiper.svelte

@@ -181,7 +181,7 @@
 	};
 	//定时器
 	// timer
-	let intervalTime: number | null = null;
+	let intervalTime: ReturnType<typeof setInterval>;
 	//定时器执行函数
 	// timer function
 	const intervalTimeFun = () => {

+ 1 - 1
packages/stdf/src/lib/lang/id_ID.ts

@@ -65,7 +65,7 @@ const id_ID: LangProps = {
 		defaultMinute: 'Menit',
 		defaultSecond: 'Kedua'
 	},
-	kalender: {
+	calendar: {
 		weekTextList: ['Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', 'Ming'],
 		weekSundayStartTextList: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
 		monthTextList: [

+ 2 - 2
packages/stdf/src/routes/+page.svelte

@@ -29,10 +29,10 @@
 </a>
 <div class="flex flex-col py-4">
 	<div>
-		{#each menuList as menu}
+		{#each menuList as menu (menu.class)}
 			<div class="mb-2 mt-8 px-4 text-sm text-gray-500">{isZh ? menu.class : menu.class_en}</div>
 			<CellGroup>
-				{#each menu.childs as child, i}
+				{#each menu.childs as child, i (child.nav)}
 					<a href={child.nav + (isZh ? '/zh_CN' : '/en_US')}>
 						<Cell
 							title={isZh ? child.title : child.title_en}

+ 1 - 1
packages/stdf/src/routes/toast/en_US/+page.svelte

@@ -36,7 +36,7 @@
 	let visible32 = $state(false);
 
 	let time = $state(4);
-	let timer: number | null = null;
+	let timer: ReturnType<typeof setInterval>;
 	const useSnippetFun = () => {
 		visible25 = true;
 		timer = setInterval(() => {

+ 1 - 1
packages/stdf/src/routes/toast/zh_CN/+page.svelte

@@ -36,7 +36,7 @@
 	let visible32 = $state(false);
 
 	let time = $state(4);
-	let timer: number | null = null;
+	let timer: ReturnType<typeof setInterval>;
 	const useSnippetFun = () => {
 		visible25 = true;
 		timer = setInterval(() => {