@ironsource/shared-ui 2.1.8-rc.1 → 2.1.8-rc.3
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/DataGrid.vue_vue_type_style_index_0_scoped_7524407f_lang.css +1 -0
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css +1 -0
- package/components/table/common/Table.common.js +71 -68
- package/components/table/v4/DataGrid.vue.d.ts +10 -4
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +130 -136
- package/components/table/v4/DataGridRowsCounter.vue.js +2 -2
- package/components/table/v4/DataGridRowsCounter.vue2.js +14 -13
- package/components/table/v4/MultipleDataGrid.vue.d.ts +2 -2
- package/components/table/v4/index.d.ts +41 -7
- package/components/table/v4/storyUtils.d.ts +8 -0
- package/index.d.ts +82 -14
- package/package.json +3 -2
- package/utils/formatNumbers.d.ts +4 -0
- package/utils/formatNumbers.js +11 -0
- package/utils/index.d.ts +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_706b324e_lang.css +0 -1
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_0ce71f73_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sticky[data-v-7524407f]{position:sticky}.table-container[data-v-7524407f]{width:100%;position:relative;display:flex;flex-direction:column}.table-header[data-v-7524407f]{display:flex;align-items:center;height:calc(var(--spacing-800) - 1px);border-bottom:1px solid var(--common-divider);background-color:var(--background-paper-elevation-0);position:sticky;left:0;padding:var(--spacing-300)}.table-header .table-title[data-v-7524407f]{display:flex;flex:1;align-items:center;justify-content:flex-start;height:100%;color:var(--text-primary)}.table-header .table-header-right[data-v-7524407f]{display:flex;align-items:center;height:100%}.table-header .search-wrapper[data-v-7524407f]{width:13.75rem}.table-header.isStickyHeader[data-v-7524407f]{z-index:calc(var(--06b5104a) + 3);top:0}.table-head-container[data-v-7524407f]{display:flex;align-items:center;white-space:nowrap;color:var(--text-primary)}.table-footer[data-v-7524407f]{color:var(--text-primary);background-color:var(--background-paper-elevation-0);padding:0 var(--spacing-300);display:flex;align-items:center;min-height:var(--spacing-600);border:1px solid var(--common-divider);border-radius:var(--border-radius-md);border-top-right-radius:0;border-top-left-radius:0}.table-body-wrapper[data-v-7524407f]{display:inline-table}.table-header-actions[data-v-7524407f]{margin-left:var(--spacing-100);display:flex;align-items:center}.table-row[data-v-7524407f]{position:relative}.table-row.loading[data-v-7524407f]{opacity:.7}.table-row:not(.expanded):last-child>td[data-v-7524407f]{border-bottom:none}.table-row.expanded:last-child>.expanded-row[data-v-7524407f]{border-bottom:none}.expanded-row[data-v-7524407f]{grid-column:var(--bd683984);border-bottom:1px solid var(--common-divider);background-color:var(--background-default)}table[data-v-7524407f]{position:relative;display:block;overflow:auto;background:var(--background-paper-elevation-0);border:1px solid var(--common-divider);color:var(--text-primary);text-align:left;table-layout:fixed;width:100%;max-height:100%;border-radius:var(--border-radius-md);border-collapse:collapse;border-spacing:0}table.hasFooter[data-v-7524407f]{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none}table td[data-v-7524407f],table th[data-v-7524407f]{line-height:normal;padding:0 var(--spacing-200)}table td[data-v-7524407f]:first-of-type,table th[data-v-7524407f]:first-of-type{padding-left:var(--spacing-300)}table td[data-v-7524407f]:last-of-type,table th[data-v-7524407f]:last-of-type{padding-right:var(--spacing-300)}table td.expand-toggle-cell[data-v-7524407f],table th.expand-toggle-cell[data-v-7524407f]{padding-left:var(--spacing-150);padding-right:var(--spacing-75)}table>thead[data-v-7524407f]{border-bottom:none;z-index:calc(var(--06b5104a) + 1);display:inline-table;min-width:100%}table>thead>tr[data-v-7524407f]{color:var(--text-primary);border-bottom:1px solid var(--common-divider);height:var(--spacing-500);display:grid;grid-template-columns:var(--45ac1eb7)}table>thead>tr>th[data-v-7524407f]{background:var(--background-paper-elevation-0);width:100%;display:flex;align-items:center;cursor:default}table>thead>tr>th.bordered[data-v-7524407f]{border-right:1px solid var(--common-divider)}table>thead>tr>th.bordered.isStickyRight[data-v-7524407f]{border-right:none;border-left:1px solid var(--common-divider)}table>thead>tr>th.isTextRight[data-v-7524407f]{justify-content:flex-end}table>thead>tr>th.isSortable[data-v-7524407f]{cursor:pointer}table>thead.sticky[data-v-7524407f]{position:sticky;top:0;background:white}table>thead.isStickyHeader[data-v-7524407f]{z-index:calc(var(--06b5104a) + 2);top:calc(var(--spacing-800) - 1px)}table>tbody[data-v-7524407f]{display:block}table>tbody>*>tr[data-v-7524407f]{background-color:var(--background-default);min-height:var(--2737857f);height:auto;display:grid;align-items:center;grid-template-columns:var(--45ac1eb7)}table>tbody>*>tr:nth-of-type(2n)>td[data-v-7524407f]{background-color:var(--background-default)}table>tbody>*>tr:hover:not(.loading)>td[data-v-7524407f],table>tbody>*>tr.activeMenu>td[data-v-7524407f]{background-color:var(--background-paper-elevation-1)}table>tbody td[data-v-7524407f]{background-color:var(--background-default);border:none;min-width:0;display:flex;min-height:var(--2737857f);height:auto;width:100%;place-items:center;border-bottom:1px solid var(--common-divider);justify-content:start}table>tbody td.bordered[data-v-7524407f]{border-right:1px solid var(--common-divider)}table>tbody td.bordered.isStickyRight[data-v-7524407f]{border-right:none;border-left:1px solid var(--common-divider)}table>tbody td.isTextRight[data-v-7524407f]{justify-content:flex-end;text-align:right}.section-container[data-v-7524407f]{left:0}.sections[data-v-7524407f]{display:flex}.section[data-v-7524407f]{padding:0 1.5rem;background:var(--background-default);left:0;height:32px;display:flex;align-items:flex-end;border-right:1px solid var(--common-divider)}.table-cell[data-v-7524407f]{width:100%}.empty-state[data-v-7524407f]{min-height:250px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.data-grid-rows-counter[data-v-ef699ec5]{color:var(--text-secondary)}.text-strong[data-v-ef699ec5]{color:var(--text-primary)}
|
|
@@ -1,120 +1,123 @@
|
|
|
1
|
-
import { useSlots as
|
|
1
|
+
import { useSlots as G, 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 = (
|
|
5
|
-
const
|
|
4
|
+
const Q = 46, U = 46, tt = (e, u) => {
|
|
5
|
+
const S = G(), a = c([]);
|
|
6
6
|
N(J, {
|
|
7
|
-
onClose({ rowIndex: t, cellIndex:
|
|
8
|
-
n && (
|
|
7
|
+
onClose({ rowIndex: t, cellIndex: o, value: n } = {}) {
|
|
8
|
+
n && (a.value = [...a.value, t], u("saveRow", {
|
|
9
9
|
rowIndex: t,
|
|
10
|
-
cellIndex:
|
|
10
|
+
cellIndex: o,
|
|
11
11
|
value: n,
|
|
12
12
|
confirm: () => {
|
|
13
|
-
|
|
14
|
-
(
|
|
13
|
+
a.value = a.value.filter(
|
|
14
|
+
(i) => i !== t
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
}));
|
|
18
18
|
},
|
|
19
19
|
setActiveMenuRow(t) {
|
|
20
|
-
|
|
20
|
+
x.value = t;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
const t = (
|
|
25
|
-
return
|
|
26
|
-
const
|
|
27
|
-
return `${
|
|
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}`;
|
|
28
28
|
}, t);
|
|
29
|
-
}), g = s(() => !!
|
|
30
|
-
Array(
|
|
31
|
-
)),
|
|
32
|
-
|
|
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,
|
|
33
36
|
{
|
|
34
|
-
itemHeight: g.value ? (t) => w[t] ??
|
|
37
|
+
itemHeight: g.value ? (t) => w[t] ?? e.rowHeight : e.rowHeight
|
|
35
38
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
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);
|
|
38
41
|
};
|
|
39
42
|
V(() => {
|
|
40
|
-
h.value =
|
|
41
|
-
|
|
42
|
-
top:
|
|
43
|
+
h.value = l.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
|
|
44
|
+
l.ref.value?.scrollTo({
|
|
45
|
+
top: e.defaultScrollPosition,
|
|
43
46
|
behavior: "smooth"
|
|
44
47
|
});
|
|
45
48
|
}, 300);
|
|
46
49
|
});
|
|
47
|
-
const
|
|
48
|
-
const [t] =
|
|
50
|
+
const O = s(() => {
|
|
51
|
+
const [t] = T.value;
|
|
49
52
|
return t && t.index > 0;
|
|
50
|
-
}),
|
|
53
|
+
}), P = s(() => l.style), L = s(() => e.columns.reduce((t, o) => (o.isSticky && (t[o.id] = M(o)), t), {}));
|
|
51
54
|
F(
|
|
52
|
-
|
|
55
|
+
l.ref,
|
|
53
56
|
() => {
|
|
54
|
-
|
|
57
|
+
e.isInfiniteScroll && u("loadMore");
|
|
55
58
|
},
|
|
56
|
-
{ distance:
|
|
59
|
+
{ distance: e.infiniteScrollThreshold }
|
|
57
60
|
);
|
|
58
|
-
function
|
|
59
|
-
|
|
61
|
+
function E() {
|
|
62
|
+
l.ref.value?.scrollTo({
|
|
60
63
|
top: 0,
|
|
61
64
|
behavior: "smooth"
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
|
-
function
|
|
65
|
-
if (!
|
|
67
|
+
function D(t) {
|
|
68
|
+
if (!e.sort)
|
|
66
69
|
return;
|
|
67
|
-
const
|
|
70
|
+
const o = e.sort.sortBy === t.id;
|
|
68
71
|
if (!(t.isSortable || t.isSortable === void 0))
|
|
69
72
|
return;
|
|
70
|
-
let
|
|
71
|
-
|
|
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 });
|
|
72
75
|
}
|
|
73
|
-
function
|
|
74
|
-
const { isSticky:
|
|
75
|
-
if (!
|
|
76
|
+
function M(t) {
|
|
77
|
+
const { isSticky: o, width: n } = t;
|
|
78
|
+
if (!o || !n)
|
|
76
79
|
return null;
|
|
77
|
-
const
|
|
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);
|
|
78
81
|
return {
|
|
79
|
-
...t.isStickyRight ? { right: `${
|
|
82
|
+
...t.isStickyRight ? { right: `${z}px` } : { left: `${f}px` },
|
|
80
83
|
zIndex: 1
|
|
81
84
|
};
|
|
82
85
|
}
|
|
83
|
-
const d = c([]), w = {},
|
|
86
|
+
const d = c([]), w = {}, _ = (t) => d.value.includes(t), K = async (t, o) => {
|
|
84
87
|
const n = d.value.indexOf(t);
|
|
85
88
|
if (n === -1) {
|
|
86
89
|
d.value.push(t);
|
|
87
|
-
const
|
|
88
|
-
await j(),
|
|
90
|
+
const i = o.target.closest("tr");
|
|
91
|
+
await j(), i && (w[t] = i.offsetHeight);
|
|
89
92
|
} else
|
|
90
93
|
d.value.splice(n, 1), delete w[t];
|
|
91
|
-
},
|
|
92
|
-
() => `1 / span ${
|
|
94
|
+
}, W = s(() => `${e.rowHeight}px`), X = s(
|
|
95
|
+
() => `1 / span ${e.columns.length + 1}`
|
|
93
96
|
);
|
|
94
97
|
return {
|
|
95
|
-
list:
|
|
96
|
-
containerProps:
|
|
97
|
-
wrapperProps:
|
|
98
|
-
activeRow:
|
|
99
|
-
gridColumnTemplate:
|
|
100
|
-
floatingActionRef:
|
|
101
|
-
scrollToTop:
|
|
102
|
-
toggleSortOrder:
|
|
103
|
-
columnsStickyPositions:
|
|
104
|
-
hasSearchSlot:
|
|
105
|
-
showBackToTopButton:
|
|
106
|
-
containerStyle:
|
|
107
|
-
onScroll:
|
|
108
|
-
scrollTo:
|
|
109
|
-
savingRows:
|
|
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,
|
|
110
113
|
floatingActionPosition: h,
|
|
111
114
|
hasExpandSlot: g,
|
|
112
|
-
hasCheckboxes:
|
|
113
|
-
toggleExpandRow:
|
|
114
|
-
isRowExpanded:
|
|
115
|
-
cssRowHeight:
|
|
116
|
-
cssExpandGridCol:
|
|
117
|
-
activeMenuRow:
|
|
115
|
+
hasCheckboxes: y,
|
|
116
|
+
toggleExpandRow: K,
|
|
117
|
+
isRowExpanded: _,
|
|
118
|
+
cssRowHeight: W,
|
|
119
|
+
cssExpandGridCol: X,
|
|
120
|
+
activeMenuRow: x
|
|
118
121
|
};
|
|
119
122
|
};
|
|
120
123
|
export {
|
|
@@ -25,6 +25,8 @@ 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;
|
|
28
30
|
}>, {
|
|
29
31
|
title: string;
|
|
30
32
|
sort: any;
|
|
@@ -49,6 +51,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
49
51
|
searchPlaceholder: string;
|
|
50
52
|
searchAutoFocus: boolean;
|
|
51
53
|
zIndexBase: number;
|
|
54
|
+
rowCustomClassKey: string;
|
|
55
|
+
rowDataKey: string;
|
|
52
56
|
}>, {
|
|
53
57
|
scrollTo: (index: number) => void;
|
|
54
58
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -93,6 +97,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
93
97
|
searchPlaceholder?: string;
|
|
94
98
|
searchAutoFocus?: boolean;
|
|
95
99
|
zIndexBase?: number;
|
|
100
|
+
rowCustomClassKey?: string;
|
|
101
|
+
rowDataKey?: string;
|
|
96
102
|
}>, {
|
|
97
103
|
title: string;
|
|
98
104
|
sort: any;
|
|
@@ -117,6 +123,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
117
123
|
searchPlaceholder: string;
|
|
118
124
|
searchAutoFocus: boolean;
|
|
119
125
|
zIndexBase: number;
|
|
126
|
+
rowCustomClassKey: string;
|
|
127
|
+
rowDataKey: string;
|
|
120
128
|
}>>> & {
|
|
121
129
|
onSelectAll?: (value: boolean) => any;
|
|
122
130
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -157,6 +165,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
157
165
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
158
166
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
159
167
|
zIndexBase: number;
|
|
168
|
+
rowCustomClassKey: string;
|
|
169
|
+
rowDataKey: string;
|
|
160
170
|
}>, Partial<Record<`section-${string}`, (_: {}) => any>> & Partial<Record<`header-${string}`, (_: {
|
|
161
171
|
column: Column;
|
|
162
172
|
}) => any>> & Partial<Record<`cell-${string}`, (_: {
|
|
@@ -175,10 +185,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
175
185
|
row: import("@vueuse/core").UseVirtualListItem<Row>;
|
|
176
186
|
gridColumnTemplate: any;
|
|
177
187
|
}): any;
|
|
178
|
-
"floating-row"?(_: {
|
|
179
|
-
row: import("@vueuse/core").UseVirtualListItem<Row>;
|
|
180
|
-
rowIndex: number;
|
|
181
|
-
}): any;
|
|
182
188
|
"empty-state"?(_: {}): any;
|
|
183
189
|
footer?(_: {}): any;
|
|
184
190
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DataGrid.vue2.js";
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../../DataGrid.
|
|
4
|
-
const a = /* @__PURE__ */
|
|
2
|
+
/* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../DataGrid.vue_vue_type_style_index_0_scoped_7524407f_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-7524407f"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import "../../../DataGrid.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import "../../../DataGrid.vue_vue_type_style_index_0_scoped_7524407f_lang.css"; import { defineComponent as ie, useCssVars as de, unref as t, useSlots as oe, computed as v, openBlock as l, createElementBlock as o, createElementVNode as u, normalizeStyle as x, normalizeClass as f, renderSlot as r, createVNode as h, withCtx as T, createTextVNode as w, toDisplayString as E, isRef as ne, createCommentVNode as c, Fragment as B, renderList as I, createBlock as z, mergeProps as re } from "vue";
|
|
2
|
+
import p from "../../typography/v4/Typography.vue.js";
|
|
3
|
+
import ce from "../../skeleton/v4/SkeletonV4.vue.js";
|
|
4
4
|
import ue from "../../emptyState/v4/EmptyStateV4.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import K from "../../checkbox/v4/CheckboxV4.vue.js";
|
|
6
6
|
import { TableTestIdModifiers as S } from "../../../testids/index.js";
|
|
7
7
|
import { tableCommon as he } from "../common/Table.common.js";
|
|
8
8
|
import ye from "./SortIcon.vue.js";
|
|
9
9
|
import fe from "./HelpIcon.vue.js";
|
|
10
10
|
import Se from "./ExpandRowToggle.vue.js";
|
|
11
11
|
import ke from "../../search/v4/SearchV4.vue.js";
|
|
12
|
-
import { useVModel as
|
|
13
|
-
const
|
|
12
|
+
import { useVModel as me } from "@vueuse/core";
|
|
13
|
+
const ge = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["data-testid"], Re = ["data-testid"], Ce = { class: "search-wrapper" }, xe = ["data-testid"], Te = ["data-testid"], we = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "checkbox-cell"
|
|
16
|
-
},
|
|
16
|
+
}, Ee = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "expand-toggle-cell"
|
|
19
|
-
},
|
|
19
|
+
}, Be = ["onClick"], Ie = { class: "table-head-container" }, pe = ["data-testid"], Ae = ["onMouseenter", "onClick"], Ve = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "checkbox-cell"
|
|
22
22
|
}, Me = {
|
|
@@ -25,13 +25,10 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
25
25
|
}, Pe = {
|
|
26
26
|
key: 2,
|
|
27
27
|
class: "expanded-row"
|
|
28
|
-
},
|
|
29
|
-
key: 3,
|
|
30
|
-
class: "floating-row"
|
|
31
|
-
}, He = { key: 1 }, Ne = {
|
|
28
|
+
}, He = { key: 1 }, Le = {
|
|
32
29
|
key: 0,
|
|
33
30
|
class: "table-footer"
|
|
34
|
-
},
|
|
31
|
+
}, qe = /* @__PURE__ */ ie({
|
|
35
32
|
__name: "DataGrid",
|
|
36
33
|
props: {
|
|
37
34
|
title: { default: "" },
|
|
@@ -40,8 +37,8 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
40
37
|
sections: { default: null },
|
|
41
38
|
sort: { default: null },
|
|
42
39
|
selection: { default: null },
|
|
43
|
-
getRowId: { type: Function, default: (s,
|
|
44
|
-
selectedMatcher: { type: Function, default: (s,
|
|
40
|
+
getRowId: { type: Function, default: (s, m) => m },
|
|
41
|
+
selectedMatcher: { type: Function, default: (s, m) => s === m },
|
|
45
42
|
isSticky: { type: Boolean, default: !0 },
|
|
46
43
|
isStickyHeader: { type: Boolean, default: !1 },
|
|
47
44
|
isLoading: { type: Boolean, default: !1 },
|
|
@@ -58,70 +55,72 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
58
55
|
showSearch: { type: Boolean, default: !1 },
|
|
59
56
|
searchPlaceholder: { default: "Search" },
|
|
60
57
|
searchAutoFocus: { type: Boolean, default: !1 },
|
|
61
|
-
zIndexBase: { default: 100 }
|
|
58
|
+
zIndexBase: { default: 100 },
|
|
59
|
+
rowCustomClassKey: { default: "" },
|
|
60
|
+
rowDataKey: { default: "" }
|
|
62
61
|
},
|
|
63
62
|
emits: ["update:sort", "update:search", "update:selection", "onScroll", "onClearSearch", "saveRow", "loadMore", "selectAll", "selectRow", "clickRow"],
|
|
64
|
-
setup(s, { expose:
|
|
65
|
-
const
|
|
63
|
+
setup(s, { expose: m, emit: y }) {
|
|
64
|
+
const i = s;
|
|
66
65
|
de((a) => ({
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
66
|
+
"06b5104a": s.zIndexBase,
|
|
67
|
+
bd683984: t(X),
|
|
68
|
+
"45ac1eb7": t(H),
|
|
69
|
+
"2737857f": t(J)
|
|
71
70
|
}));
|
|
72
|
-
const b = oe(), {
|
|
71
|
+
const b = oe(), U = (a) => i.rowCustomClassKey && i.rows[a] ? i.rows[a][i.rowCustomClassKey] : "", {
|
|
73
72
|
list: P,
|
|
74
73
|
containerProps: G,
|
|
75
74
|
wrapperProps: Y,
|
|
76
|
-
activeRow:
|
|
77
|
-
gridColumnTemplate:
|
|
75
|
+
activeRow: A,
|
|
76
|
+
gridColumnTemplate: H,
|
|
78
77
|
toggleSortOrder: Q,
|
|
79
|
-
columnsStickyPositions:
|
|
78
|
+
columnsStickyPositions: L,
|
|
80
79
|
hasSearchSlot: W,
|
|
81
80
|
containerStyle: j,
|
|
82
81
|
onScroll: N,
|
|
83
82
|
savingRows: F,
|
|
84
|
-
hasExpandSlot:
|
|
83
|
+
hasExpandSlot: $,
|
|
85
84
|
toggleExpandRow: q,
|
|
86
85
|
cssRowHeight: J,
|
|
87
|
-
cssExpandGridCol:
|
|
88
|
-
isRowExpanded:
|
|
86
|
+
cssExpandGridCol: X,
|
|
87
|
+
isRowExpanded: V,
|
|
89
88
|
hasCheckboxes: O,
|
|
90
|
-
activeMenuRow:
|
|
91
|
-
scrollTo:
|
|
92
|
-
} = he(
|
|
93
|
-
const a =
|
|
94
|
-
return a.length && a.every((d) =>
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
(d) => !
|
|
89
|
+
activeMenuRow: Z,
|
|
90
|
+
scrollTo: _
|
|
91
|
+
} = he(i, y), D = v(() => !!b.footer), g = me(i, "search", y), ee = v(() => i.selection.length || 0), M = v(() => {
|
|
92
|
+
const a = i.rows.map((d, e) => i.getRowId(d, e));
|
|
93
|
+
return a.length && a.every((d) => R(d));
|
|
94
|
+
}), R = (a) => i.selection.findIndex((d) => i.selectedMatcher(a, d)) !== -1, te = (a) => {
|
|
95
|
+
R(a) ? (C(
|
|
96
|
+
i.selection.filter(
|
|
97
|
+
(d) => !i.selectedMatcher(a, d)
|
|
99
98
|
)
|
|
100
|
-
), y("selectRow", !1)) : (C([...
|
|
101
|
-
},
|
|
99
|
+
), y("selectRow", !1)) : (C([...i.selection, a]), y("selectRow", !0));
|
|
100
|
+
}, se = () => {
|
|
102
101
|
if (M.value)
|
|
103
102
|
C([]), y("selectAll", !1);
|
|
104
103
|
else {
|
|
105
|
-
const a =
|
|
106
|
-
C([...
|
|
104
|
+
const a = i.rows.map((d, e) => i.getRowId(d, e)).filter((d) => !R(d));
|
|
105
|
+
C([...i.selection, ...a]), y("selectAll", !0);
|
|
107
106
|
}
|
|
108
107
|
}, C = (a) => {
|
|
109
108
|
y("update:selection", a);
|
|
110
|
-
},
|
|
111
|
-
() =>
|
|
109
|
+
}, ae = v(
|
|
110
|
+
() => i.emptyStateVariant ?? (g.value ? "no-results" : "no-data")
|
|
112
111
|
), le = v(
|
|
113
|
-
() =>
|
|
112
|
+
() => i.emptyStateSubtitle ? i.emptyStateSubtitle : g.value ? "Search again with different filters" : void 0
|
|
114
113
|
);
|
|
115
|
-
return
|
|
116
|
-
scrollTo:
|
|
117
|
-
}), (a, d) => (l(),
|
|
114
|
+
return m({
|
|
115
|
+
scrollTo: _
|
|
116
|
+
}), (a, d) => (l(), o("div", {
|
|
118
117
|
class: "table-container",
|
|
119
118
|
"data-testid": `${s.testId}-${t(S).CONTAINER}`,
|
|
120
|
-
onMouseleave: d[3] || (d[3] = (e) =>
|
|
119
|
+
onMouseleave: d[3] || (d[3] = (e) => A.value = null)
|
|
121
120
|
}, [
|
|
122
121
|
u("table", {
|
|
123
122
|
ref: t(G).ref,
|
|
124
|
-
style:
|
|
123
|
+
style: x(t(j)),
|
|
125
124
|
class: f({
|
|
126
125
|
hasFooter: t(D)
|
|
127
126
|
}),
|
|
@@ -129,7 +128,7 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
129
128
|
onScrollPassive: d[2] || (d[2] = //@ts-ignore
|
|
130
129
|
(...e) => t(N) && t(N)(...e))
|
|
131
130
|
}, [
|
|
132
|
-
s.title || t(b).title || t(W) || t(b)["table-header-actions"] ? (l(),
|
|
131
|
+
s.title || t(b).title || t(W) || t(b)["table-header-actions"] ? (l(), o("div", {
|
|
133
132
|
key: 0,
|
|
134
133
|
class: f(["table-header", { isStickyHeader: s.isStickyHeader }]),
|
|
135
134
|
"data-testid": `${s.testId}-${t(S).HEADER}`
|
|
@@ -138,40 +137,40 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
138
137
|
class: "table-title",
|
|
139
138
|
"data-testid": `${s.testId}-${t(S).TITLE}`
|
|
140
139
|
}, [
|
|
141
|
-
|
|
142
|
-
h(t(
|
|
143
|
-
default:
|
|
144
|
-
w(
|
|
140
|
+
r(a.$slots, "title", {}, () => [
|
|
141
|
+
h(t(p), { variant: "h3" }, {
|
|
142
|
+
default: T(() => [
|
|
143
|
+
w(E(s.title), 1)
|
|
145
144
|
]),
|
|
146
145
|
_: 1
|
|
147
146
|
})
|
|
148
|
-
])
|
|
147
|
+
], !0)
|
|
149
148
|
], 8, $e),
|
|
150
149
|
u("div", {
|
|
151
150
|
class: "table-header-right",
|
|
152
151
|
"data-testid": `${s.testId}-${t(S).HEADER_RIGHT}`
|
|
153
152
|
}, [
|
|
154
|
-
s.showSearch ?
|
|
155
|
-
u("div",
|
|
153
|
+
s.showSearch ? r(a.$slots, "search", { key: 0 }, () => [
|
|
154
|
+
u("div", Ce, [
|
|
156
155
|
h(t(ke), {
|
|
157
|
-
modelValue: t(
|
|
158
|
-
"onUpdate:modelValue": d[0] || (d[0] = (e) => ne(
|
|
156
|
+
modelValue: t(g),
|
|
157
|
+
"onUpdate:modelValue": d[0] || (d[0] = (e) => ne(g) ? g.value = e : null),
|
|
159
158
|
placeholder: s.searchPlaceholder,
|
|
160
159
|
"auto-focus": s.searchAutoFocus,
|
|
161
160
|
"test-id": s.testId,
|
|
162
161
|
onOnClear: d[1] || (d[1] = (e) => y("onClearSearch"))
|
|
163
162
|
}, null, 8, ["modelValue", "placeholder", "auto-focus", "test-id"])
|
|
164
163
|
])
|
|
165
|
-
]) :
|
|
164
|
+
], !0) : c("", !0)
|
|
166
165
|
], 8, Re),
|
|
167
|
-
t(b)["table-header-actions"] ? (l(),
|
|
166
|
+
t(b)["table-header-actions"] ? (l(), o("div", {
|
|
168
167
|
key: 0,
|
|
169
168
|
class: "table-header-actions",
|
|
170
169
|
"data-testid": `${s.testId}-${t(S).ACTIONS}`
|
|
171
170
|
}, [
|
|
172
|
-
|
|
173
|
-
], 8,
|
|
174
|
-
], 10, be)) :
|
|
171
|
+
r(a.$slots, "table-header-actions", {}, void 0, !0)
|
|
172
|
+
], 8, xe)) : c("", !0)
|
|
173
|
+
], 10, be)) : c("", !0),
|
|
175
174
|
u("thead", {
|
|
176
175
|
class: f({ sticky: s.isSticky, isStickyHeader: s.isStickyHeader })
|
|
177
176
|
}, [
|
|
@@ -179,38 +178,38 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
179
178
|
class: "sections",
|
|
180
179
|
"data-testid": `${s.testId}-${t(S).SECTIONS}`
|
|
181
180
|
}, [
|
|
182
|
-
(l(!0),
|
|
181
|
+
(l(!0), o(B, null, I(s.sections, (e) => (l(), o("div", {
|
|
183
182
|
key: e.id,
|
|
184
183
|
class: f(["section-container", { sticky: e.isSticky }])
|
|
185
184
|
}, [
|
|
186
|
-
|
|
185
|
+
r(a.$slots, `section-${e.id}`, {}, () => [
|
|
187
186
|
u("div", {
|
|
188
|
-
style:
|
|
187
|
+
style: x({ width: e.width + "px" }),
|
|
189
188
|
class: f({ section: !0 })
|
|
190
189
|
}, [
|
|
191
|
-
h(t(
|
|
192
|
-
default:
|
|
193
|
-
w(
|
|
190
|
+
h(t(p), { variant: "body2" }, {
|
|
191
|
+
default: T(() => [
|
|
192
|
+
w(E(e.title), 1)
|
|
194
193
|
]),
|
|
195
194
|
_: 2
|
|
196
195
|
}, 1024)
|
|
197
196
|
], 4)
|
|
198
|
-
])
|
|
197
|
+
], !0)
|
|
199
198
|
], 2))), 128))
|
|
200
199
|
], 8, Te),
|
|
201
200
|
u("tr", null, [
|
|
202
|
-
t(O) ? (l(),
|
|
203
|
-
|
|
204
|
-
h(t(
|
|
201
|
+
t(O) ? (l(), o("th", we, [
|
|
202
|
+
r(a.$slots, "select-all-checkbox", {}, () => [
|
|
203
|
+
h(t(K), {
|
|
205
204
|
disabled: s.isLoading,
|
|
206
205
|
"is-checked": t(M),
|
|
207
|
-
"is-indeterminate": !t(M) && t(
|
|
208
|
-
"onUpdate:isChecked":
|
|
206
|
+
"is-indeterminate": !t(M) && t(ee) > 0,
|
|
207
|
+
"onUpdate:isChecked": se
|
|
209
208
|
}, null, 8, ["disabled", "is-checked", "is-indeterminate"])
|
|
210
|
-
])
|
|
211
|
-
])) :
|
|
212
|
-
t(
|
|
213
|
-
(l(!0),
|
|
209
|
+
], !0)
|
|
210
|
+
])) : c("", !0),
|
|
211
|
+
t($) ? (l(), o("th", Ee)) : c("", !0),
|
|
212
|
+
(l(!0), o(B, null, I(s.columns, (e) => (l(), o("th", {
|
|
214
213
|
key: e.id,
|
|
215
214
|
class: f({
|
|
216
215
|
sticky: e.isSticky,
|
|
@@ -220,61 +219,62 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
220
219
|
isSortable: e.isSortable,
|
|
221
220
|
[`column-${e.id}`]: !0
|
|
222
221
|
}),
|
|
223
|
-
style:
|
|
222
|
+
style: x(e.isSticky ? t(L)[e.id] : null),
|
|
224
223
|
onClick: (k) => e.isSortable ? t(Q)(e) : null
|
|
225
224
|
}, [
|
|
226
|
-
u("div",
|
|
227
|
-
|
|
228
|
-
h(t(
|
|
229
|
-
default:
|
|
230
|
-
w(
|
|
225
|
+
u("div", Ie, [
|
|
226
|
+
r(a.$slots, `header-${e.id}`, { column: e }, () => [
|
|
227
|
+
h(t(p), { variant: "tableLabel" }, {
|
|
228
|
+
default: T(() => [
|
|
229
|
+
w(E(e.title), 1)
|
|
231
230
|
]),
|
|
232
231
|
_: 2
|
|
233
232
|
}, 1024)
|
|
234
|
-
]),
|
|
233
|
+
], !0),
|
|
235
234
|
e.helpText ? (l(), z(fe, {
|
|
236
235
|
key: 0,
|
|
237
236
|
"hover-help-text": e.helpText,
|
|
238
237
|
"hover-help-text-placement": e.helpTextPlacement
|
|
239
|
-
}, null, 8, ["hover-help-text", "hover-help-text-placement"])) :
|
|
238
|
+
}, null, 8, ["hover-help-text", "hover-help-text-placement"])) : c("", !0),
|
|
240
239
|
e.isSortable && e.id === s.sort?.sortBy ? (l(), z(ye, {
|
|
241
240
|
key: 1,
|
|
242
241
|
"sort-order": s.sort.sortOrder
|
|
243
|
-
}, null, 8, ["sort-order"])) :
|
|
242
|
+
}, null, 8, ["sort-order"])) : c("", !0)
|
|
244
243
|
])
|
|
245
|
-
], 14,
|
|
244
|
+
], 14, Be))), 128))
|
|
246
245
|
])
|
|
247
246
|
], 2),
|
|
248
247
|
u("tbody", null, [
|
|
249
|
-
t(P).length > 0 ? (l(),
|
|
248
|
+
t(P).length > 0 ? (l(), o("div", re({
|
|
250
249
|
key: 0,
|
|
251
250
|
class: "table-body-wrapper",
|
|
252
251
|
"data-testid": `${s.testId}-${t(S).BODY_WRAPPER}`
|
|
253
252
|
}, t(Y)), [
|
|
254
|
-
(l(!0),
|
|
253
|
+
(l(!0), o(B, null, I(t(P), (e) => (l(), o("tr", {
|
|
255
254
|
key: e.index,
|
|
256
255
|
class: f(["table-row", {
|
|
257
256
|
loading: s.isLoading || s.isLoading && !e.data || t(F).includes(e.index),
|
|
258
|
-
active: t(
|
|
259
|
-
activeMenu: t(
|
|
260
|
-
expanded: t(
|
|
257
|
+
active: t(A) === e.index,
|
|
258
|
+
activeMenu: t(Z) === e.index,
|
|
259
|
+
expanded: t($) && t(V)(e.index),
|
|
260
|
+
[U(e.index)]: !0
|
|
261
261
|
}]),
|
|
262
|
-
onMouseenter: (k) =>
|
|
262
|
+
onMouseenter: (k) => A.value = e.index,
|
|
263
263
|
onClick: (k) => y("clickRow", e.index)
|
|
264
264
|
}, [
|
|
265
|
-
t(O) ? (l(),
|
|
266
|
-
h(t(
|
|
267
|
-
"is-checked":
|
|
268
|
-
"onUpdate:isChecked": (k) =>
|
|
265
|
+
t(O) ? (l(), o("td", Ve, [
|
|
266
|
+
h(t(K), {
|
|
267
|
+
"is-checked": R(s.getRowId(e.data, e.index)),
|
|
268
|
+
"onUpdate:isChecked": (k) => te(s.getRowId(e.data, e.index))
|
|
269
269
|
}, null, 8, ["is-checked", "onUpdate:isChecked"])
|
|
270
|
-
])) :
|
|
271
|
-
t(
|
|
270
|
+
])) : c("", !0),
|
|
271
|
+
t($) ? (l(), o("td", Me, [
|
|
272
272
|
h(Se, {
|
|
273
|
-
expanded: t(
|
|
273
|
+
expanded: t(V)(e.index),
|
|
274
274
|
onClick: (k) => t(q)(e.index, k)
|
|
275
275
|
}, null, 8, ["expanded", "onClick"])
|
|
276
|
-
])) :
|
|
277
|
-
(l(!0),
|
|
276
|
+
])) : c("", !0),
|
|
277
|
+
(l(!0), o(B, null, I(s.columns, (k, n) => (l(), o("td", {
|
|
278
278
|
key: n,
|
|
279
279
|
class: f({
|
|
280
280
|
sticky: s.columns[n].isSticky,
|
|
@@ -283,47 +283,41 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
283
283
|
isTextRight: s.columns[n].isTextRight,
|
|
284
284
|
[`column-${s.columns[n].id}`]: !0
|
|
285
285
|
}),
|
|
286
|
-
style:
|
|
287
|
-
s.columns[n].isSticky ? t(
|
|
286
|
+
style: x(
|
|
287
|
+
s.columns[n].isSticky ? t(L)[s.columns[n].id] : null
|
|
288
288
|
)
|
|
289
289
|
}, [
|
|
290
|
-
!s.isLoading || s.isLoading && e.data[n] ? (l(),
|
|
290
|
+
!s.isLoading || s.isLoading && e.data[n] ? (l(), o("div", {
|
|
291
291
|
key: 0,
|
|
292
292
|
class: f(["table-cell", { last: n === e.data.length - 1 }])
|
|
293
293
|
}, [
|
|
294
|
-
|
|
294
|
+
r(a.$slots, `cell-${s.columns[n].id}`, {
|
|
295
295
|
cell: e.data[n],
|
|
296
296
|
isLoading: t(F).includes(e.index),
|
|
297
297
|
cellIndex: n,
|
|
298
298
|
row: e,
|
|
299
299
|
rowIndex: e.index
|
|
300
300
|
}, () => [
|
|
301
|
-
h(t(
|
|
302
|
-
default:
|
|
303
|
-
w(
|
|
301
|
+
h(t(p), { variant: "body1" }, {
|
|
302
|
+
default: T(() => [
|
|
303
|
+
w(E(e.data[n]), 1)
|
|
304
304
|
]),
|
|
305
305
|
_: 2
|
|
306
306
|
}, 1024)
|
|
307
|
-
])
|
|
308
|
-
], 2)) :
|
|
309
|
-
h(t(
|
|
310
|
-
])
|
|
307
|
+
], !0)
|
|
308
|
+
], 2)) : r(a.$slots, "loader", { key: 1 }, () => [
|
|
309
|
+
h(t(ce), { round: "" })
|
|
310
|
+
], !0)
|
|
311
311
|
], 6))), 128)),
|
|
312
|
-
t(
|
|
313
|
-
|
|
314
|
-
row: e,
|
|
315
|
-
gridColumnTemplate: t(V)
|
|
316
|
-
})
|
|
317
|
-
])) : r("", !0),
|
|
318
|
-
se(e.index) ? (l(), i("div", Ve, [
|
|
319
|
-
c(a.$slots, "floating-row", {
|
|
312
|
+
t($) && t(V)(e.index) ? (l(), o("div", Pe, [
|
|
313
|
+
r(a.$slots, "expanded", {
|
|
320
314
|
row: e,
|
|
321
|
-
|
|
322
|
-
})
|
|
323
|
-
])) :
|
|
315
|
+
gridColumnTemplate: t(H)
|
|
316
|
+
}, void 0, !0)
|
|
317
|
+
])) : c("", !0)
|
|
324
318
|
], 42, Ae))), 128))
|
|
325
|
-
], 16, pe)) : (l(),
|
|
326
|
-
|
|
319
|
+
], 16, pe)) : (l(), o("div", He, [
|
|
320
|
+
r(a.$slots, "empty-state", {}, () => [
|
|
327
321
|
h(t(ue), {
|
|
328
322
|
class: "empty-state",
|
|
329
323
|
title: s.emptyStateTitle,
|
|
@@ -331,16 +325,16 @@ const me = ["data-testid"], ve = ["data-testid"], be = ["data-testid"], $e = ["d
|
|
|
331
325
|
variant: t(ae),
|
|
332
326
|
"test-id": `${s.testId}-${t(S).EMPTY_STATE}`
|
|
333
327
|
}, null, 8, ["title", "subtitle", "variant", "test-id"])
|
|
334
|
-
])
|
|
328
|
+
], !0)
|
|
335
329
|
]))
|
|
336
330
|
])
|
|
337
331
|
], 46, ve),
|
|
338
|
-
t(D) ? (l(),
|
|
339
|
-
|
|
340
|
-
])) :
|
|
341
|
-
], 40,
|
|
332
|
+
t(D) ? (l(), o("div", Le, [
|
|
333
|
+
r(a.$slots, "footer", {}, void 0, !0)
|
|
334
|
+
])) : c("", !0)
|
|
335
|
+
], 40, ge));
|
|
342
336
|
}
|
|
343
337
|
});
|
|
344
338
|
export {
|
|
345
|
-
|
|
339
|
+
qe as default
|
|
346
340
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DataGridRowsCounter.vue2.js";
|
|
2
2
|
/* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../DataGridRowsCounter.
|
|
4
|
-
const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../../DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css"; //*');
|
|
4
|
+
const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ef699ec5"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import "../../../DataGridRowsCounter.
|
|
1
|
+
import "../../../DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css"; import { defineComponent as l, openBlock as u, createElementBlock as f, unref as e, createVNode as d, withCtx as i, createTextVNode as a, toDisplayString as o } from "vue";
|
|
2
2
|
import s from "../../typography/v4/Typography.vue.js";
|
|
3
3
|
import { RowsCounterTestIdModifiers as n } from "../../../testids/index.js";
|
|
4
|
-
|
|
4
|
+
import { nFormatter as r } from "../../../utils/formatNumbers.js";
|
|
5
|
+
const c = ["data-testid"], I = /* @__PURE__ */ l({
|
|
5
6
|
__name: "DataGridRowsCounter",
|
|
6
7
|
props: {
|
|
7
8
|
count: { default: 0 },
|
|
@@ -12,41 +13,41 @@ const f = ["data-testid"], C = /* @__PURE__ */ l({
|
|
|
12
13
|
testId: { default: "" }
|
|
13
14
|
},
|
|
14
15
|
setup(t) {
|
|
15
|
-
return (
|
|
16
|
+
return (m, T) => (u(), f("div", {
|
|
16
17
|
class: "data-grid-rows-counter",
|
|
17
18
|
"data-testid": `${t.testId}-${e(n).CONTAINER}`
|
|
18
19
|
}, [
|
|
19
|
-
|
|
20
|
+
d(e(s), { variant: "body1" }, {
|
|
20
21
|
default: i(() => [
|
|
21
|
-
a(
|
|
22
|
-
|
|
22
|
+
a(o(t.displayingText) + " ", 1),
|
|
23
|
+
d(e(s), {
|
|
23
24
|
class: "text-strong",
|
|
24
25
|
variant: "subtitle1",
|
|
25
26
|
"data-testid": `${t.testId}-${e(n).COUNT}`
|
|
26
27
|
}, {
|
|
27
28
|
default: i(() => [
|
|
28
|
-
a(
|
|
29
|
+
a(o(e(r)(t.count)), 1)
|
|
29
30
|
]),
|
|
30
31
|
_: 1
|
|
31
32
|
}, 8, ["data-testid"]),
|
|
32
|
-
a(" " +
|
|
33
|
-
|
|
33
|
+
a(" " + o(t.outOfText) + " ", 1),
|
|
34
|
+
d(e(s), {
|
|
34
35
|
class: "text-strong",
|
|
35
36
|
variant: "subtitle1",
|
|
36
37
|
"data-testid": `${t.testId}-${e(n).TOTAL}`
|
|
37
38
|
}, {
|
|
38
39
|
default: i(() => [
|
|
39
|
-
a(
|
|
40
|
+
a(o(e(r)(t.totalCount)), 1)
|
|
40
41
|
]),
|
|
41
42
|
_: 1
|
|
42
43
|
}, 8, ["data-testid"]),
|
|
43
|
-
a(" " +
|
|
44
|
+
a(" " + o(t.totalText), 1)
|
|
44
45
|
]),
|
|
45
46
|
_: 1
|
|
46
47
|
})
|
|
47
|
-
], 8,
|
|
48
|
+
], 8, c));
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
I as default
|
|
52
53
|
};
|
|
@@ -120,8 +120,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
120
120
|
search?(_: {}): any;
|
|
121
121
|
"table-header-actions"?(_: {}): any;
|
|
122
122
|
"floating-row"?(_: {
|
|
123
|
-
row:
|
|
124
|
-
rowIndex:
|
|
123
|
+
row: any;
|
|
124
|
+
rowIndex: any;
|
|
125
125
|
}): any;
|
|
126
126
|
"empty-state"?(_: {}): any;
|
|
127
127
|
}>;
|
|
@@ -30,6 +30,8 @@ declare const DataGridTypes: () => (({
|
|
|
30
30
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
31
31
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
32
32
|
zIndexBase: number;
|
|
33
|
+
rowCustomClassKey: string;
|
|
34
|
+
rowDataKey: string;
|
|
33
35
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
34
36
|
sort: {
|
|
35
37
|
type: import("vue").PropType<import("../common/Table.types").Sort>;
|
|
@@ -131,6 +133,14 @@ declare const DataGridTypes: () => (({
|
|
|
131
133
|
type: import("vue").PropType<number>;
|
|
132
134
|
default: number;
|
|
133
135
|
};
|
|
136
|
+
rowCustomClassKey: {
|
|
137
|
+
type: import("vue").PropType<string>;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
140
|
+
rowDataKey: {
|
|
141
|
+
type: import("vue").PropType<string>;
|
|
142
|
+
default: string;
|
|
143
|
+
};
|
|
134
144
|
}>> & {
|
|
135
145
|
onSelectAll?: (value: boolean) => any;
|
|
136
146
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -147,7 +157,7 @@ declare const DataGridTypes: () => (({
|
|
|
147
157
|
"onUpdate:selection"?: (selection: unknown[]) => any;
|
|
148
158
|
onSelectRow?: (value: boolean) => any;
|
|
149
159
|
onClickRow?: (rowIndex: number) => any;
|
|
150
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase">;
|
|
160
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase" | "rowCustomClassKey" | "rowDataKey">;
|
|
151
161
|
$attrs: {
|
|
152
162
|
[x: string]: unknown;
|
|
153
163
|
};
|
|
@@ -267,6 +277,14 @@ declare const DataGridTypes: () => (({
|
|
|
267
277
|
type: import("vue").PropType<number>;
|
|
268
278
|
default: number;
|
|
269
279
|
};
|
|
280
|
+
rowCustomClassKey: {
|
|
281
|
+
type: import("vue").PropType<string>;
|
|
282
|
+
default: string;
|
|
283
|
+
};
|
|
284
|
+
rowDataKey: {
|
|
285
|
+
type: import("vue").PropType<string>;
|
|
286
|
+
default: string;
|
|
287
|
+
};
|
|
270
288
|
}>> & {
|
|
271
289
|
onSelectAll?: (value: boolean) => any;
|
|
272
290
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -325,6 +343,8 @@ declare const DataGridTypes: () => (({
|
|
|
325
343
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
326
344
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
327
345
|
zIndexBase: number;
|
|
346
|
+
rowCustomClassKey: string;
|
|
347
|
+
rowDataKey: string;
|
|
328
348
|
}, {}, string> & {
|
|
329
349
|
beforeCreate?: (() => void) | (() => void)[];
|
|
330
350
|
created?: (() => void) | (() => void)[];
|
|
@@ -446,6 +466,14 @@ declare const DataGridTypes: () => (({
|
|
|
446
466
|
type: import("vue").PropType<number>;
|
|
447
467
|
default: number;
|
|
448
468
|
};
|
|
469
|
+
rowCustomClassKey: {
|
|
470
|
+
type: import("vue").PropType<string>;
|
|
471
|
+
default: string;
|
|
472
|
+
};
|
|
473
|
+
rowDataKey: {
|
|
474
|
+
type: import("vue").PropType<string>;
|
|
475
|
+
default: string;
|
|
476
|
+
};
|
|
449
477
|
}>> & {
|
|
450
478
|
onSelectAll?: (value: boolean) => any;
|
|
451
479
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -569,6 +597,14 @@ declare const DataGridTypes: () => (({
|
|
|
569
597
|
type: import("vue").PropType<number>;
|
|
570
598
|
default: number;
|
|
571
599
|
};
|
|
600
|
+
rowCustomClassKey: {
|
|
601
|
+
type: import("vue").PropType<string>;
|
|
602
|
+
default: string;
|
|
603
|
+
};
|
|
604
|
+
rowDataKey: {
|
|
605
|
+
type: import("vue").PropType<string>;
|
|
606
|
+
default: string;
|
|
607
|
+
};
|
|
572
608
|
}>> & {
|
|
573
609
|
onSelectAll?: (value: boolean) => any;
|
|
574
610
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -627,6 +663,8 @@ declare const DataGridTypes: () => (({
|
|
|
627
663
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
628
664
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
629
665
|
zIndexBase: number;
|
|
666
|
+
rowCustomClassKey: string;
|
|
667
|
+
rowDataKey: string;
|
|
630
668
|
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
631
669
|
$slots: Partial<Record<`section-${string}`, (_: {}) => any>> & Partial<Record<`header-${string}`, (_: {
|
|
632
670
|
column: import("../common/Table.types").Column;
|
|
@@ -646,10 +684,6 @@ declare const DataGridTypes: () => (({
|
|
|
646
684
|
row: import("@vueuse/core").UseVirtualListItem<import("../common/Table.types").Row>;
|
|
647
685
|
gridColumnTemplate: any;
|
|
648
686
|
}): any;
|
|
649
|
-
"floating-row"?(_: {
|
|
650
|
-
row: import("@vueuse/core").UseVirtualListItem<import("../common/Table.types").Row>;
|
|
651
|
-
rowIndex: number;
|
|
652
|
-
}): any;
|
|
653
687
|
"empty-state"?(_: {}): any;
|
|
654
688
|
footer?(_: {}): any;
|
|
655
689
|
};
|
|
@@ -1191,8 +1225,8 @@ declare const DataGridTypes: () => (({
|
|
|
1191
1225
|
search?(_: {}): any;
|
|
1192
1226
|
"table-header-actions"?(_: {}): any;
|
|
1193
1227
|
"floating-row"?(_: {
|
|
1194
|
-
row:
|
|
1195
|
-
rowIndex:
|
|
1228
|
+
row: any;
|
|
1229
|
+
rowIndex: any;
|
|
1196
1230
|
}): any;
|
|
1197
1231
|
"empty-state"?(_: {}): any;
|
|
1198
1232
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export declare const getRandomRows: (count: number, template?: string[]) => any[][];
|
|
2
|
+
export declare const getRandomObjectRows: (count: number, template?: string[]) => {
|
|
3
|
+
rowData: any[];
|
|
4
|
+
customClass: string;
|
|
5
|
+
}[];
|
|
2
6
|
export declare const searchRows: (array: string[][], query: string) => string[][];
|
|
3
7
|
export declare const exampleRows: string[][];
|
|
4
8
|
export declare const moreExampleRows: string[][];
|
|
5
9
|
export declare const exampleRowsWithExtraColumns: string[][];
|
|
10
|
+
export declare const exampleObjectRows: {
|
|
11
|
+
rowData: string[];
|
|
12
|
+
customClass: string;
|
|
13
|
+
}[];
|
package/index.d.ts
CHANGED
|
@@ -5206,6 +5206,8 @@ declare const _default: {
|
|
|
5206
5206
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
5207
5207
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
5208
5208
|
zIndexBase: number;
|
|
5209
|
+
rowCustomClassKey: string;
|
|
5210
|
+
rowDataKey: string;
|
|
5209
5211
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
5210
5212
|
sort: {
|
|
5211
5213
|
type: import("vue").PropType<tableV3.Sort>;
|
|
@@ -5307,6 +5309,14 @@ declare const _default: {
|
|
|
5307
5309
|
type: import("vue").PropType<number>;
|
|
5308
5310
|
default: number;
|
|
5309
5311
|
};
|
|
5312
|
+
rowCustomClassKey: {
|
|
5313
|
+
type: import("vue").PropType<string>;
|
|
5314
|
+
default: string;
|
|
5315
|
+
};
|
|
5316
|
+
rowDataKey: {
|
|
5317
|
+
type: import("vue").PropType<string>;
|
|
5318
|
+
default: string;
|
|
5319
|
+
};
|
|
5310
5320
|
}>> & {
|
|
5311
5321
|
onSelectAll?: (value: boolean) => any;
|
|
5312
5322
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -5323,7 +5333,7 @@ declare const _default: {
|
|
|
5323
5333
|
"onUpdate:selection"?: (selection: unknown[]) => any;
|
|
5324
5334
|
onSelectRow?: (value: boolean) => any;
|
|
5325
5335
|
onClickRow?: (rowIndex: number) => any;
|
|
5326
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase">;
|
|
5336
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase" | "rowCustomClassKey" | "rowDataKey">;
|
|
5327
5337
|
$attrs: {
|
|
5328
5338
|
[x: string]: unknown;
|
|
5329
5339
|
};
|
|
@@ -5443,6 +5453,14 @@ declare const _default: {
|
|
|
5443
5453
|
type: import("vue").PropType<number>;
|
|
5444
5454
|
default: number;
|
|
5445
5455
|
};
|
|
5456
|
+
rowCustomClassKey: {
|
|
5457
|
+
type: import("vue").PropType<string>;
|
|
5458
|
+
default: string;
|
|
5459
|
+
};
|
|
5460
|
+
rowDataKey: {
|
|
5461
|
+
type: import("vue").PropType<string>;
|
|
5462
|
+
default: string;
|
|
5463
|
+
};
|
|
5446
5464
|
}>> & {
|
|
5447
5465
|
onSelectAll?: (value: boolean) => any;
|
|
5448
5466
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -5501,6 +5519,8 @@ declare const _default: {
|
|
|
5501
5519
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
5502
5520
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
5503
5521
|
zIndexBase: number;
|
|
5522
|
+
rowCustomClassKey: string;
|
|
5523
|
+
rowDataKey: string;
|
|
5504
5524
|
}, {}, string> & {
|
|
5505
5525
|
beforeCreate?: (() => void) | (() => void)[];
|
|
5506
5526
|
created?: (() => void) | (() => void)[];
|
|
@@ -5622,6 +5642,14 @@ declare const _default: {
|
|
|
5622
5642
|
type: import("vue").PropType<number>;
|
|
5623
5643
|
default: number;
|
|
5624
5644
|
};
|
|
5645
|
+
rowCustomClassKey: {
|
|
5646
|
+
type: import("vue").PropType<string>;
|
|
5647
|
+
default: string;
|
|
5648
|
+
};
|
|
5649
|
+
rowDataKey: {
|
|
5650
|
+
type: import("vue").PropType<string>;
|
|
5651
|
+
default: string;
|
|
5652
|
+
};
|
|
5625
5653
|
}>> & {
|
|
5626
5654
|
onSelectAll?: (value: boolean) => any;
|
|
5627
5655
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -5745,6 +5773,14 @@ declare const _default: {
|
|
|
5745
5773
|
type: import("vue").PropType<number>;
|
|
5746
5774
|
default: number;
|
|
5747
5775
|
};
|
|
5776
|
+
rowCustomClassKey: {
|
|
5777
|
+
type: import("vue").PropType<string>;
|
|
5778
|
+
default: string;
|
|
5779
|
+
};
|
|
5780
|
+
rowDataKey: {
|
|
5781
|
+
type: import("vue").PropType<string>;
|
|
5782
|
+
default: string;
|
|
5783
|
+
};
|
|
5748
5784
|
}>> & {
|
|
5749
5785
|
onSelectAll?: (value: boolean) => any;
|
|
5750
5786
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -5803,6 +5839,8 @@ declare const _default: {
|
|
|
5803
5839
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
5804
5840
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
5805
5841
|
zIndexBase: number;
|
|
5842
|
+
rowCustomClassKey: string;
|
|
5843
|
+
rowDataKey: string;
|
|
5806
5844
|
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
5807
5845
|
$slots: Partial<Record<`section-${string}`, (_: {}) => any>> & Partial<Record<`header-${string}`, (_: {
|
|
5808
5846
|
column: tableV3.Column;
|
|
@@ -5822,10 +5860,6 @@ declare const _default: {
|
|
|
5822
5860
|
row: import("@vueuse/core").UseVirtualListItem<import("./components/table/common/Table.types").Row>;
|
|
5823
5861
|
gridColumnTemplate: any;
|
|
5824
5862
|
}): any;
|
|
5825
|
-
"floating-row"?(_: {
|
|
5826
|
-
row: import("@vueuse/core").UseVirtualListItem<import("./components/table/common/Table.types").Row>;
|
|
5827
|
-
rowIndex: number;
|
|
5828
|
-
}): any;
|
|
5829
5863
|
"empty-state"?(_: {}): any;
|
|
5830
5864
|
footer?(_: {}): any;
|
|
5831
5865
|
};
|
|
@@ -5953,6 +5987,8 @@ declare const _default: {
|
|
|
5953
5987
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
5954
5988
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
5955
5989
|
zIndexBase: number;
|
|
5990
|
+
rowCustomClassKey: string;
|
|
5991
|
+
rowDataKey: string;
|
|
5956
5992
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
5957
5993
|
sort: {
|
|
5958
5994
|
type: import("vue").PropType<tableV3.Sort>;
|
|
@@ -6054,6 +6090,14 @@ declare const _default: {
|
|
|
6054
6090
|
type: import("vue").PropType<number>;
|
|
6055
6091
|
default: number;
|
|
6056
6092
|
};
|
|
6093
|
+
rowCustomClassKey: {
|
|
6094
|
+
type: import("vue").PropType<string>;
|
|
6095
|
+
default: string;
|
|
6096
|
+
};
|
|
6097
|
+
rowDataKey: {
|
|
6098
|
+
type: import("vue").PropType<string>;
|
|
6099
|
+
default: string;
|
|
6100
|
+
};
|
|
6057
6101
|
}>> & {
|
|
6058
6102
|
onSelectAll?: (value: boolean) => any;
|
|
6059
6103
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -6070,7 +6114,7 @@ declare const _default: {
|
|
|
6070
6114
|
"onUpdate:selection"?: (selection: unknown[]) => any;
|
|
6071
6115
|
onSelectRow?: (value: boolean) => any;
|
|
6072
6116
|
onClickRow?: (rowIndex: number) => any;
|
|
6073
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase">;
|
|
6117
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "sort" | "title" | "search" | "testId" | "isLoading" | "searchAutoFocus" | "searchPlaceholder" | "selection" | "showSearch" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition" | "getRowId" | "selectedMatcher" | "emptyStateVariant" | "zIndexBase" | "rowCustomClassKey" | "rowDataKey">;
|
|
6074
6118
|
$attrs: {
|
|
6075
6119
|
[x: string]: unknown;
|
|
6076
6120
|
};
|
|
@@ -6190,6 +6234,14 @@ declare const _default: {
|
|
|
6190
6234
|
type: import("vue").PropType<number>;
|
|
6191
6235
|
default: number;
|
|
6192
6236
|
};
|
|
6237
|
+
rowCustomClassKey: {
|
|
6238
|
+
type: import("vue").PropType<string>;
|
|
6239
|
+
default: string;
|
|
6240
|
+
};
|
|
6241
|
+
rowDataKey: {
|
|
6242
|
+
type: import("vue").PropType<string>;
|
|
6243
|
+
default: string;
|
|
6244
|
+
};
|
|
6193
6245
|
}>> & {
|
|
6194
6246
|
onSelectAll?: (value: boolean) => any;
|
|
6195
6247
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -6248,6 +6300,8 @@ declare const _default: {
|
|
|
6248
6300
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
6249
6301
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
6250
6302
|
zIndexBase: number;
|
|
6303
|
+
rowCustomClassKey: string;
|
|
6304
|
+
rowDataKey: string;
|
|
6251
6305
|
}, {}, string> & {
|
|
6252
6306
|
beforeCreate?: (() => void) | (() => void)[];
|
|
6253
6307
|
created?: (() => void) | (() => void)[];
|
|
@@ -6369,6 +6423,14 @@ declare const _default: {
|
|
|
6369
6423
|
type: import("vue").PropType<number>;
|
|
6370
6424
|
default: number;
|
|
6371
6425
|
};
|
|
6426
|
+
rowCustomClassKey: {
|
|
6427
|
+
type: import("vue").PropType<string>;
|
|
6428
|
+
default: string;
|
|
6429
|
+
};
|
|
6430
|
+
rowDataKey: {
|
|
6431
|
+
type: import("vue").PropType<string>;
|
|
6432
|
+
default: string;
|
|
6433
|
+
};
|
|
6372
6434
|
}>> & {
|
|
6373
6435
|
onSelectAll?: (value: boolean) => any;
|
|
6374
6436
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -6492,6 +6554,14 @@ declare const _default: {
|
|
|
6492
6554
|
type: import("vue").PropType<number>;
|
|
6493
6555
|
default: number;
|
|
6494
6556
|
};
|
|
6557
|
+
rowCustomClassKey: {
|
|
6558
|
+
type: import("vue").PropType<string>;
|
|
6559
|
+
default: string;
|
|
6560
|
+
};
|
|
6561
|
+
rowDataKey: {
|
|
6562
|
+
type: import("vue").PropType<string>;
|
|
6563
|
+
default: string;
|
|
6564
|
+
};
|
|
6495
6565
|
}>> & {
|
|
6496
6566
|
onSelectAll?: (value: boolean) => any;
|
|
6497
6567
|
"onUpdate:search"?: (query: string) => any;
|
|
@@ -6550,6 +6620,8 @@ declare const _default: {
|
|
|
6550
6620
|
selectedMatcher: (rowId: unknown, selected: unknown) => boolean;
|
|
6551
6621
|
emptyStateVariant: "error" | "no-access" | "no-results" | "no-data" | "files" | "settings";
|
|
6552
6622
|
zIndexBase: number;
|
|
6623
|
+
rowCustomClassKey: string;
|
|
6624
|
+
rowDataKey: string;
|
|
6553
6625
|
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
6554
6626
|
$slots: Partial<Record<`section-${string}`, (_: {}) => any>> & Partial<Record<`header-${string}`, (_: {
|
|
6555
6627
|
column: tableV3.Column;
|
|
@@ -6569,10 +6641,6 @@ declare const _default: {
|
|
|
6569
6641
|
row: import("@vueuse/core").UseVirtualListItem<import("./components/table/common/Table.types").Row>;
|
|
6570
6642
|
gridColumnTemplate: any;
|
|
6571
6643
|
}): any;
|
|
6572
|
-
"floating-row"?(_: {
|
|
6573
|
-
row: import("@vueuse/core").UseVirtualListItem<import("./components/table/common/Table.types").Row>;
|
|
6574
|
-
rowIndex: number;
|
|
6575
|
-
}): any;
|
|
6576
6644
|
"empty-state"?(_: {}): any;
|
|
6577
6645
|
footer?(_: {}): any;
|
|
6578
6646
|
};
|
|
@@ -7114,8 +7182,8 @@ declare const _default: {
|
|
|
7114
7182
|
search?(_: {}): any;
|
|
7115
7183
|
"table-header-actions"?(_: {}): any;
|
|
7116
7184
|
"floating-row"?(_: {
|
|
7117
|
-
row:
|
|
7118
|
-
rowIndex:
|
|
7185
|
+
row: any;
|
|
7186
|
+
rowIndex: any;
|
|
7119
7187
|
}): any;
|
|
7120
7188
|
"empty-state"?(_: {}): any;
|
|
7121
7189
|
};
|
|
@@ -7565,8 +7633,8 @@ declare const _default: {
|
|
|
7565
7633
|
search?(_: {}): any;
|
|
7566
7634
|
"table-header-actions"?(_: {}): any;
|
|
7567
7635
|
"floating-row"?(_: {
|
|
7568
|
-
row:
|
|
7569
|
-
rowIndex:
|
|
7636
|
+
row: any;
|
|
7637
|
+
rowIndex: any;
|
|
7570
7638
|
}): any;
|
|
7571
7639
|
"empty-state"?(_: {}): any;
|
|
7572
7640
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ironsource/shared-ui",
|
|
3
|
-
"version": "2.1.8-rc.
|
|
3
|
+
"version": "2.1.8-rc.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"npm": ">=7.0.0",
|
|
6
6
|
"node": ">=16.0.0"
|
|
@@ -229,7 +229,8 @@
|
|
|
229
229
|
"./forms": "./components/forms/index.js",
|
|
230
230
|
"./statusDot": "./components/statusDot/index.js",
|
|
231
231
|
"./sortableList": "./components/sortableList/index.js",
|
|
232
|
-
"./composables/useFormValidation": "./composables/useFormValidation.js"
|
|
232
|
+
"./composables/useFormValidation": "./composables/useFormValidation.js",
|
|
233
|
+
"./utils/": "./utils/index.ts"
|
|
233
234
|
},
|
|
234
235
|
"typesVersions": {
|
|
235
236
|
"*": {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const DEFAULT_FALLBACK = "N/A";
|
|
2
|
+
export declare const nFormatter: (num: number | string, fallback?: string | null) => string;
|
|
3
|
+
export declare const diffInPersentage: (valueA: number | string, valueB: number | string, fallback?: string | null) => string | number;
|
|
4
|
+
export declare const formatNumberWithCommas: (num: number | string, fallback?: string | null) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const s = "N/A", r = (n, e, t) => n.toLocaleString("en", {
|
|
2
|
+
minimumFractionDigits: e,
|
|
3
|
+
maximumFractionDigits: t
|
|
4
|
+
}), u = (n, e = s) => {
|
|
5
|
+
const t = Number(n), a = t % 1 !== 0;
|
|
6
|
+
return isNaN(t) && e ? e : Math.abs(t) >= 1e12 ? "∞" : Math.abs(t) >= 1e9 ? `${r(t / 1e9, 0, 1)}B` : Math.abs(t) >= 1e6 ? `${r(t / 1e6, 0, 1)}M` : Math.abs(t) >= 1e3 ? `${r(t / 1e3, 0, 1)}K` : a && Math.abs(t) >= 100 ? r(t, 0, 0) : a && Math.abs(t) >= 10 ? r(t, 0, 1) : a ? r(t, 2, 2) : r(t, 0, 0);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
s as DEFAULT_FALLBACK,
|
|
10
|
+
u as nFormatter
|
|
11
|
+
};
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './formatNumbers';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.sticky[data-v-706b324e]{position:sticky}.table-container[data-v-706b324e]{width:100%;position:relative;display:flex;flex-direction:column}.table-header[data-v-706b324e]{display:flex;align-items:center;height:calc(var(--spacing-800) - 1px);border-bottom:1px solid var(--common-divider);background-color:var(--background-paper-elevation-0);position:sticky;left:0;padding:var(--spacing-300)}.table-header .table-title[data-v-706b324e]{display:flex;flex:1;align-items:center;justify-content:flex-start;height:100%;color:var(--text-primary)}.table-header .table-header-right[data-v-706b324e]{display:flex;align-items:center;height:100%}.table-header .search-wrapper[data-v-706b324e]{width:13.75rem}.table-header.isStickyHeader[data-v-706b324e]{z-index:calc(var(--6e46e9f4) + 3);top:0}.table-head-container[data-v-706b324e]{display:flex;align-items:center;white-space:nowrap;color:var(--text-primary)}.table-footer[data-v-706b324e]{color:var(--text-primary);background-color:var(--background-paper-elevation-0);padding:0 var(--spacing-300);display:flex;align-items:center;min-height:var(--spacing-600);border:1px solid var(--common-divider);border-radius:var(--border-radius-md);border-top-right-radius:0;border-top-left-radius:0}.table-body-wrapper[data-v-706b324e]{display:inline-table}.table-header-actions[data-v-706b324e]{margin-left:var(--spacing-100);display:flex;align-items:center}.table-row[data-v-706b324e]{position:relative}.table-row.loading[data-v-706b324e]{opacity:.7}.table-row:not(.expanded):last-child>td[data-v-706b324e]{border-bottom:none}.table-row.expanded:last-child>.expanded-row[data-v-706b324e]{border-bottom:none}.expanded-row[data-v-706b324e]{grid-column:var(--bd8b5530);border-bottom:1px solid var(--common-divider);background-color:var(--background-default)}table[data-v-706b324e]{position:relative;display:block;overflow:auto;background:var(--background-paper-elevation-0);border:1px solid var(--common-divider);color:var(--text-primary);text-align:left;table-layout:fixed;width:100%;max-height:100%;border-radius:var(--border-radius-md);border-collapse:collapse;border-spacing:0}table.hasFooter[data-v-706b324e]{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none}table td[data-v-706b324e],table th[data-v-706b324e]{line-height:normal;padding:0 var(--spacing-200)}table td[data-v-706b324e]:first-of-type,table th[data-v-706b324e]:first-of-type{padding-left:var(--spacing-300)}table td[data-v-706b324e]:last-of-type,table th[data-v-706b324e]:last-of-type{padding-right:var(--spacing-300)}table td.expand-toggle-cell[data-v-706b324e],table th.expand-toggle-cell[data-v-706b324e]{padding-left:var(--spacing-150);padding-right:var(--spacing-75)}table>thead[data-v-706b324e]{border-bottom:none;z-index:calc(var(--6e46e9f4) + 1);display:inline-table;min-width:100%}table>thead>tr[data-v-706b324e]{color:var(--text-primary);border-bottom:1px solid var(--common-divider);height:var(--spacing-500);display:grid;grid-template-columns:var(--03c6ae61)}table>thead>tr>th[data-v-706b324e]{background:var(--background-paper-elevation-0);width:100%;display:flex;align-items:center;cursor:default}table>thead>tr>th.bordered[data-v-706b324e]{border-right:1px solid var(--common-divider)}table>thead>tr>th.bordered.isStickyRight[data-v-706b324e]{border-right:none;border-left:1px solid var(--common-divider)}table>thead>tr>th.isTextRight[data-v-706b324e]{justify-content:flex-end}table>thead>tr>th.isSortable[data-v-706b324e]{cursor:pointer}table>thead.sticky[data-v-706b324e]{position:sticky;top:0;background:white}table>thead.isStickyHeader[data-v-706b324e]{z-index:calc(var(--6e46e9f4) + 2);top:calc(var(--spacing-800) - 1px)}table>tbody[data-v-706b324e]{display:block}table>tbody>*>tr[data-v-706b324e]{background-color:var(--background-default);min-height:var(--1c8cc6ae);height:auto;display:grid;align-items:center;grid-template-columns:var(--03c6ae61)}table>tbody>*>tr:nth-of-type(2n)>td[data-v-706b324e]{background-color:var(--background-default)}table>tbody>*>tr:hover:not(.loading)>td[data-v-706b324e],table>tbody>*>tr.activeMenu>td[data-v-706b324e]{background-color:var(--background-paper-elevation-1)}table>tbody td[data-v-706b324e]{background-color:var(--background-default);border:none;min-width:0;display:flex;min-height:var(--1c8cc6ae);height:auto;width:100%;place-items:center;border-bottom:1px solid var(--common-divider);justify-content:start}table>tbody td.bordered[data-v-706b324e]{border-right:1px solid var(--common-divider)}table>tbody td.bordered.isStickyRight[data-v-706b324e]{border-right:none;border-left:1px solid var(--common-divider)}table>tbody td.isTextRight[data-v-706b324e]{justify-content:flex-end;text-align:right}.section-container[data-v-706b324e]{left:0}.sections[data-v-706b324e]{display:flex}.section[data-v-706b324e]{padding:0 1.5rem;background:var(--background-default);left:0;height:32px;display:flex;align-items:flex-end;border-right:1px solid var(--common-divider)}.table-cell[data-v-706b324e]{width:100%}.empty-state[data-v-706b324e]{min-height:250px}.floating-row[data-v-706b324e]{display:flex;inset:0;pointer-events:none;position:absolute;z-index:calc(var(--6e46e9f4) + 1)}.floating-row *[data-v-706b324e-s]{pointer-events:auto}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.data-grid-rows-counter[data-v-0ce71f73]{color:var(--text-secondary)}.text-strong[data-v-0ce71f73]{color:var(--text-primary)}
|