feat: refactor SingleWeekPicker component to improve TypeScript interface definitions and organize script sections
All checks were successful
Publish to npm / publish (push) Successful in 28s

This commit is contained in:
Astrian Zheng 2025-02-26 09:24:09 +11:00
parent d882426936
commit 8a76679159
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA
2 changed files with 232 additions and 232 deletions

View File

@ -8,13 +8,8 @@
export default {
name: 'SingleDatePicker',
}
</script>
<script setup lang="ts">
import { ref, defineProps, watch, onMounted, toRefs, getCurrentInstance, PropType } from 'vue'
import { generateUniqueId, applyColor, getL10Weekday, getCalendarDates } from '../utils'
interface SingleDatePickerPropsColorScheme {
export interface SingleDatePickerPropsColorScheme {
mainColor: string
accentColor: string
borderColor: string
@ -22,7 +17,12 @@ export default {
reversedColor: string
}
type SingleDatePickerPropsAvailableDates = [Date | null, Date | null]
export type SingleDatePickerPropsAvailableDates = [Date | null, Date | null]
</script>
<script setup lang="ts">
import { ref, defineProps, watch, onMounted, toRefs, getCurrentInstance, PropType } from 'vue'
import { generateUniqueId, applyColor, getL10Weekday, getCalendarDates } from '../utils'
const props = defineProps({
/**

View File

@ -8,23 +8,23 @@
export default {
name: 'SingleDatePicker',
}
</script>
<script setup lang="ts">
import { ref, defineProps, toRefs, onMounted, getCurrentInstance, watch } from 'vue'
import { generateUniqueId, applyColor, getL10Weekday, getCalendarDates, calculateWeekNum } from '../utils'
interface SingleWeekPickerPropsColorScheme {
export interface SingleWeekPickerPropsColorScheme {
mainColor: string
accentColor: string
borderColor: string
hoverColor: string
reversedColor: string
}
interface SingleWeekPickerModelValue {
export interface SingleWeekPickerModelValue {
weekYear: number
weekNum: number
}
</script>
<script setup lang="ts">
import { ref, defineProps, toRefs, onMounted, getCurrentInstance, watch } from 'vue'
import { generateUniqueId, applyColor, getL10Weekday, getCalendarDates, calculateWeekNum } from '../utils'
const selectMonth = ref(false)
const uniqueId = generateUniqueId()