From 72477a939858758e2e84f7a8cd071f0c666aa98d Mon Sep 17 00:00:00 2001 From: Arthri <41360489+Arthri@users.noreply.github.com> Date: Wed, 13 Dec 2023 03:26:03 +0800 Subject: [PATCH 01/17] Refactor out Table.Sortable & RecordsTable (#23102) * Add sortable table * Add IndexedTable * refactor MedicalRecords to use IndexedTable * Reorganize children * Finish conversion * rename SearchFlex to Toolbar * import IndexedTable.scss * Deduplicate CSS * Make margins look in toolbar better * Rename IndexedTable to RecordsTable * Remove redundant classes * Unselect sort by clicking on icon rather than double click * Fix premature scrollbar * Revert field searching * Implement number sort * Implement compare for undefined, null, bigint, and boolean * simplify sorting * Remove redundant class * Add documentation * Fix med records * copy paste error * consistency fixes * Allow null as prop.sortId * document all * Remove redundant compute * Remove redundant usings * restore missing commas * fix missing hashtag in account number * Document column order * Build and update tgui * Prettier format * Reorganize props * [ci skip] --------- Co-authored-by: Arthri <41360489+a@users.noreply.github.com> Co-authored-by: tgui <41898282+github-actions[bot]@users.noreply.github.com> --- tgui/docs/component-reference.md | 116 ++++++++ tgui/packages/tgui/components/Table.js | 157 ++++++++++- .../tgui/interfaces/AccountsUplinkTerminal.js | 221 ++++++--------- .../tgui/interfaces/MedicalRecords.js | 255 +++++------------- .../tgui/interfaces/SecurityRecords.js | 186 ++++--------- .../tgui/interfaces/common/RecordsTable.js | 55 ++++ tgui/packages/tgui/public/tgui.bundle.css | 2 +- tgui/packages/tgui/public/tgui.bundle.js | 6 +- .../interfaces/AccountsUplinkTerminal.scss | 18 -- .../styles/interfaces/MedicalRecords.scss | 18 -- .../styles/interfaces/SecurityRecords.scss | 18 -- .../interfaces/common/RecordsTable.scss | 29 ++ tgui/packages/tgui/styles/main.scss | 1 + 13 files changed, 559 insertions(+), 523 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/common/RecordsTable.js create mode 100644 tgui/packages/tgui/styles/interfaces/common/RecordsTable.scss diff --git a/tgui/docs/component-reference.md b/tgui/docs/component-reference.md index c892cb628be9..4070b5d46c36 100644 --- a/tgui/docs/component-reference.md +++ b/tgui/docs/component-reference.md @@ -44,12 +44,15 @@ Make sure to add new items to this list if you document new components. - [`Table`](#table) - [`Table.Row`](#tablerow) - [`Table.Cell`](#tablecell) + - [`Table.Sortable`](#tablesortable) - [`Tabs`](#tabs) - [`Tabs.Tab`](#tabstab) - [`Tooltip`](#tooltip) - [`tgui/layouts`](#tguilayouts) - [`Window`](#window) - [`Window.Content`](#windowcontent) +- [`tgui/interfaces/common`](#tguiinterfacescommon) + - [`RecordsTable`](#recordstable) ## General Concepts @@ -844,6 +847,103 @@ A straight forward mapping to `