Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/maps search bar #949

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/ripple-tide-search/components/TideSearchFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:name="filter.id"
:modelValue="filterFormValues[filter.id]"
v-bind="filter.props"
:variant="reverseStyling ? 'reverse' : 'default'"
:options="
filter.props?.dynamicOptions?.length
? filter.props.dynamicOptions
Expand Down Expand Up @@ -51,6 +52,7 @@ interface Props {
filterFormValues: Record<string, any>
submitLabel?: string | boolean
resetLabel?: string | boolean
reverseStyling?: boolean
}

const emit = defineEmits<{
Expand All @@ -60,7 +62,8 @@ const emit = defineEmits<{

const props = withDefaults(defineProps<Props>(), {
submitLabel: 'Apply search filters',
resetLabel: 'Clear search filters'
resetLabel: 'Clear search filters',
reverseStyling: false
})

const handleFilterReset = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,13 @@
</script>

<template>
<div>
<div class="tide-search-header">
<div class="rpl-u-margin-t-8">
<div
:class="{
'tide-search-header': true,
'tide-search-header--neutral': searchListingConfig.displayMapTab
}"
>
<RplSearchBar
v-if="!locationQueryConfig?.component"
id="custom-collection-search-bar"
Expand Down Expand Up @@ -398,6 +403,7 @@
:title="title"
:filter-form-values="filterForm"
:filterInputs="userFilters"
:reverseStyling="true"
@reset="handleFilterReset"
@submit="handleFilterSubmit"
>
Expand Down Expand Up @@ -453,7 +459,7 @@
<TideSearchError v-if="searchError" />
<TideSearchNoResults
:query="searchTerm"
v-else-if="!isBusy && !results?.length"

Check warning on line 462 in packages/ripple-tide-search/components/global/TideDataDrivenMap.vue

View workflow job for this annotation

GitHub Actions / Test

Attribute "v-else-if" should go before ":query"
/>

<component
Expand Down Expand Up @@ -494,11 +500,16 @@
.tide-search-header {
display: flex;
flex-direction: column;
margin-top: var(--rpl-sp-6);
}

.tide-search-header--neutral {
background-color: var(--rpl-clr-neutral-200);
padding: var(--rpl-sp-5);
background-color: var(--rpl-clr-neutral-100);
padding: var(--rpl-sp-4);
margin-bottom: var(--rpl-sp-4);

@media (--rpl-bp-s) {
padding: var(--rpl-sp-5);
}
}

.tide-search-filters.rpl-grid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
<RplSearchBar
id="tide-address-lookup"
inputLabel="Search by postcode or suburb"
:showLabel="true"
variant="reverse"
:submitLabel="false"
:inputValue="inputValue"
:suggestions="results"
:showNoResults="true"
:debounce="5000"
placeholder="Search by postcode or suburb"
:getSuggestionVal="(itm:any) => itm?.postcode || ''"
:getOptionId="(itm:any) => itm.id"
:getSuggestionVal="(itm:any) => itm?.locality || ''"
@submit="submitAction"
@update:input-value="onUpdate"
>
<template #suggestion="{ option: { option } }">
<span>{{ option?.locality }}</span>
<RplChip
<RplTag
v-if="option?.postcode"
class="rpl-u-margin-l-4"
:label="option?.postcode"
></RplChip>
variant="dark"
class="rpl-u-margin-l-3"
/>
</template>
</RplSearchBar>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Props {
label: string
options?: any[]
timestamp?: string | number
variant: 'default' | 'reverse'
}
defineProps<Props>()
</script>
Expand All @@ -16,6 +17,7 @@ defineProps<Props>()
:key="`${id}-${timestamp}`"
:name="id"
type="RplFormDropdown"
:variant="variant"
:multiple="multiple"
:label="label"
:placeholder="placeholder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
@media (--rpl-bp-m) {
--local-search-bar-suggestion-height: 52px;
}
}

.rpl-search-bar__inner {
position: relative;
}

Expand All @@ -31,6 +33,11 @@
);
}

.rpl-search-bar__label {
display: block;
margin-bottom: var(--rpl-sp-4);
}

.rpl-search-bar__input,
.rpl-search-bar__input-wrap {
/* rpl-type-p */
Expand Down
Loading
Loading