@antscorp/antsomi-ui 1.3.5-beta.160 → 1.3.5-beta.162

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.
Files changed (232) hide show
  1. package/es/assets/images/logo/sub-logo-antsomi.png +0 -0
  2. package/es/components/common/ConfigProvider/ConfigProvider.js +8 -0
  3. package/es/components/common/ConfigProvider/GlobalStyle.js +6 -0
  4. package/es/components/icons/ExpandMoreRight.d.ts +3 -0
  5. package/es/components/icons/ExpandMoreRight.js +3 -0
  6. package/es/components/icons/index.d.ts +1 -0
  7. package/es/components/icons/index.js +1 -0
  8. package/es/components/index.d.ts +0 -1
  9. package/es/components/index.js +0 -1
  10. package/es/components/molecules/AccountSelection/AccountSelection.d.ts +16 -0
  11. package/es/components/molecules/AccountSelection/AccountSelection.js +33 -0
  12. package/es/components/molecules/AccountSelection/components/AccountItem.d.ts +10 -0
  13. package/es/components/molecules/AccountSelection/components/AccountItem.js +11 -0
  14. package/es/components/molecules/AccountSelection/components/index.d.ts +1 -0
  15. package/es/components/molecules/AccountSelection/components/index.js +1 -0
  16. package/es/components/molecules/AccountSelection/index.d.ts +1 -0
  17. package/es/components/molecules/AccountSelection/index.js +1 -0
  18. package/es/components/molecules/AccountSelection/styled.d.ts +2 -0
  19. package/es/components/molecules/AccountSelection/styled.js +95 -0
  20. package/es/components/molecules/AddDynamicContent/utils.d.ts +4 -4
  21. package/es/components/molecules/CalendarSelection/actions.d.ts +1 -1
  22. package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +2 -2
  23. package/es/components/molecules/CalendarSelection/utils.d.ts +2 -2
  24. package/es/components/molecules/DrawerDetail/DrawerDetail.js +44 -9
  25. package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.d.ts +6 -0
  26. package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +48 -0
  27. package/es/components/molecules/DrawerDetail/components/index.d.ts +1 -0
  28. package/es/components/molecules/DrawerDetail/components/index.js +1 -0
  29. package/es/components/molecules/DrawerDetail/constants.d.ts +7 -0
  30. package/es/components/molecules/DrawerDetail/constants.js +7 -0
  31. package/es/components/molecules/DrawerDetail/styled.d.ts +1 -1
  32. package/es/components/molecules/DrawerDetail/styled.js +7 -4
  33. package/es/components/molecules/DrawerDetail/types.d.ts +2 -1
  34. package/es/components/molecules/HeaderV2/HeaderV2.d.ts +31 -0
  35. package/es/components/molecules/HeaderV2/HeaderV2.js +66 -0
  36. package/es/components/molecules/HeaderV2/constants.d.ts +1 -0
  37. package/es/components/molecules/HeaderV2/constants.js +1 -0
  38. package/es/components/molecules/HeaderV2/index.d.ts +1 -0
  39. package/es/components/molecules/HeaderV2/index.js +1 -0
  40. package/es/components/molecules/HeaderV2/styled.d.ts +1 -0
  41. package/es/components/molecules/HeaderV2/styled.js +28 -0
  42. package/es/components/molecules/PreviewModal/styled.d.ts +1 -1
  43. package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +3 -3
  44. package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +1 -1
  45. package/es/components/molecules/index.d.ts +2 -0
  46. package/es/components/molecules/index.js +2 -0
  47. package/es/components/organism/AccountSharing/AccountSharing.d.ts +19 -0
  48. package/es/components/organism/AccountSharing/AccountSharing.js +443 -0
  49. package/es/components/organism/AccountSharing/constant.d.ts +20 -0
  50. package/es/components/organism/AccountSharing/constant.js +20 -0
  51. package/es/components/organism/AccountSharing/icons/close.d.ts +3 -0
  52. package/es/components/organism/AccountSharing/icons/close.js +5 -0
  53. package/es/components/organism/AccountSharing/icons/search.d.ts +3 -0
  54. package/es/components/organism/AccountSharing/icons/search.js +5 -0
  55. package/es/components/organism/AccountSharing/index.d.ts +1 -0
  56. package/es/components/organism/AccountSharing/index.js +1 -0
  57. package/es/components/organism/AccountSharing/styled.d.ts +3 -0
  58. package/es/components/organism/AccountSharing/styled.js +341 -0
  59. package/es/components/organism/AccountSharing/utils.d.ts +1 -0
  60. package/es/components/organism/AccountSharing/utils.js +4 -0
  61. package/es/components/organism/AlgorithmsSetting/styled.d.ts +1 -1
  62. package/es/components/organism/ContentSources/provider.d.ts +1 -1
  63. package/es/components/organism/ContentSources/utils.d.ts +5 -5
  64. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.d.ts +1 -1
  65. package/es/components/organism/Help/Help.js +10 -10
  66. package/es/components/organism/Help/styled.d.ts +3 -0
  67. package/es/components/organism/Help/styled.js +14 -2
  68. package/es/components/organism/Help/types.d.ts +2 -2
  69. package/es/components/organism/LeftMenu/components/ContentMenu/index.d.ts +2 -0
  70. package/es/components/organism/LeftMenu/components/ContentMenu/index.js +10 -0
  71. package/es/components/organism/LeftMenu/components/ContentMenu/useContentMenu.d.ts +3 -0
  72. package/es/components/organism/LeftMenu/components/ContentMenu/useContentMenu.js +12 -0
  73. package/es/components/organism/LeftMenu/components/DataMenu/index.d.ts +2 -0
  74. package/es/components/organism/LeftMenu/components/DataMenu/index.js +10 -0
  75. package/es/components/organism/LeftMenu/components/DataMenu/useDataMenu.d.ts +3 -0
  76. package/es/components/organism/LeftMenu/components/DataMenu/useDataMenu.js +12 -0
  77. package/es/components/organism/LeftMenu/components/HomeMenu/constants.d.ts +6 -0
  78. package/es/components/organism/LeftMenu/components/HomeMenu/constants.js +27 -0
  79. package/es/components/organism/LeftMenu/components/HomeMenu/index.d.ts +2 -0
  80. package/es/components/organism/LeftMenu/components/HomeMenu/index.js +20 -0
  81. package/es/components/organism/LeftMenu/components/HomeMenu/styled.d.ts +5 -0
  82. package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +23 -0
  83. package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.d.ts +4 -0
  84. package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +84 -0
  85. package/es/components/organism/LeftMenu/components/HomeMenu/utils.d.ts +1 -0
  86. package/es/components/organism/LeftMenu/components/HomeMenu/utils.js +30 -0
  87. package/es/components/organism/LeftMenu/components/InsightsMenu/index.d.ts +2 -0
  88. package/es/components/organism/LeftMenu/components/InsightsMenu/index.js +10 -0
  89. package/es/components/organism/LeftMenu/components/InsightsMenu/useInsightsMenu.d.ts +3 -0
  90. package/es/components/organism/LeftMenu/components/InsightsMenu/useInsightsMenu.js +12 -0
  91. package/es/components/organism/LeftMenu/components/MarketingMenu/index.d.ts +2 -0
  92. package/es/components/organism/LeftMenu/components/MarketingMenu/index.js +10 -0
  93. package/es/components/organism/LeftMenu/components/MarketingMenu/useMarketingMenu.d.ts +3 -0
  94. package/es/components/organism/LeftMenu/components/MarketingMenu/useMarketingMenu.js +49 -0
  95. package/es/components/organism/LeftMenu/components/ProfilesMenu/index.d.ts +2 -0
  96. package/es/components/organism/LeftMenu/components/ProfilesMenu/index.js +10 -0
  97. package/es/components/organism/LeftMenu/components/ProfilesMenu/useProfilesMenu.d.ts +3 -0
  98. package/es/components/organism/LeftMenu/components/ProfilesMenu/useProfilesMenu.js +13 -0
  99. package/es/components/organism/LeftMenu/components/SettingsMenu/index.d.ts +2 -0
  100. package/es/components/organism/LeftMenu/components/SettingsMenu/index.js +10 -0
  101. package/es/components/organism/LeftMenu/components/SettingsMenu/useSettingsMenu.d.ts +3 -0
  102. package/es/components/organism/LeftMenu/components/SettingsMenu/useSettingsMenu.js +13 -0
  103. package/es/components/organism/LeftMenu/components/TemplatesMenu/index.d.ts +2 -0
  104. package/es/components/organism/LeftMenu/components/TemplatesMenu/index.js +10 -0
  105. package/es/components/organism/LeftMenu/components/TemplatesMenu/useTemplatesMenu.d.ts +3 -0
  106. package/es/components/organism/LeftMenu/components/TemplatesMenu/useTemplatesMenu.js +13 -0
  107. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/index.d.ts +7 -0
  108. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/index.js +9 -0
  109. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/index.d.ts +1 -0
  110. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/index.js +1 -0
  111. package/es/components/organism/LeftMenu/components/common/ChildMenu/constants/index.d.ts +1 -0
  112. package/es/components/organism/LeftMenu/components/common/ChildMenu/constants/index.js +1 -0
  113. package/es/components/organism/LeftMenu/components/common/ChildMenu/constants/sampleData.d.ts +2 -0
  114. package/es/components/organism/LeftMenu/components/common/ChildMenu/constants/sampleData.js +39 -0
  115. package/es/components/organism/LeftMenu/components/common/ChildMenu/index.d.ts +7 -0
  116. package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +59 -0
  117. package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.d.ts +3 -0
  118. package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +37 -0
  119. package/es/components/organism/LeftMenu/components/common/index.d.ts +1 -0
  120. package/es/components/organism/LeftMenu/components/common/index.js +1 -0
  121. package/es/components/organism/LeftMenu/components/index.d.ts +8 -0
  122. package/es/components/organism/LeftMenu/components/index.js +8 -0
  123. package/es/components/organism/LeftMenu/constants/index.d.ts +3 -0
  124. package/es/components/organism/LeftMenu/constants/index.js +3 -0
  125. package/es/components/organism/LeftMenu/constants/links.d.ts +1 -0
  126. package/es/components/organism/LeftMenu/constants/links.js +1 -0
  127. package/es/components/organism/LeftMenu/constants/sampleData.d.ts +7 -0
  128. package/es/components/organism/LeftMenu/constants/sampleData.js +985 -0
  129. package/es/components/organism/LeftMenu/constants/variables.d.ts +15 -0
  130. package/es/components/organism/LeftMenu/constants/variables.js +15 -0
  131. package/es/components/organism/LeftMenu/contexts/index.d.ts +13 -0
  132. package/es/components/organism/LeftMenu/contexts/index.js +10 -0
  133. package/es/components/organism/LeftMenu/hooks/index.d.ts +1 -0
  134. package/es/components/organism/LeftMenu/hooks/index.js +1 -0
  135. package/es/components/organism/LeftMenu/hooks/useLeftMenu.d.ts +18 -0
  136. package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +94 -0
  137. package/es/components/organism/LeftMenu/index.d.ts +9 -0
  138. package/es/components/organism/LeftMenu/index.js +91 -0
  139. package/es/components/organism/LeftMenu/styled.d.ts +13 -0
  140. package/es/components/organism/LeftMenu/styled.js +210 -0
  141. package/es/components/organism/LeftMenu/types/index.d.ts +27 -0
  142. package/es/components/organism/LeftMenu/types/index.js +1 -0
  143. package/es/components/organism/LeftMenu/utils/index.d.ts +6 -0
  144. package/es/components/organism/LeftMenu/utils/index.js +69 -0
  145. package/es/components/organism/Notification/Notification.d.ts +10 -0
  146. package/es/components/organism/Notification/Notification.js +245 -0
  147. package/es/components/organism/Notification/index.d.ts +1 -0
  148. package/es/components/organism/Notification/index.js +1 -0
  149. package/es/components/organism/Notification/styled.d.ts +8 -0
  150. package/es/components/organism/Notification/styled.js +148 -0
  151. package/es/components/organism/index.d.ts +3 -0
  152. package/es/components/organism/index.js +3 -0
  153. package/es/components/template/Layout/index.d.ts +8 -0
  154. package/es/components/template/Layout/index.js +51 -0
  155. package/es/components/template/Layout/styled.d.ts +4 -0
  156. package/es/components/template/Layout/styled.js +57 -0
  157. package/es/components/template/TemplateListing/Loadable.d.ts +1 -1
  158. package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +2 -2
  159. package/es/components/template/index.d.ts +1 -0
  160. package/es/components/template/index.js +1 -0
  161. package/es/config/index.d.ts +4 -0
  162. package/es/config/index.js +7 -0
  163. package/es/constants/api.d.ts +13 -0
  164. package/es/constants/api.js +13 -0
  165. package/es/constants/index.d.ts +2 -0
  166. package/es/constants/index.js +2 -0
  167. package/es/constants/permissions.d.ts +6 -0
  168. package/es/constants/permissions.js +6 -0
  169. package/es/constants/queries.d.ts +6 -0
  170. package/es/constants/queries.js +8 -0
  171. package/es/constants/theme.js +6 -0
  172. package/es/hooks/index.d.ts +4 -0
  173. package/es/hooks/index.js +4 -0
  174. package/es/hooks/useEffectDebugger.d.ts +20 -0
  175. package/es/hooks/useEffectDebugger.js +39 -0
  176. package/es/hooks/useIsFirstRender.d.ts +1 -0
  177. package/es/hooks/useIsFirstRender.js +9 -0
  178. package/es/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  179. package/es/hooks/useIsomorphicLayoutEffect.js +2 -0
  180. package/es/hooks/useMediaQuery.d.ts +6 -0
  181. package/es/hooks/useMediaQuery.js +42 -0
  182. package/es/index.d.ts +1 -0
  183. package/es/index.js +1 -0
  184. package/es/models/AccountListing.d.ts +15 -0
  185. package/es/models/AccountListing.js +1 -0
  186. package/es/models/LeftMenu/Dashboard.d.ts +44 -0
  187. package/es/models/LeftMenu/Dashboard.js +1 -0
  188. package/es/models/LeftMenu/DestinationChannel.d.ts +15 -0
  189. package/es/models/LeftMenu/DestinationChannel.js +1 -0
  190. package/es/models/LeftMenu/FeatureMenu.d.ts +42 -0
  191. package/es/models/LeftMenu/FeatureMenu.js +54 -0
  192. package/es/models/LeftMenu/FeatureMenuPermission.d.ts +43 -0
  193. package/es/models/LeftMenu/FeatureMenuPermission.js +1 -0
  194. package/es/models/LeftMenu/index.d.ts +4 -0
  195. package/es/models/LeftMenu/index.js +4 -0
  196. package/es/providers/AppConfigProvider/contexts/index.d.ts +16 -0
  197. package/es/providers/AppConfigProvider/contexts/index.js +10 -0
  198. package/es/providers/AppConfigProvider/index.d.ts +1 -0
  199. package/es/providers/AppConfigProvider/index.js +1 -0
  200. package/es/providers/ConfigProvider/ConfigProvider.d.ts +13 -0
  201. package/es/providers/ConfigProvider/ConfigProvider.js +65 -0
  202. package/es/providers/ConfigProvider/GlobalStyle.d.ts +5 -0
  203. package/es/providers/ConfigProvider/GlobalStyle.js +848 -0
  204. package/es/providers/ConfigProvider/index.d.ts +1 -0
  205. package/es/providers/ConfigProvider/index.js +1 -0
  206. package/es/providers/index.d.ts +2 -0
  207. package/es/providers/index.js +2 -0
  208. package/es/queries/Account/index.d.ts +1 -0
  209. package/es/queries/Account/index.js +1 -0
  210. package/es/queries/Account/useGetAccountList.d.ts +15 -0
  211. package/es/queries/Account/useGetAccountList.js +15 -0
  212. package/es/queries/BusinessObject/useGetListAttributeBO.d.ts +1 -3
  213. package/es/queries/LeftMenu/index.d.ts +23 -0
  214. package/es/queries/LeftMenu/index.js +23 -0
  215. package/es/queries/index.d.ts +1 -0
  216. package/es/queries/index.js +1 -0
  217. package/es/services/Account/index.d.ts +12 -0
  218. package/es/services/Account/index.js +65 -0
  219. package/es/services/LeftMenu/index.d.ts +40 -0
  220. package/es/services/LeftMenu/index.js +134 -0
  221. package/es/services/LeftMenu/utils.d.ts +9 -0
  222. package/es/services/LeftMenu/utils.js +135 -0
  223. package/es/test.js +51 -1
  224. package/es/types/api.d.ts +6 -0
  225. package/es/types/api.js +1 -0
  226. package/es/types/index.d.ts +1 -0
  227. package/es/utils/common.d.ts +23 -6
  228. package/es/utils/common.js +96 -43
  229. package/es/utils/loadable.d.ts +1 -1
  230. package/package.json +12 -5
  231. package/es/components/common/index.d.ts +0 -1
  232. package/es/components/common/index.js +0 -1
@@ -16,6 +16,7 @@ import dayjs from 'dayjs';
16
16
  import React, { useEffect } from 'react';
17
17
  import weekday from 'dayjs/plugin/weekday';
18
18
  import localeData from 'dayjs/plugin/localeData';
19
+ import relativeTime from 'dayjs/plugin/relativeTime';
19
20
  /** dayjs plugins for timezone */
20
21
  import utc from 'dayjs/plugin/utc';
21
22
  import timezone from 'dayjs/plugin/timezone';
@@ -28,11 +29,18 @@ import '@antscorp/antsomi-ui/es/assets/css/main.scss';
28
29
  // import '@antscorp/antsomi-ui/es/locales/i18n';
29
30
  import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
30
31
  import 'animate.css';
32
+ // Providers
33
+ // import {
34
+ // QueryClientProviderAntsomiUI,
35
+ // QueryDevtoolsAntsomiUI,
36
+ // queryClientAntsomiUI,
37
+ // } from '@antscorp/antsomi-ui/es/queries';
31
38
  // NOTE: HOT fix DatePicker Advanced
32
39
  dayjs.extend(weekday);
33
40
  dayjs.extend(localeData);
34
41
  dayjs.extend(utc);
35
42
  dayjs.extend(timezone);
43
+ dayjs.extend(relativeTime);
36
44
  const ConfigProvider = props => {
37
45
  // Props
38
46
  const { children, locale } = props, restOfProps = __rest(props, ["children", "locale"]);
@@ -84,6 +84,12 @@ export const GlobalStyle = () => {
84
84
  width: 36px !important;
85
85
  height: 36px !important;
86
86
  }
87
+
88
+ &.antsomi-btn-icon-only.antsomi-btn-sm {
89
+ /* Important to override the above code before */
90
+ width: 24px !important;
91
+ height: 24px !important;
92
+ }
87
93
  }
88
94
 
89
95
  .antsomi-btn-text:disabled,
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IconProps } from './type';
3
+ export declare const ExpandMoreRight: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,3 @@
1
+ import React, { forwardRef } from 'react';
2
+ export const ExpandMoreRight = forwardRef((props, ref) => (React.createElement("svg", Object.assign({ width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { ref: ref }),
3
+ React.createElement("path", { d: "M3.67969 5L0.492188 1.8125L1.89844 0.40625L6.49219 5L1.89844 9.59375L0.492188 8.1875L3.67969 5ZM8.69531 5L5.50781 1.8125L6.91406 0.40625L11.5078 5L6.91406 9.59375L5.50781 8.1875L8.69531 5Z", fill: "currentColor" }))));
@@ -23,6 +23,7 @@ export { OpenUrlIcon } from './OpenUrlIcon';
23
23
  export { BugIcon } from './BugIcon';
24
24
  export { IdeaIcon } from './IdeaIcon';
25
25
  export { RequestIcon } from './RequestIcon';
26
+ export { ExpandMoreRight } from './ExpandMoreRight';
26
27
  export { HighlightAlt } from './HightlightAlt';
27
28
  export { DesktopWindows } from './DesktopWindows';
28
29
  export { AddShoppingCart } from './AddShoppingCart';
@@ -23,6 +23,7 @@ export { OpenUrlIcon } from './OpenUrlIcon';
23
23
  export { BugIcon } from './BugIcon';
24
24
  export { IdeaIcon } from './IdeaIcon';
25
25
  export { RequestIcon } from './RequestIcon';
26
+ export { ExpandMoreRight } from './ExpandMoreRight';
26
27
  export { HighlightAlt } from './HightlightAlt';
27
28
  export { DesktopWindows } from './DesktopWindows';
28
29
  export { AddShoppingCart } from './AddShoppingCart';
@@ -1,5 +1,4 @@
1
1
  export * from './atoms';
2
2
  export * from './molecules';
3
- export * from './common';
4
3
  export * from './organism';
5
4
  export * from './template';
@@ -1,5 +1,4 @@
1
1
  export * from './atoms';
2
2
  export * from './molecules';
3
- export * from './common';
4
3
  export * from './organism';
5
4
  export * from './template';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface AccountSelectionProps {
3
+ className?: string;
4
+ apiConfig: {
5
+ domain: string;
6
+ token: string;
7
+ userId: number;
8
+ portalId?: number;
9
+ languageCode?: string;
10
+ };
11
+ showAllAccount?: boolean;
12
+ currentAccount?: number | 'ALL_ACCOUNT';
13
+ inputStyle?: 'select' | 'input';
14
+ onChange?: (userId: number | 'ALL_ACCOUNT') => void;
15
+ }
16
+ export declare const AccountSelection: React.FC<AccountSelectionProps>;
@@ -0,0 +1,33 @@
1
+ import Icon from '@antscorp/icons';
2
+ import React, { useCallback, useMemo, useState } from 'react';
3
+ import { Input, Popover, Text } from '@antscorp/antsomi-ui/es/components/atoms';
4
+ import { AccountItem } from './components';
5
+ import { AccountSelectionStyled, PopoverFieldStyled } from './styled';
6
+ import { useGetAccountList, useGetRecentAccount } from '../../..';
7
+ import { Tooltip } from 'antd';
8
+ import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
9
+ export const AccountSelection = props => {
10
+ const { className, apiConfig, showAllAccount = true, currentAccount, inputStyle = 'input', onChange, } = props;
11
+ const { data } = useGetAccountList({ apiConfig });
12
+ const { data: recentData } = useGetRecentAccount({ apiConfig });
13
+ const [open, setOpen] = useState(false);
14
+ const [searchValue, setSearchValue] = useState('');
15
+ const currentAccountInfo = useMemo(() => data === null || data === void 0 ? void 0 : data.entries.find(account => account.userId === currentAccount), [data, currentAccount]);
16
+ const handleSelectAccount = useCallback((userId) => {
17
+ setOpen(false);
18
+ if (onChange)
19
+ onChange(userId);
20
+ }, [onChange]);
21
+ return (React.createElement(Popover, { content: React.createElement(AccountSelectionStyled, { className: className },
22
+ React.createElement(Input, { placeholder: "Search", suffix: React.createElement(Icon, { type: "icon-ants-search-2", style: { fontSize: '24px' } }), value: searchValue, onChange: event => setSearchValue(event.target.value) }),
23
+ React.createElement(Text, { className: "recent-text" }, "Recent"),
24
+ React.createElement("ul", null, recentData === null || recentData === void 0 ? void 0 : recentData.value.map(accountId => data === null || data === void 0 ? void 0 : data.entries.find(account => account.userId === accountId)).filter(Boolean).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === account.userId })))),
25
+ React.createElement("ul", { className: "account-list" }, data === null || data === void 0 ? void 0 : data.entries.filter(account => !(recentData === null || recentData === void 0 ? void 0 : recentData.value.includes(account.userId)) &&
26
+ searchStringQuery(account.userName, searchValue)).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === account.userId })))),
27
+ showAllAccount ? (React.createElement(Text, { className: `all-account ${currentAccount === 'ALL_ACCOUNT' ? 'is-selected' : ''}`, onClick: () => handleSelectAccount('ALL_ACCOUNT') },
28
+ React.createElement("strong", null, "All account"))) : null), trigger: "click", overlayInnerStyle: { padding: 0 }, placement: "bottomLeft", arrow: false, open: open, onOpenChange: setOpen },
29
+ React.createElement(PopoverFieldStyled, { className: inputStyle },
30
+ React.createElement(Tooltip, { title: currentAccount === 'ALL_ACCOUNT' ? 'All account' : currentAccountInfo === null || currentAccountInfo === void 0 ? void 0 : currentAccountInfo.userName },
31
+ React.createElement("span", null, currentAccount === 'ALL_ACCOUNT' ? 'All account' : currentAccountInfo === null || currentAccountInfo === void 0 ? void 0 : currentAccountInfo.userName)),
32
+ React.createElement(Icon, { type: "icon-ants-angle-down", style: { width: '20px', textAlign: 'center' } }))));
33
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface AccountItemProps {
3
+ className?: string;
4
+ userName: string;
5
+ userId: number;
6
+ isSelected?: boolean;
7
+ onClick?: (userId: number) => void;
8
+ }
9
+ export declare const AccountItem: React.FC<AccountItemProps>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Text, Typography } from '../../../atoms';
3
+ import { formatUserId } from '@antscorp/antsomi-ui/es/utils';
4
+ export const AccountItem = React.memo(props => {
5
+ const { className, userName, userId, isSelected, onClick } = props;
6
+ return (
7
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
8
+ React.createElement("li", { onClick: () => onClick && onClick(userId), className: `${className || ''} ${isSelected ? 'is-selected' : ''}` },
9
+ React.createElement(Typography.Text, { className: "account-name", ellipsis: { tooltip: true } }, userName),
10
+ React.createElement(Text, { className: "account-id" }, formatUserId(userId))));
11
+ });
@@ -0,0 +1 @@
1
+ export { AccountItem } from './AccountItem';
@@ -0,0 +1 @@
1
+ export { AccountItem } from './AccountItem';
@@ -0,0 +1 @@
1
+ export { AccountSelection, type AccountSelectionProps } from './AccountSelection';
@@ -0,0 +1 @@
1
+ export { AccountSelection } from './AccountSelection';
@@ -0,0 +1,2 @@
1
+ export declare const AccountSelectionStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const PopoverFieldStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,95 @@
1
+ var _a, _b, _c, _d, _e, _f, _g;
2
+ import { THEME } from '@antscorp/antsomi-ui/es/constants';
3
+ import styled from 'styled-components';
4
+ export const AccountSelectionStyled = styled.div `
5
+ background-color: white;
6
+ display: flex;
7
+ flex-direction: column;
8
+ width: 300px;
9
+ height: 450px;
10
+ box-shadow: 0px 3px 20px 0px #002e5933;
11
+
12
+ .input__wrapper .antsomi-input-affix-wrapper {
13
+ padding: 8px 10px;
14
+ }
15
+
16
+ .recent-text {
17
+ color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw7};
18
+ padding: 6px 10px 0;
19
+ }
20
+
21
+ ul {
22
+ list-style: none;
23
+ margin: 0;
24
+ padding: 0;
25
+ }
26
+
27
+ ul.account-list {
28
+ border-top: 1px solid ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.bw3};
29
+ overflow-y: auto;
30
+ }
31
+
32
+ li {
33
+ display: flex;
34
+ justify-content: space-between;
35
+ padding: 8px 10px;
36
+ margin-bottom: 6px;
37
+ cursor: pointer;
38
+
39
+ .account-name {
40
+ white-space: nowrap;
41
+ overflow: hidden;
42
+ text-overflow: ellipsis;
43
+ }
44
+ .account-id {
45
+ flex-shrink: 0;
46
+ }
47
+ }
48
+
49
+ .all-account {
50
+ padding: 8px 10px;
51
+ border-top: 1px solid ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.bw3};
52
+ cursor: pointer;
53
+ }
54
+
55
+ li:hover,
56
+ .all-account:hover {
57
+ background-color: ${(_d = THEME.token) === null || _d === void 0 ? void 0 : _d.blue};
58
+ }
59
+
60
+ li.is-selected,
61
+ .all-account.is-selected {
62
+ background-color: ${(_e = THEME.token) === null || _e === void 0 ? void 0 : _e.blue1_1};
63
+ }
64
+ `;
65
+ export const PopoverFieldStyled = styled.div `
66
+ box-sizing: border-box;
67
+ width: 190px;
68
+ height: 36px;
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ padding: 0 10px;
73
+ cursor: pointer;
74
+
75
+ background-color: white;
76
+
77
+ font-size: 12px;
78
+ font-weight: bold;
79
+
80
+ span {
81
+ white-space: nowrap;
82
+ overflow: hidden;
83
+ text-overflow: ellipsis;
84
+ }
85
+
86
+ &.select {
87
+ border: 1px solid ${(_f = THEME.token) === null || _f === void 0 ? void 0 : _f.bw3};
88
+ border-radius: 999px;
89
+ }
90
+
91
+ &.input {
92
+ border-bottom: 1px solid ${(_g = THEME.token) === null || _g === void 0 ? void 0 : _g.colorPrimary};
93
+ width: 300px;
94
+ }
95
+ `;
@@ -28,10 +28,10 @@ export declare const CUSTOM_TYPE: {
28
28
  };
29
29
  export declare const buildOptionAttrArchive: (list: any[], selected: any) => any[];
30
30
  export declare const checkStatusAttr: ({ listBO, itemTypeId, listAttribute, field, }: {
31
- listBO?: any[] | undefined;
32
- itemTypeId?: number | undefined;
33
- listAttribute?: any[] | undefined;
34
- field?: string | undefined;
31
+ listBO?: any[];
32
+ itemTypeId?: number;
33
+ listAttribute?: any[];
34
+ field?: string;
35
35
  }) => {
36
36
  errorMessage: string;
37
37
  isDisable: boolean;
@@ -9,7 +9,7 @@ export declare const ACTION_TYPES: {
9
9
  readonly apply: "apply";
10
10
  readonly resetValue: "reset_value";
11
11
  };
12
- export declare const changeRangeType: (rangeType: string, callback?: ((rangeInfo: RangeInfo) => void) | undefined) => {
12
+ export declare const changeRangeType: (rangeType: string, callback?: (rangeInfo: RangeInfo) => void) => {
13
13
  type: "change_range_type";
14
14
  payload: {
15
15
  rangeType: string;
@@ -1,4 +1,4 @@
1
1
  export declare const useCalendarSelectionContext: () => {
2
- state: import("@antscorp/antsomi-ui/es/components/molecules/CalendarSelection/types").ReducerState;
3
- action: import("@antscorp/antsomi-ui/es/components/molecules/CalendarSelection/types").ActionType;
2
+ state: import("../types").ReducerState;
3
+ action: import("../types").ActionType;
4
4
  };
@@ -29,7 +29,7 @@ export declare const getDefaultDate: () => {
29
29
  export declare const getRangeValue: ({ rangeInfo, currentRangeValue, limitNumOfDays, }: {
30
30
  rangeInfo: RangeInfo;
31
31
  currentRangeValue: RangeValue[];
32
- limitNumOfDays?: number | undefined;
32
+ limitNumOfDays?: number;
33
33
  }) => RangeValue[];
34
34
  export declare const getRangeValueSelctedTitle: (rangeValue: RangeValue[], options?: {
35
35
  formatStart?: string;
@@ -44,7 +44,7 @@ export declare const combineCurrentValue: (state: ReducerState) => {
44
44
  };
45
45
  export declare const genTriggerOut: ({ mode, id, }: {
46
46
  mode: ReducerState['triggerOut']['mode'];
47
- id?: number | undefined;
47
+ id?: number;
48
48
  }) => {
49
49
  mode: "auto" | "manual";
50
50
  id: number;
@@ -10,19 +10,55 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  // Libraries
13
- import React from 'react';
13
+ import React, { useEffect, useMemo } from 'react';
14
14
  // Components
15
15
  import { Flex, Icon, Tooltip } from '../../atoms';
16
16
  // Styled
17
17
  import { CloseBtn, Content, LeftMenu, MenuFooter, MenuItem, StyledDrawer } from './styled';
18
18
  // Constants
19
- const DRAWER_WIDTH_DEFAULT = 'calc(100vw - 70px)';
19
+ import { BREAK_POINT, DRAWER_LARGE_MAX_WIDTH, DRAWER_LARGE_MIN_WIDTH, DRAWER_SMALL_MAX_WIDTH, DRAWER_SMALL_MIN_WIDTH, } from './constants';
20
+ import { ToggleDrawerSizeButton } from './components';
21
+ import { useMediaQuery, useToggle } from '@antscorp/antsomi-ui/es/hooks';
20
22
  export const DrawerDetail = props => {
21
- const { width = DRAWER_WIDTH_DEFAULT, fullScreen, children, menuProps, closeIconProps } = props, restProps = __rest(props, ["width", "fullScreen", "children", "menuProps", "closeIconProps"]);
22
- const { show: showMenu = true, showClose = true, items, selectedKeys, footer, onClick = () => { }, } = menuProps || {};
23
+ // Props
24
+ const { width, fullScreen, children, menuProps, closeIconProps } = props, restProps = __rest(props, ["width", "fullScreen", "children", "menuProps", "closeIconProps"]);
25
+ const { show: showMenu = true, showExpandButton = true, showClose = true, items, selectedKeys, footer, onClick = () => { }, } = menuProps || {};
23
26
  const { onClose = () => { } } = props;
24
27
  const _a = closeIconProps || {}, { show: showCloseIcon, onClick: onCloseIconClick = () => { } } = _a, restOfCloseIcon = __rest(_a, ["show", "onClick"]);
25
- return (React.createElement(StyledDrawer, Object.assign({}, restProps, { closable: false, width: fullScreen ? '100vw' : width, classNames: {
28
+ // Hooks
29
+ const matchesSmallScreen = useMediaQuery(`(max-width: ${BREAK_POINT})`);
30
+ // State
31
+ const [collapseDrawer, toggleCollapseDrawer] = useToggle(false);
32
+ // Effects
33
+ useEffect(() => {
34
+ toggleCollapseDrawer(!matchesSmallScreen);
35
+ }, [matchesSmallScreen, toggleCollapseDrawer]);
36
+ // Memo
37
+ const drawerWidth = useMemo(() => {
38
+ if (fullScreen)
39
+ return '100vw';
40
+ if (width)
41
+ return width;
42
+ /**
43
+ * Check if drawer is collapsed
44
+ * Case 1: Large screen (> 1440px)
45
+ * Case 2: Small screen (<= 1440px)
46
+ */
47
+ switch (collapseDrawer) {
48
+ case false: {
49
+ if (matchesSmallScreen)
50
+ return DRAWER_SMALL_MAX_WIDTH;
51
+ return DRAWER_LARGE_MAX_WIDTH;
52
+ }
53
+ case true:
54
+ default: {
55
+ if (matchesSmallScreen)
56
+ return DRAWER_SMALL_MIN_WIDTH;
57
+ return DRAWER_LARGE_MIN_WIDTH;
58
+ }
59
+ }
60
+ }, [collapseDrawer, fullScreen, matchesSmallScreen, width]);
61
+ return (React.createElement(StyledDrawer, Object.assign({}, restProps, { closable: false, width: drawerWidth, classNames: {
26
62
  body: 'drawer-detail-body',
27
63
  } }),
28
64
  showCloseIcon && (React.createElement("div", Object.assign({ className: "close-btn" }, restOfCloseIcon, { onClick: e => {
@@ -30,7 +66,8 @@ export const DrawerDetail = props => {
30
66
  onClose(e);
31
67
  } }),
32
68
  React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
33
- showMenu && (React.createElement(LeftMenu, { className: "animate__animated animate__fadeInLeft animate__fast" },
69
+ showMenu && (React.createElement(LeftMenu, { className: "animate__animated animate__fadeIn" },
70
+ showExpandButton && !fullScreen && (React.createElement(ToggleDrawerSizeButton, { onClick: () => toggleCollapseDrawer(), collapse: collapseDrawer })),
34
71
  React.createElement("div", null,
35
72
  showClose && (React.createElement(CloseBtn, { onClick: onClose },
36
73
  React.createElement(Icon, { type: "icon-ants-remove-slim", size: 14 }))),
@@ -39,6 +76,4 @@ export const DrawerDetail = props => {
39
76
  React.createElement(MenuFooter, null, footer))),
40
77
  React.createElement(Content, null, children)));
41
78
  };
42
- DrawerDetail.defaultProps = {
43
- width: DRAWER_WIDTH_DEFAULT,
44
- };
79
+ DrawerDetail.defaultProps = {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface ToggleDrawerSizeButtonProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ collapse?: boolean;
4
+ }
5
+ export declare const ToggleDrawerSizeButton: React.FC<ToggleDrawerSizeButtonProps>;
6
+ export {};
@@ -0,0 +1,48 @@
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 { THEME } from '@antscorp/antsomi-ui/es/constants';
14
+ import React from 'react';
15
+ import styled from 'styled-components';
16
+ // Icons
17
+ import { ExpandMoreRight } from '../../../icons';
18
+ const { token } = THEME || {};
19
+ /* Styled */
20
+ const StyledToggleButton = styled.div `
21
+ position: absolute;
22
+ width: 30px;
23
+ height: 30px;
24
+ border-radius: 100%;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ background-color: ${token === null || token === void 0 ? void 0 : token.blue1_2};
29
+ color: ${token === null || token === void 0 ? void 0 : token.bw8};
30
+ top: 50%;
31
+ transform: translateY(-50%);
32
+ left: -5px;
33
+ cursor: pointer;
34
+
35
+ svg {
36
+ transition: all 300ms;
37
+ ${({ $collapse }) => $collapse && 'transform: rotate(180deg)'}
38
+ }
39
+
40
+ &:hover {
41
+ color: #000;
42
+ }
43
+ `;
44
+ export const ToggleDrawerSizeButton = props => {
45
+ const { collapse } = props, restProps = __rest(props, ["collapse"]);
46
+ return (React.createElement(StyledToggleButton, Object.assign({ "$collapse": !!collapse }, restProps),
47
+ React.createElement(ExpandMoreRight, null)));
48
+ };
@@ -0,0 +1 @@
1
+ export * from './ToggleDrawerSizeButton';
@@ -0,0 +1 @@
1
+ export * from './ToggleDrawerSizeButton';
@@ -0,0 +1,7 @@
1
+ declare const DRAWER_MAX_WIDTH = "calc(100vw - 70px)";
2
+ declare const DRAWER_LARGE_MIN_WIDTH = "1370px";
3
+ declare const DRAWER_LARGE_MAX_WIDTH = "calc(100vw - 70px)";
4
+ declare const DRAWER_SMALL_MAX_WIDTH = "calc(100vw - 70px)";
5
+ declare const DRAWER_SMALL_MIN_WIDTH = "calc(100vw - 310px)";
6
+ declare const BREAK_POINT = "1440px";
7
+ export { DRAWER_MAX_WIDTH, DRAWER_LARGE_MIN_WIDTH, DRAWER_LARGE_MAX_WIDTH, DRAWER_SMALL_MAX_WIDTH, DRAWER_SMALL_MIN_WIDTH, BREAK_POINT, };
@@ -0,0 +1,7 @@
1
+ const DRAWER_MAX_WIDTH = 'calc(100vw - 70px)';
2
+ const DRAWER_LARGE_MIN_WIDTH = '1370px';
3
+ const DRAWER_LARGE_MAX_WIDTH = 'calc(100vw - 70px)';
4
+ const DRAWER_SMALL_MAX_WIDTH = 'calc(100vw - 70px)';
5
+ const DRAWER_SMALL_MIN_WIDTH = 'calc(100vw - 310px)';
6
+ const BREAK_POINT = '1440px';
7
+ export { DRAWER_MAX_WIDTH, DRAWER_LARGE_MIN_WIDTH, DRAWER_LARGE_MAX_WIDTH, DRAWER_SMALL_MAX_WIDTH, DRAWER_SMALL_MIN_WIDTH, BREAK_POINT, };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledDrawer: import("styled-components").StyledComponent<import("react").FC<import("@antscorp/antsomi-ui/es/components/molecules/Drawer/Drawer").DrawerProps>, any, {}, never>;
2
+ export declare const StyledDrawer: import("styled-components").StyledComponent<import("react").FC<import("../Drawer").DrawerProps>, any, {}, never>;
3
3
  export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const LeftMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export declare const CloseBtn: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,4 +1,4 @@
1
- var _a, _b, _c;
1
+ var _a, _b;
2
2
  // Libraries
3
3
  import styled from 'styled-components';
4
4
  // Drawer
@@ -8,10 +8,13 @@ import { THEME } from '@antscorp/antsomi-ui/es/constants';
8
8
  const { token } = THEME || {};
9
9
  export const StyledDrawer = styled(Drawer) `
10
10
  &.antsomi-drawer-content {
11
+ overflow: visible !important;
12
+
11
13
  .drawer-detail-body {
12
14
  display: flex;
13
15
  width: 100%;
14
16
  padding: 0px;
17
+ overflow: visible;
15
18
  }
16
19
 
17
20
  .close-btn {
@@ -42,7 +45,7 @@ export const Content = styled.div `
42
45
  export const LeftMenu = styled.div `
43
46
  width: 46px;
44
47
  height: 100%;
45
- background-color: #eaf1fb;
48
+ background-color: ${token === null || token === void 0 ? void 0 : token.blue1_2};
46
49
  padding: 8px 5px;
47
50
  box-sizing: border-box;
48
51
  display: flex;
@@ -69,7 +72,7 @@ export const CloseBtn = styled.div `
69
72
  export const MenuItem = styled.div `
70
73
  height: 36px;
71
74
  width: 36px;
72
- border-radius: 10px;
75
+ border-radius: ${token === null || token === void 0 ? void 0 : token.borderRadiusLG}px;
73
76
  background-color: transparent;
74
77
  display: flex;
75
78
  align-items: center;
@@ -78,7 +81,7 @@ export const MenuItem = styled.div `
78
81
  transition: all 0.2s;
79
82
 
80
83
  * {
81
- color: ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.bw8};
84
+ color: ${token === null || token === void 0 ? void 0 : token.bw8};
82
85
  }
83
86
 
84
87
  i {
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import type { DrawerProps, MenuProps as AntdProps } from 'antd';
3
3
  import { ItemType } from 'antd/es/menu/hooks/useItems';
4
4
  export interface DrawerDetailProps extends Omit<DrawerProps, 'closeIcon'> {
@@ -11,6 +11,7 @@ export interface DrawerDetailCloseIconProps extends React.HtmlHTMLAttributes<HTM
11
11
  }
12
12
  export interface DrawerDetailMenuProps extends Omit<AntdProps, 'onClick'> {
13
13
  show?: boolean;
14
+ showExpandButton?: boolean;
14
15
  showClose?: boolean;
15
16
  footer?: ReactNode;
16
17
  onClick?: (item: ItemType) => void;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { AccountSelectionProps } from '../AccountSelection';
3
+ import { AccountSharingProps } from '../../organism';
4
+ import { IHelpProps } from '../../organism/Help/types';
5
+ export interface HeaderV2Props {
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ pageTitle?: string | React.ReactNode;
9
+ accountSelection?: Omit<AccountSelectionProps, 'onChange' | 'apiConfig'> & {
10
+ onSelectAccount?: (account: number | 'ALL_ACCOUNT') => void;
11
+ };
12
+ helpConfig: Omit<IHelpProps, 'configs'> & {
13
+ configs: Omit<IHelpProps['configs'], 'portalId' | 'userId' | 'token' | 'domain' | 'domainTicket' | 'domainPlatform'>;
14
+ } & {
15
+ show?: boolean;
16
+ };
17
+ notificationConfig?: {
18
+ show?: boolean;
19
+ };
20
+ accountSharingConfig: Pick<AccountSharingProps, 'isShowSharing' | 'isShareAccountAccess' | 'u_ogs' | 'appCode' | 'callbackLogout' | 'callbackGetInfoAccount'> & {
21
+ show?: boolean;
22
+ };
23
+ config: {
24
+ env: 'DEVELOPMENT' | 'PRODUCTION';
25
+ language?: string;
26
+ userId: number;
27
+ portalId: number;
28
+ token: string;
29
+ };
30
+ }
31
+ export declare const HeaderV2: React.FC<HeaderV2Props>;