@gspa/ui 0.1.3 → 0.1.4
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/README.md +18 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/Accordion.cjs +1 -0
- package/dist/components/Accordion.js +192 -0
- package/dist/components/AccordionItem.cjs +1 -0
- package/dist/components/AccordionItem.js +109 -0
- package/dist/components/AddReminderModal.cjs +1 -0
- package/dist/components/AddReminderModal.js +107 -0
- package/dist/components/Alert.cjs +1 -0
- package/dist/components/Alert.js +222 -0
- package/dist/components/Avatar.cjs +1 -0
- package/dist/components/Avatar.js +86 -0
- package/dist/components/Badge.cjs +1 -0
- package/dist/components/Badge.js +109 -0
- package/dist/components/Breadcrumb.cjs +1 -0
- package/dist/components/Breadcrumb.js +72 -0
- package/dist/components/Button.cjs +1 -0
- package/dist/components/Button.js +190 -0
- package/dist/components/ButtonGroup.cjs +1 -0
- package/dist/components/ButtonGroup.js +46 -0
- package/dist/components/Calendar.cjs +1 -0
- package/dist/components/Calendar.js +341 -0
- package/dist/components/Card.cjs +1 -0
- package/dist/components/Card.js +316 -0
- package/dist/components/CardBody.cjs +1 -0
- package/dist/components/CardBody.js +34 -0
- package/dist/components/CardContent.cjs +1 -0
- package/dist/components/CardContent.js +17 -0
- package/dist/components/CardFooter.cjs +1 -0
- package/dist/components/CardFooter.js +34 -0
- package/dist/components/CardHeader.cjs +1 -0
- package/dist/components/CardHeader.js +91 -0
- package/dist/components/CardTitle.cjs +1 -0
- package/dist/components/CardTitle.js +17 -0
- package/dist/components/Checkbox.cjs +1 -0
- package/dist/components/Checkbox.js +185 -0
- package/dist/components/CircularProgress.cjs +1 -0
- package/dist/components/CircularProgress.js +141 -0
- package/dist/components/DataTable.cjs +1 -0
- package/dist/components/DataTable.js +863 -0
- package/dist/components/DataTableCell.cjs +1 -0
- package/dist/components/DataTableCell.js +95 -0
- package/dist/components/DataTableFilters.cjs +1 -0
- package/dist/components/DataTableFilters.js +519 -0
- package/dist/components/DataTableHeader.cjs +1 -0
- package/dist/components/DataTableHeader.js +116 -0
- package/dist/components/DataTablePagination.cjs +1 -0
- package/dist/components/DataTablePagination.js +290 -0
- package/dist/components/DataTableRow.cjs +1 -0
- package/dist/components/DataTableRow.js +199 -0
- package/dist/components/DataTableToolBar.cjs +1 -0
- package/dist/components/DataTableToolBar.js +477 -0
- package/dist/components/DatePicker.cjs +1 -0
- package/dist/components/DatePicker.js +401 -0
- package/dist/components/Divider.cjs +1 -0
- package/dist/components/Divider.js +103 -0
- package/dist/components/Dropdown.cjs +1 -0
- package/dist/components/Dropdown.js +104 -0
- package/dist/components/DropdownItem.cjs +1 -0
- package/dist/components/DropdownItem.js +60 -0
- package/dist/components/EventsCalendar.cjs +1 -0
- package/dist/components/EventsCalendar.js +863 -0
- package/dist/components/FileUpload.cjs +1 -0
- package/dist/components/FileUpload.js +195 -0
- package/dist/components/FilterDrawer.cjs +1 -0
- package/dist/components/FilterDrawer.js +412 -0
- package/dist/components/Footer.cjs +1 -0
- package/dist/components/Footer.js +157 -0
- package/dist/components/FormField.cjs +1 -0
- package/dist/components/FormField.js +190 -0
- package/dist/components/Graph.cjs +1 -0
- package/dist/components/Graph.js +164 -0
- package/dist/components/GraphFilters.cjs +1 -0
- package/dist/components/GraphFilters.js +305 -0
- package/dist/components/Header.cjs +1 -0
- package/dist/components/Header.js +674 -0
- package/dist/components/Icon.cjs +1 -0
- package/dist/components/Icon.js +51 -0
- package/dist/components/Image.cjs +1 -0
- package/dist/components/Image.js +112 -0
- package/dist/components/Input.cjs +1 -0
- package/dist/components/Input.js +166 -0
- package/dist/components/InputGroup.cjs +1 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.cjs +1 -0
- package/dist/components/Label.js +46 -0
- package/dist/components/Link.cjs +1 -0
- package/dist/components/Link.js +119 -0
- package/dist/components/ListItem.cjs +1 -0
- package/dist/components/ListItem.js +89 -0
- package/dist/components/Loader.cjs +1 -0
- package/dist/components/Loader.js +154 -0
- package/dist/components/Logo.cjs +1 -0
- package/dist/components/Logo.js +67 -0
- package/dist/components/MenuItem.cjs +1 -0
- package/dist/components/MenuItem.js +66 -0
- package/dist/components/Modal.cjs +1 -0
- package/dist/components/Modal.js +110 -0
- package/dist/components/ModalBody.cjs +1 -0
- package/dist/components/ModalBody.js +33 -0
- package/dist/components/ModalFooter.cjs +1 -0
- package/dist/components/ModalFooter.js +33 -0
- package/dist/components/ModalHeader.cjs +1 -0
- package/dist/components/ModalHeader.js +24 -0
- package/dist/components/MultiSelect.cjs +1 -0
- package/dist/components/MultiSelect.js +211 -0
- package/dist/components/Notification.cjs +1 -0
- package/dist/components/Notification.js +121 -0
- package/dist/components/Option.cjs +1 -0
- package/dist/components/Option.js +44 -0
- package/dist/components/Progress.cjs +1 -0
- package/dist/components/Progress.js +77 -0
- package/dist/components/ProgressBar.cjs +1 -0
- package/dist/components/ProgressBar.js +101 -0
- package/dist/components/Radio.cjs +1 -0
- package/dist/components/Radio.js +81 -0
- package/dist/components/RailNav.cjs +1 -0
- package/dist/components/RailNav.js +124 -0
- package/dist/components/ReminderConfig.cjs +1 -0
- package/dist/components/ReminderConfig.js +375 -0
- package/dist/components/ReusableForm.cjs +1 -0
- package/dist/components/ReusableForm.js +657 -0
- package/dist/components/ReusableFormModal.cjs +1 -0
- package/dist/components/ReusableFormModal.js +112 -0
- package/dist/components/RightDrawer.cjs +1 -0
- package/dist/components/RightDrawer.js +143 -0
- package/dist/components/Search.cjs +1 -0
- package/dist/components/Search.js +252 -0
- package/dist/components/Select.cjs +1 -0
- package/dist/components/Select.js +243 -0
- package/dist/components/Sidebar.cjs +1 -0
- package/dist/components/Sidebar.js +372 -0
- package/dist/components/Slider.cjs +1 -0
- package/dist/components/Slider.js +42 -0
- package/dist/components/Spinner.cjs +1 -0
- package/dist/components/Spinner.js +87 -0
- package/dist/components/Stepper.cjs +1 -0
- package/dist/components/Stepper.js +12 -0
- package/dist/components/StepperItem.cjs +1 -0
- package/dist/components/StepperItem.js +33 -0
- package/dist/components/Switch.cjs +1 -0
- package/dist/components/Switch.js +112 -0
- package/dist/components/Tab.cjs +1 -0
- package/dist/components/Tab.js +134 -0
- package/dist/components/TabPanel.cjs +1 -0
- package/dist/components/TabPanel.js +49 -0
- package/dist/components/Text.cjs +1 -0
- package/dist/components/Text.js +84 -0
- package/dist/components/Textarea.cjs +1 -0
- package/dist/components/Textarea.js +102 -0
- package/dist/components/ThemeConfigurator.cjs +1 -0
- package/dist/components/ThemeConfigurator.js +50 -0
- package/dist/components/Timeline.cjs +1 -0
- package/dist/components/Timeline.js +24 -0
- package/dist/components/TimelineItem.cjs +1 -0
- package/dist/components/TimelineItem.js +63 -0
- package/dist/components/Toast.cjs +1 -0
- package/dist/components/Toast.js +231 -0
- package/dist/components/Tooltip.cjs +1 -0
- package/dist/components/Tooltip.js +124 -0
- package/dist/components/Typography.cjs +1 -0
- package/dist/components/Typography.js +267 -0
- package/dist/components/charts/BarChart.cjs +1 -0
- package/dist/components/charts/BarChart.js +323 -0
- package/dist/components/charts/LineChart.cjs +1 -0
- package/dist/components/charts/LineChart.js +322 -0
- package/dist/components/charts/PieChart.cjs +1 -0
- package/dist/components/charts/PieChart.js +311 -0
- package/dist/components/charts/StackedBarChart.cjs +1 -0
- package/dist/components/charts/StackedBarChart.js +348 -0
- package/dist/components/widgets/DashboardWidget.cjs +1 -0
- package/dist/components/widgets/DashboardWidget.js +309 -0
- package/dist/directives/tooltip.cjs +47 -0
- package/dist/directives/tooltip.js +115 -0
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +311 -19548
- package/dist/layouts/AuthLayout.cjs +1 -0
- package/dist/layouts/AuthLayout.js +190 -0
- package/dist/layouts/DashboardLayout.cjs +1 -0
- package/dist/layouts/DashboardLayout.js +244 -0
- package/dist/layouts/DefaultLayout.cjs +1 -0
- package/dist/layouts/DefaultLayout.js +94 -0
- package/dist/layouts/ErrorLayout.cjs +1 -0
- package/dist/layouts/ErrorLayout.js +452 -0
- package/dist/lib/auth.cjs +1 -0
- package/dist/lib/auth.js +4 -0
- package/dist/lib/theme.cjs +1 -0
- package/dist/lib/theme.js +135 -0
- package/dist/lib/toast.cjs +1 -0
- package/dist/lib/toast.js +81 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +37 -7
- package/dist/index.js +0 -605
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { ref as h, computed as s, watch as $, createElementBlock as c, openBlock as r, createElementVNode as l, createCommentVNode as m, normalizeClass as o, createVNode as d, withDirectives as T, vModelText as B, withCtx as y, Fragment as D, renderList as E, toDisplayString as b, renderSlot as O, createBlock as C, createTextVNode as w } from "vue";
|
|
2
|
+
import { cva as Q } from "class-variance-authority";
|
|
3
|
+
import { cn as W } from "../utils/cn.js";
|
|
4
|
+
import k from "./Button.js";
|
|
5
|
+
import R from "./Select.js";
|
|
6
|
+
import v from "./Icon.js";
|
|
7
|
+
const X = { class: "border-b" }, Y = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "flex items-center gap-3 min-w-64"
|
|
10
|
+
}, Z = { class: "relative flex-1" }, ee = { class: "relative flex-1" }, te = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "min-w-40"
|
|
13
|
+
}, ae = { class: "relative" }, le = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "min-w-40"
|
|
16
|
+
}, re = { class: "relative" }, se = ["value"], oe = {
|
|
17
|
+
key: 3,
|
|
18
|
+
class: "flex items-center gap-2"
|
|
19
|
+
}, ne = { class: "flex items-center gap-3 ml-auto" }, ie = { class: "flex items-center gap-3 flex-wrap" }, ue = ["onClick"], he = {
|
|
20
|
+
__name: "GraphFilters",
|
|
21
|
+
props: {
|
|
22
|
+
showDateFilter: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
showChartTypeFilter: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
showExport: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
showRefresh: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
dataSources: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => []
|
|
41
|
+
},
|
|
42
|
+
variant: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "default",
|
|
45
|
+
validator: (n) => ["default", "minimal", "bordered"].includes(n)
|
|
46
|
+
},
|
|
47
|
+
padding: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "normal",
|
|
50
|
+
validator: (n) => ["compact", "normal", "comfortable"].includes(n)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
emits: [
|
|
54
|
+
"update:dateFrom",
|
|
55
|
+
"update:dateTo",
|
|
56
|
+
"update:chartType",
|
|
57
|
+
"update:dataSource",
|
|
58
|
+
"export",
|
|
59
|
+
"refresh",
|
|
60
|
+
"clear-filters"
|
|
61
|
+
],
|
|
62
|
+
setup(n, { emit: U }) {
|
|
63
|
+
const g = n, f = U, i = h(""), u = h(""), x = h("bar"), p = h(""), A = Q("flex flex-wrap items-center gap-4", {
|
|
64
|
+
variants: {
|
|
65
|
+
variant: {
|
|
66
|
+
default: "",
|
|
67
|
+
minimal: "bg-transparent",
|
|
68
|
+
bordered: ""
|
|
69
|
+
},
|
|
70
|
+
padding: {
|
|
71
|
+
compact: "px-4 py-3",
|
|
72
|
+
normal: "px-6 py-4",
|
|
73
|
+
comfortable: "px-8 py-6"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
variant: "default",
|
|
78
|
+
padding: "normal"
|
|
79
|
+
}
|
|
80
|
+
}), N = s(() => i.value || u.value || p.value), F = s(() => {
|
|
81
|
+
const a = [];
|
|
82
|
+
if (i.value || u.value) {
|
|
83
|
+
let e = "";
|
|
84
|
+
i.value && u.value ? e = `${i.value} to ${u.value}` : i.value ? e = `From ${i.value}` : u.value && (e = `Until ${u.value}`), e && a.push({
|
|
85
|
+
key: "date",
|
|
86
|
+
label: "Date Range",
|
|
87
|
+
value: e,
|
|
88
|
+
icon: "calendar"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (p.value) {
|
|
92
|
+
const e = g.dataSources.find((t) => t.value === p.value);
|
|
93
|
+
a.push({
|
|
94
|
+
key: "dataSource",
|
|
95
|
+
label: "Data Source",
|
|
96
|
+
value: e?.label || p.value,
|
|
97
|
+
icon: "database"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return a;
|
|
101
|
+
}), L = s(
|
|
102
|
+
() => W(A({
|
|
103
|
+
variant: g.variant,
|
|
104
|
+
padding: g.padding
|
|
105
|
+
}))
|
|
106
|
+
), S = s(
|
|
107
|
+
() => "w-full pl-10 pr-3 py-2 border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm ui-surface "
|
|
108
|
+
), V = s(
|
|
109
|
+
() => "w-full pr-8 appearance-none border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm py-2 pl-3 ui-surface "
|
|
110
|
+
), _ = s(
|
|
111
|
+
() => "ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
112
|
+
), z = s(
|
|
113
|
+
() => "ui-text ui-primary-bg hover:bg-(--ui-primary-strong) border border-(--ui-primary) px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
114
|
+
), G = s(
|
|
115
|
+
() => "ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
116
|
+
), I = s(
|
|
117
|
+
() => "px-6 py-3 ui-primary-soft border-t border-(--ui-primary-soft)"
|
|
118
|
+
), M = s(
|
|
119
|
+
() => "text-sm font-semibold ui-primary"
|
|
120
|
+
), P = s(
|
|
121
|
+
() => "flex items-center gap-1.5 ui-surface border border-(--ui-primary-soft) ui-primary px-3 py-1.5 rounded-full text-sm font-medium"
|
|
122
|
+
), j = s(
|
|
123
|
+
() => "ui-primary hover:text-(--ui-primary) ml-1 hover:bg-(--ui-primary-soft) rounded-full p-0.5 transition-all"
|
|
124
|
+
), q = (a) => {
|
|
125
|
+
x.value = a.target.value, f("update:chartType", a.target.value);
|
|
126
|
+
}, H = (a) => {
|
|
127
|
+
p.value = a.target.value, f("update:dataSource", a.target.value);
|
|
128
|
+
}, J = () => {
|
|
129
|
+
i.value = "", u.value = "", p.value = "", f("clear-filters");
|
|
130
|
+
}, K = (a) => {
|
|
131
|
+
switch (a) {
|
|
132
|
+
case "date":
|
|
133
|
+
i.value = "", u.value = "";
|
|
134
|
+
break;
|
|
135
|
+
case "dataSource":
|
|
136
|
+
p.value = "";
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return $(() => i.value, (a) => {
|
|
141
|
+
f("update:dateFrom", a);
|
|
142
|
+
}), $(() => u.value, (a) => {
|
|
143
|
+
f("update:dateTo", a);
|
|
144
|
+
}), (a, e) => (r(), c("div", X, [
|
|
145
|
+
l("div", {
|
|
146
|
+
class: o(L.value)
|
|
147
|
+
}, [
|
|
148
|
+
n.showDateFilter ? (r(), c("div", Y, [
|
|
149
|
+
l("div", Z, [
|
|
150
|
+
d(v, {
|
|
151
|
+
icon: "calendar",
|
|
152
|
+
class: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"
|
|
153
|
+
}),
|
|
154
|
+
T(l("input", {
|
|
155
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => i.value = t),
|
|
156
|
+
type: "date",
|
|
157
|
+
class: o(S.value),
|
|
158
|
+
placeholder: "From date"
|
|
159
|
+
}, null, 2), [
|
|
160
|
+
[B, i.value]
|
|
161
|
+
])
|
|
162
|
+
]),
|
|
163
|
+
e[6] || (e[6] = l("span", { class: "ui-text text-sm" }, "to", -1)),
|
|
164
|
+
l("div", ee, [
|
|
165
|
+
d(v, {
|
|
166
|
+
icon: "calendar",
|
|
167
|
+
class: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"
|
|
168
|
+
}),
|
|
169
|
+
T(l("input", {
|
|
170
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => u.value = t),
|
|
171
|
+
type: "date",
|
|
172
|
+
class: o(S.value),
|
|
173
|
+
placeholder: "To date"
|
|
174
|
+
}, null, 2), [
|
|
175
|
+
[B, u.value]
|
|
176
|
+
])
|
|
177
|
+
])
|
|
178
|
+
])) : m("", !0),
|
|
179
|
+
n.showChartTypeFilter ? (r(), c("div", te, [
|
|
180
|
+
l("div", ae, [
|
|
181
|
+
d(R, {
|
|
182
|
+
modelValue: x.value,
|
|
183
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => x.value = t),
|
|
184
|
+
class: o(V.value),
|
|
185
|
+
onChange: q
|
|
186
|
+
}, {
|
|
187
|
+
default: y(() => [...e[7] || (e[7] = [
|
|
188
|
+
l("option", { value: "bar" }, " Bar Chart ", -1),
|
|
189
|
+
l("option", { value: "line" }, " Line Chart ", -1),
|
|
190
|
+
l("option", { value: "pie" }, " Pie Chart ", -1)
|
|
191
|
+
])]),
|
|
192
|
+
_: 1
|
|
193
|
+
}, 8, ["modelValue", "class"]),
|
|
194
|
+
d(v, {
|
|
195
|
+
icon: "chart-bar",
|
|
196
|
+
class: "absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"
|
|
197
|
+
})
|
|
198
|
+
])
|
|
199
|
+
])) : m("", !0),
|
|
200
|
+
n.dataSources.length > 0 ? (r(), c("div", le, [
|
|
201
|
+
l("div", re, [
|
|
202
|
+
d(R, {
|
|
203
|
+
modelValue: p.value,
|
|
204
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => p.value = t),
|
|
205
|
+
class: o(V.value),
|
|
206
|
+
onChange: H
|
|
207
|
+
}, {
|
|
208
|
+
default: y(() => [
|
|
209
|
+
e[8] || (e[8] = l("option", { value: "" }, " All Sources ", -1)),
|
|
210
|
+
(r(!0), c(D, null, E(n.dataSources, (t) => (r(), c("option", {
|
|
211
|
+
key: t.value,
|
|
212
|
+
value: t.value
|
|
213
|
+
}, b(t.label), 9, se))), 128))
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
}, 8, ["modelValue", "class"]),
|
|
217
|
+
d(v, {
|
|
218
|
+
icon: "database",
|
|
219
|
+
class: "absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"
|
|
220
|
+
})
|
|
221
|
+
])
|
|
222
|
+
])) : m("", !0),
|
|
223
|
+
a.$slots.filters ? (r(), c("div", oe, [
|
|
224
|
+
O(a.$slots, "filters")
|
|
225
|
+
])) : m("", !0),
|
|
226
|
+
l("div", ne, [
|
|
227
|
+
N.value ? (r(), C(k, {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: o(_.value),
|
|
230
|
+
onClick: J
|
|
231
|
+
}, {
|
|
232
|
+
default: y(() => [
|
|
233
|
+
d(v, {
|
|
234
|
+
icon: "rotate-left",
|
|
235
|
+
class: "w-4 h-4 mr-2"
|
|
236
|
+
}),
|
|
237
|
+
e[9] || (e[9] = w(" Clear Filters ", -1))
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
}, 8, ["class"])) : m("", !0),
|
|
241
|
+
n.showExport ? (r(), C(k, {
|
|
242
|
+
key: 1,
|
|
243
|
+
class: o(z.value),
|
|
244
|
+
onClick: e[4] || (e[4] = (t) => a.$emit("export"))
|
|
245
|
+
}, {
|
|
246
|
+
default: y(() => [
|
|
247
|
+
d(v, {
|
|
248
|
+
icon: "download",
|
|
249
|
+
class: "w-4 h-4 mr-2"
|
|
250
|
+
}),
|
|
251
|
+
e[10] || (e[10] = w(" Export ", -1))
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}, 8, ["class"])) : m("", !0),
|
|
255
|
+
n.showRefresh ? (r(), C(k, {
|
|
256
|
+
key: 2,
|
|
257
|
+
class: o(G.value),
|
|
258
|
+
onClick: e[5] || (e[5] = (t) => a.$emit("refresh"))
|
|
259
|
+
}, {
|
|
260
|
+
default: y(() => [
|
|
261
|
+
d(v, {
|
|
262
|
+
icon: "sync",
|
|
263
|
+
class: "w-4 h-4 mr-2"
|
|
264
|
+
}),
|
|
265
|
+
e[11] || (e[11] = w(" Refresh ", -1))
|
|
266
|
+
]),
|
|
267
|
+
_: 1
|
|
268
|
+
}, 8, ["class"])) : m("", !0)
|
|
269
|
+
])
|
|
270
|
+
], 2),
|
|
271
|
+
F.value.length > 0 ? (r(), c("div", {
|
|
272
|
+
key: 0,
|
|
273
|
+
class: o(I.value)
|
|
274
|
+
}, [
|
|
275
|
+
l("div", ie, [
|
|
276
|
+
l("span", {
|
|
277
|
+
class: o(M.value)
|
|
278
|
+
}, "Active filters:", 2),
|
|
279
|
+
(r(!0), c(D, null, E(F.value, (t) => (r(), c("div", {
|
|
280
|
+
key: t.key,
|
|
281
|
+
class: o(P.value)
|
|
282
|
+
}, [
|
|
283
|
+
d(v, {
|
|
284
|
+
icon: t.icon,
|
|
285
|
+
class: "w-3 h-3"
|
|
286
|
+
}, null, 8, ["icon"]),
|
|
287
|
+
l("span", null, b(t.label) + ": " + b(t.value), 1),
|
|
288
|
+
l("button", {
|
|
289
|
+
class: o(j.value),
|
|
290
|
+
onClick: (de) => K(t.key)
|
|
291
|
+
}, [
|
|
292
|
+
d(v, {
|
|
293
|
+
icon: "circle-xmark",
|
|
294
|
+
class: "w-3 h-3"
|
|
295
|
+
})
|
|
296
|
+
], 10, ue)
|
|
297
|
+
], 2))), 128))
|
|
298
|
+
])
|
|
299
|
+
], 2)) : m("", !0)
|
|
300
|
+
]));
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
export {
|
|
304
|
+
he as default
|
|
305
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../utils/cn.cjs"),$=require("../lib/theme.cjs"),n=require("./Icon.cjs"),Ne=require("./Search.cjs"),Ce=require("./Switch.cjs"),Ve=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),Se={class:"relative flex items-center justify-between h-20 sm:h-18 px-3 sm:px-4 md:px-6"},Be={class:"flex items-center gap-2 sm:gap-3 md:gap-4 min-w-0 flex-1"},Ee=["src"],De={key:2,class:"h-5 sm:h-18 w-px ui-border-strong-bg shrink-0 hidden sm:block"},Le={key:3,class:"shrink-0 ui-surface border ui-border-strong px-2 py-1.5 sm:px-3 sm:py-2 rounded-xl shadow-sm flex items-center gap-2 relative hover:bg-(--ui-surface-muted) transition-colors max-w-52 sm:max-w-72"},Ae={class:"w-8 h-8 rounded-lg ui-surface-muted border ui-border-strong flex items-center justify-center shrink-0"},Te={class:"flex-1 min-w-0"},ze={class:"text-xs sm:text-sm font-semibold ui-text truncate group-hover:text-(--ui-primary) leading-tight"},Me={key:1,class:"min-w-0 flex-1 px-1"},je={class:"text-xs sm:text-sm font-semibold ui-text truncate max-w-[160px] sm:max-w-52 leading-tight"},Ie={key:0,class:"ui-surface absolute top-full left-0 right-0 sm:left-0 sm:right-auto mt-2 w-[min(92vw,24rem)] rounded-2xl border ui-border-strong shadow-2xl z-50 max-h-96 overflow-hidden"},Ue={class:"p-3 sm:p-4 border-b ui-border-strong ui-surface-muted"},Oe={class:"text-sm sm:text-base font-semibold ui-text flex items-center gap-2"},Fe={class:"text-xs ui-text mt-1"},He={class:"py-2 max-h-80 overflow-y-auto"},$e=["onClick"],Re={key:0,class:"shrink-0 mr-2 sm:mr-3"},qe=["src","alt"],Pe={key:1,class:"w-7 h-7 sm:w-8 sm:h-8 rounded-lg bg-linear-to-br from-(--ui-bg) to-(--ui-bg) flex items-center justify-center mr-2 sm:mr-3 shrink-0"},We={class:"flex-1 text-left min-w-0"},Ye={class:"font-semibold truncate text-sm sm:text-md"},Ge={key:0,class:"pointer-events-none absolute left-1/2 -translate-x-1/2"},Qe=["src"],Ze={class:"flex items-center gap-1 sm:gap-2 md:gap-3 pl-2"},Je={key:0,class:"absolute -top-0.5 -right-0.5 sm:-top-1 sm:-right-1 min-w-4 h-4 sm:min-w-[18px] sm:h-[18px] ui-danger-bg ui-text-inverse text-[10px] sm:text-xs rounded-full flex items-center justify-center font-semibold px-0.5 sm:px-1"},Xe={key:0,class:"ui-surface absolute right-2 sm:right-4 md:right-6 top-14 sm:top-16 mt-2 w-[calc(100vw-1rem)] max-w-sm sm:w-80 md:w-96 rounded-2xl border ui-border-strong shadow-2xl z-9999 overflow-hidden"},Ke={class:"p-3 sm:p-4 border-b ui-border-strong ui-surface-muted"},et={class:"text-sm sm:text-base font-semibold ui-text"},tt={key:0,class:"text-xs ui-text mt-1"},ot={class:"max-h-[60vh] sm:max-h-96 overflow-y-auto"},rt={key:0,class:"p-6 sm:p-8 text-center"},st=["onClick"],at={class:"flex items-start space-x-2 sm:space-x-3"},nt={class:"flex-1 min-w-0"},lt={class:"flex items-start justify-between gap-2"},it={class:"text-xs sm:text-md font-semibold ui-text flex-1 leading-tight"},ct={key:0,class:"shrink-0 w-2 h-2 mt-1 ui-primary-bg rounded-full"},ut={key:0,class:"flex items-center gap-1 sm:gap-1.5 mt-1.5 flex-wrap"},dt={class:"inline-flex items-center px-1.5 sm:px-2 py-0.5 rounded text-[10px] sm:text-xs font-semibold ui-accent-soft ui-accent border border-(--ui-accent-soft)"},mt={class:"inline-flex items-center px-1.5 sm:px-2 py-0.5 rounded text-[10px] sm:text-xs font-medium ui-surface-muted ui-text border ui-border-strong"},pt={class:"flex items-center gap-1.5 sm:gap-2 mt-1.5 sm:mt-2 flex-wrap"},ft={key:0,class:"inline-flex items-center px-1.5 sm:px-2 py-0.5 rounded text-[10px] sm:text-xs font-medium ui-primary-soft ui-primary"},ht={class:"truncate max-w-[100px] sm:max-w-none"},yt={class:"text-[10px] sm:text-xs ui-text mt-1.5 sm:mt-2 flex items-center"},gt={key:0,class:"p-2 sm:p-3 text-center border-t ui-border-strong ui-surface-muted"},vt={key:1,class:"w-40 sm:w-52 md:w-64"},xt={class:"relative"},bt=["aria-label"],wt={class:"w-9 h-9 sm:w-10 sm:h-10 bg-linear-to-br from-(--ui-primary-soft) to-(--ui-accent-soft) rounded-full flex items-center justify-center shadow-sm overflow-hidden border ui-border-strong"},kt=["src","alt"],_t={key:1,class:"ui-primary text-sm sm:text-base font-semibold"},Nt={key:0,class:"ui-surface absolute right-0 mt-2 w-56 sm:w-60 rounded-xl border ui-border-strong shadow-xl z-50 overflow-hidden"},Ct={class:"p-3 sm:p-4 border-b ui-border-strong flex items-center gap-3"},Vt={class:"w-10 h-10 shrink-0 bg-linear-to-br from-(--ui-primary-soft) to-(--ui-accent-soft) rounded-full flex items-center justify-center shadow-sm overflow-hidden"},St=["src","alt"],Bt={key:1,class:"ui-primary text-sm font-semibold"},Et={class:"min-w-0"},Dt={class:"text-sm font-semibold ui-text truncate"},Lt={class:"text-xs ui-text truncate"},At={key:0,class:"px-3 py-3 border-b ui-border-strong"},Tt={class:"flex items-center justify-between gap-3"},zt={class:"flex items-center gap-2 min-w-0"},Mt={class:"text-sm font-medium ui-text truncate"},jt={class:"py-2"},It=["onClick"],Ut={class:"flex items-center justify-center w-7 h-7 sm:w-8 sm:h-8 rounded-lg mr-2 sm:mr-3 shrink-0 transition-colors ml-1 sm:ml-2 ui-surface-muted ui-text group-hover:bg-(--ui-bg)"},Ot={class:"flex-1 truncate font-semibold ui-text text-xs sm:text-md"},Ft={class:"border-t ui-border-strong py-2"},Ht={class:"flex items-center justify-center w-7 h-7 sm:w-8 sm:h-8 rounded-lg mr-1 sm:mr-1 shrink-0 transition-colors ml-1 sm:ml-2 ui-danger-soft ui-danger group-hover:bg-(--ui-danger-soft)"},$t={__name:"Header",props:{sidebarWidth:{type:Number,default:256},currentSection:{type:String,default:"Dashboard"},currentPage:{type:String,default:"Overview"},currentRoute:{type:String,default:""},user:{type:Object,required:!0},notifications:{type:Array,default:()=>[]},profileMenuItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentCompany:{type:Object,default:null},companyLogo:{type:String,default:"/logo.png"},currentCompanyLogo:{type:String,default:""},companyLogos:{type:Object,default:()=>({})},companies:{type:Array,default:()=>[]},activeRoles:{type:Array,default:()=>[]},showSearch:{type:Boolean,default:!0},showNotifications:{type:Boolean,default:!0},showBreadcrumb:{type:Boolean,default:!0},showCompanyInfo:{type:Boolean,default:!0},showHeaderLogo:{type:Boolean,default:!0},logoUrl:{type:String,default:"/applogo.png"},headerLogo:{type:String,default:"/logo.png"},companyLogoClass:{type:String,default:"h-16 sm:h-22 md:h-22"},searchPlaceholder:{type:String,default:"Search..."},notificationsTitle:{type:String,default:"Notifications"},companySwitcherTitle:{type:String,default:"Switch Company"},companySwitcherDescription:{type:String,default:"Select a company to view its data"},entityLabel:{type:String,default:"Company"},entityFieldMap:{type:Object,default:()=>({})},showSettings:{type:Boolean,default:!0},settingsLabel:{type:String,default:"Settings"},settingsRoute:{type:[String,Object],default:"/settings"},showThemeSwitcher:{type:Boolean,default:!0},themeSwitcherTitle:{type:String,default:"Appearance"},themeModes:{type:Array,default:()=>["light","dark"]},userInitialsOverride:{type:String,default:""},userRoleDisplayOverride:{type:String,default:""},userAvatarUrl:{type:String,default:""},userAvatarAlt:{type:String,default:""},showUserAvatar:{type:Boolean,default:!0},themeScope:{type:String,default:"default",validator:a=>["default","module"].includes(a)}},emits:["search","profile-action","logout","navigate","toggle-mobile-sidebar","company-change","notification-click","view-all-notifications","theme-change"],setup(a,{emit:R}){const s=a,i=R,C=e.ref(""),m=e.ref(!1),c=e.ref(!1),E=e.ref(!1),p=e.ref(!1),w=e.ref("light"),k=e.ref("/logo.png"),V=e.ref(!1),g=e.computed(()=>s.notifications.filter(t=>!t.read).length),v=e.computed(()=>{const t=(Array.isArray(s.themeModes)?s.themeModes:[]).map(r=>String(r||"").toLowerCase()).filter(r=>r==="light"||r==="dark");return t.length>0?[...new Set(t)]:["light","dark"]}),q=e.computed(()=>v.value.length>1),D=e.computed({get:()=>w.value==="dark",set:t=>{const r=t?"dark":"light";v.value.includes(r)&&be(r)}}),L=e.computed(()=>s.userInitialsOverride?s.userInitialsOverride:(s.user?.name||"Guest").split(" ").map(r=>r[0]||"").join("").toUpperCase()),_=e.computed(()=>s.showUserAvatar&&s.userAvatarUrl||""),A=e.computed(()=>!!_.value&&!V.value),T=e.computed(()=>s.userAvatarAlt||`${s.user?.name||"User"} avatar`),z=()=>{V.value=!0},P=e.computed(()=>String(s.entityLabel||"Company").toLowerCase()),M=e.computed(()=>s.showCompanyInfo),W=e.computed(()=>s.companySwitcherTitle||`Switch ${s.entityLabel||"Company"}`),Y=e.computed(()=>s.companySwitcherDescription||`Select a ${(s.entityLabel||"Company").toLowerCase()} to view its data`),f=e.computed(()=>({id:s.entityFieldMap?.id||"",name:s.entityFieldMap?.name||"",role:s.entityFieldMap?.role||"",type:s.entityFieldMap?.type||"",typeName:s.entityFieldMap?.typeName||""})),j=["company_id","companyId","id"],G=["company_name","companyName","name"],Q=["company_role","companyRole","role"],Z=["company_type","companyType","type"],I=["name","label","title","company_type_name","companyTypeName"],h=(t,r,l=[])=>{if(!t||typeof t!="object")return null;if(r&&t[r]!=null)return t[r];for(const o of l)if(t[o]!=null)return t[o];return null},J=t=>{if(!t||typeof t!="object")return"";const r=h(t,f.value.type,Z);if(typeof r=="string")return r;if(r&&typeof r=="object"){const o=h(r,f.value.typeName,I);if(o!=null)return String(o)}const l=h(t,f.value.typeName,I);return l!=null?String(l):""},U=t=>{if(!t||typeof t!="object")return null;const r=h(t,f.value.id,j),l=h(t,f.value.name,G),o=h(t,f.value.role,Q);return{...t,__id:r,__name:l!=null?String(l):"Unknown",__role:o!=null?String(o):"",__typeName:J(t),__raw:t}},X=e.computed(()=>s.currentCompany),K=e.computed(()=>Array.isArray(s.companies)?s.companies:[]),u=e.computed(()=>U(X.value)),O=e.computed(()=>K.value.map(U).filter(Boolean)),ee=()=>{m.value=!m.value,c.value=!1},te=()=>{c.value=!c.value,m.value=!1,p.value=!1},oe=()=>{p.value=!p.value,c.value=!1,m.value=!1},re=t=>{i("navigate",t),c.value=!1},d=t=>t.route?!!(s.currentRoute===t.route||s.currentRoute.startsWith(t.route+"/")):!1,se=()=>s.themeScope==="module"?"border-b ui-border-strong bg-[color:color-mix(in oklab, var(--module-soft, var(--ui-primary-soft)), transparent 10%)]":"border-b ui-border-strong bg-[color:color-mix(in oklab, var(--module-soft, var(--ui-primary-soft)), transparent 8%)]",ae=t=>t?s.themeScope==="module"?"shadow-sm border":"bg-linear-to-br from-(--ui-primary-soft) to-(--ui-primary-soft) ui-primary shadow-sm border border-(--ui-primary-soft)":"ui-text hover:bg-(--ui-surface-muted) hover:text-(--ui-text) border border-transparent",ne=t=>!t||s.themeScope!=="module"?null:{backgroundColor:"var(--module-soft, var(--ui-primary-soft))",borderColor:"var(--module-border, var(--ui-border-strong))"},le=t=>!t||s.themeScope!=="module"?null:{background:"var(--module-primary, var(--ui-primary))"},ie=t=>t?s.themeScope==="module"?"shadow-md border":"bg-linear-to-br from-(--ui-primary) to-(--ui-primary) ui-text shadow-md":"ui-surface-muted ui-text group-hover:bg-(--ui-bg)",ce=t=>!t||s.themeScope!=="module"?null:{backgroundColor:"var(--module-primary, var(--ui-primary))",color:"var(--ui-text-inverse, #fff)",borderColor:"var(--module-border, var(--ui-border-strong))"},ue=t=>t?s.themeScope==="module"?"font-semibold":"ui-primary":"ui-text",de=t=>!t||s.themeScope!=="module"?null:{color:"var(--module-text, var(--ui-primary))"},me=t=>t?s.themeScope==="module"?"border shadow-sm font-semibold":"bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 25%)] ui-primary border-(--ui-primary-soft)":"ui-text border-transparent hover:bg-(--ui-surface-muted)",pe=t=>!t||s.themeScope!=="module"?null:{backgroundColor:"var(--module-soft, var(--ui-primary-soft))",borderColor:"var(--module-border, var(--ui-border-strong))",color:"var(--module-text, var(--ui-primary))"},fe=t=>!t||s.themeScope!=="module"?null:{color:"var(--module-primary, var(--ui-primary))"},he=t=>{i("profile-action",t),c.value=!1},ye=()=>{i("logout"),c.value=!1},ge=t=>{const r=t?.__raw||t;i("company-change",r),p.value=!1},ve=t=>{i("notification-click",t)},xe=()=>{i("view-all-notifications"),m.value=!1},F=t=>{!t.target.closest(".absolute")&&!t.target.closest("button")&&(m.value=!1,c.value=!1,p.value=!1)},be=t=>{v.value.includes(t)&&(w.value=t,$.setMode(t),i("theme-change",t))},S=()=>{E.value=window.innerWidth<768},we=t=>{if(t.title.includes("Overdue"))return"ui-danger-soft ui-danger";if(t.title.includes("Due in 0"))return"ui-warning-soft ui-warning";const r={due_date_reminder:"ui-warning-soft ui-warning",info:"ui-primary-soft ui-primary",success:"ui-success-soft ui-success",warning:"ui-warning-soft ui-warning",error:"ui-danger-soft ui-danger"};return r[t.type]||r.info},ke=t=>{if(!t)return"";const r=t.split("\\");return r[r.length-1].replace(/([A-Z])/g," $1").trim().split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join(" ")},_e=t=>{if(!t)return"";const r=new Date(t),l=new Date;l.setHours(0,0,0,0);const o=new Date(r);o.setHours(0,0,0,0);const y=o-l,x=Math.ceil(y/(1e3*60*60*24));return x===0?"Due Today":x===1?"Due Tomorrow":x<0?`${Math.abs(x)} days overdue`:x<=7?`Due in ${x} days`:r.toLocaleDateString("en-KE",{month:"short",day:"numeric",year:r.getFullYear()!==l.getFullYear()?"numeric":void 0})},B=t=>{const r=t?.__id??h(t,f.value.id,j);return r==null?null:s.companyLogos[r]||null},N=e.computed(()=>{if(s.currentCompanyLogo)return s.currentCompanyLogo;const t=B(u.value);return t||(s.companyLogo?s.companyLogo:"/logo.png")}),H=t=>{const r="/logo.png",l=t||r;if(l===r||typeof Image>"u"){k.value=r;return}const o=new Image;o.onload=()=>{k.value=l},o.onerror=()=>{k.value=r},o.src=l};return e.onMounted(()=>{document.addEventListener("click",F),S(),window.addEventListener("resize",S);const t=$.getMode()||v.value[0]||"light";w.value=v.value.includes(t)?t:v.value[0],H(N.value)}),e.onUnmounted(()=>{document.removeEventListener("click",F),window.removeEventListener("resize",S)}),e.watch(C,t=>i("search",t)),e.watch(N,t=>{H(t)}),e.watch(_,()=>{V.value=!1}),(t,r)=>{const l=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("header",{class:e.normalizeClass(e.unref(b.cn)("fixed top-0 z-50 w-full backdrop-blur-md transition-all duration-300 ease-out",s.themeScope==="module"&&"kv-module-header",se())),style:{left:"0"}},[e.createElementVNode("div",Se,[e.createElementVNode("div",Be,[E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"p-2 ui-text rounded-lg hover:bg-(--ui-surface-muted) transition-colors shrink-0",onClick:r[0]||(r[0]=o=>i("toggle-mobile-sidebar"))},[e.createVNode(n.default,{icon:"bars",class:"w-5 h-5"})])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(b.cn)("shrink-0 overflow-hidden rounded-2xl flex items-center justify-center",s.companyLogoClass))},[e.createElementVNode("img",{src:k.value,alt:"Company logo",class:"max-w-full max-h-full w-auto h-auto object-contain object-center"},null,8,Ee)],2)):e.createCommentVNode("",!0),N.value&&M.value&&u.value?(e.openBlock(),e.createElementBlock("div",De)):e.createCommentVNode("",!0),M.value&&u.value?(e.openBlock(),e.createElementBlock("div",Le,[O.value.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"flex items-center gap-2 sm:gap-3 w-44 sm:w-60 cursor-pointer rounded-lg px-1.5 py-1 transition-all group",onClick:oe},[e.createElementVNode("div",Ae,[e.createVNode(n.default,{icon:"building",class:"w-4 h-4 ui-primary"})]),e.createElementVNode("div",Te,[e.createElementVNode("p",ze,e.toDisplayString(u.value.__name),1)]),e.createVNode(n.default,{icon:"chevron-down",class:e.normalizeClass(["w-3.5 h-3.5 ui-text-soft shrink-0 group-hover:text-(--ui-primary) transition-transform",{"rotate-180":p.value}])},null,8,["class"])])):(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("p",je,e.toDisplayString(u.value.__name),1)])),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",Ue,[e.createElementVNode("h3",Oe,[e.createVNode(n.default,{icon:"list",class:"w-4 h-4 ui-primary"}),e.createTextVNode(" "+e.toDisplayString(W.value),1)]),e.createElementVNode("p",Fe,e.toDisplayString(Y.value),1)]),e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,o=>(e.openBlock(),e.createElementBlock("button",{key:o.__id||o.__name,class:e.normalizeClass(e.unref(b.cn)("mx-2 flex items-center w-[calc(100%-1rem)] rounded-xl px-3 sm:px-4 py-2.5 text-sm transition-all group border",me(o.__id===u.value?.__id))),style:e.normalizeStyle(pe(o.__id===u.value?.__id)),onClick:y=>ge(o)},[B(o)?(e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("img",{src:B(o),alt:`${o.__name} ${P.value} logo`,class:"w-7 h-7 sm:w-8 sm:h-8 object-contain rounded-lg ui-surface p-0.5 sm:p-1 border ui-border-strong group-hover:border-(--ui-primary-soft) transition-colors",onError:r[1]||(r[1]=y=>{y.target.src="/logo.png"})},null,40,qe)])):(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(n.default,{icon:"building",class:"w-3.5 h-3.5 sm:w-4 sm:h-4 ui-text"})])),e.createElementVNode("div",We,[e.createElementVNode("p",Ye,e.toDisplayString(o.__name),1)]),o.__id===u.value?.__id?(e.openBlock(),e.createBlock(n.default,{key:2,icon:"check-circle",class:"w-4 h-4 sm:w-5 sm:h-5 ui-primary shrink-0 ml-2",style:e.normalizeStyle(fe(o.__id===u.value?.__id))},null,8,["style"])):e.createCommentVNode("",!0)],14,$e))),128))])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)]),a.showHeaderLogo&&(a.logoUrl||a.headerLogo)?(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("img",{src:a.logoUrl||a.headerLogo,alt:"App logo",class:"h-16 sm:h-32 md:h-32 mt-4 w-auto object-contain",onError:r[2]||(r[2]=o=>{o.target.src="/applogo.png"})},null,40,Qe)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ze,[a.showNotifications?(e.openBlock(),e.createElementBlock("button",{key:0,class:"relative p-2 ui-text rounded-xl hover:bg-(--ui-surface-muted) transition-colors",onClick:ee},[e.createVNode(n.default,{icon:"bell",class:"w-5 h-5"}),g.value>0?(e.openBlock(),e.createElementBlock("span",Je,e.toDisplayString(g.value>9?"9+":g.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",Ke,[e.createElementVNode("h3",et,e.toDisplayString(a.notificationsTitle),1),g.value>0?(e.openBlock(),e.createElementBlock("p",tt," You have "+e.toDisplayString(g.value)+" unread notification"+e.toDisplayString(g.value>1?"s":""),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ot,[a.notifications.length===0?(e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(n.default,{icon:"bell",class:"w-10 h-10 sm:w-12 sm:h-12 mx-auto ui-text mb-2"}),r[5]||(r[5]=e.createElementVNode("p",{class:"text-md ui-text"}," No notifications ",-1))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.notifications,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:e.normalizeClass(["p-3 sm:p-4 border-b ui-border-strong hover:bg-(--ui-surface-muted) cursor-pointer transition-colors",o.read?"opacity-60":""]),onClick:y=>ve(o)},[e.createElementVNode("div",at,[e.createElementVNode("div",{class:e.normalizeClass(["shrink-0 w-8 h-8 sm:w-9 sm:h-9 rounded-lg flex items-center justify-center",we(o)])},[o.title.includes("Overdue")?(e.openBlock(),e.createBlock(n.default,{key:0,icon:"exclamation-triangle",class:"w-4 h-4 sm:w-5 sm:h-5"})):o.type==="due_date_reminder"?(e.openBlock(),e.createBlock(n.default,{key:1,icon:"clock",class:"w-4 h-4 sm:w-5 sm:h-5"})):(e.openBlock(),e.createBlock(n.default,{key:2,icon:"bell",class:"w-4 h-4 sm:w-5 sm:h-5"}))],2),e.createElementVNode("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("p",it,e.toDisplayString(o.title),1),o.read?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ct))]),o.source?(e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("span",dt,[e.createVNode(n.default,{icon:"tag",class:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),e.createTextVNode(" "+e.toDisplayString(o.source.body_code),1)]),e.createVNode(n.default,{icon:"chevron-right",class:"w-2.5 h-2.5 sm:w-3 sm:h-3 ui-text hidden xs:block"}),e.createElementVNode("span",mt,e.toDisplayString(o.source.code),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,[o.model?(e.openBlock(),e.createElementBlock("span",ft,[e.createVNode(n.default,{icon:"file",class:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),e.createElementVNode("span",ht,e.toDisplayString(ke(o.model)),1)])):e.createCommentVNode("",!0),o.due_date?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center px-1.5 sm:px-2 py-0.5 rounded text-[10px] sm:text-xs font-medium whitespace-nowrap",o.title.includes("Overdue")?"ui-danger-soft ui-danger border border-(--ui-danger-soft)":(o.title.includes("Due in 0"),"ui-warning-soft ui-warning border border-(--ui-warning-soft)")])},[e.createVNode(n.default,{icon:"calendar",class:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1 shrink-0"}),e.createTextVNode(" "+e.toDisplayString(_e(o.due_date)),1)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("p",yt,[e.createVNode(n.default,{icon:"clock",class:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),e.createTextVNode(" "+e.toDisplayString(o.time),1)])])])],10,st))),128))]),a.notifications.length>0?(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("button",{class:"text-sm font-semibold ui-primary hover:text-(--ui-primary-strong) transition-colors",onClick:xe}," View all notifications → ")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),a.showSearch?(e.openBlock(),e.createElementBlock("div",vt,[e.createVNode(Ne.default,{modelValue:C.value,"onUpdate:modelValue":r[3]||(r[3]=o=>C.value=o),placeholder:a.searchPlaceholder,size:"sm","show-no-results":!1,"min-length":0,debounce:200,results:[]},null,8,["modelValue","placeholder"])])):e.createCommentVNode("",!0),e.createElementVNode("div",xt,[e.createElementVNode("button",{class:"shrink-0 rounded-full transition-transform hover:scale-105 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-primary)","aria-label":`${a.user.name} profile menu`,onClick:te},[e.createElementVNode("div",wt,[A.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:_.value,alt:T.value,class:"w-full h-full object-cover",onError:z},null,40,kt)):(e.openBlock(),e.createElementBlock("span",_t,e.toDisplayString(L.value),1))])],8,bt),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Nt,[e.createElementVNode("div",Ct,[e.createElementVNode("div",Vt,[A.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:_.value,alt:T.value,class:"w-full h-full object-cover",onError:z},null,40,St)):(e.openBlock(),e.createElementBlock("span",Bt,e.toDisplayString(L.value),1))]),e.createElementVNode("div",Et,[e.createElementVNode("p",Dt,e.toDisplayString(a.user.name),1),e.createElementVNode("p",Lt,e.toDisplayString(a.user.email),1)])]),a.showThemeSwitcher?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Tt,[e.createElementVNode("div",zt,[e.createVNode(n.default,{icon:w.value==="dark"?"moon":"sun",class:e.normalizeClass(["w-4 h-4 shrink-0",w.value==="dark"?"ui-primary":"ui-text"])},null,8,["icon","class"]),e.createElementVNode("span",Mt,e.toDisplayString(a.themeSwitcherTitle),1)]),e.createVNode(Ce.default,{modelValue:D.value,"onUpdate:modelValue":r[4]||(r[4]=o=>D.value=o),size:"md",disabled:!q.value},null,8,["modelValue","disabled"])])])):e.createCommentVNode("",!0),e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.profileMenuItems,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.name},[o.route?(e.openBlock(),e.createBlock(l,{key:0,to:o.route,class:e.normalizeClass(e.unref(b.cn)("flex items-center px-2.5 sm:px-3 py-2 sm:py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",ae(d(o)))),style:e.normalizeStyle(ne(d(o))),onClick:y=>re(o)},{default:e.withCtx(()=>[d(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-6 sm:h-8 bg-linear-to-b from-(--ui-primary) to-(--ui-primary) rounded-r-full",style:e.normalizeStyle(le(d(o)))},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(b.cn)("flex items-center justify-center w-7 h-7 sm:w-8 sm:h-8 rounded-lg mr-2 sm:mr-3 shrink-0 transition-colors ml-1 sm:ml-2",ie(d(o)))),style:e.normalizeStyle(ce(d(o)))},[o.icon?(e.openBlock(),e.createBlock(n.default,{key:0,icon:o.icon,class:"w-3.5 h-3.5 sm:w-4 sm:h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],6),e.createElementVNode("span",{class:e.normalizeClass(e.unref(b.cn)("flex-1 truncate font-semibold text-xs sm:text-md",ue(d(o)))),style:e.normalizeStyle(de(d(o)))},e.toDisplayString(o.label),7)]),_:2},1032,["to","class","style","onClick"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"flex items-center w-full px-2.5 sm:px-3 py-2 sm:py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative ui-text hover:bg-(--ui-surface-muted) hover:text-(--ui-text) border border-transparent",onClick:y=>he(o)},[e.createElementVNode("div",Ut,[o.icon?(e.openBlock(),e.createBlock(n.default,{key:0,icon:o.icon,class:"w-3.5 h-3.5 sm:w-4 sm:h-4"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ot,e.toDisplayString(o.label),1)],8,It))],64))),128))]),e.createElementVNode("div",Ft,[e.createElementVNode("button",{class:"flex items-center w-full px-2.5 sm:px-3 py-2 sm:py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative ui-danger hover:bg-(--ui-danger-soft) border border-transparent",onClick:ye},[e.createElementVNode("div",Ht,[e.createVNode(n.default,{icon:"sign-out-alt",class:"w-3.5 h-3.5 sm:w-4 sm:h-4"})]),r[6]||(r[6]=e.createElementVNode("span",{class:"truncate font-semibold ui-danger text-xs sm:text-md"}," Sign out ",-1))])])])):e.createCommentVNode("",!0)]),_:1})])])])],2)}}},Rt=Ve._export_sfc($t,[["__scopeId","data-v-3e4b26b8"]]);exports.default=Rt;
|