@antscorp/antsomi-ui 1.3.5-beta.8 → 1.3.5-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +2 -2
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
- package/package.json +1 -1
|
@@ -9,5 +9,6 @@ export interface RichMenuBlockProps {
|
|
|
9
9
|
cellActiveIdx?: number;
|
|
10
10
|
onClickCell?: (cellIdx: number) => void;
|
|
11
11
|
onChange?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
|
|
12
|
+
reCalculateFlag?: boolean | number;
|
|
12
13
|
}
|
|
13
14
|
export declare const RichMenuBlock: React.FC<RichMenuBlockProps>;
|
|
@@ -8,7 +8,7 @@ import { RichMenuCell } from './RichMenuCell';
|
|
|
8
8
|
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
9
9
|
const PATH = 'src/app/modules/Dashboard/containers/RichMenu/containers/Design/components/Workspace/components/RichMenuBlock/index.tsx';
|
|
10
10
|
export const RichMenuBlock = props => {
|
|
11
|
-
const { richMenu, layerActive, cellActiveIdx, isPreview, isActionLink = false, onClickCell, onChange, } = props;
|
|
11
|
+
const { richMenu, layerActive, cellActiveIdx, isPreview, isActionLink = false, onClickCell, onChange, reCalculateFlag, } = props;
|
|
12
12
|
const { gridTemplateCols = [], gridTemplateRows = [], cells = [], uploadMode, image, layoutType, rows, cols, } = richMenu || {};
|
|
13
13
|
const { imageUrl, imageStyles } = image || {};
|
|
14
14
|
const grid = {
|
|
@@ -45,7 +45,7 @@ export const RichMenuBlock = props => {
|
|
|
45
45
|
}
|
|
46
46
|
}, PATH);
|
|
47
47
|
const renderCell = (cellInfo, ctx) => (React.createElement(RichMenuCell, { context: ctx, isActionLink: isActionLink, isPreview: isPreview, layerActive: layerActive, cellActiveIdx: cellActiveIdx, cell: cellInfo, isSingleMode: isSingleUploadMode, onClick: handleClickCell }));
|
|
48
|
-
return (React.createElement(ResizeGrid, Object.assign({ grid: grid, isPreview: isPreview, containerStyle: imageStyles, isCompact: layoutType === 'compact', renderCell: renderCell, cellActiveStyle: { background: 'rgba(0, 95, 184, 0.5)' }, cellBorder: isSingleUploadMode ? '1px solid rgba(0, 95, 184, 1)' : '1px dotted #000000', onChange: handleGridChange }, Object.assign({}, (isSingleUploadMode && {
|
|
48
|
+
return (React.createElement(ResizeGrid, Object.assign({ grid: grid, isPreview: isPreview, containerStyle: imageStyles, isCompact: layoutType === 'compact', renderCell: renderCell, cellActiveStyle: { background: 'rgba(0, 95, 184, 0.5)' }, cellBorder: isSingleUploadMode ? '1px solid rgba(0, 95, 184, 1)' : '1px dotted #000000', onChange: handleGridChange, reCalculateFlag: reCalculateFlag }, Object.assign({}, (isSingleUploadMode && {
|
|
49
49
|
image: imageUrl,
|
|
50
50
|
imagePosition: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectPosition,
|
|
51
51
|
imageSize: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectFit,
|
|
@@ -5,6 +5,7 @@ interface RichMenuMobileViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
isPreview?: boolean;
|
|
6
6
|
onChangeRichMenu?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
|
|
7
7
|
onClickCell?: (cellIndex: number) => void;
|
|
8
|
+
reCalculateFlag?: boolean | number;
|
|
8
9
|
}
|
|
9
10
|
export declare const RichMenuMobileView: React.FC<RichMenuMobileViewProps>;
|
|
10
11
|
export {};
|
|
@@ -20,7 +20,7 @@ import { RichMenuBlock } from '../RichMenuBlock';
|
|
|
20
20
|
// Styles
|
|
21
21
|
import { MobileContent, RichMenuWrapper, TopBar } from './styled';
|
|
22
22
|
export const RichMenuMobileView = props => {
|
|
23
|
-
const { richMenu, className, isPreview, onChangeRichMenu, onClickCell } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell"]);
|
|
23
|
+
const { richMenu, className, isPreview, onChangeRichMenu, onClickCell, reCalculateFlag } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell", "reCalculateFlag"]);
|
|
24
24
|
// State
|
|
25
25
|
const [state, setState] = useState({
|
|
26
26
|
showRichMenu: true,
|
|
@@ -32,6 +32,6 @@ export const RichMenuMobileView = props => {
|
|
|
32
32
|
return (React.createElement(MobileFrame, Object.assign({ className: `ants-mx-auto ${className}` }, restOfProps),
|
|
33
33
|
isPreview && React.createElement(TopBar, { src: IphoneTopBar, width: "100%", height: "auto" }),
|
|
34
34
|
React.createElement(MobileContent, null,
|
|
35
|
-
React.createElement(RichMenuWrapper, { "$showRichMenu": showRichMenu && !showTypingChat, "$isPreview": !!isPreview }, richMenu && (React.createElement(RichMenuBlock, { richMenu: richMenu, isPreview: isPreview, onChange: onChangeRichMenu, onClickCell: onClickCell }))),
|
|
35
|
+
React.createElement(RichMenuWrapper, { "$showRichMenu": showRichMenu && !showTypingChat, "$isPreview": !!isPreview }, richMenu && (React.createElement(RichMenuBlock, { richMenu: richMenu, isPreview: isPreview, onChange: onChangeRichMenu, onClickCell: onClickCell, reCalculateFlag: reCalculateFlag }))),
|
|
36
36
|
React.createElement(RichMenuChatBar, { disabled: !isPreview, label: richMenu === null || richMenu === void 0 ? void 0 : richMenu.chatBar.label, showRichMenu: showRichMenu, showTypingChat: showTypingChat, onToggleRichMenu: showRichMenu => setState(prevState => (Object.assign(Object.assign({}, prevState), { showRichMenu: !!showRichMenu }))), onToggleTypingChat: showTypingChat => setState(prevState => (Object.assign(Object.assign({}, prevState), { showTypingChat: !!showTypingChat }))) }))));
|
|
37
37
|
};
|