nuxt-ui-elements-pro 0.1.6 → 0.1.8
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/module.json +1 -1
- package/dist/module.mjs +105 -8
- package/dist/runtime/components/EventCalendar.d.vue.ts +82 -3
- package/dist/runtime/components/EventCalendar.vue +123 -12
- package/dist/runtime/components/EventCalendar.vue.d.ts +82 -3
- package/dist/runtime/components/OrgChart.d.vue.ts +191 -0
- package/dist/runtime/components/OrgChart.vue +290 -0
- package/dist/runtime/components/OrgChart.vue.d.ts +191 -0
- package/dist/runtime/components/{EventCalendarHeader.d.vue.ts → event-calendar/EventCalendarHeader.d.vue.ts} +20 -1
- package/dist/runtime/components/event-calendar/EventCalendarHeader.vue +55 -0
- package/dist/runtime/components/{EventCalendarHeader.vue.d.ts → event-calendar/EventCalendarHeader.vue.d.ts} +20 -1
- package/dist/runtime/components/{EventCalendarListView.d.vue.ts → event-calendar/EventCalendarListView.d.vue.ts} +1 -1
- package/dist/runtime/components/{EventCalendarListView.vue → event-calendar/EventCalendarListView.vue} +1 -1
- package/dist/runtime/components/{EventCalendarListView.vue.d.ts → event-calendar/EventCalendarListView.vue.d.ts} +1 -1
- package/dist/runtime/components/{EventCalendarMonthView.d.vue.ts → event-calendar/EventCalendarMonthView.d.vue.ts} +1 -2
- package/dist/runtime/components/{EventCalendarMonthView.vue → event-calendar/EventCalendarMonthView.vue} +2 -24
- package/dist/runtime/components/{EventCalendarMonthView.vue.d.ts → event-calendar/EventCalendarMonthView.vue.d.ts} +1 -2
- package/dist/runtime/components/{EventCalendarTimeGrid.d.vue.ts → event-calendar/EventCalendarTimeGrid.d.vue.ts} +1 -2
- package/dist/runtime/components/{EventCalendarTimeGrid.vue → event-calendar/EventCalendarTimeGrid.vue} +2 -24
- package/dist/runtime/components/{EventCalendarTimeGrid.vue.d.ts → event-calendar/EventCalendarTimeGrid.vue.d.ts} +1 -2
- package/dist/runtime/components/org-chart/OrgChartConnectors.d.vue.ts +15 -0
- package/dist/runtime/components/org-chart/OrgChartConnectors.vue +29 -0
- package/dist/runtime/components/org-chart/OrgChartConnectors.vue.d.ts +15 -0
- package/dist/runtime/components/org-chart/OrgChartControls.d.vue.ts +19 -0
- package/dist/runtime/components/org-chart/OrgChartControls.vue +25 -0
- package/dist/runtime/components/org-chart/OrgChartControls.vue.d.ts +19 -0
- package/dist/runtime/components/org-chart/OrgChartNode.d.vue.ts +30 -0
- package/dist/runtime/components/org-chart/OrgChartNode.vue +129 -0
- package/dist/runtime/components/org-chart/OrgChartNode.vue.d.ts +30 -0
- package/dist/runtime/composables/useOrgChart.d.ts +42 -0
- package/dist/runtime/composables/useOrgChart.js +154 -0
- package/dist/runtime/composables/useOrgChartContext.d.ts +8 -0
- package/dist/runtime/composables/useOrgChartContext.js +11 -0
- package/dist/runtime/composables/useOrgChartDragDrop.d.ts +20 -0
- package/dist/runtime/composables/useOrgChartDragDrop.js +67 -0
- package/dist/runtime/composables/useOrgChartKeyboard.d.ts +16 -0
- package/dist/runtime/composables/useOrgChartKeyboard.js +101 -0
- package/dist/runtime/composables/useOrgChartSearch.d.ts +16 -0
- package/dist/runtime/composables/useOrgChartSearch.js +62 -0
- package/dist/runtime/composables/useOrgChartZoom.d.ts +26 -0
- package/dist/runtime/composables/useOrgChartZoom.js +101 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/types/event-calendar.d.ts +1 -0
- package/dist/runtime/types/index.d.ts +2 -4
- package/dist/runtime/types/index.js +2 -4
- package/dist/runtime/types/org-chart.d.ts +181 -0
- package/dist/runtime/types/org-chart.js +0 -0
- package/dist/runtime/utils/org-chart.d.ts +55 -0
- package/dist/runtime/utils/org-chart.js +367 -0
- package/package.json +1 -1
- package/dist/runtime/components/EventCalendarHeader.vue +0 -48
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarDate } from "@internationalized/date";
|
|
2
|
-
import type { CalendarView } from "
|
|
2
|
+
import type { CalendarView } from "../../types/event-calendar.js";
|
|
3
3
|
import type { Component } from "vue";
|
|
4
4
|
export interface EventCalendarHeaderProps {
|
|
5
5
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -14,6 +14,25 @@ export interface EventCalendarHeaderSlots {
|
|
|
14
14
|
currentDate: CalendarDate;
|
|
15
15
|
view: CalendarView;
|
|
16
16
|
setView: (v: CalendarView) => void;
|
|
17
|
+
views: CalendarView[];
|
|
18
|
+
}) => any;
|
|
19
|
+
/** Replace just the title element */
|
|
20
|
+
title: (props: {
|
|
21
|
+
title: string;
|
|
22
|
+
date: CalendarDate;
|
|
23
|
+
view: CalendarView;
|
|
24
|
+
}) => any;
|
|
25
|
+
/** Replace just the navigation buttons */
|
|
26
|
+
nav: (props: {
|
|
27
|
+
prev: () => void;
|
|
28
|
+
next: () => void;
|
|
29
|
+
today: () => void;
|
|
30
|
+
}) => any;
|
|
31
|
+
/** Replace just the view switcher */
|
|
32
|
+
"view-switcher": (props: {
|
|
33
|
+
view: CalendarView;
|
|
34
|
+
setView: (v: CalendarView) => void;
|
|
35
|
+
views: CalendarView[];
|
|
17
36
|
}) => any;
|
|
18
37
|
}
|
|
19
38
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { Primitive } from "reka-ui";
|
|
3
|
+
import { useEventCalendarContext } from "../../composables/useEventCalendarContext";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script setup>
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
as: { type: null, required: false }
|
|
9
|
+
});
|
|
10
|
+
defineSlots();
|
|
11
|
+
const ctx = useEventCalendarContext();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<Primitive :as="props.as ?? 'div'" data-slot="header" :class="ctx.ui.value.header({ class: ctx.propUi.value?.header })">
|
|
16
|
+
<slot
|
|
17
|
+
:title="ctx.headerTitle.value"
|
|
18
|
+
:prev="ctx.goToPrev"
|
|
19
|
+
:next="ctx.goToNext"
|
|
20
|
+
:today="ctx.goToToday"
|
|
21
|
+
:current-date="ctx.displayDate.value"
|
|
22
|
+
:view="ctx.view.value"
|
|
23
|
+
:set-view="ctx.setView"
|
|
24
|
+
:views="ctx.views.value">
|
|
25
|
+
<slot name="title" :title="ctx.headerTitle.value" :date="ctx.displayDate.value" :view="ctx.view.value">
|
|
26
|
+
<span data-slot="headerTitle" :class="ctx.ui.value.headerTitle({ class: ctx.propUi.value?.headerTitle })" aria-live="polite" aria-atomic="true">
|
|
27
|
+
{{ ctx.headerTitle.value }}
|
|
28
|
+
</span>
|
|
29
|
+
</slot>
|
|
30
|
+
|
|
31
|
+
<div data-slot="headerActions" :class="ctx.ui.value.headerActions({ class: ctx.propUi.value?.headerActions })">
|
|
32
|
+
<slot name="view-switcher" :view="ctx.view.value" :set-view="ctx.setView" :views="ctx.views.value">
|
|
33
|
+
<div data-slot="viewSwitcher" role="group" aria-label="Calendar view" :class="ctx.ui.value.viewSwitcher({ class: ctx.propUi.value?.viewSwitcher })">
|
|
34
|
+
<UButton
|
|
35
|
+
v-for="v in ctx.views.value"
|
|
36
|
+
:key="v"
|
|
37
|
+
:label="v"
|
|
38
|
+
size="xs"
|
|
39
|
+
:color="ctx.view.value === v ? ctx.color.value : 'neutral'"
|
|
40
|
+
:variant="ctx.view.value === v ? 'subtle' : 'ghost'"
|
|
41
|
+
:aria-pressed="ctx.view.value === v"
|
|
42
|
+
class="capitalize"
|
|
43
|
+
@click="ctx.setView(v)" />
|
|
44
|
+
</div>
|
|
45
|
+
</slot>
|
|
46
|
+
|
|
47
|
+
<slot name="nav" :prev="ctx.goToPrev" :next="ctx.goToNext" :today="ctx.goToToday">
|
|
48
|
+
<UButton icon="i-lucide-chevron-left" color="neutral" variant="ghost" size="xs" square :aria-label="`Previous ${ctx.view.value}`" @click="ctx.goToPrev" />
|
|
49
|
+
<UButton label="Today" color="neutral" variant="ghost" size="xs" aria-label="Go to today" @click="ctx.goToToday" />
|
|
50
|
+
<UButton icon="i-lucide-chevron-right" color="neutral" variant="ghost" size="xs" square :aria-label="`Next ${ctx.view.value}`" @click="ctx.goToNext" />
|
|
51
|
+
</slot>
|
|
52
|
+
</div>
|
|
53
|
+
</slot>
|
|
54
|
+
</Primitive>
|
|
55
|
+
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarDate } from "@internationalized/date";
|
|
2
|
-
import type { CalendarView } from "
|
|
2
|
+
import type { CalendarView } from "../../types/event-calendar.js";
|
|
3
3
|
import type { Component } from "vue";
|
|
4
4
|
export interface EventCalendarHeaderProps {
|
|
5
5
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -14,6 +14,25 @@ export interface EventCalendarHeaderSlots {
|
|
|
14
14
|
currentDate: CalendarDate;
|
|
15
15
|
view: CalendarView;
|
|
16
16
|
setView: (v: CalendarView) => void;
|
|
17
|
+
views: CalendarView[];
|
|
18
|
+
}) => any;
|
|
19
|
+
/** Replace just the title element */
|
|
20
|
+
title: (props: {
|
|
21
|
+
title: string;
|
|
22
|
+
date: CalendarDate;
|
|
23
|
+
view: CalendarView;
|
|
24
|
+
}) => any;
|
|
25
|
+
/** Replace just the navigation buttons */
|
|
26
|
+
nav: (props: {
|
|
27
|
+
prev: () => void;
|
|
28
|
+
next: () => void;
|
|
29
|
+
today: () => void;
|
|
30
|
+
}) => any;
|
|
31
|
+
/** Replace just the view switcher */
|
|
32
|
+
"view-switcher": (props: {
|
|
33
|
+
view: CalendarView;
|
|
34
|
+
setView: (v: CalendarView) => void;
|
|
35
|
+
views: CalendarView[];
|
|
17
36
|
}) => any;
|
|
18
37
|
}
|
|
19
38
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarEvent, CalendarView, CalendarDay } from "
|
|
1
|
+
import type { CalendarEvent, CalendarView, CalendarDay } from "../../types/event-calendar.js";
|
|
2
2
|
import type { Component } from "vue";
|
|
3
3
|
export interface EventCalendarListViewProps {
|
|
4
4
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarEvent, CalendarView, CalendarDay } from "
|
|
1
|
+
import type { CalendarEvent, CalendarView, CalendarDay } from "../../types/event-calendar.js";
|
|
2
2
|
import type { Component } from "vue";
|
|
3
3
|
export interface EventCalendarListViewProps {
|
|
4
4
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarEvent, CalendarView, CalendarDay } from "
|
|
1
|
+
import type { CalendarEvent, CalendarView, CalendarDay } from "../../types/event-calendar.js";
|
|
2
2
|
import { type Component } from "vue";
|
|
3
3
|
export interface EventCalendarMonthViewProps {
|
|
4
4
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -22,7 +22,6 @@ export interface EventCalendarMonthViewSlots {
|
|
|
22
22
|
day: CalendarDay;
|
|
23
23
|
}) => any;
|
|
24
24
|
loading: () => any;
|
|
25
|
-
empty: () => any;
|
|
26
25
|
}
|
|
27
26
|
declare const _default: typeof __VLS_export;
|
|
28
27
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Primitive } from "reka-ui";
|
|
3
|
-
import {
|
|
3
|
+
import { ref } from "vue";
|
|
4
4
|
import { useEventListener, onKeyStroke } from "@vueuse/core";
|
|
5
|
-
import { useEventCalendarContext } from "
|
|
5
|
+
import { useEventCalendarContext } from "../../composables/useEventCalendarContext";
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
@@ -11,11 +11,6 @@ const props = defineProps({
|
|
|
11
11
|
});
|
|
12
12
|
defineSlots();
|
|
13
13
|
const ctx = useEventCalendarContext();
|
|
14
|
-
const isEmpty = computed(
|
|
15
|
-
() => !ctx.loading.value && ctx.monthWeekLayouts.value.every(
|
|
16
|
-
(layout) => layout.spanning.length === 0 && layout.singleDay.length === 0
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
14
|
const expandedDay = ref(null);
|
|
20
15
|
function openExpandDay(dateKey, e) {
|
|
21
16
|
e.stopPropagation();
|
|
@@ -314,23 +309,6 @@ onKeyStroke("Escape", () => {
|
|
|
314
309
|
<span class="sr-only">Loading events</span>
|
|
315
310
|
</slot>
|
|
316
311
|
</div>
|
|
317
|
-
|
|
318
|
-
<!-- Empty state -->
|
|
319
|
-
<div
|
|
320
|
-
v-else-if="isEmpty"
|
|
321
|
-
data-slot="emptyState"
|
|
322
|
-
:class="ctx.ui.value.emptyState({ class: ctx.propUi.value?.emptyState })">
|
|
323
|
-
<slot name="empty">
|
|
324
|
-
<UIcon
|
|
325
|
-
name="i-lucide-calendar-x2"
|
|
326
|
-
data-slot="emptyStateIcon"
|
|
327
|
-
:class="ctx.ui.value.emptyStateIcon({ class: ctx.propUi.value?.emptyStateIcon })"
|
|
328
|
-
aria-hidden="true" />
|
|
329
|
-
<p data-slot="emptyStateText" :class="ctx.ui.value.emptyStateText({ class: ctx.propUi.value?.emptyStateText })">
|
|
330
|
-
No events
|
|
331
|
-
</p>
|
|
332
|
-
</slot>
|
|
333
|
-
</div>
|
|
334
312
|
</div>
|
|
335
313
|
</Primitive>
|
|
336
314
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarEvent, CalendarView, CalendarDay } from "
|
|
1
|
+
import type { CalendarEvent, CalendarView, CalendarDay } from "../../types/event-calendar.js";
|
|
2
2
|
import { type Component } from "vue";
|
|
3
3
|
export interface EventCalendarMonthViewProps {
|
|
4
4
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -22,7 +22,6 @@ export interface EventCalendarMonthViewSlots {
|
|
|
22
22
|
day: CalendarDay;
|
|
23
23
|
}) => any;
|
|
24
24
|
loading: () => any;
|
|
25
|
-
empty: () => any;
|
|
26
25
|
}
|
|
27
26
|
declare const _default: typeof __VLS_export;
|
|
28
27
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarDate } from "@internationalized/date";
|
|
2
|
-
import type { CalendarEvent, CalendarView } from "
|
|
2
|
+
import type { CalendarEvent, CalendarView } from "../../types/event-calendar.js";
|
|
3
3
|
import { type Component } from "vue";
|
|
4
4
|
export interface EventCalendarTimeGridProps {
|
|
5
5
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -19,7 +19,6 @@ export interface EventCalendarTimeGridSlots {
|
|
|
19
19
|
date: CalendarDate;
|
|
20
20
|
}) => any;
|
|
21
21
|
loading: () => any;
|
|
22
|
-
empty: () => any;
|
|
23
22
|
}
|
|
24
23
|
declare const _default: typeof __VLS_export;
|
|
25
24
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Primitive } from "reka-ui";
|
|
3
|
-
import {
|
|
4
|
-
import { useEventCalendarContext } from "
|
|
3
|
+
import {} from "vue";
|
|
4
|
+
import { useEventCalendarContext } from "../../composables/useEventCalendarContext";
|
|
5
5
|
import { format } from "#std/date";
|
|
6
6
|
</script>
|
|
7
7
|
|
|
@@ -11,11 +11,6 @@ const props = defineProps({
|
|
|
11
11
|
});
|
|
12
12
|
defineSlots();
|
|
13
13
|
const ctx = useEventCalendarContext();
|
|
14
|
-
const isEmpty = computed(
|
|
15
|
-
() => !ctx.loading.value && ctx.timeGridDays.value.every(
|
|
16
|
-
(day) => day.allDayEvents.length === 0 && day.timedEvents.length === 0
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
14
|
</script>
|
|
20
15
|
|
|
21
16
|
<template>
|
|
@@ -284,23 +279,6 @@ const isEmpty = computed(
|
|
|
284
279
|
<span class="sr-only">Loading events</span>
|
|
285
280
|
</slot>
|
|
286
281
|
</div>
|
|
287
|
-
|
|
288
|
-
<!-- Empty state -->
|
|
289
|
-
<div
|
|
290
|
-
v-else-if="isEmpty"
|
|
291
|
-
data-slot="emptyState"
|
|
292
|
-
:class="ctx.ui.value.emptyState({ class: ctx.propUi.value?.emptyState })">
|
|
293
|
-
<slot name="empty">
|
|
294
|
-
<UIcon
|
|
295
|
-
name="i-lucide-calendar-x2"
|
|
296
|
-
data-slot="emptyStateIcon"
|
|
297
|
-
:class="ctx.ui.value.emptyStateIcon({ class: ctx.propUi.value?.emptyStateIcon })"
|
|
298
|
-
aria-hidden="true" />
|
|
299
|
-
<p data-slot="emptyStateText" :class="ctx.ui.value.emptyStateText({ class: ctx.propUi.value?.emptyStateText })">
|
|
300
|
-
No events
|
|
301
|
-
</p>
|
|
302
|
-
</slot>
|
|
303
|
-
</div>
|
|
304
282
|
</div>
|
|
305
283
|
</Primitive>
|
|
306
284
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarDate } from "@internationalized/date";
|
|
2
|
-
import type { CalendarEvent, CalendarView } from "
|
|
2
|
+
import type { CalendarEvent, CalendarView } from "../../types/event-calendar.js";
|
|
3
3
|
import { type Component } from "vue";
|
|
4
4
|
export interface EventCalendarTimeGridProps {
|
|
5
5
|
/** Rendered element type @defaultValue 'div' */
|
|
@@ -19,7 +19,6 @@ export interface EventCalendarTimeGridSlots {
|
|
|
19
19
|
date: CalendarDate;
|
|
20
20
|
}) => any;
|
|
21
21
|
loading: () => any;
|
|
22
|
-
empty: () => any;
|
|
23
22
|
}
|
|
24
23
|
declare const _default: typeof __VLS_export;
|
|
25
24
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
connectors: import("../../types/org-chart.js").OrgChartConnector[];
|
|
3
|
+
};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_1) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useOrgChartContext } from "../../composables/useOrgChartContext";
|
|
3
|
+
const ctx = useOrgChartContext();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<svg
|
|
8
|
+
data-slot="connectorLayer"
|
|
9
|
+
:class="ctx.ui.value.connectorLayer({ class: ctx.propUi.value?.connectorLayer })"
|
|
10
|
+
:width="ctx.layout.value.width"
|
|
11
|
+
:height="ctx.layout.value.height"
|
|
12
|
+
:viewBox="`0 0 ${ctx.layout.value.width} ${ctx.layout.value.height}`"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
>
|
|
15
|
+
<!-- Hierarchical connectors -->
|
|
16
|
+
<slot :connectors="ctx.layout.value.connectors">
|
|
17
|
+
<path
|
|
18
|
+
v-for="connector in ctx.layout.value.connectors"
|
|
19
|
+
:key="`${connector.fromId}-${connector.toId}`"
|
|
20
|
+
data-slot="connector"
|
|
21
|
+
:d="connector.path"
|
|
22
|
+
:class="[
|
|
23
|
+
ctx.ui.value.connector({ class: ctx.propUi.value?.connector }),
|
|
24
|
+
ctx.animated.value ? 'transition-all duration-300 ease-in-out' : ''
|
|
25
|
+
]"
|
|
26
|
+
/>
|
|
27
|
+
</slot>
|
|
28
|
+
</svg>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
connectors: import("../../types/org-chart.js").OrgChartConnector[];
|
|
3
|
+
};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_1) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
zoomIn: () => void;
|
|
3
|
+
zoomOut: () => void;
|
|
4
|
+
zoomReset: () => void;
|
|
5
|
+
fitToView: () => void;
|
|
6
|
+
scale: number;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useOrgChartContext } from "../../composables/useOrgChartContext";
|
|
3
|
+
const ctx = useOrgChartContext();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div
|
|
8
|
+
v-if="ctx.zoomConfig.value.enabled && ctx.zoomConfig.value.controls"
|
|
9
|
+
data-slot="zoomControls"
|
|
10
|
+
:class="ctx.ui.value.zoomControls({ class: ctx.propUi.value?.zoomControls })"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
:zoom-in="ctx.zoomIn"
|
|
14
|
+
:zoom-out="ctx.zoomOut"
|
|
15
|
+
:zoom-reset="ctx.zoomReset"
|
|
16
|
+
:fit-to-view="ctx.fitToView"
|
|
17
|
+
:scale="ctx.scale.value"
|
|
18
|
+
>
|
|
19
|
+
<UButton icon="i-lucide-zoom-in" size="xs" color="neutral" variant="outline" square aria-label="Zoom in" @click="ctx.zoomIn" />
|
|
20
|
+
<UButton icon="i-lucide-zoom-out" size="xs" color="neutral" variant="outline" square aria-label="Zoom out" @click="ctx.zoomOut" />
|
|
21
|
+
<UButton icon="i-lucide-maximize" size="xs" color="neutral" variant="outline" square aria-label="Fit to view" @click="ctx.fitToView" />
|
|
22
|
+
<UButton icon="i-lucide-rotate-ccw" size="xs" color="neutral" variant="outline" square aria-label="Reset zoom" @click="ctx.zoomReset" />
|
|
23
|
+
</slot>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
zoomIn: () => void;
|
|
3
|
+
zoomOut: () => void;
|
|
4
|
+
zoomReset: () => void;
|
|
5
|
+
fitToView: () => void;
|
|
6
|
+
scale: number;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OrgChartTreeNode } from "../../types/org-chart.js";
|
|
2
|
+
export interface OrgChartNodeProps {
|
|
3
|
+
node: OrgChartTreeNode;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<OrgChartNodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OrgChartNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
8
|
+
avatar?: (props: {
|
|
9
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
10
|
+
}) => any;
|
|
11
|
+
} & {
|
|
12
|
+
label?: (props: {
|
|
13
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
14
|
+
}) => any;
|
|
15
|
+
} & {
|
|
16
|
+
description?: (props: {
|
|
17
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
18
|
+
}) => any;
|
|
19
|
+
} & {
|
|
20
|
+
'collapse-toggle'?: (props: {
|
|
21
|
+
expanded: boolean;
|
|
22
|
+
count: number;
|
|
23
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
24
|
+
}) => any;
|
|
25
|
+
}>;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useOrgChartContext } from "../../composables/useOrgChartContext";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script setup>
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
node: { type: Object, required: true }
|
|
9
|
+
});
|
|
10
|
+
const ctx = useOrgChartContext();
|
|
11
|
+
const isExpanded = computed(() => ctx.isExpanded(props.node.data.id));
|
|
12
|
+
const isSelected = computed(() => ctx.isSelected(props.node.data.id));
|
|
13
|
+
const isFocused = computed(() => ctx.isFocused(props.node.data.id));
|
|
14
|
+
const isMatched = computed(() => ctx.isMatched(props.node.data.id));
|
|
15
|
+
const isDimmed = computed(() => ctx.isDimmed(props.node.data.id));
|
|
16
|
+
const isDragging = computed(() => ctx.draggedNodeId.value === props.node.data.id);
|
|
17
|
+
const isDropTarget = computed(() => ctx.dropTargetId.value === props.node.data.id);
|
|
18
|
+
const hasChildren = computed(() => props.node.children.length > 0);
|
|
19
|
+
const nodeStyle = computed(() => {
|
|
20
|
+
const _layout = ctx.layout.value;
|
|
21
|
+
const cfg = ctx.layoutConfig.value;
|
|
22
|
+
return {
|
|
23
|
+
left: `${props.node.x}px`,
|
|
24
|
+
top: `${props.node.y}px`,
|
|
25
|
+
width: `${cfg.nodeWidth}px`,
|
|
26
|
+
height: `${cfg.nodeHeight}px`
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
const togglePosition = computed(() => {
|
|
30
|
+
const cfg = ctx.layoutConfig.value;
|
|
31
|
+
const dir = ctx.direction.value;
|
|
32
|
+
switch (dir) {
|
|
33
|
+
case "vertical":
|
|
34
|
+
return {
|
|
35
|
+
left: `${cfg.nodeWidth / 2 - 10}px`,
|
|
36
|
+
top: `${cfg.nodeHeight - 2}px`
|
|
37
|
+
};
|
|
38
|
+
case "bottom-up":
|
|
39
|
+
return {
|
|
40
|
+
left: `${cfg.nodeWidth / 2 - 10}px`,
|
|
41
|
+
top: "-8px"
|
|
42
|
+
};
|
|
43
|
+
case "horizontal":
|
|
44
|
+
return {
|
|
45
|
+
left: `${cfg.nodeWidth - 2}px`,
|
|
46
|
+
top: `${cfg.nodeHeight / 2 - 10}px`
|
|
47
|
+
};
|
|
48
|
+
case "right-to-left":
|
|
49
|
+
return {
|
|
50
|
+
left: "-8px",
|
|
51
|
+
top: `${cfg.nodeHeight / 2 - 10}px`
|
|
52
|
+
};
|
|
53
|
+
default:
|
|
54
|
+
return {
|
|
55
|
+
left: `${cfg.nodeWidth / 2 - 10}px`,
|
|
56
|
+
top: `${cfg.nodeHeight - 2}px`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const nodeColor = computed(() => props.node.data.color);
|
|
61
|
+
function nodeClasses() {
|
|
62
|
+
const classes = [ctx.ui.value.node({ class: ctx.propUi.value?.node })];
|
|
63
|
+
if (ctx.animated.value) classes.push(ctx.ui.value.nodeAnimated({ class: ctx.propUi.value?.nodeAnimated }));
|
|
64
|
+
if (isSelected.value) classes.push(ctx.ui.value.nodeSelected({ class: ctx.propUi.value?.nodeSelected }));
|
|
65
|
+
if (isFocused.value) classes.push(ctx.ui.value.nodeFocused({ class: ctx.propUi.value?.nodeFocused }));
|
|
66
|
+
if (isMatched.value) classes.push(ctx.ui.value.nodeMatched({ class: ctx.propUi.value?.nodeMatched }));
|
|
67
|
+
if (isDimmed.value) classes.push(ctx.ui.value.nodeDimmed({ class: ctx.propUi.value?.nodeDimmed }));
|
|
68
|
+
if (isDragging.value) classes.push(ctx.ui.value.nodeDragging({ class: ctx.propUi.value?.nodeDragging }));
|
|
69
|
+
if (isDropTarget.value) classes.push(ctx.ui.value.nodeDropTarget({ class: ctx.propUi.value?.nodeDropTarget }));
|
|
70
|
+
return classes;
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<div
|
|
76
|
+
:data-slot="'node'"
|
|
77
|
+
:data-node-id="node.data.id"
|
|
78
|
+
role="treeitem"
|
|
79
|
+
:aria-expanded="hasChildren ? isExpanded : void 0"
|
|
80
|
+
:aria-selected="isSelected"
|
|
81
|
+
:aria-level="node.depth + 1"
|
|
82
|
+
:aria-setsize="node.siblingCount"
|
|
83
|
+
:aria-posinset="node.indexInSiblings + 1"
|
|
84
|
+
:aria-label="`${node.data.name}${node.data.title ? ', ' + node.data.title : ''}`"
|
|
85
|
+
:tabindex="isFocused ? 0 : -1"
|
|
86
|
+
:draggable="ctx.draggable.value && !!node.parent"
|
|
87
|
+
:style="[nodeStyle, nodeColor ? { '--node-color': nodeColor === 'neutral' ? 'var(--ui-bg-inverted)' : `var(--ui-${nodeColor})` } : void 0]"
|
|
88
|
+
:class="nodeClasses()"
|
|
89
|
+
@click="ctx.handleNodeClick(node, $event)"
|
|
90
|
+
@keydown="ctx.onKeydown"
|
|
91
|
+
@dragstart="ctx.onDragStart(node.data.id, $event)"
|
|
92
|
+
@dragover="ctx.onDragOver(node.data.id, $event)"
|
|
93
|
+
@dragleave="ctx.onDragLeave($event)"
|
|
94
|
+
@drop="ctx.onDrop(node.data.id, $event)"
|
|
95
|
+
@dragend="ctx.onDragEnd($event)"
|
|
96
|
+
>
|
|
97
|
+
<slot name="avatar" :node="node.data">
|
|
98
|
+
<img v-if="node.data.avatar" :src="node.data.avatar" :alt="node.data.name" :class="ctx.ui.value.nodeAvatar({ class: ctx.propUi.value?.nodeAvatar })" />
|
|
99
|
+
<div v-else-if="node.data.icon" :class="ctx.ui.value.nodeIcon({ class: ctx.propUi.value?.nodeIcon })">
|
|
100
|
+
<UIcon :name="node.data.icon" />
|
|
101
|
+
</div>
|
|
102
|
+
</slot>
|
|
103
|
+
|
|
104
|
+
<div :class="ctx.ui.value.nodeContent({ class: ctx.propUi.value?.nodeContent })">
|
|
105
|
+
<slot name="label" :node="node.data">
|
|
106
|
+
<span :class="ctx.ui.value.nodeName({ class: ctx.propUi.value?.nodeName })">{{ node.data.name }}</span>
|
|
107
|
+
</slot>
|
|
108
|
+
<slot name="description" :node="node.data">
|
|
109
|
+
<span v-if="node.data.title" :class="ctx.ui.value.nodeTitle({ class: ctx.propUi.value?.nodeTitle })">{{ node.data.title }}</span>
|
|
110
|
+
</slot>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- Collapse toggle -->
|
|
114
|
+
<button
|
|
115
|
+
v-if="hasChildren"
|
|
116
|
+
:data-slot="'collapseToggle'"
|
|
117
|
+
:style="togglePosition"
|
|
118
|
+
:class="ctx.ui.value.collapseToggle({ class: ctx.propUi.value?.collapseToggle })"
|
|
119
|
+
:aria-label="isExpanded ? 'Collapse' : `Expand (${ctx.getDescendantCount(node.data.id)} members)`"
|
|
120
|
+
@click.stop="ctx.toggleExpand(node.data.id)"
|
|
121
|
+
>
|
|
122
|
+
<slot name="collapse-toggle" :expanded="isExpanded" :count="ctx.getDescendantCount(node.data.id)" :node="node.data">
|
|
123
|
+
<span :class="ctx.ui.value.descendantBadge({ class: ctx.propUi.value?.descendantBadge })">
|
|
124
|
+
{{ isExpanded ? "\u2212" : "+" }}
|
|
125
|
+
</span>
|
|
126
|
+
</slot>
|
|
127
|
+
</button>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OrgChartTreeNode } from "../../types/org-chart.js";
|
|
2
|
+
export interface OrgChartNodeProps {
|
|
3
|
+
node: OrgChartTreeNode;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<OrgChartNodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OrgChartNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
8
|
+
avatar?: (props: {
|
|
9
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
10
|
+
}) => any;
|
|
11
|
+
} & {
|
|
12
|
+
label?: (props: {
|
|
13
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
14
|
+
}) => any;
|
|
15
|
+
} & {
|
|
16
|
+
description?: (props: {
|
|
17
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
18
|
+
}) => any;
|
|
19
|
+
} & {
|
|
20
|
+
'collapse-toggle'?: (props: {
|
|
21
|
+
expanded: boolean;
|
|
22
|
+
count: number;
|
|
23
|
+
node: import("../../types/org-chart.js").OrgChartNode;
|
|
24
|
+
}) => any;
|
|
25
|
+
}>;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|