quasar-ui-danx 0.0.18 → 0.0.19

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.18",
3
+ "version": "0.0.19",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -49,27 +49,27 @@
49
49
  </template>
50
50
  <template #body-cell="rowProps">
51
51
  <q-td :key="rowProps.key" :props="rowProps">
52
- <template v-if="rowProps.col.component">
53
- <RenderComponentColumn
54
- :row-props="rowProps"
55
- @action="$emit('action', $event)"
56
- />
57
- </template>
58
- <template v-else-if="rowProps.col.fieldList">
59
- <div v-for="field in rowProps.col.fieldList" :key="field">
60
- {{ rowProps.row[field] }}
61
- </div>
62
- </template>
63
- <template v-else-if="rowProps.col.filterOnClick">
64
- <a @click="$emit('filter', rowProps.col.filterOnClick(rowProps.row))">
65
- {{ rowProps.value }}
66
- </a>
67
- </template>
68
- <template v-else>
69
- <slot v-bind="{name: rowProps.col.name, row: rowProps.row, value: rowProps.value}">
70
- {{ rowProps.value }}
71
- </slot>
72
- </template>
52
+ <component
53
+ :is="rowProps.col.onClick ? 'a' : 'div'"
54
+ @click="() => rowProps.col.onClick && rowProps.col.onClick(rowProps.row)"
55
+ >
56
+ <template v-if="rowProps.col.component">
57
+ <RenderComponent
58
+ :row-props="rowProps"
59
+ @action="$emit('action', $event)"
60
+ />
61
+ </template>
62
+ <template v-else-if="rowProps.col.fieldList">
63
+ <div v-for="field in rowProps.col.fieldList" :key="field">
64
+ {{ rowProps.row[field] }}
65
+ </div>
66
+ </template>
67
+ <template v-else>
68
+ <slot v-bind="{name: rowProps.col.name, row: rowProps.row, value: rowProps.value}">
69
+ {{ rowProps.value }}
70
+ </slot>
71
+ </template>
72
+ </component>
73
73
  </q-td>
74
74
  </template>
75
75
  </q-table>
@@ -77,7 +77,7 @@
77
77
 
78
78
  <script setup>
79
79
  import { ref } from 'vue';
80
- import { EmptyTableState, registerStickyScrolling, RenderComponentColumn, TableSummaryRow } from '.';
80
+ import { EmptyTableState, registerStickyScrolling, RenderComponent, TableSummaryRow } from '.';
81
81
  import { DragHandleIcon as RowResizeIcon } from '../../svg';
82
82
  import { HandleDraggable } from '../DragAndDrop';
83
83
 
@@ -6,5 +6,5 @@ export * from "./tableColumns";
6
6
  export { default as ActionTable } from "./ActionTable.vue";
7
7
  export { default as BatchActionMenu } from "./BatchActionMenu.vue";
8
8
  export { default as EmptyTableState } from "./EmptyTableState.vue";
9
- export { default as RenderComponentColumn } from "./RenderComponentColumn.vue";
9
+ export { default as RenderComponent } from "src/components/ActionTable/RenderComponent.vue";
10
10
  export { default as TableSummaryRow } from "./TableSummaryRow.vue";
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <ul>
3
+ <li v-for="item in items" :key="item[column]">
4
+ {{ item[column] }}
5
+ </li>
6
+ </ul>
7
+ </template>
8
+ <script setup>
9
+ defineProps({
10
+ items: {
11
+ type: Array,
12
+ required: true
13
+ },
14
+ column: {
15
+ type: String,
16
+ required: true
17
+ }
18
+ });
19
+ </script>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <QBtn
3
+ class="bg-neutral-plus-6"
4
+ :loading="loading"
5
+ >
6
+ <RefreshIcon class="w-5" />
7
+ </QBtn>
8
+ </template>
9
+ <script setup>
10
+ import { RefreshIcon } from "@heroicons/vue/solid";
11
+
12
+ defineEmits(["refresh"]);
13
+ defineProps({
14
+ loading: Boolean
15
+ });
16
+ </script>