Ui/fix/selectList-sticky-header-fix (#1084)

* selectList sticky header

* selectList changed & servicemap adapted

* ignore eslint

Co-authored-by: Leon <>
Co-authored-by: AmitUp9 <96980485+AmitUp9@users.noreply.github.com>
This commit is contained in:
leon-up9 2022-05-15 14:39:09 +03:00 committed by GitHub
parent 5fc3e38c1a
commit 366d34b8d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 38 deletions

View File

@ -67,7 +67,6 @@
height: 100% height: 100%
display: flex display: flex
flex-direction: column flex-direction: column
margin-right: 10px
width: 100% width: 100%
border-radius: 4px border-radius: 4px
@ -82,17 +81,18 @@
margin-top: 10px margin-top: 10px
margin-right: 10px margin-right: 10px
.protocolsFilterList, .servicesFilter .card
background: white background: white
padding: 10px padding: 10px
border-radius: 4px border-radius: 4px
user-select: none user-select: none
box-shadow: 0px 1px 5px #979797
.servicesFilter .servicesFilterWrapper
margin-top: 10px margin-top: 20px
margin-bottom: 3px
height: 100% height: 100%
overflow: hidden overflow: hidden
border-radius: 4px
& .servicesFilterList .servicesFilterList
height: calc(100% - 30px - 52px) height: calc(100% - 30px - 52px)

View File

@ -158,6 +158,7 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
if (checkedProtocols.length === 0) { if (checkedProtocols.length === 0) {
setCheckedProtocols(getProtocolsForFilter.map(x => x.key)) setCheckedProtocols(getProtocolsForFilter.map(x => x.key))
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [getProtocolsForFilter]) }, [getProtocolsForFilter])
useEffect(() => { useEffect(() => {
@ -217,13 +218,13 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
<div className={styles.filterSection + ` ${isFilterClicked ? styles.show : ""}`}> <div className={styles.filterSection + ` ${isFilterClicked ? styles.show : ""}`}>
<Resizeable minWidth={170} maxWidth={320}> <Resizeable minWidth={170} maxWidth={320}>
<div className={styles.filterWrapper}> <div className={styles.filterWrapper}>
<div className={styles.protocolsFilterList}> <div className={styles.card}>
<SelectList items={getProtocolsForFilter} checkBoxWidth="5%" tableName={"PROTOCOLS"} multiSelect={true} <SelectList items={getProtocolsForFilter} checkBoxWidth="5%" tableName={"PROTOCOLS"} multiSelect={true}
checkedValues={checkedProtocols} setCheckedValues={onProtocolsChange} tableClassName={styles.filters} checkedValues={checkedProtocols} setCheckedValues={onProtocolsChange} tableClassName={styles.filters}
inputSearchClass={styles.servicesFilterSearch} isFilterable={false}/> inputSearchClass={styles.servicesFilterSearch} isFilterable={false}/>
</div> </div>
<div className={styles.servicesFilter}> <div className={styles.servicesFilterWrapper + ` ${styles.card}`}>
<div className={styles.servicesFilterList}> <div className={styles.servicesFilterList}>
<SelectList items={getServicesForFilter} tableName={"SERVICES"} tableClassName={styles.filters} multiSelect={true} <SelectList items={getServicesForFilter} tableName={"SERVICES"} tableClassName={styles.filters} multiSelect={true}
checkBoxWidth="5%" checkedValues={checkedServices} setCheckedValues={onServiceChanges} inputSearchClass={styles.servicesFilterSearch}/> checkBoxWidth="5%" checkedValues={checkedServices} setCheckedValues={onServiceChanges} inputSearchClass={styles.servicesFilterSearch}/>
</div> </div>

View File

@ -85,7 +85,7 @@ const SelectList: React.FC<Props> = ({ items, tableName, checkedValues = [], mul
const tableBody = filteredValues.length === 0 ? const tableBody = filteredValues.length === 0 ?
<tr> <tr>
<td colSpan={2}> <td colSpan={2} className={styles.displayBlock}>
<NoDataMessage messageText={noItemsMessage} /> <NoDataMessage messageText={noItemsMessage} />
</td> </td>
</tr> </tr>

View File

@ -1,44 +1,70 @@
@import '../../../variables.module' @import '../../../variables.module'
@import '../../../components' @import '../../../components'
.selectListTable .selectListTable
overflow: auto
height: 100%
user-select: none // when resizble moved we get unwanted beheviour user-select: none // when resizble moved we get unwanted beheviour
height: 100%
table table
width: 100% width: 100%
margin-top: 20px
border-collapse: collapse border-collapse: collapse
table-layout: fixed
height: 100%
display: flex
flex-flow: column
height: 100%
th thead
color: $blue-gray display: table
text-align: left table-layout: fixed
padding: 10px flex: 0 0 auto
position: sticky width: calc(100% - 0.9em)
top: 0
background: $main-background-color
font-size: 12px
tr tbody
border-bottom-width: 1px display: block
border-bottom-color: $data-background-color overflow: auto
border-bottom-style: solid width: 100%
width: 100% height: 100%
flex: 1 1 auto
td tbody tr:hover
color: $light-gray background: $header-background-color
padding: 10px
font-size: 11px th
font-weight: 600 color: $blue-gray
padding-top: 5px text-align: left
padding-bottom: 5px padding: 10px
background: $main-background-color
font-size: 12px
tr
border-bottom-width: 1px
border-bottom-color: $data-background-color
border-bottom-style: solid
width: 100%
display: block
position: relative
display: table
table-layout: fixed
td
color: $light-gray
padding: 10px
font-size: 11px
font-weight: 600
padding-top: 5px
padding-bottom: 5px
.nowrap .nowrap
white-space: nowrap white-space: nowrap
.totalSelected .totalSelected
font-size: 12px font-size: 12px
color: $light-blue-color color: $light-blue-color
font-weight: 700 font-weight: 700
.displayBlock
display: block
.filterInput
margin-bottom: 20px