@ulu/frontend-vue 0.1.1-beta.14 → 0.1.1-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{breakpoints-C2dyQISk.js → breakpoints-B0Wreot9.js} +1 -1
- package/dist/frontend-vue.css +1 -1
- package/dist/frontend-vue.js +1 -1
- package/dist/{index-C9eXElLr.js → index-slmI2p79.js} +860 -809
- package/lib/components/systems/facets/UluFacetsActiveFilters.vue +88 -68
- package/lib/components/systems/facets/UluFacetsFilterLists.vue +7 -7
- package/lib/components/systems/facets/UluFacetsList.vue +1 -1
- package/lib/components/systems/facets/UluFacetsSearch.vue +1 -1
- package/lib/plugins/core/index.js +1 -0
- package/package.json +3 -3
- package/types/components/systems/facets/UluFacetsActiveFilters.vue.d.ts +6 -0
- package/types/components/systems/facets/UluFacetsActiveFilters.vue.d.ts.map +1 -1
- package/types/plugins/core/index.d.ts.map +1 -1
|
@@ -1,84 +1,104 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-if="activeFilters.length" class="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class="
|
|
11
|
-
|
|
2
|
+
<div v-if="activeFilters.length" class="facets-active" :class="classes.container">
|
|
3
|
+
<component :is="labelElement" class="facets-active__label" :class="classes.label">
|
|
4
|
+
<slot name="label">
|
|
5
|
+
Active Filters:
|
|
6
|
+
</slot>
|
|
7
|
+
</component>
|
|
8
|
+
<ul class="facets-active__list" :class="classes.list">
|
|
9
|
+
<li
|
|
10
|
+
class="facets-active__item"
|
|
11
|
+
v-for="filter in activeFilters"
|
|
12
|
+
:key="`${ filter.groupUid }-${ filter.uid }`"
|
|
13
|
+
:class="classes.item"
|
|
12
14
|
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<button
|
|
16
|
+
:class="classes.filterButton"
|
|
17
|
+
icon="type:remove"
|
|
18
|
+
@click="removeFilter(filter)"
|
|
19
|
+
>
|
|
20
|
+
<span :class="classes.filterButtonText">
|
|
21
|
+
<span class="hidden-visually">Remove Active Filter:</span>
|
|
22
|
+
{{ filter.label }}
|
|
23
|
+
</span>
|
|
24
|
+
<span :class="classes.filterButtonIcon">
|
|
25
|
+
<UluIcon :icon="removeIcon" />
|
|
26
|
+
</span>
|
|
27
|
+
</button>
|
|
28
|
+
</li>
|
|
29
|
+
</ul>
|
|
30
|
+
<button @click="clearFilters" :class="classes.clearButton">Clear All</button>
|
|
18
31
|
</div>
|
|
19
32
|
</template>
|
|
20
33
|
|
|
21
34
|
<script setup>
|
|
22
|
-
import { computed } from 'vue';
|
|
23
|
-
import
|
|
24
|
-
import UluIcon from '../../elements/UluIcon.vue';
|
|
35
|
+
import { computed } from 'vue';
|
|
36
|
+
import UluIcon from '../../elements/UluIcon.vue';
|
|
25
37
|
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
/**
|
|
40
|
+
* The selectedFacets array from the useFacets composable.
|
|
41
|
+
*/
|
|
42
|
+
selectedFacets: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: () => []
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Element to use for label
|
|
48
|
+
*/
|
|
49
|
+
labelElement: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "strong"
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Icon to use for remove (in button)
|
|
55
|
+
*/
|
|
56
|
+
removeIcon: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "type:close"
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Classes for different element { label, list, item, filterButton, filterButtonText, filterButtonIcon, clearButton }
|
|
62
|
+
*/
|
|
63
|
+
classes: {
|
|
64
|
+
type: Object,
|
|
65
|
+
default: () => ({
|
|
66
|
+
container: "layout-flex flex-wrap",
|
|
67
|
+
label: "hidden-visually",
|
|
68
|
+
list: "layout-flex flex-wrap",
|
|
69
|
+
item: "margin-right-small-x",
|
|
70
|
+
filterButton: "button button--small button--outline no-min-width",
|
|
71
|
+
filterButtonText: null,
|
|
72
|
+
filterButtonIcon: "button__icon",
|
|
73
|
+
clearButton: "button button--small"
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
});
|
|
35
77
|
|
|
36
|
-
const emit = defineEmits(['facet-change', 'clear-filters']);
|
|
78
|
+
const emit = defineEmits(['facet-change', 'clear-filters']);
|
|
37
79
|
|
|
38
|
-
const activeFilters = computed(() => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
80
|
+
const activeFilters = computed(() => {
|
|
81
|
+
const filters = [];
|
|
82
|
+
props.selectedFacets.forEach(group => {
|
|
83
|
+
group.children.forEach(child => {
|
|
84
|
+
filters.push({
|
|
85
|
+
...child,
|
|
86
|
+
groupUid: group.uid
|
|
87
|
+
});
|
|
45
88
|
});
|
|
46
89
|
});
|
|
90
|
+
return filters;
|
|
47
91
|
});
|
|
48
|
-
return filters;
|
|
49
|
-
});
|
|
50
92
|
|
|
51
|
-
function removeFilter(filter) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function clearFilters() {
|
|
60
|
-
emit('clear-filters');
|
|
61
|
-
}
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<style lang="scss">
|
|
65
|
-
.ulu-facets-active-filters {
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
flex-wrap: wrap;
|
|
69
|
-
gap: 1rem;
|
|
70
|
-
margin-bottom: 1.5rem;
|
|
71
|
-
padding-bottom: 1.5rem;
|
|
72
|
-
border-bottom: 1px solid #eee;
|
|
73
|
-
|
|
74
|
-
&__label {
|
|
75
|
-
margin-right: 0.5rem;
|
|
93
|
+
function removeFilter(filter) {
|
|
94
|
+
emit('facet-change', {
|
|
95
|
+
groupUid: filter.groupUid,
|
|
96
|
+
facetUid: filter.uid,
|
|
97
|
+
selected: false
|
|
98
|
+
});
|
|
76
99
|
}
|
|
77
100
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
flex-wrap: wrap;
|
|
81
|
-
gap: 0.5rem;
|
|
101
|
+
function clearFilters() {
|
|
102
|
+
emit('clear-filters');
|
|
82
103
|
}
|
|
83
|
-
|
|
84
|
-
</style>
|
|
104
|
+
</script>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="facets-filters">
|
|
3
3
|
<UluCollapsible
|
|
4
4
|
v-for="group in facets"
|
|
5
5
|
:key="group.uid"
|
|
6
6
|
:classes="{
|
|
7
|
-
container: ['
|
|
8
|
-
containerOpen: ['
|
|
9
|
-
containerClosed: ['
|
|
10
|
-
trigger: ['
|
|
11
|
-
content: ['
|
|
7
|
+
container: ['facets-filters__group', classes.group],
|
|
8
|
+
containerOpen: ['facets-filters__group--open', classes.groupOpen],
|
|
9
|
+
containerClosed: ['facets-filters__group--closed', classes.groupClosed],
|
|
10
|
+
trigger: ['facets-filters__group-trigger', classes.groupTrigger],
|
|
11
|
+
content: ['facets-filters__group-content', classes.groupContent]
|
|
12
12
|
}"
|
|
13
13
|
:startOpen="group.open"
|
|
14
14
|
>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
/>
|
|
30
30
|
<UluCollapsible
|
|
31
31
|
v-if="group.children.length > maxVisible"
|
|
32
|
-
class="
|
|
32
|
+
class="facets-filters__more-facets"
|
|
33
33
|
:class="classes.moreFacets"
|
|
34
34
|
:clickOutsideCloses="false"
|
|
35
35
|
:closeOnEscape="false"
|
|
@@ -15,6 +15,7 @@ const defaults = {
|
|
|
15
15
|
success: "fas fa-circle-check",
|
|
16
16
|
externalLink: "fas fa-arrow-up-right-from-square",
|
|
17
17
|
close: "fas fa-xmark",
|
|
18
|
+
remove: "fas fa-xmark",
|
|
18
19
|
expand: "fas fa-plus",
|
|
19
20
|
collapse: "fas fa-minus",
|
|
20
21
|
resizeHorizontal: "fas fa-grip-lines-vertical",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend-vue",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.16",
|
|
4
4
|
"description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@formkit/auto-animate": "^0.9.0",
|
|
65
65
|
"@headlessui/vue": "^1.7.23",
|
|
66
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
66
|
+
"@ulu/frontend": "^0.1.0-beta.114",
|
|
67
67
|
"@unhead/vue": "^2.0.11",
|
|
68
68
|
"vue": "^3.5.17",
|
|
69
69
|
"vue-router": "^4.5.1"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
88
88
|
"@storybook/addon-links": "^9.1.1",
|
|
89
89
|
"@storybook/vue3-vite": "^9.1.1",
|
|
90
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
90
|
+
"@ulu/frontend": "^0.1.0-beta.114",
|
|
91
91
|
"@unhead/vue": "^2.0.11",
|
|
92
92
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
93
93
|
"ollama": "^0.5.16",
|
|
@@ -6,13 +6,19 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
7
|
$emit: typeof emit;
|
|
8
8
|
$props: Partial<typeof props>;
|
|
9
|
+
classes: Record<string, any>;
|
|
10
|
+
labelElement: string;
|
|
9
11
|
selectedFacets: unknown[];
|
|
12
|
+
removeIcon: string;
|
|
10
13
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
14
|
type __VLS_Slots = {
|
|
12
15
|
label?: ((props: {}) => any) | undefined;
|
|
13
16
|
};
|
|
14
17
|
declare const emit: (event: "facet-change" | "clear-filters", ...args: any[]) => void;
|
|
15
18
|
declare const props: {
|
|
19
|
+
readonly classes: Record<string, any>;
|
|
20
|
+
readonly labelElement: string;
|
|
16
21
|
readonly selectedFacets: unknown[];
|
|
22
|
+
readonly removeIcon: string;
|
|
17
23
|
};
|
|
18
24
|
//# sourceMappingURL=UluFacetsActiveFilters.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluFacetsActiveFilters.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsActiveFilters.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluFacetsActiveFilters.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsActiveFilters.vue"],"names":[],"mappings":"wBAmTqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AATzB;WAIkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,KAAK,CAAC;;;;;2OAGrC;;;;AA7JD,sFAA4D;AAxC5D;;;;;EAsCG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"AAmCA,mEAyDC;AA3DD,gCAA0D"}
|