Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
06ae0792
Commit
06ae0792
authored
1 year ago
by
Chris Beer
Browse files
Options
Downloads
Patches
Plain Diff
Pull search styles up and use built-in MUI components when possible
parent
d547ebf4
No related branches found
No related tags found
2 merge requests
!19
Draft: Merge video support into mui5
,
!18
Only nudge over badge content for the WindowListButton; it needs special...
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SearchPanelControls.js
+13
-16
13 additions, 16 deletions
src/components/SearchPanelControls.js
with
13 additions
and
16 deletions
src/components/SearchPanelControls.js
+
13
−
16
View file @
06ae0792
...
@@ -7,15 +7,17 @@ import isObject from 'lodash/isObject';
...
@@ -7,15 +7,17 @@ import isObject from 'lodash/isObject';
import
Autocomplete
from
'
@mui/material/Autocomplete
'
;
import
Autocomplete
from
'
@mui/material/Autocomplete
'
;
import
CircularProgress
from
'
@mui/material/CircularProgress
'
;
import
CircularProgress
from
'
@mui/material/CircularProgress
'
;
import
TextField
from
'
@mui/material/TextField
'
;
import
TextField
from
'
@mui/material/TextField
'
;
import
InputAdornment
from
'
@mui/material/InputAdornment
'
;
import
SearchIcon
from
'
@mui/icons-material/SearchSharp
'
;
import
SearchIcon
from
'
@mui/icons-material/SearchSharp
'
;
import
MiradorMenuButton
from
'
../containers/MiradorMenuButton
'
;
import
MiradorMenuButton
from
'
../containers/MiradorMenuButton
'
;
import
SearchPanelNavigation
from
'
../containers/SearchPanelNavigation
'
;
import
SearchPanelNavigation
from
'
../containers/SearchPanelNavigation
'
;
const
StyledForm
=
styled
(
'
form
'
)({
const
StyledForm
=
styled
(
'
form
'
,
{
name
:
'
SearchPanelControls
'
,
slot
:
'
form
'
})(({
theme
})
=>
({
});
paddingBottom
:
theme
.
spacing
(
1
),
paddingRight
:
theme
.
spacing
(
1.5
),
width
:
'
100%
'
,
}));
const
StyledEndAdornment
=
styled
(
'
div
'
)({
});
/** Sometimes an autocomplete match can be a simple string, other times an object
/** Sometimes an autocomplete match can be a simple string, other times an object
with a `match` property, this function abstracts that away */
with a `match` property, this function abstracts that away */
const
getMatch
=
(
option
)
=>
(
isObject
(
option
)
?
option
.
match
:
option
);
const
getMatch
=
(
option
)
=>
(
isObject
(
option
)
?
option
.
match
:
option
);
...
@@ -131,11 +133,6 @@ export class SearchPanelControls extends Component {
...
@@ -131,11 +133,6 @@ export class SearchPanelControls extends Component {
return
(
return
(
<>
<>
<
StyledForm
<
StyledForm
sx
=
{{
paddingBottom
:
1
,
paddingRight
:
1.5
,
width
:
'
100%
'
,
}}
aria
-
label
=
{
t
(
'
searchTitle
'
)}
aria
-
label
=
{
t
(
'
searchTitle
'
)}
onSubmit
=
{
this
.
submitSearch
}
onSubmit
=
{
this
.
submitSearch
}
>
>
...
@@ -152,6 +149,7 @@ export class SearchPanelControls extends Component {
...
@@ -152,6 +149,7 @@ export class SearchPanelControls extends Component {
onChange
=
{
this
.
selectItem
}
onChange
=
{
this
.
selectItem
}
onInputChange
=
{
this
.
handleChange
}
onInputChange
=
{
this
.
handleChange
}
freeSolo
freeSolo
disableClearable
renderInput
=
{
params
=>
(
renderInput
=
{
params
=>
(
<
TextField
<
TextField
{...
params
}
{...
params
}
...
@@ -160,24 +158,23 @@ export class SearchPanelControls extends Component {
...
@@ -160,24 +158,23 @@ export class SearchPanelControls extends Component {
InputProps
=
{{
InputProps
=
{{
...
params
.
InputProps
,
...
params
.
InputProps
,
endAdornment
:
(
endAdornment
:
(
<
StyledEndAdornment
sx
=
{{
<
InputAdornment
sx
=
{{
position
:
'
relative
'
}}
position
=
"
end
"
>
position
:
'
absolute
'
,
right
:
0
,
}}
>
<
MiradorMenuButton
aria
-
label
=
{
t
(
'
searchSubmitAria
'
)}
type
=
"
submit
"
>
<
MiradorMenuButton
aria
-
label
=
{
t
(
'
searchSubmitAria
'
)}
type
=
"
submit
"
>
<
SearchIcon
/>
<
SearchIcon
/>
<
/MiradorMenuButton
>
<
/MiradorMenuButton
>
{
Boolean
(
searchIsFetching
)
&&
(
{
Boolean
(
searchIsFetching
)
&&
(
<
CircularProgress
<
CircularProgress
sx
=
{{
sx
=
{{
left
:
'
50%
'
,
marginLeft
:
'
-25px
'
,
marginTop
:
'
-25px
'
,
position
:
'
absolute
'
,
position
:
'
absolute
'
,
right
:
0
,
top
:
'
50%
'
,
}}
}}
size
=
{
50
}
size
=
{
50
}
/
>
/
>
)}
)}
<
/
StyledEnd
Adornment
>
<
/
Input
Adornment
>
),
),
}}
}}
/
>
/
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment