@ulu/frontend-vue 0.1.1-beta.16 → 0.1.1-beta.17

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.
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <div class="facets-filters">
3
+ <UluAccordion
4
+ v-for="group in facets"
5
+ :key="group.uid"
6
+ :modifiers="accordionModifiers"
7
+ :startOpen="group.open"
8
+ >
9
+ <template #trigger="{ isOpen }">
10
+ <slot name="groupTrigger" :group="group" :isOpen="isOpen">
11
+ {{ group.name }}
12
+ </slot>
13
+ </template>
14
+ <template #default>
15
+ <UluFacetsList
16
+ :children="group.children.slice(0, maxVisible)"
17
+ :groupUid="group.uid"
18
+ :groupName="group.name"
19
+ :type="group.multiple ? 'checkbox' : 'radio'"
20
+ :compact="compact"
21
+ :model-value="selectedUids(group)"
22
+ @facet-change="emit('facet-change', $event)"
23
+ />
24
+ <UluAccordion
25
+ v-if="group.children.length > maxVisible"
26
+ class="facets-filters__more-facets"
27
+ :class="classes.moreFacets"
28
+ :modifiers="accordionModifiers"
29
+ >
30
+ <template #trigger="{ isOpen }">
31
+ {{ isOpen ? "View Less" : "Show More" }}
32
+ </template>
33
+ <template #default>
34
+ <UluFacetsList
35
+ :children="group.children.slice(maxVisible)"
36
+ :groupUid="group.uid"
37
+ :groupName="group.name"
38
+ :type="group.multiple ? 'checkbox' : 'radio'"
39
+ :compact="compact"
40
+ :model-value="selectedUids(group)"
41
+ @facet-change="emit('facet-change', $event)"
42
+ />
43
+ </template>
44
+ </UluAccordion>
45
+ </template>
46
+ </UluAccordion>
47
+ </div>
48
+ </template>
49
+
50
+ <script setup>
51
+ import UluFacetsList from "./UluFacetsList.vue";
52
+ import UluAccordion from "../../collapsible/UluAccordion.vue";
53
+
54
+ defineProps({
55
+ /**
56
+ * An object of classes to apply to the component.
57
+ */
58
+ classes: {
59
+ type: Object,
60
+ default: () => ({})
61
+ },
62
+ /**
63
+ * The maximum number of facets to show before showing the "More" button.
64
+ */
65
+ maxVisible: {
66
+ type: Number,
67
+ default: 5
68
+ },
69
+ /**
70
+ * An array of facet groups to display.
71
+ */
72
+ facets: {
73
+ type: Array,
74
+ default: () => []
75
+ },
76
+ /**
77
+ * Whether to use compact modifier on selectable menu
78
+ */
79
+ compact: Boolean,
80
+ /**
81
+ * Class modifiers for accordion (ie. 'transparent', 'secondary', etc)
82
+ */
83
+ accordionModifiers: [String, Array]
84
+ });
85
+
86
+ const emit = defineEmits(['facet-change']);
87
+
88
+ const selectedUids = (group) => {
89
+ if (group.multiple) {
90
+ return group.children.filter(c => c.selected).map(c => c.uid);
91
+ }
92
+ return group.children.find(c => c.selected)?.uid || '';
93
+ };
94
+ </script>
@@ -31,9 +31,6 @@
31
31
  v-if="group.children.length > maxVisible"
32
32
  class="facets-filters__more-facets"
33
33
  :class="classes.moreFacets"
34
- :clickOutsideCloses="false"
35
- :closeOnEscape="false"
36
- :transitionHeight="true"
37
34
  >
38
35
  <template #trigger="{ isOpen }">
39
36
  {{ isOpen ? "View Less" : "Show More" }}
@@ -1,6 +1,7 @@
1
1
  export { useFacets } from './facets/useFacets.js';
2
2
  export { default as UluFacetsActiveFilters } from './facets/UluFacetsActiveFilters.vue';
3
3
  export { default as UluFacetsFilterLists } from './facets/UluFacetsFilterLists.vue';
4
+ export { default as UluFacetsFilterAccordions } from './facets/UluFacetsFilterAccordions.vue';
4
5
  export { default as UluFacetsFilterPopovers } from './facets/UluFacetsFilterPopovers.vue';
5
6
  export { default as UluFacetsFilterSelects } from './facets/UluFacetsFilterSelects.vue';
6
7
  export { default as UluFacetsHeaderLayout } from './facets/UluFacetsHeaderLayout.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.1.1-beta.16",
3
+ "version": "0.1.1-beta.17",
4
4
  "description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
5
5
  "type": "module",
6
6
  "files": [
@@ -0,0 +1,29 @@
1
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
2
+ export default _default;
3
+ type __VLS_WithSlots<T, S> = T & (new () => {
4
+ $slots: S;
5
+ });
6
+ declare const __VLS_component: import("vue").DefineComponent<{}, {
7
+ $emit: typeof emit;
8
+ $props: Partial<typeof __VLS_props>;
9
+ classes: Record<string, any>;
10
+ compact: boolean;
11
+ maxVisible: number;
12
+ facets: unknown[];
13
+ accordionModifiers?: string | unknown[] | undefined;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
+ type __VLS_Slots = {
16
+ groupTrigger?: ((props: {
17
+ group: unknown;
18
+ isOpen: boolean | undefined;
19
+ }) => any) | undefined;
20
+ };
21
+ declare const emit: (event: "facet-change", ...args: any[]) => void;
22
+ declare const __VLS_props: {
23
+ readonly classes: Record<string, any>;
24
+ readonly compact: boolean;
25
+ readonly maxVisible: number;
26
+ readonly facets: unknown[];
27
+ readonly accordionModifiers?: string | unknown[] | undefined;
28
+ };
29
+ //# sourceMappingURL=UluFacetsFilterAccordions.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluFacetsFilterAccordions.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsFilterAccordions.vue"],"names":[],"mappings":"wBAkTqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AATzB;WAIkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,WAAW,CAAC;;;;;;2OAG3C;;;;;;;AA/KD,oEAA2C;AAhC3C;;;;;;EA8BG"}
@@ -1 +1 @@
1
- {"version":3,"file":"UluFacetsFilterLists.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsFilterLists.vue"],"names":[],"mappings":"wBAkUqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AATzB;WAIkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,WAAW,CAAC;;;;;2OAG3C;;;;;;;AA/LD,oEAA2C;AA5B3C;;;;;EA0BG"}
1
+ {"version":3,"file":"UluFacetsFilterLists.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsFilterLists.vue"],"names":[],"mappings":"wBAyTqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AATzB;WAIkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,WAAW,CAAC;;;;;2OAG3C;;;;;;;AAzLD,oEAA2C;AA5B3C;;;;;EA0BG"}
@@ -1,6 +1,7 @@
1
1
  export { useFacets } from "./facets/useFacets.js";
2
2
  export { default as UluFacetsActiveFilters } from "./facets/UluFacetsActiveFilters.vue";
3
3
  export { default as UluFacetsFilterLists } from "./facets/UluFacetsFilterLists.vue";
4
+ export { default as UluFacetsFilterAccordions } from "./facets/UluFacetsFilterAccordions.vue";
4
5
  export { default as UluFacetsFilterPopovers } from "./facets/UluFacetsFilterPopovers.vue";
5
6
  export { default as UluFacetsFilterSelects } from "./facets/UluFacetsFilterSelects.vue";
6
7
  export { default as UluFacetsHeaderLayout } from "./facets/UluFacetsHeaderLayout.vue";