@nu-art/work-hub-frontend 0.400.7 → 0.400.8
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/_core/work-hub-item.d.ts +1 -0
- package/_core/work-hub-item.js +3 -0
- package/_ui/Component_WorkHubActionMenu/Component_WorkHubActionMenu.d.ts +2 -0
- package/_ui/Component_WorkHubActionMenu/Component_WorkHubActionMenu.js +16 -1
- package/_ui/Component_WorkHubActionMenu/Component_WorkHubActionMenu.scss +76 -2
- package/_ui/Component_WorkHubActionMenu/types.d.ts +2 -1
- package/package.json +6 -6
package/_core/work-hub-item.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class WorkHubItem<Args extends any = void> extends Logger {
|
|
|
15
15
|
setModulesToAwait: (modules: ModuleFE_BaseDB<any>[]) => this;
|
|
16
16
|
setCustomMenuActionsResolver: (resolver: (tab: WorkHubTab) => WorkHubItem_MenuSection[]) => this;
|
|
17
17
|
openTab: (id: string, label: string, args: Args) => void;
|
|
18
|
+
closeTab: (tabId: string) => void;
|
|
18
19
|
openTabMenu: (e: MouseEvent<HTMLDivElement>, tab: WorkHubTab) => void;
|
|
19
20
|
updateArgs: (tabId: string, args: Partial<Args>) => void;
|
|
20
21
|
}
|
package/_core/work-hub-item.js
CHANGED
|
@@ -41,6 +41,9 @@ export class WorkHubItem extends Logger {
|
|
|
41
41
|
renderArgs: args,
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
+
closeTab = (tabId) => {
|
|
45
|
+
ModuleFE_WorkHub.tabs.remove(tabId);
|
|
46
|
+
};
|
|
44
47
|
openTabMenu = (e, tab) => {
|
|
45
48
|
const customSections = this.customMenuActionsResolver(tab);
|
|
46
49
|
Component_WorkHubActionMenu.show(e, {
|
|
@@ -14,5 +14,7 @@ export declare class Component_WorkHubActionMenu extends ComponentSync<Props> {
|
|
|
14
14
|
render(): import("react/jsx-runtime").JSX.Element[];
|
|
15
15
|
private render_Section;
|
|
16
16
|
private render_Action;
|
|
17
|
+
private render_ActionButton;
|
|
18
|
+
private render_ActionWithInner;
|
|
17
19
|
}
|
|
18
20
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, ComponentSync, LL_V_L, ModuleFE_MouseInteractivity, mouseInteractivity_PopUp } from '@nu-art/thunderstorm-frontend';
|
|
2
|
+
import { _className, Button, ComponentSync, LL_H_C, LL_V_L, ModuleFE_MouseInteractivity, mouseInteractivity_PopUp } from '@nu-art/thunderstorm-frontend';
|
|
3
3
|
import { ModuleFE_WorkHub } from '../../_module/index.js';
|
|
4
4
|
import './Component_WorkHubActionMenu.scss';
|
|
5
|
+
import { TS_Icons } from '@nu-art/ts-styles';
|
|
6
|
+
import { generateHex } from '@nu-art/ts-common';
|
|
5
7
|
export class Component_WorkHubActionMenu extends ComponentSync {
|
|
6
8
|
// ######################## Static ########################
|
|
7
9
|
static show = (e, props) => {
|
|
@@ -39,9 +41,22 @@ export class Component_WorkHubActionMenu extends ComponentSync {
|
|
|
39
41
|
return _jsxs(LL_V_L, { className: 'action-menu__section', children: [!!section.label?.length && _jsx("div", { className: 'action-menu__section-label', children: section.label }), section.actions.map(this.render_Action)] }, index);
|
|
40
42
|
};
|
|
41
43
|
render_Action = (action, index) => {
|
|
44
|
+
if (action.action)
|
|
45
|
+
return this.render_ActionButton(action, index);
|
|
46
|
+
return this.render_ActionWithInner(action, index);
|
|
47
|
+
};
|
|
48
|
+
render_ActionButton = (action, index) => {
|
|
42
49
|
return _jsx(Button, { variant: 'work-hub-menu-action', disabled: action.disabled, onClick: async () => {
|
|
43
50
|
await action.action();
|
|
44
51
|
this.closeMenu();
|
|
45
52
|
}, children: action.label }, index);
|
|
46
53
|
};
|
|
54
|
+
render_ActionWithInner = (action, index) => {
|
|
55
|
+
const hasInner = !!action.innerActions?.length;
|
|
56
|
+
const renderInner = hasInner && !action.disabled;
|
|
57
|
+
const anchorId = generateHex(4);
|
|
58
|
+
const style = { '--anchor-id': anchorId };
|
|
59
|
+
const className = _className('work-hub-menu-action-with-inner', action.disabled && 'disabled');
|
|
60
|
+
return _jsxs("div", { className: className, style: style, children: [_jsxs(LL_H_C, { className: 'work-hub-menu-action', children: [_jsx("div", { className: 'work-hub-menu-action__label', children: action.label }), hasInner && _jsx(TS_Icons.treeCollapse.component, {})] }), renderInner && _jsx(LL_V_L, { className: 'work-hub-menu-action__inner-actions', children: action.innerActions?.map(this.render_Action) })] }, index);
|
|
61
|
+
};
|
|
47
62
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
box-shadow: 0 0 15px 0 #BAB8E6;
|
|
7
7
|
padding: 4px;
|
|
8
8
|
border-radius: 10px;
|
|
9
|
-
overflow: hidden;
|
|
10
9
|
|
|
11
10
|
.ts-button[data-variant='work-hub-menu-action'] {
|
|
12
11
|
--ts-button--content-color: #{S.black(1)};
|
|
@@ -37,13 +36,88 @@
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
|
|
39
|
+
.work-hub-menu-action-with-inner {
|
|
40
|
+
height: 24px;
|
|
41
|
+
width: 100%;
|
|
42
|
+
position: relative;
|
|
43
|
+
|
|
44
|
+
& > .work-hub-menu-action {
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 100%;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
padding-left: 6px;
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
transition: background 300ms ease-out;
|
|
52
|
+
|
|
53
|
+
.work-hub-menu-action__label {
|
|
54
|
+
color: S.black(1);
|
|
55
|
+
font: {
|
|
56
|
+
size: 14px;
|
|
57
|
+
weight: 500;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.icon--wrapper {
|
|
62
|
+
@include S.color-svg(S.black(1));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& > .work-hub-menu-action__inner-actions {
|
|
67
|
+
width: 300px;
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: -4px;
|
|
70
|
+
right: calc(-100% - 10px);
|
|
71
|
+
border: 1px solid #333;
|
|
72
|
+
box-shadow: 0 0 15px 0 #BAB8E6;
|
|
73
|
+
background: #fff;
|
|
74
|
+
padding: 4px;
|
|
75
|
+
gap: 4px;
|
|
76
|
+
border-radius: 6px;
|
|
77
|
+
opacity: 0;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
& > .work-hub-menu-action {
|
|
83
|
+
background: S.dark-blue(6);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
& > .work-hub-menu-action__inner-actions {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
pointer-events: unset;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.disabled {
|
|
93
|
+
& > .work-hub-menu-action {
|
|
94
|
+
background: transparent;
|
|
95
|
+
|
|
96
|
+
.work-hub-menu-action__label {
|
|
97
|
+
color: S.black(5);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.icon--wrapper {
|
|
101
|
+
@include S.color-svg(S.black(5));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
40
107
|
.action-menu__section {
|
|
41
108
|
width: 100%;
|
|
42
109
|
padding: 4px 0;
|
|
43
110
|
gap: 4px;
|
|
44
111
|
|
|
45
112
|
.action-menu__section-label {
|
|
46
|
-
|
|
113
|
+
color: S.black(1);
|
|
114
|
+
height: 24px;
|
|
115
|
+
padding: 0 6px;
|
|
116
|
+
line-height: 24px;
|
|
117
|
+
font: {
|
|
118
|
+
size: 12px;
|
|
119
|
+
weight: 800;
|
|
120
|
+
}
|
|
47
121
|
}
|
|
48
122
|
|
|
49
123
|
&:not(:last-child) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type WorkHubItem_MenuAction = {
|
|
2
2
|
label: string;
|
|
3
|
-
action
|
|
3
|
+
action?: () => (Promise<void> | void);
|
|
4
4
|
disabled?: boolean;
|
|
5
|
+
innerActions?: WorkHubItem_MenuAction[];
|
|
5
6
|
};
|
|
6
7
|
export type WorkHubItem_MenuSection = {
|
|
7
8
|
label?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/work-hub-frontend",
|
|
3
|
-
"version": "0.400.
|
|
3
|
+
"version": "0.400.8",
|
|
4
4
|
"description": "TS WorkHub Frontend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TacB0sS",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"linkDirectory": true
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@nu-art/work-hub-shared": "0.400.
|
|
25
|
-
"@nu-art/ts-common": "0.400.
|
|
26
|
-
"@nu-art/ts-styles": "0.400.
|
|
27
|
-
"@nu-art/thunderstorm-shared": "0.400.
|
|
28
|
-
"@nu-art/thunderstorm-frontend": "0.400.
|
|
24
|
+
"@nu-art/work-hub-shared": "0.400.8",
|
|
25
|
+
"@nu-art/ts-common": "0.400.8",
|
|
26
|
+
"@nu-art/ts-styles": "0.400.8",
|
|
27
|
+
"@nu-art/thunderstorm-shared": "0.400.8",
|
|
28
|
+
"@nu-art/thunderstorm-frontend": "0.400.8",
|
|
29
29
|
"react": "^18.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|