@ironsource/shared-ui 2.1.6-rc.36 → 2.1.6-rc.37

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.
Files changed (36) hide show
  1. package/DataGrid.vue_vue_type_style_index_0_scoped_057abdf5_lang.css +1 -0
  2. package/DropdownV4.vue_vue_type_style_index_0_scoped_b484da34_lang.css +1 -0
  3. package/OptionV4.vue_vue_type_style_index_0_scoped_9db0f796_lang.css +1 -0
  4. package/TreeDropdown.vue_vue_type_style_index_0_scoped_4492426c_lang.css +1 -0
  5. package/components/autocomplete/Autocomplete.vue.d.ts +1 -0
  6. package/components/autocomplete/Autocomplete.vue2.js +6 -5
  7. package/components/autocomplete/index.d.ts +1 -0
  8. package/components/dropdown/common/Dropdown.common.js +22 -22
  9. package/components/dropdown/common/Option.common.d.ts +1 -1
  10. package/components/dropdown/common/Option.common.js +9 -9
  11. package/components/dropdown/composables/useChildOptions.d.ts +7 -0
  12. package/components/dropdown/composables/useChildOptions.js +14 -0
  13. package/components/dropdown/v4/DropdownV4.vue.d.ts +6 -0
  14. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  15. package/components/dropdown/v4/DropdownV4.vue2.js +43 -40
  16. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  17. package/components/dropdown/v4/OptionV4.vue2.js +21 -22
  18. package/components/dropdown/v4/TreeDropdown.vue.d.ts +97 -0
  19. package/components/dropdown/v4/TreeDropdown.vue.js +7 -0
  20. package/components/dropdown/v4/TreeDropdown.vue2.js +115 -0
  21. package/components/dropdown/v4/index.d.ts +162 -2
  22. package/components/dropdown/v4/index.js +7 -4
  23. package/components/multibar/MultiBarMenu.vue2.js +12 -11
  24. package/components/table/common/Table.common.d.ts +1 -0
  25. package/components/table/common/Table.common.js +65 -61
  26. package/components/table/v4/DataGrid.vue.d.ts +3 -1
  27. package/components/table/v4/DataGrid.vue.js +2 -2
  28. package/components/table/v4/DataGrid.vue2.js +169 -166
  29. package/components/table/v4/DataGridMenu.vue2.js +3 -2
  30. package/components/table/v4/index.d.ts +9 -3
  31. package/index.d.ts +339 -8
  32. package/mocks/options.d.ts +12 -0
  33. package/package.json +1 -1
  34. package/DataGrid.vue_vue_type_style_index_0_scoped_ac14037f_lang.css +0 -1
  35. package/DropdownV4.vue_vue_type_style_index_0_scoped_2e7a89bc_lang.css +0 -1
  36. package/OptionV4.vue_vue_type_style_index_0_scoped_69abfd4a_lang.css +0 -1
@@ -24,6 +24,7 @@ export declare const tableCommon: (props: any, emit: any) => {
24
24
  showBackToTopButton: import("vue").ComputedRef<boolean>;
25
25
  containerStyle: import("vue").ComputedRef<CSSProperties>;
26
26
  onScroll: (event: any) => void;
27
+ scrollTo: (index: number) => void;
27
28
  savingRows: import("vue").Ref<any[]>;
28
29
  floatingActionPosition: import("vue").Ref<number>;
29
30
  hasExpandSlot: import("vue").ComputedRef<boolean>;
@@ -1,17 +1,17 @@
1
- import { useSlots as G, ref as c, provide as K, computed as l, onMounted as N, nextTick as V } from "vue";
2
- import { useVirtualList as j, useInfiniteScroll as q } from "@vueuse/core";
3
- import { TableContext as F } from "./TableContext.js";
4
- const J = 46, Q = 46, p = (e, a) => {
5
- const m = G(), u = c([]);
6
- K(F, {
7
- onClose({ rowIndex: t, cellIndex: o, value: n } = {}) {
1
+ import { useSlots as K, ref as c, provide as N, computed as s, onMounted as V, nextTick as j } from "vue";
2
+ import { useVirtualList as q, useInfiniteScroll as F } from "@vueuse/core";
3
+ import { TableContext as J } from "./TableContext.js";
4
+ const Q = 46, U = 46, tt = (o, a) => {
5
+ const m = K(), u = c([]);
6
+ N(J, {
7
+ onClose({ rowIndex: t, cellIndex: e, value: n } = {}) {
8
8
  n && (u.value = [...u.value, t], a("saveRow", {
9
9
  rowIndex: t,
10
- cellIndex: o,
10
+ cellIndex: e,
11
11
  value: n,
12
12
  confirm: () => {
13
13
  u.value = u.value.filter(
14
- (i) => i !== t
14
+ (l) => l !== t
15
15
  );
16
16
  }
17
17
  }));
@@ -20,99 +20,103 @@ const J = 46, Q = 46, p = (e, a) => {
20
20
  C.value = t;
21
21
  }
22
22
  });
23
- const x = l(() => !!e.selection), T = l(() => {
24
- const t = (x.value ? `${Q}px ` : "") + (g.value ? `${J}px ` : "");
25
- return e.columns.reduce((o, n) => {
26
- const i = n.width ? `${n.width}px` : `${n.colSpan || 1}fr`;
27
- return `${o} ${i}`;
23
+ const x = s(() => !!o.selection), T = s(() => {
24
+ const t = (x.value ? `${U}px ` : "") + (g.value ? `${Q}px ` : "");
25
+ return o.columns.reduce((e, n) => {
26
+ const l = n.width ? `${n.width}px` : `${n.colSpan || 1}fr`;
27
+ return `${e} ${l}`;
28
28
  }, t);
29
- }), g = l(() => !!m.expanded), y = c(null), C = c(null), H = l(() => Array(e.loadingRowCount).fill(
30
- Array(e.columns.length).fill("")
31
- )), $ = l(() => e.isLoading ? [...e.rows, ...H.value] : e.rows), { list: R, containerProps: s, wrapperProps: b } = j($, {
32
- itemHeight: g.value ? (t) => w[t] ?? e.rowHeight : e.rowHeight
33
- }), k = c(null), h = c(0), B = l(() => !!m.search), I = (t) => {
34
- s.onScroll(), h.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, a("onScroll", t.target.scrollTop);
29
+ }), g = s(() => !!m.expanded), y = c(null), C = c(null), H = s(() => Array(o.loadingRowCount).fill(
30
+ Array(o.columns.length).fill("")
31
+ )), $ = s(() => o.isLoading ? [...o.rows, ...H.value] : o.rows), { list: R, containerProps: i, wrapperProps: b, scrollTo: k } = q(
32
+ $,
33
+ {
34
+ itemHeight: g.value ? (t) => w[t] ?? o.rowHeight : o.rowHeight
35
+ }
36
+ ), B = c(null), h = c(0), I = s(() => !!m.search), O = (t) => {
37
+ i.onScroll(), h.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, a("onScroll", t.target.scrollTop);
35
38
  };
36
- N(() => {
37
- h.value = s.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
38
- s.ref.value?.scrollTo({
39
- top: e.defaultScrollPosition,
39
+ V(() => {
40
+ h.value = i.ref.value?.getBoundingClientRect().width, o.defaultScrollPosition && setTimeout(() => {
41
+ i.ref.value?.scrollTo({
42
+ top: o.defaultScrollPosition,
40
43
  behavior: "smooth"
41
44
  });
42
45
  }, 300);
43
46
  });
44
- const O = l(() => {
47
+ const P = s(() => {
45
48
  const [t] = R.value;
46
49
  return t && t.index > 0;
47
- }), P = l(() => s.style), A = l(() => e.columns.reduce((t, o) => (o.isSticky && (t[o.id] = M(o)), t), {}));
48
- q(
49
- s.ref,
50
+ }), A = s(() => i.style), E = s(() => o.columns.reduce((t, e) => (e.isSticky && (t[e.id] = _(e)), t), {}));
51
+ F(
52
+ i.ref,
50
53
  () => {
51
- e.isInfiniteScroll && a("loadMore");
54
+ o.isInfiniteScroll && a("loadMore");
52
55
  },
53
- { distance: e.infiniteScrollThreshold }
56
+ { distance: o.infiniteScrollThreshold }
54
57
  );
55
- function E() {
56
- s.ref.value?.scrollTo({
58
+ function L() {
59
+ i.ref.value?.scrollTo({
57
60
  top: 0,
58
61
  behavior: "smooth"
59
62
  });
60
63
  }
61
- function L(t) {
62
- if (!e.sort)
64
+ function M(t) {
65
+ if (!o.sort)
63
66
  return;
64
- const o = e.sort.sortBy === t.id;
67
+ const e = o.sort.sortBy === t.id;
65
68
  if (!(t.isSortable || t.isSortable === void 0))
66
69
  return;
67
- let i = e.sort.sortOrder, f = e.sort.sortBy;
68
- o ? i = e.sort.sortOrder === "asc" ? "desc" : "asc" : f = t.id, a("update:sort", { sortBy: f, sortOrder: i });
70
+ let l = o.sort.sortOrder, f = o.sort.sortBy;
71
+ e ? l = o.sort.sortOrder === "asc" ? "desc" : "asc" : f = t.id, a("update:sort", { sortBy: f, sortOrder: l });
69
72
  }
70
- function M(t) {
71
- const { isSticky: o, width: n } = t;
72
- if (!o || !n)
73
+ function _(t) {
74
+ const { isSticky: e, width: n } = t;
75
+ if (!e || !n)
73
76
  return null;
74
- const i = e.columns.findIndex((r) => r.id === t.id), f = e.columns.reduce((r, v, S) => S < i ? r + v.width : r, 0), z = e.columns.reduce((r, v, S) => S > i ? r + v.width : r, 0);
77
+ const l = o.columns.findIndex((r) => r.id === t.id), f = o.columns.reduce((r, v, S) => S < l ? r + v.width : r, 0), G = o.columns.reduce((r, v, S) => S > l ? r + v.width : r, 0);
75
78
  return {
76
- ...t.isStickyRight ? { right: `${z}px` } : { left: `${f}px` },
79
+ ...t.isStickyRight ? { right: `${G}px` } : { left: `${f}px` },
77
80
  zIndex: 1
78
81
  };
79
82
  }
80
- const d = c([]), w = {}, _ = (t) => d.value.includes(t), D = async (t, o) => {
83
+ const d = c([]), w = {}, D = (t) => d.value.includes(t), W = async (t, e) => {
81
84
  const n = d.value.indexOf(t);
82
85
  if (n === -1) {
83
86
  d.value.push(t);
84
- const i = o.target.closest("tr");
85
- await V(), i && (w[t] = i.offsetHeight);
87
+ const l = e.target.closest("tr");
88
+ await j(), l && (w[t] = l.offsetHeight);
86
89
  } else
87
90
  d.value.splice(n, 1), delete w[t];
88
- }, W = l(() => `${e.rowHeight}px`), X = l(
89
- () => `1 / span ${e.columns.length + 1}`
91
+ }, X = s(() => `${o.rowHeight}px`), z = s(
92
+ () => `1 / span ${o.columns.length + 1}`
90
93
  );
91
94
  return {
92
95
  list: R,
93
- containerProps: s,
96
+ containerProps: i,
94
97
  wrapperProps: b,
95
98
  activeRow: y,
96
99
  gridColumnTemplate: T,
97
- floatingActionRef: k,
98
- scrollToTop: E,
99
- toggleSortOrder: L,
100
- columnsStickyPositions: A,
101
- hasSearchSlot: B,
102
- showBackToTopButton: O,
103
- containerStyle: P,
104
- onScroll: I,
100
+ floatingActionRef: B,
101
+ scrollToTop: L,
102
+ toggleSortOrder: M,
103
+ columnsStickyPositions: E,
104
+ hasSearchSlot: I,
105
+ showBackToTopButton: P,
106
+ containerStyle: A,
107
+ onScroll: O,
108
+ scrollTo: k,
105
109
  savingRows: u,
106
110
  floatingActionPosition: h,
107
111
  hasExpandSlot: g,
108
112
  hasCheckboxes: x,
109
- toggleExpandRow: D,
110
- isRowExpanded: _,
111
- cssRowHeight: W,
112
- cssExpandGridCol: X,
113
+ toggleExpandRow: W,
114
+ isRowExpanded: D,
115
+ cssRowHeight: X,
116
+ cssExpandGridCol: z,
113
117
  activeMenuRow: C
114
118
  };
115
119
  };
116
120
  export {
117
- p as tableCommon
121
+ tt as tableCommon
118
122
  };
@@ -49,7 +49,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
49
49
  searchPlaceholder: string;
50
50
  searchAutoFocus: boolean;
51
51
  zIndexBase: number;
52
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
+ }>, {
53
+ scrollTo: (index: number) => void;
54
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
55
  "update:sort": (newSort: Sort) => void;
54
56
  "update:search": (query: string) => void;
55
57
  "update:selection": (selection: unknown[]) => void;
@@ -1,7 +1,7 @@
1
1
  import o from "./DataGrid.vue2.js";
2
2
  /* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../DataGrid.vue_vue_type_style_index_0_scoped_ac14037f_lang.css"; //*');
4
- const s = /* @__PURE__ */ _(o, [["__scopeId", "data-v-ac14037f"]]);
3
+ // import "../../../DataGrid.vue_vue_type_style_index_0_scoped_057abdf5_lang.css"; //*');
4
+ const s = /* @__PURE__ */ _(o, [["__scopeId", "data-v-057abdf5"]]);
5
5
  export {
6
6
  s as default
7
7
  };