quasar-ui-danx 0.4.87 → 0.4.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.4.87",
3
+ "version": "0.4.89",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -5,7 +5,7 @@
5
5
  >
6
6
  <QTable
7
7
  ref="actionTable"
8
- :selected="selectedRows"
8
+ :selected="selectedRows || []"
9
9
  :pagination="pagination"
10
10
  :columns="tableColumns"
11
11
  :loading="loadingList || loadingSummary"
@@ -29,7 +29,7 @@
29
29
  v-if="hasData"
30
30
  :label="label"
31
31
  :item-count="summary?.count || 0"
32
- :selected-count="selectedRows.length"
32
+ :selected-count="selectedRows?.length"
33
33
  :sticky-colspan="summaryColSpan"
34
34
  :loading="loadingSummary"
35
35
  :summary="summary"
@@ -75,77 +75,78 @@ import TableSummaryRow from "./TableSummaryRow.vue";
75
75
  defineEmits(["update:selected-rows", "update:pagination"]);
76
76
 
77
77
  export interface Props {
78
- name: string;
79
- label: string;
80
- color?: string;
81
- selectedRows: ActionTargetItem[];
82
- pagination: ListControlsPagination;
83
- loadingList?: boolean;
84
- loadingSummary?: boolean;
85
- pagedItems?: any;
86
- summary: any;
87
- menuActions?: ResourceAction[];
88
- columns: TableColumn[];
89
- rowsPerPageOptions?: number[];
90
- summaryColSpan?: number;
91
- selection: "multiple" | "single";
78
+ name: string;
79
+ label: string;
80
+ color?: string;
81
+ selectedRows?: ActionTargetItem[];
82
+ pagination: ListControlsPagination;
83
+ loadingList?: boolean;
84
+ loadingSummary?: boolean;
85
+ pagedItems?: any;
86
+ summary: any;
87
+ menuActions?: ResourceAction[];
88
+ columns: TableColumn[];
89
+ rowsPerPageOptions?: number[];
90
+ summaryColSpan?: number;
91
+ selection?: "multiple" | "single";
92
92
  }
93
93
 
94
94
  const props = withDefaults(defineProps<Props>(), {
95
- color: "",
96
- pagedItems: null,
97
- summary: null,
98
- loadingSummary: false,
99
- rowsPerPageOptions: () => [10, 25, 50, 100],
100
- summaryColSpan: null,
101
- selection: "multiple"
95
+ color: "",
96
+ pagedItems: null,
97
+ summary: null,
98
+ loadingSummary: false,
99
+ rowsPerPageOptions: () => [10, 25, 50, 100],
100
+ summaryColSpan: null,
101
+ selection: undefined
102
102
  });
103
103
 
104
104
  const actionTable = ref(null);
105
105
  registerStickyScrolling(actionTable);
106
106
 
107
107
  const tableColumns = computed<TableColumn[]>(() => {
108
- const columns = [...props.columns].map((column: TableColumn) => ({
109
- ...column,
110
- field: column.field || column.name
111
- }));
108
+ const columns = [...props.columns].map((column: TableColumn) => ({
109
+ ...column,
110
+ field: column.field || column.name
111
+ }));
112
112
 
113
- // Inject the Action Menu column if there are menu actions
114
- if (props.menuActions?.length) {
115
- const menuColumn = columns.find((column) => column.name === "menu");
116
- const menuColumnOptions: TableColumn = {
117
- name: "menu",
118
- label: "",
119
- required: true,
120
- hideContent: true,
121
- shrink: true,
122
- actionMenu: props.menuActions
123
- };
113
+ // Inject the Action Menu column if there are menu actions
114
+ if (props.menuActions?.length) {
115
+ const menuColumn = columns.find((column) => column.name === "menu");
116
+ const menuColumnOptions: TableColumn = {
117
+ name: "menu",
118
+ label: "",
119
+ required: true,
120
+ hideContent: true,
121
+ shrink: true,
122
+ actionMenu: props.menuActions
123
+ };
124
124
 
125
- if (menuColumn) {
126
- Object.assign(menuColumn, menuColumnOptions);
127
- } else {
128
- columns.unshift(menuColumnOptions);
129
- }
130
- }
125
+ if (menuColumn) {
126
+ Object.assign(menuColumn, menuColumnOptions);
127
+ } else {
128
+ columns.unshift(menuColumnOptions);
129
+ }
130
+ }
131
131
 
132
- return columns;
132
+ return columns;
133
133
  });
134
134
  const hasData = computed(() => props.pagedItems?.data?.length);
135
135
  const COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;
136
136
  const columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});
137
+
137
138
  function onUpdateColumnSettings() {
138
- setItem(COLUMN_SETTINGS_KEY, columnSettings.value);
139
+ setItem(COLUMN_SETTINGS_KEY, columnSettings.value);
139
140
  }
140
141
  </script>
141
142
 
142
143
  <style scoped lang="scss">
143
144
  .dx-action-table {
144
- &.dx-no-data {
145
- :deep(.q-table__middle) {
146
- flex-grow: 0;
147
- flex-shrink: 1;
148
- }
149
- }
145
+ &.dx-no-data {
146
+ :deep(.q-table__middle) {
147
+ flex-grow: 0;
148
+ flex-shrink: 1;
149
+ }
150
+ }
150
151
  }
151
152
  </style>
@@ -42,22 +42,22 @@ import { fDate, parseDateTime } from "../../../../helpers";
42
42
 
43
43
  const emit = defineEmits(["update:model-value"]);
44
44
  const props = defineProps<{
45
- modelValue?: string | null;
46
- label: string | null;
47
- clearable: boolean;
45
+ modelValue?: string | null;
46
+ label: string | null;
47
+ clearable?: boolean;
48
48
  }>();
49
49
 
50
50
  const formattedDate = computed(() => {
51
- if (props.modelValue) {
52
- return fDate(parseDateTime(props.modelValue || "0000-00-00"));
53
- }
54
- return "- -";
51
+ if (props.modelValue) {
52
+ return fDate(parseDateTime(props.modelValue || "0000-00-00"));
53
+ }
54
+ return "- -";
55
55
  });
56
56
 
57
57
  const date = ref(parseDateTime(props.modelValue));
58
58
  watch(() => props.modelValue, val => date.value = val);
59
59
 
60
60
  function onSave() {
61
- emit("update:model-value", date.value);
61
+ emit("update:model-value", date.value);
62
62
  }
63
63
  </script>
@@ -65,6 +65,7 @@ import {
65
65
  FaSolidClock as ClockIcon,
66
66
  FaSolidCodeMerge as MergeIcon,
67
67
  FaSolidCopy as CopyIcon,
68
+ FaSolidDatabase as DatabaseIcon,
68
69
  FaSolidEye as ViewIcon,
69
70
  FaSolidFileExport as ExportIcon,
70
71
  FaSolidFileImport as ImportIcon,
@@ -82,7 +83,7 @@ import { computed, ref } from "vue";
82
83
  import { ActionTarget, ResourceAction } from "../../../types";
83
84
 
84
85
  export interface ActionButtonProps {
85
- type?: "save" | "trash" | "back" | "create" | "edit" | "copy" | "folder" | "play" | "stop" | "pause" | "refresh" | "restart" | "confirm" | "cancel" | "export" | "import" | "minus" | "merge" | "check" | "clock" | "view";
86
+ type?: "save" | "trash" | "back" | "create" | "edit" | "copy" | "folder" | "play" | "stop" | "pause" | "refresh" | "restart" | "confirm" | "cancel" | "export" | "import" | "minus" | "merge" | "check" | "clock" | "view" | "database";
86
87
  color?: "red" | "blue" | "blue-invert" | "sky" | "sky-invert" | "green" | "green-invert" | "lime" | "white" | "gray" | "slate" | "slate-invert" | "yellow" | "orange";
87
88
  size?: "xxs" | "xs" | "sm" | "md" | "lg";
88
89
  icon?: object | string;
@@ -230,6 +231,8 @@ const typeOptions = computed(() => {
230
231
  return { icon: CheckIcon };
231
232
  case "view":
232
233
  return { icon: ViewIcon };
234
+ case "database":
235
+ return { icon: DatabaseIcon };
233
236
  default:
234
237
  return { icon: EditIcon };
235
238
  }