@vc-shell/framework 1.0.66 → 1.0.68

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.
Files changed (101) hide show
  1. package/core/composables/index.ts +1 -0
  2. package/core/composables/useErrorHandler/index.ts +44 -0
  3. package/core/composables/useNotifications/index.ts +13 -3
  4. package/core/composables/useSettings/index.ts +2 -3
  5. package/core/plugins/error-interceptor/index.ts +17 -0
  6. package/core/plugins/error-interceptor/interceptor.ts +43 -0
  7. package/core/plugins/index.ts +1 -0
  8. package/core/plugins/validation/rules.ts +10 -0
  9. package/dist/core/composables/index.d.ts +1 -0
  10. package/dist/core/composables/index.d.ts.map +1 -1
  11. package/dist/core/composables/useErrorHandler/index.d.ts +8 -0
  12. package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -0
  13. package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
  14. package/dist/core/composables/useSettings/index.d.ts +1 -1
  15. package/dist/core/composables/useSettings/index.d.ts.map +1 -1
  16. package/dist/core/plugins/error-interceptor/index.d.ts +107 -0
  17. package/dist/core/plugins/error-interceptor/index.d.ts.map +1 -0
  18. package/dist/core/plugins/error-interceptor/interceptor.d.ts +39 -0
  19. package/dist/core/plugins/error-interceptor/interceptor.d.ts.map +1 -0
  20. package/dist/core/plugins/index.d.ts +1 -0
  21. package/dist/core/plugins/index.d.ts.map +1 -1
  22. package/dist/core/plugins/validation/rules.d.ts +1 -0
  23. package/dist/core/plugins/validation/rules.d.ts.map +1 -1
  24. package/dist/framework.mjs +23475 -22417
  25. package/dist/index.css +1 -1
  26. package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts +8 -0
  27. package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts.map +1 -1
  28. package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts +1 -0
  29. package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts.map +1 -1
  30. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
  31. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  32. package/dist/shared/components/notifications/components/index.d.ts +2 -0
  33. package/dist/shared/components/notifications/components/index.d.ts.map +1 -0
  34. package/dist/shared/components/notifications/components/notification-container/index.d.ts +131 -0
  35. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -0
  36. package/dist/shared/components/notifications/composables/index.d.ts +3 -0
  37. package/dist/shared/components/notifications/composables/index.d.ts.map +1 -0
  38. package/dist/shared/components/notifications/composables/useContainer/index.d.ts +27 -0
  39. package/dist/shared/components/notifications/composables/useContainer/index.d.ts.map +1 -0
  40. package/dist/shared/components/notifications/composables/useInstance/index.d.ts +9 -0
  41. package/dist/shared/components/notifications/composables/useInstance/index.d.ts.map +1 -0
  42. package/dist/shared/components/notifications/core/index.d.ts +2 -0
  43. package/dist/shared/components/notifications/core/index.d.ts.map +1 -0
  44. package/dist/shared/components/notifications/core/notification.d.ts +12 -0
  45. package/dist/shared/components/notifications/core/notification.d.ts.map +1 -0
  46. package/dist/shared/components/notifications/index.d.ts +15 -0
  47. package/dist/shared/components/notifications/index.d.ts.map +1 -0
  48. package/dist/shared/components/notifications/types/index.d.ts +15 -0
  49. package/dist/shared/components/notifications/types/index.d.ts.map +1 -0
  50. package/dist/shared/index.d.ts +1 -0
  51. package/dist/shared/index.d.ts.map +1 -1
  52. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +8 -1
  53. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
  54. package/dist/shared/modules/assets/components/assets-details/index.d.ts +121 -23
  55. package/dist/shared/modules/assets/components/assets-details/index.d.ts.map +1 -1
  56. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +8 -1
  57. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
  58. package/dist/shared/modules/assets-manager/components/assets-manager/index.d.ts +144 -28
  59. package/dist/shared/modules/assets-manager/components/assets-manager/index.d.ts.map +1 -1
  60. package/dist/ui/components/molecules/vc-notification/index.d.ts +49 -100
  61. package/dist/ui/components/molecules/vc-notification/index.d.ts.map +1 -1
  62. package/dist/ui/components/molecules/vc-notification/vc-notification.vue.d.ts +10 -31
  63. package/dist/ui/components/molecules/vc-notification/vc-notification.vue.d.ts.map +1 -1
  64. package/dist/ui/components/organisms/vc-app/index.d.ts +0 -2
  65. package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -1
  66. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +0 -1
  67. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  68. package/dist/ui/components/organisms/vc-blade/index.d.ts +1 -0
  69. package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
  70. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -0
  71. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  72. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +1 -1
  73. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  74. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  75. package/dist/vite.config.d.ts.map +1 -1
  76. package/package.json +5 -4
  77. package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -1
  78. package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +63 -33
  79. package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +0 -2
  80. package/shared/components/notifications/components/index.ts +1 -0
  81. package/shared/components/notifications/components/notification-container/index.ts +80 -0
  82. package/shared/components/notifications/composables/index.ts +2 -0
  83. package/shared/components/notifications/composables/useContainer/index.ts +190 -0
  84. package/shared/components/notifications/composables/useInstance/index.ts +46 -0
  85. package/shared/components/notifications/core/index.ts +1 -0
  86. package/shared/components/notifications/core/notification.ts +96 -0
  87. package/shared/components/notifications/index.ts +17 -0
  88. package/shared/components/notifications/styles/index.scss +9 -0
  89. package/shared/components/notifications/types/index.ts +16 -0
  90. package/shared/index.ts +8 -1
  91. package/shared/modules/assets/components/assets-details/assets-details.vue +6 -0
  92. package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +6 -0
  93. package/ui/components/molecules/vc-notification/index.ts +1 -8
  94. package/ui/components/molecules/vc-notification/vc-notification.vue +60 -25
  95. package/ui/components/organisms/vc-app/index.ts +0 -1
  96. package/ui/components/organisms/vc-app/vc-app.vue +9 -9
  97. package/ui/components/organisms/vc-blade/vc-blade.vue +44 -1
  98. package/ui/components/organisms/vc-popup/vc-popup.vue +1 -1
  99. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -1
  100. package/ui/components/organisms/vc-table/vc-table.vue +12 -2
  101. package/ui/locales/en.json +6 -0
@@ -1,39 +1,77 @@
1
1
  <template>
2
2
  <div
3
- class="vc-notification tw-flex tw-items-center tw-mt-1 tw-mb-3 tw-mx-2 tw-bg-[color:var(--notification-background)] tw-border tw-border-solid tw-border-[color:#eef0f2] tw-box-border tw-shadow-[2px_2px_11px_rgba(126,142,157,0.4)] tw-rounded-[var(--notification-border-radius)] tw-overflow-hidden tw-py-2 tw-px-4 tw-max-w-[600px]"
3
+ ref="nodeRef"
4
+ class="vc-notification tw-flex tw-items-center tw-mt-1 tw-mb-3 tw-mx-2 tw-bg-[color:var(--notification-background)] tw-border tw-border-solid tw-border-[color:#eef0f2] tw-box-border tw-shadow-[2px_2px_11px_rgba(126,142,157,0.4)] tw-rounded-[var(--notification-border-radius)] tw-overflow-hidden tw-py-2 tw-px-4 tw-max-w-[600px] tw-justify-between"
5
+ :id="String(notificationId)"
4
6
  @mouseenter="onMouseEnter"
5
7
  @mouseleave="onMouseLeave"
6
8
  >
9
+ <VcIcon
10
+ :icon="types[type]?.icon"
11
+ :style="{ color: types[type]?.color }"
12
+ size="l"
13
+ class="tw-mr-2"
14
+ ></VcIcon>
7
15
  <div class="tw-text-[color:var(--notification-content-color)]">
8
- <slot></slot>
16
+ {{ content }}
9
17
  </div>
10
18
  <VcIcon
11
19
  icon="fas fa-times"
12
20
  class="tw-cursor-pointer tw-text-[color:var(--notification-dismiss-color)] tw-ml-2"
13
21
  size="s"
14
- @click="onDismiss"
22
+ @click.stop="closeNotification"
15
23
  ></VcIcon>
16
24
  </div>
17
25
  </template>
18
26
 
19
27
  <script lang="ts" setup>
28
+ import { NotificationType } from "./../../../../shared/components/notifications";
20
29
  import { VcIcon } from "./../../";
30
+ import { onMounted, ref, toRefs, watch } from "vue";
21
31
 
22
32
  export interface Props {
23
- timeout?: number;
24
- }
25
-
26
- export interface Emits {
27
- (event: "dismiss"): void;
28
- (event: "expired"): void;
33
+ content?: string;
34
+ notificationId?: number | string;
35
+ updateId?: number | string;
36
+ type?: NotificationType;
37
+ timeout?: number | boolean;
38
+ pauseOnHover?: boolean;
39
+ closeNotification?: () => void;
40
+ limit?: number;
29
41
  }
30
42
 
31
- const props = withDefaults(defineProps<Props>(), {
32
- timeout: 0,
43
+ const props = defineProps<Props>();
44
+
45
+ const types = {
46
+ default: { icon: "fas fa-info-circle", color: "var(--notification-info)" },
47
+ success: { icon: "fas fa-check-circle", color: "var(--notification-success)" },
48
+ error: { icon: "fas fa-exclamation-circle", color: "var(--notification-error)" },
49
+ warning: { icon: "fas fa-exclamation-triangle", color: "var(--notification-warning)" },
50
+ };
51
+ const { timeout } = toRefs(props);
52
+
53
+ const timer = ref();
54
+
55
+ watch(
56
+ timeout,
57
+ (newVal) => {
58
+ if (newVal) {
59
+ timer.value = Timer(() => {
60
+ props.closeNotification();
61
+ }, props.timeout as number);
62
+
63
+ timer.value.start();
64
+ }
65
+ },
66
+ { immediate: true }
67
+ );
68
+
69
+ onMounted(() => {
70
+ if (props.timeout) {
71
+ timer.value.start();
72
+ }
33
73
  });
34
74
 
35
- const emit = defineEmits<Emits>();
36
-
37
75
  function Timer(callback: (...args: unknown[]) => unknown, delay: number) {
38
76
  let timerId: number;
39
77
  let from: number;
@@ -62,25 +100,17 @@ function Timer(callback: (...args: unknown[]) => unknown, delay: number) {
62
100
  };
63
101
  }
64
102
 
65
- const timer = Timer(() => emit("expired"), props.timeout);
66
- if (props.timeout) {
67
- timer.start();
68
- }
69
-
70
103
  function onMouseEnter() {
71
- timer.pause();
104
+ if (props.timeout) {
105
+ timer.value.pause();
106
+ }
72
107
  }
73
108
 
74
109
  function onMouseLeave() {
75
110
  if (props.timeout) {
76
- timer.resume();
111
+ timer.value.resume();
77
112
  }
78
113
  }
79
-
80
- function onDismiss() {
81
- timer.pause();
82
- emit("dismiss");
83
- }
84
114
  </script>
85
115
 
86
116
  <style lang="scss">
@@ -90,6 +120,11 @@ function onDismiss() {
90
120
  --notification-box-shadow: 2px 2px 11px rgba(126, 142, 157, 0.4);
91
121
  --notification-dismiss-color: #83a3be;
92
122
  --notification-content-color: #8c9cab;
123
+
124
+ --notification-warning: #f89406;
125
+ --notification-error: #ef796f;
126
+ --notification-success: #87b563;
127
+ --notification-info: #bdd1df;
93
128
  }
94
129
 
95
130
  .vc-notification {
@@ -6,7 +6,6 @@ export const VcApp = _App as typeof _App & {
6
6
  $slots: {
7
7
  appSwitcher: () => VNode[];
8
8
  bladeNavigation: () => VNode[];
9
- notifications: () => VNode[];
10
9
  passwordChange: () => VNode[];
11
10
  };
12
11
  };
@@ -22,7 +22,10 @@
22
22
  @logo:click="$emit('logo:click')"
23
23
  :title="title"
24
24
  >
25
- <template v-slot:appSwitcher>
25
+ <template
26
+ v-slot:appSwitcher
27
+ v-if="$slots['appSwitcher']"
28
+ >
26
29
  <slot name="appSwitcher"></slot>
27
30
  </template>
28
31
  </VcAppBar>
@@ -39,16 +42,14 @@
39
42
  ></VcAppMenu>
40
43
 
41
44
  <!-- Workspace blades -->
42
- <div class="vc-app__workspace tw-px-2 tw-w-full tw-overflow-hidden !tw-flex tw-grow tw-basis-0 tw-relative">
43
- <slot name="bladeNavigation"></slot>
44
- </div>
45
-
46
45
  <div
47
- class="[pointer-events:painted] tw-absolute tw-flex tw-z-[1000] tw-overflow-hidden tw-top-0 tw-left-2/4 -tw-translate-x-2/4 tw-flex-col tw-items-center tw-p-2 tw-box-border"
46
+ class="vc-app__workspace tw-px-2 tw-w-full tw-overflow-hidden !tw-flex tw-grow tw-basis-0 tw-relative"
47
+ v-if="$slots['bladeNavigation']"
48
48
  >
49
- <slot name="notifications"></slot>
49
+ <slot name="bladeNavigation"></slot>
50
50
  </div>
51
- <div>
51
+
52
+ <div v-if="$slots['passwordChange']">
52
53
  <slot name="passwordChange"></slot>
53
54
  </div>
54
55
  </div>
@@ -65,7 +66,6 @@ export default defineComponent({
65
66
  </script>
66
67
 
67
68
  <script lang="ts" setup>
68
- import { useRouter } from "vue-router";
69
69
  import VcAppBar from "./_internal/vc-app-bar/vc-app-bar.vue";
70
70
  import VcAppMenu from "./_internal/vc-app-menu/vc-app-menu.vue";
71
71
  import { ExtendedComponent, IBladeRef, IMenuClickEvent, IOpenBlade } from "./../../../../shared";
@@ -34,18 +34,52 @@
34
34
  </template>
35
35
  </VcBladeHeader>
36
36
 
37
+ <template v-if="$slots['error']">
38
+ <div class="tw-text-white tw-p-2 tw-flex tw-flex-row tw-items-center tw-bg-[color:var(--blade-color-error)]">
39
+ <VcIcon
40
+ size="s"
41
+ icon="fas fa-exclamation-triangle"
42
+ />
43
+ <div class="tw-line-clamp-1 tw-w-full tw-mx-2"><slot name="error"></slot></div>
44
+ <VcButton
45
+ @click="toggleErrorPopup"
46
+ variant="onlytext"
47
+ class="tw-shrink-0 tw-opacity-80 tw-text-white hover:!tw-opacity-100 hover:!tw-text-white"
48
+ >{{ $t("COMPONENTS.ORGANISMS.VC_BLADE.SEE_DETAILS") }}</VcButton
49
+ >
50
+ </div>
51
+ </template>
52
+
37
53
  <!-- Set up blade toolbar -->
38
54
  <VcBladeToolbar
39
55
  class="tw-shrink-0"
40
56
  :items="toolbarItems"
41
57
  ></VcBladeToolbar>
42
58
 
59
+ <VcPopup
60
+ variant="medium"
61
+ :title="$t('COMPONENTS.ORGANISMS.VC_BLADE.ERROR_POPUP.TITLE')"
62
+ @close="toggleErrorPopup"
63
+ v-if="isErrorPopupActive"
64
+ >
65
+ <div class="tw-p-5 tw-flex tw-flex-row tw-items-center tw-h-full">
66
+ <VcIcon
67
+ icon="fas fa-exclamation-circle"
68
+ size="xxl"
69
+ class="tw-text-[color:var(--blade-color-error)] tw-mr-3"
70
+ ></VcIcon>
71
+ <VcContainer no-padding>
72
+ <slot name="error"></slot>
73
+ </VcContainer>
74
+ </div>
75
+ </VcPopup>
76
+
43
77
  <slot></slot>
44
78
  </div>
45
79
  </template>
46
80
 
47
81
  <script lang="ts">
48
- import { defineComponent, computed } from "vue";
82
+ import { defineComponent, computed, ref } from "vue";
49
83
  import { IBladeToolbar } from "../../../../core/types";
50
84
  import { IBladeContainer } from "./../../../../shared";
51
85
 
@@ -57,6 +91,7 @@ export default defineComponent({
57
91
  <script lang="ts" setup>
58
92
  import VcBladeHeader from "./_internal/vc-blade-header/vc-blade-header.vue";
59
93
  import VcBladeToolbar from "./_internal/vc-blade-toolbar/vc-blade-toolbar.vue";
94
+ import { VcButton, VcIcon, VcPopup, VcContainer } from "./../../";
60
95
 
61
96
  export interface Props {
62
97
  icon?: string;
@@ -70,6 +105,7 @@ export interface Props {
70
105
  toolbarItems?: IBladeToolbar[];
71
106
  onClose?: () => void;
72
107
  blades?: IBladeContainer[];
108
+ // error?: string;
73
109
  }
74
110
 
75
111
  export interface Emits {
@@ -87,18 +123,25 @@ const props = withDefaults(defineProps<Props>(), {
87
123
 
88
124
  defineEmits<Emits>();
89
125
 
126
+ const isErrorPopupActive = ref(false);
127
+
90
128
  const isExpandable = computed(() => {
91
129
  if (!props.expandable) {
92
130
  return props.expandable;
93
131
  }
94
132
  return props.blades?.length !== 0;
95
133
  });
134
+
135
+ function toggleErrorPopup() {
136
+ isErrorPopupActive.value = !isErrorPopupActive.value;
137
+ }
96
138
  </script>
97
139
 
98
140
  <style lang="scss">
99
141
  :root {
100
142
  --blade-background-color: #ffffff;
101
143
  --blade-border-radius: 6px;
144
+ --blade-color-error: #f14e4e;
102
145
  }
103
146
 
104
147
  .vc-app_mobile .vc-blade {
@@ -17,7 +17,7 @@
17
17
  ></VcIcon>
18
18
  </div>
19
19
 
20
- <div class="vc-popup__content tw-grow tw-basis-0">
20
+ <div class="vc-popup__content tw-grow tw-basis-0 tw-h-[calc(100%-44px)]">
21
21
  <slot></slot>
22
22
  </div>
23
23
  </div>
@@ -68,7 +68,7 @@ export default defineComponent({
68
68
  import { offset, computePosition, ComputePositionReturn } from "@floating-ui/vue";
69
69
 
70
70
  export interface Props {
71
- title: string;
71
+ title?: string;
72
72
  counter: number;
73
73
  parentExpanded?: boolean;
74
74
  }
@@ -433,6 +433,7 @@ import { offset, flip, arrow, computePosition, ComputePositionReturn } from "@fl
433
433
  import { IActionBuilderResult, ITableColumns } from "./../../../../core/types";
434
434
  import { useLocalStorage, useCurrentElement } from "@vueuse/core";
435
435
  import { VcContainer, VcInput, VcCheckbox, VcIcon, VcPagination, VcButton, VcLoading } from "./../../";
436
+ import * as _ from "lodash-es";
436
437
 
437
438
  export interface StatusImage {
438
439
  image?: string;
@@ -543,7 +544,7 @@ const nextColumn = ref<ITableColumns>();
543
544
  const lastResize = ref<number>();
544
545
  const table = useCurrentElement();
545
546
  const resizer = ref();
546
- const state = useLocalStorage("VC_TABLE_STATE_" + props.stateKey.toUpperCase(), []);
547
+ const state = useLocalStorage<ITableColumns[]>("VC_TABLE_STATE_" + props.stateKey.toUpperCase(), []);
547
548
  const defaultColumns: Ref<ITableColumns[]> = ref([]);
548
549
  const draggedColumn = ref();
549
550
  const draggedElement = ref<HTMLElement>();
@@ -650,6 +651,10 @@ watch(
650
651
  () => props.columns,
651
652
  (newVal) => {
652
653
  defaultColumns.value = newVal;
654
+
655
+ if (newVal.length !== state.value.length) {
656
+ saveState();
657
+ }
653
658
  },
654
659
  { deep: true, immediate: true }
655
660
  );
@@ -982,7 +987,12 @@ function saveState() {
982
987
  function restoreState() {
983
988
  console.debug("[@vc-shell/framewok#vc-table.vue] - Restore state");
984
989
  if (Object.keys(state.value).length) {
985
- defaultColumns.value = state.value;
990
+ defaultColumns.value = state.value.map((item) => {
991
+ return {
992
+ ...item,
993
+ title: defaultColumns.value.find((x) => x.id === item.id).title,
994
+ };
995
+ });
986
996
  }
987
997
  }
988
998
 
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "COMPONENTS":{
3
3
  "ORGANISMS":{
4
+ "VC_BLADE":{
5
+ "SEE_DETAILS": "See details",
6
+ "ERROR_POPUP":{
7
+ "TITLE":"Error details"
8
+ }
9
+ },
4
10
  "VC_TABLE":{
5
11
  "ALL_SELECTED":"All items in this page are selected.",
6
12
  "SELECT":"Select all items",