From 5db57f5d6c5c1515f41a7dd0106dfd6ec6a9cf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= Date: Fri, 17 Jan 2025 16:04:55 +0100 Subject: [PATCH 1/8] feat: add component --- components/ALinearBreadCrumb.vue | 96 +++++++++++++++++++ .../components/ALinearBreadCrumb.story.vue | 37 +++++++ 2 files changed, 133 insertions(+) create mode 100644 components/ALinearBreadCrumb.vue create mode 100644 stories/components/ALinearBreadCrumb.story.vue diff --git a/components/ALinearBreadCrumb.vue b/components/ALinearBreadCrumb.vue new file mode 100644 index 0000000..a42e5fa --- /dev/null +++ b/components/ALinearBreadCrumb.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/stories/components/ALinearBreadCrumb.story.vue b/stories/components/ALinearBreadCrumb.story.vue new file mode 100644 index 0000000..889d257 --- /dev/null +++ b/stories/components/ALinearBreadCrumb.story.vue @@ -0,0 +1,37 @@ + + + + + +# ATabs + +The `ATabs` component allows you to create a set of tabs with customizable styling. + +## Usage + +The `ATabs` component offers the following options: + +- `tabs` (array, required): A list of objects representing the tabs. Each object should have a `label` (string) and a `value` (string). The `icon` (string) option is optional. + From b3dee94fbb5c00847bea20cd1aa34f6614a69d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= Date: Fri, 24 Jan 2025 11:59:04 +0100 Subject: [PATCH 2/8] feat: update path, separator and story --- components/ALinearBreadCrumb.vue | 20 +++++++++++-------- .../components/ALinearBreadCrumb.story.vue | 19 ++++++++++++------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/components/ALinearBreadCrumb.vue b/components/ALinearBreadCrumb.vue index a42e5fa..e64d796 100644 --- a/components/ALinearBreadCrumb.vue +++ b/components/ALinearBreadCrumb.vue @@ -2,32 +2,36 @@ import { computed } from "vue"; const props = defineProps({ - pathSegments: { - type: Array as () => string[], + path: { + type: String, required: true, }, root: { type: String, default: "Home", }, - path: { + splitChar: { type: String, - required: true, + default: "/", }, separator: { type: String, - default: ">", + default: "/", }, }); const emit = defineEmits(["updatePath"]); +const pathSegments = computed(() => + props.path.split(props.splitChar).filter(Boolean) +); + const goToFolderLevel = (level: number) => { - const newPath = props.pathSegments.slice(0, level + 1).join("/"); - emit("updatePath", level); + const newPath = pathSegments.value.slice(0, level + 1).join(props.splitChar); + emit("updatePath", newPath); }; -const isBreadcrumbEmpty = computed(() => props.pathSegments?.length === 0); +const isBreadcrumbEmpty = computed(() => pathSegments.value.length === 0);