ketekny-ui-kit 1.0.97 → 1.0.98
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/package.json
CHANGED
|
@@ -196,6 +196,18 @@ export default {
|
|
|
196
196
|
visible: false,
|
|
197
197
|
nodes: null,
|
|
198
198
|
app: null,
|
|
199
|
+
content,
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function renderContent(bubble) {
|
|
203
|
+
const content = state.content
|
|
204
|
+
if (content.mode === 'text') bubble.textContent = content.text || ''
|
|
205
|
+
else if (content.mode === 'html') bubble.innerHTML = content.html || ''
|
|
206
|
+
else if (content.mode === 'component') {
|
|
207
|
+
state.app?.unmount?.()
|
|
208
|
+
state.app = createApp({ render: () => h(content.component, content.props || {}) })
|
|
209
|
+
state.app.mount(bubble)
|
|
210
|
+
}
|
|
199
211
|
}
|
|
200
212
|
|
|
201
213
|
function ensureNodes() {
|
|
@@ -204,12 +216,7 @@ export default {
|
|
|
204
216
|
const { wrapper, bubble, arrow } = createNodes()
|
|
205
217
|
document.body.appendChild(wrapper)
|
|
206
218
|
|
|
207
|
-
|
|
208
|
-
if (content.mode === 'html') bubble.innerHTML = content.html
|
|
209
|
-
if (content.mode === 'component') {
|
|
210
|
-
state.app = createApp({ render: () => h(content.component, content.props || {}) })
|
|
211
|
-
state.app.mount(bubble)
|
|
212
|
-
}
|
|
219
|
+
renderContent(bubble)
|
|
213
220
|
|
|
214
221
|
state.nodes = { wrapper, bubble, arrow }
|
|
215
222
|
return state.nodes
|
|
@@ -297,17 +304,17 @@ export default {
|
|
|
297
304
|
t.state.placement = nextPlacement
|
|
298
305
|
}
|
|
299
306
|
|
|
300
|
-
|
|
307
|
+
t.state.content = normalizeValue(binding)
|
|
301
308
|
if (!t.state.nodes) return
|
|
302
309
|
|
|
303
310
|
const { bubble } = t.state.nodes
|
|
311
|
+
const content = t.state.content
|
|
304
312
|
if (content.mode === 'text') bubble.textContent = content.text || ''
|
|
305
313
|
else if (content.mode === 'html') bubble.innerHTML = content.html || ''
|
|
306
314
|
else if (content.mode === 'component') {
|
|
307
315
|
t.state.app?.unmount?.()
|
|
308
|
-
|
|
309
|
-
app.mount(bubble)
|
|
310
|
-
t.state.app = app
|
|
316
|
+
t.state.app = createApp({ render: () => h(content.component, content.props || {}) })
|
|
317
|
+
t.state.app.mount(bubble)
|
|
311
318
|
}
|
|
312
319
|
},
|
|
313
320
|
|
|
@@ -239,33 +239,38 @@ export default {
|
|
|
239
239
|
|
|
240
240
|
<template>
|
|
241
241
|
<aside
|
|
242
|
-
class="fixed inset-y-0 left-0 z-40 flex h-full shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width,transform] duration-200 ease-out lg:static lg:translate-x-0"
|
|
242
|
+
class="group/sidebar fixed inset-y-0 left-0 z-40 flex h-full shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width,transform] duration-200 ease-out lg:static lg:translate-x-0"
|
|
243
243
|
:style="sidebarWidthStyle"
|
|
244
244
|
:class="[
|
|
245
245
|
mobileOpen ? 'translate-x-0' : '-translate-x-full lg:translate-x-0',
|
|
246
246
|
]"
|
|
247
247
|
>
|
|
248
|
-
<
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
v-tooltip.right="collapsed ? 'Ανάπτυξη πλαϊνού μενού' : 'Σύμπτυξη πλαϊνού μενού'"
|
|
251
|
+
class="absolute right-0 top-1/2 z-50 hidden h-14 w-6 -translate-y-1/2 translate-x-1/2 items-center justify-center rounded-r-md border border-sidebar-border bg-sidebar-accent text-sidebar-muted opacity-70 shadow-lg shadow-black/30 transition-[color,opacity] hover:opacity-100 hover:text-sidebar-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand lg:inline-flex"
|
|
252
|
+
:aria-label="collapsed ? 'Ανάπτυξη πλαϊνού μενού' : 'Σύμπτυξη πλαϊνού μενού'"
|
|
253
|
+
@click="toggleCollapsed"
|
|
254
|
+
>
|
|
255
|
+
<PanelLeftOpen v-if="collapsed" class="size-4" :stroke-width="2" />
|
|
256
|
+
<PanelLeftClose v-else class="size-4" :stroke-width="2" />
|
|
257
|
+
</button>
|
|
258
|
+
|
|
259
|
+
<div class="relative flex items-center px-4 py-4" :class="collapsed ? 'justify-center' : 'gap-2.5'">
|
|
249
260
|
<img
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
? 'https://s3.ketekny.gr/public/web-apps/logos/logo-icon-dark.png'
|
|
253
|
-
: 'https://support.ketekny.gr/logo-dark.png'
|
|
254
|
-
"
|
|
261
|
+
v-if="collapsed"
|
|
262
|
+
src="https://s3.ketekny.gr/public/web-apps/logos/logo-icon-dark.png"
|
|
255
263
|
alt="Ketekny logo"
|
|
256
|
-
class="object-contain"
|
|
257
|
-
|
|
264
|
+
class="size-9 shrink-0 rounded-lg object-contain"
|
|
265
|
+
@click="handleLogoClick"
|
|
266
|
+
/>
|
|
267
|
+
<img
|
|
268
|
+
v-else
|
|
269
|
+
src="https://support.ketekny.gr/logo-dark.png"
|
|
270
|
+
alt="Ketekny logo"
|
|
271
|
+
class="h-10 min-w-0 flex-1 object-contain"
|
|
258
272
|
@click="handleLogoClick"
|
|
259
273
|
/>
|
|
260
|
-
<button
|
|
261
|
-
v-if="!collapsed"
|
|
262
|
-
type="button"
|
|
263
|
-
class="ml-auto hidden rounded-md p-1.5 text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground lg:inline-flex"
|
|
264
|
-
aria-label="Collapse sidebar"
|
|
265
|
-
@click="toggleCollapsed"
|
|
266
|
-
>
|
|
267
|
-
<PanelLeftClose class="size-4" :stroke-width="2" />
|
|
268
|
-
</button>
|
|
269
274
|
</div>
|
|
270
275
|
|
|
271
276
|
<div v-if="title && !collapsed" class="px-4 pb-2">
|
|
@@ -291,18 +296,6 @@ export default {
|
|
|
291
296
|
</div>
|
|
292
297
|
</div>
|
|
293
298
|
|
|
294
|
-
<div v-if="collapsed" class="justify-center hidden px-3 pb-1 lg:flex">
|
|
295
|
-
<button
|
|
296
|
-
type="button"
|
|
297
|
-
v-tooltip.right="'Ανάπτυξη πλαϊνού μενού'"
|
|
298
|
-
class="flex h-10 w-10 items-center justify-center rounded-md text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
299
|
-
aria-label="Ανάπτυξη πλαϊνού μενού"
|
|
300
|
-
@click="toggleCollapsed"
|
|
301
|
-
>
|
|
302
|
-
<PanelLeftOpen class="size-4" :stroke-width="2" />
|
|
303
|
-
</button>
|
|
304
|
-
</div>
|
|
305
|
-
|
|
306
299
|
<div v-if="!collapsed" class="px-3 pb-2">
|
|
307
300
|
<div class="relative">
|
|
308
301
|
<Search
|
|
@@ -376,67 +369,69 @@ export default {
|
|
|
376
369
|
<Bell class="size-4" :stroke-width="2" />
|
|
377
370
|
</button>
|
|
378
371
|
</div>
|
|
379
|
-
<
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
activeId === link.id
|
|
389
|
-
? 'bg-brand text-brand-foreground font-medium'
|
|
390
|
-
: link.id === 'sign-out'
|
|
391
|
-
? 'text-orange-300 hover:bg-orange-500/10 hover:text-orange-200'
|
|
392
|
-
: 'text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-foreground',
|
|
393
|
-
]"
|
|
394
|
-
:aria-label="collapsed ? link.label : undefined"
|
|
395
|
-
@click="handleFooterSelect(link.id)"
|
|
396
|
-
>
|
|
397
|
-
<component
|
|
398
|
-
:is="link.icon"
|
|
399
|
-
class="size-4 shrink-0"
|
|
400
|
-
:class="
|
|
372
|
+
<template v-if="collapsed">
|
|
373
|
+
<button
|
|
374
|
+
v-for="link in footerLinks"
|
|
375
|
+
:key="link.id"
|
|
376
|
+
type="button"
|
|
377
|
+
v-tooltip.right="link.label"
|
|
378
|
+
class="flex items-center w-full rounded-md transition-colors duration-150"
|
|
379
|
+
:class="[
|
|
380
|
+
'justify-center px-0 py-2',
|
|
401
381
|
activeId === link.id
|
|
402
|
-
? 'text-brand-foreground'
|
|
382
|
+
? 'bg-brand text-brand-foreground font-medium'
|
|
403
383
|
: link.id === 'sign-out'
|
|
404
|
-
? 'text-orange-
|
|
405
|
-
: 'text-sidebar-
|
|
406
|
-
"
|
|
407
|
-
:
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
:
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
:
|
|
428
|
-
|
|
429
|
-
|
|
384
|
+
? 'text-orange-300 hover:bg-orange-500/10 hover:text-orange-200'
|
|
385
|
+
: 'text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-foreground',
|
|
386
|
+
]"
|
|
387
|
+
:aria-label="link.label"
|
|
388
|
+
@click="handleFooterSelect(link.id)"
|
|
389
|
+
>
|
|
390
|
+
<component
|
|
391
|
+
:is="link.icon"
|
|
392
|
+
class="size-4 shrink-0"
|
|
393
|
+
:class="
|
|
394
|
+
activeId === link.id
|
|
395
|
+
? 'text-brand-foreground'
|
|
396
|
+
: link.id === 'sign-out'
|
|
397
|
+
? 'text-orange-400'
|
|
398
|
+
: 'text-sidebar-muted'
|
|
399
|
+
"
|
|
400
|
+
:stroke-width="2"
|
|
401
|
+
/>
|
|
402
|
+
</button>
|
|
403
|
+
</template>
|
|
404
|
+
<template v-else>
|
|
405
|
+
<button
|
|
406
|
+
v-for="link in expandedFooterLinks"
|
|
407
|
+
:key="`${link.id}-expanded`"
|
|
408
|
+
type="button"
|
|
409
|
+
class="flex items-center w-full rounded-md transition-colors duration-150"
|
|
410
|
+
:class="[
|
|
411
|
+
'gap-2.5 px-2 py-2 text-left',
|
|
430
412
|
activeId === link.id
|
|
431
|
-
? 'text-brand-foreground'
|
|
413
|
+
? 'bg-brand text-brand-foreground font-medium'
|
|
432
414
|
: link.id === 'sign-out'
|
|
433
|
-
? 'text-orange-
|
|
434
|
-
: 'text-sidebar-
|
|
435
|
-
"
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
415
|
+
? 'text-orange-300 hover:bg-orange-500/10 hover:text-orange-200'
|
|
416
|
+
: 'text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-foreground',
|
|
417
|
+
]"
|
|
418
|
+
@click="handleFooterSelect(link.id)"
|
|
419
|
+
>
|
|
420
|
+
<component
|
|
421
|
+
:is="link.icon"
|
|
422
|
+
class="size-4 shrink-0"
|
|
423
|
+
:class="
|
|
424
|
+
activeId === link.id
|
|
425
|
+
? 'text-brand-foreground'
|
|
426
|
+
: link.id === 'sign-out'
|
|
427
|
+
? 'text-orange-400'
|
|
428
|
+
: 'text-sidebar-muted'
|
|
429
|
+
"
|
|
430
|
+
:stroke-width="2"
|
|
431
|
+
/>
|
|
432
|
+
<span class="truncate">{{ link.label }}</span>
|
|
433
|
+
</button>
|
|
434
|
+
</template>
|
|
440
435
|
</div>
|
|
441
436
|
|
|
442
437
|
<div
|
|
@@ -164,6 +164,7 @@ export default {
|
|
|
164
164
|
:level="level + 1"
|
|
165
165
|
:active-id="activeId"
|
|
166
166
|
:open-ids="openIds"
|
|
167
|
+
:collapsed="collapsed"
|
|
167
168
|
@select="$emit('select', $event)"
|
|
168
169
|
@toggle="$emit('toggle', $event)"
|
|
169
170
|
/>
|
|
@@ -207,6 +208,7 @@ export default {
|
|
|
207
208
|
:level="0"
|
|
208
209
|
:active-id="activeId"
|
|
209
210
|
:open-ids="openIds"
|
|
211
|
+
:collapsed="false"
|
|
210
212
|
@select="$emit('select', $event)"
|
|
211
213
|
@toggle="$emit('toggle', $event)"
|
|
212
214
|
/>
|