@empathyco/x-components 6.0.0-alpha.34 → 6.0.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,14 @@
1
1
  import _sfc_main from './page-loader-button.vue2.js';
2
2
  import { resolveComponent, openBlock, createElementBlock, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, toDisplayString, createVNode, normalizeClass, withCtx, createTextVNode } from 'vue';
3
+ import './page-loader-button.vue3.js';
3
4
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
4
5
 
5
6
  const _hoisted_1 = {
6
- class: "x-flex x-flex-col x-items-center x-py-32",
7
+ class: "x-page-loader",
7
8
  "data-test": "page-loader"
8
9
  };
9
10
  const _hoisted_2 = {
10
- class: "x-text x-py-16",
11
+ class: "x-page-loader__text-content",
11
12
  "data-test": "text-content"
12
13
  };
13
14
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -25,7 +26,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
25
26
  1
26
27
  /* TEXT */
27
28
  )
28
- ]),
29
+ ], true),
29
30
  createVNode(_component_BaseEventButton, {
30
31
  class: normalizeClass(["x-button", _ctx.buttonClasses]),
31
32
  events: _ctx.events,
@@ -35,15 +36,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
35
36
  default: withCtx(() => [
36
37
  renderSlot(_ctx.$slots, "buttonContent", {}, () => [
37
38
  createTextVNode("Load")
38
- ])
39
+ ], true)
39
40
  ]),
40
41
  _: 3
41
42
  /* FORWARDED */
42
43
  }, 8, ["class", "events"])
43
- ])
44
+ ], true)
44
45
  ]);
45
46
  }
46
- var pageLoaderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
47
+ var pageLoaderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1e62f4ee"]]);
47
48
 
48
49
  export { pageLoaderButton as default };
49
50
  //# sourceMappingURL=page-loader-button.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-loader-button.vue.js","sources":["../../../src/components/page-loader-button.vue"],"sourcesContent":["<template>\n <div class=\"x-flex x-flex-col x-items-center x-py-32\" data-test=\"page-loader\">\n <!--\n @slot default\n @binding {number} resultsLength - The search result's length\n @binding {number} totalResults - The totalResults of a searched query\n -->\n <slot v-bind=\"{ resultsLength, totalResults }\">\n <!-- @slot Rendered count with a text and the number of results displayed & remaining. -->\n <slot name=\"textContent\" :resultsLength=\"resultsLength\" :totalResults=\"totalResults\">\n <p class=\"x-text x-py-16\" data-test=\"text-content\">\n You are seeing {{ resultsLength }} of {{ totalResults }} results\n </p>\n </slot>\n <BaseEventButton\n class=\"x-button\"\n :class=\"buttonClasses\"\n :events=\"events\"\n data-test=\"load-content\"\n aria-label=\"Load\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot name=\"buttonContent\">Load</slot>\n </BaseEventButton>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../utils/types';\n import { use$x } from '../composables';\n import { XEventsTypes } from '../wiring';\n import BaseEventButton from './base-event-button.vue';\n\n /**\n * Component that renders a text with the number of rendered results and\n * the remaining ones and a `<BaseEventButton>` with the logic of emitting\n * the event \"UserReachedResultsListEnd\" to load more results on click.\n *\n * @public\n */\n export default defineComponent({\n name: 'PageLoaderButton',\n components: { BaseEventButton },\n props: {\n /**\n * CSS classes to customize the loader button.\n *\n * @internal\n */\n buttonClasses: {\n type: String as PropType<VueCSSClasses>,\n default: ''\n },\n /**\n * Events to customize what will be emitted by the loader button.\n *\n * @internal\n */\n buttonEvents: {\n type: Object as PropType<Partial<XEventsTypes>>\n }\n },\n setup(props) {\n const $x = use$x();\n const resultsLength = computed(() => $x.results.length);\n const totalResults = computed(() => $x.totalResults);\n\n /**\n * The events that will be emitted when clicking on the loader button.\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => {\n return { UserReachedResultsListEnd: undefined, ...props.buttonEvents };\n });\n\n return {\n resultsLength,\n totalResults,\n events\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the \"UserReachedResultsListEnd\" event by default. This can be changed using the\nbuttonEvents prop:\n\n```vue live\n<template>\n <PageLoaderButton :buttonEvents=\"{ UserClickedCloseX: undefined }\" />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n## See it in action\n\nHere you have a basic example of how the page loader component is rendered.\n\n```vue live\n<template>\n <PageLoaderButton />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the default layout\n\nThis component has a default slot which allows to customise the entire layout.\n\n```vue live\n<template>\n <PageLoaderButton>\n <template #default=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-flex-col\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n <button\n @click=\"$x.emit('UserReachedResultsListEnd', undefined)\"\n class=\"x-button x-button-ghost\"\n >\n Load more\n </button>\n </div>\n </template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the slots\n\nThis component allows to customise both the textContent and the buttonContent slots. The\ntextContent's slot layout can be replaced entirely, while the buttonContent's slot enables wrapping\ncontent inside and customizing its style using the buttonClasses prop.\n\n```vue live\n<template>\n <PageLoaderButton :buttonClasses=\"buttonClasses\">\n <template #textContent=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n </template>\n <template #buttonContent>Load more results</template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n },\n data() {\n return {\n buttonClasses: 'x-rounded-full'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_renderSlot","resultsLength","_normalizeProps","_guardReactiveProps","totalResults","_createElementVNode","_toDisplayString","events","_withCtx"],"mappings":";;;;MACwD,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,0CAAA;;;MAShC,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,gBAAA;;;;qCAT1CA,gBAwBM,CAAA,iBAAA,CAAA,CAAA;SAhBFC,SAIO,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,IAJmBC,UAAA,CAAA,IAAA,CAAa,QAAEC,SAAa,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,aAAA,EAAA,IAAA,CAAA,aAAA,EAAA,YAAA,EAAA,IAAA,CAAA,YAAA,EAAA,CAAA,CAAA,EAAA,MAAA;AAAA,MAAAH,UAAA,CAAG,KAAcI,MAAY,EAAA,aAAA,EAAA;AAAA,QAI5E,aAAA,EAAA,IAAA,CAAA,aAAA;AAAA,QAHL,YAAA,EAAA,IAAA,CAAA,YAAA;AAAA,OAAA,EAAA,MAAA;AAIF,QAAAC,kBAAA;AAAA,UASkB,GAAA;AAAA,UAAA,UAAA;AAAA,UAAA,kBAAA,GAAAC,eAAA,CAAA,IAAA,CAAA,aAAA,CAAA,GAAA,MAAA,GAAAA,eAAA,CAAA,IAAA,CAAA,YAAA,CAAA,GAAA,WAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;kBANPC,0BAAM,EAAA;AAAA,QACf,sBAAU,CAAc,UAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA;AAAA,QACxB,MAAU,EAAA,IAAA,CAAA,MAAA;AAAA,QAAA,WAAA,EAAA,cAAA;AAnBlB,QAAA,YAAA,EAAA,MAAA;AAAA,OAAA,EAAA;iBAAAC,OAsBmC,CAAA,MAAA;AAAA,UAAAR,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,eAAA,EAAA,EAAA,EAAA,MAAA;;AAtBnC,WAAA,CAAA;AAAA,SAAA,CAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"page-loader-button.vue.js","sources":["../../../src/components/page-loader-button.vue"],"sourcesContent":["<template>\n <div class=\"x-page-loader\" data-test=\"page-loader\">\n <!--\n @slot default\n @binding {number} resultsLength - The search result's length\n @binding {number} totalResults - The totalResults of a searched query\n -->\n <slot v-bind=\"{ resultsLength, totalResults }\">\n <!-- @slot Rendered count with a text and the number of results displayed & remaining. -->\n <slot name=\"textContent\" :resultsLength=\"resultsLength\" :totalResults=\"totalResults\">\n <p class=\"x-page-loader__text-content\" data-test=\"text-content\">\n You are seeing {{ resultsLength }} of {{ totalResults }} results\n </p>\n </slot>\n <BaseEventButton\n class=\"x-button\"\n :class=\"buttonClasses\"\n :events=\"events\"\n data-test=\"load-content\"\n aria-label=\"Load\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot name=\"buttonContent\">Load</slot>\n </BaseEventButton>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../utils/types';\n import { use$x } from '../composables';\n import { XEventsTypes } from '../wiring';\n import BaseEventButton from './base-event-button.vue';\n\n /**\n * Component that renders a text with the number of rendered results and\n * the remaining ones and a `<BaseEventButton>` with the logic of emitting\n * the event \"UserReachedResultsListEnd\" to load more results on click.\n *\n * @public\n */\n export default defineComponent({\n name: 'PageLoaderButton',\n components: { BaseEventButton },\n props: {\n /**\n * CSS classes to customize the loader button.\n *\n * @internal\n */\n buttonClasses: {\n type: String as PropType<VueCSSClasses>,\n default: ''\n },\n /**\n * Events to customize what will be emitted by the loader button.\n *\n * @internal\n */\n buttonEvents: {\n type: Object as PropType<Partial<XEventsTypes>>\n }\n },\n setup(props) {\n const $x = use$x();\n const resultsLength = computed(() => $x.results.length);\n const totalResults = computed(() => $x.totalResults);\n\n /**\n * The events that will be emitted when clicking on the loader button.\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => {\n return { UserReachedResultsListEnd: undefined, ...props.buttonEvents };\n });\n\n return {\n resultsLength,\n totalResults,\n events\n };\n }\n });\n</script>\n\n<style scoped>\n .x-page-loader {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 32px 0;\n }\n\n .x-page-loader__text-content {\n padding: 16px 0;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the \"UserReachedResultsListEnd\" event by default. This can be changed using the\nbuttonEvents prop:\n\n```vue live\n<template>\n <PageLoaderButton :buttonEvents=\"{ UserClickedCloseX: undefined }\" />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n## See it in action\n\nHere you have a basic example of how the page loader component is rendered.\n\n```vue live\n<template>\n <PageLoaderButton />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the default layout\n\nThis component has a default slot which allows to customise the entire layout.\n\n```vue live\n<template>\n <PageLoaderButton>\n <template #default=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-flex-col\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n <button\n @click=\"$x.emit('UserReachedResultsListEnd', undefined)\"\n class=\"x-button x-button-ghost\"\n >\n Load more\n </button>\n </div>\n </template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the slots\n\nThis component allows to customise both the textContent and the buttonContent slots. The\ntextContent's slot layout can be replaced entirely, while the buttonContent's slot enables wrapping\ncontent inside and customizing its style using the buttonClasses prop.\n\n```vue live\n<template>\n <PageLoaderButton :buttonClasses=\"buttonClasses\">\n <template #textContent=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n </template>\n <template #buttonContent>Load more results</template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n },\n data() {\n return {\n buttonClasses: 'x-rounded-full'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_renderSlot","resultsLength","_normalizeProps","_guardReactiveProps","totalResults","_createElementVNode","_toDisplayString","_createVNode","events","_withCtx"],"mappings":";;;;;MAC6B,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,eAAA;;;MASQ,UAAU,GAAA;AAAA,EAAA,KAAA,EAAA,6BAAA;;;;qCATvDA,gBAwBM,CAAA,iBAAA,CAAA,CAAA;SAhBFC,SAIO,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,IAJmBC,UAAA,CAAA,IAAA,CAAa,QAAEC,SAAa,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,aAAA,EAAA,IAAA,CAAA,aAAA,EAAA,YAAA,EAAA,IAAA,CAAA,YAAA,EAAA,CAAA,CAAA,EAAA,MAAA;AAAA,MAAAH,UAAA,CAAG,KAAcI,MAAY,EAAA,aAAA,EAAA;AAAA,QAI5E,aAAA,EAAA,IAAA,CAAA,aAAA;AAAA,QAHL,YAAA,EAAA,IAAA,CAAA,YAAA;AAAA,OAAA,EAAA,MAAA;AAIF,QAAAC,kBAAA;AAAA,UASkB,GAAA;AAAA,UAAA,UAAA;AAAA,UAAA,kBAAA,GAAAC,eAAA,CAAA,IAAA,CAAA,aAAA,CAAA,GAAA,MAAA,GAAAA,eAAA,CAAA,IAAA,CAAA,YAAA,CAAA,GAAA,WAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,EARhB,IAAK,CAAA;AAAA,MAAAC,WAAA,CAEIC,0BAAM,EAAA;AAAA,QACf,sBAAU,CAAc,UAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA;AAAA,QACxB,MAAU,EAAA,IAAA,CAAA,MAAA;AAAA,QAAA,WAAA,EAAA,cAAA;AAnBlB,QAAA,YAAA,EAAA,MAAA;AAAA,OAAA,EAAA;iBAAAC,OAsBmC,CAAA,MAAA;AAAA,UAAAT,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,eAAA,EAAA,EAAA,EAAA,MAAA;;AAtBnC,WAAA,EAAA,IAAA,CAAA;AAAA,SAAA,CAAA;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-loader-button.vue2.js","sources":["../../../src/components/page-loader-button.vue"],"sourcesContent":["<template>\n <div class=\"x-flex x-flex-col x-items-center x-py-32\" data-test=\"page-loader\">\n <!--\n @slot default\n @binding {number} resultsLength - The search result's length\n @binding {number} totalResults - The totalResults of a searched query\n -->\n <slot v-bind=\"{ resultsLength, totalResults }\">\n <!-- @slot Rendered count with a text and the number of results displayed & remaining. -->\n <slot name=\"textContent\" :resultsLength=\"resultsLength\" :totalResults=\"totalResults\">\n <p class=\"x-text x-py-16\" data-test=\"text-content\">\n You are seeing {{ resultsLength }} of {{ totalResults }} results\n </p>\n </slot>\n <BaseEventButton\n class=\"x-button\"\n :class=\"buttonClasses\"\n :events=\"events\"\n data-test=\"load-content\"\n aria-label=\"Load\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot name=\"buttonContent\">Load</slot>\n </BaseEventButton>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../utils/types';\n import { use$x } from '../composables';\n import { XEventsTypes } from '../wiring';\n import BaseEventButton from './base-event-button.vue';\n\n /**\n * Component that renders a text with the number of rendered results and\n * the remaining ones and a `<BaseEventButton>` with the logic of emitting\n * the event \"UserReachedResultsListEnd\" to load more results on click.\n *\n * @public\n */\n export default defineComponent({\n name: 'PageLoaderButton',\n components: { BaseEventButton },\n props: {\n /**\n * CSS classes to customize the loader button.\n *\n * @internal\n */\n buttonClasses: {\n type: String as PropType<VueCSSClasses>,\n default: ''\n },\n /**\n * Events to customize what will be emitted by the loader button.\n *\n * @internal\n */\n buttonEvents: {\n type: Object as PropType<Partial<XEventsTypes>>\n }\n },\n setup(props) {\n const $x = use$x();\n const resultsLength = computed(() => $x.results.length);\n const totalResults = computed(() => $x.totalResults);\n\n /**\n * The events that will be emitted when clicking on the loader button.\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => {\n return { UserReachedResultsListEnd: undefined, ...props.buttonEvents };\n });\n\n return {\n resultsLength,\n totalResults,\n events\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the \"UserReachedResultsListEnd\" event by default. This can be changed using the\nbuttonEvents prop:\n\n```vue live\n<template>\n <PageLoaderButton :buttonEvents=\"{ UserClickedCloseX: undefined }\" />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n## See it in action\n\nHere you have a basic example of how the page loader component is rendered.\n\n```vue live\n<template>\n <PageLoaderButton />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the default layout\n\nThis component has a default slot which allows to customise the entire layout.\n\n```vue live\n<template>\n <PageLoaderButton>\n <template #default=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-flex-col\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n <button\n @click=\"$x.emit('UserReachedResultsListEnd', undefined)\"\n class=\"x-button x-button-ghost\"\n >\n Load more\n </button>\n </div>\n </template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the slots\n\nThis component allows to customise both the textContent and the buttonContent slots. The\ntextContent's slot layout can be replaced entirely, while the buttonContent's slot enables wrapping\ncontent inside and customizing its style using the buttonClasses prop.\n\n```vue live\n<template>\n <PageLoaderButton :buttonClasses=\"buttonClasses\">\n <template #textContent=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n </template>\n <template #buttonContent>Load more results</template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n },\n data() {\n return {\n buttonClasses: 'x-rounded-full'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmCE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,OAAO,EAAE,EAAC;AACX,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAwC;AAChD,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAClB,QAAA,MAAM,aAAY,GAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACvD,MAAM,YAAW,GAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,CAAA;AAEpD;;;;;AAKE;AACF,QAAA,MAAM,MAAK,GAAI,QAAQ,CAAwB,MAAM;YACnD,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,cAAc,CAAA;AACxE,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,aAAa;YACb,YAAY;YACZ,MAAK;SACN,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"page-loader-button.vue2.js","sources":["../../../src/components/page-loader-button.vue"],"sourcesContent":["<template>\n <div class=\"x-page-loader\" data-test=\"page-loader\">\n <!--\n @slot default\n @binding {number} resultsLength - The search result's length\n @binding {number} totalResults - The totalResults of a searched query\n -->\n <slot v-bind=\"{ resultsLength, totalResults }\">\n <!-- @slot Rendered count with a text and the number of results displayed & remaining. -->\n <slot name=\"textContent\" :resultsLength=\"resultsLength\" :totalResults=\"totalResults\">\n <p class=\"x-page-loader__text-content\" data-test=\"text-content\">\n You are seeing {{ resultsLength }} of {{ totalResults }} results\n </p>\n </slot>\n <BaseEventButton\n class=\"x-button\"\n :class=\"buttonClasses\"\n :events=\"events\"\n data-test=\"load-content\"\n aria-label=\"Load\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot name=\"buttonContent\">Load</slot>\n </BaseEventButton>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { VueCSSClasses } from '../utils/types';\n import { use$x } from '../composables';\n import { XEventsTypes } from '../wiring';\n import BaseEventButton from './base-event-button.vue';\n\n /**\n * Component that renders a text with the number of rendered results and\n * the remaining ones and a `<BaseEventButton>` with the logic of emitting\n * the event \"UserReachedResultsListEnd\" to load more results on click.\n *\n * @public\n */\n export default defineComponent({\n name: 'PageLoaderButton',\n components: { BaseEventButton },\n props: {\n /**\n * CSS classes to customize the loader button.\n *\n * @internal\n */\n buttonClasses: {\n type: String as PropType<VueCSSClasses>,\n default: ''\n },\n /**\n * Events to customize what will be emitted by the loader button.\n *\n * @internal\n */\n buttonEvents: {\n type: Object as PropType<Partial<XEventsTypes>>\n }\n },\n setup(props) {\n const $x = use$x();\n const resultsLength = computed(() => $x.results.length);\n const totalResults = computed(() => $x.totalResults);\n\n /**\n * The events that will be emitted when clicking on the loader button.\n *\n * @returns The {@link XEvent} to emit.\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => {\n return { UserReachedResultsListEnd: undefined, ...props.buttonEvents };\n });\n\n return {\n resultsLength,\n totalResults,\n events\n };\n }\n });\n</script>\n\n<style scoped>\n .x-page-loader {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 32px 0;\n }\n\n .x-page-loader__text-content {\n padding: 16px 0;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the \"UserReachedResultsListEnd\" event by default. This can be changed using the\nbuttonEvents prop:\n\n```vue live\n<template>\n <PageLoaderButton :buttonEvents=\"{ UserClickedCloseX: undefined }\" />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n## See it in action\n\nHere you have a basic example of how the page loader component is rendered.\n\n```vue live\n<template>\n <PageLoaderButton />\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the default layout\n\nThis component has a default slot which allows to customise the entire layout.\n\n```vue live\n<template>\n <PageLoaderButton>\n <template #default=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-flex-col\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n <button\n @click=\"$x.emit('UserReachedResultsListEnd', undefined)\"\n class=\"x-button x-button-ghost\"\n >\n Load more\n </button>\n </div>\n </template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n }\n };\n</script>\n```\n\n### Customise the slots\n\nThis component allows to customise both the textContent and the buttonContent slots. The\ntextContent's slot layout can be replaced entirely, while the buttonContent's slot enables wrapping\ncontent inside and customizing its style using the buttonClasses prop.\n\n```vue live\n<template>\n <PageLoaderButton :buttonClasses=\"buttonClasses\">\n <template #textContent=\"{ resultsLength, totalResults }\">\n <div class=\"x-flex x-gap-4 x-text\">\n <span class=\"x-text-accent-50 x-font-bold\">{{ resultsLength }}</span>\n <span>of</span>\n <span class=\"x-text-accent-50\">{{ totalResults }}</span>\n </div>\n </template>\n <template #buttonContent>Load more results</template>\n </PageLoaderButton>\n</template>\n\n<script>\n import { PageLoaderButton } from '@empathyco/x-components';\n\n export default {\n name: 'PageLoaderButtonDemo',\n components: {\n PageLoaderButton\n },\n data() {\n return {\n buttonClasses: 'x-rounded-full'\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmCE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,OAAO,EAAE,EAAC;AACX,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAwC;AAChD,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAClB,QAAA,MAAM,aAAY,GAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACvD,MAAM,YAAW,GAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,CAAA;AAEpD;;;;;AAKE;AACF,QAAA,MAAM,MAAK,GAAI,QAAQ,CAAwB,MAAM;YACnD,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,cAAc,CAAA;AACxE,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,aAAa;YACb,YAAY;YACZ,MAAK;SACN,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -0,0 +1,7 @@
1
+ import injectCss from '../../tools/inject-css.js';
2
+
3
+ var css = ".x-page-loader[data-v-1e62f4ee]{align-items:center;display:flex;flex-direction:column;padding:32px 0}.x-page-loader__text-content[data-v-1e62f4ee]{padding:16px 0}";
4
+ injectCss(css);
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=page-loader-button.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-loader-button.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -89,6 +89,7 @@ import '../../../components/sliding-panel.vue2.js';
89
89
  import '../../../components/sliding-panel.vue3.js';
90
90
  import '../../../components/snippet-callbacks.vue2.js';
91
91
  import '../../../components/page-loader-button.vue2.js';
92
+ import '../../../components/page-loader-button.vue3.js';
92
93
  import '../../../components/page-selector.vue2.js';
93
94
  import '../../../components/page-selector.vue3.js';
94
95
  import '../../../composables/create-use-device.js';
@@ -1 +1 @@
1
- {"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpen && hasContent\"\n ref=\"empathizeRef\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, ref } from 'vue';\n import { NoAnimation } from '../../../components';\n import { use$x, useDebounce } from '../../../composables';\n import { AnimationProp } from '../../../types';\n import { XEvent } from '../../../wiring';\n import { empathizeXModule } from '../x-module';\n import { getActiveElement } from '../../../utils/html';\n\n /**\n * Component containing the empathize. It has a required slot to define its content and two props\n * to define when to open and close it: `eventsToOpenEmpathize` and `eventsToCloseEmpathize`.\n *\n * @public\n */\n export default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox']\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox'\n ]\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n }\n },\n setup(props) {\n const $x = use$x();\n\n const empathizeRef = ref<HTMLDivElement>();\n\n const isOpen = ref(false);\n const hasContent = ref(!!empathizeRef.value?.children.length);\n\n /**\n * Changes the state of {@link Empathize.isOpen} assigning to it the value of `newOpen`\n * parameter. Also emits the {@link XEvent} `EmpathizeOpened` or `EmpathizeClosed` if\n * the state really changes.\n *\n * @param newOpen - The new open state to assign to {@link Empathize.isOpen}.\n */\n const changeOpen = useDebounce((newOpen: boolean) => {\n if (isOpen.value !== newOpen) {\n isOpen.value = newOpen;\n const empathizeEvent = isOpen.value ? 'EmpathizeOpened' : 'EmpathizeClosed';\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value });\n }\n }, 0);\n\n /**\n * Open empathize. This method will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on Empathize root\n * element.\n */\n function open() {\n hasContent.value = !!empathizeRef.value?.children.length;\n if (hasContent.value) {\n changeOpen(true);\n }\n }\n\n /**\n * Close empathize. This method will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement();\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpen(false);\n }\n }\n\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open));\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close));\n\n return {\n close,\n empathizeRef,\n hasContent,\n isOpen,\n open\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `'`UserIsTypingAQuery`, `'`UserClickedSearchBox` and\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter`,\n 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,gBAAgB,CAAC,IAAI;AAC9B,IAAA,KAAK,EAAE;;AAEL,QAAA,qBAAqB,EAAE;AACrB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,CAAA;AACrF,SAAA;;AAED,QAAA,sBAAsB,EAAE;AACtB,YAAA,IAAI,EAAE,KAA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AI,gBAAgB,EAAE,CAAA;YACxC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE;gBAChD,UAAU,CAAC,KAAK,CAAC,CAAA;AACnB,aAAA;SACF;QAEA,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACjF,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAEnF,OAAO;YACL,KAAK;YACL,YAAY;YACZ,UAAU;YACV,MAAM;YACN,IAAG;SACJ,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpen && hasContent\"\n ref=\"empathizeRef\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, ref } from 'vue';\n import { NoAnimation } from '../../../components';\n import { use$x, useDebounce } from '../../../composables';\n import { AnimationProp } from '../../../types';\n import { XEvent } from '../../../wiring';\n import { empathizeXModule } from '../x-module';\n import { getActiveElement } from '../../../utils/html';\n\n /**\n * Component containing the empathize. It has a required slot to define its content and two props\n * to define when to open and close it: `eventsToOpenEmpathize` and `eventsToCloseEmpathize`.\n *\n * @public\n */\n export default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox']\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox'\n ]\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n }\n },\n setup(props) {\n const $x = use$x();\n\n const empathizeRef = ref<HTMLDivElement>();\n\n const isOpen = ref(false);\n const hasContent = ref(!!empathizeRef.value?.children.length);\n\n /**\n * Changes the state of {@link Empathize.isOpen} assigning to it the value of `newOpen`\n * parameter. Also emits the {@link XEvent} `EmpathizeOpened` or `EmpathizeClosed` if\n * the state really changes.\n *\n * @param newOpen - The new open state to assign to {@link Empathize.isOpen}.\n */\n const changeOpen = useDebounce((newOpen: boolean) => {\n if (isOpen.value !== newOpen) {\n isOpen.value = newOpen;\n const empathizeEvent = isOpen.value ? 'EmpathizeOpened' : 'EmpathizeClosed';\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value });\n }\n }, 0);\n\n /**\n * Open empathize. This method will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on Empathize root\n * element.\n */\n function open() {\n hasContent.value = !!empathizeRef.value?.children.length;\n if (hasContent.value) {\n changeOpen(true);\n }\n }\n\n /**\n * Close empathize. This method will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement();\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpen(false);\n }\n }\n\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open));\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close));\n\n return {\n close,\n empathizeRef,\n hasContent,\n isOpen,\n open\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `'`UserIsTypingAQuery`, `'`UserClickedSearchBox` and\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter`,\n 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BE;;;;;AAKE;AAC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,CAAC,CAAA;AAEL;;;;AAIE;AACF,QAAA,SAAS,IAAI,GAAA;AACX,YAAA,UAAU,CAAC,KAAI,GAAI,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAA;YACxD,IAAI,UAAU,CAAC,KAAK,EAAE;gBACpB,UAAU,CAAC,IAAI,CAAC,CAAA;AAClB,aAAA;SACF;AAEA;;;;AAIE;AACF,QAAA,SAAS,KAAK,GAAA;AACZ,YAAA,MAAM,aAAY,GAAI,gBAAgB,EAAE,CAAA;YACxC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE;gBAChD,UAAU,CAAC,KAAK,CAAC,CAAA;AACnB,aAAA;SACF;QAEA,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACjF,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAEnF,OAAO;YACL,KAAK;YACL,YAAY;YACZ,UAAU;YACV,MAAM;YACN,IAAG;SACJ,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -22,7 +22,7 @@ var _sfc_main = defineComponent({
22
22
  const params = useState('extraParams', ['params']).params;
23
23
  const $x = use$x();
24
24
  $x.emit('ExtraParamsInitialized', { ...props.values });
25
- $x.emit('ExtraParamsProvided', { ...props.values, ...params.value });
25
+ $x.emit('ExtraParamsProvided', { ...params.value, ...props.values });
26
26
  watch(() => props.values, values => {
27
27
  $x.emit('ExtraParamsProvided', { ...values });
28
28
  }, { deep: true });
@@ -1 +1 @@
1
- {"version":3,"file":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import { Dictionary } from '@empathyco/x-utils';\n import { ComputedRef, defineComponent, PropType, watch } from 'vue';\n import { extraParamsXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n\n export default defineComponent({\n name: 'ExtraParams',\n xModule: extraParamsXModule.name,\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>,\n required: true\n }\n },\n setup(props) {\n const params: ComputedRef<Dictionary> = useState('extraParams', ['params']).params;\n const $x = use$x();\n\n $x.emit('ExtraParamsInitialized', { ...props.values });\n $x.emit('ExtraParamsProvided', { ...props.values, ...params.value });\n\n watch(\n () => props.values,\n values => {\n $x.emit('ExtraParamsProvided', { ...values });\n },\n { deep: true }\n );\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\n- [`ExtraParamsProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\n_See how the event is triggered when the component is rendered._\n\n```vue\n<template>\n <ExtraParams :values=\"values\" />\n</template>\n\n<script>\n import { ExtraParams } from '@empathyco/x-components/extra-params';\n\n export default {\n name: 'ExtraParamsDemo',\n components: {\n ExtraParams\n },\n data() {\n return {\n values: {\n warehouse: 1234\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAOE;;;;;AAKE;AAEF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,kBAAkB,CAAC,IAAI;AAChC,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAuC;AAC7C,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,MAAM,GAA4B,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;AAClF,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAElB,QAAA,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,GAAG,KAAK,CAAC,MAAO,EAAC,CAAC,CAAA;AACtD,QAAA,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,KAAI,EAAG,CAAC,CAAA;QAEpE,KAAK,CACH,MAAM,KAAK,CAAC,MAAM,EAClB,MAAK,IAAK;YACR,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,MAAK,EAAG,CAAC,CAAA;AAC/C,SAAC,EACD,EAAE,IAAI,EAAE,IAAK,EAAA,CACd,CAAA;;AAED,QAAA,OAAO,MAAO,GAAC,CAAA;KACjB;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import { Dictionary } from '@empathyco/x-utils';\n import { ComputedRef, defineComponent, PropType, watch } from 'vue';\n import { extraParamsXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n\n export default defineComponent({\n name: 'ExtraParams',\n xModule: extraParamsXModule.name,\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>,\n required: true\n }\n },\n setup(props) {\n const params: ComputedRef<Dictionary> = useState('extraParams', ['params']).params;\n const $x = use$x();\n\n $x.emit('ExtraParamsInitialized', { ...props.values });\n $x.emit('ExtraParamsProvided', { ...params.value, ...props.values });\n\n watch(\n () => props.values,\n values => {\n $x.emit('ExtraParamsProvided', { ...values });\n },\n { deep: true }\n );\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\n- [`ExtraParamsProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\n_See how the event is triggered when the component is rendered._\n\n```vue\n<template>\n <ExtraParams :values=\"values\" />\n</template>\n\n<script>\n import { ExtraParams } from '@empathyco/x-components/extra-params';\n\n export default {\n name: 'ExtraParamsDemo',\n components: {\n ExtraParams\n },\n data() {\n return {\n values: {\n warehouse: 1234\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAOE;;;;;AAKE;AAEF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,kBAAkB,CAAC,IAAI;AAChC,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAuC;AAC7C,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,MAAM,GAA4B,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;AAClF,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAElB,QAAA,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,GAAG,KAAK,CAAC,MAAO,EAAC,CAAC,CAAA;AACtD,QAAA,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,MAAK,EAAG,CAAC,CAAA;QAEpE,KAAK,CACH,MAAM,KAAK,CAAC,MAAM,EAClB,MAAK,IAAK;YACR,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,MAAK,EAAG,CAAC,CAAA;AAC/C,SAAC,EACD,EAAE,IAAI,EAAE,IAAK,EAAA,CACd,CAAA;;AAED,QAAA,OAAO,MAAO,GAAC,CAAA;KACjB;AACD,CAAA,CAAC;;;;"}
@@ -96,6 +96,7 @@ import '../../../components/sliding-panel.vue2.js';
96
96
  import '../../../components/sliding-panel.vue3.js';
97
97
  import '../../../components/snippet-callbacks.vue2.js';
98
98
  import '../../../components/page-loader-button.vue2.js';
99
+ import '../../../components/page-loader-button.vue3.js';
99
100
  import '../../../components/page-selector.vue2.js';
100
101
  import '../../../components/page-selector.vue3.js';
101
102
  import { queriesPreviewXModule } from '../x-module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"query-preview-button.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview-button.vue"],"sourcesContent":["<template>\n <BaseEventButton\n :events=\"events\"\n :metadata=\"metadata\"\n class=\"x-query-preview-button x-button\"\n data-test=\"query-preview-button\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot :queryPreviewInfo=\"fullQueryPreviewInfo\">\n {{ queryPreviewInfo.query }}\n </slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { QueryPreviewInfo } from '../store/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { BaseEventButton } from '../../../components';\n import { queriesPreviewXModule } from '../x-module';\n import { useState } from '../../../composables/use-state';\n import { WireMetadata } from '../../../wiring/index';\n\n /**\n * Component containing an event button that emits\n * {@link QueriesPreviewXEvents.UserAcceptedAQueryPreview} when clicked with\n * the full query preview info as payload.\n *\n * It has a default slot to customize its contents.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreviewButton',\n xModule: queriesPreviewXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * The information about the request of the query preview.\n *\n * @public\n */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /**\n * The metadata property for the request on each query preview.\n *\n * @public\n */\n metadata: {\n type: Object as PropType<Omit<WireMetadata, 'moduleName'>>\n }\n },\n setup(props) {\n /**\n * We use the module extra params to combine them with the query preview's extra params.\n */\n const { params } = useState('queriesPreview', ['params']);\n\n /**\n * The provided query preview with the base extra params from the module merged in.\n *\n * @returns The query preview info with the base extra params merged in.\n * @public\n */\n const fullQueryPreviewInfo = computed(\n (): QueryPreviewInfo => ({\n ...props.queryPreviewInfo,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: props.queryPreviewInfo.filters\n })\n );\n\n /**\n * List of events to emit by the BaseEventButton.\n *\n * @returns An object with the event and payload.\n *\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserAcceptedAQueryPreview: fullQueryPreviewInfo.value })\n );\n\n return {\n fullQueryPreviewInfo,\n events\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThe component content has the query preview query as default\n\n```vue\n<template>\n <div>\n <QueryPreviewButton queryPreviewInfo=\"queryPreviewInfo\" />\n </div>\n</template>\n\n<script>\n import { QueryPreviewButton } from '@empathyco/x-components/queries-preview';\n\n export default {\n components: {\n QueryPreviewButton\n },\n data: function () {\n return {\n queryPreviewInfo: {\n query: 'shoes'\n }\n };\n }\n };\n</script>\n```\n\n### Customizing slots\n\nThe content of the button is customizable via its default slot\n\n```vue\n<template>\n <div>\n <QueryPreviewButton queryPreviewInfo=\"queryPreviewInfo\">\n {{ `Search for: ${queryPreviewInfo.query}` }}\n </QueryPreviewButton>\n </div>\n</template>\n\n<script>\n import { QueryPreviewButton } from '@empathyco/x-components/queries-preview';\n\n export default {\n components: {\n QueryPreviewButton\n },\n data: function () {\n return {\n queryPreviewInfo: {\n query: 'shoes'\n }\n };\n }\n };\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserAcceptedAQueryPreview`: the event is emitted after the user clicks the button. The event\n payload is the `QueryPreviewInfo` of the query.\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBE;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,qBAAqB,CAAC,IAAI;IACnC,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAoC;AAC1C,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD;;;;AAIE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAmD;AAC3D,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;AAEE;AACF,QAAA,MAAM,EAAE,MAAK,KAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEzD;;;;;AAKE;AACF,QAAA,MAAM,oBAAqB,GAAE,QAAQ,CACnC,OAAyB;YACvB,GAAG,KAAK,CAAC,gBAAgB;AACzB,YAAA,WAAW,EAAE;gBACX,GAAG,MAAM,CAAC,KAAK;AACf,gBAAA,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAU;AACrC,aAAA;AACD,YAAA,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAM;AACvC,SAAA,CAAA,CACF,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,MAAO,GAAE,QAAQ,CACrB,OAA8B,EAAE,yBAAyB,EAAE,oBAAoB,CAAC,OAAO,CAAA,CACxF,CAAA;QAED,OAAO;YACL,oBAAoB;YACpB,MAAK;SACN,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"query-preview-button.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview-button.vue"],"sourcesContent":["<template>\n <BaseEventButton\n :events=\"events\"\n :metadata=\"metadata\"\n class=\"x-query-preview-button x-button\"\n data-test=\"query-preview-button\"\n >\n <!-- @slot Button content with a text, an icon or both -->\n <slot :queryPreviewInfo=\"fullQueryPreviewInfo\">\n {{ queryPreviewInfo.query }}\n </slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { QueryPreviewInfo } from '../store/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { BaseEventButton } from '../../../components';\n import { queriesPreviewXModule } from '../x-module';\n import { useState } from '../../../composables/use-state';\n import { WireMetadata } from '../../../wiring/index';\n\n /**\n * Component containing an event button that emits\n * {@link QueriesPreviewXEvents.UserAcceptedAQueryPreview} when clicked with\n * the full query preview info as payload.\n *\n * It has a default slot to customize its contents.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreviewButton',\n xModule: queriesPreviewXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * The information about the request of the query preview.\n *\n * @public\n */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /**\n * The metadata property for the request on each query preview.\n *\n * @public\n */\n metadata: {\n type: Object as PropType<Omit<WireMetadata, 'moduleName'>>\n }\n },\n setup(props) {\n /**\n * We use the module extra params to combine them with the query preview's extra params.\n */\n const { params } = useState('queriesPreview', ['params']);\n\n /**\n * The provided query preview with the base extra params from the module merged in.\n *\n * @returns The query preview info with the base extra params merged in.\n * @public\n */\n const fullQueryPreviewInfo = computed(\n (): QueryPreviewInfo => ({\n ...props.queryPreviewInfo,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: props.queryPreviewInfo.filters\n })\n );\n\n /**\n * List of events to emit by the BaseEventButton.\n *\n * @returns An object with the event and payload.\n *\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserAcceptedAQueryPreview: fullQueryPreviewInfo.value })\n );\n\n return {\n fullQueryPreviewInfo,\n events\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThe component content has the query preview query as default\n\n```vue\n<template>\n <div>\n <QueryPreviewButton queryPreviewInfo=\"queryPreviewInfo\" />\n </div>\n</template>\n\n<script>\n import { QueryPreviewButton } from '@empathyco/x-components/queries-preview';\n\n export default {\n components: {\n QueryPreviewButton\n },\n data: function () {\n return {\n queryPreviewInfo: {\n query: 'shoes'\n }\n };\n }\n };\n</script>\n```\n\n### Customizing slots\n\nThe content of the button is customizable via its default slot\n\n```vue\n<template>\n <div>\n <QueryPreviewButton queryPreviewInfo=\"queryPreviewInfo\">\n {{ `Search for: ${queryPreviewInfo.query}` }}\n </QueryPreviewButton>\n </div>\n</template>\n\n<script>\n import { QueryPreviewButton } from '@empathyco/x-components/queries-preview';\n\n export default {\n components: {\n QueryPreviewButton\n },\n data: function () {\n return {\n queryPreviewInfo: {\n query: 'shoes'\n }\n };\n }\n };\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserAcceptedAQueryPreview`: the event is emitted after the user clicks the button. The event\n payload is the `QueryPreviewInfo` of the query.\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBE;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,qBAAqB,CAAC,IAAI;IACnC,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAoC;AAC1C,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD;;;;AAIE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAmD;AAC3D,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;AAEE;AACF,QAAA,MAAM,EAAE,MAAK,KAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEzD;;;;;AAKE;AACF,QAAA,MAAM,oBAAqB,GAAE,QAAQ,CACnC,OAAyB;YACvB,GAAG,KAAK,CAAC,gBAAgB;AACzB,YAAA,WAAW,EAAE;gBACX,GAAG,MAAM,CAAC,KAAK;AACf,gBAAA,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAU;AACrC,aAAA;AACD,YAAA,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAM;AACvC,SAAA,CAAA,CACF,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,MAAO,GAAE,QAAQ,CACrB,OAA8B,EAAE,yBAAyB,EAAE,oBAAoB,CAAC,OAAO,CAAA,CACxF,CAAA;QAED,OAAO;YACL,oBAAoB;YACpB,MAAK;SACN,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -98,6 +98,7 @@ import '../../../components/sliding-panel.vue2.js';
98
98
  import '../../../components/sliding-panel.vue3.js';
99
99
  import '../../../components/snippet-callbacks.vue2.js';
100
100
  import '../../../components/page-loader-button.vue2.js';
101
+ import '../../../components/page-loader-button.vue3.js';
101
102
  import '../../../components/page-selector.vue2.js';
102
103
  import '../../../components/page-selector.vue3.js';
103
104
  import { queriesPreviewXModule } from '../x-module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"query-preview.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"hasResults\" data-test=\"query-preview\" class=\"x-query-preview\">\n <li\n v-for=\"result in queryPreviewResults?.results\"\n :key=\"result.id\"\n class=\"x-query-preview__item\"\n data-test=\"query-preview-item\"\n >\n <!--\n @slot Query Preview result slot.\n @binding {Result} result - A Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n ComputedRef,\n defineComponent,\n inject,\n onBeforeUnmount,\n PropType,\n provide,\n Ref,\n watch\n } from 'vue';\n import { SearchRequest, Filter } from '@empathyco/x-types';\n import { deepEqual, Dictionary } from '@empathyco/x-utils';\n import { LIST_ITEMS_KEY } from '../../../components';\n import { QueryFeature, FeatureLocation } from '../../../types';\n import { QueryPreviewInfo, QueryPreviewItem } from '../store/types';\n import { QueriesPreviewConfig } from '../config.types';\n import { queriesPreviewXModule } from '../x-module';\n import {\n DebouncedFunction,\n debounceFunction,\n createOrigin,\n createRawFilters\n } from '../../../utils';\n import { getHashFromQueryPreviewInfo } from '../utils/get-hash-from-query-preview';\n import { useXBus, useState } from '../../../composables';\n\n /**\n * Retrieves a preview of the results of a query and exposes them in the default slot,\n * along with the query preview and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreview',\n xModule: queriesPreviewXModule.name,\n props: {\n /** The information about the request of the query preview. */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /** The origin property for the request. */\n queryFeature: {\n type: String as PropType<QueryFeature>\n },\n /** Number of query preview results to be rendered. */\n maxItemsToRender: {\n type: Number\n },\n /**\n * Debounce time in milliseconds for triggering the search requests.\n * It will default to 0 to fit the most common use case (pre-search),\n * and it would work properly with a 250 value inside empathize.\n */\n debounceTimeMs: {\n type: Number,\n default: 0\n },\n /**\n * Controls whether the QueryPreview should be removed from the state\n * when the component is destroyed.\n */\n persistInCache: {\n type: Boolean,\n default: false\n }\n },\n emits: ['load', 'error'],\n setup(props, { emit, slots }) {\n const xBus = useXBus();\n\n const queriesPreviewState = useState('queriesPreview', [\n 'queriesPreview',\n 'params',\n 'config'\n ]);\n\n /**\n * The results preview of the queries preview cacheable mounted.\n * It is a dictionary, indexed by the query preview query.\n */\n const previewResults: ComputedRef<Dictionary<QueryPreviewItem>> =\n queriesPreviewState.queriesPreview;\n\n /**\n * As the request is handled in this component, we need\n * the extra params that will be used in the request.\n */\n const params: ComputedRef<Dictionary<unknown>> = queriesPreviewState.params;\n\n /**\n * As the request is handled in this component, we need\n * the config that will be used in the request.\n */\n const config: ComputedRef<QueriesPreviewConfig> = queriesPreviewState.config;\n\n /**\n * Query Preview key converted into a unique id.\n *\n * @returns The query hash.\n */\n const queryPreviewHash = computed(() =>\n getHashFromQueryPreviewInfo(props.queryPreviewInfo, params.value.lang as string)\n );\n\n provide('queryPreviewHash', queryPreviewHash);\n\n /**\n * Gets from the state the results preview of the query preview.\n *\n * @returns The results preview of the actual query preview.\n */\n const queryPreviewResults = computed(() => {\n const resultsPreview = previewResults.value[queryPreviewHash.value];\n return resultsPreview?.results\n ? {\n ...resultsPreview,\n results: resultsPreview.results.slice(0, props.maxItemsToRender)\n }\n : undefined;\n });\n\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n *\n * @returns A list of results.\n */\n const results = computed(() => queryPreviewResults.value?.results);\n provide(LIST_ITEMS_KEY as string, results);\n\n /**\n * It injects the provided {@link FeatureLocation} of the selected query in the search request.\n *\n * @internal\n */\n const injectedLocation = inject<Ref<FeatureLocation> | FeatureLocation>('location', 'none');\n const location =\n typeof injectedLocation === 'object' && 'value' in injectedLocation\n ? injectedLocation.value\n : injectedLocation;\n\n /**\n * The computed request object to be used to retrieve the query preview results.\n *\n * @returns The search request object.\n */\n const queryPreviewRequest = computed<SearchRequest>(() => {\n const origin = createOrigin({\n feature: props.queryFeature,\n location: location\n });\n const filters = props.queryPreviewInfo.filters?.reduce((filtersList, filterId) => {\n const facetId = filterId.split(':')[0];\n const rawFilter = createRawFilters([filterId])[0];\n filtersList[facetId] = filtersList[facetId]\n ? filtersList[facetId].concat(rawFilter)\n : [rawFilter];\n\n return filtersList;\n }, {} as Record<string, Filter[]>);\n\n return {\n query: props.queryPreviewInfo.query,\n rows: config.value.maxItemsToRequest,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: filters,\n ...(origin && { origin })\n };\n });\n\n /**\n * The debounce method to trigger the request after the debounceTimeMs defined\n * for cacheable queries.\n *\n * @returns The search request object.\n */\n const emitQueryPreviewRequestUpdated = computed<DebouncedFunction<[SearchRequest]>>(() =>\n debounceFunction(request => {\n xBus.emit('QueryPreviewRequestUpdated', request, { priority: 0, replaceable: false });\n }, props.debounceTimeMs)\n );\n\n /**\n * Initialises watcher to emit debounced requests, and first value for the requests.\n *\n * @internal\n */\n watch(queryPreviewRequest, (newRequest, oldRequest) => {\n if (!deepEqual(newRequest, oldRequest)) {\n emitQueryPreviewRequestUpdated.value(newRequest);\n }\n });\n\n const cachedQueryPreview = previewResults.value[queryPreviewHash.value];\n\n // If the query has been saved it will emit load instead of the emitting the updated request.\n if (cachedQueryPreview?.status === 'success') {\n emit('load', queryPreviewHash.value);\n xBus.emit('QueryPreviewMounted', queryPreviewHash.value, {\n priority: 0,\n replaceable: false\n });\n } else {\n emitQueryPreviewRequestUpdated.value(queryPreviewRequest.value);\n }\n\n /**\n * Cancels the (remaining) requests when the component is destroyed\n * via the `debounce.cancel()` method.\n * If the prop 'persistInCache' is set to false, it also removes the QueryPreview\n * from the state when the component is destroyed.\n */\n onBeforeUnmount(() => {\n emitQueryPreviewRequestUpdated.value.cancel();\n xBus.emit(\n 'QueryPreviewUnmounted',\n { queryPreviewHash: queryPreviewHash.value, cache: props.persistInCache },\n {\n priority: 0,\n replaceable: false\n }\n );\n });\n\n /**\n * Cancels the previous request when the debounced function changes (e.g: the debounceTimeMs\n * prop changes or there is a request in progress that cancels it).\n *\n * @param _new - The new debounced function.\n * @param old - The previous debounced function.\n * @internal\n */\n watch(\n emitQueryPreviewRequestUpdated,\n (_new: DebouncedFunction<[SearchRequest]>, old: DebouncedFunction<[SearchRequest]>) => {\n old.cancel();\n }\n );\n\n const queryPreviewResultsStatus = computed(() => queryPreviewResults.value?.status);\n\n /**\n * Emits an event when the query results are loaded or fail to load.\n *\n * @param status - The status of the query preview request.\n */\n watch(queryPreviewResultsStatus, () => {\n if (queryPreviewResultsStatus.value === 'success') {\n emit(results.value?.length ? 'load' : 'error', queryPreviewHash.value);\n } else if (queryPreviewResultsStatus.value === 'error') {\n emit('error', queryPreviewHash.value);\n }\n });\n\n const hasResults = computed(() => (queryPreviewResults.value?.totalResults ?? 0) > 0);\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no results, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are no results.\n */\n function renderDefaultSlot() {\n const slotProps = {\n queryPreviewInfo: props.queryPreviewInfo,\n results: queryPreviewResults.value?.results,\n totalResults: queryPreviewResults.value?.totalResults,\n displayTagging: queryPreviewResults.value?.displayTagging,\n queryTagging: queryPreviewResults.value?.queryTagging\n };\n\n return hasResults.value ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { hasResults, queryPreviewResults };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`QueryPreviewRequestUpdated`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted when the component is mounted and when the properties of the request object\n changes. The event payload is the `queryPreviewRequest` object.\n\n## Vue Events\n\nA list of vue events that the component will emit:\n\n- `load`: the event is emitted when the query results have been loaded.\n- `error`: the event is emitted if there is some error when retrieving the query results.\n\n## See it in action\n\nHere you have a basic example of how the QueryPreview is rendered. Keep in mind that this component\nis intended to be used overriding its default slot. By default it will only render the names of the\nresults.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" />\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'sandals' }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, the results will be rendered inside a sliding panel.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #default=\"{ totalResults, results }\">\n <section>\n <p>Total results: {{ totalResults }}</p>\n <SlidingPanel :resetOnContentChange=\"false\">\n <article\n v-for=\"result in results\"\n :key=\"result.id\"\n class=\"x-result\"\n style=\"max-width: 300px; overflow: hidden\"\n >\n <BaseResultLink :result=\"result\">\n <BaseResultImage :result=\"result\" class=\"x-result__picture\" />\n </BaseResultLink>\n <div class=\"x-result__description\">\n <BaseResultLink :result=\"result\">\n <h1 class=\"x-title3\">{{ result.name }}</h1>\n </BaseResultLink>\n </div>\n </article>\n </SlidingPanel>\n </section>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n import { BaseResultImage, BaseResultLink, SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'QueryPreviewDemoOverridingSlot',\n components: {\n BaseResultImage,\n BaseResultLink,\n QueryPreview,\n SlidingPanel\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with the result slot\n\nThe component exposes a slot to override the result content, without modifying the list.\n\nIn this example, the ID of the results will be rendered along with the name.\n\n```vue\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #result=\"{ result }\">\n <span>{{ result.id }}</span>\n <span>{{ result.name }}</span>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemoOverridingResultSlot',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the query preview has been limited to render a maximum of 4 results.\n\n```vue\n<template>\n <QueryPreview\n :maxItemsToRender=\"maxItemsToRender\"\n :queryPreviewInfo=\"queryPreviewInfo\"\n #default=\"{ results }\"\n >\n <BaseGrid #default=\"{ item }\" :items=\"results\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n </BaseResultLink>\n </BaseGrid>\n </QueryPreview>\n</template>\n\n<script>\n import { BaseGrid, BaseResultImage, BaseResultLink } from '@empathyco/x-components';\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n BaseGrid,\n BaseResultImage,\n BaseResultLink,\n QueryPreview\n },\n data() {\n return {\n maxItemsToRender: 4,\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["debounceFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,qBAAqB,CAAC,IAAI;AACnC,IAAA,KAAK,EAAE;;AAEL,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAoC;AAC1C,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA+B;AACtC,SAAA;;AAED,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAK;AACZ,SAAA;AACD;;;;AAIE;AACF,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAA;AACV,SAAA;AACD;;;AAGE;AACF,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,O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,EAAE,mBAAmB,CAAC,KAAK,EAAE,cAAc;AACzD,gBAAA,YAAY,EAAE,mBAAmB,CAAC,KAAK,EAAE,YAAW;aACrD,CAAA;YAED,OAAO,UAAU,CAAC,KAAM,GAAE,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA,GAAI,EAAE,CAAA;SAC9D;AAEA;AAC6E;AAC7E,QAAA,MAAM,cAAa,GAAI,EAAE,UAAU,EAAE,mBAAkB,EAAG,CAAA;AAC1D,QAAA,QAAQ,KAAK,CAAC,OAAM,GAAI,iBAAgB,GAAI,cAAc,EAA0B;KACtF;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"query-preview.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"hasResults\" data-test=\"query-preview\" class=\"x-query-preview\">\n <li\n v-for=\"result in queryPreviewResults?.results\"\n :key=\"result.id\"\n class=\"x-query-preview__item\"\n data-test=\"query-preview-item\"\n >\n <!--\n @slot Query Preview result slot.\n @binding {Result} result - A Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n ComputedRef,\n defineComponent,\n inject,\n onBeforeUnmount,\n PropType,\n provide,\n Ref,\n watch\n } from 'vue';\n import { SearchRequest, Filter } from '@empathyco/x-types';\n import { deepEqual, Dictionary } from '@empathyco/x-utils';\n import { LIST_ITEMS_KEY } from '../../../components';\n import { QueryFeature, FeatureLocation } from '../../../types';\n import { QueryPreviewInfo, QueryPreviewItem } from '../store/types';\n import { QueriesPreviewConfig } from '../config.types';\n import { queriesPreviewXModule } from '../x-module';\n import {\n DebouncedFunction,\n debounceFunction,\n createOrigin,\n createRawFilters\n } from '../../../utils';\n import { getHashFromQueryPreviewInfo } from '../utils/get-hash-from-query-preview';\n import { useXBus, useState } from '../../../composables';\n\n /**\n * Retrieves a preview of the results of a query and exposes them in the default slot,\n * along with the query preview and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreview',\n xModule: queriesPreviewXModule.name,\n props: {\n /** The information about the request of the query preview. */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /** The origin property for the request. */\n queryFeature: {\n type: String as PropType<QueryFeature>\n },\n /** Number of query preview results to be rendered. */\n maxItemsToRender: {\n type: Number\n },\n /**\n * Debounce time in milliseconds for triggering the search requests.\n * It will default to 0 to fit the most common use case (pre-search),\n * and it would work properly with a 250 value inside empathize.\n */\n debounceTimeMs: {\n type: Number,\n default: 0\n },\n /**\n * Controls whether the QueryPreview should be removed from the state\n * when the component is destroyed.\n */\n persistInCache: {\n type: Boolean,\n default: false\n }\n },\n emits: ['load', 'error'],\n setup(props, { emit, slots }) {\n const xBus = useXBus();\n\n const queriesPreviewState = useState('queriesPreview', [\n 'queriesPreview',\n 'params',\n 'config'\n ]);\n\n /**\n * The results preview of the queries preview cacheable mounted.\n * It is a dictionary, indexed by the query preview query.\n */\n const previewResults: ComputedRef<Dictionary<QueryPreviewItem>> =\n queriesPreviewState.queriesPreview;\n\n /**\n * As the request is handled in this component, we need\n * the extra params that will be used in the request.\n */\n const params: ComputedRef<Dictionary<unknown>> = queriesPreviewState.params;\n\n /**\n * As the request is handled in this component, we need\n * the config that will be used in the request.\n */\n const config: ComputedRef<QueriesPreviewConfig> = queriesPreviewState.config;\n\n /**\n * Query Preview key converted into a unique id.\n *\n * @returns The query hash.\n */\n const queryPreviewHash = computed(() =>\n getHashFromQueryPreviewInfo(props.queryPreviewInfo, params.value.lang as string)\n );\n\n provide('queryPreviewHash', queryPreviewHash);\n\n /**\n * Gets from the state the results preview of the query preview.\n *\n * @returns The results preview of the actual query preview.\n */\n const queryPreviewResults = computed(() => {\n const resultsPreview = previewResults.value[queryPreviewHash.value];\n return resultsPreview?.results\n ? {\n ...resultsPreview,\n results: resultsPreview.results.slice(0, props.maxItemsToRender)\n }\n : undefined;\n });\n\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n *\n * @returns A list of results.\n */\n const results = computed(() => queryPreviewResults.value?.results);\n provide(LIST_ITEMS_KEY as string, results);\n\n /**\n * It injects the provided {@link FeatureLocation} of the selected query in the search request.\n *\n * @internal\n */\n const injectedLocation = inject<Ref<FeatureLocation> | FeatureLocation>('location', 'none');\n const location =\n typeof injectedLocation === 'object' && 'value' in injectedLocation\n ? injectedLocation.value\n : injectedLocation;\n\n /**\n * The computed request object to be used to retrieve the query preview results.\n *\n * @returns The search request object.\n */\n const queryPreviewRequest = computed<SearchRequest>(() => {\n const origin = createOrigin({\n feature: props.queryFeature,\n location: location\n });\n const filters = props.queryPreviewInfo.filters?.reduce((filtersList, filterId) => {\n const facetId = filterId.split(':')[0];\n const rawFilter = createRawFilters([filterId])[0];\n filtersList[facetId] = filtersList[facetId]\n ? filtersList[facetId].concat(rawFilter)\n : [rawFilter];\n\n return filtersList;\n }, {} as Record<string, Filter[]>);\n\n return {\n query: props.queryPreviewInfo.query,\n rows: config.value.maxItemsToRequest,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: filters,\n ...(origin && { origin })\n };\n });\n\n /**\n * The debounce method to trigger the request after the debounceTimeMs defined\n * for cacheable queries.\n *\n * @returns The search request object.\n */\n const emitQueryPreviewRequestUpdated = computed<DebouncedFunction<[SearchRequest]>>(() =>\n debounceFunction(request => {\n xBus.emit('QueryPreviewRequestUpdated', request, { priority: 0, replaceable: false });\n }, props.debounceTimeMs)\n );\n\n /**\n * Initialises watcher to emit debounced requests, and first value for the requests.\n *\n * @internal\n */\n watch(queryPreviewRequest, (newRequest, oldRequest) => {\n if (!deepEqual(newRequest, oldRequest)) {\n emitQueryPreviewRequestUpdated.value(newRequest);\n }\n });\n\n const cachedQueryPreview = previewResults.value[queryPreviewHash.value];\n\n // If the query has been saved it will emit load instead of the emitting the updated request.\n if (cachedQueryPreview?.status === 'success') {\n emit('load', queryPreviewHash.value);\n xBus.emit('QueryPreviewMounted', queryPreviewHash.value, {\n priority: 0,\n replaceable: false\n });\n } else {\n emitQueryPreviewRequestUpdated.value(queryPreviewRequest.value);\n }\n\n /**\n * Cancels the (remaining) requests when the component is destroyed\n * via the `debounce.cancel()` method.\n * If the prop 'persistInCache' is set to false, it also removes the QueryPreview\n * from the state when the component is destroyed.\n */\n onBeforeUnmount(() => {\n emitQueryPreviewRequestUpdated.value.cancel();\n xBus.emit(\n 'QueryPreviewUnmounted',\n { queryPreviewHash: queryPreviewHash.value, cache: props.persistInCache },\n {\n priority: 0,\n replaceable: false\n }\n );\n });\n\n /**\n * Cancels the previous request when the debounced function changes (e.g: the debounceTimeMs\n * prop changes or there is a request in progress that cancels it).\n *\n * @param _new - The new debounced function.\n * @param old - The previous debounced function.\n * @internal\n */\n watch(\n emitQueryPreviewRequestUpdated,\n (_new: DebouncedFunction<[SearchRequest]>, old: DebouncedFunction<[SearchRequest]>) => {\n old.cancel();\n }\n );\n\n const queryPreviewResultsStatus = computed(() => queryPreviewResults.value?.status);\n\n /**\n * Emits an event when the query results are loaded or fail to load.\n *\n * @param status - The status of the query preview request.\n */\n watch(queryPreviewResultsStatus, () => {\n if (queryPreviewResultsStatus.value === 'success') {\n emit(results.value?.length ? 'load' : 'error', queryPreviewHash.value);\n } else if (queryPreviewResultsStatus.value === 'error') {\n emit('error', queryPreviewHash.value);\n }\n });\n\n const hasResults = computed(() => (queryPreviewResults.value?.totalResults ?? 0) > 0);\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no results, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are no results.\n */\n function renderDefaultSlot() {\n const slotProps = {\n queryPreviewInfo: props.queryPreviewInfo,\n results: queryPreviewResults.value?.results,\n totalResults: queryPreviewResults.value?.totalResults,\n displayTagging: queryPreviewResults.value?.displayTagging,\n queryTagging: queryPreviewResults.value?.queryTagging\n };\n\n return hasResults.value ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { hasResults, queryPreviewResults };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`QueryPreviewRequestUpdated`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted when the component is mounted and when the properties of the request object\n changes. The event payload is the `queryPreviewRequest` object.\n\n## Vue Events\n\nA list of vue events that the component will emit:\n\n- `load`: the event is emitted when the query results have been loaded.\n- `error`: the event is emitted if there is some error when retrieving the query results.\n\n## See it in action\n\nHere you have a basic example of how the QueryPreview is rendered. Keep in mind that this component\nis intended to be used overriding its default slot. By default it will only render the names of the\nresults.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" />\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'sandals' }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, the results will be rendered inside a sliding panel.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #default=\"{ totalResults, results }\">\n <section>\n <p>Total results: {{ totalResults }}</p>\n <SlidingPanel :resetOnContentChange=\"false\">\n <article\n v-for=\"result in results\"\n :key=\"result.id\"\n class=\"x-result\"\n style=\"max-width: 300px; overflow: hidden\"\n >\n <BaseResultLink :result=\"result\">\n <BaseResultImage :result=\"result\" class=\"x-result__picture\" />\n </BaseResultLink>\n <div class=\"x-result__description\">\n <BaseResultLink :result=\"result\">\n <h1 class=\"x-title3\">{{ result.name }}</h1>\n </BaseResultLink>\n </div>\n </article>\n </SlidingPanel>\n </section>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n import { BaseResultImage, BaseResultLink, SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'QueryPreviewDemoOverridingSlot',\n components: {\n BaseResultImage,\n BaseResultLink,\n QueryPreview,\n SlidingPanel\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with the result slot\n\nThe component exposes a slot to override the result content, without modifying the list.\n\nIn this example, the ID of the results will be rendered along with the name.\n\n```vue\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #result=\"{ result }\">\n <span>{{ result.id }}</span>\n <span>{{ result.name }}</span>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemoOverridingResultSlot',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the query preview has been limited to render a maximum of 4 results.\n\n```vue\n<template>\n <QueryPreview\n :maxItemsToRender=\"maxItemsToRender\"\n :queryPreviewInfo=\"queryPreviewInfo\"\n #default=\"{ results }\"\n >\n <BaseGrid #default=\"{ item }\" :items=\"results\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n </BaseResultLink>\n </BaseGrid>\n </QueryPreview>\n</template>\n\n<script>\n import { BaseGrid, BaseResultImage, BaseResultLink } from '@empathyco/x-components';\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n BaseGrid,\n BaseResultImage,\n BaseResultLink,\n QueryPreview\n },\n data() {\n return {\n maxItem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../../components/sliding-panel.vue3.js';
97
97
  import '../../../components/snippet-callbacks.vue2.js';
98
98
  import '../../../components/page-loader-button.vue2.js';
99
+ import '../../../components/page-loader-button.vue3.js';
99
100
  import '../../../components/page-selector.vue2.js';
100
101
  import '../../../components/page-selector.vue3.js';
101
102
  import { scrollXModule } from '../x-module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-top.vue2.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { NoAnimation, BaseEventButton } from '../../../components';\n import { XEventsTypes } from '../../../wiring';\n import { scrollXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n import { useState } from '../../../composables';\n import { MainScrollId } from './scroll.const';\n\n /**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\n export default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId\n }\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll', ['data']);\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false\n };\n });\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId })\n );\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number');\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!\n );\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN'\n );\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value\n );\n\n return {\n events,\n isVisible\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\n import { ScrollToTop } from '@empathyco/x-components/scroll';\n\n export default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAU;AAC1B,SAAA;AACD;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAM;AACnB;;;;AAIE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,YAAW;AACtB,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;AAIE;;AAEF,QAAA,MAAM,EAAE,IAAK,EAAA,GAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAE7C;;;;;;AAME;AACF,QAAA,MAAM,UAAW,GAAE,QAAQ,CAAC,MAAM;YAChC,OAAO,KAAK,CAAC,QAAO,IAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAA;kBAC9C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAA;AAC3B,kBAAE;AACE,oBAAA,QAAQ,EAAE,CAAC;AACX,oBAAA,SAAS,EAAE,IAAI;AACf,oBAAA,eAAe,EAAE,KAAK;AACtB,oBAAA,mBAAmB,EAAE,KAAK;AAC1B,oBAAA,aAAa,EAAE,KAAI;iBACpB,CAAA;AACP,SAAC,CAAC,CAAA;AAEF;;;;;AAKE;AACF,QAAA,MAAM,MAAO,GAAE,QAAQ,CACrB,OAA8B,EAAE,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAA,CACzE,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,uBAAuB,QAAQ,CAAC,MAAM,OAAO,KAAK,CAAC,WAAU,KAAM,QAAQ,CAAC,CAAA;AAElF;;;;;AAKE;QACF,MAAM,kBAAmB,GAAE,QAAQ,CACjC,MAAM,oBAAoB,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,QAAS,GAAE,KAAK,CAAC,WAAW,CAClF,CAAA;AAED;;;;;AAKE;QACF,MAAM,yBAA0B,GAAE,QAAQ,CACxC,MAAM,UAAU,CAAC,KAAK,CAAC,mBAAkB,IAAK,UAAU,CAAC,KAAK,CAAC,SAAU,KAAI,MAAK,CACnF,CAAA;AAED;;;;;AAKE;QACF,MAAM,YAAY,QAAQ,CAAC,MACzB,oBAAoB,CAAC,KAAM,GAAE,kBAAkB,CAAC,KAAI,GAAI,yBAAyB,CAAC,KAAI,CACvF,CAAA;QAED,OAAO;YACL,MAAM;YACN,SAAQ;SACT,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"scroll-to-top.vue2.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { NoAnimation, BaseEventButton } from '../../../components';\n import { XEventsTypes } from '../../../wiring';\n import { scrollXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n import { useState } from '../../../composables';\n import { MainScrollId } from './scroll.const';\n\n /**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\n export default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId\n }\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll', ['data']);\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false\n };\n });\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId })\n );\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number');\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!\n );\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN'\n );\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value\n );\n\n return {\n events,\n isVisible\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\n import { ScrollToTop } from '@empathyco/x-components/scroll';\n\n export default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KA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CAAA;AAED;;;;;AAKE;QACF,MAAM,yBAA0B,GAAE,QAAQ,CACxC,MAAM,UAAU,CAAC,KAAK,CAAC,mBAAkB,IAAK,UAAU,CAAC,KAAK,CAAC,SAAU,KAAI,MAAK,CACnF,CAAA;AAED;;;;;AAKE;QACF,MAAM,YAAY,QAAQ,CAAC,MACzB,oBAAoB,CAAC,KAAM,GAAE,kBAAkB,CAAC,KAAI,GAAI,yBAAyB,CAAC,KAAI,CACvF,CAAA;QAED,OAAO;YACL,MAAM;YACN,SAAQ;SACT,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "6.0.0-alpha.34",
3
+ "version": "6.0.0-alpha.36",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -69,14 +69,14 @@
69
69
  "prepublishOnly": "pnpm run build"
70
70
  },
71
71
  "dependencies": {
72
- "@empathyco/x-adapter": "^8.1.0-alpha.0",
73
- "@empathyco/x-adapter-platform": "^1.1.0-alpha.9",
74
- "@empathyco/x-bus": "^1.0.3-alpha.1",
75
- "@empathyco/x-deep-merge": "^2.0.3-alpha.1",
72
+ "@empathyco/x-adapter": "^8.1.0-alpha.1",
73
+ "@empathyco/x-adapter-platform": "^1.1.0-alpha.10",
74
+ "@empathyco/x-bus": "^1.0.3-alpha.2",
75
+ "@empathyco/x-deep-merge": "^2.0.3-alpha.2",
76
76
  "@empathyco/x-logger": "^1.2.0-alpha.11",
77
- "@empathyco/x-storage-service": "^2.0.3-alpha.0",
78
- "@empathyco/x-types": "^10.1.0-alpha.6",
79
- "@empathyco/x-utils": "^1.0.3-alpha.1",
77
+ "@empathyco/x-storage-service": "^2.0.3-alpha.1",
78
+ "@empathyco/x-types": "^10.1.0-alpha.7",
79
+ "@empathyco/x-utils": "^1.0.3-alpha.2",
80
80
  "@vue/devtools-api": "~6.5.0",
81
81
  "@vueuse/core": "~10.7.1",
82
82
  "js-md5": "~0.8.3",
@@ -90,53 +90,53 @@
90
90
  "vuex": "4.0.2"
91
91
  },
92
92
  "devDependencies": {
93
- "@badeball/cypress-cucumber-preprocessor": "~20.0.0",
94
- "@bahmutov/cypress-esbuild-preprocessor": "~2.2.0",
95
- "@empathyco/x-tailwindcss": "^2.0.0-alpha.2",
96
- "@microsoft/api-documenter": "~7.23.0",
97
- "@microsoft/api-extractor": "~7.39.0",
98
- "@testing-library/jest-dom": "~5.17.0",
99
- "@types/autoprefixer": "~10.2.0",
100
- "@types/glob": "~8.0.1",
101
- "@types/jest": "~27.5.0",
102
- "@types/node": "~18.19.0",
103
- "@types/testing-library__jest-dom": "~5.14.5",
104
- "@vitejs/plugin-vue": "~5.1.2",
93
+ "@badeball/cypress-cucumber-preprocessor": "20.0.0",
94
+ "@bahmutov/cypress-esbuild-preprocessor": "2.2.0",
95
+ "@empathyco/x-tailwindcss": "^2.0.0-alpha.3",
96
+ "@microsoft/api-documenter": "7.23.0",
97
+ "@microsoft/api-extractor": "7.39.0",
98
+ "@testing-library/jest-dom": "5.17.0",
99
+ "@types/autoprefixer": "10.2.0",
100
+ "@types/glob": "8.0.1",
101
+ "@types/jest": "27.5.0",
102
+ "@types/node": "18.19.0",
103
+ "@types/testing-library__jest-dom": "5.14.5",
104
+ "@vitejs/plugin-vue": "5.1.2",
105
105
  "@vue/test-utils": "~2.4.6",
106
- "@vue/vue3-jest": "~27.0.0",
107
- "autoprefixer": "~10.4.4",
108
- "convert-source-map": "~2.0.0",
109
- "cypress": "~13.6.0",
106
+ "@vue/vue3-jest": "27.0.0",
107
+ "autoprefixer": "10.4.4",
108
+ "convert-source-map": "2.0.0",
109
+ "cypress": "13.6.0",
110
110
  "esbuild": "0.20.0",
111
- "glob": "~10.3.0",
112
- "jest": "~27.5.0",
113
- "jest-scss-transform": "~1.0.1",
114
- "postcss": "~8.4.12",
115
- "postcss-dir-pseudo-class": "~7.0.0",
116
- "postcss-logical": "~4.0.2",
117
- "rimraf": "~3.0.2",
118
- "rollup": "~4.9.1",
119
- "rollup-plugin-copy": "~3.5.0",
120
- "rollup-plugin-delete": "~2.0.0",
121
- "rollup-plugin-styles": "~4.0.0",
122
- "rollup-plugin-typescript2": "~0.36.0",
123
- "rollup-plugin-vue": "~6.0.0",
124
- "sass": "~1.70.0",
125
- "start-server-and-test": "~2.0.0",
126
- "tailwindcss": "~3.4.0",
127
- "ts-jest": "~27.1.0",
128
- "ts-node": "~10.9.2",
129
- "typescript": "~4.9.4",
130
- "vite": "~4.5.0",
131
- "vite-plugin-vue-inspector": "~5.1.2",
132
- "vue": "~3.4.31",
133
- "vue-docgen-cli": "~4.79.0",
134
- "vue-router": "~4.4.0",
111
+ "glob": "10.3.0",
112
+ "jest": "27.5.0",
113
+ "jest-scss-transform": "1.0.1",
114
+ "postcss": "8.4.12",
115
+ "postcss-dir-pseudo-class": "7.0.0",
116
+ "postcss-logical": "4.0.2",
117
+ "rimraf": "3.0.2",
118
+ "rollup": "4.9.1",
119
+ "rollup-plugin-copy": "3.5.0",
120
+ "rollup-plugin-delete": "2.0.0",
121
+ "rollup-plugin-styles": "4.0.0",
122
+ "rollup-plugin-typescript2": "0.36.0",
123
+ "rollup-plugin-vue": "6.0.0",
124
+ "sass": "1.70.0",
125
+ "start-server-and-test": "2.0.0",
126
+ "tailwindcss": "3.4.0",
127
+ "ts-jest": "27.1.0",
128
+ "ts-node": "10.9.2",
129
+ "typescript": "4.9.4",
130
+ "vite": "4.5.0",
131
+ "vite-plugin-vue-inspector": "5.1.2",
132
+ "vue": "3.4.31",
133
+ "vue-docgen-cli": "4.79.0",
134
+ "vue-router": "4.4.0",
135
135
  "vuex": "4.0.2"
136
136
  },
137
137
  "publishConfig": {
138
138
  "access": "public",
139
139
  "directory": "dist"
140
140
  },
141
- "gitHead": "17629cde81c4af43107bac76fb2635ac3a04abc3"
141
+ "gitHead": "c0f4da50910ea0653b954cdc5cb503f0fb6d9193"
142
142
  }