@antscorp/antsomi-ui 1.3.5-beta.877 → 1.3.5-beta.878

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 (107) hide show
  1. package/es/components/atoms/SlideBar/SlideBar.js +3 -1
  2. package/es/components/atoms/Slider/index.js +3 -8
  3. package/es/components/atoms/index.d.ts +0 -1
  4. package/es/components/atoms/index.js +0 -1
  5. package/es/components/icons/LazyIcon/LazyIcon.d.ts +0 -1
  6. package/es/components/icons/LazyIcon/LazyIcon.js +0 -1
  7. package/es/components/icons/index.d.ts +0 -1
  8. package/es/components/icons/index.js +0 -1
  9. package/es/components/molecules/AccountSelection/AccountListing.js +1 -1
  10. package/es/components/molecules/AccountSelection/index.d.ts +2 -1
  11. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
  12. package/es/components/molecules/CalendarSelection/CalendarSelection.js +5 -4
  13. package/es/components/molecules/ColorPicker/CustomPicker/index.js +2 -2
  14. package/es/components/molecules/ColorPicker/index.d.ts +0 -1
  15. package/es/components/molecules/ColorPicker/index.js +2 -3
  16. package/es/components/molecules/DrawerDetail/DrawerDetail.js +3 -3
  17. package/es/components/molecules/EditableName/EditableName.js +1 -1
  18. package/es/components/molecules/FontSetting/index.js +2 -2
  19. package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +2 -6
  20. package/es/components/molecules/RequestAccess/RequestAccess.d.ts +0 -1
  21. package/es/components/molecules/RequestAccess/RequestAccess.js +10 -5
  22. package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +1 -1
  23. package/es/components/molecules/SearchPopover/components/PopoverSelect/PopoverSelect.js +2 -4
  24. package/es/components/molecules/SelectAccount/ButtonViewAll.js +6 -14
  25. package/es/components/molecules/SelectAccount/Content.js +2 -3
  26. package/es/components/molecules/SelectAccount/styled.js +0 -4
  27. package/es/components/molecules/SelectAccount/type.d.ts +0 -2
  28. package/es/components/molecules/TagifyInput/TagifyInput.js +224 -369
  29. package/es/components/molecules/TagifyInput/constants.d.ts +2 -21
  30. package/es/components/molecules/TagifyInput/constants.js +2 -21
  31. package/es/components/molecules/TagifyInput/patternHandlers.d.ts +1 -3
  32. package/es/components/molecules/TagifyInput/patternHandlers.js +4 -22
  33. package/es/components/molecules/TagifyInput/styled.js +0 -1
  34. package/es/components/molecules/TagifyInput/types.d.ts +0 -2
  35. package/es/components/molecules/TagifyInput/utils.d.ts +0 -20
  36. package/es/components/molecules/TagifyInput/utils.js +3 -41
  37. package/es/components/molecules/TagifyInput/utils.style.js +1 -64
  38. package/es/components/molecules/TemplateSaveAs/styled.js +1 -1
  39. package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +1 -1
  40. package/es/components/molecules/UploadImage/index.d.ts +0 -1
  41. package/es/components/molecules/UploadImage/index.js +4 -41
  42. package/es/components/molecules/index.d.ts +1 -1
  43. package/es/components/molecules/index.js +1 -1
  44. package/es/components/organism/AccountSharing/styled.js +2 -12
  45. package/es/components/organism/ContentSources/Settings.d.ts +0 -3
  46. package/es/components/organism/ContentSources/Settings.js +1 -1
  47. package/es/components/organism/ContentSources/index.d.ts +0 -3
  48. package/es/components/organism/ContentSources/index.js +3 -4
  49. package/es/components/organism/DataTable/utils/filter.d.ts +1 -1
  50. package/es/components/organism/LeftMenu/utils/index.js +5 -7
  51. package/es/components/organism/index.d.ts +0 -1
  52. package/es/components/organism/index.js +0 -1
  53. package/es/components/template/Layout/Layout.js +7 -51
  54. package/es/components/template/Layout/constants/menuCode.d.ts +0 -1
  55. package/es/components/template/Layout/constants/menuCode.js +0 -1
  56. package/es/components/template/Layout/constants/permission.d.ts +1 -0
  57. package/es/components/template/Layout/constants/permission.js +1 -1
  58. package/es/components/template/Layout/utils/permission.js +0 -1
  59. package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
  60. package/es/constants/queries.d.ts +0 -1
  61. package/es/constants/queries.js +0 -1
  62. package/es/locales/en/translation.json +1 -1
  63. package/es/locales/ja/google-sheet.json +31 -31
  64. package/es/locales/vi/google-sheet.json +1 -1
  65. package/es/providers/ConfigProvider/GlobalStyle.js +1 -29
  66. package/es/queries/Account/useGetAccountList.js +1 -1
  67. package/es/queries/index.d.ts +0 -1
  68. package/es/queries/index.js +0 -1
  69. package/es/services/Permission/index.d.ts +0 -16
  70. package/es/services/Permission/index.js +0 -35
  71. package/es/stories/assets/code-brackets.svg +1 -0
  72. package/es/test.d.ts +11 -0
  73. package/es/test.js +377 -138
  74. package/package.json +4 -5
  75. package/es/__tests__/fileMock.test.d.ts +0 -2
  76. package/es/__tests__/fileMock.test.js +0 -2
  77. package/es/__tests__/styleMock.test.d.ts +0 -1
  78. package/es/__tests__/styleMock.test.js +0 -2
  79. package/es/assets/images/error-icon.png +0 -0
  80. package/es/components/atoms/NotificationStatus/NotificationStatus.d.ts +0 -12
  81. package/es/components/atoms/NotificationStatus/NotificationStatus.js +0 -27
  82. package/es/components/atoms/NotificationStatus/constants/index.d.ts +0 -15
  83. package/es/components/atoms/NotificationStatus/constants/index.js +0 -15
  84. package/es/components/atoms/NotificationStatus/index.d.ts +0 -1
  85. package/es/components/atoms/NotificationStatus/index.js +0 -1
  86. package/es/components/atoms/NotificationStatus/styled.d.ts +0 -3
  87. package/es/components/atoms/NotificationStatus/styled.js +0 -14
  88. package/es/components/atoms/Popover/styled.d.ts +0 -4
  89. package/es/components/atoms/Popover/styled.js +0 -5
  90. package/es/components/icons/IpRestrictionIcon.d.ts +0 -3
  91. package/es/components/icons/IpRestrictionIcon.js +0 -7
  92. package/es/components/molecules/UploadImage/MediaThumb.d.ts +0 -8
  93. package/es/components/molecules/UploadImage/MediaThumb.js +0 -15
  94. package/es/components/molecules/UploadImage/VideoThumbnail.d.ts +0 -4
  95. package/es/components/molecules/UploadImage/VideoThumbnail.js +0 -40
  96. package/es/components/organism/GenerativeInsights/constants.d.ts +0 -1
  97. package/es/components/organism/GenerativeInsights/constants.js +0 -1
  98. package/es/components/organism/GenerativeInsights/index.d.ts +0 -11
  99. package/es/components/organism/GenerativeInsights/index.js +0 -54
  100. package/es/components/organism/GenerativeInsights/styled.d.ts +0 -12
  101. package/es/components/organism/GenerativeInsights/styled.js +0 -65
  102. package/es/components/organism/GenerativeInsights/utils.d.ts +0 -13
  103. package/es/components/organism/GenerativeInsights/utils.js +0 -49
  104. package/es/queries/Media/index.d.ts +0 -1
  105. package/es/queries/Media/index.js +0 -1
  106. package/es/queries/Media/useGetListingSavedMedia.d.ts +0 -12
  107. package/es/queries/Media/useGetListingSavedMedia.js +0 -15
@@ -270,7 +270,9 @@ export const SlideBar = props => {
270
270
  fontSize: `${BTN_ADD_SIZE}px`,
271
271
  cursor: disabledAdd ? 'not-allowed' : 'pointer',
272
272
  color: disabledAdd ? THEME.token?.colorTextDisabled : THEME.token?.colorPrimary,
273
- }, onClick: (e) => {
273
+ },
274
+ // disabled={disabledAdd}
275
+ onClick: (e) => {
274
276
  e.stopPropagation();
275
277
  if (!disabledAdd) {
276
278
  handleAddSlide();
@@ -10,16 +10,11 @@ export const Slider = memo(props => {
10
10
  const { range, value, min = 0, max = 0, className, tooltipVisible = false } = props;
11
11
  const isNegative = useMemo(() => !!(!range && min < 0), [range, min]);
12
12
  const calculateWidth = useMemo(() => ((value || 0) * 100) / (Math.abs(max) + Math.abs(min) || 1), [min, max, value]);
13
- // const restProps = tooltipVisible === 'default' ? omit(props, ['tooltipVisible']) : props;
14
- const restProps = omit(props, ['tooltipVisible']);
13
+ const restProps = tooltipVisible === 'default' ? omit(props, ['tooltipVisible']) : props;
15
14
  if (isNegative) {
16
- return (_jsx(SliderWrapper, { isNegative: true, width: calculateWidth, className: className, children: _jsx(AntdSlider, { ...omit(restProps, ['marks', 'className']), tooltip: tooltipVisible !== 'default' && {
17
- open: tooltipVisible,
18
- }, marks: {
15
+ return (_jsx(SliderWrapper, { isNegative: true, width: calculateWidth, className: className, children: _jsx(AntdSlider, { ...omit(restProps, ['marks', 'className']), marks: {
19
16
  0: ' ',
20
17
  } }) }));
21
18
  }
22
- return (_jsx(SliderWrapper, { className: className, children: _jsx(AntdSlider, { ...restProps, tooltip: tooltipVisible !== 'default' && {
23
- open: tooltipVisible,
24
- } }) }));
19
+ return (_jsx(SliderWrapper, { className: className, children: _jsx(AntdSlider, { ...restProps }) }));
25
20
  });
@@ -46,7 +46,6 @@ export * from './RateV2';
46
46
  export * from './Popover';
47
47
  export * from './Iframe';
48
48
  export * from './Avatar';
49
- export * from './NotificationStatus';
50
49
  export type { SliderProps } from './Slider';
51
50
  export type { PaginationProps } from './Pagination';
52
51
  export type { InputDynamicProps } from './InputDynamic';
@@ -46,4 +46,3 @@ export * from './RateV2';
46
46
  export * from './Popover';
47
47
  export * from './Iframe';
48
48
  export * from './Avatar';
49
- export * from './NotificationStatus';
@@ -208,7 +208,6 @@ export declare const LazyIcon: {
208
208
  InteractiveIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
209
209
  InvisibleIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
210
210
  InvitePeopleIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
211
- IpRestrictionIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
212
211
  IssueBugIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
213
212
  ItemRecommendationIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
214
213
  JourneyTactic30Icon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
@@ -214,7 +214,6 @@ export const LazyIcon = {
214
214
  InteractiveIcon: lazy(() => import('../InteractiveIcon').then(m => ({ default: m.InteractiveIcon }))),
215
215
  InvisibleIcon: lazy(() => import('../InvisibleIcon').then(m => ({ default: m.InvisibleIcon }))),
216
216
  InvitePeopleIcon: lazy(() => import('../InvitePeopleIcon').then(m => ({ default: m.InvitePeopleIcon }))),
217
- IpRestrictionIcon: lazy(() => import('../IpRestrictionIcon').then(m => ({ default: m.IpRestrictionIcon }))),
218
217
  IssueBugIcon: lazy(() => import('../IssueBugIcon').then(m => ({ default: m.IssueBugIcon }))),
219
218
  ItemRecommendationIcon: lazy(() => import('../ItemRecommendationIcon').then(m => ({ default: m.ItemRecommendationIcon }))),
220
219
  JourneyTactic30Icon: lazy(() => import('../JourneyTactic30Icon').then(m => ({ default: m.JourneyTactic30Icon }))),
@@ -206,7 +206,6 @@ export { Integration30Icon } from './Integration30Icon';
206
206
  export { InteractiveIcon } from './InteractiveIcon';
207
207
  export { InvisibleIcon } from './InvisibleIcon';
208
208
  export { InvitePeopleIcon } from './InvitePeopleIcon';
209
- export { IpRestrictionIcon } from './IpRestrictionIcon';
210
209
  export { IssueBugIcon } from './IssueBugIcon';
211
210
  export { ItemRecommendationIcon } from './ItemRecommendationIcon';
212
211
  export { JourneyTactic30Icon } from './JourneyTactic30Icon';
@@ -206,7 +206,6 @@ export { Integration30Icon } from './Integration30Icon';
206
206
  export { InteractiveIcon } from './InteractiveIcon';
207
207
  export { InvisibleIcon } from './InvisibleIcon';
208
208
  export { InvitePeopleIcon } from './InvitePeopleIcon';
209
- export { IpRestrictionIcon } from './IpRestrictionIcon';
210
209
  export { IssueBugIcon } from './IssueBugIcon';
211
210
  export { ItemRecommendationIcon } from './ItemRecommendationIcon';
212
211
  export { JourneyTactic30Icon } from './JourneyTactic30Icon';
@@ -33,7 +33,7 @@ export const AccountListing = React.forwardRef((props, ref) => {
33
33
  },
34
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
35
  [onChange, recentData]);
36
- return (_jsxs(AccountSelectionStyled, { className: className, children: [_jsx(Input, { placeholder: "Search", suffix: _jsx(Icon, { type: "icon-ants-search-2", style: { fontSize: '24px', color: THEME.token?.bw8 } }), value: searchValue, onChange: event => setSearchValue(event.target.value) }), _jsx("div", { className: "account-list", children: _jsx("ul", { children: _jsxs(Scrollbars, { style: { width: '100%', height: showAllAccount ? '364px' : '410px' }, children: [recentData?.value?.length && recentData?.value?.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "recent-text", children: "Recent" }), recentData?.value
36
+ return (_jsxs(AccountSelectionStyled, { className: className, children: [_jsx(Input, { placeholder: "Search", suffix: _jsx(Icon, { type: "icon-ants-search-2", style: { fontSize: '24px', color: THEME.token?.bw8 } }), value: searchValue, onChange: event => setSearchValue(event.target.value) }), _jsx("div", { className: "account-list", children: _jsx("ul", { children: _jsxs(Scrollbars, { style: { width: '100%', height: showAllAccount ? '364px' : '410px' }, children: [recentData?.value?.length ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "recent-text", children: "Recent" }), recentData?.value
37
37
  .map(accountId => accountData?.find(account => account.userId === accountId))
38
38
  .filter((accountId, index, self) => Boolean(accountId) && index === self.indexOf(accountId))
39
39
  .map(account => (_jsx(AccountItem, { userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: +currentAccount === account.userId }, account.userId))), _jsx(Divider, { style: { margin: '8px 0', color: THEME.token?.bw3 } })] })) : null, accountData
@@ -1,3 +1,4 @@
1
1
  export { AccountSelection, type AccountSelectionProps } from './AccountSelection';
2
- export { AccountListing, type AccountListingHandle } from './AccountListing';
2
+ export { AccountListing } from './AccountListing';
3
+ export type { AccountListingHandle } from './AccountListing';
3
4
  export { useAccountSelection } from './hooks';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
2
3
  export type TDisplayFormat = 'number' | 'percentage' | 'currency' | 'datetime';
3
4
  type DisplayFormatProps = {
@@ -10,15 +10,16 @@ import { LOCAL_TIMEZONE, RANGE_LIMIT } from './constants';
10
10
  import { initState, resetValue } from './actions';
11
11
  import { useTriggerOut } from './hooks/useTriggerOut';
12
12
  export const CalendarSelection = props => {
13
- const initialized = useRef(false);
13
+ const initialed = useRef(false);
14
14
  const { value, rangeLimit = RANGE_LIMIT, timezone = LOCAL_TIMEZONE, timeDisplayProps, popoverProps, rangePickerProps, onChange, } = props;
15
15
  const [state, dispatch] = useReducer(reducer, INITIAL_STATE);
16
16
  useLayoutEffect(() => {
17
- if (!value || initialized.current)
17
+ if (!value)
18
18
  return;
19
- const needTriggerOut = !initialized.current;
19
+ const needTriggerOut = !initialed.current;
20
+ // console.log({ needTriggerOut });
20
21
  dispatch(initState(value, needTriggerOut));
21
- initialized.current = true;
22
+ initialed.current = true;
22
23
  }, [value]);
23
24
  useLayoutEffect(() => {
24
25
  if (!state.open) {
@@ -42,7 +42,7 @@ const styleContainAlpha = {
42
42
  };
43
43
  const CustomPicker = props => {
44
44
  // Props
45
- const { className, style, children, isHideAlpha, onChange, onChangeComplete, presetColors, ...restOf } = props;
45
+ const { className, style, children, onChange, onChangeComplete, presetColors, ...restOf } = props;
46
46
  // State
47
47
  const [isShowRgbaInput, setShowRgbaInput] = useState(true);
48
48
  const onChangeRgbaColor = (key, value) => {
@@ -68,7 +68,7 @@ const CustomPicker = props => {
68
68
  width: '100%',
69
69
  height: 12,
70
70
  marginTop: 10,
71
- }, children: _jsx(Alpha, { ...restOf, pointer: HuePointer, onChange: onChange }) })] })] }), _jsxs("div", { style: { ...wrapperStyling, paddingBottom: 15 }, children: [_jsx(Icon, { type: "icon-ants-unfold-more", style: { cursor: 'pointer', fontSize: '20px' }, onClick: () => setShowRgbaInput(!isShowRgbaInput) }), isShowRgbaInput ? (_jsxs("div", { style: rgbaInputStyling, children: [_jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.r, controls: false, onChange: value => onChangeRgbaColor('r', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "R" })] }), _jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.g, controls: false, onChange: value => onChangeRgbaColor('g', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "G" })] }), _jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.b, controls: false, onChange: value => onChangeRgbaColor('b', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "B" })] }), !isHideAlpha && (_jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.a, controls: false, onChange: value => onChangeRgbaColor('a', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "A" })] }))] })) : (_jsxs(EditableInputWrapper, { children: [_jsx(EditableInput, { value: props.color, onChange: onChange }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "HEX" })] })), _jsx(Button, { onClick: () => {
71
+ }, children: _jsx(Alpha, { ...restOf, pointer: HuePointer, onChange: onChange }) })] })] }), _jsxs("div", { style: { ...wrapperStyling, paddingBottom: 15 }, children: [_jsx(Icon, { type: "icon-ants-unfold-more", style: { cursor: 'pointer', fontSize: '20px' }, onClick: () => setShowRgbaInput(!isShowRgbaInput) }), isShowRgbaInput ? (_jsxs("div", { style: rgbaInputStyling, children: [_jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.r, controls: false, onChange: value => onChangeRgbaColor('r', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "R" })] }), _jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.g, controls: false, onChange: value => onChangeRgbaColor('g', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "G" })] }), _jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.b, controls: false, onChange: value => onChangeRgbaColor('b', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "B" })] }), _jsxs("div", { style: rgbaStyling, children: [_jsx(InputNumberWrapper, { value: props.rgb?.a, controls: false, onChange: value => onChangeRgbaColor('a', value) }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "A" })] })] })) : (_jsxs(EditableInputWrapper, { children: [_jsx(EditableInput, { value: props.color, onChange: onChange }), _jsx(Text, { style: { position: 'absolute', bottom: '-20px' }, children: "HEX" })] })), _jsx(Button, { onClick: () => {
72
72
  setShowRgbaInput(true);
73
73
  onChange('rgba(0, 0, 0, 0)');
74
74
  }, children: "Clear" })] }), presetColors ? (_jsxs("div", { children: [_jsx(Divider, {}), presetColors] })) : null] }));
@@ -3,7 +3,6 @@ export interface ColorPickerProps {
3
3
  className?: string;
4
4
  color?: string;
5
5
  presetColors?: any[] | ReactNode;
6
- isHideAlpha?: boolean;
7
6
  defaultColor?: string;
8
7
  icon?: React.ReactNode | string;
9
8
  onChange?: (color: string) => void;
@@ -22,7 +22,7 @@ const styleBtnColor = {
22
22
  };
23
23
  export const ColorPicker = props => {
24
24
  // Props
25
- const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, isHideAlpha, } = props;
25
+ const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, } = props;
26
26
  const { onChange = () => { } } = props;
27
27
  // States
28
28
  const [color, setColor] = useState(defaultColor);
@@ -71,7 +71,7 @@ export const ColorPicker = props => {
71
71
  const onPopoverVisibleChange = visible => {
72
72
  setPopoverVisible(visible);
73
73
  };
74
- return (_jsxs(ColorPickerWrapper, { className: `antsomi-color-picker ${className || ''}`, style: style, children: [showInput && positionInput === 'left' && (_jsx(Input, { style: { textTransform: 'uppercase' }, value: color, onChange: onChangeColorInput })), _jsx(Popover, { arrow: true, content: _jsx(CustomPicker, { color: color, presetColors: presetColors, isHideAlpha: isHideAlpha, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange, children: _jsx("div", { className: "antsomi-popover-button", style: styleBtnColor, children: iconNode || (_jsx("span", { style: {
74
+ return (_jsxs(ColorPickerWrapper, { className: `antsomi-color-picker ${className || ''}`, style: style, children: [showInput && positionInput === 'left' && (_jsx(Input, { style: { textTransform: 'uppercase' }, value: color, onChange: onChangeColorInput })), _jsx(Popover, { arrow: true, content: _jsx(CustomPicker, { color: color, presetColors: presetColors, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange, children: _jsx("div", { className: "antsomi-popover-button", style: styleBtnColor, children: iconNode || (_jsx("span", { style: {
75
75
  backgroundColor: color,
76
76
  display: 'block',
77
77
  width: 20,
@@ -83,7 +83,6 @@ ColorPicker.defaultProps = {
83
83
  className: '',
84
84
  color: '#000000',
85
85
  defaultColor: '#000000',
86
- isHideAlpha: false,
87
86
  onChange: () => { },
88
87
  showInput: true,
89
88
  positionInput: 'left',
@@ -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, onToggleCollapse, ...restProps } = props;
19
+ const { width, fullScreen: fullScreenProp = false, children, menuProps, closeIconProps, maxWidth, minWidth, defaultSize = 'max', headerProps, name, destroyOnClose = true, onToggleCollapse, ...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;
@@ -120,7 +120,7 @@ export const DrawerDetail = props => {
120
120
  motionAppear: false,
121
121
  motionEnter: false,
122
122
  motionLeave: false,
123
- }, mask: mask, classNames: {
123
+ }, classNames: {
124
124
  body: 'drawer-detail-body',
125
125
  }, contentWrapperStyle: {
126
126
  transition: 'none',
@@ -131,5 +131,5 @@ export const DrawerDetail = props => {
131
131
  onClose(e);
132
132
  }, children: _jsx(Icon, { type: "icon-ants-remove-slim", size: 14 }) })), showExpandButton && !fullScreen && (_jsx(ToggleDrawerSizeButton, { style: {
133
133
  ...(!showMenu && { background: '#ffffff' }),
134
- }, onClick: () => handleToggleDrawerSize(), collapse: collapseDrawer })), showMenu && (_jsxs(LeftMenu, { "data-test": "left-menu", className: "animate__animated animate__fadeIn", children: [_jsxs("div", { children: [showClose && (_jsx(CloseBtn, { "data-test": "close-btn", onClick: onClose, children: _jsx(Icon, { type: "icon-ants-remove-slim", size: 14 }) })), _jsx(Flex, { vertical: true, gap: 10, align: "center", justify: "center", children: items?.map((item) => (_jsx(Tooltip, { title: item?.label, mouseEnterDelay: 0.3, placement: "right", children: _jsx(MenuItem, { className: selectedKeys?.includes(item.key) ? 'active' : '', onClick: () => onClick && onClick(item), children: item.icon }, item?.key) }, item?.key))) })] }), _jsx(MenuFooter, { children: footer })] })), _jsxs(Content, { className: "drawer-detail-content", children: [headerProps?.children && (_jsx(DrawerHeader, { align: "center", ...restOfHeaderProps, children: headerChildren })), children] })] }));
134
+ }, onClick: () => handleToggleDrawerSize(), collapse: collapseDrawer })), showMenu && (_jsxs(LeftMenu, { className: "animate__animated animate__fadeIn", children: [_jsxs("div", { children: [showClose && (_jsx(CloseBtn, { onClick: onClose, children: _jsx(Icon, { type: "icon-ants-remove-slim", size: 14 }) })), _jsx(Flex, { vertical: true, gap: 10, align: "center", justify: "center", children: items?.map((item) => (_jsx(Tooltip, { title: item?.label, mouseEnterDelay: 0.3, placement: "right", children: _jsx(MenuItem, { className: selectedKeys?.includes(item.key) ? 'active' : '', onClick: () => onClick && onClick(item), children: item.icon }, item?.key) }, item?.key))) })] }), _jsx(MenuFooter, { children: footer })] })), _jsxs(Content, { className: "drawer-detail-content", children: [headerProps?.children && (_jsx(DrawerHeader, { align: "center", ...restOfHeaderProps, children: headerChildren })), children] })] }));
135
135
  };
@@ -52,7 +52,7 @@ export const EditableName = React.forwardRef((props, ref) => {
52
52
  inputRefElement?.input?.removeEventListener('wheel', preventWheel);
53
53
  };
54
54
  }, []);
55
- return (_jsxs(InputWrapperStyled, { "data-test": props['data-test'] || 'editable-name', className: className || '', style: style, ref: componentInViewRef, children: [_jsx(Tooltip, { title: value || internalValue, children: _jsx(Input, { readOnly: readonly, ref: inputRef, style: { width: inputWidth + 2 }, defaultValue: defaultValue.current, value: value, onChange: event => {
55
+ return (_jsxs(InputWrapperStyled, { className: className || '', style: style, ref: componentInViewRef, children: [_jsx(Tooltip, { title: value || internalValue, children: _jsx(Input, { readOnly: readonly, ref: inputRef, style: { width: inputWidth + 2 }, defaultValue: defaultValue.current, value: value, onChange: event => {
56
56
  const newValue = event.target.value;
57
57
  if (spanRef.current)
58
58
  spanRef.current.innerText = newValue;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useMemo } from 'react';
2
+ import { useMemo } from 'react';
3
3
  /* Components */
4
4
  import { Space } from '@antscorp/antsomi-ui/es/components/atoms/Space';
5
5
  import { Switch } from '@antscorp/antsomi-ui/es/components/atoms/Switch';
@@ -35,7 +35,7 @@ export const FontSettingEdit = ({ settings, styles, showSettings, onChange, }) =
35
35
  [settings]);
36
36
  const filteredSetting = useMemo(() => {
37
37
  if (!showSettings || showSettings?.length === 0) {
38
- return Object.keys(settingMap).map(keySetting => (_jsx(React.Fragment, { children: settingMap[keySetting] }, keySetting)));
38
+ return Object.keys(settingMap).map(keySetting => settingMap[keySetting]);
39
39
  }
40
40
  return showSettings.map(keySetting => settingMap[keySetting]);
41
41
  }, [showSettings, settingMap]);
@@ -54,11 +54,7 @@ export function MatchesAny(props) {
54
54
  threshold: 0,
55
55
  initialIsIntersecting: false,
56
56
  onChange(isIntersecting) {
57
- // Only load more items if the search input is empty and not in external search mode.
58
- // This prevents loading more items when the user is searching for something specific.
59
- const isNoNeedToLoadMore = !!searchValue && !isExternalSearch;
60
- if (isIntersecting && !isNoNeedToLoadMore) {
61
- // Load more items when the user reaches the end of the list.
57
+ if (isIntersecting) {
62
58
  onLoadMore();
63
59
  }
64
60
  },
@@ -383,5 +379,5 @@ export function MatchesAnySelect(props) {
383
379
  ...dropdownStyle,
384
380
  display: 'none',
385
381
  padding: 0,
386
- }, loading: loading, status: props.status || (error ? 'error' : undefined), ...restProps }), !!error && (_jsx(Text, { className: "ant-form-item-explain-error", type: "danger", children: error }))] }) }));
382
+ }, loading: loading, status: props.status || (error ? 'error' : undefined), ...restProps }), !!error && _jsx(Text, { className: 'ant-form-item-explain-error', type: 'danger', children: error })] }) }));
387
383
  }
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  interface RequestAccessProps {
3
- fullscreen?: boolean;
4
3
  className?: string;
5
4
  placeholder?: string;
6
5
  deniedTitle?: string;
@@ -1,12 +1,15 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState } from 'react';
3
3
  import { Button, Flex, TextArea, Typography } from '@antscorp/antsomi-ui/es/components';
4
- import { translate as t, translations } from '@antscorp/antsomi-locales';
5
4
  // Styled
6
5
  import { RequestAccessStyled } from './styled';
6
+ // Translate
7
+ import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
8
+ import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
7
9
  import { BlockIcon } from '../../icons';
10
+ const { t } = i18nInstance;
8
11
  export const RequestAccess = props => {
9
- const { fullscreen, className, placeholder = t(translations.requestAccess.placeholder), deniedTitle = t(translations.requestAccess.deniedTitle), deniedSubTitle = t(translations.requestAccess.deniedSubTitle), sentTitle = t(translations.requestAccess.sentTitle), sentSubTitle = t(translations.requestAccess.sentSubTitle), requestText = t(translations.requestAccess.requestText), switchAccountText = t(translations.requestAccess.switchAccountText), onRequest, onSwitchAccount, } = props;
12
+ const { className, placeholder = t(translations.requestAccess.placeholder), deniedTitle = t(translations.requestAccess.deniedTitle), deniedSubTitle = t(translations.requestAccess.deniedSubTitle), sentTitle = t(translations.requestAccess.sentTitle), sentSubTitle = t(translations.requestAccess.sentSubTitle), requestText = t(translations.requestAccess.requestText), switchAccountText = t(translations.requestAccess.switchAccountText), onRequest, onSwitchAccount, } = props;
10
13
  const [isSentRequest, setIsSentRequest] = useState(false);
11
14
  const [isLoading, setIsLoading] = useState(false);
12
15
  const messageRef = useRef(null);
@@ -16,8 +19,10 @@ export const RequestAccess = props => {
16
19
  try {
17
20
  setIsLoading(true);
18
21
  onRequest(message)
19
- .then(() => {
20
- setIsSentRequest(true);
22
+ .then(data => {
23
+ if (data) {
24
+ setIsSentRequest(true);
25
+ }
21
26
  })
22
27
  .finally(() => setIsLoading(false));
23
28
  }
@@ -31,5 +36,5 @@ export const RequestAccess = props => {
31
36
  if (onSwitchAccount)
32
37
  onSwitchAccount();
33
38
  };
34
- return (_jsx(RequestAccessStyled, { className: `antsomi-request-access ${className || ''}`, style: fullscreen ? { inset: 0, height: '100vh' } : {}, children: _jsxs(Flex, { vertical: true, gap: 20, children: [_jsxs(Flex, { vertical: true, gap: 5, children: [_jsx(Typography.Text, { className: "denied-title", children: isSentRequest ? (sentTitle) : (_jsxs(_Fragment, { children: [deniedTitle, _jsx(BlockIcon, {})] })) }), _jsx(Typography.Text, { className: "denied-sub-title", children: isSentRequest ? sentSubTitle : deniedSubTitle })] }), !isSentRequest ? (_jsx(TextArea, { style: { resize: 'none' }, placeholder: placeholder, ref: messageRef })) : null, _jsxs(Flex, { className: "action-buttons", gap: 10, children: [isSentRequest ? null : (_jsx(Button, { onClick: handleClickRequest, type: "primary", loading: isLoading, children: requestText })), _jsx(Button, { onClick: handleSwitchAccount, children: switchAccountText })] })] }) }));
39
+ return (_jsx(RequestAccessStyled, { className: `antsomi-request-access ${className || ''}`, children: _jsxs(Flex, { vertical: true, gap: 20, children: [_jsxs(Flex, { vertical: true, gap: 5, children: [_jsx(Typography.Text, { className: "denied-title", children: isSentRequest ? (sentTitle) : (_jsxs(_Fragment, { children: [deniedTitle, _jsx(BlockIcon, {})] })) }), _jsx(Typography.Text, { className: "denied-sub-title", children: isSentRequest ? sentSubTitle : deniedSubTitle })] }), !isSentRequest ? (_jsx(TextArea, { style: { resize: 'none' }, placeholder: placeholder, ref: messageRef })) : null, _jsxs(Flex, { className: "action-buttons", gap: 10, children: [isSentRequest ? null : (_jsx(Button, { onClick: handleClickRequest, type: "primary", loading: isLoading, children: requestText })), _jsx(Button, { onClick: handleSwitchAccount, children: switchAccountText })] })] }) }));
35
40
  };
@@ -721,7 +721,7 @@ export const SAMPLE_RICHMENU = {
721
721
  displayDefault: true,
722
722
  },
723
723
  image: {
724
- imageUrl: 'https://s.cystack.net/portal/organizations/487b0f9dd9d8543312dc25e32ac71e4f/logo.jpg',
724
+ imageUrl: 'https://sandbox-st-media-template.antsomi.com/upload/2024/01/04/8d8cf39a-748f-435c-b6c6-b71b5facc739.gif',
725
725
  imageStyles: {
726
726
  borderTopLeftRadius: '0px',
727
727
  borderTopRightRadius: '0px',
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { SearchPopover } from '../../SearchPopover';
4
4
  import './styles.scss';
5
- import { Button, Checkbox, Typography } from '../../../../atoms';
5
+ import { Button, Checkbox } from '../../../../atoms';
6
6
  import { StyledAction, StyledFooter, StyledListFieldsWrapper } from './styled';
7
7
  import { EmptyData } from '../../../EmptyData';
8
8
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
@@ -103,9 +103,7 @@ export const PopoverSelect = (props) => {
103
103
  if (typeof option.label === 'function') {
104
104
  return option.label({ selected: selectedKeys.has(option.key) });
105
105
  }
106
- return (_jsx(Typography.Text, { ellipsis: {
107
- tooltip: option.label,
108
- }, style: { maxWidth: 310 }, children: option.label }));
106
+ return option.label;
109
107
  };
110
108
  const items = filteredOptions.map(opt => ({
111
109
  key: opt.key,
@@ -1,28 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Libraries
3
- import { useContext, useState } from 'react';
3
+ import { useContext } from 'react';
4
4
  // Context
5
5
  import { SelectAccountContext } from './context';
6
6
  // Components
7
7
  import { ButtonViewAllStyled, ViewAllWrapper } from './styled';
8
- import { Icon, Input, Popover } from '../../atoms';
8
+ import { Popover } from '../../atoms';
9
9
  import AccountChip from './AccountChip';
10
- import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
11
10
  const ButtonViewAll = () => {
12
11
  const { state, dispatch } = useContext(SelectAccountContext);
13
- const { usersSelected, nameKey, userIdKey, users, styles, showSearchViewAll } = state;
14
- const [search, setSearch] = useState('');
15
- const searchedUsers = showSearchViewAll
16
- ? usersSelected.filter(id => {
17
- const user = users.find(u => u?.[userIdKey] === id);
18
- return searchStringQuery(user?.[nameKey], search);
19
- })
20
- : usersSelected;
12
+ const { usersSelected, nameKey, userIdKey, users, styles } = state;
21
13
  const handleRemove = ({ userId, index }) => {
22
14
  dispatch({ type: 'REMOVE_USER', payload: { userId, index } });
23
15
  };
24
- const contentViewAll = () => (_jsxs(ViewAllWrapper, { children: [showSearchViewAll && (_jsx(Input, { value: search, placeholder: "Search", suffix: _jsx(Icon, { type: "icon-ants-search-2" }), onAfterChange: value => setSearch(value), debounce: 500 })), state.showOwnerDefault && _jsx(AccountChip, { label: "Owner", user: {}, value: "owner", disabled: true }), state.type === 'group'
25
- ? searchedUsers?.map((id, index) => {
16
+ const contentViewAll = () => (_jsxs(ViewAllWrapper, { children: [state.showOwnerDefault && _jsx(AccountChip, { label: "Owner", user: {}, value: "owner", disabled: true }), state.type === 'group'
17
+ ? usersSelected?.map((id, index) => {
26
18
  const group = state.listAccountGroup.find(u => u?.[state?.groupIdKey] === id);
27
19
  if (!group) {
28
20
  const user = users.find(u => u?.[userIdKey] === id);
@@ -32,7 +24,7 @@ const ButtonViewAll = () => {
32
24
  }
33
25
  return (_jsx(AccountChip, { user: group, value: group?.[state.groupIdKey], label: group?.[state?.groupNameKey], onRemove: () => handleRemove({ userId: group?.[state.groupIdKey], index }) }, group?.[state.groupIdKey]));
34
26
  })
35
- : searchedUsers?.map((id, index) => {
27
+ : usersSelected?.map((id, index) => {
36
28
  const user = users.find(u => u?.[userIdKey] === id);
37
29
  return (_jsx(AccountChip, { user: user, value: user?.[userIdKey], label: user?.[nameKey], onRemove: () => handleRemove({ userId: user?.[userIdKey], index }) }, user?.[userIdKey]));
38
30
  })] }));
@@ -10,11 +10,10 @@ import ButtonAdd from './ButtonAdd';
10
10
  import ButtonViewAll from './ButtonViewAll';
11
11
  export const Content = () => {
12
12
  const { state, dispatch } = useContext(SelectAccountContext);
13
- const { usersSelected, nameKey, userIdKey, users, disabled, className, styles, hideAddButton } = state;
13
+ const { usersSelected, nameKey, userIdKey, users, disabled, className, styles } = state;
14
14
  const handleRemove = ({ userId, index }) => {
15
15
  dispatch({ type: 'REMOVE_USER', payload: { userId, index } });
16
16
  };
17
- const isHideAddButton = hideAddButton || state?.isViewMode || (state?.onlyOne && usersSelected?.length);
18
17
  return (_jsxs(Wrapper, { className: `select-account ${className}`, style: { ...(styles?.wrapper || {}) }, disabled: !!disabled, children: [state.showOwnerDefault && _jsx(AccountChip, { label: "Owner", user: {}, value: "owner", disabled: true }), state.type === 'group'
19
18
  ? usersSelected?.map((id, index) => {
20
19
  if (index >= state?.limitShow)
@@ -35,5 +34,5 @@ export const Content = () => {
35
34
  if (!user)
36
35
  return null;
37
36
  return (_jsx(AccountChip, { user: user, value: user?.[userIdKey], label: user?.[nameKey], onRemove: () => handleRemove({ userId: user?.[userIdKey], index }) }, user?.[userIdKey]));
38
- }), state?.usersSelected?.length > state?.limitShow && _jsx(ButtonViewAll, {}), isHideAddButton ? null : _jsx(ButtonAdd, {})] }));
37
+ }), state?.usersSelected?.length > state?.limitShow && _jsx(ButtonViewAll, {}), !state?.isViewMode && (!state?.onlyOne || !usersSelected?.length) && _jsx(ButtonAdd, {})] }));
39
38
  };
@@ -136,10 +136,6 @@ export const ViewAllWrapper = styled.div `
136
136
  flex-wrap: wrap;
137
137
  max-width: 300px;
138
138
  padding: 15px;
139
-
140
- .input__wrapper {
141
- width: 100%;
142
- }
143
139
  `;
144
140
  export const ItemOnlyOne = styled.div `
145
141
  padding: 8px 10px;
@@ -31,8 +31,6 @@ export type SelectAccountProps = {
31
31
  disabledAccount?: any[];
32
32
  limit?: number;
33
33
  limitShow?: number;
34
- hideAddButton?: boolean;
35
- showSearchViewAll?: boolean;
36
34
  className?: string;
37
35
  styles?: {
38
36
  wrapper?: React.CSSProperties;