@leaflink/stash 53.4.6 → 53.4.8
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/AppSidebar.js +56 -52
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewToolbar.js +139 -125
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +1114 -1113
- package/dist/DatePicker.js.map +1 -1
- package/dist/Modal.js +105 -89
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +30 -26
- package/dist/Modals.js.map +1 -1
- package/dist/MoreActions.js +294 -288
- package/dist/MoreActions.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/RadioGroup.js +69 -62
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +27 -25
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +103 -101
- package/dist/Select.js.map +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
- package/dist/Thumbnail.js +42 -42
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailGroup.js +24 -22
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/Timeline.js +15 -13
- package/dist/Timeline.js.map +1 -1
- package/dist/Toast.vue.d.ts +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js.map → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js.map} +1 -1
- package/dist/components.css +1 -1
- package/dist/getContrastingTextColor.d.ts +8 -0
- package/dist/index-t9tXBnql.js +469 -0
- package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
- package/dist/templateRefNarrowing-CeANDylX.js +22 -0
- package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
- package/dist/useMediaQuery.d.ts +12 -10
- package/dist/useMediaQuery.js +7 -29
- package/dist/useMediaQuery.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/dist/useValidation.d.ts +11 -1
- package/dist/useValidation.js +240 -198
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/getContrastingTextColor.js +36 -24
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/package.json +1 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
- package/dist/index-DA70nQCT.js +0 -424
package/dist/AppSidebar.js
CHANGED
|
@@ -1,94 +1,98 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as C, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as B, useSlots as C, computed as h, ref as O, watchEffect as $, createElementBlock as t, openBlock as a, normalizeClass as _, createVNode as o, Transition as b, withCtx as g, withDirectives as y, withModifiers as M, vShow as x, createElementVNode as p, createCommentVNode as d, renderSlot as i, unref as c } from "vue";
|
|
2
|
+
import { a as V } from "./index-t9tXBnql.js";
|
|
3
|
+
import z from "./Backdrop.js";
|
|
4
|
+
import N from "./Divider.js";
|
|
5
|
+
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const A = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "px-3 pt-6"
|
|
9
|
-
},
|
|
9
|
+
}, D = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "px-3 pt-6"
|
|
12
12
|
}, P = {
|
|
13
13
|
key: 2,
|
|
14
14
|
class: "pt-6"
|
|
15
|
-
},
|
|
15
|
+
}, L = {
|
|
16
16
|
role: "menubar",
|
|
17
17
|
"aria-orientation": "vertical"
|
|
18
|
-
},
|
|
18
|
+
}, Q = /* @__PURE__ */ B({
|
|
19
19
|
__name: "AppSidebar",
|
|
20
20
|
props: {
|
|
21
21
|
isOpen: { type: Boolean, default: !1 }
|
|
22
22
|
},
|
|
23
23
|
emits: ["dismiss", "update:is-open"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
|
|
24
|
+
setup(k, { emit: w }) {
|
|
25
|
+
const u = k, n = C(), f = w, l = V("screen and (min-width: 1321px)"), s = h(() => u.isOpen && !l.value), r = O({ height: "", overflow: "" }), m = h(() => u.isOpen || l.value);
|
|
26
|
+
function S() {
|
|
27
|
+
f("dismiss"), f("update:is-open", !1);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return document.scrollingElement || document.body;
|
|
29
|
+
function E() {
|
|
30
|
+
return typeof document > "u" ? null : document.scrollingElement || document.body;
|
|
31
31
|
}
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
return $(() => {
|
|
33
|
+
if (l.value) return;
|
|
34
|
+
const e = E();
|
|
35
|
+
e && (s.value && Object.assign(r.value, {
|
|
36
|
+
overflow: e.style.overflow,
|
|
37
|
+
height: e.style.height
|
|
38
|
+
}), Object.assign(e.style, {
|
|
39
|
+
overflow: s.value ? "hidden" : r.value.overflow,
|
|
38
40
|
// Prevents page from scrolling when AppSidebar is open
|
|
39
|
-
height:
|
|
41
|
+
height: s.value ? "100%" : r.value.height
|
|
40
42
|
// Ensures the backdrop covers the entire page when AppSidebar is open
|
|
41
43
|
}));
|
|
42
|
-
}), (
|
|
44
|
+
}), (e, v) => (a(), t("div", {
|
|
43
45
|
id: "stash-app-sidebar",
|
|
44
|
-
class:
|
|
45
|
-
"stash-app-sidebar--is-open":
|
|
46
|
-
"z-modal":
|
|
47
|
-
"z-[301]": !
|
|
46
|
+
class: _(["stash-app-sidebar relative", {
|
|
47
|
+
"stash-app-sidebar--is-open": m.value,
|
|
48
|
+
"z-modal": s.value,
|
|
49
|
+
"z-[301]": !s.value
|
|
48
50
|
}]),
|
|
49
51
|
"data-test": "stash-app-sidebar"
|
|
50
52
|
}, [
|
|
51
|
-
o(
|
|
52
|
-
default:
|
|
53
|
-
|
|
53
|
+
o(b, { name: "backdrop" }, {
|
|
54
|
+
default: g(() => [
|
|
55
|
+
y(o(z, {
|
|
54
56
|
class: "stash-app-sidebar__backdrop",
|
|
55
|
-
onClick:
|
|
57
|
+
onClick: M(S, ["stop"])
|
|
56
58
|
}, null, 512), [
|
|
57
|
-
[
|
|
59
|
+
[x, s.value]
|
|
58
60
|
])
|
|
59
61
|
]),
|
|
60
62
|
_: 1
|
|
61
63
|
}),
|
|
62
|
-
o(
|
|
63
|
-
default:
|
|
64
|
-
|
|
65
|
-
class:
|
|
64
|
+
o(b, { name: "aside" }, {
|
|
65
|
+
default: g(() => [
|
|
66
|
+
y(p("aside", {
|
|
67
|
+
class: _(["stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500", { "shadow-3xl": s.value }]),
|
|
66
68
|
"data-test": "stash-app-sidebar__aside"
|
|
67
69
|
}, [
|
|
68
|
-
o(
|
|
69
|
-
|
|
70
|
-
i(
|
|
71
|
-
])) :
|
|
72
|
-
|
|
73
|
-
i(
|
|
74
|
-
])) :
|
|
75
|
-
|
|
76
|
-
p("ul",
|
|
77
|
-
i(
|
|
70
|
+
o(N, { class: "stash-app-sidebar__divider" }),
|
|
71
|
+
c(n)["app-context"] ? (a(), t("div", A, [
|
|
72
|
+
i(e.$slots, "app-context")
|
|
73
|
+
])) : d("", !0),
|
|
74
|
+
c(n)["company-context"] ? (a(), t("div", D, [
|
|
75
|
+
i(e.$slots, "company-context")
|
|
76
|
+
])) : d("", !0),
|
|
77
|
+
c(n).navigation ? (a(), t("nav", P, [
|
|
78
|
+
p("ul", L, [
|
|
79
|
+
i(e.$slots, "navigation")
|
|
78
80
|
])
|
|
79
|
-
])) :
|
|
80
|
-
|
|
81
|
-
i(
|
|
81
|
+
])) : d("", !0),
|
|
82
|
+
v[0] || (v[0] = p("div", { class: "flex-1" }, null, -1)),
|
|
83
|
+
i(e.$slots, "footer")
|
|
82
84
|
], 2), [
|
|
83
|
-
[
|
|
85
|
+
[x, m.value]
|
|
84
86
|
])
|
|
85
87
|
]),
|
|
86
88
|
_: 3
|
|
87
89
|
})
|
|
88
90
|
], 2));
|
|
89
91
|
}
|
|
90
|
-
}),
|
|
92
|
+
}), T = {}, q = {
|
|
93
|
+
$style: T
|
|
94
|
+
}, K = /* @__PURE__ */ j(Q, [["__cssModules", q]]);
|
|
91
95
|
export {
|
|
92
|
-
|
|
96
|
+
K as default
|
|
93
97
|
};
|
|
94
98
|
//# sourceMappingURL=AppSidebar.js.map
|
package/dist/AppSidebar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.js","sources":["../src/components/AppSidebar/AppSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useSlots, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Divider from '../Divider/Divider.vue';\n\n export interface AppSidebarProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n isOpen?: boolean;\n }\n\n const props = withDefaults(defineProps<AppSidebarProps>(), {\n isOpen: false,\n });\n\n const slots = useSlots();\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'dismiss'): void;\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n const isExtraLargeScreen = useMediaQuery('screen and (min-width: 1321px)');\n const isBackdropVisible = computed(() => props.isOpen && !isExtraLargeScreen.value);\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const isSidebarOpen = computed(() => props.isOpen || isExtraLargeScreen.value);\n\n function onBackdropClick() {\n emit('dismiss');\n emit('update:is-open', false);\n }\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watchEffect(() => {\n if (isExtraLargeScreen.value)
|
|
1
|
+
{"version":3,"file":"AppSidebar.js","sources":["../src/components/AppSidebar/AppSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useSlots, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Divider from '../Divider/Divider.vue';\n\n export interface AppSidebarProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n isOpen?: boolean;\n }\n\n const props = withDefaults(defineProps<AppSidebarProps>(), {\n isOpen: false,\n });\n\n const slots = useSlots();\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'dismiss'): void;\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n const isExtraLargeScreen = useMediaQuery('screen and (min-width: 1321px)');\n const isBackdropVisible = computed(() => props.isOpen && !isExtraLargeScreen.value);\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const isSidebarOpen = computed(() => props.isOpen || isExtraLargeScreen.value);\n\n function onBackdropClick() {\n emit('dismiss');\n emit('update:is-open', false);\n }\n\n function getPageScrollingElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watchEffect(() => {\n if (isExtraLargeScreen.value) return;\n\n const el = getPageScrollingElement();\n if (!el) return;\n\n if (isBackdropVisible.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n overflow: el.style.overflow,\n height: el.style.height,\n });\n }\n\n Object.assign(el.style, {\n overflow: isBackdropVisible.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when AppSidebar is open\n height: isBackdropVisible.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when AppSidebar is open\n });\n });\n</script>\n\n<template>\n <div\n id=\"stash-app-sidebar\"\n class=\"stash-app-sidebar relative\"\n :class=\"{\n 'stash-app-sidebar--is-open': isSidebarOpen,\n 'z-modal': isBackdropVisible,\n 'z-[301]': !isBackdropVisible,\n }\"\n data-test=\"stash-app-sidebar\"\n >\n <Transition name=\"backdrop\">\n <Backdrop v-show=\"isBackdropVisible\" class=\"stash-app-sidebar__backdrop\" @click.stop=\"onBackdropClick\" />\n </Transition>\n <Transition name=\"aside\">\n <aside\n v-show=\"isSidebarOpen\"\n class=\"stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500\"\n :class=\"{ 'shadow-3xl': isBackdropVisible }\"\n data-test=\"stash-app-sidebar__aside\"\n >\n <Divider class=\"stash-app-sidebar__divider\" />\n <div v-if=\"slots['app-context']\" class=\"px-3 pt-6\">\n <!-- @slot App Context component slot, ideally for rendering the context switcher -->\n <slot name=\"app-context\"></slot>\n </div>\n <div v-if=\"slots['company-context']\" class=\"px-3 pt-6\">\n <!-- @slot Company Context component slot, ideally for rendering the company picker -->\n <slot name=\"company-context\"></slot>\n </div>\n <nav v-if=\"slots['navigation']\" class=\"pt-6\">\n <ul role=\"menubar\" aria-orientation=\"vertical\">\n <!-- @slot Navigation component slot, for rendering navigation items -->\n <slot name=\"navigation\"></slot>\n </ul>\n </nav>\n <div class=\"flex-1\"></div>\n <!-- @slot Footer component slot, for rendering version/environment notes -->\n <slot name=\"footer\"></slot>\n </aside>\n </Transition>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__aside) {\n padding-top: calc(var(--height-topbar) - 1px); /* -1px to compensate for the border height */\n width: var(--width-sidebar);\n }\n\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__divider::before),\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__divider::after) {\n border-bottom: 1px solid rgb(255 255 255 / 12%);\n }\n\n :global(:where(.stash-app-sidebar) .backdrop-enter-active),\n :global(:where(.stash-app-sidebar) .backdrop-leave-active) {\n transition: opacity 200ms ease-in-out;\n }\n\n :global(:where(.stash-app-sidebar) .backdrop-enter-from),\n :global(:where(.stash-app-sidebar) .backdrop-leave-to) {\n opacity: 0;\n }\n\n :global(:where(.stash-app-sidebar) .aside-enter-active),\n :global(:where(.stash-app-sidebar) .aside-leave-active) {\n transition:\n opacity 200ms ease-in-out,\n transform 200ms ease-in-out;\n }\n\n :global(:where(.stash-app-sidebar) .aside-enter-from),\n :global(:where(.stash-app-sidebar) .aside-leave-to) {\n opacity: 0;\n transform: translateX(-20%);\n }\n }\n</style>\n"],"names":["props","__props","slots","useSlots","emit","__emit","isExtraLargeScreen","useMediaQuery","isBackdropVisible","computed","initialPageScrollingElementStyle","ref","isSidebarOpen","onBackdropClick","getPageScrollingElement","watchEffect","el","_createElementBlock","_createVNode","_Transition","Backdrop","_createElementVNode","_normalizeClass","Divider","_unref","_openBlock","_hoisted_1","_renderSlot","_ctx","_hoisted_2","_hoisted_3","_hoisted_4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcE,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAERC,IAAOC,GAQPC,IAAqBC,EAAc,gCAAgC,GACnEC,IAAoBC,EAAS,MAAMT,EAAM,UAAU,CAACM,EAAmB,KAAK,GAC5EI,IAAmCC,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEC,IAAgBH,EAAS,MAAMT,EAAM,UAAUM,EAAmB,KAAK;AAE7E,aAASO,IAAkB;AACzB,MAAAT,EAAK,SAAS,GACdA,EAAK,kBAAkB,EAAK;AAAA,IAC9B;AAEA,aAASU,IAA8C;AACrD,aAAI,OAAO,WAAa,MAAoB,OACpC,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,WAAAC,EAAY,MAAM;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AA,iBAAA;AAAA,YAAA;YAE3BJ,EAAAtB,CAAA,EAAK,cAAhBuB,EAAA,GAAAR,EAKM,OALNa,GAKM;AAAA,cAJJT,EAGK,MAHLU,GAGK;AAAA,gBADHJ,EAA+BC,EAAA,QAAA,YAAA;AAAA,cAAA;;4BAGnCP,EAA0B,OAAA,EAArB,OAAM,SAAA,GAAQ,MAAA,EAAA;AAAA,YAEnBM,EAA2BC,EAAA,QAAA,QAAA;AAAA,UAAA;gBAtBnBhB,EAAA,KAAa;AAAA,UAAA;;;;;;;;;"}
|
package/dist/AppTopbar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, createElementBlock as f, openBlock as h, createElementVNode as e, normalizeClass as i, createVNode as a, unref as b, renderSlot as o } from "vue";
|
|
2
|
-
import u from "./
|
|
2
|
+
import { a as u } from "./index-t9tXBnql.js";
|
|
3
3
|
import x from "./Icon.js";
|
|
4
4
|
import { _ as l } from "./Logo.vue_vue_type_script_setup_true_lang-qiNaaWWV.js";
|
|
5
5
|
const _ = {
|
package/dist/Copy.js
CHANGED
|
@@ -5,7 +5,7 @@ import { t as f } from "./locale.js";
|
|
|
5
5
|
import _ from "./Button.js";
|
|
6
6
|
import x from "./Icon.js";
|
|
7
7
|
import $ from "./IconLabel.js";
|
|
8
|
-
import { _ as N } from "./Tooltip.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { _ as N } from "./Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js";
|
|
9
9
|
import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const U = /* @__PURE__ */ w({
|
|
11
11
|
__name: "Copy",
|
package/dist/DataViewFilters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as B, computed as C, defineComponent as j, useSlots as O, inject as z, provide as J, watch as Q, createBlock as m, openBlock as f, normalizeClass as U, unref as t, withCtx as u, createCommentVNode as p, createElementBlock as Z, mergeProps as $, createElementVNode as A, renderSlot as G, createVNode as I, createTextVNode as k, toDisplayString as w } from "vue";
|
|
2
|
-
import q from "./
|
|
2
|
+
import { a as q } from "./index-t9tXBnql.js";
|
|
3
3
|
import { SCREEN_SIZES as H } from "./constants.js";
|
|
4
4
|
import { t as d } from "./locale.js";
|
|
5
5
|
import { _ as K } from "./Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataViewFilters.js","sources":["../src/components/DataViewFilters/DataViewFilters.types.ts","../src/components/DataViewFilters/useFilters.ts","../src/components/DataViewFilters/DataViewFilters.vue"],"sourcesContent":["import { UseFiltersReturnType } from './useFilters';\n\n/**\n * A function that is called when the user clicks one of the \"Apply\" buttons in DataViewFilters.\n *\n * A return value of `{ preventDismiss: true }` can be used to prevent the DataViewFilters drawer or a FilterDropdown from closing, such as when some filters have invalid values.\n */\nexport type OnApplyFilters = () => Promise<{ preventDismiss?: boolean } | void> | { preventDismiss?: boolean } | void;\n\nexport enum DrawerStyle {\n /** Displays all groups and their fields without the need for navigating submenus. */\n Cascade = 'cascade',\n /** Displays only group names or fields; navigation between the group names and a submenu of fields is required. */\n Nested = 'nested',\n}\n\nexport type DrawerStyles = `${DrawerStyle}`;\n\nexport interface DataViewFiltersUtilsInjection {\n useFiltersInstance?: UseFiltersReturnType;\n drawerStyle?: DrawerStyles;\n}\n","import cloneDeep from 'lodash-es/cloneDeep';\nimport { computed, ComputedRef, Ref, ref } from 'vue';\n\nimport isDefined from '../../composables/useValidation/utils/isDefined';\nimport DataView from '../DataView/DataView.vue';\n\ntype DataViewInstance = InstanceType<typeof DataView>;\n\n/**\n * Contains metadata and configuration for the filters.\n * @see https://www.typescriptlang.org/docs/handbook/2/mapped-types.html\n */\nexport type UseFiltersSchema<Values extends object, Groups extends string> = {\n [Property in keyof Values]: {\n defaultValue?: Values[Property];\n group?: Groups;\n isActive?: (value: Values[Property]) => boolean;\n };\n};\n\nexport interface UseFiltersArgs<Values extends object, Groups extends string> {\n schema: UseFiltersSchema<Values, Groups>;\n /** A ref for an instance of DataView */\n dataViewRef: Ref<unknown>; // Note: using `Ref<InstanceType<typeof DataView>>` here causes type errors when providing a value for this argument\n}\n\nexport interface UseFiltersReturnType<Values = object, Groups extends string = string> {\n applyFilters: () => void;\n resetAllFilters: () => void;\n resetFilterGroup: (group: string) => void; // Note: group is intentionally not typed as `Groups` since there is no way to pass in a Groups type to UseFiltersReturnType within DataViewFilters.vue\n undoWorkingFilters: () => void;\n activeFiltersCounts: ComputedRef<Record<Groups, number>>;\n totalActiveFiltersCount: ComputedRef<number>;\n appliedFilters: Ref<Values>;\n workingFilters: Ref<Values>;\n}\n\n/**\n * Provides utility functions for working with `DataViewFilters`.\n */\nexport function useFilters<Values extends object, Groups extends string>({\n schema,\n dataViewRef,\n}: UseFiltersArgs<Values, Groups>): UseFiltersReturnType<Values, Groups> {\n const appliedFilters = ref({}) as Ref<Values>;\n const workingFilters = ref({}) as Ref<Values>;\n\n for (const filterName in schema) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n\n const dvRef = dataViewRef as Ref<DataViewInstance>;\n\n /**\n * For when an \"Apply\" button is clicked. It does the following:\n * 1) applies the working filter state\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function applyFilters() {\n appliedFilters.value = cloneDeep(workingFilters.value);\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * For when a \"Reset all\" button is clicked. It does the following:\n * 1) applies the defaultValue filter values to all filters\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function resetAllFilters() {\n for (const filterName in schema) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * For when a \"Reset\" button is clicked. It does the following:\n * 1) applies the defaultValue filter values to the given filter group\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function resetFilterGroup(group: Groups) {\n for (const filterName in schema) {\n if (schema[filterName].group === group) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n }\n\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * Resets the `workingFilters` to match the `appliedFilters`. This can be used when the FilterDrawer or a FilterDropdown is dismissed without clicking \"Reset\" or \"Apply\".\n */\n function undoWorkingFilters() {\n workingFilters.value = cloneDeep(appliedFilters.value);\n }\n\n const activeFiltersCounts = computed(() => {\n const counts = {} as Record<Groups, number>;\n\n for (const filterName in schema) {\n const config = schema[filterName];\n const value = appliedFilters.value[filterName];\n const isActive = config.isActive?.(value) || isDefined(value);\n\n if (isActive && config.group) {\n counts[config.group] = (counts[config.group] ?? 0) + 1;\n }\n }\n\n return counts;\n });\n\n const totalActiveFiltersCount = computed(() => {\n let count = 0;\n\n for (const filterName in schema) {\n const config = schema[filterName];\n const value = appliedFilters.value[filterName];\n const isActive = config.isActive?.(value) || isDefined(value);\n\n if (isActive) {\n count += 1;\n }\n }\n\n return count;\n });\n\n return {\n applyFilters,\n resetAllFilters,\n // @ts-expect-error \"could be instantiated with a different subtype\": TODO: figure out how to resolve the types\n resetFilterGroup,\n undoWorkingFilters,\n activeFiltersCounts,\n totalActiveFiltersCount,\n appliedFilters,\n workingFilters,\n };\n}\n\nexport default useFilters;\n","<script lang=\"ts\">\n export * from './DataViewFilters.keys';\n export * from './DataViewFilters.types';\n export * from './useFilters';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, ref, watch } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import { SCREEN_SIZES } from '../../constants';\n import { t } from '../../locale';\n import Box from '../Box/Box.vue';\n import Button from '../Button/Button.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import FilterChip from '../FilterChip/FilterChip.vue';\n import Icon from '../Icon/Icon.vue';\n import Label from '../Label/Label.vue';\n import Modal, { type ModalProps } from '../Modal/Modal.vue';\n import SearchBar, { SearchBarProps } from '../SearchBar/SearchBar.vue';\n import { DATA_VIEW_FILTERS_UTILS_INJECTION } from './DataViewFilters.keys';\n import type { DrawerStyles, OnApplyFilters } from './DataViewFilters.types';\n import type { UseFiltersReturnType } from './useFilters';\n\n export interface DataViewFiltersProps {\n filtersLabelText?: string;\n /**\n * Props to pass to the `SearchBar` component.\n */\n searchBarProps?: SearchBarProps;\n showSearch?: boolean;\n /** 'cascade' displays all fields within every filter group; 'nested' displays only the group names and requires clicking a group to view its fields. */\n drawerStyle?: DrawerStyles;\n drawerProps?: ModalProps;\n /**\n * @deprecated The `activeGroup` prop is a sufficient replacement for this prop. A falsy `activeGroup` will hide the button and a truthy `activeGroup` will show it (when the `drawerStyle` is 'nested').\n *\n * **Note:** This prop has no effect when using a \"cascade\" `drawerStyle`.\n */\n showDrawerPreviousButton?: boolean;\n /**\n * Required when using filters. This prop should contain the return value of the `useFilters()` composable.\n */\n useFiltersInstance?: UseFiltersReturnType;\n onApply?: OnApplyFilters;\n /**\n * The name of the active filter group. The active filter group is determined by which instance of FilterDropdown or FilterDrawerItem is open.\n *\n * **Note:** This prop is required when using a \"nested\" `drawerStyle`, but has no effect when using a \"cascade\" `drawerStyle`.\n */\n activeGroup?: string;\n }\n\n export interface DataViewFiltersSlots {\n default?: () => unknown;\n drawer?: () => unknown;\n 'filters-label'?: () => unknown;\n }\n\n const props = withDefaults(defineProps<DataViewFiltersProps>(), {\n filtersLabelText: t('ll.filterBy'),\n isLoading: false,\n drawerStyle: 'cascade',\n drawerProps: undefined,\n searchBarProps: undefined,\n showDrawerPreviousButton: false,\n showSearch: true,\n useFiltersInstance: undefined,\n onApply: undefined,\n activeGroup: undefined,\n });\n\n const emit = defineEmits<{\n /** When the drawer is opened */\n (e: 'open-drawer'): void;\n /** When the drawer is dismissed */\n (e: 'dismiss'): void;\n /** When the \"Previous\" button in the header is clicked */\n (e: 'previous'): void;\n /** When the \"Reset\" button is clicked while viewing a filter group */\n (e: 'reset-group'): void;\n /** When one of the \"Reset All\" buttons is clicked */\n (e: 'reset-all'): void;\n }>();\n\n const slots = defineSlots<DataViewFiltersSlots>();\n\n const isDesktop = useMediaQuery(`(min-width: ${SCREEN_SIZES.lg})`);\n const isViewingGroupsMenu = computed(() => props.drawerStyle === 'nested' && !props.activeGroup);\n const isViewingSingleGroup = computed(() => props.drawerStyle === 'nested' && props.activeGroup);\n\n const {\n density,\n isLoading: isDataViewLoading,\n isWithinModule,\n currentSearch,\n updateCurrentSearch,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n provide(DATA_VIEW_FILTERS_UTILS_INJECTION.key, {\n useFiltersInstance: props.useFiltersInstance,\n drawerStyle: props.drawerStyle,\n });\n\n const totalActiveFiltersCount = computed(() => props.useFiltersInstance?.totalActiveFiltersCount.value ?? 0);\n /** The number of active filters in the currently active group. This is only used when the drawerStyle is 'nested'. */\n const activeGroupActiveFiltersCount = computed(\n () => Number(props.activeGroup && props.useFiltersInstance?.activeFiltersCounts.value[props.activeGroup]) || 0,\n );\n const isDrawerOpen = ref(false);\n\n async function handleApplyClick() {\n const { preventDismiss } = (await props.onApply?.()) || props.useFiltersInstance?.applyFilters() || {};\n\n if (!preventDismiss) {\n isDrawerOpen.value = false;\n }\n }\n\n function handleResetGroupClick() {\n if (!props.activeGroup) {\n return;\n }\n\n props.useFiltersInstance?.resetFilterGroup(props.activeGroup);\n emit('reset-group');\n isDrawerOpen.value = false;\n }\n\n function handleResetAllClick() {\n props.useFiltersInstance?.resetAllFilters();\n emit('reset-all');\n isDrawerOpen.value = false;\n }\n\n function onDismiss() {\n props.useFiltersInstance?.undoWorkingFilters();\n isDrawerOpen.value = false;\n emit('dismiss');\n }\n\n watch(isDrawerOpen, () => {\n if (isDrawerOpen.value) {\n emit('open-drawer');\n }\n });\n</script>\n\n<template>\n <Box\n class=\"stash-data-view-filters grid grid-cols-12 gap-6 p-3\"\n :class=\"{ 'lg:p-6': density === 'comfortable', 'mb-3': !isWithinModule }\"\n :radius=\"isWithinModule ? 'none' : 'rounded'\"\n data-test=\"stash-data-view-filters\"\n disable-padding\n >\n <SearchBar\n v-if=\"props.showSearch\"\n class=\"col-span-12 md:col-span-6 lg:col-span-4\"\n data-test=\"stash-data-view-filters|search-bar\"\n :is-loading=\"isDataViewLoading\"\n :label=\"t('ll.search')\"\n :model-value=\"currentSearch\"\n v-bind=\"props.searchBarProps\"\n @search=\"(searchTerm) => updateCurrentSearch(searchTerm, { shouldEmit: true })\"\n />\n <div\n v-if=\"slots.default\"\n class=\"col-span-12 row-start-2 md:col-start-7 md:row-start-1 lg:col-span-8 lg:col-start-5\"\n >\n <div class=\"hidden md:block\">\n <slot name=\"filters-label\">\n <Label>{{ props.filtersLabelText }}</Label>\n </slot>\n </div>\n <div class=\"flex gap-4\">\n <FilterChip\n secondary\n class=\"!md:inline-flex !flex w-full justify-center gap-4 md:w-auto\"\n data-test=\"stash-data-view-filters|drawer-toggle-button\"\n :filter-count=\"totalActiveFiltersCount\"\n @click=\"isDrawerOpen = true\"\n >\n <span class=\"inline-flex items-center gap-3\">\n <Icon name=\"filter-line\" class=\"text-ice-700\" />\n <span>{{ t('ll.filters') }}</span>\n </span>\n </FilterChip>\n <slot v-if=\"isDesktop\"></slot>\n <Button v-if=\"totalActiveFiltersCount > 0 && isDesktop\" inline @click=\"handleResetAllClick\">\n {{ t('ll.resetAll') }}\n </Button>\n </div>\n </div>\n <Modal\n v-if=\"slots.drawer\"\n data-test=\"stash-data-view-filters|drawer\"\n disable-body-padding\n position=\"right\"\n size=\"narrow\"\n :is-open=\"isDrawerOpen\"\n :title=\"t('ll.allFilters')\"\n v-bind=\"props.drawerProps\"\n @dismiss=\"onDismiss\"\n >\n <template #headerAction>\n <Button\n v-if=\"isViewingSingleGroup\"\n icon\n class=\"text-ice-100\"\n data-test=\"stash-data-view-filters|drawer-previous-button\"\n :aria-label=\"t('ll.previous')\"\n :title=\"t('ll.previous')\"\n @click=\"emit('previous')\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n </template>\n\n <slot name=\"drawer\"></slot>\n\n <template #footer>\n <div class=\"flex justify-end gap-gutter\">\n <Button v-if=\"totalActiveFiltersCount === 0\" secondary @click=\"onDismiss\">\n {{ t('ll.cancel') }}\n </Button>\n <Button\n v-if=\"(isViewingGroupsMenu || props.drawerStyle === 'cascade') && totalActiveFiltersCount > 0\"\n secondary\n :disabled=\"isDataViewLoading\"\n @click=\"handleResetAllClick\"\n >\n {{ t('ll.resetAll') }}\n </Button>\n <Button\n v-if=\"isViewingSingleGroup && activeGroupActiveFiltersCount > 0\"\n secondary\n :disabled=\"isDataViewLoading\"\n @click=\"handleResetGroupClick\"\n >\n {{ t('ll.reset') }}\n </Button>\n <Button\n v-if=\"isViewingSingleGroup || props.drawerStyle === 'cascade'\"\n :disabled=\"isDataViewLoading\"\n @click=\"handleApplyClick\"\n >\n {{ t('ll.apply') }}\n </Button>\n </div>\n </template>\n </Modal>\n </Box>\n</template>\n"],"names":["DrawerStyle","useFilters","schema","dataViewRef","appliedFilters","ref","workingFilters","filterName","dvRef","applyFilters","cloneDeep","resetAllFilters","resetFilterGroup","group","undoWorkingFilters","activeFiltersCounts","computed","counts","config","value","_a","isDefined","totalActiveFiltersCount","count","props","__props","emit","__emit","slots","_useSlots","isDesktop","useMediaQuery","SCREEN_SIZES","isViewingGroupsMenu","isViewingSingleGroup","density","isDataViewLoading","isWithinModule","currentSearch","updateCurrentSearch","inject","DATA_VIEW_INJECTION","provide","DATA_VIEW_FILTERS_UTILS_INJECTION","activeGroupActiveFiltersCount","isDrawerOpen","handleApplyClick","preventDismiss","_b","handleResetGroupClick","handleResetAllClick","onDismiss","watch","_createBlock","Box","_normalizeClass","_unref","_openBlock","SearchBar","_mergeProps","t","_cache","searchTerm","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","Label","_createTextVNode","_toDisplayString","_hoisted_3","FilterChip","_hoisted_4","Icon","Button","Modal","_hoisted_5"],"mappings":";;;;;;;;;;;;;;;;AASO,IAAKA,uBAAAA,OAEVA,EAAA,UAAU,WAEVA,EAAA,SAAS,UAJCA,IAAAA,MAAA,CAAA,CAAA;AC+BL,SAASC,GAAyD;AAAA,EACvE,QAAAC;AAAA,EACA,aAAAC;AACF,GAAyE;AACvE,QAAMC,IAAiBC,EAAI,EAAE,GACvBC,IAAiBD,EAAI,EAAE;AAE7B,aAAWE,KAAcL;AAEvB,IAAAE,EAAe,MAAMG,CAAU,IAAIL,EAAOK,CAAU,EAAE,cAEtDD,EAAe,MAAMC,CAAU,IAAIL,EAAOK,CAAU,EAAE;AAGxD,QAAMC,IAAQL;AAQd,WAASM,IAAe;AACtB,IAAAL,EAAe,QAAQM,EAAUJ,EAAe,KAAK,GACrDE,EAAM,MAAM,qBAAqBJ,EAAe,OAAO,EAAE,YAAY,IAAM;AAAA,EAC7E;AAQA,WAASO,IAAkB;AACzB,eAAWJ,KAAcL;AAEvB,MAAAE,EAAe,MAAMG,CAAU,IAAIL,EAAOK,CAAU,EAAE,cAEtDD,EAAe,MAAMC,CAAU,IAAIL,EAAOK,CAAU,EAAE;AAGxD,IAAAC,EAAM,MAAM,qBAAqBJ,EAAe,OAAO,EAAE,YAAY,IAAM;AAAA,EAC7E;AAQA,WAASQ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A3BNX,EA2BM,OA3BNc,IA2BM;AAAA,cA1BUzD,EAAA,UAAuB,UAArC+B,EAESwB,GAAA;AAAA;gBAFoC,WAAA;AAAA,gBAAW,SAAO1B;AAAA,cAAA;2BAC7D,MAAoB;AAAA,sBAAjBK,EAAAI,CAAA,EAAC,WAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;eAGG3B,EAAA,SAAuBT,EAAM,8BAA8BF,EAAA,QAAuB,UAD3F+B,EAOSwB,GAAA;AAAA;gBALP,WAAA;AAAA,gBACC,UAAUrB,EAAApB,CAAA;AAAA,gBACV,SAAOc;AAAA,cAAA;2BAER,MAAsB;AAAA,sBAAnBM,EAAAI,CAAA,EAAC,aAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;cAGE1B,EAAA,SAAwBU,EAAA,QAA6B,UAD7DS,EAOSwB,GAAA;AAAA;gBALP,WAAA;AAAA,gBACC,UAAUrB,EAAApB,CAAA;AAAA,gBACV,SAAOa;AAAA,cAAA;2BAER,MAAmB;AAAA,sBAAhBO,EAAAI,CAAA,EAAC,UAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;cAGE1B,EAAA,SAAwBV,EAAM,gBAAW,kBADjD6B,EAMSwB,GAAA;AAAA;gBAJN,UAAUrB,EAAApB,CAAA;AAAA,gBACV,SAAOU;AAAA,cAAA;2BAER,MAAmB;AAAA,sBAAhBU,EAAAI,CAAA,EAAC,UAAA,CAAA,GAAA,CAAA;AAAA,gBAAA;;;;;qBA5BV,MAA2B;AAAA,YAA3BO,EAA2BC,EAAA,QAAA,QAAA;AAAA,UAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"DataViewFilters.js","sources":["../src/components/DataViewFilters/DataViewFilters.types.ts","../src/components/DataViewFilters/useFilters.ts","../src/components/DataViewFilters/DataViewFilters.vue"],"sourcesContent":["import { UseFiltersReturnType } from './useFilters';\n\n/**\n * A function that is called when the user clicks one of the \"Apply\" buttons in DataViewFilters.\n *\n * A return value of `{ preventDismiss: true }` can be used to prevent the DataViewFilters drawer or a FilterDropdown from closing, such as when some filters have invalid values.\n */\nexport type OnApplyFilters = () => Promise<{ preventDismiss?: boolean } | void> | { preventDismiss?: boolean } | void;\n\nexport enum DrawerStyle {\n /** Displays all groups and their fields without the need for navigating submenus. */\n Cascade = 'cascade',\n /** Displays only group names or fields; navigation between the group names and a submenu of fields is required. */\n Nested = 'nested',\n}\n\nexport type DrawerStyles = `${DrawerStyle}`;\n\nexport interface DataViewFiltersUtilsInjection {\n useFiltersInstance?: UseFiltersReturnType;\n drawerStyle?: DrawerStyles;\n}\n","import cloneDeep from 'lodash-es/cloneDeep';\nimport { computed, ComputedRef, Ref, ref } from 'vue';\n\nimport isDefined from '../../composables/useValidation/utils/isDefined';\nimport DataView from '../DataView/DataView.vue';\n\ntype DataViewInstance = InstanceType<typeof DataView>;\n\n/**\n * Contains metadata and configuration for the filters.\n * @see https://www.typescriptlang.org/docs/handbook/2/mapped-types.html\n */\nexport type UseFiltersSchema<Values extends object, Groups extends string> = {\n [Property in keyof Values]: {\n defaultValue?: Values[Property];\n group?: Groups;\n isActive?: (value: Values[Property]) => boolean;\n };\n};\n\nexport interface UseFiltersArgs<Values extends object, Groups extends string> {\n schema: UseFiltersSchema<Values, Groups>;\n /** A ref for an instance of DataView */\n dataViewRef: Ref<unknown>; // Note: using `Ref<InstanceType<typeof DataView>>` here causes type errors when providing a value for this argument\n}\n\nexport interface UseFiltersReturnType<Values = object, Groups extends string = string> {\n applyFilters: () => void;\n resetAllFilters: () => void;\n resetFilterGroup: (group: string) => void; // Note: group is intentionally not typed as `Groups` since there is no way to pass in a Groups type to UseFiltersReturnType within DataViewFilters.vue\n undoWorkingFilters: () => void;\n activeFiltersCounts: ComputedRef<Record<Groups, number>>;\n totalActiveFiltersCount: ComputedRef<number>;\n appliedFilters: Ref<Values>;\n workingFilters: Ref<Values>;\n}\n\n/**\n * Provides utility functions for working with `DataViewFilters`.\n */\nexport function useFilters<Values extends object, Groups extends string>({\n schema,\n dataViewRef,\n}: UseFiltersArgs<Values, Groups>): UseFiltersReturnType<Values, Groups> {\n const appliedFilters = ref({}) as Ref<Values>;\n const workingFilters = ref({}) as Ref<Values>;\n\n for (const filterName in schema) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n\n const dvRef = dataViewRef as Ref<DataViewInstance>;\n\n /**\n * For when an \"Apply\" button is clicked. It does the following:\n * 1) applies the working filter state\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function applyFilters() {\n appliedFilters.value = cloneDeep(workingFilters.value);\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * For when a \"Reset all\" button is clicked. It does the following:\n * 1) applies the defaultValue filter values to all filters\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function resetAllFilters() {\n for (const filterName in schema) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * For when a \"Reset\" button is clicked. It does the following:\n * 1) applies the defaultValue filter values to the given filter group\n * 2) sets the current page to 1\n * 3) emits the \"update\" event from DataView\n */\n function resetFilterGroup(group: Groups) {\n for (const filterName in schema) {\n if (schema[filterName].group === group) {\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n appliedFilters.value[filterName] = schema[filterName].defaultValue;\n // @ts-expect-error \"could be instantiated with an arbitrary type\"; TODO: figure out how to resolve the types\n workingFilters.value[filterName] = schema[filterName].defaultValue;\n }\n }\n\n dvRef.value.updateCurrentFilters(appliedFilters.value, { shouldEmit: true });\n }\n\n /**\n * Resets the `workingFilters` to match the `appliedFilters`. This can be used when the FilterDrawer or a FilterDropdown is dismissed without clicking \"Reset\" or \"Apply\".\n */\n function undoWorkingFilters() {\n workingFilters.value = cloneDeep(appliedFilters.value);\n }\n\n const activeFiltersCounts = computed(() => {\n const counts = {} as Record<Groups, number>;\n\n for (const filterName in schema) {\n const config = schema[filterName];\n const value = appliedFilters.value[filterName];\n const isActive = config.isActive?.(value) || isDefined(value);\n\n if (isActive && config.group) {\n counts[config.group] = (counts[config.group] ?? 0) + 1;\n }\n }\n\n return counts;\n });\n\n const totalActiveFiltersCount = computed(() => {\n let count = 0;\n\n for (const filterName in schema) {\n const config = schema[filterName];\n const value = appliedFilters.value[filterName];\n const isActive = config.isActive?.(value) || isDefined(value);\n\n if (isActive) {\n count += 1;\n }\n }\n\n return count;\n });\n\n return {\n applyFilters,\n resetAllFilters,\n // @ts-expect-error \"could be instantiated with a different subtype\": TODO: figure out how to resolve the types\n resetFilterGroup,\n undoWorkingFilters,\n activeFiltersCounts,\n totalActiveFiltersCount,\n appliedFilters,\n workingFilters,\n };\n}\n\nexport default useFilters;\n","<script lang=\"ts\">\n export * from './DataViewFilters.keys';\n export * from './DataViewFilters.types';\n export * from './useFilters';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, ref, watch } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import { SCREEN_SIZES } from '../../constants';\n import { t } from '../../locale';\n import Box from '../Box/Box.vue';\n import Button from '../Button/Button.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import FilterChip from '../FilterChip/FilterChip.vue';\n import Icon from '../Icon/Icon.vue';\n import Label from '../Label/Label.vue';\n import Modal, { type ModalProps } from '../Modal/Modal.vue';\n import SearchBar, { SearchBarProps } from '../SearchBar/SearchBar.vue';\n import { DATA_VIEW_FILTERS_UTILS_INJECTION } from './DataViewFilters.keys';\n import type { DrawerStyles, OnApplyFilters } from './DataViewFilters.types';\n import type { UseFiltersReturnType } from './useFilters';\n\n export interface DataViewFiltersProps {\n filtersLabelText?: string;\n /**\n * Props to pass to the `SearchBar` component.\n */\n searchBarProps?: SearchBarProps;\n showSearch?: boolean;\n /** 'cascade' displays all fields within every filter group; 'nested' displays only the group names and requires clicking a group to view its fields. */\n drawerStyle?: DrawerStyles;\n drawerProps?: ModalProps;\n /**\n * @deprecated The `activeGroup` prop is a sufficient replacement for this prop. A falsy `activeGroup` will hide the button and a truthy `activeGroup` will show it (when the `drawerStyle` is 'nested').\n *\n * **Note:** This prop has no effect when using a \"cascade\" `drawerStyle`.\n */\n showDrawerPreviousButton?: boolean;\n /**\n * Required when using filters. This prop should contain the return value of the `useFilters()` composable.\n */\n useFiltersInstance?: UseFiltersReturnType;\n onApply?: OnApplyFilters;\n /**\n * The name of the active filter group. The active filter group is determined by which instance of FilterDropdown or FilterDrawerItem is open.\n *\n * **Note:** This prop is required when using a \"nested\" `drawerStyle`, but has no effect when using a \"cascade\" `drawerStyle`.\n */\n activeGroup?: string;\n }\n\n export interface DataViewFiltersSlots {\n default?: () => unknown;\n drawer?: () => unknown;\n 'filters-label'?: () => unknown;\n }\n\n const props = withDefaults(defineProps<DataViewFiltersProps>(), {\n filtersLabelText: t('ll.filterBy'),\n isLoading: false,\n drawerStyle: 'cascade',\n drawerProps: undefined,\n searchBarProps: undefined,\n showDrawerPreviousButton: false,\n showSearch: true,\n useFiltersInstance: undefined,\n onApply: undefined,\n activeGroup: undefined,\n });\n\n const emit = defineEmits<{\n /** When the drawer is opened */\n (e: 'open-drawer'): void;\n /** When the drawer is dismissed */\n (e: 'dismiss'): void;\n /** When the \"Previous\" button in the header is clicked */\n (e: 'previous'): void;\n /** When the \"Reset\" button is clicked while viewing a filter group */\n (e: 'reset-group'): void;\n /** When one of the \"Reset All\" buttons is clicked */\n (e: 'reset-all'): void;\n }>();\n\n const slots = defineSlots<DataViewFiltersSlots>();\n\n const isDesktop = useMediaQuery(`(min-width: ${SCREEN_SIZES.lg})`);\n const isViewingGroupsMenu = computed(() => props.drawerStyle === 'nested' && !props.activeGroup);\n const isViewingSingleGroup = computed(() => props.drawerStyle === 'nested' && props.activeGroup);\n\n const {\n density,\n isLoading: isDataViewLoading,\n isWithinModule,\n currentSearch,\n updateCurrentSearch,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n provide(DATA_VIEW_FILTERS_UTILS_INJECTION.key, {\n useFiltersInstance: props.useFiltersInstance,\n drawerStyle: props.drawerStyle,\n });\n\n const totalActiveFiltersCount = computed(() => props.useFiltersInstance?.totalActiveFiltersCount.value ?? 0);\n /** The number of active filters in the currently active group. This is only used when the drawerStyle is 'nested'. */\n const activeGroupActiveFiltersCount = computed(\n () => Number(props.activeGroup && props.useFiltersInstance?.activeFiltersCounts.value[props.activeGroup]) || 0,\n );\n const isDrawerOpen = ref(false);\n\n async function handleApplyClick() {\n const { preventDismiss } = (await props.onApply?.()) || props.useFiltersInstance?.applyFilters() || {};\n\n if (!preventDismiss) {\n isDrawerOpen.value = false;\n }\n }\n\n function handleResetGroupClick() {\n if (!props.activeGroup) {\n return;\n }\n\n props.useFiltersInstance?.resetFilterGroup(props.activeGroup);\n emit('reset-group');\n isDrawerOpen.value = false;\n }\n\n function handleResetAllClick() {\n props.useFiltersInstance?.resetAllFilters();\n emit('reset-all');\n isDrawerOpen.value = false;\n }\n\n function onDismiss() {\n props.useFiltersInstance?.undoWorkingFilters();\n isDrawerOpen.value = false;\n emit('dismiss');\n }\n\n watch(isDrawerOpen, () => {\n if (isDrawerOpen.value) {\n emit('open-drawer');\n }\n });\n</script>\n\n<template>\n <Box\n class=\"stash-data-view-filters grid grid-cols-12 gap-6 p-3\"\n :class=\"{ 'lg:p-6': density === 'comfortable', 'mb-3': !isWithinModule }\"\n :radius=\"isWithinModule ? 'none' : 'rounded'\"\n data-test=\"stash-data-view-filters\"\n disable-padding\n >\n <SearchBar\n v-if=\"props.showSearch\"\n class=\"col-span-12 md:col-span-6 lg:col-span-4\"\n data-test=\"stash-data-view-filters|search-bar\"\n :is-loading=\"isDataViewLoading\"\n :label=\"t('ll.search')\"\n :model-value=\"currentSearch\"\n v-bind=\"props.searchBarProps\"\n @search=\"(searchTerm) => updateCurrentSearch(searchTerm, { shouldEmit: true })\"\n />\n <div\n v-if=\"slots.default\"\n class=\"col-span-12 row-start-2 md:col-start-7 md:row-start-1 lg:col-span-8 lg:col-start-5\"\n >\n <div class=\"hidden md:block\">\n <slot name=\"filters-label\">\n <Label>{{ props.filtersLabelText }}</Label>\n </slot>\n </div>\n <div class=\"flex gap-4\">\n <FilterChip\n secondary\n class=\"!md:inline-flex !flex w-full justify-center gap-4 md:w-auto\"\n data-test=\"stash-data-view-filters|drawer-toggle-button\"\n :filter-count=\"totalActiveFiltersCount\"\n @click=\"isDrawerOpen = true\"\n >\n <span class=\"inline-flex items-center gap-3\">\n <Icon name=\"filter-line\" class=\"text-ice-700\" />\n <span>{{ t('ll.filters') }}</span>\n </span>\n </FilterChip>\n <slot v-if=\"isDesktop\"></slot>\n <Button v-if=\"totalActiveFiltersCount > 0 && isDesktop\" inline @click=\"handleResetAllClick\">\n {{ t('ll.resetAll') }}\n </Button>\n </div>\n </div>\n <Modal\n v-if=\"slots.drawer\"\n data-test=\"stash-data-view-filters|drawer\"\n disable-body-padding\n position=\"right\"\n size=\"narrow\"\n :is-open=\"isDrawerOpen\"\n :title=\"t('ll.allFilters')\"\n v-bind=\"props.drawerProps\"\n @dismiss=\"onDismiss\"\n >\n <template #headerAction>\n <Button\n v-if=\"isViewingSingleGroup\"\n icon\n class=\"text-ice-100\"\n data-test=\"stash-data-view-filters|drawer-previous-button\"\n :aria-label=\"t('ll.previous')\"\n :title=\"t('ll.previous')\"\n @click=\"emit('previous')\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n </template>\n\n <slot name=\"drawer\"></slot>\n\n <template #footer>\n <div class=\"flex justify-end gap-gutter\">\n <Button v-if=\"totalActiveFiltersCount === 0\" secondary @click=\"onDismiss\">\n {{ t('ll.cancel') }}\n </Button>\n <Button\n v-if=\"(isViewingGroupsMenu || props.drawerStyle === 'cascade') && totalActiveFiltersCount > 0\"\n secondary\n :disabled=\"isDataViewLoading\"\n @click=\"handleResetAllClick\"\n >\n {{ t('ll.resetAll') }}\n </Button>\n <Button\n v-if=\"isViewingSingleGroup && activeGroupActiveFiltersCount > 0\"\n secondary\n :disabled=\"isDataViewLoading\"\n @click=\"handleResetGroupClick\"\n >\n {{ t('ll.reset') }}\n </Button>\n <Button\n v-if=\"isViewingSingleGroup || props.drawerStyle === 'cascade'\"\n :disabled=\"isDataViewLoading\"\n @click=\"handleApplyClick\"\n >\n {{ t('ll.apply') }}\n </Button>\n </div>\n </template>\n </Modal>\n </Box>\n</template>\n"],"names":["DrawerStyle","useFilters","schema","dataViewRef","appliedFilters","ref","workingFilters","filterName","dvRef","applyFilters","cloneDeep","resetAllFilters","resetFilterGroup","group","undoWorkingFilters","activeFiltersCounts","computed","counts","config","value","_a","isDefined","totalActiveFiltersCount","count","props","__props","emit","__emit","slots","_useSlots","isDesktop","useMediaQuery","SCREEN_SIZES","isViewingGroupsMenu","isViewingSingleGroup","density","isDataViewLoading","isWithinModule","currentSearch","updateCurrentSearch","inject","DATA_VIEW_INJECTION","provide","DATA_VIEW_FILTERS_UTILS_INJECTION","activeGroupActiveFiltersCount","isDrawerOpen","handleApplyClick","preventDismiss","_b","handleResetGroupClick","handleResetAllClick","onDismiss","watch","_createBlock","Box","_normalizeClass","_unref","_openBlock","SearchBar","_mergeProps","t","_cache","searchTerm","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","Label","_createTextVNode","_toDisplayString","_hoisted_3","FilterChip","_hoisted_4","Icon","Button","Modal","_hoisted_5"],"mappings":";;;;;;;;;;;;;;;;AASO,IAAKA,uBAAAA,OAEVA,EAAA,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