@ulu/frontend-vue 0.1.0-beta.9 → 0.1.1-beta.10
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-BbkGNxxt.js → breakpoints-BYSYcx8V.js} +1 -1
- package/dist/frontend-vue.css +1 -1
- package/dist/frontend-vue.js +82 -70
- package/dist/index-A7weElM_.js +7766 -0
- package/lib/components/collapsible/UluAccordion.vue +71 -53
- package/lib/components/collapsible/UluAccordionGroup.vue +54 -0
- package/lib/components/collapsible/UluCollapsible.vue +144 -0
- package/lib/components/collapsible/UluDropdown.vue +29 -29
- package/lib/components/collapsible/UluOverflowPopover.vue +1 -1
- package/lib/components/elements/UluBadge.vue +51 -28
- package/lib/components/elements/UluBadgeStack.vue +8 -13
- package/lib/components/elements/UluButtonVerbose.vue +119 -0
- package/lib/components/elements/UluCard.vue +1 -1
- package/lib/components/elements/UluDefinitionList.vue +14 -17
- package/lib/components/elements/UluExternalLink.vue +21 -27
- package/lib/components/elements/UluIcon.vue +11 -1
- package/lib/components/elements/UluList.vue +53 -55
- package/lib/components/elements/UluSpokeSpinner.vue +12 -18
- package/lib/components/elements/UluTag.vue +35 -35
- package/lib/components/forms/UluFileDisplay.vue +49 -31
- package/lib/components/forms/UluFormFile.vue +37 -24
- package/lib/components/forms/UluFormMessage.vue +13 -10
- package/lib/components/forms/UluFormSelect.vue +28 -16
- package/lib/components/forms/UluFormText.vue +24 -15
- package/lib/components/forms/UluSearchForm.vue +11 -10
- package/lib/components/forms/UluSelectableMenu.vue +106 -0
- package/lib/components/index.js +4 -3
- package/lib/components/layout/UluTitleRail.vue +18 -0
- package/lib/components/layout/UluWhenBreakpoint.vue +9 -0
- package/lib/components/navigation/UluBreadcrumb.vue +9 -2
- package/lib/components/navigation/UluMenu.vue +13 -6
- package/lib/components/navigation/UluMenuStack.vue +50 -31
- package/lib/components/navigation/UluPager.vue +102 -0
- package/lib/components/systems/facets/ExampleFacetsWithPagination.vue +119 -0
- package/lib/components/systems/facets/UluFacetsActiveFilters.vue +84 -0
- package/lib/components/systems/facets/UluFacetsFilterLists.vue +97 -0
- package/lib/components/systems/facets/UluFacetsFilterPopovers.vue +125 -0
- package/lib/components/systems/facets/UluFacetsFilterSelects.vue +71 -0
- package/lib/components/systems/facets/UluFacetsHeaderLayout.vue +24 -0
- package/lib/components/systems/facets/UluFacetsList.vue +64 -34
- package/lib/components/systems/facets/UluFacetsResults.vue +63 -0
- package/lib/components/systems/facets/UluFacetsSearch.vue +27 -50
- package/lib/components/systems/facets/UluFacetsSidebarLayout.vue +90 -0
- package/lib/components/systems/facets/UluFacetsSort.vue +45 -0
- package/lib/components/systems/facets/_facets.scss +2 -3
- package/lib/components/systems/facets/_mock-data.js +40 -0
- package/lib/components/systems/facets/useFacets.js +394 -0
- package/lib/components/systems/index.js +14 -2
- package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +2 -1
- package/lib/components/systems/skeleton/UluShowSkeleton.vue +9 -8
- package/lib/components/systems/skeleton/UluSkeletonContent.vue +39 -43
- package/lib/components/systems/skeleton/UluSkeletonMedia.vue +4 -6
- package/lib/components/systems/skeleton/UluSkeletonText.vue +27 -0
- package/lib/components/systems/slider/UluImageSlideShow.vue +1 -1
- package/lib/components/systems/slider/UluSlideShow.vue +8 -3
- package/lib/components/systems/table-sticky/UluTableSticky.vue +7 -7
- package/lib/components/systems/table-sticky/UluTableStickyTable.vue +3 -3
- package/lib/components/visualizations/UluAnimateNumber.vue +7 -1
- package/lib/components/visualizations/UluProgressBar.vue +148 -74
- package/lib/components/visualizations/UluProgressCircle.vue +159 -0
- package/lib/composables/index.js +3 -1
- package/lib/composables/useDocumentTitle.js +61 -0
- package/lib/composables/usePagination.js +122 -0
- package/lib/index.js +1 -0
- package/lib/plugins/core/index.js +6 -1
- package/lib/plugins/popovers/UluPopover.vue +8 -3
- package/lib/plugins/toast/UluToast.vue +1 -1
- package/lib/plugins/toast/UluToastDisplay.vue +19 -2
- package/lib/utils/dom.js +12 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/{vue-router.js → router.js} +114 -30
- package/package.json +22 -12
- package/types/components/collapsible/UluAccordion.vue.d.ts +42 -0
- package/types/components/collapsible/UluAccordion.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluAccordionGroup.vue.d.ts +19 -0
- package/types/components/collapsible/UluAccordionGroup.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluCollapsible.vue.d.ts +40 -0
- package/types/components/collapsible/UluCollapsible.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluDropdown.vue.d.ts +22 -0
- package/types/components/collapsible/UluDropdown.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluModal.vue.d.ts +253 -0
- package/types/components/collapsible/UluModal.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluOverflowPopover.vue.d.ts +18 -0
- package/types/components/collapsible/UluOverflowPopover.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluTab.vue.d.ts +10 -0
- package/types/components/collapsible/UluTab.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluTabGroup.vue.d.ts +18 -0
- package/types/components/collapsible/UluTabGroup.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluTabList.vue.d.ts +10 -0
- package/types/components/collapsible/UluTabList.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluTabPanel.vue.d.ts +10 -0
- package/types/components/collapsible/UluTabPanel.vue.d.ts.map +1 -0
- package/types/components/collapsible/UluTabPanels.vue.d.ts +10 -0
- package/types/components/collapsible/UluTabPanels.vue.d.ts.map +1 -0
- package/types/components/elements/UluAlert.vue.d.ts +147 -0
- package/types/components/elements/UluAlert.vue.d.ts.map +1 -0
- package/types/components/elements/UluBadge.vue.d.ts +30 -0
- package/types/components/elements/UluBadge.vue.d.ts.map +1 -0
- package/types/components/elements/UluBadgeStack.vue.d.ts +9 -0
- package/types/components/elements/UluBadgeStack.vue.d.ts.map +1 -0
- package/types/components/elements/UluButton.vue.d.ts +186 -0
- package/types/components/elements/UluButton.vue.d.ts.map +1 -0
- package/types/components/elements/UluButtonVerbose.vue.d.ts +126 -0
- package/types/components/elements/UluButtonVerbose.vue.d.ts.map +1 -0
- package/types/components/elements/UluCallout.vue.d.ts +27 -0
- package/types/components/elements/UluCallout.vue.d.ts.map +1 -0
- package/types/components/elements/UluCard.vue.d.ts +238 -0
- package/types/components/elements/UluCard.vue.d.ts.map +1 -0
- package/types/components/elements/UluDefinitionList.vue.d.ts +26 -0
- package/types/components/elements/UluDefinitionList.vue.d.ts.map +1 -0
- package/types/components/elements/UluExternalLink.vue.d.ts +25 -0
- package/types/components/elements/UluExternalLink.vue.d.ts.map +1 -0
- package/types/components/elements/UluIcon.vue.d.ts +11 -0
- package/types/components/elements/UluIcon.vue.d.ts.map +1 -0
- package/types/components/elements/UluList.vue.d.ts +37 -0
- package/types/components/elements/UluList.vue.d.ts.map +1 -0
- package/types/components/elements/UluMain.vue.d.ts +13 -0
- package/types/components/elements/UluMain.vue.d.ts.map +1 -0
- package/types/components/elements/UluSpokeSpinner.vue.d.ts +9 -0
- package/types/components/elements/UluSpokeSpinner.vue.d.ts.map +1 -0
- package/types/components/elements/UluTag.vue.d.ts +26 -0
- package/types/components/elements/UluTag.vue.d.ts.map +1 -0
- package/types/components/forms/UluFileDisplay.vue.d.ts +23 -0
- package/types/components/forms/UluFileDisplay.vue.d.ts.map +1 -0
- package/types/components/forms/UluFormFile.vue.d.ts +26 -0
- package/types/components/forms/UluFormFile.vue.d.ts.map +1 -0
- package/types/components/forms/UluFormMessage.vue.d.ts +18 -0
- package/types/components/forms/UluFormMessage.vue.d.ts.map +1 -0
- package/types/components/forms/UluFormSelect.vue.d.ts +24 -0
- package/types/components/forms/UluFormSelect.vue.d.ts.map +1 -0
- package/types/components/forms/UluFormText.vue.d.ts +22 -0
- package/types/components/forms/UluFormText.vue.d.ts.map +1 -0
- package/types/components/forms/UluSearchForm.vue.d.ts +9 -0
- package/types/components/forms/UluSearchForm.vue.d.ts.map +1 -0
- package/types/components/forms/UluSelectableMenu.vue.d.ts +30 -0
- package/types/components/forms/UluSelectableMenu.vue.d.ts.map +1 -0
- package/types/components/index.d.ts +48 -0
- package/types/components/layout/UluAdaptiveLayout.vue.d.ts +12 -0
- package/types/components/layout/UluAdaptiveLayout.vue.d.ts.map +1 -0
- package/types/components/layout/UluDataGrid.vue.d.ts +3 -0
- package/types/components/layout/UluDataGrid.vue.d.ts.map +1 -0
- package/types/components/layout/UluTitleRail.vue.d.ts +91 -0
- package/types/components/layout/UluTitleRail.vue.d.ts.map +1 -0
- package/types/components/layout/UluWhenBreakpoint.vue.d.ts +20 -0
- package/types/components/layout/UluWhenBreakpoint.vue.d.ts.map +1 -0
- package/types/components/navigation/UluBreadcrumb.vue.d.ts +71 -0
- package/types/components/navigation/UluBreadcrumb.vue.d.ts.map +1 -0
- package/types/components/navigation/UluMenu.vue.d.ts +142 -0
- package/types/components/navigation/UluMenu.vue.d.ts.map +1 -0
- package/types/components/navigation/UluMenuStack.vue.d.ts +19 -0
- package/types/components/navigation/UluMenuStack.vue.d.ts.map +1 -0
- package/types/components/navigation/UluNavStrip.vue.d.ts +138 -0
- package/types/components/navigation/UluNavStrip.vue.d.ts.map +1 -0
- package/types/components/navigation/UluPager.vue.d.ts +15 -0
- package/types/components/navigation/UluPager.vue.d.ts.map +1 -0
- package/types/components/navigation/UluSkipLink.vue.d.ts +3 -0
- package/types/components/navigation/UluSkipLink.vue.d.ts.map +1 -0
- package/types/components/systems/facets/ExampleFacetsWithPagination.vue.d.ts +3 -0
- package/types/components/systems/facets/ExampleFacetsWithPagination.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsActiveFilters.vue.d.ts +18 -0
- package/types/components/systems/facets/UluFacetsActiveFilters.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsFilterLists.vue.d.ts +27 -0
- package/types/components/systems/facets/UluFacetsFilterLists.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsFilterPopovers.vue.d.ts +25 -0
- package/types/components/systems/facets/UluFacetsFilterPopovers.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsFilterSelects.vue.d.ts +11 -0
- package/types/components/systems/facets/UluFacetsFilterSelects.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsHeaderLayout.vue.d.ts +12 -0
- package/types/components/systems/facets/UluFacetsHeaderLayout.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsList.vue.d.ts +21 -0
- package/types/components/systems/facets/UluFacetsList.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsResults.vue.d.ts +27 -0
- package/types/components/systems/facets/UluFacetsResults.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsSearch.vue.d.ts +15 -0
- package/types/components/systems/facets/UluFacetsSearch.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsSidebarLayout.vue.d.ts +22 -0
- package/types/components/systems/facets/UluFacetsSidebarLayout.vue.d.ts.map +1 -0
- package/types/components/systems/facets/UluFacetsSort.vue.d.ts +22 -0
- package/types/components/systems/facets/UluFacetsSort.vue.d.ts.map +1 -0
- package/types/components/systems/facets/_mock-data.d.ts +18 -0
- package/types/components/systems/facets/_mock-data.d.ts.map +1 -0
- package/types/components/systems/facets/useFacets.d.ts +57 -0
- package/types/components/systems/facets/useFacets.d.ts.map +1 -0
- package/types/components/systems/index.d.ts +25 -1
- package/types/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts +60 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts.map +1 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsNav.vue.d.ts +15 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsNav.vue.d.ts.map +1 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts +32 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts.map +1 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsSection.vue.d.ts +50 -0
- package/types/components/systems/scroll-anchors/UluScrollAnchorsSection.vue.d.ts.map +1 -0
- package/types/components/systems/scroll-anchors/symbols.d.ts +3 -3
- package/types/components/systems/scroll-anchors/symbols.d.ts.map +1 -1
- package/types/components/systems/skeleton/UluShowSkeleton.vue.d.ts +16 -0
- package/types/components/systems/skeleton/UluShowSkeleton.vue.d.ts.map +1 -0
- package/types/components/systems/skeleton/UluSkeletonContent.vue.d.ts +9 -0
- package/types/components/systems/skeleton/UluSkeletonContent.vue.d.ts.map +1 -0
- package/types/components/systems/skeleton/UluSkeletonMedia.vue.d.ts +3 -0
- package/types/components/systems/skeleton/UluSkeletonMedia.vue.d.ts.map +1 -0
- package/types/components/systems/skeleton/UluSkeletonText.vue.d.ts +13 -0
- package/types/components/systems/skeleton/UluSkeletonText.vue.d.ts.map +1 -0
- package/types/components/systems/slider/UluImageSlideShow.vue.d.ts +130 -0
- package/types/components/systems/slider/UluImageSlideShow.vue.d.ts.map +1 -0
- package/types/components/systems/slider/UluSlideShow.vue.d.ts +205 -0
- package/types/components/systems/slider/UluSlideShow.vue.d.ts.map +1 -0
- package/types/components/systems/slider/UluSlideShowSlide.vue.d.ts +17 -0
- package/types/components/systems/slider/UluSlideShowSlide.vue.d.ts.map +1 -0
- package/types/components/systems/table-sticky/UluTableSticky.vue.d.ts +455 -0
- package/types/components/systems/table-sticky/UluTableSticky.vue.d.ts.map +1 -0
- package/types/components/systems/table-sticky/UluTableStickyRows.vue.d.ts +34 -0
- package/types/components/systems/table-sticky/UluTableStickyRows.vue.d.ts.map +1 -0
- package/types/components/systems/table-sticky/UluTableStickyTable.vue.d.ts +151 -0
- package/types/components/systems/table-sticky/UluTableStickyTable.vue.d.ts.map +1 -0
- package/types/components/utils/UluCondText.vue.d.ts +29 -0
- package/types/components/utils/UluCondText.vue.d.ts.map +1 -0
- package/types/components/utils/UluEmpty.vue.d.ts +3 -0
- package/types/components/utils/UluEmpty.vue.d.ts.map +1 -0
- package/types/components/utils/UluEmptyView.vue.d.ts +3 -0
- package/types/components/utils/UluEmptyView.vue.d.ts.map +1 -0
- package/types/components/utils/UluPlaceholderImage.vue.d.ts +61 -0
- package/types/components/utils/UluPlaceholderImage.vue.d.ts.map +1 -0
- package/types/components/utils/UluPlaceholderText.vue.d.ts +24 -0
- package/types/components/utils/UluPlaceholderText.vue.d.ts.map +1 -0
- package/types/components/utils/UluRouteAnnouncer.vue.d.ts +63 -0
- package/types/components/utils/UluRouteAnnouncer.vue.d.ts.map +1 -0
- package/types/components/visualizations/UluAnimateNumber.vue.d.ts +16 -0
- package/types/components/visualizations/UluAnimateNumber.vue.d.ts.map +1 -0
- package/types/components/visualizations/UluProgressBar.vue.d.ts +66 -0
- package/types/components/visualizations/UluProgressBar.vue.d.ts.map +1 -0
- package/types/components/visualizations/UluProgressCircle.vue.d.ts +48 -0
- package/types/components/visualizations/UluProgressCircle.vue.d.ts.map +1 -0
- package/types/composables/index.d.ts +2 -0
- package/types/composables/useBreakpointManager.d.ts +1 -1
- package/types/composables/useBreakpointManager.d.ts.map +1 -1
- package/types/composables/useDocumentTitle.d.ts +22 -0
- package/types/composables/useDocumentTitle.d.ts.map +1 -0
- package/types/composables/useIcon.d.ts +1 -1
- package/types/composables/useIcon.d.ts.map +1 -1
- package/types/composables/useModifiers.d.ts +1 -1
- package/types/composables/useModifiers.d.ts.map +1 -1
- package/types/composables/usePageTitle.d.ts +19 -0
- package/types/composables/usePageTitle.d.ts.map +1 -0
- package/types/composables/usePagination.d.ts +25 -0
- package/types/composables/usePagination.d.ts.map +1 -0
- package/types/composables/useWindowResize.d.ts +1 -1
- package/types/composables/useWindowResize.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/plugins/core/index.d.ts.map +1 -1
- package/types/plugins/modals/UluModalsDisplay.vue.d.ts +14 -0
- package/types/plugins/modals/UluModalsDisplay.vue.d.ts.map +1 -0
- package/types/plugins/modals/api.d.ts +7 -4
- package/types/plugins/modals/api.d.ts.map +1 -1
- package/types/plugins/popovers/UluPopover.vue.d.ts +54 -0
- package/types/plugins/popovers/UluPopover.vue.d.ts.map +1 -0
- package/types/plugins/popovers/UluTooltipDisplay.vue.d.ts +3 -0
- package/types/plugins/popovers/UluTooltipDisplay.vue.d.ts.map +1 -0
- package/types/plugins/popovers/UluTooltipPopover.vue.d.ts +3 -0
- package/types/plugins/popovers/UluTooltipPopover.vue.d.ts.map +1 -0
- package/types/plugins/popovers/defaults.d.ts +2 -2
- package/types/plugins/popovers/defaults.d.ts.map +1 -1
- package/types/plugins/popovers/manager.d.ts +50 -6
- package/types/plugins/popovers/manager.d.ts.map +1 -1
- package/types/plugins/popovers/useFollow.d.ts +4 -4
- package/types/plugins/popovers/useFollow.d.ts.map +1 -1
- package/types/plugins/toast/UluToast.vue.d.ts +52 -0
- package/types/plugins/toast/UluToast.vue.d.ts.map +1 -0
- package/types/plugins/toast/UluToastDisplay.vue.d.ts +13 -0
- package/types/plugins/toast/UluToastDisplay.vue.d.ts.map +1 -0
- package/types/plugins/toast/defaults.d.ts +39 -2
- package/types/plugins/toast/store.d.ts +65 -2
- package/types/plugins/toast/store.d.ts.map +1 -1
- package/types/utils/dom.d.ts +2 -1
- package/types/utils/dom.d.ts.map +1 -1
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/router.d.ts +144 -0
- package/types/utils/router.d.ts.map +1 -0
- package/dist/index-D3Uc6T5M.js +0 -6469
- package/lib/components/collapsible/UluCollapsibleRegion.vue +0 -278
- package/lib/components/forms/UluCheckboxMenu.vue +0 -36
- package/lib/components/systems/facets/UluFacets.vue +0 -380
- package/lib/components/systems/skeleton/UluSkeletonTextInline.vue +0 -9
- package/lib/components/visualizations/UluProgressDonut.vue +0 -97
- package/lib/utils/placeholder.js +0 -6
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
class="search-form__submit button button--primary"
|
|
14
14
|
aria-label="Submit Search"
|
|
15
15
|
>
|
|
16
|
-
<
|
|
16
|
+
<UluIcon icon="type:search" />
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
<script setup>
|
|
22
|
+
import UluIcon from "../elements/UluIcon.vue";
|
|
23
|
+
defineProps({
|
|
24
|
+
/**
|
|
25
|
+
* The placeholder text for the search input.
|
|
26
|
+
*/
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "Titles, keyword…"
|
|
29
30
|
}
|
|
30
|
-
};
|
|
31
|
+
});
|
|
31
32
|
</script>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="menu-stack form-theme"
|
|
4
|
+
:class="{
|
|
5
|
+
'menu-stack--hide-inputs' : hideInputs,
|
|
6
|
+
'menu-stack--compact' : compact
|
|
7
|
+
}"
|
|
8
|
+
:role="groupRole"
|
|
9
|
+
:aria-labelledby="legendId"
|
|
10
|
+
>
|
|
11
|
+
<div v-if="legend" :id="legendId" class="hidden-visually">{{ legend }}</div>
|
|
12
|
+
<ul class="menu-stack__list">
|
|
13
|
+
<li class="menu-stack__item" v-for="option in options" :key="option.uid">
|
|
14
|
+
<div class="menu-stack__selectable">
|
|
15
|
+
<input
|
|
16
|
+
:type="type"
|
|
17
|
+
:id="getId(option)"
|
|
18
|
+
:name="name"
|
|
19
|
+
:value="option.uid"
|
|
20
|
+
:checked="isChecked(option)"
|
|
21
|
+
@change="handleChange(option, $event)"
|
|
22
|
+
>
|
|
23
|
+
<label :for="getId(option)">
|
|
24
|
+
<slot :option="option">
|
|
25
|
+
{{ option?.label || option?.title || option?.text }}
|
|
26
|
+
</slot>
|
|
27
|
+
</label>
|
|
28
|
+
</div>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>
|
|
35
|
+
import { computed } from 'vue';
|
|
36
|
+
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
/**
|
|
39
|
+
* The legend for the menu.
|
|
40
|
+
*/
|
|
41
|
+
legend: String,
|
|
42
|
+
/**
|
|
43
|
+
* An array of options for the menu.
|
|
44
|
+
*/
|
|
45
|
+
options: Array,
|
|
46
|
+
/**
|
|
47
|
+
* Use compact modifier on menu stack
|
|
48
|
+
*/
|
|
49
|
+
compact: Boolean,
|
|
50
|
+
/**
|
|
51
|
+
* The type of input to use ('checkbox' or 'radio').
|
|
52
|
+
*/
|
|
53
|
+
type: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'checkbox',
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* The value of the menu (for v-model).
|
|
59
|
+
*/
|
|
60
|
+
modelValue: [String, Array],
|
|
61
|
+
/**
|
|
62
|
+
* If true, the input elements will be visually hidden.
|
|
63
|
+
*/
|
|
64
|
+
hideInputs: Boolean
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits(['update:modelValue']);
|
|
68
|
+
|
|
69
|
+
const name = computed(() => props.legend ? props.legend.toLowerCase().replace(/\s+/g, '-') : `menu-${ Math.random().toString(36).substring(7) }`);
|
|
70
|
+
const legendId = computed(() => name.value ? `${name.value}-legend` : null);
|
|
71
|
+
const groupRole = computed(() => props.type === 'radio' ? 'radiogroup' : 'group');
|
|
72
|
+
|
|
73
|
+
const getId = (option) => `${name.value}-${option.uid}`;
|
|
74
|
+
|
|
75
|
+
const isChecked = (option) => {
|
|
76
|
+
if (props.type === 'radio') {
|
|
77
|
+
return props.modelValue === option.uid;
|
|
78
|
+
}
|
|
79
|
+
if (Array.isArray(props.modelValue)) {
|
|
80
|
+
return props.modelValue.includes(option.uid);
|
|
81
|
+
}
|
|
82
|
+
if (props.type === 'checkbox') {
|
|
83
|
+
return option.checked || false;
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleChange = (option, event) => {
|
|
89
|
+
if (props.type === 'radio') {
|
|
90
|
+
emit('update:modelValue', option.uid);
|
|
91
|
+
} else {
|
|
92
|
+
if (Array.isArray(props.modelValue)) {
|
|
93
|
+
const newValue = [...props.modelValue];
|
|
94
|
+
const index = newValue.indexOf(option.uid);
|
|
95
|
+
if (index > -1) {
|
|
96
|
+
newValue.splice(index, 1);
|
|
97
|
+
} else {
|
|
98
|
+
newValue.push(option.uid);
|
|
99
|
+
}
|
|
100
|
+
emit('update:modelValue', newValue);
|
|
101
|
+
} else {
|
|
102
|
+
option.checked = event.target.checked;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
</script>
|
package/lib/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* - Used in main plugin and bundle exports
|
|
5
5
|
*/
|
|
6
6
|
export { default as UluAccordion } from './collapsible/UluAccordion.vue';
|
|
7
|
-
export { default as
|
|
7
|
+
export { default as UluCollapsible } from './collapsible/UluCollapsible.vue';
|
|
8
8
|
export { default as UluDropdown } from './collapsible/UluDropdown.vue';
|
|
9
9
|
export { default as UluModal } from './collapsible/UluModal.vue';
|
|
10
10
|
export { default as UluOverflowPopover } from './collapsible/UluOverflowPopover.vue';
|
|
@@ -17,6 +17,7 @@ export { default as UluAlert } from './elements/UluAlert.vue';
|
|
|
17
17
|
export { default as UluBadge } from './elements/UluBadge.vue';
|
|
18
18
|
export { default as UluBadgeStack } from './elements/UluBadgeStack.vue';
|
|
19
19
|
export { default as UluButton } from './elements/UluButton.vue';
|
|
20
|
+
export { default as UluButtonVerbose } from './elements/UluButtonVerbose.vue';
|
|
20
21
|
export { default as UluCallout } from './elements/UluCallout.vue';
|
|
21
22
|
export { default as UluCard } from './elements/UluCard.vue';
|
|
22
23
|
export { default as UluDefinitionList } from './elements/UluDefinitionList.vue';
|
|
@@ -26,7 +27,7 @@ export { default as UluList } from './elements/UluList.vue';
|
|
|
26
27
|
export { default as UluMain } from './elements/UluMain.vue';
|
|
27
28
|
export { default as UluSpokeSpinner } from './elements/UluSpokeSpinner.vue';
|
|
28
29
|
export { default as UluTag } from './elements/UluTag.vue';
|
|
29
|
-
export { default as
|
|
30
|
+
export { default as UluSelectableMenu } from './forms/UluSelectableMenu.vue';
|
|
30
31
|
export { default as UluFileDisplay } from './forms/UluFileDisplay.vue';
|
|
31
32
|
export { default as UluFormFile } from './forms/UluFormFile.vue';
|
|
32
33
|
export { default as UluFormMessage } from './forms/UluFormMessage.vue';
|
|
@@ -49,5 +50,5 @@ export { default as UluPlaceholderText } from './utils/UluPlaceholderText.vue';
|
|
|
49
50
|
export { default as UluRouteAnnouncer } from './utils/UluRouteAnnouncer.vue';
|
|
50
51
|
export { default as UluAnimateNumber } from './visualizations/UluAnimateNumber.vue';
|
|
51
52
|
export { default as UluProgressBar } from './visualizations/UluProgressBar.vue';
|
|
52
|
-
export { default as
|
|
53
|
+
export { default as UluProgressCircle } from './visualizations/UluProgressCircle.vue';
|
|
53
54
|
export * from './systems/index.js';
|
|
@@ -37,11 +37,20 @@
|
|
|
37
37
|
UluIcon
|
|
38
38
|
},
|
|
39
39
|
props: {
|
|
40
|
+
/**
|
|
41
|
+
* Icon to display next to the title.
|
|
42
|
+
*/
|
|
40
43
|
icon: String,
|
|
44
|
+
/**
|
|
45
|
+
* The alignment of the icon with the title.
|
|
46
|
+
*/
|
|
41
47
|
iconAlign: {
|
|
42
48
|
type: String,
|
|
43
49
|
default: "baseline"
|
|
44
50
|
},
|
|
51
|
+
/**
|
|
52
|
+
* Classes for the different elements in the component.
|
|
53
|
+
*/
|
|
45
54
|
classes: {
|
|
46
55
|
type: Object,
|
|
47
56
|
default: () => ({
|
|
@@ -49,11 +58,20 @@
|
|
|
49
58
|
icon: "margin-right-small"
|
|
50
59
|
})
|
|
51
60
|
},
|
|
61
|
+
/**
|
|
62
|
+
* The title to display.
|
|
63
|
+
*/
|
|
52
64
|
title: String,
|
|
65
|
+
/**
|
|
66
|
+
* The HTML element to use for the title.
|
|
67
|
+
*/
|
|
53
68
|
titleElement: {
|
|
54
69
|
type: String,
|
|
55
70
|
default: "h2"
|
|
56
71
|
},
|
|
72
|
+
/**
|
|
73
|
+
* If true, a rule will be displayed under the title.
|
|
74
|
+
*/
|
|
57
75
|
rule: Boolean
|
|
58
76
|
}
|
|
59
77
|
}
|
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
import { useRequiredInject } from '../../composables/useRequiredInject.js';
|
|
8
8
|
|
|
9
9
|
const props = defineProps({
|
|
10
|
+
/**
|
|
11
|
+
* The maximum breakpoint to show the content at.
|
|
12
|
+
*/
|
|
10
13
|
max: String,
|
|
14
|
+
/**
|
|
15
|
+
* The minimum breakpoint to show the content at.
|
|
16
|
+
*/
|
|
11
17
|
min: String,
|
|
18
|
+
/**
|
|
19
|
+
* Only show the content at this breakpoint.
|
|
20
|
+
*/
|
|
12
21
|
only: String,
|
|
13
22
|
});
|
|
14
23
|
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
aria-label="Breadcrumb"
|
|
5
5
|
v-if="items.length"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
7
|
+
<ol :class="classes.list">
|
|
8
8
|
<li v-for="(item, index) in items" :key="index" :class="classes.item">
|
|
9
9
|
<router-link
|
|
10
|
+
v-if="!item.current"
|
|
10
11
|
:to="item.to"
|
|
11
12
|
:class="classes.link"
|
|
12
13
|
:aria-current="item.current ? 'page' : null"
|
|
@@ -15,6 +16,11 @@
|
|
|
15
16
|
{{ item.title }}
|
|
16
17
|
</slot>
|
|
17
18
|
</router-link>
|
|
19
|
+
<span v-else :class="item.current">
|
|
20
|
+
<slot :item="item">
|
|
21
|
+
{{ item.title }}
|
|
22
|
+
</slot>
|
|
23
|
+
</span>
|
|
18
24
|
<template v-if="index < items.length - 1">
|
|
19
25
|
<slot name="separator">
|
|
20
26
|
<UluIcon
|
|
@@ -24,7 +30,7 @@
|
|
|
24
30
|
</slot>
|
|
25
31
|
</template>
|
|
26
32
|
</li>
|
|
27
|
-
</
|
|
33
|
+
</ol>
|
|
28
34
|
</nav>
|
|
29
35
|
</template>
|
|
30
36
|
|
|
@@ -63,6 +69,7 @@
|
|
|
63
69
|
list: "breadcrumb__list",
|
|
64
70
|
item: "breadcrumb__item",
|
|
65
71
|
link: "breadcrumb__link",
|
|
72
|
+
current: "breadcrumb__current",
|
|
66
73
|
separator: "breadcrumb__separator"
|
|
67
74
|
})
|
|
68
75
|
}
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
<li
|
|
4
4
|
v-for="(item, index) in items"
|
|
5
5
|
:key="index"
|
|
6
|
-
:class="[
|
|
6
|
+
:class="[
|
|
7
|
+
classes.item,
|
|
8
|
+
item?.classes?.item,
|
|
9
|
+
item.separatorBefore ? classes.itemSeparatorBefore : '',
|
|
10
|
+
item.separatorAfter ? classes.itemSeparatorAfter : ''
|
|
11
|
+
]"
|
|
7
12
|
>
|
|
8
13
|
<!--
|
|
9
14
|
Note: The ternary spread method below is conditionally adding certain
|
|
@@ -12,13 +17,15 @@
|
|
|
12
17
|
<component
|
|
13
18
|
:is="item.to || item.path ? 'router-link' : item.click ? 'button' : 'a'"
|
|
14
19
|
v-bind="{
|
|
15
|
-
...(item.to || item.path ? {
|
|
20
|
+
...(item.to || item.path ? {
|
|
21
|
+
to: item.to || item.path,
|
|
22
|
+
activeClass: classes.linkActive || null,
|
|
23
|
+
exactActiveClass: classes.linkExactActive || null
|
|
24
|
+
} : {}),
|
|
16
25
|
...(item.href ? { 'href' : item.href || '#' } : {}),
|
|
17
26
|
}"
|
|
18
27
|
@click="(event) => { handleItemClick(event, item) }"
|
|
19
28
|
:class="[classes.link, item?.classes?.link]"
|
|
20
|
-
:activeClass="classes.linkActive"
|
|
21
|
-
:exactActiveClass="classes.linkExactActive"
|
|
22
29
|
:aria-label="iconOnly ? item.title : null"
|
|
23
30
|
:id="item.id"
|
|
24
31
|
v-ulu-tooltip="iconOnly ? item.title : item.tooltip || null"
|
|
@@ -60,7 +67,7 @@
|
|
|
60
67
|
/**
|
|
61
68
|
* Fired anytime a item is clicked
|
|
62
69
|
*/
|
|
63
|
-
"
|
|
70
|
+
"item-click"
|
|
64
71
|
],
|
|
65
72
|
props: {
|
|
66
73
|
/**
|
|
@@ -98,7 +105,7 @@
|
|
|
98
105
|
if (item.click) {
|
|
99
106
|
item.click(event);
|
|
100
107
|
}
|
|
101
|
-
this.$emit("
|
|
108
|
+
this.$emit("item-click", { item, event });
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<component
|
|
3
3
|
class="menu-stack"
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
'menu-stack--compact' : compact
|
|
7
|
-
}"
|
|
4
|
+
:is="containerElement"
|
|
5
|
+
:class="resolvedModifiers"
|
|
8
6
|
>
|
|
9
7
|
<UluMenu
|
|
10
8
|
:items="items"
|
|
@@ -13,37 +11,58 @@
|
|
|
13
11
|
item: 'menu-stack__item',
|
|
14
12
|
link: 'menu-stack__link',
|
|
15
13
|
linkText: 'menu-stack__link-text',
|
|
16
|
-
linkIcon: 'menu-stack__link-icon'
|
|
14
|
+
linkIcon: 'menu-stack__link-icon',
|
|
15
|
+
itemSeparatorBefore: 'menu-stack__item--separator-before',
|
|
16
|
+
itemSeparatorAfter: 'menu-stack__item--separator-after'
|
|
17
17
|
}"
|
|
18
18
|
:noChildren="noChildren"
|
|
19
19
|
/>
|
|
20
|
-
</
|
|
20
|
+
</component>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script>
|
|
23
|
+
<script setup>
|
|
24
|
+
import { computed } from "vue";
|
|
24
25
|
import UluMenu from "./UluMenu.vue";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
import { useModifiers } from "../../composables/useModifiers.js";
|
|
27
|
+
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
/**
|
|
30
|
+
* Menu item (see UluMenu)
|
|
31
|
+
*/
|
|
32
|
+
items: Array,
|
|
33
|
+
/**
|
|
34
|
+
* The HTML element to use as the container (e.g., 'nav', 'div', 'aside').
|
|
35
|
+
*/
|
|
36
|
+
containerElement: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "nav"
|
|
29
39
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Hanging style menu
|
|
42
|
+
*/
|
|
43
|
+
hanging: Boolean,
|
|
44
|
+
/**
|
|
45
|
+
* Compact style menu
|
|
46
|
+
*/
|
|
47
|
+
compact: Boolean,
|
|
48
|
+
/**
|
|
49
|
+
* Don't include children of menu
|
|
50
|
+
*/
|
|
51
|
+
noChildren: Boolean,
|
|
52
|
+
/**
|
|
53
|
+
* Class modifiers (ie. 'transparent', 'secondary', etc)
|
|
54
|
+
*/
|
|
55
|
+
modifiers: [String, Array]
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const internalModifiers = computed(() => ({
|
|
59
|
+
'hanging' : props.hanging,
|
|
60
|
+
'compact' : props.compact,
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const { resolvedModifiers } = useModifiers({
|
|
64
|
+
props,
|
|
65
|
+
internal: internalModifiers,
|
|
66
|
+
baseClass: "menu-stack"
|
|
67
|
+
});
|
|
49
68
|
</script>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav v-if="items" class="pager" role="navigation" :aria-labelledby="headingId">
|
|
3
|
+
<component :is="titleElement" :id="headingId" class="hidden-visually">Pagination</component>
|
|
4
|
+
<ul class="pager__items js-pager__items">
|
|
5
|
+
<!-- First page link -->
|
|
6
|
+
<li v-if="items.first" class="pager__item pager__item--first">
|
|
7
|
+
<router-link :to="items.first.href" title="Go to first page" v-bind="items.first.attributes">
|
|
8
|
+
<span class="hidden-visually">First page</span>
|
|
9
|
+
<UluIcon icon="fas fa-angle-double-left" aria-hidden="true" />
|
|
10
|
+
</router-link>
|
|
11
|
+
</li>
|
|
12
|
+
|
|
13
|
+
<!-- Previous page link -->
|
|
14
|
+
<li v-if="items.previous" class="pager__item pager__item--previous">
|
|
15
|
+
<router-link :to="items.previous.href" title="Go to previous page" rel="prev" v-bind="items.previous.attributes">
|
|
16
|
+
<span class="hidden-visually">Previous page</span>
|
|
17
|
+
<UluIcon icon="fas fa-angle-left" aria-hidden="true" />
|
|
18
|
+
</router-link>
|
|
19
|
+
</li>
|
|
20
|
+
|
|
21
|
+
<!-- Ellipsis for previous pages -->
|
|
22
|
+
<li v-if="ellipses.previous" class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
|
23
|
+
|
|
24
|
+
<!-- Page number links -->
|
|
25
|
+
<li v-for="(item, key) in items.pages" :key="key" :class="['pager__item', { 'is-active': current == key }]">
|
|
26
|
+
<router-link :to="item.href" :title="getPageTitle(key)" v-bind="item.attributes">
|
|
27
|
+
<span class="hidden-visually">
|
|
28
|
+
{{ current == key ? 'Current page' : 'Page' }}
|
|
29
|
+
</span>
|
|
30
|
+
{{ key }}
|
|
31
|
+
</router-link>
|
|
32
|
+
</li>
|
|
33
|
+
|
|
34
|
+
<!-- Ellipsis for next pages -->
|
|
35
|
+
<li v-if="ellipses.next" class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
|
36
|
+
|
|
37
|
+
<!-- Next page link -->
|
|
38
|
+
<li v-if="items.next" class="pager__item pager__item--next">
|
|
39
|
+
<router-link :to="items.next.href" title="Go to next page" rel="next" v-bind="items.next.attributes">
|
|
40
|
+
<span class="hidden-visually">Next page</span>
|
|
41
|
+
<UluIcon icon="fas fa-angle-right" aria-hidden="true" />
|
|
42
|
+
</router-link>
|
|
43
|
+
</li>
|
|
44
|
+
|
|
45
|
+
<!-- Last page link -->
|
|
46
|
+
<li v-if="items.last" class="pager__item pager__item--last">
|
|
47
|
+
<router-link :to="items.last.href" title="Go to last page" v-bind="items.last.attributes">
|
|
48
|
+
<span class="hidden-visually">Last page</span>
|
|
49
|
+
<UluIcon icon="fas fa-angle-double-right" aria-hidden="true" />
|
|
50
|
+
</router-link>
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</nav>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script setup>
|
|
57
|
+
import UluIcon from '../elements/UluIcon.vue';
|
|
58
|
+
|
|
59
|
+
let pagerCounter = 0;
|
|
60
|
+
|
|
61
|
+
const props = defineProps({
|
|
62
|
+
/**
|
|
63
|
+
* The HTML element to use for the visually hidden title.
|
|
64
|
+
*/
|
|
65
|
+
titleElement: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'h4'
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* List of pager items.
|
|
71
|
+
*/
|
|
72
|
+
items: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: () => ({})
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* The page number of the current page.
|
|
78
|
+
*/
|
|
79
|
+
current: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: 1
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Ellipses configuration.
|
|
85
|
+
*/
|
|
86
|
+
ellipses: {
|
|
87
|
+
type: Object,
|
|
88
|
+
default: () => ({})
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const headingId = `ulu-pager-${ pagerCounter++ }`;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generates the title for a page link.
|
|
96
|
+
* @param {string|number} key - The page number.
|
|
97
|
+
* @returns {string} The title for the page link.
|
|
98
|
+
*/
|
|
99
|
+
function getPageTitle(key) {
|
|
100
|
+
return props.current == key ? 'Current page' : `Go to page ${key}`;
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BibliographyList">
|
|
3
|
+
<LayoutListPage title="Bibliography" icon="type:bibliography">
|
|
4
|
+
<template #intro>
|
|
5
|
+
<AppContent uid="bibliographyIntroduction" />
|
|
6
|
+
</template>
|
|
7
|
+
<template #default>
|
|
8
|
+
<UluFacetsSidebarLayout>
|
|
9
|
+
<template #sidebar>
|
|
10
|
+
<UluFacetsSearch v-model="searchValue" />
|
|
11
|
+
<UluFacetsSort v-model="selectedSort" :sort-types="sortTypes" />
|
|
12
|
+
<UluFacetsFilterLists :facets="facets" @facet-change="handleFacetChange" />
|
|
13
|
+
</template>
|
|
14
|
+
<template #main>
|
|
15
|
+
<UluFacetsResults :items="paginatedItems">
|
|
16
|
+
<template #item="{ item }">
|
|
17
|
+
<div class="source-item">
|
|
18
|
+
<h3>{{ item.title || "NO TITLE" }}</h3>
|
|
19
|
+
<div>
|
|
20
|
+
<PortableText v-if="item.citation" :value="item.citation" />
|
|
21
|
+
</div>
|
|
22
|
+
<small v-if="item.publicationDate">Published on: {{ item.publicationDate }}</small>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</UluFacetsResults>
|
|
26
|
+
<UluPager
|
|
27
|
+
v-if="totalPages > 1"
|
|
28
|
+
:items="pagerItems"
|
|
29
|
+
:current="currentPage"
|
|
30
|
+
:ellipses="pagerEllipses"
|
|
31
|
+
class="mt-4"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
</UluFacetsSidebarLayout>
|
|
35
|
+
</template>
|
|
36
|
+
</LayoutListPage>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup>
|
|
41
|
+
import { ref } from "vue";
|
|
42
|
+
import { PortableText } from "@portabletext/vue";
|
|
43
|
+
import sources from "@/api/virtual/sources.js?virtual-module";
|
|
44
|
+
import {
|
|
45
|
+
useFacets,
|
|
46
|
+
usePagination,
|
|
47
|
+
UluFacetsSidebarLayout,
|
|
48
|
+
UluFacetsFilterLists,
|
|
49
|
+
UluFacetsSort,
|
|
50
|
+
UluFacetsSearch,
|
|
51
|
+
UluFacetsResults
|
|
52
|
+
} from "@ulu/frontend-vue";
|
|
53
|
+
|
|
54
|
+
const sorterDateLatest = (a, b) => new Date(b.publicationDate) - new Date(a.publicationDate);
|
|
55
|
+
|
|
56
|
+
const config = {
|
|
57
|
+
facetFields: [
|
|
58
|
+
{ name: "Chapters", uid: "chapters", open: false, getValue: item => item.chapters?.map(c => c.uuid) },
|
|
59
|
+
{ name: "Types", uid: "types", open: true },
|
|
60
|
+
{ name: "Topics", uid: "topics", open: true },
|
|
61
|
+
{ name: "Citation Type", uid: "citationType", open: true },
|
|
62
|
+
{ name: "Source Type", uid: "sourceType", open: true },
|
|
63
|
+
{ name: "Authors", uid: "authors", open: false },
|
|
64
|
+
{ name: "Source Name", uid: "sourceName", open: false }
|
|
65
|
+
],
|
|
66
|
+
extraSortTypes: {
|
|
67
|
+
newest: {
|
|
68
|
+
text: "Date (Newest)",
|
|
69
|
+
sort: items => [...items].sort(sorterDateLatest)
|
|
70
|
+
},
|
|
71
|
+
oldest: {
|
|
72
|
+
text: "Date (Oldest)",
|
|
73
|
+
sort: items => [...items].sort(sorterDateLatest).reverse()
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
initialSortType: "az",
|
|
77
|
+
// Remove quotes and stuff from beginning when sorting
|
|
78
|
+
getSortValue: item => item.title ? item.title.replace(/^[^A-Za-z0-9]+/, "") : "",
|
|
79
|
+
searchOptions: {
|
|
80
|
+
keys: ["title", "authors", "sourceName", "topics", "types", "citation"]
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const itemsPerPage = 20;
|
|
85
|
+
|
|
86
|
+
const {
|
|
87
|
+
facets,
|
|
88
|
+
searchValue,
|
|
89
|
+
selectedSort,
|
|
90
|
+
sortTypes,
|
|
91
|
+
displayItems,
|
|
92
|
+
handleFacetChange,
|
|
93
|
+
} = useFacets(ref(sources), config);
|
|
94
|
+
|
|
95
|
+
const {
|
|
96
|
+
currentPage,
|
|
97
|
+
totalPages,
|
|
98
|
+
paginatedItems,
|
|
99
|
+
pagerItems,
|
|
100
|
+
pagerEllipses
|
|
101
|
+
} = usePagination(displayItems, itemsPerPage);
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style lang="scss">
|
|
105
|
+
// Add some basic styling for the item display
|
|
106
|
+
.source-item {
|
|
107
|
+
padding: 1rem;
|
|
108
|
+
border-bottom: 1px solid #eee;
|
|
109
|
+
|
|
110
|
+
h3 {
|
|
111
|
+
margin: 0 0 0.5rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
p {
|
|
115
|
+
margin: 0 0 0.5rem;
|
|
116
|
+
font-style: italic;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</style>
|