quasar-ui-danx 0.4.22 → 0.4.23

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="text-xs font-bold">
4
- {{ label }}
4
+ <slot name="label">
5
+ {{ label }}
6
+ </slot>
5
7
  </div>
6
8
  <div :class="valueClass">
7
9
  <template v-if="url">
@@ -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
- const { name: routeName } = vueRouter.currentRoute.value;
443
- vueRouter.push({
444
- name: (Array.isArray(routeName) ? routeName[0] : routeName) || "home",
445
- params
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) {
@@ -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