quasar-ui-danx 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -31,20 +31,8 @@ const props = defineProps({
31
31
  type: Object,
32
32
  required: true
33
33
  },
34
- filterGroups: {
35
- type: Array,
36
- required: true
37
- },
38
34
  showFilters: Boolean
39
35
  });
40
36
 
41
- const filterNameDictionary = computed(() => {
42
- return props.filterGroups.reduce((acc, fg) => {
43
- fg.fields.forEach(f => {
44
- acc[f.name] = true;
45
- });
46
- return acc;
47
- }, {});
48
- });
49
- const activeCount = computed(() => Object.keys(props.filter).filter(key => props.filter[key] !== undefined && filterNameDictionary.value[key]).length);
37
+ const activeCount = computed(() => Object.keys(props.filter).filter(key => props.filter[key] !== undefined).length);
50
38
  </script>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div class="w-full flex justify-end items-center flex-nowrap border-b">
3
+ <FilterListToggle
4
+ :show-filters="showFilters"
5
+ :filter="filter"
6
+ class="border-r p-4 flex-shrink-0"
7
+ @update:show-filters="$emit('update:show-filters', $event)"
8
+ @update:filter="$emit('update:filter', $event)"
9
+ />
10
+
11
+ <div class="flex-grow">
12
+ <slot />
13
+ </div>
14
+
15
+ <div v-if="$slots['right-side']" class="flex justify-end items-stretch flex-nowrap p-4">
16
+ <QSeparator vertical class="mx-4 h-10 self-center" />
17
+
18
+ <slot name="right-side" />
19
+ </div>
20
+ </div>
21
+ </template>
22
+ <script setup>
23
+ import { FilterListToggle } from "quasar-ui-danx";
24
+
25
+ defineEmits(["update:show-filters", "update:filter"]);
26
+ defineProps({
27
+ filter: {
28
+ type: Object,
29
+ default: null
30
+ },
31
+ showFilters: Boolean
32
+ });
33
+ </script>
@@ -3,3 +3,4 @@ export {
3
3
  } from "./CollapsableFiltersSidebar.vue";
4
4
  export { default as FilterGroupList } from "./FilterGroupList.vue";
5
5
  export { default as FilterListToggle } from "./FilterListToggle.vue";
6
+ export { default as FilterToolbarLayout } from "./FilterToolbarLayout.vue";
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <QBtn class="bg-neutral-plus-6" :loading="isExporting" @click="onExport">
3
+ <ExportIcon class="w-5" />
4
+ </QBtn>
5
+ </template>
6
+ <script setup>
7
+ import { DownloadIcon as ExportIcon } from '@heroicons/vue/solid';
8
+ import { ref } from 'vue';
9
+ import { FlashMessages } from '../../../helpers';
10
+
11
+ const props = defineProps({
12
+ exporter: {
13
+ type: Function,
14
+ required: true
15
+ }
16
+ });
17
+ const isExporting = ref(false);
18
+ async function onExport() {
19
+ isExporting.value = true;
20
+ try {
21
+ await props.exporter();
22
+ } catch (error) {
23
+ console.error(error);
24
+ FlashMessages.error('Failed to export data');
25
+ }
26
+ isExporting.value = false;
27
+ }
28
+ </script>
@@ -1,6 +1,7 @@
1
1
  export { default as CollapsableSidebar } from "./CollapsableSidebar.vue";
2
2
  export { default as ConfirmDialog } from "./Dialogs/ConfirmDialog.vue";
3
3
  export { default as ContentDrawer } from "./ContentDrawer.vue";
4
+ export { default as ExportButton } from "src/components/Utility/Buttons/ExportButton.vue";
4
5
  export { default as FlatList } from "./FlatList.vue";
5
6
  export { default as FullScreenCarouselDialog } from "./Dialogs/FullscreenCarouselDialog.vue";
6
7
  export { default as FullScreenDialog } from "./Dialogs/FullScreenDialog.vue";
@@ -8,6 +9,6 @@ export { default as ImagePreview } from "./ImagePreview.vue";
8
9
  export { default as InfoDialog } from "./Dialogs/InfoDialog.vue";
9
10
  export { default as InputDialog } from "./Dialogs/InputDialog.vue";
10
11
  export { default as ListTransition } from "./Transitions/ListTransition.vue";
11
- export { default as RefreshButton } from "./RefreshButton.vue";
12
+ export { default as RefreshButton } from "src/components/Utility/Buttons/RefreshButton.vue";
12
13
  export { default as SlideTransition } from "./Transitions/SlideTransition.vue";
13
14
  export { default as StaggeredListTransition } from "./Transitions/StaggeredListTransition.vue";