Skip to content

Commit bf3be15

Browse files
committed
feat: add size option
1 parent e137082 commit bf3be15

6 files changed

+39
-6
lines changed

src/components/SearchBreadcrumb/SearchBreadcrumbEntry.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup>
22
import { PhosphorIcon } from '@icij/murmur-next'
33
import { computed } from 'vue'
4+
import { pick } from 'lodash'
45
56
import SearchBreadcrumbEntryOccurrences from './SearchBreadcrumbEntryOccurrences'
67
import SearchBreadcrumbEntryFilter from './SearchBreadcrumbEntryFilter'
@@ -24,6 +25,9 @@ const props = defineProps({
2425
type: String,
2526
default: null
2627
},
28+
size: {
29+
type: String
30+
},
2731
occurrences: {
2832
type: Number,
2933
default: 0
@@ -45,8 +49,8 @@ const entryComponent = computed(() => {
4549
4650
const entryAttributes = computed(() => {
4751
return props.filter
48-
? { name: props.filter, value: props.value, icon: props.icon, color: props.color, noIcon: props.noIcon }
49-
: { query: props.query, noIcon: props.noIcon }
52+
? { name: props.filter, ...pick(props, ['value', 'icon', 'color', 'noIcon', 'size']) }
53+
: pick(props, ['query', 'noIcon', 'size'])
5054
})
5155
</script>
5256

src/components/SearchBreadcrumb/SearchBreadcrumbEntryFilter.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const props = defineProps({
2525
type: String,
2626
default: null
2727
},
28+
size: {
29+
type: String
30+
},
2831
operator: {
2932
type: String
3033
},
@@ -66,6 +69,7 @@ const color = computed(() => {
6669
:term="term"
6770
:operator="operator"
6871
:prefix="prefix"
72+
:size="size"
6973
:icon="icon"
7074
:color="color"
7175
:no-icon="noIcon"

src/components/SearchBreadcrumb/SearchBreadcrumbEntryOccurrences.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const lessOccurrences = computed(() => {
2020
<template>
2121
<div
2222
v-b-tooltip.top="{ offset: '0' }"
23-
class="search-breadcrumb-entry-occurrences d-inline-flex p-2"
23+
class="search-breadcrumb-entry-occurrences d-inline-flex px-2"
2424
:title="$t('searchBreadcrumbEntryOccurences.title', lessOccurrences, { lessOccurrences: $n(lessOccurrences) })"
2525
>
2626
{{ $t('searchBreadcrumbEntryOccurences.label', occurrences, { occurrences: $n(occurrences) }) }}

src/components/SearchBreadcrumb/SearchBreadcrumbEntryQuery.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const props = defineProps({
1111
},
1212
noIcon: {
1313
type: Boolean
14+
},
15+
size: {
16+
type: String
1417
}
1518
})
1619
@@ -24,11 +27,12 @@ const ast = computed(() => {
2427
</script>
2528

2629
<template>
27-
<search-breadcrumb-entry-query-ast v-if="ast" :ast="ast" :no-icon="noIcon" />
30+
<search-breadcrumb-entry-query-ast v-if="ast" :ast="ast" :no-icon="noIcon" :size="size" />
2831
<search-breadcrumb-entry-query-term
2932
v-else
3033
:term="query"
3134
:no-icon="noIcon"
35+
:size="size"
3236
title="Unable to parse the query"
3337
color="var(--bs-danger)"
3438
prefix="-"

src/components/SearchBreadcrumb/SearchBreadcrumbEntryQueryAst.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const props = defineProps({
1717
},
1818
noIcon: {
1919
type: Boolean
20+
},
21+
size: {
22+
type: String
2023
}
2124
})
2225
@@ -28,13 +31,20 @@ const isTerm = computed(() => !!props.ast.term && !isFilter.value)
2831

2932
<template>
3033
<span class="search-breadcrumb-entry-query-ast d-inline-flex flex-wrap flex-wrap column-gap-1 row-gap-2">
31-
<search-breadcrumb-entry-query-ast v-if="isLeft" :ast="ast.left" :operator="operator" :no-icon="noIcon" />
34+
<search-breadcrumb-entry-query-ast
35+
v-if="isLeft"
36+
:ast="ast.left"
37+
:operator="operator"
38+
:no-icon="noIcon"
39+
:size="size"
40+
/>
3241
<search-breadcrumb-entry-query-term
3342
v-if="isTerm"
3443
:term="ast.term"
3544
:operator="operator"
3645
:prefix="ast.prefix"
3746
:no-icon="noIcon"
47+
:size="size"
3848
/>
3949
<search-breadcrumb-entry-filter
4050
v-if="isFilter"
@@ -43,7 +53,14 @@ const isTerm = computed(() => !!props.ast.term && !isFilter.value)
4353
:prefix="ast.prefix"
4454
:value="ast.term"
4555
:no-icon="noIcon"
56+
:size="size"
57+
/>
58+
<search-breadcrumb-entry-query-ast
59+
v-if="isRight"
60+
:ast="ast.right"
61+
:operator="ast.operator"
62+
:no-icon="noIcon"
63+
:size="size"
4664
/>
47-
<search-breadcrumb-entry-query-ast v-if="isRight" :ast="ast.right" :operator="ast.operator" :no-icon="noIcon" />
4865
</span>
4966
</template>

src/components/SearchBreadcrumb/SearchBreadcrumbEntryQueryTerm.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const props = defineProps({
2626
},
2727
noIcon: {
2828
type: Boolean
29+
},
30+
size: {
31+
type: String
2932
}
3033
})
3134
@@ -51,6 +54,7 @@ const showOperator = computed(() => {
5154
variant="outline-danger"
5255
class="search-breadcrumb-entry-query-term"
5356
:class="classList"
57+
:size="size"
5458
:style="style"
5559
:icon-left="noIcon ? null : icon"
5660
icon-right="x"

0 commit comments

Comments
 (0)