@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
69 lines (68 loc) • 1.98 kB
JavaScript
import { getUniqueString } from "../../common/utils.js";
import { openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
const _sfc_main = {
compatConfig: { MODE: 3 },
name: "DtListItemGroup",
props: {
/**
* Id of the List Item Group
*/
id: {
type: String,
default() {
return getUniqueString();
}
},
/**
* List's heading.
*/
heading: {
type: String,
default: ""
},
/**
* Additional class to style the heading
*/
headingClass: {
type: [String, Array, Object],
default: ""
},
/**
* Additional class for the wrapper list element.
*/
listClass: {
type: [String, Array, Object],
default: ""
}
}
};
const _hoisted_1 = ["id", "aria-labelledby"];
const _hoisted_2 = ["id"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("ul", {
id: $props.id,
class: normalizeClass(["d-list-item-group", $props.listClass]),
role: "group",
"data-qa": "dt-dropdown-list-wrapper",
"aria-labelledby": `${$props.id}-heading`
}, [
$props.heading ? (openBlock(), createElementBlock("li", {
key: 0,
id: `${$props.id}-heading`,
role: "presentation",
"data-qa": "dt-dropdown-list-heading",
class: normalizeClass(["dt-dropdown-list--header", $props.headingClass])
}, [
renderSlot(_ctx.$slots, "headingSlot", {}, () => [
createTextVNode(toDisplayString($props.heading), 1)
])
], 10, _hoisted_2)) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_1);
}
const list_item_group = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
list_item_group as default
};
//# sourceMappingURL=list_item_group.vue.js.map