@antscorp/antsomi-ui 1.3.5-beta.161 → 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.
- package/es/components/icons/ExpandMoreRight.d.ts +3 -0
- package/es/components/icons/ExpandMoreRight.js +3 -0
- package/es/components/icons/index.d.ts +1 -0
- package/es/components/icons/index.js +1 -0
- package/es/components/molecules/AddDynamicContent/utils.d.ts +4 -4
- package/es/components/molecules/CalendarSelection/actions.d.ts +1 -1
- package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +2 -2
- package/es/components/molecules/CalendarSelection/utils.d.ts +2 -2
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +44 -9
- package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.d.ts +6 -0
- package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +48 -0
- package/es/components/molecules/DrawerDetail/components/index.d.ts +1 -0
- package/es/components/molecules/DrawerDetail/components/index.js +1 -0
- package/es/components/molecules/DrawerDetail/constants.d.ts +7 -0
- package/es/components/molecules/DrawerDetail/constants.js +7 -0
- package/es/components/molecules/DrawerDetail/styled.d.ts +1 -1
- package/es/components/molecules/DrawerDetail/styled.js +7 -4
- package/es/components/molecules/DrawerDetail/types.d.ts +2 -1
- package/es/components/molecules/PreviewModal/styled.d.ts +1 -1
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +3 -3
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +1 -1
- package/es/components/organism/AlgorithmsSetting/styled.d.ts +1 -1
- package/es/components/organism/ContentSources/provider.d.ts +1 -1
- package/es/components/organism/ContentSources/utils.d.ts +5 -5
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/ContentMenu/useContentMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/DataMenu/useDataMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/InsightsMenu/useInsightsMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/ProfilesMenu/useProfilesMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/SettingsMenu/useSettingsMenu.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/TemplatesMenu/useTemplatesMenu.d.ts +1 -1
- package/es/components/template/TemplateListing/Loadable.d.ts +1 -1
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +2 -2
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/es/hooks/useIsomorphicLayoutEffect.js +2 -0
- package/es/hooks/useMediaQuery.d.ts +6 -0
- package/es/hooks/useMediaQuery.js +42 -0
- package/es/queries/BusinessObject/useGetListAttributeBO.d.ts +1 -3
- package/es/utils/loadable.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -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[]
|
|
32
|
-
itemTypeId?: number
|
|
33
|
-
listAttribute?: any[]
|
|
34
|
-
field?: string
|
|
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?: (
|
|
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("
|
|
3
|
-
action: import("
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
22
|
-
const {
|
|
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
|
-
|
|
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
|
|
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,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("
|
|
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
|
|
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:
|
|
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:
|
|
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: ${
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("
|
|
2
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("../ModalV2").ModalV2Props>, any, {}, never>;
|
|
3
3
|
export declare const ModalHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
4
4
|
export declare const ModalBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,17 +3,17 @@ export declare const useShareAccess: () => {
|
|
|
3
3
|
state: {
|
|
4
4
|
allowEdit: boolean;
|
|
5
5
|
allowView: boolean;
|
|
6
|
-
accessInfo?: import("
|
|
6
|
+
accessInfo?: import("../types").ObjectAccessInfo | undefined;
|
|
7
7
|
accessUserId?: number | undefined;
|
|
8
8
|
accessUserPermission?: {
|
|
9
9
|
view: number;
|
|
10
10
|
edit: number;
|
|
11
11
|
} | undefined;
|
|
12
|
-
excludeUserAccess?: import("
|
|
12
|
+
excludeUserAccess?: import("../types").ExcludeUserAccess | undefined;
|
|
13
13
|
modalTransferOwnership: {
|
|
14
14
|
open: boolean;
|
|
15
15
|
userToOwnerShipId: number;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
dispatch: import("react").Dispatch<import("
|
|
18
|
+
dispatch: import("react").Dispatch<import("../types").ShareAccessAction> | null;
|
|
19
19
|
};
|
|
@@ -66,7 +66,7 @@ export declare const useTemplateSave: (options: TemplateListingOptions) => {
|
|
|
66
66
|
form: import("antd").FormInstance<FormValue>;
|
|
67
67
|
errors: any[] | undefined;
|
|
68
68
|
refetchCategoryList: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<TemplateCategory[], any>>;
|
|
69
|
-
refetchTemplateList: <TPageData_1>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData_1>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("@antscorp/antsomi-ui/es/types").ResponseListing<import("
|
|
69
|
+
refetchTemplateList: <TPageData_1>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData_1>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("@antscorp/antsomi-ui/es/types").ResponseListing<import("../../../../models/ObjectTemplate").ObjectTemplate>>, any>>;
|
|
70
70
|
onLoadMore: () => void;
|
|
71
71
|
onChange: (newValue: Partial<TemplateValueOptions>) => void;
|
|
72
72
|
};
|
|
@@ -10,7 +10,7 @@ export declare const AlgorithmWrapper: import("styled-components").StyledCompone
|
|
|
10
10
|
mode: ContentSourceModeView;
|
|
11
11
|
}, never>;
|
|
12
12
|
export declare const StyledSelect: import("styled-components").StyledComponent<{
|
|
13
|
-
(props: import("
|
|
13
|
+
(props: import("../../molecules").SelectV2Props): import("react").JSX.Element;
|
|
14
14
|
defaultProps: {
|
|
15
15
|
suffixIcon: import("react").JSX.Element;
|
|
16
16
|
filterOption: (input: any, option: any) => boolean;
|
|
@@ -9,6 +9,6 @@ export interface ContentSourceProviderProps {
|
|
|
9
9
|
export declare const ContentSourceProvider: ({ children }: ContentSourceProviderProps) => React.JSX.Element;
|
|
10
10
|
export declare const useContentSourceState: () => ContentSourceState;
|
|
11
11
|
export declare const useContentSourceDispatch: () => React.Dispatch<UpdateGroupAction>;
|
|
12
|
-
export declare const useSelectServiceAuth: () => import("
|
|
12
|
+
export declare const useSelectServiceAuth: () => import("../../..").PayloadInfo;
|
|
13
13
|
export declare const useSelectContentSources: () => import("./types").TContentSourceSettings;
|
|
14
14
|
export declare const useSelectModeView: () => import("./types").ContentSourceModeView;
|
|
@@ -17,11 +17,11 @@ export declare const isCheckStatusAttr: (listBO: any, itemTypeId: any, listAttri
|
|
|
17
17
|
isDisable: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare const checkStatusCollection: ({ listBO, itemTypeId, listCollection, field, checkDisable, }: {
|
|
20
|
-
listBO?: any[]
|
|
21
|
-
itemTypeId?: number | null
|
|
22
|
-
listCollection?: any[]
|
|
23
|
-
field?: string
|
|
24
|
-
checkDisable?: boolean
|
|
20
|
+
listBO?: any[];
|
|
21
|
+
itemTypeId?: number | null;
|
|
22
|
+
listCollection?: any[];
|
|
23
|
+
field?: string;
|
|
24
|
+
checkDisable?: boolean;
|
|
25
25
|
}) => {
|
|
26
26
|
errorMessage: string;
|
|
27
27
|
isDisable: boolean;
|
|
@@ -11,5 +11,5 @@ export declare const WrapperContent: import("styled-components").StyledComponent
|
|
|
11
11
|
export declare const List: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
12
12
|
export declare const ListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
13
13
|
export declare const Span: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
-
export declare const TextField: import("styled-components").StyledComponent<React.FC<import("
|
|
14
|
+
export declare const TextField: import("styled-components").StyledComponent<React.FC<import("../../../../../../atoms/Text").TextProps>, any, {}, never>;
|
|
15
15
|
export {};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Asynchronously loads the component for TemplateListing
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
|
-
export declare const TemplateListing: (props: import("
|
|
6
|
+
export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
|
|
@@ -60,7 +60,7 @@ export declare const useTemplateListing: <T = undefined>(options: TemplateListin
|
|
|
60
60
|
templateItems: (TTemplateItem | undefined)[];
|
|
61
61
|
openCategoryKeys: string[];
|
|
62
62
|
similarTemplates: (TTemplateItem | undefined)[];
|
|
63
|
-
templateDetail: import("
|
|
63
|
+
templateDetail: import("../../../../models/ObjectTemplate").ObjectTemplate | undefined;
|
|
64
64
|
checkedCategories: TCheckedCategories;
|
|
65
65
|
selectTemplateAction: TSelectTemplateAction | T | undefined;
|
|
66
66
|
previewTemplateCategories: TCategoryItem[];
|
|
@@ -68,7 +68,7 @@ export declare const useTemplateListing: <T = undefined>(options: TemplateListin
|
|
|
68
68
|
isLoadingTemplateList: boolean;
|
|
69
69
|
isLoadingTemplateDetail: boolean;
|
|
70
70
|
refetchCategoryList: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<TemplateCategory[], any>>;
|
|
71
|
-
refetchTemplateList: <TPageData_1>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData_1>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("@antscorp/antsomi-ui/es/types").ResponseListing<import("
|
|
71
|
+
refetchTemplateList: <TPageData_1>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData_1>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("@antscorp/antsomi-ui/es/types").ResponseListing<import("../../../../models/ObjectTemplate").ObjectTemplate>>, any>>;
|
|
72
72
|
onChangeCheckedCategories: (checkedCategories: TCheckedCategories) => void;
|
|
73
73
|
onChangeOpenCategoryKeys: (openKeys: string[]) => void;
|
|
74
74
|
onRemoveObjectTemplate: (id: TThumbnailCardId) => void;
|
package/es/hooks/index.d.ts
CHANGED
package/es/hooks/index.js
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
|
|
3
|
+
const IS_SERVER = typeof window === 'undefined';
|
|
4
|
+
export function useMediaQuery(query, { defaultValue = false, initializeWithValue = true } = {}) {
|
|
5
|
+
const getMatches = (query) => {
|
|
6
|
+
if (IS_SERVER) {
|
|
7
|
+
return defaultValue;
|
|
8
|
+
}
|
|
9
|
+
return window.matchMedia(query).matches;
|
|
10
|
+
};
|
|
11
|
+
const [matches, setMatches] = useState(() => {
|
|
12
|
+
if (initializeWithValue) {
|
|
13
|
+
return getMatches(query);
|
|
14
|
+
}
|
|
15
|
+
return defaultValue;
|
|
16
|
+
});
|
|
17
|
+
// Handles the change event of the media query.
|
|
18
|
+
function handleChange() {
|
|
19
|
+
setMatches(getMatches(query));
|
|
20
|
+
}
|
|
21
|
+
useIsomorphicLayoutEffect(() => {
|
|
22
|
+
const matchMedia = window.matchMedia(query);
|
|
23
|
+
// Triggered at the first client-side load and if query changes
|
|
24
|
+
handleChange();
|
|
25
|
+
// Use deprecated `addListener` and `removeListener` to support Safari < 14 (#135)
|
|
26
|
+
if (matchMedia.addListener) {
|
|
27
|
+
matchMedia.addListener(handleChange);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
matchMedia.addEventListener('change', handleChange);
|
|
31
|
+
}
|
|
32
|
+
return () => {
|
|
33
|
+
if (matchMedia.removeListener) {
|
|
34
|
+
matchMedia.removeListener(handleChange);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
matchMedia.removeEventListener('change', handleChange);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}, [query]);
|
|
41
|
+
return matches;
|
|
42
|
+
}
|
|
@@ -9,9 +9,7 @@ type GetListAttributeBOProps<T> = {
|
|
|
9
9
|
export declare const useGetListAttributeBO: <T = Record<string, any>>(apiParams: APIParams, infos: PayloadInfo, props?: GetListAttributeBOProps<T>) => UseQueryResult<T, unknown>;
|
|
10
10
|
export declare const getListAttributeBOQuery: ({ itemTypeIds, url, infos, }: {
|
|
11
11
|
itemTypeIds: (number | null)[];
|
|
12
|
-
} & {
|
|
13
|
-
url: string;
|
|
14
|
-
} & Record<string, any> & {
|
|
12
|
+
} & APIParams & {
|
|
15
13
|
infos: PayloadInfo;
|
|
16
14
|
}) => Promise<any>;
|
|
17
15
|
export {};
|
package/es/utils/loadable.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ interface Opts {
|
|
|
3
3
|
fallback: React.ReactNode;
|
|
4
4
|
}
|
|
5
5
|
type Unpromisify<T> = T extends Promise<infer P> ? P : never;
|
|
6
|
-
export declare const lazyLoad: <T extends Promise<any>, U extends React.ComponentType<any>>(importFunc: () => T, selectorFunc?: (
|
|
6
|
+
export declare const lazyLoad: <T extends Promise<any>, U extends React.ComponentType<any>>(importFunc: () => T, selectorFunc?: (s: Unpromisify<T>) => U, opts?: Opts) => (props: React.ComponentProps<U>) => JSX.Element;
|
|
7
7
|
export {};
|