@antscorp/antsomi-ui 1.7.4 → 1.7.6
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 +40 -8
- package/es/components/atoms/Scrollbars/Scrollbars.js +6 -5
- package/es/components/icons/DataIcon.d.ts +3 -0
- package/es/components/icons/DataIcon.js +18 -0
- package/es/components/icons/TableIcon.d.ts +3 -0
- package/es/components/icons/TableIcon.js +7 -0
- package/es/components/icons/hooks/useIcon.d.ts +5 -0
- package/es/components/icons/hooks/useIcon.js +9 -0
- package/es/components/icons/index.d.ts +2 -0
- package/es/components/icons/index.js +2 -0
- package/es/components/icons/type.d.ts +1 -0
- package/es/components/molecules/AccountSelection/styled.js +7 -1
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +1 -1
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +45 -20
- package/es/components/molecules/EditableName/EditableName.js +4 -1
- package/es/components/molecules/EditorTab/EditorTab.d.ts +2 -1
- package/es/components/molecules/EditorTab/EditorTab.js +4 -2
- package/es/components/molecules/EditorTab/index.d.ts +1 -0
- package/es/components/molecules/HeaderV2/HeaderV2.js +1 -1
- package/es/components/molecules/HeaderV2/constants.d.ts +1 -1
- package/es/components/molecules/HeaderV2/constants.js +1 -1
- package/es/components/molecules/HeaderV2/styled.d.ts +1 -1
- package/es/components/molecules/HeaderV2/styled.js +18 -9
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +43 -19
- package/es/components/molecules/MatchAnySelect/types.d.ts +4 -0
- package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.d.ts +0 -1
- package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.js +18 -104
- package/es/components/molecules/SearchPopover/components/PopoverSelect/PopoverSelect.d.ts +4 -0
- package/es/components/molecules/SearchPopover/components/PopoverSelect/PopoverSelect.js +132 -0
- package/es/components/molecules/SearchPopover/components/PopoverSelect/index.d.ts +1 -0
- package/es/components/molecules/SearchPopover/components/PopoverSelect/index.js +1 -0
- package/es/components/molecules/SearchPopover/components/index.d.ts +1 -0
- package/es/components/molecules/SearchPopover/components/index.js +1 -0
- package/es/components/molecules/SearchPopover/index.d.ts +1 -1
- package/es/components/molecules/SearchPopover/index.js +1 -1
- package/es/components/molecules/SearchPopover/types.d.ts +13 -5
- package/es/components/molecules/ShareAccess/ShareAccess.js +2 -2
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +3 -3
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +6 -5
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +1 -1
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.d.ts +1 -1
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +3 -2
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +18 -4
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +28 -14
- package/es/components/molecules/ShareAccess/types.d.ts +11 -10
- package/es/components/molecules/ShareAccess/utils.d.ts +7 -4
- package/es/components/molecules/ShareAccess/utils.js +15 -4
- package/es/components/molecules/Tabs/Tabs.js +4 -0
- package/es/components/molecules/index.d.ts +2 -1
- package/es/components/molecules/index.js +1 -1
- package/es/components/organism/AccountProfile/AccountProfile.d.ts +7 -0
- package/es/components/organism/AccountProfile/AccountProfile.js +21 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/AccountSetting.d.ts +5 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/AccountSetting.js +864 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/constant.d.ts +64 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/constant.js +64 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/index.d.ts +13 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/index.js +293 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.d.ts +4 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +103 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/images/english.png +0 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/images/vietnam.png +0 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/index.d.ts +18 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/index.js +77 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.d.ts +11 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +22 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/UploadAvatar/index.d.ts +10 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/UploadAvatar/index.js +83 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/constants.d.ts +126 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/constants.js +179 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/images/img-account-big.png +0 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/index.d.ts +1 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/index.js +1 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.d.ts +8 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +564 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/types.d.ts +36 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/types.js +2 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/useModal.d.ts +11 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/useModal.js +84 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/utils.d.ts +21 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/utils.js +94 -0
- package/es/components/organism/AccountProfile/index.d.ts +2 -0
- package/es/components/organism/AccountProfile/index.js +2 -0
- package/es/components/organism/AccountSharing/AccountSharing.js +16 -4
- package/es/components/organism/DataTable/components/Filter/AddFilterButton.js +7 -3
- package/es/components/organism/DataTable/components/Filter/FilterCondition/index.d.ts +1 -0
- package/es/components/organism/DataTable/components/Filter/FilterCondition/index.js +5 -3
- package/es/components/organism/DataTable/components/Filter/FilterConditionList.js +2 -2
- package/es/components/organism/DataTable/components/Filter/FilterItem.js +11 -9
- package/es/components/organism/DataTable/components/Pagination/index.d.ts +2 -1
- package/es/components/organism/DataTable/components/Pagination/index.js +19 -17
- package/es/components/organism/DataTable/components/Pagination/styled.js +2 -1
- package/es/components/organism/DataTable/components/Table/ResizableCell.js +7 -4
- package/es/components/organism/DataTable/components/Table/index.js +7 -1
- package/es/components/organism/DataTable/components/Table/styled.js +7 -7
- package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +8 -4
- package/es/components/organism/DataTable/hooks/useAddFilterButton.d.ts +1 -0
- package/es/components/organism/DataTable/hooks/useAddFilterButton.js +3 -2
- package/es/components/organism/DataTable/hooks/useDataTable.js +2 -1
- package/es/components/organism/DataTable/hooks/useDataTableListing/types.d.ts +16 -3
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +80 -35
- package/es/components/organism/DataTable/styled/index.js +0 -5
- package/es/components/organism/DataTable/types/filter.d.ts +3 -1
- package/es/components/organism/DataTable/utils/filter.d.ts +4 -2
- package/es/components/organism/DataTable/utils/filter.js +59 -35
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +6 -6
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +37 -25
- package/es/components/organism/LeftMenu/constants/variables.d.ts +8 -0
- package/es/components/organism/LeftMenu/constants/variables.js +10 -15
- package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +2 -0
- package/es/components/organism/LeftMenu/hooks/usePermission.js +18 -3
- package/es/components/organism/LeftMenu/styled.js +20 -0
- package/es/components/organism/LeftMenu/types/index.d.ts +2 -0
- package/es/components/organism/LeftMenu/utils/index.d.ts +5 -1
- package/es/components/organism/LeftMenu/utils/index.js +54 -26
- package/es/components/organism/ModifyColumnModal/ModifyColumnModal.js +4 -2
- package/es/components/organism/ModifyColumnModal/styled.js +4 -0
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/template/Layout/Layout.js +22 -11
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/index.js +2 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +3 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/index.js +1 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +15 -0
- package/es/components/template/Layout/components/RecommendationWorkspace/index.js +4 -21
- package/es/components/template/Layout/constants/permission.d.ts +1 -0
- package/es/components/template/Layout/constants/permission.js +1 -0
- package/es/components/template/Layout/stores/index.d.ts +1 -0
- package/es/components/template/Layout/styled.js +2 -2
- package/es/components/template/Layout/types.d.ts +1 -0
- package/es/components/template/TemplateListing/hooks/useTemplateListing.js +1 -0
- package/es/config/index.d.ts +1 -0
- package/es/config/index.js +1 -0
- package/es/constants/api.d.ts +5 -0
- package/es/constants/api.js +4 -0
- package/es/constants/condition.js +1 -1
- package/es/constants/postMessage.d.ts +1 -0
- package/es/constants/postMessage.js +1 -0
- package/es/constants/queries.d.ts +2 -0
- package/es/constants/queries.js +2 -0
- package/es/locales/en/translation.json +64 -0
- package/es/locales/i18n.d.ts +128 -0
- package/es/locales/translations.d.ts +64 -0
- package/es/locales/vi/translation.json +64 -0
- package/es/models/AccountListing.d.ts +12 -0
- package/es/models/DataTable/DataTableListing.d.ts +1 -0
- package/es/models/LeftMenu/FeatureMenu.d.ts +2 -0
- package/es/models/LeftMenu/FeatureMenuPermission.d.ts +2 -1
- package/es/providers/ConfigProvider/GlobalStyle.js +4 -4
- package/es/queries/Account/useGetAccountList.d.ts +9 -4
- package/es/queries/Account/useGetAccountList.js +6 -1
- package/es/queries/DataTable/index.d.ts +6 -1
- package/es/queries/DataTable/index.js +6 -2
- package/es/services/Account/index.d.ts +7 -5
- package/es/services/Account/index.js +24 -0
- package/es/tests/DataTableTest.js +18 -8
- package/es/utils/common.js +1 -1
- package/es/utils/dataTable.d.ts +1 -0
- package/es/utils/dataTable.js +19 -2
- package/package.json +4 -2
- package/es/components/common/ConfigProvider/ConfigProvider.d.ts +0 -11
- package/es/components/common/ConfigProvider/ConfigProvider.js +0 -63
- package/es/components/common/ConfigProvider/GlobalStyle.d.ts +0 -5
- package/es/components/common/ConfigProvider/GlobalStyle.js +0 -868
- package/es/components/common/ConfigProvider/index.d.ts +0 -1
- package/es/components/common/ConfigProvider/index.js +0 -1
- package/es/components/organism/DataTable/components/Filter/FilterCondition/utils.d.ts +0 -0
- package/es/components/organism/DataTable/components/Filter/FilterCondition/utils.js +0 -1
- /package/es/components/molecules/SearchPopover/components/{PopoverAddField → PopoverSelect}/styles.scss +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,23 +4,55 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### [v1.7.
|
|
7
|
+
#### [v1.7.6](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.6..v2.0.22)
|
|
8
8
|
|
|
9
9
|
- chore: update storybook version [`d13f194`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d13f19462c2fe117934df7fe2e09fd0aa95a0167)
|
|
10
|
-
- feat
|
|
11
|
-
-
|
|
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
12
|
|
|
13
|
-
|
|
13
|
+
### [v2.0.22](https://bitbucket.org/git-vn/at.packages.frontend/compare/v2.0.22..v1.7.5)
|
|
14
14
|
|
|
15
15
|
> 19 January 2023
|
|
16
16
|
|
|
17
|
-
#### [v1.
|
|
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)
|
|
18
34
|
|
|
19
35
|
> 2 July 2024
|
|
20
36
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
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)
|
|
24
56
|
|
|
25
57
|
#### [v1.0.3](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.3..v1.0.2)
|
|
26
58
|
|
|
@@ -12,16 +12,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { Scrollbars as CustomScrollbars, } from 'react-custom-scrollbars';
|
|
13
13
|
import { cloneDeep } from 'lodash';
|
|
14
14
|
// Libraries
|
|
15
|
-
import React, { useRef } from 'react';
|
|
15
|
+
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
16
16
|
// Styled
|
|
17
17
|
import { HorizontalTrack, ThumbBar, VerticalTrack } from './styled';
|
|
18
18
|
const THUMB_SIZE = 4;
|
|
19
19
|
const MARGIN = 3;
|
|
20
|
-
export const Scrollbars = props => {
|
|
20
|
+
export const Scrollbars = forwardRef((props, refProp) => {
|
|
21
21
|
// Props
|
|
22
22
|
const { autoHide = true, autoHeightMax = 0, className } = props, restProps = __rest(props, ["autoHide", "autoHeightMax", "className"]);
|
|
23
23
|
// Refs
|
|
24
24
|
const ref = useRef(null);
|
|
25
|
+
useImperativeHandle(refProp, () => ref.current, []);
|
|
25
26
|
/**
|
|
26
27
|
* Updates the size and position of the custom scrollbar thumbs based on the provided dimensions and scroll positions.
|
|
27
28
|
*
|
|
@@ -57,7 +58,7 @@ export const Scrollbars = props => {
|
|
|
57
58
|
ref.current.trackHorizontal.style.visibility =
|
|
58
59
|
scrollWidth <= clientWidth ? 'hidden' : 'visible';
|
|
59
60
|
};
|
|
60
|
-
return (React.createElement(CustomScrollbars, Object.assign({ className: `custom-scrollbars ${className || ''}`,
|
|
61
|
+
return (React.createElement(CustomScrollbars, Object.assign({ className: `custom-scrollbars ${className || ''}`, autoHide: autoHide, autoHeightMax: autoHeightMax, renderThumbVertical: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-vertical" }, props)), renderThumbHorizontal: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-horizontal" }, props)), renderTrackVertical: (_a) => {
|
|
61
62
|
var { style } = _a, restOfProps = __rest(_a, ["style"]);
|
|
62
63
|
return (React.createElement(VerticalTrack, Object.assign({ className: "scrollbar-track" }, restOfProps, { style: Object.assign(Object.assign({}, style), { display: 'block' }) })));
|
|
63
64
|
}, renderTrackHorizontal: (_a) => {
|
|
@@ -77,5 +78,5 @@ export const Scrollbars = props => {
|
|
|
77
78
|
// }
|
|
78
79
|
// Return a div element with the adjusted styles and original props, applying a custom class for styling
|
|
79
80
|
return React.createElement("div", Object.assign({ className: "scrollbar-view" }, props, { style: newStyle }));
|
|
80
|
-
}, onUpdate: onUpdate, hideTracksWhenNotNeeded: true }, restProps)));
|
|
81
|
-
};
|
|
81
|
+
}, onUpdate: onUpdate, hideTracksWhenNotNeeded: true }, restProps, { ref: ref })));
|
|
82
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React, { forwardRef } from 'react';
|
|
14
|
+
export const DataIcon = forwardRef((props, ref) => {
|
|
15
|
+
const restProps = __rest(props, []);
|
|
16
|
+
return (React.createElement("svg", Object.assign({ ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, restProps),
|
|
17
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.002 6.5C19.002 7.88071 15.6499 9 11.515 9C7.38 9 4.02795 7.88071 4.02795 6.5C4.02795 5.11929 7.38 4 11.515 4C15.6499 4 19.002 5.11929 19.002 6.5ZM18.974 12.131C18.974 13.42 15.622 14.465 11.487 14.465C7.352 14.465 4 13.419 4 12.131V8.46204C4 9.75104 7.352 10.795 11.487 10.795C15.622 10.795 18.974 9.74904 18.974 8.46204V12.131ZM18.974 17.8423C18.974 19.1313 15.622 20.1763 11.487 20.1763C7.352 20.1763 4 19.1303 4 17.8423V14.1733C4 15.4623 7.352 16.5063 11.487 16.5063C15.622 16.5063 18.974 15.4603 18.974 14.1733V17.8423Z", fill: "currentColor" })));
|
|
18
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useIcon } from './hooks/useIcon';
|
|
3
|
+
export const TableIcon = forwardRef((props, ref) => {
|
|
4
|
+
const { width, height } = useIcon(props);
|
|
5
|
+
return (React.createElement("svg", Object.assign({}, props, { ref: ref, width: width, height: height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }),
|
|
6
|
+
React.createElement("path", { d: "M3 14.0156V9.98438H6.98438V14.0156H3ZM3 18.9844V15H6.98438V18.9844H3ZM3 9V5.01562H6.98438V9H3ZM8.01562 14.0156V9.98438H21V14.0156H8.01562ZM8.01562 18.9844V15H21V18.9844H8.01562ZM8.01562 5.01562H21V9H8.01562V5.01562Z", fill: "currentColor" })));
|
|
7
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
export const useIcon = (props) => {
|
|
3
|
+
const { size = 24 } = props;
|
|
4
|
+
const [width, height] = useMemo(() => [size || (props === null || props === void 0 ? void 0 : props.width), size || (props === null || props === void 0 ? void 0 : props.height)], [size, props.width, props.height]);
|
|
5
|
+
return {
|
|
6
|
+
width,
|
|
7
|
+
height,
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2
|
-
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
2
|
+
import { globalToken, THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
export const AccountSelectionStyled = styled.div `
|
|
5
5
|
background-color: white;
|
|
@@ -13,6 +13,12 @@ export const AccountSelectionStyled = styled.div `
|
|
|
13
13
|
padding: 8px 10px;
|
|
14
14
|
height: 40px;
|
|
15
15
|
box-sizing: border-box;
|
|
16
|
+
border-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw3};
|
|
17
|
+
&:hover,
|
|
18
|
+
&:focus,
|
|
19
|
+
&:focus-within {
|
|
20
|
+
border-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw3};
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
.recent-text {
|
package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js
CHANGED
|
@@ -57,7 +57,7 @@ export const AdvancedRangePicker = props => {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
return (React.createElement(Space, { size:
|
|
60
|
+
return (React.createElement(Space, { size: 15, align: "end", className: className || '' },
|
|
61
61
|
React.createElement(AdvancedPicker, { valueType: valueType, disabled: disabled, label: showLabel ? t(translations.datePicker.startDate) || '' : '', date: timeRange.startDate.date, option: omit(timeRange.startDate, 'date'), operatorKey: "between", type: "startDate", format: useFormatMapping
|
|
62
62
|
? getFormatDisplayFromValueType('startDate', valueType)
|
|
63
63
|
: ADVANCED_RANGE_PICKER_FORMAT.startDate,
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
// Libraries
|
|
13
13
|
import { ConfigProvider } from 'antd';
|
|
14
14
|
import { isNil } from 'lodash';
|
|
15
|
-
import React, { useEffect, useMemo } from 'react';
|
|
15
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
16
16
|
// Components
|
|
17
17
|
import { Flex, Icon, Tooltip } from '../../atoms';
|
|
18
18
|
// Styled
|
|
@@ -24,9 +24,10 @@ import { ToggleDrawerSizeButton } from './components';
|
|
|
24
24
|
import { useMediaQuery, useToggle } from '@antscorp/antsomi-ui/es/hooks';
|
|
25
25
|
// Utils
|
|
26
26
|
import { safeParseJson } from '@antscorp/antsomi-ui/es/utils';
|
|
27
|
+
import { POST_MESSAGE_TYPES } from '@antscorp/antsomi-ui/es/constants';
|
|
27
28
|
export const DrawerDetail = props => {
|
|
28
29
|
// Props
|
|
29
|
-
const { width, fullScreen, children, menuProps, closeIconProps, maxWidth, minWidth, defaultSize = 'max', headerProps, name, destroyOnClose = true } = props, restProps = __rest(props, ["width", "fullScreen", "children", "menuProps", "closeIconProps", "maxWidth", "minWidth", "defaultSize", "headerProps", "name", "destroyOnClose"]);
|
|
30
|
+
const { width, fullScreen: fullScreenProp = false, children, menuProps, closeIconProps, maxWidth, minWidth, defaultSize = 'max', headerProps, name, destroyOnClose = true } = props, restProps = __rest(props, ["width", "fullScreen", "children", "menuProps", "closeIconProps", "maxWidth", "minWidth", "defaultSize", "headerProps", "name", "destroyOnClose"]);
|
|
30
31
|
const { show: showMenu = true, showExpandButton = true, showClose = true, items, selectedKeys, footer, onClick = () => { }, } = menuProps || {};
|
|
31
32
|
const _a = headerProps || {}, { children: headerChildren } = _a, restOfHeaderProps = __rest(_a, ["children"]);
|
|
32
33
|
const { onClose = () => { } } = props;
|
|
@@ -35,7 +36,25 @@ export const DrawerDetail = props => {
|
|
|
35
36
|
const matchesSmallScreen = useMediaQuery(`(max-width: ${BREAK_POINT})`);
|
|
36
37
|
// State
|
|
37
38
|
const [collapseDrawer, toggleCollapseDrawer] = useToggle(false);
|
|
39
|
+
const [fullScreen, toggleFullScreen] = useToggle(fullScreenProp);
|
|
40
|
+
// Handlers
|
|
41
|
+
const handleToggleDrawerDetailFullscreen = useCallback((event) => {
|
|
42
|
+
const { type, data } = event.data || {};
|
|
43
|
+
const { name: payloadName, value } = data || {};
|
|
44
|
+
if (type === POST_MESSAGE_TYPES.TOGGLE_DRAWER_DETAIL_FULLSCREEN && payloadName === name) {
|
|
45
|
+
toggleFullScreen(isNil(value) ? undefined : value);
|
|
46
|
+
}
|
|
47
|
+
}, [name, toggleFullScreen]);
|
|
38
48
|
// Effects
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
window.addEventListener('message', handleToggleDrawerDetailFullscreen);
|
|
51
|
+
return () => {
|
|
52
|
+
window.removeEventListener('message', handleToggleDrawerDetailFullscreen);
|
|
53
|
+
};
|
|
54
|
+
}, [handleToggleDrawerDetailFullscreen]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
toggleFullScreen(fullScreenProp);
|
|
57
|
+
}, [fullScreenProp, toggleFullScreen]);
|
|
39
58
|
useEffect(() => {
|
|
40
59
|
if (matchesSmallScreen) {
|
|
41
60
|
toggleCollapseDrawer(false);
|
|
@@ -87,7 +106,6 @@ export const DrawerDetail = props => {
|
|
|
87
106
|
}
|
|
88
107
|
}
|
|
89
108
|
}, [collapseDrawer, fullScreen, matchesSmallScreen, maxWidth, minWidth, width]);
|
|
90
|
-
// Handlers
|
|
91
109
|
const handleToggleDrawerSize = () => {
|
|
92
110
|
const localStorageValues = safeParseJson(localStorage.getItem(DRAWER_DETAIL_LOCAL_STORAGE_KEY), {});
|
|
93
111
|
toggleCollapseDrawer(!collapseDrawer);
|
|
@@ -98,25 +116,32 @@ export const DrawerDetail = props => {
|
|
|
98
116
|
localStorage.setItem(DRAWER_DETAIL_LOCAL_STORAGE_KEY, JSON.stringify(Object.assign(Object.assign({}, localStorageValues), { [name || '']: !collapseDrawer })));
|
|
99
117
|
}
|
|
100
118
|
};
|
|
101
|
-
return (React.createElement(ConfigProvider, { theme: {
|
|
119
|
+
return (React.createElement(ConfigProvider, { theme: {
|
|
120
|
+
token: {
|
|
121
|
+
motion: false,
|
|
122
|
+
},
|
|
123
|
+
} },
|
|
102
124
|
React.createElement(StyledDrawer, Object.assign({ push: false, closable: false, width: drawerWidth, classNames: {
|
|
103
125
|
body: 'drawer-detail-body',
|
|
126
|
+
}, contentWrapperStyle: {
|
|
127
|
+
transition: 'none',
|
|
104
128
|
}, destroyOnClose: destroyOnClose }, restProps),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
React.createElement("
|
|
113
|
-
|
|
114
|
-
React.createElement(
|
|
115
|
-
|
|
116
|
-
React.createElement(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
React.createElement(ConfigProvider, { theme: { token: { motion: true } } },
|
|
130
|
+
showCloseIcon && (React.createElement("div", Object.assign({ className: "close-btn" }, restOfCloseIcon, { onClick: e => {
|
|
131
|
+
onCloseIconClick(e);
|
|
132
|
+
onClose(e);
|
|
133
|
+
} }),
|
|
134
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
|
|
135
|
+
showExpandButton && !fullScreen && (React.createElement(ToggleDrawerSizeButton, { style: Object.assign({}, (!showMenu && { background: '#ffffff' })), onClick: () => handleToggleDrawerSize(), collapse: collapseDrawer })),
|
|
136
|
+
showMenu && (React.createElement(LeftMenu, { className: "animate__animated animate__fadeIn" },
|
|
137
|
+
React.createElement("div", null,
|
|
138
|
+
showClose && (React.createElement(CloseBtn, { onClick: onClose },
|
|
139
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
|
|
140
|
+
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" },
|
|
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)))));
|
|
121
146
|
};
|
|
122
147
|
DrawerDetail.defaultProps = {};
|
|
@@ -70,6 +70,9 @@ export const EditableName = React.forwardRef((props, ref) => {
|
|
|
70
70
|
(error || requiredError) && !isLoading ? (React.createElement("div", { className: "suffix-icon-error" },
|
|
71
71
|
React.createElement(Tooltip, { title: error || requiredError },
|
|
72
72
|
React.createElement(Icon, { type: "icon-ants-warning-circle", style: { color: '#F44336', fontSize: '19.2px' } })))) : readonly ? null : (React.createElement("div", { className: "suffix-icon" },
|
|
73
|
-
React.createElement(Icon, { type: "icon-ants-pencil", style: { color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.blue7, fontSize: '24px' }
|
|
73
|
+
React.createElement(Icon, { type: "icon-ants-pencil", style: { color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.blue7, fontSize: '24px' }, onClick: () => {
|
|
74
|
+
var _a;
|
|
75
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
76
|
+
} }))),
|
|
74
77
|
React.createElement("span", { ref: spanRef, className: "hidden-span" })));
|
|
75
78
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ModalFuncProps } from 'antd';
|
|
3
|
-
interface EditorTabItem {
|
|
3
|
+
export interface EditorTabItem {
|
|
4
4
|
showIcon?: boolean;
|
|
5
5
|
closeable?: boolean;
|
|
6
6
|
showDropdown?: boolean;
|
|
7
|
+
hideRemoveOption?: boolean;
|
|
7
8
|
id: string;
|
|
8
9
|
name: string;
|
|
9
10
|
type: 'query' | 'table-detail';
|
|
@@ -157,7 +157,7 @@ export const EditorTab = props => {
|
|
|
157
157
|
React.createElement(Icon, { type: "icon-ants-angle-left" }))),
|
|
158
158
|
React.createElement("div", { ref: leftBlockRef, className: classnames('left-block', leftBlockClassName), onWheel: onWheelLeftBlock }, arrTabs && arrTabs.length
|
|
159
159
|
? arrTabs.map((tab, idx) => {
|
|
160
|
-
const { showIcon = true, showDropdown = true, closeable = true } = tab;
|
|
160
|
+
const { showIcon = true, showDropdown = true, hideRemoveOption, closeable = true, } = tab;
|
|
161
161
|
return (React.createElement("div", { key: tab.id, onClick: () => handleActiveTab(tab.id), className: classnames('tab-item', tabItemClassName, {
|
|
162
162
|
active: tab.id === activeTabId,
|
|
163
163
|
}) },
|
|
@@ -170,7 +170,9 @@ export const EditorTab = props => {
|
|
|
170
170
|
showDropdown ? (React.createElement(Dropdown, { menu: {
|
|
171
171
|
items: [
|
|
172
172
|
{ label: 'Configure', key: 'configure', style: { minWidth: '135px' } },
|
|
173
|
-
|
|
173
|
+
...(hideRemoveOption
|
|
174
|
+
? []
|
|
175
|
+
: [{ label: 'Remove', key: 'remove', style: { minWidth: '135px' } }]),
|
|
174
176
|
],
|
|
175
177
|
onClick: (_a) => __awaiter(void 0, [_a], void 0, function* ({ key, domEvent }) {
|
|
176
178
|
switch (key) {
|
|
@@ -110,7 +110,7 @@ export const HeaderV2 = memo(props => {
|
|
|
110
110
|
const QUOTE_ENTITY = React.createElement(React.Fragment, null, "\u00BB");
|
|
111
111
|
return (React.createElement(HeaderV2Styled, { className: className || '', style: style },
|
|
112
112
|
React.createElement("div", { className: "left-side" },
|
|
113
|
-
showLogo && (React.createElement(LogoWrapper,
|
|
113
|
+
showLogo && (React.createElement(LogoWrapper, { className: "logo-wrapper" },
|
|
114
114
|
React.createElement("img", { src: SubLogoAntsomi, alt: "Antsomi sub logo" }))),
|
|
115
115
|
React.createElement(AccountSelection, Object.assign({}, accountSelectionProps, { currentAccount: selectedAccount, apiConfig: accountSelectionApiConfig, onChange: handleChangeAccount, inputStyle: inputStyle })),
|
|
116
116
|
React.createElement("div", { className: "title-container" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HEADER_HEIGHT =
|
|
1
|
+
export declare const HEADER_HEIGHT = 57;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const HEADER_HEIGHT =
|
|
1
|
+
export const HEADER_HEIGHT = 57;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HeaderV2Styled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
1
|
export declare const LogoWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const HeaderV2Styled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,6 +3,15 @@ var _a, _b, _c;
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
// Constants
|
|
5
5
|
import { THEME, globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
6
|
+
export const LogoWrapper = styled.div `
|
|
7
|
+
height: 30px;
|
|
8
|
+
width: 30px;
|
|
9
|
+
|
|
10
|
+
img {
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
6
15
|
export const HeaderV2Styled = styled.div `
|
|
7
16
|
height: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.headerHeight};
|
|
8
17
|
background-color: #f6f8fc;
|
|
@@ -22,6 +31,15 @@ export const HeaderV2Styled = styled.div `
|
|
|
22
31
|
.left-side {
|
|
23
32
|
flex: 1;
|
|
24
33
|
overflow: hidden;
|
|
34
|
+
|
|
35
|
+
.logo-wrapper {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.title-container {
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
25
43
|
}
|
|
26
44
|
|
|
27
45
|
.header-breadcrumbs,
|
|
@@ -47,12 +65,3 @@ export const HeaderV2Styled = styled.div `
|
|
|
47
65
|
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorTextBase};
|
|
48
66
|
}
|
|
49
67
|
`;
|
|
50
|
-
export const LogoWrapper = styled.div `
|
|
51
|
-
height: 30px;
|
|
52
|
-
width: 30px;
|
|
53
|
-
|
|
54
|
-
img {
|
|
55
|
-
height: 100%;
|
|
56
|
-
width: 100%;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
// Libraries
|
|
14
14
|
import { ConfigProvider } from 'antd';
|
|
15
15
|
import { uniqBy } from 'lodash';
|
|
16
|
-
import React, { useMemo, useState } from 'react';
|
|
16
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
17
17
|
// Components
|
|
18
18
|
import { EmptyData, Select } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
19
19
|
import { Button, Flex, Icon, Input, Popover, Scrollbars, Spin, Typography, Tooltip, } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
@@ -27,25 +27,37 @@ import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
|
27
27
|
import { MATCHES_ANY_THEME } from './constants';
|
|
28
28
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
29
29
|
// Hooks
|
|
30
|
-
import { useDeepCompareEffect, useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
30
|
+
import { useDeepCompareEffect, useDeepCompareMemo, useIntersectionObserver, } from '@antscorp/antsomi-ui/es/hooks';
|
|
31
31
|
// Utils
|
|
32
32
|
import { flatTree, recursiveSearchItems } from '@antscorp/antsomi-ui/es/utils';
|
|
33
|
+
import { DataIcon } from '../../icons';
|
|
33
34
|
const initialState = {
|
|
34
35
|
isOpenPopover: false,
|
|
35
36
|
};
|
|
36
37
|
const matchesAnyInitialState = {
|
|
37
38
|
searchValue: '',
|
|
38
39
|
selectedItems: [],
|
|
40
|
+
isShowLoadMoreEl: false,
|
|
39
41
|
};
|
|
40
42
|
const { t } = i18nInstance;
|
|
41
43
|
const { Text } = Typography;
|
|
42
44
|
export const MatchesAny = props => {
|
|
43
45
|
// Props
|
|
44
|
-
const { objectName, loading = false, showExtendValue = true, items, onApply = () => { }, onCancel = () => { } } = props, restOfProps = __rest(props, ["objectName", "loading", "showExtendValue", "items", "onApply", "onCancel"]);
|
|
46
|
+
const { objectName, loading = false, showExtendValue = true, items, onApply = () => { }, onCancel = () => { }, onLoadMore = () => { } } = props, restOfProps = __rest(props, ["objectName", "loading", "showExtendValue", "items", "onApply", "onCancel", "onLoadMore"]);
|
|
45
47
|
// State
|
|
46
48
|
const [state, setState] = useState(matchesAnyInitialState);
|
|
47
49
|
// Variables
|
|
48
|
-
const { searchValue, selectedItems } = state;
|
|
50
|
+
const { searchValue, selectedItems, isShowLoadMoreEl } = state;
|
|
51
|
+
// Refs
|
|
52
|
+
const { ref: loadMoreRef } = useIntersectionObserver({
|
|
53
|
+
threshold: 0,
|
|
54
|
+
initialIsIntersecting: false,
|
|
55
|
+
onChange(isIntersecting) {
|
|
56
|
+
if (isIntersecting) {
|
|
57
|
+
onLoadMore();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
});
|
|
49
61
|
// Effects
|
|
50
62
|
/**
|
|
51
63
|
* Updates the `selectedItems` state when the `selectedItems` prop changes.
|
|
@@ -53,6 +65,12 @@ export const MatchesAny = props => {
|
|
|
53
65
|
useDeepCompareEffect(() => {
|
|
54
66
|
setState(prev => (Object.assign(Object.assign({}, prev), { selectedItems: props.selectedItems })));
|
|
55
67
|
}, [props.selectedItems]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
// Delay for show load more el
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
setState(prev => (Object.assign(Object.assign({}, prev), { isShowLoadMoreEl: true })));
|
|
72
|
+
}, 500);
|
|
73
|
+
}, []);
|
|
56
74
|
// Handlers
|
|
57
75
|
/**
|
|
58
76
|
* Adds an item and, if applicable, its leaf descendants to the list of selected items.
|
|
@@ -146,7 +164,10 @@ export const MatchesAny = props => {
|
|
|
146
164
|
(selectedItem.isExtendValue && selectedItem.title === item.title)))
|
|
147
165
|
: selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.some(selectedItem => selectedItem.key === item.key ||
|
|
148
166
|
(selectedItem.isExtendValue && selectedItem.title === item.title));
|
|
149
|
-
return Object.assign(Object.assign(Object.assign({}, item), { title: renderItemNodeTitle({
|
|
167
|
+
return Object.assign(Object.assign(Object.assign({}, item), { title: renderItemNodeTitle({
|
|
168
|
+
item,
|
|
169
|
+
onSelectItem,
|
|
170
|
+
}), disabled: isSelected }), (item.children && {
|
|
150
171
|
children: serializeTreeData(item.children),
|
|
151
172
|
}));
|
|
152
173
|
});
|
|
@@ -154,8 +175,10 @@ export const MatchesAny = props => {
|
|
|
154
175
|
return { treeData, matchedParents };
|
|
155
176
|
}, [items, searchValue, selectedItems]);
|
|
156
177
|
const selectedTreeData = useMemo(() => {
|
|
157
|
-
|
|
158
|
-
const
|
|
178
|
+
var _a;
|
|
179
|
+
const notExtendValueSelectedItems = (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.filter(item => !item.isExtendValue)) || [];
|
|
180
|
+
const extendValueSelectedItems = (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.filter(item => item.isExtendValue)) || [];
|
|
181
|
+
const lazyLoadSelectedItems = (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.filter(selectedItem => !flatTree(items || [], 'children').some(item => item.key === selectedItem.key))) || [];
|
|
159
182
|
const serializeTreeData = (list) => {
|
|
160
183
|
var _a;
|
|
161
184
|
return ((_a = list
|
|
@@ -175,7 +198,7 @@ export const MatchesAny = props => {
|
|
|
175
198
|
children: serializeTreeData(item.children),
|
|
176
199
|
}))))) || [];
|
|
177
200
|
};
|
|
178
|
-
return serializeTreeData(items || []).concat((extendValueSelectedItems === null ||
|
|
201
|
+
return serializeTreeData(items || []).concat(((_a = [...lazyLoadSelectedItems, ...extendValueSelectedItems]) === null || _a === void 0 ? void 0 : _a.map(item => (Object.assign(Object.assign({}, item), { title: renderItemNodeTitle({ item, onRemoveItem }) })))) || []);
|
|
179
202
|
}, [items, selectedItems]);
|
|
180
203
|
const isDisableRemoveAll = useDeepCompareMemo(() => !(selectedTreeData === null || selectedTreeData === void 0 ? void 0 : selectedTreeData.length), [selectedTreeData]);
|
|
181
204
|
const isDisableSelectAll = useDeepCompareMemo(() => {
|
|
@@ -194,21 +217,22 @@ export const MatchesAny = props => {
|
|
|
194
217
|
React.createElement(Text, { strong: true }, `${objectName} (${flatTree(items, 'children').filter(item => !item.children).length})`),
|
|
195
218
|
React.createElement(TextButton, { disabled: isDisableSelectAll, onClick: onSelectAll }, t(translations.global.selectAll).toString())),
|
|
196
219
|
React.createElement(Spin, { spinning: loading },
|
|
197
|
-
React.createElement(Scrollbars, { style: { height: '100%' } }, (treeData === null || treeData === void 0 ? void 0 : treeData.length) ? (React.createElement(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
220
|
+
React.createElement(Scrollbars, { style: { height: '100%' } }, (treeData === null || treeData === void 0 ? void 0 : treeData.length) ? (React.createElement(React.Fragment, null,
|
|
221
|
+
React.createElement(StyledTree, { key: searchValue, defaultExpandedKeys: matchedParents.map(item => item.key), selectable: false, treeData: treeData, switcherIcon: props => (React.createElement(Icon, { type: "icon-ants-caret-down", style: {
|
|
222
|
+
transform: props.expanded ? 'rotate(0)' : 'rotate(-90deg)',
|
|
223
|
+
transition: 'transform 0.3s ease',
|
|
224
|
+
}, color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8 })) }),
|
|
225
|
+
isShowLoadMoreEl && React.createElement("div", { ref: loadMoreRef }))) : (React.createElement(EmptyData, { showIcon: false, description: t(translations.global.noResultsMatchesKeyWord).toString() })))))));
|
|
201
226
|
};
|
|
202
227
|
const renderSelectedList = () => (React.createElement("div", { className: "matches-any__section" },
|
|
203
228
|
React.createElement(Flex, { className: "matches-any__header", justify: "space-between" },
|
|
204
229
|
React.createElement(Text, { strong: true }, `${t(translations.global.selected)} (${(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) || 0})`),
|
|
205
230
|
React.createElement(TextButton, { disabled: isDisableRemoveAll, onClick: onRemoveAll }, t(translations.global.removeAll).toString())),
|
|
206
231
|
React.createElement("div", { className: "matches-any__body" },
|
|
207
|
-
React.createElement(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}, color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8 })) })))))));
|
|
232
|
+
React.createElement(Scrollbars, { style: { height: '100%' } }, !(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) ? (React.createElement(EmptyData, { icon: React.createElement(DataIcon, { color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw5, width: 48, height: 48 }), description: t(translations.global.selectItemsFromList).toString() })) : (React.createElement(StyledTree, { selectable: false, treeData: selectedTreeData, switcherIcon: props => (React.createElement(Icon, { type: "icon-ants-caret-down", style: {
|
|
233
|
+
transform: props.expanded ? 'rotate(0)' : 'rotate(-90deg)',
|
|
234
|
+
transition: 'transform 0.3s ease',
|
|
235
|
+
}, color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw8 })) }))))));
|
|
212
236
|
// Handlers
|
|
213
237
|
const onApplyExtendValue = (extendValues) => {
|
|
214
238
|
// Filter out values that are already present in selectedItems
|
|
@@ -238,7 +262,7 @@ export const MatchesAny = props => {
|
|
|
238
262
|
};
|
|
239
263
|
export const MatchesAnySelect = props => {
|
|
240
264
|
var _a, _b, _c;
|
|
241
|
-
const { placeholder = 'Select an item', dropdownStyle, objectName, selectedItems, items, loading, popupClassName, onChange = () => { } } = props, restProps = __rest(props, ["placeholder", "dropdownStyle", "objectName", "selectedItems", "items", "loading", "popupClassName", "onChange"]);
|
|
265
|
+
const { placeholder = 'Select an item', dropdownStyle, objectName, selectedItems, items, loading, popupClassName, onChange = () => { }, onLoadMore } = props, restProps = __rest(props, ["placeholder", "dropdownStyle", "objectName", "selectedItems", "items", "loading", "popupClassName", "onChange", "onLoadMore"]);
|
|
242
266
|
// State
|
|
243
267
|
const [state, setState] = useState(initialState);
|
|
244
268
|
// Variables
|
|
@@ -251,7 +275,7 @@ export const MatchesAnySelect = props => {
|
|
|
251
275
|
onChange(selectedItems);
|
|
252
276
|
setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false })));
|
|
253
277
|
};
|
|
254
|
-
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 }))) }), overlayStyle: { width: 700 }, overlayInnerStyle: {
|
|
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 }), overlayStyle: { width: 700 }, overlayInnerStyle: {
|
|
255
279
|
padding: 0,
|
|
256
280
|
}, trigger: ['click'], destroyTooltipOnHide: true, onOpenChange: () => setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: !isOpenPopover }))) },
|
|
257
281
|
React.createElement(Tooltip, { mouseEnterDelay: 0.5, title: `${selectedItems ? selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => item.title).join(', ') : ''}` },
|
|
@@ -20,6 +20,8 @@ export interface MatchesAnySelectProps extends SelectProps {
|
|
|
20
20
|
selectedItems?: MatchesAnyItem[];
|
|
21
21
|
/** Callback function that is called when the selected items change. */
|
|
22
22
|
onChange?: (selectedItems: MatchesAnyItem[]) => void;
|
|
23
|
+
/** Callback function that is called when the user scroll */
|
|
24
|
+
onLoadMore?: () => void;
|
|
23
25
|
}
|
|
24
26
|
export interface MatchesAnyProps extends Omit<FlexProps, 'children'> {
|
|
25
27
|
/** The name of the object, corresponding to the `objectName` property in `MatchesAnySelectProps`. */
|
|
@@ -40,4 +42,6 @@ export interface MatchesAnyProps extends Omit<FlexProps, 'children'> {
|
|
|
40
42
|
onApply?: (selectedItems: MatchesAnyItem[]) => void;
|
|
41
43
|
/** Callback function that is called when the cancel action is triggered. */
|
|
42
44
|
onCancel?: () => void;
|
|
45
|
+
/** Callback function that is called when the user scroll */
|
|
46
|
+
onLoadMore?: MatchesAnySelectProps['onLoadMore'];
|
|
43
47
|
}
|