Jin Mao
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
31 additions and
14 deletions
-
cspell.json
-
internal/tailwind-config/src/index.ts
-
packages/@core/base/shared/src/utils/date.ts
-
packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts
-
packages/@core/ui-kit/tabs-ui/src/use-tabs-view-scroll.ts
-
playground/src/api/request.ts
|
|
|
@ -36,6 +36,7 @@ |
|
|
|
"prefixs", |
|
|
|
"publint", |
|
|
|
"qrcode", |
|
|
|
"reka", |
|
|
|
"shadcn", |
|
|
|
"sonner", |
|
|
|
"sortablejs", |
|
|
|
|
|
|
|
@ -175,18 +175,18 @@ export default { |
|
|
|
keyframes: { |
|
|
|
'accordion-down': { |
|
|
|
from: { height: '0' }, |
|
|
|
to: { height: 'var(--radix-accordion-content-height)' }, |
|
|
|
to: { height: 'var(--reka-accordion-content-height)' }, |
|
|
|
}, |
|
|
|
'accordion-up': { |
|
|
|
from: { height: 'var(--radix-accordion-content-height)' }, |
|
|
|
from: { height: 'var(--reka-accordion-content-height)' }, |
|
|
|
to: { height: '0' }, |
|
|
|
}, |
|
|
|
'collapsible-down': { |
|
|
|
from: { height: '0' }, |
|
|
|
to: { height: 'var(--radix-collapsible-content-height)' }, |
|
|
|
to: { height: 'var(--reka-collapsible-content-height)' }, |
|
|
|
}, |
|
|
|
'collapsible-up': { |
|
|
|
from: { height: 'var(--radix-collapsible-content-height)' }, |
|
|
|
from: { height: 'var(--reka-collapsible-content-height)' }, |
|
|
|
to: { height: '0' }, |
|
|
|
}, |
|
|
|
float: { |
|
|
|
|
|
|
|
@ -7,7 +7,19 @@ dayjs.extend(timezone); |
|
|
|
|
|
|
|
type FormatDate = Date | dayjs.Dayjs | number | string; |
|
|
|
|
|
|
|
export function formatDate(time: FormatDate, format = 'YYYY-MM-DD') { |
|
|
|
type Format = |
|
|
|
| 'HH' |
|
|
|
| 'HH:mm' |
|
|
|
| 'HH:mm:ss' |
|
|
|
| 'YYYY' |
|
|
|
| 'YYYY-MM' |
|
|
|
| 'YYYY-MM-DD' |
|
|
|
| 'YYYY-MM-DD HH' |
|
|
|
| 'YYYY-MM-DD HH:mm' |
|
|
|
| 'YYYY-MM-DD HH:mm:ss' |
|
|
|
| (string & {}); |
|
|
|
|
|
|
|
export function formatDate(time?: FormatDate, format: Format = 'YYYY-MM-DD') { |
|
|
|
try { |
|
|
|
const date = dayjs.isDayjs(time) ? time : dayjs(time); |
|
|
|
if (!date.isValid()) { |
|
|
|
@ -16,11 +28,11 @@ export function formatDate(time: FormatDate, format = 'YYYY-MM-DD') { |
|
|
|
return date.tz().format(format); |
|
|
|
} catch (error) { |
|
|
|
console.error(`Error formatting date: ${error}`); |
|
|
|
return String(time); |
|
|
|
return String(time ?? ''); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export function formatDateTime(time: FormatDate) { |
|
|
|
export function formatDateTime(time?: FormatDate) { |
|
|
|
return formatDate(time, 'YYYY-MM-DD HH:mm:ss'); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -13,7 +13,7 @@ export interface VbenButtonProps { |
|
|
|
/** |
|
|
|
* Change the default rendered element for the one passed as a child, merging their props and behavior. |
|
|
|
* |
|
|
|
* Read our [Composition](https://www.radix-vue.com/guides/composition.html) guide for more details.
|
|
|
|
* Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details.
|
|
|
|
*/ |
|
|
|
asChild?: boolean; |
|
|
|
class?: any; |
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ export function useTabsViewScroll(props: TabsProps) { |
|
|
|
} |
|
|
|
|
|
|
|
const viewportEl = scrollbarEl?.querySelector( |
|
|
|
'div[data-radix-scroll-area-viewport]', |
|
|
|
'div[data-reka-scroll-area-viewport]', |
|
|
|
); |
|
|
|
|
|
|
|
scrollViewportEl.value = viewportEl; |
|
|
|
|
|
|
|
@ -29,11 +29,15 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) { |
|
|
|
baseURL, |
|
|
|
transformResponse: (data: any, header: AxiosResponseHeaders) => { |
|
|
|
// storeAsString指示将BigInt存储为字符串,设为false则会存储为内置的BigInt类型
|
|
|
|
return header.getContentType()?.toString().includes('application/json') |
|
|
|
? cloneDeep( |
|
|
|
JSONBigInt({ storeAsString: true, strict: true }).parse(data), |
|
|
|
) |
|
|
|
: data; |
|
|
|
if ( |
|
|
|
header.getContentType()?.toString().includes('application/json') && |
|
|
|
typeof data === 'string' |
|
|
|
) { |
|
|
|
return cloneDeep( |
|
|
|
JSONBigInt({ storeAsString: true, strict: true }).parse(data), |
|
|
|
); |
|
|
|
} |
|
|
|
return data; |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
|