quasar-ui-danx 0.0.34 → 0.0.36

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.34",
3
+ "version": "0.0.36",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -57,7 +57,9 @@
57
57
  >
58
58
  <RenderComponent
59
59
  v-if="rowProps.col.component"
60
- :row-props="rowProps"
60
+ :params="[rowProps.row]"
61
+ :component="rowProps.col.component"
62
+ :text="rowProps.value"
61
63
  @action="$emit('action', $event)"
62
64
  />
63
65
  <div v-else-if="rowProps.col.fieldList">
@@ -1,22 +1,37 @@
1
1
  <template>
2
2
  <Component
3
- :is="component.is"
4
- v-bind="component.props"
5
- @action="$emit('action', $event)"
6
- >{{ component.value || component.props?.text || rowProps.value }}</Component>
3
+ :is="resolvedComponent.is"
4
+ v-bind="{...resolvedComponent.props, ...overrideProps}"
5
+ @action="$emit('action', $event)"
6
+ >{{ resolvedComponent.value || resolvedComponent.props?.text || text }}</Component>
7
7
  </template>
8
8
  <script setup>
9
- import { computed } from "vue";
9
+ import { computed } from 'vue';
10
10
 
11
- defineEmits(["action"]);
11
+ defineEmits(['action']);
12
12
  const props = defineProps({
13
- rowProps: {
14
- type: Object,
13
+ component: {
14
+ type: [Function, Object],
15
15
  required: true
16
+ },
17
+ params: {
18
+ type: Array,
19
+ default: () => []
20
+ },
21
+ text: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ overrideProps: {
26
+ type: Object,
27
+ default: () => ({})
16
28
  }
17
29
  });
18
30
 
19
- const component = computed(() => {
20
- return props.rowProps.col.component(props.rowProps.row);
31
+ const resolvedComponent = computed(() => {
32
+ if (typeof props.component === 'function') {
33
+ return props.component(...props.params);
34
+ }
35
+ return props.component;
21
36
  });
22
37
  </script>
@@ -252,10 +252,10 @@ export function useListActions(name: string, {
252
252
  return result;
253
253
  }
254
254
 
255
- // The active ad for viewing / editing in the Ad Form
255
+ // The active ad for viewing / editing
256
256
  const activeItem = ref(null);
257
- // Controls the tab on the Ad Form
258
- const formTab = ref("general");
257
+ // Controls the active panel (ie: tab) if rendering a panels drawer or similar
258
+ const activePanel = ref(null);
259
259
 
260
260
  /**
261
261
  * Gets the additional details for the currently active item.
@@ -293,7 +293,7 @@ export function useListActions(name: string, {
293
293
  */
294
294
  function openItemForm(item, tab) {
295
295
  activeItem.value = item;
296
- formTab.value = tab;
296
+ activePanel.value = tab;
297
297
  }
298
298
 
299
299
  /**
@@ -357,7 +357,7 @@ export function useListActions(name: string, {
357
357
  quasarPagination,
358
358
  isApplyingActionToItem,
359
359
  activeItem,
360
- formTab,
360
+ activePanel,
361
361
 
362
362
  // Actions
363
363
  initialize,