{"version":3,"file":"constants.mjs","sources":["../../../../../src/components/Table/TableNG/constants.ts"],"sourcesContent":["/** Column width and sizing configuration */\nexport const COLUMN = {\n  DEFAULT_WIDTH: 150,\n  EXPANDER_WIDTH: 36,\n  // This will need to eventually change to 36\n  MIN_WIDTH: 50,\n  // Upper bound for a content-aware auto-sized column before we grow it to fill the panel.\n  // Keeps one long value (e.g. a JSON blob) from consuming the whole table width.\n  MAX_AUTO_WIDTH: 400,\n  // Content-aware width for image columns. Images scale to the cell (object-fit: contain), so a\n  // wide column is mostly whitespace — a small default reads better than the graphical default.\n  IMAGE_WIDTH: 72,\n};\n\n/** Table layout and display constants */\nexport const TABLE = {\n  MAX_WRAP_TEXT_LENGTH: 10_000,\n  CELL_PADDING: 6,\n  FRAME_BORDER_WIDTH: 1,\n  LINE_HEIGHT: 22,\n  /**\n   * The header label's own line box, which is shorter than a body row's `LINE_HEIGHT`. Kept here\n   * because two places have to agree on it: the label's `line-height` in `HeaderCell`, and\n   * `useHeaderHeight`, which multiplies it by the wrapped line count to size the header row.\n   */\n  HEADER_LINE_HEIGHT: 20,\n  MAX_CELL_HEIGHT: 48,\n  PAGINATION_LIMIT: 750,\n  SCROLL_BAR_WIDTH: 8,\n  SCROLL_BAR_MARGIN: 2,\n  HEADER_HEIGHT: 34,\n  NESTED_NO_DATA_HEIGHT: 60,\n  BORDER_RIGHT: 1,\n  SCROLLBAR_AFFORDANCE: 16,\n  // Bounds on a JSON cell expanded by hover. Unlike a long string, a JSON blob can be hundreds of\n  // lines and thousands of columns wide, so an unbounded expansion escapes the panel and puts the\n  // content out of reach again. Capping the width lets `pre-wrap` wrap instead of growing, and the\n  // height cap keeps the overlay scrollable in place; the inspector remains the full-value view.\n  JSON_OVERFLOW_MAX_WIDTH: 600,\n  JSON_OVERFLOW_MAX_HEIGHT: '40vh',\n};\n\n/**\n * Horizontal chrome around a cell's content: left + right padding plus the right border. Subtract\n * from a column's pixel width to get its usable content width, or add to size a column to content.\n */\nexport const CELL_HORIZONTAL_CHROME = TABLE.CELL_PADDING * 2 + TABLE.BORDER_RIGHT;\n\n/** Block-axis space around a nested table. */\nexport const NESTED_TABLE_VERTICAL_PADDING = TABLE.CELL_PADDING * 2;\nexport const REFRESHED_NESTED_TABLE_VERTICAL_PADDING = TABLE.CELL_PADDING * 4;\n\n/**\n * Marker classes stamped onto the first and last columns once the final column list is assembled.\n * CSS can't find those columns on its own: `:first-child`/`:last-child` match the first and last\n * *rendered* cells, and react-data-grid drops off-screen columns from the DOM, so they stop being\n * the edge columns as soon as the grid scrolls horizontally.\n */\nexport const FIRST_COLUMN_CLASS = 'table-ng-first-col';\nexport const LAST_COLUMN_CLASS = 'table-ng-last-col';\nexport const NESTED_LAST_ROW_CLASS = 'table-ng-row-nested-last';\nexport const OVERFLOW_CELL_CLASS = 'table-ng-cell-overflow';\n\n// Marks a row that carries a zebra stripe, and one that is a nested table's container rather than\n// a row of data. Both are applied through `rowClass` - see `makeStripedRowClass`.\nexport const STRIPED_ROW_CLASS = 'table-ng-row-striped';\nexport const NESTED_ROW_CLASS = 'table-ng-row-nested';\n\n// Distance from a panel's content edge to the start of its title text: PanelChrome's header\n// container padding (theme.spacing(1)) plus the title's own inline-start padding (x0_5).\nconst PANEL_TITLE_INSET = 12;\n\n/**\n * Extra inline-start padding the first column takes when the surrounding panel renders without\n * padding of its own (see the `noPanelPadding` prop). The table then sits flush against the panel\n * edge, which would leave the first column's content 6px in while the panel title sits at 12px —\n * this makes up the difference so the two line up.\n */\nexport const FIRST_COLUMN_EXTRA_PADDING = PANEL_TITLE_INSET - TABLE.CELL_PADDING;\n\n/**\n * The pagination row's own height. Hand-measured rather than a token: it comes out of the\n * `size=\"sm\"` Pagination buttons (24px) plus the 5px bottom margin on the list items that hold\n * them, rounded up to a whole pixel.\n */\nconst PAGINATION_ROW_HEIGHT = 30;\n\n/** Gap between the grid and the pagination controls, and below them when they need one. */\nexport const PAGINATION_MARGIN = 8;\n\n/**\n * Vertical space the pagination controls take under the grid: the row itself, the margin above it,\n * and a matching margin below it only when the panel has dropped its own padding (`noPanelPadding`)\n * and so has none of its own left to sit on.\n *\n * One helper because three places have to agree on the number — `paginationContainer`'s margins,\n * the grid's `blockSize` reservation, and `usePaginatedRows`, which subtracts it from the panel\n * height before working out how many rows fit on a page. Those were three separate numbers derived\n * three different ways, and they no longer added up: the grid reserved 38px against a 37px chrome,\n * so the grid plus the controls overflowed the panel.\n */\nexport const getPaginationChromeHeight = (noPanelPadding = false): number =>\n  PAGINATION_ROW_HEIGHT + PAGINATION_MARGIN * (noPanelPadding ? 2 : 1);\n\n// Duration of the post-reorder highlight.\nexport const COLUMN_SETTLE_MS = 280;\n\n// Space a single header affordance icon (filter / sort / type) reserves next to the label. Sized to\n// the widest of them — the sort arrow, rendered at Icon size \"lg\" (18px) — plus the flex gap, so a\n// filterable or sorted column doesn't ellipsize its title once its icon appears.\nconst HEADER_ICON_WIDTH = 18;\nconst HEADER_ICON_GAP = 4;\nexport const HEADER_ICON_SPACE = HEADER_ICON_WIDTH + HEADER_ICON_GAP;\n\n// Space one of the header's IconButtons reserves. They need their own measurement rather than\n// reusing HEADER_ICON_SPACE: a size=\"sm\" IconButton is a 14px glyph plus the 4px trailing margin the\n// component sets on itself, where the icons above are bare `Icon`s. Keep in step with the `size`\n// props at the call sites — changing one without this silently mis-sizes auto columns.\nconst HEADER_ICON_BUTTON_WIDTH = 14 + 4;\nconst HEADER_ICON_BUTTON_SPACE = HEADER_ICON_BUTTON_WIDTH + HEADER_ICON_GAP;\n\n// The `table.refresh` column menu, which replaces the classic header's inline filter icon. It stays\n// in flow while hover-hidden (it fades with opacity rather than unmounting), so this reserves the\n// same space whether or not it happens to be visible.\nexport const HEADER_MENU_SPACE = HEADER_ICON_BUTTON_SPACE;\n\n// The info button a column with `headerTooltip` set renders next to its label. Always in flow, and\n// in both the classic and refreshed headers.\nexport const HEADER_TOOLTIP_SPACE = HEADER_ICON_BUTTON_SPACE;\n\n// How far the grid has to be scrollable in a direction before that edge's scroll shadow appears\n// (see useScrollShadows). Sub-pixel scroll heights are common — fractional row heights, zoom levels\n// — and at 0 they left a shadow permanently half-lit on a table that doesn't actually scroll.\nexport const SCROLL_SHADOW_THRESHOLD = 1;\n// Reserve the hover-only drag handle so the label does not shift when it appears.\nexport const HEADER_DRAG_HANDLE_WIDTH = 16;\nexport const HEADER_DRAG_HANDLE_SPACE = HEADER_DRAG_HANDLE_WIDTH + HEADER_ICON_GAP;\n"],"names":[],"mappings":";AACO,MAAM,MAAA,GAAS;AAAA,EACpB,aAAA,EAAe,GAAA;AAAA,EACf,cAAA,EAAgB,EAAA;AAAA;AAAA,EAEhB,SAAA,EAAW,EAAA;AAAA;AAAA;AAAA,EAGX,cAAA,EAAgB,GAAA;AAAA;AAAA;AAAA,EAGhB,WAAA,EAAa;AACf;AAGO,MAAM,KAAA,GAAQ;AAAA,EACnB,oBAAA,EAAsB,GAAA;AAAA,EACtB,YAAA,EAAc,CAAA;AAAA,EACd,kBAAA,EAAoB,CAAA;AAAA,EACpB,WAAA,EAAa,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMb,kBAAA,EAAoB,EAAA;AAAA,EACpB,eAAA,EAAiB,EAAA;AAAA,EACjB,gBAAA,EAAkB,GAAA;AAAA,EAClB,gBAAA,EAAkB,CAAA;AAAA,EAClB,iBAAA,EAAmB,CAAA;AAAA,EACnB,aAAA,EAAe,EAAA;AAAA,EACf,qBAAA,EAAuB,EAAA;AAAA,EACvB,YAAA,EAAc,CAAA;AAAA,EACd,oBAAA,EAAsB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,uBAAA,EAAyB,GAAA;AAAA,EACzB,wBAAA,EAA0B;AAC5B;AAMO,MAAM,sBAAA,GAAyB,KAAA,CAAM,YAAA,GAAe,CAAA,GAAI,KAAA,CAAM;AAG9D,MAAM,6BAAA,GAAgC,MAAM,YAAA,GAAe;AAC3D,MAAM,uCAAA,GAA0C,MAAM,YAAA,GAAe;AAQrE,MAAM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