quasar-ui-danx 0.3.12 → 0.3.13

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.3.12",
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,5 +1,8 @@
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
8
  ref="actionTable"
@@ -12,10 +15,10 @@
12
15
  selection="multiple"
13
16
  :rows-per-page-options="rowsPerPageOptions"
14
17
  class="sticky-column sticky-header w-full h-full !border-0"
15
- color="blue-600"
18
+ :color="color"
16
19
  @update:selected="$emit('update:selected-rows', $event)"
17
20
  @update:pagination="() => {}"
18
- @request="$emit('update:quasar-pagination', {...$event.pagination, __sort: mapSortBy($event.pagination, columns)})"
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,6 +27,7 @@
24
27
  </template>
25
28
  <template #top-row>
26
29
  <TableSummaryRow
30
+ v-if="hasData"
27
31
  :label="label"
28
32
  :item-count="summary?.count || 0"
29
33
  :selected-count="selectedRows.length"
@@ -60,7 +64,7 @@
60
64
 
61
65
  <script setup>
62
66
  import { QTable } from "quasar";
63
- import { ref } from "vue";
67
+ import { computed, ref } from "vue";
64
68
  import { getItem, setItem } from "../../helpers";
65
69
  import { ActionVnode } from "../Utility";
66
70
  import ActionTableColumn from "./ActionTableColumn.vue";
@@ -79,6 +83,10 @@ const props = defineProps({
79
83
  type: String,
80
84
  required: true
81
85
  },
86
+ color: {
87
+ type: String,
88
+ default: "blue-600"
89
+ },
82
90
  selectedRows: {
83
91
  type: Array,
84
92
  required: true
@@ -109,9 +117,21 @@ const props = defineProps({
109
117
  const actionTable = ref(null);
110
118
  registerStickyScrolling(actionTable);
111
119
 
120
+ const hasData = computed(() => props.pagedItems?.data?.length);
112
121
  const COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;
113
122
  const columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});
114
123
  function onUpdateColumnSettings() {
115
124
  setItem(COLUMN_SETTINGS_KEY, columnSettings.value);
116
125
  }
117
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>
@@ -2,8 +2,8 @@
2
2
  <CollapsableSidebar
3
3
  :collapse="!showFilters"
4
4
  disabled
5
- min-width="0"
6
- max-width="18rem"
5
+ :min-width="minWidth"
6
+ :max-width="maxWidth"
7
7
  :name="name"
8
8
  @update:collapse="$emit('update:show-filters', !$event)"
9
9
  >
@@ -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: () => []
@@ -1,10 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <div
4
- v-if="label"
5
- class="font-bold text-xs mb-2"
6
- >
7
- {{ label }}
3
+ <div class="mb-2">
4
+ <FieldLabel :label="label" />
8
5
  </div>
9
6
  <template v-if="inline">
10
7
  <QDate
@@ -41,6 +38,7 @@
41
38
  import { CalendarIcon as DateIcon } from "@heroicons/vue/outline";
42
39
  import { computed, ref, watch } from "vue";
43
40
  import { fDate, parseQDate, parseQDateTime } from "../../../../helpers";
41
+ import FieldLabel from "./FieldLabel";
44
42
 
45
43
  const emit = defineEmits(["update:model-value"]);
46
44
  const props = defineProps({
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex flex-grow flex-col flex-nowrap overflow-hidden h-full bg-white">
2
+ <div class="flex flex-grow flex-col flex-nowrap overflow-hidden h-full">
3
3
  <slot name="top" />
4
4
  <slot name="toolbar" />
5
5
  <div class="flex flex-nowrap flex-grow overflow-hidden w-full">
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <QTr
3
- class="sticky-column-1 transition-all sticky-row"
4
- :class="{'!bg-gray-100': !selectedCount, '!bg-blue-600 text-white selected': selectedCount, 'opacity-50': loading}"
3
+ class="dx-table-summary-tr sticky-column-1 transition-all sticky-row"
4
+ :class="{'has-selection': selectedCount, 'is-loading': loading}"
5
5
  >
6
6
  <QTd
7
7
  :colspan="stickyColspan"
8
- class="font-bold transition-all"
9
- :class="{'!bg-gray-100 !pl-5': !selectedCount, '!bg-blue-600 text-white !pl-4': selectedCount}"
8
+ class="dx-table-summary-td transition-all"
9
+ :class="{'has-selection': selectedCount}"
10
10
  >
11
11
  <div class="flex flex-nowrap items-center">
12
12
  <div