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 @@
export declare function isPlatformMac(): boolean;

View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPlatformMac = isPlatformMac;
function isPlatformMac() {
return true;
}

9
node_modules/rc-select/lib/utils/commonUtil.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { DisplayValueType } from '../BaseSelect';
export declare function toArray<T>(value: T | T[]): T[];
export declare const isClient: HTMLElement;
/** Is client side and not jsdom */
export declare const isBrowserClient: HTMLElement;
export declare function hasValue(value: any): boolean;
/** combo mode no value judgment function */
export declare function isComboNoValue(value: any): boolean;
export declare function getTitle(item: DisplayValueType): string;

44
node_modules/rc-select/lib/utils/commonUtil.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTitle = getTitle;
exports.hasValue = hasValue;
exports.isClient = exports.isBrowserClient = void 0;
exports.isComboNoValue = isComboNoValue;
exports.toArray = toArray;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
function toArray(value) {
if (Array.isArray(value)) {
return value;
}
return value !== undefined ? [value] : [];
}
var isClient = exports.isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
/** Is client side and not jsdom */
var isBrowserClient = exports.isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;
function hasValue(value) {
return value !== undefined && value !== null;
}
/** combo mode no value judgment function */
function isComboNoValue(value) {
return !value && value !== 0;
}
function isTitleType(title) {
return ['string', 'number'].includes((0, _typeof2.default)(title));
}
function getTitle(item) {
var title = undefined;
if (item) {
if (isTitleType(item.title)) {
title = item.title.toString();
} else if (isTitleType(item.label)) {
title = item.label.toString();
}
}
return title;
}

2
node_modules/rc-select/lib/utils/keyUtil.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/** keyCode Judgment function */
export declare function isValidateOpenKey(currentKeyCode: number): boolean;

22
node_modules/rc-select/lib/utils/keyUtil.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidateOpenKey = isValidateOpenKey;
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
/** keyCode Judgment function */
function isValidateOpenKey(currentKeyCode) {
return (
// Undefined for Edge bug:
// https://github.com/ant-design/ant-design/issues/51292
currentKeyCode &&
// Other keys
![
// System function button
_KeyCode.default.ESC, _KeyCode.default.SHIFT, _KeyCode.default.BACKSPACE, _KeyCode.default.TAB, _KeyCode.default.WIN_KEY, _KeyCode.default.ALT, _KeyCode.default.META, _KeyCode.default.WIN_KEY_RIGHT, _KeyCode.default.CTRL, _KeyCode.default.SEMICOLON, _KeyCode.default.EQUALS, _KeyCode.default.CAPS_LOCK, _KeyCode.default.CONTEXT_MENU,
// F1-F12
_KeyCode.default.F1, _KeyCode.default.F2, _KeyCode.default.F3, _KeyCode.default.F4, _KeyCode.default.F5, _KeyCode.default.F6, _KeyCode.default.F7, _KeyCode.default.F8, _KeyCode.default.F9, _KeyCode.default.F10, _KeyCode.default.F11, _KeyCode.default.F12].includes(currentKeyCode)
);
}

3
node_modules/rc-select/lib/utils/legacyUtil.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import * as React from 'react';
import type { BaseOptionType, DefaultOptionType } from '../Select';
export declare function convertChildrenToData<OptionType extends BaseOptionType = DefaultOptionType>(nodes: React.ReactNode, optionOnly?: boolean): OptionType[];

54
node_modules/rc-select/lib/utils/legacyUtil.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.convertChildrenToData = convertChildrenToData;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
var _excluded = ["children", "value"],
_excluded2 = ["children"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function convertNodeToOption(node) {
var _ref = node,
key = _ref.key,
_ref$props = _ref.props,
children = _ref$props.children,
value = _ref$props.value,
restProps = (0, _objectWithoutProperties2.default)(_ref$props, _excluded);
return (0, _objectSpread2.default)({
key: key,
value: value !== undefined ? value : key,
children: children
}, restProps);
}
function convertChildrenToData(nodes) {
var optionOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return (0, _toArray.default)(nodes).map(function (node, index) {
if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {
return null;
}
var _ref2 = node,
isSelectOptGroup = _ref2.type.isSelectOptGroup,
key = _ref2.key,
_ref2$props = _ref2.props,
children = _ref2$props.children,
restProps = (0, _objectWithoutProperties2.default)(_ref2$props, _excluded2);
if (optionOnly || !isSelectOptGroup) {
return convertNodeToOption(node);
}
return (0, _objectSpread2.default)((0, _objectSpread2.default)({
key: "__RC_SELECT_GRP__".concat(key === null ? index : key, "__"),
label: key
}, restProps), {}, {
options: convertChildrenToData(children)
});
}).filter(function (data) {
return data;
});
}

1
node_modules/rc-select/lib/utils/platformUtil.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function isPlatformMac(): boolean;

10
node_modules/rc-select/lib/utils/platformUtil.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPlatformMac = isPlatformMac;
/* istanbul ignore file */
function isPlatformMac() {
return /(mac\sos|macintosh)/i.test(navigator.appVersion);
}

24
node_modules/rc-select/lib/utils/valueUtil.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { BaseOptionType, DefaultOptionType } from '../Select';
import type { FieldNames } from '../Select';
import type { FlattenOptionData } from '../interface';
export declare function isValidCount(value?: number): boolean;
export declare function fillFieldNames(fieldNames: FieldNames | undefined, childrenAsData: boolean): {
label: string;
value: string;
options: string;
groupLabel: string;
};
/**
* Flat options into flatten list.
* We use `optionOnly` here is aim to avoid user use nested option group.
* Here is simply set `key` to the index if not provided.
*/
export declare function flattenOptions<OptionType extends BaseOptionType = DefaultOptionType>(options: OptionType[], { fieldNames, childrenAsData }?: {
fieldNames?: FieldNames;
childrenAsData?: boolean;
}): FlattenOptionData<OptionType>[];
/**
* Inject `props` into `option` for legacy usage
*/
export declare function injectPropsWithOption<T extends object>(option: T): T;
export declare const getSeparatedContent: (text: string, tokens: string[], end?: number) => string[];

139
node_modules/rc-select/lib/utils/valueUtil.js generated vendored Normal file
View File

@@ -0,0 +1,139 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fillFieldNames = fillFieldNames;
exports.flattenOptions = flattenOptions;
exports.getSeparatedContent = void 0;
exports.injectPropsWithOption = injectPropsWithOption;
exports.isValidCount = isValidCount;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
function getKey(data, index) {
var key = data.key;
var value;
if ('value' in data) {
value = data.value;
}
if (key !== null && key !== undefined) {
return key;
}
if (value !== undefined) {
return value;
}
return "rc-index-key-".concat(index);
}
function isValidCount(value) {
return typeof value !== 'undefined' && !Number.isNaN(value);
}
function fillFieldNames(fieldNames, childrenAsData) {
var _ref = fieldNames || {},
label = _ref.label,
value = _ref.value,
options = _ref.options,
groupLabel = _ref.groupLabel;
var mergedLabel = label || (childrenAsData ? 'children' : 'label');
return {
label: mergedLabel,
value: value || 'value',
options: options || 'options',
groupLabel: groupLabel || mergedLabel
};
}
/**
* Flat options into flatten list.
* We use `optionOnly` here is aim to avoid user use nested option group.
* Here is simply set `key` to the index if not provided.
*/
function flattenOptions(options) {
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
fieldNames = _ref2.fieldNames,
childrenAsData = _ref2.childrenAsData;
var flattenList = [];
var _fillFieldNames = fillFieldNames(fieldNames, false),
fieldLabel = _fillFieldNames.label,
fieldValue = _fillFieldNames.value,
fieldOptions = _fillFieldNames.options,
groupLabel = _fillFieldNames.groupLabel;
function dig(list, isGroupOption) {
if (!Array.isArray(list)) {
return;
}
list.forEach(function (data) {
if (isGroupOption || !(fieldOptions in data)) {
var value = data[fieldValue];
// Option
flattenList.push({
key: getKey(data, flattenList.length),
groupOption: isGroupOption,
data: data,
label: data[fieldLabel],
value: value
});
} else {
var grpLabel = data[groupLabel];
if (grpLabel === undefined && childrenAsData) {
grpLabel = data.label;
}
// Option Group
flattenList.push({
key: getKey(data, flattenList.length),
group: true,
data: data,
label: grpLabel
});
dig(data[fieldOptions], true);
}
});
}
dig(options, false);
return flattenList;
}
/**
* Inject `props` into `option` for legacy usage
*/
function injectPropsWithOption(option) {
var newOption = (0, _objectSpread2.default)({}, option);
if (!('props' in newOption)) {
Object.defineProperty(newOption, 'props', {
get: function get() {
(0, _warning.default)(false, 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.');
return newOption;
}
});
}
return newOption;
}
var getSeparatedContent = exports.getSeparatedContent = function getSeparatedContent(text, tokens, end) {
if (!tokens || !tokens.length) {
return null;
}
var match = false;
var separate = function separate(str, _ref3) {
var _ref4 = (0, _toArray2.default)(_ref3),
token = _ref4[0],
restTokens = _ref4.slice(1);
if (!token) {
return [str];
}
var list = str.split(token);
match = match || list.length > 1;
return list.reduce(function (prevList, unitStr) {
return [].concat((0, _toConsumableArray2.default)(prevList), (0, _toConsumableArray2.default)(separate(unitStr, restTokens)));
}, []).filter(Boolean);
};
var list = separate(text, tokens);
if (match) {
return typeof end !== 'undefined' ? list.slice(0, end) : list;
} else {
return null;
}
};

View File

@@ -0,0 +1,4 @@
import type { DefaultOptionType, FieldNames, SelectProps } from '../Select';
declare function warningProps(props: SelectProps): void;
export declare function warningNullOptions(options: DefaultOptionType[], fieldNames: FieldNames): void;
export default warningProps;

137
node_modules/rc-select/lib/utils/warningPropsUtil.js generated vendored Normal file
View File

@@ -0,0 +1,137 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof3 = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.warningNullOptions = warningNullOptions;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
var _warning = _interopRequireWildcard(require("rc-util/lib/warning"));
var React = _interopRequireWildcard(require("react"));
var _BaseSelect = require("../BaseSelect");
var _commonUtil = require("./commonUtil");
var _legacyUtil = require("./legacyUtil");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function warningProps(props) {
var mode = props.mode,
options = props.options,
children = props.children,
backfill = props.backfill,
allowClear = props.allowClear,
placeholder = props.placeholder,
getInputElement = props.getInputElement,
showSearch = props.showSearch,
onSearch = props.onSearch,
defaultOpen = props.defaultOpen,
autoFocus = props.autoFocus,
labelInValue = props.labelInValue,
value = props.value,
inputValue = props.inputValue,
optionLabelProp = props.optionLabelProp;
var multiple = (0, _BaseSelect.isMultiple)(mode);
var mergedShowSearch = showSearch !== undefined ? showSearch : multiple || mode === 'combobox';
var mergedOptions = options || (0, _legacyUtil.convertChildrenToData)(children);
// `tags` should not set option as disabled
(0, _warning.default)(mode !== 'tags' || mergedOptions.every(function (opt) {
return !opt.disabled;
}), 'Please avoid setting option to disabled in tags mode since user can always type text as tag.');
// `combobox` & `tags` should option be `string` type
if (mode === 'tags' || mode === 'combobox') {
var hasNumberValue = mergedOptions.some(function (item) {
if (item.options) {
return item.options.some(function (opt) {
return typeof ('value' in opt ? opt.value : opt.key) === 'number';
});
}
return typeof ('value' in item ? item.value : item.key) === 'number';
});
(0, _warning.default)(!hasNumberValue, '`value` of Option should not use number type when `mode` is `tags` or `combobox`.');
}
// `combobox` should not use `optionLabelProp`
(0, _warning.default)(mode !== 'combobox' || !optionLabelProp, '`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.');
// Only `combobox` support `backfill`
(0, _warning.default)(mode === 'combobox' || !backfill, '`backfill` only works with `combobox` mode.');
// Only `combobox` support `getInputElement`
(0, _warning.default)(mode === 'combobox' || !getInputElement, '`getInputElement` only work with `combobox` mode.');
// Customize `getInputElement` should not use `allowClear` & `placeholder`
(0, _warning.noteOnce)(mode !== 'combobox' || !getInputElement || !allowClear || !placeholder, 'Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.');
// `onSearch` should use in `combobox` or `showSearch`
if (onSearch && !mergedShowSearch && mode !== 'combobox' && mode !== 'tags') {
(0, _warning.default)(false, '`onSearch` should work with `showSearch` instead of use alone.');
}
(0, _warning.noteOnce)(!defaultOpen || autoFocus, '`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.');
if (value !== undefined && value !== null) {
var values = (0, _commonUtil.toArray)(value);
(0, _warning.default)(!labelInValue || values.every(function (val) {
return (0, _typeof2.default)(val) === 'object' && ('key' in val || 'value' in val);
}), '`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`');
(0, _warning.default)(!multiple || Array.isArray(value), '`value` should be array when `mode` is `multiple` or `tags`');
}
// Syntactic sugar should use correct children type
if (children) {
var invalidateChildType = null;
(0, _toArray.default)(children).some(function (node) {
if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {
return false;
}
var _ref = node,
type = _ref.type;
if (type.isSelectOption) {
return false;
}
if (type.isSelectOptGroup) {
var allChildrenValid = (0, _toArray.default)(node.props.children).every(function (subNode) {
if (! /*#__PURE__*/React.isValidElement(subNode) || !node.type || subNode.type.isSelectOption) {
return true;
}
invalidateChildType = subNode.type;
return false;
});
if (allChildrenValid) {
return false;
}
return true;
}
invalidateChildType = type;
return true;
});
if (invalidateChildType) {
(0, _warning.default)(false, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(invalidateChildType.displayName || invalidateChildType.name || invalidateChildType, "`."));
}
(0, _warning.default)(inputValue === undefined, '`inputValue` is deprecated, please use `searchValue` instead.');
}
}
// value in Select option should not be null
// note: OptGroup has options too
function warningNullOptions(options, fieldNames) {
if (options) {
var recursiveOptions = function recursiveOptions(optionsList) {
var inGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
for (var i = 0; i < optionsList.length; i++) {
var option = optionsList[i];
if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
(0, _warning.default)(false, '`value` in Select options should not be `null`.');
return true;
}
if (!inGroup && Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options], true)) {
break;
}
}
};
recursiveOptions(options);
}
}
var _default = exports.default = warningProps;