This commit is contained in:
parent
7d98c38429
commit
5ed809faa0
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
<title>会员服务 - 金华中医院</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../baseline-browser-mapping/dist/cli.cjs
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../browserslist/cli.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../esbuild/bin/esbuild
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../jsesc/bin/jsesc
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../json5/lib/cli.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../loose-envify/cli.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../nanoid/bin/nanoid.cjs
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../@babel/parser/bin/babel-parser.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../rollup/dist/bin/rollup
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../semver/bin/semver.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../typescript/bin/tsc
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../typescript/bin/tsserver
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../update-browserslist-db/cli.js
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../vite/bin/vite.js
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
"hash": "7038cc68",
|
||||||
|
"configHash": "e6f39275",
|
||||||
|
"lockfileHash": "23c3b2bd",
|
||||||
|
"browserHash": "82b35688",
|
||||||
|
"optimized": {
|
||||||
|
"react": {
|
||||||
|
"src": "../../react/index.js",
|
||||||
|
"file": "react.js",
|
||||||
|
"fileHash": "ecff4a1a",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react-dom": {
|
||||||
|
"src": "../../react-dom/index.js",
|
||||||
|
"file": "react-dom.js",
|
||||||
|
"fileHash": "38b576c5",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react/jsx-dev-runtime": {
|
||||||
|
"src": "../../react/jsx-dev-runtime.js",
|
||||||
|
"file": "react_jsx-dev-runtime.js",
|
||||||
|
"fileHash": "7be78078",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react/jsx-runtime": {
|
||||||
|
"src": "../../react/jsx-runtime.js",
|
||||||
|
"file": "react_jsx-runtime.js",
|
||||||
|
"fileHash": "033c6377",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"@ant-design/icons": {
|
||||||
|
"src": "../../@ant-design/icons/es/index.js",
|
||||||
|
"file": "@ant-design_icons.js",
|
||||||
|
"fileHash": "b3ae10ca",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"antd": {
|
||||||
|
"src": "../../antd/es/index.js",
|
||||||
|
"file": "antd.js",
|
||||||
|
"fileHash": "0d57a4b3",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"antd/locale/zh_CN": {
|
||||||
|
"src": "../../antd/locale/zh_CN.js",
|
||||||
|
"file": "antd_locale_zh_CN.js",
|
||||||
|
"fileHash": "b8dbe62f",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react-dom/client": {
|
||||||
|
"src": "../../react-dom/client.js",
|
||||||
|
"file": "react-dom_client.js",
|
||||||
|
"fileHash": "f9a5794e",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react-router-dom": {
|
||||||
|
"src": "../../react-router-dom/dist/index.js",
|
||||||
|
"file": "react-router-dom.js",
|
||||||
|
"fileHash": "c62277ee",
|
||||||
|
"needsInterop": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chunks": {
|
||||||
|
"chunk-LXZHMVBO": {
|
||||||
|
"file": "chunk-LXZHMVBO.js"
|
||||||
|
},
|
||||||
|
"chunk-TYILIMWK": {
|
||||||
|
"file": "chunk-TYILIMWK.js"
|
||||||
|
},
|
||||||
|
"chunk-CANBAPAS": {
|
||||||
|
"file": "chunk-CANBAPAS.js"
|
||||||
|
},
|
||||||
|
"chunk-5WRI5ZAA": {
|
||||||
|
"file": "chunk-5WRI5ZAA.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,423 @@
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-5WRI5ZAA.js";
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
||||||
|
var require_interopRequireDefault = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports, module) {
|
||||||
|
function _interopRequireDefault(e) {
|
||||||
|
return e && e.__esModule ? e : {
|
||||||
|
"default": e
|
||||||
|
};
|
||||||
|
}
|
||||||
|
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/rc-pagination/lib/locale/zh_CN.js
|
||||||
|
var require_zh_CN = __commonJS({
|
||||||
|
"node_modules/rc-pagination/lib/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var locale = {
|
||||||
|
// Options
|
||||||
|
items_per_page: "条/页",
|
||||||
|
jump_to: "跳至",
|
||||||
|
jump_to_confirm: "确定",
|
||||||
|
page: "页",
|
||||||
|
// Pagination
|
||||||
|
prev_page: "上一页",
|
||||||
|
next_page: "下一页",
|
||||||
|
prev_5: "向前 5 页",
|
||||||
|
next_5: "向后 5 页",
|
||||||
|
prev_3: "向前 3 页",
|
||||||
|
next_3: "向后 3 页",
|
||||||
|
page_size: "页码"
|
||||||
|
};
|
||||||
|
var _default = exports.default = locale;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/typeof.js
|
||||||
|
var require_typeof = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/typeof.js"(exports, module) {
|
||||||
|
function _typeof(o) {
|
||||||
|
"@babel/helpers - typeof";
|
||||||
|
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
||||||
|
return typeof o2;
|
||||||
|
} : function(o2) {
|
||||||
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
||||||
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
||||||
|
}
|
||||||
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/toPrimitive.js
|
||||||
|
var require_toPrimitive = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/toPrimitive.js"(exports, module) {
|
||||||
|
var _typeof = require_typeof()["default"];
|
||||||
|
function toPrimitive(t, r) {
|
||||||
|
if ("object" != _typeof(t) || !t) return t;
|
||||||
|
var e = t[Symbol.toPrimitive];
|
||||||
|
if (void 0 !== e) {
|
||||||
|
var i = e.call(t, r || "default");
|
||||||
|
if ("object" != _typeof(i)) return i;
|
||||||
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||||
|
}
|
||||||
|
return ("string" === r ? String : Number)(t);
|
||||||
|
}
|
||||||
|
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/toPropertyKey.js
|
||||||
|
var require_toPropertyKey = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports, module) {
|
||||||
|
var _typeof = require_typeof()["default"];
|
||||||
|
var toPrimitive = require_toPrimitive();
|
||||||
|
function toPropertyKey(t) {
|
||||||
|
var i = toPrimitive(t, "string");
|
||||||
|
return "symbol" == _typeof(i) ? i : i + "";
|
||||||
|
}
|
||||||
|
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/defineProperty.js
|
||||||
|
var require_defineProperty = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module) {
|
||||||
|
var toPropertyKey = require_toPropertyKey();
|
||||||
|
function _defineProperty(e, r, t) {
|
||||||
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
||||||
|
value: t,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true,
|
||||||
|
writable: true
|
||||||
|
}) : e[r] = t, e;
|
||||||
|
}
|
||||||
|
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/@babel/runtime/helpers/objectSpread2.js
|
||||||
|
var require_objectSpread2 = __commonJS({
|
||||||
|
"node_modules/@babel/runtime/helpers/objectSpread2.js"(exports, module) {
|
||||||
|
var defineProperty = require_defineProperty();
|
||||||
|
function ownKeys(e, r) {
|
||||||
|
var t = Object.keys(e);
|
||||||
|
if (Object.getOwnPropertySymbols) {
|
||||||
|
var o = Object.getOwnPropertySymbols(e);
|
||||||
|
r && (o = o.filter(function(r2) {
|
||||||
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
||||||
|
})), t.push.apply(t, o);
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
function _objectSpread2(e) {
|
||||||
|
for (var r = 1; r < arguments.length; r++) {
|
||||||
|
var t = null != arguments[r] ? arguments[r] : {};
|
||||||
|
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
||||||
|
defineProperty(e, r2, t[r2]);
|
||||||
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
||||||
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/rc-picker/lib/locale/common.js
|
||||||
|
var require_common = __commonJS({
|
||||||
|
"node_modules/rc-picker/lib/locale/common.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.commonLocale = void 0;
|
||||||
|
var commonLocale = exports.commonLocale = {
|
||||||
|
yearFormat: "YYYY",
|
||||||
|
dayFormat: "D",
|
||||||
|
cellMeridiemFormat: "A",
|
||||||
|
monthBeforeYear: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/rc-picker/lib/locale/zh_CN.js
|
||||||
|
var require_zh_CN2 = __commonJS({
|
||||||
|
"node_modules/rc-picker/lib/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var _objectSpread2 = _interopRequireDefault(require_objectSpread2());
|
||||||
|
var _common = require_common();
|
||||||
|
var locale = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _common.commonLocale), {}, {
|
||||||
|
locale: "zh_CN",
|
||||||
|
today: "今天",
|
||||||
|
now: "此刻",
|
||||||
|
backToToday: "返回今天",
|
||||||
|
ok: "确定",
|
||||||
|
timeSelect: "选择时间",
|
||||||
|
dateSelect: "选择日期",
|
||||||
|
weekSelect: "选择周",
|
||||||
|
clear: "清除",
|
||||||
|
week: "周",
|
||||||
|
month: "月",
|
||||||
|
year: "年",
|
||||||
|
previousMonth: "上个月 (翻页上键)",
|
||||||
|
nextMonth: "下个月 (翻页下键)",
|
||||||
|
monthSelect: "选择月份",
|
||||||
|
yearSelect: "选择年份",
|
||||||
|
decadeSelect: "选择年代",
|
||||||
|
previousYear: "上一年 (Control键加左方向键)",
|
||||||
|
nextYear: "下一年 (Control键加右方向键)",
|
||||||
|
previousDecade: "上一年代",
|
||||||
|
nextDecade: "下一年代",
|
||||||
|
previousCentury: "上一世纪",
|
||||||
|
nextCentury: "下一世纪",
|
||||||
|
yearFormat: "YYYY年",
|
||||||
|
cellDateFormat: "D",
|
||||||
|
monthBeforeYear: false
|
||||||
|
});
|
||||||
|
var _default = exports.default = locale;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/antd/lib/time-picker/locale/zh_CN.js
|
||||||
|
var require_zh_CN3 = __commonJS({
|
||||||
|
"node_modules/antd/lib/time-picker/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var locale = {
|
||||||
|
placeholder: "请选择时间",
|
||||||
|
rangePlaceholder: ["开始时间", "结束时间"]
|
||||||
|
};
|
||||||
|
var _default = exports.default = locale;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/antd/lib/date-picker/locale/zh_CN.js
|
||||||
|
var require_zh_CN4 = __commonJS({
|
||||||
|
"node_modules/antd/lib/date-picker/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var _zh_CN = _interopRequireDefault(require_zh_CN2());
|
||||||
|
var _zh_CN2 = _interopRequireDefault(require_zh_CN3());
|
||||||
|
var locale = {
|
||||||
|
lang: Object.assign({
|
||||||
|
placeholder: "请选择日期",
|
||||||
|
yearPlaceholder: "请选择年份",
|
||||||
|
quarterPlaceholder: "请选择季度",
|
||||||
|
monthPlaceholder: "请选择月份",
|
||||||
|
weekPlaceholder: "请选择周",
|
||||||
|
rangePlaceholder: ["开始日期", "结束日期"],
|
||||||
|
rangeYearPlaceholder: ["开始年份", "结束年份"],
|
||||||
|
rangeMonthPlaceholder: ["开始月份", "结束月份"],
|
||||||
|
rangeQuarterPlaceholder: ["开始季度", "结束季度"],
|
||||||
|
rangeWeekPlaceholder: ["开始周", "结束周"]
|
||||||
|
}, _zh_CN.default),
|
||||||
|
timePickerLocale: Object.assign({}, _zh_CN2.default)
|
||||||
|
};
|
||||||
|
locale.lang.ok = "确定";
|
||||||
|
var _default = exports.default = locale;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/antd/lib/calendar/locale/zh_CN.js
|
||||||
|
var require_zh_CN5 = __commonJS({
|
||||||
|
"node_modules/antd/lib/calendar/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var _zh_CN = _interopRequireDefault(require_zh_CN4());
|
||||||
|
var _default = exports.default = _zh_CN.default;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/antd/lib/locale/zh_CN.js
|
||||||
|
var require_zh_CN6 = __commonJS({
|
||||||
|
"node_modules/antd/lib/locale/zh_CN.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
var _interopRequireDefault = require_interopRequireDefault().default;
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
var _zh_CN = _interopRequireDefault(require_zh_CN());
|
||||||
|
var _zh_CN2 = _interopRequireDefault(require_zh_CN5());
|
||||||
|
var _zh_CN3 = _interopRequireDefault(require_zh_CN4());
|
||||||
|
var _zh_CN4 = _interopRequireDefault(require_zh_CN3());
|
||||||
|
var typeTemplate = "${label}不是一个有效的${type}";
|
||||||
|
var localeValues = {
|
||||||
|
locale: "zh-cn",
|
||||||
|
Pagination: _zh_CN.default,
|
||||||
|
DatePicker: _zh_CN3.default,
|
||||||
|
TimePicker: _zh_CN4.default,
|
||||||
|
Calendar: _zh_CN2.default,
|
||||||
|
// locales for all components
|
||||||
|
global: {
|
||||||
|
placeholder: "请选择",
|
||||||
|
close: "关闭"
|
||||||
|
},
|
||||||
|
Table: {
|
||||||
|
filterTitle: "筛选",
|
||||||
|
filterConfirm: "确定",
|
||||||
|
filterReset: "重置",
|
||||||
|
filterEmptyText: "无筛选项",
|
||||||
|
filterCheckAll: "全选",
|
||||||
|
filterSearchPlaceholder: "在筛选项中搜索",
|
||||||
|
emptyText: "暂无数据",
|
||||||
|
selectAll: "全选当页",
|
||||||
|
selectInvert: "反选当页",
|
||||||
|
selectNone: "清空所有",
|
||||||
|
selectionAll: "全选所有",
|
||||||
|
sortTitle: "排序",
|
||||||
|
expand: "展开行",
|
||||||
|
collapse: "关闭行",
|
||||||
|
triggerDesc: "点击降序",
|
||||||
|
triggerAsc: "点击升序",
|
||||||
|
cancelSort: "取消排序"
|
||||||
|
},
|
||||||
|
Modal: {
|
||||||
|
okText: "确定",
|
||||||
|
cancelText: "取消",
|
||||||
|
justOkText: "知道了"
|
||||||
|
},
|
||||||
|
Tour: {
|
||||||
|
Next: "下一步",
|
||||||
|
Previous: "上一步",
|
||||||
|
Finish: "结束导览"
|
||||||
|
},
|
||||||
|
Popconfirm: {
|
||||||
|
cancelText: "取消",
|
||||||
|
okText: "确定"
|
||||||
|
},
|
||||||
|
Transfer: {
|
||||||
|
titles: ["", ""],
|
||||||
|
searchPlaceholder: "请输入搜索内容",
|
||||||
|
itemUnit: "项",
|
||||||
|
itemsUnit: "项",
|
||||||
|
remove: "删除",
|
||||||
|
selectCurrent: "全选当页",
|
||||||
|
removeCurrent: "删除当页",
|
||||||
|
selectAll: "全选所有",
|
||||||
|
deselectAll: "取消全选",
|
||||||
|
removeAll: "删除全部",
|
||||||
|
selectInvert: "反选当页"
|
||||||
|
},
|
||||||
|
Upload: {
|
||||||
|
uploading: "文件上传中",
|
||||||
|
removeFile: "删除文件",
|
||||||
|
uploadError: "上传错误",
|
||||||
|
previewFile: "预览文件",
|
||||||
|
downloadFile: "下载文件"
|
||||||
|
},
|
||||||
|
Empty: {
|
||||||
|
description: "暂无数据"
|
||||||
|
},
|
||||||
|
Icon: {
|
||||||
|
icon: "图标"
|
||||||
|
},
|
||||||
|
Text: {
|
||||||
|
edit: "编辑",
|
||||||
|
copy: "复制",
|
||||||
|
copied: "复制成功",
|
||||||
|
expand: "展开",
|
||||||
|
collapse: "收起"
|
||||||
|
},
|
||||||
|
Form: {
|
||||||
|
optional: "(可选)",
|
||||||
|
defaultValidateMessages: {
|
||||||
|
default: "字段验证错误${label}",
|
||||||
|
required: "请输入${label}",
|
||||||
|
enum: "${label}必须是其中一个[${enum}]",
|
||||||
|
whitespace: "${label}不能为空字符",
|
||||||
|
date: {
|
||||||
|
format: "${label}日期格式无效",
|
||||||
|
parse: "${label}不能转换为日期",
|
||||||
|
invalid: "${label}是一个无效日期"
|
||||||
|
},
|
||||||
|
types: {
|
||||||
|
string: typeTemplate,
|
||||||
|
method: typeTemplate,
|
||||||
|
array: typeTemplate,
|
||||||
|
object: typeTemplate,
|
||||||
|
number: typeTemplate,
|
||||||
|
date: typeTemplate,
|
||||||
|
boolean: typeTemplate,
|
||||||
|
integer: typeTemplate,
|
||||||
|
float: typeTemplate,
|
||||||
|
regexp: typeTemplate,
|
||||||
|
email: typeTemplate,
|
||||||
|
url: typeTemplate,
|
||||||
|
hex: typeTemplate
|
||||||
|
},
|
||||||
|
string: {
|
||||||
|
len: "${label}须为${len}个字符",
|
||||||
|
min: "${label}最少${min}个字符",
|
||||||
|
max: "${label}最多${max}个字符",
|
||||||
|
range: "${label}须在${min}-${max}字符之间"
|
||||||
|
},
|
||||||
|
number: {
|
||||||
|
len: "${label}必须等于${len}",
|
||||||
|
min: "${label}最小值为${min}",
|
||||||
|
max: "${label}最大值为${max}",
|
||||||
|
range: "${label}须在${min}-${max}之间"
|
||||||
|
},
|
||||||
|
array: {
|
||||||
|
len: "须为${len}个${label}",
|
||||||
|
min: "最少${min}个${label}",
|
||||||
|
max: "最多${max}个${label}",
|
||||||
|
range: "${label}数量须在${min}-${max}之间"
|
||||||
|
},
|
||||||
|
pattern: {
|
||||||
|
mismatch: "${label}与模式不匹配${pattern}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Image: {
|
||||||
|
preview: "预览"
|
||||||
|
},
|
||||||
|
QRCode: {
|
||||||
|
expired: "二维码过期",
|
||||||
|
refresh: "点击刷新",
|
||||||
|
scanned: "已扫描"
|
||||||
|
},
|
||||||
|
ColorPicker: {
|
||||||
|
presetEmpty: "暂无",
|
||||||
|
transparent: "无色",
|
||||||
|
singleColor: "单色",
|
||||||
|
gradientColor: "渐变色"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var _default = exports.default = localeValues;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/antd/locale/zh_CN.js
|
||||||
|
var require_zh_CN7 = __commonJS({
|
||||||
|
"node_modules/antd/locale/zh_CN.js"(exports, module) {
|
||||||
|
module.exports = require_zh_CN6();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_zh_CN7();
|
||||||
|
//# sourceMappingURL=antd_locale_zh_CN.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,31 @@
|
||||||
|
var __create = Object.create;
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __getProtoOf = Object.getPrototypeOf;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __commonJS = (cb, mod) => function __require() {
|
||||||
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||||
|
// If the importer is in node compatibility mode or this is not an ESM
|
||||||
|
// file that has been converted to a CommonJS file using a Babel-
|
||||||
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||||
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||||
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||||
|
mod
|
||||||
|
));
|
||||||
|
|
||||||
|
export {
|
||||||
|
__commonJS,
|
||||||
|
__toESM
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=chunk-5WRI5ZAA.js.map
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import {
|
||||||
|
require_react_dom
|
||||||
|
} from "./chunk-TYILIMWK.js";
|
||||||
|
import "./chunk-CANBAPAS.js";
|
||||||
|
import "./chunk-5WRI5ZAA.js";
|
||||||
|
export default require_react_dom();
|
||||||
|
//# sourceMappingURL=react-dom.js.map
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
import {
|
||||||
|
require_react_dom
|
||||||
|
} from "./chunk-TYILIMWK.js";
|
||||||
|
import "./chunk-CANBAPAS.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-5WRI5ZAA.js";
|
||||||
|
|
||||||
|
// node_modules/react-dom/client.js
|
||||||
|
var require_client = __commonJS({
|
||||||
|
"node_modules/react-dom/client.js"(exports) {
|
||||||
|
var m = require_react_dom();
|
||||||
|
if (false) {
|
||||||
|
exports.createRoot = m.createRoot;
|
||||||
|
exports.hydrateRoot = m.hydrateRoot;
|
||||||
|
} else {
|
||||||
|
i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||||
|
exports.createRoot = function(c, o) {
|
||||||
|
i.usingClientEntryPoint = true;
|
||||||
|
try {
|
||||||
|
return m.createRoot(c, o);
|
||||||
|
} finally {
|
||||||
|
i.usingClientEntryPoint = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.hydrateRoot = function(c, h, o) {
|
||||||
|
i.usingClientEntryPoint = true;
|
||||||
|
try {
|
||||||
|
return m.hydrateRoot(c, h, o);
|
||||||
|
} finally {
|
||||||
|
i.usingClientEntryPoint = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var i;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_client();
|
||||||
|
//# sourceMappingURL=react-dom_client.js.map
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": ["../../react-dom/client.js"],
|
||||||
|
"sourcesContent": ["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n"],
|
||||||
|
"mappings": ";;;;;;;;;AAAA;AAAA;AAEA,QAAI,IAAI;AACR,QAAI,OAAuC;AACzC,cAAQ,aAAa,EAAE;AACvB,cAAQ,cAAc,EAAE;AAAA,IAC1B,OAAO;AACD,UAAI,EAAE;AACV,cAAQ,aAAa,SAAS,GAAG,GAAG;AAClC,UAAE,wBAAwB;AAC1B,YAAI;AACF,iBAAO,EAAE,WAAW,GAAG,CAAC;AAAA,QAC1B,UAAE;AACA,YAAE,wBAAwB;AAAA,QAC5B;AAAA,MACF;AACA,cAAQ,cAAc,SAAS,GAAG,GAAG,GAAG;AACtC,UAAE,wBAAwB;AAC1B,YAAI;AACF,iBAAO,EAAE,YAAY,GAAG,GAAG,CAAC;AAAA,QAC9B,UAAE;AACA,YAAE,wBAAwB;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAjBM;AAAA;AAAA;",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,6 @@
|
||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-CANBAPAS.js";
|
||||||
|
import "./chunk-5WRI5ZAA.js";
|
||||||
|
export default require_react();
|
||||||
|
//# sourceMappingURL=react.js.map
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,913 @@
|
||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-CANBAPAS.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-5WRI5ZAA.js";
|
||||||
|
|
||||||
|
// node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||||
|
var require_react_jsx_dev_runtime_development = __commonJS({
|
||||||
|
"node_modules/react/cjs/react-jsx-dev-runtime.development.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
if (true) {
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var React = require_react();
|
||||||
|
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||||
|
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||||
|
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||||
|
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||||
|
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||||
|
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||||
|
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||||
|
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||||
|
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||||
|
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||||
|
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||||
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||||
|
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||||
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||||
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||||
|
function getIteratorFn(maybeIterable) {
|
||||||
|
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||||
|
if (typeof maybeIterator === "function") {
|
||||||
|
return maybeIterator;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||||
|
function error(format) {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||||
|
args[_key2 - 1] = arguments[_key2];
|
||||||
|
}
|
||||||
|
printWarning("error", format, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function printWarning(level, format, args) {
|
||||||
|
{
|
||||||
|
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
||||||
|
if (stack !== "") {
|
||||||
|
format += "%s";
|
||||||
|
args = args.concat([stack]);
|
||||||
|
}
|
||||||
|
var argsWithFormat = args.map(function(item) {
|
||||||
|
return String(item);
|
||||||
|
});
|
||||||
|
argsWithFormat.unshift("Warning: " + format);
|
||||||
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var enableScopeAPI = false;
|
||||||
|
var enableCacheElement = false;
|
||||||
|
var enableTransitionTracing = false;
|
||||||
|
var enableLegacyHidden = false;
|
||||||
|
var enableDebugTracing = false;
|
||||||
|
var REACT_MODULE_REFERENCE;
|
||||||
|
{
|
||||||
|
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
||||||
|
}
|
||||||
|
function isValidElementType(type) {
|
||||||
|
if (typeof type === "string" || typeof type === "function") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (typeof type === "object" && type !== null) {
|
||||||
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
||||||
|
// types supported by any Flight configuration anywhere since
|
||||||
|
// we don't know which Flight build this will end up being used
|
||||||
|
// with.
|
||||||
|
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function getWrappedName(outerType, innerType, wrapperName) {
|
||||||
|
var displayName = outerType.displayName;
|
||||||
|
if (displayName) {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
var functionName = innerType.displayName || innerType.name || "";
|
||||||
|
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
||||||
|
}
|
||||||
|
function getContextName(type) {
|
||||||
|
return type.displayName || "Context";
|
||||||
|
}
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (type == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (typeof type.tag === "number") {
|
||||||
|
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof type === "function") {
|
||||||
|
return type.displayName || type.name || null;
|
||||||
|
}
|
||||||
|
if (typeof type === "string") {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "Fragment";
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "Portal";
|
||||||
|
case REACT_PROFILER_TYPE:
|
||||||
|
return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE:
|
||||||
|
return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return "SuspenseList";
|
||||||
|
}
|
||||||
|
if (typeof type === "object") {
|
||||||
|
switch (type.$$typeof) {
|
||||||
|
case REACT_CONTEXT_TYPE:
|
||||||
|
var context = type;
|
||||||
|
return getContextName(context) + ".Consumer";
|
||||||
|
case REACT_PROVIDER_TYPE:
|
||||||
|
var provider = type;
|
||||||
|
return getContextName(provider._context) + ".Provider";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
return getWrappedName(type, type.render, "ForwardRef");
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
var outerName = type.displayName || null;
|
||||||
|
if (outerName !== null) {
|
||||||
|
return outerName;
|
||||||
|
}
|
||||||
|
return getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE: {
|
||||||
|
var lazyComponent = type;
|
||||||
|
var payload = lazyComponent._payload;
|
||||||
|
var init = lazyComponent._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(init(payload));
|
||||||
|
} catch (x) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var assign = Object.assign;
|
||||||
|
var disabledDepth = 0;
|
||||||
|
var prevLog;
|
||||||
|
var prevInfo;
|
||||||
|
var prevWarn;
|
||||||
|
var prevError;
|
||||||
|
var prevGroup;
|
||||||
|
var prevGroupCollapsed;
|
||||||
|
var prevGroupEnd;
|
||||||
|
function disabledLog() {
|
||||||
|
}
|
||||||
|
disabledLog.__reactDisabledLog = true;
|
||||||
|
function disableLogs() {
|
||||||
|
{
|
||||||
|
if (disabledDepth === 0) {
|
||||||
|
prevLog = console.log;
|
||||||
|
prevInfo = console.info;
|
||||||
|
prevWarn = console.warn;
|
||||||
|
prevError = console.error;
|
||||||
|
prevGroup = console.group;
|
||||||
|
prevGroupCollapsed = console.groupCollapsed;
|
||||||
|
prevGroupEnd = console.groupEnd;
|
||||||
|
var props = {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: disabledLog,
|
||||||
|
writable: true
|
||||||
|
};
|
||||||
|
Object.defineProperties(console, {
|
||||||
|
info: props,
|
||||||
|
log: props,
|
||||||
|
warn: props,
|
||||||
|
error: props,
|
||||||
|
group: props,
|
||||||
|
groupCollapsed: props,
|
||||||
|
groupEnd: props
|
||||||
|
});
|
||||||
|
}
|
||||||
|
disabledDepth++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function reenableLogs() {
|
||||||
|
{
|
||||||
|
disabledDepth--;
|
||||||
|
if (disabledDepth === 0) {
|
||||||
|
var props = {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
writable: true
|
||||||
|
};
|
||||||
|
Object.defineProperties(console, {
|
||||||
|
log: assign({}, props, {
|
||||||
|
value: prevLog
|
||||||
|
}),
|
||||||
|
info: assign({}, props, {
|
||||||
|
value: prevInfo
|
||||||
|
}),
|
||||||
|
warn: assign({}, props, {
|
||||||
|
value: prevWarn
|
||||||
|
}),
|
||||||
|
error: assign({}, props, {
|
||||||
|
value: prevError
|
||||||
|
}),
|
||||||
|
group: assign({}, props, {
|
||||||
|
value: prevGroup
|
||||||
|
}),
|
||||||
|
groupCollapsed: assign({}, props, {
|
||||||
|
value: prevGroupCollapsed
|
||||||
|
}),
|
||||||
|
groupEnd: assign({}, props, {
|
||||||
|
value: prevGroupEnd
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (disabledDepth < 0) {
|
||||||
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
||||||
|
var prefix;
|
||||||
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||||
|
{
|
||||||
|
if (prefix === void 0) {
|
||||||
|
try {
|
||||||
|
throw Error();
|
||||||
|
} catch (x) {
|
||||||
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
||||||
|
prefix = match && match[1] || "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "\n" + prefix + name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var reentry = false;
|
||||||
|
var componentFrameCache;
|
||||||
|
{
|
||||||
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
||||||
|
componentFrameCache = new PossiblyWeakMap();
|
||||||
|
}
|
||||||
|
function describeNativeComponentFrame(fn, construct) {
|
||||||
|
if (!fn || reentry) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
var frame = componentFrameCache.get(fn);
|
||||||
|
if (frame !== void 0) {
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var control;
|
||||||
|
reentry = true;
|
||||||
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
||||||
|
Error.prepareStackTrace = void 0;
|
||||||
|
var previousDispatcher;
|
||||||
|
{
|
||||||
|
previousDispatcher = ReactCurrentDispatcher.current;
|
||||||
|
ReactCurrentDispatcher.current = null;
|
||||||
|
disableLogs();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (construct) {
|
||||||
|
var Fake = function() {
|
||||||
|
throw Error();
|
||||||
|
};
|
||||||
|
Object.defineProperty(Fake.prototype, "props", {
|
||||||
|
set: function() {
|
||||||
|
throw Error();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (typeof Reflect === "object" && Reflect.construct) {
|
||||||
|
try {
|
||||||
|
Reflect.construct(Fake, []);
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
Reflect.construct(fn, [], Fake);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Fake.call();
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
fn.call(Fake.prototype);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
throw Error();
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
fn();
|
||||||
|
}
|
||||||
|
} catch (sample) {
|
||||||
|
if (sample && control && typeof sample.stack === "string") {
|
||||||
|
var sampleLines = sample.stack.split("\n");
|
||||||
|
var controlLines = control.stack.split("\n");
|
||||||
|
var s = sampleLines.length - 1;
|
||||||
|
var c = controlLines.length - 1;
|
||||||
|
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
||||||
|
c--;
|
||||||
|
}
|
||||||
|
for (; s >= 1 && c >= 0; s--, c--) {
|
||||||
|
if (sampleLines[s] !== controlLines[c]) {
|
||||||
|
if (s !== 1 || c !== 1) {
|
||||||
|
do {
|
||||||
|
s--;
|
||||||
|
c--;
|
||||||
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
||||||
|
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
||||||
|
if (fn.displayName && _frame.includes("<anonymous>")) {
|
||||||
|
_frame = _frame.replace("<anonymous>", fn.displayName);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (typeof fn === "function") {
|
||||||
|
componentFrameCache.set(fn, _frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _frame;
|
||||||
|
}
|
||||||
|
} while (s >= 1 && c >= 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
reentry = false;
|
||||||
|
{
|
||||||
|
ReactCurrentDispatcher.current = previousDispatcher;
|
||||||
|
reenableLogs();
|
||||||
|
}
|
||||||
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
||||||
|
}
|
||||||
|
var name = fn ? fn.displayName || fn.name : "";
|
||||||
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
||||||
|
{
|
||||||
|
if (typeof fn === "function") {
|
||||||
|
componentFrameCache.set(fn, syntheticFrame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return syntheticFrame;
|
||||||
|
}
|
||||||
|
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
||||||
|
{
|
||||||
|
return describeNativeComponentFrame(fn, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function shouldConstruct(Component) {
|
||||||
|
var prototype = Component.prototype;
|
||||||
|
return !!(prototype && prototype.isReactComponent);
|
||||||
|
}
|
||||||
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
||||||
|
if (type == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (typeof type === "function") {
|
||||||
|
{
|
||||||
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof type === "string") {
|
||||||
|
return describeBuiltInComponentFrame(type);
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return describeBuiltInComponentFrame("Suspense");
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return describeBuiltInComponentFrame("SuspenseList");
|
||||||
|
}
|
||||||
|
if (typeof type === "object") {
|
||||||
|
switch (type.$$typeof) {
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
return describeFunctionComponentFrame(type.render);
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
||||||
|
case REACT_LAZY_TYPE: {
|
||||||
|
var lazyComponent = type;
|
||||||
|
var payload = lazyComponent._payload;
|
||||||
|
var init = lazyComponent._init;
|
||||||
|
try {
|
||||||
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
||||||
|
} catch (x) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
var loggedTypeFailures = {};
|
||||||
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
function setCurrentlyValidatingElement(element) {
|
||||||
|
{
|
||||||
|
if (element) {
|
||||||
|
var owner = element._owner;
|
||||||
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
||||||
|
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
||||||
|
} else {
|
||||||
|
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
||||||
|
{
|
||||||
|
var has = Function.call.bind(hasOwnProperty);
|
||||||
|
for (var typeSpecName in typeSpecs) {
|
||||||
|
if (has(typeSpecs, typeSpecName)) {
|
||||||
|
var error$1 = void 0;
|
||||||
|
try {
|
||||||
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
||||||
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
||||||
|
err.name = "Invariant Violation";
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
||||||
|
} catch (ex) {
|
||||||
|
error$1 = ex;
|
||||||
|
}
|
||||||
|
if (error$1 && !(error$1 instanceof Error)) {
|
||||||
|
setCurrentlyValidatingElement(element);
|
||||||
|
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
||||||
|
setCurrentlyValidatingElement(null);
|
||||||
|
}
|
||||||
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
||||||
|
loggedTypeFailures[error$1.message] = true;
|
||||||
|
setCurrentlyValidatingElement(element);
|
||||||
|
error("Failed %s type: %s", location, error$1.message);
|
||||||
|
setCurrentlyValidatingElement(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var isArrayImpl = Array.isArray;
|
||||||
|
function isArray(a) {
|
||||||
|
return isArrayImpl(a);
|
||||||
|
}
|
||||||
|
function typeName(value) {
|
||||||
|
{
|
||||||
|
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
||||||
|
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function willCoercionThrow(value) {
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
return false;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
{
|
||||||
|
if (willCoercionThrow(value)) {
|
||||||
|
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||||
|
var RESERVED_PROPS = {
|
||||||
|
key: true,
|
||||||
|
ref: true,
|
||||||
|
__self: true,
|
||||||
|
__source: true
|
||||||
|
};
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var specialPropRefWarningShown;
|
||||||
|
var didWarnAboutStringRefs;
|
||||||
|
{
|
||||||
|
didWarnAboutStringRefs = {};
|
||||||
|
}
|
||||||
|
function hasValidRef(config) {
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(config, "ref")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
||||||
|
if (getter && getter.isReactWarning) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return config.ref !== void 0;
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return config.key !== void 0;
|
||||||
|
}
|
||||||
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
||||||
|
{
|
||||||
|
if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
||||||
|
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
||||||
|
if (!didWarnAboutStringRefs[componentName]) {
|
||||||
|
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
||||||
|
didWarnAboutStringRefs[componentName] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
{
|
||||||
|
var warnAboutAccessingKey = function() {
|
||||||
|
if (!specialPropKeyWarningShown) {
|
||||||
|
specialPropKeyWarningShown = true;
|
||||||
|
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
warnAboutAccessingKey.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function defineRefPropWarningGetter(props, displayName) {
|
||||||
|
{
|
||||||
|
var warnAboutAccessingRef = function() {
|
||||||
|
if (!specialPropRefWarningShown) {
|
||||||
|
specialPropRefWarningShown = true;
|
||||||
|
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
warnAboutAccessingRef.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "ref", {
|
||||||
|
get: warnAboutAccessingRef,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
||||||
|
var element = {
|
||||||
|
// This tag allows us to uniquely identify this as a React Element
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
// Built-in properties that belong on the element
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
ref,
|
||||||
|
props,
|
||||||
|
// Record the component responsible for creating this element.
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
{
|
||||||
|
element._store = {};
|
||||||
|
Object.defineProperty(element._store, "validated", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: false
|
||||||
|
});
|
||||||
|
Object.defineProperty(element, "_self", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
value: self
|
||||||
|
});
|
||||||
|
Object.defineProperty(element, "_source", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
value: source
|
||||||
|
});
|
||||||
|
if (Object.freeze) {
|
||||||
|
Object.freeze(element.props);
|
||||||
|
Object.freeze(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
function jsxDEV(type, config, maybeKey, source, self) {
|
||||||
|
{
|
||||||
|
var propName;
|
||||||
|
var props = {};
|
||||||
|
var key = null;
|
||||||
|
var ref = null;
|
||||||
|
if (maybeKey !== void 0) {
|
||||||
|
{
|
||||||
|
checkKeyStringCoercion(maybeKey);
|
||||||
|
}
|
||||||
|
key = "" + maybeKey;
|
||||||
|
}
|
||||||
|
if (hasValidKey(config)) {
|
||||||
|
{
|
||||||
|
checkKeyStringCoercion(config.key);
|
||||||
|
}
|
||||||
|
key = "" + config.key;
|
||||||
|
}
|
||||||
|
if (hasValidRef(config)) {
|
||||||
|
ref = config.ref;
|
||||||
|
warnIfStringRefCannotBeAutoConverted(config, self);
|
||||||
|
}
|
||||||
|
for (propName in config) {
|
||||||
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
||||||
|
props[propName] = config[propName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type && type.defaultProps) {
|
||||||
|
var defaultProps = type.defaultProps;
|
||||||
|
for (propName in defaultProps) {
|
||||||
|
if (props[propName] === void 0) {
|
||||||
|
props[propName] = defaultProps[propName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (key || ref) {
|
||||||
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
||||||
|
if (key) {
|
||||||
|
defineKeyPropWarningGetter(props, displayName);
|
||||||
|
}
|
||||||
|
if (ref) {
|
||||||
|
defineRefPropWarningGetter(props, displayName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
||||||
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
function setCurrentlyValidatingElement$1(element) {
|
||||||
|
{
|
||||||
|
if (element) {
|
||||||
|
var owner = element._owner;
|
||||||
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
||||||
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
||||||
|
} else {
|
||||||
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var propTypesMisspellWarningShown;
|
||||||
|
{
|
||||||
|
propTypesMisspellWarningShown = false;
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
{
|
||||||
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getDeclarationErrorAddendum() {
|
||||||
|
{
|
||||||
|
if (ReactCurrentOwner$1.current) {
|
||||||
|
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
||||||
|
if (name) {
|
||||||
|
return "\n\nCheck the render method of `" + name + "`.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getSourceInfoErrorAddendum(source) {
|
||||||
|
{
|
||||||
|
if (source !== void 0) {
|
||||||
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
||||||
|
var lineNumber = source.lineNumber;
|
||||||
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ownerHasKeyUseWarning = {};
|
||||||
|
function getCurrentComponentErrorInfo(parentType) {
|
||||||
|
{
|
||||||
|
var info = getDeclarationErrorAddendum();
|
||||||
|
if (!info) {
|
||||||
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
||||||
|
if (parentName) {
|
||||||
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateExplicitKey(element, parentType) {
|
||||||
|
{
|
||||||
|
if (!element._store || element._store.validated || element.key != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element._store.validated = true;
|
||||||
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
||||||
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
||||||
|
var childOwner = "";
|
||||||
|
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
||||||
|
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
||||||
|
}
|
||||||
|
setCurrentlyValidatingElement$1(element);
|
||||||
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateChildKeys(node, parentType) {
|
||||||
|
{
|
||||||
|
if (typeof node !== "object") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isArray(node)) {
|
||||||
|
for (var i = 0; i < node.length; i++) {
|
||||||
|
var child = node[i];
|
||||||
|
if (isValidElement(child)) {
|
||||||
|
validateExplicitKey(child, parentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (isValidElement(node)) {
|
||||||
|
if (node._store) {
|
||||||
|
node._store.validated = true;
|
||||||
|
}
|
||||||
|
} else if (node) {
|
||||||
|
var iteratorFn = getIteratorFn(node);
|
||||||
|
if (typeof iteratorFn === "function") {
|
||||||
|
if (iteratorFn !== node.entries) {
|
||||||
|
var iterator = iteratorFn.call(node);
|
||||||
|
var step;
|
||||||
|
while (!(step = iterator.next()).done) {
|
||||||
|
if (isValidElement(step.value)) {
|
||||||
|
validateExplicitKey(step.value, parentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validatePropTypes(element) {
|
||||||
|
{
|
||||||
|
var type = element.type;
|
||||||
|
if (type === null || type === void 0 || typeof type === "string") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var propTypes;
|
||||||
|
if (typeof type === "function") {
|
||||||
|
propTypes = type.propTypes;
|
||||||
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
||||||
|
// Inner props are checked in the reconciler.
|
||||||
|
type.$$typeof === REACT_MEMO_TYPE)) {
|
||||||
|
propTypes = type.propTypes;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (propTypes) {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
||||||
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
||||||
|
propTypesMisspellWarningShown = true;
|
||||||
|
var _name = getComponentNameFromType(type);
|
||||||
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
||||||
|
}
|
||||||
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
||||||
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateFragmentProps(fragment) {
|
||||||
|
{
|
||||||
|
var keys = Object.keys(fragment.props);
|
||||||
|
for (var i = 0; i < keys.length; i++) {
|
||||||
|
var key = keys[i];
|
||||||
|
if (key !== "children" && key !== "key") {
|
||||||
|
setCurrentlyValidatingElement$1(fragment);
|
||||||
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fragment.ref !== null) {
|
||||||
|
setCurrentlyValidatingElement$1(fragment);
|
||||||
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
||||||
|
{
|
||||||
|
var validType = isValidElementType(type);
|
||||||
|
if (!validType) {
|
||||||
|
var info = "";
|
||||||
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
||||||
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
||||||
|
}
|
||||||
|
var sourceInfo = getSourceInfoErrorAddendum(source);
|
||||||
|
if (sourceInfo) {
|
||||||
|
info += sourceInfo;
|
||||||
|
} else {
|
||||||
|
info += getDeclarationErrorAddendum();
|
||||||
|
}
|
||||||
|
var typeString;
|
||||||
|
if (type === null) {
|
||||||
|
typeString = "null";
|
||||||
|
} else if (isArray(type)) {
|
||||||
|
typeString = "array";
|
||||||
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
||||||
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
||||||
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
||||||
|
} else {
|
||||||
|
typeString = typeof type;
|
||||||
|
}
|
||||||
|
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
||||||
|
}
|
||||||
|
var element = jsxDEV(type, props, key, source, self);
|
||||||
|
if (element == null) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
if (validType) {
|
||||||
|
var children = props.children;
|
||||||
|
if (children !== void 0) {
|
||||||
|
if (isStaticChildren) {
|
||||||
|
if (isArray(children)) {
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
validateChildKeys(children[i], type);
|
||||||
|
}
|
||||||
|
if (Object.freeze) {
|
||||||
|
Object.freeze(children);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
validateChildKeys(children, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(props, "key")) {
|
||||||
|
var componentName = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(props).filter(function(k) {
|
||||||
|
return k !== "key";
|
||||||
|
});
|
||||||
|
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
||||||
|
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
||||||
|
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
||||||
|
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) {
|
||||||
|
validateFragmentProps(element);
|
||||||
|
} else {
|
||||||
|
validatePropTypes(element);
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var jsxDEV$1 = jsxWithValidation;
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsxDEV = jsxDEV$1;
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react/jsx-dev-runtime.js
|
||||||
|
var require_jsx_dev_runtime = __commonJS({
|
||||||
|
"node_modules/react/jsx-dev-runtime.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_jsx_dev_runtime_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_jsx_dev_runtime();
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react/cjs/react-jsx-dev-runtime.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-dev-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=react_jsx-dev-runtime.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,925 @@
|
||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-CANBAPAS.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-5WRI5ZAA.js";
|
||||||
|
|
||||||
|
// node_modules/react/cjs/react-jsx-runtime.development.js
|
||||||
|
var require_react_jsx_runtime_development = __commonJS({
|
||||||
|
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
if (true) {
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var React = require_react();
|
||||||
|
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||||
|
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||||
|
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||||
|
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||||
|
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||||
|
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||||
|
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||||
|
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||||
|
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||||
|
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||||
|
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||||
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||||
|
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||||
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||||
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||||
|
function getIteratorFn(maybeIterable) {
|
||||||
|
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||||
|
if (typeof maybeIterator === "function") {
|
||||||
|
return maybeIterator;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||||
|
function error(format) {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||||
|
args[_key2 - 1] = arguments[_key2];
|
||||||
|
}
|
||||||
|
printWarning("error", format, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function printWarning(level, format, args) {
|
||||||
|
{
|
||||||
|
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
||||||
|
if (stack !== "") {
|
||||||
|
format += "%s";
|
||||||
|
args = args.concat([stack]);
|
||||||
|
}
|
||||||
|
var argsWithFormat = args.map(function(item) {
|
||||||
|
return String(item);
|
||||||
|
});
|
||||||
|
argsWithFormat.unshift("Warning: " + format);
|
||||||
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var enableScopeAPI = false;
|
||||||
|
var enableCacheElement = false;
|
||||||
|
var enableTransitionTracing = false;
|
||||||
|
var enableLegacyHidden = false;
|
||||||
|
var enableDebugTracing = false;
|
||||||
|
var REACT_MODULE_REFERENCE;
|
||||||
|
{
|
||||||
|
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
||||||
|
}
|
||||||
|
function isValidElementType(type) {
|
||||||
|
if (typeof type === "string" || typeof type === "function") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (typeof type === "object" && type !== null) {
|
||||||
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
||||||
|
// types supported by any Flight configuration anywhere since
|
||||||
|
// we don't know which Flight build this will end up being used
|
||||||
|
// with.
|
||||||
|
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function getWrappedName(outerType, innerType, wrapperName) {
|
||||||
|
var displayName = outerType.displayName;
|
||||||
|
if (displayName) {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
var functionName = innerType.displayName || innerType.name || "";
|
||||||
|
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
||||||
|
}
|
||||||
|
function getContextName(type) {
|
||||||
|
return type.displayName || "Context";
|
||||||
|
}
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (type == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (typeof type.tag === "number") {
|
||||||
|
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof type === "function") {
|
||||||
|
return type.displayName || type.name || null;
|
||||||
|
}
|
||||||
|
if (typeof type === "string") {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "Fragment";
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "Portal";
|
||||||
|
case REACT_PROFILER_TYPE:
|
||||||
|
return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE:
|
||||||
|
return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return "SuspenseList";
|
||||||
|
}
|
||||||
|
if (typeof type === "object") {
|
||||||
|
switch (type.$$typeof) {
|
||||||
|
case REACT_CONTEXT_TYPE:
|
||||||
|
var context = type;
|
||||||
|
return getContextName(context) + ".Consumer";
|
||||||
|
case REACT_PROVIDER_TYPE:
|
||||||
|
var provider = type;
|
||||||
|
return getContextName(provider._context) + ".Provider";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
return getWrappedName(type, type.render, "ForwardRef");
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
var outerName = type.displayName || null;
|
||||||
|
if (outerName !== null) {
|
||||||
|
return outerName;
|
||||||
|
}
|
||||||
|
return getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE: {
|
||||||
|
var lazyComponent = type;
|
||||||
|
var payload = lazyComponent._payload;
|
||||||
|
var init = lazyComponent._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(init(payload));
|
||||||
|
} catch (x) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var assign = Object.assign;
|
||||||
|
var disabledDepth = 0;
|
||||||
|
var prevLog;
|
||||||
|
var prevInfo;
|
||||||
|
var prevWarn;
|
||||||
|
var prevError;
|
||||||
|
var prevGroup;
|
||||||
|
var prevGroupCollapsed;
|
||||||
|
var prevGroupEnd;
|
||||||
|
function disabledLog() {
|
||||||
|
}
|
||||||
|
disabledLog.__reactDisabledLog = true;
|
||||||
|
function disableLogs() {
|
||||||
|
{
|
||||||
|
if (disabledDepth === 0) {
|
||||||
|
prevLog = console.log;
|
||||||
|
prevInfo = console.info;
|
||||||
|
prevWarn = console.warn;
|
||||||
|
prevError = console.error;
|
||||||
|
prevGroup = console.group;
|
||||||
|
prevGroupCollapsed = console.groupCollapsed;
|
||||||
|
prevGroupEnd = console.groupEnd;
|
||||||
|
var props = {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
value: disabledLog,
|
||||||
|
writable: true
|
||||||
|
};
|
||||||
|
Object.defineProperties(console, {
|
||||||
|
info: props,
|
||||||
|
log: props,
|
||||||
|
warn: props,
|
||||||
|
error: props,
|
||||||
|
group: props,
|
||||||
|
groupCollapsed: props,
|
||||||
|
groupEnd: props
|
||||||
|
});
|
||||||
|
}
|
||||||
|
disabledDepth++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function reenableLogs() {
|
||||||
|
{
|
||||||
|
disabledDepth--;
|
||||||
|
if (disabledDepth === 0) {
|
||||||
|
var props = {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
writable: true
|
||||||
|
};
|
||||||
|
Object.defineProperties(console, {
|
||||||
|
log: assign({}, props, {
|
||||||
|
value: prevLog
|
||||||
|
}),
|
||||||
|
info: assign({}, props, {
|
||||||
|
value: prevInfo
|
||||||
|
}),
|
||||||
|
warn: assign({}, props, {
|
||||||
|
value: prevWarn
|
||||||
|
}),
|
||||||
|
error: assign({}, props, {
|
||||||
|
value: prevError
|
||||||
|
}),
|
||||||
|
group: assign({}, props, {
|
||||||
|
value: prevGroup
|
||||||
|
}),
|
||||||
|
groupCollapsed: assign({}, props, {
|
||||||
|
value: prevGroupCollapsed
|
||||||
|
}),
|
||||||
|
groupEnd: assign({}, props, {
|
||||||
|
value: prevGroupEnd
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (disabledDepth < 0) {
|
||||||
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
||||||
|
var prefix;
|
||||||
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||||
|
{
|
||||||
|
if (prefix === void 0) {
|
||||||
|
try {
|
||||||
|
throw Error();
|
||||||
|
} catch (x) {
|
||||||
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
||||||
|
prefix = match && match[1] || "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "\n" + prefix + name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var reentry = false;
|
||||||
|
var componentFrameCache;
|
||||||
|
{
|
||||||
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
||||||
|
componentFrameCache = new PossiblyWeakMap();
|
||||||
|
}
|
||||||
|
function describeNativeComponentFrame(fn, construct) {
|
||||||
|
if (!fn || reentry) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
var frame = componentFrameCache.get(fn);
|
||||||
|
if (frame !== void 0) {
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var control;
|
||||||
|
reentry = true;
|
||||||
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
||||||
|
Error.prepareStackTrace = void 0;
|
||||||
|
var previousDispatcher;
|
||||||
|
{
|
||||||
|
previousDispatcher = ReactCurrentDispatcher.current;
|
||||||
|
ReactCurrentDispatcher.current = null;
|
||||||
|
disableLogs();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (construct) {
|
||||||
|
var Fake = function() {
|
||||||
|
throw Error();
|
||||||
|
};
|
||||||
|
Object.defineProperty(Fake.prototype, "props", {
|
||||||
|
set: function() {
|
||||||
|
throw Error();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (typeof Reflect === "object" && Reflect.construct) {
|
||||||
|
try {
|
||||||
|
Reflect.construct(Fake, []);
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
Reflect.construct(fn, [], Fake);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Fake.call();
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
fn.call(Fake.prototype);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
throw Error();
|
||||||
|
} catch (x) {
|
||||||
|
control = x;
|
||||||
|
}
|
||||||
|
fn();
|
||||||
|
}
|
||||||
|
} catch (sample) {
|
||||||
|
if (sample && control && typeof sample.stack === "string") {
|
||||||
|
var sampleLines = sample.stack.split("\n");
|
||||||
|
var controlLines = control.stack.split("\n");
|
||||||
|
var s = sampleLines.length - 1;
|
||||||
|
var c = controlLines.length - 1;
|
||||||
|
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
||||||
|
c--;
|
||||||
|
}
|
||||||
|
for (; s >= 1 && c >= 0; s--, c--) {
|
||||||
|
if (sampleLines[s] !== controlLines[c]) {
|
||||||
|
if (s !== 1 || c !== 1) {
|
||||||
|
do {
|
||||||
|
s--;
|
||||||
|
c--;
|
||||||
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
||||||
|
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
||||||
|
if (fn.displayName && _frame.includes("<anonymous>")) {
|
||||||
|
_frame = _frame.replace("<anonymous>", fn.displayName);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (typeof fn === "function") {
|
||||||
|
componentFrameCache.set(fn, _frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _frame;
|
||||||
|
}
|
||||||
|
} while (s >= 1 && c >= 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
reentry = false;
|
||||||
|
{
|
||||||
|
ReactCurrentDispatcher.current = previousDispatcher;
|
||||||
|
reenableLogs();
|
||||||
|
}
|
||||||
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
||||||
|
}
|
||||||
|
var name = fn ? fn.displayName || fn.name : "";
|
||||||
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
||||||
|
{
|
||||||
|
if (typeof fn === "function") {
|
||||||
|
componentFrameCache.set(fn, syntheticFrame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return syntheticFrame;
|
||||||
|
}
|
||||||
|
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
||||||
|
{
|
||||||
|
return describeNativeComponentFrame(fn, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function shouldConstruct(Component) {
|
||||||
|
var prototype = Component.prototype;
|
||||||
|
return !!(prototype && prototype.isReactComponent);
|
||||||
|
}
|
||||||
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
||||||
|
if (type == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (typeof type === "function") {
|
||||||
|
{
|
||||||
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof type === "string") {
|
||||||
|
return describeBuiltInComponentFrame(type);
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return describeBuiltInComponentFrame("Suspense");
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return describeBuiltInComponentFrame("SuspenseList");
|
||||||
|
}
|
||||||
|
if (typeof type === "object") {
|
||||||
|
switch (type.$$typeof) {
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
return describeFunctionComponentFrame(type.render);
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
||||||
|
case REACT_LAZY_TYPE: {
|
||||||
|
var lazyComponent = type;
|
||||||
|
var payload = lazyComponent._payload;
|
||||||
|
var init = lazyComponent._init;
|
||||||
|
try {
|
||||||
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
||||||
|
} catch (x) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
var loggedTypeFailures = {};
|
||||||
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
function setCurrentlyValidatingElement(element) {
|
||||||
|
{
|
||||||
|
if (element) {
|
||||||
|
var owner = element._owner;
|
||||||
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
||||||
|
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
||||||
|
} else {
|
||||||
|
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
||||||
|
{
|
||||||
|
var has = Function.call.bind(hasOwnProperty);
|
||||||
|
for (var typeSpecName in typeSpecs) {
|
||||||
|
if (has(typeSpecs, typeSpecName)) {
|
||||||
|
var error$1 = void 0;
|
||||||
|
try {
|
||||||
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
||||||
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
||||||
|
err.name = "Invariant Violation";
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
||||||
|
} catch (ex) {
|
||||||
|
error$1 = ex;
|
||||||
|
}
|
||||||
|
if (error$1 && !(error$1 instanceof Error)) {
|
||||||
|
setCurrentlyValidatingElement(element);
|
||||||
|
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
||||||
|
setCurrentlyValidatingElement(null);
|
||||||
|
}
|
||||||
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
||||||
|
loggedTypeFailures[error$1.message] = true;
|
||||||
|
setCurrentlyValidatingElement(element);
|
||||||
|
error("Failed %s type: %s", location, error$1.message);
|
||||||
|
setCurrentlyValidatingElement(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var isArrayImpl = Array.isArray;
|
||||||
|
function isArray(a) {
|
||||||
|
return isArrayImpl(a);
|
||||||
|
}
|
||||||
|
function typeName(value) {
|
||||||
|
{
|
||||||
|
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
||||||
|
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function willCoercionThrow(value) {
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
return false;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
{
|
||||||
|
if (willCoercionThrow(value)) {
|
||||||
|
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||||
|
var RESERVED_PROPS = {
|
||||||
|
key: true,
|
||||||
|
ref: true,
|
||||||
|
__self: true,
|
||||||
|
__source: true
|
||||||
|
};
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var specialPropRefWarningShown;
|
||||||
|
var didWarnAboutStringRefs;
|
||||||
|
{
|
||||||
|
didWarnAboutStringRefs = {};
|
||||||
|
}
|
||||||
|
function hasValidRef(config) {
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(config, "ref")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
||||||
|
if (getter && getter.isReactWarning) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return config.ref !== void 0;
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return config.key !== void 0;
|
||||||
|
}
|
||||||
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
||||||
|
{
|
||||||
|
if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
||||||
|
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
||||||
|
if (!didWarnAboutStringRefs[componentName]) {
|
||||||
|
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
||||||
|
didWarnAboutStringRefs[componentName] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
{
|
||||||
|
var warnAboutAccessingKey = function() {
|
||||||
|
if (!specialPropKeyWarningShown) {
|
||||||
|
specialPropKeyWarningShown = true;
|
||||||
|
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
warnAboutAccessingKey.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function defineRefPropWarningGetter(props, displayName) {
|
||||||
|
{
|
||||||
|
var warnAboutAccessingRef = function() {
|
||||||
|
if (!specialPropRefWarningShown) {
|
||||||
|
specialPropRefWarningShown = true;
|
||||||
|
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
warnAboutAccessingRef.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "ref", {
|
||||||
|
get: warnAboutAccessingRef,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
||||||
|
var element = {
|
||||||
|
// This tag allows us to uniquely identify this as a React Element
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
// Built-in properties that belong on the element
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
ref,
|
||||||
|
props,
|
||||||
|
// Record the component responsible for creating this element.
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
{
|
||||||
|
element._store = {};
|
||||||
|
Object.defineProperty(element._store, "validated", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: false
|
||||||
|
});
|
||||||
|
Object.defineProperty(element, "_self", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
value: self
|
||||||
|
});
|
||||||
|
Object.defineProperty(element, "_source", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
value: source
|
||||||
|
});
|
||||||
|
if (Object.freeze) {
|
||||||
|
Object.freeze(element.props);
|
||||||
|
Object.freeze(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
function jsxDEV(type, config, maybeKey, source, self) {
|
||||||
|
{
|
||||||
|
var propName;
|
||||||
|
var props = {};
|
||||||
|
var key = null;
|
||||||
|
var ref = null;
|
||||||
|
if (maybeKey !== void 0) {
|
||||||
|
{
|
||||||
|
checkKeyStringCoercion(maybeKey);
|
||||||
|
}
|
||||||
|
key = "" + maybeKey;
|
||||||
|
}
|
||||||
|
if (hasValidKey(config)) {
|
||||||
|
{
|
||||||
|
checkKeyStringCoercion(config.key);
|
||||||
|
}
|
||||||
|
key = "" + config.key;
|
||||||
|
}
|
||||||
|
if (hasValidRef(config)) {
|
||||||
|
ref = config.ref;
|
||||||
|
warnIfStringRefCannotBeAutoConverted(config, self);
|
||||||
|
}
|
||||||
|
for (propName in config) {
|
||||||
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
||||||
|
props[propName] = config[propName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type && type.defaultProps) {
|
||||||
|
var defaultProps = type.defaultProps;
|
||||||
|
for (propName in defaultProps) {
|
||||||
|
if (props[propName] === void 0) {
|
||||||
|
props[propName] = defaultProps[propName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (key || ref) {
|
||||||
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
||||||
|
if (key) {
|
||||||
|
defineKeyPropWarningGetter(props, displayName);
|
||||||
|
}
|
||||||
|
if (ref) {
|
||||||
|
defineRefPropWarningGetter(props, displayName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
||||||
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
||||||
|
function setCurrentlyValidatingElement$1(element) {
|
||||||
|
{
|
||||||
|
if (element) {
|
||||||
|
var owner = element._owner;
|
||||||
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
||||||
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
||||||
|
} else {
|
||||||
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var propTypesMisspellWarningShown;
|
||||||
|
{
|
||||||
|
propTypesMisspellWarningShown = false;
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
{
|
||||||
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getDeclarationErrorAddendum() {
|
||||||
|
{
|
||||||
|
if (ReactCurrentOwner$1.current) {
|
||||||
|
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
||||||
|
if (name) {
|
||||||
|
return "\n\nCheck the render method of `" + name + "`.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getSourceInfoErrorAddendum(source) {
|
||||||
|
{
|
||||||
|
if (source !== void 0) {
|
||||||
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
||||||
|
var lineNumber = source.lineNumber;
|
||||||
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ownerHasKeyUseWarning = {};
|
||||||
|
function getCurrentComponentErrorInfo(parentType) {
|
||||||
|
{
|
||||||
|
var info = getDeclarationErrorAddendum();
|
||||||
|
if (!info) {
|
||||||
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
||||||
|
if (parentName) {
|
||||||
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateExplicitKey(element, parentType) {
|
||||||
|
{
|
||||||
|
if (!element._store || element._store.validated || element.key != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element._store.validated = true;
|
||||||
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
||||||
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
||||||
|
var childOwner = "";
|
||||||
|
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
||||||
|
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
||||||
|
}
|
||||||
|
setCurrentlyValidatingElement$1(element);
|
||||||
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateChildKeys(node, parentType) {
|
||||||
|
{
|
||||||
|
if (typeof node !== "object") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isArray(node)) {
|
||||||
|
for (var i = 0; i < node.length; i++) {
|
||||||
|
var child = node[i];
|
||||||
|
if (isValidElement(child)) {
|
||||||
|
validateExplicitKey(child, parentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (isValidElement(node)) {
|
||||||
|
if (node._store) {
|
||||||
|
node._store.validated = true;
|
||||||
|
}
|
||||||
|
} else if (node) {
|
||||||
|
var iteratorFn = getIteratorFn(node);
|
||||||
|
if (typeof iteratorFn === "function") {
|
||||||
|
if (iteratorFn !== node.entries) {
|
||||||
|
var iterator = iteratorFn.call(node);
|
||||||
|
var step;
|
||||||
|
while (!(step = iterator.next()).done) {
|
||||||
|
if (isValidElement(step.value)) {
|
||||||
|
validateExplicitKey(step.value, parentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validatePropTypes(element) {
|
||||||
|
{
|
||||||
|
var type = element.type;
|
||||||
|
if (type === null || type === void 0 || typeof type === "string") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var propTypes;
|
||||||
|
if (typeof type === "function") {
|
||||||
|
propTypes = type.propTypes;
|
||||||
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
||||||
|
// Inner props are checked in the reconciler.
|
||||||
|
type.$$typeof === REACT_MEMO_TYPE)) {
|
||||||
|
propTypes = type.propTypes;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (propTypes) {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
||||||
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
||||||
|
propTypesMisspellWarningShown = true;
|
||||||
|
var _name = getComponentNameFromType(type);
|
||||||
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
||||||
|
}
|
||||||
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
||||||
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validateFragmentProps(fragment) {
|
||||||
|
{
|
||||||
|
var keys = Object.keys(fragment.props);
|
||||||
|
for (var i = 0; i < keys.length; i++) {
|
||||||
|
var key = keys[i];
|
||||||
|
if (key !== "children" && key !== "key") {
|
||||||
|
setCurrentlyValidatingElement$1(fragment);
|
||||||
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fragment.ref !== null) {
|
||||||
|
setCurrentlyValidatingElement$1(fragment);
|
||||||
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
||||||
|
setCurrentlyValidatingElement$1(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
||||||
|
{
|
||||||
|
var validType = isValidElementType(type);
|
||||||
|
if (!validType) {
|
||||||
|
var info = "";
|
||||||
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
||||||
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
||||||
|
}
|
||||||
|
var sourceInfo = getSourceInfoErrorAddendum(source);
|
||||||
|
if (sourceInfo) {
|
||||||
|
info += sourceInfo;
|
||||||
|
} else {
|
||||||
|
info += getDeclarationErrorAddendum();
|
||||||
|
}
|
||||||
|
var typeString;
|
||||||
|
if (type === null) {
|
||||||
|
typeString = "null";
|
||||||
|
} else if (isArray(type)) {
|
||||||
|
typeString = "array";
|
||||||
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
||||||
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
||||||
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
||||||
|
} else {
|
||||||
|
typeString = typeof type;
|
||||||
|
}
|
||||||
|
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
||||||
|
}
|
||||||
|
var element = jsxDEV(type, props, key, source, self);
|
||||||
|
if (element == null) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
if (validType) {
|
||||||
|
var children = props.children;
|
||||||
|
if (children !== void 0) {
|
||||||
|
if (isStaticChildren) {
|
||||||
|
if (isArray(children)) {
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
validateChildKeys(children[i], type);
|
||||||
|
}
|
||||||
|
if (Object.freeze) {
|
||||||
|
Object.freeze(children);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
validateChildKeys(children, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (hasOwnProperty.call(props, "key")) {
|
||||||
|
var componentName = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(props).filter(function(k) {
|
||||||
|
return k !== "key";
|
||||||
|
});
|
||||||
|
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
||||||
|
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
||||||
|
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
||||||
|
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) {
|
||||||
|
validateFragmentProps(element);
|
||||||
|
} else {
|
||||||
|
validatePropTypes(element);
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function jsxWithValidationStatic(type, props, key) {
|
||||||
|
{
|
||||||
|
return jsxWithValidation(type, props, key, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function jsxWithValidationDynamic(type, props, key) {
|
||||||
|
{
|
||||||
|
return jsxWithValidation(type, props, key, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var jsx = jsxWithValidationDynamic;
|
||||||
|
var jsxs = jsxWithValidationStatic;
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsx = jsx;
|
||||||
|
exports.jsxs = jsxs;
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react/jsx-runtime.js
|
||||||
|
var require_jsx_runtime = __commonJS({
|
||||||
|
"node_modules/react/jsx-runtime.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_jsx_runtime_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_jsx_runtime();
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react/cjs/react-jsx-runtime.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=react_jsx-runtime.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,22 @@
|
||||||
|
MIT LICENSE
|
||||||
|
|
||||||
|
Copyright (c) 2018-present Ant UED, https://xtech.antfin.com/
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<h1 align="center">Ant Design Colors</h1>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
:art: Color palettes calculator of [Ant Design](https://ant.design/docs/spec/colors).
|
||||||
|
|
||||||
|
[![CI status][github-action-image]][github-action-url]
|
||||||
|
[![codecov][codecov-image]][codecov-url]
|
||||||
|
[![NPM version][npm-image]][npm-url]
|
||||||
|
[![NPM downloads][download-image]][download-url]
|
||||||
|
[![][bundlephobia-image]][bundlephobia-url]
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[npm-image]: http://img.shields.io/npm/v/@ant-design/colors.svg?style=flat-square
|
||||||
|
[npm-url]: http://npmjs.org/package/@ant-design/colors
|
||||||
|
[github-action-image]: https://github.com/ant-design/ant-design-colors/actions/workflows/ci.yml/badge.svg
|
||||||
|
[github-action-url]: https://github.com/ant-design/ant-design-colors/actions/workflows/ci.yml
|
||||||
|
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design-colors/main.svg?style=flat-square
|
||||||
|
[codecov-url]: https://codecov.io/gh/ant-design/ant-design-colors/tree/main
|
||||||
|
[download-image]: https://img.shields.io/npm/dm/@ant-design/colors.svg?style=flat-square
|
||||||
|
[download-url]: https://npmjs.org/package/@ant-design/colors
|
||||||
|
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@ant-design/colors?style=flat-square
|
||||||
|
[bundlephobia-url]: https://bundlephobia.com/package/@ant-design/colors
|
||||||
|
</div>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install @ant-design/colors
|
||||||
|
// or
|
||||||
|
$ yarn add @ant-design/colors
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install @ant-design/colors --save
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
import {
|
||||||
|
red,
|
||||||
|
volcano,
|
||||||
|
gold,
|
||||||
|
yellow,
|
||||||
|
lime,
|
||||||
|
green,
|
||||||
|
cyan,
|
||||||
|
blue,
|
||||||
|
geekblue,
|
||||||
|
purple,
|
||||||
|
magenta,
|
||||||
|
grey,
|
||||||
|
} from '@ant-design/colors';
|
||||||
|
|
||||||
|
console.log(blue); // ['#E6F4FF', '#BAE0FF', '#91CAFF', '#69B1FF', '#4096FF', '#1677FF', '#0958D9', '#003EB3', '#002C8C', '#001D66']
|
||||||
|
console.log(blue.primary); // '#1677FF'
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { generate, presetPalettes } from '@ant-design/colors';
|
||||||
|
|
||||||
|
// Generate color palettes by a given color
|
||||||
|
const colors = generate('#1890ff');
|
||||||
|
console.log(colors); // ['#E6F7FF', '#BAE7FF', '#91D5FF', ''#69C0FF', '#40A9FF', '#1890FF', '#096DD9', '#0050B3', '#003A8C', '#002766']
|
||||||
|
console.log(presetPalettes);
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
red: [...],
|
||||||
|
volcano: [...],
|
||||||
|
orange: [...],
|
||||||
|
gold: [...],
|
||||||
|
yellow: [...],
|
||||||
|
lime: [...],
|
||||||
|
green: [...],
|
||||||
|
cyan: [...],
|
||||||
|
blue: [...],
|
||||||
|
geekblue: [...],
|
||||||
|
purple: [...],
|
||||||
|
magenta: [...],
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { generate, presetDarkPalettes } from '@ant-design/colors';
|
||||||
|
|
||||||
|
// Generate dark color palettes by a given color
|
||||||
|
const colors = generate('#1890ff', {
|
||||||
|
theme: 'dark',
|
||||||
|
backgroundColor: '#141414',
|
||||||
|
});
|
||||||
|
console.log(colors); // ['#111d2c', '#112a45', '#15395b', '#164c7e', '#1765ad', '#177ddc', '#3c9ae8', '#65b7f3', '#8dcff8', '#b7e3fa']
|
||||||
|
console.log(presetDarkPalettes);
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
red: [...],
|
||||||
|
volcano: [...],
|
||||||
|
orange: [...],
|
||||||
|
gold: [...],
|
||||||
|
yellow: [...],
|
||||||
|
lime: [...],
|
||||||
|
green: [...],
|
||||||
|
cyan: [...],
|
||||||
|
blue: [...],
|
||||||
|
geekblue: [...],
|
||||||
|
purple: [...],
|
||||||
|
magenta: [...],
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Articles
|
||||||
|
|
||||||
|
- [Ant Design Colors](https://ant.design/docs/spec/colors)
|
||||||
|
- [Ant Design 色板生成算法演进之路](https://zhuanlan.zhihu.com/p/32422584)
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
import type { ColorInput } from '@ant-design/fast-color';
|
||||||
|
interface Opts {
|
||||||
|
theme?: 'dark' | 'default';
|
||||||
|
backgroundColor?: string;
|
||||||
|
}
|
||||||
|
export default function generate(color: ColorInput, opts?: Opts): string[];
|
||||||
|
export {};
|
||||||
|
//# sourceMappingURL=generate.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsFzD,UAAU,IAAI;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,IAAS,GAAG,MAAM,EAAE,CA8B7E"}
|
||||||
|
|
@ -0,0 +1,128 @@
|
||||||
|
import { FastColor } from '@ant-design/fast-color';
|
||||||
|
var hueStep = 2; // 色相阶梯
|
||||||
|
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
|
||||||
|
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
|
||||||
|
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
|
||||||
|
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
|
||||||
|
var lightColorCount = 5; // 浅色数量,主色上
|
||||||
|
var darkColorCount = 4; // 深色数量,主色下
|
||||||
|
|
||||||
|
// 暗色主题颜色映射关系表
|
||||||
|
var darkColorMap = [{
|
||||||
|
index: 7,
|
||||||
|
amount: 15
|
||||||
|
}, {
|
||||||
|
index: 6,
|
||||||
|
amount: 25
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 30
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 45
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 65
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 85
|
||||||
|
}, {
|
||||||
|
index: 4,
|
||||||
|
amount: 90
|
||||||
|
}, {
|
||||||
|
index: 3,
|
||||||
|
amount: 95
|
||||||
|
}, {
|
||||||
|
index: 2,
|
||||||
|
amount: 97
|
||||||
|
}, {
|
||||||
|
index: 1,
|
||||||
|
amount: 98
|
||||||
|
}];
|
||||||
|
function getHue(hsv, i, light) {
|
||||||
|
var hue;
|
||||||
|
// 根据色相不同,色相转向不同
|
||||||
|
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
||||||
|
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
||||||
|
} else {
|
||||||
|
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
||||||
|
}
|
||||||
|
if (hue < 0) {
|
||||||
|
hue += 360;
|
||||||
|
} else if (hue >= 360) {
|
||||||
|
hue -= 360;
|
||||||
|
}
|
||||||
|
return hue;
|
||||||
|
}
|
||||||
|
function getSaturation(hsv, i, light) {
|
||||||
|
// grey color don't change saturation
|
||||||
|
if (hsv.h === 0 && hsv.s === 0) {
|
||||||
|
return hsv.s;
|
||||||
|
}
|
||||||
|
var saturation;
|
||||||
|
if (light) {
|
||||||
|
saturation = hsv.s - saturationStep * i;
|
||||||
|
} else if (i === darkColorCount) {
|
||||||
|
saturation = hsv.s + saturationStep;
|
||||||
|
} else {
|
||||||
|
saturation = hsv.s + saturationStep2 * i;
|
||||||
|
}
|
||||||
|
// 边界值修正
|
||||||
|
if (saturation > 1) {
|
||||||
|
saturation = 1;
|
||||||
|
}
|
||||||
|
// 第一格的 s 限制在 0.06-0.1 之间
|
||||||
|
if (light && i === lightColorCount && saturation > 0.1) {
|
||||||
|
saturation = 0.1;
|
||||||
|
}
|
||||||
|
if (saturation < 0.06) {
|
||||||
|
saturation = 0.06;
|
||||||
|
}
|
||||||
|
return Math.round(saturation * 100) / 100;
|
||||||
|
}
|
||||||
|
function getValue(hsv, i, light) {
|
||||||
|
var value;
|
||||||
|
if (light) {
|
||||||
|
value = hsv.v + brightnessStep1 * i;
|
||||||
|
} else {
|
||||||
|
value = hsv.v - brightnessStep2 * i;
|
||||||
|
}
|
||||||
|
// Clamp value between 0 and 1
|
||||||
|
value = Math.max(0, Math.min(1, value));
|
||||||
|
return Math.round(value * 100) / 100;
|
||||||
|
}
|
||||||
|
export default function generate(color) {
|
||||||
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||||
|
var patterns = [];
|
||||||
|
var pColor = new FastColor(color);
|
||||||
|
var hsv = pColor.toHsv();
|
||||||
|
for (var i = lightColorCount; i > 0; i -= 1) {
|
||||||
|
var c = new FastColor({
|
||||||
|
h: getHue(hsv, i, true),
|
||||||
|
s: getSaturation(hsv, i, true),
|
||||||
|
v: getValue(hsv, i, true)
|
||||||
|
});
|
||||||
|
patterns.push(c);
|
||||||
|
}
|
||||||
|
patterns.push(pColor);
|
||||||
|
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
||||||
|
var _c = new FastColor({
|
||||||
|
h: getHue(hsv, _i),
|
||||||
|
s: getSaturation(hsv, _i),
|
||||||
|
v: getValue(hsv, _i)
|
||||||
|
});
|
||||||
|
patterns.push(_c);
|
||||||
|
}
|
||||||
|
|
||||||
|
// dark theme patterns
|
||||||
|
if (opts.theme === 'dark') {
|
||||||
|
return darkColorMap.map(function (_ref) {
|
||||||
|
var index = _ref.index,
|
||||||
|
amount = _ref.amount;
|
||||||
|
return new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return patterns.map(function (c) {
|
||||||
|
return c.toHexString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export { default as generate } from './generate';
|
||||||
|
export * from './presets';
|
||||||
|
export type * from './types';
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,WAAW,CAAA;AACzB,mBAAmB,SAAS,CAAA"}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
export { default as generate } from "./generate";
|
||||||
|
export * from "./presets";
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
import type { Palette, PalettesProps } from './types';
|
||||||
|
export declare const presetPrimaryColors: Record<string, string>;
|
||||||
|
export declare const red: Palette;
|
||||||
|
export declare const volcano: Palette;
|
||||||
|
export declare const orange: Palette;
|
||||||
|
export declare const gold: Palette;
|
||||||
|
export declare const yellow: Palette;
|
||||||
|
export declare const lime: Palette;
|
||||||
|
export declare const green: Palette;
|
||||||
|
export declare const cyan: Palette;
|
||||||
|
export declare const blue: Palette;
|
||||||
|
export declare const geekblue: Palette;
|
||||||
|
export declare const purple: Palette;
|
||||||
|
export declare const magenta: Palette;
|
||||||
|
export declare const grey: Palette;
|
||||||
|
export declare const gray: Palette;
|
||||||
|
export declare const presetPalettes: PalettesProps;
|
||||||
|
export declare const redDark: Palette;
|
||||||
|
export declare const volcanoDark: Palette;
|
||||||
|
export declare const orangeDark: Palette;
|
||||||
|
export declare const goldDark: Palette;
|
||||||
|
export declare const yellowDark: Palette;
|
||||||
|
export declare const limeDark: Palette;
|
||||||
|
export declare const greenDark: Palette;
|
||||||
|
export declare const cyanDark: Palette;
|
||||||
|
export declare const blueDark: Palette;
|
||||||
|
export declare const geekblueDark: Palette;
|
||||||
|
export declare const purpleDark: Palette;
|
||||||
|
export declare const magentaDark: Palette;
|
||||||
|
export declare const greyDark: Palette;
|
||||||
|
export declare const presetDarkPalettes: PalettesProps;
|
||||||
|
//# sourceMappingURL=presets.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["presets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CActD,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,OAWjB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,OAWnB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,IAAI,SAAO,CAAC;AAEzB,eAAO,MAAM,cAAc,EAAE,aAc5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,OAWvB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,OAW1B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,aAchC,CAAC"}
|
||||||
|
|
@ -0,0 +1,100 @@
|
||||||
|
// Generated by script. Do NOT modify!
|
||||||
|
|
||||||
|
export var presetPrimaryColors = {
|
||||||
|
"red": "#F5222D",
|
||||||
|
"volcano": "#FA541C",
|
||||||
|
"orange": "#FA8C16",
|
||||||
|
"gold": "#FAAD14",
|
||||||
|
"yellow": "#FADB14",
|
||||||
|
"lime": "#A0D911",
|
||||||
|
"green": "#52C41A",
|
||||||
|
"cyan": "#13C2C2",
|
||||||
|
"blue": "#1677FF",
|
||||||
|
"geekblue": "#2F54EB",
|
||||||
|
"purple": "#722ED1",
|
||||||
|
"magenta": "#EB2F96",
|
||||||
|
"grey": "#666666"
|
||||||
|
};
|
||||||
|
export var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
|
||||||
|
red.primary = red[5];
|
||||||
|
export var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
|
||||||
|
volcano.primary = volcano[5];
|
||||||
|
export var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
|
||||||
|
orange.primary = orange[5];
|
||||||
|
export var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
|
||||||
|
gold.primary = gold[5];
|
||||||
|
export var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
|
||||||
|
yellow.primary = yellow[5];
|
||||||
|
export var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
|
||||||
|
lime.primary = lime[5];
|
||||||
|
export var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
|
||||||
|
green.primary = green[5];
|
||||||
|
export var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
|
||||||
|
cyan.primary = cyan[5];
|
||||||
|
export var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
||||||
|
blue.primary = blue[5];
|
||||||
|
export var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
|
||||||
|
geekblue.primary = geekblue[5];
|
||||||
|
export var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
|
||||||
|
purple.primary = purple[5];
|
||||||
|
export var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
|
||||||
|
magenta.primary = magenta[5];
|
||||||
|
export var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
|
||||||
|
grey.primary = grey[5];
|
||||||
|
export var gray = grey;
|
||||||
|
export var presetPalettes = {
|
||||||
|
red: red,
|
||||||
|
volcano: volcano,
|
||||||
|
orange: orange,
|
||||||
|
gold: gold,
|
||||||
|
yellow: yellow,
|
||||||
|
lime: lime,
|
||||||
|
green: green,
|
||||||
|
cyan: cyan,
|
||||||
|
blue: blue,
|
||||||
|
geekblue: geekblue,
|
||||||
|
purple: purple,
|
||||||
|
magenta: magenta,
|
||||||
|
grey: grey
|
||||||
|
};
|
||||||
|
export var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
|
||||||
|
redDark.primary = redDark[5];
|
||||||
|
export var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
|
||||||
|
volcanoDark.primary = volcanoDark[5];
|
||||||
|
export var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
|
||||||
|
orangeDark.primary = orangeDark[5];
|
||||||
|
export var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
|
||||||
|
goldDark.primary = goldDark[5];
|
||||||
|
export var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
|
||||||
|
yellowDark.primary = yellowDark[5];
|
||||||
|
export var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
|
||||||
|
limeDark.primary = limeDark[5];
|
||||||
|
export var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
|
||||||
|
greenDark.primary = greenDark[5];
|
||||||
|
export var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
|
||||||
|
cyanDark.primary = cyanDark[5];
|
||||||
|
export var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
|
||||||
|
blueDark.primary = blueDark[5];
|
||||||
|
export var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
|
||||||
|
geekblueDark.primary = geekblueDark[5];
|
||||||
|
export var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
|
||||||
|
purpleDark.primary = purpleDark[5];
|
||||||
|
export var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
|
||||||
|
magentaDark.primary = magentaDark[5];
|
||||||
|
export var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
|
||||||
|
greyDark.primary = greyDark[5];
|
||||||
|
export var presetDarkPalettes = {
|
||||||
|
red: redDark,
|
||||||
|
volcano: volcanoDark,
|
||||||
|
orange: orangeDark,
|
||||||
|
gold: goldDark,
|
||||||
|
yellow: yellowDark,
|
||||||
|
lime: limeDark,
|
||||||
|
green: greenDark,
|
||||||
|
cyan: cyanDark,
|
||||||
|
blue: blueDark,
|
||||||
|
geekblue: geekblueDark,
|
||||||
|
purple: purpleDark,
|
||||||
|
magenta: magentaDark,
|
||||||
|
grey: greyDark
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export type Palette = string[] & {
|
||||||
|
primary?: string;
|
||||||
|
};
|
||||||
|
export type PalettesProps = Record<string, Palette>;
|
||||||
|
//# sourceMappingURL=types.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
import type { ColorInput } from '@ant-design/fast-color';
|
||||||
|
interface Opts {
|
||||||
|
theme?: 'dark' | 'default';
|
||||||
|
backgroundColor?: string;
|
||||||
|
}
|
||||||
|
export default function generate(color: ColorInput, opts?: Opts): string[];
|
||||||
|
export {};
|
||||||
|
//# sourceMappingURL=generate.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsFzD,UAAU,IAAI;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,IAAS,GAAG,MAAM,EAAE,CA8B7E"}
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = generate;
|
||||||
|
var _fastColor = require("@ant-design/fast-color");
|
||||||
|
var hueStep = 2; // 色相阶梯
|
||||||
|
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
|
||||||
|
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
|
||||||
|
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
|
||||||
|
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
|
||||||
|
var lightColorCount = 5; // 浅色数量,主色上
|
||||||
|
var darkColorCount = 4; // 深色数量,主色下
|
||||||
|
|
||||||
|
// 暗色主题颜色映射关系表
|
||||||
|
var darkColorMap = [{
|
||||||
|
index: 7,
|
||||||
|
amount: 15
|
||||||
|
}, {
|
||||||
|
index: 6,
|
||||||
|
amount: 25
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 30
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 45
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 65
|
||||||
|
}, {
|
||||||
|
index: 5,
|
||||||
|
amount: 85
|
||||||
|
}, {
|
||||||
|
index: 4,
|
||||||
|
amount: 90
|
||||||
|
}, {
|
||||||
|
index: 3,
|
||||||
|
amount: 95
|
||||||
|
}, {
|
||||||
|
index: 2,
|
||||||
|
amount: 97
|
||||||
|
}, {
|
||||||
|
index: 1,
|
||||||
|
amount: 98
|
||||||
|
}];
|
||||||
|
function getHue(hsv, i, light) {
|
||||||
|
var hue;
|
||||||
|
// 根据色相不同,色相转向不同
|
||||||
|
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
||||||
|
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
||||||
|
} else {
|
||||||
|
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
||||||
|
}
|
||||||
|
if (hue < 0) {
|
||||||
|
hue += 360;
|
||||||
|
} else if (hue >= 360) {
|
||||||
|
hue -= 360;
|
||||||
|
}
|
||||||
|
return hue;
|
||||||
|
}
|
||||||
|
function getSaturation(hsv, i, light) {
|
||||||
|
// grey color don't change saturation
|
||||||
|
if (hsv.h === 0 && hsv.s === 0) {
|
||||||
|
return hsv.s;
|
||||||
|
}
|
||||||
|
var saturation;
|
||||||
|
if (light) {
|
||||||
|
saturation = hsv.s - saturationStep * i;
|
||||||
|
} else if (i === darkColorCount) {
|
||||||
|
saturation = hsv.s + saturationStep;
|
||||||
|
} else {
|
||||||
|
saturation = hsv.s + saturationStep2 * i;
|
||||||
|
}
|
||||||
|
// 边界值修正
|
||||||
|
if (saturation > 1) {
|
||||||
|
saturation = 1;
|
||||||
|
}
|
||||||
|
// 第一格的 s 限制在 0.06-0.1 之间
|
||||||
|
if (light && i === lightColorCount && saturation > 0.1) {
|
||||||
|
saturation = 0.1;
|
||||||
|
}
|
||||||
|
if (saturation < 0.06) {
|
||||||
|
saturation = 0.06;
|
||||||
|
}
|
||||||
|
return Math.round(saturation * 100) / 100;
|
||||||
|
}
|
||||||
|
function getValue(hsv, i, light) {
|
||||||
|
var value;
|
||||||
|
if (light) {
|
||||||
|
value = hsv.v + brightnessStep1 * i;
|
||||||
|
} else {
|
||||||
|
value = hsv.v - brightnessStep2 * i;
|
||||||
|
}
|
||||||
|
// Clamp value between 0 and 1
|
||||||
|
value = Math.max(0, Math.min(1, value));
|
||||||
|
return Math.round(value * 100) / 100;
|
||||||
|
}
|
||||||
|
function generate(color) {
|
||||||
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||||
|
var patterns = [];
|
||||||
|
var pColor = new _fastColor.FastColor(color);
|
||||||
|
var hsv = pColor.toHsv();
|
||||||
|
for (var i = lightColorCount; i > 0; i -= 1) {
|
||||||
|
var c = new _fastColor.FastColor({
|
||||||
|
h: getHue(hsv, i, true),
|
||||||
|
s: getSaturation(hsv, i, true),
|
||||||
|
v: getValue(hsv, i, true)
|
||||||
|
});
|
||||||
|
patterns.push(c);
|
||||||
|
}
|
||||||
|
patterns.push(pColor);
|
||||||
|
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
||||||
|
var _c = new _fastColor.FastColor({
|
||||||
|
h: getHue(hsv, _i),
|
||||||
|
s: getSaturation(hsv, _i),
|
||||||
|
v: getValue(hsv, _i)
|
||||||
|
});
|
||||||
|
patterns.push(_c);
|
||||||
|
}
|
||||||
|
|
||||||
|
// dark theme patterns
|
||||||
|
if (opts.theme === 'dark') {
|
||||||
|
return darkColorMap.map(function (_ref) {
|
||||||
|
var index = _ref.index,
|
||||||
|
amount = _ref.amount;
|
||||||
|
return new _fastColor.FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return patterns.map(function (c) {
|
||||||
|
return c.toHexString();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export { default as generate } from './generate';
|
||||||
|
export * from './presets';
|
||||||
|
export type * from './types';
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,WAAW,CAAA;AACzB,mBAAmB,SAAS,CAAA"}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
var _exportNames = {
|
||||||
|
generate: true
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "generate", {
|
||||||
|
enumerable: true,
|
||||||
|
get: function get() {
|
||||||
|
return _generate.default;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var _generate = _interopRequireDefault(require("./generate"));
|
||||||
|
var _presets = require("./presets");
|
||||||
|
Object.keys(_presets).forEach(function (key) {
|
||||||
|
if (key === "default" || key === "__esModule") return;
|
||||||
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||||
|
if (key in exports && exports[key] === _presets[key]) return;
|
||||||
|
Object.defineProperty(exports, key, {
|
||||||
|
enumerable: true,
|
||||||
|
get: function get() {
|
||||||
|
return _presets[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
import type { Palette, PalettesProps } from './types';
|
||||||
|
export declare const presetPrimaryColors: Record<string, string>;
|
||||||
|
export declare const red: Palette;
|
||||||
|
export declare const volcano: Palette;
|
||||||
|
export declare const orange: Palette;
|
||||||
|
export declare const gold: Palette;
|
||||||
|
export declare const yellow: Palette;
|
||||||
|
export declare const lime: Palette;
|
||||||
|
export declare const green: Palette;
|
||||||
|
export declare const cyan: Palette;
|
||||||
|
export declare const blue: Palette;
|
||||||
|
export declare const geekblue: Palette;
|
||||||
|
export declare const purple: Palette;
|
||||||
|
export declare const magenta: Palette;
|
||||||
|
export declare const grey: Palette;
|
||||||
|
export declare const gray: Palette;
|
||||||
|
export declare const presetPalettes: PalettesProps;
|
||||||
|
export declare const redDark: Palette;
|
||||||
|
export declare const volcanoDark: Palette;
|
||||||
|
export declare const orangeDark: Palette;
|
||||||
|
export declare const goldDark: Palette;
|
||||||
|
export declare const yellowDark: Palette;
|
||||||
|
export declare const limeDark: Palette;
|
||||||
|
export declare const greenDark: Palette;
|
||||||
|
export declare const cyanDark: Palette;
|
||||||
|
export declare const blueDark: Palette;
|
||||||
|
export declare const geekblueDark: Palette;
|
||||||
|
export declare const purpleDark: Palette;
|
||||||
|
export declare const magentaDark: Palette;
|
||||||
|
export declare const greyDark: Palette;
|
||||||
|
export declare const presetDarkPalettes: PalettesProps;
|
||||||
|
//# sourceMappingURL=presets.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["presets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CActD,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,OAWjB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,OAWnB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,OAWpB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,OAWlB,CAAC;AAGF,eAAO,MAAM,IAAI,SAAO,CAAC;AAEzB,eAAO,MAAM,cAAc,EAAE,aAc5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,OAWrB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,OAWvB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,OAW1B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAWxB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAWtB,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,aAchC,CAAC"}
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.yellowDark = exports.yellow = exports.volcanoDark = exports.volcano = exports.redDark = exports.red = exports.purpleDark = exports.purple = exports.presetPrimaryColors = exports.presetPalettes = exports.presetDarkPalettes = exports.orangeDark = exports.orange = exports.magentaDark = exports.magenta = exports.limeDark = exports.lime = exports.greyDark = exports.grey = exports.greenDark = exports.green = exports.gray = exports.goldDark = exports.gold = exports.geekblueDark = exports.geekblue = exports.cyanDark = exports.cyan = exports.blueDark = exports.blue = void 0;
|
||||||
|
// Generated by script. Do NOT modify!
|
||||||
|
|
||||||
|
var presetPrimaryColors = exports.presetPrimaryColors = {
|
||||||
|
"red": "#F5222D",
|
||||||
|
"volcano": "#FA541C",
|
||||||
|
"orange": "#FA8C16",
|
||||||
|
"gold": "#FAAD14",
|
||||||
|
"yellow": "#FADB14",
|
||||||
|
"lime": "#A0D911",
|
||||||
|
"green": "#52C41A",
|
||||||
|
"cyan": "#13C2C2",
|
||||||
|
"blue": "#1677FF",
|
||||||
|
"geekblue": "#2F54EB",
|
||||||
|
"purple": "#722ED1",
|
||||||
|
"magenta": "#EB2F96",
|
||||||
|
"grey": "#666666"
|
||||||
|
};
|
||||||
|
var red = exports.red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
|
||||||
|
red.primary = red[5];
|
||||||
|
var volcano = exports.volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
|
||||||
|
volcano.primary = volcano[5];
|
||||||
|
var orange = exports.orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
|
||||||
|
orange.primary = orange[5];
|
||||||
|
var gold = exports.gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
|
||||||
|
gold.primary = gold[5];
|
||||||
|
var yellow = exports.yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
|
||||||
|
yellow.primary = yellow[5];
|
||||||
|
var lime = exports.lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
|
||||||
|
lime.primary = lime[5];
|
||||||
|
var green = exports.green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
|
||||||
|
green.primary = green[5];
|
||||||
|
var cyan = exports.cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
|
||||||
|
cyan.primary = cyan[5];
|
||||||
|
var blue = exports.blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
||||||
|
blue.primary = blue[5];
|
||||||
|
var geekblue = exports.geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
|
||||||
|
geekblue.primary = geekblue[5];
|
||||||
|
var purple = exports.purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
|
||||||
|
purple.primary = purple[5];
|
||||||
|
var magenta = exports.magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
|
||||||
|
magenta.primary = magenta[5];
|
||||||
|
var grey = exports.grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
|
||||||
|
grey.primary = grey[5];
|
||||||
|
var gray = exports.gray = grey;
|
||||||
|
var presetPalettes = exports.presetPalettes = {
|
||||||
|
red: red,
|
||||||
|
volcano: volcano,
|
||||||
|
orange: orange,
|
||||||
|
gold: gold,
|
||||||
|
yellow: yellow,
|
||||||
|
lime: lime,
|
||||||
|
green: green,
|
||||||
|
cyan: cyan,
|
||||||
|
blue: blue,
|
||||||
|
geekblue: geekblue,
|
||||||
|
purple: purple,
|
||||||
|
magenta: magenta,
|
||||||
|
grey: grey
|
||||||
|
};
|
||||||
|
var redDark = exports.redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
|
||||||
|
redDark.primary = redDark[5];
|
||||||
|
var volcanoDark = exports.volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
|
||||||
|
volcanoDark.primary = volcanoDark[5];
|
||||||
|
var orangeDark = exports.orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
|
||||||
|
orangeDark.primary = orangeDark[5];
|
||||||
|
var goldDark = exports.goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
|
||||||
|
goldDark.primary = goldDark[5];
|
||||||
|
var yellowDark = exports.yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
|
||||||
|
yellowDark.primary = yellowDark[5];
|
||||||
|
var limeDark = exports.limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
|
||||||
|
limeDark.primary = limeDark[5];
|
||||||
|
var greenDark = exports.greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
|
||||||
|
greenDark.primary = greenDark[5];
|
||||||
|
var cyanDark = exports.cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
|
||||||
|
cyanDark.primary = cyanDark[5];
|
||||||
|
var blueDark = exports.blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
|
||||||
|
blueDark.primary = blueDark[5];
|
||||||
|
var geekblueDark = exports.geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
|
||||||
|
geekblueDark.primary = geekblueDark[5];
|
||||||
|
var purpleDark = exports.purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
|
||||||
|
purpleDark.primary = purpleDark[5];
|
||||||
|
var magentaDark = exports.magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
|
||||||
|
magentaDark.primary = magentaDark[5];
|
||||||
|
var greyDark = exports.greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
|
||||||
|
greyDark.primary = greyDark[5];
|
||||||
|
var presetDarkPalettes = exports.presetDarkPalettes = {
|
||||||
|
red: redDark,
|
||||||
|
volcano: volcanoDark,
|
||||||
|
orange: orangeDark,
|
||||||
|
gold: goldDark,
|
||||||
|
yellow: yellowDark,
|
||||||
|
lime: limeDark,
|
||||||
|
green: greenDark,
|
||||||
|
cyan: cyanDark,
|
||||||
|
blue: blueDark,
|
||||||
|
geekblue: geekblueDark,
|
||||||
|
purple: purpleDark,
|
||||||
|
magenta: magentaDark,
|
||||||
|
grey: greyDark
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export type Palette = string[] & {
|
||||||
|
primary?: string;
|
||||||
|
};
|
||||||
|
export type PalettesProps = Record<string, Palette>;
|
||||||
|
//# sourceMappingURL=types.d.ts.map
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"name": "@ant-design/colors",
|
||||||
|
"version": "7.2.1",
|
||||||
|
"description": "Color palettes calculator of Ant Design",
|
||||||
|
"homepage": "https://github.com/ant-design/ant-design-colors#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/ant-design/ant-design-colors/issues"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/ant-design/ant-design-colors.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "afc163 <afc163@gmail.com>",
|
||||||
|
"main": "./lib/index",
|
||||||
|
"module": "./es/index",
|
||||||
|
"typings": "es/index.d.ts",
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"es"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"bench": "vitest bench",
|
||||||
|
"coverage": "npm test -- --coverage",
|
||||||
|
"compile": "father build",
|
||||||
|
"lint": "eslint src --ext .ts",
|
||||||
|
"prepare": "tsx generate-presets",
|
||||||
|
"prepublishOnly": "npm run compile && np --no-cleanup --no-publish --branch=antd-5.x",
|
||||||
|
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
||||||
|
"test": "jest"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@ant-design/fast-color": "^2.0.6"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@ctrl/tinycolor": "^3.6.1",
|
||||||
|
"@types/jest": "^26.0.24",
|
||||||
|
"@types/node": "^20.14.9",
|
||||||
|
"@umijs/fabric": "^3.0.0",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"father": "^4.4.4",
|
||||||
|
"jest": "^26.6.3",
|
||||||
|
"np": "^7.7.0",
|
||||||
|
"prettier": "^2.8.8",
|
||||||
|
"ts-jest": "^26.5.6",
|
||||||
|
"tsx": "^4.16.1",
|
||||||
|
"typescript": "~5.8.2",
|
||||||
|
"vitest": "^1.6.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
# @ant-design/cssinjs-utils
|
||||||
|
A cssinjs util library to support Ant Design (antd) and its ecosystem libraries.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
``` bash
|
||||||
|
npm i @ant-design/cssinjs-utils --save
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
## Example
|
||||||
|
http://localhost:8000
|
||||||
|
|
||||||
|
## Development
|
||||||
|
``` bash
|
||||||
|
npm install
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
## Test Case
|
||||||
|
```
|
||||||
|
npm test
|
||||||
|
npm run coverage
|
||||||
|
```
|
||||||
|
open coverage/ dir
|
||||||
|
|
||||||
|
## License
|
||||||
|
cssinjs-util is released under the MIT license.
|
||||||
6
node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.d.ts
generated
vendored
Normal file
6
node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
import React from 'react';
|
||||||
|
/**
|
||||||
|
* Like `useMemo`, but this hook result will be shared across all instances.
|
||||||
|
*/
|
||||||
|
declare function useUniqueMemo<T>(memoFn: () => T, deps: React.DependencyList): T;
|
||||||
|
export default useUniqueMemo;
|
||||||
100
node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.js
generated
vendored
Normal file
100
node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.js
generated
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||||
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||||
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||||
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||||
|
import React from 'react';
|
||||||
|
var BEAT_LIMIT = 1000 * 60 * 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A helper class to map keys to values.
|
||||||
|
* It supports both primitive keys and object keys.
|
||||||
|
*/
|
||||||
|
var ArrayKeyMap = /*#__PURE__*/function () {
|
||||||
|
function ArrayKeyMap() {
|
||||||
|
_classCallCheck(this, ArrayKeyMap);
|
||||||
|
_defineProperty(this, "map", new Map());
|
||||||
|
// Use WeakMap to avoid memory leak
|
||||||
|
_defineProperty(this, "objectIDMap", new WeakMap());
|
||||||
|
_defineProperty(this, "nextID", 0);
|
||||||
|
_defineProperty(this, "lastAccessBeat", new Map());
|
||||||
|
// We will clean up the cache when reach the limit
|
||||||
|
_defineProperty(this, "accessBeat", 0);
|
||||||
|
}
|
||||||
|
_createClass(ArrayKeyMap, [{
|
||||||
|
key: "set",
|
||||||
|
value: function set(keys, value) {
|
||||||
|
// New set will trigger clear
|
||||||
|
this.clear();
|
||||||
|
|
||||||
|
// Set logic
|
||||||
|
var compositeKey = this.getCompositeKey(keys);
|
||||||
|
this.map.set(compositeKey, value);
|
||||||
|
this.lastAccessBeat.set(compositeKey, Date.now());
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "get",
|
||||||
|
value: function get(keys) {
|
||||||
|
var compositeKey = this.getCompositeKey(keys);
|
||||||
|
var cache = this.map.get(compositeKey);
|
||||||
|
this.lastAccessBeat.set(compositeKey, Date.now());
|
||||||
|
this.accessBeat += 1;
|
||||||
|
return cache;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "getCompositeKey",
|
||||||
|
value: function getCompositeKey(keys) {
|
||||||
|
var _this = this;
|
||||||
|
var ids = keys.map(function (key) {
|
||||||
|
if (key && _typeof(key) === 'object') {
|
||||||
|
return "obj_".concat(_this.getObjectID(key));
|
||||||
|
}
|
||||||
|
return "".concat(_typeof(key), "_").concat(key);
|
||||||
|
});
|
||||||
|
return ids.join('|');
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "getObjectID",
|
||||||
|
value: function getObjectID(obj) {
|
||||||
|
if (this.objectIDMap.has(obj)) {
|
||||||
|
return this.objectIDMap.get(obj);
|
||||||
|
}
|
||||||
|
var id = this.nextID;
|
||||||
|
this.objectIDMap.set(obj, id);
|
||||||
|
this.nextID += 1;
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "clear",
|
||||||
|
value: function clear() {
|
||||||
|
var _this2 = this;
|
||||||
|
if (this.accessBeat > 10000) {
|
||||||
|
var now = Date.now();
|
||||||
|
this.lastAccessBeat.forEach(function (beat, key) {
|
||||||
|
if (now - beat > BEAT_LIMIT) {
|
||||||
|
_this2.map.delete(key);
|
||||||
|
_this2.lastAccessBeat.delete(key);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.accessBeat = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return ArrayKeyMap;
|
||||||
|
}();
|
||||||
|
var uniqueMap = new ArrayKeyMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like `useMemo`, but this hook result will be shared across all instances.
|
||||||
|
*/
|
||||||
|
function useUniqueMemo(memoFn, deps) {
|
||||||
|
return React.useMemo(function () {
|
||||||
|
var cachedValue = uniqueMap.get(deps);
|
||||||
|
if (cachedValue) {
|
||||||
|
return cachedValue;
|
||||||
|
}
|
||||||
|
var newValue = memoFn();
|
||||||
|
uniqueMap.set(deps, newValue);
|
||||||
|
return newValue;
|
||||||
|
}, deps);
|
||||||
|
}
|
||||||
|
export default useUniqueMemo;
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
export type UseCSP = () => {
|
||||||
|
nonce?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Provide a default hook since not everyone needs to config this.
|
||||||
|
*/
|
||||||
|
declare const useDefaultCSP: UseCSP;
|
||||||
|
export default useDefaultCSP;
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* Provide a default hook since not everyone needs to config this.
|
||||||
|
*/
|
||||||
|
var useDefaultCSP = function useDefaultCSP() {
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
export default useDefaultCSP;
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
export type UsePrefix = () => {
|
||||||
|
/**
|
||||||
|
* All the component use `@ant-design/cssinjs-utils` should have same `rootPrefixCls`.
|
||||||
|
*/
|
||||||
|
rootPrefixCls: string;
|
||||||
|
/**
|
||||||
|
* `iconPrefixCls` comes from the setting of `@ant-design/icons`.
|
||||||
|
* Here maybe little coupling but everyone need use this.
|
||||||
|
*/
|
||||||
|
iconPrefixCls: string;
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import type { Theme, TokenType } from '@ant-design/cssinjs';
|
||||||
|
import type { OverrideTokenMap, TokenMap, GlobalToken } from '../interface';
|
||||||
|
export type TokenMapWithTheme<CompTokenMap extends TokenMap, AliasToken extends TokenType, DesignToken extends TokenType> = {
|
||||||
|
[key in keyof OverrideTokenMap<CompTokenMap, AliasToken>]?: OverrideTokenMap<CompTokenMap, AliasToken>[key] & {
|
||||||
|
theme?: Theme<DesignToken, AliasToken>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export interface UseTokenReturn<CompTokenMap extends TokenMap, AliasToken extends TokenType, DesignToken extends TokenType> {
|
||||||
|
token: GlobalToken<CompTokenMap, AliasToken>;
|
||||||
|
realToken?: GlobalToken<CompTokenMap, AliasToken>;
|
||||||
|
theme?: Theme<DesignToken, AliasToken>;
|
||||||
|
components?: TokenMapWithTheme<CompTokenMap, DesignToken, AliasToken>;
|
||||||
|
hashId?: string;
|
||||||
|
hashed?: string | boolean;
|
||||||
|
cssVar?: {
|
||||||
|
prefix?: string;
|
||||||
|
key?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export type UseToken<CompTokenMap extends TokenMap, DesignToken extends TokenType, AliasToken extends TokenType> = () => UseTokenReturn<CompTokenMap, DesignToken, AliasToken>;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
export { default as genStyleUtils } from './util/genStyleUtils';
|
||||||
|
export { default as genCalc } from './util/calc';
|
||||||
|
export { default as statisticToken, merge as mergeToken, statistic } from './util/statistic';
|
||||||
|
export type { OverrideTokenMap, TokenMap, TokenMapKey, GlobalTokenWithComponent, ComponentToken, ComponentTokenKey, GlobalToken, } from './interface';
|
||||||
|
export type { default as AbstractCalculator } from './util/calc/calculator';
|
||||||
|
export type { FullToken, GetDefaultToken, GetDefaultTokenFn, GenStyleFn, TokenWithCommonCls, CSSUtil, } from './util/genStyleUtils';
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export { default as genStyleUtils } from "./util/genStyleUtils";
|
||||||
|
export { default as genCalc } from "./util/calc";
|
||||||
|
export { default as statisticToken, merge as mergeToken, statistic } from "./util/statistic";
|
||||||
10
node_modules/@ant-design/cssinjs-utils/es/interface/components.d.ts
generated
vendored
Normal file
10
node_modules/@ant-design/cssinjs-utils/es/interface/components.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import type { TokenType } from '@ant-design/cssinjs';
|
||||||
|
export type TokenMap = Record<PropertyKey, any>;
|
||||||
|
export type TokenMapKey<CompTokenMap extends TokenMap> = Extract<keyof CompTokenMap, string>;
|
||||||
|
export type GlobalToken<CompTokenMap extends TokenMap, AliasToken extends TokenType> = AliasToken & CompTokenMap;
|
||||||
|
export type OverrideTokenMap<CompTokenMap extends TokenMap, AliasToken extends TokenType> = {
|
||||||
|
[key in keyof CompTokenMap]: Partial<CompTokenMap[key]> & Partial<AliasToken>;
|
||||||
|
};
|
||||||
|
export type GlobalTokenWithComponent<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = GlobalToken<CompTokenMap, AliasToken> & CompTokenMap[C];
|
||||||
|
export type ComponentToken<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = Exclude<OverrideTokenMap<CompTokenMap, AliasToken>[C], undefined>;
|
||||||
|
export type ComponentTokenKey<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = keyof ComponentToken<CompTokenMap, AliasToken, C>;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
/// <reference types="react" />
|
||||||
|
export type { OverrideTokenMap, TokenMap, TokenMapKey, GlobalTokenWithComponent, ComponentToken, ComponentTokenKey, GlobalToken, } from './components';
|
||||||
|
export type UseComponentStyleResult = [(node: React.ReactNode) => React.ReactElement, string];
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
15
node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.d.ts
generated
vendored
Normal file
15
node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import AbstractCalculator from './calculator';
|
||||||
|
export default class CSSCalculator extends AbstractCalculator {
|
||||||
|
result: string;
|
||||||
|
unitlessCssVar: Set<string>;
|
||||||
|
lowPriority?: boolean;
|
||||||
|
constructor(num: number | string | AbstractCalculator, unitlessCssVar: Set<string>);
|
||||||
|
add(num: number | string | AbstractCalculator): this;
|
||||||
|
sub(num: number | string | AbstractCalculator): this;
|
||||||
|
mul(num: number | string | AbstractCalculator): this;
|
||||||
|
div(num: number | string | AbstractCalculator): this;
|
||||||
|
getResult(force?: boolean): string;
|
||||||
|
equal(options?: {
|
||||||
|
unit?: boolean;
|
||||||
|
}): string;
|
||||||
|
}
|
||||||
116
node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.js
generated
vendored
Normal file
116
node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||||
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||||
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||||
|
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
||||||
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
||||||
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
||||||
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||||
|
import AbstractCalculator from "./calculator";
|
||||||
|
var CALC_UNIT = 'CALC_UNIT';
|
||||||
|
var regexp = new RegExp(CALC_UNIT, 'g');
|
||||||
|
function unit(value) {
|
||||||
|
if (typeof value === 'number') {
|
||||||
|
return "".concat(value).concat(CALC_UNIT);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
var CSSCalculator = /*#__PURE__*/function (_AbstractCalculator) {
|
||||||
|
_inherits(CSSCalculator, _AbstractCalculator);
|
||||||
|
var _super = _createSuper(CSSCalculator);
|
||||||
|
function CSSCalculator(num, unitlessCssVar) {
|
||||||
|
var _this;
|
||||||
|
_classCallCheck(this, CSSCalculator);
|
||||||
|
_this = _super.call(this);
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "result", '');
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "unitlessCssVar", void 0);
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "lowPriority", void 0);
|
||||||
|
var numType = _typeof(num);
|
||||||
|
_this.unitlessCssVar = unitlessCssVar;
|
||||||
|
if (num instanceof CSSCalculator) {
|
||||||
|
_this.result = "(".concat(num.result, ")");
|
||||||
|
} else if (numType === 'number') {
|
||||||
|
_this.result = unit(num);
|
||||||
|
} else if (numType === 'string') {
|
||||||
|
_this.result = num;
|
||||||
|
}
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
_createClass(CSSCalculator, [{
|
||||||
|
key: "add",
|
||||||
|
value: function add(num) {
|
||||||
|
if (num instanceof CSSCalculator) {
|
||||||
|
this.result = "".concat(this.result, " + ").concat(num.getResult());
|
||||||
|
} else if (typeof num === 'number' || typeof num === 'string') {
|
||||||
|
this.result = "".concat(this.result, " + ").concat(unit(num));
|
||||||
|
}
|
||||||
|
this.lowPriority = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "sub",
|
||||||
|
value: function sub(num) {
|
||||||
|
if (num instanceof CSSCalculator) {
|
||||||
|
this.result = "".concat(this.result, " - ").concat(num.getResult());
|
||||||
|
} else if (typeof num === 'number' || typeof num === 'string') {
|
||||||
|
this.result = "".concat(this.result, " - ").concat(unit(num));
|
||||||
|
}
|
||||||
|
this.lowPriority = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "mul",
|
||||||
|
value: function mul(num) {
|
||||||
|
if (this.lowPriority) {
|
||||||
|
this.result = "(".concat(this.result, ")");
|
||||||
|
}
|
||||||
|
if (num instanceof CSSCalculator) {
|
||||||
|
this.result = "".concat(this.result, " * ").concat(num.getResult(true));
|
||||||
|
} else if (typeof num === 'number' || typeof num === 'string') {
|
||||||
|
this.result = "".concat(this.result, " * ").concat(num);
|
||||||
|
}
|
||||||
|
this.lowPriority = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "div",
|
||||||
|
value: function div(num) {
|
||||||
|
if (this.lowPriority) {
|
||||||
|
this.result = "(".concat(this.result, ")");
|
||||||
|
}
|
||||||
|
if (num instanceof CSSCalculator) {
|
||||||
|
this.result = "".concat(this.result, " / ").concat(num.getResult(true));
|
||||||
|
} else if (typeof num === 'number' || typeof num === 'string') {
|
||||||
|
this.result = "".concat(this.result, " / ").concat(num);
|
||||||
|
}
|
||||||
|
this.lowPriority = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "getResult",
|
||||||
|
value: function getResult(force) {
|
||||||
|
return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "equal",
|
||||||
|
value: function equal(options) {
|
||||||
|
var _this2 = this;
|
||||||
|
var _ref = options || {},
|
||||||
|
cssUnit = _ref.unit;
|
||||||
|
var mergedUnit = true;
|
||||||
|
if (typeof cssUnit === 'boolean') {
|
||||||
|
mergedUnit = cssUnit;
|
||||||
|
} else if (Array.from(this.unitlessCssVar).some(function (cssVar) {
|
||||||
|
return _this2.result.includes(cssVar);
|
||||||
|
})) {
|
||||||
|
mergedUnit = false;
|
||||||
|
}
|
||||||
|
this.result = this.result.replace(regexp, mergedUnit ? 'px' : '');
|
||||||
|
if (typeof this.lowPriority !== 'undefined') {
|
||||||
|
return "calc(".concat(this.result, ")");
|
||||||
|
}
|
||||||
|
return this.result;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return CSSCalculator;
|
||||||
|
}(AbstractCalculator);
|
||||||
|
export { CSSCalculator as default };
|
||||||
11
node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.d.ts
generated
vendored
Normal file
11
node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import AbstractCalculator from './calculator';
|
||||||
|
declare class NumCalculator extends AbstractCalculator {
|
||||||
|
result: number;
|
||||||
|
constructor(num: number | string | AbstractCalculator);
|
||||||
|
add(num: number | string | AbstractCalculator): this;
|
||||||
|
sub(num: number | string | AbstractCalculator): this;
|
||||||
|
mul(num: number | string | AbstractCalculator): this;
|
||||||
|
div(num: number | string | AbstractCalculator): this;
|
||||||
|
equal(): number;
|
||||||
|
}
|
||||||
|
export default NumCalculator;
|
||||||
71
node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.js
generated
vendored
Normal file
71
node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||||
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||||
|
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
||||||
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
||||||
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
||||||
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||||
|
import AbstractCalculator from "./calculator";
|
||||||
|
var NumCalculator = /*#__PURE__*/function (_AbstractCalculator) {
|
||||||
|
_inherits(NumCalculator, _AbstractCalculator);
|
||||||
|
var _super = _createSuper(NumCalculator);
|
||||||
|
function NumCalculator(num) {
|
||||||
|
var _this;
|
||||||
|
_classCallCheck(this, NumCalculator);
|
||||||
|
_this = _super.call(this);
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "result", 0);
|
||||||
|
if (num instanceof NumCalculator) {
|
||||||
|
_this.result = num.result;
|
||||||
|
} else if (typeof num === 'number') {
|
||||||
|
_this.result = num;
|
||||||
|
}
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
_createClass(NumCalculator, [{
|
||||||
|
key: "add",
|
||||||
|
value: function add(num) {
|
||||||
|
if (num instanceof NumCalculator) {
|
||||||
|
this.result += num.result;
|
||||||
|
} else if (typeof num === 'number') {
|
||||||
|
this.result += num;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "sub",
|
||||||
|
value: function sub(num) {
|
||||||
|
if (num instanceof NumCalculator) {
|
||||||
|
this.result -= num.result;
|
||||||
|
} else if (typeof num === 'number') {
|
||||||
|
this.result -= num;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "mul",
|
||||||
|
value: function mul(num) {
|
||||||
|
if (num instanceof NumCalculator) {
|
||||||
|
this.result *= num.result;
|
||||||
|
} else if (typeof num === 'number') {
|
||||||
|
this.result *= num;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "div",
|
||||||
|
value: function div(num) {
|
||||||
|
if (num instanceof NumCalculator) {
|
||||||
|
this.result /= num.result;
|
||||||
|
} else if (typeof num === 'number') {
|
||||||
|
this.result /= num;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "equal",
|
||||||
|
value: function equal() {
|
||||||
|
return this.result;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return NumCalculator;
|
||||||
|
}(AbstractCalculator);
|
||||||
|
export default NumCalculator;
|
||||||
30
node_modules/@ant-design/cssinjs-utils/es/util/calc/calculator.d.ts
generated
vendored
Normal file
30
node_modules/@ant-design/cssinjs-utils/es/util/calc/calculator.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
declare abstract class AbstractCalculator {
|
||||||
|
/**
|
||||||
|
* @descCN 计算两数的和,例如:1 + 2
|
||||||
|
* @descEN Calculate the sum of two numbers, e.g. 1 + 2
|
||||||
|
*/
|
||||||
|
abstract add(num: number | string | AbstractCalculator): this;
|
||||||
|
/**
|
||||||
|
* @descCN 计算两数的差,例如:1 - 2
|
||||||
|
* @descEN Calculate the difference between two numbers, e.g. 1 - 2
|
||||||
|
*/
|
||||||
|
abstract sub(num: number | string | AbstractCalculator): this;
|
||||||
|
/**
|
||||||
|
* @descCN 计算两数的积,例如:1 * 2
|
||||||
|
* @descEN Calculate the product of two numbers, e.g. 1 * 2
|
||||||
|
*/
|
||||||
|
abstract mul(num: number | string | AbstractCalculator): this;
|
||||||
|
/**
|
||||||
|
* @descCN 计算两数的商,例如:1 / 2
|
||||||
|
* @descEN Calculate the quotient of two numbers, e.g. 1 / 2
|
||||||
|
*/
|
||||||
|
abstract div(num: number | string | AbstractCalculator): this;
|
||||||
|
/**
|
||||||
|
* @descCN 获取计算结果
|
||||||
|
* @descEN Get the calculation result
|
||||||
|
*/
|
||||||
|
abstract equal(options?: {
|
||||||
|
unit?: boolean;
|
||||||
|
}): string | number;
|
||||||
|
}
|
||||||
|
export default AbstractCalculator;
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||||
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||||
|
var AbstractCalculator = /*#__PURE__*/_createClass(function AbstractCalculator() {
|
||||||
|
_classCallCheck(this, AbstractCalculator);
|
||||||
|
});
|
||||||
|
export default AbstractCalculator;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
import type AbstractCalculator from './calculator';
|
||||||
|
import CSSCalculator from './CSSCalculator';
|
||||||
|
import NumCalculator from './NumCalculator';
|
||||||
|
declare const genCalc: (type: 'css' | 'js', unitlessCssVar: Set<string>) => (num: number | string | AbstractCalculator) => CSSCalculator | NumCalculator;
|
||||||
|
export default genCalc;
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
import CSSCalculator from "./CSSCalculator";
|
||||||
|
import NumCalculator from "./NumCalculator";
|
||||||
|
var genCalc = function genCalc(type, unitlessCssVar) {
|
||||||
|
var Calculator = type === 'css' ? CSSCalculator : NumCalculator;
|
||||||
|
return function (num) {
|
||||||
|
return new Calculator(num, unitlessCssVar);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default genCalc;
|
||||||
116
node_modules/@ant-design/cssinjs-utils/es/util/genStyleUtils.d.ts
generated
vendored
Normal file
116
node_modules/@ant-design/cssinjs-utils/es/util/genStyleUtils.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
import React from 'react';
|
||||||
|
import type { CSSInterpolation, CSSObject, TokenType } from '@ant-design/cssinjs';
|
||||||
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
||||||
|
import type { ComponentTokenKey, GlobalTokenWithComponent, TokenMap, TokenMapKey, UseComponentStyleResult } from '../interface';
|
||||||
|
import type AbstractCalculator from './calc/calculator';
|
||||||
|
import type { UseCSP } from '../hooks/useCSP';
|
||||||
|
import type { UsePrefix } from '../hooks/usePrefix';
|
||||||
|
import type { UseToken } from '../hooks/useToken';
|
||||||
|
type LayerConfig = Parameters<typeof useStyleRegister>[0]['layer'];
|
||||||
|
export interface StyleInfo {
|
||||||
|
hashId: string;
|
||||||
|
prefixCls: string;
|
||||||
|
rootPrefixCls: string;
|
||||||
|
iconPrefixCls: string;
|
||||||
|
}
|
||||||
|
export type CSSUtil = {
|
||||||
|
calc: (number: any) => AbstractCalculator;
|
||||||
|
max: (...values: (number | string)[]) => number | string;
|
||||||
|
min: (...values: (number | string)[]) => number | string;
|
||||||
|
};
|
||||||
|
export type TokenWithCommonCls<T> = T & {
|
||||||
|
/** Wrap component class with `.` prefix */
|
||||||
|
componentCls: string;
|
||||||
|
/** Origin prefix which do not have `.` prefix */
|
||||||
|
prefixCls: string;
|
||||||
|
/** Wrap icon class with `.` prefix */
|
||||||
|
iconCls: string;
|
||||||
|
/** Wrap ant prefixCls class with `.` prefix */
|
||||||
|
antCls: string;
|
||||||
|
} & CSSUtil;
|
||||||
|
export type FullToken<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = TokenWithCommonCls<GlobalTokenWithComponent<CompTokenMap, AliasToken, C>>;
|
||||||
|
export type GenStyleFn<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = (token: FullToken<CompTokenMap, AliasToken, C>, info: StyleInfo) => CSSInterpolation;
|
||||||
|
export type GetDefaultTokenFn<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = (token: AliasToken & Partial<CompTokenMap[C]>) => CompTokenMap[C];
|
||||||
|
export type GetDefaultToken<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = null | CompTokenMap[C] | GetDefaultTokenFn<CompTokenMap, AliasToken, C>;
|
||||||
|
export interface SubStyleComponentProps {
|
||||||
|
prefixCls: string;
|
||||||
|
rootCls?: string;
|
||||||
|
}
|
||||||
|
export type CSSVarRegisterProps = {
|
||||||
|
rootCls: string;
|
||||||
|
component: string;
|
||||||
|
cssVar: {
|
||||||
|
prefix?: string;
|
||||||
|
key?: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
type GetResetStylesConfig = {
|
||||||
|
prefix: ReturnType<UsePrefix>;
|
||||||
|
csp: ReturnType<UseCSP>;
|
||||||
|
};
|
||||||
|
export type GetResetStyles<AliasToken extends TokenType> = (token: AliasToken, config?: GetResetStylesConfig) => CSSInterpolation;
|
||||||
|
export type GetCompUnitless<CompTokenMap extends TokenMap, AliasToken extends TokenType> = <C extends TokenMapKey<CompTokenMap>>(component: C | [C, string]) => Partial<Record<ComponentTokenKey<CompTokenMap, AliasToken, C>, boolean>>;
|
||||||
|
declare function genStyleUtils<CompTokenMap extends TokenMap, AliasToken extends TokenType, DesignToken extends TokenType>(config: {
|
||||||
|
usePrefix: UsePrefix;
|
||||||
|
useToken: UseToken<CompTokenMap, AliasToken, DesignToken>;
|
||||||
|
useCSP?: UseCSP;
|
||||||
|
getResetStyles?: GetResetStyles<AliasToken>;
|
||||||
|
getCommonStyle?: (token: AliasToken, componentPrefixCls: string, rootCls?: string, resetFont?: boolean) => CSSObject;
|
||||||
|
getCompUnitless?: GetCompUnitless<CompTokenMap, AliasToken>;
|
||||||
|
layer?: LayerConfig;
|
||||||
|
}): {
|
||||||
|
genStyleHooks: <C extends TokenMapKey<CompTokenMap>>(component: C | [C, string], styleFn: GenStyleFn<CompTokenMap, AliasToken, C>, getDefaultToken?: GetDefaultToken<CompTokenMap, AliasToken, C>, options?: {
|
||||||
|
resetStyle?: boolean;
|
||||||
|
resetFont?: boolean;
|
||||||
|
deprecatedTokens?: [keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C], undefined>, keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C], undefined>][];
|
||||||
|
/**
|
||||||
|
* Component tokens that do not need unit.
|
||||||
|
*/
|
||||||
|
unitless?: Partial<Record<keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C], undefined>, boolean>>;
|
||||||
|
/**
|
||||||
|
* Only use component style in client side. Ignore in SSR.
|
||||||
|
*/
|
||||||
|
clientOnly?: boolean;
|
||||||
|
/**
|
||||||
|
* Set order of component style.
|
||||||
|
* @default -999
|
||||||
|
*/
|
||||||
|
order?: number;
|
||||||
|
/**
|
||||||
|
* Whether generate styles
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
injectStyle?: boolean;
|
||||||
|
}) => (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||||
|
genSubStyleComponent: <C_1 extends TokenMapKey<CompTokenMap>>(componentName: C_1 | [C_1, string], styleFn: GenStyleFn<CompTokenMap, AliasToken, C_1>, getDefaultToken?: GetDefaultToken<CompTokenMap, AliasToken, C_1>, options?: {
|
||||||
|
resetStyle?: boolean;
|
||||||
|
resetFont?: boolean;
|
||||||
|
deprecatedTokens?: [keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_1], undefined>, keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_1], undefined>][];
|
||||||
|
/**
|
||||||
|
* Only use component style in client side. Ignore in SSR.
|
||||||
|
*/
|
||||||
|
clientOnly?: boolean;
|
||||||
|
/**
|
||||||
|
* Set order of component style. Default is -999.
|
||||||
|
*/
|
||||||
|
order?: number;
|
||||||
|
injectStyle?: boolean;
|
||||||
|
unitless?: Partial<Record<keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_1], undefined>, boolean>>;
|
||||||
|
}) => React.FunctionComponent<SubStyleComponentProps>;
|
||||||
|
genComponentStyleHook: <C_2 extends TokenMapKey<CompTokenMap>>(componentName: C_2 | [C_2, string], styleFn: GenStyleFn<CompTokenMap, AliasToken, C_2>, getDefaultToken?: GetDefaultToken<CompTokenMap, AliasToken, C_2>, options?: {
|
||||||
|
resetStyle?: boolean;
|
||||||
|
resetFont?: boolean;
|
||||||
|
deprecatedTokens?: [keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_2], undefined>, keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_2], undefined>][];
|
||||||
|
/**
|
||||||
|
* Only use component style in client side. Ignore in SSR.
|
||||||
|
*/
|
||||||
|
clientOnly?: boolean;
|
||||||
|
/**
|
||||||
|
* Set order of component style. Default is -999.
|
||||||
|
*/
|
||||||
|
order?: number;
|
||||||
|
injectStyle?: boolean;
|
||||||
|
unitless?: Partial<Record<keyof Exclude<import("../interface").OverrideTokenMap<CompTokenMap, AliasToken>[C_2], undefined>, boolean>>;
|
||||||
|
}) => (prefixCls: string, rootCls?: string) => UseComponentStyleResult;
|
||||||
|
};
|
||||||
|
export default genStyleUtils;
|
||||||
|
|
@ -0,0 +1,245 @@
|
||||||
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||||
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||||
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||||
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||||
|
import React from 'react';
|
||||||
|
import { token2CSSVar, useCSSVarRegister, useStyleRegister } from '@ant-design/cssinjs';
|
||||||
|
import genCalc from "./calc";
|
||||||
|
import getCompVarPrefix from "./getCompVarPrefix";
|
||||||
|
import getComponentToken from "./getComponentToken";
|
||||||
|
import getDefaultComponentToken from "./getDefaultComponentToken";
|
||||||
|
import genMaxMin from "./maxmin";
|
||||||
|
import statisticToken, { merge as mergeToken } from "./statistic";
|
||||||
|
import useUniqueMemo from "../_util/hooks/useUniqueMemo";
|
||||||
|
import useDefaultCSP from "../hooks/useCSP";
|
||||||
|
function genStyleUtils(config) {
|
||||||
|
// Dependency inversion for preparing basic config.
|
||||||
|
var _config$useCSP = config.useCSP,
|
||||||
|
useCSP = _config$useCSP === void 0 ? useDefaultCSP : _config$useCSP,
|
||||||
|
useToken = config.useToken,
|
||||||
|
usePrefix = config.usePrefix,
|
||||||
|
getResetStyles = config.getResetStyles,
|
||||||
|
getCommonStyle = config.getCommonStyle,
|
||||||
|
getCompUnitless = config.getCompUnitless;
|
||||||
|
function genStyleHooks(component, styleFn, getDefaultToken, options) {
|
||||||
|
var componentName = Array.isArray(component) ? component[0] : component;
|
||||||
|
function prefixToken(key) {
|
||||||
|
return "".concat(String(componentName)).concat(key.slice(0, 1).toUpperCase()).concat(key.slice(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fill unitless
|
||||||
|
var originUnitless = (options === null || options === void 0 ? void 0 : options.unitless) || {};
|
||||||
|
var originCompUnitless = typeof getCompUnitless === 'function' ? getCompUnitless(component) : {};
|
||||||
|
var compUnitless = _objectSpread(_objectSpread({}, originCompUnitless), {}, _defineProperty({}, prefixToken('zIndexPopup'), true));
|
||||||
|
Object.keys(originUnitless).forEach(function (key) {
|
||||||
|
compUnitless[prefixToken(key)] = originUnitless[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
// Options
|
||||||
|
var mergedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
||||||
|
unitless: compUnitless,
|
||||||
|
prefixToken: prefixToken
|
||||||
|
});
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
var useStyle = genComponentStyleHook(component, styleFn, getDefaultToken, mergedOptions);
|
||||||
|
var useCSSVar = genCSSVarRegister(componentName, getDefaultToken, mergedOptions);
|
||||||
|
return function (prefixCls) {
|
||||||
|
var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
|
||||||
|
var _useStyle = useStyle(prefixCls, rootCls),
|
||||||
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
||||||
|
hashId = _useStyle2[1];
|
||||||
|
var _useCSSVar = useCSSVar(rootCls),
|
||||||
|
_useCSSVar2 = _slicedToArray(_useCSSVar, 2),
|
||||||
|
wrapCSSVar = _useCSSVar2[0],
|
||||||
|
cssVarCls = _useCSSVar2[1];
|
||||||
|
return [wrapCSSVar, hashId, cssVarCls];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function genCSSVarRegister(component, getDefaultToken, options) {
|
||||||
|
var compUnitless = options.unitless,
|
||||||
|
_options$injectStyle = options.injectStyle,
|
||||||
|
injectStyle = _options$injectStyle === void 0 ? true : _options$injectStyle,
|
||||||
|
prefixToken = options.prefixToken,
|
||||||
|
ignore = options.ignore;
|
||||||
|
var CSSVarRegister = function CSSVarRegister(_ref) {
|
||||||
|
var rootCls = _ref.rootCls,
|
||||||
|
_ref$cssVar = _ref.cssVar,
|
||||||
|
cssVar = _ref$cssVar === void 0 ? {} : _ref$cssVar;
|
||||||
|
var _useToken = useToken(),
|
||||||
|
realToken = _useToken.realToken;
|
||||||
|
useCSSVarRegister({
|
||||||
|
path: [component],
|
||||||
|
prefix: cssVar.prefix,
|
||||||
|
key: cssVar.key,
|
||||||
|
unitless: compUnitless,
|
||||||
|
ignore: ignore,
|
||||||
|
token: realToken,
|
||||||
|
scope: rootCls
|
||||||
|
}, function () {
|
||||||
|
var defaultToken = getDefaultComponentToken(component, realToken, getDefaultToken);
|
||||||
|
var componentToken = getComponentToken(component, realToken, defaultToken, {
|
||||||
|
deprecatedTokens: options === null || options === void 0 ? void 0 : options.deprecatedTokens
|
||||||
|
});
|
||||||
|
Object.keys(defaultToken).forEach(function (key) {
|
||||||
|
componentToken[prefixToken(key)] = componentToken[key];
|
||||||
|
delete componentToken[key];
|
||||||
|
});
|
||||||
|
return componentToken;
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
var useCSSVar = function useCSSVar(rootCls) {
|
||||||
|
var _useToken2 = useToken(),
|
||||||
|
cssVar = _useToken2.cssVar;
|
||||||
|
return [function (node) {
|
||||||
|
return injectStyle && cssVar ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSVarRegister, {
|
||||||
|
rootCls: rootCls,
|
||||||
|
cssVar: cssVar,
|
||||||
|
component: component
|
||||||
|
}), node) : node;
|
||||||
|
}, cssVar === null || cssVar === void 0 ? void 0 : cssVar.key];
|
||||||
|
};
|
||||||
|
return useCSSVar;
|
||||||
|
}
|
||||||
|
function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
||||||
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
||||||
|
var cells = Array.isArray(componentName) ? componentName : [componentName, componentName];
|
||||||
|
var _cells = _slicedToArray(cells, 1),
|
||||||
|
component = _cells[0];
|
||||||
|
var concatComponent = cells.join('-');
|
||||||
|
var mergedLayer = config.layer || {
|
||||||
|
name: 'antd'
|
||||||
|
};
|
||||||
|
|
||||||
|
// Return new style hook
|
||||||
|
return function (prefixCls) {
|
||||||
|
var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
|
||||||
|
var _useToken3 = useToken(),
|
||||||
|
theme = _useToken3.theme,
|
||||||
|
realToken = _useToken3.realToken,
|
||||||
|
hashId = _useToken3.hashId,
|
||||||
|
token = _useToken3.token,
|
||||||
|
cssVar = _useToken3.cssVar;
|
||||||
|
var _usePrefix = usePrefix(),
|
||||||
|
rootPrefixCls = _usePrefix.rootPrefixCls,
|
||||||
|
iconPrefixCls = _usePrefix.iconPrefixCls;
|
||||||
|
var csp = useCSP();
|
||||||
|
var type = cssVar ? 'css' : 'js';
|
||||||
|
|
||||||
|
// Use unique memo to share the result across all instances
|
||||||
|
var calc = useUniqueMemo(function () {
|
||||||
|
var unitlessCssVar = new Set();
|
||||||
|
if (cssVar) {
|
||||||
|
Object.keys(options.unitless || {}).forEach(function (key) {
|
||||||
|
// Some component proxy the AliasToken (e.g. Image) and some not (e.g. Modal)
|
||||||
|
// We should both pass in `unitlessCssVar` to make sure the CSSVar can be unitless.
|
||||||
|
unitlessCssVar.add(token2CSSVar(key, cssVar.prefix));
|
||||||
|
unitlessCssVar.add(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return genCalc(type, unitlessCssVar);
|
||||||
|
}, [type, component, cssVar === null || cssVar === void 0 ? void 0 : cssVar.prefix]);
|
||||||
|
var _genMaxMin = genMaxMin(type),
|
||||||
|
max = _genMaxMin.max,
|
||||||
|
min = _genMaxMin.min;
|
||||||
|
|
||||||
|
// Shared config
|
||||||
|
var sharedConfig = {
|
||||||
|
theme: theme,
|
||||||
|
token: token,
|
||||||
|
hashId: hashId,
|
||||||
|
nonce: function nonce() {
|
||||||
|
return csp.nonce;
|
||||||
|
},
|
||||||
|
clientOnly: options.clientOnly,
|
||||||
|
layer: mergedLayer,
|
||||||
|
// antd is always at top of styles
|
||||||
|
order: options.order || -999
|
||||||
|
};
|
||||||
|
|
||||||
|
// This if statement is safe, as it will only be used if the generator has the function. It's not dynamic.
|
||||||
|
if (typeof getResetStyles === 'function') {
|
||||||
|
// Generate style for all need reset tags.
|
||||||
|
useStyleRegister(_objectSpread(_objectSpread({}, sharedConfig), {}, {
|
||||||
|
clientOnly: false,
|
||||||
|
path: ['Shared', rootPrefixCls]
|
||||||
|
}), function () {
|
||||||
|
return getResetStyles(token, {
|
||||||
|
prefix: {
|
||||||
|
rootPrefixCls: rootPrefixCls,
|
||||||
|
iconPrefixCls: iconPrefixCls
|
||||||
|
},
|
||||||
|
csp: csp
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var wrapSSR = useStyleRegister(_objectSpread(_objectSpread({}, sharedConfig), {}, {
|
||||||
|
path: [concatComponent, prefixCls, iconPrefixCls]
|
||||||
|
}), function () {
|
||||||
|
if (options.injectStyle === false) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
var _statisticToken = statisticToken(token),
|
||||||
|
proxyToken = _statisticToken.token,
|
||||||
|
flush = _statisticToken.flush;
|
||||||
|
var defaultComponentToken = getDefaultComponentToken(component, realToken, getDefaultToken);
|
||||||
|
var componentCls = ".".concat(prefixCls);
|
||||||
|
var componentToken = getComponentToken(component, realToken, defaultComponentToken, {
|
||||||
|
deprecatedTokens: options.deprecatedTokens
|
||||||
|
});
|
||||||
|
if (cssVar && defaultComponentToken && _typeof(defaultComponentToken) === 'object') {
|
||||||
|
Object.keys(defaultComponentToken).forEach(function (key) {
|
||||||
|
defaultComponentToken[key] = "var(".concat(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)), ")");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var mergedToken = mergeToken(proxyToken, {
|
||||||
|
componentCls: componentCls,
|
||||||
|
prefixCls: prefixCls,
|
||||||
|
iconCls: ".".concat(iconPrefixCls),
|
||||||
|
antCls: ".".concat(rootPrefixCls),
|
||||||
|
calc: calc,
|
||||||
|
// @ts-ignore
|
||||||
|
max: max,
|
||||||
|
// @ts-ignore
|
||||||
|
min: min
|
||||||
|
}, cssVar ? defaultComponentToken : componentToken);
|
||||||
|
var styleInterpolation = styleFn(mergedToken, {
|
||||||
|
hashId: hashId,
|
||||||
|
prefixCls: prefixCls,
|
||||||
|
rootPrefixCls: rootPrefixCls,
|
||||||
|
iconPrefixCls: iconPrefixCls
|
||||||
|
});
|
||||||
|
flush(component, componentToken);
|
||||||
|
var commonStyle = typeof getCommonStyle === 'function' ? getCommonStyle(mergedToken, prefixCls, rootCls, options.resetFont) : null;
|
||||||
|
return [options.resetStyle === false ? null : commonStyle, styleInterpolation];
|
||||||
|
});
|
||||||
|
return [wrapSSR, hashId];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function genSubStyleComponent(componentName, styleFn, getDefaultToken) {
|
||||||
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
||||||
|
var useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, _objectSpread({
|
||||||
|
resetStyle: false,
|
||||||
|
// Sub Style should default after root one
|
||||||
|
order: -998
|
||||||
|
}, options));
|
||||||
|
var StyledComponent = function StyledComponent(_ref2) {
|
||||||
|
var prefixCls = _ref2.prefixCls,
|
||||||
|
_ref2$rootCls = _ref2.rootCls,
|
||||||
|
rootCls = _ref2$rootCls === void 0 ? prefixCls : _ref2$rootCls;
|
||||||
|
useStyle(prefixCls, rootCls);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
StyledComponent.displayName = "SubStyle_".concat(String(Array.isArray(componentName) ? componentName.join('.') : componentName));
|
||||||
|
}
|
||||||
|
return StyledComponent;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
genStyleHooks: genStyleHooks,
|
||||||
|
genSubStyleComponent: genSubStyleComponent,
|
||||||
|
genComponentStyleHook: genComponentStyleHook
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export default genStyleUtils;
|
||||||
2
node_modules/@ant-design/cssinjs-utils/es/util/getCompVarPrefix.d.ts
generated
vendored
Normal file
2
node_modules/@ant-design/cssinjs-utils/es/util/getCompVarPrefix.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
declare const getCompVarPrefix: (component: string, prefix?: string) => string;
|
||||||
|
export default getCompVarPrefix;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
var getCompVarPrefix = function getCompVarPrefix(component, prefix) {
|
||||||
|
return "".concat([prefix, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, '$1-$2').replace(/([a-z])([A-Z])/g, '$1-$2')].filter(Boolean).join('-'));
|
||||||
|
};
|
||||||
|
export default getCompVarPrefix;
|
||||||
9
node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.d.ts
generated
vendored
Normal file
9
node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import type { TokenMap, TokenMapKey, ComponentTokenKey, GlobalToken } from '../interface';
|
||||||
|
import type { TokenType } from '@ant-design/cssinjs';
|
||||||
|
declare function getComponentToken<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>>(component: C, token: GlobalToken<CompTokenMap, AliasToken>, defaultToken: CompTokenMap[C], options?: {
|
||||||
|
deprecatedTokens?: [
|
||||||
|
ComponentTokenKey<CompTokenMap, AliasToken, C>,
|
||||||
|
ComponentTokenKey<CompTokenMap, AliasToken, C>
|
||||||
|
][];
|
||||||
|
}): any;
|
||||||
|
export default getComponentToken;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue