@antscorp/antsomi-ui 1.3.3-beta.4 → 1.3.3-beta.41
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/assets/images/iphone-top-bar.png +0 -0
- package/es/assets/images/iphone.png +0 -0
- package/es/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Input/Input.d.ts +3 -0
- package/es/components/atoms/Input/Input.js +4 -3
- package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +30 -0
- package/es/components/atoms/InputDynamic/InputDynamic.js +320 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
- package/es/components/atoms/InputDynamic/index.d.ts +2 -0
- package/es/components/atoms/InputDynamic/index.js +1 -0
- package/es/components/atoms/InputDynamic/styled.d.ts +12 -0
- package/es/components/atoms/InputDynamic/styled.js +281 -0
- package/es/components/atoms/InputDynamic/utils.d.ts +22 -0
- package/es/components/atoms/InputDynamic/utils.js +751 -0
- package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
- package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
- package/es/components/atoms/MobileFrame/constants.js +4 -0
- package/es/components/atoms/MobileFrame/index.d.ts +2 -0
- package/es/components/atoms/MobileFrame/index.js +1 -0
- package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
- package/es/components/atoms/MobileFrame/styled.js +33 -0
- package/es/components/atoms/Pagination/index.d.ts +1 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
- package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
- package/es/components/atoms/PreviewTabs/index.js +1 -0
- package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
- package/es/components/atoms/PreviewTabs/styled.js +79 -0
- package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
- package/es/components/atoms/RequiredLabel/index.js +4 -3
- package/es/components/atoms/Slider/index.d.ts +2 -1
- package/es/components/atoms/Slider/index.js +7 -14
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Spin/Spin.d.ts +2 -1
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/index.d.ts +7 -0
- package/es/components/atoms/index.js +5 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +66 -2
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CloseIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/EventIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
- package/es/components/molecules/FontSetting/constants.d.ts +3 -0
- package/es/components/molecules/FontSetting/constants.js +22 -0
- package/es/components/molecules/FontSetting/index.d.ts +10 -4
- package/es/components/molecules/FontSetting/index.js +36 -35
- package/es/components/molecules/FontSetting/types.d.ts +1 -1
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/index.d.ts +1 -0
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
- package/es/components/molecules/ModalV2/ModalV2.js +26 -0
- package/es/components/molecules/ModalV2/index.d.ts +2 -0
- package/es/components/molecules/ModalV2/index.js +1 -0
- package/es/components/molecules/ModalV2/styled.d.ts +7 -0
- package/es/components/molecules/ModalV2/styled.js +22 -0
- package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
- package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
- package/es/components/molecules/PreviewModal/index.d.ts +2 -0
- package/es/components/molecules/PreviewModal/index.js +1 -0
- package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
- package/es/components/molecules/PreviewModal/styled.js +39 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +719 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +86 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
- package/es/components/molecules/ResizeGrid/constant.js +111 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
- package/es/components/molecules/ResizeGrid/styled.js +56 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +49 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +8 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +36 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
- package/es/components/molecules/RichMenu/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/index.js +3 -0
- package/es/components/molecules/Select/Select.d.ts +4 -2
- package/es/components/molecules/Select/Test.d.ts +2 -1
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
- package/es/components/molecules/index.d.ts +6 -0
- package/es/components/molecules/index.js +4 -0
- package/es/components/organism/Help/styled.d.ts +6 -2
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/richMenu.d.ts +19 -0
- package/es/constants/richMenu.js +19 -0
- package/es/constants/storybook.d.ts +2 -1
- package/es/constants/theme.js +13 -2
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/locales/en/translation.json +3 -1
- package/es/locales/i18n.d.ts +3 -0
- package/es/locales/translations.d.ts +2 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/test.d.ts +2 -1
- package/es/test.js +164 -66
- package/es/types/index.d.ts +12 -0
- package/es/types/index.js +2 -1
- package/es/types/richMenu.d.ts +191 -0
- package/es/types/richMenu.js +1 -0
- package/es/types/variables.d.ts +2 -0
- package/es/types/variables.js +1 -0
- package/es/utils/common.d.ts +2 -0
- package/es/utils/common.js +16 -0
- package/es/utils/handleError.d.ts +32 -2
- package/es/utils/handleError.js +42 -4
- package/package.json +8 -6
- package/dist/0173b5993573afa04880.woff +0 -0
- package/dist/0dfb9214dfd945cd7290.png +0 -1
- package/dist/2883cad25a2b4e87ce5f.eot +0 -0
- package/dist/4f54a37971347e3d7122.png +0 -1
- package/dist/574b7bee0563a9fe9a29.png +0 -1
- package/dist/6b586356e837581204dc.svg +0 -1
- package/dist/72eec5c1c786b45a667f.ttf +0 -0
- package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
- package/dist/dbc405edd6e0806efbc9.svg +0 -1
- package/dist/e32f09119052a55cce3c.png +0 -1
- package/dist/e3851b9384a984c6fdb5.png +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.LICENSE.txt +0 -69
- package/dist/main.css +0 -69
- package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
- package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
- package/dist/public/icons/725a52bd91a3ce534b10833df510e5fa.png +0 -0
- package/dist/public/icons/7d037e0b378e87a82804443636cd0e13.svg +0 -346
- package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
- package/dist/public/icons/bb64e23a1ff390a416d765ee556096ab.svg +0 -87
- package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
- package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
- package/dist/public/icons/placeholder-image.png +0 -0
- package/dist/public/icons/transparent.svg +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
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 React from 'react';
|
|
14
|
+
// Styled
|
|
15
|
+
import { MobileWrapper, MobileInner, MobileBottomLine } from './styled';
|
|
16
|
+
export const MobileFrame = (_a) => {
|
|
17
|
+
var { children } = _a, restOfProps = __rest(_a, ["children"]);
|
|
18
|
+
return (React.createElement(MobileWrapper, Object.assign({}, restOfProps),
|
|
19
|
+
React.createElement(MobileInner, null,
|
|
20
|
+
children,
|
|
21
|
+
React.createElement(MobileBottomLine, null))));
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileFrame } from './MobileFrame';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MobileWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const MobileInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const MobileBottomLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Assets
|
|
4
|
+
import MobileFrame from '@antscorp/antsomi-ui/es/assets/images/iphone.png';
|
|
5
|
+
export const MobileWrapper = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
background: url(${MobileFrame}) no-repeat center center;
|
|
10
|
+
background-size: contain;
|
|
11
|
+
`;
|
|
12
|
+
export const MobileInner = styled.div `
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
max-width: 336px;
|
|
16
|
+
height: 695px;
|
|
17
|
+
margin: 61px 23px 20px 24px;
|
|
18
|
+
border-bottom-left-radius: 50px;
|
|
19
|
+
border-bottom-right-radius: 50px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
`;
|
|
22
|
+
export const MobileBottomLine = styled.div `
|
|
23
|
+
width: 145px;
|
|
24
|
+
height: 5px;
|
|
25
|
+
background-color: #000000;
|
|
26
|
+
border-radius: 20px;
|
|
27
|
+
position: absolute;
|
|
28
|
+
margin: auto;
|
|
29
|
+
bottom: 10px;
|
|
30
|
+
left: 50%;
|
|
31
|
+
transform: translateX(-50%);
|
|
32
|
+
z-index: 10;
|
|
33
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PreviewTabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
total?: number;
|
|
4
|
+
current?: number;
|
|
5
|
+
onChange?: (current: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const PreviewTabs: React.FC<PreviewTabProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 React, { useEffect, useState } from 'react';
|
|
14
|
+
import cn from 'classnames';
|
|
15
|
+
// Components
|
|
16
|
+
import { Flex, Icon } from '..';
|
|
17
|
+
// Styled
|
|
18
|
+
import { NavigationButton, StyledRichMenuTabs } from './styled';
|
|
19
|
+
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
20
|
+
const defaultProps = {
|
|
21
|
+
total: 20,
|
|
22
|
+
current: 1,
|
|
23
|
+
};
|
|
24
|
+
const PATH = 'antsomi-ui/src/components/atoms/PreviewTabs/PreviewTabs.tsx';
|
|
25
|
+
export const PreviewTabs = props => {
|
|
26
|
+
const { total = 20, current = 1, onChange } = props, restProps = __rest(props, ["total", "current", "onChange"]);
|
|
27
|
+
const tabsRef = React.useRef(null);
|
|
28
|
+
// State
|
|
29
|
+
const [state, setState] = useState({
|
|
30
|
+
disablePrev: true,
|
|
31
|
+
disableNext: true,
|
|
32
|
+
});
|
|
33
|
+
// Variables
|
|
34
|
+
const { disableNext, disablePrev } = state;
|
|
35
|
+
// Handlers
|
|
36
|
+
const checkScroll = () => {
|
|
37
|
+
if (tabsRef.current) {
|
|
38
|
+
const { scrollLeft, clientWidth, scrollWidth } = tabsRef.current;
|
|
39
|
+
setState(prevState => (Object.assign(Object.assign({}, prevState), { disableNext: scrollLeft + clientWidth === scrollWidth })));
|
|
40
|
+
setState(prevState => (Object.assign(Object.assign({}, prevState), { disablePrev: scrollLeft === 0 })));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Check disable next navigation base length of tabs
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
checkScroll();
|
|
46
|
+
}, []);
|
|
47
|
+
// Handlers
|
|
48
|
+
const onClickNavigation = tryCatchWrapper((isPrev) => {
|
|
49
|
+
if (tabsRef.current) {
|
|
50
|
+
const { scrollLeft } = tabsRef.current;
|
|
51
|
+
tabsRef.current.scrollTo({ left: scrollLeft + (isPrev ? -40 : 40), behavior: 'smooth' });
|
|
52
|
+
checkScroll();
|
|
53
|
+
}
|
|
54
|
+
}, PATH);
|
|
55
|
+
return (React.createElement(StyledRichMenuTabs, Object.assign({}, restProps),
|
|
56
|
+
React.createElement(NavigationButton, { className: cn('navigation--previous', {
|
|
57
|
+
'navigation--disabled': disablePrev,
|
|
58
|
+
}), onClick: () => onClickNavigation(true) },
|
|
59
|
+
React.createElement(Icon, { type: "icon-ants-angle-left" })),
|
|
60
|
+
React.createElement(Flex, { ref: tabsRef, className: "tabs antsomi-scrollbar-hidden", align: "center", onScroll: () => checkScroll() }, Array.from({ length: total }).map((_, index) => (React.createElement(Flex, { key: `${index + 1}`, align: "center", justify: "center", className: `tabs__item ${current === index + 1 ? 'tabs__item--active' : ''}`, onClick: () => onChange && onChange(index + 1) },
|
|
61
|
+
React.createElement(Flex, { align: "center", justify: "center", className: "tabs__label" }, index + 1))))),
|
|
62
|
+
React.createElement(NavigationButton, { className: cn('navigation--next', {
|
|
63
|
+
'navigation--disabled': disableNext,
|
|
64
|
+
}), onClick: () => onClickNavigation(false) },
|
|
65
|
+
React.createElement(Icon, { type: "icon-ants-angle-right" }))));
|
|
66
|
+
};
|
|
67
|
+
PreviewTabs.defaultProps = defaultProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreviewTabs } from './PreviewTabs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface StyledRichMenuTabsProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const StyledRichMenuTabs: import("styled-components").StyledComponent<"div", any, StyledRichMenuTabsProps, never>;
|
|
6
|
+
export declare const NavigationButton: 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>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Components
|
|
2
|
+
import { Flex } from '../Flex';
|
|
3
|
+
// Styled
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
export const StyledRichMenuTabs = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background: #f0f0f0;
|
|
9
|
+
box-shadow: 0px 3px 3px 0px rgba(0, 46, 89, 0.1);
|
|
10
|
+
height: 40px;
|
|
11
|
+
width: ${({ width }) => width || 467}px;
|
|
12
|
+
|
|
13
|
+
.tabs {
|
|
14
|
+
flex: 1;
|
|
15
|
+
width: 100%;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
|
|
18
|
+
&__item {
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
height: 40px;
|
|
21
|
+
width: 40px;
|
|
22
|
+
border-right: 1px solid #d4d4d4;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: all 200ms;
|
|
25
|
+
|
|
26
|
+
&--active {
|
|
27
|
+
background-color: #fff;
|
|
28
|
+
|
|
29
|
+
.tabs__label {
|
|
30
|
+
background-color: var(--primary-color);
|
|
31
|
+
color: #fff;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__label {
|
|
37
|
+
height: 24px;
|
|
38
|
+
width: 24px;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
color: var(--primary-color);
|
|
42
|
+
border-radius: 100%;
|
|
43
|
+
border: 1px solid #b8cfe6;
|
|
44
|
+
background-color: #fff;
|
|
45
|
+
transition: all 200ms;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
export const NavigationButton = styled(Flex) `
|
|
50
|
+
width: 40px;
|
|
51
|
+
height: 40px;
|
|
52
|
+
background-color: #fff;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
i {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #595959;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.navigation--previous {
|
|
61
|
+
border-right: 1px solid #d4d4d4;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.navigation--next {
|
|
65
|
+
border-left: 1px solid #d4d4d4;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.navigation--disabled {
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
|
|
71
|
+
i {
|
|
72
|
+
color: #59595980;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
NavigationButton.defaultProps = {
|
|
77
|
+
align: 'center',
|
|
78
|
+
justify: 'center',
|
|
79
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RateContinuousProps {
|
|
3
|
+
count?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
/**
|
|
7
|
+
* @description number of star
|
|
8
|
+
*/
|
|
9
|
+
value?: number;
|
|
10
|
+
type?: 'full' | 'half' | 'continuous';
|
|
11
|
+
/**
|
|
12
|
+
* @param value current number of stars are selected
|
|
13
|
+
* @description number of stars = fillWidth / STAR_WIDTH
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (value: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const RateV2: React.FC<RateContinuousProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import StarImage from '@antscorp/antsomi-ui/es/assets/images/stars_slider.png';
|
|
3
|
+
const STAR_WIDTH = 30;
|
|
4
|
+
const parseNumDecimals = (input, decimals) => +Number.parseFloat(input === null || input === void 0 ? void 0 : input.toString()).toFixed(decimals);
|
|
5
|
+
const roundHalf = (num) => {
|
|
6
|
+
const multiplier = 1 / 0.5;
|
|
7
|
+
return Math.round(num * multiplier) / multiplier;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param width width measure from the left edge of star container
|
|
12
|
+
* @param type type of star - 'full' | 'half' | 'continuous'
|
|
13
|
+
* @default type 'full'
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
const getWidth = (width, type = 'full') => {
|
|
17
|
+
const numberOfStar = width / STAR_WIDTH;
|
|
18
|
+
return type === 'full'
|
|
19
|
+
? Math.ceil(numberOfStar) * STAR_WIDTH
|
|
20
|
+
: type === 'half'
|
|
21
|
+
? roundHalf(numberOfStar) * STAR_WIDTH
|
|
22
|
+
: width;
|
|
23
|
+
};
|
|
24
|
+
export const RateV2 = ({ count = 5, className, defaultValue = 0, value, type = 'full', onChange, }) => {
|
|
25
|
+
const fullWidth = count * STAR_WIDTH;
|
|
26
|
+
// The width is calculated when move mouse => change the UI, not change the real value
|
|
27
|
+
const [fillWidth, setFillWidth] = useState(() => defaultValue ? getWidth(defaultValue * STAR_WIDTH, type) : 0);
|
|
28
|
+
// The real current value that will be return to parent component by onChange function
|
|
29
|
+
// currWidth = value * STAR_WIDTH
|
|
30
|
+
const [currWidth, setCurrWidth] = useState(0);
|
|
31
|
+
const handleMouseMove = e => {
|
|
32
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
33
|
+
const x = e.clientX - rect.left;
|
|
34
|
+
const hoverWidth = Math.round(x);
|
|
35
|
+
setFillWidth(getWidth(hoverWidth, type));
|
|
36
|
+
};
|
|
37
|
+
const handleClick = () => {
|
|
38
|
+
// If have no value => auto set current value; if have value => must control value with onChange props
|
|
39
|
+
if (!value)
|
|
40
|
+
setCurrWidth(fillWidth);
|
|
41
|
+
if (onChange)
|
|
42
|
+
onChange(parseNumDecimals(fillWidth / STAR_WIDTH, 2));
|
|
43
|
+
};
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (typeof value === 'number') {
|
|
46
|
+
const width = getWidth(value * STAR_WIDTH, type);
|
|
47
|
+
setCurrWidth(width);
|
|
48
|
+
setFillWidth(width);
|
|
49
|
+
}
|
|
50
|
+
}, [value]);
|
|
51
|
+
return (React.createElement("div", { className: `antsomi-rate-continuous${className ? ` ${className}` : ''}`, style: {
|
|
52
|
+
position: 'relative',
|
|
53
|
+
width: `${fullWidth}px`,
|
|
54
|
+
backgroundPosition: '-27px',
|
|
55
|
+
height: '28px',
|
|
56
|
+
}, onMouseMove: handleMouseMove, onMouseLeave: () => setFillWidth(currWidth || 0), onClick: handleClick },
|
|
57
|
+
React.createElement("div", { className: "custom-rate custom-rate--fill", style: {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
background: `url(${StarImage}) 0px 0px`,
|
|
60
|
+
width: `${fillWidth}px`,
|
|
61
|
+
height: '26px',
|
|
62
|
+
zIndex: 1,
|
|
63
|
+
} }),
|
|
64
|
+
React.createElement("div", { className: "custom-rate custom-rate--empty", style: {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
top: '0px',
|
|
67
|
+
left: '0px',
|
|
68
|
+
backgroundImage: 'none',
|
|
69
|
+
background: `transparent url(${StarImage}) 0px -26px`,
|
|
70
|
+
width: `${fullWidth}px`,
|
|
71
|
+
height: '26px',
|
|
72
|
+
} })));
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RateV2 } from './RateV2';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RateV2 } from './RateV2';
|
|
@@ -17,8 +17,9 @@ import { Text } from '../Text';
|
|
|
17
17
|
import { StyledRequired } from './styled';
|
|
18
18
|
export const RequiredLabel = memo(props => {
|
|
19
19
|
// Props
|
|
20
|
-
const { children } = props, restProps = __rest(props, ["children"]);
|
|
20
|
+
const { children, isReverseMask = false } = props, restProps = __rest(props, ["children", "isReverseMask"]);
|
|
21
21
|
return (React.createElement(Text, Object.assign({}, restProps),
|
|
22
|
-
React.createElement(StyledRequired, null, "*"),
|
|
23
|
-
children
|
|
22
|
+
!isReverseMask && React.createElement(StyledRequired, null, "*"),
|
|
23
|
+
children,
|
|
24
|
+
isReverseMask && React.createElement(StyledRequired, null, "*")));
|
|
24
25
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SliderRangeProps, SliderSingleProps } from 'antd/es/slider';
|
|
3
|
-
export interface SliderProps extends SliderSingleProps {
|
|
3
|
+
export interface SliderProps extends Omit<SliderSingleProps, 'tooltipVisible'> {
|
|
4
|
+
tooltipVisible?: boolean | 'default';
|
|
4
5
|
}
|
|
5
6
|
export declare const Slider: React.FC<SliderProps | SliderRangeProps>;
|
|
@@ -1,30 +1,23 @@
|
|
|
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
1
|
// Libraries
|
|
13
2
|
import React, { memo, useMemo } from 'react';
|
|
14
3
|
// Antd Components
|
|
15
4
|
import { Slider as AntdSlider } from 'antd';
|
|
16
5
|
// Styled
|
|
17
6
|
import { SliderWrapper } from './styled';
|
|
7
|
+
import { omit } from 'lodash';
|
|
18
8
|
export const Slider = memo(props => {
|
|
19
|
-
const { range, value, min = 0, max = 0, className } = props
|
|
9
|
+
const { range, value, min = 0, max = 0, className, tooltipVisible } = props;
|
|
20
10
|
const isNegative = useMemo(() => !!(!range && min < 0), [range, min]);
|
|
21
11
|
const calculateWidth = useMemo(() => ((value || 0) * 100) / (Math.abs(max) + Math.abs(min) || 1), [min, max, value]);
|
|
12
|
+
const restProps = tooltipVisible === 'default' ? omit(props, ['tooltipVisible']) : props;
|
|
22
13
|
if (isNegative) {
|
|
23
14
|
return (React.createElement(SliderWrapper, { isNegative: true, width: calculateWidth, className: className },
|
|
24
|
-
React.createElement(AntdSlider, Object.assign({
|
|
15
|
+
React.createElement(AntdSlider, Object.assign({}, omit(restProps, ['marks', 'className']), { marks: {
|
|
16
|
+
0: ' ',
|
|
17
|
+
} }))));
|
|
25
18
|
}
|
|
26
19
|
return (React.createElement(SliderWrapper, { className: className },
|
|
27
|
-
React.createElement(AntdSlider, Object.assign({},
|
|
20
|
+
React.createElement(AntdSlider, Object.assign({}, restProps))));
|
|
28
21
|
});
|
|
29
22
|
Slider.defaultProps = {
|
|
30
23
|
tooltipVisible: false,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SliderRangeProps, SliderSingleProps } from 'antd/es/slider';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
defaultSliderTrack?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const SliderV2: React.FC<(SliderSingleProps & SliderProps) | (SliderRangeProps & SliderProps)>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
// Antd Components
|
|
4
|
+
import { Slider as AntdSlider } from 'antd';
|
|
5
|
+
// React.FC<SliderProps>
|
|
6
|
+
export const SliderV2 = props => {
|
|
7
|
+
const { min, max, onChange, styles, range, value, defaultValue, marks, defaultSliderTrack } = props;
|
|
8
|
+
const [valueInternal, setValueInternal] = useState(defaultValue || min || 0);
|
|
9
|
+
if (min && max && min < 0 && max > 0 && !range && !defaultSliderTrack) {
|
|
10
|
+
const sliderWidth = max - min;
|
|
11
|
+
const calcValue = value || valueInternal;
|
|
12
|
+
const leftTrackPosition = `${(Math.abs(calcValue > 0 ? min : min - calcValue) / sliderWidth) * 100}%`;
|
|
13
|
+
const sliderTrackWidth = `${(Math.abs(calcValue) / sliderWidth) * 100}%`;
|
|
14
|
+
return (React.createElement(AntdSlider, Object.assign({ value: value || valueInternal, onChange: value => {
|
|
15
|
+
setValueInternal(value);
|
|
16
|
+
if (onChange)
|
|
17
|
+
onChange(value);
|
|
18
|
+
}, styles: Object.assign({ track: Object.assign({ left: leftTrackPosition, width: sliderTrackWidth }, styles === null || styles === void 0 ? void 0 : styles.track) }, styles), marks: marks || { 0: ' ' } }, props)));
|
|
19
|
+
}
|
|
20
|
+
return React.createElement(AntdSlider, Object.assign({}, props));
|
|
21
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SpinProps as AntdSpinProps } from 'antd';
|
|
2
3
|
export interface TSpinProps extends AntdSpinProps {
|
|
3
4
|
indicatorSize?: number;
|
|
4
5
|
children?: any;
|
|
5
6
|
}
|
|
6
7
|
export declare const Spin: {
|
|
7
|
-
(props: TSpinProps): JSX.Element;
|
|
8
|
+
(props: TSpinProps): React.JSX.Element;
|
|
8
9
|
defaultProps: {};
|
|
9
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StyledSpin: import("styled-components").StyledComponent<import("antd/es/spin").
|
|
1
|
+
export declare const StyledSpin: import("styled-components").StyledComponent<import("antd/es/spin").SpinFCType, any, {}, never>;
|
|
@@ -30,5 +30,12 @@ export { Spin } from './Spin';
|
|
|
30
30
|
export { Alert } from './Alert';
|
|
31
31
|
export { ScrollBox } from './ScrollBox';
|
|
32
32
|
export { Rate } from './Rate';
|
|
33
|
+
export { SliderV2 } from './SliderV2';
|
|
33
34
|
export * from './Flex';
|
|
35
|
+
export * from './RateV2';
|
|
36
|
+
export { InputDynamic } from './InputDynamic';
|
|
37
|
+
export * from './PreviewTabs';
|
|
38
|
+
export * from './MobileFrame';
|
|
34
39
|
export type { SliderProps } from './Slider';
|
|
40
|
+
export type { PaginationProps } from './Pagination';
|
|
41
|
+
export type { InputDynamicProps } from './InputDynamic';
|
|
@@ -30,4 +30,9 @@ export { Spin } from './Spin';
|
|
|
30
30
|
export { Alert } from './Alert';
|
|
31
31
|
export { ScrollBox } from './ScrollBox';
|
|
32
32
|
export { Rate } from './Rate';
|
|
33
|
+
export { SliderV2 } from './SliderV2';
|
|
33
34
|
export * from './Flex';
|
|
35
|
+
export * from './RateV2';
|
|
36
|
+
export { InputDynamic } from './InputDynamic';
|
|
37
|
+
export * from './PreviewTabs';
|
|
38
|
+
export * from './MobileFrame';
|
|
@@ -9,11 +9,45 @@ import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
|
9
9
|
import { far } from '@fortawesome/free-regular-svg-icons';
|
|
10
10
|
import { fab } from '@fortawesome/free-brands-svg-icons';
|
|
11
11
|
library.add(fas, far, fab);
|
|
12
|
+
const { accent6, accent7, scrollBarSize } = THEME.token || {};
|
|
12
13
|
export const GlobalStyle = () => {
|
|
13
14
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33;
|
|
14
15
|
return (React.createElement(Global, { styles: css `
|
|
15
16
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap');
|
|
16
17
|
|
|
18
|
+
/* Custom */
|
|
19
|
+
.antsomi-scrollbar-hidden {
|
|
20
|
+
-ms-overflow-style: none; /* for Internet Explorer, Edge */
|
|
21
|
+
scrollbar-width: none; /* for Firefox */
|
|
22
|
+
|
|
23
|
+
&::-webkit-scrollbar {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* width */
|
|
29
|
+
::-webkit-scrollbar {
|
|
30
|
+
width: ${scrollBarSize};
|
|
31
|
+
height: ${scrollBarSize};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Track */
|
|
35
|
+
::-webkit-scrollbar-track {
|
|
36
|
+
background: ${accent6};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Handle */
|
|
40
|
+
::-webkit-scrollbar-thumb {
|
|
41
|
+
background: ${accent7};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.scrollbar--gutter-stable {
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
scrollbar-gutter: stable;
|
|
47
|
+
margin-right: -${scrollBarSize};
|
|
48
|
+
padding-right: -${scrollBarSize};
|
|
49
|
+
}
|
|
50
|
+
|
|
17
51
|
/* Button */
|
|
18
52
|
.antsomi-btn {
|
|
19
53
|
font-weight: 700 !important;
|
|
@@ -409,6 +443,12 @@ export const GlobalStyle = () => {
|
|
|
409
443
|
font-size: ${(_27 = THEME.token) === null || _27 === void 0 ? void 0 : _27.fontSize}px;
|
|
410
444
|
margin-right: 0;
|
|
411
445
|
|
|
446
|
+
.antsomi-radio-disabled {
|
|
447
|
+
.antsomi-radio-inner {
|
|
448
|
+
border-color: #d9d9d9 !important;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
412
452
|
.antsomi-radio-inner {
|
|
413
453
|
display: flex;
|
|
414
454
|
justify-content: center;
|
|
@@ -474,10 +514,10 @@ export const GlobalStyle = () => {
|
|
|
474
514
|
}
|
|
475
515
|
}
|
|
476
516
|
.antsomi-modal-footer {
|
|
477
|
-
padding:
|
|
517
|
+
padding: 15px !important;
|
|
478
518
|
text-align: right;
|
|
479
519
|
background: transparent;
|
|
480
|
-
border-top: 1px solid #f0f0f0;
|
|
520
|
+
border-top: 1px solid #f0f0f0 !important;
|
|
481
521
|
border-radius: 0 0 2px 2px;
|
|
482
522
|
}
|
|
483
523
|
}
|
|
@@ -514,5 +554,29 @@ export const GlobalStyle = () => {
|
|
|
514
554
|
}
|
|
515
555
|
}
|
|
516
556
|
}
|
|
557
|
+
|
|
558
|
+
/* Tabs */
|
|
559
|
+
.antsomi-tabs {
|
|
560
|
+
.antsomi-tabs-tab {
|
|
561
|
+
&.antsomi-tabs-tab-active {
|
|
562
|
+
font-weight: bold;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/* Form */
|
|
568
|
+
.antsomi-form {
|
|
569
|
+
.antsomi-form-item {
|
|
570
|
+
.antsomi-form-item-label {
|
|
571
|
+
> label.antsomi-form-item-required:not(.antsomi-form-item-required-mark-optional) {
|
|
572
|
+
&::before {
|
|
573
|
+
position: absolute;
|
|
574
|
+
right: 0px;
|
|
575
|
+
font-family: Roboto;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
517
581
|
` }));
|
|
518
582
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ArrowGrowIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const AudioRecordIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const BugIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CameraIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CaptureIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CheckSlimIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CommentIcon: (props: any) => React.JSX.Element;
|