@antscorp/antsomi-ui 1.7.9 → 1.8.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/es/components/atoms/Steps/Steps.js +3 -1
- package/es/components/icons/AddRadiusIcon.d.ts +3 -0
- package/es/components/icons/AddRadiusIcon.js +7 -0
- package/es/components/icons/{WebPagesBrowserIcon.d.ts → PivotTableChartIcon.d.ts} +1 -1
- package/es/components/icons/PivotTableChartIcon.js +11 -0
- package/es/components/icons/SubtractRadiusIcon.d.ts +3 -0
- package/es/components/icons/{ArrowIcon.js → SubtractRadiusIcon.js} +2 -2
- package/es/components/icons/document/IconGallery.js +1 -1
- package/es/components/icons/index.d.ts +3 -6
- package/es/components/icons/index.js +3 -6
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +32 -28
- package/es/components/molecules/DrawerDetail/types.d.ts +2 -1
- package/es/components/molecules/Dropdown/Dropdown.d.ts +0 -1
- package/es/components/molecules/Dropdown/Dropdown.js +3 -3
- package/es/components/molecules/Dropdown/style.scss +6 -4
- package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -0
- package/es/components/molecules/HeaderV2/HeaderV2.js +2 -2
- package/es/components/molecules/HeaderV2/styled.d.ts +3 -1
- package/es/components/molecules/HeaderV2/styled.js +2 -0
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +7 -2
- package/es/components/molecules/RequestAccess/RequestAccess.d.ts +15 -0
- package/es/components/molecules/RequestAccess/RequestAccess.js +50 -0
- package/es/components/molecules/RequestAccess/index.d.ts +1 -0
- package/es/components/molecules/RequestAccess/index.js +1 -0
- package/es/components/molecules/RequestAccess/styled.d.ts +1 -0
- package/es/components/molecules/RequestAccess/styled.js +41 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +1 -1
- package/es/components/molecules/index.d.ts +1 -0
- package/es/components/molecules/index.js +1 -0
- package/es/components/organism/AccountSharing/AccountSharing.js +15 -3
- package/es/components/organism/DataTable/components/ModifyColumn/index.js +5 -4
- package/es/components/organism/DataTable/components/ModifyColumn/styled.d.ts +1 -0
- package/es/components/organism/DataTable/components/ModifyColumn/styled.js +10 -1
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.d.ts +10 -0
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.js +29 -0
- package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +8 -4
- package/es/components/organism/DataTable/components/Toolbar/ToolbarActionButtons.js +5 -0
- package/es/components/organism/DataTable/components/Toolbar/index.js +4 -2
- package/es/components/organism/DataTable/constants/common.d.ts +1 -1
- package/es/components/organism/DataTable/constants/common.js +1 -1
- package/es/components/organism/DataTable/constants/toolbar.d.ts +1 -0
- package/es/components/organism/DataTable/constants/toolbar.js +8 -2
- package/es/components/organism/DataTable/hooks/useDataTableListing/types.d.ts +8 -0
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.d.ts +6 -1
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +124 -12
- package/es/components/organism/DataTable/styled/index.d.ts +1 -0
- package/es/components/organism/DataTable/styled/index.js +6 -0
- package/es/components/organism/DataTable/types/toolbar.d.ts +9 -1
- package/es/components/organism/LeftMenu/LeftMenu.js +2 -2
- package/es/components/organism/LeftMenu/components/HomeMenu/index.js +2 -2
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.d.ts +1 -0
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +6 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +2 -2
- package/es/components/organism/LeftMenu/constants/variables.d.ts +4 -2
- package/es/components/organism/LeftMenu/constants/variables.js +2 -14
- package/es/components/organism/LeftMenu/hooks/usePermission.js +2 -1
- package/es/components/organism/LeftMenu/styled.d.ts +1 -0
- package/es/components/organism/LeftMenu/styled.js +8 -2
- package/es/components/organism/LeftMenu/utils/index.d.ts +34 -1
- package/es/components/organism/LeftMenu/utils/index.js +47 -23
- package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +28 -6
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.d.ts +2 -1
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +14 -36
- package/es/components/organism/PreviewTemplateModal/types.d.ts +2 -1
- package/es/components/organism/TicketEditor/Content.js +40 -8
- package/es/components/organism/TicketEditor/index.js +12 -3
- package/es/components/organism/TicketEditor/styled.js +48 -1
- package/es/components/template/Layout/Layout.d.ts +1 -0
- package/es/components/template/Layout/Layout.js +38 -9
- package/es/components/template/Layout/constants/permission.d.ts +5 -1
- package/es/components/template/Layout/constants/permission.js +5 -1
- package/es/components/template/Layout/stores/index.d.ts +2 -0
- package/es/components/template/Layout/stores/index.js +1 -0
- package/es/components/template/Layout/styled.d.ts +5 -0
- package/es/components/template/Layout/styled.js +15 -2
- package/es/components/template/TemplateListing/index.js +3 -3
- package/es/constants/permissions.d.ts +6 -0
- package/es/constants/permissions.js +6 -0
- package/es/constants/theme.js +9 -5
- package/es/locales/en/translation.json +12 -1
- package/es/locales/i18n.d.ts +22 -0
- package/es/locales/translations.d.ts +11 -0
- package/es/locales/vi/translation.json +12 -1
- package/es/providers/ConfigProvider/GlobalStyle.js +8 -1
- package/es/utils/common.d.ts +10 -0
- package/es/utils/common.js +13 -0
- package/package.json +6 -6
- package/es/components/icons/ArrowIcon.d.ts +0 -3
- package/es/components/icons/CloseRemoveIcon.d.ts +0 -3
- package/es/components/icons/CloseRemoveIcon.js +0 -7
- package/es/components/icons/DataVer2Icon.d.ts +0 -3
- package/es/components/icons/DataVer2Icon.js +0 -7
- package/es/components/icons/LockRestrictIcon.d.ts +0 -3
- package/es/components/icons/LockRestrictIcon.js +0 -7
- package/es/components/icons/MoveTo1Icon.d.ts +0 -3
- package/es/components/icons/MoveTo1Icon.js +0 -7
- package/es/components/icons/WebPagesBrowserIcon.js +0 -7
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
// Libraries
|
|
13
13
|
import React, { useEffect, useMemo, useState, memo } from 'react';
|
|
14
14
|
import { isNumber } from 'lodash';
|
|
15
|
+
import { ConfigProvider } from 'antd';
|
|
15
16
|
// Styled
|
|
16
17
|
import { ErrorIcon, SelectedIcon, StepsWrapper } from './styled';
|
|
17
18
|
export const Steps = memo(props => {
|
|
@@ -62,5 +63,6 @@ export const Steps = memo(props => {
|
|
|
62
63
|
: items, [saveHighestStep, items, highestStep, props.status, current]);
|
|
63
64
|
/** Check whether the user has reactivated the previous step or not */
|
|
64
65
|
const isReactivate = saveHighestStep && isNumber(current) && current < highestStep;
|
|
65
|
-
return (React.createElement(
|
|
66
|
+
return (React.createElement(ConfigProvider, { theme: { token: { motion: false } } },
|
|
67
|
+
React.createElement(StepsWrapper, Object.assign({ items: customItems }, restOfProps, { size: size, isReactivate: isReactivate, highestStep: highestStep, className: `${className || ''}${saveHighestStep ? ' save-highest-step' : ''}` }))));
|
|
66
68
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useIcon } from './hooks/useIcon';
|
|
3
|
+
export const AddRadiusIcon = forwardRef((props, ref) => {
|
|
4
|
+
const { width, height } = useIcon(props);
|
|
5
|
+
return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
|
|
6
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 3C5.23858 3 3 5.23858 3 8V16C3 18.7614 5.23858 21 8 21H16C18.7614 21 21 18.7614 21 16V8C21 5.23858 18.7614 3 16 3H8ZM13.2 10.8H16.8C17.1183 10.8 17.4235 10.9264 17.6486 11.1515C17.8736 11.3765 18 11.6817 18 12C18 12.3183 17.8736 12.6235 17.6486 12.8485C17.4235 13.0736 17.1183 13.2 16.8 13.2H13.2V16.8C13.2 17.1183 13.0736 17.4235 12.8486 17.6485C12.6235 17.8736 12.3183 18 12 18C11.6817 18 11.3765 17.8736 11.1514 17.6485C10.9264 17.4235 10.8 17.1183 10.8 16.8V13.2H7.2C6.88174 13.2 6.57646 13.0736 6.35142 12.8485C6.12637 12.6235 6 12.3183 6 12C6 11.6817 6.12637 11.3765 6.35142 11.1515C6.57646 10.9264 6.88174 10.8 7.2 10.8H10.8V7.2C10.8 6.88174 10.9264 6.57653 11.1514 6.35149C11.3765 6.12645 11.6817 6 12 6C12.3183 6 12.6235 6.12645 12.8486 6.35149C13.0736 6.57653 13.2 6.88174 13.2 7.2V10.8Z", fill: "currentColor" })));
|
|
7
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconProps } from './types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PivotTableChartIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useIcon } from './hooks/useIcon';
|
|
3
|
+
export const PivotTableChartIcon = forwardRef((props, ref) => {
|
|
4
|
+
// search tag: group by, pivot table
|
|
5
|
+
const { width, height } = useIcon(props);
|
|
6
|
+
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", enableBackground: "new 0 0 24 24", viewBox: "0 0 24 24", fill: "currentColor" }, props, { ref: ref, width: width, height: height }),
|
|
7
|
+
React.createElement("g", null,
|
|
8
|
+
React.createElement("path", { d: "M0,0h24v24H0V0z", fill: "none" })),
|
|
9
|
+
React.createElement("g", null,
|
|
10
|
+
React.createElement("path", { d: "M21,5c0-1.1-0.9-2-2-2h-9v5h11V5z M3,19c0,1.1,0.9,2,2,2h3V10H3V19z M3,5v3h5V3H5C3.9,3,3,3.9,3,5z M18,8.99L14,13 l1.41,1.41l1.59-1.6V15c0,1.1-0.9,2-2,2h-2.17l1.59-1.59L13,14l-4,4l4,4l1.41-1.41L12.83,19H15c2.21,0,4-1.79,4-4v-2.18l1.59,1.6 L22,13L18,8.99z" }))));
|
|
11
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { useIcon } from './hooks/useIcon';
|
|
3
|
-
export const
|
|
3
|
+
export const SubtractRadiusIcon = forwardRef((props, ref) => {
|
|
4
4
|
const { width, height } = useIcon(props);
|
|
5
5
|
return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref, width: width, height: height }),
|
|
6
|
-
React.createElement("path", { d: "
|
|
6
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 3C5.23858 3 3 5.23858 3 8V16C3 18.7614 5.23858 21 8 21H16C18.7614 21 21 18.7614 21 16V8C21 5.23858 18.7614 3 16 3H8ZM17 11H7V13H17V11Z", fill: "currentColor" })));
|
|
7
7
|
});
|
|
@@ -40,7 +40,7 @@ export const IconGallery = () => {
|
|
|
40
40
|
React.createElement("h4", null, "These components below are invalid (check name and file name is correct?)"),
|
|
41
41
|
invalidIcons.map(item => (React.createElement("strong", { key: item.name, style: { color: 'red' } },
|
|
42
42
|
React.createElement("pre", null, item.name)))))) : null,
|
|
43
|
-
React.createElement(Input, { placeholder: "Search Icon", value: search, onChange: e => setSearch(e.target.value), style: { fontSize: '
|
|
43
|
+
React.createElement(Input, { placeholder: "Search Icon", value: search, onChange: e => setSearch(e.target.value), style: { fontSize: '16px' } }),
|
|
44
44
|
React.createElement(Flex, { className: "grid-container", gap: 16 }, validIcons
|
|
45
45
|
.filter(item => searchMatchAny([item.name, ...item.dataSearch], debounceSearchValue))
|
|
46
46
|
.map(item => {
|
|
@@ -2,12 +2,12 @@ export { AccountCircleIcon } from './AccountCircleIcon';
|
|
|
2
2
|
export { AddChartIcon } from './AddChartIcon';
|
|
3
3
|
export { AddFolderIcon } from './AddFolderIcon';
|
|
4
4
|
export { AddIcon } from './AddIcon';
|
|
5
|
+
export { AddRadiusIcon } from './AddRadiusIcon';
|
|
5
6
|
export { AddShoppingCartIcon } from './AddShoppingCartIcon';
|
|
6
7
|
export { AdjustIcon } from './AdjustIcon';
|
|
7
8
|
export { AllDevicesIcon } from './AllDevicesIcon';
|
|
8
9
|
export { AllJourneyChannelsIcon } from './AllJourneyChannelsIcon';
|
|
9
10
|
export { ArrowGrowIcon } from './ArrowGrowIcon';
|
|
10
|
-
export { ArrowIcon } from './ArrowIcon';
|
|
11
11
|
export { ArrowLineIcon } from './ArrowLineIcon';
|
|
12
12
|
export { AssignmentIndIcon } from './AssignmentIndIcon';
|
|
13
13
|
export { AttachmentIcon } from './AttachmentIcon';
|
|
@@ -43,7 +43,6 @@ export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
|
|
|
43
43
|
export { CircleAddElementIcon } from './CircleAddElementIcon';
|
|
44
44
|
export { CircleNotificationsIcon } from './CircleNotificationsIcon';
|
|
45
45
|
export { CloseIcon } from './CloseIcon';
|
|
46
|
-
export { CloseRemoveIcon } from './CloseRemoveIcon';
|
|
47
46
|
export { CodeIcon } from './CodeIcon';
|
|
48
47
|
export { ColorProfileStyleThemeIcon } from './ColorProfileStyleThemeIcon';
|
|
49
48
|
export { ColumnIcon } from './ColumnIcon';
|
|
@@ -62,7 +61,6 @@ export { CurvedConnectorIcon } from './CurvedConnectorIcon';
|
|
|
62
61
|
export { DashboardIcon } from './DashboardIcon';
|
|
63
62
|
export { DataIcon } from './DataIcon';
|
|
64
63
|
export { DataRefreshIcon } from './DataRefreshIcon';
|
|
65
|
-
export { DataVer2Icon } from './DataVer2Icon';
|
|
66
64
|
export { DeleteRemoveTrashIcon } from './DeleteRemoveTrashIcon';
|
|
67
65
|
export { DeliveryLogIcon } from './DeliveryLogIcon';
|
|
68
66
|
export { DesktopLaptopIcon } from './DesktopLaptopIcon';
|
|
@@ -132,7 +130,6 @@ export { LineIcon } from './LineIcon';
|
|
|
132
130
|
export { ListIcon } from './ListIcon';
|
|
133
131
|
export { LoadingIcon } from './LoadingIcon';
|
|
134
132
|
export { LocalMallIcon } from './LocalMallIcon';
|
|
135
|
-
export { LockRestrictIcon } from './LockRestrictIcon';
|
|
136
133
|
export { MapIcon } from './MapIcon';
|
|
137
134
|
export { MarkAsReadIcon } from './MarkAsReadIcon';
|
|
138
135
|
export { MediaGalleryIcon } from './MediaGalleryIcon';
|
|
@@ -145,7 +142,6 @@ export { MobileFriendlyIcon } from './MobileFriendlyIcon';
|
|
|
145
142
|
export { MobilePhoneIcon } from './MobilePhoneIcon';
|
|
146
143
|
export { MoreIcon } from './MoreIcon';
|
|
147
144
|
export { MoreInfoIcon } from './MoreInfoIcon';
|
|
148
|
-
export { MoveTo1Icon } from './MoveTo1Icon';
|
|
149
145
|
export { MoveToIcon } from './MoveToIcon';
|
|
150
146
|
export { MuteIcon } from './MuteIcon';
|
|
151
147
|
export { NodeViewIcon } from './NodeViewIcon';
|
|
@@ -161,6 +157,7 @@ export { PenDrawingIcon } from './PenDrawingIcon';
|
|
|
161
157
|
export { PersonAddDisabledIcon } from './PersonAddDisabledIcon';
|
|
162
158
|
export { PersonUserAccountIcon } from './PersonUserAccountIcon';
|
|
163
159
|
export { PhoneCallbackIcon } from './PhoneCallbackIcon';
|
|
160
|
+
export { PivotTableChartIcon } from './PivotTableChartIcon';
|
|
164
161
|
export { PlaneIcon } from './PlaneIcon';
|
|
165
162
|
export { PreviewIcon } from './PreviewIcon';
|
|
166
163
|
export { PreviewVisibilityEyeIcon } from './PreviewVisibilityEyeIcon';
|
|
@@ -211,6 +208,7 @@ export { StatisticIcon } from './StatisticIcon';
|
|
|
211
208
|
export { StickerIcon } from './StickerIcon';
|
|
212
209
|
export { StopRecordIcon } from './StopRecordIcon';
|
|
213
210
|
export { StoreIcon } from './StoreIcon';
|
|
211
|
+
export { SubtractRadiusIcon } from './SubtractRadiusIcon';
|
|
214
212
|
export { SupportAssistantIcon } from './SupportAssistantIcon';
|
|
215
213
|
export { SurveyDirectorProfileIcon } from './SurveyDirectorProfileIcon';
|
|
216
214
|
export { SystemRunningIcon } from './SystemRunningIcon';
|
|
@@ -237,7 +235,6 @@ export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
|
|
|
237
235
|
export { WarningIcon } from './WarningIcon';
|
|
238
236
|
export { WebAssetIcon } from './WebAssetIcon';
|
|
239
237
|
export { WebIcon } from './WebIcon';
|
|
240
|
-
export { WebPagesBrowserIcon } from './WebPagesBrowserIcon';
|
|
241
238
|
export { WebhookIcon } from './WebhookIcon';
|
|
242
239
|
export { WidgetIcon } from './WidgetIcon';
|
|
243
240
|
export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
|
|
@@ -2,12 +2,12 @@ export { AccountCircleIcon } from './AccountCircleIcon';
|
|
|
2
2
|
export { AddChartIcon } from './AddChartIcon';
|
|
3
3
|
export { AddFolderIcon } from './AddFolderIcon';
|
|
4
4
|
export { AddIcon } from './AddIcon';
|
|
5
|
+
export { AddRadiusIcon } from './AddRadiusIcon';
|
|
5
6
|
export { AddShoppingCartIcon } from './AddShoppingCartIcon';
|
|
6
7
|
export { AdjustIcon } from './AdjustIcon';
|
|
7
8
|
export { AllDevicesIcon } from './AllDevicesIcon';
|
|
8
9
|
export { AllJourneyChannelsIcon } from './AllJourneyChannelsIcon';
|
|
9
10
|
export { ArrowGrowIcon } from './ArrowGrowIcon';
|
|
10
|
-
export { ArrowIcon } from './ArrowIcon';
|
|
11
11
|
export { ArrowLineIcon } from './ArrowLineIcon';
|
|
12
12
|
export { AssignmentIndIcon } from './AssignmentIndIcon';
|
|
13
13
|
export { AttachmentIcon } from './AttachmentIcon';
|
|
@@ -43,7 +43,6 @@ export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
|
|
|
43
43
|
export { CircleAddElementIcon } from './CircleAddElementIcon';
|
|
44
44
|
export { CircleNotificationsIcon } from './CircleNotificationsIcon';
|
|
45
45
|
export { CloseIcon } from './CloseIcon';
|
|
46
|
-
export { CloseRemoveIcon } from './CloseRemoveIcon';
|
|
47
46
|
export { CodeIcon } from './CodeIcon';
|
|
48
47
|
export { ColorProfileStyleThemeIcon } from './ColorProfileStyleThemeIcon';
|
|
49
48
|
export { ColumnIcon } from './ColumnIcon';
|
|
@@ -62,7 +61,6 @@ export { CurvedConnectorIcon } from './CurvedConnectorIcon';
|
|
|
62
61
|
export { DashboardIcon } from './DashboardIcon';
|
|
63
62
|
export { DataIcon } from './DataIcon';
|
|
64
63
|
export { DataRefreshIcon } from './DataRefreshIcon';
|
|
65
|
-
export { DataVer2Icon } from './DataVer2Icon';
|
|
66
64
|
export { DeleteRemoveTrashIcon } from './DeleteRemoveTrashIcon';
|
|
67
65
|
export { DeliveryLogIcon } from './DeliveryLogIcon';
|
|
68
66
|
export { DesktopLaptopIcon } from './DesktopLaptopIcon';
|
|
@@ -132,7 +130,6 @@ export { LineIcon } from './LineIcon';
|
|
|
132
130
|
export { ListIcon } from './ListIcon';
|
|
133
131
|
export { LoadingIcon } from './LoadingIcon';
|
|
134
132
|
export { LocalMallIcon } from './LocalMallIcon';
|
|
135
|
-
export { LockRestrictIcon } from './LockRestrictIcon';
|
|
136
133
|
export { MapIcon } from './MapIcon';
|
|
137
134
|
export { MarkAsReadIcon } from './MarkAsReadIcon';
|
|
138
135
|
export { MediaGalleryIcon } from './MediaGalleryIcon';
|
|
@@ -145,7 +142,6 @@ export { MobileFriendlyIcon } from './MobileFriendlyIcon';
|
|
|
145
142
|
export { MobilePhoneIcon } from './MobilePhoneIcon';
|
|
146
143
|
export { MoreIcon } from './MoreIcon';
|
|
147
144
|
export { MoreInfoIcon } from './MoreInfoIcon';
|
|
148
|
-
export { MoveTo1Icon } from './MoveTo1Icon';
|
|
149
145
|
export { MoveToIcon } from './MoveToIcon';
|
|
150
146
|
export { MuteIcon } from './MuteIcon';
|
|
151
147
|
export { NodeViewIcon } from './NodeViewIcon';
|
|
@@ -161,6 +157,7 @@ export { PenDrawingIcon } from './PenDrawingIcon';
|
|
|
161
157
|
export { PersonAddDisabledIcon } from './PersonAddDisabledIcon';
|
|
162
158
|
export { PersonUserAccountIcon } from './PersonUserAccountIcon';
|
|
163
159
|
export { PhoneCallbackIcon } from './PhoneCallbackIcon';
|
|
160
|
+
export { PivotTableChartIcon } from './PivotTableChartIcon';
|
|
164
161
|
export { PlaneIcon } from './PlaneIcon';
|
|
165
162
|
export { PreviewIcon } from './PreviewIcon';
|
|
166
163
|
export { PreviewVisibilityEyeIcon } from './PreviewVisibilityEyeIcon';
|
|
@@ -211,6 +208,7 @@ export { StatisticIcon } from './StatisticIcon';
|
|
|
211
208
|
export { StickerIcon } from './StickerIcon';
|
|
212
209
|
export { StopRecordIcon } from './StopRecordIcon';
|
|
213
210
|
export { StoreIcon } from './StoreIcon';
|
|
211
|
+
export { SubtractRadiusIcon } from './SubtractRadiusIcon';
|
|
214
212
|
export { SupportAssistantIcon } from './SupportAssistantIcon';
|
|
215
213
|
export { SurveyDirectorProfileIcon } from './SurveyDirectorProfileIcon';
|
|
216
214
|
export { SystemRunningIcon } from './SystemRunningIcon';
|
|
@@ -237,7 +235,6 @@ export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
|
|
|
237
235
|
export { WarningIcon } from './WarningIcon';
|
|
238
236
|
export { WebAssetIcon } from './WebAssetIcon';
|
|
239
237
|
export { WebIcon } from './WebIcon';
|
|
240
|
-
export { WebPagesBrowserIcon } from './WebPagesBrowserIcon';
|
|
241
238
|
export { WebhookIcon } from './WebhookIcon';
|
|
242
239
|
export { WidgetIcon } from './WidgetIcon';
|
|
243
240
|
export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
|
|
@@ -10,7 +10,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
|
-
import { ConfigProvider } from 'antd';
|
|
14
13
|
import { isNil } from 'lodash';
|
|
15
14
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
16
15
|
// Components
|
|
@@ -116,32 +115,37 @@ export const DrawerDetail = props => {
|
|
|
116
115
|
localStorage.setItem(DRAWER_DETAIL_LOCAL_STORAGE_KEY, JSON.stringify(Object.assign(Object.assign({}, localStorageValues), { [name || '']: !collapseDrawer })));
|
|
117
116
|
}
|
|
118
117
|
};
|
|
119
|
-
return (React.createElement(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
118
|
+
return (React.createElement(StyledDrawer, Object.assign({ push: false, closable: false, width: drawerWidth, motion: {
|
|
119
|
+
visible: false,
|
|
120
|
+
motionAppear: false,
|
|
121
|
+
motionEnter: false,
|
|
122
|
+
motionLeave: false,
|
|
123
|
+
}, maskMotion: {
|
|
124
|
+
visible: false,
|
|
125
|
+
motionAppear: false,
|
|
126
|
+
motionEnter: false,
|
|
127
|
+
motionLeave: false,
|
|
128
|
+
}, classNames: {
|
|
129
|
+
body: 'drawer-detail-body',
|
|
130
|
+
}, contentWrapperStyle: {
|
|
131
|
+
transition: 'none',
|
|
132
|
+
}, maskStyle: {
|
|
133
|
+
transition: 'none',
|
|
134
|
+
}, destroyOnClose: destroyOnClose }, restProps),
|
|
135
|
+
showCloseIcon && (React.createElement("div", Object.assign({ className: "close-btn" }, restOfCloseIcon, { onClick: e => {
|
|
136
|
+
onCloseIconClick(e);
|
|
137
|
+
onClose(e);
|
|
138
|
+
} }),
|
|
139
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
|
|
140
|
+
showExpandButton && !fullScreen && (React.createElement(ToggleDrawerSizeButton, { style: Object.assign({}, (!showMenu && { background: '#ffffff' })), onClick: () => handleToggleDrawerSize(), collapse: collapseDrawer })),
|
|
141
|
+
showMenu && (React.createElement(LeftMenu, { className: "animate__animated animate__fadeIn" },
|
|
142
|
+
React.createElement("div", null,
|
|
143
|
+
showClose && (React.createElement(CloseBtn, { onClick: onClose },
|
|
134
144
|
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
React.createElement(MenuItem, { key: item === null || item === void 0 ? void 0 : item.key, className: (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.includes(item.key)) ? 'active' : '', onClick: () => onClick && onClick(item) }, item.icon)))))),
|
|
142
|
-
React.createElement(MenuFooter, null, footer))),
|
|
143
|
-
React.createElement(Content, null,
|
|
144
|
-
(headerProps === null || headerProps === void 0 ? void 0 : headerProps.children) && (React.createElement(DrawerHeader, Object.assign({ align: "center" }, restOfHeaderProps), headerChildren)),
|
|
145
|
-
children)))));
|
|
145
|
+
React.createElement(Flex, { vertical: true, gap: 10, align: "center", justify: "center" }, items === null || items === void 0 ? void 0 : items.map((item) => (React.createElement(Tooltip, { key: item === null || item === void 0 ? void 0 : item.key, title: item === null || item === void 0 ? void 0 : item.label, mouseEnterDelay: 0.3, placement: "right" },
|
|
146
|
+
React.createElement(MenuItem, { key: item === null || item === void 0 ? void 0 : item.key, className: (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.includes(item.key)) ? 'active' : '', onClick: () => onClick && onClick(item) }, item.icon)))))),
|
|
147
|
+
React.createElement(MenuFooter, null, footer))),
|
|
148
|
+
React.createElement(Content, null,
|
|
149
|
+
(headerProps === null || headerProps === void 0 ? void 0 : headerProps.children) && (React.createElement(DrawerHeader, Object.assign({ align: "center" }, restOfHeaderProps), headerChildren)),
|
|
150
|
+
children)));
|
|
146
151
|
};
|
|
147
|
-
DrawerDetail.defaultProps = {};
|
|
@@ -15,9 +15,10 @@ export interface DrawerDetailProps extends Omit<DrawerProps, 'closeIcon' | 'titl
|
|
|
15
15
|
export interface DrawerDetailCloseIconProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
|
|
16
16
|
show?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface DrawerHeaderProps extends FlexProps {
|
|
18
|
+
export interface DrawerHeaderProps extends Omit<FlexProps, 'children'> {
|
|
19
19
|
height?: React.CSSProperties['height'];
|
|
20
20
|
showBorderBottom?: boolean;
|
|
21
|
+
children?: ReactNode;
|
|
21
22
|
}
|
|
22
23
|
export interface DrawerDetailMenuProps extends Omit<AntdProps, 'onClick'> {
|
|
23
24
|
show?: boolean;
|
|
@@ -14,11 +14,11 @@ import { Space, Typography } from 'antd';
|
|
|
14
14
|
import Icon from '@antscorp/icons';
|
|
15
15
|
import { StyledInputDropdownRoot } from './styled';
|
|
16
16
|
import clsx from 'clsx';
|
|
17
|
-
import './style.scss';
|
|
17
|
+
// import './style.scss';
|
|
18
18
|
export { Dropdown } from 'antd';
|
|
19
19
|
const DefaultExpandIcon = React.createElement(Icon, { type: "icon-ants-expand-more" });
|
|
20
20
|
export const InputDropdown = (props) => {
|
|
21
|
-
const { children, disabled = false, className, trigger = ['click'], menu = { items: [] }, width = '100%', expandIcon = DefaultExpandIcon, onOpenChange = () => { } } = props, rest = __rest(props, ["children", "disabled", "className", "trigger", "menu", "width", "expandIcon", "onOpenChange"]);
|
|
21
|
+
const { children, disabled = false, className, trigger = ['click'], menu = { items: [] }, width = '100%', expandIcon = DefaultExpandIcon, onOpenChange = () => { }, overlayClassName } = props, rest = __rest(props, ["children", "disabled", "className", "trigger", "menu", "width", "expandIcon", "onOpenChange", "overlayClassName"]);
|
|
22
22
|
const [enableTooltip, setEnableTooltip] = useState(true);
|
|
23
23
|
const renderChildren = useCallback(() => {
|
|
24
24
|
if (typeof children === 'string') {
|
|
@@ -37,7 +37,7 @@ export const InputDropdown = (props) => {
|
|
|
37
37
|
setEnableTooltip(!open);
|
|
38
38
|
onOpenChange(...args);
|
|
39
39
|
};
|
|
40
|
-
return (React.createElement(StyledInputDropdownRoot, Object.assign({ menu: menu, trigger: trigger, disabled: disabled }, rest, { className: clsx({ disabled }, className, 'antsomi-input-dropdown'), onOpenChange: handleOpen }),
|
|
40
|
+
return (React.createElement(StyledInputDropdownRoot, Object.assign({ menu: menu, trigger: trigger, disabled: disabled }, rest, { className: clsx({ disabled }, className, 'antsomi-input-dropdown'), overlayClassName: clsx(overlayClassName, 'antsomi-input-dropdown-overlay'), onOpenChange: handleOpen }),
|
|
41
41
|
React.createElement(Space, { style: { width } },
|
|
42
42
|
renderChildren(),
|
|
43
43
|
expandIcon)));
|
|
@@ -32,7 +32,7 @@ export const HeaderV2 = memo(props => {
|
|
|
32
32
|
const { search } = useLocation();
|
|
33
33
|
const { replace } = useCustomRouter();
|
|
34
34
|
// * Prefer to use Header in AppConfigContext
|
|
35
|
-
const { className, style, breadcrumbs, showLogo = false, rightContent, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, } = props;
|
|
35
|
+
const { show = true, className, style, breadcrumbs, showLogo = false, rightContent, pageTitle = '', accountSelection = {}, helpConfig, notificationConfig = {}, accountSharingConfig, useURLParam, config, } = props;
|
|
36
36
|
/** General config for children component */
|
|
37
37
|
const { env = envContext, language = languageCode, userId = isNaN(Number(auth === null || auth === void 0 ? void 0 : auth.userId)) ? 0 : Number(auth === null || auth === void 0 ? void 0 : auth.userId), portalId = auth === null || auth === void 0 ? void 0 : auth.portalId, token = auth === null || auth === void 0 ? void 0 : auth.token, permissionDomain = PERMISSION_API, iamDomain = IAM_API, appCode = contextAppCode, menuCode = contextMenuCode, } = config || {};
|
|
38
38
|
const { currentAccount, inputStyle = 'select', onSelectAccount } = accountSelection, accountSelectionProps = __rest(accountSelection, ["currentAccount", "inputStyle", "onSelectAccount"]);
|
|
@@ -108,7 +108,7 @@ export const HeaderV2 = memo(props => {
|
|
|
108
108
|
onSelectAccount === null || onSelectAccount === void 0 ? void 0 : onSelectAccount(userId);
|
|
109
109
|
};
|
|
110
110
|
const QUOTE_ENTITY = React.createElement(React.Fragment, null, "\u00BB");
|
|
111
|
-
return (React.createElement(HeaderV2Styled, { className: className || '', style: style },
|
|
111
|
+
return (React.createElement(HeaderV2Styled, { "$show": show, className: className || '', style: style },
|
|
112
112
|
React.createElement("div", { className: "left-side" },
|
|
113
113
|
showLogo && (React.createElement(LogoWrapper, { className: "logo-wrapper" },
|
|
114
114
|
React.createElement("img", { src: SubLogoAntsomi, alt: "Antsomi sub logo" }))),
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const LogoWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const HeaderV2Styled: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
export declare const HeaderV2Styled: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$show: boolean;
|
|
4
|
+
}, never>;
|
|
@@ -178,7 +178,7 @@ export const MatchesAny = props => {
|
|
|
178
178
|
var _a;
|
|
179
179
|
const notExtendValueSelectedItems = (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.filter(item => !item.isExtendValue)) || [];
|
|
180
180
|
const extendValueSelectedItems = (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.filter(item => item.isExtendValue)) || [];
|
|
181
|
-
const lazyLoadSelectedItems = (
|
|
181
|
+
const lazyLoadSelectedItems = (notExtendValueSelectedItems === null || notExtendValueSelectedItems === void 0 ? void 0 : notExtendValueSelectedItems.filter(selectedItem => !flatTree(items || [], 'children').some(item => item.key === selectedItem.key))) || [];
|
|
182
182
|
const serializeTreeData = (list) => {
|
|
183
183
|
var _a;
|
|
184
184
|
return ((_a = list
|
|
@@ -275,7 +275,12 @@ export const MatchesAnySelect = props => {
|
|
|
275
275
|
onChange(selectedItems);
|
|
276
276
|
setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false })));
|
|
277
277
|
};
|
|
278
|
-
return (React.createElement(Popover, { open: isOpenPopover, arrow: false, placement: "bottomLeft", content: React.createElement(MatchesAny, { className: popupClassName, items: items, selectedItems: selectedItems, loading: loading, objectName: objectName, onApply: onApplyMatchesAny, onCancel: () => setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false }))), onLoadMore: onLoadMore }),
|
|
278
|
+
return (React.createElement(Popover, { open: isOpenPopover, arrow: false, placement: "bottomLeft", content: React.createElement(MatchesAny, { className: popupClassName, items: items, selectedItems: selectedItems, loading: loading, objectName: objectName, onApply: onApplyMatchesAny, onCancel: () => setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false }))), onLoadMore: onLoadMore }), align: {
|
|
279
|
+
overflow: {
|
|
280
|
+
shiftY: 0,
|
|
281
|
+
shiftX: 0,
|
|
282
|
+
},
|
|
283
|
+
}, overlayStyle: { width: 700 }, overlayInnerStyle: {
|
|
279
284
|
padding: 0,
|
|
280
285
|
}, trigger: ['click'], destroyTooltipOnHide: true, onOpenChange: () => setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: !isOpenPopover }))) },
|
|
281
286
|
React.createElement(Tooltip, { mouseEnterDelay: 0.5, title: `${selectedItems ? selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => item.title).join(', ') : ''}` },
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RequestAccessProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
deniedTitle?: string;
|
|
6
|
+
deniedSubTitle?: string;
|
|
7
|
+
sentTitle?: string;
|
|
8
|
+
sentSubTitle?: string;
|
|
9
|
+
requestText?: string;
|
|
10
|
+
switchAccountText?: string;
|
|
11
|
+
onRequest?: (message: string) => Promise<any>;
|
|
12
|
+
onSwitchAccount?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const RequestAccess: React.FC<RequestAccessProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Button, Flex, TextArea, Typography } from '@antscorp/antsomi-ui/es/components';
|
|
3
|
+
// Styled
|
|
4
|
+
import { RequestAccessStyled } from './styled';
|
|
5
|
+
// Translate
|
|
6
|
+
import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
7
|
+
import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
8
|
+
import { BlockIcon } from '../../icons';
|
|
9
|
+
const { t } = i18nInstance;
|
|
10
|
+
export const RequestAccess = props => {
|
|
11
|
+
const { className, placeholder = t(translations.requestAccess.placeholder), deniedTitle = t(translations.requestAccess.deniedTitle), deniedSubTitle = t(translations.requestAccess.deniedSubTitle), sentTitle = t(translations.requestAccess.sentTitle), sentSubTitle = t(translations.requestAccess.sentSubTitle), requestText = t(translations.requestAccess.requestText), switchAccountText = t(translations.requestAccess.switchAccountText), onRequest, onSwitchAccount, } = props;
|
|
12
|
+
const [isSentRequest, setIsSentRequest] = useState(false);
|
|
13
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
14
|
+
const messageRef = useRef(null);
|
|
15
|
+
const handleClickRequest = () => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const message = ((_b = (_a = messageRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea.value) || '';
|
|
18
|
+
if (onRequest) {
|
|
19
|
+
try {
|
|
20
|
+
setIsLoading(true);
|
|
21
|
+
onRequest(message)
|
|
22
|
+
.then(data => {
|
|
23
|
+
if (data) {
|
|
24
|
+
setIsSentRequest(true);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
.finally(() => setIsLoading(false));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
// the onRequest(message) callback is called in try (have not call again)
|
|
31
|
+
setIsSentRequest(true);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const handleSwitchAccount = () => {
|
|
36
|
+
if (onSwitchAccount)
|
|
37
|
+
onSwitchAccount();
|
|
38
|
+
};
|
|
39
|
+
return (React.createElement(RequestAccessStyled, { className: `antsomi-request-access ${className || ''}` },
|
|
40
|
+
React.createElement(Flex, { vertical: true, gap: 20 },
|
|
41
|
+
React.createElement(Flex, { vertical: true, gap: 5 },
|
|
42
|
+
React.createElement(Typography.Text, { className: "denied-title" }, isSentRequest ? (sentTitle) : (React.createElement(React.Fragment, null,
|
|
43
|
+
deniedTitle,
|
|
44
|
+
React.createElement(BlockIcon, null)))),
|
|
45
|
+
React.createElement(Typography.Text, { className: "denied-sub-title" }, isSentRequest ? sentSubTitle : deniedSubTitle)),
|
|
46
|
+
!isSentRequest ? (React.createElement(TextArea, { style: { resize: 'none' }, placeholder: placeholder, ref: messageRef })) : null,
|
|
47
|
+
React.createElement(Flex, { className: "action-buttons", gap: 10 },
|
|
48
|
+
isSentRequest ? null : (React.createElement(Button, { onClick: handleClickRequest, type: "primary", loading: isLoading }, requestText)),
|
|
49
|
+
React.createElement(Button, { onClick: handleSwitchAccount }, switchAccountText)))));
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RequestAccess } from './RequestAccess';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RequestAccess } from './RequestAccess';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RequestAccessStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const RequestAccessStyled = styled.div `
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
& > div {
|
|
13
|
+
width: 350px;
|
|
14
|
+
|
|
15
|
+
.denied-title {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
gap: 5px;
|
|
18
|
+
|
|
19
|
+
font-size: 20px;
|
|
20
|
+
line-height: 24px;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.orange6};
|
|
23
|
+
|
|
24
|
+
& > svg {
|
|
25
|
+
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw5};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.denied-sub-title {
|
|
30
|
+
line-height: 14px;
|
|
31
|
+
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.antsomi-input {
|
|
35
|
+
height: 150px;
|
|
36
|
+
border: 1px solid ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1} !important;
|
|
37
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
38
|
+
padding: 10px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -93,7 +93,7 @@ export const SearchUser = (props) => {
|
|
|
93
93
|
label: (React.createElement(StyledSelectItem, { onClick: () => handleAddUser(user) },
|
|
94
94
|
React.createElement(Avatar, { src: user.avatar }),
|
|
95
95
|
React.createElement("div", { className: "info" },
|
|
96
|
-
React.createElement("div", { className: "name" }, user.
|
|
96
|
+
React.createElement("div", { className: "name" }, user.full_name),
|
|
97
97
|
React.createElement("div", { className: "email" }, user.email)))),
|
|
98
98
|
})) },
|
|
99
99
|
React.createElement(Input, { style: { padding: '5px' }, placeholder: placeholder, suffix: isFetching ? (React.createElement(Spin, { indicatorSize: 20, style: { paddingLeft: '5px', marginLeft: '10px', alignSelf: 'center' } })) : (
|
|
@@ -49,6 +49,7 @@ export { EditableName } from './EditableName';
|
|
|
49
49
|
export { VirtualizedMenu } from './VirtualizedMenu';
|
|
50
50
|
export { SearchPopover, PopoverAddField, PopoverSelect } from './SearchPopover';
|
|
51
51
|
export { CalendarSelection, CalendarSelectionConstants, CalendarSelectionUtils, } from './CalendarSelection';
|
|
52
|
+
export { RequestAccess } from './RequestAccess';
|
|
52
53
|
export * from './EmptyData';
|
|
53
54
|
export * from './PreviewModal';
|
|
54
55
|
export * from './DrawerDetail';
|
|
@@ -49,6 +49,7 @@ export { EditableName } from './EditableName';
|
|
|
49
49
|
export { VirtualizedMenu } from './VirtualizedMenu';
|
|
50
50
|
export { SearchPopover, PopoverAddField, PopoverSelect } from './SearchPopover';
|
|
51
51
|
export { CalendarSelection, CalendarSelectionConstants, CalendarSelectionUtils, } from './CalendarSelection';
|
|
52
|
+
export { RequestAccess } from './RequestAccess';
|
|
52
53
|
export * from './EmptyData';
|
|
53
54
|
export * from './PreviewModal';
|
|
54
55
|
export * from './DrawerDetail';
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
/* eslint-disable react/no-this-in-sfc */
|
|
11
11
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
12
12
|
import axios from 'axios';
|
|
13
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
13
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { CookiesProvider, useCookies } from 'react-cookie';
|
|
15
15
|
// Icons
|
|
16
16
|
import { Button, Flex, Popover, Spin, Text, Typography } from '../../atoms';
|
|
@@ -228,7 +228,7 @@ export const AccountSharing = props => {
|
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
// const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
231
|
-
const onClickButtonLogout = () => {
|
|
231
|
+
const onClickButtonLogout = useCallback(() => {
|
|
232
232
|
removeCookie(`${UOGS_PREFIX}${networkId}`, Object.assign(Object.assign({}, (env !== ENV.DEV && {
|
|
233
233
|
domain: `.${origin.split('.').splice(-2).join('.')}`,
|
|
234
234
|
})), { path: '/', sameSite: 'none', secure: true }));
|
|
@@ -240,7 +240,19 @@ export const AccountSharing = props => {
|
|
|
240
240
|
else {
|
|
241
241
|
window.location.reload();
|
|
242
242
|
}
|
|
243
|
-
};
|
|
243
|
+
}, [callbackLogout, env, networkId, removeCookie, urlLogout]);
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
const logoutEvent = (event) => {
|
|
246
|
+
const { data } = event;
|
|
247
|
+
if ((data === null || data === void 0 ? void 0 : data.type) === 'cdp_request_logout') {
|
|
248
|
+
onClickButtonLogout();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
window.addEventListener('message', logoutEvent);
|
|
252
|
+
return () => {
|
|
253
|
+
window.removeEventListener('message', logoutEvent);
|
|
254
|
+
};
|
|
255
|
+
}, [onClickButtonLogout]);
|
|
244
256
|
function urlDomain(data) {
|
|
245
257
|
const a = document.createElement('a');
|
|
246
258
|
a.href = data;
|