@ironsource/shared-ui 2.1.11-rc.13 → 2.1.11-rc.14
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/components/table/common/Table.common.js +26 -28
- package/index.js +1 -1
- package/package.json +1 -1
|
@@ -4,17 +4,15 @@ import { TableContext as J } from "./TableContext.js";
|
|
|
4
4
|
const Q = 46, U = 46, tt = (e, u) => {
|
|
5
5
|
const S = G(), a = c([]);
|
|
6
6
|
N(J, {
|
|
7
|
-
onClose({ rowIndex: t, cellIndex: o, value:
|
|
8
|
-
|
|
7
|
+
onClose({ rowIndex: t, cellIndex: o, value: l } = {}) {
|
|
8
|
+
a.value = [...a.value, t], u("saveRow", {
|
|
9
9
|
rowIndex: t,
|
|
10
10
|
cellIndex: o,
|
|
11
|
-
value:
|
|
11
|
+
value: l,
|
|
12
12
|
confirm: () => {
|
|
13
|
-
a.value = a.value.filter(
|
|
14
|
-
(i) => i !== t
|
|
15
|
-
);
|
|
13
|
+
a.value = a.value.filter((n) => n !== t);
|
|
16
14
|
}
|
|
17
|
-
})
|
|
15
|
+
});
|
|
18
16
|
},
|
|
19
17
|
setActiveMenuRow(t) {
|
|
20
18
|
x.value = t;
|
|
@@ -22,26 +20,26 @@ const Q = 46, U = 46, tt = (e, u) => {
|
|
|
22
20
|
});
|
|
23
21
|
const y = s(() => !!e.selection), C = s(() => {
|
|
24
22
|
const t = (y.value ? `${U}px ` : "") + (g.value ? `${Q}px ` : "");
|
|
25
|
-
return e.columns.reduce((o,
|
|
26
|
-
const
|
|
27
|
-
return `${o} ${
|
|
23
|
+
return e.columns.reduce((o, l) => {
|
|
24
|
+
const n = l.width ? `${l.width}px` : `${l.colSpan || 1}fr`;
|
|
25
|
+
return `${o} ${n}`;
|
|
28
26
|
}, t);
|
|
29
27
|
}), g = s(() => !!S.expanded), A = c(null), x = c(null), R = s(() => Array(e.loadingRowCount).fill(
|
|
30
28
|
Array(e.columns.length).fill("")
|
|
31
29
|
)), H = s(() => e.rows.length && Array.isArray(e.rows[0]) ? e.isLoading ? [...e.rows, ...R.value] : e.rows : e.isLoading ? [
|
|
32
30
|
...e.rows.map((o) => o[e.rowDataKey]),
|
|
33
31
|
...R.value
|
|
34
|
-
] : e.rows.map((o) => o[e.rowDataKey])), { list: T, containerProps:
|
|
32
|
+
] : e.rows.map((o) => o[e.rowDataKey])), { list: T, containerProps: i, wrapperProps: $, scrollTo: b } = q(
|
|
35
33
|
H,
|
|
36
34
|
{
|
|
37
35
|
itemHeight: g.value ? (t) => w[t] ?? e.rowHeight : e.rowHeight
|
|
38
36
|
}
|
|
39
37
|
), k = c(null), h = c(0), B = s(() => !!S.search), I = (t) => {
|
|
40
|
-
|
|
38
|
+
i.onScroll(), h.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, u("onScroll", t.target.scrollTop);
|
|
41
39
|
};
|
|
42
40
|
V(() => {
|
|
43
|
-
h.value =
|
|
44
|
-
|
|
41
|
+
h.value = i.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
|
|
42
|
+
i.ref.value?.scrollTo({
|
|
45
43
|
top: e.defaultScrollPosition,
|
|
46
44
|
behavior: "smooth"
|
|
47
45
|
});
|
|
@@ -50,16 +48,16 @@ const Q = 46, U = 46, tt = (e, u) => {
|
|
|
50
48
|
const O = s(() => {
|
|
51
49
|
const [t] = T.value;
|
|
52
50
|
return t && t.index > 0;
|
|
53
|
-
}), P = s(() =>
|
|
51
|
+
}), P = s(() => i.style), L = s(() => e.columns.reduce((t, o) => (o.isSticky && (t[o.id] = M(o)), t), {}));
|
|
54
52
|
F(
|
|
55
|
-
|
|
53
|
+
i.ref,
|
|
56
54
|
() => {
|
|
57
55
|
e.isInfiniteScroll && u("loadMore");
|
|
58
56
|
},
|
|
59
57
|
{ distance: e.infiniteScrollThreshold }
|
|
60
58
|
);
|
|
61
59
|
function E() {
|
|
62
|
-
|
|
60
|
+
i.ref.value?.scrollTo({
|
|
63
61
|
top: 0,
|
|
64
62
|
behavior: "smooth"
|
|
65
63
|
});
|
|
@@ -70,33 +68,33 @@ const Q = 46, U = 46, tt = (e, u) => {
|
|
|
70
68
|
const o = e.sort.sortBy === t.id;
|
|
71
69
|
if (!(t.isSortable || t.isSortable === void 0))
|
|
72
70
|
return;
|
|
73
|
-
let
|
|
74
|
-
o ?
|
|
71
|
+
let n = e.sort.sortOrder, f = e.sort.sortBy;
|
|
72
|
+
o ? n = e.sort.sortOrder === "asc" ? "desc" : "asc" : f = t.id, u("update:sort", { sortBy: f, sortOrder: n });
|
|
75
73
|
}
|
|
76
74
|
function M(t) {
|
|
77
|
-
const { isSticky: o, width:
|
|
78
|
-
if (!o || !
|
|
75
|
+
const { isSticky: o, width: l } = t;
|
|
76
|
+
if (!o || !l)
|
|
79
77
|
return null;
|
|
80
|
-
const
|
|
78
|
+
const n = e.columns.findIndex((r) => r.id === t.id), f = e.columns.reduce((r, v, m) => m < n ? r + v.width : r, 0), z = e.columns.reduce((r, v, m) => m > n ? r + v.width : r, 0);
|
|
81
79
|
return {
|
|
82
80
|
...t.isStickyRight ? { right: `${z}px` } : { left: `${f}px` },
|
|
83
81
|
zIndex: 1
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
const d = c([]), w = {}, _ = (t) => d.value.includes(t), K = async (t, o) => {
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
85
|
+
const l = d.value.indexOf(t);
|
|
86
|
+
if (l === -1) {
|
|
89
87
|
d.value.push(t);
|
|
90
|
-
const
|
|
91
|
-
await j(),
|
|
88
|
+
const n = o.target.closest("tr");
|
|
89
|
+
await j(), n && (w[t] = n.offsetHeight);
|
|
92
90
|
} else
|
|
93
|
-
d.value.splice(
|
|
91
|
+
d.value.splice(l, 1), delete w[t];
|
|
94
92
|
}, W = s(() => `${e.rowHeight}px`), X = s(
|
|
95
93
|
() => `1 / span ${e.columns.length + 1}`
|
|
96
94
|
);
|
|
97
95
|
return {
|
|
98
96
|
list: T,
|
|
99
|
-
containerProps:
|
|
97
|
+
containerProps: i,
|
|
100
98
|
wrapperProps: $,
|
|
101
99
|
activeRow: A,
|
|
102
100
|
gridColumnTemplate: C,
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './AutocompleteDropdown.vue_vue_type_style_index_0_scoped_214ddaf4_lang.css';
|
|
2
2
|
import { AppTriggerTypes as ro } from "./components/appTrigger/index.js";
|
|
3
3
|
import { AutocompleteDropdownTypes as mo } from "./components/autocompleteDropdown/index.js";
|
|
4
4
|
import { MenuItemTypes as po } from "./components/menuItem/index.js";
|