@antscorp/antsomi-ui 1.3.6-beta.3 → 1.3.6-beta.30

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 (91) hide show
  1. package/es/components/atoms/Input/Input.d.ts +11 -17
  2. package/es/components/atoms/Input/Input.js +7 -11
  3. package/es/components/atoms/Switch/Switch.js +2 -1
  4. package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
  5. package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
  6. package/es/components/icons/TaskAltIcon.d.ts +3 -0
  7. package/es/components/icons/TaskAltIcon.js +7 -0
  8. package/es/components/icons/UnsubscribeIcon.d.ts +3 -0
  9. package/es/components/icons/UnsubscribeIcon.js +7 -0
  10. package/es/components/icons/index.d.ts +2 -0
  11. package/es/components/icons/index.js +2 -0
  12. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
  13. package/es/components/molecules/CodeStructure/CodeStructure.d.ts +23 -2
  14. package/es/components/molecules/CodeStructure/CodeStructure.js +136 -26
  15. package/es/components/molecules/CodeStructure/constants.js +2 -2
  16. package/es/components/molecules/CodeStructure/styled.d.ts +3 -0
  17. package/es/components/molecules/CodeStructure/styled.js +6 -0
  18. package/es/components/molecules/CodeStructure/type.d.ts +2 -2
  19. package/es/components/molecules/CodeStructure/type.js +2 -2
  20. package/es/components/molecules/CodeStructure/utils.d.ts +12 -2
  21. package/es/components/molecules/CodeStructure/utils.js +5 -3
  22. package/es/components/molecules/DrawerDetail/DrawerDetail.js +10 -5
  23. package/es/components/molecules/DrawerDetail/types.d.ts +1 -0
  24. package/es/components/molecules/Dropdown/style.scss +6 -4
  25. package/es/components/molecules/EditingListV2/EditingList.d.ts +2 -0
  26. package/es/components/molecules/EditingListV2/EditingList.js +17 -0
  27. package/es/components/molecules/EditingListV2/components/List/List.d.ts +9 -0
  28. package/es/components/molecules/EditingListV2/components/List/List.js +42 -0
  29. package/es/components/molecules/EditingListV2/components/List/index.d.ts +1 -0
  30. package/es/components/molecules/EditingListV2/components/List/index.js +1 -0
  31. package/es/components/molecules/EditingListV2/components/Loadable.d.ts +8 -0
  32. package/es/components/molecules/EditingListV2/components/Loadable.js +2 -0
  33. package/es/components/molecules/EditingListV2/components/Popover/Popover.d.ts +11 -0
  34. package/es/components/molecules/EditingListV2/components/Popover/Popover.js +10 -0
  35. package/es/components/molecules/EditingListV2/components/Popover/index.d.ts +1 -0
  36. package/es/components/molecules/EditingListV2/components/Popover/index.js +1 -0
  37. package/es/components/molecules/EditingListV2/components/index.d.ts +3 -0
  38. package/es/components/molecules/EditingListV2/components/index.js +3 -0
  39. package/es/components/molecules/EditingListV2/index.d.ts +2 -0
  40. package/es/components/molecules/EditingListV2/index.js +1 -0
  41. package/es/components/molecules/EditingListV2/types.d.ts +19 -0
  42. package/es/components/molecules/EditingListV2/types.js +1 -0
  43. package/es/components/molecules/EditingListV2/utils.d.ts +27 -0
  44. package/es/components/molecules/EditingListV2/utils.js +28 -0
  45. package/es/components/molecules/InputSelectAttribute/index.js +5 -2
  46. package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.js +2 -2
  47. package/es/components/molecules/SearchPopover/components/PopoverSelect/PopoverSelect.js +4 -4
  48. package/es/components/molecules/SearchPopover/types.d.ts +1 -0
  49. package/es/components/molecules/TagifyInput/TagifyInput.js +5 -3
  50. package/es/components/molecules/index.d.ts +1 -0
  51. package/es/components/molecules/index.js +1 -0
  52. package/es/components/organism/TicketEditorV2/Content.d.ts +27 -0
  53. package/es/components/organism/TicketEditorV2/Content.js +296 -0
  54. package/es/components/organism/TicketEditorV2/Service.d.ts +49 -0
  55. package/es/components/organism/TicketEditorV2/Service.js +58 -0
  56. package/es/components/organism/TicketEditorV2/TicketEditorV2.d.ts +20 -0
  57. package/es/components/organism/TicketEditorV2/TicketEditorV2.js +124 -0
  58. package/es/components/organism/TicketEditorV2/components/DropdownComponent.d.ts +9 -0
  59. package/es/components/organism/TicketEditorV2/components/DropdownComponent.js +45 -0
  60. package/es/components/organism/TicketEditorV2/components/Message.d.ts +2 -0
  61. package/es/components/organism/TicketEditorV2/components/Message.js +31 -0
  62. package/es/components/organism/TicketEditorV2/components/MessageComponent.d.ts +10 -0
  63. package/es/components/organism/TicketEditorV2/components/MessageComponent.js +64 -0
  64. package/es/components/organism/TicketEditorV2/components/icons/AddTicketIcon.d.ts +2 -0
  65. package/es/components/organism/TicketEditorV2/components/icons/AddTicketIcon.js +5 -0
  66. package/es/components/organism/TicketEditorV2/components/icons/TicketIcon.d.ts +2 -0
  67. package/es/components/organism/TicketEditorV2/components/icons/TicketIcon.js +5 -0
  68. package/es/components/organism/TicketEditorV2/constant.d.ts +17 -0
  69. package/es/components/organism/TicketEditorV2/constant.js +17 -0
  70. package/es/components/organism/TicketEditorV2/constants/index.d.ts +1 -0
  71. package/es/components/organism/TicketEditorV2/constants/index.js +1 -0
  72. package/es/components/organism/TicketEditorV2/constants/queryKeys.d.ts +5 -0
  73. package/es/components/organism/TicketEditorV2/constants/queryKeys.js +5 -0
  74. package/es/components/organism/TicketEditorV2/index.d.ts +1 -0
  75. package/es/components/organism/TicketEditorV2/index.js +1 -0
  76. package/es/components/organism/TicketEditorV2/queries/index.d.ts +3 -0
  77. package/es/components/organism/TicketEditorV2/queries/index.js +3 -0
  78. package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.d.ts +12 -0
  79. package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.js +14 -0
  80. package/es/components/organism/TicketEditorV2/queries/useGetListComments.d.ts +13 -0
  81. package/es/components/organism/TicketEditorV2/queries/useGetListComments.js +18 -0
  82. package/es/components/organism/TicketEditorV2/queries/useGetListUser.d.ts +11 -0
  83. package/es/components/organism/TicketEditorV2/queries/useGetListUser.js +14 -0
  84. package/es/components/organism/TicketEditorV2/styled.d.ts +54 -0
  85. package/es/components/organism/TicketEditorV2/styled.js +871 -0
  86. package/es/components/organism/TicketEditorV2/util.d.ts +46 -0
  87. package/es/components/organism/TicketEditorV2/util.js +408 -0
  88. package/es/components/organism/index.d.ts +1 -0
  89. package/es/components/organism/index.js +1 -0
  90. package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
  91. package/package.json +2 -2
@@ -16,7 +16,7 @@ import { safeParseJson } from '@antscorp/antsomi-ui/es/utils';
16
16
  import { POST_MESSAGE_TYPES } from '@antscorp/antsomi-ui/es/constants';
17
17
  export const DrawerDetail = props => {
18
18
  // Props
19
- const { width, fullScreen: fullScreenProp = false, children, menuProps, closeIconProps, maxWidth, minWidth, defaultSize = 'max', headerProps, name, destroyOnClose = true, mask = false, classNames, onToggleCollapse, closable = false, ...restProps } = props;
19
+ const { width, fullScreen: fullScreenProp = false, children, menuProps, closeIconProps, maxWidth, minWidth, defaultSize = 'max', headerProps, name, destroyOnClose = true, mask = false, classNames, collapsed: propCollapsed, onToggleCollapse, closable = false, ...restProps } = props;
20
20
  const { show: showMenu = true, showExpandButton = true, showClose = true, items, selectedKeys, footer, onClick = () => { }, } = menuProps || {};
21
21
  const { children: headerChildren, ...restOfHeaderProps } = headerProps || {};
22
22
  const { onClose = () => { } } = props;
@@ -99,17 +99,22 @@ export const DrawerDetail = props => {
99
99
  }
100
100
  }
101
101
  }, [collapseDrawer, fullScreen, matchesSmallScreen, maxWidth, minWidth, width]);
102
- const handleToggleDrawerSize = () => {
102
+ const handleToggleDrawerSize = useCallback((updatedCollapsed) => {
103
103
  const localStorageValues = safeParseJson(localStorage.getItem(DRAWER_DETAIL_LOCAL_STORAGE_KEY), {});
104
- toggleCollapseDrawer(!collapseDrawer);
105
- onToggleCollapse?.(!collapseDrawer);
104
+ toggleCollapseDrawer(updatedCollapsed ?? !collapseDrawer);
105
+ onToggleCollapse?.(updatedCollapsed ?? !collapseDrawer);
106
106
  /**
107
107
  * Set local storage last collapsed
108
108
  */
109
109
  if (name) {
110
110
  localStorage.setItem(DRAWER_DETAIL_LOCAL_STORAGE_KEY, JSON.stringify({ ...localStorageValues, [name || '']: !collapseDrawer }));
111
111
  }
112
- };
112
+ }, [collapseDrawer, name, onToggleCollapse, toggleCollapseDrawer]);
113
+ useEffect(() => {
114
+ if (propCollapsed !== undefined) {
115
+ handleToggleDrawerSize(propCollapsed);
116
+ }
117
+ }, [propCollapsed, handleToggleDrawerSize]);
113
118
  return (_jsxs(StyledDrawer, { push: false, closable: closable, width: drawerWidth, motion: {
114
119
  visible: false,
115
120
  motionAppear: false,
@@ -14,6 +14,7 @@ export interface DrawerDetailProps extends Omit<DrawerProps, 'closeIcon' | 'titl
14
14
  classNames?: DrawerProps['classNames'] & {
15
15
  btnToogleSize?: string;
16
16
  };
17
+ collapsed?: boolean;
17
18
  onToggleCollapse?: (collapsed: boolean) => void;
18
19
  }
19
20
  export interface DrawerDetailCloseIconProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
@@ -1,9 +1,11 @@
1
1
  .antsomi-input-dropdown-overlay {
2
- .antsomi-dropdown-menu {
3
- overflow: hidden;
2
+ &.antsomi-dropdown {
3
+ .antsomi-dropdown-menu {
4
+ overflow: hidden;
4
5
 
5
- :hover {
6
- overflow: auto;
6
+ &:hover {
7
+ overflow: auto;
8
+ }
7
9
  }
8
10
  }
9
11
  }
@@ -0,0 +1,2 @@
1
+ import { EditingListProps } from './types';
2
+ export declare const EditingListV2: (props: EditingListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Libraries
3
+ import { useMemo } from 'react';
4
+ // Components
5
+ import { Suspense } from '../../atoms';
6
+ import { ListItem, LazyComponent } from './components';
7
+ const { Popover } = LazyComponent;
8
+ export const EditingListV2 = (props) => {
9
+ const { isLoading = false, addButtonLabel = 'Add', options = [], selected = [], removable = true, popupPlacement = 'right', className, onChange, } = props;
10
+ const selectedOptions = useMemo(() => options.filter(opt => selected.includes(opt.key)), [selected, options]);
11
+ // const isSelectAll = selectedOptions.length === options.length;
12
+ const handleRemove = (removedKey) => {
13
+ const selectedKeys = selectedOptions.filter(opt => opt.key !== removedKey).map(opt => opt.key);
14
+ onChange?.(selectedKeys);
15
+ };
16
+ return (_jsxs("div", { className: className, children: [_jsx(ListItem, { isLoading: isLoading, selectOptions: selectedOptions, removable: removable, onClickRemove: handleRemove }), !isLoading && (_jsx(Suspense, { children: _jsx(Popover, { placement: popupPlacement, options: options, selected: selected, addButtonLabel: addButtonLabel, onChange: onChange }) }))] }));
17
+ };
@@ -0,0 +1,9 @@
1
+ import { Option } from '../../types';
2
+ type ListProps = {
3
+ isLoading: boolean;
4
+ selectOptions: Option[];
5
+ removable?: boolean;
6
+ onClickRemove?: (key: string) => void;
7
+ };
8
+ export declare const ListItem: (props: ListProps) => import("react/jsx-runtime").JSX.Element | undefined;
9
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Libraries
3
+ import { useState } from 'react';
4
+ import { isEmpty } from 'lodash';
5
+ // Components
6
+ import { Spin, Typography } from '../../../../atoms';
7
+ import { List } from 'antd';
8
+ import { CloseIcon } from '@antscorp/antsomi-ui/es/components/icons';
9
+ // Utils
10
+ import { CLS } from '../../utils';
11
+ // Constants
12
+ import { globalToken } from '@antscorp/antsomi-ui/es/constants';
13
+ export const ListItem = (props) => {
14
+ const { isLoading, selectOptions, onClickRemove, removable } = props;
15
+ const [hover, setHover] = useState('');
16
+ const renderLabel = (label) => {
17
+ if (typeof label === 'string') {
18
+ return _jsx(Typography.Text, { ellipsis: { tooltip: true }, children: label });
19
+ }
20
+ return label;
21
+ };
22
+ const items = selectOptions.map(opt => ({
23
+ className: CLS.ListItem.default,
24
+ key: opt.key,
25
+ label: renderLabel(opt.label),
26
+ }));
27
+ if (isLoading) {
28
+ return _jsx(Spin, { indicatorSize: 24 });
29
+ }
30
+ if (isEmpty(selectOptions)) {
31
+ return;
32
+ }
33
+ return (_jsx(List, { dataSource: items, renderItem: item => (_jsxs(List.Item, { style: {
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ border: '1px solid #B8CFE6',
37
+ borderRadius: '4px',
38
+ padding: '10px',
39
+ marginBottom: '10px',
40
+ minHeight: '40px',
41
+ }, onMouseEnter: () => setHover(item.key), onMouseLeave: () => setHover(''), children: [item.label, ' ', hover === item.key && removable && (_jsx(CloseIcon, { size: 18, color: globalToken?.bw8, style: { flexShrink: 0, cursor: 'pointer' }, onClick: onClickRemove ? () => onClickRemove(item.key) : undefined }))] })) }));
42
+ };
@@ -0,0 +1 @@
1
+ export { ListItem } from './List';
@@ -0,0 +1 @@
1
+ export { ListItem } from './List';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const Popover: import("react").LazyExoticComponent<(props: {
3
+ placement?: "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "left" | "right" | "bottom" | "top" | "bottomLeft" | "topLeft" | "topRight" | "bottomRight" | undefined;
4
+ options: import("../types").Option[];
5
+ selected: string[];
6
+ addButtonLabel: import("react").ReactNode;
7
+ onChange?: ((selected: string[]) => void) | undefined;
8
+ }) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,2 @@
1
+ import { lazy } from 'react';
2
+ export const Popover = lazy(() => import('./Popover').then(module => ({ default: module.Popover })));
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Option } from '../../types';
3
+ type PopoverProps = {
4
+ placement?: 'left' | 'right' | 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
5
+ options: Option[];
6
+ selected: string[];
7
+ addButtonLabel: React.ReactNode;
8
+ onChange?: (selected: string[]) => void;
9
+ };
10
+ export declare const Popover: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Components
3
+ import { Button } from '@antscorp/antsomi-ui/es/components/atoms';
4
+ import { PopoverAddField } from '../../../SearchPopover';
5
+ // Icons
6
+ import { AddIcon } from '../../../../icons';
7
+ export const Popover = (props) => {
8
+ const { options, selected, addButtonLabel, onChange, placement } = props;
9
+ return (_jsx(PopoverAddField, { style: { margin: 0 }, fields: options, placement: placement, selected: selected, onApply: onChange, isAllowEmpty: true, children: _jsxs(Button, { type: "text", children: [_jsx(AddIcon, { size: 14 }), addButtonLabel] }) }));
10
+ };
@@ -0,0 +1 @@
1
+ export { Popover } from './Popover';
@@ -0,0 +1 @@
1
+ export { Popover } from './Popover';
@@ -0,0 +1,3 @@
1
+ export { ListItem } from './List';
2
+ export { Popover } from './Popover';
3
+ export * as LazyComponent from './Loadable';
@@ -0,0 +1,3 @@
1
+ export { ListItem } from './List';
2
+ export { Popover } from './Popover';
3
+ export * as LazyComponent from './Loadable';
@@ -0,0 +1,2 @@
1
+ export { EditingListV2 } from './EditingList';
2
+ export type { EditingListProps } from './types';
@@ -0,0 +1 @@
1
+ export { EditingListV2 } from './EditingList';
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export type Option = {
3
+ key: string;
4
+ label: React.ReactNode;
5
+ search?: string;
6
+ };
7
+ export type EditingListProps = {
8
+ popupPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
9
+ addButtonLabel?: string;
10
+ options?: Option[];
11
+ selected?: string[];
12
+ showNum?: boolean;
13
+ className?: string;
14
+ isLoading?: boolean;
15
+ emptyDescription?: string;
16
+ removable?: boolean;
17
+ isAllowEmpty?: boolean;
18
+ onChange?: (selected: string[]) => void;
19
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ export declare const componentCls: (className: string) => string;
2
+ export declare const CLS: {
3
+ readonly Root: {
4
+ readonly default: string;
5
+ };
6
+ readonly Title: {
7
+ readonly default: string;
8
+ };
9
+ readonly Search: {
10
+ readonly default: string;
11
+ };
12
+ readonly RemoveButton: {
13
+ readonly default: string;
14
+ };
15
+ readonly AddButton: {
16
+ readonly default: string;
17
+ };
18
+ readonly ListWapper: {
19
+ readonly default: string;
20
+ };
21
+ readonly List: {
22
+ readonly default: string;
23
+ };
24
+ readonly ListItem: {
25
+ readonly default: string;
26
+ };
27
+ };
@@ -0,0 +1,28 @@
1
+ import { antsomiClsx } from '@antscorp/antsomi-ui/es/utils';
2
+ export const componentCls = antsomiClsx('editing-list');
3
+ export const CLS = {
4
+ Root: {
5
+ default: componentCls('root'),
6
+ },
7
+ Title: {
8
+ default: componentCls('title'),
9
+ },
10
+ Search: {
11
+ default: componentCls('search'),
12
+ },
13
+ RemoveButton: {
14
+ default: componentCls('remove-btn'),
15
+ },
16
+ AddButton: {
17
+ default: componentCls('add-btn'),
18
+ },
19
+ ListWapper: {
20
+ default: componentCls('selected-list-wrapper'),
21
+ },
22
+ List: {
23
+ default: componentCls('selected-list'),
24
+ },
25
+ ListItem: {
26
+ default: componentCls('selected-list-item'),
27
+ },
28
+ };
@@ -14,6 +14,7 @@ import { EmptyData } from '../EmptyData';
14
14
  import { Dashboard30Icon, ErrorIcon } from '../../icons';
15
15
  // Constants
16
16
  import { THEME } from '@antscorp/antsomi-ui/es/constants';
17
+ import { TAG_TYPE } from '../TagifyInput';
17
18
  const InputSelectAttribute = (props) => {
18
19
  const { value, errorMsg, label, isErrorTag, sourceOptions = [], mapCodeOptions = {}, onChange, } = props;
19
20
  const [form] = Form.useForm();
@@ -27,7 +28,7 @@ const InputSelectAttribute = (props) => {
27
28
  return [];
28
29
  }, [sourceValue, mapCodeOptions]);
29
30
  const initCodeTitleField = useMemo(() => {
30
- if (sourceValue === 'allocated_code') {
31
+ if (sourceValue === TAG_TYPE.PROMOTION_CODE) {
31
32
  return 'Allocated Code';
32
33
  }
33
34
  return upperFirst(translate(translations._ITEM_NAME_ATTRIBUTE, 'attribute'));
@@ -98,7 +99,9 @@ const InputSelectAttribute = (props) => {
98
99
  height: 32,
99
100
  padding: '4px 12px 4px 4px',
100
101
  borderBottom: `1px solid ${errorMsg ? THEME.token?.colorError : THEME.token?.blue1}`,
101
- }, children: [_jsx("div", { style: { width: '100%', cursor: 'pointer' }, onClick: onOpenModal, children: isObjValue && (_jsx(Tag, { isError: isErrorTag, children: isErrorTag ? (_jsxs(Flex, { gap: 5, align: "center", children: ["Unknown", _jsx(Tooltip, { title: "The used dynamic content is removed", children: _jsx(ErrorIcon, { size: 16 }) })] })) : (get(mapCodeBySource, [value?.code, 'label'], value?.code)) })) }), _jsx(Icon, { type: "icon-ants-remove", style: { fontSize: 10, color: '#222', cursor: 'pointer' }, onClick: onDeselect })] }));
102
+ }, children: [_jsx("div", { style: { width: '100%', cursor: 'pointer' }, onClick: onOpenModal, children: isObjValue && (_jsx(Tag, { isError: isErrorTag, children: isErrorTag ? (_jsxs(Flex, { gap: 5, align: "center", children: ["Unknown", _jsx(Tooltip, { title: "The used dynamic content is removed", children: _jsx(ErrorIcon, { size: 16 }) })] })) : (_jsx(Typography.Text, { ellipsis: {
103
+ tooltip: get(mapCodeBySource, [value?.code, 'label'], value?.code),
104
+ }, style: { maxWidth: 150 }, children: get(mapCodeBySource, [value?.code, 'label'], value?.code) })) })) }), _jsx(Icon, { type: "icon-ants-remove", style: { fontSize: 10, color: '#222', cursor: 'pointer' }, onClick: onDeselect })] }));
102
105
  }
103
106
  else {
104
107
  element = (_jsx(StyledSelect, { mode: "multiple", options: [{ value: '', label: 'Or select a field' }], notFoundContent: null, onSelect: onOpenModal, style: { width: '100%', borderTop: 'none', borderLeft: 'none', borderRight: 'none' }, onDeselect: onDeselect, autoClearSearchValue: false, searchValue: typeof value === 'string' ? value : '', onSearch: onChangeInput, status: errorMsg ? 'error' : undefined, placeholder: typeof value === 'string' ? value : translate(translations.inputYourValue.title), "$isPlaceholder": !value, "$isError": !!errorMsg, dropdownStyle: {
@@ -7,7 +7,7 @@ import { PopoverSelect } from '../PopoverSelect';
7
7
  import { Flex, Typography } from 'antd';
8
8
  import { IconField } from '@antscorp/antsomi-ui/es/components/atoms/IconField';
9
9
  export const PopoverAddField = (props) => {
10
- const { fields, onSearchPredicate, className, children, ...rest } = props;
10
+ const { fields, onSearchPredicate, className, children, isAllowEmpty, ...rest } = props;
11
11
  const originalFieldByKey = useMemo(() => new Map(fields.map(field => [field.key, field])), [fields]);
12
12
  const handleOnSearchPredicate = useCallback((option) => {
13
13
  const originalField = originalFieldByKey.get(option.key);
@@ -27,5 +27,5 @@ export const PopoverAddField = (props) => {
27
27
  selected: params.selected.includes(field.key),
28
28
  })] })),
29
29
  })), [fields]);
30
- return (_jsx(PopoverSelect, { ...rest, options: options, onSearchPredicate: handleOnSearchPredicate, className: clsx(className, 'ants-popover-add-fields'), children: children || (_jsxs(Button, { type: "text", children: [_jsx(Icon, { type: "icon-ants-plus-slim", size: 14 }), "Add fields"] })) }));
30
+ return (_jsx(PopoverSelect, { ...rest, options: options, onSearchPredicate: handleOnSearchPredicate, className: clsx(className, 'ants-popover-add-fields'), isAllowEmpty: isAllowEmpty || false, children: children || (_jsxs(Button, { type: "text", children: [_jsx(Icon, { type: "icon-ants-plus-slim", size: 14 }), "Add fields"] })) }));
31
31
  };
@@ -14,7 +14,7 @@ import { VirtualizedMenu } from '../../../VirtualizedMenu';
14
14
  import { ITEM_SIZE, ITEM_SPACING } from '../../../VirtualizedMenu/config';
15
15
  const { t } = i18nInstance;
16
16
  export const PopoverSelect = (props) => {
17
- const { open: openProp, selected, options: optionsProp = [], inputSearchProps = {}, children, showAllLabel = 'Show all', showSelectedLabel = 'Show selected', selectAllLabel = 'Select all', deselectAllLabel = 'Unselect all', menuProps = {}, onCancel, onApply, onSearchPredicate, ...rest } = props;
17
+ const { open: openProp, selected, options: optionsProp = [], inputSearchProps = {}, children, showAllLabel = 'Show all', showSelectedLabel = 'Show selected', selectAllLabel = 'Select all', deselectAllLabel = 'Unselect all', menuProps = {}, isAllowEmpty = false, onCancel, onApply, onSearchPredicate, ...rest } = props;
18
18
  const itemSize = menuProps.itemSize || ITEM_SIZE;
19
19
  const itemSpacing = menuProps.itemSpacing || ITEM_SPACING;
20
20
  const { value: searchValue, searchConfig, ...restInputSearchProps } = inputSearchProps;
@@ -26,7 +26,7 @@ export const PopoverSelect = (props) => {
26
26
  const [selectedKeys, setSelectedKeys] = useState(new Set());
27
27
  const [search, setSearch] = useState('');
28
28
  const [showSelected, setShowSelected] = useState(false);
29
- const applyDisabled = selectedKeys.size === 0;
29
+ const applyDisabled = selectedKeys.size === 0 && !isAllowEmpty;
30
30
  const options = useMemo(() => typeof optionsProp === 'function'
31
31
  ? optionsProp({ selected: [...selectedKeys] })
32
32
  : optionsProp, [optionsProp, selectedKeys]);
@@ -113,11 +113,11 @@ export const PopoverSelect = (props) => {
113
113
  key: opt.key,
114
114
  label: (_jsx(Checkbox, { onChange: e => handleToggleField(opt, e.target.checked), checked: selectedKeys.has(opt.key), children: renderCheckBoxLabel(opt) })),
115
115
  }));
116
- return (_jsx(SearchPopover, { destroyTooltipOnHide: true, ...rest, content: _jsxs(_Fragment, { children: [optionsProp.length > 0 && (_jsxs(StyledAction, { children: [_jsx(Button, { type: "link", size: "small", onClick: () => setShowSelected(current => !current), children: showSelected ? showAllLabel : showSelectedLabel }), selectedKeys.size === options.length ? (_jsx(Button, { type: "link", onClick: handleDeselectAll, children: deselectAllLabel })) : (_jsx(Button, { type: "link", onClick: handleSelectAll, children: selectAllLabel }))] })), filteredOptions.length ? (_jsx(StyledListFieldsWrapper, { "$minHeight": calDefaultListHeightInPopover({
116
+ return (_jsx(SearchPopover, { destroyTooltipOnHide: true, placement: "bottomLeft", ...rest, content: _jsxs(_Fragment, { children: [optionsProp.length > 0 && (_jsxs(StyledAction, { children: [_jsx(Button, { type: "link", size: "small", onClick: () => setShowSelected(current => !current), children: showSelected ? showAllLabel : showSelectedLabel }), selectedKeys.size === options.length ? (_jsx(Button, { type: "link", onClick: handleDeselectAll, children: deselectAllLabel })) : (_jsx(Button, { type: "link", onClick: handleSelectAll, children: selectAllLabel }))] })), filteredOptions.length ? (_jsx(StyledListFieldsWrapper, { "$minHeight": calDefaultListHeightInPopover({
117
117
  listLength: filteredOptions.length,
118
118
  itemSize,
119
119
  itemSpacing,
120
- }), children: _jsx(VirtualizedMenu, { ...menuProps, itemSize: itemSize, items: items }) })) : (_jsx(EmptyData, { showIcon: false, description: t(translations.noData).toString() })), _jsxs(StyledFooter, { children: [_jsx(Button, { onClick: handleCancel, children: "Cancel" }), _jsx(Button, { onClick: handleApply, disabled: applyDisabled, type: "primary", children: "Apply" })] })] }), trigger: ['click'], placement: "bottomLeft", open: open, inputSearchProps: {
120
+ }), children: _jsx(VirtualizedMenu, { ...menuProps, itemSize: itemSize, items: items }) })) : (_jsx(EmptyData, { showIcon: false, description: t(translations.noData).toString() })), _jsxs(StyledFooter, { children: [_jsx(Button, { onClick: handleCancel, children: "Cancel" }), _jsx(Button, { onClick: handleApply, disabled: applyDisabled, type: "primary", children: "Apply" })] })] }), trigger: ['click'], open: open, inputSearchProps: {
121
121
  ...restInputSearchProps,
122
122
  value: search,
123
123
  onAfterChange: handleOnSearch,
@@ -9,6 +9,7 @@ export type SearchPopoverProps = PropsWithChildren<{
9
9
  inputSearchProps?: InputProps & {
10
10
  searchConfig?: SearchConfig;
11
11
  };
12
+ isAllowEmpty?: boolean;
12
13
  } & PopoverProps>;
13
14
  export type Option = {
14
15
  key: string;
@@ -24,7 +24,7 @@ const { CUSTOM_TAG } = TAG_TYPE;
24
24
  const { READONLY_TAG, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP, ERROR_TAG, WARNING_TAG } = TAG_CUSTOM_ATTRIBUTES;
25
25
  const TagifyInput = forwardRef((props, ref) => {
26
26
  // Props
27
- const { initialValue, escapeHTML, status, readonly, readonlyTag, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties = {}, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, } = props;
27
+ const { initialValue, escapeHTML, status, readonly, readonlyTag, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, } = props;
28
28
  // States
29
29
  const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
30
30
  const [tooltipRefresher, setTooltipRefresher] = useState(1);
@@ -35,6 +35,7 @@ const TagifyInput = forwardRef((props, ref) => {
35
35
  const tagifyWrapperRef = useRef(null);
36
36
  const placeholderRef = useRef(null);
37
37
  const lastRange = useRef(null);
38
+ const tagLength = tagifyRef?.current?.getTagElms().length;
38
39
  // Memoizations
39
40
  const cssVariablesMemoized = useMemo(() => _.assign({}, defaultCssVariables, cssTagifyVariables || {}), [cssTagifyVariables]);
40
41
  // Only run in the first render
@@ -823,10 +824,10 @@ const TagifyInput = forwardRef((props, ref) => {
823
824
  makeValidLabelTags(mapAttributes, mapErrorAttributes);
824
825
  }, [mapAttributes, mapErrorAttributes, makeValidLabelTags]);
825
826
  useLayoutEffect(() => {
826
- if (tagProperties) {
827
+ if (tagProperties && tagLength) {
827
828
  executeTagProperties(tagProperties);
828
829
  }
829
- }, [tagProperties, executeTagProperties]);
830
+ }, [tagProperties, tagLength, executeTagProperties]);
830
831
  // Listen to Tagify events
831
832
  useEffect(() => {
832
833
  const { current: tagifyInstance } = tagifyRef || {};
@@ -874,6 +875,7 @@ const TagifyInput = forwardRef((props, ref) => {
874
875
  }
875
876
  // Convert the string to tagify pattern
876
877
  const content = parseTagStringToTagify(textValue, acceptableTagPattern);
878
+ setIsLineBreak(hasLineBreak(textValue));
877
879
  tagifyRef.current.loadOriginalValues(content);
878
880
  // Need to sync label of the tags if any map attribute is changed to make correct label
879
881
  makeValidLabelTags(mapAttributes, mapErrorAttributes);
@@ -6,6 +6,7 @@ export { Select } from './Select';
6
6
  export { SelectV2 } from './SelectV2';
7
7
  export { DatePicker } from './DatePicker';
8
8
  export { ChatBox, ChatBoxInsight } from './ChatBox';
9
+ export { EditingListV2 } from './EditingListV2';
9
10
  export { PopupDraggable } from './PopupDraggable';
10
11
  export { CaptureScreen } from './CaptureScreen';
11
12
  export { SettingWrapper } from './SettingWrapper';
@@ -6,6 +6,7 @@ export { Select } from './Select';
6
6
  export { SelectV2 } from './SelectV2';
7
7
  export { DatePicker } from './DatePicker';
8
8
  export { ChatBox, ChatBoxInsight } from './ChatBox';
9
+ export { EditingListV2 } from './EditingListV2';
9
10
  export { PopupDraggable } from './PopupDraggable';
10
11
  export { CaptureScreen } from './CaptureScreen';
11
12
  export { SettingWrapper } from './SettingWrapper';
@@ -0,0 +1,27 @@
1
+ declare const Content: ({ apiKey, domain, portalId, token, action, ticketId, listUsers, domainTicket, config, ticketDetails, listComment, userId, fetchgetTicketComments, isLoadingComment, isLoadingDetails, isLoadingDataSouce, accountManage, timeZone, isLoadingSelectedAccount, accountEdit, initOwnerId, isAllAccount, dataSelectInput, setDataSelectInput, }: {
2
+ apiKey: any;
3
+ domain: any;
4
+ portalId: any;
5
+ token: any;
6
+ action: any;
7
+ ticketId: any;
8
+ listUsers: any;
9
+ domainTicket: any;
10
+ config: any;
11
+ ticketDetails: any;
12
+ listComment: any;
13
+ userId: any;
14
+ fetchgetTicketComments: any;
15
+ isLoadingComment: any;
16
+ isLoadingDetails: any;
17
+ isLoadingDataSouce: any;
18
+ accountManage: any;
19
+ timeZone: any;
20
+ isLoadingSelectedAccount: any;
21
+ accountEdit: any;
22
+ initOwnerId: any;
23
+ isAllAccount: any;
24
+ dataSelectInput: any;
25
+ setDataSelectInput: any;
26
+ }) => import("react/jsx-runtime").JSX.Element;
27
+ export default Content;