@elastic/eui 93.6.0 → 94.1.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.
Files changed (147) hide show
  1. package/dist/eui_theme_dark.css +0 -765
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -765
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +123 -133
  6. package/es/components/basic_table/basic_table.styles.js +3 -17
  7. package/es/components/basic_table/collapsed_item_actions.js +11 -20
  8. package/es/components/basic_table/default_item_action.js +9 -16
  9. package/es/components/basic_table/expanded_item_actions.js +1 -2
  10. package/es/components/basic_table/in_memory_table.js +63 -78
  11. package/es/components/provider/component_defaults/component_defaults.js +7 -1
  12. package/es/components/table/_table_cell_content.js +72 -0
  13. package/es/components/table/_table_cell_content.styles.js +63 -0
  14. package/es/components/table/index.js +0 -1
  15. package/es/components/table/mobile/responsive_context.js +37 -0
  16. package/es/components/table/mobile/table_header_mobile.js +11 -4
  17. package/es/components/table/mobile/table_header_mobile.styles.js +15 -0
  18. package/es/components/table/mobile/table_sort_mobile.js +12 -3
  19. package/es/components/table/table.js +23 -13
  20. package/es/components/table/table.styles.js +102 -0
  21. package/es/components/table/table_cells_shared.styles.js +52 -0
  22. package/es/components/table/table_footer_cell.js +12 -12
  23. package/es/components/table/table_header_cell.js +58 -75
  24. package/es/components/table/table_header_cell_checkbox.js +6 -2
  25. package/es/components/table/table_row.js +18 -6
  26. package/es/components/table/table_row.styles.js +78 -0
  27. package/es/components/table/table_row_cell.js +65 -91
  28. package/es/components/table/table_row_cell.styles.js +89 -0
  29. package/es/components/table/table_row_cell_checkbox.js +7 -0
  30. package/eui.d.ts +667 -510
  31. package/i18ntokens.json +52 -52
  32. package/lib/components/basic_table/basic_table.js +122 -132
  33. package/lib/components/basic_table/basic_table.styles.js +5 -20
  34. package/lib/components/basic_table/collapsed_item_actions.js +11 -20
  35. package/lib/components/basic_table/default_item_action.js +12 -17
  36. package/lib/components/basic_table/expanded_item_actions.js +1 -2
  37. package/lib/components/basic_table/in_memory_table.js +63 -78
  38. package/lib/components/provider/component_defaults/component_defaults.js +7 -1
  39. package/lib/components/table/_table_cell_content.js +82 -0
  40. package/lib/components/table/_table_cell_content.styles.js +68 -0
  41. package/lib/components/table/index.js +0 -7
  42. package/lib/components/table/mobile/responsive_context.js +47 -0
  43. package/lib/components/table/mobile/table_header_mobile.js +11 -4
  44. package/lib/components/table/mobile/table_header_mobile.styles.js +22 -0
  45. package/lib/components/table/mobile/table_sort_mobile.js +12 -3
  46. package/lib/components/table/table.js +23 -13
  47. package/lib/components/table/table.styles.js +109 -0
  48. package/lib/components/table/table_cells_shared.styles.js +58 -0
  49. package/lib/components/table/table_footer_cell.js +11 -11
  50. package/lib/components/table/table_header_cell.js +58 -75
  51. package/lib/components/table/table_header_cell_checkbox.js +6 -2
  52. package/lib/components/table/table_row.js +17 -5
  53. package/lib/components/table/table_row.styles.js +84 -0
  54. package/lib/components/table/table_row_cell.js +64 -92
  55. package/lib/components/table/table_row_cell.styles.js +94 -0
  56. package/lib/components/table/table_row_cell_checkbox.js +7 -0
  57. package/optimize/es/components/basic_table/basic_table.js +56 -59
  58. package/optimize/es/components/basic_table/basic_table.styles.js +3 -17
  59. package/optimize/es/components/basic_table/collapsed_item_actions.js +11 -20
  60. package/optimize/es/components/basic_table/default_item_action.js +9 -16
  61. package/optimize/es/components/basic_table/expanded_item_actions.js +1 -2
  62. package/optimize/es/components/basic_table/in_memory_table.js +1 -6
  63. package/optimize/es/components/table/_table_cell_content.js +56 -0
  64. package/optimize/es/components/table/_table_cell_content.styles.js +63 -0
  65. package/optimize/es/components/table/index.js +0 -1
  66. package/optimize/es/components/table/mobile/responsive_context.js +37 -0
  67. package/optimize/es/components/table/mobile/table_header_mobile.js +11 -4
  68. package/optimize/es/components/table/mobile/table_header_mobile.styles.js +15 -0
  69. package/optimize/es/components/table/mobile/table_sort_mobile.js +7 -1
  70. package/optimize/es/components/table/table.js +13 -12
  71. package/optimize/es/components/table/table.styles.js +102 -0
  72. package/optimize/es/components/table/table_cells_shared.styles.js +49 -0
  73. package/optimize/es/components/table/table_footer_cell.js +12 -12
  74. package/optimize/es/components/table/table_header_cell.js +57 -61
  75. package/optimize/es/components/table/table_header_cell_checkbox.js +6 -2
  76. package/optimize/es/components/table/table_row.js +10 -2
  77. package/optimize/es/components/table/table_row.styles.js +78 -0
  78. package/optimize/es/components/table/table_row_cell.js +49 -80
  79. package/optimize/es/components/table/table_row_cell.styles.js +89 -0
  80. package/optimize/es/components/table/table_row_cell_checkbox.js +7 -0
  81. package/optimize/lib/components/basic_table/basic_table.js +55 -58
  82. package/optimize/lib/components/basic_table/basic_table.styles.js +5 -20
  83. package/optimize/lib/components/basic_table/collapsed_item_actions.js +11 -20
  84. package/optimize/lib/components/basic_table/default_item_action.js +12 -17
  85. package/optimize/lib/components/basic_table/expanded_item_actions.js +1 -2
  86. package/optimize/lib/components/basic_table/in_memory_table.js +1 -6
  87. package/optimize/lib/components/table/_table_cell_content.js +66 -0
  88. package/optimize/lib/components/table/_table_cell_content.styles.js +68 -0
  89. package/optimize/lib/components/table/index.js +0 -7
  90. package/optimize/lib/components/table/mobile/responsive_context.js +47 -0
  91. package/optimize/lib/components/table/mobile/table_header_mobile.js +11 -4
  92. package/optimize/lib/components/table/mobile/table_header_mobile.styles.js +22 -0
  93. package/optimize/lib/components/table/mobile/table_sort_mobile.js +7 -1
  94. package/optimize/lib/components/table/table.js +13 -12
  95. package/optimize/lib/components/table/table.styles.js +109 -0
  96. package/optimize/lib/components/table/table_cells_shared.styles.js +56 -0
  97. package/optimize/lib/components/table/table_footer_cell.js +11 -11
  98. package/optimize/lib/components/table/table_header_cell.js +57 -61
  99. package/optimize/lib/components/table/table_header_cell_checkbox.js +6 -2
  100. package/optimize/lib/components/table/table_row.js +9 -1
  101. package/optimize/lib/components/table/table_row.styles.js +85 -0
  102. package/optimize/lib/components/table/table_row_cell.js +48 -82
  103. package/optimize/lib/components/table/table_row_cell.styles.js +94 -0
  104. package/optimize/lib/components/table/table_row_cell_checkbox.js +7 -0
  105. package/package.json +2 -2
  106. package/src/components/index.scss +0 -1
  107. package/test-env/components/basic_table/basic_table.js +118 -131
  108. package/test-env/components/basic_table/basic_table.styles.js +5 -20
  109. package/test-env/components/basic_table/collapsed_item_actions.js +11 -20
  110. package/test-env/components/basic_table/default_item_action.js +12 -17
  111. package/test-env/components/basic_table/expanded_item_actions.js +1 -2
  112. package/test-env/components/basic_table/in_memory_table.js +63 -78
  113. package/test-env/components/provider/component_defaults/component_defaults.js +7 -1
  114. package/test-env/components/table/_table_cell_content.js +76 -0
  115. package/test-env/components/table/_table_cell_content.styles.js +68 -0
  116. package/test-env/components/table/index.js +0 -7
  117. package/test-env/components/table/mobile/responsive_context.js +47 -0
  118. package/test-env/components/table/mobile/table_header_mobile.js +11 -4
  119. package/test-env/components/table/mobile/table_header_mobile.styles.js +22 -0
  120. package/test-env/components/table/mobile/table_sort_mobile.js +12 -3
  121. package/test-env/components/table/table.js +23 -13
  122. package/test-env/components/table/table.styles.js +109 -0
  123. package/test-env/components/table/table_cells_shared.styles.js +56 -0
  124. package/test-env/components/table/table_footer_cell.js +11 -11
  125. package/test-env/components/table/table_header_cell.js +58 -75
  126. package/test-env/components/table/table_header_cell_checkbox.js +6 -2
  127. package/test-env/components/table/table_row.js +17 -5
  128. package/test-env/components/table/table_row.styles.js +85 -0
  129. package/test-env/components/table/table_row_cell.js +59 -93
  130. package/test-env/components/table/table_row_cell.styles.js +94 -0
  131. package/test-env/components/table/table_row_cell_checkbox.js +7 -0
  132. package/es/components/table/table_header_button.js +0 -52
  133. package/lib/components/table/table_header_button.js +0 -59
  134. package/optimize/es/components/table/table_header_button.js +0 -43
  135. package/optimize/lib/components/table/table_header_button.js +0 -50
  136. package/src/components/date_picker/react-datepicker/LICENSE +0 -21
  137. package/src/components/date_picker/react-datepicker/README.md +0 -168
  138. package/src/components/table/_index.scss +0 -7
  139. package/src/components/table/_mixins.scss +0 -20
  140. package/src/components/table/_responsive.scss +0 -211
  141. package/src/components/table/_table.scss +0 -241
  142. package/src/components/table/_variables.scss +0 -17
  143. package/src/components/table/mobile/_index.scss +0 -1
  144. package/src/components/table/mobile/_mobile.scss +0 -17
  145. package/src/services/theme/README.md +0 -153
  146. package/src/test/README.md +0 -44
  147. package/test-env/components/table/table_header_button.js +0 -58
package/eui.d.ts CHANGED
@@ -3854,13 +3854,81 @@ declare module '@elastic/eui/src/components/focus_trap' {
3854
3854
  export type { EuiFocusTrapProps, FocusTarget } from '@elastic/eui/src/components/focus_trap/focus_trap';
3855
3855
  export { EuiFocusTrap } from '@elastic/eui/src/components/focus_trap/focus_trap';
3856
3856
 
3857
+ }
3858
+ declare module '@elastic/eui/src/components/table/mobile/responsive_context' {
3859
+
3860
+ import { type EuiBreakpointSize } from '@elastic/eui/src/services';
3861
+ export const DEFAULT_TABLE_BREAKPOINT: EuiBreakpointSize;
3862
+ /**
3863
+ * Used by parent/top-level table components to determine isResponsive state
3864
+ * based on the passed breakpoint
3865
+ */
3866
+ export const useIsEuiTableResponsive: (componentProp?: string | boolean | undefined) => boolean;
3867
+ /**
3868
+ * Context set by parent table components
3869
+ * Hook used by cells to fetch parent isResponsive state
3870
+ */
3871
+ export const EuiTableIsResponsiveContext: import("react").Context<boolean>;
3872
+ export const useEuiTableIsResponsive: () => boolean;
3873
+
3874
+ }
3875
+ declare module '@elastic/eui/src/components/table/table.styles' {
3876
+ import { UseEuiTheme } from '@elastic/eui/src/services';
3877
+ export const euiTableVariables: ({ euiTheme }: UseEuiTheme) => {
3878
+ cellContentPadding: string;
3879
+ compressedCellContentPadding: string;
3880
+ mobileSizes: {
3881
+ actions: {
3882
+ width: string;
3883
+ offset: string;
3884
+ };
3885
+ checkbox: {
3886
+ width: string;
3887
+ offset: string;
3888
+ };
3889
+ };
3890
+ checkboxSize: string;
3891
+ };
3892
+ export const euiTableStyles: (euiThemeContext: UseEuiTheme) => {
3893
+ euiTable: import("@emotion/utils").SerializedStyles;
3894
+ layout: {
3895
+ fixed: import("@emotion/utils").SerializedStyles;
3896
+ auto: import("@emotion/utils").SerializedStyles;
3897
+ };
3898
+ /**
3899
+ * 1. The padding on the `.euiTableCellContent` div allows the ellipsis to show if the
3900
+ * content is truncated. If the padding was on the cell, the ellipsis would be cropped.
3901
+ * 2. The `:where()` selector sets the specificity to 0, allowing consumers to more easily
3902
+ * override our CSS if needed
3903
+ */
3904
+ uncompressed: import("@emotion/utils").SerializedStyles;
3905
+ compressed: import("@emotion/utils").SerializedStyles;
3906
+ /**
3907
+ * Responsive/mobile vs desktop styles
3908
+ * Individual row/cells handle their own desktop vs mobile styles
3909
+ */
3910
+ desktop: import("@emotion/utils").SerializedStyles;
3911
+ mobile: import("@emotion/utils").SerializedStyles;
3912
+ };
3913
+ export const euiTableCaptionStyles: import("@emotion/utils").SerializedStyles;
3914
+
3857
3915
  }
3858
3916
  declare module '@elastic/eui/src/components/table/table' {
3859
3917
  import { FunctionComponent, TableHTMLAttributes } from 'react';
3918
+ import { type EuiBreakpointSize } from '@elastic/eui/src/services';
3860
3919
  import { CommonProps } from '@elastic/eui/src/components/common';
3861
3920
  export interface EuiTableProps extends CommonProps, TableHTMLAttributes<HTMLTableElement> {
3862
3921
  compressed?: boolean;
3863
- responsive?: boolean;
3922
+ /**
3923
+ * Named breakpoint. Below this size, the table will collapse
3924
+ * into responsive cards.
3925
+ *
3926
+ * Pass `false` to never collapse to a mobile view, or inversely,
3927
+ * `true` to always render mobile-friendly cards.
3928
+ *
3929
+ * @default m
3930
+ */
3931
+ responsiveBreakpoint?: EuiBreakpointSize | boolean;
3864
3932
  /**
3865
3933
  * Sets the table-layout CSS property
3866
3934
  */
@@ -3890,102 +3958,441 @@ declare module '@elastic/eui/src/components/table/utils' {
3890
3958
  export const resolveWidthAsStyle: (style?: CSSProperties, width?: string | number | undefined) => CSSProperties;
3891
3959
 
3892
3960
  }
3893
- declare module '@elastic/eui/src/components/table/table_footer_cell' {
3894
- import { FunctionComponent, TdHTMLAttributes } from 'react';
3895
- import { CommonProps } from '@elastic/eui/src/components/common';
3896
- import { HorizontalAlignment } from '@elastic/eui/src/services';
3897
- export type EuiTableFooterCellProps = CommonProps & TdHTMLAttributes<HTMLTableCellElement> & {
3898
- align?: HorizontalAlignment;
3899
- width?: string | number;
3900
- };
3901
- export const EuiTableFooterCell: FunctionComponent<EuiTableFooterCellProps>;
3961
+ declare module '@elastic/eui/src/services/canvas/canvas_text_utils' {
3962
+ import type { ExclusiveUnion } from '@elastic/eui/src/components/common';
3963
+ export type CanvasTextParams = ExclusiveUnion<{
3964
+ container: HTMLElement;
3965
+ }, {
3966
+ font: CanvasTextDrawingStyles['font'];
3967
+ }>;
3968
+ /**
3969
+ * Creates a temporary Canvas element for manipulating text & determining text width.
3970
+ *
3971
+ * To accurately measure text, canvas rendering requires either a container to
3972
+ * compute/derive font styles from, or a static font string (useful for usage
3973
+ * outside the DOM). Particular care should be applied when fallback fonts are
3974
+ * used, as more fallback fonts can lead to less precision.
3975
+ *
3976
+ * Please note that while canvas is more significantly more performant than DOM
3977
+ * measurement, there are subpixel to single digit pixel differences between
3978
+ * DOM and canvas measurement due to the different rendering engines used.
3979
+ */
3980
+ export class CanvasTextUtils {
3981
+ context: CanvasRenderingContext2D;
3982
+ currentText: string;
3983
+ constructor({ font, container }: CanvasTextParams);
3984
+ computeFontFromElement: (element: HTMLElement) => string;
3985
+ get textWidth(): number;
3986
+ setTextToCheck: (text: string) => void;
3987
+ }
3902
3988
 
3903
3989
  }
3904
- declare module '@elastic/eui/src/components/table/table_header' {
3905
- import { FunctionComponent, ReactNode, HTMLAttributes } from 'react';
3906
- import { CommonProps } from '@elastic/eui/src/components/common';
3907
- export type EuiTableHeaderProps = CommonProps & HTMLAttributes<HTMLElement> & {
3990
+ declare module '@elastic/eui/src/services/canvas' {
3991
+ export { CanvasTextUtils } from '@elastic/eui/src/services/canvas/canvas_text_utils';
3992
+ export type { CanvasTextParams } from '@elastic/eui/src/services/canvas/canvas_text_utils';
3993
+
3994
+ }
3995
+ declare module '@elastic/eui/src/components/text_truncate/utils' {
3996
+ import { CanvasTextParams, CanvasTextUtils } from '@elastic/eui/src/services/canvas'; type TruncationParams = CanvasTextParams & {
3997
+ fullText: string;
3998
+ ellipsis: string;
3999
+ availableWidth: number;
4000
+ };
4001
+ /**
4002
+ * Utilities for truncating types at various positions, as well as
4003
+ * determining whether truncation is possible or even necessary.
4004
+ */
4005
+ export class TruncationUtils extends CanvasTextUtils {
4006
+ protected fullText: TruncationParams['fullText'];
4007
+ protected ellipsis: TruncationParams['ellipsis'];
4008
+ protected availableWidth: TruncationParams['availableWidth'];
4009
+ constructor({ fullText, ellipsis, availableWidth, ...rest }: TruncationParams);
3908
4010
  /**
3909
- * Children must be valid DOM structure residing within `<thead>`.
3910
- * Use `<td> | <th>` by default, or `<tr><th/></tr>` when `wrapWithTableRow=false`
4011
+ * Performance utilities
3911
4012
  */
3912
- children?: ReactNode;
4013
+ debugPerformance: boolean;
4014
+ debugCounter: number;
4015
+ get textWidth(): number;
3913
4016
  /**
3914
- * Automatically adds a wrapping `<tr>` element around the children
4017
+ * Internal utils for calculating a ratio based on the passed available width
4018
+ * vs the full text width.
4019
+ * This ratio is used to get an initial _approximate_ text string that should
4020
+ * be slightly over the available width, which we can then remove from
4021
+ * character-by-character until the text just fits within the available width.
3915
4022
  */
3916
- wrapWithTableRow?: boolean;
3917
- };
3918
- export const EuiTableHeader: FunctionComponent<EuiTableHeaderProps>;
3919
-
3920
- }
3921
- declare module '@elastic/eui/src/components/inner_text/inner_text' {
3922
- import { FunctionComponent, ReactElement } from 'react'; type RefT = HTMLElement | Element | undefined | null;
3923
- export function useInnerText(innerTextFallback?: string): [(node: RefT) => void, string | undefined];
3924
- export interface EuiInnerTextProps {
4023
+ widthRatio: number;
4024
+ setTextWidthRatio: (text?: string, textToOffset?: string) => void;
4025
+ getTextFromRatio: (text: string, type: 'start' | 'end') => string;
3925
4026
  /**
3926
- * ReactNode to render as this component's content
4027
+ * Early return checks
3927
4028
  */
3928
- children: (ref?: (node: RefT) => void, innerText?: string) => ReactElement;
3929
- fallback?: string;
4029
+ checkIfTruncationIsNeeded: () => false | undefined;
4030
+ checkSufficientEllipsisWidth: (truncation: string) => false | undefined;
4031
+ checkTruncationOffsetWidth: (text: string) => false | undefined;
4032
+ /**
4033
+ * Truncation types logic. This is where the magic happens
4034
+ */
4035
+ truncateStart: (truncationOffset?: number | undefined) => string;
4036
+ truncateEnd: (truncationOffset?: number | undefined) => string;
4037
+ truncateStartEndAtPosition: (truncationPosition: number) => string;
4038
+ truncateStartEndAtMiddle: () => string;
4039
+ truncateMiddle: () => string;
3930
4040
  }
3931
- export const EuiInnerText: FunctionComponent<EuiInnerTextProps>;
3932
4041
  export {};
3933
4042
 
3934
4043
  }
3935
- declare module '@elastic/eui/src/components/inner_text' {
3936
- export type { EuiInnerTextProps } from '@elastic/eui/src/components/inner_text/inner_text';
3937
- export { useInnerText, EuiInnerText } from '@elastic/eui/src/components/inner_text/inner_text';
4044
+ declare module '@elastic/eui/src/components/text_truncate/text_truncate.styles' {
4045
+ export const euiTextTruncateStyles: {
4046
+ euiTextTruncate: import("@emotion/utils").SerializedStyles;
4047
+ /**
4048
+ * The below CSS is a hack to get double clicking and selecting the *full* text
4049
+ * instead of the truncated text (useful for copying/pasting, and mimics how
4050
+ * `text-overflow: ellipsis` works).
4051
+ *
4052
+ * Real talk: I'm lowkey amazed it works and it wouldn't surprise me if we ran into
4053
+ * cross-browser issues with this at some point. Hopefully CSS natively implements
4054
+ * custom text truncation some day (https://github.com/w3c/csswg-drafts/issues/3937)
4055
+ * and there'll be no need for the entire component at that point 🙏
4056
+ */
4057
+ euiTextTruncate__truncatedText: import("@emotion/utils").SerializedStyles;
4058
+ euiTextTruncate__fullText: import("@emotion/utils").SerializedStyles;
4059
+ };
3938
4060
 
3939
4061
  }
3940
- declare module '@elastic/eui/src/components/table/table_header_button' {
3941
- import { ButtonHTMLAttributes, FunctionComponent } from 'react';
3942
- import { CommonProps } from '@elastic/eui/src/components/common';
3943
- import { IconType } from '@elastic/eui/src/components/icon';
3944
- export type EuiTableHeaderButtonProps = CommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
3945
- iconType?: IconType;
4062
+ declare module '@elastic/eui/src/components/text_truncate/text_truncate' {
4063
+ import { HTMLAttributes, FunctionComponent, ReactNode } from 'react';
4064
+ import type { CommonProps } from '@elastic/eui/src/components/common'; const TRUNCATION_TYPES: readonly ["end", "start", "startEnd", "middle"];
4065
+ export type EuiTextTruncationTypes = (typeof TRUNCATION_TYPES)[number];
4066
+ export type EuiTextTruncateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onResize'> & CommonProps & {
4067
+ /**
4068
+ * The full text string to truncate
4069
+ */
4070
+ text: string;
4071
+ /**
4072
+ * The truncation type desired. Determines where the ellipses are placed.
4073
+ */
4074
+ truncation?: EuiTextTruncationTypes;
4075
+ /**
4076
+ * This prop **only** applies to the `start` and `end` truncation types.
4077
+ * It allows preserving a certain number of characters of either the
4078
+ * starting or ending text.
4079
+ *
4080
+ * If the passed offset is greater than the total text length,
4081
+ * the offset will be ignored.
4082
+ */
4083
+ truncationOffset?: number;
4084
+ /**
4085
+ * This prop **only** applies to the `startEnd` truncation type.
4086
+ * It allows customizing the anchor position of the displayed text,
4087
+ * which otherwise defaults to the middle of the text string.
4088
+ *
4089
+ * The primary use case for this prop for is search highlighting - e.g., if
4090
+ * a user searches for a specific word in the text, pass the index of that
4091
+ * found word to ensure it is always visible.
4092
+ *
4093
+ * This behavior will intelligently detect when positions are close to the start
4094
+ * or end of the text, and omit leading or trailing ellipses when necessary.
4095
+ * If the passed position is greater than the total text length,
4096
+ * the truncation will simply default to `start` instead.
4097
+ */
4098
+ truncationPosition?: number;
4099
+ /**
4100
+ * Defaults to the horizontal ellipsis character.
4101
+ * Can be optionally configured to use other punctuation,
4102
+ * e.g. spaces, brackets, hyphens, asterisks, etc.
4103
+ */
4104
+ ellipsis?: string;
4105
+ /**
4106
+ * By default, EuiTextTruncate will render a resize observer to detect the
4107
+ * available width it has. For performance reasons (e.g. multiple truncated
4108
+ * text items within the same container), you may opt to pass in your own
4109
+ * container width, which will skip initializing a resize observer.
4110
+ */
4111
+ width?: number;
4112
+ /**
4113
+ * Optional callback that fires when the default resizer observer both mounts and
4114
+ * registers a size change. This callback will **not** fire if `width` is passed.
4115
+ */
4116
+ onResize?: (width: number) => void;
4117
+ /**
4118
+ * By default, EuiTextTruncate will render the truncated string directly.
4119
+ * You can optionally pass a render prop function to the component, which
4120
+ * allows for more flexible text rendering, e.g. adding custom markup
4121
+ * or highlighting
4122
+ */
4123
+ children?: (truncatedString: string) => ReactNode;
4124
+ /**
4125
+ * For some edge case scenarios, EuiTextTruncate's calculations may be off until
4126
+ * fonts are done loading or layout is done shifting or settling. Adding a delay
4127
+ * may help resolve any rendering issues.
4128
+ */
4129
+ calculationDelayMs?: number;
3946
4130
  };
3947
- export const EuiTableHeaderButton: FunctionComponent<EuiTableHeaderButtonProps>;
4131
+ export const EuiTextTruncate: FunctionComponent<EuiTextTruncateProps>;
4132
+ export {};
3948
4133
 
3949
4134
  }
3950
- declare module '@elastic/eui/src/components/table/table_header_cell' {
3951
- import { FunctionComponent, ThHTMLAttributes } from 'react';
3952
- import { CommonProps, NoArgCallback } from '@elastic/eui/src/components/common';
3953
- import { HorizontalAlignment } from '@elastic/eui/src/services';
3954
- export type TableHeaderCellScope = 'col' | 'row' | 'colgroup' | 'rowgroup';
3955
- export type EuiTableHeaderCellProps = CommonProps & Omit<ThHTMLAttributes<HTMLTableHeaderCellElement>, 'align' | 'scope'> & {
3956
- align?: HorizontalAlignment;
3957
- isSortAscending?: boolean;
3958
- isSorted?: boolean;
4135
+ declare module '@elastic/eui/src/components/text_truncate/text_block_truncate' {
4136
+ import { FunctionComponent, HTMLAttributes, PropsWithChildren } from 'react';
4137
+ import { CommonProps } from '@elastic/eui/src/components/common';
4138
+ export type EuiTextBlockTruncateProps = PropsWithChildren & CommonProps & HTMLAttributes<HTMLDivElement> & {
3959
4139
  /**
3960
- * Mobile options for displaying differently at small screens
4140
+ * Number of lines of text to truncate to
3961
4141
  */
3962
- mobileOptions?: {
3963
- /**
3964
- * If false, will not render the column at all for mobile
3965
- */
3966
- show?: boolean;
3967
- /**
3968
- * Only show for mobile? If true, will not render the column at all
3969
- * for desktop
3970
- */
3971
- only?: boolean;
3972
- };
3973
- onSort?: NoArgCallback<void>;
3974
- scope?: TableHeaderCellScope;
3975
- width?: string | number;
3976
- description?: string;
4142
+ lines: number;
3977
4143
  /**
3978
- * Shows the sort indicator but removes the button
4144
+ * Applies styling to the child element instead of rendering a parent wrapper `div`.
4145
+ * Can only be used when wrapping a *single* child element/tag, and not raw text.
3979
4146
  */
3980
- readOnly?: boolean;
4147
+ cloneElement?: boolean;
3981
4148
  };
3982
- export const EuiTableHeaderCell: FunctionComponent<EuiTableHeaderCellProps>;
4149
+ export const EuiTextBlockTruncate: FunctionComponent<EuiTextBlockTruncateProps>;
3983
4150
 
3984
4151
  }
3985
- declare module '@elastic/eui/src/components/table/table_header_cell_checkbox' {
3986
- import { FunctionComponent, ThHTMLAttributes } from 'react';
3987
- import { CommonProps } from '@elastic/eui/src/components/common';
3988
- export type EuiTableHeaderCellCheckboxScope = 'col' | 'row' | 'colgroup' | 'rowgroup';
4152
+ declare module '@elastic/eui/src/components/text_truncate' {
4153
+ export type { EuiTextTruncateProps, EuiTextTruncationTypes, } from '@elastic/eui/src/components/text_truncate/text_truncate';
4154
+ export { EuiTextTruncate } from '@elastic/eui/src/components/text_truncate/text_truncate';
4155
+ export type { EuiTextBlockTruncateProps } from '@elastic/eui/src/components/text_truncate/text_block_truncate';
4156
+ export { EuiTextBlockTruncate } from '@elastic/eui/src/components/text_truncate/text_block_truncate';
4157
+ export { TruncationUtils } from '@elastic/eui/src/components/text_truncate/utils';
4158
+
4159
+ }
4160
+ declare module '@elastic/eui/src/components/table/table_row_cell.styles' {
4161
+ import { UseEuiTheme } from '@elastic/eui/src/services';
4162
+ export const euiTableRowCellStyles: (euiThemeContext: UseEuiTheme) => {
4163
+ euiTableRowCell: import("@emotion/utils").SerializedStyles;
4164
+ rowHeader: import("@emotion/utils").SerializedStyles;
4165
+ isExpander: import("@emotion/utils").SerializedStyles;
4166
+ hasActions: import("@emotion/utils").SerializedStyles;
4167
+ middle: import("@emotion/utils").SerializedStyles;
4168
+ baseline: import("@emotion/utils").SerializedStyles;
4169
+ top: import("@emotion/utils").SerializedStyles;
4170
+ bottom: import("@emotion/utils").SerializedStyles;
4171
+ desktop: {
4172
+ desktop: import("@emotion/utils").SerializedStyles;
4173
+ actions: import("@emotion/utils").SerializedStyles;
4174
+ };
4175
+ mobile: {
4176
+ mobile: import("@emotion/utils").SerializedStyles;
4177
+ enlarge: import("@emotion/utils").SerializedStyles;
4178
+ rightColumnContent: string;
4179
+ readonly actions: import("@emotion/utils").SerializedStyles;
4180
+ readonly expander: import("@emotion/utils").SerializedStyles;
4181
+ /**
4182
+ * Custom actions may not be icons and therefore may not fit in a column
4183
+ * If they're the last cell, we can create a pseudo "row"/"border-top"
4184
+ * that mimicks the visual separation that the right column has
4185
+ */
4186
+ customActions: import("@emotion/utils").SerializedStyles;
4187
+ };
4188
+ euiTableRowCell__mobileHeader: import("@emotion/utils").SerializedStyles;
4189
+ };
4190
+
4191
+ }
4192
+ declare module '@elastic/eui/src/components/table/table_row_cell' {
4193
+ import { CSSProperties, FunctionComponent, ReactNode, TdHTMLAttributes } from 'react';
4194
+ import { CommonProps } from '@elastic/eui/src/components/common';
4195
+ import { HorizontalAlignment } from '@elastic/eui/src/services';
4196
+ interface EuiTableRowCellSharedPropsShape {
4197
+ /**
4198
+ * Horizontal alignment of the text in the cell
4199
+ */
4200
+ align?: HorizontalAlignment;
4201
+ /**
4202
+ * Creates a text wrapper around cell content that helps word break or truncate
4203
+ * long text correctly.
4204
+ * @default true
4205
+ */
4206
+ textOnly?: boolean;
4207
+ /**
4208
+ * Indicates whether this column should truncate overflowing text content.
4209
+ * - Set to `true` to enable single-line truncation.
4210
+ * - To enable multi-line truncation, use a configuration object with `lines`
4211
+ * set to a number of lines to truncate to.
4212
+ * @default false
4213
+ */
4214
+ truncateText?: boolean | {
4215
+ lines: number;
4216
+ };
4217
+ width?: CSSProperties['width'];
4218
+ }
4219
+ export interface EuiTableRowCellMobileOptionsShape extends EuiTableRowCellSharedPropsShape {
4220
+ /**
4221
+ * If false, will not render the cell at all for mobile
4222
+ * @default true
4223
+ */
4224
+ show?: boolean;
4225
+ /**
4226
+ * Only show for mobile? If true, will not render the column at all for desktop
4227
+ * @default false
4228
+ */
4229
+ only?: boolean;
4230
+ /**
4231
+ * Custom render/children if different from desktop
4232
+ */
4233
+ render?: ReactNode;
4234
+ /**
4235
+ * The column's header for use in mobile view (automatically passed down
4236
+ * when using `EuiBasicTable`).
4237
+ * Or pass `false` to not show a header at all.
4238
+ */
4239
+ header?: ReactNode | boolean;
4240
+ /**
4241
+ * Increase text size compared to rest of cells
4242
+ * @default false
4243
+ */
4244
+ enlarge?: boolean;
4245
+ /**
4246
+ * Applies the value to the width of the cell in mobile view (typically 50%)
4247
+ * @default 50%
4248
+ */
4249
+ width?: CSSProperties['width'];
4250
+ }
4251
+ export interface EuiTableRowCellProps extends EuiTableRowCellSharedPropsShape {
4252
+ /**
4253
+ * Vertical alignment of the content in the cell
4254
+ */
4255
+ valign?: TdHTMLAttributes<HTMLTableCellElement>['valign'];
4256
+ /**
4257
+ * Indicates whether the cell should be marked as the heading for its row
4258
+ */
4259
+ setScopeRow?: boolean;
4260
+ /**
4261
+ * Indicates if the cell is dedicated to row actions
4262
+ * (used for mobile styling and desktop action hover behavior)
4263
+ */
4264
+ hasActions?: boolean | 'custom';
4265
+ /**
4266
+ * Indicates if the column is dedicated as the expandable row toggle
4267
+ */
4268
+ isExpander?: boolean;
4269
+ /**
4270
+ * Mobile options for displaying differently at small screens;
4271
+ * See #EuiTableRowCellMobileOptionsShape
4272
+ */
4273
+ mobileOptions?: EuiTableRowCellMobileOptionsShape;
4274
+ } type Props = CommonProps & Omit<TdHTMLAttributes<HTMLTableCellElement>, 'valign'> & EuiTableRowCellProps;
4275
+ export const EuiTableRowCell: FunctionComponent<Props>;
4276
+ export {};
4277
+
4278
+ }
4279
+ declare module '@elastic/eui/src/components/table/_table_cell_content.styles' {
4280
+ import { UseEuiTheme } from '@elastic/eui/src/services';
4281
+ export const euiTableCellContentStyles: ({ euiTheme }: UseEuiTheme) => {
4282
+ euiTableCellContent: import("@emotion/utils").SerializedStyles;
4283
+ left: null;
4284
+ right: import("@emotion/utils").SerializedStyles;
4285
+ center: import("@emotion/utils").SerializedStyles;
4286
+ truncateText: import("@emotion/utils").SerializedStyles;
4287
+ wrapText: import("@emotion/utils").SerializedStyles;
4288
+ hasActions: {
4289
+ actions: import("@emotion/utils").SerializedStyles;
4290
+ desktop: import("@emotion/utils").SerializedStyles;
4291
+ mobile: import("@emotion/utils").SerializedStyles;
4292
+ };
4293
+ };
4294
+
4295
+ }
4296
+ declare module '@elastic/eui/src/components/table/_table_cell_content' {
4297
+ import { FunctionComponent, HTMLAttributes } from 'react';
4298
+ import { CommonProps } from '@elastic/eui/src/components/common';
4299
+ import type { EuiTableRowCellProps } from '@elastic/eui/src/components/table/table_row_cell';
4300
+ export type EuiTableCellContentProps = CommonProps & HTMLAttributes<HTMLDivElement> & Pick<EuiTableRowCellProps, 'align' | 'hasActions' | 'textOnly'> & {
4301
+ truncateText?: EuiTableRowCellProps['truncateText'] | null;
4302
+ };
4303
+ export const EuiTableCellContent: FunctionComponent<EuiTableCellContentProps>;
4304
+
4305
+ }
4306
+ declare module '@elastic/eui/src/components/table/table_cells_shared.styles' {
4307
+ import { UseEuiTheme } from '@elastic/eui/src/services';
4308
+ export const euiTableHeaderFooterCellStyles: (euiThemeContext: UseEuiTheme) => {
4309
+ euiTableHeaderCell: import("@emotion/utils").SerializedStyles;
4310
+ euiTableHeaderCell__content: import("@emotion/utils").SerializedStyles;
4311
+ euiTableHeaderCell__button: import("@emotion/utils").SerializedStyles;
4312
+ euiTableFooterCell: import("@emotion/utils").SerializedStyles;
4313
+ };
4314
+ export const euiTableCellCheckboxStyles: (euiThemeContext: UseEuiTheme) => {
4315
+ euiTableHeaderCellCheckbox: import("@emotion/utils").SerializedStyles;
4316
+ euiTableRowCellCheckbox: import("@emotion/utils").SerializedStyles;
4317
+ desktop: import("@emotion/utils").SerializedStyles;
4318
+ mobile: import("@emotion/utils").SerializedStyles;
4319
+ };
4320
+
4321
+ }
4322
+ declare module '@elastic/eui/src/components/table/table_footer_cell' {
4323
+ import { FunctionComponent, TdHTMLAttributes } from 'react';
4324
+ import { HorizontalAlignment } from '@elastic/eui/src/services';
4325
+ import { CommonProps } from '@elastic/eui/src/components/common';
4326
+ export type EuiTableFooterCellProps = CommonProps & TdHTMLAttributes<HTMLTableCellElement> & {
4327
+ align?: HorizontalAlignment;
4328
+ width?: string | number;
4329
+ };
4330
+ export const EuiTableFooterCell: FunctionComponent<EuiTableFooterCellProps>;
4331
+
4332
+ }
4333
+ declare module '@elastic/eui/src/components/table/table_header' {
4334
+ import { FunctionComponent, ReactNode, HTMLAttributes } from 'react';
4335
+ import { CommonProps } from '@elastic/eui/src/components/common';
4336
+ export type EuiTableHeaderProps = CommonProps & HTMLAttributes<HTMLElement> & {
4337
+ /**
4338
+ * Children must be valid DOM structure residing within `<thead>`.
4339
+ * Use `<td> | <th>` by default, or `<tr><th/></tr>` when `wrapWithTableRow=false`
4340
+ */
4341
+ children?: ReactNode;
4342
+ /**
4343
+ * Automatically adds a wrapping `<tr>` element around the children
4344
+ */
4345
+ wrapWithTableRow?: boolean;
4346
+ };
4347
+ export const EuiTableHeader: FunctionComponent<EuiTableHeaderProps>;
4348
+
4349
+ }
4350
+ declare module '@elastic/eui/src/components/inner_text/inner_text' {
4351
+ import { FunctionComponent, ReactElement } from 'react'; type RefT = HTMLElement | Element | undefined | null;
4352
+ export function useInnerText(innerTextFallback?: string): [(node: RefT) => void, string | undefined];
4353
+ export interface EuiInnerTextProps {
4354
+ /**
4355
+ * ReactNode to render as this component's content
4356
+ */
4357
+ children: (ref?: (node: RefT) => void, innerText?: string) => ReactElement;
4358
+ fallback?: string;
4359
+ }
4360
+ export const EuiInnerText: FunctionComponent<EuiInnerTextProps>;
4361
+ export {};
4362
+
4363
+ }
4364
+ declare module '@elastic/eui/src/components/inner_text' {
4365
+ export type { EuiInnerTextProps } from '@elastic/eui/src/components/inner_text/inner_text';
4366
+ export { useInnerText, EuiInnerText } from '@elastic/eui/src/components/inner_text/inner_text';
4367
+
4368
+ }
4369
+ declare module '@elastic/eui/src/components/table/table_header_cell' {
4370
+ import { FunctionComponent, ThHTMLAttributes } from 'react';
4371
+ import { HorizontalAlignment } from '@elastic/eui/src/services';
4372
+ import { CommonProps, NoArgCallback } from '@elastic/eui/src/components/common';
4373
+ import type { EuiTableRowCellMobileOptionsShape } from '@elastic/eui/src/components/table/table_row_cell';
4374
+ export type TableHeaderCellScope = 'col' | 'row' | 'colgroup' | 'rowgroup';
4375
+ export type EuiTableHeaderCellProps = CommonProps & Omit<ThHTMLAttributes<HTMLTableHeaderCellElement>, 'align' | 'scope'> & {
4376
+ align?: HorizontalAlignment;
4377
+ isSortAscending?: boolean;
4378
+ isSorted?: boolean;
4379
+ mobileOptions?: Pick<EuiTableRowCellMobileOptionsShape, 'only' | 'show'>;
4380
+ onSort?: NoArgCallback<void>;
4381
+ scope?: TableHeaderCellScope;
4382
+ width?: string | number;
4383
+ description?: string;
4384
+ /**
4385
+ * Shows the sort indicator but removes the button
4386
+ */
4387
+ readOnly?: boolean;
4388
+ };
4389
+ export const EuiTableHeaderCell: FunctionComponent<EuiTableHeaderCellProps>;
4390
+
4391
+ }
4392
+ declare module '@elastic/eui/src/components/table/table_header_cell_checkbox' {
4393
+ import { FunctionComponent, ThHTMLAttributes } from 'react';
4394
+ import { CommonProps } from '@elastic/eui/src/components/common';
4395
+ export type EuiTableHeaderCellCheckboxScope = 'col' | 'row' | 'colgroup' | 'rowgroup';
3989
4396
  export interface EuiTableHeaderCellCheckboxProps {
3990
4397
  width?: string | number;
3991
4398
  scope?: EuiTableHeaderCellCheckboxScope;
@@ -5219,410 +5626,174 @@ declare module '@elastic/eui/src/components/table/table_pagination/table_paginat
5219
5626
  *
5220
5627
  * @default true
5221
5628
  */
5222
- showPerPageOptions?: boolean;
5223
- /**
5224
- * Current selection for "Rows per page".
5225
- * Pass `0` to display the selected "Show all" option and hide the pagination.
5226
- *
5227
- * @default 10
5228
- */
5229
- itemsPerPage?: number;
5230
- /**
5231
- * Custom array of options for "Rows per page".
5232
- * Pass `0` as one of the options to create a "Show all" option.
5233
- *
5234
- * @default [10, 25, 50]
5235
- */
5236
- itemsPerPageOptions?: number[];
5237
- /**
5238
- * Click handler that passes back selected `pageSize` number
5239
- */
5240
- onChangeItemsPerPage?: ItemsPerPageChangeHandler;
5241
- onChangePage?: PageChangeHandler;
5242
- /**
5243
- * Requires the `id` of the table being controlled
5244
- */
5245
- 'aria-controls'?: string;
5246
- 'aria-label'?: string;
5247
- }
5248
- export const EuiTablePagination: FunctionComponent<EuiTablePaginationProps>;
5249
-
5250
- }
5251
- declare module '@elastic/eui/src/components/table/table_pagination' {
5252
- export type { EuiTablePaginationProps } from '@elastic/eui/src/components/table/table_pagination/table_pagination';
5253
- export { EuiTablePagination } from '@elastic/eui/src/components/table/table_pagination/table_pagination';
5254
- export { useEuiTablePaginationDefaults, euiTablePaginationDefaults, } from '@elastic/eui/src/components/table/table_pagination/table_pagination_defaults';
5255
-
5256
- }
5257
- declare module '@elastic/eui/src/components/table/mobile/table_header_mobile' {
5258
- import { FunctionComponent, HTMLAttributes } from 'react';
5259
- import { CommonProps } from '@elastic/eui/src/components/common';
5260
- export const EuiTableHeaderMobile: FunctionComponent<CommonProps & HTMLAttributes<HTMLDivElement>>;
5261
-
5262
- }
5263
- declare module '@elastic/eui/src/components/table/mobile/table_sort_mobile_item' {
5264
- import { FunctionComponent, PropsWithChildren } from 'react';
5265
- import { CommonProps } from '@elastic/eui/src/components/common';
5266
- export interface EuiTableSortMobileItemProps extends PropsWithChildren, CommonProps {
5267
- /**
5268
- * Callback to know when an item has been clicked
5269
- */
5270
- onSort?: () => void;
5271
- /**
5272
- * Indicates current option is the sorted on column
5273
- */
5274
- isSorted?: boolean;
5275
- /**
5276
- * Indicates which direction the current column is sorted on
5277
- */
5278
- isSortAscending?: boolean;
5279
- ariaLabel?: string;
5280
- }
5281
- export const EuiTableSortMobileItem: FunctionComponent<EuiTableSortMobileItemProps>;
5282
-
5283
- }
5284
- declare module '@elastic/eui/src/components/table/mobile/table_sort_mobile' {
5285
- import React, { Component, ReactNode, Key } from 'react';
5286
- import { PopoverAnchorPosition } from '@elastic/eui/src/components/popover';
5287
- interface ItemProps {
5288
- name: ReactNode;
5289
- key?: Key;
5290
- onSort?: () => void;
5291
- isSorted?: boolean;
5292
- isSortAscending?: boolean;
5293
- }
5294
- export interface EuiTableSortMobileProps {
5295
- className?: string;
5296
- anchorPosition?: PopoverAnchorPosition;
5297
- items?: ItemProps[];
5298
- }
5299
- interface State {
5300
- isPopoverOpen: boolean;
5301
- }
5302
- export class EuiTableSortMobile extends Component<EuiTableSortMobileProps, State> {
5303
- state: {
5304
- isPopoverOpen: boolean;
5305
- };
5306
- onButtonClick: () => void;
5307
- closePopover: () => void;
5308
- render(): React.JSX.Element;
5309
- }
5310
- export {};
5311
-
5312
- }
5313
- declare module '@elastic/eui/src/components/table/table_row' {
5314
- import { FunctionComponent, HTMLAttributes, KeyboardEventHandler, MouseEventHandler } from 'react';
5315
- import { CommonProps } from '@elastic/eui/src/components/common';
5316
- export interface EuiTableRowProps {
5317
- /**
5318
- * Indicates if the table has a single column of checkboxes for selecting
5319
- * rows (affects mobile only)
5320
- */
5321
- isSelectable?: boolean;
5322
- /**
5323
- * Indicates the current row has been selected
5324
- */
5325
- isSelected?: boolean;
5326
- /**
5327
- * Indicates if the table has a dedicated column for icon-only actions
5328
- * (affects mobile only)
5329
- */
5330
- hasActions?: boolean;
5331
- /**
5332
- * Indicates if the row will have an expanded row
5333
- */
5334
- isExpandable?: boolean;
5335
- /**
5336
- * Indicates if the row will be the expanded row
5337
- */
5338
- isExpandedRow?: boolean;
5339
- onClick?: MouseEventHandler<HTMLTableRowElement> & KeyboardEventHandler<HTMLTableRowElement>;
5340
- } type Props = CommonProps & HTMLAttributes<HTMLTableRowElement> & EuiTableRowProps;
5341
- export const EuiTableRow: FunctionComponent<Props>;
5342
- export {};
5343
-
5344
- }
5345
- declare module '@elastic/eui/src/services/canvas/canvas_text_utils' {
5346
- import type { ExclusiveUnion } from '@elastic/eui/src/components/common';
5347
- export type CanvasTextParams = ExclusiveUnion<{
5348
- container: HTMLElement;
5349
- }, {
5350
- font: CanvasTextDrawingStyles['font'];
5351
- }>;
5352
- /**
5353
- * Creates a temporary Canvas element for manipulating text & determining text width.
5354
- *
5355
- * To accurately measure text, canvas rendering requires either a container to
5356
- * compute/derive font styles from, or a static font string (useful for usage
5357
- * outside the DOM). Particular care should be applied when fallback fonts are
5358
- * used, as more fallback fonts can lead to less precision.
5359
- *
5360
- * Please note that while canvas is more significantly more performant than DOM
5361
- * measurement, there are subpixel to single digit pixel differences between
5362
- * DOM and canvas measurement due to the different rendering engines used.
5363
- */
5364
- export class CanvasTextUtils {
5365
- context: CanvasRenderingContext2D;
5366
- currentText: string;
5367
- constructor({ font, container }: CanvasTextParams);
5368
- computeFontFromElement: (element: HTMLElement) => string;
5369
- get textWidth(): number;
5370
- setTextToCheck: (text: string) => void;
5371
- }
5372
-
5373
- }
5374
- declare module '@elastic/eui/src/services/canvas' {
5375
- export { CanvasTextUtils } from '@elastic/eui/src/services/canvas/canvas_text_utils';
5376
- export type { CanvasTextParams } from '@elastic/eui/src/services/canvas/canvas_text_utils';
5377
-
5378
- }
5379
- declare module '@elastic/eui/src/components/text_truncate/utils' {
5380
- import { CanvasTextParams, CanvasTextUtils } from '@elastic/eui/src/services/canvas'; type TruncationParams = CanvasTextParams & {
5381
- fullText: string;
5382
- ellipsis: string;
5383
- availableWidth: number;
5384
- };
5385
- /**
5386
- * Utilities for truncating types at various positions, as well as
5387
- * determining whether truncation is possible or even necessary.
5388
- */
5389
- export class TruncationUtils extends CanvasTextUtils {
5390
- protected fullText: TruncationParams['fullText'];
5391
- protected ellipsis: TruncationParams['ellipsis'];
5392
- protected availableWidth: TruncationParams['availableWidth'];
5393
- constructor({ fullText, ellipsis, availableWidth, ...rest }: TruncationParams);
5394
- /**
5395
- * Performance utilities
5396
- */
5397
- debugPerformance: boolean;
5398
- debugCounter: number;
5399
- get textWidth(): number;
5400
- /**
5401
- * Internal utils for calculating a ratio based on the passed available width
5402
- * vs the full text width.
5403
- * This ratio is used to get an initial _approximate_ text string that should
5404
- * be slightly over the available width, which we can then remove from
5405
- * character-by-character until the text just fits within the available width.
5406
- */
5407
- widthRatio: number;
5408
- setTextWidthRatio: (text?: string, textToOffset?: string) => void;
5409
- getTextFromRatio: (text: string, type: 'start' | 'end') => string;
5410
- /**
5411
- * Early return checks
5412
- */
5413
- checkIfTruncationIsNeeded: () => false | undefined;
5414
- checkSufficientEllipsisWidth: (truncation: string) => false | undefined;
5415
- checkTruncationOffsetWidth: (text: string) => false | undefined;
5416
- /**
5417
- * Truncation types logic. This is where the magic happens
5418
- */
5419
- truncateStart: (truncationOffset?: number | undefined) => string;
5420
- truncateEnd: (truncationOffset?: number | undefined) => string;
5421
- truncateStartEndAtPosition: (truncationPosition: number) => string;
5422
- truncateStartEndAtMiddle: () => string;
5423
- truncateMiddle: () => string;
5424
- }
5425
- export {};
5426
-
5427
- }
5428
- declare module '@elastic/eui/src/components/text_truncate/text_truncate.styles' {
5429
- export const euiTextTruncateStyles: {
5430
- euiTextTruncate: import("@emotion/utils").SerializedStyles;
5431
- /**
5432
- * The below CSS is a hack to get double clicking and selecting the *full* text
5433
- * instead of the truncated text (useful for copying/pasting, and mimics how
5434
- * `text-overflow: ellipsis` works).
5435
- *
5436
- * Real talk: I'm lowkey amazed it works and it wouldn't surprise me if we ran into
5437
- * cross-browser issues with this at some point. Hopefully CSS natively implements
5438
- * custom text truncation some day (https://github.com/w3c/csswg-drafts/issues/3937)
5439
- * and there'll be no need for the entire component at that point 🙏
5440
- */
5441
- euiTextTruncate__truncatedText: import("@emotion/utils").SerializedStyles;
5442
- euiTextTruncate__fullText: import("@emotion/utils").SerializedStyles;
5443
- };
5444
-
5445
- }
5446
- declare module '@elastic/eui/src/components/text_truncate/text_truncate' {
5447
- import { HTMLAttributes, FunctionComponent, ReactNode } from 'react';
5448
- import type { CommonProps } from '@elastic/eui/src/components/common'; const TRUNCATION_TYPES: readonly ["end", "start", "startEnd", "middle"];
5449
- export type EuiTextTruncationTypes = (typeof TRUNCATION_TYPES)[number];
5450
- export type EuiTextTruncateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onResize'> & CommonProps & {
5451
- /**
5452
- * The full text string to truncate
5453
- */
5454
- text: string;
5455
- /**
5456
- * The truncation type desired. Determines where the ellipses are placed.
5457
- */
5458
- truncation?: EuiTextTruncationTypes;
5459
- /**
5460
- * This prop **only** applies to the `start` and `end` truncation types.
5461
- * It allows preserving a certain number of characters of either the
5462
- * starting or ending text.
5463
- *
5464
- * If the passed offset is greater than the total text length,
5465
- * the offset will be ignored.
5466
- */
5467
- truncationOffset?: number;
5468
- /**
5469
- * This prop **only** applies to the `startEnd` truncation type.
5470
- * It allows customizing the anchor position of the displayed text,
5471
- * which otherwise defaults to the middle of the text string.
5472
- *
5473
- * The primary use case for this prop for is search highlighting - e.g., if
5474
- * a user searches for a specific word in the text, pass the index of that
5475
- * found word to ensure it is always visible.
5476
- *
5477
- * This behavior will intelligently detect when positions are close to the start
5478
- * or end of the text, and omit leading or trailing ellipses when necessary.
5479
- * If the passed position is greater than the total text length,
5480
- * the truncation will simply default to `start` instead.
5481
- */
5482
- truncationPosition?: number;
5483
- /**
5484
- * Defaults to the horizontal ellipsis character.
5485
- * Can be optionally configured to use other punctuation,
5486
- * e.g. spaces, brackets, hyphens, asterisks, etc.
5487
- */
5488
- ellipsis?: string;
5489
- /**
5490
- * By default, EuiTextTruncate will render a resize observer to detect the
5491
- * available width it has. For performance reasons (e.g. multiple truncated
5492
- * text items within the same container), you may opt to pass in your own
5493
- * container width, which will skip initializing a resize observer.
5494
- */
5495
- width?: number;
5496
- /**
5497
- * Optional callback that fires when the default resizer observer both mounts and
5498
- * registers a size change. This callback will **not** fire if `width` is passed.
5499
- */
5500
- onResize?: (width: number) => void;
5629
+ showPerPageOptions?: boolean;
5501
5630
  /**
5502
- * By default, EuiTextTruncate will render the truncated string directly.
5503
- * You can optionally pass a render prop function to the component, which
5504
- * allows for more flexible text rendering, e.g. adding custom markup
5505
- * or highlighting
5631
+ * Current selection for "Rows per page".
5632
+ * Pass `0` to display the selected "Show all" option and hide the pagination.
5633
+ *
5634
+ * @default 10
5506
5635
  */
5507
- children?: (truncatedString: string) => ReactNode;
5636
+ itemsPerPage?: number;
5508
5637
  /**
5509
- * For some edge case scenarios, EuiTextTruncate's calculations may be off until
5510
- * fonts are done loading or layout is done shifting or settling. Adding a delay
5511
- * may help resolve any rendering issues.
5638
+ * Custom array of options for "Rows per page".
5639
+ * Pass `0` as one of the options to create a "Show all" option.
5640
+ *
5641
+ * @default [10, 25, 50]
5512
5642
  */
5513
- calculationDelayMs?: number;
5514
- };
5515
- export const EuiTextTruncate: FunctionComponent<EuiTextTruncateProps>;
5516
- export {};
5517
-
5518
- }
5519
- declare module '@elastic/eui/src/components/text_truncate/text_block_truncate' {
5520
- import { FunctionComponent, HTMLAttributes, PropsWithChildren } from 'react';
5521
- import { CommonProps } from '@elastic/eui/src/components/common';
5522
- export type EuiTextBlockTruncateProps = PropsWithChildren & CommonProps & HTMLAttributes<HTMLDivElement> & {
5643
+ itemsPerPageOptions?: number[];
5523
5644
  /**
5524
- * Number of lines of text to truncate to
5645
+ * Click handler that passes back selected `pageSize` number
5525
5646
  */
5526
- lines: number;
5647
+ onChangeItemsPerPage?: ItemsPerPageChangeHandler;
5648
+ onChangePage?: PageChangeHandler;
5527
5649
  /**
5528
- * Applies styling to the child element instead of rendering a parent wrapper `div`.
5529
- * Can only be used when wrapping a *single* child element/tag, and not raw text.
5650
+ * Requires the `id` of the table being controlled
5530
5651
  */
5531
- cloneElement?: boolean;
5652
+ 'aria-controls'?: string;
5653
+ 'aria-label'?: string;
5654
+ }
5655
+ export const EuiTablePagination: FunctionComponent<EuiTablePaginationProps>;
5656
+
5657
+ }
5658
+ declare module '@elastic/eui/src/components/table/table_pagination' {
5659
+ export type { EuiTablePaginationProps } from '@elastic/eui/src/components/table/table_pagination/table_pagination';
5660
+ export { EuiTablePagination } from '@elastic/eui/src/components/table/table_pagination/table_pagination';
5661
+ export { useEuiTablePaginationDefaults, euiTablePaginationDefaults, } from '@elastic/eui/src/components/table/table_pagination/table_pagination_defaults';
5662
+
5663
+ }
5664
+ declare module '@elastic/eui/src/components/table/mobile/table_header_mobile.styles' {
5665
+ import { UseEuiTheme } from '@elastic/eui/src/services';
5666
+ export const euiTableHeaderMobileStyles: ({ euiTheme }: UseEuiTheme) => {
5667
+ euiTableHeaderMobile: import("@emotion/utils").SerializedStyles;
5532
5668
  };
5533
- export const EuiTextBlockTruncate: FunctionComponent<EuiTextBlockTruncateProps>;
5534
5669
 
5535
5670
  }
5536
- declare module '@elastic/eui/src/components/text_truncate' {
5537
- export type { EuiTextTruncateProps, EuiTextTruncationTypes, } from '@elastic/eui/src/components/text_truncate/text_truncate';
5538
- export { EuiTextTruncate } from '@elastic/eui/src/components/text_truncate/text_truncate';
5539
- export type { EuiTextBlockTruncateProps } from '@elastic/eui/src/components/text_truncate/text_block_truncate';
5540
- export { EuiTextBlockTruncate } from '@elastic/eui/src/components/text_truncate/text_block_truncate';
5541
- export { TruncationUtils } from '@elastic/eui/src/components/text_truncate/utils';
5671
+ declare module '@elastic/eui/src/components/table/mobile/table_header_mobile' {
5672
+ import { FunctionComponent, HTMLAttributes } from 'react';
5673
+ import { CommonProps } from '@elastic/eui/src/components/common';
5674
+ import type { EuiTableProps } from '@elastic/eui/src/components/table/table';
5675
+ export const EuiTableHeaderMobile: FunctionComponent<CommonProps & HTMLAttributes<HTMLDivElement> & Pick<EuiTableProps, 'responsiveBreakpoint'>>;
5542
5676
 
5543
5677
  }
5544
- declare module '@elastic/eui/src/components/table/table_row_cell' {
5545
- import { CSSProperties, FunctionComponent, ReactNode, TdHTMLAttributes } from 'react';
5678
+ declare module '@elastic/eui/src/components/table/mobile/table_sort_mobile_item' {
5679
+ import { FunctionComponent, PropsWithChildren } from 'react';
5546
5680
  import { CommonProps } from '@elastic/eui/src/components/common';
5547
- import { HorizontalAlignment } from '@elastic/eui/src/services';
5548
- interface EuiTableRowCellSharedPropsShape {
5549
- /**
5550
- * Horizontal alignment of the text in the cell
5551
- */
5552
- align?: HorizontalAlignment;
5681
+ export interface EuiTableSortMobileItemProps extends PropsWithChildren, CommonProps {
5553
5682
  /**
5554
- * _Should only be used for action cells_
5683
+ * Callback to know when an item has been clicked
5555
5684
  */
5556
- showOnHover?: boolean;
5685
+ onSort?: () => void;
5557
5686
  /**
5558
- * Creates a text wrapper around cell content that helps word break or truncate
5559
- * long text correctly.
5687
+ * Indicates current option is the sorted on column
5560
5688
  */
5561
- textOnly?: boolean;
5689
+ isSorted?: boolean;
5562
5690
  /**
5563
- * Indicates whether this column should truncate overflowing text content.
5564
- * - Set to `true` to enable single-line truncation.
5565
- * - To enable multi-line truncation, use a configuration object with `lines`
5566
- * set to a number of lines to truncate to.
5691
+ * Indicates which direction the current column is sorted on
5567
5692
  */
5568
- truncateText?: boolean | {
5569
- lines: number;
5693
+ isSortAscending?: boolean;
5694
+ ariaLabel?: string;
5695
+ }
5696
+ export const EuiTableSortMobileItem: FunctionComponent<EuiTableSortMobileItemProps>;
5697
+
5698
+ }
5699
+ declare module '@elastic/eui/src/components/table/mobile/table_sort_mobile' {
5700
+ import React, { Component, ReactNode, Key } from 'react';
5701
+ import { CommonProps } from '@elastic/eui/src/components/common';
5702
+ import { PopoverAnchorPosition } from '@elastic/eui/src/components/popover';
5703
+ interface ItemProps {
5704
+ name: ReactNode;
5705
+ key?: Key;
5706
+ onSort?: () => void;
5707
+ isSorted?: boolean;
5708
+ isSortAscending?: boolean;
5709
+ }
5710
+ export interface EuiTableSortMobileProps extends CommonProps {
5711
+ anchorPosition?: PopoverAnchorPosition;
5712
+ items?: ItemProps[];
5713
+ }
5714
+ interface State {
5715
+ isPopoverOpen: boolean;
5716
+ }
5717
+ export class EuiTableSortMobile extends Component<EuiTableSortMobileProps, State> {
5718
+ state: {
5719
+ isPopoverOpen: boolean;
5570
5720
  };
5571
- width?: CSSProperties['width'];
5721
+ onButtonClick: () => void;
5722
+ closePopover: () => void;
5723
+ euiTableSortMobileStyles: {
5724
+ marginInlineStart: string;
5725
+ label: string;
5726
+ };
5727
+ render(): React.JSX.Element;
5572
5728
  }
5573
- export interface EuiTableRowCellMobileOptionsShape extends EuiTableRowCellSharedPropsShape {
5574
- /**
5575
- * If false, will not render the cell at all for mobile
5576
- */
5577
- show?: boolean;
5578
- /**
5579
- * Only show for mobile? If true, will not render the column at all for desktop
5580
- */
5581
- only?: boolean;
5582
- /**
5583
- * Custom render/children if different from desktop
5584
- */
5585
- render?: ReactNode;
5586
- /**
5587
- * The column's header for use in mobile view (automatically passed down
5588
- * when using `EuiBasicTable`).
5589
- * Or pass `false` to not show a header at all.
5590
- */
5591
- header?: ReactNode | boolean;
5592
- /**
5593
- * Increase text size compared to rest of cells
5594
- */
5595
- enlarge?: boolean;
5729
+ export {};
5730
+
5731
+ }
5732
+ declare module '@elastic/eui/src/components/table/table_row.styles' {
5733
+ import { UseEuiTheme } from '@elastic/eui/src/services';
5734
+ export const euiTableRowStyles: (euiThemeContext: UseEuiTheme) => {
5735
+ euiTableRow: import("@emotion/utils").SerializedStyles;
5736
+ desktop: {
5737
+ desktop: import("@emotion/utils").SerializedStyles;
5738
+ expanded: import("@emotion/utils").SerializedStyles;
5739
+ clickable: import("@emotion/utils").SerializedStyles;
5740
+ selected: import("@emotion/utils").SerializedStyles;
5741
+ checkboxOffset: import("@emotion/utils").SerializedStyles;
5742
+ };
5743
+ mobile: {
5744
+ mobile: import("@emotion/utils").SerializedStyles;
5745
+ selected: import("@emotion/utils").SerializedStyles;
5746
+ /**
5747
+ * Left column offset (no border)
5748
+ * Used for selection checkbox, which will be absolutely positioned
5749
+ */
5750
+ hasLeftColumn: import("@emotion/utils").SerializedStyles;
5751
+ /**
5752
+ * Right column styles + border
5753
+ * Used for cell actions and row expander arrow
5754
+ */
5755
+ hasRightColumn: import("@emotion/utils").SerializedStyles;
5756
+ /**
5757
+ * Bottom of card - expanded rows
5758
+ */
5759
+ expanded: import("@emotion/utils").SerializedStyles;
5760
+ };
5761
+ };
5762
+
5763
+ }
5764
+ declare module '@elastic/eui/src/components/table/table_row' {
5765
+ import { FunctionComponent, HTMLAttributes, KeyboardEventHandler, MouseEventHandler } from 'react';
5766
+ import { CommonProps } from '@elastic/eui/src/components/common';
5767
+ export interface EuiTableRowProps {
5596
5768
  /**
5597
- * Applies the value to the width of the cell in mobile view (typically 50%)
5769
+ * Indicates if the table has a single column of checkboxes for selecting
5770
+ * rows (used for mobile styling)
5598
5771
  */
5599
- width?: CSSProperties['width'];
5600
- }
5601
- export interface EuiTableRowCellProps extends EuiTableRowCellSharedPropsShape {
5772
+ hasSelection?: boolean;
5602
5773
  /**
5603
- * Vertical alignment of the content in the cell
5774
+ * Indicates that the current row's checkbox is selectable / not disabled
5604
5775
  */
5605
- valign?: TdHTMLAttributes<HTMLTableCellElement>['valign'];
5776
+ isSelectable?: boolean;
5606
5777
  /**
5607
- * Indicates whether the cell should be marked as the heading for its row
5778
+ * Indicates the current row has been selected
5608
5779
  */
5609
- setScopeRow?: boolean;
5780
+ isSelected?: boolean;
5610
5781
  /**
5611
- * Indicates if the column is dedicated to icon-only actions (currently
5612
- * affects mobile only)
5782
+ * Indicates if the table has a dedicated column for actions
5783
+ * (used for mobile styling and desktop action hover behavior)
5613
5784
  */
5614
- hasActions?: boolean;
5785
+ hasActions?: boolean | 'custom';
5615
5786
  /**
5616
- * Indicates if the column is dedicated as the expandable row toggle
5787
+ * Indicates if the row will have an expanded row
5617
5788
  */
5618
- isExpander?: boolean;
5789
+ isExpandable?: boolean;
5619
5790
  /**
5620
- * Mobile options for displaying differently at small screens;
5621
- * See #EuiTableRowCellMobileOptionsShape
5791
+ * Indicates if the row will be the expanded row
5622
5792
  */
5623
- mobileOptions?: EuiTableRowCellMobileOptionsShape;
5624
- } type Props = CommonProps & Omit<TdHTMLAttributes<HTMLTableCellElement>, 'valign'> & EuiTableRowCellProps;
5625
- export const EuiTableRowCell: FunctionComponent<Props>;
5793
+ isExpandedRow?: boolean;
5794
+ onClick?: MouseEventHandler<HTMLTableRowElement> & KeyboardEventHandler<HTMLTableRowElement>;
5795
+ } type Props = CommonProps & HTMLAttributes<HTMLTableRowElement> & EuiTableRowProps;
5796
+ export const EuiTableRow: FunctionComponent<Props>;
5626
5797
  export {};
5627
5798
 
5628
5799
  }
@@ -5642,8 +5813,6 @@ declare module '@elastic/eui/src/components/table' {
5642
5813
  export { EuiTableFooterCell } from '@elastic/eui/src/components/table/table_footer_cell';
5643
5814
  export type { EuiTableHeaderProps } from '@elastic/eui/src/components/table/table_header';
5644
5815
  export { EuiTableHeader } from '@elastic/eui/src/components/table/table_header';
5645
- export type { EuiTableHeaderButtonProps } from '@elastic/eui/src/components/table/table_header_button';
5646
- export { EuiTableHeaderButton } from '@elastic/eui/src/components/table/table_header_button';
5647
5816
  export type { EuiTableHeaderCellProps } from '@elastic/eui/src/components/table/table_header_cell';
5648
5817
  export { EuiTableHeaderCell } from '@elastic/eui/src/components/table/table_header_cell';
5649
5818
  export type { EuiTableHeaderCellCheckboxProps } from '@elastic/eui/src/components/table/table_header_cell_checkbox';
@@ -5666,7 +5835,7 @@ declare module '@elastic/eui/src/components/provider/component_defaults/componen
5666
5835
  import React, { FunctionComponent, PropsWithChildren } from 'react';
5667
5836
  import type { EuiPortalProps } from '@elastic/eui/src/components/portal';
5668
5837
  import type { EuiFocusTrapProps } from '@elastic/eui/src/components/focus_trap';
5669
- import type { EuiTablePaginationProps } from '@elastic/eui/src/components/table';
5838
+ import type { EuiTablePaginationProps, EuiTableProps } from '@elastic/eui/src/components/table';
5670
5839
  export type EuiComponentDefaults = {
5671
5840
  /**
5672
5841
  * Provide a global configuration for EuiPortal's default insertion position.
@@ -5683,6 +5852,12 @@ declare module '@elastic/eui/src/components/provider/component_defaults/componen
5683
5852
  * These defaults will be inherited all table and grid components that utilize EuiTablePagination.
5684
5853
  */
5685
5854
  EuiTablePagination?: Pick<EuiTablePaginationProps, 'itemsPerPage' | 'itemsPerPageOptions' | 'showPerPageOptions'>;
5855
+ /**
5856
+ * Provide a global configuration for EuiTable's `responsiveBreakpoint` prop. Defaults to `'s'`.
5857
+ *
5858
+ * Defaults will be inherited by all `EuiBasicTable`s and `EuiInMemoryTable`s.
5859
+ */
5860
+ EuiTable?: Pick<EuiTableProps, 'responsiveBreakpoint'>;
5686
5861
  };
5687
5862
  export const EuiComponentDefaultsContext: React.Context<EuiComponentDefaults>;
5688
5863
  export type EuiComponentDefaultsProviderProps = PropsWithChildren & {
@@ -22464,7 +22639,7 @@ declare module '@elastic/eui/src/components/tour' {
22464
22639
 
22465
22640
  }
22466
22641
  declare module '@elastic/eui/src/components/basic_table/action_types' {
22467
- import { ReactElement, ReactNode } from 'react';
22642
+ import { ReactElement, ReactNode, MouseEvent } from 'react';
22468
22643
  import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
22469
22644
  import { EuiButtonIconProps } from '@elastic/eui/src/components/button/button_icon/button_icon';
22470
22645
  import { EuiButtonEmptyProps } from '@elastic/eui/src/components/button/button_empty';
@@ -22479,9 +22654,11 @@ declare module '@elastic/eui/src/components/basic_table/action_types' {
22479
22654
  */
22480
22655
  description: string | ((item: T) => string);
22481
22656
  /**
22482
- * A handler function to execute the action
22657
+ * A handler function to execute the action. Passes back the current row
22658
+ * item as the first argument, and the originating React click event
22659
+ * as a second argument.
22483
22660
  */
22484
- onClick?: (item: T) => void;
22661
+ onClick?: (item: T, event: MouseEvent) => void;
22485
22662
  href?: string | ((item: T) => string);
22486
22663
  target?: string;
22487
22664
  /**
@@ -22492,8 +22669,21 @@ declare module '@elastic/eui/src/components/basic_table/action_types' {
22492
22669
  * A callback function that determines whether the action is enabled
22493
22670
  */
22494
22671
  enabled?: (item: T) => boolean;
22495
- isPrimary?: boolean;
22496
22672
  'data-test-subj'?: string | ((item: T) => string);
22673
+ /**
22674
+ * If more than 3 actions are passed, 2 primary actions will show (on hover)
22675
+ * next to an expansion menu of all actions.
22676
+ *
22677
+ * On mobile, primary actions will be tucked away in the expansion menu for space.
22678
+ */
22679
+ isPrimary?: boolean;
22680
+ /**
22681
+ * Allows only showing the action on mouse hover or keyboard focus.
22682
+ * If more than 3 actions are passed, this will always be true for `isPrimary` actions.
22683
+ *
22684
+ * Has no effect on mobile, or if `hasActions` is not set.
22685
+ */
22686
+ showOnHover?: boolean;
22497
22687
  }
22498
22688
  export interface DefaultItemEmptyButtonAction<T extends object> extends DefaultItemActionBase<T> {
22499
22689
  /**
@@ -22514,7 +22704,7 @@ declare module '@elastic/eui/src/components/basic_table/action_types' {
22514
22704
  color?: EuiButtonIconProps['color'] | EuiButtonIconColorFunction<T>;
22515
22705
  }
22516
22706
  export type DefaultItemAction<T extends object> = ExclusiveUnion<DefaultItemEmptyButtonAction<T>, DefaultItemIconButtonAction<T>>;
22517
- export interface CustomItemAction<T> {
22707
+ export type CustomItemAction<T> = {
22518
22708
  /**
22519
22709
  * Allows rendering a totally custom action
22520
22710
  */
@@ -22527,8 +22717,7 @@ declare module '@elastic/eui/src/components/basic_table/action_types' {
22527
22717
  * A callback that defines whether the action is enabled
22528
22718
  */
22529
22719
  enabled?: (item: T) => boolean;
22530
- isPrimary?: boolean;
22531
- }
22720
+ } & Pick<DefaultItemActionBase<{}>, 'isPrimary' | 'showOnHover'>;
22532
22721
  export type Action<T extends object> = DefaultItemAction<T> | CustomItemAction<T>;
22533
22722
  export const isCustomItemAction: <T extends object>(action: (import ("@elastic/eui/src/components/common").DisambiguateSet<DefaultItemEmptyButtonAction<T>, DefaultItemIconButtonAction<T>> & DefaultItemIconButtonAction<T>) | (import ("@elastic/eui/src/components/common").DisambiguateSet<DefaultItemIconButtonAction<T>, DefaultItemEmptyButtonAction<T>> & DefaultItemEmptyButtonAction<T>) | CustomItemAction<T>) => action is CustomItemAction<T>;
22534
22723
  export const callWithItemIfFunction: <T>(item: T) => <U>(prop: U | ((item: T) => U)) => U;
@@ -22596,7 +22785,7 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22596
22785
  items: T[];
22597
22786
  pagination?: Pagination;
22598
22787
  }
22599
- export interface EuiTableFieldDataColumnType<T> extends CommonProps, TdHTMLAttributes<HTMLTableDataCellElement> {
22788
+ export interface EuiTableFieldDataColumnType<T> extends CommonProps, Omit<TdHTMLAttributes<HTMLTableCellElement>, 'width' | 'align'> {
22600
22789
  /**
22601
22790
  * A field of the item (may be a nested field)
22602
22791
  */
@@ -22621,16 +22810,22 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22621
22810
  * Defines whether the user can sort on this column. If a function is provided, this function returns the value to sort against
22622
22811
  */
22623
22812
  sortable?: boolean | ((item: T) => Primitive);
22624
- isExpander?: boolean;
22625
22813
  /**
22626
- * Creates a text wrapper around cell content that helps word break or truncate
22627
- * long text correctly.
22814
+ * Disables the user's ability to change the sort, but will still
22815
+ * show the current sort direction in the column header
22628
22816
  */
22629
- textOnly?: boolean;
22817
+ readOnly?: boolean;
22630
22818
  /**
22631
22819
  * Defines the horizontal alignment of the column
22820
+ * @default left
22632
22821
  */
22633
22822
  align?: HorizontalAlignment;
22823
+ /**
22824
+ * Creates a text wrapper around cell content that helps word break or truncate
22825
+ * long text correctly.
22826
+ * @default true
22827
+ */
22828
+ textOnly?: boolean;
22634
22829
  /**
22635
22830
  * Indicates whether this column should truncate overflowing text content.
22636
22831
  * - Set to `true` to enable single-line truncation.
@@ -22638,6 +22833,10 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22638
22833
  * set to a number of lines to truncate to.
22639
22834
  */
22640
22835
  truncateText?: EuiTableRowCellProps['truncateText'];
22836
+ /**
22837
+ * Allows configuring custom render options or appearances for column cells
22838
+ * when the table responsively collapses into a mobile-friendly view
22839
+ */
22641
22840
  mobileOptions?: Omit<EuiTableRowCellMobileOptionsShape, 'render'> & {
22642
22841
  render?: (item: T) => ReactNode;
22643
22842
  };
@@ -22650,11 +22849,12 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22650
22849
  */
22651
22850
  footer?: string | ReactElement | ((props: EuiTableFooterProps<T>) => ReactNode);
22652
22851
  /**
22653
- * Disables the user's ability to change the sort but still shows the current direction
22852
+ * If passing `itemIdToExpandedRowMap` to your table, set this flag to `true`
22853
+ * for the custom column or cell used to toggle the expanded row.
22654
22854
  */
22655
- readOnly?: boolean;
22855
+ isExpander?: boolean;
22656
22856
  }
22657
- export interface EuiTableComputedColumnType<T> extends CommonProps, TdHTMLAttributes<HTMLTableDataCellElement> {
22857
+ export type EuiTableComputedColumnType<T> = CommonProps & Omit<TdHTMLAttributes<HTMLTableCellElement>, 'width' | 'align'> & {
22658
22858
  /**
22659
22859
  * A function that computes the value for each item and renders it
22660
22860
  */
@@ -22663,30 +22863,12 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22663
22863
  * The display name of the column
22664
22864
  */
22665
22865
  name?: ReactNode;
22666
- /**
22667
- * A description of the column (will be presented as a title over the column header
22668
- */
22669
- description?: string;
22670
22866
  /**
22671
22867
  * If provided, allows this column to be sorted on. Must return the value to sort against.
22672
22868
  */
22673
22869
  sortable?: (item: T) => Primitive;
22674
- /**
22675
- * A CSS width property. Hints for the required width of the column
22676
- */
22677
- width?: string;
22678
- /**
22679
- * Indicates whether this column should truncate its content when it doesn't fit
22680
- */
22681
- truncateText?: boolean;
22682
- isExpander?: boolean;
22683
- align?: HorizontalAlignment;
22684
- /**
22685
- * Disables the user's ability to change the sort but still shows the current direction
22686
- */
22687
- readOnly?: boolean;
22688
- }
22689
- export interface EuiTableActionsColumnType<T extends object> {
22870
+ } & Pick<EuiTableFieldDataColumnType<T>, 'readOnly' | 'description' | 'width' | 'align' | 'truncateText' | 'isExpander'>;
22871
+ export type EuiTableActionsColumnType<T extends object> = {
22690
22872
  /**
22691
22873
  * An array of one of the objects: #DefaultItemAction or #CustomItemAction
22692
22874
  */
@@ -22695,15 +22877,7 @@ declare module '@elastic/eui/src/components/basic_table/table_types' {
22695
22877
  * The display name of the column
22696
22878
  */
22697
22879
  name?: ReactNode;
22698
- /**
22699
- * A description of the column (will be presented as a title over the column header
22700
- */
22701
- description?: string;
22702
- /**
22703
- * A CSS width property. Hints for the required width of the column
22704
- */
22705
- width?: string;
22706
- }
22880
+ } & Pick<EuiTableFieldDataColumnType<T>, 'description' | 'width'>;
22707
22881
  export interface EuiTableSortingType<T> {
22708
22882
  /**
22709
22883
  * Indicates the property/field to sort on
@@ -22812,8 +22986,7 @@ declare module '@elastic/eui/src/components/basic_table/expanded_item_actions' {
22812
22986
  declare module '@elastic/eui/src/components/basic_table/basic_table.styles' {
22813
22987
  import { UseEuiTheme } from '@elastic/eui/src/services';
22814
22988
  export const euiBasicTableBodyLoading: ({ euiTheme }: UseEuiTheme) => import("@emotion/utils").SerializedStyles;
22815
- export const safariLoadingWorkaround: () => import("@emotion/utils").SerializedStyles;
22816
- export const euiBasicTableActionsWrapper: import("@emotion/utils").SerializedStyles;
22989
+ export const safariLoadingWorkaround: import("@emotion/utils").SerializedStyles;
22817
22990
 
22818
22991
  }
22819
22992
  declare module '@elastic/eui/src/components/basic_table/basic_table' {
@@ -22886,9 +23059,6 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
22886
23059
  * Indicates which column should be used as the identifying cell in each row. Should match a "field" prop in FieldDataColumn
22887
23060
  */
22888
23061
  rowHeader?: string;
22889
- hasActions?: boolean;
22890
- isExpandable?: boolean;
22891
- isSelectable?: boolean;
22892
23062
  /**
22893
23063
  * Provides an infinite loading indicator
22894
23064
  */
@@ -22905,10 +23075,6 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
22905
23075
  * Configures #Pagination
22906
23076
  */
22907
23077
  pagination?: undefined;
22908
- /**
22909
- * If true, will convert table to cards in mobile view
22910
- */
22911
- responsive?: boolean;
22912
23078
  /**
22913
23079
  * Applied to `EuiTableRow`
22914
23080
  */
@@ -22925,13 +23091,6 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
22925
23091
  * Sets the table-layout CSS property. Note that auto tableLayout prevents truncateText from working properly.
22926
23092
  */
22927
23093
  tableLayout?: 'fixed' | 'auto';
22928
- /**
22929
- * Applied to table cells. Any cell using a render function will set this to be false.
22930
- *
22931
- * Creates a text wrapper around cell content that helps word break or truncate
22932
- * long text correctly.
22933
- */
22934
- textOnly?: boolean;
22935
23094
  } type BasicTableWithPaginationProps<T extends object> = Omit<BasicTableProps<T>, 'pagination' | 'onChange'> & {
22936
23095
  pagination: Pagination;
22937
23096
  onChange?: (criteria: CriteriaWithPagination<T>) => void;
@@ -22945,7 +23104,6 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
22945
23104
  static contextType: React.Context<import ("@elastic/eui/src/components/provider/component_defaults").EuiComponentDefaults>;
22946
23105
  context: ContextType<typeof EuiComponentDefaultsContext>;
22947
23106
  static defaultProps: {
22948
- responsive: boolean;
22949
23107
  tableLayout: string;
22950
23108
  noItemsMessage: React.JSX.Element;
22951
23109
  };
@@ -22977,8 +23135,8 @@ declare module '@elastic/eui/src/components/basic_table/basic_table' {
22977
23135
  renderErrorMessage(error: string): React.JSX.Element;
22978
23136
  renderEmptyMessage(): React.JSX.Element;
22979
23137
  renderItemRow(item: T, rowIndex: number): React.JSX.Element;
22980
- renderItemSelectionCell(itemId: ItemId<T>, item: T, selected: boolean): React.JSX.Element;
22981
- renderItemActionsCell(itemId: ItemIdResolved, item: T, column: EuiTableActionsColumnType<T>, columnIndex: number): React.JSX.Element;
23138
+ renderItemSelectionCell(itemId: ItemId<T>, item: T, selected: boolean): (boolean | React.JSX.Element | undefined)[];
23139
+ renderItemActionsCell(itemId: ItemIdResolved, item: T, column: EuiTableActionsColumnType<T>, columnIndex: number, hasCustomActions: boolean): React.JSX.Element;
22982
23140
  renderItemFieldDataCell(itemId: ItemId<T>, item: T, column: EuiTableFieldDataColumnType<T>, columnIndex: number, setScopeRow: boolean): React.JSX.Element;
22983
23141
  renderItemComputedCell(itemId: ItemId<T>, item: T, column: EuiTableComputedColumnType<T>, columnIndex: number): React.JSX.Element;
22984
23142
  renderItemCell(item: T, column: EuiBasicTableColumn<T>, key: string | number, content: ReactNode, setScopeRow: boolean): React.JSX.Element;
@@ -23094,7 +23252,6 @@ declare module '@elastic/eui/src/components/basic_table/in_memory_table' {
23094
23252
  export class EuiInMemoryTable<T extends object = object> extends Component<EuiInMemoryTableProps<T>, State<T>> {
23095
23253
  static contextType: React.Context<EuiComponentDefaults>;
23096
23254
  static defaultProps: {
23097
- responsive: boolean;
23098
23255
  tableLayout: string;
23099
23256
  searchFormat: string;
23100
23257
  };