@tiny-codes/react-easy 1.7.6 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/es/components/ColumnSetting/index.js +2 -1
  3. package/es/components/ColumnSetting/index.js.map +1 -1
  4. package/es/components/ConfigProvider/context.d.ts +36 -0
  5. package/es/components/ConfigProvider/context.js +1 -0
  6. package/es/components/ConfigProvider/context.js.map +1 -1
  7. package/es/components/ConfigProvider/index.d.ts +5 -3
  8. package/es/components/ConfigProvider/index.js +13 -7
  9. package/es/components/ConfigProvider/index.js.map +1 -1
  10. package/es/components/ConfigProvider/style/index.js +1 -1
  11. package/es/components/ConfigProvider/style/index.js.map +1 -1
  12. package/es/components/ContextMenu/index.js +3 -2
  13. package/es/components/ContextMenu/index.js.map +1 -1
  14. package/es/components/ContextMenu/style/index.js.map +1 -1
  15. package/es/components/DeleteConfirmAction/withDeleteConfirmAction.d.ts +3 -3
  16. package/es/components/EditableText/index.js +3 -2
  17. package/es/components/EditableText/index.js.map +1 -1
  18. package/es/components/EllipsisTypography/withEllipsisTypography.d.ts +16 -0
  19. package/es/components/EllipsisTypography/withEllipsisTypography.js +18 -2
  20. package/es/components/EllipsisTypography/withEllipsisTypography.js.map +1 -1
  21. package/es/components/FloatDrawer/index.js +3 -2
  22. package/es/components/FloatDrawer/index.js.map +1 -1
  23. package/es/components/FloatDrawer/style/index.js +1 -1
  24. package/es/components/FloatDrawer/style/index.js.map +1 -1
  25. package/es/components/Iconfont/createIconfont.d.ts +42 -0
  26. package/es/components/Iconfont/createIconfont.js +57 -0
  27. package/es/components/Iconfont/createIconfont.js.map +1 -0
  28. package/es/components/Iconfont/index.d.ts +1 -0
  29. package/es/components/Iconfont/index.js +2 -0
  30. package/es/components/Iconfont/index.js.map +1 -0
  31. package/es/components/Loading/index.js +3 -2
  32. package/es/components/Loading/index.js.map +1 -1
  33. package/es/components/Loading/style/index.js +1 -1
  34. package/es/components/Loading/style/index.js.map +1 -1
  35. package/es/components/OverflowTags/index.js +3 -2
  36. package/es/components/OverflowTags/index.js.map +1 -1
  37. package/es/components/OverflowTags/style/index.js +1 -1
  38. package/es/components/OverflowTags/style/index.js.map +1 -1
  39. package/es/components/index.d.ts +1 -0
  40. package/es/components/index.js +1 -0
  41. package/es/components/index.js.map +1 -1
  42. package/es/hooks/style/useSplitter.d.ts +3 -0
  43. package/es/hooks/style/useSplitter.js +40 -0
  44. package/es/hooks/style/useSplitter.js.map +1 -0
  45. package/es/hooks/useSplitter.d.ts +52 -9
  46. package/es/hooks/useSplitter.js +69 -39
  47. package/es/hooks/useSplitter.js.map +1 -1
  48. package/lib/components/ColumnSetting/index.js +2 -1
  49. package/lib/components/ColumnSetting/index.js.map +3 -3
  50. package/lib/components/ConfigProvider/context.d.ts +36 -0
  51. package/lib/components/ConfigProvider/context.js +1 -0
  52. package/lib/components/ConfigProvider/context.js.map +2 -2
  53. package/lib/components/ConfigProvider/index.d.ts +5 -3
  54. package/lib/components/ConfigProvider/index.js +10 -2
  55. package/lib/components/ConfigProvider/index.js.map +2 -2
  56. package/lib/components/ConfigProvider/style/index.js +1 -1
  57. package/lib/components/ConfigProvider/style/index.js.map +2 -2
  58. package/lib/components/ContextMenu/index.js +2 -1
  59. package/lib/components/ContextMenu/index.js.map +3 -3
  60. package/lib/components/ContextMenu/style/index.js.map +2 -2
  61. package/lib/components/DeleteConfirmAction/withDeleteConfirmAction.d.ts +3 -3
  62. package/lib/components/EditableText/index.js +3 -2
  63. package/lib/components/EditableText/index.js.map +3 -3
  64. package/lib/components/EllipsisTypography/withEllipsisTypography.d.ts +16 -0
  65. package/lib/components/EllipsisTypography/withEllipsisTypography.js +16 -2
  66. package/lib/components/EllipsisTypography/withEllipsisTypography.js.map +2 -2
  67. package/lib/components/FloatDrawer/index.js +3 -2
  68. package/lib/components/FloatDrawer/index.js.map +3 -3
  69. package/lib/components/FloatDrawer/style/index.js +1 -1
  70. package/lib/components/FloatDrawer/style/index.js.map +2 -2
  71. package/lib/components/Iconfont/createIconfont.d.ts +42 -0
  72. package/lib/components/Iconfont/createIconfont.js +65 -0
  73. package/lib/components/Iconfont/createIconfont.js.map +7 -0
  74. package/lib/components/Iconfont/index.d.ts +1 -0
  75. package/lib/components/Iconfont/index.js +24 -0
  76. package/lib/components/Iconfont/index.js.map +7 -0
  77. package/lib/components/Loading/index.js +3 -2
  78. package/lib/components/Loading/index.js.map +3 -3
  79. package/lib/components/Loading/style/index.js +1 -1
  80. package/lib/components/Loading/style/index.js.map +2 -2
  81. package/lib/components/OverflowTags/index.js +3 -2
  82. package/lib/components/OverflowTags/index.js.map +3 -3
  83. package/lib/components/OverflowTags/style/index.js +1 -1
  84. package/lib/components/OverflowTags/style/index.js.map +2 -2
  85. package/lib/components/index.d.ts +1 -0
  86. package/lib/components/index.js +3 -1
  87. package/lib/components/index.js.map +2 -2
  88. package/lib/hooks/style/useSplitter.d.ts +3 -0
  89. package/lib/hooks/style/useSplitter.js +72 -0
  90. package/lib/hooks/style/useSplitter.js.map +7 -0
  91. package/lib/hooks/useSplitter.d.ts +52 -9
  92. package/lib/hooks/useSplitter.js +56 -26
  93. package/lib/hooks/useSplitter.js.map +3 -3
  94. package/package.json +2 -1
@@ -0,0 +1,65 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/Iconfont/createIconfont.tsx
30
+ var createIconfont_exports = {};
31
+ __export(createIconfont_exports, {
32
+ createIconfont: () => createIconfont
33
+ });
34
+ module.exports = __toCommonJS(createIconfont_exports);
35
+ var import_react = require("react");
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_icons = require("@ant-design/icons");
38
+ var import_ConfigProvider = __toESM(require("../ConfigProvider"));
39
+ var createIconfont = (scriptUrl, options) => {
40
+ const { iconPrefix = "" } = options || {};
41
+ const AntdIconfont = (0, import_icons.createFromIconfontCN)({ scriptUrl });
42
+ const Iconfont = (props) => {
43
+ const { type, className, size, style, ...iconProps } = props;
44
+ const { getPrefixCls } = (0, import_react.useContext)(import_ConfigProvider.default.ConfigContext);
45
+ const iconType = type.startsWith(iconPrefix) ? type : `${iconPrefix}-${type}`;
46
+ return /* @__PURE__ */ React.createElement(
47
+ AntdIconfont,
48
+ {
49
+ type: iconType,
50
+ className: (0, import_classnames.default)(getPrefixCls("iconfont"), className),
51
+ style: {
52
+ ...style,
53
+ fontSize: (style == null ? void 0 : style.fontSize) ?? size
54
+ },
55
+ ...iconProps
56
+ }
57
+ );
58
+ };
59
+ return Iconfont;
60
+ };
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ createIconfont
64
+ });
65
+ //# sourceMappingURL=createIconfont.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/Iconfont/createIconfont.tsx"],
4
+ "sourcesContent": ["import { type CSSProperties, type FC, useContext } from 'react';\nimport classNames from 'classnames';\nimport { createFromIconfontCN } from '@ant-design/icons';\nimport type { IconFontProps as AntIconFontProps } from '@ant-design/icons/es/components/IconFont';\nimport ConfigProvider from '../ConfigProvider';\n\n/**\n * - **EN:** Props for the Iconfont component\n * - **CN:** Iconfont 组件的props\n */\nexport interface IconfontProps<T extends string = string>\n extends Omit<AntIconFontProps<T>, 'type' | 'size' | 'spin' | 'rotate'> {\n /**\n * - **EN:** Icon name. Find an icon in iconfont and click `Copy Code`\n * - **CN:** 图标名称。在 iconfont 中找到某个图标,点击`复制代码`\n */\n type: T;\n /**\n * - **EN:** Whether the icon should spin continuously, can be used to indicate loading\n * - **CN:** 图标是否持续旋转,可以实现 loading 的效果\n *\n * @default false\n */\n spin?: boolean;\n /**\n * - **EN:** Rotate the icon by a fixed angle clockwise\n * - **CN:** 图标顺时针旋转一个固定角度\n *\n * @default 0\n */\n rotate?: number;\n /**\n * - **EN:** Icon size, an alias for `style.fontSize`\n * - **CN:** 图标尺寸,是 `style.fontSize` 的别名\n */\n size?: CSSProperties['fontSize'];\n}\n\n/**\n * - **EN:** Create an Iconfont component with a specified iconfont script URL.\n * - **CN:** 创建一个Iconfont组件,指定iconfont的脚本地址\n *\n * @param scriptUrl - Path to the iconfont script | 字体图标的路径\n */\nexport const createIconfont = <T extends string = string>(\n scriptUrl: string,\n options?: {\n /** Icon name prefix | 图标名称前缀 */\n iconPrefix?: string;\n }\n): FC<IconfontProps<T>> => {\n const { iconPrefix = '' } = options || {};\n const AntdIconfont = createFromIconfontCN({ scriptUrl });\n /**\n * - **EN:** Render an iconfont icon, setting the `type` prop to the iconfont icon name.\n * - **CN:** 渲染一个 iconfont 的图标,把 `type` 属性设置为 iconfont 字体的图标名\n */\n const Iconfont: FC<IconfontProps<T>> = (props) => {\n const { type, className, size, style, ...iconProps } = props;\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const iconType = type.startsWith(iconPrefix) ? type : `${iconPrefix}-${type}`;\n\n return (\n <AntdIconfont\n type={iconType}\n className={classNames(getPrefixCls('iconfont'), className)}\n style={{\n ...style,\n fontSize: style?.fontSize ?? size,\n }}\n {...iconProps}\n />\n );\n };\n return Iconfont;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwD;AACxD,wBAAuB;AACvB,mBAAqC;AAErC,4BAA2B;AAwCpB,IAAM,iBAAiB,CAC5B,WACA,YAIyB;AACzB,QAAM,EAAE,aAAa,GAAG,IAAI,WAAW,CAAC;AACxC,QAAM,mBAAe,mCAAqB,EAAE,UAAU,CAAC;AAKvD,QAAM,WAAiC,CAAC,UAAU;AAChD,UAAM,EAAE,MAAM,WAAW,MAAM,OAAO,GAAG,UAAU,IAAI;AACvD,UAAM,EAAE,aAAa,QAAI,yBAAW,sBAAAA,QAAe,aAAa;AAChE,UAAM,WAAW,KAAK,WAAW,UAAU,IAAI,OAAO,GAAG,cAAc;AAEvE,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,eAAW,kBAAAC,SAAW,aAAa,UAAU,GAAG,SAAS;AAAA,QACzD,OAAO;AAAA,UACL,GAAG;AAAA,UACH,WAAU,+BAAO,aAAY;AAAA,QAC/B;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACA,SAAO;AACT;",
6
+ "names": ["ConfigProvider", "classNames"]
7
+ }
@@ -0,0 +1 @@
1
+ export * from './createIconfont';
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/components/Iconfont/index.tsx
17
+ var Iconfont_exports = {};
18
+ module.exports = __toCommonJS(Iconfont_exports);
19
+ __reExport(Iconfont_exports, require("./createIconfont"), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require("./createIconfont")
23
+ });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/Iconfont/index.tsx"],
4
+ "sourcesContent": ["export * from './createIconfont';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,6BAAd;",
6
+ "names": []
7
+ }
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(Loading_exports);
35
35
  var import_react = require("react");
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
+ var import_ConfigProvider = __toESM(require("../ConfigProvider"));
38
39
  var import_style = __toESM(require("./style"));
39
40
  var Loading = (props) => {
40
41
  const {
@@ -47,8 +48,8 @@ var Loading = (props) => {
47
48
  className,
48
49
  ...spinProps
49
50
  } = props;
50
- const { getPrefixCls } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
51
- const prefixCls = getPrefixCls("easy-loading", prefixClsInProps);
51
+ const { getPrefixCls } = (0, import_react.useContext)(import_ConfigProvider.default.ConfigContext);
52
+ const prefixCls = getPrefixCls("loading", prefixClsInProps);
52
53
  const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls);
53
54
  return children ? (
54
55
  // Use spin to wrap children when children is provided,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Loading/index.tsx"],
4
- "sourcesContent": ["import { type CSSProperties, type FC, useContext } from 'react';\nimport type { SpinProps } from 'antd';\nimport { ConfigProvider, Spin } from 'antd';\nimport classNames from 'classnames';\nimport useStyle from './style';\n\nexport type LoadingProps = SpinProps & {\n /**\n * - **EN:** When used independently, the positioning method of the animation:\n *\n * - **absolute** - Uses absolute positioning, and the animation will automatically center itself\n * within the parent container.\n * - **flex** - Uses flexbox layout, and the animation will automatically fill the parent container\n * and center itself.\n * - **CN:** 独立使用时,动画的定位方式:\n *\n * - **absolute** - 使用绝对定位,动画会自动居中显示在父容器中。\n * - **flex** - 使用弹性布局,动画会自动填充父容器并居中显示。\n *\n * @default `flex`\n */\n mode?: 'absolute' | 'flex';\n /**\n * - **EN:** When used independently, set the class name for the mask parent container of the\n * animation\n * - **CN:** 在独立使用时,设置动画遮罩父容器的样式类名\n */\n rootClassName?: string;\n /**\n * - **EN:** When used independently, set the style for the mask parent container of the animation\n * - **CN:** 在独立使用时,设置动画遮罩父容器的样式\n */\n rootStyle?: CSSProperties;\n};\n\n/**\n * **EN:** Page loading animation component, providing two usage methods:\n *\n * - **Spin** - When the component wraps children, it wraps the `Spin` component around the children\n * to provide animation effects.\n * - **Independent** - Directly render a loading animation that automatically fills the parent\n * container and is centered.\n *\n * **CN:** 页面加载动画组件,提供两种使用方式:\n *\n * - **Spin** - 组件包裹children时,在children外层包裹 `Spin` 组件,提供动画效果。\n * - **独立使用** - 直接渲染一个加载动画,自动撑满父容器,且显示在居中位置。\n *\n * @example\n * 1. Spin surrounding children\n *\n * ```tsx\n * <PageLoading spinning={loading}>\n * <div>This is content</div>\n * </PageLoading>;\n * ```\n *\n * 2. Independent usage (inline layout)\n *\n * ```tsx\n * <PageLoading />;\n * ```\n *\n * 3. Centered display within container (absolute layout)\n *\n * ```tsx\n * <div className=\"container\" style={{ position: 'relative' }}>\n * <PageLoading absolute />\n * </div>;\n * ```\n */\nconst Loading: FC<LoadingProps> = (props) => {\n const {\n prefixCls: prefixClsInProps,\n mode = 'flex',\n rootClassName,\n rootStyle,\n children,\n spinning = true,\n className,\n ...spinProps\n } = props;\n\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('easy-loading', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n return children\n ? // Use spin to wrap children when children is provided,\n // and control the animation display with the spinning prop.\n wrapCSSVar(\n <Spin className={classNames(hashId, cssVarCls, prefixCls, className)} spinning={spinning} {...spinProps}>\n {children}\n </Spin>\n )\n : // Show the loading animation in a wrapper that fills the parent container and centers the animation,\n // and hides the entire component when the animation is off.\n spinning &&\n wrapCSSVar(\n <div\n className={classNames(\n hashId,\n cssVarCls,\n prefixCls,\n rootClassName,\n mode === 'absolute' ? `${prefixCls}-absolute` : `${prefixCls}-flex`\n )}\n style={rootStyle}\n >\n <Spin className={className} spinning={spinning} {...spinProps} />\n </div>\n );\n};\n\nexport default Loading;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwD;AAExD,kBAAqC;AACrC,wBAAuB;AACvB,mBAAqB;AAmErB,IAAM,UAA4B,CAAC,UAAU;AAC3C,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,aAAa,QAAI,yBAAW,2BAAe,aAAa;AAChE,QAAM,YAAY,aAAa,gBAAgB,gBAAgB;AAC/D,QAAM,CAAC,YAAY,QAAQ,SAAS,QAAI,aAAAA,SAAS,SAAS;AAE1D,SAAO;AAAA;AAAA;AAAA,IAGH;AAAA,MACE,oCAAC,oBAAK,eAAW,kBAAAC,SAAW,QAAQ,WAAW,WAAW,SAAS,GAAG,UAAqB,GAAG,aAC3F,QACH;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAGA,YACE;AAAA,MACE;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,kBAAAA;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAS,aAAa,GAAG,uBAAuB,GAAG;AAAA,UACrD;AAAA,UACA,OAAO;AAAA;AAAA,QAEP,oCAAC,oBAAK,WAAsB,UAAqB,GAAG,WAAW;AAAA,MACjE;AAAA,IACF;AAAA;AACR;AAEA,IAAO,kBAAQ;",
6
- "names": ["useStyle", "classNames"]
4
+ "sourcesContent": ["import { type CSSProperties, type FC, useContext } from 'react';\nimport type { SpinProps } from 'antd';\nimport { Spin } from 'antd';\nimport classNames from 'classnames';\nimport ConfigProvider from '../ConfigProvider';\nimport useStyle from './style';\n\nexport type LoadingProps = SpinProps & {\n /**\n * - **EN:** When used independently, the positioning method of the animation:\n *\n * - **absolute** - Uses absolute positioning, and the animation will automatically center itself\n * within the parent container.\n * - **flex** - Uses flexbox layout, and the animation will automatically fill the parent container\n * and center itself.\n * - **CN:** 独立使用时,动画的定位方式:\n *\n * - **absolute** - 使用绝对定位,动画会自动居中显示在父容器中。\n * - **flex** - 使用弹性布局,动画会自动填充父容器并居中显示。\n *\n * @default `flex`\n */\n mode?: 'absolute' | 'flex';\n /**\n * - **EN:** When used independently, set the class name for the mask parent container of the\n * animation\n * - **CN:** 在独立使用时,设置动画遮罩父容器的样式类名\n */\n rootClassName?: string;\n /**\n * - **EN:** When used independently, set the style for the mask parent container of the animation\n * - **CN:** 在独立使用时,设置动画遮罩父容器的样式\n */\n rootStyle?: CSSProperties;\n};\n\n/**\n * **EN:** Page loading animation component, providing two usage methods:\n *\n * - **Spin** - When the component wraps children, it wraps the `Spin` component around the children\n * to provide animation effects.\n * - **Independent** - Directly render a loading animation that automatically fills the parent\n * container and is centered.\n *\n * **CN:** 页面加载动画组件,提供两种使用方式:\n *\n * - **Spin** - 组件包裹children时,在children外层包裹 `Spin` 组件,提供动画效果。\n * - **独立使用** - 直接渲染一个加载动画,自动撑满父容器,且显示在居中位置。\n *\n * @example\n * 1. Spin surrounding children\n *\n * ```tsx\n * <PageLoading spinning={loading}>\n * <div>This is content</div>\n * </PageLoading>;\n * ```\n *\n * 2. Independent usage (inline layout)\n *\n * ```tsx\n * <PageLoading />;\n * ```\n *\n * 3. Centered display within container (absolute layout)\n *\n * ```tsx\n * <div className=\"container\" style={{ position: 'relative' }}>\n * <PageLoading absolute />\n * </div>;\n * ```\n */\nconst Loading: FC<LoadingProps> = (props) => {\n const {\n prefixCls: prefixClsInProps,\n mode = 'flex',\n rootClassName,\n rootStyle,\n children,\n spinning = true,\n className,\n ...spinProps\n } = props;\n\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('loading', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n return children\n ? // Use spin to wrap children when children is provided,\n // and control the animation display with the spinning prop.\n wrapCSSVar(\n <Spin className={classNames(hashId, cssVarCls, prefixCls, className)} spinning={spinning} {...spinProps}>\n {children}\n </Spin>\n )\n : // Show the loading animation in a wrapper that fills the parent container and centers the animation,\n // and hides the entire component when the animation is off.\n spinning &&\n wrapCSSVar(\n <div\n className={classNames(\n hashId,\n cssVarCls,\n prefixCls,\n rootClassName,\n mode === 'absolute' ? `${prefixCls}-absolute` : `${prefixCls}-flex`\n )}\n style={rootStyle}\n >\n <Spin className={className} spinning={spinning} {...spinProps} />\n </div>\n );\n};\n\nexport default Loading;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwD;AAExD,kBAAqB;AACrB,wBAAuB;AACvB,4BAA2B;AAC3B,mBAAqB;AAmErB,IAAM,UAA4B,CAAC,UAAU;AAC3C,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,aAAa,QAAI,yBAAW,sBAAAA,QAAe,aAAa;AAChE,QAAM,YAAY,aAAa,WAAW,gBAAgB;AAC1D,QAAM,CAAC,YAAY,QAAQ,SAAS,QAAI,aAAAC,SAAS,SAAS;AAE1D,SAAO;AAAA;AAAA;AAAA,IAGH;AAAA,MACE,oCAAC,oBAAK,eAAW,kBAAAC,SAAW,QAAQ,WAAW,WAAW,SAAS,GAAG,UAAqB,GAAG,aAC3F,QACH;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAGA,YACE;AAAA,MACE;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,kBAAAA;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAS,aAAa,GAAG,uBAAuB,GAAG;AAAA,UACrD;AAAA,UACA,OAAO;AAAA;AAAA,QAEP,oCAAC,oBAAK,WAAsB,UAAqB,GAAG,WAAW;AAAA,MACjE;AAAA,IACF;AAAA;AACR;AAEA,IAAO,kBAAQ;",
6
+ "names": ["ConfigProvider", "useStyle", "classNames"]
7
7
  }
@@ -46,5 +46,5 @@ var genStyle = (token) => {
46
46
  }
47
47
  };
48
48
  };
49
- var style_default = (0, import_internal.genStyleHooks)("EasyLoading", genStyle);
49
+ var style_default = (0, import_internal.genStyleHooks)("Loading", genStyle);
50
50
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/Loading/style/index.ts"],
4
- "sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<OverflowTagsToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n '&-flex': {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n },\n '&-absolute': {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n [`:global(.${token.antCls}-spin)`]: {\n lineHeight: 0,\n },\n },\n };\n};\n\nexport default genStyleHooks('EasyLoading' as never, genStyle);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAO9B,IAAM,WAA6C,CAAC,UAAqB;AACvE,QAAM,EAAE,aAAa,IAAI;AACzB,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,UAAU;AAAA,QACR,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,cAAc;AAAA,QACZ,UAAU;AAAA,QACV,KAAK;AAAA,QACL,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,CAAC,YAAY,MAAM,cAAc,GAAG;AAAA,QAClC,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,oBAAQ,+BAAc,eAAwB,QAAQ;",
4
+ "sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype LoadingToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<LoadingToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n '&-flex': {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n },\n '&-absolute': {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n [`:global(.${token.antCls}-spin)`]: {\n lineHeight: 0,\n },\n },\n };\n};\n\nexport default genStyleHooks('Loading' as never, genStyle);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAO9B,IAAM,WAAwC,CAAC,UAAqB;AAClE,QAAM,EAAE,aAAa,IAAI;AACzB,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,UAAU;AAAA,QACR,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,cAAc;AAAA,QACZ,UAAU;AAAA,QACV,KAAK;AAAA,QACL,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,CAAC,YAAY,MAAM,cAAc,GAAG;AAAA,QAClC,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,oBAAQ,+BAAc,WAAoB,QAAQ;",
6
6
  "names": []
7
7
  }
@@ -38,6 +38,7 @@ var import_internal = require("antd/es/theme/internal");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_rc_overflow = __toESM(require("rc-overflow"));
40
40
  var import_math = require("../../utils/math");
41
+ var import_ConfigProvider = __toESM(require("../ConfigProvider"));
41
42
  var import_style = __toESM(require("./style"));
42
43
  var OverflowTags = (props) => {
43
44
  const {
@@ -53,8 +54,8 @@ var OverflowTags = (props) => {
53
54
  ...restProps
54
55
  } = props;
55
56
  const { token } = import_antd.theme.useToken();
56
- const { getPrefixCls } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
57
- const prefixCls = getPrefixCls("easy-overflow-tags", prefixClsInProps);
57
+ const { getPrefixCls } = (0, import_react.useContext)(import_ConfigProvider.default.ConfigContext);
58
+ const prefixCls = getPrefixCls("overflow-tags", prefixClsInProps);
58
59
  const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls);
59
60
  const colors = (0, import_react.useMemo)(
60
61
  () => import_internal.PresetColors.filter((c) => !["lime", "yellow", "magenta"].includes(c)).map((color) => token[`${color}-3`]),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/OverflowTags/index.tsx"],
4
- "sourcesContent": ["import type { ReactNode } from 'react';\nimport { useCallback, useContext, useMemo } from 'react';\nimport type { DropdownProps, TagProps } from 'antd';\nimport { ConfigProvider, Dropdown, Tag, theme } from 'antd';\nimport { PresetColors } from 'antd/es/theme/internal';\nimport classNames from 'classnames';\nimport type { OverflowProps } from 'rc-overflow';\nimport Overflow from 'rc-overflow';\nimport { random } from '../../utils/math';\nimport useStyle from './style';\n\nexport interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem'> {\n /**\n * **CN**: 标签集合的数据\n *\n * **EN**: Data collection of tags\n */\n tags: T[] | undefined;\n /**\n * **EN**: Function to get the tag name, default is `tag.label` or `tag.name`\n *\n * **CN**: 获取标签名称的函数,默认取`tag.label`或`tag.name`\n */\n getTagName?: (tag: T) => ReactNode;\n /**\n * **EN**: Function to get the unique identifier of the tag, default is `tag.value` or `tag.id`\n *\n * **CN**: 获取标签唯一标识的函数,默认取`tag.value`或`tag.id`\n */\n getTagKey?: (tag: T) => React.Key;\n\n /**\n * **EN**: Custom tag rendering function\n *\n * **CN**: 标签渲染函数\n */\n renderTag?: OverflowProps<T>['renderItem'];\n /**\n * **EN**: Custom properties for the tag component\n *\n * **CN**: 自定义标签的组件属性\n */\n tagProps?: TagProps | ((tag: T, options: { tags: T[] }) => TagProps);\n /**\n * **EN**: When the number of tags exceeds the maximum display count, an ellipsis tag will be\n * shown. This property is used to set the style of the ellipsis tag.\n *\n * **CN**: 当标签数量超过最大显示数量时,会显示省略号的标签,此属性用于设置省略号标签的样式\n */\n ellipsisTagProps?: TagProps | ((tag: T, options: { omittedItems: T[]; allTags: T[] }) => TagProps);\n /**\n * **EN**: Custom properties for the dropdown component when tags are overflowed\n *\n * **CN**: 当标签溢出时,下拉菜单的自定义属性\n */\n ellipsisDropdownProps?: DropdownProps;\n /**\n * **EN**: Whether to use random colors, default is `false`. Note that the tag object can also\n * contain a `color` property to specify the color, and the latter takes precedence.\n *\n * **CN**: 是否使用随机颜色,默认`false`。注意,tag对象还可以包含`color`属性来指定颜色,而且后者优先级更高。\n *\n * @default false\n */\n randomColors?: boolean;\n}\n\n/**\n * - **EN:** Overflow tags component, used to display a collection of tags that can overflow and be\n * truncated. It supports displaying tags in a dropdown when the number of tags exceeds the\n * maximum display count. It also supports custom tag rendering and properties.\n * - **CN:** 溢出标签组件,用于显示一组可以溢出和截断的标签集合。当标签数量超过最大显示数量时,支持在下拉菜单中显示标签。还支持自定义标签渲染和属性。\n *\n * @example\n * <OverflowTags\n * tags={[\n * { value: 1, label: 'Tag1', icon: <Icon1 /> },\n * { value: 2, label: 'Tag2', icon: <Icon2 /> },\n * ]}\n * tagProps={{ color: 'blue' }}\n * ellipsisTagProps={{ color: 'grey' }}\n * />;\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst OverflowTags = <T,>(props: OverflowTagsProps<T>) => {\n const {\n tags = [],\n randomColors,\n getTagName: getTagNameInProps,\n getTagKey,\n tagProps,\n ellipsisTagProps,\n ellipsisDropdownProps,\n className,\n prefixCls: prefixClsInProps,\n ...restProps\n } = props;\n const { token } = theme.useToken();\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('easy-overflow-tags', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n const colors = useMemo(\n () => PresetColors.filter((c) => !['lime', 'yellow', 'magenta'].includes(c)).map((color) => token[`${color}-3`]),\n [token]\n );\n const getValue = useCallback((tag: T | undefined, field: string) => {\n if (tag != null && typeof tag === 'object') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const record = tag as Record<string, any>;\n return record[field];\n }\n return undefined;\n }, []);\n const getTagName = useCallback(\n (tag: T) => {\n return getTagNameInProps\n ? getTagNameInProps(tag)\n : (getValue(tag, 'label') ?? getValue(tag, 'name') ?? tag?.toString());\n },\n [getTagNameInProps, getValue]\n );\n const renderTag = (item: T) => {\n return (\n <Tag\n icon={getValue(item, 'icon')}\n color={randomColors ? colors[random(0, colors.length - 1)] : getValue(item, 'color') || 'default'}\n {...(typeof tagProps === 'function' ? tagProps(item, { tags }) : tagProps)}\n >\n {getTagName(item)}\n </Tag>\n );\n };\n\n return wrapCSSVar(\n <Overflow<T>\n className={classNames(hashId, cssVarCls, prefixCls, className)}\n data={tags}\n maxCount=\"responsive\"\n renderItem={renderTag}\n renderRest={(omittedItems) => (\n <Dropdown\n {...ellipsisDropdownProps}\n menu={{\n items: omittedItems.map((tag) => ({\n type: 'item',\n key: getTagKey ? getTagKey(tag) : (getValue(tag, 'value') ?? getValue(tag, 'id') ?? getTagName(tag)),\n label: getTagName(tag),\n })),\n ...ellipsisDropdownProps?.menu,\n }}\n >\n <Tag\n {...(typeof ellipsisTagProps === 'function'\n ? ellipsisTagProps(omittedItems[0], { omittedItems, allTags: tags })\n : ellipsisTagProps)}\n >\n + {omittedItems.length}...\n </Tag>\n </Dropdown>\n )}\n {...restProps}\n />\n );\n};\n\nexport default OverflowTags;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAiD;AAEjD,kBAAqD;AACrD,sBAA6B;AAC7B,wBAAuB;AAEvB,yBAAqB;AACrB,kBAAuB;AACvB,mBAAqB;AA2ErB,IAAM,eAAe,CAAK,UAAgC;AACxD,QAAM;AAAA,IACJ,OAAO,CAAC;AAAA,IACR;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,MAAM,IAAI,kBAAM,SAAS;AACjC,QAAM,EAAE,aAAa,QAAI,yBAAW,2BAAe,aAAa;AAChE,QAAM,YAAY,aAAa,sBAAsB,gBAAgB;AACrE,QAAM,CAAC,YAAY,QAAQ,SAAS,QAAI,aAAAA,SAAS,SAAS;AAE1D,QAAM,aAAS;AAAA,IACb,MAAM,6BAAa,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,UAAU,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,MAAM,GAAG,SAAS,CAAC;AAAA,IAC/G,CAAC,KAAK;AAAA,EACR;AACA,QAAM,eAAW,0BAAY,CAAC,KAAoB,UAAkB;AAClE,QAAI,OAAO,QAAQ,OAAO,QAAQ,UAAU;AAE1C,YAAM,SAAS;AACf,aAAO,OAAO,KAAK;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,QAAM,iBAAa;AAAA,IACjB,CAAC,QAAW;AACV,aAAO,oBACH,kBAAkB,GAAG,IACpB,SAAS,KAAK,OAAO,KAAK,SAAS,KAAK,MAAM,MAAK,2BAAK;AAAA,IAC/D;AAAA,IACA,CAAC,mBAAmB,QAAQ;AAAA,EAC9B;AACA,QAAM,YAAY,CAAC,SAAY;AAC7B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,SAAS,MAAM,MAAM;AAAA,QAC3B,OAAO,eAAe,WAAO,oBAAO,GAAG,OAAO,SAAS,CAAC,CAAC,IAAI,SAAS,MAAM,OAAO,KAAK;AAAA,QACvF,GAAI,OAAO,aAAa,aAAa,SAAS,MAAM,EAAE,KAAK,CAAC,IAAI;AAAA;AAAA,MAEhE,WAAW,IAAI;AAAA,IAClB;AAAA,EAEJ;AAEA,SAAO;AAAA,IACL;AAAA,MAAC,mBAAAC;AAAA,MAAA;AAAA,QACC,eAAW,kBAAAC,SAAW,QAAQ,WAAW,WAAW,SAAS;AAAA,QAC7D,MAAM;AAAA,QACN,UAAS;AAAA,QACT,YAAY;AAAA,QACZ,YAAY,CAAC,iBACX;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ,MAAM;AAAA,cACJ,OAAO,aAAa,IAAI,CAAC,SAAS;AAAA,gBAChC,MAAM;AAAA,gBACN,KAAK,YAAY,UAAU,GAAG,IAAK,SAAS,KAAK,OAAO,KAAK,SAAS,KAAK,IAAI,KAAK,WAAW,GAAG;AAAA,gBAClG,OAAO,WAAW,GAAG;AAAA,cACvB,EAAE;AAAA,cACF,GAAG,+DAAuB;AAAA,YAC5B;AAAA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACE,GAAI,OAAO,qBAAqB,aAC7B,iBAAiB,aAAa,CAAC,GAAG,EAAE,cAAc,SAAS,KAAK,CAAC,IACjE;AAAA;AAAA,YACL;AAAA,YACI,aAAa;AAAA,YAAO;AAAA,UACzB;AAAA,QACF;AAAA,QAED,GAAG;AAAA;AAAA,IACN;AAAA,EACF;AACF;AAEA,IAAO,uBAAQ;",
6
- "names": ["useStyle", "Overflow", "classNames"]
4
+ "sourcesContent": ["import type { ReactNode } from 'react';\nimport { useCallback, useContext, useMemo } from 'react';\nimport type { DropdownProps, TagProps } from 'antd';\nimport { Dropdown, Tag, theme } from 'antd';\nimport { PresetColors } from 'antd/es/theme/internal';\nimport classNames from 'classnames';\nimport type { OverflowProps } from 'rc-overflow';\nimport Overflow from 'rc-overflow';\nimport { random } from '../../utils/math';\nimport ConfigProvider from '../ConfigProvider';\nimport useStyle from './style';\n\nexport interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem'> {\n /**\n * **CN**: 标签集合的数据\n *\n * **EN**: Data collection of tags\n */\n tags: T[] | undefined;\n /**\n * **EN**: Function to get the tag name, default is `tag.label` or `tag.name`\n *\n * **CN**: 获取标签名称的函数,默认取`tag.label`或`tag.name`\n */\n getTagName?: (tag: T) => ReactNode;\n /**\n * **EN**: Function to get the unique identifier of the tag, default is `tag.value` or `tag.id`\n *\n * **CN**: 获取标签唯一标识的函数,默认取`tag.value`或`tag.id`\n */\n getTagKey?: (tag: T) => React.Key;\n\n /**\n * **EN**: Custom tag rendering function\n *\n * **CN**: 标签渲染函数\n */\n renderTag?: OverflowProps<T>['renderItem'];\n /**\n * **EN**: Custom properties for the tag component\n *\n * **CN**: 自定义标签的组件属性\n */\n tagProps?: TagProps | ((tag: T, options: { tags: T[] }) => TagProps);\n /**\n * **EN**: When the number of tags exceeds the maximum display count, an ellipsis tag will be\n * shown. This property is used to set the style of the ellipsis tag.\n *\n * **CN**: 当标签数量超过最大显示数量时,会显示省略号的标签,此属性用于设置省略号标签的样式\n */\n ellipsisTagProps?: TagProps | ((tag: T, options: { omittedItems: T[]; allTags: T[] }) => TagProps);\n /**\n * **EN**: Custom properties for the dropdown component when tags are overflowed\n *\n * **CN**: 当标签溢出时,下拉菜单的自定义属性\n */\n ellipsisDropdownProps?: DropdownProps;\n /**\n * **EN**: Whether to use random colors, default is `false`. Note that the tag object can also\n * contain a `color` property to specify the color, and the latter takes precedence.\n *\n * **CN**: 是否使用随机颜色,默认`false`。注意,tag对象还可以包含`color`属性来指定颜色,而且后者优先级更高。\n *\n * @default false\n */\n randomColors?: boolean;\n}\n\n/**\n * - **EN:** Overflow tags component, used to display a collection of tags that can overflow and be\n * truncated. It supports displaying tags in a dropdown when the number of tags exceeds the\n * maximum display count. It also supports custom tag rendering and properties.\n * - **CN:** 溢出标签组件,用于显示一组可以溢出和截断的标签集合。当标签数量超过最大显示数量时,支持在下拉菜单中显示标签。还支持自定义标签渲染和属性。\n *\n * @example\n * <OverflowTags\n * tags={[\n * { value: 1, label: 'Tag1', icon: <Icon1 /> },\n * { value: 2, label: 'Tag2', icon: <Icon2 /> },\n * ]}\n * tagProps={{ color: 'blue' }}\n * ellipsisTagProps={{ color: 'grey' }}\n * />;\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst OverflowTags = <T,>(props: OverflowTagsProps<T>) => {\n const {\n tags = [],\n randomColors,\n getTagName: getTagNameInProps,\n getTagKey,\n tagProps,\n ellipsisTagProps,\n ellipsisDropdownProps,\n className,\n prefixCls: prefixClsInProps,\n ...restProps\n } = props;\n const { token } = theme.useToken();\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('overflow-tags', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n\n const colors = useMemo(\n () => PresetColors.filter((c) => !['lime', 'yellow', 'magenta'].includes(c)).map((color) => token[`${color}-3`]),\n [token]\n );\n const getValue = useCallback((tag: T | undefined, field: string) => {\n if (tag != null && typeof tag === 'object') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const record = tag as Record<string, any>;\n return record[field];\n }\n return undefined;\n }, []);\n const getTagName = useCallback(\n (tag: T) => {\n return getTagNameInProps\n ? getTagNameInProps(tag)\n : (getValue(tag, 'label') ?? getValue(tag, 'name') ?? tag?.toString());\n },\n [getTagNameInProps, getValue]\n );\n const renderTag = (item: T) => {\n return (\n <Tag\n icon={getValue(item, 'icon')}\n color={randomColors ? colors[random(0, colors.length - 1)] : getValue(item, 'color') || 'default'}\n {...(typeof tagProps === 'function' ? tagProps(item, { tags }) : tagProps)}\n >\n {getTagName(item)}\n </Tag>\n );\n };\n\n return wrapCSSVar(\n <Overflow<T>\n className={classNames(hashId, cssVarCls, prefixCls, className)}\n data={tags}\n maxCount=\"responsive\"\n renderItem={renderTag}\n renderRest={(omittedItems) => (\n <Dropdown\n {...ellipsisDropdownProps}\n menu={{\n items: omittedItems.map((tag) => ({\n type: 'item',\n key: getTagKey ? getTagKey(tag) : (getValue(tag, 'value') ?? getValue(tag, 'id') ?? getTagName(tag)),\n label: getTagName(tag),\n })),\n ...ellipsisDropdownProps?.menu,\n }}\n >\n <Tag\n {...(typeof ellipsisTagProps === 'function'\n ? ellipsisTagProps(omittedItems[0], { omittedItems, allTags: tags })\n : ellipsisTagProps)}\n >\n + {omittedItems.length}...\n </Tag>\n </Dropdown>\n )}\n {...restProps}\n />\n );\n};\n\nexport default OverflowTags;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAiD;AAEjD,kBAAqC;AACrC,sBAA6B;AAC7B,wBAAuB;AAEvB,yBAAqB;AACrB,kBAAuB;AACvB,4BAA2B;AAC3B,mBAAqB;AA2ErB,IAAM,eAAe,CAAK,UAAgC;AACxD,QAAM;AAAA,IACJ,OAAO,CAAC;AAAA,IACR;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,MAAM,IAAI,kBAAM,SAAS;AACjC,QAAM,EAAE,aAAa,QAAI,yBAAW,sBAAAA,QAAe,aAAa;AAChE,QAAM,YAAY,aAAa,iBAAiB,gBAAgB;AAChE,QAAM,CAAC,YAAY,QAAQ,SAAS,QAAI,aAAAC,SAAS,SAAS;AAE1D,QAAM,aAAS;AAAA,IACb,MAAM,6BAAa,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,UAAU,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,MAAM,GAAG,SAAS,CAAC;AAAA,IAC/G,CAAC,KAAK;AAAA,EACR;AACA,QAAM,eAAW,0BAAY,CAAC,KAAoB,UAAkB;AAClE,QAAI,OAAO,QAAQ,OAAO,QAAQ,UAAU;AAE1C,YAAM,SAAS;AACf,aAAO,OAAO,KAAK;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,QAAM,iBAAa;AAAA,IACjB,CAAC,QAAW;AACV,aAAO,oBACH,kBAAkB,GAAG,IACpB,SAAS,KAAK,OAAO,KAAK,SAAS,KAAK,MAAM,MAAK,2BAAK;AAAA,IAC/D;AAAA,IACA,CAAC,mBAAmB,QAAQ;AAAA,EAC9B;AACA,QAAM,YAAY,CAAC,SAAY;AAC7B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,SAAS,MAAM,MAAM;AAAA,QAC3B,OAAO,eAAe,WAAO,oBAAO,GAAG,OAAO,SAAS,CAAC,CAAC,IAAI,SAAS,MAAM,OAAO,KAAK;AAAA,QACvF,GAAI,OAAO,aAAa,aAAa,SAAS,MAAM,EAAE,KAAK,CAAC,IAAI;AAAA;AAAA,MAEhE,WAAW,IAAI;AAAA,IAClB;AAAA,EAEJ;AAEA,SAAO;AAAA,IACL;AAAA,MAAC,mBAAAC;AAAA,MAAA;AAAA,QACC,eAAW,kBAAAC,SAAW,QAAQ,WAAW,WAAW,SAAS;AAAA,QAC7D,MAAM;AAAA,QACN,UAAS;AAAA,QACT,YAAY;AAAA,QACZ,YAAY,CAAC,iBACX;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ,MAAM;AAAA,cACJ,OAAO,aAAa,IAAI,CAAC,SAAS;AAAA,gBAChC,MAAM;AAAA,gBACN,KAAK,YAAY,UAAU,GAAG,IAAK,SAAS,KAAK,OAAO,KAAK,SAAS,KAAK,IAAI,KAAK,WAAW,GAAG;AAAA,gBAClG,OAAO,WAAW,GAAG;AAAA,cACvB,EAAE;AAAA,cACF,GAAG,+DAAuB;AAAA,YAC5B;AAAA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACE,GAAI,OAAO,qBAAqB,aAC7B,iBAAiB,aAAa,CAAC,GAAG,EAAE,cAAc,SAAS,KAAK,CAAC,IACjE;AAAA;AAAA,YACL;AAAA,YACI,aAAa;AAAA,YAAO;AAAA,UACzB;AAAA,QACF;AAAA,QAED,GAAG;AAAA;AAAA,IACN;AAAA,EACF;AACF;AAEA,IAAO,uBAAQ;",
6
+ "names": ["ConfigProvider", "useStyle", "Overflow", "classNames"]
7
7
  }
@@ -36,5 +36,5 @@ var genStyle = (token) => {
36
36
  }
37
37
  };
38
38
  };
39
- var style_default = (0, import_internal.genStyleHooks)("EasyOverflowTags", genStyle);
39
+ var style_default = (0, import_internal.genStyleHooks)("OverflowTags", genStyle);
40
40
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/OverflowTags/style/index.ts"],
4
- "sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<OverflowTagsToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n width: '100%',\n maxWidth: '100%',\n position: 'relative',\n },\n };\n};\n\nexport default genStyleHooks('EasyOverflowTags' as never, genStyle);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAO9B,IAAM,WAA6C,CAAC,UAAqB;AACvE,QAAM,EAAE,aAAa,IAAI;AACzB,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,oBAAQ,+BAAc,oBAA6B,QAAQ;",
4
+ "sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype OverflowTagsToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<OverflowTagsToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n width: '100%',\n maxWidth: '100%',\n position: 'relative',\n },\n };\n};\n\nexport default genStyleHooks('OverflowTags' as never, genStyle);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAO9B,IAAM,WAA6C,CAAC,UAAqB;AACvE,QAAM,EAAE,aAAa,IAAI;AACzB,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,oBAAQ,+BAAc,gBAAyB,QAAQ;",
6
6
  "names": []
7
7
  }
@@ -28,6 +28,7 @@ export type { FloatDrawerProps } from './FloatDrawer';
28
28
  export { default as FloatDrawer } from './FloatDrawer';
29
29
  export type { FormItemControlProps } from './FormItemControl';
30
30
  export { default as FormItemControl } from './FormItemControl';
31
+ export * from './Iconfont';
31
32
  export type { LoadingProps } from './Loading';
32
33
  export { default as Loading } from './Loading';
33
34
  export type { ModalActionProps, FormCompPropsConstraint, ModalActionTrigger, ModalActionRef } from './ModalAction';
@@ -76,6 +76,7 @@ __reExport(components_exports, require("./EllipsisTypography/EllipsisLink"), mod
76
76
  var import_EllipsisLink = __toESM(require("./EllipsisTypography/EllipsisLink"));
77
77
  var import_FloatDrawer = __toESM(require("./FloatDrawer"));
78
78
  var import_FormItemControl = __toESM(require("./FormItemControl"));
79
+ __reExport(components_exports, require("./Iconfont"), module.exports);
79
80
  var import_Loading = __toESM(require("./Loading"));
80
81
  var import_ModalAction = require("./ModalAction");
81
82
  var import_ModalAction2 = __toESM(require("./ModalAction"));
@@ -109,6 +110,7 @@ var import_Pulse = __toESM(require("./Animation/Pulse"));
109
110
  ...require("./EllipsisTypography/EllipsisParagraph"),
110
111
  ...require("./EllipsisTypography/EllipsisText"),
111
112
  ...require("./EllipsisTypography/EllipsisTitle"),
112
- ...require("./EllipsisTypography/EllipsisLink")
113
+ ...require("./EllipsisTypography/EllipsisLink"),
114
+ ...require("./Iconfont")
113
115
  });
114
116
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/index.tsx"],
4
- "sourcesContent": ["export type { BreakLinesProps } from './BreakLines';\nexport { default as BreakLines } from './BreakLines';\n\nexport type { ColumnSettingProps } from './ColumnSetting';\nexport { default as ColumnSetting } from './ColumnSetting';\n\nexport type { ConfigProviderProps } from './ConfigProvider';\nexport { default as ConfigProvider } from './ConfigProvider';\nexport type { ReactEasyContextProps } from './ConfigProvider/context';\nexport { default as ReactEasyContext } from './ConfigProvider/context';\n\nexport type { ConfirmActionProps, ConfirmActionTrigger, ConfirmActionRef, ActionCompConstraint } from './ConfirmAction';\nexport { withDefaultConfirmActionProps } from './ConfirmAction';\nexport { default as withConfirmAction } from './ConfirmAction/withConfirmAction';\nexport { default as ConfirmAction } from './ConfirmAction';\n\nexport type {\n ContextMenuProps,\n ContextMenuItem,\n ContextMenuSeparator,\n ContextMenuSubmenu,\n ContextMenuRef,\n} from './ContextMenu';\nexport { default as ContextMenu } from './ContextMenu';\n\n// export * from './DeleteConfirmAction';\nexport { default as DeleteConfirmAction } from './DeleteConfirmAction';\nexport { default as withDeleteConfirmAction } from './DeleteConfirmAction/withDeleteConfirmAction';\n\nexport type { EditableTextProps } from './EditableText';\nexport { default as EditableText } from './EditableText';\n\nexport * from './EllipsisTypography/EllipsisParagraph';\nexport { default as EllipsisParagraph } from './EllipsisTypography/EllipsisParagraph';\n\nexport * from './EllipsisTypography/EllipsisText';\nexport { default as EllipsisText } from './EllipsisTypography/EllipsisText';\n\nexport * from './EllipsisTypography/EllipsisTitle';\nexport { default as EllipsisTitle } from './EllipsisTypography/EllipsisTitle';\n\nexport * from './EllipsisTypography/EllipsisLink';\nexport { default as EllipsisLink } from './EllipsisTypography/EllipsisLink';\n\nexport type { FloatDrawerProps } from './FloatDrawer';\nexport { default as FloatDrawer } from './FloatDrawer';\n\nexport type { FormItemControlProps } from './FormItemControl';\nexport { default as FormItemControl } from './FormItemControl';\n\nexport type { LoadingProps } from './Loading';\nexport { default as Loading } from './Loading';\n\nexport type { ModalActionProps, FormCompPropsConstraint, ModalActionTrigger, ModalActionRef } from './ModalAction';\nexport { withDefaultModalActionProps, withModalAction } from './ModalAction';\nexport { default as ModalAction } from './ModalAction';\n\nexport type { OverflowTagsProps } from './OverflowTags';\nexport { default as OverflowTags } from './OverflowTags';\n\nexport type { PulseAnimationProps } from './Animation/Pulse';\nexport { default as PulseAnimation } from './Animation/Pulse';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AAGtC,2BAAyC;AAGzC,4BAA0C;AAE1C,qBAA4C;AAG5C,2BAA8C;AAC9C,+BAA6C;AAC7C,IAAAA,wBAAyC;AASzC,yBAAuC;AAGvC,iCAA+C;AAC/C,qCAAmD;AAGnD,0BAAwC;AAExC,+BAAc,mDAhCd;AAiCA,+BAA6C;AAE7C,+BAAc,8CAnCd;AAoCA,0BAAwC;AAExC,+BAAc,+CAtCd;AAuCA,2BAAyC;AAEzC,+BAAc,8CAzCd;AA0CA,0BAAwC;AAGxC,yBAAuC;AAGvC,6BAA2C;AAG3C,qBAAmC;AAGnC,yBAA6D;AAC7D,IAAAC,sBAAuC;AAGvC,0BAAwC;AAGxC,mBAA0C;",
4
+ "sourcesContent": ["export type { BreakLinesProps } from './BreakLines';\nexport { default as BreakLines } from './BreakLines';\n\nexport type { ColumnSettingProps } from './ColumnSetting';\nexport { default as ColumnSetting } from './ColumnSetting';\n\nexport type { ConfigProviderProps } from './ConfigProvider';\nexport { default as ConfigProvider } from './ConfigProvider';\nexport type { ReactEasyContextProps } from './ConfigProvider/context';\nexport { default as ReactEasyContext } from './ConfigProvider/context';\n\nexport type { ConfirmActionProps, ConfirmActionTrigger, ConfirmActionRef, ActionCompConstraint } from './ConfirmAction';\nexport { withDefaultConfirmActionProps } from './ConfirmAction';\nexport { default as withConfirmAction } from './ConfirmAction/withConfirmAction';\nexport { default as ConfirmAction } from './ConfirmAction';\n\nexport type {\n ContextMenuProps,\n ContextMenuItem,\n ContextMenuSeparator,\n ContextMenuSubmenu,\n ContextMenuRef,\n} from './ContextMenu';\nexport { default as ContextMenu } from './ContextMenu';\n\n// export * from './DeleteConfirmAction';\nexport { default as DeleteConfirmAction } from './DeleteConfirmAction';\nexport { default as withDeleteConfirmAction } from './DeleteConfirmAction/withDeleteConfirmAction';\n\nexport type { EditableTextProps } from './EditableText';\nexport { default as EditableText } from './EditableText';\n\nexport * from './EllipsisTypography/EllipsisParagraph';\nexport { default as EllipsisParagraph } from './EllipsisTypography/EllipsisParagraph';\n\nexport * from './EllipsisTypography/EllipsisText';\nexport { default as EllipsisText } from './EllipsisTypography/EllipsisText';\n\nexport * from './EllipsisTypography/EllipsisTitle';\nexport { default as EllipsisTitle } from './EllipsisTypography/EllipsisTitle';\n\nexport * from './EllipsisTypography/EllipsisLink';\nexport { default as EllipsisLink } from './EllipsisTypography/EllipsisLink';\n\nexport type { FloatDrawerProps } from './FloatDrawer';\nexport { default as FloatDrawer } from './FloatDrawer';\n\nexport type { FormItemControlProps } from './FormItemControl';\nexport { default as FormItemControl } from './FormItemControl';\n\nexport * from './Iconfont';\n\nexport type { LoadingProps } from './Loading';\nexport { default as Loading } from './Loading';\n\nexport type { ModalActionProps, FormCompPropsConstraint, ModalActionTrigger, ModalActionRef } from './ModalAction';\nexport { withDefaultModalActionProps, withModalAction } from './ModalAction';\nexport { default as ModalAction } from './ModalAction';\n\nexport type { OverflowTagsProps } from './OverflowTags';\nexport { default as OverflowTags } from './OverflowTags';\n\nexport type { PulseAnimationProps } from './Animation/Pulse';\nexport { default as PulseAnimation } from './Animation/Pulse';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AAGtC,2BAAyC;AAGzC,4BAA0C;AAE1C,qBAA4C;AAG5C,2BAA8C;AAC9C,+BAA6C;AAC7C,IAAAA,wBAAyC;AASzC,yBAAuC;AAGvC,iCAA+C;AAC/C,qCAAmD;AAGnD,0BAAwC;AAExC,+BAAc,mDAhCd;AAiCA,+BAA6C;AAE7C,+BAAc,8CAnCd;AAoCA,0BAAwC;AAExC,+BAAc,+CAtCd;AAuCA,2BAAyC;AAEzC,+BAAc,8CAzCd;AA0CA,0BAAwC;AAGxC,yBAAuC;AAGvC,6BAA2C;AAE3C,+BAAc,uBAlDd;AAqDA,qBAAmC;AAGnC,yBAA6D;AAC7D,IAAAC,sBAAuC;AAGvC,0BAAwC;AAGxC,mBAA0C;",
6
6
  "names": ["import_ConfirmAction", "import_ModalAction"]
7
7
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (prefixCls: string, rootCls?: string | undefined) => readonly [(node: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, string, string];
3
+ export default _default;
@@ -0,0 +1,72 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/style/useSplitter.ts
20
+ var useSplitter_exports = {};
21
+ __export(useSplitter_exports, {
22
+ default: () => useSplitter_default
23
+ });
24
+ module.exports = __toCommonJS(useSplitter_exports);
25
+ var import_internal = require("antd/es/theme/internal");
26
+ var genStyle = (token) => {
27
+ const { componentCls, EasySplitter: { splitterDefaultWidth = 1 } = {} } = token;
28
+ return {
29
+ [componentCls]: {
30
+ flex: "none",
31
+ userSelect: "none",
32
+ [`&${componentCls}-vertical`]: {
33
+ cursor: "col-resize",
34
+ padding: "0 4px",
35
+ height: "100%",
36
+ [`${componentCls}-handle`]: {
37
+ width: `var(--splitter-width, ${splitterDefaultWidth}px)`,
38
+ height: "100%"
39
+ }
40
+ },
41
+ [`&${componentCls}-horizontal`]: {
42
+ cursor: "row-resize",
43
+ padding: "4px 0",
44
+ width: "100%",
45
+ [`${componentCls}-handle`]: {
46
+ width: "100%",
47
+ height: `var(--splitter-width, ${splitterDefaultWidth}px)`
48
+ }
49
+ },
50
+ "&:hover": {
51
+ [`${componentCls}-handle`]: {
52
+ background: token.colorPrimaryActive
53
+ }
54
+ },
55
+ [`&${componentCls}-dragging`]: {
56
+ [`${componentCls}-handle`]: {
57
+ background: token.colorPrimaryHover
58
+ }
59
+ },
60
+ [`&${componentCls}-hover`]: {
61
+ [`${componentCls}-handle`]: {
62
+ background: token.colorPrimaryActive
63
+ }
64
+ },
65
+ [`${componentCls}-handle`]: {
66
+ background: token.colorBorder
67
+ }
68
+ }
69
+ };
70
+ };
71
+ var useSplitter_default = (0, import_internal.genStyleHooks)("EasySplitter", genStyle);
72
+ //# sourceMappingURL=useSplitter.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/style/useSplitter.ts"],
4
+ "sourcesContent": ["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype UseSplitterToken = FullToken<\n {\n EasySplitter?: {\n splitterDefaultWidth?: number;\n };\n },\n AliasToken,\n 'EasySplitter'\n>;\n\nconst genStyle: GenerateStyle<UseSplitterToken> = (token): CSSObject => {\n const { componentCls, EasySplitter: { splitterDefaultWidth = 1 } = {} } = token;\n return {\n [componentCls]: {\n flex: 'none',\n userSelect: 'none',\n [`&${componentCls}-vertical`]: {\n cursor: 'col-resize',\n padding: '0 4px',\n height: '100%',\n [`${componentCls}-handle`]: {\n width: `var(--splitter-width, ${splitterDefaultWidth}px)`,\n height: '100%',\n },\n },\n [`&${componentCls}-horizontal`]: {\n cursor: 'row-resize',\n padding: '4px 0',\n width: '100%',\n [`${componentCls}-handle`]: {\n width: '100%',\n height: `var(--splitter-width, ${splitterDefaultWidth}px)`,\n },\n },\n '&:hover': {\n [`${componentCls}-handle`]: {\n background: token.colorPrimaryActive,\n },\n },\n [`&${componentCls}-dragging`]: {\n [`${componentCls}-handle`]: {\n background: token.colorPrimaryHover,\n },\n },\n [`&${componentCls}-hover`]: {\n [`${componentCls}-handle`]: {\n background: token.colorPrimaryActive,\n },\n },\n [`${componentCls}-handle`]: {\n background: token.colorBorder,\n },\n },\n };\n};\n\nexport default genStyleHooks('EasySplitter' as never, genStyle);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAe9B,IAAM,WAA4C,CAAC,UAAqB;AACtE,QAAM,EAAE,cAAc,cAAc,EAAE,uBAAuB,EAAE,IAAI,CAAC,EAAE,IAAI;AAC1E,SAAO;AAAA,IACL,CAAC,YAAY,GAAG;AAAA,MACd,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,CAAC,IAAI,uBAAuB,GAAG;AAAA,QAC7B,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,CAAC,GAAG,qBAAqB,GAAG;AAAA,UAC1B,OAAO,yBAAyB;AAAA,UAChC,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,MACA,CAAC,IAAI,yBAAyB,GAAG;AAAA,QAC/B,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,OAAO;AAAA,QACP,CAAC,GAAG,qBAAqB,GAAG;AAAA,UAC1B,OAAO;AAAA,UACP,QAAQ,yBAAyB;AAAA,QACnC;AAAA,MACF;AAAA,MACA,WAAW;AAAA,QACT,CAAC,GAAG,qBAAqB,GAAG;AAAA,UAC1B,YAAY,MAAM;AAAA,QACpB;AAAA,MACF;AAAA,MACA,CAAC,IAAI,uBAAuB,GAAG;AAAA,QAC7B,CAAC,GAAG,qBAAqB,GAAG;AAAA,UAC1B,YAAY,MAAM;AAAA,QACpB;AAAA,MACF;AAAA,MACA,CAAC,IAAI,oBAAoB,GAAG;AAAA,QAC1B,CAAC,GAAG,qBAAqB,GAAG;AAAA,UAC1B,YAAY,MAAM;AAAA,QACpB;AAAA,MACF;AAAA,MACA,CAAC,GAAG,qBAAqB,GAAG;AAAA,QAC1B,YAAY,MAAM;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,0BAAQ,+BAAc,gBAAyB,QAAQ;",
6
+ "names": []
7
+ }
@@ -2,40 +2,41 @@ import { type CSSProperties } from 'react';
2
2
  export interface UseSplitterProps {
3
3
  /**
4
4
  * - **EN:** Split direction. vertical = left/right; horizontal = top/bottom.
5
- * - **ZH:** 分割方向。vertical 表示左右分割;horizontal 表示上下分割。
5
+ * - **CN:** 分割方向。vertical 表示左右分割;horizontal 表示上下分割。
6
6
  *
7
7
  * @default 'vertical'
8
8
  */
9
9
  direction?: 'vertical' | 'horizontal';
10
10
  /**
11
- * - **EN:** The container element reference.
12
- * - **ZH:** 容器元素的引用。
11
+ * - **EN:** Parent container element. If not specified, the parent container of the `dom` element
12
+ * will be used automatically.
13
+ * - **CN:** 父容器元素,如果不指定,则自动使用 `dom` 元素的父容器
13
14
  */
14
- container: HTMLDivElement | null | undefined;
15
+ container?: HTMLDivElement | null | undefined;
15
16
  /**
16
17
  * - **EN:** Default ratio of the left/top pane (0~1).
17
- * - **ZH:** 左侧/顶部面板的默认比例 (0~1)。
18
+ * - **CN:** 左侧/顶部面板的默认比例 (0~1)。
18
19
  *
19
20
  * @default 0.32
20
21
  */
21
22
  defaultRatio?: number;
22
23
  /**
23
24
  * - **EN:** Minimum ratio of the left/top pane (0~1).
24
- * - **ZH:** 左侧/顶部面板的最小比例 (0~1)。
25
+ * - **CN:** 左侧/顶部面板的最小比例 (0~1)。
25
26
  *
26
27
  * @default 0.15
27
28
  */
28
29
  minRatio?: number;
29
30
  /**
30
31
  * - **EN:** Maximum ratio of the left/top pane (0~1).
31
- * - **ZH:** 左侧/顶部面板的最大比例 (0~1)。
32
+ * - **CN:** 左侧/顶部面板的最大比例 (0~1)。
32
33
  *
33
34
  * @default 0.85
34
35
  */
35
36
  maxRatio?: number;
36
37
  /**
37
38
  * - **EN:** Width of the splitter in pixels.
38
- * - **ZH:** 分割条的宽度,单位为像素。
39
+ * - **CN:** 分割条的宽度,单位为像素。
39
40
  *
40
41
  * @default 2
41
42
  */
@@ -44,9 +45,51 @@ export interface UseSplitterProps {
44
45
  className?: string;
45
46
  /** Additional style for the splitter element */
46
47
  style?: CSSProperties;
48
+ /**
49
+ * - **EN:** Custom prefix for the component's CSS class.
50
+ * - **CN:** 组件的自定义 CSS 类前缀。
51
+ */
52
+ prefixCls?: string;
53
+ /**
54
+ * - **EN:** Semantic class names
55
+ * - **CN:** 语义化类名
56
+ */
57
+ classNames?: {
58
+ /**
59
+ * - **EN:** Class name applied when the splitter is hovered.
60
+ * - **CN:** 分割条悬停时应用的类名。
61
+ */
62
+ hover?: string;
63
+ /**
64
+ * - **EN:** Class name applied when the splitter is being dragged.
65
+ * - **CN:** 分割条拖动时应用的类名。
66
+ */
67
+ dragging?: string;
68
+ /**
69
+ * - **EN:** Class name applied to the splitter handle.
70
+ * - **CN:** 分割条手柄的类名。
71
+ */
72
+ handle?: string;
73
+ };
74
+ /**
75
+ * - **EN:** Semantic styles
76
+ * - **CN:** 语义化样式
77
+ */
78
+ styles?: {
79
+ /**
80
+ * - **EN:** Custom styles for the splitter handle.
81
+ * - **CN:** 分割条手柄的自定义样式。
82
+ */
83
+ handle?: CSSProperties;
84
+ };
85
+ /**
86
+ * - **EN:** Callback function when the splitter ratio changes.
87
+ * - **CN:** 分割比例变化时的回调函数。
88
+ */
89
+ onChange?: (ratio?: number) => void;
47
90
  }
48
91
  declare const useSplitter: (props: UseSplitterProps) => {
49
- dom: import("react/jsx-runtime").JSX.Element;
92
+ dom: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
50
93
  percent: number | undefined;
51
94
  width: number | undefined;
52
95
  dragging: boolean;