@vc-shell/framework 1.1.0-alpha.4 → 1.1.0-alpha.6
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/core/composables/useMenuService/index.ts +20 -110
- package/core/composables/useWidgets/index.ts +2 -1
- package/core/plugins/modularity/index.ts +3 -3
- package/core/services/menu-service.ts +195 -0
- package/core/services/widget-service.ts +20 -0
- package/core/types/index.ts +1 -1
- package/dist/core/composables/useMenuService/index.d.ts +4 -10
- package/dist/core/composables/useMenuService/index.d.ts.map +1 -1
- package/dist/core/composables/useWidgets/index.d.ts +2 -1
- package/dist/core/composables/useWidgets/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/services/menu-service.d.ts +17 -0
- package/dist/core/services/menu-service.d.ts.map +1 -0
- package/dist/core/services/widget-service.d.ts +4 -0
- package/dist/core/services/widget-service.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +220 -210
- package/dist/{index-CrxFDC2b.js → index-3ySdd-mG.js} +1 -1
- package/dist/{index-B1YR_MYV.js → index-B-nvqNbp.js} +1 -1
- package/dist/{index-xLYzNPa7.js → index-BQF2-UMe.js} +1 -1
- package/dist/{index-BBYyHeYA.js → index-BXlxP2d2.js} +1 -1
- package/dist/{index-Cf9Tz1ql.js → index-C7P-aBjd.js} +1 -1
- package/dist/{index-8LELHzw9.js → index-CO_2IshF.js} +1 -1
- package/dist/{index-BA98L1jI.js → index-CfyFpaKq.js} +1 -1
- package/dist/{index-DVljTjbf.js → index-Ci23AX3j.js} +1 -1
- package/dist/{index-D1JchciU.js → index-CyuFXG83.js} +1 -1
- package/dist/{index-CWKrD2Cd.js → index-D1rpRTKf.js} +1 -1
- package/dist/{index-BAeTsi-X.js → index-DLxTAT7x.js} +1 -1
- package/dist/{index-BuO5ByG9.js → index-DOVhosAY.js} +1 -1
- package/dist/{index-DLtsQ_PJ.js → index-DZAq0B3U.js} +23780 -23339
- package/dist/{index-BrUitdDo.js → index-DtkJ7xTB.js} +1 -1
- package/dist/{index-9lJxZE5w.js → index-DvGVm1rK.js} +1 -1
- package/dist/{index-RwX3kiZh.js → index-EDF1MDtU.js} +1 -1
- package/dist/{index-CJ5I7vTn.js → index-LjqdX6jw.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +2 -0
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +2 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -1
- package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts +25 -0
- package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts +27 -0
- package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +22 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +1 -1
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +12 -4
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +1 -1
- package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts +15 -0
- package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts +33 -0
- package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts +57 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts +22 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts +19 -0
- package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts +18 -0
- package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts +14 -0
- package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts +21 -0
- package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/types.d.ts +5 -1
- package/dist/shared/components/draggable-dashboard/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +6 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +2 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/draggable-dashboard/DraggableDashboard.vue +114 -148
- package/shared/components/draggable-dashboard/composables/useCellSizeCalculator.ts +121 -0
- package/shared/components/draggable-dashboard/composables/useCollisionDetection.ts +219 -0
- package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +126 -331
- package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +74 -220
- package/shared/components/draggable-dashboard/composables/useDragClone.ts +97 -0
- package/shared/components/draggable-dashboard/composables/useEventCoordinates.ts +91 -0
- package/shared/components/draggable-dashboard/composables/useGridPosition.ts +150 -0
- package/shared/components/draggable-dashboard/composables/useGridSystem.ts +169 -0
- package/shared/components/draggable-dashboard/composables/useLayoutPersistence.ts +89 -0
- package/shared/components/draggable-dashboard/composables/useResizeObserver.ts +105 -0
- package/shared/components/draggable-dashboard/composables/useWidgetLayout.ts +264 -0
- package/shared/components/draggable-dashboard/composables/useWidgetStyles.ts +120 -0
- package/shared/components/draggable-dashboard/types.ts +6 -1
- package/shared/components/notification-dropdown/notification-dropdown.vue +1 -0
- package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +27 -0
- package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +23 -0
- package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +19 -0
- package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +21 -0
- package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +23 -0
- package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +18 -0
- package/ui/components/atoms/vc-icon/icons/index.ts +6 -0
- package/ui/components/atoms/vc-icon/vc-icon.vue +101 -82
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue +10 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +3 -4
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +2 -2
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +1 -0
- package/ui/components/organisms/vc-app/vc-app.vue +2 -3
- package/ui/components/organisms/vc-table/vc-table.vue +4 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
|
|
3
|
+
import type { CellSize } from "./useCellSizeCalculator";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Constants for widget styles
|
|
7
|
+
*/
|
|
8
|
+
const WIDGET_GAP = 20; // The gap between widgets in pixels
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Type for returned styles
|
|
12
|
+
*/
|
|
13
|
+
export type WidgetStyle = Record<string, string>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Hook for managing widget styles
|
|
17
|
+
*
|
|
18
|
+
* Provides functions for calculating CSS styles for widgets based on their position,
|
|
19
|
+
* dragging state, and other parameters
|
|
20
|
+
*
|
|
21
|
+
* @param getCellSize The function for getting the cell sizes
|
|
22
|
+
* @returns An object with functions for working with widget styles
|
|
23
|
+
*/
|
|
24
|
+
export function useWidgetStyles(getCellSize: () => CellSize) {
|
|
25
|
+
/**
|
|
26
|
+
* Gets the styles for the preview position indicator
|
|
27
|
+
*
|
|
28
|
+
* @param widget The widget that is being dragged
|
|
29
|
+
* @param position The position for preview
|
|
30
|
+
* @returns An object with styles for the preview indicator
|
|
31
|
+
*/
|
|
32
|
+
const getPreviewStyles = (widget: IDashboardWidget, position: DashboardWidgetPosition): WidgetStyle => {
|
|
33
|
+
const cellSize = getCellSize();
|
|
34
|
+
if (!position || !widget?.size) return {};
|
|
35
|
+
|
|
36
|
+
const widgetWidth = widget.size.width * cellSize.width - WIDGET_GAP;
|
|
37
|
+
const widgetHeight = widget.size.height * cellSize.height - WIDGET_GAP;
|
|
38
|
+
|
|
39
|
+
const translateX = position.x * cellSize.width + WIDGET_GAP / 2;
|
|
40
|
+
const translateY = position.y * cellSize.height + WIDGET_GAP / 2;
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
width: `${widgetWidth}px`,
|
|
44
|
+
height: `${widgetHeight}px`,
|
|
45
|
+
transform: `translate(${translateX}px, ${translateY}px)`,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the styles for the widget
|
|
51
|
+
*
|
|
52
|
+
* @param widget The widget for which to get the styles
|
|
53
|
+
* @param position The position of the widget
|
|
54
|
+
* @param isDragged Whether the widget is being dragged
|
|
55
|
+
* @param displacedPosition The position of the displaced widget
|
|
56
|
+
* @returns An object with styles for the widget
|
|
57
|
+
*/
|
|
58
|
+
const getWidgetStyles = (
|
|
59
|
+
widget: IDashboardWidget,
|
|
60
|
+
position: DashboardWidgetPosition | undefined,
|
|
61
|
+
isDragged: boolean = false,
|
|
62
|
+
displacedPosition?: DashboardWidgetPosition,
|
|
63
|
+
): WidgetStyle => {
|
|
64
|
+
if (!position) return { display: "none" };
|
|
65
|
+
|
|
66
|
+
const cellSize = getCellSize();
|
|
67
|
+
|
|
68
|
+
// Base sizes and positions
|
|
69
|
+
const width = widget.size.width * cellSize.width - WIDGET_GAP;
|
|
70
|
+
const height = widget.size.height * cellSize.height - WIDGET_GAP;
|
|
71
|
+
|
|
72
|
+
const left = position.x * cellSize.width + WIDGET_GAP / 2;
|
|
73
|
+
const top = position.y * cellSize.height + WIDGET_GAP / 2;
|
|
74
|
+
|
|
75
|
+
// Base styles for all states
|
|
76
|
+
const baseStyles: WidgetStyle = {
|
|
77
|
+
position: "absolute",
|
|
78
|
+
width: `${width}px`,
|
|
79
|
+
height: `${height}px`,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// If the widget is displaced by another widget
|
|
83
|
+
if (displacedPosition) {
|
|
84
|
+
const newLeft = displacedPosition.x * cellSize.width + WIDGET_GAP / 2;
|
|
85
|
+
const newTop = displacedPosition.y * cellSize.height + WIDGET_GAP / 2;
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
...baseStyles,
|
|
89
|
+
transform: `translate(${newLeft}px, ${newTop}px)`,
|
|
90
|
+
transition: "transform var(--dashboard-transition-duration) var(--dashboard-transition-timing)",
|
|
91
|
+
zIndex: "10",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// If the widget is being dragged
|
|
96
|
+
if (isDragged) {
|
|
97
|
+
return {
|
|
98
|
+
...baseStyles,
|
|
99
|
+
transform: `translate(${left}px, ${top}px)`,
|
|
100
|
+
opacity: "0", // Hide the original, since the clone is displayed
|
|
101
|
+
pointerEvents: "none",
|
|
102
|
+
zIndex: "1",
|
|
103
|
+
transition: "none", // Disable animations for the original widget
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Normal widget
|
|
108
|
+
return {
|
|
109
|
+
...baseStyles,
|
|
110
|
+
transform: `translate(${left}px, ${top}px)`,
|
|
111
|
+
transition: "transform var(--dashboard-transition-duration) var(--dashboard-transition-timing)",
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
getPreviewStyles,
|
|
117
|
+
getWidgetStyles,
|
|
118
|
+
WIDGET_GAP,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from
|
|
1
|
+
import type { Component } from "vue";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Position type for a widget on the dashboard grid
|
|
@@ -63,6 +63,11 @@ export interface IDashboardWidget {
|
|
|
63
63
|
* Widget size
|
|
64
64
|
*/
|
|
65
65
|
size: DashboardWidgetSize;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Built-in widget position (optional)
|
|
69
|
+
*/
|
|
70
|
+
position?: DashboardWidgetPosition;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<g stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<!-- Building outline -->
|
|
6
|
+
<path d="M1 19H19" />
|
|
7
|
+
<path d="M1 8L10 1L19 8V19H1V8Z" />
|
|
8
|
+
|
|
9
|
+
<!-- Door and details -->
|
|
10
|
+
<rect x="7" y="13" width="6" height="6" />
|
|
11
|
+
|
|
12
|
+
<!-- Windows -->
|
|
13
|
+
<rect x="4" y="6" width="3" height="3" />
|
|
14
|
+
<rect x="13" y="6" width="3" height="3" />
|
|
15
|
+
|
|
16
|
+
<!-- Flag/sign -->
|
|
17
|
+
<path d="M4 8.5V4.5" />
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
defineProps<{
|
|
24
|
+
width?: number | string
|
|
25
|
+
height?: number | string
|
|
26
|
+
}>()
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<g stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<!-- Price tag shape -->
|
|
6
|
+
<path d="M9.5 1H5C2.79086 1 1 2.79086 1 5V9.5C1 9.63261 1.05268 9.75979 1.14645 9.85355L10.1464 18.8536C10.3417 19.0488 10.6583 19.0488 10.8536 18.8536L18.8536 10.8536C19.0488 10.6583 19.0488 10.3417 18.8536 10.1464L9.85355 1.14645C9.75979 1.05268 9.63261 1 9.5 1Z" />
|
|
7
|
+
<!-- Tag hole -->
|
|
8
|
+
<circle cx="5" cy="5" r="2" fill="none" />
|
|
9
|
+
<!-- Discount line -->
|
|
10
|
+
<path d="M13 7L7 13" />
|
|
11
|
+
<!-- Percentage symbol -->
|
|
12
|
+
<circle cx="7" cy="7" r="0.5" fill="none" />
|
|
13
|
+
<circle cx="13" cy="13" r="0.5" fill="none" />
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
defineProps<{
|
|
20
|
+
width?: number | string
|
|
21
|
+
height?: number | string
|
|
22
|
+
}>()
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<path
|
|
5
|
+
d="M5 10H10M5 14H12M5 6H12M14 1H3C1.89543 1 1 1.89543 1 3V17C1 18.1046 1.89543 19 3 19H17C18.1046 19 19 18.1046 19 17V6L14 1ZM14 1V6H19"
|
|
6
|
+
stroke="currentColor"
|
|
7
|
+
stroke-width="2"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
defineProps<{
|
|
16
|
+
width?: number | string
|
|
17
|
+
height?: number | string
|
|
18
|
+
}>()
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<g stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<!-- Main person -->
|
|
6
|
+
<circle cx="8" cy="8" r="3" fill="none" />
|
|
7
|
+
<path d="M2 19V17C2 14.7909 3.79086 13 6 13H10C12.2091 13 14 14.7909 14 17V19" />
|
|
8
|
+
|
|
9
|
+
<!-- Secondary person (partial, behind) -->
|
|
10
|
+
<path d="M15 8C15 9.65685 13.6569 11 12 11" />
|
|
11
|
+
<path d="M18 19V17C18 15.3431 17.1652 13.9089 15.8944 13.1913" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
defineProps<{
|
|
18
|
+
width?: number | string
|
|
19
|
+
height?: number | string
|
|
20
|
+
}>()
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<g stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<!-- Package box outline -->
|
|
6
|
+
<path d="M1 5L10 1L19 5V15L10 19L1 15V5Z" />
|
|
7
|
+
<!-- Middle line separating top and bottom -->
|
|
8
|
+
<path d="M10 9L19 5" />
|
|
9
|
+
<path d="M10 9L1 5" />
|
|
10
|
+
<!-- Vertical line from middle to bottom -->
|
|
11
|
+
<path d="M10 9V19" />
|
|
12
|
+
<!-- Additional details -->
|
|
13
|
+
<path d="M5 3L14 7" />
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
defineProps<{
|
|
20
|
+
width?: number | string
|
|
21
|
+
height?: number | string
|
|
22
|
+
}>()
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" :width="width" :height="height">
|
|
4
|
+
<g stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<!-- User head -->
|
|
6
|
+
<circle cx="10" cy="5" r="4" fill="none" />
|
|
7
|
+
<!-- User body -->
|
|
8
|
+
<path d="M3 19V17C3 14.2386 5.23858 12 8 12H12C14.7614 12 17 14.2386 17 17V19" />
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
defineProps<{
|
|
15
|
+
width?: number | string
|
|
16
|
+
height?: number | string
|
|
17
|
+
}>()
|
|
18
|
+
</script>
|
|
@@ -10,11 +10,17 @@ export { default as CircleDotsIcon } from "./CircleDotsIcon.vue"
|
|
|
10
10
|
export { default as CrossSignIcon } from "./CrossSignIcon.vue"
|
|
11
11
|
export { default as DoubleArrowLeftIcon } from "./DoubleArrowLeftIcon.vue"
|
|
12
12
|
export { default as DoubleArrowRightIcon } from "./DoubleArrowRightIcon.vue"
|
|
13
|
+
export { default as FulfillmentCentersIcon } from "./FulfillmentCentersIcon.vue"
|
|
13
14
|
export { default as GridDotsIcon } from "./GridDotsIcon.vue"
|
|
14
15
|
export { default as LogoutIcon } from "./LogoutIcon.vue"
|
|
15
16
|
export { default as MenuBurgerIcon } from "./MenuBurgerIcon.vue"
|
|
16
17
|
export { default as MinusSignIcon } from "./MinusSignIcon.vue"
|
|
18
|
+
export { default as OffersIcon } from "./OffersIcon.vue"
|
|
19
|
+
export { default as OrdersIcon } from "./OrdersIcon.vue"
|
|
20
|
+
export { default as PeopleIcon } from "./PeopleIcon.vue"
|
|
17
21
|
export { default as PlusSignIcon } from "./PlusSignIcon.vue"
|
|
22
|
+
export { default as ProductsIcon } from "./ProductsIcon.vue"
|
|
23
|
+
export { default as ProfileIcon } from "./ProfileIcon.vue"
|
|
18
24
|
export { default as SearchIcon } from "./SearchIcon.vue"
|
|
19
25
|
export { default as SettingsBoltIcon } from "./SettingsBoltIcon.vue"
|
|
20
26
|
export { default as ShoppingCardIcon } from "./ShoppingCardIcon.vue"
|
|
@@ -1,82 +1,101 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="isCustomIcon ? safeIcon : 'i'"
|
|
4
|
-
:class="[
|
|
5
|
-
'vc-icon',
|
|
6
|
-
`vc-icon_${size}`,
|
|
7
|
-
variant ? `vc-icon_${variant}` : '',
|
|
8
|
-
!isCustomIcon ? (icon as string).toLowerCase() : '',
|
|
9
|
-
]"
|
|
10
|
-
v-bind="isCustomIcon ? { width: iconSize, height: iconSize } : {}"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts" setup>
|
|
15
|
-
import { computed, markRaw } from "vue";
|
|
16
|
-
import type { Component } from "vue";
|
|
17
|
-
|
|
18
|
-
export interface Props {
|
|
19
|
-
icon?: string | Component;
|
|
20
|
-
size?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl";
|
|
21
|
-
variant?: "warning" | "danger" | "success";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
25
|
-
icon: "fas fa-square-full",
|
|
26
|
-
size: "m",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="isCustomIcon ? safeIcon : 'i'"
|
|
4
|
+
:class="[
|
|
5
|
+
'vc-icon',
|
|
6
|
+
`vc-icon_${size}`,
|
|
7
|
+
variant ? `vc-icon_${variant}` : '',
|
|
8
|
+
!isCustomIcon ? (icon as string).toLowerCase() : '',
|
|
9
|
+
]"
|
|
10
|
+
v-bind="isCustomIcon ? { width: iconSize, height: iconSize } : {}"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { computed, markRaw, resolveComponent } from "vue";
|
|
16
|
+
import type { Component } from "vue";
|
|
17
|
+
|
|
18
|
+
export interface Props {
|
|
19
|
+
icon?: string | Component;
|
|
20
|
+
size?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl";
|
|
21
|
+
variant?: "warning" | "danger" | "success";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
25
|
+
icon: "fas fa-square-full",
|
|
26
|
+
size: "m",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Check if the icon is a component or can be resolved as a component
|
|
30
|
+
const isCustomIcon = computed(() => {
|
|
31
|
+
if (typeof props.icon !== "string") {
|
|
32
|
+
return true; // Component instance passed directly
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Check if string is a component name that can be resolved
|
|
36
|
+
const resolved = resolveComponent(props.icon);
|
|
37
|
+
return resolved !== props.icon; // If resolved is different from original string, it's a component name
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Get the component instance for rendering
|
|
41
|
+
const safeIcon = computed(() => {
|
|
42
|
+
if (typeof props.icon !== "string") {
|
|
43
|
+
return markRaw(props.icon); // Use markRaw for direct component instances
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Try to resolve component by name
|
|
47
|
+
const resolved = resolveComponent(props.icon);
|
|
48
|
+
return resolved !== props.icon ? resolved : "i"; // Return resolved component or fallback to 'i'
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const sizeMap = {
|
|
52
|
+
xs: 12,
|
|
53
|
+
s: 14,
|
|
54
|
+
m: 18,
|
|
55
|
+
l: 20,
|
|
56
|
+
xl: 22,
|
|
57
|
+
xxl: 30,
|
|
58
|
+
xxxl: 64,
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
const iconSize = computed(() => sizeMap[props.size]);
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss">
|
|
65
|
+
:root {
|
|
66
|
+
--icon-size-xs: 12px;
|
|
67
|
+
--icon-size-s: 14px;
|
|
68
|
+
--icon-size-m: 18px;
|
|
69
|
+
--icon-size-l: 20px;
|
|
70
|
+
--icon-size-xl: 22px;
|
|
71
|
+
--icon-size-xxl: 30px;
|
|
72
|
+
--icon-size-xxxl: 64px;
|
|
73
|
+
|
|
74
|
+
--icon-color-success: var(--success-500);
|
|
75
|
+
--icon-color-danger: var(--danger-500);
|
|
76
|
+
--icon-color-warning: var(--warning-500);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
$sizes: xs, s, m, l, xl, xxl, xxxl;
|
|
80
|
+
$variants: warning, danger, success;
|
|
81
|
+
|
|
82
|
+
.vc-icon {
|
|
83
|
+
overflow: visible;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@each $size in $sizes {
|
|
87
|
+
.vc-icon_#{$size} {
|
|
88
|
+
font-size: var(--icon-size-#{$size});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@each $variant in $variants {
|
|
93
|
+
.vc-icon_#{$variant} {
|
|
94
|
+
color: var(--icon-color-#{$variant});
|
|
95
|
+
|
|
96
|
+
:deep(path) {
|
|
97
|
+
stroke: var(--icon-color-#{$variant});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script lang="ts" setup>
|
|
47
|
-
import { ref, getCurrentInstance, onUnmounted, useSlots, Slots, h, withDirectives } from "vue";
|
|
47
|
+
import { ref, getCurrentInstance, onUnmounted, useSlots, Slots, h, withDirectives, onMounted } from "vue";
|
|
48
48
|
import { useAppBarOverlay } from "./../../composables/useAppBarOverlay";
|
|
49
49
|
import { vOnClickOutside } from "@vueuse/components";
|
|
50
50
|
|
|
@@ -54,6 +54,7 @@ export interface Props {
|
|
|
54
54
|
position: "bottom" | "bottom-end" | "bottom-start";
|
|
55
55
|
beforeOpen?: () => boolean;
|
|
56
56
|
overlayed?: boolean;
|
|
57
|
+
isOpened?: boolean;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export interface Emits {
|
|
@@ -135,14 +136,20 @@ onUnmounted(() => {
|
|
|
135
136
|
hideContent();
|
|
136
137
|
}
|
|
137
138
|
});
|
|
139
|
+
|
|
140
|
+
onMounted(() => {
|
|
141
|
+
if (props.isOpened) {
|
|
142
|
+
toggleContent();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
138
145
|
</script>
|
|
139
146
|
|
|
140
147
|
<style lang="scss">
|
|
141
148
|
:root {
|
|
142
149
|
--app-bar-button-width: 52px;
|
|
143
150
|
--app-bar-button-shadow-color: var(--additional-950);
|
|
144
|
-
--app-bar-button-shadow:
|
|
145
|
-
1px 1px 22px rgb(from var(--app-bar-button-shadow-color) r g b / 7%);
|
|
151
|
+
--app-bar-button-shadow:
|
|
152
|
+
0 -6px 6px var(--additional-50), 1px 1px 22px rgb(from var(--app-bar-button-shadow-color) r g b / 7%);
|
|
146
153
|
--app-bar-button-height: var(--app-bar-height);
|
|
147
154
|
--app-bar-button-bg-color: var(--additional-50);
|
|
148
155
|
--app-bar-button-dropdown-bg-color: var(--additional-50);
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
>
|
|
56
56
|
<AppBarHeader
|
|
57
57
|
:logo="logo"
|
|
58
|
-
:expanded="state.isSidebarExpanded
|
|
58
|
+
:expanded="state.isSidebarExpanded"
|
|
59
59
|
class="vc-app-bar__header"
|
|
60
60
|
:class="{
|
|
61
61
|
'vc-app-bar__header--hover-expanded': $isDesktop.value && isHoverExpanded && !state.isSidebarExpanded,
|
|
@@ -254,8 +254,7 @@ const shouldShowInMenu = computed(() => {
|
|
|
254
254
|
// transition-duration: var(--app-bar-hover-transition-duration);
|
|
255
255
|
background-color: var(--app-bar-background);
|
|
256
256
|
// border-right: 1px solid var(--app-bar-border);
|
|
257
|
-
|
|
258
|
-
z-index: 10000;
|
|
257
|
+
z-index: 50;
|
|
259
258
|
|
|
260
259
|
&--desktop {
|
|
261
260
|
position: fixed;
|
|
@@ -390,7 +389,7 @@ const shouldShowInMenu = computed(() => {
|
|
|
390
389
|
}
|
|
391
390
|
|
|
392
391
|
&--hover-expanded {
|
|
393
|
-
@apply tw-w-[var(--app-bar-width)];
|
|
392
|
+
@apply tw-w-[var(--app-bar-collapsed-width)];
|
|
394
393
|
}
|
|
395
394
|
|
|
396
395
|
&--hover-collapsed {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
<script lang="ts" setup>
|
|
36
36
|
import VcAppMenuLink from "./_internal/vc-app-menu-link.vue";
|
|
37
37
|
import { MenuItem } from "../../../../../../../../core/types";
|
|
38
|
-
|
|
38
|
+
import type { Component } from "vue";
|
|
39
39
|
export interface Props {
|
|
40
40
|
sticky?: boolean;
|
|
41
41
|
isVisible?: boolean;
|
|
42
42
|
url?: string;
|
|
43
|
-
icon?: string;
|
|
43
|
+
icon?: string | Component;
|
|
44
44
|
title?: string;
|
|
45
45
|
children?: MenuItem[];
|
|
46
46
|
expand?: boolean;
|
|
@@ -107,7 +107,7 @@ import { useI18n } from "vue-i18n";
|
|
|
107
107
|
import { createGlobalSearch } from "../../../../core/composables/useGlobalSearch";
|
|
108
108
|
import { provideDashboardService } from "../../../../core/composables/useDashboard";
|
|
109
109
|
import { DynamicModulesKey } from "../../../../injection-keys";
|
|
110
|
-
|
|
110
|
+
import { provideMenuService } from "../../../../core/composables/useMenuService";
|
|
111
111
|
export interface Props {
|
|
112
112
|
isReady: boolean;
|
|
113
113
|
logo?: string;
|
|
@@ -151,8 +151,6 @@ const { loadFromHistory } = useNotifications();
|
|
|
151
151
|
const route = useRoute();
|
|
152
152
|
const { isAuthenticated } = useUser();
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
154
|
const routes = router.getRoutes();
|
|
157
155
|
|
|
158
156
|
const settingsMenu = useSettingsMenu();
|
|
@@ -233,6 +231,7 @@ watchOnce(
|
|
|
233
231
|
provide("internalRoutes", internalRoutes);
|
|
234
232
|
provide(DynamicModulesKey, dynamicModules);
|
|
235
233
|
provideDashboardService();
|
|
234
|
+
provideMenuService();
|
|
236
235
|
createGlobalSearch();
|
|
237
236
|
</script>
|
|
238
237
|
|