@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
75 lines (74 loc) • 2.04 kB
JavaScript
import { BREADCRUMBS_INVERTED_MODIFIER as l } from "./breadcrumbs-constants.js";
import i from "./breadcrumb-item.js";
import s from "../../common/utils/index.js";
import { resolveComponent as b, openBlock as t, createElementBlock as n, normalizeClass as f, createElementVNode as _, renderSlot as p, Fragment as B, renderList as E, createBlock as v, mergeProps as D } from "vue";
import { _ as I } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
const g = {
compatConfig: { MODE: 3 },
name: "DtBreadcrumbs",
components: {
DtBreadcrumbItem: i
},
props: {
/**
* A provided list of breadcrumbs. Overridden by default slot
*/
breadcrumbs: {
type: Array,
default: () => [],
validate(r) {
return r.every(({ href: a, label: e }) => a !== void 0 && e !== void 0);
}
},
/**
* Passed through to link. If true, applies inverted styles to the link.
* @values true, false
*/
inverted: {
type: Boolean,
default: !1
},
/**
* Descriptive label for the navigation content.
*/
ariaLabel: {
type: String,
default: "breadcrumb"
}
},
data() {
return {
BREADCRUMBS_INVERTED_MODIFIER: l
};
},
methods: {
getBreadcrumbItemKey(r) {
return `breadcrumbs-item-${r}-${s.getUniqueString()}`;
}
}
}, y = ["aria-label"];
function R(r, a, e, C, d, m) {
const o = b("dt-breadcrumb-item");
return t(), n("nav", {
"aria-label": e.ariaLabel,
"data-qa": "dt-breadcrumbs",
class: f([
"d-breadcrumbs",
{ [d.BREADCRUMBS_INVERTED_MODIFIER]: e.inverted }
])
}, [
_("ol", null, [
p(r.$slots, "default", {}, () => [
(t(!0), n(B, null, E(e.breadcrumbs, (u, c) => (t(), v(o, D({
key: m.getBreadcrumbItemKey(c),
inverted: e.inverted
}, u), null, 16, ["inverted"]))), 128))
])
])
], 10, y);
}
const F = /* @__PURE__ */ I(g, [["render", R]]);
export {
F as default
};
//# sourceMappingURL=breadcrumbs.js.map