mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 19:57:55 +01:00
chore(Range): export RangeColor type
This commit is contained in:
@@ -26,11 +26,10 @@ import { twMerge, twJoin } from 'tailwind-merge'
|
|||||||
import { useUI } from '../../composables/useUI'
|
import { useUI } from '../../composables/useUI'
|
||||||
import { useFormGroup } from '../../composables/useFormGroup'
|
import { useFormGroup } from '../../composables/useFormGroup'
|
||||||
import { mergeConfig } from '../../utils'
|
import { mergeConfig } from '../../utils'
|
||||||
import type { RangeSize, Strategy } from '../../types'
|
import type { RangeSize, RangeColor, Strategy } from '../../types'
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import appConfig from '#build/app.config'
|
import appConfig from '#build/app.config'
|
||||||
import { range } from '#ui/ui.config'
|
import { range } from '#ui/ui.config'
|
||||||
import colors from '#ui-colors'
|
|
||||||
|
|
||||||
const config = mergeConfig<typeof range>(appConfig.ui.strategy, appConfig.ui.range, range)
|
const config = mergeConfig<typeof range>(appConfig.ui.strategy, appConfig.ui.range, range)
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String as PropType<typeof colors[number]>,
|
type: String as PropType<RangeColor>,
|
||||||
default: () => config.default.color,
|
default: () => config.default.color,
|
||||||
validator (value: string) {
|
validator (value: string) {
|
||||||
return appConfig.ui.colors.includes(value)
|
return appConfig.ui.colors.includes(value)
|
||||||
|
|||||||
2
src/runtime/types/range.d.ts
vendored
2
src/runtime/types/range.d.ts
vendored
@@ -1,5 +1,7 @@
|
|||||||
import { range } from '../ui.config'
|
import { range } from '../ui.config'
|
||||||
import type { ExtractDeepKey } from '.'
|
import type { ExtractDeepKey } from '.'
|
||||||
import type { AppConfig } from 'nuxt/schema'
|
import type { AppConfig } from 'nuxt/schema'
|
||||||
|
import colors from '#ui-colors'
|
||||||
|
|
||||||
export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
|
export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
|
||||||
|
export type RangeColor = typeof colors[number]
|
||||||
|
|||||||
Reference in New Issue
Block a user