@maropost-ui/liquidsky-ui 0.1.41 → 0.1.45
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/README.md +96 -54
- package/dist/components/AppDropdown/useDropdownData.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.css +5 -1
- package/dist/index.js +15237 -18655
- package/dist/index.js.map +1 -1
- package/dist/stories/helpers/vue-story-docs.d.ts +31 -0
- package/dist/stories/helpers/vue-story-docs.d.ts.map +1 -0
- package/dist/types/NotificationIconProps.d.ts +2 -0
- package/dist/types/NotificationIconProps.d.ts.map +1 -1
- package/dist/types/SlVueTreeNextProps.d.ts +84 -0
- package/dist/types/SlVueTreeNextProps.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/deduplicateObjects.d.ts +36 -0
- package/dist/utils/deduplicateObjects.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +15 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/vuetify.d.ts.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/vue3";
|
|
2
|
+
/**
|
|
3
|
+
* Overrides Docs → “Show code” for Vue CSF stories that use a custom `render()` template.
|
|
4
|
+
*
|
|
5
|
+
* Storybook’s Vue renderer only reflects the primary component + flattened args there, so
|
|
6
|
+
* wrappers (`v-dialog`, layout, triggers, `v-bind="args"`) disappear unless you set source explicitly.
|
|
7
|
+
*
|
|
8
|
+
* Spread onto a story (or merge `parameters` if the story already defines docs):
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const canvasTemplate = `
|
|
12
|
+
* <div>
|
|
13
|
+
* <MyWidget v-bind="args" />
|
|
14
|
+
* </div>
|
|
15
|
+
* `;
|
|
16
|
+
*
|
|
17
|
+
* export const Default: Story = {
|
|
18
|
+
* ...vueStoryDocs(vueSfcDocsSnippet({ template: `...`, script: `...` })),
|
|
19
|
+
* render: ...
|
|
20
|
+
* };
|
|
21
|
+
*/
|
|
22
|
+
export declare function vueStoryDocs(code: string): Pick<StoryObj, "parameters">;
|
|
23
|
+
/**
|
|
24
|
+
* Full SFC-shaped snippet for Docs → Show code (`<template>` + `<script setup>`).
|
|
25
|
+
* Use when readers need runnable context, not only the inner component tag.
|
|
26
|
+
*/
|
|
27
|
+
export declare function vueSfcDocsSnippet(parts: {
|
|
28
|
+
template: string;
|
|
29
|
+
script: string;
|
|
30
|
+
}): string;
|
|
31
|
+
//# sourceMappingURL=vue-story-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-story-docs.d.ts","sourceRoot":"","sources":["../../../src/stories/helpers/vue-story-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAWvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAET"}
|
|
@@ -11,6 +11,8 @@ export interface NotificationIconProps {
|
|
|
11
11
|
iconColor?: string;
|
|
12
12
|
/** Class to apply to the icon */
|
|
13
13
|
iconClass?: string;
|
|
14
|
+
/** Icon size */
|
|
15
|
+
iconSize?: string | number;
|
|
14
16
|
/** Badge props to apply to the badge */
|
|
15
17
|
badgeColor?: string;
|
|
16
18
|
/** Class to apply to the badge */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationIconProps.d.ts","sourceRoot":"","sources":["../../src/types/NotificationIconProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yBAAyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"NotificationIconProps.d.ts","sourceRoot":"","sources":["../../src/types/NotificationIconProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yBAAyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export declare enum MultiSelectKey {
|
|
3
|
+
CTRL = "ctrlKey",
|
|
4
|
+
META = "metaKey"
|
|
5
|
+
}
|
|
6
|
+
export interface NodeModel<T> {
|
|
7
|
+
title: string;
|
|
8
|
+
isLeaf?: boolean;
|
|
9
|
+
children?: NodeModel<T>[];
|
|
10
|
+
isExpanded?: boolean;
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
isDraggable?: boolean;
|
|
13
|
+
isSelectable?: boolean;
|
|
14
|
+
data?: T;
|
|
15
|
+
toBeDeleted?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TreeNode<T> extends NodeModel<T> {
|
|
18
|
+
isVisible?: boolean;
|
|
19
|
+
isFirstChild: boolean;
|
|
20
|
+
isLastChild: boolean;
|
|
21
|
+
ind: number;
|
|
22
|
+
level: number;
|
|
23
|
+
path: number[];
|
|
24
|
+
pathStr: string;
|
|
25
|
+
children: TreeNode<T>[];
|
|
26
|
+
}
|
|
27
|
+
export interface SlVueTreeNodeSlotProps<T> {
|
|
28
|
+
node: TreeNode<T>;
|
|
29
|
+
}
|
|
30
|
+
export interface CursorPosition<T> {
|
|
31
|
+
node: TreeNode<T>;
|
|
32
|
+
placement: 'before' | 'inside' | 'after';
|
|
33
|
+
}
|
|
34
|
+
export interface VueData<T> {
|
|
35
|
+
rootCursorPosition: CursorPosition<T>;
|
|
36
|
+
rootDraggingNode: TreeNode<T>;
|
|
37
|
+
}
|
|
38
|
+
export interface SlVueTreeProps<T> {
|
|
39
|
+
modelValue?: NodeModel<T>[];
|
|
40
|
+
edgeSize?: number;
|
|
41
|
+
allowMultiselect?: boolean;
|
|
42
|
+
showBranches?: boolean;
|
|
43
|
+
level?: number;
|
|
44
|
+
parentInd?: number;
|
|
45
|
+
parentContext?: Context<T>;
|
|
46
|
+
rootContext?: any;
|
|
47
|
+
allowToggleBranch?: boolean;
|
|
48
|
+
multiselectKey?: MultiSelectKey[];
|
|
49
|
+
scrollAreaHeight?: number;
|
|
50
|
+
maxScrollSpeed?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface Context<T> {
|
|
53
|
+
getRoot: () => Context<T>;
|
|
54
|
+
setCursorPosition: (pos: CursorPosition<T> | null) => void;
|
|
55
|
+
currentNodes: ComputedRef<TreeNode<T>[]>;
|
|
56
|
+
cursorPosition: ComputedRef<CursorPosition<T>>;
|
|
57
|
+
emit: (event: any, ...args: any[]) => void;
|
|
58
|
+
ref: any;
|
|
59
|
+
onNodeMousedownHandler: (event: MouseEvent | TouchEvent, node: TreeNode<T>) => void;
|
|
60
|
+
onNodeMouseupHandler: (event: MouseEvent | TouchEvent, node: TreeNode<T> | null) => void;
|
|
61
|
+
onMousemoveHandler: (event: MouseEvent | TouchEvent | null) => void;
|
|
62
|
+
getCursorPositionFromCoords: (x: number, y: number) => {
|
|
63
|
+
node: TreeNode<T> | null;
|
|
64
|
+
placement: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
updateNode: (val: {
|
|
67
|
+
path: number[];
|
|
68
|
+
patch: Partial<TreeNode<T>>;
|
|
69
|
+
}) => void;
|
|
70
|
+
getNode: (path: number[], nodeModel?: NodeModel<T> | null, siblings?: NodeModel<T>[] | null, visible?: boolean | null) => TreeNode<T> | null;
|
|
71
|
+
traverse: (callback: (node: TreeNode<T>, nodeModel: NodeModel<T>, siblings: NodeModel<T>[]) => boolean | void, nodeModels?: NodeModel<T>[] | null, parentPath?: number[]) => NodeModel<T>[] | boolean;
|
|
72
|
+
select: (path: number[], addToSelection?: boolean, event?: MouseEvent | TouchEvent | null) => TreeNode<T> | null;
|
|
73
|
+
getNodeEl: (path: number[]) => HTMLElement;
|
|
74
|
+
getFirstNode: () => TreeNode<T> | null;
|
|
75
|
+
getLastNode: () => TreeNode<T>;
|
|
76
|
+
getNextNode: (path: number[], filter?: (node: TreeNode<T>) => boolean) => TreeNode<T>;
|
|
77
|
+
getPrevNode: (path: number[], filter?: (node: TreeNode<T>) => boolean) => TreeNode<T> | null;
|
|
78
|
+
getSelected: () => TreeNode<T>[];
|
|
79
|
+
insert: (cursorPosition: CursorPosition<T>, nodeModel: NodeModel<T> | NodeModel<T>[]) => void;
|
|
80
|
+
remove: (paths: number[][]) => void;
|
|
81
|
+
rootCursorPosition: Ref<CursorPosition<T> | null>;
|
|
82
|
+
selectionSize: ComputedRef<number>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=SlVueTreeNextProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlVueTreeNextProps.d.ts","sourceRoot":"","sources":["../../src/types/SlVueTreeNextProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEtC,oBAAY,cAAc;IACtB,IAAI,YAAY;IAChB,IAAI,YAAY;CACnB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO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CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAA;IACrF,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IAC5F,WAAW,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAChC,MAAM,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAA;IAC7F,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAA;IACnC,kBAAkB,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACjD,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACrC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges and deduplicates multiple arrays of objects structurally, without requiring a unique ID or key.
|
|
3
|
+
*
|
|
4
|
+
* Objects are compared deterministically by sorting their keys alphabetically. This ensures that
|
|
5
|
+
* objects with identical properties but different key orderings are accurately identified as duplicates.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of elements in the array (defaults to `any`).
|
|
8
|
+
* @param {...any[][]} arrays - One or more arrays to be flattened and deduplicated.
|
|
9
|
+
* @returns {T[]} A new array containing only structurally unique items, cast to the expected type.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // 1. Basic usage with mismatched key order
|
|
13
|
+
* const array1 = [{ role: 'admin', active: true }];
|
|
14
|
+
* const array2 = [{ active: true, role: 'admin' }, { role: 'user', active: false }];
|
|
15
|
+
*
|
|
16
|
+
* const unique = deduplicateObjects(array1, array2);
|
|
17
|
+
* // Output: [{ role: 'admin', active: true }, { role: 'user', active: false }]
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // 2. Handling nested objects and internal arrays
|
|
21
|
+
* const groupA = [{ user: { id: 1, tags: ['a', 'b'] } }];
|
|
22
|
+
* const groupB = [{ user: { tags: ['a', 'b'], id: 1 } }]; // nested keys reversed
|
|
23
|
+
*
|
|
24
|
+
* const uniqueNested = deduplicateObjects(groupA, groupB);
|
|
25
|
+
* // Output: [{ user: { id: 1, tags: ['a', 'b'] } }]
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // 3. Usage inside generic Vue/React hooks or composables
|
|
29
|
+
* function useDropdownData<T>(items: Ref<T[]>, initialData: T[]) {
|
|
30
|
+
* // Perfectly safe to call with unconstrained generic types
|
|
31
|
+
* const uniqueItems = deduplicateObjects<T>(items.value, initialData);
|
|
32
|
+
* return uniqueItems;
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
export declare const deduplicateObjects: <T = any>(...arrays: any[][]) => T[];
|
|
36
|
+
//# sourceMappingURL=deduplicateObjects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplicateObjects.d.ts","sourceRoot":"","sources":["../../src/utils/deduplicateObjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,GAAG,GAAG,EAAE,GAAG,QAAQ,GAAG,EAAE,EAAE,KAAG,CAAC,EA6BjE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function to deeply merge two objects
|
|
3
|
+
* Keeps keys from source if they don't exist in target. Otherwise, it overwrites the target value with the source value.
|
|
4
|
+
* @param target The target object
|
|
5
|
+
* @param source The source object
|
|
6
|
+
* @returns The merged object
|
|
7
|
+
*/
|
|
8
|
+
export declare const deepMerge: (target: any, source: any) => any;
|
|
9
|
+
/**
|
|
10
|
+
* Function to check if a value is an object
|
|
11
|
+
* @param item The value to check
|
|
12
|
+
* @returns Whether the value is an object
|
|
13
|
+
*/
|
|
14
|
+
export declare const isObject: (item: any) => any;
|
|
15
|
+
//# sourceMappingURL=deepMerge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/utils/deepMerge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,GAAG,EAAE,QAAQ,GAAG,QAejD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,QAEjC,CAAA"}
|
package/dist/vuetify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vuetify.d.ts","sourceRoot":"","sources":["../src/vuetify.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;;;;;CAKlB,CAAA;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAclB,CAAA;AACD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFpB,CAAA;AAGD,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,GAAQ;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vuetify.d.ts","sourceRoot":"","sources":["../src/vuetify.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;;;;;CAKlB,CAAA;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAclB,CAAA;AACD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFpB,CAAA;AAGD,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,GAAQ;;;;;;;;;;;;;;;;;;;yBAiC+k1G,GAAI;;;;;;;;;;;uBAAjp0G,CAAC;;;;;;wBAAmh1G,CAAC;;;;;;;uDAAoY,CAAC;;;;;;;;;;;;;;;;;;;;;;6DAAu5C,CAAC;wDAAyF,CAAC;wCAAuF,CAAC,4CAA4C,CAAC;mDAA2G,CAAC,6CAA6C,CAAC;;;;;;;;;;;kBAAsnB,CAAC;;;;EAF3x7G"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maropost-ui/liquidsky-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
4
4
|
"description": "Shared UI components, composables, and utils for Vue + Vuetify",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
"date-fns-tz": "^3.2.0",
|
|
46
46
|
"lz-string": "^1.5.0",
|
|
47
47
|
"vue": "^3.5.11",
|
|
48
|
-
"vue-router": "^4.4.5"
|
|
49
|
-
"vuetify": "^3.7.13"
|
|
48
|
+
"vue-router": "^4.4.5"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@mdi/font": "^7.4.47",
|