@antscorp/antsomi-ui 1.3.5-beta.345 → 1.3.5-beta.347
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.
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useContextSelector } from 'use-context-selector';
|
|
15
15
|
import AntsProcessingNotification from '@antscorp/processing-notification';
|
|
16
|
-
import { merge, omit } from 'lodash';
|
|
16
|
+
import { cloneDeep, merge, omit } from 'lodash';
|
|
17
17
|
// Styled
|
|
18
18
|
import { ChildrenWrapper, ContentWrapper, LayoutWrapper, NotificationWrapper } from './styled';
|
|
19
19
|
// Components
|
|
@@ -42,17 +42,16 @@ export const Layout = memo(props => {
|
|
|
42
42
|
const showLeftMenu = useLayoutStore(store => store.state.leftMenu.show);
|
|
43
43
|
const contentWrapper = useLayoutStore(store => store.state.contentWrapper);
|
|
44
44
|
const workspace = useLayoutStore(store => store.state.workspace);
|
|
45
|
+
const layoutState = useLayoutStore(store => store.state);
|
|
46
|
+
console.log('🚀 ~ layoutState: joifdsjfiodsjfoids', layoutState, contentWrapper);
|
|
45
47
|
const [showAccountSelection, setShowAccountSelection] = useState(false);
|
|
46
48
|
const [noSpaceTopContent, setNoSpaceTopContent] = useState(false);
|
|
47
49
|
// Refs
|
|
48
50
|
const notificationWrapperRef = useRef(null);
|
|
49
51
|
// Hooks
|
|
50
|
-
useMutationObserver(
|
|
51
|
-
console.log({ mutationsList });
|
|
52
|
-
console.log({ notificationWrapperRef: notificationWrapperRef.current });
|
|
52
|
+
useMutationObserver(() => {
|
|
53
53
|
if (notificationWrapperRef.current) {
|
|
54
54
|
const child = notificationWrapperRef.current.querySelector('div');
|
|
55
|
-
console.log('🚀 ~ child:', child);
|
|
56
55
|
setNoSpaceTopContent(!!child);
|
|
57
56
|
}
|
|
58
57
|
}, notificationWrapperRef, {
|
|
@@ -107,9 +106,15 @@ export const Layout = memo(props => {
|
|
|
107
106
|
INSIGHT_U_OGS: 'uogs',
|
|
108
107
|
} }) }), accountSharingConfig: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSharingConfig), { u_ogs: 'uogs', appCode: 'APP_CUSTOMER_360' }), accountSelection: Object.assign(Object.assign({}, headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection), { show: !!((_b = headerProps === null || headerProps === void 0 ? void 0 : headerProps.accountSelection) === null || _b === void 0 ? void 0 : _b.show) && showAccountSelection }) }));
|
|
109
108
|
}, [headerProps, iamDomain, permissionDomain, showAccountSelection]);
|
|
110
|
-
const mergeHeaderProps =
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
const mergeHeaderProps = useDeepCompareMemo(() => merge(cloneDeep(initialHeaderProps), cloneDeep(headerStore)),
|
|
110
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
+
[cloneDeep(initialHeaderProps), cloneDeep(headerStore)]);
|
|
112
|
+
const mergeContentWrapperProps = useDeepCompareMemo(() => merge(cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)),
|
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
[cloneDeep(contentWrapperProps), cloneDeep(contentWrapper)]);
|
|
115
|
+
const mergeWorkSpaceProps = useDeepCompareMemo(() => merge(cloneDeep(restOfWorkspaceProps), cloneDeep(omit(workspace, 'workspaceContentProps'))),
|
|
116
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
|
+
[cloneDeep(restOfWorkspaceProps), cloneDeep(workspace)]);
|
|
113
118
|
const antsProcessingNotificationConfig = useMemo(() => (Object.assign({ permissionDomain, socketDomain: SOCKET_API, token, accountId: userId, userId, lang: languageCode, networkId: portalId }, processingNotificationProps)), [permissionDomain, token, userId, languageCode, portalId, processingNotificationProps]);
|
|
114
119
|
const onActiveMenuCodeChange = useCallback((activeItemPath, flattenPermissionList) => {
|
|
115
120
|
var _a;
|
|
@@ -121,7 +126,7 @@ export const Layout = memo(props => {
|
|
|
121
126
|
React.createElement(HeaderV2, Object.assign({}, mergeHeaderProps, { showLogo: !showLeftMenu })),
|
|
122
127
|
React.createElement(Flex, { className: "layout-body" },
|
|
123
128
|
showLeftMenu && (React.createElement(LeftMenu, Object.assign({ className: `layout-body__menu ${className}`, appConfig: appConfig }, restOfLeftMenuProps, { onActiveMenuCodeChange: onActiveMenuCodeChange }))),
|
|
124
|
-
React.createElement(ContentWrapper, Object.assign({ "$noPadding": noPadding, "$noSpaceTopContent": noSpaceTopContent }, mergeContentWrapperProps),
|
|
129
|
+
React.createElement(ContentWrapper, Object.assign({ "$noPadding": mergeContentWrapperProps.noPadding, "$noSpaceTopContent": noSpaceTopContent }, mergeContentWrapperProps),
|
|
125
130
|
React.createElement("div", Object.assign({}, mergeWorkSpaceProps, { className: `layout-body__content ${(workspaceProps === null || workspaceProps === void 0 ? void 0 : workspaceProps.className) || ''}` }),
|
|
126
131
|
React.createElement(NotificationWrapper, { ref: notificationWrapperRef },
|
|
127
132
|
React.createElement(AntsProcessingNotification, Object.assign({}, antsProcessingNotificationConfig))),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.347",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"unpkg": "dist/index.js",
|
|
20
20
|
"types": "es/index.d.ts",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"publish": "npm run clean && npm run build:es",
|
|
23
22
|
"build:es": "npm run copy-files && npm run ts-compile",
|
|
24
23
|
"clean": "rimraf dist lib es",
|
|
25
24
|
"dev": "vite",
|