@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,243 @@
|
|
|
1
|
+
import { ref as c, computed as C, onMounted as X, onUnmounted as _, watch as L, createElementBlock as i, openBlock as s, mergeProps as F, renderSlot as Q, createElementVNode as d, createBlock as Z, normalizeClass as N, toDisplayString as w, Teleport as j, createCommentVNode as H, normalizeStyle as J, withDirectives as Y, withKeys as ee, withModifiers as b, vModelText as te, Fragment as oe, renderList as le, nextTick as ne } from "vue";
|
|
2
|
+
import { cva as ae } from "class-variance-authority";
|
|
3
|
+
import { cn as P } from "../utils/cn.js";
|
|
4
|
+
const se = ["id", "name", "value", "disabled", "required"], ie = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "relative"
|
|
7
|
+
}, re = ["id", "disabled"], ue = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "ui-text-muted"
|
|
10
|
+
}, de = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "ui-text"
|
|
13
|
+
}, ce = { class: "px-3 py-2 border-b ui-border" }, pe = ["onKeydown"], fe = ["onClick"], ve = { class: "block font-normal truncate" }, me = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "absolute inset-y-0 right-0 flex items-center pr-4 ui-primary"
|
|
16
|
+
}, ye = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "px-4 py-3 text-sm ui-text text-center"
|
|
19
|
+
}, be = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "px-4 py-3"
|
|
22
|
+
}, p = 12, h = 4, R = 320, we = 180, he = 10050, De = {
|
|
23
|
+
__name: "Select",
|
|
24
|
+
props: {
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: [String, Number, Boolean],
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
options: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => []
|
|
32
|
+
},
|
|
33
|
+
placeholder: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: null
|
|
36
|
+
},
|
|
37
|
+
hasError: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
id: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: null
|
|
44
|
+
},
|
|
45
|
+
name: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: null
|
|
48
|
+
},
|
|
49
|
+
disabled: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
required: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
allowCreate: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
class: String
|
|
62
|
+
},
|
|
63
|
+
emits: ["update:modelValue"],
|
|
64
|
+
setup(n, { emit: W }) {
|
|
65
|
+
const o = n, D = W, r = c(!1), a = c(""), E = c(null), v = c(null), g = c(null), u = c([...o.options]), O = c({}), M = C(() => o.options.find((e) => e.value === o.modelValue)), $ = ae(
|
|
66
|
+
"border ui-border-strong rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) text-sm min-w-[60px] focus:border-transparent ",
|
|
67
|
+
{
|
|
68
|
+
variants: {
|
|
69
|
+
disabled: {
|
|
70
|
+
true: "ui-surface-muted cursor-not-allowed opacity-50",
|
|
71
|
+
false: "ui-surface hover:border-(--ui-border-strong)"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
), z = C(
|
|
76
|
+
() => P(
|
|
77
|
+
$({ disabled: o.disabled }),
|
|
78
|
+
"px-3 py-2",
|
|
79
|
+
o.class
|
|
80
|
+
)
|
|
81
|
+
), A = C(
|
|
82
|
+
() => P(
|
|
83
|
+
"w-full px-3 py-2 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) ui-surface ",
|
|
84
|
+
o.hasError ? "border-(--ui-danger)" : "ui-border",
|
|
85
|
+
o.disabled ? "ui-surface-muted cursor-not-allowed opacity-50" : "hover:border-(--ui-border-strong)",
|
|
86
|
+
o.class
|
|
87
|
+
)
|
|
88
|
+
), f = () => {
|
|
89
|
+
if (!v.value || !r.value) return;
|
|
90
|
+
const e = v.value.getBoundingClientRect(), t = window.innerWidth, l = window.innerHeight, m = Math.max(0, l - e.bottom - h - p), I = Math.max(0, e.top - h - p), S = I > m, G = Math.max(
|
|
91
|
+
Math.min(R, S ? I : m),
|
|
92
|
+
Math.min(we, R)
|
|
93
|
+
), U = Math.max(0, t - p * 2), k = Math.min(e.width, U);
|
|
94
|
+
let y = e.left;
|
|
95
|
+
y + k > t - p && (y = t - p - k), y < p && (y = p), O.value = {
|
|
96
|
+
position: "fixed",
|
|
97
|
+
left: `${y}px`,
|
|
98
|
+
width: `${k}px`,
|
|
99
|
+
maxHeight: `${G}px`,
|
|
100
|
+
zIndex: he,
|
|
101
|
+
...S ? { bottom: `${l - e.top + h}px` } : { top: `${e.bottom + h}px` }
|
|
102
|
+
};
|
|
103
|
+
}, T = () => {
|
|
104
|
+
o.disabled || (r.value = !r.value, r.value && (f(), ne(() => {
|
|
105
|
+
E.value?.focus();
|
|
106
|
+
})));
|
|
107
|
+
}, q = (e) => {
|
|
108
|
+
D("update:modelValue", e), r.value = !1, a.value = "", u.value = [...o.options];
|
|
109
|
+
}, V = (e) => {
|
|
110
|
+
if (e && (e.stopPropagation(), e.preventDefault()), o.allowCreate && a.value.trim()) {
|
|
111
|
+
const t = a.value.trim();
|
|
112
|
+
D("update:modelValue", t), r.value = !1, a.value = "", u.value = [...o.options];
|
|
113
|
+
}
|
|
114
|
+
}, K = () => {
|
|
115
|
+
if (!a.value.trim())
|
|
116
|
+
u.value = [...o.options];
|
|
117
|
+
else {
|
|
118
|
+
const e = a.value.toLowerCase();
|
|
119
|
+
u.value = o.options.filter(
|
|
120
|
+
(t) => t.label.toLowerCase().includes(e)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}, x = (e) => {
|
|
124
|
+
e.key === "Escape" ? (r.value = !1, a.value = "", u.value = [...o.options]) : e.key === "Enter" && o.allowCreate && a.value.trim() && u.value.length === 0 && (e.preventDefault(), V(e));
|
|
125
|
+
}, B = (e) => {
|
|
126
|
+
if (!v.value) return;
|
|
127
|
+
const t = e.target, l = g.value && g.value.contains(t), m = v.value.contains(t);
|
|
128
|
+
!l && !m && (r.value = !1, a.value = "", u.value = [...o.options]);
|
|
129
|
+
};
|
|
130
|
+
return X(() => {
|
|
131
|
+
document.addEventListener("click", B), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f);
|
|
132
|
+
}), _(() => {
|
|
133
|
+
document.removeEventListener("click", B), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
134
|
+
}), L(() => o.options, (e) => {
|
|
135
|
+
u.value = [...e];
|
|
136
|
+
}, { immediate: !0 }), L(r, (e) => {
|
|
137
|
+
e && f();
|
|
138
|
+
}), (e, t) => !n.options || n.options.length === 0 ? (s(), i("select", F({
|
|
139
|
+
key: 0,
|
|
140
|
+
id: n.id,
|
|
141
|
+
name: n.name,
|
|
142
|
+
value: n.modelValue,
|
|
143
|
+
disabled: n.disabled,
|
|
144
|
+
required: n.required,
|
|
145
|
+
class: z.value
|
|
146
|
+
}, e.$attrs, {
|
|
147
|
+
onChange: t[0] || (t[0] = (l) => e.$emit("update:modelValue", l.target.value))
|
|
148
|
+
}), [
|
|
149
|
+
Q(e.$slots, "default")
|
|
150
|
+
], 16, se)) : (s(), i("div", ie, [
|
|
151
|
+
d("button", {
|
|
152
|
+
id: n.id,
|
|
153
|
+
ref_key: "buttonRef",
|
|
154
|
+
ref: v,
|
|
155
|
+
type: "button",
|
|
156
|
+
disabled: n.disabled,
|
|
157
|
+
class: N(A.value),
|
|
158
|
+
onClick: T,
|
|
159
|
+
onKeydown: x
|
|
160
|
+
}, [
|
|
161
|
+
M.value ? (s(), i("div", de, w(M.value.label), 1)) : (s(), i("div", ue, w(n.placeholder || "Select an option"), 1)),
|
|
162
|
+
t[4] || (t[4] = d("svg", {
|
|
163
|
+
class: "absolute right-2 top-2.5 h-5 w-5 ui-text",
|
|
164
|
+
fill: "currentColor",
|
|
165
|
+
viewBox: "0 0 20 20"
|
|
166
|
+
}, [
|
|
167
|
+
d("path", {
|
|
168
|
+
"fill-rule": "evenodd",
|
|
169
|
+
d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
|
|
170
|
+
"clip-rule": "evenodd"
|
|
171
|
+
})
|
|
172
|
+
], -1))
|
|
173
|
+
], 42, re),
|
|
174
|
+
(s(), Z(j, { to: "body" }, [
|
|
175
|
+
r.value ? (s(), i("div", {
|
|
176
|
+
key: 0,
|
|
177
|
+
ref_key: "dropdownRef",
|
|
178
|
+
ref: g,
|
|
179
|
+
style: J(O.value),
|
|
180
|
+
"data-select-dropdown": "",
|
|
181
|
+
class: "ui-surface border ui-border-strong shadow-lg rounded-md py-1 text-base overflow-hidden focus:outline-none flex flex-col overscroll-contain"
|
|
182
|
+
}, [
|
|
183
|
+
d("div", ce, [
|
|
184
|
+
Y(d("input", {
|
|
185
|
+
ref_key: "searchInput",
|
|
186
|
+
ref: E,
|
|
187
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => a.value = l),
|
|
188
|
+
type: "text",
|
|
189
|
+
placeholder: "Search options...",
|
|
190
|
+
class: "w-full px-2 py-1 text-sm border ui-border-strong rounded focus:outline-none focus:ring-1 focus:ring-(--ui-primary) ui-surface placeholder:text-(--ui-text-muted)",
|
|
191
|
+
onInput: K,
|
|
192
|
+
onKeydown: [
|
|
193
|
+
x,
|
|
194
|
+
ee(b(x, ["prevent"]), ["enter"])
|
|
195
|
+
]
|
|
196
|
+
}, null, 40, pe), [
|
|
197
|
+
[te, a.value]
|
|
198
|
+
])
|
|
199
|
+
]),
|
|
200
|
+
u.value.length > 0 ? (s(), i("div", {
|
|
201
|
+
key: 0,
|
|
202
|
+
class: "overflow-y-auto flex-1 overscroll-contain",
|
|
203
|
+
onWheel: t[2] || (t[2] = b(() => {
|
|
204
|
+
}, ["stop"]))
|
|
205
|
+
}, [
|
|
206
|
+
(s(!0), i(oe, null, le(u.value, (l) => (s(), i("button", {
|
|
207
|
+
key: l.value,
|
|
208
|
+
type: "button",
|
|
209
|
+
class: N(["cursor-pointer select-none relative py-2 pl-3 pr-9 w-full text-left hover:bg-(--ui-primary-soft) focus:bg-(--ui-primary-soft) focus:outline-none transition-colors duration-150", { "ui-primary-soft ui-primary": n.modelValue === l.value }]),
|
|
210
|
+
onClick: b((m) => q(l.value), ["stop"])
|
|
211
|
+
}, [
|
|
212
|
+
d("span", ve, w(l.label), 1),
|
|
213
|
+
n.modelValue === l.value ? (s(), i("span", me, [...t[5] || (t[5] = [
|
|
214
|
+
d("svg", {
|
|
215
|
+
class: "h-5 w-5",
|
|
216
|
+
fill: "currentColor",
|
|
217
|
+
viewBox: "0 0 20 20"
|
|
218
|
+
}, [
|
|
219
|
+
d("path", {
|
|
220
|
+
"fill-rule": "evenodd",
|
|
221
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
222
|
+
"clip-rule": "evenodd"
|
|
223
|
+
})
|
|
224
|
+
], -1)
|
|
225
|
+
])])) : H("", !0)
|
|
226
|
+
], 10, fe))), 128))
|
|
227
|
+
], 32)) : o.allowCreate ? (s(), i("div", be, [
|
|
228
|
+
d("button", {
|
|
229
|
+
type: "button",
|
|
230
|
+
class: "w-full text-left px-2 py-1 text-sm ui-primary hover:bg-(--ui-primary-soft) rounded cursor-pointer transition-colors",
|
|
231
|
+
onClick: b(V, ["stop"]),
|
|
232
|
+
onMousedown: t[3] || (t[3] = b(() => {
|
|
233
|
+
}, ["prevent"]))
|
|
234
|
+
}, ' Create "' + w(a.value) + '" ', 33)
|
|
235
|
+
])) : (s(), i("div", ye, " No options found "))
|
|
236
|
+
], 4)) : H("", !0)
|
|
237
|
+
]))
|
|
238
|
+
]));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
export {
|
|
242
|
+
De as default
|
|
243
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../utils/cn.cjs"),v=require("./Icon.cjs"),U=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0,class:"flex ui-surface items-center justify-between p-4 border-b ui-border-strong shrink-0 lg:hidden"},Q={class:"text-base font-semibold ui-text"},R={class:"flex-1 overflow-y-auto overflow-x-hidden p-3 sm:p-4"},G={class:"space-y-2"},J={key:0},K={key:0,class:"absolute top-1.5 right-1.5 inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"},X={key:1,class:"relative","data-submenu-dropdown":""},Y=["onClick"],Z={key:0,class:"absolute top-1.5 right-1.5 inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"},ee={key:1,class:"absolute top-1.5 right-1.5 w-2 h-2 ui-primary-bg rounded-full"},te={class:"px-4 py-3 border-b ui-border-strong ui-surface-muted"},oe={class:"text-sm font-semibold ui-text"},re={key:0,class:"px-4 pt-3 pb-2"},ne={class:"relative"},le=["placeholder"],ae={class:"absolute left-3 top-1/2 transform -translate-y-1/2 ui-text-soft"},se={class:"py-2 pb-16 flex-1 min-h-0 overflow-y-auto overscroll-contain"},ue={key:0,class:"px-4 py-6 text-center"},ce={class:"truncate text-xl"},ie={key:0,class:"ml-auto inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"},j=320,de={__name:"Sidebar",props:{sidebarWidth:{type:Number,default:130},header:{type:Object,default:null},navigationItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentPath:{type:String,default:""},showSearch:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search..."},searchableMenus:{type:Array,default:()=>[]},themeScope:{type:String,default:"default",validator:m=>["default","module"].includes(m)}},emits:["navigate","update:mobileOpen","search"],setup(m,{expose:I,emit:O}){const n=m,b=O,a=e.ref(!1),d=e.ref(!1),s=e.ref(null),u=e.ref(""),f=e.computed(()=>n.mobileOpen),k=e.computed(()=>{if(!n.showSearch||!s.value)return!1;const t=s.value.name?.toLowerCase()||"";return n.searchableMenus.some(r=>t.includes(r.toLowerCase()))}),w=e.computed(()=>{if(!s.value?.subItems)return[];if(!u.value.trim())return s.value.subItems;const t=u.value.toLowerCase().trim();return s.value.subItems.filter(r=>{const c=r.label?.toLowerCase()||"",o=r.name?.toLowerCase()||"";return c.includes(t)||o.includes(t)})}),A=e.computed(()=>a.value?0:n.sidebarWidth+(d.value?j:0)),D=e.computed(()=>({left:`${n.sidebarWidth}px`,width:`${j}px`,maxWidth:`calc(100vw - ${n.sidebarWidth}px)`,top:"0px",height:"100vh",...n.themeScope==="module"?{background:"color-mix(in oklab, var(--module-soft-alt, var(--ui-accent-soft)) 50%, var(--ui-surface) 50%)"}:{}})),W=e.computed(()=>({width:`${n.sidebarWidth}px`,top:a.value?"0px":"4rem",...n.themeScope==="module"?{background:"color-mix(in oklab, var(--module-soft, var(--ui-primary-soft)) 45%, var(--ui-background) 55%)"}:{}})),h=t=>{b("navigate",t),a.value&&p();const r=d.value&&s.value&&s.value.subItems.some(c=>c.route===t.route);(a.value||!r)&&y()},p=()=>{b("update:mobileOpen",!1)},S=t=>t.subItems&&t.subItems.length>0,$=t=>typeof t?.route=="string"&&t.route.length>0,q=t=>{if(d.value&&s.value?.name===t.name){x();return}$(t)&&h(t),s.value=t,d.value=!0,u.value=""},x=()=>{d.value=!1,u.value="",s.value=null},y=()=>{x()},P=t=>{h(t)},T=t=>{u.value=t,b("search",{query:t,menu:s.value?.name})},F=()=>{u.value=""},C=t=>{t.target.closest("[data-submenu-dropdown]")||x()},l=t=>{const r=n.currentPath;return t.route?!!(r===t.route||r.startsWith(t.route+"/")):t.subItems&&t.subItems.length>0?t.subItems.some(c=>c.route?r===c.route||r.startsWith(c.route+"/"):!1):!1},_=t=>t?n.themeScope==="module"?"border shadow-sm":"bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 18%)] border border-(--ui-primary-soft) shadow-sm":"ui-text hover:bg-(--ui-surface-muted) border border-transparent",E=t=>!t||n.themeScope!=="module"?null:{backgroundColor:"var(--module-soft, var(--ui-primary-soft))",borderColor:"var(--module-border, var(--ui-border-strong))"},N=t=>t?n.themeScope==="module"?"shadow-sm text-white":"ui-primary-bg shadow-sm":"ui-surface-muted ui-text-soft group-hover:text-(--ui-text) group-hover:bg-(--ui-primary-soft)",B=t=>t?n.themeScope!=="module"?{color:"#ffffff"}:{backgroundColor:"var(--module-primary, var(--ui-primary))",color:"#ffffff",border:"1px solid var(--module-border, var(--ui-border-strong))"}:null,V=t=>t?n.themeScope==="module"?"ui-text font-semibold":"ui-primary font-semibold":"ui-text group-hover:text-(--ui-text)",z=()=>null,g=()=>{const t=a.value;a.value=window.innerWidth<1024,t&&!a.value&&f.value&&p()},M=t=>{t.key==="Escape"&&(d.value?y():a.value&&f.value&&p())};return e.onMounted(()=>{g(),window.addEventListener("resize",g),document.addEventListener("keydown",M),document.addEventListener("click",C)}),e.onUnmounted(()=>{window.removeEventListener("resize",g),document.removeEventListener("keydown",M),document.removeEventListener("click",C)}),I({isMobile:a,isMobileOpen:f,submenuOpen:d,contentMarginLeft:A,closeAllMenus:y}),(t,r)=>{const c=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[f.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 lg:hidden bg-black/30 backdrop-blur-2xs",onClick:p})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("aside",{class:e.normalizeClass(e.unref(i.cn)("fixed left-0 z-40 ui-surface border-r ui-border-strong overflow-visible flex flex-col shadow-xl shadow-black/5","transition-transform duration-300 ease-out",n.themeScope==="module"&&"kv-module-sidebar",a.value?e.unref(i.cn)("transform h-screen",f.value?"translate-x-0":"-translate-x-full"):"translate-x-0 h-[calc(100vh-4rem)]")),style:e.normalizeStyle(W.value)},[a.value?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("h2",Q,e.toDisplayString(m.header?.title),1),e.createElementVNode("button",{class:"p-2 rounded-lg ui-text hover:bg-(--ui-surface-muted) transition-colors","aria-label":"Close sidebar",onClick:p},[...r[2]||(r[2]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("nav",R,[e.createElementVNode("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.navigationItems,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.name||o.label},[o.type==="link"?(e.openBlock(),e.createElementBlock("div",J,[S(o)?(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i.cn)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-3 px-2.5",_(l(o)))),style:e.normalizeStyle(E(l(o))),onClick:L=>q(o)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i.cn)("flex items-center justify-center rounded-lg transition-colors mb-2","w-10 h-10",N(l(o)))),style:e.normalizeStyle(B(l(o)))},[e.createVNode(v.default,{icon:o.icon,class:"w-5 h-5",style:e.normalizeStyle(l(o)?{color:"#ffffff"}:null)},null,8,["icon","style"])],6),e.createElementVNode("span",{class:e.normalizeClass(e.unref(i.cn)("text-[11px] leading-tight font-medium text-center",V(l(o)))),style:e.normalizeStyle(z(l(o)))},e.toDisplayString(o.label),7),o.badge?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(o.badge),1)):e.createCommentVNode("",!0),l(o)&&S(o)?(e.openBlock(),e.createElementBlock("div",ee)):e.createCommentVNode("",!0)],14,Y)])):(e.openBlock(),e.createBlock(c,{key:0,to:o.route,class:e.normalizeClass(e.unref(i.cn)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-3 px-2.5",_(l(o)))),style:e.normalizeStyle(E(l(o))),onClick:L=>h(o)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i.cn)("flex items-center justify-center rounded-lg transition-colors mb-2","w-10 h-10",N(l(o)))),style:e.normalizeStyle(B(l(o)))},[e.createVNode(v.default,{icon:o.icon,class:"w-5 h-5",style:e.normalizeStyle(l(o)?{color:"#ffffff"}:null)},null,8,["icon","style"])],6),e.createElementVNode("span",{class:e.normalizeClass(e.unref(i.cn)("text-[11px] leading-tight font-medium text-center",V(l(o)))),style:e.normalizeStyle(z(l(o)))},e.toDisplayString(o.label),7),o.badge?(e.openBlock(),e.createElementBlock("span",K,e.toDisplayString(o.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","style","onClick"]))])):e.createCommentVNode("",!0)],64))),128))])]),e.createVNode(e.Transition,{"enter-active-class":"transition-transform duration-250 ease-out","leave-active-class":"transition-transform duration-200 ease-in","enter-from-class":"-translate-x-full","enter-to-class":"translate-x-0","leave-from-class":"translate-x-0","leave-to-class":"-translate-x-full"},{default:e.withCtx(()=>[d.value&&s.value&&(!a.value||f.value)?(e.openBlock(),e.createElementBlock("div",{key:0,"data-submenu-dropdown":"",class:e.normalizeClass(e.unref(i.cn)("ui-surface border ui-border-strong shadow-2xl overflow-hidden z-50 fixed border-l rounded-none flex flex-col min-h-0")),style:e.normalizeStyle(D.value)},[e.createElementVNode("div",te,[e.createElementVNode("p",oe,e.toDisplayString(s.value.label),1)]),k.value?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",ne,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=o=>u.value=o),type:"text",placeholder:m.searchPlaceholder,class:"w-full px-3 py-2 pl-9 pr-9 text-sm border ui-border-strong rounded-xl focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent transition-all ui-bg",onInput:r[1]||(r[1]=o=>T(u.value))},null,40,le),[[e.vModelText,u.value]]),e.createElementVNode("div",ae,[e.createVNode(v.default,{icon:"search",class:"w-4 h-4"})]),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute right-2 top-1/2 transform -translate-y-1/2 ui-text-soft hover:text-(--ui-text) transition-colors p-1",onClick:F},[e.createVNode(v.default,{icon:"times",class:"w-4 h-4"})])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("nav",se,[k.value&&u.value&&w.value.length===0?(e.openBlock(),e.createElementBlock("div",ue,[...r[3]||(r[3]=[e.createElementVNode("p",{class:"text-sm ui-text"}," No results found ",-1)])])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(w.value,o=>(e.openBlock(),e.createBlock(c,{key:o.name,to:o.route,class:e.normalizeClass(e.unref(i.cn)("mx-2 flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",l(o)?"bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 22%)] ui-primary":"ui-text hover:bg-(--ui-surface-muted)")),onClick:L=>P(o)},{default:e.withCtx(()=>[e.createVNode(v.default,{icon:o.icon||"circle",size:"xl"},null,8,["icon"]),e.createElementVNode("span",ce,e.toDisplayString(o.label),1),o.badge?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(o.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))),128))])],6)):e.createCommentVNode("",!0)]),_:1})],6)])}}},me=U._export_sfc(de,[["__scopeId","data-v-82c80c9a"]]);exports.default=me;
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { ref as C, computed as w, onMounted as ne, onUnmounted as le, resolveComponent as ae, createElementBlock as a, openBlock as s, createVNode as y, createElementVNode as o, Transition as Q, withCtx as M, createCommentVNode as f, normalizeStyle as v, normalizeClass as b, unref as p, toDisplayString as x, Fragment as O, renderList as R, createBlock as G, withDirectives as ue, vModelText as ie } from "vue";
|
|
2
|
+
import { cn as m } from "../utils/cn.js";
|
|
3
|
+
import S from "./Icon.js";
|
|
4
|
+
import { _ as ce } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const de = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex ui-surface items-center justify-between p-4 border-b ui-border-strong shrink-0 lg:hidden"
|
|
8
|
+
}, fe = { class: "text-base font-semibold ui-text" }, ve = { class: "flex-1 overflow-y-auto overflow-x-hidden p-3 sm:p-4" }, pe = { class: "space-y-2" }, me = { key: 0 }, be = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "absolute top-1.5 right-1.5 inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"
|
|
11
|
+
}, he = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "relative",
|
|
14
|
+
"data-submenu-dropdown": ""
|
|
15
|
+
}, xe = ["onClick"], ye = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "absolute top-1.5 right-1.5 inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"
|
|
18
|
+
}, ge = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "absolute top-1.5 right-1.5 w-2 h-2 ui-primary-bg rounded-full"
|
|
21
|
+
}, ke = { class: "px-4 py-3 border-b ui-border-strong ui-surface-muted" }, we = { class: "text-sm font-semibold ui-text" }, _e = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "px-4 pt-3 pb-2"
|
|
24
|
+
}, Se = { class: "relative" }, Ce = ["placeholder"], Me = { class: "absolute left-3 top-1/2 transform -translate-y-1/2 ui-text-soft" }, Le = { class: "py-2 pb-16 flex-1 min-h-0 overflow-y-auto overscroll-contain" }, je = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "px-4 py-6 text-center"
|
|
27
|
+
}, Ae = { class: "truncate text-xl" }, Ee = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "ml-auto inline-flex items-center justify-center min-w-5 h-5 px-1 text-[10px] font-bold rounded-full ui-danger-bg ui-text-inverse"
|
|
30
|
+
}, H = 320, Ie = {
|
|
31
|
+
__name: "Sidebar",
|
|
32
|
+
props: {
|
|
33
|
+
sidebarWidth: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 130
|
|
36
|
+
},
|
|
37
|
+
header: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
navigationItems: {
|
|
42
|
+
type: Array,
|
|
43
|
+
required: !0
|
|
44
|
+
},
|
|
45
|
+
mobileOpen: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
currentPath: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
// Search props
|
|
54
|
+
showSearch: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
searchPlaceholder: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "Search..."
|
|
61
|
+
},
|
|
62
|
+
searchableMenus: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: () => []
|
|
65
|
+
// Array of menu names that should have search (e.g., ['compliance', 'risks'])
|
|
66
|
+
},
|
|
67
|
+
themeScope: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "default",
|
|
70
|
+
validator: (g) => ["default", "module"].includes(g)
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
emits: [
|
|
74
|
+
"navigate",
|
|
75
|
+
"update:mobileOpen",
|
|
76
|
+
"search"
|
|
77
|
+
],
|
|
78
|
+
setup(g, { expose: J, emit: K }) {
|
|
79
|
+
const n = g, L = K, u = C(!1), h = C(!1), i = C(null), c = C(""), k = w(() => n.mobileOpen), W = w(() => {
|
|
80
|
+
if (!n.showSearch || !i.value) return !1;
|
|
81
|
+
const e = i.value.name?.toLowerCase() || "";
|
|
82
|
+
return n.searchableMenus.some(
|
|
83
|
+
(r) => e.includes(r.toLowerCase())
|
|
84
|
+
);
|
|
85
|
+
}), N = w(() => {
|
|
86
|
+
if (!i.value?.subItems) return [];
|
|
87
|
+
if (!c.value.trim())
|
|
88
|
+
return i.value.subItems;
|
|
89
|
+
const e = c.value.toLowerCase().trim();
|
|
90
|
+
return i.value.subItems.filter((r) => {
|
|
91
|
+
const d = r.label?.toLowerCase() || "", t = r.name?.toLowerCase() || "";
|
|
92
|
+
return d.includes(e) || t.includes(e);
|
|
93
|
+
});
|
|
94
|
+
}), X = w(() => u.value ? 0 : n.sidebarWidth + (h.value ? H : 0)), Y = w(() => ({
|
|
95
|
+
left: `${n.sidebarWidth}px`,
|
|
96
|
+
width: `${H}px`,
|
|
97
|
+
maxWidth: `calc(100vw - ${n.sidebarWidth}px)`,
|
|
98
|
+
top: "0px",
|
|
99
|
+
height: "100vh",
|
|
100
|
+
...n.themeScope === "module" ? {
|
|
101
|
+
background: "color-mix(in oklab, var(--module-soft-alt, var(--ui-accent-soft)) 50%, var(--ui-surface) 50%)"
|
|
102
|
+
} : {}
|
|
103
|
+
})), Z = w(() => ({
|
|
104
|
+
width: `${n.sidebarWidth}px`,
|
|
105
|
+
top: u.value ? "0px" : "4rem",
|
|
106
|
+
...n.themeScope === "module" ? {
|
|
107
|
+
background: "color-mix(in oklab, var(--module-soft, var(--ui-primary-soft)) 45%, var(--ui-background) 55%)"
|
|
108
|
+
} : {}
|
|
109
|
+
})), j = (e) => {
|
|
110
|
+
L("navigate", e), u.value && _();
|
|
111
|
+
const r = h.value && i.value && i.value.subItems.some((d) => d.route === e.route);
|
|
112
|
+
(u.value || !r) && E();
|
|
113
|
+
}, _ = () => {
|
|
114
|
+
L("update:mobileOpen", !1);
|
|
115
|
+
}, $ = (e) => e.subItems && e.subItems.length > 0, ee = (e) => typeof e?.route == "string" && e.route.length > 0, te = (e) => {
|
|
116
|
+
if (h.value && i.value?.name === e.name) {
|
|
117
|
+
A();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
ee(e) && j(e), i.value = e, h.value = !0, c.value = "";
|
|
121
|
+
}, A = () => {
|
|
122
|
+
h.value = !1, c.value = "", i.value = null;
|
|
123
|
+
}, E = () => {
|
|
124
|
+
A();
|
|
125
|
+
}, re = (e) => {
|
|
126
|
+
j(e);
|
|
127
|
+
}, oe = (e) => {
|
|
128
|
+
c.value = e, L("search", { query: e, menu: i.value?.name });
|
|
129
|
+
}, se = () => {
|
|
130
|
+
c.value = "";
|
|
131
|
+
}, z = (e) => {
|
|
132
|
+
e.target.closest("[data-submenu-dropdown]") || A();
|
|
133
|
+
}, l = (e) => {
|
|
134
|
+
const r = n.currentPath;
|
|
135
|
+
return e.route ? !!(r === e.route || r.startsWith(e.route + "/")) : e.subItems && e.subItems.length > 0 ? e.subItems.some((d) => d.route ? r === d.route || r.startsWith(d.route + "/") : !1) : !1;
|
|
136
|
+
}, B = (e) => e ? n.themeScope === "module" ? "border shadow-sm" : "bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 18%)] border border-(--ui-primary-soft) shadow-sm" : "ui-text hover:bg-(--ui-surface-muted) border border-transparent", P = (e) => !e || n.themeScope !== "module" ? null : {
|
|
137
|
+
backgroundColor: "var(--module-soft, var(--ui-primary-soft))",
|
|
138
|
+
borderColor: "var(--module-border, var(--ui-border-strong))"
|
|
139
|
+
}, T = (e) => e ? n.themeScope === "module" ? "shadow-sm text-white" : "ui-primary-bg shadow-sm" : "ui-surface-muted ui-text-soft group-hover:text-(--ui-text) group-hover:bg-(--ui-primary-soft)", V = (e) => e ? n.themeScope !== "module" ? {
|
|
140
|
+
color: "#ffffff"
|
|
141
|
+
} : {
|
|
142
|
+
backgroundColor: "var(--module-primary, var(--ui-primary))",
|
|
143
|
+
color: "#ffffff",
|
|
144
|
+
border: "1px solid var(--module-border, var(--ui-border-strong))"
|
|
145
|
+
} : null, q = (e) => e ? n.themeScope === "module" ? "ui-text font-semibold" : "ui-primary font-semibold" : "ui-text group-hover:text-(--ui-text)", D = () => null, I = () => {
|
|
146
|
+
const e = u.value;
|
|
147
|
+
u.value = window.innerWidth < 1024, e && !u.value && k.value && _();
|
|
148
|
+
}, U = (e) => {
|
|
149
|
+
e.key === "Escape" && (h.value ? E() : u.value && k.value && _());
|
|
150
|
+
};
|
|
151
|
+
return ne(() => {
|
|
152
|
+
I(), window.addEventListener("resize", I), document.addEventListener("keydown", U), document.addEventListener("click", z);
|
|
153
|
+
}), le(() => {
|
|
154
|
+
window.removeEventListener("resize", I), document.removeEventListener("keydown", U), document.removeEventListener("click", z);
|
|
155
|
+
}), J({
|
|
156
|
+
isMobile: u,
|
|
157
|
+
isMobileOpen: k,
|
|
158
|
+
submenuOpen: h,
|
|
159
|
+
contentMarginLeft: X,
|
|
160
|
+
closeAllMenus: E
|
|
161
|
+
}), (e, r) => {
|
|
162
|
+
const d = ae("router-link");
|
|
163
|
+
return s(), a("div", null, [
|
|
164
|
+
y(Q, {
|
|
165
|
+
"enter-active-class": "transition-opacity duration-300",
|
|
166
|
+
"leave-active-class": "transition-opacity duration-300",
|
|
167
|
+
"enter-from-class": "opacity-0",
|
|
168
|
+
"enter-to-class": "opacity-100",
|
|
169
|
+
"leave-from-class": "opacity-100",
|
|
170
|
+
"leave-to-class": "opacity-0"
|
|
171
|
+
}, {
|
|
172
|
+
default: M(() => [
|
|
173
|
+
k.value && u.value ? (s(), a("div", {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "fixed inset-0 z-30 lg:hidden bg-black/30 backdrop-blur-2xs",
|
|
176
|
+
onClick: _
|
|
177
|
+
})) : f("", !0)
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
}),
|
|
181
|
+
o("aside", {
|
|
182
|
+
class: b(p(m)(
|
|
183
|
+
"fixed left-0 z-40 ui-surface border-r ui-border-strong overflow-visible flex flex-col shadow-xl shadow-black/5",
|
|
184
|
+
"transition-transform duration-300 ease-out",
|
|
185
|
+
n.themeScope === "module" && "kv-module-sidebar",
|
|
186
|
+
u.value ? p(m)("transform h-screen", k.value ? "translate-x-0" : "-translate-x-full") : "translate-x-0 h-[calc(100vh-4rem)]"
|
|
187
|
+
)),
|
|
188
|
+
style: v(Z.value)
|
|
189
|
+
}, [
|
|
190
|
+
u.value ? (s(), a("div", de, [
|
|
191
|
+
o("h2", fe, x(g.header?.title), 1),
|
|
192
|
+
o("button", {
|
|
193
|
+
class: "p-2 rounded-lg ui-text hover:bg-(--ui-surface-muted) transition-colors",
|
|
194
|
+
"aria-label": "Close sidebar",
|
|
195
|
+
onClick: _
|
|
196
|
+
}, [...r[2] || (r[2] = [
|
|
197
|
+
o("svg", {
|
|
198
|
+
class: "w-5 h-5",
|
|
199
|
+
fill: "none",
|
|
200
|
+
stroke: "currentColor",
|
|
201
|
+
viewBox: "0 0 24 24"
|
|
202
|
+
}, [
|
|
203
|
+
o("path", {
|
|
204
|
+
"stroke-linecap": "round",
|
|
205
|
+
"stroke-linejoin": "round",
|
|
206
|
+
"stroke-width": "2",
|
|
207
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
208
|
+
})
|
|
209
|
+
], -1)
|
|
210
|
+
])])
|
|
211
|
+
])) : f("", !0),
|
|
212
|
+
o("nav", ve, [
|
|
213
|
+
o("div", pe, [
|
|
214
|
+
(s(!0), a(O, null, R(g.navigationItems, (t) => (s(), a(O, {
|
|
215
|
+
key: t.name || t.label
|
|
216
|
+
}, [
|
|
217
|
+
t.type === "link" ? (s(), a("div", me, [
|
|
218
|
+
$(t) ? (s(), a("div", he, [
|
|
219
|
+
o("div", {
|
|
220
|
+
class: b(p(m)(
|
|
221
|
+
"flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-3 px-2.5",
|
|
222
|
+
B(l(t))
|
|
223
|
+
)),
|
|
224
|
+
style: v(P(l(t))),
|
|
225
|
+
onClick: (F) => te(t)
|
|
226
|
+
}, [
|
|
227
|
+
o("div", {
|
|
228
|
+
class: b(p(m)(
|
|
229
|
+
"flex items-center justify-center rounded-lg transition-colors mb-2",
|
|
230
|
+
"w-10 h-10",
|
|
231
|
+
T(l(t))
|
|
232
|
+
)),
|
|
233
|
+
style: v(V(l(t)))
|
|
234
|
+
}, [
|
|
235
|
+
y(S, {
|
|
236
|
+
icon: t.icon,
|
|
237
|
+
class: "w-5 h-5",
|
|
238
|
+
style: v(l(t) ? { color: "#ffffff" } : null)
|
|
239
|
+
}, null, 8, ["icon", "style"])
|
|
240
|
+
], 6),
|
|
241
|
+
o("span", {
|
|
242
|
+
class: b(p(m)(
|
|
243
|
+
"text-[11px] leading-tight font-medium text-center",
|
|
244
|
+
q(l(t))
|
|
245
|
+
)),
|
|
246
|
+
style: v(D(l(t)))
|
|
247
|
+
}, x(t.label), 7),
|
|
248
|
+
t.badge ? (s(), a("span", ye, x(t.badge), 1)) : f("", !0),
|
|
249
|
+
l(t) && $(t) ? (s(), a("div", ge)) : f("", !0)
|
|
250
|
+
], 14, xe)
|
|
251
|
+
])) : (s(), G(d, {
|
|
252
|
+
key: 0,
|
|
253
|
+
to: t.route,
|
|
254
|
+
class: b(p(m)(
|
|
255
|
+
"flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-3 px-2.5",
|
|
256
|
+
B(l(t))
|
|
257
|
+
)),
|
|
258
|
+
style: v(P(l(t))),
|
|
259
|
+
onClick: (F) => j(t)
|
|
260
|
+
}, {
|
|
261
|
+
default: M(() => [
|
|
262
|
+
o("div", {
|
|
263
|
+
class: b(p(m)(
|
|
264
|
+
"flex items-center justify-center rounded-lg transition-colors mb-2",
|
|
265
|
+
"w-10 h-10",
|
|
266
|
+
T(l(t))
|
|
267
|
+
)),
|
|
268
|
+
style: v(V(l(t)))
|
|
269
|
+
}, [
|
|
270
|
+
y(S, {
|
|
271
|
+
icon: t.icon,
|
|
272
|
+
class: "w-5 h-5",
|
|
273
|
+
style: v(l(t) ? { color: "#ffffff" } : null)
|
|
274
|
+
}, null, 8, ["icon", "style"])
|
|
275
|
+
], 6),
|
|
276
|
+
o("span", {
|
|
277
|
+
class: b(p(m)(
|
|
278
|
+
"text-[11px] leading-tight font-medium text-center",
|
|
279
|
+
q(l(t))
|
|
280
|
+
)),
|
|
281
|
+
style: v(D(l(t)))
|
|
282
|
+
}, x(t.label), 7),
|
|
283
|
+
t.badge ? (s(), a("span", be, x(t.badge), 1)) : f("", !0)
|
|
284
|
+
]),
|
|
285
|
+
_: 2
|
|
286
|
+
}, 1032, ["to", "class", "style", "onClick"]))
|
|
287
|
+
])) : f("", !0)
|
|
288
|
+
], 64))), 128))
|
|
289
|
+
])
|
|
290
|
+
]),
|
|
291
|
+
y(Q, {
|
|
292
|
+
"enter-active-class": "transition-transform duration-250 ease-out",
|
|
293
|
+
"leave-active-class": "transition-transform duration-200 ease-in",
|
|
294
|
+
"enter-from-class": "-translate-x-full",
|
|
295
|
+
"enter-to-class": "translate-x-0",
|
|
296
|
+
"leave-from-class": "translate-x-0",
|
|
297
|
+
"leave-to-class": "-translate-x-full"
|
|
298
|
+
}, {
|
|
299
|
+
default: M(() => [
|
|
300
|
+
h.value && i.value && (!u.value || k.value) ? (s(), a("div", {
|
|
301
|
+
key: 0,
|
|
302
|
+
"data-submenu-dropdown": "",
|
|
303
|
+
class: b(p(m)("ui-surface border ui-border-strong shadow-2xl overflow-hidden z-50 fixed border-l rounded-none flex flex-col min-h-0")),
|
|
304
|
+
style: v(Y.value)
|
|
305
|
+
}, [
|
|
306
|
+
o("div", ke, [
|
|
307
|
+
o("p", we, x(i.value.label), 1)
|
|
308
|
+
]),
|
|
309
|
+
W.value ? (s(), a("div", _e, [
|
|
310
|
+
o("div", Se, [
|
|
311
|
+
ue(o("input", {
|
|
312
|
+
"onUpdate:modelValue": r[0] || (r[0] = (t) => c.value = t),
|
|
313
|
+
type: "text",
|
|
314
|
+
placeholder: g.searchPlaceholder,
|
|
315
|
+
class: "w-full px-3 py-2 pl-9 pr-9 text-sm border ui-border-strong rounded-xl focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent transition-all ui-bg",
|
|
316
|
+
onInput: r[1] || (r[1] = (t) => oe(c.value))
|
|
317
|
+
}, null, 40, Ce), [
|
|
318
|
+
[ie, c.value]
|
|
319
|
+
]),
|
|
320
|
+
o("div", Me, [
|
|
321
|
+
y(S, {
|
|
322
|
+
icon: "search",
|
|
323
|
+
class: "w-4 h-4"
|
|
324
|
+
})
|
|
325
|
+
]),
|
|
326
|
+
c.value ? (s(), a("button", {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "absolute right-2 top-1/2 transform -translate-y-1/2 ui-text-soft hover:text-(--ui-text) transition-colors p-1",
|
|
329
|
+
onClick: se
|
|
330
|
+
}, [
|
|
331
|
+
y(S, {
|
|
332
|
+
icon: "times",
|
|
333
|
+
class: "w-4 h-4"
|
|
334
|
+
})
|
|
335
|
+
])) : f("", !0)
|
|
336
|
+
])
|
|
337
|
+
])) : f("", !0),
|
|
338
|
+
o("nav", Le, [
|
|
339
|
+
W.value && c.value && N.value.length === 0 ? (s(), a("div", je, [...r[3] || (r[3] = [
|
|
340
|
+
o("p", { class: "text-sm ui-text" }, " No results found ", -1)
|
|
341
|
+
])])) : (s(!0), a(O, { key: 1 }, R(N.value, (t) => (s(), G(d, {
|
|
342
|
+
key: t.name,
|
|
343
|
+
to: t.route,
|
|
344
|
+
class: b(p(m)(
|
|
345
|
+
"mx-2 flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",
|
|
346
|
+
l(t) ? "bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 22%)] ui-primary" : "ui-text hover:bg-(--ui-surface-muted)"
|
|
347
|
+
)),
|
|
348
|
+
onClick: (F) => re(t)
|
|
349
|
+
}, {
|
|
350
|
+
default: M(() => [
|
|
351
|
+
y(S, {
|
|
352
|
+
icon: t.icon || "circle",
|
|
353
|
+
size: "xl"
|
|
354
|
+
}, null, 8, ["icon"]),
|
|
355
|
+
o("span", Ae, x(t.label), 1),
|
|
356
|
+
t.badge ? (s(), a("span", Ee, x(t.badge), 1)) : f("", !0)
|
|
357
|
+
]),
|
|
358
|
+
_: 2
|
|
359
|
+
}, 1032, ["to", "class", "onClick"]))), 128))
|
|
360
|
+
])
|
|
361
|
+
], 6)) : f("", !0)
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
})
|
|
365
|
+
], 6)
|
|
366
|
+
]);
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
}, ze = /* @__PURE__ */ ce(Ie, [["__scopeId", "data-v-82c80c9a"]]);
|
|
370
|
+
export {
|
|
371
|
+
ze as default
|
|
372
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c={class:"w-full"},d=["min","max","step","value"],N={class:"flex justify-between text-xs ui-text mt-1"},p={__name:"Slider",props:{modelValue:{type:[Number,String],default:0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1}},emits:["update:modelValue"],setup(t,{emit:m}){const r=t,i=m,o=e.computed(()=>{const l=Number(r.modelValue),a=Number(r.min),n=Number(r.max);if(Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(n)||n<=a)return"var(--ui-primary)";const u=(Math.min(Math.max(l,a),n)-a)/(n-a);return u<=.2?"#16a34a":u<=.4?"#65a30d":u<=.6?"#eab308":u<=.8?"#f97316":"#dc2626"}),s=l=>{i("update:modelValue",Number(l.target.value))};return(l,a)=>(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("input",{type:"range",min:t.min,max:t.max,step:t.step,value:t.modelValue,class:"w-full cursor-pointer",style:e.normalizeStyle({accentColor:o.value}),onInput:s},null,44,d),e.createElementVNode("div",N,[e.createElementVNode("span",null,e.toDisplayString(t.min),1),e.createElementVNode("span",null,e.toDisplayString(t.modelValue),1),e.createElementVNode("span",null,e.toDisplayString(t.max),1)])]))}};exports.default=p;
|