@antscorp/antsomi-ui 1.3.3-beta.35 → 1.3.3-beta.37
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/atoms/Alert/Alert.js +13 -6
- package/es/components/atoms/Button/index.js +1 -1
- package/es/components/atoms/Button/test.js +6 -6
- package/es/components/atoms/DividerPure/DividerPure.js +4 -15
- package/es/components/atoms/DividerPure/styled.js +36 -6
- package/es/components/atoms/Empty/Empty.js +1 -1
- package/es/components/atoms/FloatButton/index.js +1 -1
- package/es/components/atoms/Grid/Grid.js +2 -2
- package/es/components/atoms/Icon/index.js +28 -15
- package/es/components/atoms/Input/Input.js +21 -32
- package/es/components/atoms/Input/styled.js +102 -12
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +13 -13
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +2 -1
- package/es/components/atoms/InputDynamic/InputDynamic.js +83 -97
- package/es/components/atoms/InputDynamic/PopupShortLink.js +20 -21
- package/es/components/atoms/InputDynamic/styled.d.ts +1 -1
- package/es/components/atoms/InputDynamic/styled.js +275 -13
- package/es/components/atoms/InputDynamic/utils.js +104 -114
- package/es/components/atoms/InputNumber/InputNumber.js +3 -14
- package/es/components/atoms/MobileFrame/MobileFrame.js +3 -14
- package/es/components/atoms/MobileFrame/constants.js +1 -1
- package/es/components/atoms/MobileFrame/styled.js +29 -8
- package/es/components/atoms/Pagination/Pagination.js +1 -1
- package/es/components/atoms/Popover/Popover.js +1 -1
- package/es/components/atoms/Popover/styled.js +1 -6
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +20 -31
- package/es/components/atoms/PreviewTabs/styled.js +71 -10
- package/es/components/atoms/Progress/Progress.js +1 -1
- package/es/components/atoms/Radio/index.js +18 -8
- package/es/components/atoms/Rate/Rate.js +1 -1
- package/es/components/atoms/RateV2/RateV2.js +24 -30
- package/es/components/atoms/RequiredLabel/index.js +3 -14
- package/es/components/atoms/RequiredLabel/styled.js +5 -7
- package/es/components/atoms/ScrollBox/index.js +14 -25
- package/es/components/atoms/Segmented/Segmented.js +1 -1
- package/es/components/atoms/Skeleton/Skeleton.js +1 -1
- package/es/components/atoms/Slider/index.js +7 -18
- package/es/components/atoms/Slider/styled.js +38 -10
- package/es/components/atoms/SliderV2/index.js +10 -21
- package/es/components/atoms/Space/Space.js +6 -7
- package/es/components/atoms/Spin/Spin.d.ts +2 -1
- package/es/components/atoms/Spin/Spin.js +3 -14
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/Spin/styled.js +3 -6
- package/es/components/atoms/Statistic/Statistic.js +1 -1
- package/es/components/atoms/Steps/Steps.js +1 -1
- package/es/components/atoms/Switch/Switch.js +1 -1
- package/es/components/atoms/Text/index.js +4 -15
- package/es/components/atoms/Text/styled.js +40 -11
- package/es/components/atoms/Timeline/Timeline.js +1 -1
- package/es/components/atoms/Watermark/Watermark.js +1 -1
- package/es/components/common/ConfigProvider/ConfigProvider.js +4 -15
- package/es/components/common/ConfigProvider/GlobalStyle.js +569 -8
- package/es/components/icons/AccountCircle.js +2 -13
- package/es/components/icons/AddShoppingCart.js +2 -13
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/ArrowGrowIcon.js +2 -13
- package/es/components/icons/AssignmentInd.js +2 -13
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.js +2 -13
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.js +2 -13
- package/es/components/icons/Call.js +2 -13
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.js +2 -13
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.js +2 -13
- package/es/components/icons/Category.js +2 -13
- package/es/components/icons/ChatBubbleOutline.js +2 -13
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.js +2 -13
- package/es/components/icons/CircleNotifications.js +2 -13
- package/es/components/icons/CloseIcon.d.ts +2 -1
- package/es/components/icons/CloseIcon.js +2 -13
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.js +2 -13
- package/es/components/icons/ConfirmationNumber.js +2 -13
- package/es/components/icons/DesktopWindows.js +2 -13
- package/es/components/icons/EventIcon.d.ts +2 -1
- package/es/components/icons/EventIcon.js +2 -13
- package/es/components/icons/FactCheck.js +2 -13
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.js +2 -13
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.js +2 -2
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV2.js +2 -2
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/GPTIconV3.js +2 -13
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/HighlightIcon.js +2 -13
- package/es/components/icons/HightlightAlt.js +2 -13
- package/es/components/icons/HowToReg.js +2 -13
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.js +2 -13
- package/es/components/icons/Interactive.js +2 -13
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.js +2 -13
- package/es/components/icons/List.js +2 -13
- package/es/components/icons/LocalMallIcon.js +2 -13
- package/es/components/icons/MobileFriendly.js +2 -13
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.js +2 -13
- package/es/components/icons/NotificationsActive.js +2 -13
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.js +2 -13
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.js +2 -13
- package/es/components/icons/Payment.js +2 -13
- package/es/components/icons/PersonAddDisabled.js +2 -13
- package/es/components/icons/PhoneCallback.js +2 -13
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.js +2 -13
- package/es/components/icons/Preview.js +2 -13
- package/es/components/icons/Redeem.js +2 -13
- package/es/components/icons/RemoveRedEye.js +2 -13
- package/es/components/icons/RemoveShoppingCart.js +2 -13
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.js +2 -13
- package/es/components/icons/Search.js +2 -13
- package/es/components/icons/ShoppingBag.js +2 -13
- package/es/components/icons/ShoppingCart.js +2 -13
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.js +2 -13
- package/es/components/icons/Store.js +2 -13
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.js +2 -13
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.js +2 -13
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.js +2 -13
- package/es/components/icons/Web.js +2 -13
- package/es/components/icons/WebAsset.js +2 -13
- package/es/components/molecules/AlignSetting/index.js +9 -20
- package/es/components/molecules/AlignSetting/styled.js +5 -6
- package/es/components/molecules/AlignSetting/utils.js +2 -2
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/CaptureScreen.js +240 -269
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +25 -36
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +129 -15
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +2 -2
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +73 -10
- package/es/components/molecules/CaptureScreen/constants.js +7 -7
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +1 -1
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +23 -23
- package/es/components/molecules/CaptureScreen/styled.js +247 -28
- package/es/components/molecules/CaptureScreen/themes/black.js +1 -1
- package/es/components/molecules/CaptureScreen/themes/white.js +1 -1
- package/es/components/molecules/CaptureScreen/utils.js +29 -32
- package/es/components/molecules/Card/Card.js +1 -1
- package/es/components/molecules/ChatBox/ChatBox.js +81 -147
- package/es/components/molecules/ChatBox/MessageItem.js +20 -22
- package/es/components/molecules/ChatBox/constants.js +2 -2
- package/es/components/molecules/ChatBox/styled.js +275 -13
- package/es/components/molecules/Collapse/Collapse.js +3 -4
- package/es/components/molecules/ColorPicker/ChromePicker/index.js +1 -1
- package/es/components/molecules/ColorPicker/ChromePicker/styled.js +11 -6
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +21 -33
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +95 -14
- package/es/components/molecules/ColorPicker/SketchPicker/index.js +1 -12
- package/es/components/molecules/ColorPicker/SketchPicker/styled.js +6 -6
- package/es/components/molecules/ColorPicker/index.js +17 -17
- package/es/components/molecules/ColorPicker/styled.js +8 -6
- package/es/components/molecules/ColorSetting/index.js +15 -35
- package/es/components/molecules/ColorSetting/styled.js +36 -9
- package/es/components/molecules/DatePicker/DatePicker.js +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +112 -146
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +10 -10
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +45 -12
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +3 -8
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +9 -28
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -1
- package/es/components/molecules/Drawer/Drawer.js +1 -1
- package/es/components/molecules/EdgeSetting/index.js +45 -69
- package/es/components/molecules/EdgeSetting/styled.js +13 -8
- package/es/components/molecules/FontFamilySelect/constants.js +1 -1
- package/es/components/molecules/FontFamilySelect/index.js +10 -33
- package/es/components/molecules/FontSetting/constants.js +2 -2
- package/es/components/molecules/FontSetting/index.js +22 -36
- package/es/components/molecules/FontWeightSelect/constants.js +1 -1
- package/es/components/molecules/FontWeightSelect/index.js +9 -32
- package/es/components/molecules/GradientSetting/index.js +35 -55
- package/es/components/molecules/GradientSetting/styled.js +58 -6
- package/es/components/molecules/IconSelection/components/Icon/index.js +8 -19
- package/es/components/molecules/IconSelection/constants.js +31 -37
- package/es/components/molecules/IconSelection/index.js +43 -56
- package/es/components/molecules/IconSelection/styled.js +74 -10
- package/es/components/molecules/IconSelection/types.js +1 -3
- package/es/components/molecules/IconSelection/utils.js +3 -3
- package/es/components/molecules/InputNumber/index.js +12 -23
- package/es/components/molecules/InputNumberWithUnit/index.js +5 -19
- package/es/components/molecules/InputNumberWithUnit/styled.js +15 -6
- package/es/components/molecules/InputSearch/index.js +3 -14
- package/es/components/molecules/InputSearch/styled.js +43 -6
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/Modal.js +8 -23
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/Modal/styled.js +69 -17
- package/es/components/molecules/ModalV2/ModalV2.js +6 -17
- package/es/components/molecules/ModalV2/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/styled.js +19 -6
- package/es/components/molecules/Popconfirm/Popconfirm.js +1 -1
- package/es/components/molecules/PopupDraggable/PopupDraggable.js +13 -25
- package/es/components/molecules/PopupDraggable/styled.js +47 -11
- package/es/components/molecules/PreviewModal/PreviewModal.js +5 -16
- package/es/components/molecules/PreviewModal/styled.js +30 -9
- package/es/components/molecules/RadioGroup/index.js +3 -14
- package/es/components/molecules/RadioGroup/styled.js +11 -7
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +275 -338
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +23 -37
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +78 -6
- package/es/components/molecules/ResizeGrid/constant.js +26 -37
- package/es/components/molecules/ResizeGrid/styled.js +54 -9
- package/es/components/molecules/Result/Result.js +1 -1
- package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +23 -34
- package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +11 -11
- package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +34 -18
- package/es/components/molecules/RichMenuBlock/constants.js +1 -1
- package/es/components/molecules/RichMenuBlock/styled.js +15 -16
- package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +6 -17
- package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +3 -3
- package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +43 -8
- package/es/components/molecules/RichMenuChatBar/styled.js +25 -10
- package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +7 -22
- package/es/components/molecules/RichMenuMobileView/styled.js +18 -11
- package/es/components/molecules/Select/Select.d.ts +4 -2
- package/es/components/molecules/Select/Select.js +9 -20
- package/es/components/molecules/Select/Test.d.ts +2 -1
- package/es/components/molecules/Select/Test.js +2 -2
- package/es/components/molecules/Select/styled.js +34 -7
- package/es/components/molecules/SettingWrapper/index.js +2 -2
- package/es/components/molecules/SettingWrapper/styled.js +15 -9
- package/es/components/molecules/SettingWrapperPopover/index.js +4 -16
- package/es/components/molecules/SliderWithInputNumber/index.js +8 -19
- package/es/components/molecules/SliderWithInputNumber/styled.js +3 -6
- package/es/components/molecules/TextDecorationSelect/constants.js +1 -1
- package/es/components/molecules/TextDecorationSelect/index.js +9 -32
- package/es/components/molecules/TextTransformSelect/constants.js +1 -1
- package/es/components/molecules/TextTransformSelect/index.js +9 -32
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
- package/es/components/molecules/TreeSelect/TreeSelect.js +1 -1
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
- package/es/components/molecules/UploadImage/MediaIcon.js +2 -2
- package/es/components/molecules/UploadImage/index.js +182 -280
- package/es/components/molecules/UploadImage/styled.js +129 -16
- package/es/components/organism/Help/Help.js +422 -530
- package/es/components/organism/Help/constants.js +11 -12
- package/es/components/organism/Help/styled.d.ts +6 -2
- package/es/components/organism/Help/styled.js +257 -48
- package/es/components/organism/Help/utils.js +11 -11
- package/es/components/organism/PositionSetting/config.js +2 -2
- package/es/components/organism/PositionSetting/index.js +15 -27
- package/es/components/organism/PositionSetting/styled.js +1 -6
- package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +10 -10
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +6 -6
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +12 -6
- package/es/components/organism/Table/CrossTabTable/constants.js +3 -3
- package/es/components/organism/Table/CrossTabTable/styled.js +12 -6
- package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
- package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +12 -23
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +8 -8
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +20 -8
- package/es/components/organism/Table/ExplorePivotTable/constants.js +2 -2
- package/es/components/organism/Table/ExplorePivotTable/styled.js +13 -7
- package/es/components/organism/Table/ExplorePivotTable/utils.js +52 -72
- package/es/constants/gradientSetting.js +4 -4
- package/es/constants/keyCode.js +387 -387
- package/es/constants/richMenu.js +2 -2
- package/es/constants/storybook.d.ts +2 -1
- package/es/constants/storybook.js +2 -2
- package/es/constants/theme.js +6 -6
- package/es/hooks/index.js +1 -1
- package/es/hooks/useDebounce.js +5 -5
- package/es/hooks/useDeepCompareEffect.js +1 -1
- package/es/locales/i18n.js +2 -2
- package/es/locales/translations.js +7 -23
- package/es/models/SavedImage.js +23 -68
- package/es/models/Upload.js +19 -64
- package/es/models/model.js +3 -5
- package/es/services/MediaTemplateDesign/UploadFile/index.js +46 -102
- package/es/services/Ticket.js +48 -89
- package/es/services/constants.js +3 -3
- package/es/services/index.js +19 -30
- package/es/test.d.ts +2 -1
- package/es/test.js +25 -36
- package/es/utils/color.js +22 -22
- package/es/utils/common.js +75 -88
- package/es/utils/handleError.js +8 -49
- package/es/utils/loadable.js +6 -18
- package/es/utils/web.js +20 -26
- package/package.json +2 -2
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -28,51 +17,51 @@ import { Flex, Icon } from '..';
|
|
|
28
17
|
// Styled
|
|
29
18
|
import { NavigationButton, StyledRichMenuTabs } from './styled';
|
|
30
19
|
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
31
|
-
|
|
20
|
+
const defaultProps = {
|
|
32
21
|
total: 20,
|
|
33
22
|
current: 1,
|
|
34
23
|
};
|
|
35
|
-
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
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);
|
|
39
28
|
// State
|
|
40
|
-
|
|
29
|
+
const [state, setState] = useState({
|
|
41
30
|
disablePrev: true,
|
|
42
31
|
disableNext: true,
|
|
43
|
-
})
|
|
32
|
+
});
|
|
44
33
|
// Variables
|
|
45
|
-
|
|
34
|
+
const { disableNext, disablePrev } = state;
|
|
46
35
|
// Handlers
|
|
47
|
-
|
|
36
|
+
const checkScroll = () => {
|
|
48
37
|
if (tabsRef.current) {
|
|
49
|
-
|
|
50
|
-
setState(
|
|
51
|
-
setState(
|
|
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 })));
|
|
52
41
|
}
|
|
53
42
|
};
|
|
54
43
|
// Check disable next navigation base length of tabs
|
|
55
|
-
useEffect(
|
|
44
|
+
useEffect(() => {
|
|
56
45
|
checkScroll();
|
|
57
46
|
}, []);
|
|
58
47
|
// Handlers
|
|
59
|
-
|
|
48
|
+
const onClickNavigation = tryCatchWrapper((isPrev) => {
|
|
60
49
|
if (tabsRef.current) {
|
|
61
|
-
|
|
50
|
+
const { scrollLeft } = tabsRef.current;
|
|
62
51
|
tabsRef.current.scrollTo({ left: scrollLeft + (isPrev ? -40 : 40), behavior: 'smooth' });
|
|
63
52
|
checkScroll();
|
|
64
53
|
}
|
|
65
54
|
}, PATH);
|
|
66
|
-
return (React.createElement(StyledRichMenuTabs,
|
|
55
|
+
return (React.createElement(StyledRichMenuTabs, Object.assign({}, restProps),
|
|
67
56
|
React.createElement(NavigationButton, { className: cn('navigation--previous', {
|
|
68
57
|
'navigation--disabled': disablePrev,
|
|
69
|
-
}), onClick:
|
|
58
|
+
}), onClick: () => onClickNavigation(true) },
|
|
70
59
|
React.createElement(Icon, { type: "icon-ants-angle-left" })),
|
|
71
|
-
React.createElement(Flex, { ref: tabsRef, className: "tabs antsomi-scrollbar-hidden", align: "center", onScroll:
|
|
72
|
-
React.createElement(Flex, { align: "center", justify: "center", className: "tabs__label" }, index + 1)))
|
|
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))))),
|
|
73
62
|
React.createElement(NavigationButton, { className: cn('navigation--next', {
|
|
74
63
|
'navigation--disabled': disableNext,
|
|
75
|
-
}), onClick:
|
|
64
|
+
}), onClick: () => onClickNavigation(false) },
|
|
76
65
|
React.createElement(Icon, { type: "icon-ants-angle-right" }))));
|
|
77
66
|
};
|
|
78
67
|
PreviewTabs.defaultProps = defaultProps;
|
|
@@ -1,18 +1,79 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
// Components
|
|
6
2
|
import { Flex } from '../Flex';
|
|
7
3
|
// Styled
|
|
8
4
|
import styled from 'styled-components';
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
`;
|
|
14
76
|
NavigationButton.defaultProps = {
|
|
15
77
|
align: 'center',
|
|
16
78
|
justify: 'center',
|
|
17
79
|
};
|
|
18
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Progress as AntdProgress } from 'antd';
|
|
2
|
-
export
|
|
2
|
+
export const Progress = AntdProgress;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
var _a, _b, _c, _d;
|
|
6
2
|
// Libraries
|
|
7
3
|
import styled from 'styled-components';
|
|
@@ -9,7 +5,21 @@ import styled from 'styled-components';
|
|
|
9
5
|
import { Radio as AntdRadio } from 'antd';
|
|
10
6
|
// Constants
|
|
11
7
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
export const Radio = styled(AntdRadio) `
|
|
9
|
+
font-family: 'Roboto';
|
|
10
|
+
color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorTextBase};
|
|
11
|
+
font-size: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.fontSize}px;
|
|
12
|
+
|
|
13
|
+
.antsomi-radio {
|
|
14
|
+
.antsomi-radio-inner {
|
|
15
|
+
border-width: 2px;
|
|
16
|
+
border-color: ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorPrimary};
|
|
17
|
+
|
|
18
|
+
&::after {
|
|
19
|
+
background-color: ${(_d = THEME.token) === null || _d === void 0 ? void 0 : _d.colorPrimary};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const RadioButton = styled(AntdRadio.Button) ``;
|
|
25
|
+
export const RadioGroupSub = styled(AntdRadio.Group) ``;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Rate as AntdRate } from 'antd';
|
|
2
|
-
export
|
|
2
|
+
export const Rate = AntdRate;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import StarImage from '@antscorp/antsomi-ui/es/assets/images/stars_slider.png';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var roundHalf = function (num) {
|
|
8
|
-
var multiplier = 1 / 0.5;
|
|
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;
|
|
9
7
|
return Math.round(num * multiplier) / multiplier;
|
|
10
8
|
};
|
|
11
9
|
/**
|
|
@@ -15,55 +13,51 @@ var roundHalf = function (num) {
|
|
|
15
13
|
* @default type 'full'
|
|
16
14
|
* @returns
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var numberOfStar = width / STAR_WIDTH;
|
|
16
|
+
const getWidth = (width, type = 'full') => {
|
|
17
|
+
const numberOfStar = width / STAR_WIDTH;
|
|
21
18
|
return type === 'full'
|
|
22
19
|
? Math.ceil(numberOfStar) * STAR_WIDTH
|
|
23
20
|
: type === 'half'
|
|
24
21
|
? roundHalf(numberOfStar) * STAR_WIDTH
|
|
25
22
|
: width;
|
|
26
23
|
};
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
var fullWidth = count * STAR_WIDTH;
|
|
24
|
+
export const RateV2 = ({ count = 5, className, defaultValue = 0, value, type = 'full', onChange, }) => {
|
|
25
|
+
const fullWidth = count * STAR_WIDTH;
|
|
30
26
|
// The width is calculated when move mouse => change the UI, not change the real value
|
|
31
|
-
|
|
32
|
-
return defaultValue ? getWidth(defaultValue * STAR_WIDTH, type) : 0;
|
|
33
|
-
}), fillWidth = _e[0], setFillWidth = _e[1];
|
|
27
|
+
const [fillWidth, setFillWidth] = useState(() => defaultValue ? getWidth(defaultValue * STAR_WIDTH, type) : 0);
|
|
34
28
|
// The real current value that will be return to parent component by onChange function
|
|
35
29
|
// currWidth = value * STAR_WIDTH
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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);
|
|
41
35
|
setFillWidth(getWidth(hoverWidth, type));
|
|
42
36
|
};
|
|
43
|
-
|
|
37
|
+
const handleClick = () => {
|
|
44
38
|
// If have no value => auto set current value; if have value => must control value with onChange props
|
|
45
39
|
if (!value)
|
|
46
40
|
setCurrWidth(fillWidth);
|
|
47
41
|
if (onChange)
|
|
48
42
|
onChange(parseNumDecimals(fillWidth / STAR_WIDTH, 2));
|
|
49
43
|
};
|
|
50
|
-
useEffect(
|
|
44
|
+
useEffect(() => {
|
|
51
45
|
if (typeof value === 'number') {
|
|
52
|
-
|
|
46
|
+
const width = getWidth(value * STAR_WIDTH, type);
|
|
53
47
|
setCurrWidth(width);
|
|
54
48
|
setFillWidth(width);
|
|
55
49
|
}
|
|
56
50
|
}, [value]);
|
|
57
|
-
return (React.createElement("div", { className:
|
|
51
|
+
return (React.createElement("div", { className: `antsomi-rate-continuous${className ? ` ${className}` : ''}`, style: {
|
|
58
52
|
position: 'relative',
|
|
59
|
-
width:
|
|
53
|
+
width: `${fullWidth}px`,
|
|
60
54
|
backgroundPosition: '-27px',
|
|
61
55
|
height: '28px',
|
|
62
|
-
}, onMouseMove: handleMouseMove, onMouseLeave:
|
|
56
|
+
}, onMouseMove: handleMouseMove, onMouseLeave: () => setFillWidth(currWidth || 0), onClick: handleClick },
|
|
63
57
|
React.createElement("div", { className: "custom-rate custom-rate--fill", style: {
|
|
64
58
|
position: 'absolute',
|
|
65
|
-
background:
|
|
66
|
-
width:
|
|
59
|
+
background: `url(${StarImage}) 0px 0px`,
|
|
60
|
+
width: `${fillWidth}px`,
|
|
67
61
|
height: '26px',
|
|
68
62
|
zIndex: 1,
|
|
69
63
|
} }),
|
|
@@ -72,8 +66,8 @@ export var RateV2 = function (_a) {
|
|
|
72
66
|
top: '0px',
|
|
73
67
|
left: '0px',
|
|
74
68
|
backgroundImage: 'none',
|
|
75
|
-
background:
|
|
76
|
-
width:
|
|
69
|
+
background: `transparent url(${StarImage}) 0px -26px`,
|
|
70
|
+
width: `${fullWidth}px`,
|
|
77
71
|
height: '26px',
|
|
78
72
|
} })));
|
|
79
73
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,10 +15,10 @@ import React, { memo } from 'react';
|
|
|
26
15
|
import { Text } from '../Text';
|
|
27
16
|
// Styled
|
|
28
17
|
import { StyledRequired } from './styled';
|
|
29
|
-
export
|
|
18
|
+
export const RequiredLabel = memo(props => {
|
|
30
19
|
// Props
|
|
31
|
-
|
|
32
|
-
return (React.createElement(Text,
|
|
20
|
+
const { children, isReverseMask = false } = props, restProps = __rest(props, ["children", "isReverseMask"]);
|
|
21
|
+
return (React.createElement(Text, Object.assign({}, restProps),
|
|
33
22
|
!isReverseMask && React.createElement(StyledRequired, null, "*"),
|
|
34
23
|
children,
|
|
35
24
|
isReverseMask && React.createElement(StyledRequired, null, "*")));
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
var _a;
|
|
6
2
|
// Libraries
|
|
7
3
|
import styled from 'styled-components';
|
|
8
4
|
// Constants
|
|
9
5
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
6
|
+
export const RequiredLabelWrapper = styled.div ``;
|
|
7
|
+
export const StyledRequired = styled.span `
|
|
8
|
+
color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.red6};
|
|
9
|
+
margin-right: 4px;
|
|
10
|
+
`;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
2
|
var t = {};
|
|
18
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -30,11 +15,11 @@ import React, { useState, useEffect, useRef } from 'react';
|
|
|
30
15
|
import styled from 'styled-components';
|
|
31
16
|
// Constants
|
|
32
17
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
useEffect(
|
|
18
|
+
export const ScrollBox = props => {
|
|
19
|
+
const { children, height, maxHeight, isPadding, loadMore, style } = props, restOf = __rest(props, ["children", "height", "maxHeight", "isPadding", "loadMore", "style"]);
|
|
20
|
+
const wrapperRef = useRef(null);
|
|
21
|
+
const [isScroll, setIsScroll] = useState(false);
|
|
22
|
+
useEffect(() => {
|
|
38
23
|
if (wrapperRef.current && wrapperRef.current.scrollHeight > wrapperRef.current.clientHeight) {
|
|
39
24
|
!isScroll && setIsScroll(true);
|
|
40
25
|
}
|
|
@@ -43,8 +28,8 @@ export var ScrollBox = function (props) {
|
|
|
43
28
|
}
|
|
44
29
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
30
|
}, [wrapperRef.current]);
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
const handleScroll = e => {
|
|
32
|
+
const bottom = e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight;
|
|
48
33
|
if (bottom) {
|
|
49
34
|
if (typeof loadMore === 'function') {
|
|
50
35
|
loadMore();
|
|
@@ -53,10 +38,14 @@ export var ScrollBox = function (props) {
|
|
|
53
38
|
};
|
|
54
39
|
return (
|
|
55
40
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
56
|
-
React.createElement(Wrapper,
|
|
41
|
+
React.createElement(Wrapper, Object.assign({ ref: wrapperRef }, Object.assign(Object.assign({}, restOf), { style: Object.assign(Object.assign(Object.assign(Object.assign({}, style), (height && { height })), (maxHeight && { maxHeight })), { paddingRight: isScroll && isPadding ? 8 : 0 }) }), { onScroll: handleScroll }), children));
|
|
57
42
|
};
|
|
58
|
-
|
|
43
|
+
const Wrapper = styled.div `
|
|
44
|
+
height: 100%;
|
|
45
|
+
width: 100%;
|
|
46
|
+
background-color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw0};
|
|
47
|
+
overflow: auto;
|
|
48
|
+
`;
|
|
59
49
|
ScrollBox.defaultProps = {
|
|
60
50
|
isPadding: false,
|
|
61
51
|
};
|
|
62
|
-
var templateObject_1;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Segmented as AntdSegmented } from 'antd';
|
|
2
|
-
export
|
|
2
|
+
export const Segmented = AntdSegmented;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Skeleton as AntdSkeleton } from 'antd';
|
|
2
|
-
export
|
|
2
|
+
export const Skeleton = AntdSkeleton;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
// Libraries
|
|
13
2
|
import React, { memo, useMemo } from 'react';
|
|
14
3
|
// Antd Components
|
|
@@ -16,19 +5,19 @@ import { Slider as AntdSlider } from 'antd';
|
|
|
16
5
|
// Styled
|
|
17
6
|
import { SliderWrapper } from './styled';
|
|
18
7
|
import { omit } from 'lodash';
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
export const Slider = memo(props => {
|
|
9
|
+
const { range, value, min = 0, max = 0, className, tooltipVisible } = props;
|
|
10
|
+
const isNegative = useMemo(() => !!(!range && min < 0), [range, min]);
|
|
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;
|
|
24
13
|
if (isNegative) {
|
|
25
14
|
return (React.createElement(SliderWrapper, { isNegative: true, width: calculateWidth, className: className },
|
|
26
|
-
React.createElement(AntdSlider,
|
|
15
|
+
React.createElement(AntdSlider, Object.assign({}, omit(restProps, ['marks', 'className']), { marks: {
|
|
27
16
|
0: ' ',
|
|
28
17
|
} }))));
|
|
29
18
|
}
|
|
30
19
|
return (React.createElement(SliderWrapper, { className: className },
|
|
31
|
-
React.createElement(AntdSlider,
|
|
20
|
+
React.createElement(AntdSlider, Object.assign({}, restProps))));
|
|
32
21
|
});
|
|
33
22
|
Slider.defaultProps = {
|
|
34
23
|
tooltipVisible: false,
|
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
// Libraries
|
|
6
2
|
import styled, { css } from 'styled-components';
|
|
7
3
|
// Constants
|
|
8
4
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
-
export
|
|
5
|
+
export const SliderWrapper = styled.div `
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
.antsomi-slider {
|
|
9
|
+
${p => {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
|
|
11
|
+
const width = p.width || 0;
|
|
12
12
|
return p.isNegative
|
|
13
|
-
? css
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
? css `
|
|
14
|
+
.antsomi-slider-handle-1 {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.antsomi-slider-track {
|
|
19
|
+
${width < 0
|
|
20
|
+
? css `
|
|
21
|
+
left: auto !important;
|
|
22
|
+
right: 50% !important;
|
|
23
|
+
`
|
|
24
|
+
: css `
|
|
25
|
+
left: 50% !important;
|
|
26
|
+
right: auto !important;
|
|
27
|
+
`}
|
|
28
|
+
|
|
29
|
+
width: ${Math.abs(width)}% !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.antsomi-slider-dot {
|
|
33
|
+
top: -4px;
|
|
34
|
+
width: 0.25rem;
|
|
35
|
+
height: 0.875rem;
|
|
36
|
+
border-radius: 0.125rem;
|
|
37
|
+
background-color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.accent1};
|
|
38
|
+
border-color: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.accent1};
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
: '';
|
|
42
|
+
}}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -1,32 +1,21 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
// Libraries
|
|
13
2
|
import React, { useState } from 'react';
|
|
14
3
|
// Antd Components
|
|
15
4
|
import { Slider as AntdSlider } from 'antd';
|
|
16
5
|
// React.FC<SliderProps>
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
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);
|
|
20
9
|
if (min && max && min < 0 && max > 0 && !range && !defaultSliderTrack) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return (React.createElement(AntdSlider,
|
|
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 => {
|
|
26
15
|
setValueInternal(value);
|
|
27
16
|
if (onChange)
|
|
28
17
|
onChange(value);
|
|
29
|
-
}, styles:
|
|
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)));
|
|
30
19
|
}
|
|
31
|
-
return React.createElement(AntdSlider,
|
|
20
|
+
return React.createElement(AntdSlider, Object.assign({}, props));
|
|
32
21
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import styled from 'styled-components';
|
|
6
2
|
// Components
|
|
7
3
|
import { Space as AntdSpace } from 'antd';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export const OriginSpace = styled(AntdSpace) `
|
|
5
|
+
&.antsomi-space-vertical {
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
export const Space = OriginSpace;
|
|
@@ -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
|
};
|