|
1 | 1 | <template>
|
2 | 2 | <div class="mx-auto h-[calc(100vh-57px)] max-w-screen-2xl">
|
3 |
| - <UiSplitter direction="horizontal"> |
| 3 | + <UiSplitter |
| 4 | + id="ticket-dashboard-splitter-group" |
| 5 | + direction="horizontal" |
| 6 | + @layout="layout = $event" |
| 7 | + > |
4 | 8 | <UiSplitterPanel
|
5 | 9 | v-if="breakpoints.isGreaterOrEqual('md')"
|
| 10 | + id="ticket-dashboard-splitter-panel-1" |
6 | 11 | v-slot="{ isCollapsed }"
|
7 | 12 | collapsible
|
8 | 13 | :collapsed-size="xlUp ? 4 : lg ? 5 : 8"
|
9 | 14 | :min-size="xlUp ? 18 : lg ? 20 : 28"
|
10 |
| - :default-size="xlUp ? 22 : lg ? 25 : 35" |
| 15 | + :default-size="layout[0]" |
11 | 16 | :max-size="xlUp ? 26 : lg ? 30 : 40"
|
12 | 17 | class="group/splitter"
|
13 | 18 | >
|
|
38 | 43 | </nav>
|
39 | 44 | </UiScrollArea>
|
40 | 45 | </UiSplitterPanel>
|
41 |
| - <UiSplitterHandle v-if="breakpoints.isGreaterOrEqual('md')" with-handle /> |
42 |
| - <UiSplitterPanel> |
| 46 | + <UiSplitterHandle |
| 47 | + v-if="breakpoints.isGreaterOrEqual('md')" |
| 48 | + id="ticket-dashboard-splitter-handle-1" |
| 49 | + with-handle |
| 50 | + /> |
| 51 | + <UiSplitterPanel id="ticket-dashboard-splitter-panel-2" :default-size="layout[1]"> |
43 | 52 | <UiNavbar sticky>
|
44 | 53 | <UiContainer class="flex h-16 items-center justify-between lg:px-6">
|
45 | 54 | <div class="flex items-center gap-2">
|
|
228 | 237 | const lg = breakpoints.lg.value;
|
229 | 238 | const xlUp = breakpoints.isGreaterOrEqual("xl");
|
230 | 239 | const showMenu = ref(false);
|
| 240 | + const period = useState("ticket-dashboard-period", () => "Yearly"); |
231 | 241 |
|
232 |
| - const period = ref("Yearly"); |
| 242 | + const layout = useCookie<number[]>("ticket-dashboard-layout", { |
| 243 | + default: () => [xlUp ? 22 : lg ? 25 : 35, xlUp ? 78 : lg ? 75 : 65], |
| 244 | + }); |
233 | 245 |
|
234 | 246 | // return the number formatted as K or M -> 1.2K or 1.2M
|
235 | 247 | const shortenCurrency = (v: number = 0) => {
|
|
0 commit comments