add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
export type MemoChildrenProps = {
shouldUpdate: boolean;
children: React.ReactNode;
};
declare const _default: React.MemoExoticComponent<({ children }: MemoChildrenProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>>;
export default _default;

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
export default /*#__PURE__*/React.memo(function (_ref) {
var children = _ref.children;
return children;
}, function (_, _ref2) {
var shouldUpdate = _ref2.shouldUpdate;
return !shouldUpdate;
});

15
node_modules/rc-dialog/es/Dialog/Content/Panel.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import React from 'react';
import type { IDialogPropTypes } from '../../IDialogPropTypes';
export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
prefixCls: string;
ariaId?: string;
onMouseDown?: React.MouseEventHandler;
onMouseUp?: React.MouseEventHandler;
holderRef?: React.Ref<HTMLDivElement>;
}
export type ContentRef = {
focus: () => void;
changeActive: (next: boolean) => void;
};
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<ContentRef>>;
export default Panel;

148
node_modules/rc-dialog/es/Dialog/Content/Panel.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import classNames from 'classnames';
import { useComposeRef } from "rc-util/es/ref";
import React, { useMemo, useRef } from 'react';
import { RefContext } from "../../context";
import MemoChildren from "./MemoChildren";
import pickAttrs from "rc-util/es/pickAttrs";
var sentinelStyle = {
width: 0,
height: 0,
overflow: 'hidden',
outline: 'none'
};
var entityStyle = {
outline: 'none'
};
var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
var prefixCls = props.prefixCls,
className = props.className,
style = props.style,
title = props.title,
ariaId = props.ariaId,
footer = props.footer,
closable = props.closable,
closeIcon = props.closeIcon,
onClose = props.onClose,
children = props.children,
bodyStyle = props.bodyStyle,
bodyProps = props.bodyProps,
modalRender = props.modalRender,
onMouseDown = props.onMouseDown,
onMouseUp = props.onMouseUp,
holderRef = props.holderRef,
visible = props.visible,
forceRender = props.forceRender,
width = props.width,
height = props.height,
modalClassNames = props.classNames,
modalStyles = props.styles;
// ================================= Refs =================================
var _React$useContext = React.useContext(RefContext),
panelRef = _React$useContext.panel;
var mergedRef = useComposeRef(holderRef, panelRef);
var sentinelStartRef = useRef();
var sentinelEndRef = useRef();
React.useImperativeHandle(ref, function () {
return {
focus: function focus() {
var _sentinelStartRef$cur;
(_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
preventScroll: true
});
},
changeActive: function changeActive(next) {
var _document = document,
activeElement = _document.activeElement;
if (next && activeElement === sentinelEndRef.current) {
sentinelStartRef.current.focus({
preventScroll: true
});
} else if (!next && activeElement === sentinelStartRef.current) {
sentinelEndRef.current.focus({
preventScroll: true
});
}
}
};
});
// ================================ Style =================================
var contentStyle = {};
if (width !== undefined) {
contentStyle.width = width;
}
if (height !== undefined) {
contentStyle.height = height;
}
// ================================ Render ================================
var footerNode = footer ? /*#__PURE__*/React.createElement("div", {
className: classNames("".concat(prefixCls, "-footer"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.footer),
style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.footer)
}, footer) : null;
var headerNode = title ? /*#__PURE__*/React.createElement("div", {
className: classNames("".concat(prefixCls, "-header"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.header),
style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header)
}, /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-title"),
id: ariaId
}, title)) : null;
var closableObj = useMemo(function () {
if (_typeof(closable) === 'object' && closable !== null) {
return closable;
}
if (closable) {
return {
closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-close-x")
})
};
}
return {};
}, [closable, closeIcon, prefixCls]);
var ariaProps = pickAttrs(closableObj, true);
var closeBtnIsDisabled = _typeof(closable) === 'object' && closable.disabled;
var closerNode = closable ? /*#__PURE__*/React.createElement("button", _extends({
type: "button",
onClick: onClose,
"aria-label": "Close"
}, ariaProps, {
className: "".concat(prefixCls, "-close"),
disabled: closeBtnIsDisabled
}), closableObj.closeIcon) : null;
var content = /*#__PURE__*/React.createElement("div", {
className: classNames("".concat(prefixCls, "-content"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.content),
style: modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content
}, closerNode, headerNode, /*#__PURE__*/React.createElement("div", _extends({
className: classNames("".concat(prefixCls, "-body"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.body),
style: _objectSpread(_objectSpread({}, bodyStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
}, bodyProps), children), footerNode);
return /*#__PURE__*/React.createElement("div", {
key: "dialog-element",
role: "dialog",
"aria-labelledby": title ? ariaId : null,
"aria-modal": "true",
ref: mergedRef,
style: _objectSpread(_objectSpread({}, style), contentStyle),
className: classNames(prefixCls, className),
onMouseDown: onMouseDown,
onMouseUp: onMouseUp
}, /*#__PURE__*/React.createElement("div", {
ref: sentinelStartRef,
tabIndex: 0,
style: entityStyle
}, /*#__PURE__*/React.createElement(MemoChildren, {
shouldUpdate: visible || forceRender
}, modalRender ? modalRender(content) : content)), /*#__PURE__*/React.createElement("div", {
tabIndex: 0,
ref: sentinelEndRef,
style: sentinelStyle
}));
});
if (process.env.NODE_ENV !== 'production') {
Panel.displayName = 'Panel';
}
export default Panel;

13
node_modules/rc-dialog/es/Dialog/Content/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import * as React from 'react';
import type { PanelProps, ContentRef } from './Panel';
export type ContentProps = {
motionName: string;
ariaId: string;
onVisibleChanged: (visible: boolean) => void;
} & PanelProps;
declare const Content: React.ForwardRefExoticComponent<{
motionName: string;
ariaId: string;
onVisibleChanged: (visible: boolean) => void;
} & PanelProps & React.RefAttributes<ContentRef>>;
export default Content;

63
node_modules/rc-dialog/es/Dialog/Content/index.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
import { useRef } from 'react';
import classNames from 'classnames';
import CSSMotion from 'rc-motion';
import { offset } from "../../util";
import Panel from "./Panel";
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
var prefixCls = props.prefixCls,
title = props.title,
style = props.style,
className = props.className,
visible = props.visible,
forceRender = props.forceRender,
destroyOnClose = props.destroyOnClose,
motionName = props.motionName,
ariaId = props.ariaId,
onVisibleChanged = props.onVisibleChanged,
mousePosition = props.mousePosition;
var dialogRef = useRef();
// ============================= Style ==============================
var _React$useState = React.useState(),
_React$useState2 = _slicedToArray(_React$useState, 2),
transformOrigin = _React$useState2[0],
setTransformOrigin = _React$useState2[1];
var contentStyle = {};
if (transformOrigin) {
contentStyle.transformOrigin = transformOrigin;
}
function onPrepare() {
var elementOffset = offset(dialogRef.current);
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
}
// ============================= Render =============================
return /*#__PURE__*/React.createElement(CSSMotion, {
visible: visible,
onVisibleChanged: onVisibleChanged,
onAppearPrepare: onPrepare,
onEnterPrepare: onPrepare,
forceRender: forceRender,
motionName: motionName,
removeOnLeave: destroyOnClose,
ref: dialogRef
}, function (_ref, motionRef) {
var motionClassName = _ref.className,
motionStyle = _ref.style;
return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {
ref: ref,
title: title,
ariaId: ariaId,
prefixCls: prefixCls,
holderRef: motionRef,
style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),
className: classNames(className, motionClassName)
}));
});
});
Content.displayName = 'Content';
export default Content;

11
node_modules/rc-dialog/es/Dialog/Mask.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import * as React from 'react';
export type MaskProps = {
prefixCls: string;
visible: boolean;
motionName?: string;
style?: React.CSSProperties;
maskProps?: React.HTMLAttributes<HTMLDivElement>;
className?: string;
};
declare const Mask: React.FC<MaskProps>;
export default Mask;

28
node_modules/rc-dialog/es/Dialog/Mask.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import * as React from 'react';
import classNames from 'classnames';
import CSSMotion from 'rc-motion';
var Mask = function Mask(props) {
var prefixCls = props.prefixCls,
style = props.style,
visible = props.visible,
maskProps = props.maskProps,
motionName = props.motionName,
className = props.className;
return /*#__PURE__*/React.createElement(CSSMotion, {
key: "mask",
visible: visible,
motionName: motionName,
leavedClassName: "".concat(prefixCls, "-mask-hidden")
}, function (_ref, ref) {
var motionClassName = _ref.className,
motionStyle = _ref.style;
return /*#__PURE__*/React.createElement("div", _extends({
ref: ref,
style: _objectSpread(_objectSpread({}, motionStyle), style),
className: classNames("".concat(prefixCls, "-mask"), motionClassName, className)
}, maskProps));
});
};
export default Mask;

4
node_modules/rc-dialog/es/Dialog/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IDialogPropTypes } from '../IDialogPropTypes';
declare const Dialog: React.FC<IDialogPropTypes>;
export default Dialog;

201
node_modules/rc-dialog/es/Dialog/index.js generated vendored Normal file
View File

@@ -0,0 +1,201 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import classNames from 'classnames';
import contains from "rc-util/es/Dom/contains";
import useId from "rc-util/es/hooks/useId";
import KeyCode from "rc-util/es/KeyCode";
import pickAttrs from "rc-util/es/pickAttrs";
import * as React from 'react';
import { useEffect, useRef } from 'react';
import { getMotionName } from "../util";
import Content from "./Content";
import Mask from "./Mask";
import { warning } from "rc-util/es/warning";
var Dialog = function Dialog(props) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-dialog' : _props$prefixCls,
zIndex = props.zIndex,
_props$visible = props.visible,
visible = _props$visible === void 0 ? false : _props$visible,
_props$keyboard = props.keyboard,
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
_props$focusTriggerAf = props.focusTriggerAfterClose,
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
wrapStyle = props.wrapStyle,
wrapClassName = props.wrapClassName,
wrapProps = props.wrapProps,
onClose = props.onClose,
afterOpenChange = props.afterOpenChange,
afterClose = props.afterClose,
transitionName = props.transitionName,
animation = props.animation,
_props$closable = props.closable,
closable = _props$closable === void 0 ? true : _props$closable,
_props$mask = props.mask,
mask = _props$mask === void 0 ? true : _props$mask,
maskTransitionName = props.maskTransitionName,
maskAnimation = props.maskAnimation,
_props$maskClosable = props.maskClosable,
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
maskStyle = props.maskStyle,
maskProps = props.maskProps,
rootClassName = props.rootClassName,
modalClassNames = props.classNames,
modalStyles = props.styles;
if (process.env.NODE_ENV !== 'production') {
['wrapStyle', 'bodyStyle', 'maskStyle'].forEach(function (prop) {
// (prop in props) && console.error(`Warning: ${prop} is deprecated, please use styles instead.`)
warning(!(prop in props), "".concat(prop, " is deprecated, please use styles instead."));
});
if ('wrapClassName' in props) {
warning(false, "wrapClassName is deprecated, please use classNames instead.");
}
}
var lastOutSideActiveElementRef = useRef();
var wrapperRef = useRef();
var contentRef = useRef();
var _React$useState = React.useState(visible),
_React$useState2 = _slicedToArray(_React$useState, 2),
animatedVisible = _React$useState2[0],
setAnimatedVisible = _React$useState2[1];
// ========================== Init ==========================
var ariaId = useId();
function saveLastOutSideActiveElementRef() {
if (!contains(wrapperRef.current, document.activeElement)) {
lastOutSideActiveElementRef.current = document.activeElement;
}
}
function focusDialogContent() {
if (!contains(wrapperRef.current, document.activeElement)) {
var _contentRef$current;
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();
}
}
// ========================= Events =========================
function onDialogVisibleChanged(newVisible) {
// Try to focus
if (newVisible) {
focusDialogContent();
} else {
// Clean up scroll bar & focus back
setAnimatedVisible(false);
if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
try {
lastOutSideActiveElementRef.current.focus({
preventScroll: true
});
} catch (e) {
// Do nothing
}
lastOutSideActiveElementRef.current = null;
}
// Trigger afterClose only when change visible from true to false
if (animatedVisible) {
afterClose === null || afterClose === void 0 || afterClose();
}
}
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(newVisible);
}
function onInternalClose(e) {
onClose === null || onClose === void 0 || onClose(e);
}
// >>> Content
var contentClickRef = useRef(false);
var contentTimeoutRef = useRef();
// We need record content click incase content popup out of dialog
var onContentMouseDown = function onContentMouseDown() {
clearTimeout(contentTimeoutRef.current);
contentClickRef.current = true;
};
var onContentMouseUp = function onContentMouseUp() {
contentTimeoutRef.current = setTimeout(function () {
contentClickRef.current = false;
});
};
// >>> Wrapper
// Close only when element not on dialog
var onWrapperClick = null;
if (maskClosable) {
onWrapperClick = function onWrapperClick(e) {
if (contentClickRef.current) {
contentClickRef.current = false;
} else if (wrapperRef.current === e.target) {
onInternalClose(e);
}
};
}
function onWrapperKeyDown(e) {
if (keyboard && e.keyCode === KeyCode.ESC) {
e.stopPropagation();
onInternalClose(e);
return;
}
// keep focus inside dialog
if (visible && e.keyCode === KeyCode.TAB) {
contentRef.current.changeActive(!e.shiftKey);
}
}
// ========================= Effect =========================
useEffect(function () {
if (visible) {
setAnimatedVisible(true);
saveLastOutSideActiveElementRef();
}
}, [visible]);
// Remove direct should also check the scroll bar update
useEffect(function () {
return function () {
clearTimeout(contentTimeoutRef.current);
};
}, []);
var mergedStyle = _objectSpread(_objectSpread(_objectSpread({
zIndex: zIndex
}, wrapStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.wrapper), {}, {
display: !animatedVisible ? 'none' : null
});
// ========================= Render =========================
return /*#__PURE__*/React.createElement("div", _extends({
className: classNames("".concat(prefixCls, "-root"), rootClassName)
}, pickAttrs(props, {
data: true
})), /*#__PURE__*/React.createElement(Mask, {
prefixCls: prefixCls,
visible: mask && visible,
motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
style: _objectSpread(_objectSpread({
zIndex: zIndex
}, maskStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.mask),
maskProps: maskProps,
className: modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.mask
}), /*#__PURE__*/React.createElement("div", _extends({
tabIndex: -1,
onKeyDown: onWrapperKeyDown,
className: classNames("".concat(prefixCls, "-wrap"), wrapClassName, modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.wrapper),
ref: wrapperRef,
onClick: onWrapperClick,
style: mergedStyle
}, wrapProps), /*#__PURE__*/React.createElement(Content, _extends({}, props, {
onMouseDown: onContentMouseDown,
onMouseUp: onContentMouseUp,
ref: contentRef,
closable: closable,
ariaId: ariaId,
prefixCls: prefixCls,
visible: visible && animatedVisible,
onClose: onInternalClose,
onVisibleChanged: onDialogVisibleChanged,
motionName: getMotionName(prefixCls, transitionName, animation)
}))));
};
export default Dialog;