@antscorp/antsomi-ui 1.7.9 → 1.8.1
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/CHANGELOG.md +91 -0
- 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 +48 -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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
### Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
|
4
|
+
|
|
5
|
+
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
|
+
|
|
7
|
+
#### [v1.7.6](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.6..v2.0.22)
|
|
8
|
+
|
|
9
|
+
- chore: update storybook version [`d13f194`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d13f19462c2fe117934df7fe2e09fd0aa95a0167)
|
|
10
|
+
- feat: update input width when in view [`f27b982`](https://bitbucket.org/git-vn/at.packages.frontend/commits/f27b982a4427c414a1b5d5538641516a3d35aa6e)
|
|
11
|
+
- chore: update datatable components [`d38cf96`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d38cf9687b2a6fd03396247d04c6ef37a6b030f1)
|
|
12
|
+
|
|
13
|
+
### [v2.0.22](https://bitbucket.org/git-vn/at.packages.frontend/compare/v2.0.22..v1.7.5)
|
|
14
|
+
|
|
15
|
+
> 19 January 2023
|
|
16
|
+
|
|
17
|
+
#### [v1.7.5](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.5..v1.7.4)
|
|
18
|
+
|
|
19
|
+
> 11 July 2024
|
|
20
|
+
|
|
21
|
+
- feat(compoents): add component AccountProfile [`e504187`](https://bitbucket.org/git-vn/at.packages.frontend/commits/e5041873fa3236acf35312801754240a7542b8dd)
|
|
22
|
+
- chore(component): remove unuse common folder [`5123bac`](https://bitbucket.org/git-vn/at.packages.frontend/commits/5123bac8005db98661ca48c500aab56ac42b1feb)
|
|
23
|
+
- chore: update formatFitlerValue for useTablisting hook [`2b173a0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/2b173a02ab8fb24a8cd3b6d1c8403c111e831eb4)
|
|
24
|
+
|
|
25
|
+
#### [v1.7.4](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.4..v1.3.5-beta.446)
|
|
26
|
+
|
|
27
|
+
> 5 July 2024
|
|
28
|
+
|
|
29
|
+
- chore: update storybook version [`d13f194`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d13f19462c2fe117934df7fe2e09fd0aa95a0167)
|
|
30
|
+
- feat(MatchesAnySelect): create and handle new MatchesAnySelect component [`a89c46e`](https://bitbucket.org/git-vn/at.packages.frontend/commits/a89c46e00e81d5a28ac37f42166dcab1c49212df)
|
|
31
|
+
- chore: update filter matches any datatable [`4db6dc8`](https://bitbucket.org/git-vn/at.packages.frontend/commits/4db6dc81b62a9168ca9fe1a5e39e414e473e7285)
|
|
32
|
+
|
|
33
|
+
#### [v1.3.5-beta.446](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.3.5-beta.446..v1.0.10)
|
|
34
|
+
|
|
35
|
+
> 2 July 2024
|
|
36
|
+
|
|
37
|
+
- chore(datatable): update useTableListing hook [`262def1`](https://bitbucket.org/git-vn/at.packages.frontend/commits/262def14c8a44ae73d1d9163696afc25e026ba45)
|
|
38
|
+
- chore: update data table component [`7fce77d`](https://bitbucket.org/git-vn/at.packages.frontend/commits/7fce77db8191ff7633679ea9befe28718eb40a88)
|
|
39
|
+
- chore(storybook): add addon-controls [`8ea93fc`](https://bitbucket.org/git-vn/at.packages.frontend/commits/8ea93fc4bb41c50f7a7025bc79d968d849e8d113)
|
|
40
|
+
|
|
41
|
+
#### [v1.0.10](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.10..v1.0.9)
|
|
42
|
+
|
|
43
|
+
> 20 June 2024
|
|
44
|
+
|
|
45
|
+
#### [v1.0.9](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.9..v1.0.8)
|
|
46
|
+
|
|
47
|
+
> 20 June 2024
|
|
48
|
+
|
|
49
|
+
#### [v1.0.8](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.8..v1.0.3)
|
|
50
|
+
|
|
51
|
+
> 20 June 2024
|
|
52
|
+
|
|
53
|
+
- feat(SelectAccount): add component [`2f1dea0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/2f1dea035af07a01a6be8da47b531d52d2977bbe)
|
|
54
|
+
- fix: update style for calendar selection [`4347b91`](https://bitbucket.org/git-vn/at.packages.frontend/commits/4347b91f5bbe31caeb64478116c1822fe443f359)
|
|
55
|
+
- feat(EditorTab): use modal async in onCloseTab [`76aece8`](https://bitbucket.org/git-vn/at.packages.frontend/commits/76aece8cc7a44385d63019058daa1f8477c8fbcb)
|
|
56
|
+
|
|
57
|
+
#### [v1.0.3](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.3..v1.0.2)
|
|
58
|
+
|
|
59
|
+
> 17 January 2023
|
|
60
|
+
|
|
61
|
+
- update timeline package [`e198927`](https://bitbucket.org/git-vn/at.packages.frontend/commits/e198927d83931f9155e90ab9a1d9d3a5ac2989c4)
|
|
62
|
+
- update-ticket-editor [`38dd7b0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/38dd7b0a7b2b0b58a63e725419e9b057e053f44f)
|
|
63
|
+
- update-upload-file-ticket-editor [`bb2f2ef`](https://bitbucket.org/git-vn/at.packages.frontend/commits/bb2f2ef1c46f4239ad716c897e53856a6368ea7d)
|
|
64
|
+
|
|
65
|
+
#### v1.0.2
|
|
66
|
+
|
|
67
|
+
> 4 January 2023
|
|
68
|
+
|
|
69
|
+
- Sprint10/vinlt/feature/date advanced [`#24`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/24)
|
|
70
|
+
- Sprint10/sangndd/feature/extend value matches any [`#23`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/23)
|
|
71
|
+
- Sprint10/sangndd/feature/extend value matches any [`#22`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/22)
|
|
72
|
+
- [Scatter chart] Max X-axis giá trị bị lặp [`#20`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/20)
|
|
73
|
+
- Sprint8/vinlt/feature/show data label short [`#18`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/18)
|
|
74
|
+
- Fix duplicate axis max value [`#17`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/17)
|
|
75
|
+
- [Antalyser] Một số bug khi nhập axis giá trị thập phân [`#16`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/16)
|
|
76
|
+
- Sprint6/vinlt/fixbug/chart [`#15`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/15)
|
|
77
|
+
- - Axis allows input of decimal values [`#14`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/14)
|
|
78
|
+
- Sprint4/sangndd/feature/icons [`#12`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/12)
|
|
79
|
+
- Sprint4/sangndd/feature/icons [`#11`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/11)
|
|
80
|
+
- Sprint4/thanghn/fixbug/pivot alias border [`#10`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/10)
|
|
81
|
+
- fix scroll dimension and total column [`#9`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/9)
|
|
82
|
+
- [ANTALYSER][Filter][Khi filter filed có type date và semantic là "Month day" thì không load được danh sách các ngày trong tháng] [`#7`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/7)
|
|
83
|
+
- [ANTALYSER][Pivot chart][Tính năng Add border shadow chưa hoạt động] [`#8`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/8)
|
|
84
|
+
- Fix bug [ANTALYSER][Scatter chart][Label ở cột X và Y chưa đổi theo alias name đã change ở metric] [`#6`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/6)
|
|
85
|
+
- Fix bug [Pivot chart] Row color không hiển thị được khi chọn hiển thị data của metric là Bar [`#5`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/5)
|
|
86
|
+
- Fix bug package antscorp/charts [`#1`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/1)
|
|
87
|
+
- Fix bug package antscorp/chart [`#2`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/2)
|
|
88
|
+
- table component [`#1`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/1)
|
|
89
|
+
- Update map indonesia [`fc94208`](https://bitbucket.org/git-vn/at.packages.frontend/commits/fc9420838b3f4087a5763017e9bf7e72ee8c5e31)
|
|
90
|
+
- Update geomap [`43f3098`](https://bitbucket.org/git-vn/at.packages.frontend/commits/43f3098506f30a215dc2b30734590e5c55f8b490)
|
|
91
|
+
- sync package master [`7476118`](https://bitbucket.org/git-vn/at.packages.frontend/commits/7476118de2fcfa1bd6b0a9e3c0f887b29fd149b6)
|
|
@@ -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>;
|