@nextcloud/vue
Version:
Nextcloud vue components
23 lines (22 loc) • 1.4 kB
JavaScript
import "../assets/index51.css";
import { n as i } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const r = { name: "NcAppSidebarTab", inject: ["registerTab", "unregisterTab", "getActiveTab"], props: { id: { type: String, required: !0 }, name: { type: String, required: !0 }, icon: { type: String, default: "" }, order: { type: Number, default: 0 } }, emits: ["bottom-reached", "scroll"], expose: ["id", "name", "icon", "order", "renderIcon"], computed: { isActive() {
return this.getActiveTab() === this.id;
} }, created() {
this.registerTab(this);
}, beforeDestroy() {
this.unregisterTab(this.id);
}, methods: { onScroll(e) {
this.$el.scrollHeight - this.$el.scrollTop === this.$el.clientHeight && this.$emit("bottom-reached", e), this.$emit("scroll", e);
}, renderIcon() {
var e, t;
return (t = (e = this.$scopedSlots).icon) == null ? void 0 : t.call(e);
} } };
var s = function() {
var e = this, t = e._self._c;
return t("section", { staticClass: "app-sidebar__tab", class: { "app-sidebar__tab--active": e.isActive }, attrs: { id: `tab-${e.id}`, "aria-hidden": !e.isActive, "aria-labelledby": e.id, tabindex: "0", role: "tabpanel" }, on: { scroll: e.onScroll } }, [t("h3", { staticClass: "hidden-visually" }, [e._v(" " + e._s(e.name) + " ")]), e._t("default")], 2);
}, a = [], o = i(r, s, a, !1, null, "24771dcd", null, null);
const c = o.exports;
export {
c as default
};