@vc-shell/framework 1.0.164 → 1.0.166
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/CHANGELOG.md +23 -0
- package/core/composables/index.ts +1 -0
- package/core/composables/useAsync/index.ts +4 -3
- package/core/composables/useBreadcrumbs/index.ts +75 -0
- package/dist/core/composables/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useAsync/index.d.ts +1 -1
- package/dist/core/composables/useAsync/index.d.ts.map +1 -1
- package/dist/core/composables/useBreadcrumbs/index.d.ts +18 -0
- package/dist/core/composables/useBreadcrumbs/index.d.ts.map +1 -0
- package/dist/framework.js +3626 -3574
- package/dist/index.css +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +5 -5
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts +3 -3
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +9 -3
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +9 -9
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +10 -4
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue.d.ts +20 -52
- package/dist/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/index.d.ts +3 -21
- package/dist/ui/components/molecules/vc-breadcrumbs/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts +3 -14
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +3 -6
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +6 -0
- package/dist/ui/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/shared/modules/dynamic/components/fields/GalleryField.ts +2 -2
- package/shared/modules/dynamic/components/fields/ImageField.ts +2 -2
- package/shared/modules/dynamic/components/fields/VideoField.ts +2 -2
- package/shared/modules/dynamic/factories/base/useListFactory.ts +6 -6
- package/shared/modules/dynamic/factories/types/index.ts +12 -4
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +8 -6
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +39 -12
- package/shared/modules/dynamic/types/index.ts +0 -2
- package/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +11 -27
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +3 -3
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +4 -9
- package/ui/components/molecules/vc-field/vc-field.vue +0 -1
- package/ui/components/molecules/vc-rating/vc-rating.vue +1 -1
- package/ui/components/molecules/vc-select/vc-select.vue +13 -8
- package/ui/components/organisms/vc-table/vc-table.vue +0 -2
- package/ui/types/index.ts +6 -1
package/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue
CHANGED
|
@@ -19,36 +19,20 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
|
+
import { Breadcrumbs } from "../../../../../types";
|
|
22
23
|
import { VcIcon } from "./../../../../";
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
current:
|
|
26
|
-
|
|
27
|
-
default: false,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
icon: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: undefined,
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
title: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: undefined,
|
|
38
|
-
},
|
|
25
|
+
export interface Props extends Breadcrumbs {
|
|
26
|
+
current: boolean;
|
|
27
|
+
}
|
|
39
28
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
29
|
+
export interface Emits {
|
|
30
|
+
(event: "click"): void;
|
|
31
|
+
}
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
type: String,
|
|
47
|
-
default: undefined,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
33
|
+
const props = defineProps<Props>();
|
|
50
34
|
|
|
51
|
-
const emit = defineEmits(
|
|
35
|
+
const emit = defineEmits<Emits>();
|
|
52
36
|
|
|
53
37
|
function onClick(): void {
|
|
54
38
|
if (!props.current) {
|
|
@@ -74,12 +58,12 @@ function onClick(): void {
|
|
|
74
58
|
|
|
75
59
|
.vc-breadcrumbs-item {
|
|
76
60
|
@apply tw-h-[var(--breadcrumbs-item-height)]
|
|
77
|
-
tw-box-border tw-rounded-[
|
|
61
|
+
tw-box-border tw-rounded-[3px]
|
|
78
62
|
tw-border tw-border-solid
|
|
79
63
|
tw-border-[color:var(--breadcrumbs-item-border-color)]
|
|
80
64
|
tw-text-[color:var(--breadcrumbs-item-color)]
|
|
81
65
|
tw-whitespace-nowrap
|
|
82
|
-
tw-px-3
|
|
66
|
+
tw-px-3
|
|
83
67
|
tw-text-sm tw-cursor-pointer tw-inline-flex tw-items-center
|
|
84
68
|
hover:tw-border
|
|
85
69
|
hover:tw-border-solid
|
|
@@ -23,17 +23,17 @@ export const Primary: Story = {
|
|
|
23
23
|
id: "0",
|
|
24
24
|
title: "Back",
|
|
25
25
|
icon: "fas fa-arrow-left",
|
|
26
|
-
current: false,
|
|
26
|
+
// current: false,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
id: "1",
|
|
30
30
|
title: "Electronics",
|
|
31
|
-
current: false,
|
|
31
|
+
// current: false,
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: "2",
|
|
35
35
|
title: "Desktop",
|
|
36
|
-
current: true,
|
|
36
|
+
// current: true,
|
|
37
37
|
},
|
|
38
38
|
],
|
|
39
39
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
v-if="items"
|
|
4
|
-
class="tw-flex tw-items-center tw-flex-
|
|
3
|
+
v-if="items && items.length"
|
|
4
|
+
class="tw-flex tw-items-center tw-flex-wrap tw-gap-[10px]"
|
|
5
5
|
>
|
|
6
6
|
<VcBreadcrumbsItem
|
|
7
7
|
v-for="(item, i) in items"
|
|
@@ -13,16 +13,11 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script lang="ts" setup>
|
|
16
|
+
import { Breadcrumbs } from "../../../types";
|
|
16
17
|
import VcBreadcrumbsItem from "./_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue";
|
|
17
18
|
|
|
18
19
|
export interface Props {
|
|
19
|
-
items?:
|
|
20
|
-
current: boolean;
|
|
21
|
-
icon?: string;
|
|
22
|
-
title: string;
|
|
23
|
-
clickHandler?: () => void;
|
|
24
|
-
id: string;
|
|
25
|
-
}[];
|
|
20
|
+
items?: Breadcrumbs[];
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
withDefaults(defineProps<Props>(), {
|
|
@@ -514,7 +514,7 @@ const defaultValue = ref<Option[]>([]) as Ref<Option[]>;
|
|
|
514
514
|
|
|
515
515
|
const optionsList = ref<Option[]>([]) as Ref<Option[]>;
|
|
516
516
|
|
|
517
|
-
const
|
|
517
|
+
// const optionsList = ref<Option[]>([]) as Ref<Option[]>;
|
|
518
518
|
|
|
519
519
|
const totalItems = ref();
|
|
520
520
|
|
|
@@ -525,7 +525,7 @@ let innerValueCache: Option[];
|
|
|
525
525
|
useIntersectionObserver(
|
|
526
526
|
el,
|
|
527
527
|
([{ isIntersecting }]) => {
|
|
528
|
-
if (isIntersecting) {
|
|
528
|
+
if (isIntersecting && hasNextPage.value) {
|
|
529
529
|
onLoadMore();
|
|
530
530
|
}
|
|
531
531
|
},
|
|
@@ -607,7 +607,7 @@ watch(
|
|
|
607
607
|
watch(
|
|
608
608
|
() => optionsList.value,
|
|
609
609
|
(newVal) => {
|
|
610
|
-
|
|
610
|
+
optionsList.value = newVal;
|
|
611
611
|
},
|
|
612
612
|
{ immediate: true, deep: true },
|
|
613
613
|
);
|
|
@@ -627,6 +627,7 @@ async function onLoadMore() {
|
|
|
627
627
|
listLoading.value = true;
|
|
628
628
|
const data = await props.options(filterString.value, optionsList.value.length);
|
|
629
629
|
optionsList.value.push(...(data.results as Option[]));
|
|
630
|
+
totalItems.value = data.totalCount;
|
|
630
631
|
} finally {
|
|
631
632
|
listLoading.value = false;
|
|
632
633
|
}
|
|
@@ -693,7 +694,7 @@ const hasValue = computed(() => fieldValueIsFilled(innerValue.value));
|
|
|
693
694
|
const innerOptionsValue = computed(() => innerValue.value.map((opt) => getOptionValue.value(opt)));
|
|
694
695
|
|
|
695
696
|
const optionScope = computed(() => {
|
|
696
|
-
return
|
|
697
|
+
return optionsList.value.map((opt, i) => {
|
|
697
698
|
return {
|
|
698
699
|
index: i,
|
|
699
700
|
opt,
|
|
@@ -759,9 +760,11 @@ function closeDropdown() {
|
|
|
759
760
|
|
|
760
761
|
const onDropdownClose = async () => {
|
|
761
762
|
if (props.options && typeof props.options === "function") {
|
|
762
|
-
|
|
763
|
+
const data = await props.options();
|
|
764
|
+
optionsList.value = data.results as Option[];
|
|
765
|
+
totalItems.value = data.totalCount;
|
|
763
766
|
} else {
|
|
764
|
-
|
|
767
|
+
optionsList.value = props.options as Option[];
|
|
765
768
|
}
|
|
766
769
|
|
|
767
770
|
filterString.value = undefined;
|
|
@@ -857,12 +860,14 @@ async function onSearch(value: string) {
|
|
|
857
860
|
if (props.options && typeof props.options === "function") {
|
|
858
861
|
try {
|
|
859
862
|
listLoading.value = true;
|
|
860
|
-
|
|
863
|
+
const data = await props.options(filterString.value);
|
|
864
|
+
optionsList.value = data.results as Option[];
|
|
865
|
+
totalItems.value = data.totalCount;
|
|
861
866
|
} finally {
|
|
862
867
|
listLoading.value = false;
|
|
863
868
|
}
|
|
864
869
|
} else {
|
|
865
|
-
|
|
870
|
+
optionsList.value = optionsList.value.filter((x: Option) => {
|
|
866
871
|
return (x[props.optionLabel as keyof Option] as string).toLowerCase().includes(filterString.value.toLowerCase());
|
|
867
872
|
});
|
|
868
873
|
}
|
|
@@ -507,7 +507,6 @@ const props = withDefaults(
|
|
|
507
507
|
pages: 0,
|
|
508
508
|
expanded: true,
|
|
509
509
|
currentPage: 0,
|
|
510
|
-
selectedItemId: undefined,
|
|
511
510
|
header: true,
|
|
512
511
|
footer: true,
|
|
513
512
|
activeFilterCount: 0,
|
|
@@ -526,7 +525,6 @@ const emit = defineEmits<{
|
|
|
526
525
|
selectionChanged: [values: T[]];
|
|
527
526
|
"search:change": [value: string | number | Date | null | undefined];
|
|
528
527
|
headerClick: [item: ITableColumns];
|
|
529
|
-
value: [Record<string, unknown>];
|
|
530
528
|
itemClick: [item: T];
|
|
531
529
|
"scroll:ptr": [];
|
|
532
530
|
"row:reorder": [args: { dragIndex: number; dropIndex: number; value: T[] }];
|
package/ui/types/index.ts
CHANGED
|
@@ -10,4 +10,9 @@ declare module "vue" {
|
|
|
10
10
|
export interface GlobalComponents extends TGlobalComponents<typeof components> {}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export {
|
|
13
|
+
export interface Breadcrumbs {
|
|
14
|
+
icon?: string;
|
|
15
|
+
title: string;
|
|
16
|
+
clickHandler?: (id: string) => void | Promise<void>;
|
|
17
|
+
id: string;
|
|
18
|
+
}
|