@antscorp/antsomi-ui 1.3.5-common.2 → 1.3.5-common.4

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 (35) hide show
  1. package/dist/723.index.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.LICENSE.txt +0 -33
  4. package/dist/main.css +2 -1
  5. package/es/components/molecules/EditorTab/EditorTab.d.ts +4 -7
  6. package/es/components/molecules/EditorTab/EditorTab.js +20 -23
  7. package/es/components/molecules/EditorTab/styled.js +12 -2
  8. package/es/components/molecules/SearchPopover/SearchPopover.d.ts +2 -6
  9. package/es/components/molecules/SearchPopover/SearchPopover.js +3 -4
  10. package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.d.ts +4 -0
  11. package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.js +115 -0
  12. package/es/components/molecules/SearchPopover/components/PopoverAddField/index.d.ts +1 -0
  13. package/es/components/molecules/SearchPopover/components/PopoverAddField/index.js +1 -0
  14. package/es/components/molecules/SearchPopover/components/PopoverAddField/styles.scss +59 -0
  15. package/es/components/molecules/SearchPopover/components/index.d.ts +1 -0
  16. package/es/components/molecules/SearchPopover/components/index.js +1 -0
  17. package/es/components/molecules/SearchPopover/constants.d.ts +27 -0
  18. package/es/components/molecules/SearchPopover/constants.js +27 -0
  19. package/es/components/molecules/SearchPopover/index.d.ts +3 -1
  20. package/es/components/molecules/SearchPopover/index.js +1 -0
  21. package/es/components/molecules/SearchPopover/styles.scss +2 -0
  22. package/es/components/molecules/SearchPopover/types.d.ts +18 -0
  23. package/es/components/molecules/SearchPopover/types.js +1 -0
  24. package/es/components/molecules/SearchPopover/utils.d.ts +2 -0
  25. package/es/components/molecules/SearchPopover/utils.js +23 -0
  26. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +11 -3
  27. package/es/components/molecules/VirtualizedMenu/types.d.ts +1 -0
  28. package/es/components/molecules/index.d.ts +2 -2
  29. package/es/components/molecules/index.js +1 -1
  30. package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +4 -4
  31. package/es/components/organism/LeftMenu/index.js +1 -2
  32. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +10 -2
  33. package/es/constants/theme.js +3 -3
  34. package/package.json +2 -1
  35. package/dist/public/icons/sub-logo-antsomi.png +0 -0
@@ -0,0 +1,27 @@
1
+ export const FIELD_DATA_TYPE = {
2
+ NUMBER: {
3
+ label: 'Number',
4
+ name: 'number',
5
+ value: 2,
6
+ },
7
+ STRING: {
8
+ label: 'String',
9
+ name: 'string',
10
+ value: 1,
11
+ },
12
+ TEXT: {
13
+ label: 'Text',
14
+ name: 'text',
15
+ value: 1,
16
+ },
17
+ DATE_TIME: {
18
+ label: 'Datetime',
19
+ name: 'datetime',
20
+ value: 5,
21
+ },
22
+ BOOLEAN: {
23
+ label: 'Boolean',
24
+ name: 'boolean',
25
+ value: 17,
26
+ },
27
+ };
@@ -1 +1,3 @@
1
- export { SearchPopover, SearchPopoverProps } from './SearchPopover';
1
+ export { PopoverAddField } from './components';
2
+ export { SearchPopover } from './SearchPopover';
3
+ export type { SearchPopoverProps, PopoverAddFieldProps } from './types';
@@ -1 +1,2 @@
1
+ export { PopoverAddField } from './components';
1
2
  export { SearchPopover } from './SearchPopover';
@@ -17,10 +17,12 @@
17
17
  background: transparent;
18
18
  font-size: 20px;
19
19
  padding: 0;
20
+ min-width: 25px;
20
21
 
21
22
  > i {
22
23
  font-size: 24px;
23
24
  color: #595959;
25
+ cursor: pointer;
24
26
  }
25
27
  }
26
28
  }
@@ -0,0 +1,18 @@
1
+ import { PopoverProps } from 'antd';
2
+ import { InputProps } from '../../atoms/Input';
3
+ import { PropsWithChildren } from 'react';
4
+ export type SearchPopoverProps = PropsWithChildren<{
5
+ inputSearchProps?: InputProps;
6
+ } & PopoverProps>;
7
+ export type Field = {
8
+ key: string;
9
+ label: string;
10
+ dataType?: string | number;
11
+ };
12
+ export type PopoverAddFieldProps = SearchPopoverProps & Partial<{
13
+ fields: Field[];
14
+ selected: string[];
15
+ onCancel: () => void;
16
+ onApply: (selected: string[]) => void;
17
+ children: React.ReactNode;
18
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const renderIconField: (dataType?: string | number) => React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { Icon } from '../../atoms/Icon';
3
+ import { FIELD_DATA_TYPE } from './constants';
4
+ export const renderIconField = (dataType = FIELD_DATA_TYPE.STRING.name) => {
5
+ switch (dataType) {
6
+ case FIELD_DATA_TYPE.STRING.name:
7
+ case FIELD_DATA_TYPE.STRING.value:
8
+ case FIELD_DATA_TYPE.TEXT.name:
9
+ case FIELD_DATA_TYPE.TEXT.value:
10
+ return React.createElement(Icon, { type: "icon-ants-ABC", style: { color: '#56b261' } });
11
+ case FIELD_DATA_TYPE.BOOLEAN.name:
12
+ case FIELD_DATA_TYPE.BOOLEAN.value:
13
+ return React.createElement(Icon, { type: "icon-ants-boolean", style: { color: '#51a5d5' } });
14
+ case FIELD_DATA_TYPE.NUMBER.name:
15
+ case FIELD_DATA_TYPE.NUMBER.value:
16
+ return React.createElement(Icon, { type: "icon-ants-123", style: { color: '#51a5d5' } });
17
+ case FIELD_DATA_TYPE.DATE_TIME.name:
18
+ case FIELD_DATA_TYPE.DATE_TIME.value:
19
+ return React.createElement(Icon, { type: "icon-ants-calendar-v2", style: { color: '#56b261' } });
20
+ default:
21
+ return React.createElement(Icon, { type: "icon-ants-ABC", style: { color: '#56b261' } });
22
+ }
23
+ };
@@ -22,7 +22,7 @@ const innerElementType = forwardRef((_a, ref) => {
22
22
  return React.createElement("div", Object.assign({ ref: ref, style: style }, rest));
23
23
  });
24
24
  export const MenuInline = (props) => {
25
- const { width, height, items = [], inlineIndent = INLINE_INDENT, inlinePadding = INLINE_PADDING, itemSize = ITEM_SIZE, itemSpacing = ITEM_SPACING, openKeys: openKeysProp = [], onClick, className, } = props;
25
+ const { width, height, items = [], inlineIndent = INLINE_INDENT, inlinePadding = INLINE_PADDING, itemSize = ITEM_SIZE, itemSpacing = ITEM_SPACING, openKeys: openKeysProp = [], onClick, selectable = false, className, } = props;
26
26
  const [openKeys, setOpenKeys] = useState(new Set());
27
27
  const [selectedKeys, setSelectedKeys] = useState(new Set());
28
28
  useDeepCompareEffect(() => {
@@ -74,13 +74,21 @@ export const MenuInline = (props) => {
74
74
  if (hasChilren && !isOpen) {
75
75
  handleExpandItem(item);
76
76
  }
77
- if (!hasChilren && !selectedKeys.has(key)) {
77
+ if (selectable && !hasChilren && !selectedKeys.has(key)) {
78
78
  setSelectedKeys(new Set([item.key]));
79
79
  }
80
80
  if (onClick) {
81
81
  onClick({ item, pathKey: flattenItems[idx].pathKey });
82
82
  }
83
- }, [flattenItems, handleCollapseItem, handleExpandItem, onClick, openKeys, selectedKeys]);
83
+ }, [
84
+ selectable,
85
+ flattenItems,
86
+ handleCollapseItem,
87
+ handleExpandItem,
88
+ onClick,
89
+ openKeys,
90
+ selectedKeys,
91
+ ]);
84
92
  const renderItem = useCallback((args) => {
85
93
  const { index, style } = args;
86
94
  const item = flattenItems[index];
@@ -25,6 +25,7 @@ export type VirtualizedMenuProps = Partial<{
25
25
  pathKey: PathKey;
26
26
  }) => void;
27
27
  className: string;
28
+ selectable: boolean;
28
29
  }>;
29
30
  export type PathKey = (string | number)[];
30
31
  export type MenuInlineProps = Omit<VirtualizedMenuProps, 'mode'>;
@@ -48,7 +48,7 @@ export * from './DatePickerV2';
48
48
  export { ModalSelect } from './ModalSelect';
49
49
  export { EditableName } from './EditableName';
50
50
  export { VirtualizedMenu } from './VirtualizedMenu';
51
- export { SearchPopover } from './SearchPopover';
51
+ export { SearchPopover, PopoverAddField } from './SearchPopover';
52
52
  export * from './EmptyData';
53
53
  export * from './PreviewModal';
54
54
  export * from './Drawer';
@@ -71,4 +71,4 @@ export type { ImageResizeHandle } from './ImageEditor';
71
71
  export type { EditableNameHandle } from './EditableName';
72
72
  export type { AccountListingHandle, AccountSelectionProps } from './AccountSelection';
73
73
  export type { VirtualizedMenuProps } from './VirtualizedMenu';
74
- export type { SearchPopoverProps } from './SearchPopover';
74
+ export type { SearchPopoverProps, PopoverAddFieldProps } from './SearchPopover';
@@ -48,7 +48,7 @@ export * from './DatePickerV2';
48
48
  export { ModalSelect } from './ModalSelect';
49
49
  export { EditableName } from './EditableName';
50
50
  export { VirtualizedMenu } from './VirtualizedMenu';
51
- export { SearchPopover } from './SearchPopover';
51
+ export { SearchPopover, PopoverAddField } from './SearchPopover';
52
52
  export * from './EmptyData';
53
53
  export * from './PreviewModal';
54
54
  export * from './Drawer';
@@ -71,10 +71,10 @@ export const useLeftMenu = (props) => {
71
71
  const { data: dashboardData, refetch: refetchDashboard } = useGetDashboard({
72
72
  args: {
73
73
  auth: {
74
- token: env === 'development' ? '5474r2x214z284d4w2b4y494d43464k5a4v2j464m5a4' : auth === null || auth === void 0 ? void 0 : auth.token,
75
- url: env === 'development' ? `${CDP_API.production}/hub` : `${CDP_API === null || CDP_API === void 0 ? void 0 : CDP_API[env]}/hub`,
76
- portalId: env === 'development' ? 561236459 : auth === null || auth === void 0 ? void 0 : auth.portalId,
77
- userId: env === 'development' ? '1600083836' : auth === null || auth === void 0 ? void 0 : auth.userId,
74
+ token: auth === null || auth === void 0 ? void 0 : auth.token,
75
+ url: `${CDP_API === null || CDP_API === void 0 ? void 0 : CDP_API[env]}/hub`,
76
+ portalId: auth === null || auth === void 0 ? void 0 : auth.portalId,
77
+ userId: auth === null || auth === void 0 ? void 0 : auth.userId,
78
78
  },
79
79
  params: {
80
80
  objectType,
@@ -5,8 +5,6 @@ import { Typography } from 'antd';
5
5
  import classNames from 'classnames';
6
6
  import { isNil, isString } from 'lodash';
7
7
  import { Link } from 'react-router-dom';
8
- // Assets
9
- import SubLogoAntsomi from '@antscorp/antsomi-ui/es/assets/images/logo/sub-logo-antsomi.png';
10
8
  // Styled
11
9
  import { ChildMenuWrapper, ExpandWrapper, FeatureMenu, FeatureMenuItem, LeftMenuNav, LeftMenuNavWrapper, PopoverWrapper, NavLogoWrapper, FeatureMenuWrapper, IconWrapper, } from './styled';
12
10
  // Constants
@@ -15,6 +13,7 @@ import { APP_KEYS } from './constants';
15
13
  import { CustomMenu, CommonMenu, HomeMenu } from './components';
16
14
  // Hooks
17
15
  import { useLeftMenu, useNavigatePath } from './hooks';
16
+ const SubLogoAntsomi = 'https://st-media-template.antsomi.com/icons/antsomi/antsomi.png';
18
17
  export const LeftMenu = memo(props => {
19
18
  const { style, className, customization } = props;
20
19
  const { isExpandable = true, isCustomized = false, items = [], onMenuItemClick, } = customization || {};
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components';
3
3
  import skeletonBackground from '../../../../../assets/images/background/skeleton-background.png';
4
4
  // Constants
5
5
  import { globalToken } from '@antscorp/antsomi-ui/es/constants';
6
+ import { MOBILE_VIEWPORT } from '@antscorp/antsomi-ui/es/components/atoms/MobileFrameV2/constants';
6
7
  const THUMBNAIL_CARD_RADIUS = 5;
7
8
  export const BannerWrapper = styled.div `
8
9
  width: 100%;
@@ -19,9 +20,16 @@ export const BannerWrapper = styled.div `
19
20
  #banner-mobile {
20
21
  ${props => {
21
22
  const height = props.$height || 700;
22
- const scale = (height - 10) / 722.41;
23
+ const smallScale = (height - 10) / (MOBILE_VIEWPORT.MD.height + 36);
24
+ const largeScale = (height - 10) / (MOBILE_VIEWPORT.LG.height + 36);
23
25
  return css `
24
- transform: scale(${scale});
26
+ @media screen and (max-height: 1000px) {
27
+ transform: scale(${smallScale});
28
+ }
29
+
30
+ @media screen and (min-height: 1001px) {
31
+ transform: scale(${largeScale});
32
+ }
25
33
  `;
26
34
  }}
27
35
  }
@@ -177,9 +177,9 @@ THEME.components = {
177
177
  titleFontSizeSM: 14,
178
178
  horizontalMargin: '0px',
179
179
  colorBorderSecondary: '#E5E5E5',
180
- lineHeight: 1.17,
181
- lineHeightLG: 1.17,
182
- lineHeightSM: 1.17,
180
+ lineHeight: 1.143,
181
+ lineHeightLG: 1.143,
182
+ lineHeightSM: 1.143,
183
183
  itemHoverColor: (_w = THEME.token) === null || _w === void 0 ? void 0 : _w.colorPrimary,
184
184
  },
185
185
  Collapse: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-common.2",
3
+ "version": "1.3.5-common.4",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -19,6 +19,7 @@
19
19
  "unpkg": "dist/index.js",
20
20
  "types": "es/index.d.ts",
21
21
  "scripts": {
22
+ "publish": "npm run clean && npm run build:es",
22
23
  "build:es": "npm run copy-files && npm run ts-compile",
23
24
  "clean": "rimraf dist lib es",
24
25
  "dev": "vite",