quasar-ui-danx 0.4.17 → 0.4.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +2710 -2708
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +38 -38
- package/dist/danx.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/listControls.ts +2 -0
- package/src/helpers/formats.ts +2 -4
- package/src/helpers/routes.ts +4 -0
- package/src/types/controls.d.ts +2 -0
package/package.json
CHANGED
@@ -363,6 +363,8 @@ export function useListControls(name: string, options: ListControlsOptions): Act
|
|
363
363
|
const nextIndex = index + offset;
|
364
364
|
|
365
365
|
const latestNextIndex = latestCallOnly("getNextItem", async () => {
|
366
|
+
if (!pagedItems.value?.data) return -1;
|
367
|
+
|
366
368
|
// Load the previous page if the offset is before index 0
|
367
369
|
if (nextIndex < 0) {
|
368
370
|
if (pagination.value.page > 1) {
|
package/src/helpers/formats.ts
CHANGED
@@ -228,8 +228,8 @@ export function fShortSize(value: string | number) {
|
|
228
228
|
return Math.round(n / div) + " " + power.unit;
|
229
229
|
}
|
230
230
|
|
231
|
-
export function fBoolean(value
|
232
|
-
return value ? "Yes" : "No";
|
231
|
+
export function fBoolean(value?: boolean) {
|
232
|
+
return (value === undefined || value === null) ? "-" : (value ? "Yes" : "No");
|
233
233
|
}
|
234
234
|
|
235
235
|
/**
|
@@ -378,8 +378,6 @@ export function fMarkdownCode(type: string, string: string | object): string {
|
|
378
378
|
string = stringifyYAML(typeof string === "string" ? JSON.parse(string) : string);
|
379
379
|
break;
|
380
380
|
case "ts":
|
381
|
-
string = "";
|
382
|
-
break;
|
383
381
|
default:
|
384
382
|
string = fJSON(string);
|
385
383
|
}
|
package/src/helpers/routes.ts
CHANGED
@@ -18,6 +18,10 @@ export function useActionRoutes(baseUrl: string): ListControlsRoutes {
|
|
18
18
|
const item = await request.get(`${baseUrl}/${target.id}/details`);
|
19
19
|
return storeObject(item);
|
20
20
|
},
|
21
|
+
async relation(target, relation) {
|
22
|
+
const item = await request.get(`${baseUrl}/${target.id}/relation/${relation}`);
|
23
|
+
return storeObject(item);
|
24
|
+
},
|
21
25
|
fieldOptions() {
|
22
26
|
return request.get(`${baseUrl}/field-options`);
|
23
27
|
},
|
package/src/types/controls.d.ts
CHANGED
@@ -30,6 +30,8 @@ export interface ListControlsRoutes {
|
|
30
30
|
|
31
31
|
detailsAndStore?(target: ActionTargetItem): Promise<ActionTargetItem>;
|
32
32
|
|
33
|
+
relation?(target: ActionTargetItem, relation: string): Promise<ActionTargetItem>;
|
34
|
+
|
33
35
|
more?(pager: ListControlsPagination): Promise<ActionTargetItem[]>;
|
34
36
|
|
35
37
|
fieldOptions?(filter?: AnyObject): Promise<AnyObject>;
|