first commit
This commit is contained in:
29
frontend/node_modules/antd/lib/notification/PurePanel.d.ts
generated
vendored
Normal file
29
frontend/node_modules/antd/lib/notification/PurePanel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import type { NoticeProps } from 'rc-notification/lib/Notice';
|
||||
import type { IconType } from './interface';
|
||||
export declare const TypeIcon: {
|
||||
info: React.JSX.Element;
|
||||
success: React.JSX.Element;
|
||||
error: React.JSX.Element;
|
||||
warning: React.JSX.Element;
|
||||
loading: React.JSX.Element;
|
||||
};
|
||||
export declare function getCloseIcon(prefixCls: string, closeIcon?: React.ReactNode): React.ReactNode;
|
||||
export interface PureContentProps {
|
||||
prefixCls: string;
|
||||
icon?: React.ReactNode;
|
||||
message?: React.ReactNode;
|
||||
description?: React.ReactNode;
|
||||
/** @deprecated Please use `actions` instead */
|
||||
btn?: React.ReactNode;
|
||||
actions?: React.ReactNode;
|
||||
type?: IconType;
|
||||
role?: 'alert' | 'status';
|
||||
}
|
||||
export declare const PureContent: React.FC<PureContentProps>;
|
||||
export interface PurePanelProps extends Omit<NoticeProps, 'prefixCls' | 'eventKey'>, Omit<PureContentProps, 'prefixCls' | 'children'> {
|
||||
prefixCls?: string;
|
||||
}
|
||||
/** @private Internal Component. Do not use in your production. */
|
||||
declare const PurePanel: React.FC<PurePanelProps>;
|
||||
export default PurePanel;
|
||||
139
frontend/node_modules/antd/lib/notification/PurePanel.js
generated
vendored
Normal file
139
frontend/node_modules/antd/lib/notification/PurePanel.js
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.TypeIcon = exports.PureContent = void 0;
|
||||
exports.getCloseIcon = getCloseIcon;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _CheckCircleFilled = _interopRequireDefault(require("@ant-design/icons/CheckCircleFilled"));
|
||||
var _CloseCircleFilled = _interopRequireDefault(require("@ant-design/icons/CloseCircleFilled"));
|
||||
var _CloseOutlined = _interopRequireDefault(require("@ant-design/icons/CloseOutlined"));
|
||||
var _ExclamationCircleFilled = _interopRequireDefault(require("@ant-design/icons/ExclamationCircleFilled"));
|
||||
var _InfoCircleFilled = _interopRequireDefault(require("@ant-design/icons/InfoCircleFilled"));
|
||||
var _LoadingOutlined = _interopRequireDefault(require("@ant-design/icons/LoadingOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcNotification = require("rc-notification");
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var _purePanel = _interopRequireDefault(require("./style/pure-panel"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const TypeIcon = exports.TypeIcon = {
|
||||
info: /*#__PURE__*/React.createElement(_InfoCircleFilled.default, null),
|
||||
success: /*#__PURE__*/React.createElement(_CheckCircleFilled.default, null),
|
||||
error: /*#__PURE__*/React.createElement(_CloseCircleFilled.default, null),
|
||||
warning: /*#__PURE__*/React.createElement(_ExclamationCircleFilled.default, null),
|
||||
loading: /*#__PURE__*/React.createElement(_LoadingOutlined.default, null)
|
||||
};
|
||||
function getCloseIcon(prefixCls, closeIcon) {
|
||||
if (closeIcon === null || closeIcon === false) {
|
||||
return null;
|
||||
}
|
||||
return closeIcon || /*#__PURE__*/React.createElement(_CloseOutlined.default, {
|
||||
className: `${prefixCls}-close-icon`
|
||||
});
|
||||
}
|
||||
const typeToIcon = {
|
||||
success: _CheckCircleFilled.default,
|
||||
info: _InfoCircleFilled.default,
|
||||
error: _CloseCircleFilled.default,
|
||||
warning: _ExclamationCircleFilled.default
|
||||
};
|
||||
const PureContent = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
icon,
|
||||
type,
|
||||
message,
|
||||
description,
|
||||
actions,
|
||||
role = 'alert'
|
||||
} = props;
|
||||
let iconNode = null;
|
||||
if (icon) {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-icon`
|
||||
}, icon);
|
||||
} else if (type) {
|
||||
iconNode = /*#__PURE__*/React.createElement(typeToIcon[type] || null, {
|
||||
className: (0, _classnames.default)(`${prefixCls}-icon`, `${prefixCls}-icon-${type}`)
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
className: (0, _classnames.default)({
|
||||
[`${prefixCls}-with-icon`]: iconNode
|
||||
}),
|
||||
role: role
|
||||
}, iconNode, /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-message`
|
||||
}, message), description && /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-description`
|
||||
}, description), actions && /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-actions`
|
||||
}, actions));
|
||||
};
|
||||
/** @private Internal Component. Do not use in your production. */
|
||||
exports.PureContent = PureContent;
|
||||
const PurePanel = props => {
|
||||
const {
|
||||
prefixCls: staticPrefixCls,
|
||||
className,
|
||||
icon,
|
||||
type,
|
||||
message,
|
||||
description,
|
||||
btn,
|
||||
actions,
|
||||
closable = true,
|
||||
closeIcon,
|
||||
className: notificationClassName
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "className", "icon", "type", "message", "description", "btn", "actions", "closable", "closeIcon", "className"]);
|
||||
const {
|
||||
getPrefixCls
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Notification');
|
||||
warning.deprecated(!btn, 'btn', 'actions');
|
||||
}
|
||||
const prefixCls = staticPrefixCls || getPrefixCls('notification');
|
||||
const noticePrefixCls = `${prefixCls}-notice`;
|
||||
const rootCls = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls, rootCls);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
||||
className: (0, _classnames.default)(`${noticePrefixCls}-pure-panel`, hashId, className, cssVarCls, rootCls)
|
||||
}, /*#__PURE__*/React.createElement(_purePanel.default, {
|
||||
prefixCls: prefixCls
|
||||
}), /*#__PURE__*/React.createElement(_rcNotification.Notice, Object.assign({}, restProps, {
|
||||
prefixCls: prefixCls,
|
||||
eventKey: "pure",
|
||||
duration: null,
|
||||
closable: closable,
|
||||
className: (0, _classnames.default)({
|
||||
notificationClassName
|
||||
}),
|
||||
closeIcon: getCloseIcon(prefixCls, closeIcon),
|
||||
content: /*#__PURE__*/React.createElement(PureContent, {
|
||||
prefixCls: noticePrefixCls,
|
||||
icon: icon,
|
||||
type: type,
|
||||
message: message,
|
||||
description: description,
|
||||
actions: mergedActions
|
||||
})
|
||||
}))));
|
||||
};
|
||||
var _default = exports.default = PurePanel;
|
||||
26
frontend/node_modules/antd/lib/notification/index.d.ts
generated
vendored
Normal file
26
frontend/node_modules/antd/lib/notification/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import type { ArgsProps, GlobalConfigProps } from './interface';
|
||||
import PurePanel from './PurePanel';
|
||||
import useNotification from './useNotification';
|
||||
export type { ArgsProps };
|
||||
interface BaseMethods {
|
||||
open: (config: ArgsProps) => void;
|
||||
destroy: (key?: React.Key) => void;
|
||||
config: (config: GlobalConfigProps) => void;
|
||||
useNotification: typeof useNotification;
|
||||
/** @private Internal Component. Do not use in your production. */
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
||||
}
|
||||
type StaticFn = (config: ArgsProps) => void;
|
||||
interface NoticeMethods {
|
||||
success: StaticFn;
|
||||
info: StaticFn;
|
||||
warning: StaticFn;
|
||||
error: StaticFn;
|
||||
}
|
||||
declare const staticMethods: NoticeMethods & BaseMethods;
|
||||
declare const actWrapper: (wrapper: any) => void;
|
||||
export { actWrapper };
|
||||
declare const actDestroy: () => void;
|
||||
export { actDestroy };
|
||||
export default staticMethods;
|
||||
205
frontend/node_modules/antd/lib/notification/index.js
generated
vendored
Normal file
205
frontend/node_modules/antd/lib/notification/index.js
generated
vendored
Normal file
@@ -0,0 +1,205 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.actWrapper = exports.actDestroy = void 0;
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var _context = require("../app/context");
|
||||
var _configProvider = _interopRequireWildcard(require("../config-provider"));
|
||||
var _UnstableContext = require("../config-provider/UnstableContext");
|
||||
var _PurePanel = _interopRequireDefault(require("./PurePanel"));
|
||||
var _useNotification = _interopRequireWildcard(require("./useNotification"));
|
||||
let notification = null;
|
||||
let act = callback => callback();
|
||||
let taskQueue = [];
|
||||
let defaultGlobalConfig = {};
|
||||
function getGlobalContext() {
|
||||
const {
|
||||
getContainer,
|
||||
rtl,
|
||||
maxCount,
|
||||
top,
|
||||
bottom,
|
||||
showProgress,
|
||||
pauseOnHover
|
||||
} = defaultGlobalConfig;
|
||||
const mergedContainer = (getContainer === null || getContainer === void 0 ? void 0 : getContainer()) || document.body;
|
||||
return {
|
||||
getContainer: () => mergedContainer,
|
||||
rtl,
|
||||
maxCount,
|
||||
top,
|
||||
bottom,
|
||||
showProgress,
|
||||
pauseOnHover
|
||||
};
|
||||
}
|
||||
const GlobalHolder = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
||||
const {
|
||||
notificationConfig,
|
||||
sync
|
||||
} = props;
|
||||
const {
|
||||
getPrefixCls
|
||||
} = (0, _react.useContext)(_configProvider.ConfigContext);
|
||||
const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls('notification');
|
||||
const appConfig = (0, _react.useContext)(_context.AppConfigContext);
|
||||
const [api, holder] = (0, _useNotification.useInternalNotification)(Object.assign(Object.assign(Object.assign({}, notificationConfig), {
|
||||
prefixCls
|
||||
}), appConfig.notification));
|
||||
_react.default.useEffect(sync, []);
|
||||
_react.default.useImperativeHandle(ref, () => {
|
||||
const instance = Object.assign({}, api);
|
||||
Object.keys(instance).forEach(method => {
|
||||
instance[method] = (...args) => {
|
||||
sync();
|
||||
return api[method].apply(api, args);
|
||||
};
|
||||
});
|
||||
return {
|
||||
instance,
|
||||
sync
|
||||
};
|
||||
});
|
||||
return holder;
|
||||
});
|
||||
const GlobalHolderWrapper = /*#__PURE__*/_react.default.forwardRef((_, ref) => {
|
||||
const [notificationConfig, setNotificationConfig] = _react.default.useState(getGlobalContext);
|
||||
const sync = () => {
|
||||
setNotificationConfig(getGlobalContext);
|
||||
};
|
||||
_react.default.useEffect(sync, []);
|
||||
const global = (0, _configProvider.globalConfig)();
|
||||
const rootPrefixCls = global.getRootPrefixCls();
|
||||
const rootIconPrefixCls = global.getIconPrefixCls();
|
||||
const theme = global.getTheme();
|
||||
const dom = /*#__PURE__*/_react.default.createElement(GlobalHolder, {
|
||||
ref: ref,
|
||||
sync: sync,
|
||||
notificationConfig: notificationConfig
|
||||
});
|
||||
return /*#__PURE__*/_react.default.createElement(_configProvider.default, {
|
||||
prefixCls: rootPrefixCls,
|
||||
iconPrefixCls: rootIconPrefixCls,
|
||||
theme: theme
|
||||
}, global.holderRender ? global.holderRender(dom) : dom);
|
||||
});
|
||||
const flushNotificationQueue = () => {
|
||||
if (!notification) {
|
||||
const holderFragment = document.createDocumentFragment();
|
||||
const newNotification = {
|
||||
fragment: holderFragment
|
||||
};
|
||||
notification = newNotification;
|
||||
// Delay render to avoid sync issue
|
||||
act(() => {
|
||||
const reactRender = (0, _UnstableContext.unstableSetRender)();
|
||||
reactRender(/*#__PURE__*/_react.default.createElement(GlobalHolderWrapper, {
|
||||
ref: node => {
|
||||
const {
|
||||
instance,
|
||||
sync
|
||||
} = node || {};
|
||||
Promise.resolve().then(() => {
|
||||
if (!newNotification.instance && instance) {
|
||||
newNotification.instance = instance;
|
||||
newNotification.sync = sync;
|
||||
flushNotificationQueue();
|
||||
}
|
||||
});
|
||||
}
|
||||
}), holderFragment);
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Notification not ready
|
||||
if (!notification.instance) {
|
||||
return;
|
||||
}
|
||||
// >>> Execute task
|
||||
taskQueue.forEach(task => {
|
||||
switch (task.type) {
|
||||
case 'open':
|
||||
{
|
||||
act(() => {
|
||||
notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'destroy':
|
||||
act(() => {
|
||||
var _a;
|
||||
(_a = notification === null || notification === void 0 ? void 0 : notification.instance) === null || _a === void 0 ? void 0 : _a.destroy(task.key);
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
// Clean up
|
||||
taskQueue = [];
|
||||
};
|
||||
// ==============================================================================
|
||||
// == Export ==
|
||||
// ==============================================================================
|
||||
function setNotificationGlobalConfig(config) {
|
||||
defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);
|
||||
// Trigger sync for it
|
||||
act(() => {
|
||||
var _a;
|
||||
(_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);
|
||||
});
|
||||
}
|
||||
function open(config) {
|
||||
const global = (0, _configProvider.globalConfig)();
|
||||
if (process.env.NODE_ENV !== 'production' && !global.holderRender) {
|
||||
(0, _configProvider.warnContext)('notification');
|
||||
}
|
||||
taskQueue.push({
|
||||
type: 'open',
|
||||
config
|
||||
});
|
||||
flushNotificationQueue();
|
||||
}
|
||||
const destroy = key => {
|
||||
taskQueue.push({
|
||||
type: 'destroy',
|
||||
key
|
||||
});
|
||||
flushNotificationQueue();
|
||||
};
|
||||
const methods = ['success', 'info', 'warning', 'error'];
|
||||
const baseStaticMethods = {
|
||||
open,
|
||||
destroy,
|
||||
config: setNotificationGlobalConfig,
|
||||
useNotification: _useNotification.default,
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: _PurePanel.default
|
||||
};
|
||||
const staticMethods = baseStaticMethods;
|
||||
methods.forEach(type => {
|
||||
staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {
|
||||
type
|
||||
}));
|
||||
});
|
||||
// ==============================================================================
|
||||
// == Test ==
|
||||
// ==============================================================================
|
||||
const noop = () => {};
|
||||
let _actWrapper = noop;
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
_actWrapper = wrapper => {
|
||||
act = wrapper;
|
||||
};
|
||||
}
|
||||
const actWrapper = exports.actWrapper = _actWrapper;
|
||||
let _actDestroy = noop;
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
_actDestroy = () => {
|
||||
notification = null;
|
||||
};
|
||||
}
|
||||
const actDestroy = exports.actDestroy = _actDestroy;
|
||||
var _default = exports.default = staticMethods;
|
||||
71
frontend/node_modules/antd/lib/notification/interface.d.ts
generated
vendored
Normal file
71
frontend/node_modules/antd/lib/notification/interface.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import type * as React from 'react';
|
||||
import type { ClosableType } from '../_util/hooks';
|
||||
interface DivProps extends React.HTMLProps<HTMLDivElement> {
|
||||
'data-testid'?: string;
|
||||
}
|
||||
export declare const NotificationPlacements: readonly ["top", "topLeft", "topRight", "bottom", "bottomLeft", "bottomRight"];
|
||||
export type NotificationPlacement = (typeof NotificationPlacements)[number];
|
||||
export type IconType = 'success' | 'info' | 'error' | 'warning';
|
||||
export interface ArgsProps {
|
||||
message: React.ReactNode;
|
||||
description?: React.ReactNode;
|
||||
/** @deprecated Please use `actions` instead */
|
||||
btn?: React.ReactNode;
|
||||
actions?: React.ReactNode;
|
||||
key?: React.Key;
|
||||
onClose?: () => void;
|
||||
duration?: number | null;
|
||||
showProgress?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
placement?: NotificationPlacement;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
readonly type?: IconType;
|
||||
onClick?: () => void;
|
||||
closeIcon?: React.ReactNode;
|
||||
closable?: ClosableType;
|
||||
props?: DivProps;
|
||||
role?: 'alert' | 'status';
|
||||
}
|
||||
type StaticFn = (args: ArgsProps) => void;
|
||||
export interface NotificationInstance {
|
||||
success: StaticFn;
|
||||
error: StaticFn;
|
||||
info: StaticFn;
|
||||
warning: StaticFn;
|
||||
open: StaticFn;
|
||||
destroy: (key?: React.Key) => void;
|
||||
}
|
||||
export interface GlobalConfigProps {
|
||||
top?: number;
|
||||
bottom?: number;
|
||||
duration?: number;
|
||||
showProgress?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
prefixCls?: string;
|
||||
getContainer?: () => HTMLElement | ShadowRoot;
|
||||
placement?: NotificationPlacement;
|
||||
closeIcon?: React.ReactNode;
|
||||
closable?: ClosableType;
|
||||
rtl?: boolean;
|
||||
maxCount?: number;
|
||||
props?: DivProps;
|
||||
}
|
||||
export interface NotificationConfig {
|
||||
top?: number;
|
||||
bottom?: number;
|
||||
prefixCls?: string;
|
||||
getContainer?: () => HTMLElement | ShadowRoot;
|
||||
placement?: NotificationPlacement;
|
||||
maxCount?: number;
|
||||
rtl?: boolean;
|
||||
stack?: boolean | {
|
||||
threshold?: number;
|
||||
};
|
||||
duration?: number;
|
||||
showProgress?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
closeIcon?: React.ReactNode;
|
||||
}
|
||||
export {};
|
||||
7
frontend/node_modules/antd/lib/notification/interface.js
generated
vendored
Normal file
7
frontend/node_modules/antd/lib/notification/interface.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NotificationPlacements = void 0;
|
||||
const NotificationPlacements = exports.NotificationPlacements = ['top', 'topLeft', 'topRight', 'bottom', 'bottomLeft', 'bottomRight'];
|
||||
113
frontend/node_modules/antd/lib/notification/style/index.d.ts
generated
vendored
Normal file
113
frontend/node_modules/antd/lib/notification/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { AliasToken, FullToken, GenStyleFn } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 提醒框 z-index
|
||||
* @descEN z-index of Notification
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
/**
|
||||
* @desc 提醒框宽度
|
||||
* @descEN Width of Notification
|
||||
*/
|
||||
width: number | string;
|
||||
/**
|
||||
* @desc 成功提醒框容器背景色
|
||||
* @descEN Background color of success notification container
|
||||
*/
|
||||
colorSuccessBg?: string;
|
||||
/**
|
||||
* @desc 错误提醒框容器背景色
|
||||
* @descEN Background color of error notification container
|
||||
*/
|
||||
colorErrorBg?: string;
|
||||
/**
|
||||
* @desc 信息提醒框容器背景色
|
||||
* @descEN Background color of info notification container
|
||||
*/
|
||||
colorInfoBg?: string;
|
||||
/**
|
||||
* @desc 警告提醒框容器背景色
|
||||
* @descEN Background color of warning notification container
|
||||
*/
|
||||
colorWarningBg?: string;
|
||||
}
|
||||
/**
|
||||
* @desc Notification 组件的 Token
|
||||
* @descEN Token for Notification component
|
||||
*/
|
||||
export interface NotificationToken extends FullToken<'Notification'> {
|
||||
/**
|
||||
* @desc 动画最大高度
|
||||
* @descEN Maximum height of animation
|
||||
*/
|
||||
animationMaxHeight: number | string;
|
||||
/**
|
||||
* @desc 提醒框背景色
|
||||
* @descEN Background color of Notification
|
||||
*/
|
||||
notificationBg: string;
|
||||
/**
|
||||
* @desc 提醒框内边距
|
||||
* @descEN Padding of Notification
|
||||
*/
|
||||
notificationPadding: string;
|
||||
/**
|
||||
* @desc 提醒框垂直内边距
|
||||
* @descEN Vertical padding of Notification
|
||||
*/
|
||||
notificationPaddingVertical: number;
|
||||
/**
|
||||
* @desc 提醒框水平内边距
|
||||
* @descEN Horizontal padding of Notification
|
||||
*/
|
||||
notificationPaddingHorizontal: number;
|
||||
/**
|
||||
* @desc 提醒框图标尺寸
|
||||
* @descEN Icon size of Notification
|
||||
*/
|
||||
notificationIconSize: number | string;
|
||||
/**
|
||||
* @desc 提醒框关闭按钮尺寸
|
||||
* @descEN Close button size of Notification
|
||||
*/
|
||||
notificationCloseButtonSize: number | string;
|
||||
/**
|
||||
* @desc 提醒框底部外边距
|
||||
* @descEN Bottom margin of Notification
|
||||
*/
|
||||
notificationMarginBottom: number;
|
||||
/**
|
||||
* @desc 提醒框边缘外边距
|
||||
* @descEN Edge margin of Notification
|
||||
*/
|
||||
notificationMarginEdge: number;
|
||||
/**
|
||||
* @desc 提醒框堆叠层数
|
||||
* @descEN Stack layer of Notification
|
||||
*/
|
||||
notificationStackLayer: number;
|
||||
/**
|
||||
* @desc 提醒框进度条背景色
|
||||
* @descEN Background color of Notification progress bar
|
||||
*/
|
||||
notificationProgressBg: string;
|
||||
/**
|
||||
* @desc 提醒框进度条高度
|
||||
* @descEN Height of Notification progress bar
|
||||
*/
|
||||
notificationProgressHeight: number;
|
||||
}
|
||||
export declare const genNoticeStyle: (token: NotificationToken) => CSSObject;
|
||||
export declare const prepareComponentToken: (token: AliasToken) => {
|
||||
zIndexPopup: number;
|
||||
width: number;
|
||||
colorSuccessBg: undefined;
|
||||
colorErrorBg: undefined;
|
||||
colorInfoBg: undefined;
|
||||
colorWarningBg: undefined;
|
||||
};
|
||||
export declare const prepareNotificationToken: (token: Parameters<GenStyleFn<'Notification'>>[0]) => NotificationToken;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
285
frontend/node_modules/antd/lib/notification/style/index.js
generated
vendored
Normal file
285
frontend/node_modules/antd/lib/notification/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareNotificationToken = exports.prepareComponentToken = exports.genNoticeStyle = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _hooks = require("../../_util/hooks");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _placement = _interopRequireDefault(require("./placement"));
|
||||
var _stack = _interopRequireDefault(require("./stack"));
|
||||
const genNoticeStyle = token => {
|
||||
const {
|
||||
iconCls,
|
||||
componentCls,
|
||||
// .ant-notification
|
||||
boxShadow,
|
||||
fontSizeLG,
|
||||
notificationMarginBottom,
|
||||
borderRadiusLG,
|
||||
colorSuccess,
|
||||
colorInfo,
|
||||
colorWarning,
|
||||
colorError,
|
||||
colorTextHeading,
|
||||
notificationBg,
|
||||
notificationPadding,
|
||||
notificationMarginEdge,
|
||||
notificationProgressBg,
|
||||
notificationProgressHeight,
|
||||
fontSize,
|
||||
lineHeight,
|
||||
width,
|
||||
notificationIconSize,
|
||||
colorText,
|
||||
colorSuccessBg,
|
||||
colorErrorBg,
|
||||
colorInfoBg,
|
||||
colorWarningBg
|
||||
} = token;
|
||||
const noticeCls = `${componentCls}-notice`;
|
||||
return {
|
||||
position: 'relative',
|
||||
marginBottom: notificationMarginBottom,
|
||||
marginInlineStart: 'auto',
|
||||
background: notificationBg,
|
||||
borderRadius: borderRadiusLG,
|
||||
boxShadow,
|
||||
[noticeCls]: {
|
||||
padding: notificationPadding,
|
||||
width,
|
||||
maxWidth: `calc(100vw - ${(0, _cssinjs.unit)(token.calc(notificationMarginEdge).mul(2).equal())})`,
|
||||
lineHeight,
|
||||
wordWrap: 'break-word',
|
||||
borderRadius: borderRadiusLG,
|
||||
overflow: 'hidden',
|
||||
// Type-specific background colors
|
||||
'&-success': colorSuccessBg ? {
|
||||
background: colorSuccessBg
|
||||
} : {},
|
||||
'&-error': colorErrorBg ? {
|
||||
background: colorErrorBg
|
||||
} : {},
|
||||
'&-info': colorInfoBg ? {
|
||||
background: colorInfoBg
|
||||
} : {},
|
||||
'&-warning': colorWarningBg ? {
|
||||
background: colorWarningBg
|
||||
} : {}
|
||||
},
|
||||
[`${noticeCls}-message`]: {
|
||||
color: colorTextHeading,
|
||||
fontSize: fontSizeLG,
|
||||
lineHeight: token.lineHeightLG
|
||||
},
|
||||
[`${noticeCls}-description`]: {
|
||||
fontSize,
|
||||
color: colorText,
|
||||
marginTop: token.marginXS
|
||||
},
|
||||
[`${noticeCls}-closable ${noticeCls}-message`]: {
|
||||
paddingInlineEnd: token.paddingLG
|
||||
},
|
||||
[`${noticeCls}-with-icon ${noticeCls}-message`]: {
|
||||
marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
|
||||
fontSize: fontSizeLG
|
||||
},
|
||||
[`${noticeCls}-with-icon ${noticeCls}-description`]: {
|
||||
marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
|
||||
fontSize
|
||||
},
|
||||
// Icon & color style in different selector level
|
||||
// https://github.com/ant-design/ant-design/issues/16503
|
||||
// https://github.com/ant-design/ant-design/issues/15512
|
||||
[`${noticeCls}-icon`]: {
|
||||
position: 'absolute',
|
||||
fontSize: notificationIconSize,
|
||||
lineHeight: 1,
|
||||
// icon-font
|
||||
[`&-success${iconCls}`]: {
|
||||
color: colorSuccess
|
||||
},
|
||||
[`&-info${iconCls}`]: {
|
||||
color: colorInfo
|
||||
},
|
||||
[`&-warning${iconCls}`]: {
|
||||
color: colorWarning
|
||||
},
|
||||
[`&-error${iconCls}`]: {
|
||||
color: colorError
|
||||
}
|
||||
},
|
||||
[`${noticeCls}-close`]: Object.assign({
|
||||
position: 'absolute',
|
||||
top: token.notificationPaddingVertical,
|
||||
insetInlineEnd: token.notificationPaddingHorizontal,
|
||||
color: token.colorIcon,
|
||||
outline: 'none',
|
||||
width: token.notificationCloseButtonSize,
|
||||
height: token.notificationCloseButtonSize,
|
||||
borderRadius: token.borderRadiusSM,
|
||||
transition: `background-color ${token.motionDurationMid}, color ${token.motionDurationMid}`,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
'&:hover': {
|
||||
color: token.colorIconHover,
|
||||
backgroundColor: token.colorBgTextHover
|
||||
},
|
||||
'&:active': {
|
||||
backgroundColor: token.colorBgTextActive
|
||||
}
|
||||
}, (0, _style.genFocusStyle)(token)),
|
||||
[`${noticeCls}-progress`]: {
|
||||
position: 'absolute',
|
||||
display: 'block',
|
||||
appearance: 'none',
|
||||
inlineSize: `calc(100% - ${(0, _cssinjs.unit)(borderRadiusLG)} * 2)`,
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: borderRadiusLG
|
||||
},
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: borderRadiusLG
|
||||
},
|
||||
bottom: 0,
|
||||
blockSize: notificationProgressHeight,
|
||||
border: 0,
|
||||
'&, &::-webkit-progress-bar': {
|
||||
borderRadius: borderRadiusLG,
|
||||
backgroundColor: `rgba(0, 0, 0, 0.04)`
|
||||
},
|
||||
'&::-moz-progress-bar': {
|
||||
background: notificationProgressBg
|
||||
},
|
||||
'&::-webkit-progress-value': {
|
||||
borderRadius: borderRadiusLG,
|
||||
background: notificationProgressBg
|
||||
}
|
||||
},
|
||||
[`${noticeCls}-actions`]: {
|
||||
float: 'right',
|
||||
marginTop: token.marginSM
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.genNoticeStyle = genNoticeStyle;
|
||||
const genNotificationStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
// .ant-notification
|
||||
notificationMarginBottom,
|
||||
notificationMarginEdge,
|
||||
motionDurationMid,
|
||||
motionEaseInOut
|
||||
} = token;
|
||||
const noticeCls = `${componentCls}-notice`;
|
||||
const fadeOut = new _cssinjs.Keyframes('antNotificationFadeOut', {
|
||||
'0%': {
|
||||
maxHeight: token.animationMaxHeight,
|
||||
marginBottom: notificationMarginBottom
|
||||
},
|
||||
'100%': {
|
||||
maxHeight: 0,
|
||||
marginBottom: 0,
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
opacity: 0
|
||||
}
|
||||
});
|
||||
return [
|
||||
// ============================ Holder ============================
|
||||
{
|
||||
[componentCls]: Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
position: 'fixed',
|
||||
zIndex: token.zIndexPopup,
|
||||
marginRight: {
|
||||
value: notificationMarginEdge,
|
||||
_skip_check_: true
|
||||
},
|
||||
[`${componentCls}-hook-holder`]: {
|
||||
position: 'relative'
|
||||
},
|
||||
// animation
|
||||
[`${componentCls}-fade-appear-prepare`]: {
|
||||
opacity: '0 !important'
|
||||
},
|
||||
[`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: {
|
||||
animationDuration: token.motionDurationMid,
|
||||
animationTimingFunction: motionEaseInOut,
|
||||
animationFillMode: 'both',
|
||||
opacity: 0,
|
||||
animationPlayState: 'paused'
|
||||
},
|
||||
[`${componentCls}-fade-leave`]: {
|
||||
animationTimingFunction: motionEaseInOut,
|
||||
animationFillMode: 'both',
|
||||
animationDuration: motionDurationMid,
|
||||
animationPlayState: 'paused'
|
||||
},
|
||||
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
|
||||
animationPlayState: 'running'
|
||||
},
|
||||
[`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: {
|
||||
animationName: fadeOut,
|
||||
animationPlayState: 'running'
|
||||
},
|
||||
// RTL
|
||||
'&-rtl': {
|
||||
direction: 'rtl',
|
||||
[`${noticeCls}-actions`]: {
|
||||
float: 'left'
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// ============================ Notice ============================
|
||||
{
|
||||
[componentCls]: {
|
||||
[`${noticeCls}-wrapper`]: genNoticeStyle(token)
|
||||
}
|
||||
}];
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
const prepareComponentToken = token => ({
|
||||
zIndexPopup: token.zIndexPopupBase + _hooks.CONTAINER_MAX_OFFSET + 50,
|
||||
width: 384,
|
||||
// Fix notification background color issue
|
||||
// https://github.com/ant-design/ant-design/issues/55649
|
||||
// https://github.com/ant-design/ant-design/issues/56055
|
||||
colorSuccessBg: undefined,
|
||||
colorErrorBg: undefined,
|
||||
colorInfoBg: undefined,
|
||||
colorWarningBg: undefined
|
||||
});
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
const prepareNotificationToken = token => {
|
||||
const notificationPaddingVertical = token.paddingMD;
|
||||
const notificationPaddingHorizontal = token.paddingLG;
|
||||
const notificationToken = (0, _internal.mergeToken)(token, {
|
||||
notificationBg: token.colorBgElevated,
|
||||
notificationPaddingVertical,
|
||||
notificationPaddingHorizontal,
|
||||
notificationIconSize: token.calc(token.fontSizeLG).mul(token.lineHeightLG).equal(),
|
||||
notificationCloseButtonSize: token.calc(token.controlHeightLG).mul(0.55).equal(),
|
||||
notificationMarginBottom: token.margin,
|
||||
notificationPadding: `${(0, _cssinjs.unit)(token.paddingMD)} ${(0, _cssinjs.unit)(token.paddingContentHorizontalLG)}`,
|
||||
notificationMarginEdge: token.marginLG,
|
||||
animationMaxHeight: 150,
|
||||
notificationStackLayer: 3,
|
||||
notificationProgressHeight: 2,
|
||||
notificationProgressBg: `linear-gradient(90deg, ${token.colorPrimaryBorderHover}, ${token.colorPrimary})`
|
||||
});
|
||||
return notificationToken;
|
||||
};
|
||||
exports.prepareNotificationToken = prepareNotificationToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Notification', token => {
|
||||
const notificationToken = prepareNotificationToken(token);
|
||||
return [genNotificationStyle(notificationToken), (0, _placement.default)(notificationToken), (0, _stack.default)(notificationToken)];
|
||||
}, prepareComponentToken);
|
||||
5
frontend/node_modules/antd/lib/notification/style/placement.d.ts
generated
vendored
Normal file
5
frontend/node_modules/antd/lib/notification/style/placement.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { NotificationToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
declare const genNotificationPlacementStyle: GenerateStyle<NotificationToken, CSSObject>;
|
||||
export default genNotificationPlacementStyle;
|
||||
98
frontend/node_modules/antd/lib/notification/style/placement.js
generated
vendored
Normal file
98
frontend/node_modules/antd/lib/notification/style/placement.js
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
const genNotificationPlacementStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
notificationMarginEdge,
|
||||
animationMaxHeight
|
||||
} = token;
|
||||
const noticeCls = `${componentCls}-notice`;
|
||||
const rightFadeIn = new _cssinjs.Keyframes('antNotificationFadeIn', {
|
||||
'0%': {
|
||||
transform: `translate3d(100%, 0, 0)`,
|
||||
opacity: 0
|
||||
},
|
||||
'100%': {
|
||||
transform: `translate3d(0, 0, 0)`,
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
const topFadeIn = new _cssinjs.Keyframes('antNotificationTopFadeIn', {
|
||||
'0%': {
|
||||
top: -animationMaxHeight,
|
||||
opacity: 0
|
||||
},
|
||||
'100%': {
|
||||
top: 0,
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
const bottomFadeIn = new _cssinjs.Keyframes('antNotificationBottomFadeIn', {
|
||||
'0%': {
|
||||
bottom: token.calc(animationMaxHeight).mul(-1).equal(),
|
||||
opacity: 0
|
||||
},
|
||||
'100%': {
|
||||
bottom: 0,
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
const leftFadeIn = new _cssinjs.Keyframes('antNotificationLeftFadeIn', {
|
||||
'0%': {
|
||||
transform: `translate3d(-100%, 0, 0)`,
|
||||
opacity: 0
|
||||
},
|
||||
'100%': {
|
||||
transform: `translate3d(0, 0, 0)`,
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
return {
|
||||
[componentCls]: {
|
||||
[`&${componentCls}-top, &${componentCls}-bottom`]: {
|
||||
marginInline: 0,
|
||||
[noticeCls]: {
|
||||
marginInline: 'auto auto'
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-top`]: {
|
||||
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
|
||||
animationName: topFadeIn
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-bottom`]: {
|
||||
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
|
||||
animationName: bottomFadeIn
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-topRight, &${componentCls}-bottomRight`]: {
|
||||
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
|
||||
animationName: rightFadeIn
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {
|
||||
marginRight: {
|
||||
value: 0,
|
||||
_skip_check_: true
|
||||
},
|
||||
marginLeft: {
|
||||
value: notificationMarginEdge,
|
||||
_skip_check_: true
|
||||
},
|
||||
[noticeCls]: {
|
||||
marginInlineEnd: 'auto',
|
||||
marginInlineStart: 0
|
||||
},
|
||||
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
|
||||
animationName: leftFadeIn
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
var _default = exports.default = genNotificationPlacementStyle;
|
||||
2
frontend/node_modules/antd/lib/notification/style/pure-panel.d.ts
generated
vendored
Normal file
2
frontend/node_modules/antd/lib/notification/style/pure-panel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: import("react").FunctionComponent<import("@ant-design/cssinjs-utils/lib/util/genStyleUtils").SubStyleComponentProps>;
|
||||
export default _default;
|
||||
20
frontend/node_modules/antd/lib/notification/style/pure-panel.js
generated
vendored
Normal file
20
frontend/node_modules/antd/lib/notification/style/pure-panel.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _ = require(".");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _default = exports.default = (0, _internal.genSubStyleComponent)(['Notification', 'PurePanel'], token => {
|
||||
const noticeCls = `${token.componentCls}-notice`;
|
||||
const notificationToken = (0, _.prepareNotificationToken)(token);
|
||||
return {
|
||||
[`${noticeCls}-pure-panel`]: Object.assign(Object.assign({}, (0, _.genNoticeStyle)(notificationToken)), {
|
||||
width: notificationToken.width,
|
||||
maxWidth: `calc(100vw - ${(0, _cssinjs.unit)(token.calc(notificationToken.notificationMarginEdge).mul(2).equal())})`,
|
||||
margin: 0
|
||||
})
|
||||
};
|
||||
}, _.prepareComponentToken);
|
||||
4
frontend/node_modules/antd/lib/notification/style/stack.d.ts
generated
vendored
Normal file
4
frontend/node_modules/antd/lib/notification/style/stack.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { NotificationToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
declare const genStackStyle: GenerateStyle<NotificationToken>;
|
||||
export default genStackStyle;
|
||||
103
frontend/node_modules/antd/lib/notification/style/stack.js
generated
vendored
Normal file
103
frontend/node_modules/antd/lib/notification/style/stack.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _interface = require("../interface");
|
||||
const placementAlignProperty = {
|
||||
topLeft: 'left',
|
||||
topRight: 'right',
|
||||
bottomLeft: 'left',
|
||||
bottomRight: 'right',
|
||||
top: 'left',
|
||||
bottom: 'left'
|
||||
};
|
||||
const genPlacementStackStyle = (token, placement) => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
[`${componentCls}-${placement}`]: {
|
||||
[`&${componentCls}-stack > ${componentCls}-notice-wrapper`]: {
|
||||
[placement.startsWith('top') ? 'top' : 'bottom']: 0,
|
||||
[placementAlignProperty[placement]]: {
|
||||
value: 0,
|
||||
_skip_check_: true
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genStackChildrenStyle = token => {
|
||||
const childrenStyle = {};
|
||||
for (let i = 1; i < token.notificationStackLayer; i++) {
|
||||
childrenStyle[`&:nth-last-child(${i + 1})`] = {
|
||||
overflow: 'hidden',
|
||||
[`& > ${token.componentCls}-notice`]: {
|
||||
opacity: 0,
|
||||
transition: `opacity ${token.motionDurationMid}`
|
||||
}
|
||||
};
|
||||
}
|
||||
return Object.assign({
|
||||
[`&:not(:nth-last-child(-n+${token.notificationStackLayer}))`]: {
|
||||
opacity: 0,
|
||||
overflow: 'hidden',
|
||||
color: 'transparent',
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
}, childrenStyle);
|
||||
};
|
||||
const genStackedNoticeStyle = token => {
|
||||
const childrenStyle = {};
|
||||
for (let i = 1; i < token.notificationStackLayer; i++) {
|
||||
childrenStyle[`&:nth-last-child(${i + 1})`] = {
|
||||
background: token.colorBgBlur,
|
||||
backdropFilter: 'blur(10px)',
|
||||
'-webkit-backdrop-filter': 'blur(10px)'
|
||||
};
|
||||
}
|
||||
return Object.assign({}, childrenStyle);
|
||||
};
|
||||
const genStackStyle = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return Object.assign({
|
||||
[`${componentCls}-stack`]: {
|
||||
[`& > ${componentCls}-notice-wrapper`]: Object.assign({
|
||||
transition: `transform ${token.motionDurationSlow}, backdrop-filter 0s`,
|
||||
willChange: 'transform, opacity',
|
||||
position: 'absolute'
|
||||
}, genStackChildrenStyle(token))
|
||||
},
|
||||
[`${componentCls}-stack:not(${componentCls}-stack-expanded)`]: {
|
||||
[`& > ${componentCls}-notice-wrapper`]: Object.assign({}, genStackedNoticeStyle(token))
|
||||
},
|
||||
[`${componentCls}-stack${componentCls}-stack-expanded`]: {
|
||||
[`& > ${componentCls}-notice-wrapper`]: {
|
||||
'&:not(:nth-last-child(-n + 1))': {
|
||||
opacity: 1,
|
||||
overflow: 'unset',
|
||||
color: 'inherit',
|
||||
pointerEvents: 'auto',
|
||||
[`& > ${token.componentCls}-notice`]: {
|
||||
opacity: 1
|
||||
}
|
||||
},
|
||||
'&:after': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
height: token.margin,
|
||||
width: '100%',
|
||||
insetInline: 0,
|
||||
bottom: token.calc(token.margin).mul(-1).equal(),
|
||||
background: 'transparent',
|
||||
pointerEvents: 'auto'
|
||||
}
|
||||
}
|
||||
}
|
||||
}, _interface.NotificationPlacements.map(placement => genPlacementStackStyle(token, placement)).reduce((acc, cur) => Object.assign(Object.assign({}, acc), cur), {}));
|
||||
};
|
||||
var _default = exports.default = genStackStyle;
|
||||
8
frontend/node_modules/antd/lib/notification/useNotification.d.ts
generated
vendored
Normal file
8
frontend/node_modules/antd/lib/notification/useNotification.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import type { NotificationConfig, NotificationInstance } from './interface';
|
||||
type HolderProps = NotificationConfig & {
|
||||
onAllRemoved?: VoidFunction;
|
||||
};
|
||||
export declare function useInternalNotification(notificationConfig?: HolderProps): readonly [NotificationInstance, React.ReactElement];
|
||||
export default function useNotification(notificationConfig?: NotificationConfig): readonly [NotificationInstance, React.ReactElement<unknown, string | React.JSXElementConstructor<any>>];
|
||||
export {};
|
||||
198
frontend/node_modules/antd/lib/notification/useNotification.js
generated
vendored
Normal file
198
frontend/node_modules/antd/lib/notification/useNotification.js
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useNotification;
|
||||
exports.useInternalNotification = useInternalNotification;
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcNotification = require("rc-notification");
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _internal = require("../theme/internal");
|
||||
var _PurePanel = require("./PurePanel");
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var _util = require("./util");
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const DEFAULT_OFFSET = 24;
|
||||
const DEFAULT_DURATION = 4.5;
|
||||
const DEFAULT_PLACEMENT = 'topRight';
|
||||
const Wrapper = ({
|
||||
children,
|
||||
prefixCls
|
||||
}) => {
|
||||
const rootCls = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls, rootCls);
|
||||
return wrapCSSVar(/*#__PURE__*/_react.default.createElement(_rcNotification.NotificationProvider, {
|
||||
classNames: {
|
||||
list: (0, _classnames.default)(hashId, cssVarCls, rootCls)
|
||||
}
|
||||
}, children));
|
||||
};
|
||||
const renderNotifications = (node, {
|
||||
prefixCls,
|
||||
key
|
||||
}) => (/*#__PURE__*/_react.default.createElement(Wrapper, {
|
||||
prefixCls: prefixCls,
|
||||
key: key
|
||||
}, node));
|
||||
const Holder = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
||||
const {
|
||||
top,
|
||||
bottom,
|
||||
prefixCls: staticPrefixCls,
|
||||
getContainer: staticGetContainer,
|
||||
maxCount,
|
||||
rtl,
|
||||
onAllRemoved,
|
||||
stack,
|
||||
duration,
|
||||
pauseOnHover = true,
|
||||
showProgress
|
||||
} = props;
|
||||
const {
|
||||
getPrefixCls,
|
||||
getPopupContainer,
|
||||
notification,
|
||||
direction
|
||||
} = (0, _react.useContext)(_configProvider.ConfigContext);
|
||||
const [, token] = (0, _internal.useToken)();
|
||||
const prefixCls = staticPrefixCls || getPrefixCls('notification');
|
||||
// =============================== Style ===============================
|
||||
const getStyle = placement => (0, _util.getPlacementStyle)(placement, top !== null && top !== void 0 ? top : DEFAULT_OFFSET, bottom !== null && bottom !== void 0 ? bottom : DEFAULT_OFFSET);
|
||||
const getClassName = () => (0, _classnames.default)({
|
||||
[`${prefixCls}-rtl`]: rtl !== null && rtl !== void 0 ? rtl : direction === 'rtl'
|
||||
});
|
||||
// ============================== Motion ===============================
|
||||
const getNotificationMotion = () => (0, _util.getMotion)(prefixCls);
|
||||
// ============================== Origin ===============================
|
||||
const [api, holder] = (0, _rcNotification.useNotification)({
|
||||
prefixCls,
|
||||
style: getStyle,
|
||||
className: getClassName,
|
||||
motion: getNotificationMotion,
|
||||
closable: true,
|
||||
closeIcon: (0, _PurePanel.getCloseIcon)(prefixCls),
|
||||
duration: duration !== null && duration !== void 0 ? duration : DEFAULT_DURATION,
|
||||
getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,
|
||||
maxCount,
|
||||
pauseOnHover,
|
||||
showProgress,
|
||||
onAllRemoved,
|
||||
renderNotifications,
|
||||
stack: stack === false ? false : {
|
||||
threshold: typeof stack === 'object' ? stack === null || stack === void 0 ? void 0 : stack.threshold : undefined,
|
||||
offset: 8,
|
||||
gap: token.margin
|
||||
}
|
||||
});
|
||||
// ================================ Ref ================================
|
||||
_react.default.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {
|
||||
prefixCls,
|
||||
notification
|
||||
}));
|
||||
return holder;
|
||||
});
|
||||
// ==============================================================================
|
||||
// == Hook ==
|
||||
// ==============================================================================
|
||||
function useInternalNotification(notificationConfig) {
|
||||
const holderRef = _react.default.useRef(null);
|
||||
const warning = (0, _warning.devUseWarning)('Notification');
|
||||
// ================================ API ================================
|
||||
const wrapAPI = _react.default.useMemo(() => {
|
||||
// Wrap with notification content
|
||||
// >>> Open
|
||||
const open = config => {
|
||||
var _a;
|
||||
if (!holderRef.current) {
|
||||
process.env.NODE_ENV !== "production" ? warning(false, 'usage', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : void 0;
|
||||
return;
|
||||
}
|
||||
const {
|
||||
open: originOpen,
|
||||
prefixCls,
|
||||
notification
|
||||
} = holderRef.current;
|
||||
const noticePrefixCls = `${prefixCls}-notice`;
|
||||
const {
|
||||
message,
|
||||
description,
|
||||
icon,
|
||||
type,
|
||||
btn,
|
||||
actions,
|
||||
className,
|
||||
style,
|
||||
role = 'alert',
|
||||
closeIcon,
|
||||
closable
|
||||
} = config,
|
||||
restConfig = __rest(config, ["message", "description", "icon", "type", "btn", "actions", "className", "style", "role", "closeIcon", "closable"]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warning.deprecated(!btn, 'btn', 'actions');
|
||||
}
|
||||
const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
|
||||
const realCloseIcon = (0, _PurePanel.getCloseIcon)(noticePrefixCls, (0, _util.getCloseIconConfig)(closeIcon, notificationConfig, notification));
|
||||
return originOpen(Object.assign(Object.assign({
|
||||
// use placement from props instead of hard-coding "topRight"
|
||||
placement: (_a = notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.placement) !== null && _a !== void 0 ? _a : DEFAULT_PLACEMENT
|
||||
}, restConfig), {
|
||||
content: (/*#__PURE__*/_react.default.createElement(_PurePanel.PureContent, {
|
||||
prefixCls: noticePrefixCls,
|
||||
icon: icon,
|
||||
type: type,
|
||||
message: message,
|
||||
description: description,
|
||||
actions: mergedActions,
|
||||
role: role
|
||||
})),
|
||||
className: (0, _classnames.default)(type && `${noticePrefixCls}-${type}`, className, notification === null || notification === void 0 ? void 0 : notification.className),
|
||||
style: Object.assign(Object.assign({}, notification === null || notification === void 0 ? void 0 : notification.style), style),
|
||||
closeIcon: realCloseIcon,
|
||||
closable: closable !== null && closable !== void 0 ? closable : !!realCloseIcon
|
||||
}));
|
||||
};
|
||||
// >>> destroy
|
||||
const destroy = key => {
|
||||
var _a, _b;
|
||||
if (key !== undefined) {
|
||||
(_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);
|
||||
} else {
|
||||
(_b = holderRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
|
||||
}
|
||||
};
|
||||
const clone = {
|
||||
open,
|
||||
destroy
|
||||
};
|
||||
const keys = ['success', 'info', 'warning', 'error'];
|
||||
keys.forEach(type => {
|
||||
clone[type] = config => open(Object.assign(Object.assign({}, config), {
|
||||
type
|
||||
}));
|
||||
});
|
||||
return clone;
|
||||
}, []);
|
||||
// ============================== Return ===============================
|
||||
return [wrapAPI, /*#__PURE__*/_react.default.createElement(Holder, Object.assign({
|
||||
key: "notification-holder"
|
||||
}, notificationConfig, {
|
||||
ref: holderRef
|
||||
}))];
|
||||
}
|
||||
function useNotification(notificationConfig) {
|
||||
return useInternalNotification(notificationConfig);
|
||||
}
|
||||
7
frontend/node_modules/antd/lib/notification/util.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/lib/notification/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type * as React from 'react';
|
||||
import type { CSSMotionProps } from 'rc-motion';
|
||||
import type { NotificationConfig, NotificationPlacement } from './interface';
|
||||
import type { NotificationConfig as CPNotificationConfig } from '../config-provider/context';
|
||||
export declare function getPlacementStyle(placement: NotificationPlacement, top: number, bottom: number): React.CSSProperties;
|
||||
export declare function getMotion(prefixCls: string): CSSMotionProps;
|
||||
export declare function getCloseIconConfig(closeIcon: React.ReactNode, notificationConfig?: NotificationConfig, notification?: CPNotificationConfig): React.ReactNode;
|
||||
74
frontend/node_modules/antd/lib/notification/util.js
generated
vendored
Normal file
74
frontend/node_modules/antd/lib/notification/util.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getCloseIconConfig = getCloseIconConfig;
|
||||
exports.getMotion = getMotion;
|
||||
exports.getPlacementStyle = getPlacementStyle;
|
||||
function getPlacementStyle(placement, top, bottom) {
|
||||
let style;
|
||||
switch (placement) {
|
||||
case 'top':
|
||||
style = {
|
||||
left: '50%',
|
||||
transform: 'translateX(-50%)',
|
||||
right: 'auto',
|
||||
top,
|
||||
bottom: 'auto'
|
||||
};
|
||||
break;
|
||||
case 'topLeft':
|
||||
style = {
|
||||
left: 0,
|
||||
top,
|
||||
bottom: 'auto'
|
||||
};
|
||||
break;
|
||||
case 'topRight':
|
||||
style = {
|
||||
right: 0,
|
||||
top,
|
||||
bottom: 'auto'
|
||||
};
|
||||
break;
|
||||
case 'bottom':
|
||||
style = {
|
||||
left: '50%',
|
||||
transform: 'translateX(-50%)',
|
||||
right: 'auto',
|
||||
top: 'auto',
|
||||
bottom
|
||||
};
|
||||
break;
|
||||
case 'bottomLeft':
|
||||
style = {
|
||||
left: 0,
|
||||
top: 'auto',
|
||||
bottom
|
||||
};
|
||||
break;
|
||||
default:
|
||||
style = {
|
||||
right: 0,
|
||||
top: 'auto',
|
||||
bottom
|
||||
};
|
||||
break;
|
||||
}
|
||||
return style;
|
||||
}
|
||||
function getMotion(prefixCls) {
|
||||
return {
|
||||
motionName: `${prefixCls}-fade`
|
||||
};
|
||||
}
|
||||
function getCloseIconConfig(closeIcon, notificationConfig, notification) {
|
||||
if (typeof closeIcon !== 'undefined') {
|
||||
return closeIcon;
|
||||
}
|
||||
if (typeof (notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.closeIcon) !== 'undefined') {
|
||||
return notificationConfig.closeIcon;
|
||||
}
|
||||
return notification === null || notification === void 0 ? void 0 : notification.closeIcon;
|
||||
}
|
||||
Reference in New Issue
Block a user