quasar-ui-danx 0.3.11 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/dist/danx.es.js +5978 -5901
  2. package/dist/danx.es.js.map +1 -1
  3. package/dist/danx.umd.js +5 -5
  4. package/dist/danx.umd.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/ActionTable/ActionMenu.vue +7 -7
  8. package/src/components/ActionTable/ActionTable.vue +55 -31
  9. package/src/components/ActionTable/ActionTableColumn.vue +37 -15
  10. package/src/components/ActionTable/ActionTableHeaderColumn.vue +9 -9
  11. package/src/components/ActionTable/Columns/ColumnListItem.vue +33 -10
  12. package/src/components/ActionTable/Columns/ColumnSettingsDialog.vue +23 -19
  13. package/src/components/ActionTable/Columns/TitleColumnFormat.vue +5 -3
  14. package/src/components/ActionTable/Columns/VisibleColumnsToggleButtons.vue +24 -22
  15. package/src/components/ActionTable/EmptyTableState.vue +4 -2
  16. package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +17 -9
  17. package/src/components/ActionTable/Filters/FilterFieldItem.vue +7 -5
  18. package/src/components/ActionTable/Filters/FilterFieldList.vue +21 -21
  19. package/src/components/ActionTable/Filters/FilterListToggle.vue +13 -10
  20. package/src/components/ActionTable/Filters/FilterToolbarLayout.vue +14 -7
  21. package/src/components/ActionTable/Filters/FilterableField.vue +75 -70
  22. package/src/components/ActionTable/Form/Fields/BooleanField.vue +9 -9
  23. package/src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue +7 -7
  24. package/src/components/ActionTable/Form/Fields/DateField.vue +4 -4
  25. package/src/components/ActionTable/Form/Fields/DateRangeField.vue +10 -12
  26. package/src/components/ActionTable/Form/Fields/DateTimeField.vue +13 -10
  27. package/src/components/ActionTable/Form/Fields/DateTimePicker.vue +36 -14
  28. package/src/components/ActionTable/Form/Fields/EditableDiv.vue +3 -3
  29. package/src/components/ActionTable/Form/Fields/FieldLabel.vue +2 -2
  30. package/src/components/ActionTable/Form/Fields/FileUploadButton.vue +23 -20
  31. package/src/components/ActionTable/Form/Fields/InlineDateTimeField.vue +10 -10
  32. package/src/components/ActionTable/Form/Fields/IntegerField.vue +6 -6
  33. package/src/components/ActionTable/Form/Fields/LabeledInput.vue +20 -17
  34. package/src/components/ActionTable/Form/Fields/MultiFileField.vue +35 -35
  35. package/src/components/ActionTable/Form/Fields/MultiKeywordField.vue +15 -15
  36. package/src/components/ActionTable/Form/Fields/NewPasswordField.vue +4 -4
  37. package/src/components/ActionTable/Form/Fields/NumberField.vue +11 -11
  38. package/src/components/ActionTable/Form/Fields/NumberRangeField.vue +11 -11
  39. package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +38 -33
  40. package/src/components/ActionTable/Form/Fields/SelectField.vue +37 -35
  41. package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +19 -15
  42. package/src/components/ActionTable/Form/Fields/SingleFileField.vue +29 -28
  43. package/src/components/ActionTable/Form/Fields/TextField.vue +22 -22
  44. package/src/components/ActionTable/Form/RenderedForm.vue +5 -1
  45. package/src/components/ActionTable/Layouts/ActionTableLayout.vue +1 -1
  46. package/src/components/ActionTable/TableSummaryRow.vue +15 -15
  47. package/src/components/ActionTable/listControls.ts +378 -383
  48. package/src/components/AuditHistory/AuditHistoryItem.vue +12 -6
  49. package/src/components/AuditHistory/AuditHistoryItemValue.vue +6 -6
  50. package/src/components/DragAndDrop/HandleDraggable.vue +21 -21
  51. package/src/components/DragAndDrop/ListItemDraggable.vue +19 -15
  52. package/src/components/PanelsDrawer/PanelsDrawer.vue +18 -11
  53. package/src/components/PanelsDrawer/PanelsDrawerPanels.vue +9 -5
  54. package/src/components/PanelsDrawer/PanelsDrawerTabs.vue +18 -13
  55. package/src/components/Utility/Buttons/ExportButton.vue +5 -1
  56. package/src/components/Utility/Buttons/RefreshButton.vue +2 -2
  57. package/src/components/Utility/Controls/PreviousNextControls.vue +8 -8
  58. package/src/components/Utility/Dialogs/ConfirmDialog.vue +32 -29
  59. package/src/components/Utility/Dialogs/FullScreenDialog.vue +12 -9
  60. package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +30 -26
  61. package/src/components/Utility/Dialogs/InfoDialog.vue +25 -22
  62. package/src/components/Utility/Dialogs/InputDialog.vue +7 -7
  63. package/src/components/Utility/Files/FilePreview.vue +64 -47
  64. package/src/components/Utility/Files/SvgImg.vue +7 -4
  65. package/src/components/Utility/Formats/GpsCoordinatesFormat.vue +11 -3
  66. package/src/components/Utility/Layouts/CollapsableSidebar.vue +16 -16
  67. package/src/components/Utility/Layouts/ContentDrawer.vue +8 -8
  68. package/src/components/Utility/Popovers/InteractiveTooltip.vue +7 -7
  69. package/src/components/Utility/Popovers/PopoverMenu.vue +21 -21
  70. package/src/components/Utility/Tabs/BadgeTab.vue +9 -7
  71. package/src/components/Utility/Tools/ActionVnode.vue +5 -5
  72. package/src/components/Utility/Tools/RenderComponent.vue +11 -9
  73. package/src/components/Utility/Transitions/StaggeredListTransition.vue +7 -7
  74. package/src/styles/quasar-reset.scss +63 -19
  75. package/src/styles/themes/danx/action-table.scss +19 -0
  76. package/src/styles/themes/danx/index.scss +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <PopoverMenu
3
- class="px-2 flex action-button"
4
- :items="activeActions"
5
- :disabled="!hasTarget"
6
- :tooltip="!hasTarget ? tooltip : null"
7
- :loading="isSaving || loading"
8
- :loading-component="loadingComponent"
9
- @action-item="onAction"
3
+ class="px-2 flex action-button"
4
+ :items="activeActions"
5
+ :disabled="!hasTarget"
6
+ :tooltip="!hasTarget ? tooltip : null"
7
+ :loading="isSaving || loading"
8
+ :loading-component="loadingComponent"
9
+ @action-item="onAction"
10
10
  />
11
11
  </template>
12
12
  <script setup>
@@ -1,21 +1,24 @@
1
1
  <template>
2
- <div class="overflow-hidden w-full">
2
+ <div
3
+ class="dx-action-table overflow-hidden w-full"
4
+ :class="{'dx-no-data': !hasData}"
5
+ >
3
6
  <ActionVnode />
4
7
  <QTable
5
- ref="actionTable"
6
- :selected="selectedRows"
7
- :pagination="quasarPagination"
8
- :columns="columns"
9
- :loading="isLoadingList"
10
- :rows="pagedItems?.data || []"
11
- :binary-state-sort="false"
12
- selection="multiple"
13
- :rows-per-page-options="rowsPerPageOptions"
14
- class="sticky-column sticky-header w-full h-full !border-0"
15
- color="blue-600"
16
- @update:selected="$emit('update:selected-rows', $event)"
17
- @update:pagination="() => {}"
18
- @request="$emit('update:quasar-pagination', {...$event.pagination, __sort: mapSortBy($event.pagination, columns)})"
8
+ ref="actionTable"
9
+ :selected="selectedRows"
10
+ :pagination="quasarPagination"
11
+ :columns="columns"
12
+ :loading="isLoadingList"
13
+ :rows="pagedItems?.data || []"
14
+ :binary-state-sort="false"
15
+ selection="multiple"
16
+ :rows-per-page-options="rowsPerPageOptions"
17
+ class="sticky-column sticky-header w-full h-full !border-0"
18
+ :color="color"
19
+ @update:selected="$emit('update:selected-rows', $event)"
20
+ @update:pagination="() => {}"
21
+ @request="(e) => $emit('update:quasar-pagination', {...e.pagination, __sort: mapSortBy(e.pagination, columns)})"
19
22
  >
20
23
  <template #no-data>
21
24
  <slot name="empty">
@@ -24,30 +27,35 @@
24
27
  </template>
25
28
  <template #top-row>
26
29
  <TableSummaryRow
27
- :label="label"
28
- :item-count="summary?.count || 0"
29
- :selected-count="selectedRows.length"
30
- :loading="isLoadingSummary"
31
- :summary="summary"
32
- :columns="columns"
33
- @clear="$emit('update:selected-rows', [])"
30
+ v-if="hasData"
31
+ :label="label"
32
+ :item-count="summary?.count || 0"
33
+ :selected-count="selectedRows.length"
34
+ :loading="isLoadingSummary"
35
+ :summary="summary"
36
+ :columns="columns"
37
+ @clear="$emit('update:selected-rows', [])"
34
38
  />
35
39
  </template>
36
40
  <template #header-cell="rowProps">
37
41
  <ActionTableHeaderColumn
38
- v-model="columnSettings"
39
- :row-props="rowProps"
40
- :name="name"
41
- @update:model-value="onUpdateColumnSettings"
42
+ v-model="columnSettings"
43
+ :row-props="rowProps"
44
+ :name="name"
45
+ @update:model-value="onUpdateColumnSettings"
42
46
  />
43
47
  </template>
44
48
  <template #body-cell="rowProps">
45
49
  <ActionTableColumn
46
- :key="rowProps.key"
47
- :row-props="rowProps"
48
- :settings="columnSettings[rowProps.col.name]"
50
+ :key="rowProps.key"
51
+ :row-props="rowProps"
52
+ :settings="columnSettings[rowProps.col.name]"
49
53
  >
50
- <slot :column-name="rowProps.col.name" :row="rowProps.row" :value="rowProps.value" />
54
+ <slot
55
+ :column-name="rowProps.col.name"
56
+ :row="rowProps.row"
57
+ :value="rowProps.value"
58
+ />
51
59
  </ActionTableColumn>
52
60
  </template>
53
61
  </QTable>
@@ -56,7 +64,7 @@
56
64
 
57
65
  <script setup>
58
66
  import { QTable } from "quasar";
59
- import { ref } from "vue";
67
+ import { computed, ref } from "vue";
60
68
  import { getItem, setItem } from "../../helpers";
61
69
  import { ActionVnode } from "../Utility";
62
70
  import ActionTableColumn from "./ActionTableColumn.vue";
@@ -75,6 +83,10 @@ const props = defineProps({
75
83
  type: String,
76
84
  required: true
77
85
  },
86
+ color: {
87
+ type: String,
88
+ default: "blue-600"
89
+ },
78
90
  selectedRows: {
79
91
  type: Array,
80
92
  required: true
@@ -105,9 +117,21 @@ const props = defineProps({
105
117
  const actionTable = ref(null);
106
118
  registerStickyScrolling(actionTable);
107
119
 
120
+ const hasData = computed(() => props.pagedItems?.data?.length);
108
121
  const COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;
109
122
  const columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});
110
123
  function onUpdateColumnSettings() {
111
124
  setItem(COLUMN_SETTINGS_KEY, columnSettings.value);
112
125
  }
113
126
  </script>
127
+
128
+ <style scoped lang="scss">
129
+ .dx-action-table {
130
+ &.dx-no-data {
131
+ :deep(.q-table__middle) {
132
+ flex-grow: 0;
133
+ flex-shrink: 1;
134
+ }
135
+ }
136
+ }
137
+ </style>
@@ -1,30 +1,52 @@
1
1
  <template>
2
- <QTd :key="rowProps.key" :props="rowProps" :style="columnStyle">
2
+ <QTd
3
+ :key="rowProps.key"
4
+ :props="rowProps"
5
+ :style="columnStyle"
6
+ >
3
7
  <div :style="columnStyle">
4
8
  <div
5
- class="flex items-center flex-nowrap"
6
- :class="columnClass"
9
+ class="flex items-center flex-nowrap"
10
+ :class="columnClass"
7
11
  >
8
12
  <div class="flex-grow overflow-hidden">
9
13
  <a
10
- v-if="column.onClick"
11
- @click="column.onClick(row)"
12
- :class="column.innerClass"
14
+ v-if="column.onClick"
15
+ :class="column.innerClass"
16
+ @click="column.onClick(row)"
13
17
  >
14
- <RenderVnode v-if="column.vnode" :vnode="column.vnode(row)" />
18
+ <RenderVnode
19
+ v-if="column.vnode"
20
+ :vnode="column.vnode(row)"
21
+ />
15
22
  <slot v-else>{{ value }}</slot>
16
23
  </a>
17
- <div v-else :class="column.innerClass">
18
- <RenderVnode v-if="column.vnode" :vnode="column.vnode(row)" />
19
- <slot v-else>{{ value }}</slot>
24
+ <div
25
+ v-else
26
+ :class="column.innerClass"
27
+ >
28
+ <RenderVnode
29
+ v-if="column.vnode"
30
+ :vnode="column.vnode(row)"
31
+ />
32
+ <slot v-else>
33
+ {{ value }}
34
+ </slot>
20
35
  </div>
21
- <TitleColumnFormat v-if="column.titleColumns" :row="row" :columns="column.titleColumns()" />
36
+ <TitleColumnFormat
37
+ v-if="column.titleColumns"
38
+ :row="row"
39
+ :columns="column.titleColumns()"
40
+ />
22
41
  </div>
23
- <div v-if="column.actionMenu" class="flex flex-shrink-0 pl-2">
42
+ <div
43
+ v-if="column.actionMenu"
44
+ class="flex flex-shrink-0 pl-2"
45
+ >
24
46
  <ActionMenu
25
- :actions="column.actionMenu"
26
- :target="row"
27
- :loading="isSaving"
47
+ :actions="column.actionMenu"
48
+ :target="row"
49
+ :loading="isSaving"
28
50
  />
29
51
  </div>
30
52
  </div>
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <QTh
3
- :key="rowProps.key"
4
- :props="rowProps"
5
- :data-drop-zone="isResizeable && `resize-column-` + column.name"
6
- :class="isResizeable && cls['handle-drop-zone']"
7
- :style="columnStyle"
3
+ :key="rowProps.key"
4
+ :props="rowProps"
5
+ :data-drop-zone="isResizeable && `resize-column-` + column.name"
6
+ :class="isResizeable && cls['handle-drop-zone']"
7
+ :style="columnStyle"
8
8
  >
9
9
  {{ column.label }}
10
10
  <HandleDraggable
11
- v-if="isResizeable"
12
- :drop-zone="`resize-column-` + column.name"
13
- :class="cls['resize-handle']"
14
- @resize="onResizeColumn"
11
+ v-if="isResizeable"
12
+ :drop-zone="`resize-column-` + column.name"
13
+ :class="cls['resize-handle']"
14
+ @resize="onResizeColumn"
15
15
  >
16
16
  <RowResizeIcon class="w-4 text-gray-600" />
17
17
  </HandleDraggable>
@@ -1,19 +1,42 @@
1
1
  <template>
2
2
  <div
3
- class="flex items-center w-full"
4
- :class="{'cursor-not-allowed': locked}"
3
+ class="flex items-center w-full"
4
+ :class="{'cursor-not-allowed': locked}"
5
5
  >
6
- <a v-if="locked" class="text-zinc-800 cursor-not-allowed">
6
+ <a
7
+ v-if="locked"
8
+ class="text-zinc-800 cursor-not-allowed"
9
+ >
7
10
  <LockedIcon class="w-4" />
8
11
  </a>
9
- <div class="font-semibold text-sm ml-5 py-3 flex-grow">{{ column.label }}</div>
10
- <div v-if="!locked" class="flex items-center">
11
- <a class="py-2 px-1" @click="$emit('visible', !visible)">
12
- <VisibleIcon v-if="visible" class="w-4" />
13
- <HiddenIcon v-else class="w-4 text-zinc-800" />
12
+ <div class="font-semibold text-sm ml-5 py-3 flex-grow">
13
+ {{ column.label }}
14
+ </div>
15
+ <div
16
+ v-if="!locked"
17
+ class="flex items-center"
18
+ >
19
+ <a
20
+ class="py-2 px-1"
21
+ @click="$emit('visible', !visible)"
22
+ >
23
+ <VisibleIcon
24
+ v-if="visible"
25
+ class="w-4"
26
+ />
27
+ <HiddenIcon
28
+ v-else
29
+ class="w-4 text-zinc-800"
30
+ />
14
31
  </a>
15
- <a class="py-2 px-1" @click="$emit('is-title', !isTitle)">
16
- <IsTitleIcon class="w-4" :class="isTitle ? '' : 'text-gray-400'" />
32
+ <a
33
+ class="py-2 px-1"
34
+ @click="$emit('is-title', !isTitle)"
35
+ >
36
+ <IsTitleIcon
37
+ class="w-4"
38
+ :class="isTitle ? '' : 'text-gray-400'"
39
+ />
17
40
  <QTooltip>
18
41
  <template v-if="!isTitle">Add to priority list</template>
19
42
  <template v-else>Remove from priority list</template>
@@ -1,35 +1,39 @@
1
1
  <template>
2
2
  <InfoDialog
3
- title="Column Settings"
4
- @close="$emit('close')"
3
+ title="Column Settings"
4
+ @close="$emit('close')"
5
5
  >
6
6
  <div class="mb-4 text-sm">
7
7
  Customize columns by visibility, order, or priority (maximum 3 additional).
8
8
  </div>
9
9
  <ColumnListItem
10
- v-for="column in lockedColumns" :key="column.name" locked visible :column="column"
11
- class="px-2.5 border border-gray-200 bg-white rounded-t-lg"
10
+ v-for="column in lockedColumns"
11
+ :key="column.name"
12
+ locked
13
+ visible
14
+ :column="column"
15
+ class="px-2.5 border border-gray-200 bg-white rounded-t-lg"
12
16
  />
13
17
  <ListTransition
14
- name="fade-down-list"
15
- data-drop-zone="column-list"
18
+ name="fade-down-list"
19
+ data-drop-zone="column-list"
16
20
  >
17
21
  <ListItemDraggable
18
- v-for="(column, index) in sortableColumns"
19
- :key="column.name"
20
- :list-items="sortableColumns"
21
- drop-zone="column-list"
22
- class="px-2 border border-gray-200 bg-white"
23
- :class="{'rounded-b-lg': index === sortableColumns.length - 1}"
24
- show-handle
25
- @update:list-items="$emit('update:sortable-columns', $event)"
22
+ v-for="(column, index) in sortableColumns"
23
+ :key="column.name"
24
+ :list-items="sortableColumns"
25
+ drop-zone="column-list"
26
+ class="px-2 border border-gray-200 bg-white"
27
+ :class="{'rounded-b-lg': index === sortableColumns.length - 1}"
28
+ show-handle
29
+ @update:list-items="$emit('update:sortable-columns', $event)"
26
30
  >
27
31
  <ColumnListItem
28
- :column="column"
29
- :visible="isVisible(column)"
30
- :is-title="isTitleColumn(column)"
31
- @visible="onVisibilityChange(column, $event)"
32
- @is-title="onTitleColumnChange(column, $event)"
32
+ :column="column"
33
+ :visible="isVisible(column)"
34
+ :is-title="isTitleColumn(column)"
35
+ @visible="onVisibilityChange(column, $event)"
36
+ @is-title="onTitleColumnChange(column, $event)"
33
37
  />
34
38
  </ListItemDraggable>
35
39
  </ListTransition>
@@ -1,9 +1,11 @@
1
1
  <template>
2
2
  <div>
3
3
  <div
4
- v-for="column in columns" :key="column.name"
5
- class="overflow-hidden overflow-ellipsis text-xs text-gray-400"
6
- >{{ format(row[column.name], column.format) }}
4
+ v-for="column in columns"
5
+ :key="column.name"
6
+ class="overflow-hidden overflow-ellipsis text-xs text-gray-400"
7
+ >
8
+ {{ format(row[column.name], column.format) }}
7
9
  </div>
8
10
  </div>
9
11
  </template>
@@ -1,43 +1,45 @@
1
1
  <template>
2
2
  <div class="flex items-center flex-nowrap">
3
3
  <div
4
- v-for="category in categories"
5
- :key="category"
6
- :class="getCategoryClass(category)"
4
+ v-for="category in categories"
5
+ :key="category"
6
+ :class="getCategoryClass(category)"
7
7
  >
8
8
  <QCheckbox
9
- toggle-indeterminate
10
- size="20px"
11
- :model-value="getCategoryCheckboxState(category)"
12
- class="mr-2 cb-white-border"
13
- @click="toggleColumns(columnsInCategory(category), !categoryHasVisibleColumns(category))"
9
+ toggle-indeterminate
10
+ size="20px"
11
+ :model-value="getCategoryCheckboxState(category)"
12
+ class="mr-2 cb-white-border"
13
+ @click="toggleColumns(columnsInCategory(category), !categoryHasVisibleColumns(category))"
14
14
  />
15
15
  <div>
16
16
  {{ category }}
17
17
  </div>
18
18
  <CaretDownIcon
19
- class="ml-2 w-5 transition-all"
20
- :class="{'rotate-180' : isShowingColumnToggle === category}"
19
+ class="ml-2 w-5 transition-all"
20
+ :class="{'rotate-180' : isShowingColumnToggle === category}"
21
21
  />
22
22
  <QMenu
23
- @update:model-value="isShowingColumnToggle = $event ? category : ''"
23
+ @update:model-value="isShowingColumnToggle = $event ? category : ''"
24
24
  >
25
25
  <QList>
26
26
  <div
27
- v-for="column in columnsInCategory(category)"
28
- :key="column"
29
- class="flex items-center flex-nowrap px-2 py-3 cursor-pointer"
30
- @click="toggleColumn(column.name)"
27
+ v-for="column in columnsInCategory(category)"
28
+ :key="column"
29
+ class="flex items-center flex-nowrap px-2 py-3 cursor-pointer"
30
+ @click="toggleColumn(column.name)"
31
31
  >
32
32
  <QCheckbox
33
- :model-value="!hiddenColumnNames.includes(column.name)"
34
- class="mr-3 cb-white-border"
35
- size="20px"
36
- :color="column.required ? 'gray-400': 'blue-600'"
37
- :disable="column.required"
38
- @click="toggleColumn(column.name)"
33
+ :model-value="!hiddenColumnNames.includes(column.name)"
34
+ class="mr-3 cb-white-border"
35
+ size="20px"
36
+ :color="column.required ? 'gray-400': 'blue-600'"
37
+ :disable="column.required"
38
+ @click="toggleColumn(column.name)"
39
39
  />
40
- <div class="text-xs">{{ column.label }}</div>
40
+ <div class="text-xs">
41
+ {{ column.label }}
42
+ </div>
41
43
  </div>
42
44
  </QList>
43
45
  </QMenu>
@@ -1,12 +1,14 @@
1
1
  <template>
2
2
  <div class="flex items-center justify-center text-sm py-14 w-full">
3
3
  <div v-if="loading">
4
- <slot name="loading">{{ loadingText }}
4
+ <slot name="loading">
5
+ {{ loadingText }}
5
6
  <QSpinnerBall class="w-4 ml-2" />
6
7
  </slot>
7
8
  </div>
8
9
  <div v-if="saving">
9
- <slot name="saving">{{ savingText }}
10
+ <slot name="saving">
11
+ {{ savingText }}
10
12
  <QSpinnerBall class="w-4 ml-2" />
11
13
  </slot>
12
14
  </div>
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <CollapsableSidebar
3
- :collapse="!showFilters"
4
- disabled
5
- min-width="0"
6
- max-width="18rem"
7
- :name="name"
8
- @update:collapse="$emit('update:show-filters', !$event)"
3
+ :collapse="!showFilters"
4
+ disabled
5
+ :min-width="minWidth"
6
+ :max-width="maxWidth"
7
+ :name="name"
8
+ @update:collapse="$emit('update:show-filters', !$event)"
9
9
  >
10
10
  <FilterFieldList
11
- :filter="filter"
12
- :filter-fields="filterFields"
13
- @update:filter="$emit('update:filter', $event)"
11
+ :filter="filter"
12
+ :filter-fields="filterFields"
13
+ @update:filter="$emit('update:filter', $event)"
14
14
  />
15
15
  </CollapsableSidebar>
16
16
  </template>
@@ -29,6 +29,14 @@ defineProps({
29
29
  type: Object,
30
30
  default: null
31
31
  },
32
+ minWidth: {
33
+ type: String,
34
+ default: "5rem"
35
+ },
36
+ maxWidth: {
37
+ type: String,
38
+ default: "18rem"
39
+ },
32
40
  filterFields: {
33
41
  type: Array,
34
42
  default: () => []
@@ -2,12 +2,14 @@
2
2
  <QExpansionItem>
3
3
  <template #header>
4
4
  <div class="flex items-center flex-nowrap flex-grow">
5
- <div class="whitespace-nowrap flex-grow text-left text-sm font-bold">{{ name }}</div>
5
+ <div class="whitespace-nowrap flex-grow text-left text-sm font-bold">
6
+ {{ name }}
7
+ </div>
6
8
  <QBadge
7
- :label="count"
8
- rounded
9
- class="ml-2 transition-all"
10
- :class="{'bg-gray-400': !count, 'bg-blue-600': count}"
9
+ :label="count"
10
+ rounded
11
+ class="ml-2 transition-all"
12
+ :class="{'bg-gray-400': !count, 'bg-blue-600': count}"
11
13
  />
12
14
  </div>
13
15
  </template>
@@ -2,40 +2,40 @@
2
2
  <QList>
3
3
  <div class="px-4 py-2 max-w-full">
4
4
  <template
5
- v-for="(group, index) in filterFields"
6
- :key="'group-' + group.name"
5
+ v-for="(group, index) in filterFields"
6
+ :key="'group-' + group.name"
7
7
  >
8
8
  <template v-if="group.flat">
9
9
  <FilterableField
10
- v-for="field in group.fields"
11
- :key="'field-' + field.name"
12
- :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
13
- :field="field"
14
- :loading="loading"
15
- class="mb-4"
16
- @update:model-value="updateFilter(field, $event)"
10
+ v-for="field in group.fields"
11
+ :key="'field-' + field.name"
12
+ :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
13
+ :field="field"
14
+ :loading="loading"
15
+ class="mb-4"
16
+ @update:model-value="updateFilter(field, $event)"
17
17
  />
18
18
  </template>
19
19
 
20
20
  <FilterFieldItem
21
- v-else
22
- :name="group.name"
23
- :count="activeCountByGroup[group.name]"
21
+ v-else
22
+ :name="group.name"
23
+ :count="activeCountByGroup[group.name]"
24
24
  >
25
25
  <FilterableField
26
- v-for="field in group.fields"
27
- :key="'field-' + field.name"
28
- :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
29
- :field="field"
30
- :loading="loading"
31
- class="mb-4"
32
- @update:model-value="updateFilter(field, $event)"
26
+ v-for="field in group.fields"
27
+ :key="'field-' + field.name"
28
+ :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
29
+ :field="field"
30
+ :loading="loading"
31
+ class="mb-4"
32
+ @update:model-value="updateFilter(field, $event)"
33
33
  />
34
34
  </FilterFieldItem>
35
35
 
36
36
  <QSeparator
37
- v-if="index < (filterFields.length - 1)"
38
- class="my-2"
37
+ v-if="index < (filterFields.length - 1)"
38
+ class="my-2"
39
39
  />
40
40
  </template>
41
41
  </div>
@@ -1,24 +1,27 @@
1
1
  <template>
2
- <div class="flex items-center transition-all" :class="{'w-72': showFilters, 'w-[6.5rem]': !showFilters}">
2
+ <div
3
+ class="flex items-center transition-all"
4
+ :class="{'w-72': showFilters, 'w-[6.5rem]': !showFilters}"
5
+ >
3
6
  <div class="flex-grow">
4
7
  <QBtn
5
- class="btn-blue-highlight border-blue-700"
6
- :class="{'highlighted': showFilters}"
7
- @click="$emit('update:show-filters', !showFilters)"
8
+ class="btn-blue-highlight border-blue-700"
9
+ :class="{'highlighted': showFilters}"
10
+ @click="$emit('update:show-filters', !showFilters)"
8
11
  >
9
12
  <FilterIcon class="w-5 mr-2" />
10
13
  <QBadge
11
- :label="'' + activeCount"
12
- rounded
14
+ :label="'' + activeCount"
15
+ rounded
13
16
 
14
- :color="activeCount > 0 ? 'blue-600' : 'gray-400'"
17
+ :color="activeCount > 0 ? 'blue-600' : 'gray-400'"
15
18
  />
16
19
  </QBtn>
17
20
  </div>
18
21
  <a
19
- v-if="activeCount > 0 && showFilters"
20
- class="text-blue-600 hover:text-blue-500 text-sm ml-4"
21
- @click="$emit('update:filter', {})"
22
+ v-if="activeCount > 0 && showFilters"
23
+ class="text-blue-600 hover:text-blue-500 text-sm ml-4"
24
+ @click="$emit('update:filter', {})"
22
25
  >Clear All</a>
23
26
  </div>
24
27
  </template>