@itrocks/menu 0.0.2 → 0.0.4
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/cjs/menu.d.ts +7 -4
- package/cjs/menu.html +1 -1
- package/cjs/menu.js +9 -5
- package/css/menu.css +1 -1
- package/package.json +3 -4
package/cjs/menu.d.ts
CHANGED
|
@@ -3,13 +3,16 @@ export declare class Menu {
|
|
|
3
3
|
constructor(config?: Record<string, Record<string, string>>);
|
|
4
4
|
loadConfig(config: Record<string, Record<string, string>>): void;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
items: MenuItem[];
|
|
6
|
+
declare class MenuCommons {
|
|
8
7
|
title: string;
|
|
9
8
|
constructor(title: string);
|
|
9
|
+
get class(): string;
|
|
10
|
+
}
|
|
11
|
+
export declare class MenuBlock extends MenuCommons {
|
|
12
|
+
items: MenuItem[];
|
|
10
13
|
}
|
|
11
|
-
export declare class MenuItem {
|
|
14
|
+
export declare class MenuItem extends MenuCommons {
|
|
12
15
|
link: string;
|
|
13
|
-
title: string;
|
|
14
16
|
constructor(title: string, link: string);
|
|
15
17
|
}
|
|
18
|
+
export {};
|
package/cjs/menu.html
CHANGED
package/cjs/menu.js
CHANGED
|
@@ -19,20 +19,24 @@ class Menu {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.Menu = Menu;
|
|
22
|
-
class
|
|
23
|
-
items = [];
|
|
22
|
+
class MenuCommons {
|
|
24
23
|
title;
|
|
25
24
|
constructor(title) {
|
|
26
25
|
this.title = title;
|
|
27
26
|
}
|
|
27
|
+
get class() {
|
|
28
|
+
return this.title.toLowerCase().replace(/[^a-z0-9]/g, '-');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class MenuBlock extends MenuCommons {
|
|
32
|
+
items = [];
|
|
28
33
|
}
|
|
29
34
|
exports.MenuBlock = MenuBlock;
|
|
30
|
-
class MenuItem {
|
|
35
|
+
class MenuItem extends MenuCommons {
|
|
31
36
|
link;
|
|
32
|
-
title;
|
|
33
37
|
constructor(title, link) {
|
|
38
|
+
super(title);
|
|
34
39
|
this.link = link;
|
|
35
|
-
this.title = title;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
exports.MenuItem = MenuItem;
|
package/css/menu.css
CHANGED
package/package.json
CHANGED
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
"name": "Baptiste Pillot",
|
|
4
4
|
"email": "baptiste@pillot.fr"
|
|
5
5
|
},
|
|
6
|
-
"dependencies": {
|
|
7
|
-
},
|
|
6
|
+
"dependencies": {},
|
|
8
7
|
"description": "A flexible and accessible customizable main menu component with sidebar layout",
|
|
9
8
|
"devDependencies": {
|
|
10
9
|
"sass": "^1.83",
|
|
11
|
-
"typescript": "~5.
|
|
10
|
+
"typescript": "~5.8"
|
|
12
11
|
},
|
|
13
12
|
"engines": {
|
|
14
13
|
"node": ">=18"
|
|
@@ -47,5 +46,5 @@
|
|
|
47
46
|
"build:css": "sass --no-source-map src:css"
|
|
48
47
|
},
|
|
49
48
|
"types": "./cjs/menu.d.ts",
|
|
50
|
-
"version": "0.0.
|
|
49
|
+
"version": "0.0.4"
|
|
51
50
|
}
|