quasar-ui-danx 0.4.22 → 0.4.24
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +1487 -1475
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +34 -34
- package/dist/danx.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Form/Fields/LabelValueBlock.vue +3 -1
- package/src/components/ActionTable/listControls.ts +16 -6
- package/src/helpers/formats.ts +12 -3
package/package.json
CHANGED
@@ -364,7 +364,7 @@ export function useListControls(name: string, options: ListControlsOptions): Act
|
|
364
364
|
|
365
365
|
const latestNextIndex = latestCallOnly("getNextItem", async () => {
|
366
366
|
if (!pagedItems.value?.data) return -1;
|
367
|
-
|
367
|
+
|
368
368
|
// Load the previous page if the offset is before index 0
|
369
369
|
if (nextIndex < 0) {
|
370
370
|
if (pagination.value.page > 1) {
|
@@ -439,11 +439,21 @@ export function useListControls(name: string, options: ListControlsOptions): Act
|
|
439
439
|
*/
|
440
440
|
function updateRouteParams(params: AnyObject) {
|
441
441
|
const vueRouter = getVueRouter();
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
442
|
+
let { name: routeName } = vueRouter.currentRoute.value;
|
443
|
+
routeName = Array.isArray(routeName) ? routeName[0] : routeName;
|
444
|
+
|
445
|
+
if (!routeName) {
|
446
|
+
console.error("No route name found for list controls", name);
|
447
|
+
return;
|
448
|
+
}
|
449
|
+
|
450
|
+
const newRoutePath = vueRouter.resolve({ name: routeName, params }).href;
|
451
|
+
const currentRoutePath = vueRouter.currentRoute.value.fullPath;
|
452
|
+
|
453
|
+
// Only update the route if the route is different (or the currentRoutePath is a child of the newRoutePath)
|
454
|
+
if (currentRoutePath !== newRoutePath && !currentRoutePath.startsWith(newRoutePath)) {
|
455
|
+
vueRouter.push({ name: routeName, params });
|
456
|
+
}
|
447
457
|
}
|
448
458
|
|
449
459
|
function setPanelFromRoute(params: RouteParams, meta: AnyObject) {
|
package/src/helpers/formats.ts
CHANGED
@@ -234,7 +234,13 @@ export function fShortSize(value: string | number) {
|
|
234
234
|
return Math.round(n / div) + " " + power.unit;
|
235
235
|
}
|
236
236
|
|
237
|
-
export function fBoolean(value?: boolean) {
|
237
|
+
export function fBoolean(value?: boolean | string | any) {
|
238
|
+
switch (value) {
|
239
|
+
case "Yes":
|
240
|
+
case "No":
|
241
|
+
return value;
|
242
|
+
}
|
243
|
+
|
238
244
|
return (value === undefined || value === null) ? "-" : (value ? "Yes" : "No");
|
239
245
|
}
|
240
246
|
|
@@ -370,7 +376,7 @@ export function parseMarkdownYAML(string: string): object | null | false {
|
|
370
376
|
* Parse a markdown formatted string and return the code block content
|
371
377
|
*/
|
372
378
|
export function parseMarkdownCode(string: string): string {
|
373
|
-
return string.replace(/^```[a-z0-9]{
|
379
|
+
return string.replace(/^```[a-z0-9]{0,6}\s/, "").replace(/```$/, "");
|
374
380
|
}
|
375
381
|
|
376
382
|
/**
|
@@ -378,6 +384,7 @@ export function parseMarkdownCode(string: string): string {
|
|
378
384
|
* ie: a valid JSON string with a ```json prefix and ``` postfix
|
379
385
|
*/
|
380
386
|
export function fMarkdownCode(type: string, string: string | object): string {
|
387
|
+
console.log("formatting", type, string);
|
381
388
|
if (typeof string === "object" || isJSON(string)) {
|
382
389
|
switch (type) {
|
383
390
|
case "yaml":
|
@@ -390,7 +397,9 @@ export function fMarkdownCode(type: string, string: string | object): string {
|
|
390
397
|
}
|
391
398
|
|
392
399
|
const regex = new RegExp(`\`\`\`${type}`, "g");
|
393
|
-
|
400
|
+
string = (string || "") as string;
|
401
|
+
if (!string.match(regex)) {
|
402
|
+
string = parseMarkdownCode(string as string);
|
394
403
|
return `\`\`\`${type}\n${string}\n\`\`\``;
|
395
404
|
}
|
396
405
|
|