sprintify-ui 0.2.9 → 0.2.11
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/sprintify-ui.es.js +4 -4
- package/dist/types/src/components/BaseActionItem.vue.d.ts +27 -20
- package/dist/types/src/components/BaseActionItemButton.vue.d.ts +21 -28
- package/dist/types/src/components/BaseAddressForm.vue.d.ts +63 -50
- package/dist/types/src/components/BaseBadge.vue.d.ts +41 -40
- package/dist/types/src/components/BaseBoolean.vue.d.ts +9 -14
- package/dist/types/src/components/BaseCropper.vue.d.ts +42 -25
- package/dist/types/src/components/BaseCropperModal.vue.d.ts +18 -17
- package/dist/types/src/components/BaseDataIteratorSectionBox.vue.d.ts +11 -14
- package/dist/types/src/components/BaseDataIteratorSectionButton.vue.d.ts +12 -15
- package/dist/types/src/components/BaseDataIteratorSectionModal.vue.d.ts +20 -17
- package/dist/types/src/components/BaseDataTableRowAction.vue.d.ts +18 -15
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +107 -74
- package/dist/types/src/components/BaseDraggable.vue.d.ts +35 -20
- package/dist/types/src/components/BaseFilePicker.vue.d.ts +43 -42
- package/dist/types/src/components/BaseFilePickerCrop.vue.d.ts +43 -40
- package/dist/types/src/components/BaseFileUploader.vue.d.ts +83 -62
- package/dist/types/src/components/BaseGantt.vue.d.ts +424 -0
- package/dist/types/src/components/BaseHeader.vue.d.ts +81 -66
- package/dist/types/src/components/BaseIconPicker.vue.d.ts +27 -34
- package/dist/types/src/components/BaseLayoutNotificationItemContent.vue.d.ts +18 -15
- package/dist/types/src/components/BaseSideNavigation.vue.d.ts +11 -26
- package/dist/types/src/components/BaseSideNavigationItem.vue.d.ts +27 -32
- package/dist/types/src/components/BaseTabItem.vue.d.ts +27 -32
- package/dist/types/src/components/BaseTabs.vue.d.ts +11 -26
- package/dist/types/src/services/gantt/format.d.ts +24 -0
- package/dist/types/src/services/gantt/timescale.d.ts +26 -0
- package/dist/types/src/services/gantt/types.d.ts +67 -0
- package/package.json +1 -1
- package/src/components/BaseGantt.stories.js +130 -0
- package/src/components/BaseGantt.vue +333 -0
- package/src/components/BaseTextareaAutoresize.vue +2 -2
- package/src/services/gantt/format.ts +113 -0
- package/src/services/gantt/timescale.ts +243 -0
- package/src/services/gantt/types.ts +75 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { Notification } from '@/types/Notification';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<
|
|
3
|
-
active:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
notification:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: import(
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
active: {
|
|
4
|
+
type: import("vue").PropType<boolean>;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
notification: {
|
|
8
|
+
type: import("vue").PropType<Notification>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
active: {
|
|
13
|
+
type: import("vue").PropType<boolean>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
notification: {
|
|
17
|
+
type: import("vue").PropType<Notification>;
|
|
16
18
|
required: true;
|
|
17
19
|
};
|
|
18
|
-
}
|
|
20
|
+
}>>, {}, {}>;
|
|
21
|
+
export default _default;
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
2
|
-
size
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
size: {
|
|
3
|
+
type: import("vue").PropType<"xs" | "sm" | "lg" | "md">;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
size: {
|
|
8
|
+
type: import("vue").PropType<"xs" | "sm" | "lg" | "md">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
10
12
|
size: "xs" | "sm" | "lg" | "md";
|
|
11
13
|
}, {}>, {
|
|
12
14
|
default?(_: {}): any;
|
|
13
15
|
}>;
|
|
14
16
|
export default _default;
|
|
15
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
-
} : {
|
|
20
|
-
type: import('vue').PropType<T[K]>;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type __VLS_WithDefaults<P, D> = {
|
|
25
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
26
|
-
default: D[K];
|
|
27
|
-
}> : P[K];
|
|
28
|
-
};
|
|
29
17
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
18
|
new (): {
|
|
31
19
|
$slots: S;
|
|
32
20
|
};
|
|
33
21
|
};
|
|
34
|
-
type __VLS_Prettify<T> = {
|
|
35
|
-
[K in keyof T]: T[K];
|
|
36
|
-
} & {};
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
3
|
-
to:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
disabled:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
to: {
|
|
4
|
+
type: import("vue").PropType<RouteLocationRaw>;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
disabled: {
|
|
8
|
+
type: import("vue").PropType<boolean>;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
activeStrategy: {
|
|
12
|
+
type: import("vue").PropType<"default" | "exact">;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
to: {
|
|
17
|
+
type: import("vue").PropType<RouteLocationRaw>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
type: import("vue").PropType<boolean>;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
activeStrategy: {
|
|
25
|
+
type: import("vue").PropType<"default" | "exact">;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>>, {
|
|
17
29
|
disabled: boolean;
|
|
18
30
|
activeStrategy: "default" | "exact";
|
|
19
31
|
}, {}>, {
|
|
@@ -22,25 +34,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
22
34
|
}): any;
|
|
23
35
|
}>;
|
|
24
36
|
export default _default;
|
|
25
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
-
} : {
|
|
30
|
-
type: import('vue').PropType<T[K]>;
|
|
31
|
-
required: true;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
type __VLS_WithDefaults<P, D> = {
|
|
35
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
-
default: D[K];
|
|
37
|
-
}> : P[K];
|
|
38
|
-
};
|
|
39
37
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
38
|
new (): {
|
|
41
39
|
$slots: S;
|
|
42
40
|
};
|
|
43
41
|
};
|
|
44
|
-
type __VLS_Prettify<T> = {
|
|
45
|
-
[K in keyof T]: T[K];
|
|
46
|
-
} & {};
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
3
|
-
to:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
disabled:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
to: {
|
|
4
|
+
type: import("vue").PropType<RouteLocationRaw>;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
disabled: {
|
|
8
|
+
type: import("vue").PropType<boolean>;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
activeStrategy: {
|
|
12
|
+
type: import("vue").PropType<"default" | "exact">;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
to: {
|
|
17
|
+
type: import("vue").PropType<RouteLocationRaw>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
type: import("vue").PropType<boolean>;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
activeStrategy: {
|
|
25
|
+
type: import("vue").PropType<"default" | "exact">;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>>, {
|
|
17
29
|
disabled: boolean;
|
|
18
30
|
activeStrategy: "default" | "exact";
|
|
19
31
|
}, {}>, {
|
|
@@ -22,25 +34,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
22
34
|
}): any;
|
|
23
35
|
}>;
|
|
24
36
|
export default _default;
|
|
25
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
-
} : {
|
|
30
|
-
type: import('vue').PropType<T[K]>;
|
|
31
|
-
required: true;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
type __VLS_WithDefaults<P, D> = {
|
|
35
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
-
default: D[K];
|
|
37
|
-
}> : P[K];
|
|
38
|
-
};
|
|
39
37
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
38
|
new (): {
|
|
41
39
|
$slots: S;
|
|
42
40
|
};
|
|
43
41
|
};
|
|
44
|
-
type __VLS_Prettify<T> = {
|
|
45
|
-
[K in keyof T]: T[K];
|
|
46
|
-
} & {};
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
2
|
-
size
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
size: {
|
|
3
|
+
type: import("vue").PropType<"xs" | "sm" | "lg" | "md">;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
size: {
|
|
8
|
+
type: import("vue").PropType<"xs" | "sm" | "lg" | "md">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
10
12
|
size: "xs" | "sm" | "lg" | "md";
|
|
11
13
|
}, {}>, {
|
|
12
14
|
default?(_: {}): any;
|
|
13
15
|
}>;
|
|
14
16
|
export default _default;
|
|
15
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
-
} : {
|
|
20
|
-
type: import('vue').PropType<T[K]>;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type __VLS_WithDefaults<P, D> = {
|
|
25
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
26
|
-
default: D[K];
|
|
27
|
-
}> : P[K];
|
|
28
|
-
};
|
|
29
17
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
18
|
new (): {
|
|
31
19
|
$slots: S;
|
|
32
20
|
};
|
|
33
21
|
};
|
|
34
|
-
type __VLS_Prettify<T> = {
|
|
35
|
-
[K in keyof T]: T[K];
|
|
36
|
-
} & {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
import { FormatConfig, GanttItem, GanttItemFormatted, GanttRow, GanttRowFormatted } from "./types";
|
|
3
|
+
export declare class Format {
|
|
4
|
+
private rows;
|
|
5
|
+
private config;
|
|
6
|
+
constructor(config: FormatConfig);
|
|
7
|
+
handle(): {
|
|
8
|
+
rows: GanttRowFormatted[];
|
|
9
|
+
min: DateTime;
|
|
10
|
+
max: DateTime;
|
|
11
|
+
millisecondToPixel: number;
|
|
12
|
+
height: number;
|
|
13
|
+
width: number;
|
|
14
|
+
groups: import("./types").Group[];
|
|
15
|
+
ticks: import("./types").Tick[];
|
|
16
|
+
};
|
|
17
|
+
formatGanttRows(): GanttRowFormatted[];
|
|
18
|
+
formatGanttRow(row: GanttRow): GanttRowFormatted;
|
|
19
|
+
formatGanttItem(item: GanttItem): GanttItemFormatted;
|
|
20
|
+
getMinMax(rowsFormatted: GanttRowFormatted[]): {
|
|
21
|
+
min: DateTime;
|
|
22
|
+
max: DateTime;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
import { Group, Tick } from "./types";
|
|
3
|
+
export declare class Timescale {
|
|
4
|
+
private minWidth;
|
|
5
|
+
private width;
|
|
6
|
+
private min;
|
|
7
|
+
private max;
|
|
8
|
+
private scale;
|
|
9
|
+
private millisecondToPixel;
|
|
10
|
+
constructor(minWidth: number, min: DateTime, max: DateTime);
|
|
11
|
+
handle(): {
|
|
12
|
+
groups: Group[];
|
|
13
|
+
ticks: Tick[];
|
|
14
|
+
width: number;
|
|
15
|
+
millisecondToPixel: number;
|
|
16
|
+
min: DateTime;
|
|
17
|
+
max: DateTime;
|
|
18
|
+
};
|
|
19
|
+
private getMillisecondToPixel;
|
|
20
|
+
private getGroups;
|
|
21
|
+
private getTicks;
|
|
22
|
+
private getDiffFromMin;
|
|
23
|
+
private diffInMilliseconds;
|
|
24
|
+
private mutateGroupsToKeepOneVisible;
|
|
25
|
+
private getScale;
|
|
26
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DateTime, DateTimeUnit } from "luxon";
|
|
2
|
+
export interface GanttItem {
|
|
3
|
+
id: number;
|
|
4
|
+
start: string;
|
|
5
|
+
end: string;
|
|
6
|
+
name: string;
|
|
7
|
+
meta?: Record<string, unknown>;
|
|
8
|
+
color: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GanttRow {
|
|
11
|
+
id: number;
|
|
12
|
+
name: string;
|
|
13
|
+
meta?: Record<string, unknown>;
|
|
14
|
+
items: GanttItem[];
|
|
15
|
+
}
|
|
16
|
+
export interface GanttRowFormatted {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
meta?: Record<string, unknown>;
|
|
20
|
+
items: GanttItemFormatted[];
|
|
21
|
+
}
|
|
22
|
+
export interface GanttItemFormatted {
|
|
23
|
+
id: number;
|
|
24
|
+
start: DateTime;
|
|
25
|
+
end: DateTime;
|
|
26
|
+
name: string;
|
|
27
|
+
meta?: Record<string, unknown>;
|
|
28
|
+
color: string;
|
|
29
|
+
milliseconds: number;
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}
|
|
35
|
+
export interface FormatConfig {
|
|
36
|
+
rows: GanttRow[];
|
|
37
|
+
minWidth: number;
|
|
38
|
+
rowHeight: number;
|
|
39
|
+
rowPadding: number;
|
|
40
|
+
}
|
|
41
|
+
export interface Tick {
|
|
42
|
+
date: DateTime;
|
|
43
|
+
x: number;
|
|
44
|
+
width: number;
|
|
45
|
+
label: string;
|
|
46
|
+
align: "start" | "middle" | string;
|
|
47
|
+
}
|
|
48
|
+
export interface Group {
|
|
49
|
+
date: DateTime;
|
|
50
|
+
x: number;
|
|
51
|
+
width: number;
|
|
52
|
+
label: string;
|
|
53
|
+
labelX: number;
|
|
54
|
+
labelTextAnchor: "start" | "middle" | "end";
|
|
55
|
+
}
|
|
56
|
+
export interface Scale {
|
|
57
|
+
tick: {
|
|
58
|
+
step: DateTimeUnit;
|
|
59
|
+
format: string;
|
|
60
|
+
size: number;
|
|
61
|
+
align: "start" | "middle" | string;
|
|
62
|
+
};
|
|
63
|
+
group: {
|
|
64
|
+
step: DateTimeUnit;
|
|
65
|
+
format: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
import BaseGantt from './BaseGantt.vue';
|
|
3
|
+
import defaultColors from 'tailwindcss/colors';
|
|
4
|
+
import { Icon } from '@iconify/vue';
|
|
5
|
+
import BaseCard from './BaseCard.vue';
|
|
6
|
+
import { random } from 'lodash';
|
|
7
|
+
|
|
8
|
+
const rows = [];
|
|
9
|
+
|
|
10
|
+
for (let i = 0; i < 10; i++) {
|
|
11
|
+
|
|
12
|
+
const items = [];
|
|
13
|
+
|
|
14
|
+
for (let j = 0; j < 3; j++) {
|
|
15
|
+
|
|
16
|
+
const start = DateTime.now().plus({ days: j * 1 });
|
|
17
|
+
const end = start.plus({ days: 0.5 });
|
|
18
|
+
|
|
19
|
+
const colors = ['blue', 'green', 'red', 'yellow', 'indigo', 'pink', 'purple', 'gray'];
|
|
20
|
+
|
|
21
|
+
const colorKey = random(0, colors.length - 1);
|
|
22
|
+
|
|
23
|
+
const color = defaultColors[colors[colorKey]][500];
|
|
24
|
+
|
|
25
|
+
items.push({
|
|
26
|
+
id: j + 1,
|
|
27
|
+
name: `Item ${j + 1}`,
|
|
28
|
+
start: start.toISO(),
|
|
29
|
+
end: end.toISO(),
|
|
30
|
+
color: color,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
rows.push({
|
|
35
|
+
id: i + 1,
|
|
36
|
+
name: `Project ${i + 1}`,
|
|
37
|
+
items: items,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
title: 'Form/BaseGantt',
|
|
44
|
+
component: BaseGantt,
|
|
45
|
+
args: {
|
|
46
|
+
rows,
|
|
47
|
+
maxHeight: 300,
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const Template = (args) => ({
|
|
52
|
+
components: {
|
|
53
|
+
BaseCard,
|
|
54
|
+
BaseGantt,
|
|
55
|
+
},
|
|
56
|
+
setup() {
|
|
57
|
+
|
|
58
|
+
function onItemClick(item) {
|
|
59
|
+
alert(`Item "${item.name}" clicked`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { args, onItemClick };
|
|
63
|
+
},
|
|
64
|
+
template: `
|
|
65
|
+
<BaseCard clipped>
|
|
66
|
+
<BaseGantt v-bind="args" @item:click="onItemClick">
|
|
67
|
+
</BaseGantt>
|
|
68
|
+
</BaseCard>
|
|
69
|
+
`,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const Demo = Template.bind({});
|
|
73
|
+
Demo.args = {};
|
|
74
|
+
|
|
75
|
+
const SlotItemTemplate = (args) => ({
|
|
76
|
+
components: {
|
|
77
|
+
BaseCard,
|
|
78
|
+
BaseGantt,
|
|
79
|
+
},
|
|
80
|
+
setup() {
|
|
81
|
+
function onItemClick(item) {
|
|
82
|
+
alert(`Item "${item.name}" clicked`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return { args, onItemClick };
|
|
86
|
+
},
|
|
87
|
+
template: `
|
|
88
|
+
<BaseCard clipped>
|
|
89
|
+
<BaseGantt v-bind="args" @item:click="onItemClick">
|
|
90
|
+
<template #item="{ item }">
|
|
91
|
+
<div class="flex w-full h-full items-center overflow-hidden hover:opacity-80 duration-200 bg-slate-100 hover:bg-slate-200 border border-slate-300 rounded-full">
|
|
92
|
+
<div class="flex items-center justify-center">
|
|
93
|
+
<span class="h-2 w-2 rounded-full shrink-0 mr-2 ml-2" :style="{backgroundColor: item.color}"></span>
|
|
94
|
+
<span class="truncate text-[10px] font-semibold uppercase"> {{ item.name }} </span>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
</BaseGantt>
|
|
99
|
+
</BaseCard>
|
|
100
|
+
`,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const SlotItem = SlotItemTemplate.bind({});
|
|
104
|
+
SlotItem.args = {};
|
|
105
|
+
|
|
106
|
+
const SlotSidebarItemTemplate = (args) => ({
|
|
107
|
+
components: {
|
|
108
|
+
BaseCard,
|
|
109
|
+
BaseGantt,
|
|
110
|
+
Icon,
|
|
111
|
+
},
|
|
112
|
+
setup() {
|
|
113
|
+
return { args };
|
|
114
|
+
},
|
|
115
|
+
template: `
|
|
116
|
+
<BaseCard clipped>
|
|
117
|
+
<BaseGantt v-bind="args" @item:click="onItemClick">
|
|
118
|
+
<template #sidebarItem="{ row }">
|
|
119
|
+
<button class="flex items-center px-3 bg-slate-100 hover:bg-slate-300 w-full">
|
|
120
|
+
<Icon class="mr-2 h-4 w-4 text-slate-600" icon="heroicons:folder-solid" />
|
|
121
|
+
<span class="text-xs font-semibold"> {{ row.name }} </span>
|
|
122
|
+
</button>
|
|
123
|
+
</template>
|
|
124
|
+
</BaseGantt>
|
|
125
|
+
</BaseCard>
|
|
126
|
+
`,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export const SlotSidebarItem = SlotSidebarItemTemplate.bind({});
|
|
130
|
+
SlotSidebarItem.args = {};
|