@data-fair/lib-vuetify 1.6.0 → 1.6.2

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": "@data-fair/lib-vuetify",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -2,12 +2,12 @@
2
2
  <v-alert
3
3
  v-if="notif"
4
4
  class="ui-notif-alert"
5
- v-bind="alertProps"
5
+ v-bind="fullAlertProps"
6
6
  >
7
- <p>{{ notif.msg }}</p>
7
+ <p v-if="notif.msg">{{ notif.msg }}</p>
8
8
  <p
9
9
  v-if="notif.type === 'error'"
10
- class="ml-3"
10
+ :class="notif.msg ? 'ml-3' : ''"
11
11
  v-text="notif.errorMsg"
12
12
  />
13
13
  </v-alert>
@@ -18,7 +18,10 @@ import { computed } from 'vue'
18
18
  import { type UiNotif, useUiNotif } from '@data-fair/lib-vue/ui-notif.js'
19
19
 
20
20
  const {notif, alertProps} = defineProps({
21
- notif: Object as () => UiNotif,
21
+ notif: {
22
+ type: Object as () => UiNotif,
23
+ default: null
24
+ },
22
25
  alertProps: {
23
26
  type: Object,
24
27
  default () { return {} }
@@ -28,7 +31,11 @@ const {notif, alertProps} = defineProps({
28
31
  const fullAlertProps = computed(() => {
29
32
  const props = { ...alertProps }
30
33
  if (!notif) return props
31
- props.type = notif.type
34
+ if (notif.type === 'error') {
35
+ props.color = notif.clientError ? 'warning' : 'error'
36
+ } else {
37
+ props.color = notif.type
38
+ }
32
39
  return props
33
40
  })
34
41
 
@@ -1,17 +1,24 @@
1
1
  import { type UiNotif } from '@data-fair/lib-vue/ui-notif.js';
2
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
- notif: () => UiNotif;
3
+ notif: {
4
+ type: () => UiNotif;
5
+ default: null;
6
+ };
4
7
  alertProps: {
5
8
  type: ObjectConstructor;
6
9
  default(): {};
7
10
  };
8
11
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
- notif: () => UiNotif;
12
+ notif: {
13
+ type: () => UiNotif;
14
+ default: null;
15
+ };
10
16
  alertProps: {
11
17
  type: ObjectConstructor;
12
18
  default(): {};
13
19
  };
14
20
  }>> & Readonly<{}>, {
21
+ notif: UiNotif;
15
22
  alertProps: Record<string, any>;
16
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
24
  export default _default;
@@ -2,7 +2,10 @@
2
2
  import { computed } from 'vue';
3
3
  const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
4
4
  const __VLS_props = defineProps({
5
- notif: Object,
5
+ notif: {
6
+ type: Object,
7
+ default: null
8
+ },
6
9
  alertProps: {
7
10
  type: Object,
8
11
  default() { return {}; }
@@ -13,12 +16,20 @@ const fullAlertProps = computed(() => {
13
16
  const props = { ...alertProps };
14
17
  if (!notif)
15
18
  return props;
16
- props.type = notif.type;
19
+ if (notif.type === 'error') {
20
+ props.color = notif.clientError ? 'warning' : 'error';
21
+ }
22
+ else {
23
+ props.color = notif.type;
24
+ }
17
25
  return props;
18
26
  });
19
27
  const __VLS_fnComponent = (await import('vue')).defineComponent({
20
28
  props: {
21
- notif: Object,
29
+ notif: {
30
+ type: Object,
31
+ default: null
32
+ },
22
33
  alertProps: {
23
34
  type: Object,
24
35
  default() { return {}; }
@@ -48,19 +59,20 @@ function __VLS_template() {
48
59
  const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.VAlert;
49
60
  /** @type { [typeof __VLS_components.VAlert, typeof __VLS_components.vAlert, typeof __VLS_components.VAlert, typeof __VLS_components.vAlert, ] } */
50
61
  // @ts-ignore
51
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ class: ("ui-notif-alert") }, ...(__VLS_ctx.alertProps), }));
52
- const __VLS_2 = __VLS_1({ ...{ class: ("ui-notif-alert") }, ...(__VLS_ctx.alertProps), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
53
- __VLS_elementAsFunction(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
54
- (__VLS_ctx.notif.msg);
62
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ class: ("ui-notif-alert") }, ...(__VLS_ctx.fullAlertProps), }));
63
+ const __VLS_2 = __VLS_1({ ...{ class: ("ui-notif-alert") }, ...(__VLS_ctx.fullAlertProps), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
64
+ if (__VLS_ctx.notif.msg) {
65
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
66
+ (__VLS_ctx.notif.msg);
67
+ }
55
68
  if (__VLS_ctx.notif.type === 'error') {
56
- __VLS_elementAsFunction(__VLS_intrinsicElements.p)({ ...{ class: ("ml-3") }, });
69
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p)({ ...{ class: ((__VLS_ctx.notif.msg ? 'ml-3' : '')) }, });
57
70
  __VLS_directiveAsFunction(__VLS_directives.vText)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.notif.errorMsg) }, null, null);
58
71
  }
59
72
  __VLS_nonNullable(__VLS_5.slots).default;
60
73
  const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
61
74
  }
62
75
  __VLS_styleScopedClasses['ui-notif-alert'];
63
- __VLS_styleScopedClasses['ml-3'];
64
76
  var __VLS_slots;
65
77
  var __VLS_inheritedAttrs;
66
78
  const __VLS_refs = {};
@@ -76,11 +88,14 @@ const __VLS_self = (await import('vue')).defineComponent({
76
88
  setup() {
77
89
  return {
78
90
  notif: notif,
79
- alertProps: alertProps,
91
+ fullAlertProps: fullAlertProps,
80
92
  };
81
93
  },
82
94
  props: {
83
- notif: Object,
95
+ notif: {
96
+ type: Object,
97
+ default: null
98
+ },
84
99
  alertProps: {
85
100
  type: Object,
86
101
  default() { return {}; }
@@ -92,7 +107,10 @@ export default (await import('vue')).defineComponent({
92
107
  return {};
93
108
  },
94
109
  props: {
95
- notif: Object,
110
+ notif: {
111
+ type: Object,
112
+ default: null
113
+ },
96
114
  alertProps: {
97
115
  type: Object,
98
116
  default() { return {}; }
package/ui-notif.vue CHANGED
@@ -6,10 +6,10 @@
6
6
  class="ui-notif"
7
7
  v-bind="fullSnackbarProps"
8
8
  >
9
- <p>{{ notification.msg }}</p>
9
+ <p v-if="notification.msg">{{ notification.msg }}</p>
10
10
  <p
11
11
  v-if="notification.type === 'error'"
12
- class="ml-3"
12
+ :class="notification.msg ? 'ml-3' : ''"
13
13
  v-text="notification.errorMsg"
14
14
  />
15
15
 
@@ -55,8 +55,13 @@ const { snackbarProps } = defineProps({
55
55
  const fullSnackbarProps = computed(() => {
56
56
  const props = { ...snackbarProps }
57
57
  if (!notification.value) return props
58
- if (notification.value.type === 'error') props.timeout = -1
59
- props.color = notification.value.type
58
+ if (notification.value.type === 'error') {
59
+ props.timeout = -1
60
+ props.color = notification.value.clientError ? 'warning' : 'error'
61
+ } else {
62
+ props.color = notification.value.type
63
+ }
64
+
60
65
  return props
61
66
  })
62
67
 
package/ui-notif.vue.js CHANGED
@@ -27,9 +27,13 @@ const fullSnackbarProps = computed(() => {
27
27
  const props = { ...snackbarProps };
28
28
  if (!notification.value)
29
29
  return props;
30
- if (notification.value.type === 'error')
30
+ if (notification.value.type === 'error') {
31
31
  props.timeout = -1;
32
- props.color = notification.value.type;
32
+ props.color = notification.value.clientError ? 'warning' : 'error';
33
+ }
34
+ else {
35
+ props.color = notification.value.type;
36
+ }
33
37
  return props;
34
38
  });
35
39
  const __VLS_fnComponent = (await import('vue')).defineComponent({
@@ -70,10 +74,12 @@ function __VLS_template() {
70
74
  // @ts-ignore navigation for `const notificationSnackbar = ref()`
71
75
  __VLS_ctx.notificationSnackbar;
72
76
  var __VLS_6 = {};
73
- __VLS_elementAsFunction(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
74
- (__VLS_ctx.notification.msg);
77
+ if (__VLS_ctx.notification.msg) {
78
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
79
+ (__VLS_ctx.notification.msg);
80
+ }
75
81
  if (__VLS_ctx.notification.type === 'error') {
76
- __VLS_elementAsFunction(__VLS_intrinsicElements.p)({ ...{ class: ("ml-3") }, });
82
+ __VLS_elementAsFunction(__VLS_intrinsicElements.p)({ ...{ class: ((__VLS_ctx.notification.msg ? 'ml-3' : '')) }, });
77
83
  __VLS_directiveAsFunction(__VLS_directives.vText)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.notification.errorMsg) }, null, null);
78
84
  }
79
85
  __VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
@@ -105,7 +111,6 @@ function __VLS_template() {
105
111
  const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
106
112
  }
107
113
  __VLS_styleScopedClasses['ui-notif'];
108
- __VLS_styleScopedClasses['ml-3'];
109
114
  var __VLS_slots;
110
115
  var __VLS_inheritedAttrs;
111
116
  const __VLS_refs = {
package/vite.d.ts CHANGED
@@ -6,6 +6,7 @@ export declare const autoImports: (string | {
6
6
  '@data-fair/lib-vue/ui-notif.js': string[];
7
7
  '@data-fair/lib-vue/fetch.js': string[];
8
8
  '@data-fair/lib-vue/ws.js': string[];
9
+ '@data-fair/lib-vue/async-action.js': string[];
9
10
  } | {
10
11
  '@data-fair/lib-vuetify/personal-menu.vue': string[][];
11
12
  '@data-fair/lib-vuetify/tutorial-alert.vue': string[][];