@empathyco/x-components
Version:
Empathy X Components
84 lines (81 loc) • 3.57 kB
JavaScript
import _sfc_main from './my-history.vue2.js';
import { resolveComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList, renderSlot, createElementVNode, toDisplayString, createVNode, normalizeClass, mergeProps, createTextVNode, createCommentVNode } from 'vue';
import './my-history.vue3.js';
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
const _hoisted_1 = {
class: "x-my-history-item__date",
"data-test": "my-history-date"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_HistoryQuery = resolveComponent("HistoryQuery");
const _component_BaseSuggestions = resolveComponent("BaseSuggestions");
return _ctx.hasHistoryQueries ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.animation), {
key: 0,
class: "x-my-history",
tag: "ul"
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.groupByDate, (queries, date) => {
return openBlock(), createElementBlock("li", {
key: date,
class: "x-my-history-item",
"data-test": "my-history-item"
}, [
renderSlot(_ctx.$slots, "date", { date }, () => [
createElementVNode(
"span",
_hoisted_1,
toDisplayString(date),
1
/* TEXT */
)
], true),
createVNode(_component_BaseSuggestions, {
suggestions: queries,
class: normalizeClass(["x-my-history-queries", _ctx.queriesListClass]),
"data-test": "my-history-queries",
animation: _ctx.animation
}, {
default: withCtx(({ suggestion, index }) => [
renderSlot(_ctx.$slots, "suggestion", mergeProps({ ref_for: true }, { suggestion, index, formatTime: _ctx.formatTime }), () => [
createVNode(_component_HistoryQuery, {
suggestion,
"data-test": "history-query-item",
class: "x-history-queries__item x-suggestion"
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "suggestion-content", mergeProps({ ref_for: true }, { suggestion, index, formatTime: _ctx.formatTime }), () => [
createTextVNode(
toDisplayString(suggestion.query) + " - " + toDisplayString(_ctx.formatTime(suggestion.timestamp)),
1
/* TEXT */
)
], true)
]),
"remove-button-content": withCtx(() => [
renderSlot(_ctx.$slots, "suggestion-remove-content", mergeProps({ ref_for: true }, { suggestion, index }), void 0, true)
]),
_: 2
/* DYNAMIC */
}, 1032, ["suggestion"])
], true)
]),
_: 2
/* DYNAMIC */
}, 1032, ["suggestions", "class", "animation"])
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 3
/* FORWARDED */
})) : createCommentVNode("v-if", true);
}
var myHistory = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3525044a"]]);
export { myHistory as default };
//# sourceMappingURL=my-history.vue.js.map