@tiny-codes/react-easy 1.7.6 → 1.7.7

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 (88) hide show
  1. package/CHANGELOG.md +15 -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 -8
  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/FloatDrawer/index.js +3 -2
  19. package/es/components/FloatDrawer/index.js.map +1 -1
  20. package/es/components/FloatDrawer/style/index.js +1 -1
  21. package/es/components/FloatDrawer/style/index.js.map +1 -1
  22. package/es/components/Iconfont/createIconfont.d.ts +28 -0
  23. package/es/components/Iconfont/createIconfont.js +57 -0
  24. package/es/components/Iconfont/createIconfont.js.map +1 -0
  25. package/es/components/Iconfont/index.d.ts +1 -0
  26. package/es/components/Iconfont/index.js +2 -0
  27. package/es/components/Iconfont/index.js.map +1 -0
  28. package/es/components/Loading/index.js +3 -2
  29. package/es/components/Loading/index.js.map +1 -1
  30. package/es/components/Loading/style/index.js +1 -1
  31. package/es/components/Loading/style/index.js.map +1 -1
  32. package/es/components/OverflowTags/index.js +3 -2
  33. package/es/components/OverflowTags/index.js.map +1 -1
  34. package/es/components/OverflowTags/style/index.js +1 -1
  35. package/es/components/OverflowTags/style/index.js.map +1 -1
  36. package/es/components/index.d.ts +1 -0
  37. package/es/components/index.js +1 -0
  38. package/es/components/index.js.map +1 -1
  39. package/es/hooks/style/useSplitter.d.ts +3 -0
  40. package/es/hooks/style/useSplitter.js +40 -0
  41. package/es/hooks/style/useSplitter.js.map +1 -0
  42. package/es/hooks/useSplitter.d.ts +52 -9
  43. package/es/hooks/useSplitter.js +69 -39
  44. package/es/hooks/useSplitter.js.map +1 -1
  45. package/lib/components/ColumnSetting/index.js +2 -1
  46. package/lib/components/ColumnSetting/index.js.map +3 -3
  47. package/lib/components/ConfigProvider/context.d.ts +36 -0
  48. package/lib/components/ConfigProvider/context.js +1 -0
  49. package/lib/components/ConfigProvider/context.js.map +2 -2
  50. package/lib/components/ConfigProvider/index.d.ts +5 -3
  51. package/lib/components/ConfigProvider/index.js +6 -2
  52. package/lib/components/ConfigProvider/index.js.map +2 -2
  53. package/lib/components/ConfigProvider/style/index.js +1 -1
  54. package/lib/components/ConfigProvider/style/index.js.map +2 -2
  55. package/lib/components/ContextMenu/index.js +2 -1
  56. package/lib/components/ContextMenu/index.js.map +3 -3
  57. package/lib/components/ContextMenu/style/index.js.map +2 -2
  58. package/lib/components/DeleteConfirmAction/withDeleteConfirmAction.d.ts +3 -3
  59. package/lib/components/EditableText/index.js +3 -2
  60. package/lib/components/EditableText/index.js.map +3 -3
  61. package/lib/components/FloatDrawer/index.js +3 -2
  62. package/lib/components/FloatDrawer/index.js.map +3 -3
  63. package/lib/components/FloatDrawer/style/index.js +1 -1
  64. package/lib/components/FloatDrawer/style/index.js.map +2 -2
  65. package/lib/components/Iconfont/createIconfont.d.ts +28 -0
  66. package/lib/components/Iconfont/createIconfont.js +65 -0
  67. package/lib/components/Iconfont/createIconfont.js.map +7 -0
  68. package/lib/components/Iconfont/index.d.ts +1 -0
  69. package/lib/components/Iconfont/index.js +24 -0
  70. package/lib/components/Iconfont/index.js.map +7 -0
  71. package/lib/components/Loading/index.js +3 -2
  72. package/lib/components/Loading/index.js.map +3 -3
  73. package/lib/components/Loading/style/index.js +1 -1
  74. package/lib/components/Loading/style/index.js.map +2 -2
  75. package/lib/components/OverflowTags/index.js +3 -2
  76. package/lib/components/OverflowTags/index.js.map +3 -3
  77. package/lib/components/OverflowTags/style/index.js +1 -1
  78. package/lib/components/OverflowTags/style/index.js.map +2 -2
  79. package/lib/components/index.d.ts +1 -0
  80. package/lib/components/index.js +3 -1
  81. package/lib/components/index.js.map +2 -2
  82. package/lib/hooks/style/useSplitter.d.ts +3 -0
  83. package/lib/hooks/style/useSplitter.js +72 -0
  84. package/lib/hooks/style/useSplitter.js.map +7 -0
  85. package/lib/hooks/useSplitter.d.ts +52 -9
  86. package/lib/hooks/useSplitter.js +56 -26
  87. package/lib/hooks/useSplitter.js.map +3 -3
  88. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","display","alignItems","justifyContent","width","height","position","top","left","transform","concat","antCls","lineHeight"],"sources":["../../../../src/components/Loading/style/index.ts"],"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"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAA0C,GAAG,SAA7CA,QAA0CA,CAAIC,KAAK,EAAgB;EACvE,IAAQC,YAAY,GAAKD,KAAK,CAAtBC,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,EAAAC,eAAA;IACX,QAAQ,EAAE;MACRC,OAAO,EAAE,MAAM;MACfC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,KAAK,EAAE,MAAM;MACbC,MAAM,EAAE;IACV,CAAC;IACD,YAAY,EAAE;MACZC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,KAAK;MACVC,IAAI,EAAE,KAAK;MACXC,SAAS,EAAE;IACb;EAAC,eAAAC,MAAA,CACYZ,KAAK,CAACa,MAAM,aAAW;IAClCC,UAAU,EAAE;EACd,CAAC;AAGP,CAAC;AAED,eAAehB,aAAa,CAAC,aAAa,EAAWC,QAAQ,CAAC"}
1
+ {"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","display","alignItems","justifyContent","width","height","position","top","left","transform","concat","antCls","lineHeight"],"sources":["../../../../src/components/Loading/style/index.ts"],"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"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAAqC,GAAG,SAAxCA,QAAqCA,CAAIC,KAAK,EAAgB;EAClE,IAAQC,YAAY,GAAKD,KAAK,CAAtBC,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,EAAAC,eAAA;IACX,QAAQ,EAAE;MACRC,OAAO,EAAE,MAAM;MACfC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,KAAK,EAAE,MAAM;MACbC,MAAM,EAAE;IACV,CAAC;IACD,YAAY,EAAE;MACZC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,KAAK;MACVC,IAAI,EAAE,KAAK;MACXC,SAAS,EAAE;IACb;EAAC,eAAAC,MAAA,CACYZ,KAAK,CAACa,MAAM,aAAW;IAClCC,UAAU,EAAE;EACd,CAAC;AAGP,CAAC;AAED,eAAehB,aAAa,CAAC,SAAS,EAAWC,QAAQ,CAAC"}
@@ -14,11 +14,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
16
  import { useCallback, useContext, useMemo } from 'react';
17
- import { ConfigProvider, Dropdown, Tag, theme } from 'antd';
17
+ import { Dropdown, Tag, theme } from 'antd';
18
18
  import { PresetColors } from 'antd/es/theme/internal';
19
19
  import classNames from 'classnames';
20
20
  import Overflow from 'rc-overflow';
21
21
  import { random } from "../../utils/math";
22
+ import ConfigProvider from "../ConfigProvider";
22
23
  import useStyle from "./style";
23
24
  import { jsx as _jsx } from "react/jsx-runtime";
24
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -55,7 +56,7 @@ var OverflowTags = function OverflowTags(props) {
55
56
  token = _theme$useToken.token;
56
57
  var _useContext = useContext(ConfigProvider.ConfigContext),
57
58
  getPrefixCls = _useContext.getPrefixCls;
58
- var prefixCls = getPrefixCls('easy-overflow-tags', prefixClsInProps);
59
+ var prefixCls = getPrefixCls('overflow-tags', prefixClsInProps);
59
60
  var _useStyle = useStyle(prefixCls),
60
61
  _useStyle2 = _slicedToArray(_useStyle, 3),
61
62
  wrapCSSVar = _useStyle2[0],
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useContext","useMemo","ConfigProvider","Dropdown","Tag","theme","PresetColors","classNames","Overflow","random","useStyle","jsx","_jsx","jsxs","_jsxs","OverflowTags","props","_props$tags","tags","randomColors","getTagNameInProps","getTagName","getTagKey","tagProps","ellipsisTagProps","ellipsisDropdownProps","className","prefixClsInProps","prefixCls","restProps","_objectWithoutProperties","_excluded","_theme$useToken","useToken","token","_useContext","ConfigContext","getPrefixCls","_useStyle","_useStyle2","_slicedToArray","wrapCSSVar","hashId","cssVarCls","colors","filter","c","includes","map","color","concat","getValue","tag","field","_typeof","record","undefined","_ref","_getValue","toString","renderTag","item","_objectSpread","icon","length","children","data","maxCount","renderItem","renderRest","omittedItems","menu","items","_ref2","_getValue2","type","key","label","allTags"],"sources":["../../../src/components/OverflowTags/index.tsx"],"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"],"mappings":";;;;;;;;;;;;;;;AACA,SAASA,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAExD,SAASC,cAAc,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,MAAM;AAC3D,SAASC,YAAY,QAAQ,wBAAwB;AACrD,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,MAAM;AACf,OAAOC,QAAQ;AAAgB,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA0D/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAQC,KAA2B,EAAK;EACxD,IAAAC,WAAA,GAWID,KAAK,CAVPE,IAAI;IAAJA,IAAI,GAAAD,WAAA,cAAG,EAAE,GAAAA,WAAA;IACTE,YAAY,GASVH,KAAK,CATPG,YAAY;IACAC,iBAAiB,GAQ3BJ,KAAK,CARPK,UAAU;IACVC,SAAS,GAOPN,KAAK,CAPPM,SAAS;IACTC,QAAQ,GAMNP,KAAK,CANPO,QAAQ;IACRC,gBAAgB,GAKdR,KAAK,CALPQ,gBAAgB;IAChBC,qBAAqB,GAInBT,KAAK,CAJPS,qBAAqB;IACrBC,SAAS,GAGPV,KAAK,CAHPU,SAA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A,CAAAA,aAAA,KACHrC,qBAAqB;QACzB8C,IAAI,EAAAT,aAAA;UACFU,KAAK,EAAEF,YAAY,CAACtB,GAAG,CAAC,UAACI,GAAG;YAAA,IAAAqB,KAAA,EAAAC,UAAA;YAAA,OAAM;cAChCC,IAAI,EAAE,MAAM;cACZC,GAAG,EAAEtD,SAAS,GAAGA,SAAS,CAAC8B,GAAG,CAAC,IAAAqB,KAAA,IAAAC,UAAA,GAAIvB,QAAQ,CAACC,GAAG,EAAE,OAAO,CAAC,cAAAsB,UAAA,cAAAA,UAAA,GAAIvB,QAAQ,CAACC,GAAG,EAAE,IAAI,CAAC,cAAAqB,KAAA,cAAAA,KAAA,GAAIpD,UAAU,CAAC+B,GAAG,CAAE;cACpGyB,KAAK,EAAExD,UAAU,CAAC+B,GAAG;YACvB,CAAC;UAAA,CAAC;QAAC,GACA3B,qBAAqB,aAArBA,qBAAqB,uBAArBA,qBAAqB,CAAE8C,IAAI,CAC9B;QAAAN,QAAA,eAEFnD,KAAA,CAACV,GAAG,EAAA0D,aAAA,CAAAA,aAAA,KACG,OAAOtC,gBAAgB,KAAK,UAAU,GACvCA,gBAAgB,CAAC8C,YAAY,CAAC,CAAC,CAAC,EAAE;UAAEA,YAAY,EAAZA,YAAY;UAAEQ,OAAO,EAAE5D;QAAK,CAAC,CAAC,GAClEM,gBAAgB;UAAAyC,QAAA,GACrB,IACG,EAACK,YAAY,CAACN,MAAM,EAAC,KACzB;QAAA,EAAK;MAAC,EACE,CAAC;IAAA;EACX,GACEnC,SAAS,CACd,CACH,CAAC;AACH,CAAC;AAED,eAAed,YAAY"}
1
+ {"version":3,"names":["useCallback","useContext","useMemo","Dropdown","Tag","theme","PresetColors","classNames","Overflow","random","ConfigProvider","useStyle","jsx","_jsx","jsxs","_jsxs","OverflowTags","props","_props$tags","tags","randomColors","getTagNameInProps","getTagName","getTagKey","tagProps","ellipsisTagProps","ellipsisDropdownProps","className","prefixClsInProps","prefixCls","restProps","_objectWithoutProperties","_excluded","_theme$useToken","useToken","token","_useContext","ConfigContext","getPrefixCls","_useStyle","_useStyle2","_slicedToArray","wrapCSSVar","hashId","cssVarCls","colors","filter","c","includes","map","color","concat","getValue","tag","field","_typeof","record","undefined","_ref","_getValue","toString","renderTag","item","_objectSpread","icon","length","children","data","maxCount","renderItem","renderRest","omittedItems","menu","items","_ref2","_getValue2","type","key","label","allTags"],"sources":["../../../src/components/OverflowTags/index.tsx"],"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"],"mappings":";;;;;;;;;;;;;;;AACA,SAASA,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAExD,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,MAAM;AAC3C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,MAAM;AACf,OAAOC,cAAc;AACrB,OAAOC,QAAQ;AAAgB,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAA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AU,GACvCA,gBAAgB,CAAC8C,YAAY,CAAC,CAAC,CAAC,EAAE;UAAEA,YAAY,EAAZA,YAAY;UAAEQ,OAAO,EAAE5D;QAAK,CAAC,CAAC,GAClEM,gBAAgB;UAAAyC,QAAA,GACrB,IACG,EAACK,YAAY,CAACN,MAAM,EAAC,KACzB;QAAA,EAAK;MAAC,EACE,CAAC;IAAA;EACX,GACEnC,SAAS,CACd,CACH,CAAC;AACH,CAAC;AAED,eAAed,YAAY"}
@@ -14,5 +14,5 @@ var genStyle = function genStyle(token) {
14
14
  position: 'relative'
15
15
  });
16
16
  };
17
- export default genStyleHooks('EasyOverflowTags', genStyle);
17
+ export default genStyleHooks('OverflowTags', genStyle);
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","display","flexWrap","alignItems","width","maxWidth","position"],"sources":["../../../../src/components/OverflowTags/style/index.ts"],"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"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAA0C,GAAG,SAA7CA,QAA0CA,CAAIC,KAAK,EAAgB;EACvE,IAAQC,YAAY,GAAKD,KAAK,CAAtBC,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,EAAG;IACdE,OAAO,EAAE,MAAM;IACfC,QAAQ,EAAE,MAAM;IAChBC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,MAAM;IAChBC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;AAED,eAAeV,aAAa,CAAC,kBAAkB,EAAWC,QAAQ,CAAC"}
1
+ {"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_defineProperty","display","flexWrap","alignItems","width","maxWidth","position"],"sources":["../../../../src/components/OverflowTags/style/index.ts"],"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"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAA0C,GAAG,SAA7CA,QAA0CA,CAAIC,KAAK,EAAgB;EACvE,IAAQC,YAAY,GAAKD,KAAK,CAAtBC,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,EAAG;IACdE,OAAO,EAAE,MAAM;IACfC,QAAQ,EAAE,MAAM;IAChBC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,MAAM;IAChBC,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC;AAED,eAAeV,aAAa,CAAC,cAAc,EAAWC,QAAQ,CAAC"}
@@ -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';
@@ -21,6 +21,7 @@ export * from "./EllipsisTypography/EllipsisLink";
21
21
  export { default as EllipsisLink } from "./EllipsisTypography/EllipsisLink";
22
22
  export { default as FloatDrawer } from "./FloatDrawer";
23
23
  export { default as FormItemControl } from "./FormItemControl";
24
+ export * from "./Iconfont";
24
25
  export { default as Loading } from "./Loading";
25
26
  export { withDefaultModalActionProps, withModalAction } from "./ModalAction";
26
27
  export { default as ModalAction } from "./ModalAction";
@@ -1 +1 @@
1
- {"version":3,"names":["default","BreakLines","ColumnSetting","ConfigProvider","ReactEasyContext","withDefaultConfirmActionProps","withConfirmAction","ConfirmAction","ContextMenu","DeleteConfirmAction","withDeleteConfirmAction","EditableText","EllipsisParagraph","EllipsisText","EllipsisTitle","EllipsisLink","FloatDrawer","FormItemControl","Loading","withDefaultModalActionProps","withModalAction","ModalAction","OverflowTags","PulseAnimation"],"sources":["../../src/components/index.tsx"],"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"],"mappings":"AACA,SAASA,OAAO,IAAIC,UAAU;AAG9B,SAASD,OAAO,IAAIE,aAAa;AAGjC,SAASF,OAAO,IAAIG,cAAc;AAElC,SAASH,OAAO,IAAII,gBAAgB;AAGpC,SAASC,6BAA6B;AACtC,SAASL,OAAO,IAAIM,iBAAiB;AACrC,SAASN,OAAO,IAAIO,aAAa;AASjC,SAASP,OAAO,IAAIQ,WAAW;;AAE/B;AACA,SAASR,OAAO,IAAIS,mBAAmB;AACvC,SAAST,OAAO,IAAIU,uBAAuB;AAG3C,SAASV,OAAO,IAAIW,YAAY;AAEhC;AACA,SAASX,OAAO,IAAIY,iBAAiB;AAErC;AACA,SAASZ,OAAO,IAAIa,YAAY;AAEhC;AACA,SAASb,OAAO,IAAIc,aAAa;AAEjC;AACA,SAASd,OAAO,IAAIe,YAAY;AAGhC,SAASf,OAAO,IAAIgB,WAAW;AAG/B,SAAShB,OAAO,IAAIiB,eAAe;AAGnC,SAASjB,OAAO,IAAIkB,OAAO;AAG3B,SAASC,2BAA2B,EAAEC,eAAe;AACrD,SAASpB,OAAO,IAAIqB,WAAW;AAG/B,SAASrB,OAAO,IAAIsB,YAAY;AAGhC,SAAStB,OAAO,IAAIuB,cAAc"}
1
+ {"version":3,"names":["default","BreakLines","ColumnSetting","ConfigProvider","ReactEasyContext","withDefaultConfirmActionProps","withConfirmAction","ConfirmAction","ContextMenu","DeleteConfirmAction","withDeleteConfirmAction","EditableText","EllipsisParagraph","EllipsisText","EllipsisTitle","EllipsisLink","FloatDrawer","FormItemControl","Loading","withDefaultModalActionProps","withModalAction","ModalAction","OverflowTags","PulseAnimation"],"sources":["../../src/components/index.tsx"],"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"],"mappings":"AACA,SAASA,OAAO,IAAIC,UAAU;AAG9B,SAASD,OAAO,IAAIE,aAAa;AAGjC,SAASF,OAAO,IAAIG,cAAc;AAElC,SAASH,OAAO,IAAII,gBAAgB;AAGpC,SAASC,6BAA6B;AACtC,SAASL,OAAO,IAAIM,iBAAiB;AACrC,SAASN,OAAO,IAAIO,aAAa;AASjC,SAASP,OAAO,IAAIQ,WAAW;;AAE/B;AACA,SAASR,OAAO,IAAIS,mBAAmB;AACvC,SAAST,OAAO,IAAIU,uBAAuB;AAG3C,SAASV,OAAO,IAAIW,YAAY;AAEhC;AACA,SAASX,OAAO,IAAIY,iBAAiB;AAErC;AACA,SAASZ,OAAO,IAAIa,YAAY;AAEhC;AACA,SAASb,OAAO,IAAIc,aAAa;AAEjC;AACA,SAASd,OAAO,IAAIe,YAAY;AAGhC,SAASf,OAAO,IAAIgB,WAAW;AAG/B,SAAShB,OAAO,IAAIiB,eAAe;AAEnC;AAGA,SAASjB,OAAO,IAAIkB,OAAO;AAG3B,SAASC,2BAA2B,EAAEC,eAAe;AACrD,SAASpB,OAAO,IAAIqB,WAAW;AAG/B,SAASrB,OAAO,IAAIsB,YAAY;AAGhC,SAAStB,OAAO,IAAIuB,cAAc"}
@@ -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,40 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import { genStyleHooks } from 'antd/es/theme/internal';
6
+ var genStyle = function genStyle(token) {
7
+ var componentCls = token.componentCls,
8
+ _token$EasySplitter = token.EasySplitter,
9
+ _token$EasySplitter2 = _token$EasySplitter === void 0 ? {} : _token$EasySplitter,
10
+ _token$EasySplitter2$ = _token$EasySplitter2.splitterDefaultWidth,
11
+ splitterDefaultWidth = _token$EasySplitter2$ === void 0 ? 1 : _token$EasySplitter2$;
12
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
13
+ flex: 'none',
14
+ userSelect: 'none'
15
+ }, "&".concat(componentCls, "-vertical"), _defineProperty({
16
+ cursor: 'col-resize',
17
+ padding: '0 4px',
18
+ height: '100%'
19
+ }, "".concat(componentCls, "-handle"), {
20
+ width: "var(--splitter-width, ".concat(splitterDefaultWidth, "px)"),
21
+ height: '100%'
22
+ })), "&".concat(componentCls, "-horizontal"), _defineProperty({
23
+ cursor: 'row-resize',
24
+ padding: '4px 0',
25
+ width: '100%'
26
+ }, "".concat(componentCls, "-handle"), {
27
+ width: '100%',
28
+ height: "var(--splitter-width, ".concat(splitterDefaultWidth, "px)")
29
+ })), '&:hover', _defineProperty({}, "".concat(componentCls, "-handle"), {
30
+ background: token.colorPrimaryActive
31
+ })), "&".concat(componentCls, "-dragging"), _defineProperty({}, "".concat(componentCls, "-handle"), {
32
+ background: token.colorPrimaryHover
33
+ })), "&".concat(componentCls, "-hover"), _defineProperty({}, "".concat(componentCls, "-handle"), {
34
+ background: token.colorPrimaryActive
35
+ })), "".concat(componentCls, "-handle"), {
36
+ background: token.colorBorder
37
+ }));
38
+ };
39
+ export default genStyleHooks('EasySplitter', genStyle);
40
+ //# sourceMappingURL=useSplitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["genStyleHooks","genStyle","token","componentCls","_token$EasySplitter","EasySplitter","_token$EasySplitter2","_token$EasySplitter2$","splitterDefaultWidth","_defineProperty","flex","userSelect","concat","cursor","padding","height","width","background","colorPrimaryActive","colorPrimaryHover","colorBorder"],"sources":["../../../src/hooks/style/useSplitter.ts"],"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"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAetD,IAAMC,QAAyC,GAAG,SAA5CA,QAAyCA,CAAIC,KAAK,EAAgB;EACtE,IAAQC,YAAY,GAAsDD,KAAK,CAAvEC,YAAY;IAAAC,mBAAA,GAAsDF,KAAK,CAAzDG,YAAY;IAAAC,oBAAA,GAAAF,mBAAA,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Q,CAAC"}
@@ -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;
@@ -10,13 +10,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { useEffect, useState } from 'react';
14
- import { theme } from 'antd';
13
+ import { useContext, useEffect, useState } from 'react';
14
+ import names from 'classnames';
15
+ import { ConfigProvider } from "../components";
16
+ import useStyle from "./style/useSplitter";
15
17
  import useRefValue from "./useRefValue";
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  var useSplitter = function useSplitter(props) {
18
20
  var _ref = props || {},
19
- container = _ref.container,
21
+ containerFromProps = _ref.container,
20
22
  defaultRatio = _ref.defaultRatio,
21
23
  _ref$minRatio = _ref.minRatio,
22
24
  minRatio = _ref$minRatio === void 0 ? 0.15 : _ref$minRatio,
@@ -25,31 +27,50 @@ var useSplitter = function useSplitter(props) {
25
27
  _ref$direction = _ref.direction,
26
28
  direction = _ref$direction === void 0 ? 'vertical' : _ref$direction,
27
29
  _ref$splitterWidth = _ref.splitterWidth,
28
- splitterWidth = _ref$splitterWidth === void 0 ? 2 : _ref$splitterWidth,
30
+ splitterWidth = _ref$splitterWidth === void 0 ? 1 : _ref$splitterWidth,
29
31
  className = _ref.className,
30
- style = _ref.style;
31
- var _theme$useToken = theme.useToken(),
32
- token = _theme$useToken.token;
32
+ classNames = _ref.classNames,
33
+ styles = _ref.styles,
34
+ prefixClsInProps = _ref.prefixCls,
35
+ style = _ref.style,
36
+ onChange = _ref.onChange;
37
+ var _useContext = useContext(ConfigProvider.ConfigContext),
38
+ getPrefixCls = _useContext.getPrefixCls;
39
+ var prefixCls = getPrefixCls('splitter', prefixClsInProps);
40
+ var _useStyle = useStyle(prefixCls),
41
+ _useStyle2 = _slicedToArray(_useStyle, 3),
42
+ wrapCSSVar = _useStyle2[0],
43
+ hashId = _useStyle2[1],
44
+ cssVarCls = _useStyle2[2];
33
45
  var directionRef = useRefValue(direction);
34
- var _useState = useState(defaultRatio),
46
+ var _useState = useState(null),
35
47
  _useState2 = _slicedToArray(_useState, 2),
36
- percent = _useState2[0],
37
- setPercent = _useState2[1];
38
- var percentRef = useRefValue(percent);
39
- var _useState3 = useState(container && defaultRatio ? ((container === null || container === void 0 ? void 0 : container.clientWidth) || 0) * defaultRatio : undefined),
48
+ splitterRef = _useState2[0],
49
+ setSplitterRef = _useState2[1];
50
+ var _useState3 = useState(containerFromProps),
40
51
  _useState4 = _slicedToArray(_useState3, 2),
41
- width = _useState4[0],
42
- setWidth = _useState4[1];
43
- var _useState5 = useState(false),
52
+ container = _useState4[0],
53
+ setContainer = _useState4[1];
54
+ var _useState5 = useState(defaultRatio),
44
55
  _useState6 = _slicedToArray(_useState5, 2),
45
- dragging = _useState6[0],
46
- setDragging = _useState6[1];
56
+ percent = _useState6[0],
57
+ setPercent = _useState6[1];
58
+ var percentRef = useRefValue(percent);
59
+ var onChangeRef = useRefValue(onChange);
60
+ var _useState7 = useState(container && defaultRatio ? ((container === null || container === void 0 ? void 0 : container.clientWidth) || 0) * defaultRatio : undefined),
61
+ _useState8 = _slicedToArray(_useState7, 2),
62
+ width = _useState8[0],
63
+ setWidth = _useState8[1];
64
+ var _useState9 = useState(false),
65
+ _useState10 = _slicedToArray(_useState9, 2),
66
+ dragging = _useState10[0],
67
+ setDragging = _useState10[1];
47
68
  var minRatioRef = useRefValue(minRatio);
48
69
  var maxRatioRef = useRefValue(maxRatio);
49
- var _useState7 = useState(false),
50
- _useState8 = _slicedToArray(_useState7, 2),
51
- isOver = _useState8[0],
52
- setIsOver = _useState8[1];
70
+ var _useState11 = useState(false),
71
+ _useState12 = _slicedToArray(_useState11, 2),
72
+ isOver = _useState12[0],
73
+ setIsOver = _useState12[1];
53
74
  useEffect(function () {
54
75
  if (!dragging) return;
55
76
  var onMove = function onMove(e) {
@@ -57,15 +78,19 @@ var useSplitter = function useSplitter(props) {
57
78
  if (!el) return;
58
79
  var rect = el.getBoundingClientRect();
59
80
  if (direction === 'vertical') {
81
+ var _onChangeRef$current;
60
82
  var x = e.clientX - rect.left;
61
- var ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, x / rect.width));
62
- setPercent(ratio);
83
+ var _ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, x / rect.width));
84
+ setPercent(_ratio);
63
85
  setWidth(x);
86
+ (_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 || _onChangeRef$current.call(onChangeRef, _ratio);
64
87
  } else {
88
+ var _onChangeRef$current2;
65
89
  var y = e.clientY - rect.top;
66
- var _ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, y / rect.height));
67
- setPercent(_ratio);
90
+ var _ratio2 = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, y / rect.height));
91
+ setPercent(_ratio2);
68
92
  setWidth(y);
93
+ (_onChangeRef$current2 = onChangeRef.current) === null || _onChangeRef$current2 === void 0 || _onChangeRef$current2.call(onChangeRef, _ratio2);
69
94
  }
70
95
  // prevent text selection while dragging
71
96
  e.preventDefault();
@@ -82,6 +107,11 @@ var useSplitter = function useSplitter(props) {
82
107
  window.removeEventListener('mouseup', onUp);
83
108
  };
84
109
  }, [container, dragging, direction, minRatioRef, maxRatioRef]);
110
+ useEffect(function () {
111
+ var _ref2;
112
+ var containerDom = (_ref2 = containerFromProps !== null && containerFromProps !== void 0 ? containerFromProps : splitterRef === null || splitterRef === void 0 ? void 0 : splitterRef.parentElement) !== null && _ref2 !== void 0 ? _ref2 : undefined;
113
+ setContainer(containerDom);
114
+ }, [containerFromProps, splitterRef]);
85
115
 
86
116
  // Initialize percent and width on mount
87
117
  useEffect(function () {
@@ -89,25 +119,21 @@ var useSplitter = function useSplitter(props) {
89
119
  var rect = container.getBoundingClientRect();
90
120
  setPercent(defaultRatio);
91
121
  if (directionRef.current === 'vertical') {
122
+ var _onChangeRef$current3;
92
123
  setWidth(rect.width * defaultRatio);
124
+ (_onChangeRef$current3 = onChangeRef.current) === null || _onChangeRef$current3 === void 0 || _onChangeRef$current3.call(onChangeRef, defaultRatio);
93
125
  } else {
126
+ var _onChangeRef$current4;
94
127
  setWidth(rect.height * defaultRatio);
128
+ (_onChangeRef$current4 = onChangeRef.current) === null || _onChangeRef$current4 === void 0 || _onChangeRef$current4.call(onChangeRef, defaultRatio);
95
129
  }
96
130
  }
97
131
  }, [defaultRatio, container]);
98
132
  var vertical = direction === 'vertical';
99
- var dom = /*#__PURE__*/_jsx("div", {
100
- className: className,
101
- style: _objectSpread({
102
- flex: 'none',
103
- width: vertical ? splitterWidth : '100%',
104
- height: vertical ? 'auto' : splitterWidth,
105
- cursor: vertical ? 'col-resize' : 'row-resize',
106
- background: dragging ? token.colorPrimaryHover : isOver ? token.colorPrimaryActive : token.colorBorder,
107
- margin: vertical ? '0 4px' : '4px 0',
108
- borderRadius: 4,
109
- userSelect: 'none'
110
- }, style),
133
+ var dom = wrapCSSVar( /*#__PURE__*/_jsx("div", {
134
+ ref: setSplitterRef,
135
+ className: names(hashId, cssVarCls, prefixCls, className, isOver ? names("".concat(prefixCls, "-hover"), classNames === null || classNames === void 0 ? void 0 : classNames.hover) : undefined, dragging ? names("".concat(prefixCls, "-dragging"), classNames === null || classNames === void 0 ? void 0 : classNames.dragging) : undefined, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-vertical"), vertical), "".concat(prefixCls, "-horizontal"), !vertical)),
136
+ style: _objectSpread(_defineProperty({}, "--splitter-width", splitterWidth ? "".concat(splitterWidth, "px") : undefined), style),
111
137
  onMouseDown: function onMouseDown() {
112
138
  return setDragging(true);
113
139
  },
@@ -119,8 +145,12 @@ var useSplitter = function useSplitter(props) {
119
145
  },
120
146
  role: "separator",
121
147
  "aria-orientation": vertical ? 'vertical' : 'horizontal',
122
- "aria-label": "Resize"
123
- });
148
+ "aria-label": "Resize",
149
+ children: /*#__PURE__*/_jsx("div", {
150
+ className: names("".concat(prefixCls, "-handle"), classNames === null || classNames === void 0 ? void 0 : classNames.handle),
151
+ style: styles === null || styles === void 0 ? void 0 : styles.handle
152
+ })
153
+ }));
124
154
  return {
125
155
  dom: dom,
126
156
  percent: percent,
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useState","theme","useRefValue","jsx","_jsx","useSplitter","props","_ref","container","defaultRatio","_ref$minRatio","minRatio","_ref$maxRatio","maxRatio","_ref$direction","direction","_ref$splitterWidth","splitterWidth","className","style","_theme$useToken","useToken","token","directionRef","_useState","_useState2","_slicedToArray","percent","setPercent","percentRef","_useState3","clientWidth","undefined","_useState4","width","setWidth","_useState5","_useState6","dragging","setDragging","minRatioRef","maxRatioRef","_useState7","_useState8","isOver","setIsOver","onMove","e","el","rect","getBoundingClientRect","x","clientX","left","ratio","Math","max","current","min","y","clientY","top","height","preventDefault","onUp","window","addEventListener","once","removeEventListener","vertical","dom","_objectSpread","flex","cursor","background","colorPrimaryHover","colorPrimaryActive","colorBorder","margin","borderRadius","userSelect","onMouseDown","onMouseEnter","onMouseLeave","role"],"sources":["../../src/hooks/useSplitter.tsx"],"sourcesContent":["import { type CSSProperties, useEffect, useState } from 'react';\nimport { theme } from 'antd';\nimport useRefValue from './useRefValue';\n\nexport interface UseSplitterProps {\n /**\n * - **EN:** Split direction. vertical = left/right; horizontal = top/bottom.\n * - **ZH:** 分割方向。vertical 表示左右分割;horizontal 表示上下分割。\n *\n * @default 'vertical'\n */\n direction?: 'vertical' | 'horizontal';\n /**\n * - **EN:** The container element reference.\n * - **ZH:** 容器元素的引用。\n */\n container: HTMLDivElement | null | undefined;\n /**\n * - **EN:** Default ratio of the left/top pane (0~1).\n * - **ZH:** 左侧/顶部面板的默认比例 (0~1)。\n *\n * @default 0.32\n */\n defaultRatio?: number;\n /**\n * - **EN:** Minimum ratio of the left/top pane (0~1).\n * - **ZH:** 左侧/顶部面板的最小比例 (0~1)。\n *\n * @default 0.15\n */\n minRatio?: number;\n /**\n * - **EN:** Maximum ratio of the left/top pane (0~1).\n * - **ZH:** 左侧/顶部面板的最大比例 (0~1)。\n *\n * @default 0.85\n */\n maxRatio?: number;\n /**\n * - **EN:** Width of the splitter in pixels.\n * - **ZH:** 分割条的宽度,单位为像素。\n *\n * @default 2\n */\n splitterWidth?: number;\n /** Additional class name for the splitter element */\n className?: string;\n /** Additional style for the splitter element */\n style?: CSSProperties;\n}\n\nconst useSplitter = (props: UseSplitterProps) => {\n const {\n container,\n defaultRatio,\n minRatio = 0.15,\n maxRatio = 1 - minRatio,\n direction = 'vertical',\n splitterWidth = 2,\n className,\n style,\n } = props || {};\n const { token } = theme.useToken();\n const directionRef = useRefValue(direction);\n const [percent, setPercent] = useState(defaultRatio);\n const percentRef = useRefValue(percent);\n const [width, setWidth] = useState(\n container && defaultRatio ? (container?.clientWidth || 0) * defaultRatio : undefined\n );\n const [dragging, setDragging] = useState(false);\n const minRatioRef = useRefValue(minRatio);\n const maxRatioRef = useRefValue(maxRatio);\n const [isOver, setIsOver] = useState(false);\n\n useEffect(() => {\n if (!dragging) return;\n const onMove = (e: MouseEvent) => {\n const el = container;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n if (direction === 'vertical') {\n const x = e.clientX - rect.left;\n const ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, x / rect.width));\n setPercent(ratio);\n setWidth(x);\n } else {\n const y = e.clientY - rect.top;\n const ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, y / rect.height));\n setPercent(ratio);\n setWidth(y);\n }\n // prevent text selection while dragging\n e.preventDefault();\n };\n const onUp = () => setDragging(false);\n window.addEventListener('mousemove', onMove);\n window.addEventListener('mouseup', onUp, { once: true });\n\n return () => {\n window.removeEventListener('mousemove', onMove);\n window.removeEventListener('mouseup', onUp);\n };\n }, [container, dragging, direction, minRatioRef, maxRatioRef]);\n\n // Initialize percent and width on mount\n useEffect(() => {\n if (defaultRatio && container && percentRef.current == null) {\n const rect = container.getBoundingClientRect();\n setPercent(defaultRatio);\n if (directionRef.current === 'vertical') {\n setWidth(rect.width * defaultRatio);\n } else {\n setWidth(rect.height * defaultRatio);\n }\n }\n }, [defaultRatio, container]);\n\n const vertical = direction === 'vertical';\n const dom = (\n <div\n className={className}\n style={{\n flex: 'none',\n width: vertical ? splitterWidth : '100%',\n height: vertical ? 'auto' : splitterWidth,\n cursor: vertical ? 'col-resize' : 'row-resize',\n background: dragging ? token.colorPrimaryHover : isOver ? token.colorPrimaryActive : token.colorBorder,\n margin: vertical ? '0 4px' : '4px 0',\n borderRadius: 4,\n userSelect: 'none',\n ...style,\n }}\n onMouseDown={() => setDragging(true)}\n onMouseEnter={() => setIsOver(true)}\n onMouseLeave={() => setIsOver(false)}\n role=\"separator\"\n aria-orientation={vertical ? 'vertical' : 'horizontal'}\n aria-label=\"Resize\"\n />\n );\n\n return {\n dom,\n percent,\n width,\n dragging,\n direction,\n };\n};\n\nexport default useSplitter;\n"],"mappings":";;;;;;;;;;;;AAAA,SAA6BA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,KAAK,QAAQ,MAAM;AAC5B,OAAOC,WAAW;AAAsB,SAAAC,GAAA,IAAAC,IAAA;AAiDxC,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAAuB,EAAK;EAC/C,IAAAC,IAAA,GASID,KAAK,IAAI,CAAC,CAAC;IARbE,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAAC,aAAA,GAAAH,IAAA,CACZI,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,IAAI,GAAAA,aAAA;IAAAE,aAAA,GAAAL,IAAA,CACfM,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,CAAC,GAAGD,QAAQ,GAAAC,aAAA;IAAAE,cAAA,GAAAP,IAAA,CACvBQ,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,UAAU,GAAAA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C;MACfC,UAAU,EAAE;IAAM,GACf7D,KAAK,CACR;IACF8D,WAAW,EAAE,SAAAA,YAAA;MAAA,OAAM1C,WAAW,CAAC,IAAI,CAAC;IAAA,CAAC;IACrC2C,YAAY,EAAE,SAAAA,aAAA;MAAA,OAAMrC,SAAS,CAAC,IAAI,CAAC;IAAA,CAAC;IACpCsC,YAAY,EAAE,SAAAA,aAAA;MAAA,OAAMtC,SAAS,CAAC,KAAK,CAAC;IAAA,CAAC;IACrCuC,IAAI,EAAC,WAAW;IAChB,oBAAkBf,QAAQ,GAAG,UAAU,GAAG,YAAa;IACvD,cAAW;EAAQ,CACpB,CACF;EAED,OAAO;IACLC,GAAG,EAAHA,GAAG;IACH3C,OAAO,EAAPA,OAAO;IACPO,KAAK,EAALA,KAAK;IACLI,QAAQ,EAARA,QAAQ;IACRvB,SAAS,EAATA;EACF,CAAC;AACH,CAAC;AAED,eAAeV,WAAW"}
1
+ {"version":3,"names":["useContext","useEffect","useState","names","ConfigProvider","useStyle","useRefValue","jsx","_jsx","useSplitter","props","_ref","containerFromProps","container","defaultRatio","_ref$minRatio","minRatio","_ref$maxRatio","maxRatio","_ref$direction","direction","_ref$splitterWidth","splitterWidth","className","classNames","styles","prefixClsInProps","prefixCls","style","onChange","_useContext","ConfigContext","getPrefixCls","_useStyle","_useStyle2","_slicedToArray","wrapCSSVar","hashId","cssVarCls","directionRef","_useState","_useState2","splitterRef","setSplitterRef","_useState3","_useState4","setContainer","_useState5","_useState6","percent","setPercent","percentRef","onChangeRef","_useState7","clientWidth","undefined","_useState8","width","setWidth","_useState9","_useState10","dragging","setDragging","minRatioRef","maxRatioRef","_useState11","_useState12","isOver","setIsOver","onMove","e","el","rect","getBoundingClientRect","_onChangeRef$current","x","clientX","left","ratio","Math","max","current","min","call","_onChangeRef$current2","y","clientY","top","height","preventDefault","onUp","window","addEventListener","once","removeEventListener","_ref2","containerDom","parentElement","_onChangeRef$current3","_onChangeRef$current4","vertical","dom","ref","concat","hover","_defineProperty","_objectSpread","onMouseDown","onMouseEnter","onMouseLeave","role","children","handle"],"sources":["../../src/hooks/useSplitter.tsx"],"sourcesContent":["import { type CSSProperties, useContext, useEffect, useState } from 'react';\nimport names from 'classnames';\nimport { ConfigProvider } from '../components';\nimport useStyle from './style/useSplitter';\nimport useRefValue from './useRefValue';\n\nexport interface UseSplitterProps {\n /**\n * - **EN:** Split direction. vertical = left/right; horizontal = top/bottom.\n * - **CN:** 分割方向。vertical 表示左右分割;horizontal 表示上下分割。\n *\n * @default 'vertical'\n */\n direction?: 'vertical' | 'horizontal';\n /**\n * - **EN:** Parent container element. If not specified, the parent container of the `dom` element\n * will be used automatically.\n * - **CN:** 父容器元素,如果不指定,则自动使用 `dom` 元素的父容器\n */\n container?: HTMLDivElement | null | undefined;\n /**\n * - **EN:** Default ratio of the left/top pane (0~1).\n * - **CN:** 左侧/顶部面板的默认比例 (0~1)。\n *\n * @default 0.32\n */\n defaultRatio?: number;\n /**\n * - **EN:** Minimum ratio of the left/top pane (0~1).\n * - **CN:** 左侧/顶部面板的最小比例 (0~1)。\n *\n * @default 0.15\n */\n minRatio?: number;\n /**\n * - **EN:** Maximum ratio of the left/top pane (0~1).\n * - **CN:** 左侧/顶部面板的最大比例 (0~1)。\n *\n * @default 0.85\n */\n maxRatio?: number;\n /**\n * - **EN:** Width of the splitter in pixels.\n * - **CN:** 分割条的宽度,单位为像素。\n *\n * @default 2\n */\n splitterWidth?: number;\n /** Additional class name for the splitter element */\n className?: string;\n /** Additional style for the splitter element */\n style?: CSSProperties;\n /**\n * - **EN:** Custom prefix for the component's CSS class.\n * - **CN:** 组件的自定义 CSS 类前缀。\n */\n prefixCls?: string;\n /**\n * - **EN:** Semantic class names\n * - **CN:** 语义化类名\n */\n classNames?: {\n /**\n * - **EN:** Class name applied when the splitter is hovered.\n * - **CN:** 分割条悬停时应用的类名。\n */\n hover?: string;\n /**\n * - **EN:** Class name applied when the splitter is being dragged.\n * - **CN:** 分割条拖动时应用的类名。\n */\n dragging?: string;\n /**\n * - **EN:** Class name applied to the splitter handle.\n * - **CN:** 分割条手柄的类名。\n */\n handle?: string;\n };\n /**\n * - **EN:** Semantic styles\n * - **CN:** 语义化样式\n */\n styles?: {\n /**\n * - **EN:** Custom styles for the splitter handle.\n * - **CN:** 分割条手柄的自定义样式。\n */\n handle?: CSSProperties;\n };\n /**\n * - **EN:** Callback function when the splitter ratio changes.\n * - **CN:** 分割比例变化时的回调函数。\n */\n onChange?: (ratio?: number) => void;\n}\n\nconst useSplitter = (props: UseSplitterProps) => {\n const {\n container: containerFromProps,\n defaultRatio,\n minRatio = 0.15,\n maxRatio = 1 - minRatio,\n direction = 'vertical',\n splitterWidth = 1,\n className,\n classNames,\n styles,\n prefixCls: prefixClsInProps,\n style,\n onChange,\n } = props || {};\n const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const prefixCls = getPrefixCls('splitter', prefixClsInProps);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const directionRef = useRefValue(direction);\n const [splitterRef, setSplitterRef] = useState<HTMLDivElement | null>(null);\n const [container, setContainer] = useState(containerFromProps);\n const [percent, setPercent] = useState(defaultRatio);\n const percentRef = useRefValue(percent);\n const onChangeRef = useRefValue(onChange);\n const [width, setWidth] = useState(\n container && defaultRatio ? (container?.clientWidth || 0) * defaultRatio : undefined\n );\n const [dragging, setDragging] = useState(false);\n const minRatioRef = useRefValue(minRatio);\n const maxRatioRef = useRefValue(maxRatio);\n const [isOver, setIsOver] = useState(false);\n\n useEffect(() => {\n if (!dragging) return;\n const onMove = (e: MouseEvent) => {\n const el = container;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n if (direction === 'vertical') {\n const x = e.clientX - rect.left;\n const ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, x / rect.width));\n setPercent(ratio);\n setWidth(x);\n onChangeRef.current?.(ratio);\n } else {\n const y = e.clientY - rect.top;\n const ratio = Math.max(minRatioRef.current, Math.min(maxRatioRef.current, y / rect.height));\n setPercent(ratio);\n setWidth(y);\n onChangeRef.current?.(ratio);\n }\n // prevent text selection while dragging\n e.preventDefault();\n };\n const onUp = () => setDragging(false);\n window.addEventListener('mousemove', onMove);\n window.addEventListener('mouseup', onUp, { once: true });\n\n return () => {\n window.removeEventListener('mousemove', onMove);\n window.removeEventListener('mouseup', onUp);\n };\n }, [container, dragging, direction, minRatioRef, maxRatioRef]);\n\n useEffect(() => {\n const containerDom = containerFromProps ?? (splitterRef?.parentElement as HTMLDivElement | undefined) ?? undefined;\n setContainer(containerDom);\n }, [containerFromProps, splitterRef]);\n\n // Initialize percent and width on mount\n useEffect(() => {\n if (defaultRatio && container && percentRef.current == null) {\n const rect = container.getBoundingClientRect();\n setPercent(defaultRatio);\n if (directionRef.current === 'vertical') {\n setWidth(rect.width * defaultRatio);\n onChangeRef.current?.(defaultRatio);\n } else {\n setWidth(rect.height * defaultRatio);\n onChangeRef.current?.(defaultRatio);\n }\n }\n }, [defaultRatio, container]);\n\n const vertical = direction === 'vertical';\n const dom = wrapCSSVar(\n <div\n ref={setSplitterRef}\n className={names(\n hashId,\n cssVarCls,\n prefixCls,\n className,\n isOver ? names(`${prefixCls}-hover`, classNames?.hover) : undefined,\n dragging ? names(`${prefixCls}-dragging`, classNames?.dragging) : undefined,\n {\n [`${prefixCls}-vertical`]: vertical,\n [`${prefixCls}-horizontal`]: !vertical,\n }\n )}\n style={{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [`--splitter-width` as any]: splitterWidth ? `${splitterWidth}px` : undefined,\n ...style,\n }}\n onMouseDown={() => setDragging(true)}\n onMouseEnter={() => setIsOver(true)}\n onMouseLeave={() => setIsOver(false)}\n role=\"separator\"\n aria-orientation={vertical ? 'vertical' : 'horizontal'}\n aria-label=\"Resize\"\n >\n <div className={names(`${prefixCls}-handle`, classNames?.handle)} style={styles?.handle}></div>\n </div>\n );\n\n return {\n dom,\n percent,\n width,\n dragging,\n direction,\n };\n};\n\nexport default useSplitter;\n"],"mappings":";;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;IACFxE,KAAK,EAAA8E,aAAA,CAAAD,eAAA,yBAE0BnF,aAAa,MAAAiF,MAAA,CAAMjF,aAAa,UAAOiC,SAAS,GAC1E3B,KAAK,CACR;IACF+E,WAAW,EAAE,SAAAA,YAAA;MAAA,OAAM7C,WAAW,CAAC,IAAI,CAAC;IAAA,CAAC;IACrC8C,YAAY,EAAE,SAAAA,aAAA;MAAA,OAAMxC,SAAS,CAAC,IAAI,CAAC;IAAA,CAAC;IACpCyC,YAAY,EAAE,SAAAA,aAAA;MAAA,OAAMzC,SAAS,CAAC,KAAK,CAAC;IAAA,CAAC;IACrC0C,IAAI,EAAC,WAAW;IAChB,oBAAkBV,QAAQ,GAAG,UAAU,GAAG,YAAa;IACvD,cAAW,QAAQ;IAAAW,QAAA,eAEnBvG,IAAA;MAAKe,SAAS,EAAEpB,KAAK,IAAAoG,MAAA,CAAI5E,SAAS,cAAWH,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEwF,MAAM,CAAE;MAACpF,KAAK,EAAEH,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEuF;IAAO,CAAM;EAAC,CAC5F,CACP,CAAC;EAED,OAAO;IACLX,GAAG,EAAHA,GAAG;IACHpD,OAAO,EAAPA,OAAO;IACPQ,KAAK,EAALA,KAAK;IACLI,QAAQ,EAARA,QAAQ;IACRzC,SAAS,EAATA;EACF,CAAC;AACH,CAAC;AAED,eAAeX,WAAW"}
@@ -39,6 +39,7 @@ var import_icons = require("@ant-design/icons");
39
39
  var import_hooks = require("../../hooks");
40
40
  var import_useLocalStorage = __toESM(require("../../hooks/useLocalStorage"));
41
41
  var import_useT = __toESM(require("../../hooks/useT"));
42
+ var import_ConfigProvider = __toESM(require("../ConfigProvider"));
42
43
  var import_style = __toESM(require("./style"));
43
44
  function ColumnSetting(props) {
44
45
  const {
@@ -53,7 +54,7 @@ function ColumnSetting(props) {
53
54
  onChange,
54
55
  renderColumnTitle
55
56
  } = props;
56
- const { getPrefixCls } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
57
+ const { getPrefixCls } = (0, import_react.useContext)(import_ConfigProvider.default.ConfigContext);
57
58
  const prefixCls = getPrefixCls("column-setting", prefixClsInProps);
58
59
  const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls);
59
60
  const [open, setOpen] = (0, import_react.useState)(false);