@kong-ui-public/table-data-grid 0.2.1 → 0.2.2-pr.3376.177955a30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/style.css +0 -1
- package/dist/table-data-grid.es.js +0 -314
- package/dist/table-data-grid.umd.js +0 -1
- package/dist/types/components/TableDataGrid.vue.d.ts +0 -36
- package/dist/types/components/TableDataGrid.vue.d.ts.map +0 -1
- package/dist/types/composables/useEmitState.d.ts +0 -11
- package/dist/types/composables/useEmitState.d.ts.map +0 -1
- package/dist/types/composables/useFetchInfinite.d.ts +0 -48
- package/dist/types/composables/useFetchInfinite.d.ts.map +0 -1
- package/dist/types/composables/useFetchState.d.ts +0 -30
- package/dist/types/composables/useFetchState.d.ts.map +0 -1
- package/dist/types/composables/useI18n.d.ts +0 -9
- package/dist/types/composables/useI18n.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -29
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/fetchers.d.ts +0 -42
- package/dist/types/utils/fetchers.d.ts.map +0 -1
package/package.json
CHANGED
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.kong-ui-public-table-data-grid[data-v-907dbee2]{border:none;border-radius:4px;border-radius:var(--kui-border-radius-20, 4px);box-sizing:border-box;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;width:100%}.table-data-grid-grid[data-v-907dbee2]{--ag-background-color: var(--kui-color-background, #ffffff);--ag-border-color: var(--kui-color-border, #e0e4ea);--ag-header-background-color: var(--kui-color-background, #ffffff);--ag-header-column-border: 1px solid var(--kui-color-border, #e0e4ea);--ag-header-column-border-height: 30%;--ag-header-column-resize-handle-color: transparent;--ag-header-font-weight: var(--kui-font-weight-semibold, 600);--ag-wrapper-border: none;--ag-wrapper-border-radius: 0;flex:1 1 auto;min-height:0;width:100%}.ag-cell{align-items:center;display:flex}
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { computed as C, watch as _, ref as F, shallowRef as M, readonly as w, defineComponent as W, resolveComponent as V, openBlock as N, createElementBlock as z, renderSlot as A, createVNode as L, unref as v, createBlock as x } from "vue";
|
|
2
|
-
import { AgGridVue as $ } from "ag-grid-vue3";
|
|
3
|
-
import { ModuleRegistry as j, AllCommunityModule as H, InfiniteRowModelModule as K, themeQuartz as Q } from "ag-grid-community";
|
|
4
|
-
import { createI18n as q, i18nTComponent as J } from "@kong-ui-public/i18n";
|
|
5
|
-
var D = /* @__PURE__ */ ((e) => (e.PENDING = "PENDING", e.LOADING = "LOADING", e.SUCCESS = "SUCCESS", e.ERROR = "ERROR", e))(D || {});
|
|
6
|
-
const P = (e) => !!(e != null && e.length);
|
|
7
|
-
function X(e, i, o, a = P) {
|
|
8
|
-
const l = C(() => a(e.value)), p = C(() => {
|
|
9
|
-
const f = e.value !== void 0, d = i.value !== void 0 && i.value !== null;
|
|
10
|
-
return o.value ? "LOADING" : l.value ? "SUCCESS" : d ? "ERROR" : f ? "SUCCESS" : "PENDING";
|
|
11
|
-
});
|
|
12
|
-
return {
|
|
13
|
-
fetchState: D,
|
|
14
|
-
hasData: l,
|
|
15
|
-
state: p
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const Y = ({
|
|
19
|
-
emitState: e,
|
|
20
|
-
fetchLifecycleState: i,
|
|
21
|
-
hasData: o
|
|
22
|
-
}) => {
|
|
23
|
-
_(
|
|
24
|
-
() => ({
|
|
25
|
-
hasData: o.value,
|
|
26
|
-
state: i.value
|
|
27
|
-
}),
|
|
28
|
-
({ hasData: a, state: l }) => {
|
|
29
|
-
if (l !== D.PENDING) {
|
|
30
|
-
if (l === D.LOADING) {
|
|
31
|
-
e({
|
|
32
|
-
hasData: a,
|
|
33
|
-
state: "loading"
|
|
34
|
-
});
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (l === D.ERROR) {
|
|
38
|
-
e({
|
|
39
|
-
hasData: a,
|
|
40
|
-
state: "error"
|
|
41
|
-
});
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
e({
|
|
45
|
-
hasData: a,
|
|
46
|
-
state: "success"
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}, Z = ({ startRow: e, endRow: i }) => {
|
|
52
|
-
const o = i - e;
|
|
53
|
-
return {
|
|
54
|
-
blockIndex: o > 0 ? Math.floor(e / o) : 0,
|
|
55
|
-
pageSize: o
|
|
56
|
-
};
|
|
57
|
-
}, ee = ({
|
|
58
|
-
startRow: e,
|
|
59
|
-
rowsLength: i,
|
|
60
|
-
pageSize: o,
|
|
61
|
-
total: a,
|
|
62
|
-
hasMore: l
|
|
63
|
-
}) => {
|
|
64
|
-
if (typeof a == "number")
|
|
65
|
-
return a;
|
|
66
|
-
if (l !== !0 && (l === !1 || i < o))
|
|
67
|
-
return e + i;
|
|
68
|
-
}, te = ({
|
|
69
|
-
fetcher: e,
|
|
70
|
-
resetKey: i
|
|
71
|
-
}) => {
|
|
72
|
-
const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = F(0), p = M(), g = M(), f = M(), d = F(0), k = F(!1), h = (t) => t === l.value, S = () => {
|
|
73
|
-
k.value = d.value > 0;
|
|
74
|
-
}, b = () => {
|
|
75
|
-
f.value = void 0, d.value += 1, S();
|
|
76
|
-
}, E = () => {
|
|
77
|
-
d.value = Math.max(0, d.value - 1), S();
|
|
78
|
-
}, B = (t) => {
|
|
79
|
-
const r = a.get(t);
|
|
80
|
-
if (r)
|
|
81
|
-
return r;
|
|
82
|
-
let s;
|
|
83
|
-
const u = {
|
|
84
|
-
promise: new Promise((n) => {
|
|
85
|
-
s = n;
|
|
86
|
-
}),
|
|
87
|
-
resolve: (n) => s(n)
|
|
88
|
-
};
|
|
89
|
-
return a.set(t, u), u;
|
|
90
|
-
}, m = (t, r) => {
|
|
91
|
-
r.resolve(!1), a.get(t) === r && a.delete(t);
|
|
92
|
-
}, c = async ({
|
|
93
|
-
blockIndex: t,
|
|
94
|
-
currentBlockCompletion: r,
|
|
95
|
-
datasourceId: s
|
|
96
|
-
}) => {
|
|
97
|
-
if (t === 0)
|
|
98
|
-
return "ready";
|
|
99
|
-
const u = a.get(t - 1);
|
|
100
|
-
if (!u)
|
|
101
|
-
return m(t, r), "failed";
|
|
102
|
-
const n = await u.promise;
|
|
103
|
-
return h(s) ? n ? "ready" : (m(t, r), "failed") : (m(t, r), "stale");
|
|
104
|
-
}, G = ({
|
|
105
|
-
blockIndex: t,
|
|
106
|
-
currentBlockCompletion: r,
|
|
107
|
-
getRowsParams: s,
|
|
108
|
-
pageSize: u,
|
|
109
|
-
result: n
|
|
110
|
-
}) => {
|
|
111
|
-
n.cursor !== void 0 && o.set(t, n.cursor), s.successCallback(n.data, ee({
|
|
112
|
-
startRow: s.startRow,
|
|
113
|
-
rowsLength: n.data.length,
|
|
114
|
-
pageSize: u,
|
|
115
|
-
total: n.total,
|
|
116
|
-
hasMore: n.hasMore
|
|
117
|
-
})), s.startRow === 0 && (g.value = n.data), r.resolve(!0);
|
|
118
|
-
}, y = ({
|
|
119
|
-
blockIndex: t,
|
|
120
|
-
currentBlockCompletion: r,
|
|
121
|
-
fetchError: s,
|
|
122
|
-
getRowsParams: u
|
|
123
|
-
}) => {
|
|
124
|
-
f.value = s, u.failCallback(), m(t, r);
|
|
125
|
-
}, R = () => {
|
|
126
|
-
const t = l.value + 1;
|
|
127
|
-
return l.value = t, o.clear(), a.clear(), g.value = void 0, f.value = void 0, d.value = 0, S(), {
|
|
128
|
-
async getRows(r) {
|
|
129
|
-
const {
|
|
130
|
-
blockIndex: s,
|
|
131
|
-
pageSize: u
|
|
132
|
-
} = Z({
|
|
133
|
-
startRow: r.startRow,
|
|
134
|
-
endRow: r.endRow
|
|
135
|
-
}), n = B(s), O = await c({
|
|
136
|
-
blockIndex: s,
|
|
137
|
-
currentBlockCompletion: n,
|
|
138
|
-
datasourceId: t
|
|
139
|
-
});
|
|
140
|
-
if (O !== "ready") {
|
|
141
|
-
O === "failed" && r.failCallback();
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
b();
|
|
145
|
-
try {
|
|
146
|
-
const I = s > 0 ? o.get(s - 1) : void 0, U = await e({
|
|
147
|
-
mode: "infinite",
|
|
148
|
-
pageSize: u,
|
|
149
|
-
cursor: I
|
|
150
|
-
});
|
|
151
|
-
if (!h(t)) {
|
|
152
|
-
m(s, n);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
G({
|
|
156
|
-
blockIndex: s,
|
|
157
|
-
currentBlockCompletion: n,
|
|
158
|
-
getRowsParams: r,
|
|
159
|
-
pageSize: u,
|
|
160
|
-
result: U
|
|
161
|
-
});
|
|
162
|
-
} catch (I) {
|
|
163
|
-
if (!h(t)) {
|
|
164
|
-
m(s, n);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
y({
|
|
168
|
-
blockIndex: s,
|
|
169
|
-
currentBlockCompletion: n,
|
|
170
|
-
fetchError: I,
|
|
171
|
-
getRowsParams: r
|
|
172
|
-
});
|
|
173
|
-
} finally {
|
|
174
|
-
h(t) && E();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
}, T = () => {
|
|
179
|
-
p.value = R();
|
|
180
|
-
};
|
|
181
|
-
return _(
|
|
182
|
-
() => i == null ? void 0 : i.value,
|
|
183
|
-
() => {
|
|
184
|
-
T();
|
|
185
|
-
},
|
|
186
|
-
{ immediate: !0 }
|
|
187
|
-
), {
|
|
188
|
-
datasource: w(p),
|
|
189
|
-
data: w(g),
|
|
190
|
-
error: w(f),
|
|
191
|
-
isFetching: w(k)
|
|
192
|
-
};
|
|
193
|
-
}, ae = {
|
|
194
|
-
title: "No Data",
|
|
195
|
-
message: "There is no data to display."
|
|
196
|
-
}, oe = {
|
|
197
|
-
title: "An error occurred",
|
|
198
|
-
message: "Data cannot be displayed due to an error."
|
|
199
|
-
}, re = {
|
|
200
|
-
emptyState: ae,
|
|
201
|
-
errorState: oe
|
|
202
|
-
};
|
|
203
|
-
function se() {
|
|
204
|
-
const e = q("en-us", re);
|
|
205
|
-
return {
|
|
206
|
-
i18n: e,
|
|
207
|
-
i18nT: J(e)
|
|
208
|
-
// Translation component <i18n-t>
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
const ne = {
|
|
212
|
-
class: "kong-ui-public-table-data-grid",
|
|
213
|
-
"data-testid": "table-data-grid"
|
|
214
|
-
}, ie = {
|
|
215
|
-
key: 0,
|
|
216
|
-
class: "table-error-state",
|
|
217
|
-
"data-testid": "table-error-state"
|
|
218
|
-
}, le = {
|
|
219
|
-
key: 1,
|
|
220
|
-
class: "table-empty-state",
|
|
221
|
-
"data-testid": "table-empty-state"
|
|
222
|
-
}, ce = /* @__PURE__ */ W({
|
|
223
|
-
__name: "TableDataGrid",
|
|
224
|
-
props: {
|
|
225
|
-
headers: {},
|
|
226
|
-
fetcher: { type: Function },
|
|
227
|
-
error: { type: Boolean, default: !1 },
|
|
228
|
-
pageSize: { default: 25 },
|
|
229
|
-
refreshKey: { type: [String, Number, Boolean] }
|
|
230
|
-
},
|
|
231
|
-
emits: ["grid:ready", "state"],
|
|
232
|
-
setup(e, { emit: i }) {
|
|
233
|
-
j.registerModules([H, K]);
|
|
234
|
-
const o = i, { i18n: { t: a } } = se(), l = {
|
|
235
|
-
resizable: !1,
|
|
236
|
-
sortable: !1,
|
|
237
|
-
suppressMovable: !0
|
|
238
|
-
}, p = C(() => e.headers.map((c) => ({
|
|
239
|
-
colId: c.key,
|
|
240
|
-
// Headers without explicit width constraints should fill available space.
|
|
241
|
-
flex: !c.width && !c.maxWidth ? 1 : void 0,
|
|
242
|
-
headerName: c.label,
|
|
243
|
-
maxWidth: c.maxWidth,
|
|
244
|
-
minWidth: c.minWidth,
|
|
245
|
-
valueGetter: (y) => {
|
|
246
|
-
var R;
|
|
247
|
-
return (R = y.data) == null ? void 0 : R[c.key];
|
|
248
|
-
},
|
|
249
|
-
width: c.width
|
|
250
|
-
}))), g = C(() => [e.fetcher, e.pageSize, e.refreshKey]), {
|
|
251
|
-
data: f,
|
|
252
|
-
datasource: d,
|
|
253
|
-
error: k,
|
|
254
|
-
isFetching: h
|
|
255
|
-
} = te({
|
|
256
|
-
fetcher: e.fetcher,
|
|
257
|
-
resetKey: g
|
|
258
|
-
}), {
|
|
259
|
-
fetchState: S,
|
|
260
|
-
hasData: b,
|
|
261
|
-
state: E
|
|
262
|
-
} = X(f, k, h), B = C(() => E.value === S.SUCCESS && !b.value);
|
|
263
|
-
Y({
|
|
264
|
-
emitState: (c) => o("state", c),
|
|
265
|
-
fetchLifecycleState: E,
|
|
266
|
-
hasData: b
|
|
267
|
-
});
|
|
268
|
-
const m = (c) => {
|
|
269
|
-
o("grid:ready", c.api);
|
|
270
|
-
};
|
|
271
|
-
return (c, G) => {
|
|
272
|
-
const y = V("KEmptyState");
|
|
273
|
-
return N(), z("div", ne, [
|
|
274
|
-
e.error ? (N(), z("div", ie, [
|
|
275
|
-
A(c.$slots, "error-state", {}, () => [
|
|
276
|
-
L(y, {
|
|
277
|
-
"icon-variant": "error",
|
|
278
|
-
message: v(a)("errorState.message"),
|
|
279
|
-
title: v(a)("errorState.title")
|
|
280
|
-
}, null, 8, ["message", "title"])
|
|
281
|
-
], !0)
|
|
282
|
-
])) : B.value ? (N(), z("div", le, [
|
|
283
|
-
A(c.$slots, "empty-state", {}, () => [
|
|
284
|
-
L(y, {
|
|
285
|
-
message: v(a)("emptyState.message"),
|
|
286
|
-
title: v(a)("emptyState.title")
|
|
287
|
-
}, null, 8, ["message", "title"])
|
|
288
|
-
], !0)
|
|
289
|
-
])) : (N(), x(v($), {
|
|
290
|
-
key: 2,
|
|
291
|
-
"cache-block-size": e.pageSize,
|
|
292
|
-
class: "table-data-grid-grid",
|
|
293
|
-
"column-defs": p.value,
|
|
294
|
-
datasource: v(d),
|
|
295
|
-
"default-col-def": l,
|
|
296
|
-
"infinite-initial-row-count": 1,
|
|
297
|
-
loading: v(h),
|
|
298
|
-
"row-model-type": "infinite",
|
|
299
|
-
"suppress-cell-focus": !0,
|
|
300
|
-
theme: v(Q),
|
|
301
|
-
onGridReady: m
|
|
302
|
-
}, null, 8, ["cache-block-size", "column-defs", "datasource", "loading", "theme"]))
|
|
303
|
-
]);
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
}), ue = (e, i) => {
|
|
307
|
-
const o = e.__vccOpts || e;
|
|
308
|
-
for (const [a, l] of i)
|
|
309
|
-
o[a] = l;
|
|
310
|
-
return o;
|
|
311
|
-
}, he = /* @__PURE__ */ ue(ce, [["__scopeId", "data-v-907dbee2"]]);
|
|
312
|
-
export {
|
|
313
|
-
he as TableDataGrid
|
|
314
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("ag-grid-vue3"),require("ag-grid-community"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","ag-grid-vue3","ag-grid-community","@kong-ui-public/i18n"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["kong-ui-public-table-data-grid"]={},f.Vue,f.AgGridVue,f.agGridCommunity,f["kong-ui-public-i18n"]))})(this,function(f,e,F,v,I){"use strict";var D=(t=>(t.PENDING="PENDING",t.LOADING="LOADING",t.SUCCESS="SUCCESS",t.ERROR="ERROR",t))(D||{});const O=t=>!!(t!=null&&t.length);function _(t,c,r,o=O){const l=e.computed(()=>o(t.value)),y=e.computed(()=>{const p=t.value!==void 0,m=c.value!==void 0&&c.value!==null;return r.value?"LOADING":l.value?"SUCCESS":m?"ERROR":p?"SUCCESS":"PENDING"});return{fetchState:D,hasData:l,state:y}}const z=({emitState:t,fetchLifecycleState:c,hasData:r})=>{e.watch(()=>({hasData:r.value,state:c.value}),({hasData:o,state:l})=>{if(l!==D.PENDING){if(l===D.LOADING){t({hasData:o,state:"loading"});return}if(l===D.ERROR){t({hasData:o,state:"error"});return}t({hasData:o,state:"success"})}})},T=({startRow:t,endRow:c})=>{const r=c-t;return{blockIndex:r>0?Math.floor(t/r):0,pageSize:r}},A=({startRow:t,rowsLength:c,pageSize:r,total:o,hasMore:l})=>{if(typeof o=="number")return o;if(l!==!0&&(l===!1||c<r))return t+c},L=({fetcher:t,resetKey:c})=>{const r=new Map,o=new Map,l=e.ref(0),y=e.shallowRef(),S=e.shallowRef(),p=e.shallowRef(),m=e.ref(0),C=e.ref(!1),g=a=>a===l.value,b=()=>{C.value=m.value>0},E=()=>{p.value=void 0,m.value+=1,b()},R=()=>{m.value=Math.max(0,m.value-1),b()},B=a=>{const n=o.get(a);if(n)return n;let s;const d={promise:new Promise(i=>{s=i}),resolve:i=>s(i)};return o.set(a,d),d},h=(a,n)=>{n.resolve(!1),o.get(a)===n&&o.delete(a)},u=async({blockIndex:a,currentBlockCompletion:n,datasourceId:s})=>{if(a===0)return"ready";const d=o.get(a-1);if(!d)return h(a,n),"failed";const i=await d.promise;return g(s)?i?"ready":(h(a,n),"failed"):(h(a,n),"stale")},N=({blockIndex:a,currentBlockCompletion:n,getRowsParams:s,pageSize:d,result:i})=>{i.cursor!==void 0&&r.set(a,i.cursor),s.successCallback(i.data,A({startRow:s.startRow,rowsLength:i.data.length,pageSize:d,total:i.total,hasMore:i.hasMore})),s.startRow===0&&(S.value=i.data),n.resolve(!0)},k=({blockIndex:a,currentBlockCompletion:n,fetchError:s,getRowsParams:d})=>{p.value=s,d.failCallback(),h(a,n)},w=()=>{const a=l.value+1;return l.value=a,r.clear(),o.clear(),S.value=void 0,p.value=void 0,m.value=0,b(),{async getRows(n){const{blockIndex:s,pageSize:d}=T({startRow:n.startRow,endRow:n.endRow}),i=B(s),M=await u({blockIndex:s,currentBlockCompletion:i,datasourceId:a});if(M!=="ready"){M==="failed"&&n.failCallback();return}E();try{const G=s>0?r.get(s-1):void 0,H=await t({mode:"infinite",pageSize:d,cursor:G});if(!g(a)){h(s,i);return}N({blockIndex:s,currentBlockCompletion:i,getRowsParams:n,pageSize:d,result:H})}catch(G){if(!g(a)){h(s,i);return}k({blockIndex:s,currentBlockCompletion:i,fetchError:G,getRowsParams:n})}finally{g(a)&&R()}}}},$=()=>{y.value=w()};return e.watch(()=>c==null?void 0:c.value,()=>{$()},{immediate:!0}),{datasource:e.readonly(y),data:e.readonly(S),error:e.readonly(p),isFetching:e.readonly(C)}},V={emptyState:{title:"No Data",message:"There is no data to display."},errorState:{title:"An error occurred",message:"Data cannot be displayed due to an error."}};function x(){const t=I.createI18n("en-us",V);return{i18n:t,i18nT:I.i18nTComponent(t)}}const U={class:"kong-ui-public-table-data-grid","data-testid":"table-data-grid"},W={key:0,class:"table-error-state","data-testid":"table-error-state"},q={key:1,class:"table-empty-state","data-testid":"table-empty-state"},j=((t,c)=>{const r=t.__vccOpts||t;for(const[o,l]of c)r[o]=l;return r})(e.defineComponent({__name:"TableDataGrid",props:{headers:{},fetcher:{type:Function},error:{type:Boolean,default:!1},pageSize:{default:25},refreshKey:{type:[String,Number,Boolean]}},emits:["grid:ready","state"],setup(t,{emit:c}){v.ModuleRegistry.registerModules([v.AllCommunityModule,v.InfiniteRowModelModule]);const r=c,{i18n:{t:o}}=x(),l={resizable:!1,sortable:!1,suppressMovable:!0},y=e.computed(()=>t.headers.map(u=>({colId:u.key,flex:!u.width&&!u.maxWidth?1:void 0,headerName:u.label,maxWidth:u.maxWidth,minWidth:u.minWidth,valueGetter:k=>{var w;return(w=k.data)==null?void 0:w[u.key]},width:u.width}))),S=e.computed(()=>[t.fetcher,t.pageSize,t.refreshKey]),{data:p,datasource:m,error:C,isFetching:g}=L({fetcher:t.fetcher,resetKey:S}),{fetchState:b,hasData:E,state:R}=_(p,C,g),B=e.computed(()=>R.value===b.SUCCESS&&!E.value);z({emitState:u=>r("state",u),fetchLifecycleState:R,hasData:E});const h=u=>{r("grid:ready",u.api)};return(u,N)=>{const k=e.resolveComponent("KEmptyState");return e.openBlock(),e.createElementBlock("div",U,[t.error?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(u.$slots,"error-state",{},()=>[e.createVNode(k,{"icon-variant":"error",message:e.unref(o)("errorState.message"),title:e.unref(o)("errorState.title")},null,8,["message","title"])],!0)])):B.value?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(u.$slots,"empty-state",{},()=>[e.createVNode(k,{message:e.unref(o)("emptyState.message"),title:e.unref(o)("emptyState.title")},null,8,["message","title"])],!0)])):(e.openBlock(),e.createBlock(e.unref(F.AgGridVue),{key:2,"cache-block-size":t.pageSize,class:"table-data-grid-grid","column-defs":y.value,datasource:e.unref(m),"default-col-def":l,"infinite-initial-row-count":1,loading:e.unref(g),"row-model-type":"infinite","suppress-cell-focus":!0,theme:e.unref(v.themeQuartz),onGridReady:h},null,8,["cache-block-size","column-defs","datasource","loading","theme"]))])}}}),[["__scopeId","data-v-907dbee2"]]);f.TableDataGrid=j,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { TableDataGridFetcher, TableDataGridHeader, TableDataGridStatePayload } from '../types';
|
|
2
|
-
import type { GridReadyEvent } from 'ag-grid-community';
|
|
3
|
-
declare const __VLS_export: <Row extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
-
headers: Array<TableDataGridHeader<Row>>;
|
|
6
|
-
fetcher: TableDataGridFetcher<Row>;
|
|
7
|
-
error?: boolean;
|
|
8
|
-
pageSize?: number;
|
|
9
|
-
refreshKey?: string | number | boolean;
|
|
10
|
-
} & {
|
|
11
|
-
onState?: ((payload: TableDataGridStatePayload) => any) | undefined;
|
|
12
|
-
"onGrid:ready"?: ((api: import("ag-grid-community").GridApi<Row>) => any) | undefined;
|
|
13
|
-
}> & (typeof globalThis extends {
|
|
14
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
15
|
-
} ? P : {});
|
|
16
|
-
expose: (exposed: {}) => void;
|
|
17
|
-
attrs: any;
|
|
18
|
-
slots: {
|
|
19
|
-
'empty-state': () => unknown;
|
|
20
|
-
'error-state': () => unknown;
|
|
21
|
-
};
|
|
22
|
-
emit: {
|
|
23
|
-
(e: "grid:ready", api: GridReadyEvent<Row>["api"]): void;
|
|
24
|
-
(e: "state", payload: TableDataGridStatePayload): void;
|
|
25
|
-
};
|
|
26
|
-
}>) => import("vue").VNode & {
|
|
27
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
28
|
-
};
|
|
29
|
-
declare const _default: typeof __VLS_export;
|
|
30
|
-
export default _default;
|
|
31
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
32
|
-
[K in keyof T]: T[K];
|
|
33
|
-
} : {
|
|
34
|
-
[K in keyof T as K]: T[K];
|
|
35
|
-
}) & {};
|
|
36
|
-
//# sourceMappingURL=TableDataGrid.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableDataGrid.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TableDataGrid.vue"],"names":[],"mappings":"AA8LA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAU,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAc/D,QAAA,MAAM,YAAY,GAAK,GAAG,SAAS,MAAM,EACxC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAoNO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;iBAhN7C,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;iBAC/B,oBAAoB,CAAC,GAAG,CAAC;gBAC1B,OAAO;mBACJ,MAAM;qBACJ,MAAM,GAAG,MAAM,GAAG,OAAO;;;;KA4MmD,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;uBAlMM,MAAM,OAAO;uBACb,MAAM,OAAO;;;YAKxB,YAAY,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;YACpD,OAAO,WAAW,yBAAyB,GAAG,IAAI;;EA+LpD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TableDataGridStatePayload } from '../types';
|
|
2
|
-
import type { Ref } from 'vue';
|
|
3
|
-
import { fetchState } from './useFetchState';
|
|
4
|
-
type UseEmitStateOptions = {
|
|
5
|
-
emitState: (payload: TableDataGridStatePayload) => void;
|
|
6
|
-
fetchLifecycleState: Readonly<Ref<fetchState>>;
|
|
7
|
-
hasData: Readonly<Ref<boolean>>;
|
|
8
|
-
};
|
|
9
|
-
export declare const useEmitState: ({ emitState, fetchLifecycleState, hasData, }: UseEmitStateOptions) => void;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useEmitState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEmitState.d.ts","sourceRoot":"","sources":["../../../src/composables/useEmitState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,CAAA;IACvD,mBAAmB,EAAE,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;IAC9C,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,8CAI1B,mBAAmB,SAmCrB,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { TableDataGridFetcher, TableDataGridRow } from '../types';
|
|
2
|
-
import type { IGetRowsParams } from 'ag-grid-community';
|
|
3
|
-
import type { Ref } from 'vue';
|
|
4
|
-
interface UseFetchInfiniteOptions<Row extends object = TableDataGridRow> {
|
|
5
|
-
/**
|
|
6
|
-
* Public row fetcher supplied by the host. The composable keeps AG Grid row
|
|
7
|
-
* ranges internal and calls this with the cursor-first TableDataGrid contract.
|
|
8
|
-
*/
|
|
9
|
-
fetcher: TableDataGridFetcher<Row>;
|
|
10
|
-
/**
|
|
11
|
-
* Reactive invalidation input from the component layer. Any change rebuilds
|
|
12
|
-
* the datasource and clears cursor/block state back to block 0.
|
|
13
|
-
*/
|
|
14
|
-
resetKey?: Readonly<Ref<unknown>>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Owns AG Grid infinite datasource creation and cursor-backed fetch
|
|
18
|
-
* orchestration for TableDataGrid.
|
|
19
|
-
*
|
|
20
|
-
* Callers provide the public fetcher and an optional reset key, then observe
|
|
21
|
-
* readonly fetch state and pass the returned datasource to AG Grid. Cursor maps,
|
|
22
|
-
* block completion gates, pending counts, and stale datasource guards stay
|
|
23
|
-
* private to this composable so component code cannot mutate fetch lifecycle
|
|
24
|
-
* state directly.
|
|
25
|
-
*
|
|
26
|
-
* @param fetcher Host-supplied fetcher that uses TableDataGrid's cursor-first
|
|
27
|
-
* infinite mode contract.
|
|
28
|
-
* @param resetKey Optional reactive invalidation key that rebuilds the
|
|
29
|
-
* datasource and restarts the cursor chain.
|
|
30
|
-
* @returns Readonly datasource, first-block data, error, and fetching state
|
|
31
|
-
* refs for the active AG Grid infinite datasource.
|
|
32
|
-
*/
|
|
33
|
-
export declare const useFetchInfinite: <Row extends object = TableDataGridRow>({ fetcher, resetKey, }: UseFetchInfiniteOptions<Row>) => {
|
|
34
|
-
datasource: Readonly<Ref<{
|
|
35
|
-
readonly rowCount?: number | undefined;
|
|
36
|
-
readonly getRows: (params: IGetRowsParams) => void;
|
|
37
|
-
readonly destroy?: (() => void) | undefined;
|
|
38
|
-
} | undefined, {
|
|
39
|
-
readonly rowCount?: number | undefined;
|
|
40
|
-
readonly getRows: (params: IGetRowsParams) => void;
|
|
41
|
-
readonly destroy?: (() => void) | undefined;
|
|
42
|
-
} | undefined>>;
|
|
43
|
-
data: Readonly<Ref<readonly import("vue").DeepReadonly<Row>[] | undefined, readonly import("vue").DeepReadonly<Row>[] | undefined>>;
|
|
44
|
-
error: Readonly<Ref<Readonly<unknown>, Readonly<unknown>>>;
|
|
45
|
-
isFetching: Readonly<Ref<boolean, boolean>>;
|
|
46
|
-
};
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=useFetchInfinite.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchInfinite.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchInfinite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAW9B,UAAU,uBAAuB,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB;IACrE;;;OAGG;IACH,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;CAClC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,wBAGrE,uBAAuB,CAAC,GAAG,CAAC;;;;;;;;;;;;;CA4T9B,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue';
|
|
2
|
-
export declare enum fetchState {
|
|
3
|
-
PENDING = "PENDING",
|
|
4
|
-
LOADING = "LOADING",
|
|
5
|
-
SUCCESS = "SUCCESS",
|
|
6
|
-
ERROR = "ERROR"
|
|
7
|
-
}
|
|
8
|
-
type UseFetchStateResult = {
|
|
9
|
-
fetchState: typeof fetchState;
|
|
10
|
-
hasData: Readonly<Ref<boolean>>;
|
|
11
|
-
state: Readonly<Ref<fetchState>>;
|
|
12
|
-
};
|
|
13
|
-
type FetchStateData<Row> = readonly Row[] | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Derives TableDataGrid fetch state from fetch lifecycle refs.
|
|
16
|
-
*
|
|
17
|
-
* `data`, `error`, and `isFetching` are owned by the fetch orchestration
|
|
18
|
-
* composable. This helper only reads those refs and exposes a readonly derived
|
|
19
|
-
* state without owning mutation or request lifecycle behavior.
|
|
20
|
-
*
|
|
21
|
-
* @param data Current rows from the active fetch chain, or `undefined` before
|
|
22
|
-
* the first fetch result resolves.
|
|
23
|
-
* @param error Current fetch error, if one exists.
|
|
24
|
-
* @param isFetching Whether at least one fetch request is currently pending.
|
|
25
|
-
* @param hasDataCallback Optional row detector for callers that need a custom
|
|
26
|
-
* definition of meaningful data.
|
|
27
|
-
*/
|
|
28
|
-
export default function useFetchState<Row>(data: Readonly<Ref<FetchStateData<Row>>>, error: Readonly<Ref<unknown>>, isFetching: Readonly<Ref<boolean>>, hasDataCallback?: (data: FetchStateData<Row>) => boolean): UseFetchStateResult;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=useFetchState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchState.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,OAAO,UAAU,CAAA;IAC7B,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;CACjC,CAAA;AAED,KAAK,cAAc,CAAC,GAAG,IAAI,SAAS,GAAG,EAAE,GAAG,SAAS,CAAA;AAMrD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EACvC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EACxC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAC7B,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAClC,eAAe,GAAE,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,OAAwB,GACvE,mBAAmB,CAgCrB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createI18n, i18nTComponent } from '@kong-ui-public/i18n';
|
|
2
|
-
import english from '../locales/en.json';
|
|
3
|
-
interface UseI18nReturn {
|
|
4
|
-
i18n: ReturnType<typeof createI18n<typeof english>>;
|
|
5
|
-
i18nT: ReturnType<typeof i18nTComponent<typeof english>>;
|
|
6
|
-
}
|
|
7
|
-
export default function useI18n(): UseI18nReturn;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;IACnD,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,aAAa,CAO/C"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB,cAAc,SAAS,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { GridApi } from 'ag-grid-community';
|
|
2
|
-
export type TableDataGridMode = 'infinite';
|
|
3
|
-
export type TableDataGridRow = Record<string, unknown>;
|
|
4
|
-
export type TableDataGridState = 'loading' | 'success' | 'error';
|
|
5
|
-
export type TableDataGridStatePayload = {
|
|
6
|
-
state: TableDataGridState;
|
|
7
|
-
hasData: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type TableDataGridHeader<Row extends object = TableDataGridRow> = {
|
|
10
|
-
key: Extract<keyof Row, string>;
|
|
11
|
-
label: string;
|
|
12
|
-
width?: number;
|
|
13
|
-
minWidth?: number;
|
|
14
|
-
maxWidth?: number;
|
|
15
|
-
};
|
|
16
|
-
export interface TableDataGridInfiniteFetcherParams {
|
|
17
|
-
mode: 'infinite';
|
|
18
|
-
pageSize: number;
|
|
19
|
-
cursor?: unknown;
|
|
20
|
-
}
|
|
21
|
-
export type TableDataGridFetcherResult<Row extends object = TableDataGridRow> = {
|
|
22
|
-
data: Row[];
|
|
23
|
-
cursor?: unknown;
|
|
24
|
-
total?: number;
|
|
25
|
-
hasMore?: boolean;
|
|
26
|
-
};
|
|
27
|
-
export type TableDataGridFetcher<Row extends object = TableDataGridRow> = (params: TableDataGridInfiniteFetcherParams) => Promise<TableDataGridFetcherResult<Row>>;
|
|
28
|
-
export type TableDataGridReadyPayload<Row extends object = TableDataGridRow> = GridApi<Row>;
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAA;AAC1C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACtD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,kBAAkB,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB,IAAI;IACvE,GAAG,EAAE,OAAO,CAAC,MAAM,GAAG,EAAE,MAAM,CAAC,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,0BAA0B,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB,IAAI;IAC9E,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,oBAAoB,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB,IAAI,CACxE,MAAM,EAAE,kCAAkC,KACvC,OAAO,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAA;AAE7C,MAAM,MAAM,yBAAyB,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
interface GridRowRange {
|
|
2
|
-
startRow: number;
|
|
3
|
-
endRow: number;
|
|
4
|
-
}
|
|
5
|
-
interface CursorBlock {
|
|
6
|
-
blockIndex: number;
|
|
7
|
-
pageSize: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Resolves AG Grid's zero-based, half-open row range into a cursor block.
|
|
11
|
-
*
|
|
12
|
-
* AG Grid passes `startRow` as inclusive and `endRow` as exclusive. It does not
|
|
13
|
-
* pass a block index directly, so derive it from the range before calling
|
|
14
|
-
* TableDataGrid's cursor-based fetcher.
|
|
15
|
-
*
|
|
16
|
-
* @param startRow AG Grid's inclusive row start for the requested block.
|
|
17
|
-
* @param endRow AG Grid's exclusive row end for the requested block.
|
|
18
|
-
* @returns Cursor block index and page size derived from AG Grid's row range.
|
|
19
|
-
*/
|
|
20
|
-
export declare const getCursorBlock: ({ startRow, endRow }: GridRowRange) => CursorBlock;
|
|
21
|
-
/**
|
|
22
|
-
* Translates TableDataGrid fetch metadata into AG Grid's `lastRow` signal.
|
|
23
|
-
*
|
|
24
|
-
* An undefined value tells AG Grid to keep requesting more blocks. A number
|
|
25
|
-
* tells AG Grid the absolute row index where the dataset ends.
|
|
26
|
-
*
|
|
27
|
-
* @param startRow AG Grid's inclusive row start for the fetched block.
|
|
28
|
-
* @param rowsLength Number of rows returned by the TableDataGrid fetcher.
|
|
29
|
-
* @param pageSize Requested block size derived from AG Grid's row range.
|
|
30
|
-
* @param total Optional known total row count from the backend.
|
|
31
|
-
* @param hasMore Optional backend signal for whether another block exists.
|
|
32
|
-
* @returns AG Grid `lastRow` value, or undefined when more blocks may exist.
|
|
33
|
-
*/
|
|
34
|
-
export declare const resolveInfiniteLastRow: ({ startRow, rowsLength, pageSize, total, hasMore, }: {
|
|
35
|
-
startRow: number;
|
|
36
|
-
rowsLength: number;
|
|
37
|
-
pageSize: number;
|
|
38
|
-
total?: number;
|
|
39
|
-
hasMore?: boolean;
|
|
40
|
-
}) => number | undefined;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=fetchers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchers.d.ts","sourceRoot":"","sources":["../../../src/utils/fetchers.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,sBAAsB,YAAY,KAAG,WAOnE,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,qDAMpC;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,KAAG,MAAM,GAAG,SAcZ,CAAA"}
|