{"version":3,"file":"tabs.cjs","sources":["../../src/components/tabs/TabItem.vue","../../src/components/tabs/Tabs.vue","../../src/components/tabs/index.ts"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T, C extends Component\">\nimport { computed, ref, useSlots, useId, type Component } from \"vue\";\n\nimport PlainButton from \"../utils/PlainButton\";\n\nimport { getDefault } from \"@/utils/config\";\nimport { defineClasses, useProviderChild } from \"@/composables\";\n\nimport type { TabsComponent, TabItemComponent } from \"./types\";\nimport type { TabItemProps } from \"./props\";\n\n/**\n * An tab item used by the tabs component.\n * @displayName Tab Item\n */\ndefineOptions({\n    isOruga: true,\n    name: \"OTabItem\",\n    configField: \"tabs\",\n    inheritAttrs: false,\n});\n\nconst props = withDefaults(defineProps<TabItemProps<T, C>>(), {\n    override: undefined,\n    value: undefined,\n    label: undefined,\n    disabled: false,\n    visible: true,\n    icon: () => getDefault(\"tabs.icon\"),\n    iconPack: () => getDefault(\"tabs.iconPack\"),\n    tag: () => getDefault(\"tabs.itemTag\", PlainButton),\n    content: undefined,\n    component: undefined,\n    props: undefined,\n    events: undefined,\n});\n\nconst emits = defineEmits<{\n    /** on tab item activate event */\n    activate: [];\n    /** on tab item deactivate event */\n    deactivate: [];\n}>();\n\nconst itemValue = props.value ?? useId();\n\nconst slots = useSlots();\n\n// provided data is a computed ref to ensure reactivity\nconst providedData = computed<TabItemComponent<T>>(() => ({\n    ...props,\n    value: itemValue,\n    $slots: slots,\n    tabClasses: tabClasses.value,\n    iconClasses: tabIconClasses.value,\n    labelClasses: tabLabelClasses.value,\n    isTransitioning: isTransitioning.value,\n    activate,\n    deactivate,\n}));\n\n/** inject functionalities and data from the parent component */\nconst { parent, item } = useProviderChild<TabsComponent, TabItemComponent<T>>({\n    data: providedData,\n});\n\nconst transitionName = ref();\n\nconst isActive = computed(() => item.value.index === parent.value.activeIndex);\n\nconst isTransitioning = ref(false);\n\nconst nextAnimation = computed(() => {\n    const idx =\n        parent.value.vertical && parent.value.animation.length === 4 ? 2 : 0;\n    return parent.value.animation[idx];\n});\n\nconst prevAnimation = computed(() => {\n    const idx =\n        parent.value.vertical && parent.value.animation.length === 4 ? 3 : 1;\n    return parent.value.animation[idx];\n});\n\n/** Activate element, alter animation name based on the index. */\nfunction activate(oldIndex: number): void {\n    transitionName.value =\n        item.value.index < oldIndex ? nextAnimation.value : prevAnimation.value;\n\n    // emit event\n    emits(\"activate\");\n}\n\n/** Deactivate element, alter animation name based on the index. */\nfunction deactivate(newIndex: number): void {\n    transitionName.value =\n        newIndex < item.value.index ? nextAnimation.value : prevAnimation.value;\n\n    // emit event\n    emits(\"deactivate\");\n}\n\n/** Transition after-enter hook */\nfunction afterEnter(): void {\n    isTransitioning.value = true;\n}\n\n/** Transition before-leave hook */\nfunction beforeLeave(): void {\n    isTransitioning.value = true;\n}\n\n// --- Computed Component Classes ---\n\nconst tabClasses = defineClasses(\n    [\"tabClass\", \"o-tabs__tab\"],\n    [\"tabActiveClass\", \"o-tabs__tab--active\", null, isActive],\n    [\n        \"tabDisabledClass\",\n        \"o-tabs__tab--disabled\",\n        null,\n        computed(() => props.disabled),\n    ],\n    [\n        \"tabPreviousClass\",\n        \"o-tabs__tab--previous\",\n        null,\n        computed(() => item.value.index < parent.value?.activeIndex),\n    ],\n    [\n        \"tabNextClass\",\n        \"o-tabs__tab--next\",\n        null,\n        computed(() => item.value.index > parent.value?.activeIndex),\n    ],\n);\n\nconst tabIconClasses = defineClasses([\"tabIconClass\", \"o-tabs__tab-icon\"]);\n\nconst tabLabelClasses = defineClasses([\"tabLabelClass\", \"o-tabs__tab-label\"]);\n\nconst panelClasses = defineClasses([\"tabPanelClass\", \"o-tabs__panel\"]);\n</script>\n\n<template>\n    <Transition\n        v-if=\"parent\"\n        :css=\"parent.animated\"\n        :name=\"transitionName\"\n        :appear=\"parent.animateInitially\"\n        @after-enter=\"afterEnter\"\n        @before-leave=\"beforeLeave\">\n        <div\n            v-show=\"isActive && visible\"\n            v-bind=\"$attrs\"\n            :id=\"`tabpanel-${item.identifier}`\"\n            data-oruga=\"tabs-item\"\n            :data-id=\"`tabs-${item.identifier}`\"\n            :class=\"panelClasses\"\n            role=\"tabpanel\"\n            :hidden=\"!isActive\"\n            :aria-labelledby=\"`tab-${item.identifier}`\"\n            aria-roledescription=\"item\">\n            <!-- \n                @slot Override tab panel content\n                @binding {boolean} active - if item is shown \n            -->\n            <slot :active=\"isActive && visible\">\n                <!-- injected component -->\n                <component\n                    :is=\"component\"\n                    v-if=\"component\"\n                    v-bind=\"$props.props\"\n                    v-on=\"$props.events || {}\" />\n\n                <!-- default content prop -->\n                <template v-else>{{ content }}</template>\n            </slot>\n\n            <!--\n                Do not render these slots here.\n                These are only for documentation purposes.\n                Slots are defined in tabs component.\n            -->\n            <template v-if=\"false\">\n                <!--\n                    @slot Override tab header label\n                    @binding {boolean} active - if item is shown \n                -->\n                <slot name=\"header\" :active=\"isActive && visible\" />\n            </template>\n        </div>\n    </Transition>\n</template>\n","<script setup lang=\"ts\" generic=\"T\">\nimport {\n    computed,\n    ref,\n    watch,\n    watchEffect,\n    toValue,\n    nextTick,\n    onMounted,\n    useTemplateRef,\n} from \"vue\";\n\nimport OTabItem from \"../tabs/TabItem.vue\";\nimport OIcon from \"../icon/Icon.vue\";\nimport OSlotComponent from \"../utils/SlotComponent\";\n\nimport { getDefault } from \"@/utils/config\";\nimport { mod, isDefined } from \"@/utils/helpers\";\nimport {\n    defineClasses,\n    normalizeOptions,\n    useProviderParent,\n    useSequentialId,\n} from \"@/composables\";\n\nimport type { TabsComponent, TabItem, TabItemComponent } from \"./types\";\nimport type { TabsProps } from \"./props\";\n\n/**\n * Responsive horizontal navigation tabs, switch between contents with ease.\n * @displayName Tabs\n * @requires ./TabItem.vue\n * @style _tabs.scss\n */\ndefineOptions({\n    isOruga: true,\n    name: \"OTabs\",\n    configField: \"tabs\",\n});\n\ntype ModelValue = TabsProps<T>[\"modelValue\"];\n\nconst props = withDefaults(defineProps<TabsProps<T>>(), {\n    override: undefined,\n    modelValue: undefined,\n    options: undefined,\n    variant: () => getDefault(\"tabs.variant\"),\n    size: () => getDefault(\"tabs.size\"),\n    vertical: () => getDefault(\"tabs.vertical\", false),\n    position: undefined,\n    type: () => getDefault(\"tabs.type\", \"default\"),\n    tag: () => getDefault(\"tabs.tag\", \"div\"),\n    expanded: false,\n    activateOnFocus: false,\n    animated: () => getDefault(\"tabs.animated\", true),\n    animation: () =>\n        getDefault(\"tabs.animation\", [\n            \"slide-next\",\n            \"slide-prev\",\n            \"slide-down\",\n            \"slide-up\",\n        ]),\n    animateInitially: () => getDefault(\"tabs.animateInitially\", false),\n    multiline: false,\n    ariaLabel: () => getDefault(\"tabs.ariaLabel\"),\n});\n\nconst emits = defineEmits<{\n    /**\n     * modelValue prop two-way binding\n     * @param value {T} updated modelValue prop\n     */\n    \"update:model-value\": [value: ModelValue];\n    /**\n     * on tab change event\n     * @param value {T} new tab value\n     * @param value {T} old tab value\n     */\n    change: [newValue: ModelValue, oldValue: ModelValue];\n}>();\n\nconst rootRef = useTemplateRef(\"rootElement\");\n\n// provided data is a computed ref to ensure reactivity\nconst provideData = computed<TabsComponent>(() => ({\n    activeIndex: activeItem.value?.index ?? 0,\n    type: props.type,\n    vertical: props.vertical,\n    animated: props.animated,\n    animation: props.animation,\n    animateInitially: props.animateInitially,\n}));\n\n/** provide functionalities and data to child item components */\nconst { childItems } = useProviderParent<TabItemComponent<T>>({\n    rootRef,\n    data: provideData,\n});\n\nconst items = computed<TabItem<T>[]>(() => {\n    if (!childItems.value) return [];\n    return childItems.value.map((column) => ({\n        index: column.index,\n        identifier: column.identifier,\n        ...toValue(column.data!),\n    }));\n});\n\n// create a unique id sequence\nconst { nextSequence } = useSequentialId();\n\n/** normalized programamtic options */\nconst normalizedOptions = computed(() =>\n    normalizeOptions<T>(props.options, nextSequence),\n);\n\n/** The selected item value, use v-model to make it two-way binding */\nconst vmodel = defineModel<ModelValue>({ default: undefined });\n\n/**  When v-model is changed set the new active tab. */\nwatch(\n    () => props.modelValue,\n    (value) => {\n        if (vmodel.value !== value) performAction(value as T);\n    },\n);\n\n/** the active item */\nconst activeItem = ref<TabItem<T>>();\n\n// set the active item immediate and every time the vmodel changes\nwatchEffect(() => {\n    activeItem.value = isDefined(vmodel.value)\n        ? items.value.find((item) => item.value === vmodel.value) ||\n          items.value[0]\n        : items.value[0];\n});\n\nconst isTransitioning = computed(() =>\n    items.value.some((item) => item.isTransitioning),\n);\n\nonMounted(() => {\n    // set first tab as default if not defined\n    if (!vmodel.value) vmodel.value = items.value[0]?.value;\n});\n\n// --- EVENT HANDLER ---\n\n/** Tab item click listener, emit input event and change active child. */\nfunction itemClick(item: TabItem<T>): void {\n    if (vmodel.value !== item.value) performAction(item.value);\n}\n\n/** Focus the next item or wrap around. */\nfunction onNext(event: KeyboardEvent, index: number): void {\n    if (\n        (props.vertical && event.key == \"ArrowDown\") ||\n        (!props.vertical && event.key == \"ArrowRight\")\n    ) {\n        const newIndex = mod(index + 1, items.value.length);\n        const item = getFirstViableItem(newIndex, true);\n        moveFocus(item);\n    }\n}\n\n/** Focus the previous item or wrap around. */\nfunction onPrev(event: KeyboardEvent, index: number): void {\n    if (\n        (props.vertical && event.key == \"ArrowUp\") ||\n        (!props.vertical && event.key == \"ArrowLeft\")\n    ) {\n        const newIndex = mod(index - 1, items.value.length);\n        const item = getFirstViableItem(newIndex, false);\n        moveFocus(item);\n    }\n}\n\n/** Focus to the first viable item. */\nfunction onHomePressed(): void {\n    if (items.value.length < 1) return;\n    const item = getFirstViableItem(0, true);\n    moveFocus(item);\n}\n\n/** Focus to the last viable item. */\nfunction onEndPressed(): void {\n    if (items.value.length < 1) return;\n    const item = getFirstViableItem(items.value.length - 1, false);\n    moveFocus(item);\n}\n\n/** Set focus on a tab item or click it if `activateOnFocus`. */\nfunction moveFocus(item: TabItem<T>): void {\n    if (props.activateOnFocus) {\n        itemClick(item);\n    } else {\n        const el = rootRef.value?.querySelector<HTMLElement>(\n            `#tab-${item.identifier}`,\n        );\n        el?.focus();\n    }\n}\n\n/**\n * Get the first 'viable' child, starting at startingIndex and in the direction specified\n * by the boolean parameter forward. In other words, first try to select the child at index\n * startingIndex, and if it is not visible or it is disabled, then go to the index in the\n * specified direction until either returning to startIndex or finding a viable child item.\n */\nfunction getFirstViableItem(\n    startingIndex: number,\n    forward: boolean,\n): TabItem<T> {\n    const direction = forward ? 1 : -1;\n    let newIndex = startingIndex;\n    for (\n        ;\n        newIndex !== activeItem.value?.index;\n        newIndex = mod(newIndex + direction, items.value.length)\n    ) {\n        // Break if the item at this index is viable (not disabled and is visible)\n        if (items.value[newIndex].visible && !items.value[newIndex].disabled)\n            break;\n    }\n\n    return items.value[newIndex];\n}\n\n/** Activate next child and deactivate prev child. */\nfunction performAction(newValue: ModelValue): void {\n    const oldValue = vmodel.value;\n    const oldItem = activeItem.value;\n    const newItem =\n        items.value.find((item) => item.value === newValue) || items.value[0];\n\n    if (oldItem && newItem) {\n        oldItem.deactivate(newItem.index);\n        newItem.activate(oldItem.index);\n    }\n\n    nextTick(() => {\n        vmodel.value = newValue;\n        emits(\"change\", newValue, oldValue);\n    });\n}\n\n// --- Computed Component Classes ---\n\nconst rootClasses = defineClasses(\n    [\"rootClass\", \"o-tabs\"],\n    [\n        \"positionClass\",\n        \"o-tabs--\",\n        computed(() => props.position),\n        computed(() => !!props.position),\n    ],\n    [\n        \"sizeClass\",\n        \"o-tabs--\",\n        computed(() => props.size),\n        computed(() => !!props.size),\n    ],\n    [\n        \"typeClass\",\n        \"o-tabs--\",\n        computed(() => props.type),\n        computed(() => !!props.type),\n    ],\n    [\"expandedClass\", \"o-tabs--expanded\", null, computed(() => props.expanded)],\n    [\"verticalClass\", \"o-tabs--vertical\", null, computed(() => props.vertical)],\n    [\n        \"multilineClass\",\n        \"o-tabs--multiline\",\n        null,\n        computed(() => props.multiline),\n    ],\n);\n\nconst tablistClasses = defineClasses([\"listClass\", \"o-tabs__list\"]);\n\nconst contentClasses = defineClasses(\n    [\"contentClass\", \"o-tabs__content\"],\n    [\n        \"transitioningClass\",\n        \"o-tabs__content--transitioning\",\n        null,\n        isTransitioning,\n    ],\n);\n</script>\n\n<template>\n    <div ref=\"rootElement\" data-oruga=\"tabs\" :class=\"rootClasses\">\n        <component\n            :is=\"props.tag\"\n            :class=\"tablistClasses\"\n            role=\"tablist\"\n            :aria-label=\"ariaLabel\"\n            :aria-orientation=\"vertical ? 'vertical' : 'horizontal'\">\n            <!--\n                @slot Additional slot before tabs\n            -->\n            <slot name=\"before\" />\n\n            <o-slot-component\n                v-for=\"childItem in items\"\n                v-show=\"childItem.visible\"\n                :id=\"`tab-${childItem.identifier}`\"\n                :key=\"childItem.identifier\"\n                :component=\"childItem\"\n                :tag=\"childItem.tag\"\n                name=\"header\"\n                :class=\"childItem.tabClasses\"\n                role=\"tab\"\n                :tabindex=\"childItem.value === activeItem?.value ? 0 : -1\"\n                :aria-current=\"\n                    childItem.value === activeItem?.value ? 'true' : undefined\n                \"\n                :aria-controls=\"`tabpanel-${childItem.identifier}`\"\n                :aria-selected=\"childItem.value === activeItem?.value\"\n                @click=\"itemClick(childItem)\"\n                @keydown.enter.prevent=\"itemClick(childItem)\"\n                @keydown.space.prevent=\"itemClick(childItem)\"\n                @keydown.left.prevent=\"onPrev($event, childItem.index)\"\n                @keydown.right.prevent=\"onNext($event, childItem.index)\"\n                @keydown.up.prevent=\"onPrev($event, childItem.index)\"\n                @keydown.down.prevent=\"onNext($event, childItem.index)\"\n                @keydown.home.prevent=\"onHomePressed\"\n                @keydown.end.prevent=\"onEndPressed\">\n                <o-icon\n                    v-if=\"childItem.icon\"\n                    :class=\"childItem.iconClasses\"\n                    :icon=\"childItem.icon\"\n                    :pack=\"childItem.iconPack\"\n                    :size=\"size\" />\n                <span :class=\"childItem.labelClasses\">\n                    {{ childItem.label }}\n                </span>\n            </o-slot-component>\n\n            <!--\n                @slot Additional slot after tabs\n            -->\n            <slot name=\"after\" />\n        </component>\n\n        <section :class=\"contentClasses\">\n            <!--\n                @slot Place tab items here\n            -->\n            <slot>\n                <o-tab-item\n                    v-for=\"option in normalizedOptions\"\n                    v-show=\"!option.hidden\"\n                    v-bind=\"option.attrs\"\n                    :key=\"option.key\"\n                    :value=\"option.value\"\n                    :label=\"option.label\" />\n            </slot>\n        </section>\n    </div>\n</template>\n","import type { App, Plugin } from \"vue\";\n\nimport Tabs from \"./Tabs.vue\";\nimport TabItem from \"./TabItem.vue\";\n\nimport { registerComponent } from \"@/utils/plugins\";\n\n/** export tabs specific types */\nexport type * from \"./types\";\n\n/** export tabs plugin */\nexport default {\n    install(app: App) {\n        registerComponent(app, Tabs);\n        registerComponent(app, TabItem);\n    },\n} as Plugin;\n\n/** export tabs components */\nexport { Tabs as OTabs, TabItem as OTabItem };\n"],"names":["useId","useSlots","computed","useProviderChild","ref","defineClasses","useTemplateRef","useProviderParent","toValue","useSequentialId","normalizeOptions","_useModel","watch","watchEffect","isDefined","onMounted","index","mod","nextTick","registerComponent","Tabs","TabItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,UAAM,QAAQ;AAed,UAAM,QAAQ;AAOR,UAAA,YAAY,MAAM,SAASA,UAAM;AAEvC,UAAM,QAAQC,IAAAA,SAAS;AAGjB,UAAA,eAAeC,IAAAA,SAA8B,OAAO;AAAA,MACtD,GAAG;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY,WAAW;AAAA,MACvB,aAAa,eAAe;AAAA,MAC5B,cAAc,gBAAgB;AAAA,MAC9B,iBAAiB,gBAAgB;AAAA,MACjC;AAAA,MACA;AAAA,IAAA,EACF;AAGF,UAAM,EAAE,QAAQ,KAAK,IAAIC,mCAAqD;AAAA,MAC1E,MAAM;AAAA,IAAA,CACT;AAED,UAAM,iBAAiBC,IAAAA,IAAI;AAErB,UAAA,WAAWF,aAAS,MAAM,KAAK,MAAM,UAAU,OAAO,MAAM,WAAW;AAEvE,UAAA,kBAAkBE,QAAI,KAAK;AAE3B,UAAA,gBA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