@webitel/ui-datalist 1.0.52 → 1.0.53

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-datalist",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && ( npm run lint:fix || true) && (npm run build:types || true) && npm run utils:publish",
@@ -37,7 +37,6 @@ const getPresetList = async (params, config: GetPresetListRequestConfig) => {
37
37
  merge(getDefaultGetParams()),
38
38
  (params) => (useStarToSearch ? starToSearch('search')(params) : params),
39
39
  ]);
40
-
41
40
  try {
42
41
  const response = await service.searchPresetQuery(
43
42
  page,
@@ -46,16 +45,14 @@ const getPresetList = async (params, config: GetPresetListRequestConfig) => {
46
45
  sort || '-created_at',
47
46
  fields || ['id', 'name', 'preset', 'description'],
48
47
  id,
48
+ [presetNamespace],
49
49
  );
50
50
  const { items, next } = applyTransform(response.data, [
51
51
  snakeToCamel(),
52
52
  merge(getDefaultGetListResponse()),
53
53
  ]);
54
54
  return {
55
- items: applyTransform(items, [
56
- (items) =>
57
- items.filter(({ preset }) => preset.namespace === presetNamespace),
58
- ]),
55
+ items,
59
56
  next,
60
57
  };
61
58
  } catch (err) {
@@ -74,6 +71,7 @@ const addPreset = async ({
74
71
  camelToSnake(),
75
72
  (item) => {
76
73
  item.preset.namespace = namespace;
74
+ item.section = namespace;
77
75
  return item;
78
76
  },
79
77
  ]);
@@ -90,6 +88,7 @@ const updatePreset = async ({ item: itemInstance, id, namespace }) => {
90
88
  camelToSnake(),
91
89
  (item) => {
92
90
  item.preset.namespace = namespace;
91
+ item.section = namespace;
93
92
  return item;
94
93
  },
95
94
  ]);
@@ -1,23 +1,18 @@
1
1
  <template>
2
2
  <div class="dynamic-filter-config-view">
3
- <wt-tooltip
4
- :triggers="['click']"
5
- :disabled="props.disabled"
6
- :disable-click-away="props.disableClickAway"
7
- >
8
- <template #activator="slotScope">
9
- <slot
10
- name="activator"
11
- v-bind="{ tooltipSlotScope: slotScope }"
12
- />
13
- </template>
14
- <template #default="slotScope">
3
+ <slot
4
+ name="activator"
5
+ v-bind="{ toggle, disabled: props.disabled }"
6
+ />
7
+
8
+ <wt-popover ref="popover">
9
+ <template #default>
15
10
  <slot
16
11
  name="content"
17
- v-bind="{ tooltipSlotScope: slotScope }"
12
+ v-bind="{ hide }"
18
13
  />
19
14
  </template>
20
- </wt-tooltip>
15
+ </wt-popover>
21
16
  </div>
22
17
  </template>
23
18
 
@@ -26,8 +21,8 @@
26
21
  * this component should only be used for config view representation: tooltip/popup/etc,
27
22
  * and their styling
28
23
  */
29
-
30
- import { WtTooltip } from '@webitel/ui-sdk/components';
24
+ import { WtPopover } from '@webitel/ui-sdk/components';
25
+ import {useTemplateRef} from "vue";
31
26
 
32
27
  interface Props {
33
28
  disabled?: boolean;
@@ -35,6 +30,16 @@ interface Props {
35
30
  }
36
31
 
37
32
  const props = defineProps<Props>();
33
+
34
+ const popover = useTemplateRef('popover');
35
+
36
+ const toggle = (event) => {
37
+ popover.value.toggle(event);
38
+ };
39
+
40
+ const hide = () => {
41
+ popover.value.hide()
42
+ };
38
43
  </script>
39
44
 
40
45
  <style scoped></style>
@@ -3,8 +3,8 @@
3
3
  disable-click-away
4
4
  class="dynamic-filter-add-action"
5
5
  >
6
- <template #activator>
7
- <div class="dynamic-filter-add-action-wrapper">
6
+ <template #activator="{toggle}">
7
+ <div class="dynamic-filter-add-action-wrapper" @click="toggle">
8
8
  <p v-if="props.showLabel">
9
9
  {{ t('webitelUI.filters.addFilter') }}
10
10
  </p>
@@ -12,16 +12,13 @@
12
12
  </div>
13
13
  </template>
14
14
 
15
- <template #content="{ tooltipSlotScope }">
16
- <slot
17
- name="form"
18
- v-bind="{ tooltipSlotScope }"
19
- >
15
+ <template #content="{ hide }">
16
+ <slot name="form">
20
17
  <dynamic-filter-config-form
21
18
  :filter-configs="props.filterConfigs"
22
- @cancel="() => tooltipSlotScope.hide()"
19
+ @cancel="hide"
23
20
  @submit="
24
- (payload) => submit(payload, { hide: tooltipSlotScope.hide })
21
+ (payload) => submit(payload, { hide })
25
22
  "
26
23
  />
27
24
  </slot>
@@ -1,21 +1,24 @@
1
1
  <template>
2
2
  <dynamic-filter-config-view :disabled="readonly">
3
- <template #activator="{ visible: configFormVisible }">
3
+ <template #activator="{ disabled: configFormVisible, toggle }">
4
4
  <wt-tooltip
5
5
  :disabled="configFormVisible"
6
6
  @update:visible="!localValue && fillLocalValue()"
7
+ @click="toggle"
7
8
  >
8
9
  <template #activator>
9
- <wt-chip color="primary">
10
- {{ filter.label || filterConfig.label }}
11
- <wt-icon-btn
12
- v-if="!filterConfig.notDeletable && !readonly"
13
- color="on-primary"
14
- icon="close--filled"
15
- size="sm"
16
- @mousedown.stop="deleteFilter"
17
- />
18
- </wt-chip>
10
+ <div @click="toggle">
11
+ <wt-chip color="primary">
12
+ {{ filter.label || filterConfig.label }}
13
+ <wt-icon-btn
14
+ v-if="!filterConfig.notDeletable && !readonly"
15
+ color="on-primary"
16
+ icon="close--filled"
17
+ size="sm"
18
+ @mousedown.stop="deleteFilter"
19
+ />
20
+ </wt-chip>
21
+ </div>
19
22
  </template>
20
23
 
21
24
  <template #default>
@@ -44,17 +47,17 @@
44
47
  </wt-tooltip>
45
48
  </template>
46
49
 
47
- <template #content="{ tooltipSlotScope }">
50
+ <template #content="{ hide }">
48
51
  <slot
49
52
  name="form"
50
- v-bind="{ tooltipSlotScope }"
53
+ v-bind="{ hide }"
51
54
  >
52
55
  <dynamic-filter-config-form
53
56
  :filter="props.filter"
54
57
  :filter-config="filterConfig"
55
- @cancel="() => tooltipSlotScope.hide()"
58
+ @cancel="hide"
56
59
  @submit="
57
- (payload) => submit(payload, { hide: tooltipSlotScope.hide })
60
+ (payload) => submit(payload, { hide })
58
61
  "
59
62
  />
60
63
  </slot>
@@ -2,24 +2,29 @@
2
2
  * this component should only be used for config view representation: tooltip/popup/etc,
3
3
  * and their styling
4
4
  */
5
- import { WtTooltip } from '@webitel/ui-sdk/components';
5
+ import { WtPopover } from '@webitel/ui-sdk/components';
6
6
  interface Props {
7
7
  disabled?: boolean;
8
8
  disableClickAway?: boolean;
9
9
  }
10
+ declare const toggle: (event: any) => void;
11
+ declare const hide: () => void;
10
12
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
11
- declare var __VLS_5: {
12
- tooltipSlotScope: any;
13
- }, __VLS_7: {
14
- tooltipSlotScope: any;
13
+ declare var __VLS_1: {
14
+ toggle: (event: any) => void;
15
+ disabled: boolean;
16
+ }, __VLS_9: {
17
+ hide: () => void;
15
18
  };
16
19
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
17
- activator?: (props: typeof __VLS_5) => any;
20
+ activator?: (props: typeof __VLS_1) => any;
18
21
  } & {
19
- content?: (props: typeof __VLS_7) => any;
22
+ content?: (props: typeof __VLS_9) => any;
20
23
  }>;
21
24
  declare const __VLS_self: import("vue").DefineComponent<Props, {
22
- WtTooltip: typeof WtTooltip;
25
+ WtPopover: typeof WtPopover;
26
+ toggle: typeof toggle;
27
+ hide: typeof hide;
23
28
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
29
  declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
30
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -12,9 +12,7 @@ declare const submit: (payload: FilterInitParams, { hide }: {
12
12
  hide: any;
13
13
  }) => void;
14
14
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
15
- declare var __VLS_9: {
16
- tooltipSlotScope: any;
17
- };
15
+ declare var __VLS_9: {};
18
16
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
19
17
  form?: (props: typeof __VLS_9) => any;
20
18
  }>;
@@ -19,13 +19,13 @@ declare const submit: (filter: IFilter, { hide }: {
19
19
  }) => void;
20
20
  declare const deleteFilter: () => void;
21
21
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
22
- declare var __VLS_28: {}, __VLS_38: {
23
- tooltipSlotScope: any;
22
+ declare var __VLS_29: {}, __VLS_39: {
23
+ hide: () => void;
24
24
  };
25
25
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
26
- info?: (props: typeof __VLS_28) => any;
26
+ info?: (props: typeof __VLS_29) => any;
27
27
  } & {
28
- form?: (props: typeof __VLS_38) => any;
28
+ form?: (props: typeof __VLS_39) => any;
29
29
  }>;
30
30
  declare const __VLS_self: import("vue").DefineComponent<DynamicFilterProps, {
31
31
  WtChip: typeof WtChip;