@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.
Files changed (293) hide show
  1. package/es/components/atoms/Alert/Alert.js +13 -6
  2. package/es/components/atoms/Button/index.js +1 -1
  3. package/es/components/atoms/Button/test.js +6 -6
  4. package/es/components/atoms/DividerPure/DividerPure.js +4 -15
  5. package/es/components/atoms/DividerPure/styled.js +36 -6
  6. package/es/components/atoms/Empty/Empty.js +1 -1
  7. package/es/components/atoms/FloatButton/index.js +1 -1
  8. package/es/components/atoms/Grid/Grid.js +2 -2
  9. package/es/components/atoms/Icon/index.js +28 -15
  10. package/es/components/atoms/Input/Input.js +21 -32
  11. package/es/components/atoms/Input/styled.js +102 -12
  12. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +13 -13
  13. package/es/components/atoms/InputDynamic/InputDynamic.d.ts +2 -1
  14. package/es/components/atoms/InputDynamic/InputDynamic.js +83 -97
  15. package/es/components/atoms/InputDynamic/PopupShortLink.js +20 -21
  16. package/es/components/atoms/InputDynamic/styled.d.ts +1 -1
  17. package/es/components/atoms/InputDynamic/styled.js +275 -13
  18. package/es/components/atoms/InputDynamic/utils.js +104 -114
  19. package/es/components/atoms/InputNumber/InputNumber.js +3 -14
  20. package/es/components/atoms/MobileFrame/MobileFrame.js +3 -14
  21. package/es/components/atoms/MobileFrame/constants.js +1 -1
  22. package/es/components/atoms/MobileFrame/styled.js +29 -8
  23. package/es/components/atoms/Pagination/Pagination.js +1 -1
  24. package/es/components/atoms/Popover/Popover.js +1 -1
  25. package/es/components/atoms/Popover/styled.js +1 -6
  26. package/es/components/atoms/PreviewTabs/PreviewTabs.js +20 -31
  27. package/es/components/atoms/PreviewTabs/styled.js +71 -10
  28. package/es/components/atoms/Progress/Progress.js +1 -1
  29. package/es/components/atoms/Radio/index.js +18 -8
  30. package/es/components/atoms/Rate/Rate.js +1 -1
  31. package/es/components/atoms/RateV2/RateV2.js +24 -30
  32. package/es/components/atoms/RequiredLabel/index.js +3 -14
  33. package/es/components/atoms/RequiredLabel/styled.js +5 -7
  34. package/es/components/atoms/ScrollBox/index.js +14 -25
  35. package/es/components/atoms/Segmented/Segmented.js +1 -1
  36. package/es/components/atoms/Skeleton/Skeleton.js +1 -1
  37. package/es/components/atoms/Slider/index.js +7 -18
  38. package/es/components/atoms/Slider/styled.js +38 -10
  39. package/es/components/atoms/SliderV2/index.js +10 -21
  40. package/es/components/atoms/Space/Space.js +6 -7
  41. package/es/components/atoms/Spin/Spin.d.ts +2 -1
  42. package/es/components/atoms/Spin/Spin.js +3 -14
  43. package/es/components/atoms/Spin/styled.d.ts +1 -1
  44. package/es/components/atoms/Spin/styled.js +3 -6
  45. package/es/components/atoms/Statistic/Statistic.js +1 -1
  46. package/es/components/atoms/Steps/Steps.js +1 -1
  47. package/es/components/atoms/Switch/Switch.js +1 -1
  48. package/es/components/atoms/Text/index.js +4 -15
  49. package/es/components/atoms/Text/styled.js +40 -11
  50. package/es/components/atoms/Timeline/Timeline.js +1 -1
  51. package/es/components/atoms/Watermark/Watermark.js +1 -1
  52. package/es/components/common/ConfigProvider/ConfigProvider.js +4 -15
  53. package/es/components/common/ConfigProvider/GlobalStyle.js +569 -8
  54. package/es/components/icons/AccountCircle.js +2 -13
  55. package/es/components/icons/AddShoppingCart.js +2 -13
  56. package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
  57. package/es/components/icons/ArrowGrowIcon.js +2 -13
  58. package/es/components/icons/AssignmentInd.js +2 -13
  59. package/es/components/icons/AudioRecordIcon.d.ts +2 -1
  60. package/es/components/icons/AudioRecordIcon.js +2 -13
  61. package/es/components/icons/BugIcon.d.ts +2 -1
  62. package/es/components/icons/BugIcon.js +2 -13
  63. package/es/components/icons/Call.js +2 -13
  64. package/es/components/icons/CameraIcon.d.ts +2 -1
  65. package/es/components/icons/CameraIcon.js +2 -13
  66. package/es/components/icons/CaptureIcon.d.ts +2 -1
  67. package/es/components/icons/CaptureIcon.js +2 -13
  68. package/es/components/icons/Category.js +2 -13
  69. package/es/components/icons/ChatBubbleOutline.js +2 -13
  70. package/es/components/icons/CheckSlimIcon.d.ts +2 -1
  71. package/es/components/icons/CheckSlimIcon.js +2 -13
  72. package/es/components/icons/CircleNotifications.js +2 -13
  73. package/es/components/icons/CloseIcon.d.ts +2 -1
  74. package/es/components/icons/CloseIcon.js +2 -13
  75. package/es/components/icons/CommentIcon.d.ts +2 -1
  76. package/es/components/icons/CommentIcon.js +2 -13
  77. package/es/components/icons/ConfirmationNumber.js +2 -13
  78. package/es/components/icons/DesktopWindows.js +2 -13
  79. package/es/components/icons/EventIcon.d.ts +2 -1
  80. package/es/components/icons/EventIcon.js +2 -13
  81. package/es/components/icons/FactCheck.js +2 -13
  82. package/es/components/icons/FreeDrawIcon.d.ts +2 -1
  83. package/es/components/icons/FreeDrawIcon.js +2 -13
  84. package/es/components/icons/GPTIcon.d.ts +2 -1
  85. package/es/components/icons/GPTIcon.js +2 -2
  86. package/es/components/icons/GPTIconV2.d.ts +2 -1
  87. package/es/components/icons/GPTIconV2.js +2 -2
  88. package/es/components/icons/GPTIconV3.d.ts +2 -1
  89. package/es/components/icons/GPTIconV3.js +2 -13
  90. package/es/components/icons/HighlightIcon.d.ts +2 -1
  91. package/es/components/icons/HighlightIcon.js +2 -13
  92. package/es/components/icons/HightlightAlt.js +2 -13
  93. package/es/components/icons/HowToReg.js +2 -13
  94. package/es/components/icons/IdeaIcon.d.ts +2 -1
  95. package/es/components/icons/IdeaIcon.js +2 -13
  96. package/es/components/icons/Interactive.js +2 -13
  97. package/es/components/icons/InvisibleIcon.d.ts +2 -1
  98. package/es/components/icons/InvisibleIcon.js +2 -13
  99. package/es/components/icons/List.js +2 -13
  100. package/es/components/icons/LocalMallIcon.js +2 -13
  101. package/es/components/icons/MobileFriendly.js +2 -13
  102. package/es/components/icons/MuteIcon.d.ts +2 -1
  103. package/es/components/icons/MuteIcon.js +2 -13
  104. package/es/components/icons/NotificationsActive.js +2 -13
  105. package/es/components/icons/OpenUrlIcon.d.ts +2 -1
  106. package/es/components/icons/OpenUrlIcon.js +2 -13
  107. package/es/components/icons/PauseIcon.d.ts +2 -1
  108. package/es/components/icons/PauseIcon.js +2 -13
  109. package/es/components/icons/Payment.js +2 -13
  110. package/es/components/icons/PersonAddDisabled.js +2 -13
  111. package/es/components/icons/PhoneCallback.js +2 -13
  112. package/es/components/icons/PlaneIcon.d.ts +2 -1
  113. package/es/components/icons/PlaneIcon.js +2 -13
  114. package/es/components/icons/Preview.js +2 -13
  115. package/es/components/icons/Redeem.js +2 -13
  116. package/es/components/icons/RemoveRedEye.js +2 -13
  117. package/es/components/icons/RemoveShoppingCart.js +2 -13
  118. package/es/components/icons/RequestIcon.d.ts +2 -1
  119. package/es/components/icons/RequestIcon.js +2 -13
  120. package/es/components/icons/Search.js +2 -13
  121. package/es/components/icons/ShoppingBag.js +2 -13
  122. package/es/components/icons/ShoppingCart.js +2 -13
  123. package/es/components/icons/StopRecordIcon.d.ts +2 -1
  124. package/es/components/icons/StopRecordIcon.js +2 -13
  125. package/es/components/icons/Store.js +2 -13
  126. package/es/components/icons/UserIcon.d.ts +2 -1
  127. package/es/components/icons/UserIcon.js +2 -13
  128. package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
  129. package/es/components/icons/VerticalDotsIcon.js +2 -13
  130. package/es/components/icons/WarningIcon.d.ts +2 -1
  131. package/es/components/icons/WarningIcon.js +2 -13
  132. package/es/components/icons/Web.js +2 -13
  133. package/es/components/icons/WebAsset.js +2 -13
  134. package/es/components/molecules/AlignSetting/index.js +9 -20
  135. package/es/components/molecules/AlignSetting/styled.js +5 -6
  136. package/es/components/molecules/AlignSetting/utils.js +2 -2
  137. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
  138. package/es/components/molecules/CaptureScreen/CaptureScreen.js +240 -269
  139. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
  140. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +25 -36
  141. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +129 -15
  142. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
  143. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +2 -2
  144. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +73 -10
  145. package/es/components/molecules/CaptureScreen/constants.js +7 -7
  146. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +1 -1
  147. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +23 -23
  148. package/es/components/molecules/CaptureScreen/styled.js +247 -28
  149. package/es/components/molecules/CaptureScreen/themes/black.js +1 -1
  150. package/es/components/molecules/CaptureScreen/themes/white.js +1 -1
  151. package/es/components/molecules/CaptureScreen/utils.js +29 -32
  152. package/es/components/molecules/Card/Card.js +1 -1
  153. package/es/components/molecules/ChatBox/ChatBox.js +81 -147
  154. package/es/components/molecules/ChatBox/MessageItem.js +20 -22
  155. package/es/components/molecules/ChatBox/constants.js +2 -2
  156. package/es/components/molecules/ChatBox/styled.js +275 -13
  157. package/es/components/molecules/Collapse/Collapse.js +3 -4
  158. package/es/components/molecules/ColorPicker/ChromePicker/index.js +1 -1
  159. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +11 -6
  160. package/es/components/molecules/ColorPicker/CustomPicker/index.js +21 -33
  161. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +95 -14
  162. package/es/components/molecules/ColorPicker/SketchPicker/index.js +1 -12
  163. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +6 -6
  164. package/es/components/molecules/ColorPicker/index.js +17 -17
  165. package/es/components/molecules/ColorPicker/styled.js +8 -6
  166. package/es/components/molecules/ColorSetting/index.js +15 -35
  167. package/es/components/molecules/ColorSetting/styled.js +36 -9
  168. package/es/components/molecules/DatePicker/DatePicker.js +1 -1
  169. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +112 -146
  170. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +10 -10
  171. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +45 -12
  172. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +3 -8
  173. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +9 -28
  174. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -1
  175. package/es/components/molecules/Drawer/Drawer.js +1 -1
  176. package/es/components/molecules/EdgeSetting/index.js +45 -69
  177. package/es/components/molecules/EdgeSetting/styled.js +13 -8
  178. package/es/components/molecules/FontFamilySelect/constants.js +1 -1
  179. package/es/components/molecules/FontFamilySelect/index.js +10 -33
  180. package/es/components/molecules/FontSetting/constants.js +2 -2
  181. package/es/components/molecules/FontSetting/index.js +22 -36
  182. package/es/components/molecules/FontWeightSelect/constants.js +1 -1
  183. package/es/components/molecules/FontWeightSelect/index.js +9 -32
  184. package/es/components/molecules/GradientSetting/index.js +35 -55
  185. package/es/components/molecules/GradientSetting/styled.js +58 -6
  186. package/es/components/molecules/IconSelection/components/Icon/index.js +8 -19
  187. package/es/components/molecules/IconSelection/constants.js +31 -37
  188. package/es/components/molecules/IconSelection/index.js +43 -56
  189. package/es/components/molecules/IconSelection/styled.js +74 -10
  190. package/es/components/molecules/IconSelection/types.js +1 -3
  191. package/es/components/molecules/IconSelection/utils.js +3 -3
  192. package/es/components/molecules/InputNumber/index.js +12 -23
  193. package/es/components/molecules/InputNumberWithUnit/index.js +5 -19
  194. package/es/components/molecules/InputNumberWithUnit/styled.js +15 -6
  195. package/es/components/molecules/InputSearch/index.js +3 -14
  196. package/es/components/molecules/InputSearch/styled.js +43 -6
  197. package/es/components/molecules/Modal/Modal.d.ts +2 -2
  198. package/es/components/molecules/Modal/Modal.js +8 -23
  199. package/es/components/molecules/Modal/styled.d.ts +1 -1
  200. package/es/components/molecules/Modal/styled.js +69 -17
  201. package/es/components/molecules/ModalV2/ModalV2.js +6 -17
  202. package/es/components/molecules/ModalV2/styled.d.ts +1 -1
  203. package/es/components/molecules/ModalV2/styled.js +19 -6
  204. package/es/components/molecules/Popconfirm/Popconfirm.js +1 -1
  205. package/es/components/molecules/PopupDraggable/PopupDraggable.js +13 -25
  206. package/es/components/molecules/PopupDraggable/styled.js +47 -11
  207. package/es/components/molecules/PreviewModal/PreviewModal.js +5 -16
  208. package/es/components/molecules/PreviewModal/styled.js +30 -9
  209. package/es/components/molecules/RadioGroup/index.js +3 -14
  210. package/es/components/molecules/RadioGroup/styled.js +11 -7
  211. package/es/components/molecules/ResizeGrid/ResizeGrid.js +275 -338
  212. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +23 -37
  213. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +78 -6
  214. package/es/components/molecules/ResizeGrid/constant.js +26 -37
  215. package/es/components/molecules/ResizeGrid/styled.js +54 -9
  216. package/es/components/molecules/Result/Result.js +1 -1
  217. package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +23 -34
  218. package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +11 -11
  219. package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +34 -18
  220. package/es/components/molecules/RichMenuBlock/constants.js +1 -1
  221. package/es/components/molecules/RichMenuBlock/styled.js +15 -16
  222. package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +6 -17
  223. package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +3 -3
  224. package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +43 -8
  225. package/es/components/molecules/RichMenuChatBar/styled.js +25 -10
  226. package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +7 -22
  227. package/es/components/molecules/RichMenuMobileView/styled.js +18 -11
  228. package/es/components/molecules/Select/Select.d.ts +4 -2
  229. package/es/components/molecules/Select/Select.js +9 -20
  230. package/es/components/molecules/Select/Test.d.ts +2 -1
  231. package/es/components/molecules/Select/Test.js +2 -2
  232. package/es/components/molecules/Select/styled.js +34 -7
  233. package/es/components/molecules/SettingWrapper/index.js +2 -2
  234. package/es/components/molecules/SettingWrapper/styled.js +15 -9
  235. package/es/components/molecules/SettingWrapperPopover/index.js +4 -16
  236. package/es/components/molecules/SliderWithInputNumber/index.js +8 -19
  237. package/es/components/molecules/SliderWithInputNumber/styled.js +3 -6
  238. package/es/components/molecules/TextDecorationSelect/constants.js +1 -1
  239. package/es/components/molecules/TextDecorationSelect/index.js +9 -32
  240. package/es/components/molecules/TextTransformSelect/constants.js +1 -1
  241. package/es/components/molecules/TextTransformSelect/index.js +9 -32
  242. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
  243. package/es/components/molecules/TreeSelect/TreeSelect.js +1 -1
  244. package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
  245. package/es/components/molecules/UploadImage/MediaIcon.js +2 -2
  246. package/es/components/molecules/UploadImage/index.js +182 -280
  247. package/es/components/molecules/UploadImage/styled.js +129 -16
  248. package/es/components/organism/Help/Help.js +422 -530
  249. package/es/components/organism/Help/constants.js +11 -12
  250. package/es/components/organism/Help/styled.d.ts +6 -2
  251. package/es/components/organism/Help/styled.js +257 -48
  252. package/es/components/organism/Help/utils.js +11 -11
  253. package/es/components/organism/PositionSetting/config.js +2 -2
  254. package/es/components/organism/PositionSetting/index.js +15 -27
  255. package/es/components/organism/PositionSetting/styled.js +1 -6
  256. package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +10 -10
  257. package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +6 -6
  258. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +12 -6
  259. package/es/components/organism/Table/CrossTabTable/constants.js +3 -3
  260. package/es/components/organism/Table/CrossTabTable/styled.js +12 -6
  261. package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
  262. package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +12 -23
  263. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +8 -8
  264. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +20 -8
  265. package/es/components/organism/Table/ExplorePivotTable/constants.js +2 -2
  266. package/es/components/organism/Table/ExplorePivotTable/styled.js +13 -7
  267. package/es/components/organism/Table/ExplorePivotTable/utils.js +52 -72
  268. package/es/constants/gradientSetting.js +4 -4
  269. package/es/constants/keyCode.js +387 -387
  270. package/es/constants/richMenu.js +2 -2
  271. package/es/constants/storybook.d.ts +2 -1
  272. package/es/constants/storybook.js +2 -2
  273. package/es/constants/theme.js +6 -6
  274. package/es/hooks/index.js +1 -1
  275. package/es/hooks/useDebounce.js +5 -5
  276. package/es/hooks/useDeepCompareEffect.js +1 -1
  277. package/es/locales/i18n.js +2 -2
  278. package/es/locales/translations.js +7 -23
  279. package/es/models/SavedImage.js +23 -68
  280. package/es/models/Upload.js +19 -64
  281. package/es/models/model.js +3 -5
  282. package/es/services/MediaTemplateDesign/UploadFile/index.js +46 -102
  283. package/es/services/Ticket.js +48 -89
  284. package/es/services/constants.js +3 -3
  285. package/es/services/index.js +19 -30
  286. package/es/test.d.ts +2 -1
  287. package/es/test.js +25 -36
  288. package/es/utils/color.js +22 -22
  289. package/es/utils/common.js +75 -88
  290. package/es/utils/handleError.js +8 -49
  291. package/es/utils/loadable.js +6 -18
  292. package/es/utils/web.js +20 -26
  293. 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
- var defaultProps = {
20
+ const defaultProps = {
32
21
  total: 20,
33
22
  current: 1,
34
23
  };
35
- var PATH = 'antsomi-ui/src/components/atoms/PreviewTabs/PreviewTabs.tsx';
36
- export var PreviewTabs = function (props) {
37
- var _a = props.total, total = _a === void 0 ? 20 : _a, _b = props.current, current = _b === void 0 ? 1 : _b, onChange = props.onChange, restProps = __rest(props, ["total", "current", "onChange"]);
38
- var tabsRef = React.useRef(null);
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
- var _c = useState({
29
+ const [state, setState] = useState({
41
30
  disablePrev: true,
42
31
  disableNext: true,
43
- }), state = _c[0], setState = _c[1];
32
+ });
44
33
  // Variables
45
- var disableNext = state.disableNext, disablePrev = state.disablePrev;
34
+ const { disableNext, disablePrev } = state;
46
35
  // Handlers
47
- var checkScroll = function () {
36
+ const checkScroll = () => {
48
37
  if (tabsRef.current) {
49
- var _a = tabsRef.current, scrollLeft_1 = _a.scrollLeft, clientWidth_1 = _a.clientWidth, scrollWidth_1 = _a.scrollWidth;
50
- setState(function (prevState) { return (__assign(__assign({}, prevState), { disableNext: scrollLeft_1 + clientWidth_1 === scrollWidth_1 })); });
51
- setState(function (prevState) { return (__assign(__assign({}, prevState), { disablePrev: scrollLeft_1 === 0 })); });
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(function () {
44
+ useEffect(() => {
56
45
  checkScroll();
57
46
  }, []);
58
47
  // Handlers
59
- var onClickNavigation = tryCatchWrapper(function (isPrev) {
48
+ const onClickNavigation = tryCatchWrapper((isPrev) => {
60
49
  if (tabsRef.current) {
61
- var scrollLeft = tabsRef.current.scrollLeft;
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, __assign({}, restProps),
55
+ return (React.createElement(StyledRichMenuTabs, Object.assign({}, restProps),
67
56
  React.createElement(NavigationButton, { className: cn('navigation--previous', {
68
57
  'navigation--disabled': disablePrev,
69
- }), onClick: function () { return onClickNavigation(true); } },
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: function () { return checkScroll(); } }, Array.from({ length: total }).map(function (_, index) { return (React.createElement(Flex, { key: "".concat(index + 1), align: "center", justify: "center", className: "tabs__item ".concat(current === index + 1 ? 'tabs__item--active' : ''), onClick: function () { return onChange && onChange(index + 1); } },
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: function () { return onClickNavigation(false); } },
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 var StyledRichMenuTabs = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n background: #f0f0f0;\n box-shadow: 0px 3px 3px 0px rgba(0, 46, 89, 0.1);\n height: 40px;\n width: ", "px;\n\n .tabs {\n flex: 1;\n width: 100%;\n overflow: auto;\n\n &__item {\n flex-shrink: 0;\n height: 40px;\n width: 40px;\n border-right: 1px solid #d4d4d4;\n cursor: pointer;\n transition: all 200ms;\n\n &--active {\n background-color: #fff;\n\n .tabs__label {\n background-color: var(--primary-color);\n color: #fff;\n }\n }\n }\n\n &__label {\n height: 24px;\n width: 24px;\n font-weight: 700;\n font-size: 14px;\n color: var(--primary-color);\n border-radius: 100%;\n border: 1px solid #b8cfe6;\n background-color: #fff;\n transition: all 200ms;\n }\n }\n"], ["\n display: flex;\n align-items: center;\n background: #f0f0f0;\n box-shadow: 0px 3px 3px 0px rgba(0, 46, 89, 0.1);\n height: 40px;\n width: ", "px;\n\n .tabs {\n flex: 1;\n width: 100%;\n overflow: auto;\n\n &__item {\n flex-shrink: 0;\n height: 40px;\n width: 40px;\n border-right: 1px solid #d4d4d4;\n cursor: pointer;\n transition: all 200ms;\n\n &--active {\n background-color: #fff;\n\n .tabs__label {\n background-color: var(--primary-color);\n color: #fff;\n }\n }\n }\n\n &__label {\n height: 24px;\n width: 24px;\n font-weight: 700;\n font-size: 14px;\n color: var(--primary-color);\n border-radius: 100%;\n border: 1px solid #b8cfe6;\n background-color: #fff;\n transition: all 200ms;\n }\n }\n"])), function (_a) {
10
- var width = _a.width;
11
- return width || 467;
12
- });
13
- export var NavigationButton = styled(Flex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 40px;\n height: 40px;\n background-color: #fff;\n cursor: pointer;\n\n i {\n font-size: 12px;\n color: #595959;\n }\n\n &.navigation--previous {\n border-right: 1px solid #d4d4d4;\n }\n\n &.navigation--next {\n border-left: 1px solid #d4d4d4;\n }\n\n &.navigation--disabled {\n cursor: not-allowed;\n\n i {\n color: #59595980;\n }\n }\n"], ["\n width: 40px;\n height: 40px;\n background-color: #fff;\n cursor: pointer;\n\n i {\n font-size: 12px;\n color: #595959;\n }\n\n &.navigation--previous {\n border-right: 1px solid #d4d4d4;\n }\n\n &.navigation--next {\n border-left: 1px solid #d4d4d4;\n }\n\n &.navigation--disabled {\n cursor: not-allowed;\n\n i {\n color: #59595980;\n }\n }\n"])));
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 var Progress = AntdProgress;
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 var Radio = styled(AntdRadio)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Roboto';\n color: ", ";\n font-size: ", "px;\n\n .antsomi-radio {\n .antsomi-radio-inner {\n border-width: 2px;\n border-color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n }\n"], ["\n font-family: 'Roboto';\n color: ", ";\n font-size: ", "px;\n\n .antsomi-radio {\n .antsomi-radio-inner {\n border-width: 2px;\n border-color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n }\n"])), (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorTextBase, (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.fontSize, (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorPrimary, (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.colorPrimary);
13
- export var RadioButton = styled(AntdRadio.Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
14
- export var RadioGroupSub = styled(AntdRadio.Group)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
15
- var templateObject_1, templateObject_2, templateObject_3;
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 var Rate = AntdRate;
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
- var STAR_WIDTH = 30;
4
- var parseNumDecimals = function (input, decimals) {
5
- return +Number.parseFloat(input === null || input === void 0 ? void 0 : input.toString()).toFixed(decimals);
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
- var getWidth = function (width, type) {
19
- if (type === void 0) { type = 'full'; }
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 var RateV2 = function (_a) {
28
- var _b = _a.count, count = _b === void 0 ? 5 : _b, className = _a.className, _c = _a.defaultValue, defaultValue = _c === void 0 ? 0 : _c, value = _a.value, _d = _a.type, type = _d === void 0 ? 'full' : _d, onChange = _a.onChange;
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
- var _e = useState(function () {
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
- var _f = useState(0), currWidth = _f[0], setCurrWidth = _f[1];
37
- var handleMouseMove = function (e) {
38
- var rect = e.currentTarget.getBoundingClientRect();
39
- var x = e.clientX - rect.left;
40
- var hoverWidth = Math.round(x);
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
- var handleClick = function () {
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(function () {
44
+ useEffect(() => {
51
45
  if (typeof value === 'number') {
52
- var width = getWidth(value * STAR_WIDTH, type);
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: "antsomi-rate-continuous".concat(className ? " ".concat(className) : ''), style: {
51
+ return (React.createElement("div", { className: `antsomi-rate-continuous${className ? ` ${className}` : ''}`, style: {
58
52
  position: 'relative',
59
- width: "".concat(fullWidth, "px"),
53
+ width: `${fullWidth}px`,
60
54
  backgroundPosition: '-27px',
61
55
  height: '28px',
62
- }, onMouseMove: handleMouseMove, onMouseLeave: function () { return setFillWidth(currWidth || 0); }, onClick: handleClick },
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: "url(".concat(StarImage, ") 0px 0px"),
66
- width: "".concat(fillWidth, "px"),
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: "transparent url(".concat(StarImage, ") 0px -26px"),
76
- width: "".concat(fullWidth, "px"),
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 var RequiredLabel = memo(function (props) {
18
+ export const RequiredLabel = memo(props => {
30
19
  // Props
31
- var children = props.children, _a = props.isReverseMask, isReverseMask = _a === void 0 ? false : _a, restProps = __rest(props, ["children", "isReverseMask"]);
32
- return (React.createElement(Text, __assign({}, restProps),
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 var RequiredLabelWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
11
- export var StyledRequired = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n margin-right: 4px;\n"], ["\n color: ", ";\n margin-right: 4px;\n"])), (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.red6);
12
- var templateObject_1, templateObject_2;
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 var ScrollBox = function (props) {
34
- var children = props.children, height = props.height, maxHeight = props.maxHeight, isPadding = props.isPadding, loadMore = props.loadMore, style = props.style, restOf = __rest(props, ["children", "height", "maxHeight", "isPadding", "loadMore", "style"]);
35
- var wrapperRef = useRef(null);
36
- var _a = useState(false), isScroll = _a[0], setIsScroll = _a[1];
37
- useEffect(function () {
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
- var handleScroll = function (e) {
47
- var bottom = e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight;
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, __assign({ ref: wrapperRef }, __assign(__assign({}, restOf), { style: __assign(__assign(__assign(__assign({}, style), (height && { height: height })), (maxHeight && { maxHeight: maxHeight })), { paddingRight: isScroll && isPadding ? 8 : 0 }) }), { onScroll: handleScroll }), children));
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
- var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n background-color: ", ";\n overflow: auto;\n"], ["\n height: 100%;\n width: 100%;\n background-color: ", ";\n overflow: auto;\n"])), (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw0);
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 var Segmented = AntdSegmented;
2
+ export const Segmented = AntdSegmented;
@@ -1,2 +1,2 @@
1
1
  import { Skeleton as AntdSkeleton } from 'antd';
2
- export var Skeleton = AntdSkeleton;
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 var Slider = memo(function (props) {
20
- var range = props.range, value = props.value, _a = props.min, min = _a === void 0 ? 0 : _a, _b = props.max, max = _b === void 0 ? 0 : _b, className = props.className, tooltipVisible = props.tooltipVisible;
21
- var isNegative = useMemo(function () { return !!(!range && min < 0); }, [range, min]);
22
- var calculateWidth = useMemo(function () { return ((value || 0) * 100) / (Math.abs(max) + Math.abs(min) || 1); }, [min, max, value]);
23
- var restProps = tooltipVisible === 'default' ? omit(props, ['tooltipVisible']) : props;
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, __assign({}, omit(restProps, ['marks', 'className']), { marks: {
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, __assign({}, restProps))));
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 var SliderWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n\n .antsomi-slider {\n ", "\n }\n"], ["\n width: 100%;\n\n .antsomi-slider {\n ", "\n }\n"])), function (p) {
5
+ export const SliderWrapper = styled.div `
6
+ width: 100%;
7
+
8
+ .antsomi-slider {
9
+ ${p => {
10
10
  var _a, _b;
11
- var width = p.width || 0;
11
+ const width = p.width || 0;
12
12
  return p.isNegative
13
- ? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n .antsomi-slider-handle-1 {\n display: none;\n }\n\n .antsomi-slider-track {\n ", "\n\n width: ", "% !important;\n }\n\n .antsomi-slider-dot {\n top: -4px;\n width: 0.25rem;\n height: 0.875rem;\n border-radius: 0.125rem;\n background-color: ", ";\n border-color: ", ";\n }\n "], ["\n .antsomi-slider-handle-1 {\n display: none;\n }\n\n .antsomi-slider-track {\n ", "\n\n width: ", "% !important;\n }\n\n .antsomi-slider-dot {\n top: -4px;\n width: 0.25rem;\n height: 0.875rem;\n border-radius: 0.125rem;\n background-color: ", ";\n border-color: ", ";\n }\n "])), width < 0
14
- ? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n left: auto !important;\n right: 50% !important;\n "], ["\n left: auto !important;\n right: 50% !important;\n "]))) : css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n left: 50% !important;\n right: auto !important;\n "], ["\n left: 50% !important;\n right: auto !important;\n "]))), Math.abs(width), (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.accent1, (_b = THEME.token) === null || _b === void 0 ? void 0 : _b.accent1) : '';
15
- });
16
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
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 var SliderV2 = function (props) {
18
- var min = props.min, max = props.max, onChange = props.onChange, styles = props.styles, range = props.range, value = props.value, defaultValue = props.defaultValue, marks = props.marks, defaultSliderTrack = props.defaultSliderTrack;
19
- var _a = useState(defaultValue || min || 0), valueInternal = _a[0], setValueInternal = _a[1];
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
- var sliderWidth = max - min;
22
- var calcValue = value || valueInternal;
23
- var leftTrackPosition = "".concat((Math.abs(calcValue > 0 ? min : min - calcValue) / sliderWidth) * 100, "%");
24
- var sliderTrackWidth = "".concat((Math.abs(calcValue) / sliderWidth) * 100, "%");
25
- return (React.createElement(AntdSlider, __assign({ value: value || valueInternal, onChange: function (value) {
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: __assign({ track: __assign({ left: leftTrackPosition, width: sliderTrackWidth }, styles === null || styles === void 0 ? void 0 : styles.track) }, styles), marks: marks || { 0: ' ' } }, props)));
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, __assign({}, props));
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 var OriginSpace = styled(AntdSpace)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.antsomi-space-vertical {\n width: 100%;\n }\n"], ["\n &.antsomi-space-vertical {\n width: 100%;\n }\n"])));
9
- export var Space = OriginSpace;
10
- var templateObject_1;
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
  };