Merge branch 'main' into tdesign

This commit is contained in:
Jin Mao 2025-11-09 12:04:30 +08:00 committed by GitHub
commit a4aa133db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 31 additions and 14 deletions

View File

@ -36,6 +36,7 @@
"prefixs", "prefixs",
"publint", "publint",
"qrcode", "qrcode",
"reka",
"shadcn", "shadcn",
"sonner", "sonner",
"sortablejs", "sortablejs",

View File

@ -175,18 +175,18 @@ export default {
keyframes: { keyframes: {
'accordion-down': { 'accordion-down': {
from: { height: '0' }, from: { height: '0' },
to: { height: 'var(--radix-accordion-content-height)' }, to: { height: 'var(--reka-accordion-content-height)' },
}, },
'accordion-up': { 'accordion-up': {
from: { height: 'var(--radix-accordion-content-height)' }, from: { height: 'var(--reka-accordion-content-height)' },
to: { height: '0' }, to: { height: '0' },
}, },
'collapsible-down': { 'collapsible-down': {
from: { height: '0' }, from: { height: '0' },
to: { height: 'var(--radix-collapsible-content-height)' }, to: { height: 'var(--reka-collapsible-content-height)' },
}, },
'collapsible-up': { 'collapsible-up': {
from: { height: 'var(--radix-collapsible-content-height)' }, from: { height: 'var(--reka-collapsible-content-height)' },
to: { height: '0' }, to: { height: '0' },
}, },
float: { float: {

View File

@ -7,7 +7,19 @@ dayjs.extend(timezone);
type FormatDate = Date | dayjs.Dayjs | number | string; 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 { try {
const date = dayjs.isDayjs(time) ? time : dayjs(time); const date = dayjs.isDayjs(time) ? time : dayjs(time);
if (!date.isValid()) { if (!date.isValid()) {
@ -16,11 +28,11 @@ export function formatDate(time: FormatDate, format = 'YYYY-MM-DD') {
return date.tz().format(format); return date.tz().format(format);
} catch (error) { } catch (error) {
console.error(`Error formatting date: ${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'); return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
} }

View File

@ -13,7 +13,7 @@ export interface VbenButtonProps {
/** /**
* Change the default rendered element for the one passed as a child, merging their props and behavior. * 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; asChild?: boolean;
class?: any; class?: any;

View File

@ -59,7 +59,7 @@ export function useTabsViewScroll(props: TabsProps) {
} }
const viewportEl = scrollbarEl?.querySelector( const viewportEl = scrollbarEl?.querySelector(
'div[data-radix-scroll-area-viewport]', 'div[data-reka-scroll-area-viewport]',
); );
scrollViewportEl.value = viewportEl; scrollViewportEl.value = viewportEl;

View File

@ -29,11 +29,15 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
baseURL, baseURL,
transformResponse: (data: any, header: AxiosResponseHeaders) => { transformResponse: (data: any, header: AxiosResponseHeaders) => {
// storeAsString指示将BigInt存储为字符串设为false则会存储为内置的BigInt类型 // storeAsString指示将BigInt存储为字符串设为false则会存储为内置的BigInt类型
return header.getContentType()?.toString().includes('application/json') if (
? cloneDeep( header.getContentType()?.toString().includes('application/json') &&
JSONBigInt({ storeAsString: true, strict: true }).parse(data), typeof data === 'string'
) ) {
: data; return cloneDeep(
JSONBigInt({ storeAsString: true, strict: true }).parse(data),
);
}
return data;
}, },
}); });