-
Notifications
You must be signed in to change notification settings - Fork 8
/
FilterActions.vue
74 lines (69 loc) 路 1.39 KB
/
FilterActions.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<template>
<div class="kt-filter__actions">
<ButtonLink
:isDisabled="isAddDisabled"
:isLoading="isLoading"
:label="translations.addFilterLabel"
@click="handleAdd"
/>
<ButtonLink
:isDisabled="isClearAllDisabled"
:isLoading="isLoading"
:label="translations.clearAllLabel"
:type="Kotti.Filters.ButtonLinkType.DANGER"
@click="handleClearAll"
/>
</div>
</template>
<script lang="ts">
import { defineComponent } from '@vue/composition-api'
import { useTranslationNamespace } from '../../kotti-translation/hooks'
import { Kotti } from '../../types'
import ButtonLink from './ButtonLink.vue'
export default defineComponent<{
isAddDisabled: boolean
isClearAllDisabled: boolean
isLoading: boolean
}>({
name: 'FilterActions',
components: {
ButtonLink,
},
props: {
isAddDisabled: {
default: false,
type: Boolean,
},
isClearAllDisabled: {
default: false,
type: Boolean,
},
isLoading: {
default: false,
type: Boolean,
},
},
setup(_, { emit }) {
const handleAdd = () => {
emit('startAddingFilter')
}
const handleClearAll = () => {
emit('clearAll')
}
return {
handleAdd,
handleClearAll,
Kotti,
translations: useTranslationNamespace('KtFilters'),
}
},
})
</script>
<style lang="scss" scoped>
.kt-filter__actions {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: var(--unit-1);
}
</style>