Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-09 14:52:46 +00:00
parent 42a0efe70b
commit 47fa6d98b2
28661 changed files with 2421771 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import type { GenerateStyle } from '@ant-design/pro-provider';
import type { ReactNode } from 'react';
import React from 'react';
import type { RouteContextType } from '../../index';
import type { FooterToolBarToken } from './style';
export type FooterToolbarProps = {
extra?: React.ReactNode;
style?: React.CSSProperties;
className?: string;
renderContent?: (props: FooterToolbarProps & RouteContextType & {
leftWidth?: string;
}, dom: JSX.Element) => ReactNode;
prefixCls?: string;
stylish?: GenerateStyle<FooterToolBarToken>;
children?: React.ReactNode;
portalDom?: boolean;
};
declare const FooterToolbar: React.FC<FooterToolbarProps>;
export { FooterToolbar };

View File

@@ -0,0 +1,96 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["children", "className", "extra", "portalDom", "style", "renderContent"];
/* eslint-disable react-hooks/exhaustive-deps */
import { isBrowser } from '@ant-design/pro-utils';
import { ConfigProvider } from 'antd';
import classNames from 'classnames';
import omit from "rc-util/es/omit";
import React, { useContext, useEffect, useMemo } from 'react';
import { createPortal } from 'react-dom';
import { RouteContext } from "../../index";
import { useStyle } from "./style";
import { useStylish } from "./style/stylish";
import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var FooterToolbar = function FooterToolbar(props) {
var children = props.children,
className = props.className,
extra = props.extra,
_props$portalDom = props.portalDom,
portalDom = _props$portalDom === void 0 ? true : _props$portalDom,
style = props.style,
renderContent = props.renderContent,
restProps = _objectWithoutProperties(props, _excluded);
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls,
getTargetContainer = _useContext.getTargetContainer;
var prefixCls = props.prefixCls || getPrefixCls('pro');
var baseClassName = "".concat(prefixCls, "-footer-bar");
var _useStyle = useStyle(baseClassName),
wrapSSR = _useStyle.wrapSSR,
hashId = _useStyle.hashId;
var value = useContext(RouteContext);
var width = useMemo(function () {
var hasSiderMenu = value.hasSiderMenu,
isMobile = value.isMobile,
siderWidth = value.siderWidth;
if (!hasSiderMenu) {
return undefined;
}
// 0 or undefined
if (!siderWidth) {
return '100%';
}
return isMobile ? '100%' : "calc(100% - ".concat(siderWidth, "px)");
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [value.collapsed, value.hasSiderMenu, value.isMobile, value.siderWidth]);
var containerDom = useMemo(function () {
if (typeof window === 'undefined' || typeof document === 'undefined') return null;
// 只读取一次就行了,不然总是的渲染
return (getTargetContainer === null || getTargetContainer === void 0 ? void 0 : getTargetContainer()) || document.body;
}, []);
var stylish = useStylish("".concat(baseClassName, ".").concat(baseClassName, "-stylish"), {
stylish: props.stylish
});
var dom = /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx("div", {
className: "".concat(baseClassName, "-left ").concat(hashId).trim(),
children: extra
}), /*#__PURE__*/_jsx("div", {
className: "".concat(baseClassName, "-right ").concat(hashId).trim(),
children: children
})]
});
/** 告诉 props 是否存在 footerBar */
useEffect(function () {
if (!value || !(value !== null && value !== void 0 && value.setHasFooterToolbar)) {
return function () {};
}
value === null || value === void 0 || value.setHasFooterToolbar(true);
return function () {
var _value$setHasFooterTo;
value === null || value === void 0 || (_value$setHasFooterTo = value.setHasFooterToolbar) === null || _value$setHasFooterTo === void 0 || _value$setHasFooterTo.call(value, false);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
var renderDom = /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
className: classNames(className, hashId, baseClassName, _defineProperty({}, "".concat(baseClassName, "-stylish"), !!props.stylish)),
style: _objectSpread({
width: width
}, style)
}, omit(restProps, ['prefixCls'])), {}, {
children: renderContent ? renderContent(_objectSpread(_objectSpread(_objectSpread({}, props), value), {}, {
leftWidth: width
}), dom) : dom
}));
var ssrDom = !isBrowser() || !portalDom || !containerDom ? renderDom : /*#__PURE__*/createPortal(renderDom, containerDom, baseClassName);
return stylish.wrapSSR(wrapSSR( /*#__PURE__*/_jsx(React.Fragment, {
children: ssrDom
}, baseClassName)));
};
export { FooterToolbar };

View File

@@ -0,0 +1,9 @@
/// <reference types="react" />
import type { ProAliasToken } from '@ant-design/pro-provider';
export interface FooterToolBarToken extends ProAliasToken {
componentCls: string;
}
export declare function useStyle(prefixCls: string): {
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
hashId: string;
};

View File

@@ -0,0 +1,47 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { setAlpha, useStyle as useAntdStyle } from '@ant-design/pro-provider';
var genFooterToolBarStyle = function genFooterToolBarStyle(token) {
return _defineProperty({}, token.componentCls, {
position: 'fixed',
insetInlineEnd: 0,
bottom: 0,
zIndex: 99,
display: 'flex',
alignItems: 'center',
width: '100%',
paddingInline: 24,
paddingBlock: 0,
boxSizing: 'border-box',
lineHeight: '64px',
/* A way to reset the style of the component. */
backgroundColor: setAlpha(token.colorBgElevated, 0.6),
borderBlockStart: "1px solid ".concat(token.colorSplit),
'-webkit-backdrop-filter': 'blur(8px)',
backdropFilter: 'blur(8px)',
color: token.colorText,
transition: 'all 0.2s ease 0s',
'&-left': {
flex: 1,
color: token.colorText
},
'&-right': {
color: token.colorText,
'> *': {
marginInlineEnd: 8,
'&:last-child': {
marginBlock: 0,
marginInline: 0
}
}
}
});
};
export function useStyle(prefixCls) {
return useAntdStyle('ProLayoutFooterToolbar', function (token) {
var proCardToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
return [genFooterToolBarStyle(proCardToken)];
});
}

View File

@@ -0,0 +1,11 @@
/// <reference types="react" />
import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
export interface stylishToken extends ProAliasToken {
componentCls: string;
}
export declare function useStylish(prefixCls: string, { stylish, }: {
stylish?: GenerateStyle<stylishToken>;
}): {
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
hashId: string;
};

View File

@@ -0,0 +1,13 @@
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export function useStylish(prefixCls, _ref) {
var stylish = _ref.stylish;
return useAntdStyle('ProLayoutFooterToolbarStylish', function (token) {
var stylishToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
if (!stylish) return [];
return [_defineProperty({}, "".concat(stylishToken.componentCls), stylish === null || stylish === void 0 ? void 0 : stylish(stylishToken))];
});
}