@oneb/ui-vue 0.0.52 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OneBrowserMenu-29074956.js +527 -0
- package/dist/OneBrowserMenu-8223b11f.cjs +1 -0
- package/dist/button/OneButton.vue.d.ts +2 -0
- package/dist/button/SpinnerIcon.vue.d.ts +2 -0
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/util.d.ts +2 -0
- package/dist/card/OneCard.vue.d.ts +2 -0
- package/dist/card/OneCardBody.vue.d.ts +2 -0
- package/dist/card/OneCardFooter.vue.d.ts +2 -0
- package/dist/card/OneCardHeader.vue.d.ts +2 -0
- package/dist/common/OneAvatar.vue.d.ts +2 -0
- package/dist/dropdown/OneBrowserMenu.vue.d.ts +2 -0
- package/dist/dropdown/OneBrowserMenuGrid.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdown.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdownDivider.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdownItem.vue.d.ts +2 -0
- package/dist/dropdown/OneUserMenu.vue.d.ts +2 -0
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.d.ts +1 -0
- package/dist/dropdown/index.js +110 -13
- package/dist/dropdown/menu.d.ts +15 -1
- package/dist/form/OneForm.vue.d.ts +2 -0
- package/dist/form/OneFormFeedback.vue.d.ts +2 -0
- package/dist/form/OneFormField.vue.d.ts +2 -0
- package/dist/form/OneFormInput.vue.d.ts +2 -0
- package/dist/form/OneFormLabel.vue.d.ts +2 -0
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +125 -125
- package/dist/{index-f136b5ea.js → index-72d69e4e.js} +51 -51
- package/dist/index-e804f148.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +18 -17
- package/dist/layout/IconOneb.vue.d.ts +2 -0
- package/dist/layout/OneMainLayout.vue.d.ts +2 -0
- package/dist/layout/OneSidebar.vue.d.ts +2 -0
- package/dist/layout/OneSidebarLink.vue.d.ts +2 -0
- package/dist/layout/index.cjs +5 -1
- package/dist/layout/index.js +455 -237
- package/dist/layout/layout.d.ts +71 -11
- package/dist/style.css +1 -1
- package/dist/tailwind.config.cjs +1 -1
- package/dist/tailwind.config.js +1 -1
- package/package.json +1 -1
- package/dist/OneBrowserMenu.vue_vue_type_script_setup_true_lang-2815cdad.cjs +0 -1
- package/dist/OneBrowserMenu.vue_vue_type_script_setup_true_lang-eac975c7.js +0 -438
- package/dist/index-3615f53c.cjs +0 -1
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import { defineComponent as k, ref as x, provide as P, computed as w, openBlock as o, createElementBlock as i, renderSlot as B, normalizeProps as M, guardReactiveProps as I, createCommentVNode as g, createVNode as v, Transition as D, withCtx as A, normalizeClass as b, toDisplayString as h, inject as V, withModifiers as E, createBlock as $, resolveDynamicComponent as N, createElementVNode as e, Fragment as S, renderList as z, mergeProps as q, unref as O, createTextVNode as H, pushScopeId as R, popScopeId as W } from "vue";
|
|
2
|
+
import { OneAvatar as _ } from "./common/index.js";
|
|
3
|
+
import { r as U } from "./XMarkIcon-51ef0691.js";
|
|
4
|
+
import { _ as G } from "./index-72d69e4e.js";
|
|
5
|
+
import { _ as J } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
|
+
const K = {
|
|
7
|
+
title: {
|
|
8
|
+
type: String
|
|
9
|
+
},
|
|
10
|
+
stick: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "right"
|
|
13
|
+
}
|
|
14
|
+
}, Q = {
|
|
15
|
+
variant: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "primary"
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
type: String
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
type: [Function, Object]
|
|
24
|
+
}
|
|
25
|
+
}, X = ["data-opened"], Y = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
28
|
+
}, Z = /* @__PURE__ */ k({
|
|
29
|
+
__name: "OneDropdown",
|
|
30
|
+
props: K,
|
|
31
|
+
emits: ["open", "close"],
|
|
32
|
+
setup(u, { emit: a }) {
|
|
33
|
+
const p = x(!1), l = x(null), d = a, n = u, c = () => {
|
|
34
|
+
p.value = !p.value, p.value ? d("open") : d("close");
|
|
35
|
+
};
|
|
36
|
+
P("OneDropdown", {
|
|
37
|
+
onToggle: c
|
|
38
|
+
});
|
|
39
|
+
const t = w(() => {
|
|
40
|
+
const s = l.value != null && l.value.offsetLeft < 270;
|
|
41
|
+
return l.value != null && l.value.offsetTop + 270 > window.innerHeight ? "up" + (s ? "-right" : "-left") : "down" + (s ? "-right" : "-left");
|
|
42
|
+
}), m = w(() => {
|
|
43
|
+
const s = [
|
|
44
|
+
"absolute z-10 w-fit rounded-md bg-white",
|
|
45
|
+
"py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
|
|
46
|
+
"overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
|
|
47
|
+
];
|
|
48
|
+
return t.value.startsWith("up") ? s.push("bottom-1 mb-10") : t.value.startsWith("down") && s.push("top-1 mt-10"), n.stick === "right" ? s.push("right-0") : n.stick === "left" && s.push("left-0"), s;
|
|
49
|
+
});
|
|
50
|
+
return (s, r) => (o(), i("div", {
|
|
51
|
+
class: "relative inline-block",
|
|
52
|
+
ref_key: "menuRef",
|
|
53
|
+
ref: l,
|
|
54
|
+
"data-opened": p.value
|
|
55
|
+
}, [
|
|
56
|
+
B(s.$slots, "button", M(I({ onToggle: c, isExpanded: p.value }))),
|
|
57
|
+
p.value ? (o(), i("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
60
|
+
onClick: c
|
|
61
|
+
})) : g("", !0),
|
|
62
|
+
v(D, {
|
|
63
|
+
"enter-active-class": "transition ease-out duration-100",
|
|
64
|
+
"enter-from-class": "transform opacity-0 scale-95",
|
|
65
|
+
"enter-to-class": "transform opacity-100 scale-100",
|
|
66
|
+
"leave-active-class": "transition ease-in duration-75",
|
|
67
|
+
"leave-from-class": "transform opacity-100 scale-100",
|
|
68
|
+
"leave-to-class": "transform opacity-0 scale-95"
|
|
69
|
+
}, {
|
|
70
|
+
default: A(() => [
|
|
71
|
+
p.value ? (o(), i("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: b(["menu", m.value]),
|
|
74
|
+
role: "menu",
|
|
75
|
+
"aria-orientation": "vertical",
|
|
76
|
+
tabindex: "-1"
|
|
77
|
+
}, [
|
|
78
|
+
s.title ? (o(), i("div", Y, h(s.title), 1)) : g("", !0),
|
|
79
|
+
B(s.$slots, "menu", M(I({ onToggle: c })))
|
|
80
|
+
], 2)) : g("", !0)
|
|
81
|
+
]),
|
|
82
|
+
_: 3
|
|
83
|
+
})
|
|
84
|
+
], 8, X));
|
|
85
|
+
}
|
|
86
|
+
}), T = /* @__PURE__ */ k({
|
|
87
|
+
__name: "OneDropdownItem",
|
|
88
|
+
props: Q,
|
|
89
|
+
emits: ["click"],
|
|
90
|
+
setup(u, { emit: a }) {
|
|
91
|
+
const p = a, l = u, d = V("OneDropdown"), n = () => {
|
|
92
|
+
d !== void 0 && d.onToggle(), p("click");
|
|
93
|
+
}, c = w(() => {
|
|
94
|
+
const t = [];
|
|
95
|
+
return l.variant === "secondary" ? t.push("text-secondary-content hover:bg-secondary-body-hover") : l.variant === "danger" ? t.push("text-danger-content hover:bg-danger-10") : l.variant === "warning" ? t.push("text-warning-content hover:bg-warning-10") : l.variant === "info" ? t.push("text-info-content hover:bg-info-10") : t.push("hover:bg-secondary-body-hover"), t;
|
|
96
|
+
});
|
|
97
|
+
return (t, m) => (o(), i("button", {
|
|
98
|
+
class: b(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", c.value]),
|
|
99
|
+
onClick: E(n, ["prevent"])
|
|
100
|
+
}, [
|
|
101
|
+
t.icon ? (o(), $(N(t.icon), {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: "w-4 h-4"
|
|
104
|
+
})) : g("", !0),
|
|
105
|
+
e("span", null, h(t.label), 1)
|
|
106
|
+
], 2));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
function ee(u, a) {
|
|
110
|
+
return o(), i("svg", {
|
|
111
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
112
|
+
fill: "none",
|
|
113
|
+
viewBox: "0 0 24 24",
|
|
114
|
+
"stroke-width": "1.8",
|
|
115
|
+
stroke: "currentColor",
|
|
116
|
+
"aria-hidden": "true"
|
|
117
|
+
}, [
|
|
118
|
+
e("path", {
|
|
119
|
+
"stroke-linecap": "round",
|
|
120
|
+
"stroke-linejoin": "round",
|
|
121
|
+
d: "M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"
|
|
122
|
+
})
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
125
|
+
const te = {
|
|
126
|
+
user: {
|
|
127
|
+
type: Object,
|
|
128
|
+
required: !0
|
|
129
|
+
},
|
|
130
|
+
menu: {
|
|
131
|
+
type: Array,
|
|
132
|
+
default: () => []
|
|
133
|
+
},
|
|
134
|
+
iconSize: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: "34"
|
|
137
|
+
},
|
|
138
|
+
app: {
|
|
139
|
+
type: Object
|
|
140
|
+
},
|
|
141
|
+
accountLabel: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: "Account"
|
|
144
|
+
},
|
|
145
|
+
logoutLabel: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: "Logout"
|
|
148
|
+
},
|
|
149
|
+
versionLabel: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: ""
|
|
152
|
+
},
|
|
153
|
+
onAccount: {
|
|
154
|
+
type: Function
|
|
155
|
+
},
|
|
156
|
+
onLogout: {
|
|
157
|
+
type: Function
|
|
158
|
+
}
|
|
159
|
+
}, oe = {
|
|
160
|
+
workspace: {
|
|
161
|
+
type: Object,
|
|
162
|
+
required: !0
|
|
163
|
+
},
|
|
164
|
+
workspaces: {
|
|
165
|
+
type: Array
|
|
166
|
+
},
|
|
167
|
+
apps: {
|
|
168
|
+
type: Array,
|
|
169
|
+
required: !0
|
|
170
|
+
},
|
|
171
|
+
iconSize: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: "24"
|
|
174
|
+
},
|
|
175
|
+
appsTitle: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: "Ваші додатки"
|
|
178
|
+
},
|
|
179
|
+
changeLabel: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: "Керувати робочими просторами"
|
|
182
|
+
},
|
|
183
|
+
onChange: {
|
|
184
|
+
type: Function
|
|
185
|
+
},
|
|
186
|
+
onApp: {
|
|
187
|
+
type: Function
|
|
188
|
+
}
|
|
189
|
+
}, ne = ["onClick"], se = { class: "flex flex-col items-center pt-5 pb-2 h-full" }, re = { class: "flex flex-col px-10 py-1 mt-2 text-center" }, ie = { class: "self-center text-base font-medium tracking-wide text-black" }, le = { class: "mt-1 text-xs leading-5 text-blue-500 font-light" }, ce = { class: "text-left w-full mt-5 px-3" }, ae = /* @__PURE__ */ e("div", {
|
|
190
|
+
class: "space-y-2 text-center",
|
|
191
|
+
style: { width: "240px" }
|
|
192
|
+
}, null, -1), ue = { class: "-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400" }, Re = /* @__PURE__ */ k({
|
|
193
|
+
__name: "OneUserMenu",
|
|
194
|
+
props: te,
|
|
195
|
+
setup(u) {
|
|
196
|
+
const a = u, p = w(() => {
|
|
197
|
+
var n;
|
|
198
|
+
return (n = a.menu) == null ? void 0 : n.map((c) => {
|
|
199
|
+
let t = { label: c.label };
|
|
200
|
+
c.icon != null && (t = { ...t, icon: c.icon });
|
|
201
|
+
const m = typeof c.click == "function" ? c.click : () => {
|
|
202
|
+
};
|
|
203
|
+
return {
|
|
204
|
+
key: c.label,
|
|
205
|
+
args: t,
|
|
206
|
+
click: m
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}), l = () => {
|
|
210
|
+
typeof a.onAccount == "function" && a.onAccount();
|
|
211
|
+
}, d = () => {
|
|
212
|
+
typeof a.onLogout == "function" && a.onLogout();
|
|
213
|
+
};
|
|
214
|
+
return (n, c) => (o(), $(Z, { stick: "right" }, {
|
|
215
|
+
button: A(({ onToggle: t, isExpanded: m }) => {
|
|
216
|
+
var s, r;
|
|
217
|
+
return [
|
|
218
|
+
e("button", {
|
|
219
|
+
onClick: t,
|
|
220
|
+
class: b(["p-1 rounded-full hover:bg-secondary-10", [m ? "bg-secondary-25" : ""]])
|
|
221
|
+
}, [
|
|
222
|
+
v(_, {
|
|
223
|
+
text: ((s = n.user) == null ? void 0 : s.name) || "",
|
|
224
|
+
size: n.iconSize,
|
|
225
|
+
src: (r = n.user) == null ? void 0 : r.photo_url,
|
|
226
|
+
rounded: !0
|
|
227
|
+
}, null, 8, ["text", "size", "src"])
|
|
228
|
+
], 10, ne)
|
|
229
|
+
];
|
|
230
|
+
}),
|
|
231
|
+
menu: A(() => {
|
|
232
|
+
var t, m, s, r, C;
|
|
233
|
+
return [
|
|
234
|
+
e("div", se, [
|
|
235
|
+
v(_, {
|
|
236
|
+
text: ((t = n.user) == null ? void 0 : t.name) || "",
|
|
237
|
+
size: 80,
|
|
238
|
+
src: (m = n.user) == null ? void 0 : m.photo_url,
|
|
239
|
+
rounded: !0,
|
|
240
|
+
class: "mx-auto"
|
|
241
|
+
}, null, 8, ["text", "src"]),
|
|
242
|
+
e("div", re, [
|
|
243
|
+
e("div", ie, h((s = n.user) == null ? void 0 : s.name), 1),
|
|
244
|
+
e("div", le, h((r = n.user) == null ? void 0 : r.email), 1)
|
|
245
|
+
]),
|
|
246
|
+
typeof a.onAccount == "function" ? (o(), i("a", {
|
|
247
|
+
key: 0,
|
|
248
|
+
onClick: l,
|
|
249
|
+
class: "cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"
|
|
250
|
+
}, h(n.accountLabel), 1)) : g("", !0),
|
|
251
|
+
e("div", ce, [
|
|
252
|
+
(o(!0), i(S, null, z(p.value, (y) => (o(), $(T, q({
|
|
253
|
+
key: y.key
|
|
254
|
+
}, y.args, {
|
|
255
|
+
onClick: y.click
|
|
256
|
+
}), null, 16, ["onClick"]))), 128)),
|
|
257
|
+
v(T, {
|
|
258
|
+
icon: O(ee),
|
|
259
|
+
label: n.logoutLabel,
|
|
260
|
+
class: "rounded py-3",
|
|
261
|
+
onClick: d
|
|
262
|
+
}, null, 8, ["icon", "label"])
|
|
263
|
+
]),
|
|
264
|
+
ae,
|
|
265
|
+
e("div", ue, h((C = n.app) == null ? void 0 : C.version), 1)
|
|
266
|
+
])
|
|
267
|
+
];
|
|
268
|
+
}),
|
|
269
|
+
_: 1
|
|
270
|
+
}));
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
function de(u, a) {
|
|
274
|
+
return o(), i("svg", {
|
|
275
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
276
|
+
fill: "none",
|
|
277
|
+
viewBox: "0 0 24 24",
|
|
278
|
+
"stroke-width": "1.8",
|
|
279
|
+
stroke: "currentColor",
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
}, [
|
|
282
|
+
e("rect", {
|
|
283
|
+
width: "2.94",
|
|
284
|
+
height: "2.94",
|
|
285
|
+
x: "17.16",
|
|
286
|
+
y: "3.9",
|
|
287
|
+
fill: "currentColor",
|
|
288
|
+
"stroke-width": "1.8",
|
|
289
|
+
rx: "1.1"
|
|
290
|
+
}),
|
|
291
|
+
e("rect", {
|
|
292
|
+
width: "2.94",
|
|
293
|
+
height: "2.94",
|
|
294
|
+
x: "10.53",
|
|
295
|
+
y: "3.9",
|
|
296
|
+
fill: "currentColor",
|
|
297
|
+
"stroke-width": "1.8",
|
|
298
|
+
rx: "1.1"
|
|
299
|
+
}),
|
|
300
|
+
e("rect", {
|
|
301
|
+
width: "2.94",
|
|
302
|
+
height: "2.94",
|
|
303
|
+
x: "3.9",
|
|
304
|
+
y: "3.9",
|
|
305
|
+
fill: "currentColor",
|
|
306
|
+
"stroke-width": "1.8",
|
|
307
|
+
rx: "1.1"
|
|
308
|
+
}),
|
|
309
|
+
e("rect", {
|
|
310
|
+
width: "2.94",
|
|
311
|
+
height: "2.94",
|
|
312
|
+
x: "17.16",
|
|
313
|
+
y: "10.53",
|
|
314
|
+
fill: "currentColor",
|
|
315
|
+
"stroke-width": "1.8",
|
|
316
|
+
rx: "1.1"
|
|
317
|
+
}),
|
|
318
|
+
e("rect", {
|
|
319
|
+
width: "2.94",
|
|
320
|
+
height: "2.94",
|
|
321
|
+
x: "10.53",
|
|
322
|
+
y: "10.53",
|
|
323
|
+
fill: "currentColor",
|
|
324
|
+
"stroke-width": "1.8",
|
|
325
|
+
rx: "1.1"
|
|
326
|
+
}),
|
|
327
|
+
e("rect", {
|
|
328
|
+
width: "2.94",
|
|
329
|
+
height: "2.94",
|
|
330
|
+
x: "3.9",
|
|
331
|
+
y: "10.53",
|
|
332
|
+
fill: "currentColor",
|
|
333
|
+
"stroke-width": "1.8",
|
|
334
|
+
rx: "1.1"
|
|
335
|
+
}),
|
|
336
|
+
e("rect", {
|
|
337
|
+
width: "2.94",
|
|
338
|
+
height: "2.94",
|
|
339
|
+
x: "17.16",
|
|
340
|
+
y: "17.16",
|
|
341
|
+
fill: "currentColor",
|
|
342
|
+
"stroke-width": "1.8",
|
|
343
|
+
rx: "1.1"
|
|
344
|
+
}),
|
|
345
|
+
e("rect", {
|
|
346
|
+
width: "2.94",
|
|
347
|
+
height: "2.94",
|
|
348
|
+
x: "10.53",
|
|
349
|
+
y: "17.16",
|
|
350
|
+
fill: "currentColor",
|
|
351
|
+
"stroke-width": "1.8",
|
|
352
|
+
rx: "1.1"
|
|
353
|
+
}),
|
|
354
|
+
e("rect", {
|
|
355
|
+
width: "2.94",
|
|
356
|
+
height: "2.94",
|
|
357
|
+
x: "3.9",
|
|
358
|
+
y: "17.16",
|
|
359
|
+
fill: "currentColor",
|
|
360
|
+
"stroke-width": "1.8",
|
|
361
|
+
rx: "1.1"
|
|
362
|
+
})
|
|
363
|
+
]);
|
|
364
|
+
}
|
|
365
|
+
function pe(u, a) {
|
|
366
|
+
return o(), i("svg", {
|
|
367
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
368
|
+
fill: "none",
|
|
369
|
+
viewBox: "0 0 24 24",
|
|
370
|
+
"stroke-width": "1.8",
|
|
371
|
+
stroke: "currentColor",
|
|
372
|
+
"aria-hidden": "true"
|
|
373
|
+
}, [
|
|
374
|
+
e("path", {
|
|
375
|
+
"stroke-linecap": "round",
|
|
376
|
+
"stroke-linejoin": "round",
|
|
377
|
+
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
378
|
+
})
|
|
379
|
+
]);
|
|
380
|
+
}
|
|
381
|
+
function he(u, a) {
|
|
382
|
+
return o(), i("svg", {
|
|
383
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
384
|
+
fill: "none",
|
|
385
|
+
viewBox: "0 0 24 24",
|
|
386
|
+
"stroke-width": "1.8",
|
|
387
|
+
stroke: "currentColor",
|
|
388
|
+
"aria-hidden": "true"
|
|
389
|
+
}, [
|
|
390
|
+
e("path", {
|
|
391
|
+
"stroke-linecap": "round",
|
|
392
|
+
"stroke-linejoin": "round",
|
|
393
|
+
d: "M4.5 15.75l7.5-7.5 7.5 7.5"
|
|
394
|
+
})
|
|
395
|
+
]);
|
|
396
|
+
}
|
|
397
|
+
const fe = (u) => (R("data-v-10078238"), u = u(), W(), u), me = ["data-opened"], ve = {
|
|
398
|
+
key: 1,
|
|
399
|
+
class: "absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"
|
|
400
|
+
}, ge = { class: "flex justify-between items-center pt-3 mb-3" }, ye = { class: "font-semibold text-xl px-3" }, xe = { class: "grid" }, _e = { class: "rounded-lg m-3 border" }, we = {
|
|
401
|
+
class: "space-x-2 flex items-center px-3 py-2",
|
|
402
|
+
style: { width: "300px" }
|
|
403
|
+
}, ke = { class: "flex justify-between relative" }, be = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Ce = { clsss: "flex justify-end absolute right-0" }, Ae = { key: 0 }, $e = { class: "text-xs font-semibold" }, Se = /* @__PURE__ */ fe(() => /* @__PURE__ */ e("hr", null, null, -1)), ze = { class: "px-3 py-2" }, Oe = { class: "text-secondary-content text-left pb-1 text-xs uppercase" }, Le = { class: "overflow-auto max-h-full" }, je = {
|
|
404
|
+
key: 0,
|
|
405
|
+
class: "space-y-2"
|
|
406
|
+
}, Fe = ["onClick"], Be = { class: "pl-2" }, Me = { class: "text-sm mt-1 font-semibold" }, Ie = { class: "text-xs mt-1" }, Te = {
|
|
407
|
+
key: 1,
|
|
408
|
+
class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"
|
|
409
|
+
}, Pe = /* @__PURE__ */ k({
|
|
410
|
+
__name: "OneBrowserMenu",
|
|
411
|
+
props: oe,
|
|
412
|
+
emits: ["open", "close"],
|
|
413
|
+
setup(u, { emit: a }) {
|
|
414
|
+
const p = a, l = u, d = x(!1), n = () => {
|
|
415
|
+
d.value = !d.value, d.value ? p("open") : p("close");
|
|
416
|
+
}, c = x(!1), t = w(() => c.value ? he : pe);
|
|
417
|
+
x(!1);
|
|
418
|
+
const m = () => {
|
|
419
|
+
typeof l.onChange == "function" && l.onChange();
|
|
420
|
+
}, s = (r) => {
|
|
421
|
+
typeof l.onApp == "function" && l.onApp(r);
|
|
422
|
+
};
|
|
423
|
+
return (r, C) => {
|
|
424
|
+
var y, L, j, F;
|
|
425
|
+
return o(), i("div", { "data-opened": d.value }, [
|
|
426
|
+
e("button", {
|
|
427
|
+
onClick: n,
|
|
428
|
+
class: b(["p-1 rounded-md hover:bg-secondary-10", { "bg-secondary-10": d.value }])
|
|
429
|
+
}, [
|
|
430
|
+
v(O(de), { class: "text-secondary-base w-8" })
|
|
431
|
+
], 2),
|
|
432
|
+
d.value ? (o(), i("div", {
|
|
433
|
+
key: 0,
|
|
434
|
+
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
435
|
+
onClick: n
|
|
436
|
+
})) : g("", !0),
|
|
437
|
+
d.value ? (o(), i("div", ve, [
|
|
438
|
+
e("div", ge, [
|
|
439
|
+
e("div", ye, h((y = r.workspace) == null ? void 0 : y.label), 1),
|
|
440
|
+
v(O(U), {
|
|
441
|
+
class: "w-6 cursor-pointer",
|
|
442
|
+
onClick: n
|
|
443
|
+
})
|
|
444
|
+
]),
|
|
445
|
+
e("div", xe, [
|
|
446
|
+
e("div", _e, [
|
|
447
|
+
e("div", we, [
|
|
448
|
+
e("div", ke, [
|
|
449
|
+
v(_, {
|
|
450
|
+
text: ((L = r.workspace) == null ? void 0 : L.name) || "",
|
|
451
|
+
src: (j = r.workspace) == null ? void 0 : j.photo_url,
|
|
452
|
+
size: 44,
|
|
453
|
+
rounded: !1,
|
|
454
|
+
class: "mx-auto"
|
|
455
|
+
}, null, 8, ["text", "src"])
|
|
456
|
+
]),
|
|
457
|
+
e("div", be, [
|
|
458
|
+
H(h((F = r.workspace) == null ? void 0 : F.name) + " ", 1),
|
|
459
|
+
e("div", Ce, [
|
|
460
|
+
v(G, {
|
|
461
|
+
variant: "touch",
|
|
462
|
+
icon: t.value,
|
|
463
|
+
onClick: m
|
|
464
|
+
}, null, 8, ["icon"])
|
|
465
|
+
])
|
|
466
|
+
])
|
|
467
|
+
]),
|
|
468
|
+
c.value ? (o(), i("div", Ae, [
|
|
469
|
+
(o(!0), i(S, null, z(r.workspaces, (f) => (o(), i("div", {
|
|
470
|
+
key: f.name,
|
|
471
|
+
class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
|
|
472
|
+
}, [
|
|
473
|
+
v(_, {
|
|
474
|
+
text: f.name,
|
|
475
|
+
src: f.photo_url,
|
|
476
|
+
size: 30,
|
|
477
|
+
rounded: !1
|
|
478
|
+
}, null, 8, ["text", "src"]),
|
|
479
|
+
e("span", $e, h(f.name), 1)
|
|
480
|
+
]))), 128))
|
|
481
|
+
])) : g("", !0),
|
|
482
|
+
Se,
|
|
483
|
+
e("div", {
|
|
484
|
+
onClick: m,
|
|
485
|
+
class: "text-center py-2 cursor-pointer",
|
|
486
|
+
style: { "font-size": "10px" }
|
|
487
|
+
}, h(r.changeLabel), 1)
|
|
488
|
+
])
|
|
489
|
+
]),
|
|
490
|
+
e("div", ze, [
|
|
491
|
+
e("div", Oe, h(r.appsTitle), 1),
|
|
492
|
+
e("div", Le, [
|
|
493
|
+
r.apps && r.apps.length ? (o(), i("div", je, [
|
|
494
|
+
(o(!0), i(S, null, z(r.apps, (f) => (o(), i("div", {
|
|
495
|
+
key: f.id,
|
|
496
|
+
onClick: (De) => s(f),
|
|
497
|
+
class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
|
|
498
|
+
}, [
|
|
499
|
+
v(_, {
|
|
500
|
+
text: f.name,
|
|
501
|
+
src: f.photo_url,
|
|
502
|
+
size: 44,
|
|
503
|
+
rounded: !1
|
|
504
|
+
}, null, 8, ["text", "src"]),
|
|
505
|
+
e("div", Be, [
|
|
506
|
+
e("p", Me, h(f.name), 1),
|
|
507
|
+
e("p", Ie, h(f == null ? void 0 : f.inf), 1)
|
|
508
|
+
])
|
|
509
|
+
], 8, Fe))), 128))
|
|
510
|
+
])) : g("", !0),
|
|
511
|
+
r.apps && r.apps.length ? (o(), i("button", Te, h("Дивитися всі"))) : g("", !0)
|
|
512
|
+
])
|
|
513
|
+
])
|
|
514
|
+
])) : g("", !0)
|
|
515
|
+
], 8, me);
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
const We = /* @__PURE__ */ J(Pe, [["__scopeId", "data-v-10078238"]]);
|
|
520
|
+
export {
|
|
521
|
+
We as O,
|
|
522
|
+
Z as _,
|
|
523
|
+
T as a,
|
|
524
|
+
Re as b,
|
|
525
|
+
oe as c,
|
|
526
|
+
de as r
|
|
527
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./common/index.cjs"),b=require("./XMarkIcon-f94baa4c.cjs"),E=require("./index-e804f148.cjs"),V=require("./_plugin-vue_export-helper-f246444f.cjs"),N={title:{type:String},stick:{type:String,default:"right"}},C={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},B=["data-opened"],S={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},x=e.defineComponent({__name:"OneDropdown",props:N,emits:["open","close"],setup(a,{emit:c}){const d=e.ref(!1),s=e.ref(null),i=c,o=a,l=()=>{d.value=!d.value,d.value?i("open"):i("close")};e.provide("OneDropdown",{onToggle:l});const t=e.computed(()=>{const n=s.value!=null&&s.value.offsetLeft<270;return s.value!=null&&s.value.offsetTop+270>window.innerHeight?"up"+(n?"-right":"-left"):"down"+(n?"-right":"-left")}),p=e.computed(()=>{const n=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return t.value.startsWith("up")?n.push("bottom-1 mb-10"):t.value.startsWith("down")&&n.push("top-1 mt-10"),o.stick==="right"?n.push("right-0"):o.stick==="left"&&n.push("left-0"),n});return(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:s,"data-opened":d.value},[e.renderSlot(n.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:l,isExpanded:d.value}))),d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:l})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",p.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[n.title?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:l})))],2)):e.createCommentVNode("",!0)]),_:3})],8,B))}}),g=e.defineComponent({__name:"OneDropdownItem",props:C,emits:["click"],setup(a,{emit:c}){const d=c,s=a,i=e.inject("OneDropdown"),o=()=>{i!==void 0&&i.onToggle(),d("click")},l=e.computed(()=>{const t=[];return s.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):s.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):s.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):s.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,p)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",l.value]),onClick:e.withModifiers(o,["prevent"])},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],2))}});function A(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})])}const $={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},w={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},z=["onClick"],D={class:"flex flex-col items-center pt-5 pb-2 h-full"},O={class:"flex flex-col px-10 py-1 mt-2 text-center"},L={class:"self-center text-base font-medium tracking-wide text-black"},F={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},j={class:"text-left w-full mt-5 px-3"},M=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1),P={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},I=e.defineComponent({__name:"OneUserMenu",props:$,setup(a){const c=a,d=e.computed(()=>{var o;return(o=c.menu)==null?void 0:o.map(l=>{let t={label:l.label};l.icon!=null&&(t={...t,icon:l.icon});const p=typeof l.click=="function"?l.click:()=>{};return{key:l.label,args:t,click:p}})}),s=()=>{typeof c.onAccount=="function"&&c.onAccount()},i=()=>{typeof c.onLogout=="function"&&c.onLogout()};return(o,l)=>(e.openBlock(),e.createBlock(x,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:p})=>{var n,r;return[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[p?"bg-secondary-25":""]])},[e.createVNode(h.OneAvatar,{text:((n=o.user)==null?void 0:n.name)||"",size:o.iconSize,src:(r=o.user)==null?void 0:r.photo_url,rounded:!0},null,8,["text","size","src"])],10,z)]}),menu:e.withCtx(()=>{var t,p,n,r,f;return[e.createElementVNode("div",D,[e.createVNode(h.OneAvatar,{text:((t=o.user)==null?void 0:t.name)||"",size:80,src:(p=o.user)==null?void 0:p.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",O,[e.createElementVNode("div",L,e.toDisplayString((n=o.user)==null?void 0:n.name),1),e.createElementVNode("div",F,e.toDisplayString((r=o.user)==null?void 0:r.email),1)]),typeof c.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s,class:"cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"},e.toDisplayString(o.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createBlock(g,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(g,{icon:e.unref(A),label:o.logoutLabel,class:"rounded py-3",onClick:i},null,8,["icon","label"])]),M,e.createElementVNode("div",P,e.toDisplayString((f=o.app)==null?void 0:f.version),1)])]}),_:1}))}});function _(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}function q(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function T(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}const H=a=>(e.pushScopeId("data-v-10078238"),a=a(),e.popScopeId(),a),R=["data-opened"],W={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"},U={class:"flex justify-between items-center pt-3 mb-3"},X={class:"font-semibold text-xl px-3"},G={class:"grid"},J={class:"rounded-lg m-3 border"},K={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},Q={class:"flex justify-between relative"},Y={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},Z={clsss:"flex justify-end absolute right-0"},ee={key:0},te={class:"text-xs font-semibold"},oe=H(()=>e.createElementVNode("hr",null,null,-1)),ne={class:"px-3 py-2"},re={class:"text-secondary-content text-left pb-1 text-xs uppercase"},se={class:"overflow-auto max-h-full"},le={key:0,class:"space-y-2"},ce=["onClick"],ae={class:"pl-2"},ie={class:"text-sm mt-1 font-semibold"},de={class:"text-xs mt-1"},ue={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},pe=e.defineComponent({__name:"OneBrowserMenu",props:w,emits:["open","close"],setup(a,{emit:c}){const d=c,s=a,i=e.ref(!1),o=()=>{i.value=!i.value,i.value?d("open"):d("close")},l=e.ref(!1),t=e.computed(()=>l.value?T:q);e.ref(!1);const p=()=>{typeof s.onChange=="function"&&s.onChange()},n=r=>{typeof s.onApp=="function"&&s.onApp(r)};return(r,f)=>{var m,k,v,y;return e.openBlock(),e.createElementBlock("div",{"data-opened":i.value},[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",{"bg-secondary-10":i.value}])},[e.createVNode(e.unref(_),{class:"text-secondary-base w-8"})],2),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:o})):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",U,[e.createElementVNode("div",X,e.toDisplayString((m=r.workspace)==null?void 0:m.label),1),e.createVNode(e.unref(b.render),{class:"w-6 cursor-pointer",onClick:o})]),e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(h.OneAvatar,{text:((k=r.workspace)==null?void 0:k.name)||"",src:(v=r.workspace)==null?void 0:v.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",Y,[e.createTextVNode(e.toDisplayString((y=r.workspace)==null?void 0:y.name)+" ",1),e.createElementVNode("div",Z,[e.createVNode(E._sfc_main,{variant:"touch",icon:t.value,onClick:p},null,8,["icon"])])])]),l.value?(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.workspaces,u=>(e.openBlock(),e.createElementBlock("div",{key:u.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(h.OneAvatar,{text:u.name,src:u.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",te,e.toDisplayString(u.name),1)]))),128))])):e.createCommentVNode("",!0),oe,e.createElementVNode("div",{onClick:p,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString(r.changeLabel),1)])]),e.createElementVNode("div",ne,[e.createElementVNode("div",re,e.toDisplayString(r.appsTitle),1),e.createElementVNode("div",se,[r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.apps,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,onClick:he=>n(u),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[e.createVNode(h.OneAvatar,{text:u.name,src:u.photo_url,size:44,rounded:!1},null,8,["text","src"]),e.createElementVNode("div",ae,[e.createElementVNode("p",ie,e.toDisplayString(u.name),1),e.createElementVNode("p",de,e.toDisplayString(u==null?void 0:u.inf),1)])],8,ce))),128))])):e.createCommentVNode("",!0),r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("button",ue,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,R)}}});const me=V._export_sfc(pe,[["__scopeId","data-v-10078238"]]);exports.OneBrowserMenu=me;exports._sfc_main=x;exports._sfc_main$1=g;exports._sfc_main$2=I;exports.browserMenuProps=w;exports.render=_;
|
package/dist/button/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-e804f148.cjs");require("vue");require("../_plugin-vue_export-helper-f246444f.cjs");exports.OneButton=e._sfc_main;
|
package/dist/button/index.js
CHANGED
package/dist/dropdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../OneBrowserMenu-8223b11f.cjs"),e=require("vue"),f=require("../_plugin-vue_export-helper-f246444f.cjs"),p=require("../common/index.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-e804f148.cjs");const g={},v={class:"border-t border-secondary-stroke my-1"};function k(a,o){return e.openBlock(),e.createElementBlock("div",v)}const x=f._export_sfc(g,[["render",k]]),b=["onClick"],V={class:"grid"},w={class:"font-semibold px-3"},E={class:"rounded-lg m-3 border"},N={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},B={class:"flex-shrink-0"},A={class:"w-full text-left"},C={class:"flex-shrink-0"},D=e.createElementVNode("hr",null,null,-1),O=e.createElementVNode("div",{class:"text-center py-2",style:{"font-size":"10px"}},"Керувати робочими просторами",-1),S={class:"px-3 py-2"},M={class:"text-secondary-content text-left pb-1 text-sm uppercase"},z={key:0,class:"space-y-2"},F=["onClick"],$={class:"pl-2"},q={class:"text-sm mt-1"},G={class:"text-xs mt-1"},u=3,L=e.defineComponent({__name:"OneBrowserMenuGrid",props:n.browserMenuProps,setup(a){const o=a,m=()=>{typeof o.onChange=="function"&&o.onChange()},r=e.ref(!1),_=e.computed(()=>o.apps?r.value?o.apps:o.apps.slice(0,u):[]),h=()=>{r.value=!r.value},y=t=>{typeof o.onApp=="function"&&o.onApp(t)};return(t,P)=>(e.openBlock(),e.createBlock(n._sfc_main,{stick:"right"},{button:e.withCtx(({onToggle:c,isExpanded:l})=>[e.createElementVNode("button",{onClick:c,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[l?"bg-secondary-25":""]])},[e.createVNode(e.unref(n.render),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${t.iconSize}px; height: ${t.iconSize}px`)},null,8,["style"])],10,b)]),menu:e.withCtx(()=>{var c,l,i,d;return[e.createElementVNode("div",V,[e.createElementVNode("div",w,e.toDisplayString((c=t.workspace)==null?void 0:c.label),1),e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createElementVNode("div",B,[e.createVNode(p.OneAvatar,{text:((l=t.workspace)==null?void 0:l.name)||"",src:(i=t.workspace)==null?void 0:i.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",A,e.toDisplayString((d=t.workspace)==null?void 0:d.name),1),e.createElementVNode("div",C,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:m},e.toDisplayString(t.changeLabel),1)])]),D,O])]),e.createElementVNode("div",S,[e.createElementVNode("div",M,e.toDisplayString(t.appsTitle),1),e.createElementVNode("div",null,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:T=>y(s),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[e.createVNode(p.OneAvatar,{text:s.name,src:s.photo_url,size:44,rounded:!1},null,8,["text","src"]),e.createElementVNode("div",$,[e.createElementVNode("p",q,e.toDisplayString(s.name),1),e.createElementVNode("p",G,e.toDisplayString(s.inf),1)])],8,F))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length>u?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:h,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},e.toDisplayString(r.value?"Приховати":"Дивитися всі"),1)):e.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=n.OneBrowserMenu;exports.OneDropdown=n._sfc_main;exports.OneDropdownItem=n._sfc_main$1;exports.OneUserMenu=n._sfc_main$2;exports.OneBrowserMenuGrid=L;exports.OneDropdownDivider=x;
|
package/dist/dropdown/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export { default as OneDropdownItem } from './OneDropdownItem.vue';
|
|
|
3
3
|
export { default as OneDropdownDivider } from './OneDropdownDivider.vue';
|
|
4
4
|
export { default as OneUserMenu } from './OneUserMenu.vue';
|
|
5
5
|
export { default as OneBrowserMenu } from './OneBrowserMenu.vue';
|
|
6
|
+
export { default as OneBrowserMenuGrid } from './OneBrowserMenuGrid.vue';
|
|
6
7
|
export type { DropdownProps, DropdownItemProps } from './dropdown';
|
|
7
8
|
export type { UserMenuProps, BrowserMenuProps } from './menu';
|