@record-evolution/widget-navbutton 1.0.1 → 1.0.2
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent widget-navbutton following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "widget-navbutton",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/widget-navbutton.js",
|
|
9
9
|
"types": "dist/src/widget-navbutton.d.ts",
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* and run json-schema-to-typescript to regenerate this file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type Label = string;
|
|
9
9
|
/**
|
|
10
|
-
* Navigation to perform on
|
|
10
|
+
* Navigation to perform on button click. Leave blank to perform automatic back navigation. Example: If you are at route /my/route/asset then 'settings/profile' routes to '/my/route/settings/profile'.
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
12
|
+
export type Navigation = string;
|
|
13
13
|
/**
|
|
14
14
|
* Font size in pixels
|
|
15
15
|
*/
|
|
16
16
|
export type FontSize = number;
|
|
17
17
|
|
|
18
18
|
export interface InputData {
|
|
19
|
-
title?:
|
|
20
|
-
route?:
|
|
19
|
+
title?: Label;
|
|
20
|
+
route?: Navigation;
|
|
21
21
|
style?: ButtonStyle;
|
|
22
22
|
[k: string]: unknown;
|
|
23
23
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
5
|
"title": {
|
|
6
|
-
"title": "
|
|
6
|
+
"title": "Label",
|
|
7
7
|
"order": 1,
|
|
8
8
|
"type": "string"
|
|
9
9
|
},
|
|
10
10
|
"route": {
|
|
11
|
-
"title": "
|
|
11
|
+
"title": "Navigation",
|
|
12
12
|
"order": 2,
|
|
13
|
-
"description": "Navigation to perform on
|
|
13
|
+
"description": "Navigation to perform on button click. Leave blank to perform automatic back navigation. Example: If you are at route /my/route/asset then 'settings/profile' routes to '/my/route/settings/profile'.",
|
|
14
14
|
"type": "string"
|
|
15
15
|
},
|
|
16
16
|
"style": {
|
package/src/widget-navbutton.ts
CHANGED
|
@@ -42,13 +42,13 @@ export class WidgetNavbutton extends LitElement {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
handleNavItemClick(route?: string) {
|
|
45
|
-
console.log('Navigating to:', route, this.route)
|
|
46
45
|
let goto: string
|
|
47
46
|
if (this.inputData?.route === '') {
|
|
48
|
-
goto = this.route?.split('/').filter(Boolean).slice(0, -1).join('/') || '/'
|
|
47
|
+
goto = '/' + this.route?.split('/').filter(Boolean).slice(0, -1).join('/') + '/' || '/'
|
|
49
48
|
} else {
|
|
50
49
|
goto = this.inputData?.route || '/'
|
|
51
50
|
}
|
|
51
|
+
console.log('Navigating to:', route, this.route, { goto })
|
|
52
52
|
const event = new CustomEvent('nav-submit', {
|
|
53
53
|
detail: { path: goto },
|
|
54
54
|
bubbles: true,
|