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,15 @@
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
import React from 'react';
/**
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
*
* @param props
*/
export declare const LabelIconTip: React.FC<{
label: React.ReactNode;
subTitle?: React.ReactNode;
tooltip?: string | LabelTooltipType;
ellipsis?: boolean | {
showTitle?: boolean;
};
}>;

View File

@@ -0,0 +1,61 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { InfoCircleOutlined } from '@ant-design/icons';
import { ConfigProvider, Tooltip } from 'antd';
import classNames from 'classnames';
import React, { useContext } from 'react';
import { useStyle } from "./style";
/**
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
*
* @param props
*/
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export var LabelIconTip = /*#__PURE__*/React.memo(function (props) {
var label = props.label,
tooltip = props.tooltip,
ellipsis = props.ellipsis,
subTitle = props.subTitle;
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls;
var className = getPrefixCls('pro-core-label-tip');
var _useStyle = useStyle(className),
wrapSSR = _useStyle.wrapSSR,
hashId = _useStyle.hashId;
if (!tooltip && !subTitle) {
return /*#__PURE__*/_jsx(_Fragment, {
children: label
});
}
var tooltipProps = typeof tooltip === 'string' || /*#__PURE__*/React.isValidElement(tooltip) ? {
title: tooltip
} : tooltip;
var icon = (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.icon) || /*#__PURE__*/_jsx(InfoCircleOutlined, {});
return wrapSSR( /*#__PURE__*/_jsxs("div", {
className: classNames(className, hashId),
onMouseDown: function onMouseDown(e) {
return e.stopPropagation();
},
onMouseLeave: function onMouseLeave(e) {
return e.stopPropagation();
},
onMouseMove: function onMouseMove(e) {
return e.stopPropagation();
},
children: [/*#__PURE__*/_jsx("div", {
className: classNames("".concat(className, "-title"), hashId, _defineProperty({}, "".concat(className, "-title-ellipsis"), ellipsis)),
children: label
}), subTitle && /*#__PURE__*/_jsx("div", {
className: "".concat(className, "-subtitle ").concat(hashId).trim(),
children: subTitle
}), tooltip && /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
children: /*#__PURE__*/_jsx("span", {
className: "".concat(className, "-icon ").concat(hashId).trim(),
children: icon
})
}))]
}));
});

View File

@@ -0,0 +1,9 @@
/// <reference types="react" />
import type { ProAliasToken } from '@ant-design/pro-provider';
export interface ProToken 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,43 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
var genProStyle = function genProStyle(token) {
return _defineProperty({}, token.componentCls, {
display: 'inline-flex',
alignItems: 'center',
maxWidth: '100%',
'&-icon': {
display: 'block',
marginInlineStart: '4px',
cursor: 'pointer',
'&:hover': {
color: token.colorPrimary
}
},
'&-title': {
display: 'inline-flex',
flex: '1'
},
'&-subtitle ': {
marginInlineStart: 8,
color: token.colorTextSecondary,
fontWeight: 'normal',
fontSize: token.fontSize,
whiteSpace: 'nowrap'
},
'&-title-ellipsis': {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
wordBreak: 'keep-all'
}
});
};
export function useStyle(prefixCls) {
return useAntdStyle('LabelIconTip', function (token) {
var proToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
return [genProStyle(proToken)];
});
}