@umbra.ui/core 0.1.18 → 0.1.19
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/dist/components/controls/Button/Button.vue +417 -0
- package/dist/components/controls/Button/README.md +348 -0
- package/dist/components/controls/Button/theme.css +200 -0
- package/dist/components/controls/Checkbox/Checkbox.vue +164 -0
- package/dist/components/controls/Checkbox/README.md +441 -0
- package/dist/components/controls/Checkbox/theme.css +36 -0
- package/dist/components/controls/Dropdown/Dropdown.vue +476 -0
- package/dist/components/controls/Dropdown/README.md +370 -0
- package/dist/components/controls/Dropdown/theme.css +50 -0
- package/dist/components/controls/Dropdown/types.ts +6 -0
- package/dist/components/controls/IconButton/IconButton.vue +267 -0
- package/dist/components/controls/IconButton/README.md +502 -0
- package/dist/components/controls/IconButton/theme.css +89 -0
- package/dist/components/controls/Radio/README.md +591 -0
- package/dist/components/controls/Radio/Radio.vue +89 -0
- package/dist/components/controls/Radio/theme.css +14 -0
- package/dist/components/controls/RangeSlider/README.md +608 -0
- package/dist/components/controls/RangeSlider/RangeSlider.vue +535 -0
- package/dist/components/controls/RangeSlider/theme.css +80 -0
- package/dist/components/controls/SegmentedControl/README.md +587 -0
- package/dist/components/controls/SegmentedControl/SegmentedControl.vue +284 -0
- package/dist/components/controls/SegmentedControl/theme.css +60 -0
- package/dist/components/controls/SegmentedControl/types.ts +5 -0
- package/dist/components/controls/Slider/README.md +627 -0
- package/dist/components/controls/Slider/Slider.vue +260 -0
- package/dist/components/controls/Slider/theme.css +74 -0
- package/dist/components/controls/Stepper/README.md +601 -0
- package/dist/components/controls/Stepper/Stepper.vue +103 -0
- package/dist/components/controls/Stepper/theme.css +53 -0
- package/dist/components/controls/Switch/README.md +667 -0
- package/dist/components/controls/Switch/Switch.vue +127 -0
- package/dist/components/controls/Switch/theme.css +42 -0
- package/dist/components/dialogs/Alert/Alert.vue +218 -0
- package/dist/components/dialogs/Alert/README.md +450 -0
- package/dist/components/dialogs/Alert/theme.css +44 -0
- package/dist/components/dialogs/Alert/types.ts +11 -0
- package/dist/components/dialogs/Toast/README.md +522 -0
- package/dist/components/dialogs/Toast/Toast.vue +296 -0
- package/dist/components/dialogs/Toast/ToastContainer.vue +330 -0
- package/dist/components/dialogs/Toast/theme.css +44 -0
- package/dist/components/dialogs/Toast/types.ts +46 -0
- package/dist/components/dialogs/Toast/useToast.ts +127 -0
- package/dist/components/indicators/ProgressBar/ProgressBar.vue +98 -0
- package/dist/components/indicators/ProgressBar/README.md +744 -0
- package/dist/components/indicators/ProgressBar/theme.css +36 -0
- package/dist/components/indicators/Tooltip/README.md +723 -0
- package/dist/components/indicators/Tooltip/TooltipProvider.vue +142 -0
- package/dist/components/indicators/Tooltip/theme.css +18 -0
- package/dist/components/indicators/Tooltip/tooltip.ts +48 -0
- package/dist/components/indicators/Tooltip/types.ts +15 -0
- package/dist/components/indicators/Tooltip/useTooltip.ts +71 -0
- package/dist/components/inputs/AutogrowTextView/AutogrowTextView.vue +110 -0
- package/dist/components/inputs/AutogrowTextView/README.md +643 -0
- package/dist/components/inputs/AutogrowTextView/theme.css +28 -0
- package/dist/components/inputs/InputCard/InputCard.vue +600 -0
- package/dist/components/inputs/InputCard/README.md +636 -0
- package/dist/components/inputs/InputEmail/InputEmail.vue +698 -0
- package/dist/components/inputs/InputEmail/README.md +764 -0
- package/dist/components/inputs/InputNumber/InputNumber.vue +300 -0
- package/dist/components/inputs/InputNumber/README.md +749 -0
- package/dist/components/inputs/InputPhone/InputPhone.vue +645 -0
- package/dist/components/inputs/InputPhone/README.md +636 -0
- package/dist/components/inputs/InputSecure/InputSecure.vue +646 -0
- package/dist/components/inputs/InputSecure/README.md +771 -0
- package/dist/components/inputs/InputText/InputText.vue +225 -0
- package/dist/components/inputs/InputText/README.md +844 -0
- package/dist/components/inputs/OTP/OTP.vue +349 -0
- package/dist/components/inputs/OTP/README.md +736 -0
- package/dist/components/inputs/OTP/theme.css +50 -0
- package/dist/components/inputs/StringCapture/README.md +718 -0
- package/dist/components/inputs/StringCapture/StringCapture.vue +315 -0
- package/dist/components/inputs/StringCapture/theme.css +86 -0
- package/dist/components/inputs/Tags/README.md +897 -0
- package/dist/components/inputs/Tags/TagBar.vue +793 -0
- package/dist/components/inputs/Tags/TagCreation.vue +219 -0
- package/dist/components/inputs/Tags/TagPicker.vue +380 -0
- package/dist/components/inputs/Tags/tag-bar-styles.ts +354 -0
- package/dist/components/inputs/Tags/theme.css +121 -0
- package/dist/components/inputs/Tags/types.ts +346 -0
- package/dist/components/inputs/search/README.md +759 -0
- package/dist/components/inputs/search/SearchBar.vue +394 -0
- package/dist/components/inputs/search/SearchResults.vue +310 -0
- package/dist/components/inputs/search/theme.css +187 -0
- package/dist/components/inputs/search/types.ts +8 -0
- package/dist/components/inputs/theme.css +102 -0
- package/dist/components/menus/ActionMenu/ActionMenu.vue +383 -0
- package/dist/components/menus/ActionMenu/README.md +825 -0
- package/dist/components/menus/ActionMenu/theme.css +93 -0
- package/dist/components/models/Popover/Popover.vue +551 -0
- package/dist/components/models/Popover/README.md +885 -0
- package/dist/components/models/Popover/theme.css +52 -0
- package/dist/components/models/Sheet/README.md +1159 -0
- package/dist/components/models/Sheet/Sheet.vue +465 -0
- package/dist/components/models/Sheet/theme.css +72 -0
- package/dist/components/models/Sidebar/README.md +1228 -0
- package/dist/components/models/Sidebar/Sidebar.vue +480 -0
- package/dist/components/models/Sidebar/theme.css +90 -0
- package/dist/components/navigation/adaptive/AdaptiveLayout.vue +779 -0
- package/dist/components/navigation/adaptive/AdaptiveLayoutBreadcrumbs.vue +192 -0
- package/dist/components/navigation/adaptive/AdaptiveLayoutMenuButton.vue +149 -0
- package/dist/components/navigation/adaptive/README.md +768 -0
- package/dist/components/navigation/adaptive/types.ts +19 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.ts +89 -0
- package/dist/components/navigation/adaptive/useBreakpoints.ts +41 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.ts +214 -0
- package/dist/components/navigation/adaptive/useViewAnimation.ts +721 -0
- package/dist/components/navigation/adaptive/useViewResize.ts +211 -0
- package/dist/components/navigation/navstack/NavigationStack.vue +180 -0
- package/dist/components/navigation/navstack/README.md +994 -0
- package/dist/components/navigation/navstack/useNavigationStack.ts +164 -0
- package/dist/components/navigation/slideover/README.md +1275 -0
- package/dist/components/navigation/slideover/SlideoverController.vue +287 -0
- package/dist/components/navigation/slideover/useSlideoverController.ts +320 -0
- package/dist/components/navigation/splitview/README.md +1115 -0
- package/dist/components/navigation/splitview/SplitViewController.vue +176 -0
- package/dist/components/navigation/splitview/useSplitViewController.ts +388 -0
- package/dist/components/navigation/tabcontroller/README.md +919 -0
- package/dist/components/navigation/tabcontroller/TabController.vue +307 -0
- package/dist/components/navigation/tabcontroller/TabItem.vue +57 -0
- package/dist/components/navigation/tabcontroller/types.ts +24 -0
- package/dist/components/navigation/tabcontroller/useTabController.ts +18 -0
- package/dist/components/navigation/theme.css +91 -0
- package/dist/components/navigation/types.ts +7 -0
- package/dist/components/pickers/CollectionPicker/CollectionPicker.vue +398 -0
- package/dist/components/pickers/CollectionPicker/README.md +1115 -0
- package/dist/components/pickers/CollectionPicker/theme.css +14 -0
- package/dist/components/pickers/CollectionPicker/types.ts +11 -0
- package/dist/components/pickers/ColorPicker/ColorPicker.vue +376 -0
- package/dist/components/pickers/ColorPicker/README.md +1439 -0
- package/dist/components/pickers/ColorPicker/colors.ts +299 -0
- package/dist/components/pickers/ColorPicker/theme.css +32 -0
- package/dist/components/pickers/DatePicker/DatePicker.vue +660 -0
- package/dist/components/pickers/DatePicker/README.md +1195 -0
- package/dist/components/pickers/DatePicker/theme.css +22 -0
- package/dist/components/pickers/FilePicker/FilePicker.vue +534 -0
- package/dist/components/pickers/FilePicker/README.md +1542 -0
- package/dist/components/pickers/FilePicker/theme.css +48 -0
- package/dist/components/pickers/FilePicker/types.ts +10 -0
- package/dist/components/pickers/IconPicker/IconPicker.vue +327 -0
- package/dist/components/pickers/IconPicker/README.md +1161 -0
- package/dist/components/pickers/IconPicker/theme.css +28 -0
- package/dist/components/pickers/theme.css +82 -0
- package/dist/components/views/MarkdownViewer/MarkdownViewer.vue +442 -0
- package/dist/components/views/MarkdownViewer/README.md +833 -0
- package/dist/components/views/MarkdownViewer/theme.css +130 -0
- package/package.json +3 -2
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// useViewResize.ts
|
|
2
|
+
import { ref, watch, onUnmounted, type Ref } from "vue";
|
|
3
|
+
|
|
4
|
+
export interface ResizeState {
|
|
5
|
+
viewId: string;
|
|
6
|
+
startX: number;
|
|
7
|
+
startWidth: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ResizeTooltip {
|
|
11
|
+
visible: boolean;
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
width: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ResizeConfig {
|
|
18
|
+
defaultMinWidth: number;
|
|
19
|
+
gap: number;
|
|
20
|
+
padding: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ResizableView {
|
|
24
|
+
id: string;
|
|
25
|
+
minWidth?: number;
|
|
26
|
+
maxWidth?: number;
|
|
27
|
+
currentWidth?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const useViewResize = (
|
|
31
|
+
onScreenViews: Ref<ResizableView[]>,
|
|
32
|
+
config: ResizeConfig,
|
|
33
|
+
props: { gap: string; padding: string },
|
|
34
|
+
getViewId: (view: ResizableView) => string, // Changed from (index: number) => string
|
|
35
|
+
getOnscreenId: () => string
|
|
36
|
+
) => {
|
|
37
|
+
const resizing = ref<ResizeState | null>(null);
|
|
38
|
+
const resizeTooltip = ref<ResizeTooltip>({
|
|
39
|
+
visible: false,
|
|
40
|
+
x: 0,
|
|
41
|
+
y: 0,
|
|
42
|
+
width: 0,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const updateViewWidth = (viewId: string, width: number) => {
|
|
46
|
+
const view = onScreenViews.value.find((v) => v.id === viewId);
|
|
47
|
+
if (view) {
|
|
48
|
+
view.currentWidth = width;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const calculateMaxWidthWithoutOverflow = (viewIndex: number): number => {
|
|
53
|
+
const container = document.querySelector(
|
|
54
|
+
`#${getOnscreenId()}`
|
|
55
|
+
) as HTMLElement;
|
|
56
|
+
if (!container) {
|
|
57
|
+
return Infinity;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const containerWidth = container.clientWidth;
|
|
61
|
+
const containerPadding = parseFloat(props.padding) || 0;
|
|
62
|
+
const gap = parseFloat(props.gap) || 0;
|
|
63
|
+
|
|
64
|
+
// Calculate available width considering padding
|
|
65
|
+
let availableWidth = containerWidth - containerPadding * 2;
|
|
66
|
+
|
|
67
|
+
// Calculate total width used by other views
|
|
68
|
+
let totalOtherViewsWidth = 0;
|
|
69
|
+
|
|
70
|
+
for (let i = 0; i < onScreenViews.value.length; i++) {
|
|
71
|
+
if (i !== viewIndex) {
|
|
72
|
+
const view = onScreenViews.value[i];
|
|
73
|
+
const viewElement = document.getElementById(
|
|
74
|
+
getViewId(view) // Changed from getViewId(i)
|
|
75
|
+
) as HTMLElement;
|
|
76
|
+
|
|
77
|
+
if (viewElement) {
|
|
78
|
+
// For views that aren't the last one, use their current width
|
|
79
|
+
// For the last view (if it's not the one being resized), use its minimum width
|
|
80
|
+
if (i === onScreenViews.value.length - 1) {
|
|
81
|
+
// Last view uses its minimum width when calculating constraints
|
|
82
|
+
totalOtherViewsWidth += view.minWidth || config.defaultMinWidth;
|
|
83
|
+
} else {
|
|
84
|
+
// Use actual width for non-last views
|
|
85
|
+
totalOtherViewsWidth +=
|
|
86
|
+
view.currentWidth || viewElement.offsetWidth;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Calculate gaps between views
|
|
93
|
+
const totalGaps = gap * (onScreenViews.value.length - 1);
|
|
94
|
+
|
|
95
|
+
// Calculate maximum width for the resizing view
|
|
96
|
+
const maxWidth = availableWidth - totalOtherViewsWidth - totalGaps;
|
|
97
|
+
|
|
98
|
+
// Ensure we return a positive value
|
|
99
|
+
return Math.max(config.defaultMinWidth, maxWidth);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const startResize = (viewId: string, event: MouseEvent) => {
|
|
103
|
+
const view = onScreenViews.value.find((v) => v.id === viewId);
|
|
104
|
+
if (!view) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Use getViewId to find the element more reliably
|
|
109
|
+
const viewElement = document.getElementById(getViewId(view)) as HTMLElement;
|
|
110
|
+
if (!viewElement) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const currentWidth = view.currentWidth || viewElement.offsetWidth;
|
|
115
|
+
|
|
116
|
+
resizing.value = {
|
|
117
|
+
viewId,
|
|
118
|
+
startX: event.clientX,
|
|
119
|
+
startWidth: currentWidth,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// Show tooltip with initial width
|
|
123
|
+
resizeTooltip.value = {
|
|
124
|
+
visible: true,
|
|
125
|
+
x: event.clientX,
|
|
126
|
+
y: event.clientY - 40,
|
|
127
|
+
width: Math.round(currentWidth),
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// Prevent text selection during resize
|
|
131
|
+
document.body.style.userSelect = "none";
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const handleMouseResize = (event: MouseEvent) => {
|
|
136
|
+
if (!resizing.value) return;
|
|
137
|
+
|
|
138
|
+
const view = onScreenViews.value.find(
|
|
139
|
+
(v) => v.id === resizing.value?.viewId
|
|
140
|
+
);
|
|
141
|
+
if (!view) return;
|
|
142
|
+
|
|
143
|
+
const viewIndex = onScreenViews.value.findIndex(
|
|
144
|
+
(v) => v.id === resizing.value?.viewId
|
|
145
|
+
);
|
|
146
|
+
if (viewIndex === -1) return;
|
|
147
|
+
|
|
148
|
+
const deltaX = event.clientX - resizing.value.startX;
|
|
149
|
+
const newWidth = resizing.value.startWidth + deltaX;
|
|
150
|
+
|
|
151
|
+
// Apply constraints
|
|
152
|
+
const minWidth = view.minWidth || config.defaultMinWidth;
|
|
153
|
+
const maxWidthFromView = view.maxWidth || Infinity;
|
|
154
|
+
const maxWidthFromContainer = calculateMaxWidthWithoutOverflow(viewIndex);
|
|
155
|
+
const maxWidth = Math.min(maxWidthFromView, maxWidthFromContainer);
|
|
156
|
+
|
|
157
|
+
const constrainedWidth = Math.max(minWidth, Math.min(newWidth, maxWidth));
|
|
158
|
+
|
|
159
|
+
// Update width through the callback function
|
|
160
|
+
updateViewWidth(view.id, constrainedWidth);
|
|
161
|
+
|
|
162
|
+
// Check if a constraint was hit
|
|
163
|
+
const isConstrained = newWidth !== constrainedWidth;
|
|
164
|
+
|
|
165
|
+
// Update tooltip position and value
|
|
166
|
+
resizeTooltip.value = {
|
|
167
|
+
visible: !isConstrained, // Hide when hitting a constraint
|
|
168
|
+
x: event.clientX,
|
|
169
|
+
y: event.clientY - 40,
|
|
170
|
+
width: Math.round(constrainedWidth),
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const endResize = () => {
|
|
175
|
+
if (!resizing.value) return;
|
|
176
|
+
|
|
177
|
+
resizing.value = null;
|
|
178
|
+
document.body.style.userSelect = "";
|
|
179
|
+
|
|
180
|
+
// Hide tooltip
|
|
181
|
+
resizeTooltip.value.visible = false;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// Set up event listeners when resizing starts/ends
|
|
185
|
+
watch(resizing, (newVal) => {
|
|
186
|
+
if (newVal) {
|
|
187
|
+
document.addEventListener("mousemove", handleMouseResize);
|
|
188
|
+
document.addEventListener("mouseup", endResize);
|
|
189
|
+
} else {
|
|
190
|
+
document.removeEventListener("mousemove", handleMouseResize);
|
|
191
|
+
document.removeEventListener("mouseup", endResize);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Cleanup on unmount
|
|
196
|
+
const cleanup = () => {
|
|
197
|
+
document.removeEventListener("mousemove", handleMouseResize);
|
|
198
|
+
document.removeEventListener("mouseup", endResize);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
onUnmounted(() => {
|
|
202
|
+
cleanup();
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
resizing,
|
|
207
|
+
resizeTooltip,
|
|
208
|
+
startResize,
|
|
209
|
+
updateViewWidth,
|
|
210
|
+
};
|
|
211
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { gsap } from "gsap";
|
|
3
|
+
import { Flip } from "gsap/Flip";
|
|
4
|
+
import { ref, onMounted, onUnmounted, watch, toRef } from "vue";
|
|
5
|
+
import { useNavigationStack } from "./useNavigationStack";
|
|
6
|
+
import "../theme.css";
|
|
7
|
+
import { Pane } from "../types";
|
|
8
|
+
|
|
9
|
+
gsap.registerPlugin(Flip);
|
|
10
|
+
|
|
11
|
+
// Define props
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
taskKey: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
panes: {
|
|
18
|
+
type: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
background: string;
|
|
21
|
+
foreground: string;
|
|
22
|
+
component: any;
|
|
23
|
+
props: object;
|
|
24
|
+
}>,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
childWidth: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: null,
|
|
30
|
+
},
|
|
31
|
+
childHeight: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
panes: internalPanes,
|
|
39
|
+
navigate,
|
|
40
|
+
updatePanes,
|
|
41
|
+
} = useNavigationStack(props.panes, props.taskKey);
|
|
42
|
+
|
|
43
|
+
// Watch for external pane changes and update internal state
|
|
44
|
+
watch(
|
|
45
|
+
() => props.panes,
|
|
46
|
+
(newPanes) => {
|
|
47
|
+
updatePanes(newPanes);
|
|
48
|
+
},
|
|
49
|
+
{ deep: true }
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// Container ref for tracking container dimensions
|
|
53
|
+
const containerRef = ref<HTMLElement | null>(null);
|
|
54
|
+
const width = ref(0);
|
|
55
|
+
const height = ref("");
|
|
56
|
+
|
|
57
|
+
const updateDimensions = () => {
|
|
58
|
+
const container = containerRef.value;
|
|
59
|
+
if (!container) {
|
|
60
|
+
console.log("container is null. Unable to calculate dimensions");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (props.childWidth) {
|
|
65
|
+
width.value = props.childWidth;
|
|
66
|
+
} else {
|
|
67
|
+
width.value = container.offsetWidth;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (props.childHeight) {
|
|
71
|
+
height.value = `${props.childHeight}px`;
|
|
72
|
+
} else {
|
|
73
|
+
height.value = "100%";
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
if (containerRef.value) {
|
|
79
|
+
updateDimensions();
|
|
80
|
+
|
|
81
|
+
// Use ResizeObserver to watch for container size changes
|
|
82
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
83
|
+
updateDimensions();
|
|
84
|
+
});
|
|
85
|
+
resizeObserver.observe(containerRef.value);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
onUnmounted(() => {
|
|
90
|
+
// ResizeObserver cleanup is handled automatically when the component unmounts
|
|
91
|
+
});
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<div
|
|
96
|
+
ref="containerRef"
|
|
97
|
+
:class="$style.container"
|
|
98
|
+
:style="{ '--currentContainerWidth': width + 'px', '--maxHeight': height }"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
:id="`${props.taskKey}-offscreen-left`"
|
|
102
|
+
:class="$style.offscreen_left"
|
|
103
|
+
></div>
|
|
104
|
+
<div :id="`${props.taskKey}-onscreen`" :class="$style.onscreen"></div>
|
|
105
|
+
<div
|
|
106
|
+
:id="`${props.taskKey}-offscreen-right`"
|
|
107
|
+
:class="$style.offscreen_right"
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
v-for="(pane, index) in internalPanes"
|
|
111
|
+
:key="`${pane.name}-${index}`"
|
|
112
|
+
:id="`${props.taskKey}-pane-${index}`"
|
|
113
|
+
:class="[$style.pane]"
|
|
114
|
+
:style="{ order: index }"
|
|
115
|
+
>
|
|
116
|
+
<div
|
|
117
|
+
:class="$style.component_container"
|
|
118
|
+
:style="{ backgroundColor: pane.background }"
|
|
119
|
+
>
|
|
120
|
+
<component :is="pane.component" v-bind="pane.props"></component>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<style module>
|
|
128
|
+
.container {
|
|
129
|
+
position: relative;
|
|
130
|
+
display: grid;
|
|
131
|
+
grid-template-areas: "content";
|
|
132
|
+
height: 100%;
|
|
133
|
+
width: 100%;
|
|
134
|
+
grid-template-rows: 1fr;
|
|
135
|
+
grid-template-columns: 1fr;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
}
|
|
138
|
+
.offscreen_left {
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: 0;
|
|
141
|
+
left: calc(var(--currentContainerWidth, 100%) * -1);
|
|
142
|
+
bottom: 0;
|
|
143
|
+
width: var(--currentContainerWidth, 100%);
|
|
144
|
+
display: flex;
|
|
145
|
+
justify-content: end;
|
|
146
|
+
}
|
|
147
|
+
.offscreen_right {
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: 0;
|
|
150
|
+
right: calc(var(--currentContainerWidth, 100%) * -1);
|
|
151
|
+
bottom: 0;
|
|
152
|
+
width: var(--currentContainerWidth, 100%);
|
|
153
|
+
display: flex;
|
|
154
|
+
justify-content: start;
|
|
155
|
+
}
|
|
156
|
+
.onscreen {
|
|
157
|
+
grid-area: content;
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-columns: 1fr;
|
|
160
|
+
grid-template-rows: 1fr;
|
|
161
|
+
height: 100%;
|
|
162
|
+
}
|
|
163
|
+
.pane {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: 1fr;
|
|
166
|
+
grid-template-areas: "content";
|
|
167
|
+
height: 100%;
|
|
168
|
+
}
|
|
169
|
+
.component_container {
|
|
170
|
+
grid-area: content;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
width: var(--currentContainerWidth, 100%);
|
|
173
|
+
align-self: center;
|
|
174
|
+
justify-self: center;
|
|
175
|
+
height: var(--maxHeight, 100%);
|
|
176
|
+
}
|
|
177
|
+
.component_container > :first-child {
|
|
178
|
+
height: 100%;
|
|
179
|
+
}
|
|
180
|
+
</style>
|