@webitel/ui-sdk 24.10.32 → 24.10.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.10.32",
3
+ "version": "24.10.34",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,7 +1,7 @@
1
1
 
2
2
  :root {
3
3
  --divider-border: 1px solid;
4
- --divider-border-color: var(--grey-lighten-5);
4
+ --divider-border-color: var(--grey-lighten-4);
5
5
  }
6
6
 
7
7
  :root.theme--dark {
@@ -0,0 +1,12 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtIntersectionObserver from '../wt-intersection-observer.vue';
3
+
4
+ describe('WtIntersectionObserver', () => {
5
+ const next = () => true;
6
+ it('renders a component', () => {
7
+ const wrapper = shallowMount(WtIntersectionObserver, {
8
+ props: { next }
9
+ });
10
+ expect(wrapper.exists()).toBe(true);
11
+ });
12
+ });
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <wt-loader
3
+ v-if="loading"
4
+ size="sm"
5
+ />
6
+ <div ref="intersectionTarget" />
7
+ </template>
8
+
9
+ <script setup>
10
+ import { useIntersectionObserver } from '@vueuse/core';
11
+ import { onMounted, onUnmounted, ref } from 'vue';
12
+
13
+ const props = defineProps({
14
+ next: {
15
+ type: Function,
16
+ required: true,
17
+ },
18
+ loading: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ });
23
+
24
+ const emit = defineEmits([
25
+ 'next',
26
+ ]);
27
+
28
+ const intersectionTarget = ref(null);
29
+
30
+ let stopObs;
31
+
32
+ onMounted(() => {
33
+ /**
34
+ *
35
+ * Note, observer triggers at init, so it should be used also as init function
36
+ * however, current filters module version is initializing list by itself, so we need to refactor filters ASAP
37
+ */
38
+ const { stop } = useIntersectionObserver(intersectionTarget.value, ([{ isIntersecting }]) => {
39
+ if (isIntersecting && props.next) {
40
+ emit('next');
41
+ }
42
+ });
43
+
44
+ stopObs = stop;
45
+ });
46
+
47
+ onUnmounted(() => {
48
+ stopObs();
49
+ });
50
+ </script>
51
+
52
+ <style scoped lang="scss">
53
+ .wt-loader {
54
+ margin: var(--spacing-lg) auto;
55
+ }
56
+ </style>
@@ -1,6 +1,17 @@
1
- import { localStorageGetter, queryGetter, valueGetter } from '../scripts/getters/index.js';
2
- import { localStorageRestore, queryRestore } from '../scripts/restores/index.js';
3
- import { localStorageSetter, querySetter, valueSetter } from '../scripts/setters/index.js';
1
+ import {
2
+ localStorageGetter,
3
+ queryGetter,
4
+ valueGetter,
5
+ } from '../scripts/getters/index.js';
6
+ import {
7
+ localStorageRestore,
8
+ queryRestore,
9
+ } from '../scripts/restores/index.js';
10
+ import {
11
+ localStorageSetter,
12
+ querySetter,
13
+ valueSetter,
14
+ } from '../scripts/setters/index.js';
4
15
 
5
16
  const convertGetterArray = (context) => (getters) => {
6
17
  const availableGetters = ['value', 'query', 'localStorage'];
@@ -3,9 +3,9 @@
3
3
  :close-on-select="!filterSchema.multiple"
4
4
  :multiple="filterSchema.multiple"
5
5
  :options="options"
6
+ :search-method="search"
6
7
  :track-by="trackBy"
7
8
  :value="value"
8
- :search-method="search"
9
9
  v-bind="attrs"
10
10
  @input="setValue"
11
11
  />
@@ -13,7 +13,7 @@
13
13
 
14
14
  <script setup>
15
15
 
16
- import { computed, reactive, ref, useAttrs, watch } from 'vue';
16
+ import { computed, reactive, useAttrs } from 'vue';
17
17
  import { useI18n } from 'vue-i18n';
18
18
  import { useStore } from 'vuex';
19
19
  import isEmpty from '../../../scripts/isEmpty.js';
@@ -166,7 +166,10 @@ export default class FiltersStoreModule extends BaseStoreModule {
166
166
  const wildcardListeners = context.state._emitter.all.get('*');
167
167
  const eventListeners = context.state._emitter.all.get(event);
168
168
 
169
- const listeners = [...(wildcardListeners || []), ...(eventListeners || [])];
169
+ const listeners = [
170
+ ...(wildcardListeners || []),
171
+ ...(eventListeners || []),
172
+ ];
170
173
 
171
174
  if (!listeners) {
172
175
  console.info(`No listeners for ${event} event`);
@@ -1,4 +0,0 @@
1
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M16.3642 2.30205C15.9615 2.70478 15.9615 3.35773 16.3642 3.76047C16.7537 4.14997 17.3041 4.34133 17.7459 4.44528C17.9783 4.49995 18.224 4.54015 18.4744 4.56708L12.5 10.5416C12.0973 10.9443 12.0973 11.5973 12.5 12C12.9027 12.4027 13.5557 12.4027 13.9584 12L19.9329 6.0255C19.9598 6.2759 20 6.52162 20.0547 6.75398C20.1586 7.19577 20.35 7.74621 20.7395 8.13572C21.1422 8.53845 21.7952 8.53845 22.1979 8.13572C22.6007 7.73299 22.6007 7.08003 22.1979 6.6773C22.2041 6.68348 22.2037 6.68273 22.1984 6.67302C22.1823 6.6436 22.1213 6.53194 22.0624 6.28159C21.9931 5.98696 21.9531 5.61261 21.9531 5.21888C21.9531 4.82515 21.9931 4.4508 22.0624 4.15618C22.1213 3.90584 22.1823 3.79417 22.1984 3.76475C22.2037 3.75504 22.2041 3.75428 22.1979 3.76047C22.6006 3.35773 22.6006 2.70481 22.1979 2.3021C21.7952 1.89939 21.1422 1.89937 20.7395 2.30205C20.7457 2.29587 20.7449 2.29628 20.7352 2.30159C20.7058 2.31767 20.5941 2.37869 20.3438 2.43759C20.0492 2.50692 19.6748 2.54691 19.2811 2.54691C18.8873 2.54691 18.513 2.50692 18.2183 2.43759C17.968 2.37869 17.8563 2.31766 17.8269 2.30159C17.8172 2.29628 17.8165 2.29587 17.8226 2.30205C17.4199 1.89932 16.7669 1.89932 16.3642 2.30205Z" />
3
- <path d="M6.5 7C6.5 6.44772 6.94772 6 7.5 6H12.5C13.0523 6 13.5 5.55228 13.5 5C13.5 4.44772 13.0523 4 12.5 4H7.5C5.84315 4 4.5 5.34315 4.5 7V17C4.5 18.6569 5.84315 20 7.5 20H17.5C19.1569 20 20.5 18.6569 20.5 17V12C20.5 11.4477 20.0523 11 19.5 11C18.9477 11 18.5 11.4477 18.5 12V17C18.5 17.5523 18.0523 18 17.5 18H7.5C6.94772 18 6.5 17.5523 6.5 17V7Z" fill="currentColor"/>
4
- </svg>