@lobehub/ui 6.11.0 → 6.13.0
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/es/AutoComplete/style.d.mts +1 -1
- package/es/Avatar/AvatarGroup/index.mjs +2 -1
- package/es/Avatar/AvatarGroup/index.mjs.map +1 -1
- package/es/Avatar/type.d.mts +4 -0
- package/es/List/ListRow.mjs +1 -1
- package/es/List/ListRow.mjs.map +1 -1
- package/es/List/type.d.mts +2 -1
- package/es/Table/atoms/cells.d.mts +8 -2
- package/es/Table/atoms/cells.mjs +7 -2
- package/es/Table/atoms/cells.mjs.map +1 -1
- package/es/Table/render/Body.mjs +5 -1
- package/es/Table/render/Body.mjs.map +1 -1
- package/es/Table/type.d.mts +1 -0
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ declare const styleArrays: {
|
|
|
41
41
|
}> | Readonly<{
|
|
42
42
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
43
43
|
readonly cursor: stylex.StyleXClassNameFor<"cursor", "default">;
|
|
44
|
-
readonly display: stylex.StyleXClassNameFor<"display", "
|
|
44
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex" | "none">;
|
|
45
45
|
}>)[];
|
|
46
46
|
item: Readonly<{
|
|
47
47
|
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
@@ -33,13 +33,14 @@ const AvatarGroup = memo(({ items, max, gap, variant = "borderless", bordered, s
|
|
|
33
33
|
...styleProps(styles.root, clsx$1(avatarGroupClasses(), className)),
|
|
34
34
|
...rest,
|
|
35
35
|
children: [avatars.map((avatar, index) => {
|
|
36
|
-
const { key, style: avatarStyle, className: avatarClassName, ...restAvatarProps } = avatar;
|
|
36
|
+
const { key, style: avatarStyle, className: avatarClassName, ringColor, ...restAvatarProps } = avatar;
|
|
37
37
|
return /* @__PURE__ */ jsx(AvatarImpl, {
|
|
38
38
|
className: clsx$1(avatarGroupClasses("avatar"), classNames?.avatar, avatarClassName),
|
|
39
39
|
xstyle: styles.avatar,
|
|
40
40
|
style: {
|
|
41
41
|
marginLeft: index === 0 ? 0 : gapValue,
|
|
42
42
|
zIndex: zIndexReverse ? items.length - index : index,
|
|
43
|
+
...ringColor && { boxShadow: `0 0 0 2px ${ringColor}` },
|
|
43
44
|
...customStyles?.avatar,
|
|
44
45
|
...avatarStyle
|
|
45
46
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Flexbox","clsx","Avatar"],"sources":["../../../src/Avatar/AvatarGroup/index.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { AvatarImpl as Avatar } from '../Avatar';\nimport { avatarGroupClasses } from '../stable';\nimport type { AvatarGroupProps } from '../type';\nimport { styles } from './style';\n\nconst AvatarGroup = memo<AvatarGroupProps>(\n ({\n items,\n max,\n gap,\n variant = 'borderless',\n bordered,\n shadow,\n size: sizeProp,\n background,\n animation,\n draggable,\n fallbackColors,\n fallbackVariant,\n classNames,\n shape,\n styles: customStyles,\n onClick,\n ref,\n zIndexReverse,\n className,\n ...rest\n }) => {\n const size = sizeProp ?? 48;\n const avatars = max ? items.slice(0, max) : items;\n const restAvatars = items.slice(max, items.length);\n const gapValue = gap ?? Math.floor(-size / 4);\n\n const avatarProps = {\n animation,\n background,\n bordered,\n draggable,\n fallbackColors,\n fallbackVariant,\n shadow,\n shape,\n size: sizeProp,\n variant,\n };\n\n return (\n <Flexbox\n horizontal\n gap={gap}\n ref={ref}\n {...styleProps(styles.root, clsx(avatarGroupClasses(), className))}\n {...rest}\n >\n {avatars.map((avatar, index) => {\n const {\n key,\n style: avatarStyle,\n className: avatarClassName,\n ...restAvatarProps\n } = avatar;\n return (\n <Avatar\n className={clsx(avatarGroupClasses('avatar'), classNames?.avatar, avatarClassName)}\n key={key}\n xstyle={styles.avatar}\n style={{\n marginLeft: index === 0 ? 0 : gapValue,\n zIndex: zIndexReverse ? items.length - index : index,\n ...customStyles?.avatar,\n ...avatarStyle,\n }}\n onClick={() => onClick?.({ item: avatar, key })}\n {...avatarProps}\n {...restAvatarProps}\n />\n );\n })}\n {max && restAvatars.length > 0 && (\n <Avatar\n {...avatarProps}\n avatar={`+${restAvatars.length}`}\n background={cssVar.colorText}\n className={clsx(avatarGroupClasses('count'), classNames?.count)}\n contentXstyle={styles.count}\n fallbackVariant={'text'}\n sliceText={false}\n xstyle={styles.avatar}\n style={{\n marginLeft: gapValue,\n zIndex: zIndexReverse ? 0 : avatars.length,\n ...customStyles?.count,\n }}\n />\n )}\n </Flexbox>\n );\n },\n);\n\nAvatarGroup.displayName = 'AvatarGroup';\n\nexport default AvatarGroup;\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,cAAc,MACjB,EACC,OACA,KACA,KACA,UAAU,cACV,UACA,QACA,MAAM,UACN,YACA,WACA,WACA,gBACA,iBACA,YACA,OACA,QAAQ,cACR,SACA,KACA,eACA,WACA,GAAG,WACC;CACJ,MAAM,OAAO,YAAY;CACzB,MAAM,UAAU,MAAM,MAAM,MAAM,GAAG,GAAG,IAAI;CAC5C,MAAM,cAAc,MAAM,MAAM,KAAK,MAAM,MAAM;CACjD,MAAM,WAAW,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC;CAE5C,MAAM,cAAc;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;EACN;CACF;CAEA,OACE,qBAACA,mBAAD;EACE,YAAA;EACK;EACA;EACL,GAAI,WAAW,OAAO,MAAMC,OAAK,mBAAmB,GAAG,SAAS,CAAC;EACjE,GAAI;EALN,UAAA,CAOG,QAAQ,KAAK,QAAQ,UAAU;GAC9B,MAAM,EACJ,KACA,OAAO,aACP,WAAW,iBACX,GAAG,oBACD;GACJ,OACE,oBAACC,YAAD;IACE,WAAWD,OAAK,mBAAmB,QAAQ,GAAG,YAAY,QAAQ,eAAe;IAEjF,QAAQ,OAAO;IACf,OAAO;KACL,YAAY,UAAU,IAAI,IAAI;KAC9B,QAAQ,gBAAgB,MAAM,SAAS,QAAQ;KAC/C,GAAG,cAAc;KACjB,GAAG;IACL;IACA,eAAe,UAAU;KAAE,MAAM;KAAQ;IAAI,CAAC;IAC9C,GAAI;IACJ,GAAI;GACL,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Flexbox","clsx","Avatar"],"sources":["../../../src/Avatar/AvatarGroup/index.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { AvatarImpl as Avatar } from '../Avatar';\nimport { avatarGroupClasses } from '../stable';\nimport type { AvatarGroupProps } from '../type';\nimport { styles } from './style';\n\nconst AvatarGroup = memo<AvatarGroupProps>(\n ({\n items,\n max,\n gap,\n variant = 'borderless',\n bordered,\n shadow,\n size: sizeProp,\n background,\n animation,\n draggable,\n fallbackColors,\n fallbackVariant,\n classNames,\n shape,\n styles: customStyles,\n onClick,\n ref,\n zIndexReverse,\n className,\n ...rest\n }) => {\n const size = sizeProp ?? 48;\n const avatars = max ? items.slice(0, max) : items;\n const restAvatars = items.slice(max, items.length);\n const gapValue = gap ?? Math.floor(-size / 4);\n\n const avatarProps = {\n animation,\n background,\n bordered,\n draggable,\n fallbackColors,\n fallbackVariant,\n shadow,\n shape,\n size: sizeProp,\n variant,\n };\n\n return (\n <Flexbox\n horizontal\n gap={gap}\n ref={ref}\n {...styleProps(styles.root, clsx(avatarGroupClasses(), className))}\n {...rest}\n >\n {avatars.map((avatar, index) => {\n const {\n key,\n style: avatarStyle,\n className: avatarClassName,\n ringColor,\n ...restAvatarProps\n } = avatar;\n return (\n <Avatar\n className={clsx(avatarGroupClasses('avatar'), classNames?.avatar, avatarClassName)}\n key={key}\n xstyle={styles.avatar}\n style={{\n marginLeft: index === 0 ? 0 : gapValue,\n zIndex: zIndexReverse ? items.length - index : index,\n ...(ringColor && { boxShadow: `0 0 0 2px ${ringColor}` }),\n ...customStyles?.avatar,\n ...avatarStyle,\n }}\n onClick={() => onClick?.({ item: avatar, key })}\n {...avatarProps}\n {...restAvatarProps}\n />\n );\n })}\n {max && restAvatars.length > 0 && (\n <Avatar\n {...avatarProps}\n avatar={`+${restAvatars.length}`}\n background={cssVar.colorText}\n className={clsx(avatarGroupClasses('count'), classNames?.count)}\n contentXstyle={styles.count}\n fallbackVariant={'text'}\n sliceText={false}\n xstyle={styles.avatar}\n style={{\n marginLeft: gapValue,\n zIndex: zIndexReverse ? 0 : avatars.length,\n ...customStyles?.count,\n }}\n />\n )}\n </Flexbox>\n );\n },\n);\n\nAvatarGroup.displayName = 'AvatarGroup';\n\nexport default AvatarGroup;\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,cAAc,MACjB,EACC,OACA,KACA,KACA,UAAU,cACV,UACA,QACA,MAAM,UACN,YACA,WACA,WACA,gBACA,iBACA,YACA,OACA,QAAQ,cACR,SACA,KACA,eACA,WACA,GAAG,WACC;CACJ,MAAM,OAAO,YAAY;CACzB,MAAM,UAAU,MAAM,MAAM,MAAM,GAAG,GAAG,IAAI;CAC5C,MAAM,cAAc,MAAM,MAAM,KAAK,MAAM,MAAM;CACjD,MAAM,WAAW,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC;CAE5C,MAAM,cAAc;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;EACN;CACF;CAEA,OACE,qBAACA,mBAAD;EACE,YAAA;EACK;EACA;EACL,GAAI,WAAW,OAAO,MAAMC,OAAK,mBAAmB,GAAG,SAAS,CAAC;EACjE,GAAI;EALN,UAAA,CAOG,QAAQ,KAAK,QAAQ,UAAU;GAC9B,MAAM,EACJ,KACA,OAAO,aACP,WAAW,iBACX,WACA,GAAG,oBACD;GACJ,OACE,oBAACC,YAAD;IACE,WAAWD,OAAK,mBAAmB,QAAQ,GAAG,YAAY,QAAQ,eAAe;IAEjF,QAAQ,OAAO;IACf,OAAO;KACL,YAAY,UAAU,IAAI,IAAI;KAC9B,QAAQ,gBAAgB,MAAM,SAAS,QAAQ;KAC/C,GAAI,aAAa,EAAE,WAAW,aAAa,YAAY;KACvD,GAAG,cAAc;KACjB,GAAG;IACL;IACA,eAAe,UAAU;KAAE,MAAM;KAAQ;IAAI,CAAC;IAC9C,GAAI;IACJ,GAAI;GACL,GAZM,GAYN;EAEL,CAAC,GACA,OAAO,YAAY,SAAS,KAC3B,oBAACC,YAAD;GACE,GAAI;GACJ,QAAQ,IAAI,YAAY;GACxB,YAAY,OAAO;GACnB,WAAWD,OAAK,mBAAmB,OAAO,GAAG,YAAY,KAAK;GAC9D,eAAe,OAAO;GACtB,iBAAiB;GACjB,WAAW;GACX,QAAQ,OAAO;GACf,OAAO;IACL,YAAY;IACZ,QAAQ,gBAAgB,IAAI,QAAQ;IACpC,GAAG,cAAc;GACnB;EACD,CAAA,CAEI;;AAEb,CACF;AAEA,YAAY,cAAc"}
|
package/es/Avatar/type.d.mts
CHANGED
|
@@ -126,6 +126,10 @@ export interface AvatarProps extends ComponentProps<'div'> {
|
|
|
126
126
|
}
|
|
127
127
|
export interface AvatarGroupItemType extends Pick<AvatarProps, 'avatar' | 'title' | 'alt' | 'onClick' | 'style' | 'className' | 'loading' | 'fallbackVariant'> {
|
|
128
128
|
key: string;
|
|
129
|
+
/**
|
|
130
|
+
* Draws a 2px ring in this color outside the separator border, e.g. a presence or status color
|
|
131
|
+
*/
|
|
132
|
+
ringColor?: string;
|
|
129
133
|
}
|
|
130
134
|
export interface AvatarGroupProps extends Pick<AvatarProps, 'variant' | 'bordered' | 'shadow' | 'size' | 'background' | 'animation' | 'draggable' | 'shape' | 'fallbackColors' | 'fallbackVariant'>, Omit<FlexboxProps, 'children' | 'draggable' | 'onClick' | 'ref'> {
|
|
131
135
|
classNames?: {
|
package/es/List/ListRow.mjs
CHANGED
|
@@ -59,7 +59,7 @@ const ListRow = memo(({ active, classNames, compact, item, onSelect, styles: cus
|
|
|
59
59
|
})
|
|
60
60
|
] });
|
|
61
61
|
return /* @__PURE__ */ jsxs("li", {
|
|
62
|
-
...styleProps([styles.item, listItemMarker], listClasses("row")),
|
|
62
|
+
...styleProps([styles.item, listItemMarker], clsx$1(listClasses("row"), classNames?.row), customStyles?.row),
|
|
63
63
|
children: [href && !disabled ? /* @__PURE__ */ jsx(A, {
|
|
64
64
|
"aria-current": active ? "page" : void 0,
|
|
65
65
|
className: rowClassName,
|
package/es/List/ListRow.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListRow.mjs","names":["clsx"],"sources":["../../src/List/ListRow.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport clsx from 'clsx';\nimport { memo, type MouseEvent } from 'react';\n\nimport A from '@/A';\nimport Icon from '@/Icon';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { toDataAttributes } from '@/utils/bem';\n\nimport { listItemMarker } from './marker.stylex';\nimport { listClasses } from './stable';\nimport { styles } from './style';\nimport type { ListItemType, ListProps } from './type';\n\nexport type ListRowXstyle = (\n item: ListItemType,\n active: boolean,\n) => Parameters<typeof styleProps>[0];\n\ninterface ListRowProps {\n active: boolean;\n classNames?: ListProps['classNames'];\n compact: boolean;\n item: ListItemType;\n onSelect: (item: ListItemType, event: MouseEvent<HTMLElement>) => void;\n styles?: ListProps['styles'];\n xstyle?: ListRowXstyle;\n}\n\nconst ListRow = memo<ListRowProps>(\n ({ active, classNames, compact, item, onSelect, styles: customStyles, xstyle }) => {\n const { actions, avatar, danger, description, disabled, extra, href, icon, label, showAction } =\n item;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect(item, event);\n };\n\n const rowClassName = styleProps(\n [\n focusRing.info,\n styles.row,\n compact && styles.compactRow,\n active && styles.active,\n danger && styles.danger,\n disabled && styles.disabled,\n xstyle?.(item, active),\n ],\n clsx(listClasses('item'), classNames?.item, item.className),\n ).className;\n const rowStyle = { ...customStyles?.item, ...item.style };\n const rowData = toDataAttributes({ active, danger, disabled });\n\n const content = (\n <>\n {avatar ?? (icon ? <Icon icon={icon} size={16} /> : null)}\n <span {...styleProps(styles.body, listClasses('body'))}>\n <span\n {...styleProps(\n styles.label,\n clsx('lobe-list-label', listClasses('label'), classNames?.label),\n customStyles?.label,\n )}\n >\n {label}\n </span>\n {description != null && (\n <span\n {...styleProps(\n styles.description,\n clsx(listClasses('description'), classNames?.description),\n customStyles?.description,\n )}\n >\n {description}\n </span>\n )}\n </span>\n {extra != null && (\n <span\n {...styleProps(\n styles.extra,\n clsx(listClasses('extra'), classNames?.extra),\n customStyles?.extra,\n )}\n >\n {extra}\n </span>\n )}\n </>\n );\n\n return (\n <li
|
|
1
|
+
{"version":3,"file":"ListRow.mjs","names":["clsx"],"sources":["../../src/List/ListRow.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport clsx from 'clsx';\nimport { memo, type MouseEvent } from 'react';\n\nimport A from '@/A';\nimport Icon from '@/Icon';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { toDataAttributes } from '@/utils/bem';\n\nimport { listItemMarker } from './marker.stylex';\nimport { listClasses } from './stable';\nimport { styles } from './style';\nimport type { ListItemType, ListProps } from './type';\n\nexport type ListRowXstyle = (\n item: ListItemType,\n active: boolean,\n) => Parameters<typeof styleProps>[0];\n\ninterface ListRowProps {\n active: boolean;\n classNames?: ListProps['classNames'];\n compact: boolean;\n item: ListItemType;\n onSelect: (item: ListItemType, event: MouseEvent<HTMLElement>) => void;\n styles?: ListProps['styles'];\n xstyle?: ListRowXstyle;\n}\n\nconst ListRow = memo<ListRowProps>(\n ({ active, classNames, compact, item, onSelect, styles: customStyles, xstyle }) => {\n const { actions, avatar, danger, description, disabled, extra, href, icon, label, showAction } =\n item;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect(item, event);\n };\n\n const rowClassName = styleProps(\n [\n focusRing.info,\n styles.row,\n compact && styles.compactRow,\n active && styles.active,\n danger && styles.danger,\n disabled && styles.disabled,\n xstyle?.(item, active),\n ],\n clsx(listClasses('item'), classNames?.item, item.className),\n ).className;\n const rowStyle = { ...customStyles?.item, ...item.style };\n const rowData = toDataAttributes({ active, danger, disabled });\n\n const content = (\n <>\n {avatar ?? (icon ? <Icon icon={icon} size={16} /> : null)}\n <span {...styleProps(styles.body, listClasses('body'))}>\n <span\n {...styleProps(\n styles.label,\n clsx('lobe-list-label', listClasses('label'), classNames?.label),\n customStyles?.label,\n )}\n >\n {label}\n </span>\n {description != null && (\n <span\n {...styleProps(\n styles.description,\n clsx(listClasses('description'), classNames?.description),\n customStyles?.description,\n )}\n >\n {description}\n </span>\n )}\n </span>\n {extra != null && (\n <span\n {...styleProps(\n styles.extra,\n clsx(listClasses('extra'), classNames?.extra),\n customStyles?.extra,\n )}\n >\n {extra}\n </span>\n )}\n </>\n );\n\n return (\n <li\n {...styleProps(\n [styles.item, listItemMarker],\n clsx(listClasses('row'), classNames?.row),\n customStyles?.row,\n )}\n >\n {href && !disabled ? (\n <A\n aria-current={active ? 'page' : undefined}\n className={rowClassName}\n {...rowData}\n href={href}\n style={rowStyle}\n onClick={handleClick}\n >\n {content}\n </A>\n ) : (\n <button\n aria-current={active ? 'true' : undefined}\n aria-disabled={disabled || undefined}\n className={rowClassName}\n {...rowData}\n style={rowStyle}\n type=\"button\"\n onClick={handleClick}\n >\n {content}\n </button>\n )}\n {actions != null && (\n <span\n {...styleProps(\n [styles.actions, showAction && styles.showAction],\n clsx(listClasses('actions'), classNames?.actions),\n customStyles?.actions,\n )}\n >\n {actions}\n </span>\n )}\n </li>\n );\n },\n);\n\nListRow.displayName =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UAAA;EACG,CAAA;CAER,EAAA,CAAA;CAGJ,OACE,qBAAC,MAAD;EACE,GAAI,WACF,CAAC,OAAO,MAAM,cAAc,GAC5BA,OAAK,YAAY,KAAK,GAAG,YAAY,GAAG,GACxC,cAAc,GAChB;EALF,UAAA,CAOG,QAAQ,CAAC,WACR,oBAAC,GAAD;GACE,gBAAc,SAAS,SAAS,KAAA;GAChC,WAAW;GACX,GAAI;GACE;GACN,OAAO;GACP,SAAS;GAER,UAAA;EACA,CAAA,IAEH,oBAAC,UAAD;GACE,gBAAc,SAAS,SAAS,KAAA;GAChC,iBAAe,YAAY,KAAA;GAC3B,WAAW;GACX,GAAI;GACJ,OAAO;GACP,MAAK;GACL,SAAS;GAER,UAAA;EACK,CAAA,GAET,WAAW,QACV,oBAAC,QAAD;GACE,GAAI,WACF,CAAC,OAAO,SAAS,cAAc,OAAO,UAAU,GAChDA,OAAK,YAAY,SAAS,GAAG,YAAY,OAAO,GAChD,cAAc,OAChB;GAEC,UAAA;EACG,CAAA,CAEN;;AAER,CACF;AAEA,QAAQ,cAAc"}
|
package/es/List/type.d.mts
CHANGED
|
@@ -28,7 +28,8 @@ export interface ListDividerType {
|
|
|
28
28
|
type: 'divider';
|
|
29
29
|
}
|
|
30
30
|
export type ListItem = ListItemType | ListDividerType;
|
|
31
|
-
|
|
31
|
+
/** `row` is the outer li (excluding dividers); `item` is its button or link. */
|
|
32
|
+
export type ListSemanticName = 'actions' | 'description' | 'extra' | 'item' | 'label' | 'row';
|
|
32
33
|
export interface ListProps extends Omit<ComponentProps<'ul'>, 'onClick'> {
|
|
33
34
|
activeKey?: Key | null;
|
|
34
35
|
classNames?: Partial<Record<ListSemanticName, string>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnAlign, TableCustomizeComponent } from "../type.mjs";
|
|
2
|
-
import { HTMLAttributes, ReactNode, Ref, TdHTMLAttributes } from "react";
|
|
2
|
+
import { CSSProperties, HTMLAttributes, ReactNode, Ref, TdHTMLAttributes } from "react";
|
|
3
3
|
export interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
4
4
|
align?: TableColumnAlign;
|
|
5
5
|
appendNode?: ReactNode;
|
|
@@ -28,13 +28,19 @@ export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const TableRow: ({ className, component, level, selected, ...rest }: TableRowProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
30
30
|
export interface TableExpandedRowProps {
|
|
31
|
+
/** Class name of the spanning cell. */
|
|
32
|
+
cellClassName?: string;
|
|
31
33
|
cellComponent?: TableCustomizeComponent;
|
|
34
|
+
/** Inline styles of the spanning cell. */
|
|
35
|
+
cellStyle?: CSSProperties;
|
|
32
36
|
children?: ReactNode;
|
|
33
37
|
className?: string;
|
|
34
38
|
colSpan: number;
|
|
35
39
|
component?: TableCustomizeComponent;
|
|
36
40
|
expanded?: boolean;
|
|
37
41
|
fixed?: boolean;
|
|
42
|
+
/** Inline row styles; `expanded={false}` always hides the row. */
|
|
43
|
+
style?: CSSProperties;
|
|
38
44
|
}
|
|
39
|
-
export declare const TableExpandedRow: ({ cellComponent, children, className, colSpan, component, expanded, fixed }: TableExpandedRowProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
45
|
+
export declare const TableExpandedRow: ({ cellClassName, cellComponent, cellStyle, children, className, colSpan, component, expanded, fixed, style }: TableExpandedRowProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
40
46
|
//# sourceMappingURL=cells.d.mts.map
|
package/es/Table/atoms/cells.mjs
CHANGED
|
@@ -50,12 +50,17 @@ const TableRow = ({ className, component = "tr", level, selected, ...rest }) =>
|
|
|
50
50
|
...rest,
|
|
51
51
|
className: clsx$1(level !== void 0 && `lobe-table-row`, level !== void 0 && `lobe-table-row-level-${level}`, selected && `lobe-table-row-selected`, className) || void 0
|
|
52
52
|
});
|
|
53
|
-
const TableExpandedRow = ({ cellComponent, children, className, colSpan, component = "tr", expanded = true, fixed }) => createElement(component, {
|
|
53
|
+
const TableExpandedRow = ({ cellClassName, cellComponent, cellStyle, children, className, colSpan, component = "tr", expanded = true, fixed, style }) => createElement(component, {
|
|
54
54
|
className,
|
|
55
|
-
style: {
|
|
55
|
+
style: {
|
|
56
|
+
...style,
|
|
57
|
+
display: expanded ? style?.display : "none"
|
|
58
|
+
}
|
|
56
59
|
}, /* @__PURE__ */ jsx(TableCell, {
|
|
60
|
+
className: cellClassName,
|
|
57
61
|
colSpan,
|
|
58
62
|
component: cellComponent,
|
|
63
|
+
style: cellStyle,
|
|
59
64
|
children: fixed ? /* @__PURE__ */ jsx("div", {
|
|
60
65
|
className: `${PREFIX_CLS}-expanded-row-fixed`,
|
|
61
66
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cells.mjs","names":["clsx"],"sources":["../../../src/Table/atoms/cells.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport {\n createElement,\n type CSSProperties,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n type Ref,\n type TdHTMLAttributes,\n} from 'react';\n\nimport { PREFIX_CLS } from '../constants';\nimport type { TableColumnAlign, TableCustomizeComponent } from '../type';\n\nconst CELL = `${PREFIX_CLS}-cell`;\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: TableColumnAlign;\n appendNode?: ReactNode;\n component?: TableCustomizeComponent;\n ellipsis?: boolean | { showTitle?: boolean };\n fixEnd?: number;\n fixStart?: number;\n hovered?: boolean;\n ref?: Ref<HTMLTableCellElement>;\n rowType?: 'body' | 'header';\n shadowEnd?: boolean;\n shadowStart?: boolean;\n sticky?: boolean;\n zIndex?: number;\n zIndexReverse?: number;\n}\n\nconst getEllipsisTitle = (\n ellipsis: TableCellProps['ellipsis'],\n rowType: TableCellProps['rowType'],\n children: ReactNode,\n) => {\n const config = ellipsis === true ? { showTitle: true } : ellipsis;\n if (!config || !(config.showTitle || rowType === 'header')) return undefined;\n if (typeof children === 'string' || typeof children === 'number') return String(children);\n if (isValidElement<{ children?: unknown }>(children)) {\n const inner = children.props.children;\n if (typeof inner === 'string') return inner;\n }\n return undefined;\n};\n\nexport const TableCell = ({\n align,\n appendNode,\n children,\n className,\n colSpan,\n component = 'td',\n ellipsis,\n fixEnd,\n fixStart,\n hovered,\n rowSpan,\n rowType = 'body',\n shadowEnd,\n shadowStart,\n sticky,\n style,\n title,\n zIndex,\n zIndexReverse,\n ...rest\n}: TableCellProps) => {\n const isFixStart = typeof fixStart === 'number';\n const isFixEnd = typeof fixEnd === 'number';\n const fixedStyle: CSSProperties & Record<string, unknown> = {};\n if (isFixStart) fixedStyle.insetInlineStart = fixStart;\n if (isFixEnd) fixedStyle.insetInlineEnd = fixEnd;\n if (isFixStart || isFixEnd) {\n fixedStyle['--z-offset'] = zIndex;\n fixedStyle['--z-offset-reverse'] = zIndexReverse;\n }\n const withShadow = Boolean((isFixStart && shadowStart) || (isFixEnd && shadowEnd));\n const content =\n ellipsis && withShadow ? <span className={`${CELL}-content`}>{children}</span> : children;\n\n return createElement(\n component,\n {\n ...rest,\n className: clsx(\n CELL,\n className,\n (isFixStart || isFixEnd) && `${CELL}-fix`,\n isFixStart && `${CELL}-fix-start`,\n isFixEnd && `${CELL}-fix-end`,\n isFixStart && shadowStart && `${CELL}-fix-start-shadow`,\n isFixEnd && shadowEnd && `${CELL}-fix-end-shadow`,\n ellipsis && `${CELL}-ellipsis`,\n appendNode && `${CELL}-with-append`,\n (isFixStart || isFixEnd) && sticky && `${CELL}-fix-sticky`,\n hovered && `${CELL}-row-hover`,\n ),\n colSpan: colSpan !== undefined && colSpan !== 1 ? colSpan : undefined,\n rowSpan: rowSpan !== undefined && rowSpan !== 1 ? rowSpan : undefined,\n style: { ...fixedStyle, ...(align && { textAlign: align }), ...style },\n title: title ?? getEllipsisTitle(ellipsis, rowType, children),\n },\n appendNode,\n content,\n );\n};\n\nexport const TableHeaderCell = ({ component, ...props }: TableCellProps) => (\n <TableCell rowType=\"header\" {...props} component={component ?? 'th'} />\n);\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n component?: TableCustomizeComponent;\n level?: number;\n ref?: Ref<HTMLTableRowElement>;\n selected?: boolean;\n}\n\nexport const TableRow = ({\n className,\n component = 'tr',\n level,\n selected,\n ...rest\n}: TableRowProps) =>\n createElement(component, {\n ...rest,\n className:\n clsx(\n level !== undefined && `${PREFIX_CLS}-row`,\n level !== undefined && `${PREFIX_CLS}-row-level-${level}`,\n selected && `${PREFIX_CLS}-row-selected`,\n className,\n ) || undefined,\n });\n\nexport interface TableExpandedRowProps {\n cellComponent?: TableCustomizeComponent;\n children?: ReactNode;\n className?: string;\n colSpan: number;\n component?: TableCustomizeComponent;\n expanded?: boolean;\n fixed?: boolean;\n}\n\nexport const TableExpandedRow = ({\n cellComponent,\n children,\n className,\n colSpan,\n component = 'tr',\n expanded = true,\n fixed,\n}: TableExpandedRowProps) =>\n createElement(\n component,\n { className, style: { display: expanded ?
|
|
1
|
+
{"version":3,"file":"cells.mjs","names":["clsx"],"sources":["../../../src/Table/atoms/cells.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport {\n createElement,\n type CSSProperties,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n type Ref,\n type TdHTMLAttributes,\n} from 'react';\n\nimport { PREFIX_CLS } from '../constants';\nimport type { TableColumnAlign, TableCustomizeComponent } from '../type';\n\nconst CELL = `${PREFIX_CLS}-cell`;\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: TableColumnAlign;\n appendNode?: ReactNode;\n component?: TableCustomizeComponent;\n ellipsis?: boolean | { showTitle?: boolean };\n fixEnd?: number;\n fixStart?: number;\n hovered?: boolean;\n ref?: Ref<HTMLTableCellElement>;\n rowType?: 'body' | 'header';\n shadowEnd?: boolean;\n shadowStart?: boolean;\n sticky?: boolean;\n zIndex?: number;\n zIndexReverse?: number;\n}\n\nconst getEllipsisTitle = (\n ellipsis: TableCellProps['ellipsis'],\n rowType: TableCellProps['rowType'],\n children: ReactNode,\n) => {\n const config = ellipsis === true ? { showTitle: true } : ellipsis;\n if (!config || !(config.showTitle || rowType === 'header')) return undefined;\n if (typeof children === 'string' || typeof children === 'number') return String(children);\n if (isValidElement<{ children?: unknown }>(children)) {\n const inner = children.props.children;\n if (typeof inner === 'string') return inner;\n }\n return undefined;\n};\n\nexport const TableCell = ({\n align,\n appendNode,\n children,\n className,\n colSpan,\n component = 'td',\n ellipsis,\n fixEnd,\n fixStart,\n hovered,\n rowSpan,\n rowType = 'body',\n shadowEnd,\n shadowStart,\n sticky,\n style,\n title,\n zIndex,\n zIndexReverse,\n ...rest\n}: TableCellProps) => {\n const isFixStart = typeof fixStart === 'number';\n const isFixEnd = typeof fixEnd === 'number';\n const fixedStyle: CSSProperties & Record<string, unknown> = {};\n if (isFixStart) fixedStyle.insetInlineStart = fixStart;\n if (isFixEnd) fixedStyle.insetInlineEnd = fixEnd;\n if (isFixStart || isFixEnd) {\n fixedStyle['--z-offset'] = zIndex;\n fixedStyle['--z-offset-reverse'] = zIndexReverse;\n }\n const withShadow = Boolean((isFixStart && shadowStart) || (isFixEnd && shadowEnd));\n const content =\n ellipsis && withShadow ? <span className={`${CELL}-content`}>{children}</span> : children;\n\n return createElement(\n component,\n {\n ...rest,\n className: clsx(\n CELL,\n className,\n (isFixStart || isFixEnd) && `${CELL}-fix`,\n isFixStart && `${CELL}-fix-start`,\n isFixEnd && `${CELL}-fix-end`,\n isFixStart && shadowStart && `${CELL}-fix-start-shadow`,\n isFixEnd && shadowEnd && `${CELL}-fix-end-shadow`,\n ellipsis && `${CELL}-ellipsis`,\n appendNode && `${CELL}-with-append`,\n (isFixStart || isFixEnd) && sticky && `${CELL}-fix-sticky`,\n hovered && `${CELL}-row-hover`,\n ),\n colSpan: colSpan !== undefined && colSpan !== 1 ? colSpan : undefined,\n rowSpan: rowSpan !== undefined && rowSpan !== 1 ? rowSpan : undefined,\n style: { ...fixedStyle, ...(align && { textAlign: align }), ...style },\n title: title ?? getEllipsisTitle(ellipsis, rowType, children),\n },\n appendNode,\n content,\n );\n};\n\nexport const TableHeaderCell = ({ component, ...props }: TableCellProps) => (\n <TableCell rowType=\"header\" {...props} component={component ?? 'th'} />\n);\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n component?: TableCustomizeComponent;\n level?: number;\n ref?: Ref<HTMLTableRowElement>;\n selected?: boolean;\n}\n\nexport const TableRow = ({\n className,\n component = 'tr',\n level,\n selected,\n ...rest\n}: TableRowProps) =>\n createElement(component, {\n ...rest,\n className:\n clsx(\n level !== undefined && `${PREFIX_CLS}-row`,\n level !== undefined && `${PREFIX_CLS}-row-level-${level}`,\n selected && `${PREFIX_CLS}-row-selected`,\n className,\n ) || undefined,\n });\n\nexport interface TableExpandedRowProps {\n /** Class name of the spanning cell. */\n cellClassName?: string;\n cellComponent?: TableCustomizeComponent;\n /** Inline styles of the spanning cell. */\n cellStyle?: CSSProperties;\n children?: ReactNode;\n className?: string;\n colSpan: number;\n component?: TableCustomizeComponent;\n expanded?: boolean;\n fixed?: boolean;\n /** Inline row styles; `expanded={false}` always hides the row. */\n style?: CSSProperties;\n}\n\nexport const TableExpandedRow = ({\n cellClassName,\n cellComponent,\n cellStyle,\n children,\n className,\n colSpan,\n component = 'tr',\n expanded = true,\n fixed,\n style,\n}: TableExpandedRowProps) =>\n createElement(\n component,\n { className, style: { ...style, display: expanded ? style?.display : 'none' } },\n <TableCell\n className={cellClassName}\n colSpan={colSpan}\n component={cellComponent}\n style={cellStyle}\n >\n {fixed ? (\n <div\n className={`${PREFIX_CLS}-expanded-row-fixed`}\n style={{ insetInlineStart: 0, overflow: 'hidden', position: 'sticky' }}\n >\n {children}\n </div>\n ) : (\n children\n )}\n </TableCell>,\n );\n"],"mappings":";;;;;;AAgBA,MAAM,OA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A,KAAa,YAAY,IAAI,UAAU,KAAA;EAC5D,OAAO;GAAE,GAAG;GAAY,GAAI,SAAS,EAAE,WAAW,MAAM;GAAI,GAAG;EAAM;EACrE,OAAO,SAAS,iBAAiB,UAAU,SAAS,QAAQ;CAC9D,GACA,YACA,OACF;AACF;AAEA,MAAa,mBAAmB,EAAE,WAAW,GAAG,YAC9C,oBAAC,WAAD;CAAW,SAAQ;CAAS,GAAI;CAAO,WAAW,aAAa;AAAO,CAAA;AAUxE,MAAa,YAAY,EACvB,WACA,YAAY,MACZ,OACA,UACA,GAAG,WAEH,cAAc,WAAW;CACvB,GAAG;CACH,WACEA,OACE,UAAU,KAAA,KAAa,kBACvB,UAAU,KAAA,KAAa,wBAA2B,SAClD,YAAY,2BACZ,SACF,KAAK,KAAA;AACT,CAAC;AAkBH,MAAa,oBAAoB,EAC/B,eACA,eACA,WACA,UACA,WACA,SACA,YAAY,MACZ,WAAW,MACX,OACA,YAEA,cACE,WACA;CAAE;CAAW,OAAO;EAAE,GAAG;EAAO,SAAS,WAAW,OAAO,UAAU;CAAO;AAAE,GAC9E,oBAAC,WAAD;CACE,WAAW;CACF;CACT,WAAW;CACX,OAAO;CAEN,UAAA,QACC,oBAAC,OAAD;EACE,WAAW,GAAG,WAAW;EACzB,OAAO;GAAE,kBAAkB;GAAG,UAAU;GAAU,UAAU;EAAS;EAEpE;CACE,CAAA,IAEL;AAEO,CAAA,CACb"}
|
package/es/Table/render/Body.mjs
CHANGED
|
@@ -136,10 +136,14 @@ const Body = ({ emptyNode, measure, onColumnResize, rows }) => {
|
|
|
136
136
|
renderIndex: row.renderIndex,
|
|
137
137
|
rowKey: row.key
|
|
138
138
|
}, row.key)) : /* @__PURE__ */ jsx(TableExpandedRow, {
|
|
139
|
-
|
|
139
|
+
cellClassName: semanticClassNames.body.cell,
|
|
140
|
+
cellComponent: components.bodyCell,
|
|
141
|
+
cellStyle: semanticStyles.body.cell,
|
|
142
|
+
className: clsx$1(`${prefixCls}-placeholder`, semanticClassNames.body.row),
|
|
140
143
|
colSpan: leafColumns.length,
|
|
141
144
|
component: components.bodyRow,
|
|
142
145
|
fixed: horizonScroll,
|
|
146
|
+
style: semanticStyles.body.row,
|
|
143
147
|
children: emptyNode
|
|
144
148
|
})]
|
|
145
149
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Body.mjs","names":["clsx"],"sources":["../../../src/Table/render/Body.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type Key, memo, type MouseEvent, type ReactNode, useLayoutEffect, useRef } from 'react';\n\nimport { TableBody, TableExpandedRow, TableRow } from '../atoms';\nimport type { RowModel } from '../engine/types';\nimport { useRowExpanded, useRowSelected } from '../store/hooks';\nimport type { TableRowClassName } from '../type';\nimport { BodyCell } from './BodyCell';\nimport { MeasureRowContext, useTableView, VirtualCellContext } from './context';\nimport { HeaderTitle } from './Header';\n\nexport const computeExpandedClassName = <T,>(\n className: string | TableRowClassName<T> | undefined,\n record: T,\n index: number,\n indent: number,\n) => (typeof className === 'function' ? className(record, index, indent) : (className ?? ''));\n\nexport interface BodyRowExtra {\n getHeight: (rowSpan: number) => number;\n top: number;\n}\n\nexport interface BodyRowProps<T> {\n depth: number;\n extra?: BodyRowExtra;\n hasChildren: boolean;\n index: number;\n record: T;\n renderIndex: number;\n rowKey: Key;\n}\n\nconst BodyRowInner = <T,>({\n depth,\n extra,\n hasChildren,\n index,\n record,\n renderIndex,\n rowKey,\n}: BodyRowProps<T>) => {\n const view = useTableView<T>();\n const selected = useRowSelected(rowKey);\n const expanded = useRowExpanded(rowKey);\n const expandedOnce = useRef(false);\n expandedOnce.current ||= expanded;\n\n const {\n components,\n expand,\n fixColumn,\n leafColumns,\n onRow,\n prefixCls,\n rowClassName,\n semanticClassNames,\n semanticStyles,\n } = view;\n const rowSupportExpand =\n expand.type === 'row' && (!expand.rowExpandable || expand.rowExpandable(record));\n const mergedExpandable = rowSupportExpand || expand.type === 'nest';\n const rowProps = onRow?.(record, index) ?? {};\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (expand.expandRowByClick && mergedExpandable) expand.toggle(record, event);\n rowProps.onClick?.(event);\n };\n const computedClassName =\n typeof rowClassName === 'function' ? rowClassName(record, index, depth) : rowClassName;\n const expandedClassName = computeExpandedClassName(\n expand.expandedRowClassName,\n record,\n index,\n depth,\n );\n\n let expandedRow: ReactNode = null;\n if (!extra && rowSupportExpand && (expand.forceRender || expandedOnce.current || expanded)) {\n expandedRow = (\n <TableExpandedRow\n cellComponent={components.bodyCell}\n colSpan={leafColumns.length}\n component={components.bodyRow}\n expanded={expanded}\n fixed={fixColumn}\n className={clsx(\n `${prefixCls}-expanded-row`,\n `${prefixCls}-expanded-row-level-${depth + 1}`,\n expandedClassName,\n )}\n >\n {expand.expandedRowRender?.(record, index, depth + 1, expanded)}\n </TableExpandedRow>\n );\n }\n\n const cells = leafColumns.map((leaf, colIndex) => (\n <BodyCell\n colIndex={colIndex}\n depth={depth}\n hasChildren={hasChildren}\n index={index}\n key={leaf.key}\n leaf={leaf}\n record={record}\n renderIndex={renderIndex}\n rowKey={rowKey}\n withNestIcon={expand.type === 'nest' && colIndex === expand.nestIconColumnIndex}\n />\n ));\n\n return (\n <>\n <TableRow\n {...rowProps}\n component={components.bodyRow}\n data-row-key={extra ? undefined : rowKey}\n level={depth}\n selected={selected}\n className={clsx(\n computedClassName,\n rowProps.className,\n rowProps.onClick && `${prefixCls}-row-clickable`,\n semanticClassNames.body.row,\n depth >= 1 && expandedClassName,\n extra && `${prefixCls}-row-extra`,\n )}\n style={{\n ...rowProps.style,\n ...semanticStyles.body.row,\n ...(extra && { pointerEvents: 'none', position: 'absolute', top: extra.top }),\n }}\n onClick={onClick}\n >\n {extra ? (\n <VirtualCellContext value={{ getHeight: extra.getHeight, inverse: true }}>\n {cells}\n </VirtualCellContext>\n ) : (\n cells\n )}\n </TableRow>\n {expandedRow}\n </>\n );\n};\n\nexport const BodyRow = memo(BodyRowInner) as typeof BodyRowInner;\n\nconst MeasureCell = ({\n children,\n columnKey,\n onResize,\n}: {\n children: ReactNode;\n columnKey: string;\n onResize: (key: string, width: number) => void;\n}) => {\n const ref = useRef<HTMLTableCellElement>(null);\n useLayoutEffect(() => {\n const element = ref.current;\n if (!element) return;\n onResize(columnKey, element.offsetWidth);\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => {\n if (element.offsetParent !== null) onResize(columnKey, element.offsetWidth);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [columnKey, onResize]);\n return (\n <td\n ref={ref}\n style={{ borderBottom: 0, borderTop: 0, height: 0, paddingBottom: 0, paddingTop: 0 }}\n >\n <div style={{ fontWeight: 'bold', height: 0, overflow: 'hidden' }}>{children}</div>\n </td>\n );\n};\n\nexport const MeasureRow = ({ onResize }: { onResize: (key: string, width: number) => void }) => {\n const { leafColumns, prefixCls } = useTableView();\n return (\n <MeasureRowContext value={true}>\n <tr aria-hidden=\"true\" className={`${prefixCls}-measure-row`} style={{ height: 0 }}>\n {leafColumns.map((leaf) => (\n <MeasureCell columnKey={leaf.key} key={leaf.key} onResize={onResize}>\n <HeaderTitle source={leaf.column.source} />\n </MeasureCell>\n ))}\n </tr>\n </MeasureRowContext>\n );\n};\n\nexport interface BodyProps<T> {\n emptyNode: ReactNode;\n measure: boolean;\n onColumnResize: (key: string, width: number) => void;\n rows: readonly RowModel<T>[];\n}\n\nexport const Body = <T,>({ emptyNode, measure, onColumnResize, rows }: BodyProps<T>) => {\n const { components, horizonScroll, leafColumns, prefixCls, semanticClassNames, semanticStyles } =\n useTableView<T>();\n return (\n <TableBody\n className={semanticClassNames.body.wrapper}\n component={components.bodyWrapper}\n style={semanticStyles.body.wrapper}\n >\n {measure && <MeasureRow onResize={onColumnResize} />}\n {rows.length > 0 ? (\n rows.map((row) => (\n <BodyRow\n depth={row.depth}\n hasChildren={row.hasChildren}\n index={row.index}\n key={row.key}\n record={row.record}\n renderIndex={row.renderIndex}\n rowKey={row.key}\n />\n ))\n ) : (\n <TableExpandedRow\n className={`${prefixCls}-placeholder`}\n colSpan={leafColumns.length}\n component={components.bodyRow}\n fixed={horizonScroll}\n >\n {emptyNode}\n </TableExpandedRow>\n )}\n </TableBody>\n );\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,4BACX,WACA,QACA,OACA,WACI,OAAO,cAAc,aAAa,UAAU,QAAQ,OAAO,MAAM,IAAK,aAAa;AAiBzF,MAAM,gBAAoB,EACxB,OACA,OACA,aACA,OACA,QACA,aACA,aACqB;CACrB,MAAM,OAAO,aAAgB;CAC7B,MAAM,WAAW,eAAe,MAAM;CACtC,MAAM,WAAW,eAAe,MAAM;CACtC,MAAM,eAAe,OAAO,KAAK;CACjC,aAAa,YAAY;CAEzB,MAAM,EACJ,YACA,QACA,WACA,aACA,OACA,WACA,cACA,oBACA,mBACE;CACJ,MAAM,mBACJ,OAAO,SAAS,UAAU,CAAC,OAAO,iBAAiB,OAAO,cAAc,MAAM;CAChF,MAAM,mBAAmB,oBAAoB,OAAO,SAAS;CAC7D,MAAM,WAAW,QAAQ,QAAQ,KAAK,KAAK,CAAC;CAC5C,MAAM,WAAW,UAA2C;EAC1D,IAAI,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,QAAQ,KAAK;EAC5E,SAAS,UAAU,KAAK;CAC1B;CACA,MAAM,oBACJ,OAAO,iBAAiB,aAAa,aAAa,QAAQ,OAAO,KAAK,IAAI;CAC5E,MAAM,oBAAoB,yBACxB,OAAO,sBACP,QACA,OACA,KACF;CAEA,IAAI,cAAyB;CAC7B,IAAI,CAAC,SAAS,qBAAqB,OAAO,eAAe,aAAa,WAAW,WAC/E,cACE,oBAAC,kBAAD;EACE,eAAe,WAAW;EAC1B,SAAS,YAAY;EACrB,WAAW,WAAW;EACZ;EACV,OAAO;EACP,WAAWA,OACT,GAAG,UAAU,gBACb,GAAG,UAAU,sBAAsB,QAAQ,KAC3C,iBACF;EAEC,UAAA,OAAO,oBAAoB,QAAQ,OA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x from 'clsx';\nimport { type Key, memo, type MouseEvent, type ReactNode, useLayoutEffect, useRef } from 'react';\n\nimport { TableBody, TableExpandedRow, TableRow } from '../atoms';\nimport type { RowModel } from '../engine/types';\nimport { useRowExpanded, useRowSelected } from '../store/hooks';\nimport type { TableRowClassName } from '../type';\nimport { BodyCell } from './BodyCell';\nimport { MeasureRowContext, useTableView, VirtualCellContext } from './context';\nimport { HeaderTitle } from './Header';\n\nexport const computeExpandedClassName = <T,>(\n className: string | TableRowClassName<T> | undefined,\n record: T,\n index: number,\n indent: number,\n) => (typeof className === 'function' ? className(record, index, indent) : (className ?? ''));\n\nexport interface BodyRowExtra {\n getHeight: (rowSpan: number) => number;\n top: number;\n}\n\nexport interface BodyRowProps<T> {\n depth: number;\n extra?: BodyRowExtra;\n hasChildren: boolean;\n index: number;\n record: T;\n renderIndex: number;\n rowKey: Key;\n}\n\nconst BodyRowInner = <T,>({\n depth,\n extra,\n hasChildren,\n index,\n record,\n renderIndex,\n rowKey,\n}: BodyRowProps<T>) => {\n const view = useTableView<T>();\n const selected = useRowSelected(rowKey);\n const expanded = useRowExpanded(rowKey);\n const expandedOnce = useRef(false);\n expandedOnce.current ||= expanded;\n\n const {\n components,\n expand,\n fixColumn,\n leafColumns,\n onRow,\n prefixCls,\n rowClassName,\n semanticClassNames,\n semanticStyles,\n } = view;\n const rowSupportExpand =\n expand.type === 'row' && (!expand.rowExpandable || expand.rowExpandable(record));\n const mergedExpandable = rowSupportExpand || expand.type === 'nest';\n const rowProps = onRow?.(record, index) ?? {};\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (expand.expandRowByClick && mergedExpandable) expand.toggle(record, event);\n rowProps.onClick?.(event);\n };\n const computedClassName =\n typeof rowClassName === 'function' ? rowClassName(record, index, depth) : rowClassName;\n const expandedClassName = computeExpandedClassName(\n expand.expandedRowClassName,\n record,\n index,\n depth,\n );\n\n let expandedRow: ReactNode = null;\n if (!extra && rowSupportExpand && (expand.forceRender || expandedOnce.current || expanded)) {\n expandedRow = (\n <TableExpandedRow\n cellComponent={components.bodyCell}\n colSpan={leafColumns.length}\n component={components.bodyRow}\n expanded={expanded}\n fixed={fixColumn}\n className={clsx(\n `${prefixCls}-expanded-row`,\n `${prefixCls}-expanded-row-level-${depth + 1}`,\n expandedClassName,\n )}\n >\n {expand.expandedRowRender?.(record, index, depth + 1, expanded)}\n </TableExpandedRow>\n );\n }\n\n const cells = leafColumns.map((leaf, colIndex) => (\n <BodyCell\n colIndex={colIndex}\n depth={depth}\n hasChildren={hasChildren}\n index={index}\n key={leaf.key}\n leaf={leaf}\n record={record}\n renderIndex={renderIndex}\n rowKey={rowKey}\n withNestIcon={expand.type === 'nest' && colIndex === expand.nestIconColumnIndex}\n />\n ));\n\n return (\n <>\n <TableRow\n {...rowProps}\n component={components.bodyRow}\n data-row-key={extra ? undefined : rowKey}\n level={depth}\n selected={selected}\n className={clsx(\n computedClassName,\n rowProps.className,\n rowProps.onClick && `${prefixCls}-row-clickable`,\n semanticClassNames.body.row,\n depth >= 1 && expandedClassName,\n extra && `${prefixCls}-row-extra`,\n )}\n style={{\n ...rowProps.style,\n ...semanticStyles.body.row,\n ...(extra && { pointerEvents: 'none', position: 'absolute', top: extra.top }),\n }}\n onClick={onClick}\n >\n {extra ? (\n <VirtualCellContext value={{ getHeight: extra.getHeight, inverse: true }}>\n {cells}\n </VirtualCellContext>\n ) : (\n cells\n )}\n </TableRow>\n {expandedRow}\n </>\n );\n};\n\nexport const BodyRow = memo(BodyRowInner) as typeof BodyRowInner;\n\nconst MeasureCell = ({\n children,\n columnKey,\n onResize,\n}: {\n children: ReactNode;\n columnKey: string;\n onResize: (key: string, width: number) => void;\n}) => {\n const ref = useRef<HTMLTableCellElement>(null);\n useLayoutEffect(() => {\n const element = ref.current;\n if (!element) return;\n onResize(columnKey, element.offsetWidth);\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => {\n if (element.offsetParent !== null) onResize(columnKey, element.offsetWidth);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [columnKey, onResize]);\n return (\n <td\n ref={ref}\n style={{ borderBottom: 0, borderTop: 0, height: 0, paddingBottom: 0, paddingTop: 0 }}\n >\n <div style={{ fontWeight: 'bold', height: 0, overflow: 'hidden' }}>{children}</div>\n </td>\n );\n};\n\nexport const MeasureRow = ({ onResize }: { onResize: (key: string, width: number) => void }) => {\n const { leafColumns, prefixCls } = useTableView();\n return (\n <MeasureRowContext value={true}>\n <tr aria-hidden=\"true\" className={`${prefixCls}-measure-row`} style={{ height: 0 }}>\n {leafColumns.map((leaf) => (\n <MeasureCell columnKey={leaf.key} key={leaf.key} onResize={onResize}>\n <HeaderTitle source={leaf.column.source} />\n </MeasureCell>\n ))}\n </tr>\n </MeasureRowContext>\n );\n};\n\nexport interface BodyProps<T> {\n emptyNode: ReactNode;\n measure: boolean;\n onColumnResize: (key: string, width: number) => void;\n rows: readonly RowModel<T>[];\n}\n\nexport const Body = <T,>({ emptyNode, measure, onColumnResize, rows }: BodyProps<T>) => {\n const { components, horizonScroll, leafColumns, prefixCls, semanticClassNames, semanticStyles } =\n useTableView<T>();\n return (\n <TableBody\n className={semanticClassNames.body.wrapper}\n component={components.bodyWrapper}\n style={semanticStyles.body.wrapper}\n >\n {measure && <MeasureRow onResize={onColumnResize} />}\n {rows.length > 0 ? (\n rows.map((row) => (\n <BodyRow\n depth={row.depth}\n hasChildren={row.hasChildren}\n index={row.index}\n key={row.key}\n record={row.record}\n renderIndex={row.renderIndex}\n rowKey={row.key}\n />\n ))\n ) : (\n <TableExpandedRow\n cellClassName={semanticClassNames.body.cell}\n cellComponent={components.bodyCell}\n cellStyle={semanticStyles.body.cell}\n className={clsx(`${prefixCls}-placeholder`, semanticClassNames.body.row)}\n colSpan={leafColumns.length}\n component={components.bodyRow}\n fixed={horizonScroll}\n style={semanticStyles.body.row}\n >\n {emptyNode}\n </TableExpandedRow>\n )}\n </TableBody>\n );\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa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AC9F,MAAM,EAAE,aAAa,cAAc,aAAa;CAChD,OACE,oBAAC,mBAAD;EAAmB,OAAO;EACxB,UAAA,oBAAC,MAAD;GAAI,eAAY;GAAO,WAAW,GAAG,UAAU;GAAe,OAAO,EAAE,QAAQ,EAAE;GAC9E,UAAA,YAAY,KAAK,SAChB,oBAAC,aAAD;IAAa,WAAW,KAAK;IAA8B;IACzD,UAAA,oBAAC,aAAD,EAAa,QAAQ,KAAK,OAAO,OAAS,CAAA;GAC/B,GAF0B,KAAK,GAE/B,CACd;EACC,CAAA;CACa,CAAA;AAEvB;AASA,MAAa,QAAY,EAAE,WAAW,SAAS,gBAAgB,WAAyB;CACtF,MAAM,EAAE,YAAY,eAAe,aAAa,WAAW,oBAAoB,mBAC7E,aAAgB;CAClB,OACE,qBAAC,WAAD;EACE,WAAW,mBAAmB,KAAK;EACnC,WAAW,WAAW;EACtB,OAAO,eAAe,KAAK;EAH7B,UAAA,CAKG,WAAW,oBAAC,YAAD,EAAY,UAAU,eAAiB,CAAA,GAClD,KAAK,SAAS,IACb,KAAK,KAAK,QACR,oBAAC,SAAD;GACE,OAAO,IAAI;GACX,aAAa,IAAI;GACjB,OAAO,IAAI;GAEX,QAAQ,IAAI;GACZ,aAAa,IAAI;GACjB,QAAQ,IAAI;EACb,GAJM,IAAI,GAIV,CACF,IAED,oBAAC,kBAAD;GACE,eAAe,mBAAmB,KAAK;GACvC,eAAe,WAAW;GAC1B,WAAW,eAAe,KAAK;GAC/B,WAAWA,OAAK,GAAG,UAAU,eAAe,mBAAmB,KAAK,GAAG;GACvE,SAAS,YAAY;GACrB,WAAW,WAAW;GACtB,OAAO;GACP,OAAO,eAAe,KAAK;GAE1B,UAAA;EACe,CAAA,CAEX;;AAEf"}
|
package/es/Table/type.d.mts
CHANGED
|
@@ -316,6 +316,7 @@ export type TableSemanticName = 'body' | 'content' | 'footer' | 'header' | 'pagi
|
|
|
316
316
|
* `content` the scroll box, `title` / `footer` the title and footer bars.
|
|
317
317
|
*/
|
|
318
318
|
export interface TableClassNames {
|
|
319
|
+
/** Body parts, including the placeholder row and cell in non-virtual tables. */
|
|
319
320
|
body?: Partial<Record<TableComponentsSemanticName, string>>;
|
|
320
321
|
content?: string;
|
|
321
322
|
footer?: string;
|