quasar-ui-danx 0.4.18 → 0.4.20

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.18",
3
+ "version": "0.4.20",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div class="dx-text-field">
3
3
  <FieldLabel
4
4
  v-if="!prependLabel"
5
5
  :label="label"
@@ -33,7 +33,7 @@
33
33
  @update:model-value="$emit('update:model-value', $event)"
34
34
  >
35
35
  <template
36
- v-if="prependLabel"
36
+ v-if="prependLabel || $slots.prepend"
37
37
  #prepend
38
38
  >
39
39
  <FieldLabel
@@ -43,6 +43,10 @@
43
43
  :required-label="requiredLabel"
44
44
  :class="labelClass"
45
45
  />
46
+ <slot name="prepend" />
47
+ </template>
48
+ <template #append>
49
+ <slot name="append" />
46
50
  </template>
47
51
  </QInput>
48
52
  <MaxLengthCounter
@@ -10,6 +10,10 @@ export class FlashMessages {
10
10
  type: String,
11
11
  default: ""
12
12
  },
13
+ infoMsg: {
14
+ type: String,
15
+ default: ""
16
+ },
13
17
  errorMsg: {
14
18
  type: String,
15
19
  default: ""
@@ -20,11 +24,12 @@ export class FlashMessages {
20
24
  }
21
25
  };
22
26
 
23
- static enable(msgProps: { successMsg?: string, errorMsg?: string, warningMsg?: string }) {
27
+ static enable(msgProps: { successMsg?: string, infoMsg?: string, errorMsg?: string, warningMsg?: string }) {
24
28
  FlashMessages.success(msgProps.successMsg);
25
29
  FlashMessages.error(msgProps.errorMsg);
26
30
  FlashMessages.warning(msgProps.warningMsg);
27
31
  watch(() => msgProps.successMsg, msg => FlashMessages.success(msg));
32
+ watch(() => msgProps.infoMsg, msg => FlashMessages.info(msg));
28
33
  watch(() => msgProps.errorMsg, msg => FlashMessages.error(msg));
29
34
  watch(() => msgProps.warningMsg, msg => FlashMessages.warning(msg));
30
35
  }
@@ -61,6 +66,15 @@ export class FlashMessages {
61
66
  });
62
67
  }
63
68
 
69
+ static info(message?: string, options: QNotifyCreateOptions = {}) {
70
+ FlashMessages.send(message, {
71
+ classes: "bg-sky-300 !text-sky-900",
72
+ icon: "info",
73
+ ...options,
74
+ ...danxOptions.value.flashMessages?.info
75
+ });
76
+ }
77
+
64
78
  static error(message?: string, options: QNotifyCreateOptions = {}) {
65
79
  FlashMessages.send(message, {
66
80
  classes: "bg-red-300 !text-red-900",
@@ -228,8 +228,8 @@ export function fShortSize(value: string | number) {
228
228
  return Math.round(n / div) + " " + power.unit;
229
229
  }
230
230
 
231
- export function fBoolean(value: boolean) {
232
- return value ? "Yes" : "No";
231
+ export function fBoolean(value?: boolean) {
232
+ return (value === undefined || value === null) ? "-" : (value ? "Yes" : "No");
233
233
  }
234
234
 
235
235
  /**
@@ -378,8 +378,6 @@ export function fMarkdownCode(type: string, string: string | object): string {
378
378
  string = stringifyYAML(typeof string === "string" ? JSON.parse(string) : string);
379
379
  break;
380
380
  case "ts":
381
- string = "";
382
- break;
383
381
  default:
384
382
  string = fJSON(string);
385
383
  }
@@ -11,6 +11,7 @@ export interface DanxOptions {
11
11
  flashMessages?: {
12
12
  default?: QNotifyCreateOptions;
13
13
  success?: QNotifyCreateOptions;
14
+ info?: QNotifyCreateOptions;
14
15
  warning?: QNotifyCreateOptions;
15
16
  error?: QNotifyCreateOptions;
16
17
  };