@axinom/mosaic-ui 0.51.0-rc.11 → 0.51.0-rc.12
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/dist/components/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts +2 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.model.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroup.d.ts.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Explorer/QuickEdit/useQuickEdit.tsx +1 -1
- package/src/components/PageHeader/PageHeader.scss +0 -1
- package/src/components/PageHeader/PageHeader.tsx +3 -4
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.model.ts +1 -0
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.scss +7 -0
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.tsx +1 -0
- package/src/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroup.tsx +10 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.51.0-rc.
|
|
3
|
+
"version": "0.51.0-rc.12",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build-storybook": "storybook build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@axinom/mosaic-core": "^0.4.24-rc.
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.24-rc.12",
|
|
36
36
|
"@faker-js/faker": "^7.4.0",
|
|
37
37
|
"@geoffcox/react-splitter": "^2.1.2",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "0b88f693bb9e9b890a37c4bc976c980a43c9f197"
|
|
110
110
|
}
|
|
@@ -138,7 +138,7 @@ export const useQuickEdit = <T extends Data>({
|
|
|
138
138
|
actionType:
|
|
139
139
|
isQuickEditMode &&
|
|
140
140
|
currentRegistration?.component === registration.component
|
|
141
|
-
? PageHeaderActionType.
|
|
141
|
+
? PageHeaderActionType.Hightlight
|
|
142
142
|
: PageHeaderActionType.Context,
|
|
143
143
|
onClick: async () => {
|
|
144
144
|
await saveCallbackRef.current?.();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { useTabTitle } from '../../hooks/useTabTitle/useTabTitle';
|
|
4
4
|
import { PageHeaderProps } from './PageHeader.model';
|
|
5
5
|
import classes from './PageHeader.scss';
|
|
@@ -31,10 +31,9 @@ export const PageHeader: React.FC<PageHeaderProps> = ({
|
|
|
31
31
|
useTabTitle(title, setTabTitle);
|
|
32
32
|
const { width, ref } = useElementWidthObserver<HTMLDivElement>();
|
|
33
33
|
|
|
34
|
-
const [availableActionSpace, setAvailableActionSpace] =
|
|
35
|
-
React.useState<number>(0);
|
|
34
|
+
const [availableActionSpace, setAvailableActionSpace] = useState<number>(0);
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
useEffect(() => {
|
|
38
37
|
// Use up to 75% of the container width for actions
|
|
39
38
|
const maxActionsWidth = width * 0.75;
|
|
40
39
|
|
|
@@ -88,6 +88,13 @@
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
&.highlight {
|
|
92
|
+
background-color: var(
|
|
93
|
+
--page-header-action-context-hover-background-color,
|
|
94
|
+
$page-header-action-context-hover-background-color
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
91
98
|
&.active {
|
|
92
99
|
color: var(
|
|
93
100
|
--page-header-action-context-background-color,
|
|
@@ -119,6 +119,7 @@ const PageHeaderJSAction: React.FC<PageHeaderJsActionProps> = ({
|
|
|
119
119
|
{
|
|
120
120
|
[classes.context]: actionType === PageHeaderActionType.Context,
|
|
121
121
|
[classes.active]: actionType === PageHeaderActionType.Active,
|
|
122
|
+
[classes.highlight]: actionType === PageHeaderActionType.Hightlight,
|
|
122
123
|
[classes.hasConfirm]: confirmation,
|
|
123
124
|
},
|
|
124
125
|
'page-header-action-container',
|
|
@@ -112,10 +112,14 @@ export const PageHeaderActionsGroup: React.FC<PageHeaderActionsGroupProps> = ({
|
|
|
112
112
|
}
|
|
113
113
|
}, [isConfirmOpen, isMouseOverMore, moreCollapse, moreExpanded]);
|
|
114
114
|
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const showMore = actions.length > availableActionSpace && actions.length > 1;
|
|
116
|
+
const visibleActions = showMore
|
|
117
|
+
? Math.max(availableActionSpace, 1)
|
|
118
|
+
: actions.length;
|
|
119
|
+
|
|
120
|
+
const actionsSlice = showMore
|
|
121
|
+
? Math.max(availableActionSpace - 1, 0)
|
|
122
|
+
: actions.length;
|
|
119
123
|
|
|
120
124
|
return (
|
|
121
125
|
<div
|
|
@@ -150,9 +154,7 @@ export const PageHeaderActionsGroup: React.FC<PageHeaderActionsGroupProps> = ({
|
|
|
150
154
|
/>
|
|
151
155
|
<div
|
|
152
156
|
style={{
|
|
153
|
-
maxWidth: isExpanded
|
|
154
|
-
? `${Math.min(availableActionSpace, actions.length) * 121}px`
|
|
155
|
-
: `0px`,
|
|
157
|
+
maxWidth: isExpanded ? `${visibleActions * 121}px` : `0px`,
|
|
156
158
|
opacity: isExpanded ? 1 : 0,
|
|
157
159
|
}}
|
|
158
160
|
className={classes.actions}
|
|
@@ -178,7 +180,7 @@ export const PageHeaderActionsGroup: React.FC<PageHeaderActionsGroupProps> = ({
|
|
|
178
180
|
<PageHeaderAction key={idx} {...action} />
|
|
179
181
|
),
|
|
180
182
|
)}
|
|
181
|
-
{
|
|
183
|
+
{showMore && (
|
|
182
184
|
<div onMouseEnter={() => setIsMouseOverMore(true)}>
|
|
183
185
|
<PageHeaderAction
|
|
184
186
|
label="More"
|