From 7361d50c93d417c3c0466b167e06b70958e24cfb Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Sun, 29 Oct 2023 11:52:37 +0300 Subject: [PATCH] Restore original searchbox behaviour --- .../list-details-table.scss | 3 +- .../src/lists-table/lists-table.component.tsx | 33 ++++---- .../src/lists-table/lists-table.scss | 77 +++++-------------- 3 files changed, 43 insertions(+), 70 deletions(-) diff --git a/packages/esm-patient-list-app/src/list-details-table/list-details-table.scss b/packages/esm-patient-list-app/src/list-details-table/list-details-table.scss index c1a88bce55..b2d93f276f 100644 --- a/packages/esm-patient-list-app/src/list-details-table/list-details-table.scss +++ b/packages/esm-patient-list-app/src/list-details-table/list-details-table.scss @@ -126,9 +126,10 @@ div#table-tool-bar { display: flex; justify-content: center; align-items: center; - padding: spacing.$spacing-07 !important; + padding: spacing.$spacing-09 !important; text-align: center; border: 1px solid $ui-03; + background-color: white; } .filterEmptyStateTile { diff --git a/packages/esm-patient-list-app/src/lists-table/lists-table.component.tsx b/packages/esm-patient-list-app/src/lists-table/lists-table.component.tsx index 36548d49e9..34adf6ce9e 100755 --- a/packages/esm-patient-list-app/src/lists-table/lists-table.component.tsx +++ b/packages/esm-patient-list-app/src/lists-table/lists-table.component.tsx @@ -1,12 +1,14 @@ -import React, { type CSSProperties, useCallback, useState, useMemo } from 'react'; +import React, { type CSSProperties, useState, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import fuzzy from 'fuzzy'; import orderBy from 'lodash-es/orderBy'; import { DataTable, DataTableSkeleton, + InlineLoading, Layer, Pagination, + Search, Table, TableBody, TableCell, @@ -48,6 +50,7 @@ interface PatientListTableProps { style?: CSSProperties; patientLists: Array; isLoading?: boolean; + isValidating?: boolean; headers?: Array; refetch?(): void; listType: string; @@ -59,6 +62,7 @@ const ListsTable: React.FC = ({ style, patientLists = [], isLoading = false, + isValidating, headers, refetch, listType, @@ -140,20 +144,23 @@ const ListsTable: React.FC = ({ if (patientLists.length) { return ( <> +
+
{isValidating && }
+ + ) => setSearchTerm(e.target.value)} + placeholder={t('searchThisList', 'Search this list')} + size={responsiveSize} + value={searchTerm} + /> + +
{({ rows, headers, getHeaderProps, getRowProps, getTableProps, getTableContainerProps }) => ( - -
- - - ) => setSearchTerm(e.target.value)} - placeholder={t('searchThisList', 'Search this list')} - /> - - -
+ div { + align-self: center; + justify-self: flex-end; +} + +.searchbox { + width: 100%; + max-width: 16rem; + background-color: $ui-02; + border-bottom-color: $ui-03; +}