@ironsource/shared-ui 2.1.7-test.7 → 2.1.7-test.9

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 (41) hide show
  1. package/DataGrid.vue_vue_type_style_index_0_scoped_706b324e_lang.css +1 -0
  2. package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_0ce71f73_lang.css +1 -0
  3. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_98819e5a_lang.css +1 -0
  4. package/DropdownV4.vue_vue_type_style_index_0_scoped_00ccab6b_lang.css +1 -0
  5. package/OptionV4.vue_vue_type_style_index_0_scoped_77509f61_lang.css +1 -0
  6. package/README.md +1 -1
  7. package/TreeDropdown.vue_vue_type_style_index_0_scoped_5efe563d_lang.css +1 -0
  8. package/components/dropdown/common/Dropdown.common.js +89 -89
  9. package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +1 -0
  10. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
  11. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +32 -29
  12. package/components/dropdown/v4/DropdownV4.vue.d.ts +29 -0
  13. package/components/dropdown/v4/DropdownV4.vue.js +4 -4
  14. package/components/dropdown/v4/DropdownV4.vue2.js +186 -158
  15. package/components/dropdown/v4/OptionV4.vue.d.ts +26 -2
  16. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  17. package/components/dropdown/v4/OptionV4.vue2.js +94 -71
  18. package/components/dropdown/v4/TreeDropdown.vue.d.ts +21 -16
  19. package/components/dropdown/v4/TreeDropdown.vue.js +4 -4
  20. package/components/dropdown/v4/TreeDropdown.vue2.js +162 -74
  21. package/components/dropdown/v4/index.d.ts +451 -82
  22. package/components/table/common/Table.common.js +68 -71
  23. package/components/table/v4/DataGrid.vue.d.ts +4 -10
  24. package/components/table/v4/DataGrid.vue.js +3 -3
  25. package/components/table/v4/DataGrid.vue2.js +134 -128
  26. package/components/table/v4/DataGridRowsCounter.vue.js +2 -2
  27. package/components/table/v4/DataGridRowsCounter.vue2.js +13 -14
  28. package/components/table/v4/MultipleDataGrid.vue.d.ts +2 -2
  29. package/components/table/v4/index.d.ts +7 -41
  30. package/components/table/v4/storyUtils.d.ts +0 -4
  31. package/index.d.ts +1203 -533
  32. package/mocks/options.d.ts +12 -0
  33. package/package.json +1 -1
  34. package/DataGrid.vue_vue_type_style_index_0_scoped_5273976b_lang.css +0 -1
  35. package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css +0 -1
  36. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +0 -1
  37. package/DropdownV4.vue_vue_type_style_index_0_scoped_938772ee_lang.css +0 -1
  38. package/OptionV4.vue_vue_type_style_index_0_scoped_b6a06f00_lang.css +0 -1
  39. package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +0 -1
  40. package/utils/formatNumbers.d.ts +0 -4
  41. package/utils/formatNumbers.js +0 -11
@@ -1,123 +1,120 @@
1
- import { useSlots as G, ref as c, provide as N, computed as s, onMounted as V, nextTick as j } from "vue";
1
+ import { useSlots as K, ref as c, provide as N, computed as s, onMounted as V, nextTick as j } from "vue";
2
2
  import { useVirtualList as q, useInfiniteScroll as F } from "@vueuse/core";
3
3
  import { TableContext as J } from "./TableContext.js";
4
- const Q = 46, U = 46, tt = (e, u) => {
5
- const S = G(), a = c([]);
4
+ const Q = 46, U = 46, tt = (o, a) => {
5
+ const m = K(), u = c([]);
6
6
  N(J, {
7
- onClose({ rowIndex: t, cellIndex: o, value: n } = {}) {
8
- n && (a.value = [...a.value, t], u("saveRow", {
7
+ onClose({ rowIndex: t, cellIndex: e, value: n } = {}) {
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
- a.value = a.value.filter(
14
- (i) => i !== t
13
+ u.value = u.value.filter(
14
+ (l) => l !== t
15
15
  );
16
16
  }
17
17
  }));
18
18
  },
19
19
  setActiveMenuRow(t) {
20
- x.value = t;
20
+ C.value = t;
21
21
  }
22
22
  });
23
- const y = s(() => !!e.selection), C = s(() => {
24
- const t = (y.value ? `${U}px ` : "") + (g.value ? `${Q}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 = s(() => !!S.expanded), A = c(null), x = c(null), R = s(() => Array(e.loadingRowCount).fill(
30
- Array(e.columns.length).fill("")
31
- )), H = s(() => e.rows.length && Array.isArray(e.rows[0]) ? e.isLoading ? [...e.rows, ...R.value] : e.rows : e.isLoading ? [
32
- ...e.rows.map((o) => o[e.rowDataKey]),
33
- ...R.value
34
- ] : e.rows.map((o) => o[e.rowDataKey])), { list: T, containerProps: l, wrapperProps: $, scrollTo: b } = q(
35
- H,
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
+ $,
36
33
  {
37
- itemHeight: g.value ? (t) => w[t] ?? e.rowHeight : e.rowHeight
34
+ itemHeight: g.value ? (t) => w[t] ?? o.rowHeight : o.rowHeight
38
35
  }
39
- ), k = c(null), h = c(0), B = s(() => !!S.search), I = (t) => {
40
- l.onScroll(), h.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, u("onScroll", t.target.scrollTop);
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);
41
38
  };
42
39
  V(() => {
43
- h.value = l.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
44
- l.ref.value?.scrollTo({
45
- top: e.defaultScrollPosition,
40
+ h.value = i.ref.value?.getBoundingClientRect().width, o.defaultScrollPosition && setTimeout(() => {
41
+ i.ref.value?.scrollTo({
42
+ top: o.defaultScrollPosition,
46
43
  behavior: "smooth"
47
44
  });
48
45
  }, 300);
49
46
  });
50
- const O = s(() => {
51
- const [t] = T.value;
47
+ const P = s(() => {
48
+ const [t] = R.value;
52
49
  return t && t.index > 0;
53
- }), P = s(() => l.style), L = s(() => e.columns.reduce((t, o) => (o.isSticky && (t[o.id] = M(o)), t), {}));
50
+ }), A = s(() => i.style), E = s(() => o.columns.reduce((t, e) => (e.isSticky && (t[e.id] = _(e)), t), {}));
54
51
  F(
55
- l.ref,
52
+ i.ref,
56
53
  () => {
57
- e.isInfiniteScroll && u("loadMore");
54
+ o.isInfiniteScroll && a("loadMore");
58
55
  },
59
- { distance: e.infiniteScrollThreshold }
56
+ { distance: o.infiniteScrollThreshold }
60
57
  );
61
- function E() {
62
- l.ref.value?.scrollTo({
58
+ function L() {
59
+ i.ref.value?.scrollTo({
63
60
  top: 0,
64
61
  behavior: "smooth"
65
62
  });
66
63
  }
67
- function D(t) {
68
- if (!e.sort)
64
+ function M(t) {
65
+ if (!o.sort)
69
66
  return;
70
- const o = e.sort.sortBy === t.id;
67
+ const e = o.sort.sortBy === t.id;
71
68
  if (!(t.isSortable || t.isSortable === void 0))
72
69
  return;
73
- let i = e.sort.sortOrder, f = e.sort.sortBy;
74
- o ? i = e.sort.sortOrder === "asc" ? "desc" : "asc" : f = t.id, u("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 });
75
72
  }
76
- function M(t) {
77
- const { isSticky: o, width: n } = t;
78
- if (!o || !n)
73
+ function _(t) {
74
+ const { isSticky: e, width: n } = t;
75
+ if (!e || !n)
79
76
  return null;
80
- const i = e.columns.findIndex((r) => r.id === t.id), f = e.columns.reduce((r, v, m) => m < i ? r + v.width : r, 0), z = e.columns.reduce((r, v, m) => m > 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);
81
78
  return {
82
- ...t.isStickyRight ? { right: `${z}px` } : { left: `${f}px` },
79
+ ...t.isStickyRight ? { right: `${G}px` } : { left: `${f}px` },
83
80
  zIndex: 1
84
81
  };
85
82
  }
86
- const d = c([]), w = {}, _ = (t) => d.value.includes(t), K = async (t, o) => {
83
+ const d = c([]), w = {}, D = (t) => d.value.includes(t), W = async (t, e) => {
87
84
  const n = d.value.indexOf(t);
88
85
  if (n === -1) {
89
86
  d.value.push(t);
90
- const i = o.target.closest("tr");
91
- await j(), i && (w[t] = i.offsetHeight);
87
+ const l = e.target.closest("tr");
88
+ await j(), l && (w[t] = l.offsetHeight);
92
89
  } else
93
90
  d.value.splice(n, 1), delete w[t];
94
- }, W = s(() => `${e.rowHeight}px`), X = s(
95
- () => `1 / span ${e.columns.length + 1}`
91
+ }, X = s(() => `${o.rowHeight}px`), z = s(
92
+ () => `1 / span ${o.columns.length + 1}`
96
93
  );
97
94
  return {
98
- list: T,
99
- containerProps: l,
100
- wrapperProps: $,
101
- activeRow: A,
102
- gridColumnTemplate: C,
103
- floatingActionRef: k,
104
- scrollToTop: E,
105
- toggleSortOrder: D,
106
- columnsStickyPositions: L,
107
- hasSearchSlot: B,
108
- showBackToTopButton: O,
109
- containerStyle: P,
110
- onScroll: I,
111
- scrollTo: b,
112
- savingRows: a,
95
+ list: R,
96
+ containerProps: i,
97
+ wrapperProps: b,
98
+ activeRow: y,
99
+ gridColumnTemplate: T,
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,
109
+ savingRows: u,
113
110
  floatingActionPosition: h,
114
111
  hasExpandSlot: g,
115
- hasCheckboxes: y,
116
- toggleExpandRow: K,
117
- isRowExpanded: _,
118
- cssRowHeight: W,
119
- cssExpandGridCol: X,
120
- activeMenuRow: x
112
+ hasCheckboxes: x,
113
+ toggleExpandRow: W,
114
+ isRowExpanded: D,
115
+ cssRowHeight: X,
116
+ cssExpandGridCol: z,
117
+ activeMenuRow: C
121
118
  };
122
119
  };
123
120
  export {
@@ -25,8 +25,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
25
25
  searchPlaceholder?: string;
26
26
  searchAutoFocus?: boolean;
27
27
  zIndexBase?: number;
28
- rowCustomClassKey?: string;
29
- rowDataKey?: string;
30
28
  }>, {
31
29
  title: string;
32
30
  sort: any;
@@ -51,8 +49,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
51
49
  searchPlaceholder: string;
52
50
  searchAutoFocus: boolean;
53
51
  zIndexBase: number;
54
- rowCustomClassKey: string;
55
- rowDataKey: string;
56
52
  }>, {
57
53
  scrollTo: (index: number) => void;
58
54
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -97,8 +93,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
97
93
  searchPlaceholder?: string;
98
94
  searchAutoFocus?: boolean;
99
95
  zIndexBase?: number;
100
- rowCustomClassKey?: string;
101
- rowDataKey?: string;
102
96
  }>, {
103
97
  title: string;
104
98
  sort: any;
@@ -123,8 +117,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
123
117
  searchPlaceholder: string;
124
118
  searchAutoFocus: boolean;
125
119
  zIndexBase: number;
126
- rowCustomClassKey: string;
127
- rowDataKey: string;
128
120
  }>>> & {
129
121
  onSelectAll?: (value: boolean) => any;
130
122
  "onUpdate:search"?: (query: string) => any;
@@ -165,8 +157,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
165
157
  selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
166
158
  emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
167
159
  zIndexBase: number;
168
- rowCustomClassKey: string;
169
- rowDataKey: string;
170
160
  }>, Partial<Record<`section-${string}`, (_: {}) => any>> & Partial<Record<`header-${string}`, (_: {
171
161
  column: Column;
172
162
  }) => any>> & Partial<Record<`cell-${string}`, (_: {
@@ -185,6 +175,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
185
175
  row: import("@vueuse/core").UseVirtualListItem<Row>;
186
176
  gridColumnTemplate: any;
187
177
  }): any;
178
+ "floating-row"?(_: {
179
+ row: import("@vueuse/core").UseVirtualListItem<Row>;
180
+ rowIndex: number;
181
+ }): any;
188
182
  "empty-state"?(_: {}): any;
189
183
  footer?(_: {}): any;
190
184
  }>;
@@ -1,7 +1,7 @@
1
1
  import o from "./DataGrid.vue2.js";
2
- /* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../DataGrid.vue_vue_type_style_index_0_scoped_5273976b_lang.css"; //*');
4
- const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-5273976b"]]);
2
+ /* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../DataGrid.vue_vue_type_style_index_0_scoped_706b324e_lang.css"; //*');
4
+ const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-706b324e"]]);
5
5
  export {
6
6
  a as default
7
7
  };