@empathyco/x-components
Version:
Empathy X Components
67 lines (64 loc) • 2.15 kB
JavaScript
import _sfc_main from './base-rating.vue2.js';
import { resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, renderSlot, createBlock, normalizeStyle } from 'vue';
import './base-rating.vue3.js';
import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
const _hoisted_1 = ["aria-label"];
const _hoisted_2 = {
class: "x-rating--empty",
"data-test": "rating-empty"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_DefaultIcon = resolveComponent("DefaultIcon");
return openBlock(), createElementBlock("span", {
class: "x-rating",
role: "img",
"aria-label": _ctx.ariaLabel,
"data-test": "rating"
}, [
createElementVNode("div", _hoisted_2, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.max, (i) => {
return renderSlot(_ctx.$slots, "empty-icon", {}, () => [
(openBlock(), createBlock(_component_DefaultIcon, {
key: i,
class: "x-rating__default-icon x-rating__default-icon--empty"
}))
], true);
}),
256
/* UNKEYED_FRAGMENT */
))
]),
createElementVNode(
"div",
{
class: "x-rating--filled",
style: normalizeStyle({ width: _ctx.calculateFilledWrapperWidth }),
"data-test": "rating-filled"
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.max, (i) => {
return renderSlot(_ctx.$slots, "filled-icon", {}, () => [
(openBlock(), createBlock(_component_DefaultIcon, {
key: i,
class: "x-rating__default-icon x-rating__default-icon--filled"
}))
], true);
}),
256
/* UNKEYED_FRAGMENT */
))
],
4
/* STYLE */
)
], 8, _hoisted_1);
}
var BaseRating = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f3b7cb68"]]);
export { BaseRating as default };
//# sourceMappingURL=base-rating.vue.js.map