quasar-ui-danx 0.3.13 → 0.3.21

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.13",
3
+ "version": "0.3.21",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -1,8 +1,5 @@
1
1
  <template>
2
- <div
3
- class="dx-action-table overflow-hidden w-full"
4
- :class="{'dx-no-data': !hasData}"
5
- >
2
+ <div class="overflow-hidden w-full">
6
3
  <ActionVnode />
7
4
  <QTable
8
5
  ref="actionTable"
@@ -15,10 +12,10 @@
15
12
  selection="multiple"
16
13
  :rows-per-page-options="rowsPerPageOptions"
17
14
  class="sticky-column sticky-header w-full h-full !border-0"
18
- :color="color"
15
+ color="blue-600"
19
16
  @update:selected="$emit('update:selected-rows', $event)"
20
17
  @update:pagination="() => {}"
21
- @request="(e) => $emit('update:quasar-pagination', {...e.pagination, __sort: mapSortBy(e.pagination, columns)})"
18
+ @request="$emit('update:quasar-pagination', {...$event.pagination, __sort: mapSortBy($event.pagination, columns)})"
22
19
  >
23
20
  <template #no-data>
24
21
  <slot name="empty">
@@ -27,7 +24,6 @@
27
24
  </template>
28
25
  <template #top-row>
29
26
  <TableSummaryRow
30
- v-if="hasData"
31
27
  :label="label"
32
28
  :item-count="summary?.count || 0"
33
29
  :selected-count="selectedRows.length"
@@ -64,7 +60,7 @@
64
60
 
65
61
  <script setup>
66
62
  import { QTable } from "quasar";
67
- import { computed, ref } from "vue";
63
+ import { ref } from "vue";
68
64
  import { getItem, setItem } from "../../helpers";
69
65
  import { ActionVnode } from "../Utility";
70
66
  import ActionTableColumn from "./ActionTableColumn.vue";
@@ -83,10 +79,6 @@ const props = defineProps({
83
79
  type: String,
84
80
  required: true
85
81
  },
86
- color: {
87
- type: String,
88
- default: "blue-600"
89
- },
90
82
  selectedRows: {
91
83
  type: Array,
92
84
  required: true
@@ -117,21 +109,9 @@ const props = defineProps({
117
109
  const actionTable = ref(null);
118
110
  registerStickyScrolling(actionTable);
119
111
 
120
- const hasData = computed(() => props.pagedItems?.data?.length);
121
112
  const COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;
122
113
  const columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});
123
114
  function onUpdateColumnSettings() {
124
115
  setItem(COLUMN_SETTINGS_KEY, columnSettings.value);
125
116
  }
126
117
  </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="minWidth"
6
- :max-width="maxWidth"
5
+ min-width="0"
6
+ max-width="18rem"
7
7
  :name="name"
8
8
  @update:collapse="$emit('update:show-filters', !$event)"
9
9
  >
@@ -29,14 +29,6 @@ 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
- },
40
32
  filterFields: {
41
33
  type: Array,
42
34
  default: () => []
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <div class="mb-2">
4
- <FieldLabel :label="label" />
3
+ <div
4
+ v-if="label"
5
+ class="font-bold text-xs mb-2"
6
+ >
7
+ {{ label }}
5
8
  </div>
6
9
  <template v-if="inline">
7
10
  <QDate
@@ -38,7 +41,6 @@
38
41
  import { CalendarIcon as DateIcon } from "@heroicons/vue/outline";
39
42
  import { computed, ref, watch } from "vue";
40
43
  import { fDate, parseQDate, parseQDateTime } from "../../../../helpers";
41
- import FieldLabel from "./FieldLabel";
42
44
 
43
45
  const emit = defineEmits(["update:model-value"]);
44
46
  const props = defineProps({
@@ -8,12 +8,13 @@
8
8
  {{ text }}
9
9
  </slot>
10
10
 
11
+ {{ "accept: " + ((geolocation && cameraOnly) ? "image/*;capture=camera" : undefined) }}
11
12
  <input
12
13
  ref="fileUpload"
13
14
  data-testid="file-upload"
14
15
  type="file"
15
- :accept="geolocation ? 'image/*;capture=camera' : undefined"
16
- :capture="geolocation ? 'environment' : undefined"
16
+ :accept="(geolocation && cameraOnly) ? 'image/*;capture=camera' : undefined"
17
+ :capture="(geolocation && cameraOnly) ? 'environment' : undefined"
17
18
  class="hidden"
18
19
  multiple
19
20
  @change="onAttachFiles"
@@ -28,28 +29,29 @@ import { FileUpload } from "../../../../helpers";
28
29
 
29
30
  defineExpose({ upload });
30
31
  const emit = defineEmits([
31
- "uploading",
32
- "file-progress",
33
- "file-complete",
34
- "complete"
32
+ "uploading",
33
+ "file-progress",
34
+ "file-complete",
35
+ "complete"
35
36
  ]);
36
37
  const props = defineProps({
37
- ...QBtn.props,
38
- text: {
39
- type: String,
40
- default: "Add File"
41
- },
42
- locationWaitMessage: {
43
- type: String,
44
- default: "Waiting for location..."
45
- },
46
- geolocation: Boolean
38
+ ...QBtn.props,
39
+ text: {
40
+ type: String,
41
+ default: "Add File"
42
+ },
43
+ locationWaitMessage: {
44
+ type: String,
45
+ default: "Waiting for location..."
46
+ },
47
+ cameraOnly: Boolean,
48
+ geolocation: Boolean
47
49
  });
48
50
 
49
51
  const fileUpload = ref(null);
50
52
 
51
53
  function upload() {
52
- fileUpload.value.click();
54
+ fileUpload.value.click();
53
55
  }
54
56
 
55
57
  /**
@@ -59,23 +61,23 @@ function upload() {
59
61
  * @returns {Promise<void>}
60
62
  */
61
63
  async function onAttachFiles({ target: { files } }) {
62
- emit("uploading", files);
63
- let fileUpload = new FileUpload(files)
64
- .onProgress(({ file, progress }) => {
65
- file.progress = progress;
66
- emit("file-progress", file);
67
- })
68
- .onComplete(({ file, uploadedFile }) => {
69
- emit("file-complete", { file, uploadedFile });
70
- })
71
- .onAllComplete(() => {
72
- emit("complete", fileUpload.files);
73
- });
64
+ emit("uploading", files);
65
+ let fileUpload = new FileUpload(files)
66
+ .onProgress(({ file, progress }) => {
67
+ file.progress = progress;
68
+ emit("file-progress", file);
69
+ })
70
+ .onComplete(({ file, uploadedFile }) => {
71
+ emit("file-complete", { file, uploadedFile });
72
+ })
73
+ .onAllComplete(() => {
74
+ emit("complete", fileUpload.files);
75
+ });
74
76
 
75
- if (props.geolocation) {
76
- await fileUpload.resolveLocation(props.locationWaitMessage);
77
- }
77
+ if (props.geolocation) {
78
+ await fileUpload.resolveLocation(props.locationWaitMessage);
79
+ }
78
80
 
79
- fileUpload.upload();
81
+ fileUpload.upload();
80
82
  }
81
83
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex flex-grow flex-col flex-nowrap overflow-hidden h-full">
2
+ <div class="flex flex-grow flex-col flex-nowrap overflow-hidden h-full bg-white">
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="dx-table-summary-tr sticky-column-1 transition-all sticky-row"
4
- :class="{'has-selection': selectedCount, 'is-loading': loading}"
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}"
5
5
  >
6
6
  <QTd
7
7
  :colspan="stickyColspan"
8
- class="dx-table-summary-td transition-all"
9
- :class="{'has-selection': selectedCount}"
8
+ class="font-bold transition-all"
9
+ :class="{'!bg-gray-100 !pl-5': !selectedCount, '!bg-blue-600 text-white !pl-4': selectedCount}"
10
10
  >
11
11
  <div class="flex flex-nowrap items-center">
12
12
  <div