@headless-adminapp/fluent 1.4.16 → 1.4.17
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/Insights/WidgetChartContainer.d.ts +3 -1
- package/Insights/WidgetChartContainer.js +1 -1
- package/Insights/WidgetDataGridContainer.js +7 -19
- package/Insights/WidgetSection.d.ts +5 -1
- package/Insights/WidgetSection.js +5 -3
- package/Insights/WidgetTitleBar.d.ts +2 -1
- package/Insights/WidgetTitleBar.js +2 -2
- package/package.json +2 -2
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { CommandItemState } from '@headless-adminapp/app/command';
|
|
2
2
|
import { ChartInfo } from '@headless-adminapp/core/experience/insights';
|
|
3
|
-
import { FC } from 'react';
|
|
3
|
+
import { FC, ReactNode } from 'react';
|
|
4
4
|
export type ChartComponentProps = {
|
|
5
5
|
dataset: any[];
|
|
6
6
|
chartInfo: any;
|
|
7
7
|
};
|
|
8
8
|
interface WidgetChartContainerProps {
|
|
9
9
|
title: string;
|
|
10
|
+
subtitle?: string;
|
|
10
11
|
commands?: CommandItemState[][];
|
|
11
12
|
dataset: any[];
|
|
12
13
|
chartInfo: ChartInfo;
|
|
13
14
|
isPending?: boolean;
|
|
14
15
|
isFetching?: boolean;
|
|
16
|
+
rightContent?: ReactNode;
|
|
15
17
|
}
|
|
16
18
|
export declare const WidgetChart: FC<WidgetChartContainerProps>;
|
|
17
19
|
export {};
|
|
@@ -68,7 +68,7 @@ function getChartComponent(chart) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
const WidgetChart = (props) => {
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(WidgetSection_1.WidgetSection, { children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: props.title, commands: props.commands }), (0, jsx_runtime_1.jsx)(WidgetChartBody, { dataset: props.dataset, chartInfo: props.chartInfo, isFetching: props.isFetching, isPending: props.isPending })] }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(WidgetSection_1.WidgetSection, { children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: props.title, subtitle: props.subtitle, commands: props.commands, rightContent: props.rightContent }), (0, jsx_runtime_1.jsx)(WidgetChartBody, { dataset: props.dataset, chartInfo: props.chartInfo, isFetching: props.isFetching, isPending: props.isPending })] }));
|
|
72
72
|
};
|
|
73
73
|
exports.WidgetChart = WidgetChart;
|
|
74
74
|
const WidgetChartBody = ({ isFetching, isPending, chartInfo, dataset, }) => {
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WidgetDataGridContainer = WidgetDataGridContainer;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_components_1 = require("@fluentui/react-components");
|
|
6
5
|
const command_1 = require("@headless-adminapp/app/command");
|
|
7
6
|
const hooks_1 = require("@headless-adminapp/app/command/hooks");
|
|
8
7
|
const DataGridProvider_1 = require("@headless-adminapp/app/datagrid/DataGridProvider");
|
|
9
8
|
const hooks_2 = require("@headless-adminapp/app/datagrid/hooks");
|
|
10
9
|
const hooks_3 = require("@headless-adminapp/app/metadata/hooks");
|
|
10
|
+
const BodyLoading_1 = require("../components/BodyLoading");
|
|
11
11
|
const DataGrid_1 = require("../DataGrid");
|
|
12
|
+
const WidgetSection_1 = require("./WidgetSection");
|
|
12
13
|
const WidgetTitleBar_1 = require("./WidgetTitleBar");
|
|
13
14
|
/*** @deprecated Need refactoring */
|
|
14
15
|
function WidgetDataGridContainer({ logicalName, maxRecords, filter, commands, title, view, viewId, allowContextMenu, }) {
|
|
@@ -17,23 +18,15 @@ function WidgetDataGridContainer({ logicalName, maxRecords, filter, commands, ti
|
|
|
17
18
|
const { commands: contextCommands } = (0, hooks_3.useExperienceViewCommands)(logicalName);
|
|
18
19
|
view ??= _view;
|
|
19
20
|
if (!view && isLoadingView) {
|
|
20
|
-
return (0, jsx_runtime_1.jsx)("div", { children:
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(WidgetSection_1.WidgetSection, { children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, position: 'relative' }, children: (0, jsx_runtime_1.jsx)(BodyLoading_1.BodyLoading, {}) }) }));
|
|
21
22
|
}
|
|
22
23
|
if (!view) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "View not found" });
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(WidgetSection_1.WidgetSection, { children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, position: 'relative' }, children: "View not found" }) }));
|
|
24
25
|
}
|
|
25
26
|
if (!schema) {
|
|
26
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Schema not found" });
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(WidgetSection_1.WidgetSection, { children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, position: 'relative' }, children: "Schema not found" }) }));
|
|
27
28
|
}
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
29
|
-
display: 'flex',
|
|
30
|
-
flex: 1,
|
|
31
|
-
background: react_components_1.tokens.colorNeutralBackground1,
|
|
32
|
-
boxShadow: react_components_1.tokens.shadow2,
|
|
33
|
-
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
34
|
-
// padding: tokens.spacingHorizontalM,
|
|
35
|
-
flexDirection: 'column',
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: [], onChangeView: () => { }, commands: contextCommands, allowViewSelection: false, maxRecords: maxRecords, extraFilter: filter, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer, { title: title, commands: commands, allowContextMenu: allowContextMenu }) }) }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: [], onChangeView: () => { }, commands: contextCommands, allowViewSelection: false, maxRecords: maxRecords, extraFilter: filter, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer, { title: title, commands: commands, allowContextMenu: allowContextMenu }) }));
|
|
37
30
|
}
|
|
38
31
|
const FormSubgridContainer = ({ title, commands, allowContextMenu, }) => {
|
|
39
32
|
const baseCommandHandleContext = (0, hooks_1.useBaseCommandHandlerContext)();
|
|
@@ -42,12 +35,7 @@ const FormSubgridContainer = ({ title, commands, allowContextMenu, }) => {
|
|
|
42
35
|
...baseCommandHandleContext,
|
|
43
36
|
primaryControl,
|
|
44
37
|
});
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
46
|
-
display: 'flex',
|
|
47
|
-
flex: 1,
|
|
48
|
-
flexDirection: 'column',
|
|
49
|
-
overflow: 'hidden',
|
|
50
|
-
}, children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: title, commands: transformedCommands }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(WidgetSection_1.WidgetSection, { children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: title, commands: transformedCommands }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
51
39
|
flex: 1,
|
|
52
40
|
display: 'flex',
|
|
53
41
|
flexDirection: 'column',
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
interface WidgetSectionProps {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
}
|
|
5
|
+
export declare const WidgetSection: FC<PropsWithChildren<WidgetSectionProps>>;
|
|
6
|
+
export {};
|
|
@@ -3,15 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WidgetSection = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
const WidgetSection = ({ children }) => {
|
|
6
|
+
const WidgetSection = ({ children, style, }) => {
|
|
7
7
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
8
8
|
display: 'flex',
|
|
9
9
|
flex: 1,
|
|
10
|
+
flexDirection: 'column',
|
|
10
11
|
background: react_components_1.tokens.colorNeutralBackground1,
|
|
11
|
-
|
|
12
|
+
...style,
|
|
12
13
|
borderRadius: react_components_1.tokens.borderRadiusXLarge,
|
|
13
|
-
flexDirection: 'column',
|
|
14
14
|
overflow: 'hidden',
|
|
15
|
+
boxShadow: 'none',
|
|
16
|
+
position: 'relative',
|
|
15
17
|
}, children: children }));
|
|
16
18
|
};
|
|
17
19
|
exports.WidgetSection = WidgetSection;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CommandItemState } from '@headless-adminapp/app/command';
|
|
2
2
|
interface WidgetTitleBarProps {
|
|
3
3
|
title: string;
|
|
4
|
+
subtitle?: string;
|
|
4
5
|
commands?: CommandItemState[][];
|
|
5
6
|
rightContent?: React.ReactNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function WidgetTitleBar({ title, commands, rightContent, }: Readonly<WidgetTitleBarProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function WidgetTitleBar({ title, subtitle, commands, rightContent, }: Readonly<WidgetTitleBarProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -9,7 +9,7 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
9
9
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
10
10
|
const CommandBar_1 = __importDefault(require("../CommandBar"));
|
|
11
11
|
const OverflowCommandBar_1 = require("../OverflowCommandBar");
|
|
12
|
-
function WidgetTitleBar({ title, commands, rightContent, }) {
|
|
12
|
+
function WidgetTitleBar({ title, subtitle, commands, rightContent, }) {
|
|
13
13
|
const { language } = (0, locale_1.useLocale)();
|
|
14
14
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
15
15
|
display: 'flex',
|
|
@@ -17,5 +17,5 @@ function WidgetTitleBar({ title, commands, rightContent, }) {
|
|
|
17
17
|
paddingBlock: 8,
|
|
18
18
|
height: 40,
|
|
19
19
|
alignItems: 'center',
|
|
20
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { style: {
|
|
20
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { flexShrink: 0, display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: title }), (0, jsx_runtime_1.jsx)(react_components_1.Caption2, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: subtitle })] }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), rightContent, !!commands && commands[0]?.length > 0 && ((0, jsx_runtime_1.jsx)(CommandBar_1.default.Wrapper, { align: "end", children: commands[0].map((command, index) => (0, OverflowCommandBar_1.renderCommandItem)(index, command, language)) }))] }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } }) })] }));
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"uuid": "11.0.3",
|
|
53
53
|
"yup": "^1.4.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a5a471cce4df9e87552b23e3de8c90d53e4adf43"
|
|
56
56
|
}
|