@tiny-codes/react-easy 1.7.3 → 1.7.5

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## 1.7.5
6
+
7
+ 2026-2-24
8
+
9
+ ### Features
10
+
11
+ - **EllipsisLink**
12
+ - ✨ Add `EllipsisLink` component with automatic ellipsis and tooltip functionality.
13
+
14
+ ## 1.7.4
15
+
16
+ 2026-2-24
17
+
18
+ ### Features
19
+
20
+ - **OverflowTags**
21
+ - ✨ Add `ellipsisDropdownProps` property to customize the dropdown when tags are overflowed.
22
+
5
23
  ## 1.7.3
6
24
 
7
25
  2026-2-12
@@ -0,0 +1,19 @@
1
+ import type { LinkProps } from 'antd/es/typography/Link';
2
+ import { type MakeEllipsisTypographyProps } from './withEllipsisTypography';
3
+ export type EllipsisLinkProps = MakeEllipsisTypographyProps<LinkProps>;
4
+ /**
5
+ * - **EN:** A text component with automatic ellipsis and tooltip functionality that displays a
6
+ * tooltip when the text overflows, and does not display a tooltip when the text does not
7
+ * overflow. The following three methods can enable the automatic tooltip feature:
8
+ *
9
+ * 1. Set the `ellipsis` property to `true`
10
+ * 2. Set the `ellipsis.tooltip` property to `true`
11
+ * 3. Set the `ellipsis.tooltip.title` property to `true`
12
+ * - **CN:** 具有自动省略号和提示功能的文本组件,在文本溢出时显示工具提示,如果文本未溢出,则不显示工具提示。以下三种方式均可开启自动提示功能:
13
+ *
14
+ * 1. 设置 `ellipsis` 属性为 `true`
15
+ * 2. 设置 `ellipsis.tooltip` 属性为 `true`
16
+ * 3. 设置 `ellipsis.tooltip.title` 属性为 `true`
17
+ */
18
+ declare const EllipsisLink: (props: MakeEllipsisTypographyProps<LinkProps>) => import("react/jsx-runtime").JSX.Element;
19
+ export default EllipsisLink;
@@ -0,0 +1,19 @@
1
+ import { Typography } from 'antd';
2
+ import withEllipsisTypography from "./withEllipsisTypography";
3
+ /**
4
+ * - **EN:** A text component with automatic ellipsis and tooltip functionality that displays a
5
+ * tooltip when the text overflows, and does not display a tooltip when the text does not
6
+ * overflow. The following three methods can enable the automatic tooltip feature:
7
+ *
8
+ * 1. Set the `ellipsis` property to `true`
9
+ * 2. Set the `ellipsis.tooltip` property to `true`
10
+ * 3. Set the `ellipsis.tooltip.title` property to `true`
11
+ * - **CN:** 具有自动省略号和提示功能的文本组件,在文本溢出时显示工具提示,如果文本未溢出,则不显示工具提示。以下三种方式均可开启自动提示功能:
12
+ *
13
+ * 1. 设置 `ellipsis` 属性为 `true`
14
+ * 2. 设置 `ellipsis.tooltip` 属性为 `true`
15
+ * 3. 设置 `ellipsis.tooltip.title` 属性为 `true`
16
+ */
17
+ var EllipsisLink = withEllipsisTypography(Typography.Link);
18
+ export default EllipsisLink;
19
+ //# sourceMappingURL=EllipsisLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Typography","withEllipsisTypography","EllipsisLink","Link"],"sources":["../../../src/components/EllipsisTypography/EllipsisLink.tsx"],"sourcesContent":["import { Typography } from 'antd';\nimport type { LinkProps } from 'antd/es/typography/Link';\nimport withEllipsisTypography, { type MakeEllipsisTypographyProps } from './withEllipsisTypography';\n\nexport type EllipsisLinkProps = MakeEllipsisTypographyProps<LinkProps>;\n\n/**\n * - **EN:** A text component with automatic ellipsis and tooltip functionality that displays a\n * tooltip when the text overflows, and does not display a tooltip when the text does not\n * overflow. The following three methods can enable the automatic tooltip feature:\n *\n * 1. Set the `ellipsis` property to `true`\n * 2. Set the `ellipsis.tooltip` property to `true`\n * 3. Set the `ellipsis.tooltip.title` property to `true`\n * - **CN:** 具有自动省略号和提示功能的文本组件,在文本溢出时显示工具提示,如果文本未溢出,则不显示工具提示。以下三种方式均可开启自动提示功能:\n *\n * 1. 设置 `ellipsis` 属性为 `true`\n * 2. 设置 `ellipsis.tooltip` 属性为 `true`\n * 3. 设置 `ellipsis.tooltip.title` 属性为 `true`\n */\nconst EllipsisLink = withEllipsisTypography<LinkProps>(Typography.Link);\n\nexport default EllipsisLink;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,MAAM;AAEjC,OAAOC,sBAAsB;AAI7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,YAAY,GAAGD,sBAAsB,CAAYD,UAAU,CAACG,IAAI,CAAC;AAEvE,eAAeD,YAAY"}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { TagProps } from 'antd';
2
+ import type { DropdownProps, TagProps } from 'antd';
3
3
  import type { OverflowProps } from 'rc-overflow';
4
4
  export interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem'> {
5
5
  /**
@@ -44,6 +44,12 @@ export interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem
44
44
  omittedItems: T[];
45
45
  allTags: T[];
46
46
  }) => TagProps);
47
+ /**
48
+ * **EN**: Custom properties for the dropdown component when tags are overflowed
49
+ *
50
+ * **CN**: 当标签溢出时,下拉菜单的自定义属性
51
+ */
52
+ ellipsisDropdownProps?: DropdownProps;
47
53
  /**
48
54
  * **EN**: Whether to use random colors, default is `false`. Note that the tag object can also
49
55
  * contain a `color` property to specify the color, and the latter takes precedence.
@@ -1,4 +1,4 @@
1
- var _excluded = ["tags", "randomColors", "getTagName", "getTagKey", "tagProps", "ellipsisTagProps", "className", "prefixCls"];
1
+ var _excluded = ["tags", "randomColors", "getTagName", "getTagKey", "tagProps", "ellipsisTagProps", "ellipsisDropdownProps", "className", "prefixCls"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  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; }
@@ -47,6 +47,7 @@ var OverflowTags = function OverflowTags(props) {
47
47
  getTagKey = props.getTagKey,
48
48
  tagProps = props.tagProps,
49
49
  ellipsisTagProps = props.ellipsisTagProps,
50
+ ellipsisDropdownProps = props.ellipsisDropdownProps,
50
51
  className = props.className,
51
52
  prefixClsInProps = props.prefixCls,
52
53
  restProps = _objectWithoutProperties(props, _excluded);
@@ -95,8 +96,8 @@ var OverflowTags = function OverflowTags(props) {
95
96
  maxCount: "responsive",
96
97
  renderItem: renderTag,
97
98
  renderRest: function renderRest(omittedItems) {
98
- return /*#__PURE__*/_jsx(Dropdown, {
99
- menu: {
99
+ return /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({}, ellipsisDropdownProps), {}, {
100
+ menu: _objectSpread({
100
101
  items: omittedItems.map(function (tag) {
101
102
  var _ref2, _getValue2;
102
103
  return {
@@ -105,14 +106,14 @@ var OverflowTags = function OverflowTags(props) {
105
106
  label: getTagName(tag)
106
107
  };
107
108
  })
108
- },
109
+ }, ellipsisDropdownProps === null || ellipsisDropdownProps === void 0 ? void 0 : ellipsisDropdownProps.menu),
109
110
  children: /*#__PURE__*/_jsxs(Tag, _objectSpread(_objectSpread({}, typeof ellipsisTagProps === 'function' ? ellipsisTagProps(omittedItems[0], {
110
111
  omittedItems: omittedItems,
111
112
  allTags: tags
112
113
  }) : ellipsisTagProps), {}, {
113
114
  children: ["+ ", omittedItems.length, "..."]
114
115
  }))
115
- });
116
+ }));
116
117
  }
117
118
  }, restProps)));
118
119
  };
@@ -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","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 { 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**: 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 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 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 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 }}\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,SAAA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AAC,GAClEM,gBAAgB;UAAAwC,QAAA,GACrB,IACG,EAACK,YAAY,CAACN,MAAM,EAAC,KACzB;QAAA,EAAK;MAAC,CACE,CAAC;IAAA;EACX,GACEnC,SAAS,CACd,CACH,CAAC;AACH,CAAC;AAED,eAAeb,YAAY"}
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 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>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E,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"}
@@ -22,6 +22,8 @@ export * from './EllipsisTypography/EllipsisText';
22
22
  export { default as EllipsisText } from './EllipsisTypography/EllipsisText';
23
23
  export * from './EllipsisTypography/EllipsisTitle';
24
24
  export { default as EllipsisTitle } from './EllipsisTypography/EllipsisTitle';
25
+ export * from './EllipsisTypography/EllipsisLink';
26
+ export { default as EllipsisLink } from './EllipsisTypography/EllipsisLink';
25
27
  export type { FloatDrawerProps } from './FloatDrawer';
26
28
  export { default as FloatDrawer } from './FloatDrawer';
27
29
  export type { FormItemControlProps } from './FormItemControl';
@@ -17,6 +17,8 @@ export * from "./EllipsisTypography/EllipsisText";
17
17
  export { default as EllipsisText } from "./EllipsisTypography/EllipsisText";
18
18
  export * from "./EllipsisTypography/EllipsisTitle";
19
19
  export { default as EllipsisTitle } from "./EllipsisTypography/EllipsisTitle";
20
+ export * from "./EllipsisTypography/EllipsisLink";
21
+ export { default as EllipsisLink } from "./EllipsisTypography/EllipsisLink";
20
22
  export { default as FloatDrawer } from "./FloatDrawer";
21
23
  export { default as FormItemControl } from "./FormItemControl";
22
24
  export { default as Loading } from "./Loading";
@@ -1 +1 @@
1
- {"version":3,"names":["default","BreakLines","ColumnSetting","ConfigProvider","ReactEasyContext","withDefaultConfirmActionProps","withConfirmAction","ConfirmAction","ContextMenu","DeleteConfirmAction","withDeleteConfirmAction","EditableText","EllipsisParagraph","EllipsisText","EllipsisTitle","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 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;AAGjC,SAASd,OAAO,IAAIe,WAAW;AAG/B,SAASf,OAAO,IAAIgB,eAAe;AAGnC,SAAShB,OAAO,IAAIiB,OAAO;AAG3B,SAASC,2BAA2B,EAAEC,eAAe;AACrD,SAASnB,OAAO,IAAIoB,WAAW;AAG/B,SAASpB,OAAO,IAAIqB,YAAY;AAGhC,SAASrB,OAAO,IAAIsB,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 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"}
@@ -0,0 +1,19 @@
1
+ import type { LinkProps } from 'antd/es/typography/Link';
2
+ import { type MakeEllipsisTypographyProps } from './withEllipsisTypography';
3
+ export type EllipsisLinkProps = MakeEllipsisTypographyProps<LinkProps>;
4
+ /**
5
+ * - **EN:** A text component with automatic ellipsis and tooltip functionality that displays a
6
+ * tooltip when the text overflows, and does not display a tooltip when the text does not
7
+ * overflow. The following three methods can enable the automatic tooltip feature:
8
+ *
9
+ * 1. Set the `ellipsis` property to `true`
10
+ * 2. Set the `ellipsis.tooltip` property to `true`
11
+ * 3. Set the `ellipsis.tooltip.title` property to `true`
12
+ * - **CN:** 具有自动省略号和提示功能的文本组件,在文本溢出时显示工具提示,如果文本未溢出,则不显示工具提示。以下三种方式均可开启自动提示功能:
13
+ *
14
+ * 1. 设置 `ellipsis` 属性为 `true`
15
+ * 2. 设置 `ellipsis.tooltip` 属性为 `true`
16
+ * 3. 设置 `ellipsis.tooltip.title` 属性为 `true`
17
+ */
18
+ declare const EllipsisLink: (props: MakeEllipsisTypographyProps<LinkProps>) => import("react/jsx-runtime").JSX.Element;
19
+ export default EllipsisLink;
@@ -0,0 +1,39 @@
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/EllipsisTypography/EllipsisLink.tsx
30
+ var EllipsisLink_exports = {};
31
+ __export(EllipsisLink_exports, {
32
+ default: () => EllipsisLink_default
33
+ });
34
+ module.exports = __toCommonJS(EllipsisLink_exports);
35
+ var import_antd = require("antd");
36
+ var import_withEllipsisTypography = __toESM(require("./withEllipsisTypography"));
37
+ var EllipsisLink = (0, import_withEllipsisTypography.default)(import_antd.Typography.Link);
38
+ var EllipsisLink_default = EllipsisLink;
39
+ //# sourceMappingURL=EllipsisLink.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/EllipsisTypography/EllipsisLink.tsx"],
4
+ "sourcesContent": ["import { Typography } from 'antd';\nimport type { LinkProps } from 'antd/es/typography/Link';\nimport withEllipsisTypography, { type MakeEllipsisTypographyProps } from './withEllipsisTypography';\n\nexport type EllipsisLinkProps = MakeEllipsisTypographyProps<LinkProps>;\n\n/**\n * - **EN:** A text component with automatic ellipsis and tooltip functionality that displays a\n * tooltip when the text overflows, and does not display a tooltip when the text does not\n * overflow. The following three methods can enable the automatic tooltip feature:\n *\n * 1. Set the `ellipsis` property to `true`\n * 2. Set the `ellipsis.tooltip` property to `true`\n * 3. Set the `ellipsis.tooltip.title` property to `true`\n * - **CN:** 具有自动省略号和提示功能的文本组件,在文本溢出时显示工具提示,如果文本未溢出,则不显示工具提示。以下三种方式均可开启自动提示功能:\n *\n * 1. 设置 `ellipsis` 属性为 `true`\n * 2. 设置 `ellipsis.tooltip` 属性为 `true`\n * 3. 设置 `ellipsis.tooltip.title` 属性为 `true`\n */\nconst EllipsisLink = withEllipsisTypography<LinkProps>(Typography.Link);\n\nexport default EllipsisLink;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAE3B,oCAAyE;AAkBzE,IAAM,mBAAe,8BAAAA,SAAkC,uBAAW,IAAI;AAEtE,IAAO,uBAAQ;",
6
+ "names": ["withEllipsisTypography"]
7
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { TagProps } from 'antd';
2
+ import type { DropdownProps, TagProps } from 'antd';
3
3
  import type { OverflowProps } from 'rc-overflow';
4
4
  export interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem'> {
5
5
  /**
@@ -44,6 +44,12 @@ export interface OverflowTagsProps<T> extends Omit<OverflowProps<T>, 'renderItem
44
44
  omittedItems: T[];
45
45
  allTags: T[];
46
46
  }) => TagProps);
47
+ /**
48
+ * **EN**: Custom properties for the dropdown component when tags are overflowed
49
+ *
50
+ * **CN**: 当标签溢出时,下拉菜单的自定义属性
51
+ */
52
+ ellipsisDropdownProps?: DropdownProps;
47
53
  /**
48
54
  * **EN**: Whether to use random colors, default is `false`. Note that the tag object can also
49
55
  * contain a `color` property to specify the color, and the latter takes precedence.
@@ -47,6 +47,7 @@ var OverflowTags = (props) => {
47
47
  getTagKey,
48
48
  tagProps,
49
49
  ellipsisTagProps,
50
+ ellipsisDropdownProps,
50
51
  className,
51
52
  prefixCls: prefixClsInProps,
52
53
  ...restProps
@@ -94,12 +95,14 @@ var OverflowTags = (props) => {
94
95
  renderRest: (omittedItems) => /* @__PURE__ */ React.createElement(
95
96
  import_antd.Dropdown,
96
97
  {
98
+ ...ellipsisDropdownProps,
97
99
  menu: {
98
100
  items: omittedItems.map((tag) => ({
99
101
  type: "item",
100
102
  key: getTagKey ? getTagKey(tag) : getValue(tag, "value") ?? getValue(tag, "id") ?? getTagName(tag),
101
103
  label: getTagName(tag)
102
- }))
104
+ })),
105
+ ...ellipsisDropdownProps == null ? void 0 : ellipsisDropdownProps.menu
103
106
  }
104
107
  },
105
108
  /* @__PURE__ */ React.createElement(
@@ -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 { 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**: 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 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 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 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 }}\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;AAmErB,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,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,QA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BAChC,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,YACJ;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;",
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 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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AAC,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
6
  "names": ["useStyle", "Overflow", "classNames"]
7
7
  }
@@ -22,6 +22,8 @@ export * from './EllipsisTypography/EllipsisText';
22
22
  export { default as EllipsisText } from './EllipsisTypography/EllipsisText';
23
23
  export * from './EllipsisTypography/EllipsisTitle';
24
24
  export { default as EllipsisTitle } from './EllipsisTypography/EllipsisTitle';
25
+ export * from './EllipsisTypography/EllipsisLink';
26
+ export { default as EllipsisLink } from './EllipsisTypography/EllipsisLink';
25
27
  export type { FloatDrawerProps } from './FloatDrawer';
26
28
  export { default as FloatDrawer } from './FloatDrawer';
27
29
  export type { FormItemControlProps } from './FormItemControl';
@@ -37,6 +37,7 @@ __export(components_exports, {
37
37
  ContextMenu: () => import_ContextMenu.default,
38
38
  DeleteConfirmAction: () => import_DeleteConfirmAction.default,
39
39
  EditableText: () => import_EditableText.default,
40
+ EllipsisLink: () => import_EllipsisLink.default,
40
41
  EllipsisParagraph: () => import_EllipsisParagraph.default,
41
42
  EllipsisText: () => import_EllipsisText.default,
42
43
  EllipsisTitle: () => import_EllipsisTitle.default,
@@ -71,6 +72,8 @@ __reExport(components_exports, require("./EllipsisTypography/EllipsisText"), mod
71
72
  var import_EllipsisText = __toESM(require("./EllipsisTypography/EllipsisText"));
72
73
  __reExport(components_exports, require("./EllipsisTypography/EllipsisTitle"), module.exports);
73
74
  var import_EllipsisTitle = __toESM(require("./EllipsisTypography/EllipsisTitle"));
75
+ __reExport(components_exports, require("./EllipsisTypography/EllipsisLink"), module.exports);
76
+ var import_EllipsisLink = __toESM(require("./EllipsisTypography/EllipsisLink"));
74
77
  var import_FloatDrawer = __toESM(require("./FloatDrawer"));
75
78
  var import_FormItemControl = __toESM(require("./FormItemControl"));
76
79
  var import_Loading = __toESM(require("./Loading"));
@@ -87,6 +90,7 @@ var import_Pulse = __toESM(require("./Animation/Pulse"));
87
90
  ContextMenu,
88
91
  DeleteConfirmAction,
89
92
  EditableText,
93
+ EllipsisLink,
90
94
  EllipsisParagraph,
91
95
  EllipsisText,
92
96
  EllipsisTitle,
@@ -104,6 +108,7 @@ var import_Pulse = __toESM(require("./Animation/Pulse"));
104
108
  withModalAction,
105
109
  ...require("./EllipsisTypography/EllipsisParagraph"),
106
110
  ...require("./EllipsisTypography/EllipsisText"),
107
- ...require("./EllipsisTypography/EllipsisTitle")
111
+ ...require("./EllipsisTypography/EllipsisTitle"),
112
+ ...require("./EllipsisTypography/EllipsisLink")
108
113
  });
109
114
  //# 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 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;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;AAGzC,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 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;",
6
6
  "names": ["import_ConfirmAction", "import_ModalAction"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-codes/react-easy",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Simplify React and AntDesign development with practical components and hooks",
5
5
  "keywords": [
6
6
  "react",