quasar-ui-danx 0.4.24 → 0.4.27

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.4.24",
3
+ "version": "0.4.27",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -6,7 +6,9 @@
6
6
  @drop.prevent="onDrop"
7
7
  >
8
8
  <FieldLabel
9
- :field="field"
9
+ v-if="label || (name || showName)"
10
+ :label="label"
11
+ :name="name"
10
12
  :show-name="showName"
11
13
  class="text-sm font-semibold"
12
14
  />
@@ -35,7 +37,7 @@
35
37
  v-if="!readonly || uploadedFile"
36
38
  class="w-32 cursor-pointer mt-2"
37
39
  :class="{'border border-dashed border-blue-600': !uploadedFile, 'mx-auto': !readonly}"
38
- :file="uploadedFile"
40
+ :file="uploadedFile || undefined"
39
41
  downloadable
40
42
  @click="!disable && $refs.file.click()"
41
43
  />
@@ -48,26 +50,22 @@
48
50
  </div>
49
51
  </template>
50
52
 
51
- <script setup>
53
+ <script setup lang="ts">
52
54
  import { onMounted } from "vue";
53
55
  import { useSingleFileUpload } from "../../../../helpers";
56
+ import { UploadedFile } from "../../../../types";
54
57
  import { FilePreview } from "../../../Utility";
55
58
  import FieldLabel from "./FieldLabel";
56
59
 
57
60
  const emit = defineEmits(["update:model-value"]);
58
- const props = defineProps({
59
- modelValue: {
60
- type: [Object, String],
61
- default: null
62
- },
63
- field: {
64
- type: Object,
65
- required: true
66
- },
67
- showName: Boolean,
68
- disable: Boolean,
69
- readonly: Boolean
70
- });
61
+ const props = defineProps<{
62
+ modelValue?: UploadedFile;
63
+ label?: string;
64
+ name?: string;
65
+ showName?: boolean;
66
+ disable?: boolean;
67
+ readonly?: boolean;
68
+ }>();
71
69
  const { onComplete, onDrop, onFileSelected, uploadedFile, clearUploadedFile } = useSingleFileUpload();
72
70
  onComplete(() => emit("update:model-value", uploadedFile.value));
73
71
 
@@ -384,7 +384,6 @@ export function parseMarkdownCode(string: string): string {
384
384
  * ie: a valid JSON string with a ```json prefix and ``` postfix
385
385
  */
386
386
  export function fMarkdownCode(type: string, string: string | object): string {
387
- console.log("formatting", type, string);
388
387
  if (typeof string === "object" || isJSON(string)) {
389
388
  switch (type) {
390
389
  case "yaml":