sprintify-ui 0.8.52 → 0.8.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.
|
@@ -8,19 +8,19 @@ export interface GanttItem {
|
|
|
8
8
|
color: string;
|
|
9
9
|
}
|
|
10
10
|
export interface GanttRow {
|
|
11
|
-
id: number;
|
|
11
|
+
id: number | string;
|
|
12
12
|
name: string;
|
|
13
13
|
meta?: Record<string, unknown>;
|
|
14
14
|
items: GanttItem[];
|
|
15
15
|
}
|
|
16
16
|
export interface GanttRowFormatted {
|
|
17
|
-
id: number;
|
|
17
|
+
id: number | string;
|
|
18
18
|
name: string;
|
|
19
19
|
meta?: Record<string, unknown>;
|
|
20
20
|
items: GanttItemFormatted[];
|
|
21
21
|
}
|
|
22
22
|
export interface GanttItemFormatted {
|
|
23
|
-
id: number;
|
|
23
|
+
id: number | string;
|
|
24
24
|
start: DateTime;
|
|
25
25
|
end: DateTime;
|
|
26
26
|
name: string;
|
package/package.json
CHANGED
|
@@ -13,8 +13,8 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
args: {
|
|
16
|
-
url: "https://
|
|
17
|
-
labelKey: "
|
|
16
|
+
url: "https://faker.witify.io/api/todos",
|
|
17
|
+
labelKey: "name",
|
|
18
18
|
valueKey: "id",
|
|
19
19
|
},
|
|
20
20
|
decorators: [() => ({ template: '<div class="mb-36"><story/></div>' })],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { NormalizedOption, RawOption } from '@/types';
|
|
3
|
-
import { isArray, isObject } from 'lodash';
|
|
3
|
+
import { get, isArray, isObject } from 'lodash';
|
|
4
4
|
|
|
5
5
|
export function useHasOptions(
|
|
6
6
|
modelValue: Ref<RawOption[] | RawOption | null | undefined>,
|
|
@@ -17,8 +17,8 @@ export function useHasOptions(
|
|
|
17
17
|
}
|
|
18
18
|
return modelValue.value.map((option) => {
|
|
19
19
|
return {
|
|
20
|
-
label: option
|
|
21
|
-
value: option
|
|
20
|
+
label: get(option, labelKey.value) as string,
|
|
21
|
+
value: get(option, valueKey.value) as string | number,
|
|
22
22
|
option: option,
|
|
23
23
|
} as NormalizedOption;
|
|
24
24
|
});
|
|
@@ -28,8 +28,8 @@ export function useHasOptions(
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return {
|
|
31
|
-
label: modelValue.value
|
|
32
|
-
value: modelValue.value
|
|
31
|
+
label: get(modelValue.value, labelKey.value as never, '') as string,
|
|
32
|
+
value: get(modelValue.value, valueKey.value as never) as string | number,
|
|
33
33
|
option: modelValue.value,
|
|
34
34
|
} as NormalizedOption;
|
|
35
35
|
}
|
|
@@ -39,8 +39,8 @@ export function useHasOptions(
|
|
|
39
39
|
const normalizedOptions = computed((): NormalizedOption[] => {
|
|
40
40
|
return options.value.map((option) => {
|
|
41
41
|
return {
|
|
42
|
-
label: option
|
|
43
|
-
value: option
|
|
42
|
+
label: get(option, labelKey.value, '') as string,
|
|
43
|
+
value: get(option, valueKey.value) as string | number,
|
|
44
44
|
option: option,
|
|
45
45
|
} as NormalizedOption;
|
|
46
46
|
});
|
|
@@ -10,21 +10,21 @@ export interface GanttItem {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface GanttRow {
|
|
13
|
-
id: number;
|
|
13
|
+
id: number | string;
|
|
14
14
|
name: string;
|
|
15
15
|
meta?: Record<string, unknown>;
|
|
16
16
|
items: GanttItem[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface GanttRowFormatted {
|
|
20
|
-
id: number;
|
|
20
|
+
id: number | string;
|
|
21
21
|
name: string;
|
|
22
22
|
meta?: Record<string, unknown>;
|
|
23
23
|
items: GanttItemFormatted[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface GanttItemFormatted {
|
|
27
|
-
id: number;
|
|
27
|
+
id: number | string;
|
|
28
28
|
start: DateTime;
|
|
29
29
|
end: DateTime;
|
|
30
30
|
name: string;
|