@asup/context-menu 1.0.5 → 1.1.0
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 +19 -8
- package/dist/cjs/main.css.map +1 -1
- package/dist/context-menu.d.ts +11 -11
- package/dist/main.css.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,18 +30,29 @@ import { ContextMenuProvider, iMenuItem } from '@asup/context-menu';
|
|
|
30
30
|
|
|
31
31
|
<ContextMenuHandler
|
|
32
32
|
menuItems={[
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
{
|
|
34
|
+
label: 'Item 1',
|
|
35
|
+
action: () => {
|
|
36
|
+
console.log('Item 1 function run');
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Item 2',
|
|
41
|
+
action: () => console.log('Item 2 function run'),
|
|
42
|
+
group: [
|
|
43
|
+
{ label: 'Subitem 2.1', action: () => console.log('Item 2.1 function run') },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Item 3',
|
|
48
|
+
action: () => console.log('Item 3 function run'),
|
|
49
|
+
disabled: true,
|
|
38
50
|
},
|
|
39
|
-
{ label: 'Item 3', action: item3Function, disabeld: true },
|
|
40
|
-
...
|
|
41
51
|
]}
|
|
42
52
|
>
|
|
43
53
|
<Chilren
|
|
44
54
|
where the context menu is applied...
|
|
45
55
|
/>
|
|
46
|
-
</
|
|
56
|
+
</ContextMenuHandler>
|
|
57
|
+
|
|
47
58
|
```
|
package/dist/cjs/main.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;AAWA;;;;AAIA;;;;;;;;;;;;;AAaA;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA","sources":["src/components/ContextMenu.
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;AAWA;;;;AAIA;;;;;;;;;;;;;AAaA;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA","sources":["src/components/ContextMenu.css"],"sourcesContent":[".context-menu {\n position: absolute;\n visibility: hidden;\n border: 1px solid;\n border-color: rgb(17, 20, 24);\n border-radius: 8px;\n opacity: 1;\n background-color: rgb(251, 253, 246);\n z-index: 10000;\n}\n\n.context-menu.visible {\n visibility: inherit;\n}\n\n.context-menu-item {\n color: rgb(17, 20, 24);\n cursor: pointer;\n padding: 0 4px;\n min-width: 80px;\n height: 21px;\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n white-space: nowrap;\n}\n\n.context-menu-item.disabled {\n background-color: rgba(0, 0, 0, 0.2);\n cursor: not-allowed;\n}\n\n.context-menu-item:first-child {\n padding-top: 4px;\n}\n\n.context-menu-item:last-child {\n padding-bottom: 4px;\n}\n\n.context-menu-item:not(.disabled):hover {\n background-color: rgb(251, 233, 230);\n}\n\n.context-menu-item:hover:first-child {\n border-top-left-radius: 6px;\n border-top-right-radius: 6px;\n}\n\n.context-menu-item:hover:last-child {\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.context-menu-item .caret-holder {\n align-self: flex-end;\n}\n\n.context-menu-item .caret-holder .sub-menu {\n z-index: 1;\n position: relative;\n}\n\n.context-menu-item-label {\n flex-grow: 1;\n}\n"],"names":[],"version":3,"file":"main.css.map"}
|
package/dist/context-menu.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export interface iMenuItem {
|
|
2
|
-
label: string;
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
action?: (target?: Range | null) => void;
|
|
5
|
-
group?: iMenuItem[];
|
|
6
|
-
}
|
|
7
|
-
export const ContextMenuHandler: ({ children, menuItems, style, }: {
|
|
8
|
-
children: JSX.Element[] | JSX.Element;
|
|
9
|
-
menuItems: iMenuItem[];
|
|
10
|
-
style?: import("react").CSSProperties | undefined;
|
|
11
|
-
}) => JSX.Element;
|
|
1
|
+
export interface iMenuItem {
|
|
2
|
+
label: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
action?: (target?: Range | null) => void;
|
|
5
|
+
group?: iMenuItem[];
|
|
6
|
+
}
|
|
7
|
+
export const ContextMenuHandler: ({ children, menuItems, style, }: {
|
|
8
|
+
children: JSX.Element[] | JSX.Element;
|
|
9
|
+
menuItems: iMenuItem[];
|
|
10
|
+
style?: import("react").CSSProperties | undefined;
|
|
11
|
+
}) => JSX.Element;
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=context-menu.d.ts.map
|
package/dist/main.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;AAWA;;;;AAIA;;;;;;;;;;;;;AAaA;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA","sources":["src/components/ContextMenu.
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;AAWA;;;;AAIA;;;;;;;;;;;;;AAaA;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA","sources":["src/components/ContextMenu.css"],"sourcesContent":[".context-menu {\n position: absolute;\n visibility: hidden;\n border: 1px solid;\n border-color: rgb(17, 20, 24);\n border-radius: 8px;\n opacity: 1;\n background-color: rgb(251, 253, 246);\n z-index: 10000;\n}\n\n.context-menu.visible {\n visibility: inherit;\n}\n\n.context-menu-item {\n color: rgb(17, 20, 24);\n cursor: pointer;\n padding: 0 4px;\n min-width: 80px;\n height: 21px;\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n white-space: nowrap;\n}\n\n.context-menu-item.disabled {\n background-color: rgba(0, 0, 0, 0.2);\n cursor: not-allowed;\n}\n\n.context-menu-item:first-child {\n padding-top: 4px;\n}\n\n.context-menu-item:last-child {\n padding-bottom: 4px;\n}\n\n.context-menu-item:not(.disabled):hover {\n background-color: rgb(251, 233, 230);\n}\n\n.context-menu-item:hover:first-child {\n border-top-left-radius: 6px;\n border-top-right-radius: 6px;\n}\n\n.context-menu-item:hover:last-child {\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.context-menu-item .caret-holder {\n align-self: flex-end;\n}\n\n.context-menu-item .caret-holder .sub-menu {\n z-index: 1;\n position: relative;\n}\n\n.context-menu-item-label {\n flex-grow: 1;\n}\n"],"names":[],"version":3,"file":"main.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asup/context-menu",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "REACT Typescript Context menu component",
|
|
5
5
|
"author": "Paul Thomas <@PaulDThomas>",
|
|
6
6
|
"private": false,
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"process": "^0.11.10",
|
|
58
58
|
"ts-jest": "^29.0.3",
|
|
59
59
|
"ts-node": "^10.9.1",
|
|
60
|
-
"typescript": "^
|
|
60
|
+
"typescript": "^5.0.4"
|
|
61
61
|
},
|
|
62
62
|
"lint-staged": {
|
|
63
63
|
"**/*": "prettier --write --ignore-unknown"
|