@antscorp/antsomi-ui 1.3.3-beta.9 → 1.3.4

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 (87) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/main.css +1 -101
  3. package/es/assets/css/main.scss +0 -4
  4. package/es/components/atoms/Slider/index.d.ts +1 -2
  5. package/es/components/atoms/Slider/index.js +16 -9
  6. package/es/components/atoms/Spin/Spin.d.ts +1 -2
  7. package/es/components/atoms/index.d.ts +0 -2
  8. package/es/components/atoms/index.js +0 -2
  9. package/es/components/common/ConfigProvider/ConfigProvider.d.ts +0 -1
  10. package/es/components/common/ConfigProvider/ConfigProvider.js +0 -1
  11. package/es/components/icons/ArrowGrowIcon.d.ts +1 -2
  12. package/es/components/icons/AudioRecordIcon.d.ts +1 -2
  13. package/es/components/icons/BugIcon.d.ts +1 -2
  14. package/es/components/icons/CameraIcon.d.ts +1 -2
  15. package/es/components/icons/CaptureIcon.d.ts +1 -2
  16. package/es/components/icons/CheckSlimIcon.d.ts +1 -2
  17. package/es/components/icons/CloseIcon.d.ts +1 -2
  18. package/es/components/icons/CommentIcon.d.ts +1 -2
  19. package/es/components/icons/EventIcon.d.ts +1 -2
  20. package/es/components/icons/FreeDrawIcon.d.ts +1 -2
  21. package/es/components/icons/GPTIcon.d.ts +1 -2
  22. package/es/components/icons/GPTIconV2.d.ts +1 -2
  23. package/es/components/icons/GPTIconV3.d.ts +1 -2
  24. package/es/components/icons/HighlightIcon.d.ts +1 -2
  25. package/es/components/icons/IdeaIcon.d.ts +1 -2
  26. package/es/components/icons/InvisibleIcon.d.ts +1 -2
  27. package/es/components/icons/MuteIcon.d.ts +1 -2
  28. package/es/components/icons/OpenUrlIcon.d.ts +1 -2
  29. package/es/components/icons/PauseIcon.d.ts +1 -2
  30. package/es/components/icons/PlaneIcon.d.ts +1 -2
  31. package/es/components/icons/RequestIcon.d.ts +1 -2
  32. package/es/components/icons/StopRecordIcon.d.ts +1 -2
  33. package/es/components/icons/UserIcon.d.ts +1 -2
  34. package/es/components/icons/VerticalDotsIcon.d.ts +1 -2
  35. package/es/components/icons/WarningIcon.d.ts +1 -2
  36. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +1 -2
  37. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +1 -2
  38. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +1 -2
  39. package/es/components/molecules/ColorPicker/CustomPicker/index.js +18 -9
  40. package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +1 -5
  41. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +3 -14
  42. package/es/components/molecules/ColorPicker/index.js +3 -3
  43. package/es/components/molecules/ColorSetting/index.js +3 -3
  44. package/es/components/molecules/GradientSetting/index.d.ts +2 -19
  45. package/es/components/molecules/GradientSetting/index.js +30 -52
  46. package/es/components/molecules/InputNumber/index.js +2 -2
  47. package/es/components/molecules/Modal/styled.d.ts +1 -1
  48. package/es/components/molecules/Select/Test.d.ts +1 -2
  49. package/es/components/molecules/SettingWrapper/index.d.ts +2 -1
  50. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
  51. package/es/components/molecules/UploadImage/MediaIcon.d.ts +1 -2
  52. package/es/components/molecules/index.d.ts +0 -7
  53. package/es/components/molecules/index.js +0 -6
  54. package/es/constants/storybook.d.ts +1 -2
  55. package/es/test.d.ts +1 -2
  56. package/es/test.js +39 -26
  57. package/package.json +1 -1
  58. package/es/components/atoms/Popover/styled.d.ts +0 -4
  59. package/es/components/atoms/Popover/styled.js +0 -5
  60. package/es/components/atoms/SliderV2/index.d.ts +0 -5
  61. package/es/components/atoms/SliderV2/index.js +0 -23
  62. package/es/components/molecules/FontFamilySelect/constants.d.ts +0 -307
  63. package/es/components/molecules/FontFamilySelect/constants.js +0 -257
  64. package/es/components/molecules/FontFamilySelect/index.d.ts +0 -17
  65. package/es/components/molecules/FontFamilySelect/index.js +0 -53
  66. package/es/components/molecules/FontSetting/constants.d.ts +0 -3
  67. package/es/components/molecules/FontSetting/constants.js +0 -22
  68. package/es/components/molecules/FontSetting/index.d.ts +0 -24
  69. package/es/components/molecules/FontSetting/index.js +0 -54
  70. package/es/components/molecules/FontSetting/types.d.ts +0 -22
  71. package/es/components/molecules/FontSetting/types.js +0 -1
  72. package/es/components/molecules/FontWeightSelect/constants.d.ts +0 -28
  73. package/es/components/molecules/FontWeightSelect/constants.js +0 -11
  74. package/es/components/molecules/FontWeightSelect/index.d.ts +0 -9
  75. package/es/components/molecules/FontWeightSelect/index.js +0 -39
  76. package/es/components/molecules/GradientSetting/styled.d.ts +0 -1
  77. package/es/components/molecules/GradientSetting/styled.js +0 -59
  78. package/es/components/molecules/SettingWrapperPopover/index.d.ts +0 -16
  79. package/es/components/molecules/SettingWrapperPopover/index.js +0 -17
  80. package/es/components/molecules/TextDecorationSelect/constants.d.ts +0 -19
  81. package/es/components/molecules/TextDecorationSelect/constants.js +0 -26
  82. package/es/components/molecules/TextDecorationSelect/index.d.ts +0 -15
  83. package/es/components/molecules/TextDecorationSelect/index.js +0 -45
  84. package/es/components/molecules/TextTransformSelect/constants.d.ts +0 -13
  85. package/es/components/molecules/TextTransformSelect/constants.js +0 -19
  86. package/es/components/molecules/TextTransformSelect/index.d.ts +0 -9
  87. package/es/components/molecules/TextTransformSelect/index.js +0 -39
@@ -73,7 +73,7 @@ export const ColorSetting = props => {
73
73
  });
74
74
  }
75
75
  };
76
- const presetColors = customColors ? (React.createElement("div", null,
76
+ const presetColors = (React.createElement("div", null,
77
77
  React.createElement("div", { style: stylingCenter },
78
78
  React.createElement(Text, null, "Color Profile"),
79
79
  !isHideBtnEdit && (React.createElement(Button, { type: "primary", onClick: onClickEdit }, "Edit"))),
@@ -83,14 +83,14 @@ export const ColorSetting = props => {
83
83
  customColors && customColors.length
84
84
  ? customColors.map((customColor, idx) => (React.createElement(PresetColor, { key: idx, color: customColor, onClick: () => onClickPresetColor(customColor) },
85
85
  React.createElement("div", { className: "__color", style: { backgroundColor: customColor } }))))
86
- : null))) : null;
86
+ : null)));
87
87
  return (React.createElement(SettingWrapper, { label: label, className: className, labelClassName: labelClassName, labelStyle: labelStyling, vertical: vertical },
88
88
  React.createElement(ColorPicker, Object.assign({}, restOf, { color: color, presetColors: presetColors, onChange: onChange }))));
89
89
  };
90
90
  ColorSetting.defaultProps = {
91
91
  label: '',
92
92
  labelClassName: '',
93
- // customColors: [],
93
+ customColors: [],
94
94
  isHideBtnEdit: true,
95
95
  callback: () => { },
96
96
  onChange: () => { },
@@ -5,32 +5,15 @@ interface GradientColor {
5
5
  gradientColorLocation: number;
6
6
  }
7
7
  type PositionValue = (typeof POSITION)[keyof typeof POSITION]['value'];
8
- export interface GradientConfig {
8
+ interface GradientConfig {
9
9
  gradients: GradientColor[];
10
10
  gradientType: 'linear-gradient' | 'radial-gradient';
11
11
  radialPosition: PositionValue;
12
12
  linearAngle: number;
13
13
  }
14
- interface GradientSettingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
14
+ interface GradientSettingProps {
15
15
  onChange?: (gradientConfig: GradientConfig) => void;
16
- /** Return full background css with gradient color
17
- * * @example
18
- * ```
19
- * getCSSProperty={value => {
20
- * // format of value is something like that: linear-gradient(90deg, rgb(209, 26, 102) 0%, rgb(255, 189, 100) 50%)
21
- * setBackgroundProperty(value)
22
- * }}
23
- * ```
24
- */
25
- getCSSProperty?: (value: string) => void;
26
16
  defaultValue?: GradientConfig;
27
- /** Use to store color settings, if customColors undefine => hide preset colors
28
- * @example
29
- * ```
30
- * customColors={['#646EFFDB', '#D11AB2']}
31
- * ```
32
- */
33
- customColors?: string[];
34
17
  }
35
18
  export declare const GradientSetting: React.FC<GradientSettingProps>;
36
19
  export {};
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  // Libraries
13
2
  import React, { useEffect, useState } from 'react';
14
3
  // Components
@@ -22,15 +11,13 @@ import { cloneDeep } from 'lodash';
22
11
  import { GRADIENT_TYPE, POSITION } from '@antscorp/antsomi-ui/es/constants';
23
12
  import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
24
13
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
25
- import { GradientSettingWrapper } from './styled';
26
14
  const GRADIENT_MIN = 2;
27
15
  const GRADIENT_MAX = 5;
28
16
  const DEFAULT_GRADIENTS = [
29
17
  { gradientColor: '#D11A66', gradientColorLocation: 0 },
30
18
  { gradientColor: '#FFBD64', gradientColorLocation: 50 },
31
19
  ];
32
- export const GradientSetting = props => {
33
- const { defaultValue, customColors, className, onChange, getCSSProperty } = props, rest = __rest(props, ["defaultValue", "customColors", "className", "onChange", "getCSSProperty"]);
20
+ export const GradientSetting = ({ onChange, defaultValue }) => {
34
21
  const { gradientType: defaultGradientType, gradients: defaultGradients, linearAngle: defaultLinearAngle, radialPosition: defaultRadialPosition, } = defaultValue || {};
35
22
  // const { t } = useTranslation();
36
23
  const { t } = i18nInstance;
@@ -39,49 +26,40 @@ export const GradientSetting = props => {
39
26
  const [radialPosition, setRadialPosition] = useState(defaultRadialPosition || 'center center');
40
27
  const [linearAngle, setLinearAngle] = useState(defaultLinearAngle || 90);
41
28
  useEffect(() => {
42
- if (onChange) {
43
- onChange({ gradients, gradientType, radialPosition, linearAngle });
44
- }
45
- if (getCSSProperty) {
46
- const prefixGradient = gradientType === 'linear-gradient'
47
- ? `${linearAngle}deg`
48
- : radialPosition !== 'center center'
49
- ? `circle at ${radialPosition}`
50
- : 'circle';
51
- const gradientColor = gradients === null || gradients === void 0 ? void 0 : gradients.map(item => `${item.gradientColor} ${item.gradientColorLocation}%`).join(', ');
52
- const gradientConfig = `${gradientType}(${prefixGradient}, ${gradientColor})`;
53
- getCSSProperty(gradientConfig);
54
- }
29
+ onChange && onChange({ gradients, gradientType, radialPosition, linearAngle });
55
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
56
31
  }, [JSON.stringify(gradients), gradientType, radialPosition, linearAngle]);
57
- return (React.createElement(GradientSettingWrapper, Object.assign({ className: className || '' }, rest),
58
- React.createElement(SettingWrapper, { className: "setting-container", label: t(translations.gradientStyle) },
59
- React.createElement(Select, { options: Object.values(GRADIENT_TYPE), value: gradientType, onChange: value => setGradientType(value) })),
60
- gradientType === GRADIENT_TYPE.LINEAR.value ? (React.createElement(SliderWithInputNumber, { className: "setting-container", label: t(translations.angle), min: 0, max: 360, value: linearAngle, onAfterChange: value => setLinearAngle(value) })) : (React.createElement(SettingWrapper, { className: "setting-container", label: t(translations.position) },
61
- React.createElement(Select, { options: Object.values(POSITION), value: radialPosition, onChange: value => setRadialPosition(value) }))),
32
+ return (React.createElement(React.Fragment, null,
33
+ React.createElement(SettingWrapper, { className: "ants-mb-[15px]", label: t(translations.gradientStyle) },
34
+ React.createElement(Select, { className: "ants-w-[112px]", options: Object.values(GRADIENT_TYPE), value: gradientType, onChange: value => setGradientType(value) })),
35
+ gradientType === GRADIENT_TYPE.LINEAR.value ? (React.createElement(SliderWithInputNumber, { className: "ants-mb-[15px]", label: t(translations.angle), min: 0, max: 360, value: linearAngle, onAfterChange: value => setLinearAngle(value) })) : (React.createElement(SettingWrapper, { className: "ants-mb-[15px]", label: t(translations.position) },
36
+ React.createElement(Select, { className: "ants-w-[112px]", options: Object.values(POSITION), value: radialPosition, onChange: value => setRadialPosition(value) }))),
62
37
  Array.isArray(gradients) && gradients.length
63
38
  ? gradients.map((gradient, index) => {
64
39
  const { gradientColor, gradientColorLocation } = gradient;
65
- return (React.createElement("div", { className: "color-setting__controller", key: index },
66
- React.createElement(ColorSetting, { labelClassName: "color-picker__label", label: t(translations.gradientColor, {
67
- name: t(translations.ordinalText[mapNumberToOrdinalText(index + 1)]),
68
- }), color: gradientColor, positionInput: "right", onChange: color => {
69
- setGradients(prev => {
70
- const clonePrev = cloneDeep(prev);
71
- clonePrev[index].gradientColor = color;
72
- return clonePrev;
73
- });
74
- }, customColors: customColors }),
75
- React.createElement(SliderWithInputNumber, { label: t(translations.gradientLocation, {
76
- name: t(translations.ordinalText[mapNumberToOrdinalText(index + 1)]),
77
- }), min: 0, max: 100, value: gradientColorLocation, onAfterChange: color => {
78
- setGradients(prev => {
79
- const clonePrev = cloneDeep(prev);
80
- clonePrev[index].gradientColorLocation = color;
81
- return clonePrev;
82
- });
83
- } }),
84
- (gradients === null || gradients === void 0 ? void 0 : gradients.length) > GRADIENT_MIN && (React.createElement(Icon, { type: "icon-ants-outline-delete", onClick: () => {
40
+ return (React.createElement("div", { className: "ants-flex ants-gap-x-2 ants-mb-[15px]", key: index },
41
+ React.createElement("div", { className: "ants-grid md:ants-grid-cols-5 ants-grid-cols-1 ants-gap-y-5" },
42
+ React.createElement("div", { className: "ants-col-span-2" },
43
+ React.createElement(ColorSetting, { labelClassName: "!ants-text-cus-base", label: t(translations.gradientColor, {
44
+ name: t(translations.ordinalText[mapNumberToOrdinalText(index + 1)]),
45
+ }), color: gradientColor, positionInput: "right", onChange: color => {
46
+ setGradients(prev => {
47
+ const clonePrev = cloneDeep(prev);
48
+ clonePrev[index].gradientColor = color;
49
+ return clonePrev;
50
+ });
51
+ } })),
52
+ React.createElement("div", { className: "ants-col-span-3" },
53
+ React.createElement(SliderWithInputNumber, { label: t(translations.gradientLocation, {
54
+ name: t(translations.ordinalText[mapNumberToOrdinalText(index + 1)]),
55
+ }), min: 0, max: 100, value: gradientColorLocation, onAfterChange: color => {
56
+ setGradients(prev => {
57
+ const clonePrev = cloneDeep(prev);
58
+ clonePrev[index].gradientColorLocation = color;
59
+ return clonePrev;
60
+ });
61
+ } }))),
62
+ (gradients === null || gradients === void 0 ? void 0 : gradients.length) > GRADIENT_MIN && (React.createElement(Icon, { type: "icon-ants-outline-delete", className: "ants-text-primary ants-cursor-pointer", style: { alignSelf: 'flex-end', marginBottom: '10px', fontSize: '16px' }, onClick: () => {
85
63
  const clonePrev = cloneDeep(gradients);
86
64
  clonePrev.splice(index, 1);
87
65
  setGradients(clonePrev);
@@ -19,7 +19,7 @@ import { getPreventKeyboardAction } from '@antscorp/antsomi-ui/es/utils/web';
19
19
  import { handleError } from '@antscorp/antsomi-ui/es/utils';
20
20
  const PATH = '@antscorp/antsomi-ui/es/app/components/molecules/InputNumber/index.tsx';
21
21
  export const InputNumber = props => {
22
- const { label, required, focused, errorMsg, onChange, className } = props, restOf = __rest(props, ["label", "required", "focused", "errorMsg", "onChange", "className"]);
22
+ const { label, required, focused, errorMsg, onChange } = props, restOf = __rest(props, ["label", "required", "focused", "errorMsg", "onChange"]);
23
23
  const [isFocused, setFocused] = useState(false);
24
24
  const requiredMsg = useMemo(() => {
25
25
  let msg = '';
@@ -65,7 +65,7 @@ export const InputNumber = props => {
65
65
  if (props.disableUndo) {
66
66
  listDisableActions.push('undo');
67
67
  }
68
- return (React.createElement("div", { className: className },
68
+ return (React.createElement("div", null,
69
69
  label && renderRequiredLabel(label),
70
70
  React.createElement(AntdInputNumber, Object.assign({}, restOf, { className: "--show-handler", required: required, onChange: onChangeInputNumber, onBlur: e => {
71
71
  if (!focused) {
@@ -10,6 +10,6 @@ export declare const StyledModal: import("styled-components").StyledComponent<im
10
10
  useModal: typeof import("antd/es/modal/useModal").default;
11
11
  destroyAll: () => void;
12
12
  config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
13
- _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => import("react").JSX.Element;
13
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
14
14
  }, any, CustomModalProps, never>;
15
15
  export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
- declare const SelectTest: () => React.JSX.Element;
1
+ declare const SelectTest: () => JSX.Element;
3
2
  export default SelectTest;
@@ -1,5 +1,5 @@
1
1
  import React, { CSSProperties } from 'react';
2
- export interface SettingWrapperProps {
2
+ interface SettingWrapperProps {
3
3
  label: string;
4
4
  className?: string;
5
5
  labelColor?: string;
@@ -10,3 +10,4 @@ export interface SettingWrapperProps {
10
10
  children?: React.ReactNode;
11
11
  }
12
12
  export declare const SettingWrapper: React.FC<SettingWrapperProps>;
13
+ export {};
@@ -7,5 +7,5 @@ export declare const TreeSelect: (<ValueType = any, OptionType extends import("r
7
7
  SHOW_ALL: "SHOW_ALL";
8
8
  SHOW_PARENT: "SHOW_PARENT";
9
9
  SHOW_CHILD: "SHOW_CHILD";
10
- _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
10
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element;
11
11
  };
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
- declare const MediaIcon: (_props: any) => React.JSX.Element;
1
+ declare const MediaIcon: (_props: any) => JSX.Element;
3
2
  export default MediaIcon;
@@ -25,13 +25,6 @@ export { InputNumberWithUnit } from './InputNumberWithUnit';
25
25
  export { GradientSetting } from './GradientSetting';
26
26
  export { Collapse } from './Collapse';
27
27
  export { Drawer } from './Drawer';
28
- export { SettingWrapperPopover } from './SettingWrapperPopover';
29
- export { FontWeightSelect } from './FontWeightSelect';
30
- export { FontFamilySelect } from './FontFamilySelect';
31
- export { TextDecorationSelect } from './TextDecorationSelect';
32
- export { TextTransformSelect } from './TextTransformSelect';
33
- export { FontSetting, FontSettingEdit } from './FontSetting';
34
28
  export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
35
29
  export type { ColorPickerProps } from './ColorPicker';
36
30
  export type { AlignEditProps, AlignSettingProps } from './AlignSetting';
37
- export type { TFontSettingProps, TFontSettingEditProps } from './FontSetting';
@@ -25,9 +25,3 @@ export { InputNumberWithUnit } from './InputNumberWithUnit';
25
25
  export { GradientSetting } from './GradientSetting';
26
26
  export { Collapse } from './Collapse';
27
27
  export { Drawer } from './Drawer';
28
- export { SettingWrapperPopover } from './SettingWrapperPopover';
29
- export { FontWeightSelect } from './FontWeightSelect';
30
- export { FontFamilySelect } from './FontFamilySelect';
31
- export { TextDecorationSelect } from './TextDecorationSelect';
32
- export { TextTransformSelect } from './TextTransformSelect';
33
- export { FontSetting, FontSettingEdit } from './FontSetting';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const TABLE_API_COLUMNS: ({
3
2
  title: string;
4
3
  dataIndex: string;
@@ -8,5 +7,5 @@ export declare const TABLE_API_COLUMNS: ({
8
7
  title: string;
9
8
  dataIndex: string;
10
9
  key: string;
11
- render: (text: any) => React.JSX.Element;
10
+ render: (text: any) => JSX.Element;
12
11
  })[];
package/es/test.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import '@antscorp/icons/main.css';
3
2
  export declare const BACKGROUND_COLOR_STYLE: {
4
3
  SOLID: {
@@ -11,4 +10,4 @@ export declare const BACKGROUND_COLOR_STYLE: {
11
10
  };
12
11
  };
13
12
  export declare const customColors: string[];
14
- export declare const App: () => React.JSX.Element;
13
+ export declare const App: () => JSX.Element;
package/es/test.js CHANGED
@@ -1,13 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import React, { useState } from 'react';
3
- import { createRoot } from 'react-dom/client';
3
+ import ReactDOM from 'react-dom';
4
4
  import '@antscorp/icons/main.css';
5
- import { ConfigProvider, EdgeSetting, GradientSetting, IconSelection, PositionSetting, SettingWrapper,
6
- // Slider,
7
- SliderWithInputNumber, Space, UploadImage, } from './components';
8
- // import { Slider } from 'antd';
9
- import { Slider } from '@antscorp/antsomi-ui/es/components/atoms/Slider';
10
- import { Rate } from './components/atoms/Rate';
5
+ import { ColorSetting, ConfigProvider, EdgeSetting, IconSelection, InputNumberWithUnit, PositionSetting, RadioGroup, SettingWrapper, SliderWithInputNumber, Space, UploadImage, } from './components';
6
+ // Constants
7
+ import { THEME } from './constants';
11
8
  export const BACKGROUND_COLOR_STYLE = {
12
9
  SOLID: {
13
10
  value: 'color',
@@ -31,6 +28,7 @@ export const customColors = [
31
28
  '#57b8c2',
32
29
  ];
33
30
  export const App = () => {
31
+ var _a;
34
32
  const [state, setState] = useState({
35
33
  option: {
36
34
  dateType: 'today',
@@ -99,7 +97,15 @@ export const App = () => {
99
97
  React.createElement("h2", { style: { textAlign: 'center' } }, "Test component of media template"),
100
98
  React.createElement(Space, { size: 20, direction: "vertical" },
101
99
  React.createElement(SettingWrapper, { vertical: true, label: "Color Setting" },
102
- React.createElement(GradientSetting, null)),
100
+ React.createElement(ColorSetting, { label: "Background Color", labelStyling: { color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon }, color: colorSettingState.color, customColors: colorSettingState.customColors, callback: callbackColorSetting, onChange: handleChangeColorSetting })),
101
+ React.createElement(SettingWrapper, { vertical: true, label: "Input number with unit" },
102
+ React.createElement(InputNumberWithUnit, { unit: "px", min: 0, max: 2000, value: 700, onChange: value => {
103
+ console.log('onChange:: ', value);
104
+ }, onChangeUnit: unit => {
105
+ console.log('onChangeUnit:: ', unit);
106
+ } })),
107
+ React.createElement(SettingWrapper, { label: "Radio Group" },
108
+ React.createElement(RadioGroup, { options: Object.values(BACKGROUND_COLOR_STYLE), value: radioValue, onChange: e => handleChangeRadio(e) })),
103
109
  React.createElement(SliderWithInputNumber, { label: "Size (px)", labelStyling: { marginTop: 10 }, min: 0, max: 100, value: sliderValue, onAfterChange: handleChangeSlider }),
104
110
  React.createElement(EdgeSetting, { label: "Notification Spacing", unit: "px", linked: false, values: edge,
105
111
  // edgeLabels={[t(translations.column.title), t(translations.row.title)]}
@@ -134,22 +140,29 @@ export const App = () => {
134
140
  console.log('onChangeSvg', value);
135
141
  } }))))));
136
142
  // ------------------------ Media template components test end -------------------------
137
- return (React.createElement("div", { style: { width: '500px', margin: '32px' } },
138
- React.createElement(GradientSetting, { onChange: e => console.log('gradient change') }),
139
- React.createElement("br", null),
140
- React.createElement("br", null),
141
- React.createElement("br", null),
142
- React.createElement("br", null),
143
- React.createElement(Slider, { className: "test-classname", min: -10, max: 10, onChange: e => console.log('slider change', e) }),
144
- React.createElement("br", null),
145
- React.createElement("br", null),
146
- React.createElement(Rate, null),
147
- React.createElement("br", null),
148
- React.createElement("br", null),
149
- React.createElement(Slider, { className: "test-classname" })));
143
+ // return (
144
+ // <DatePicker.AdvancedRangePicker
145
+ // disabled
146
+ // showTime={false}
147
+ // timeRange={{
148
+ // startDate: {
149
+ // date: '',
150
+ // calculationDate: 'years',
151
+ // value: 1,
152
+ // calculationType: 'minus',
153
+ // dateType: 'today',
154
+ // },
155
+ // endDate: {
156
+ // date: '',
157
+ // calculationDate: 'days',
158
+ // value: 1,
159
+ // calculationType: 'minus',
160
+ // dateType: 'today',
161
+ // },
162
+ // }}
163
+ // />
164
+ // );
150
165
  };
151
- const container = document.getElementById('root');
152
- const root = createRoot(container);
153
- root.render(React.createElement(React.StrictMode, null,
154
- React.createElement(ConfigProvider, { locale: "en" },
155
- React.createElement(App, null))));
166
+ ReactDOM.render(React.createElement(React.StrictMode, null,
167
+ React.createElement(ConfigProvider, { locale: "vi" },
168
+ React.createElement(App, null))), document.getElementById('root'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.9",
3
+ "version": "1.3.4",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const PopoverWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").PopoverProps & import("react").RefAttributes<unknown>> & {
3
- _InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/popover/PurePanel").PurePanelProps>;
4
- }, any, {}, never>;
@@ -1,5 +0,0 @@
1
- // Libraries
2
- import styled from 'styled-components';
3
- // Components
4
- import { Popover as AntdPopover } from 'antd';
5
- export const PopoverWrapper = styled(AntdPopover) ``;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import type { SliderRangeProps, SliderSingleProps } from 'antd/es/slider';
3
- export interface SliderProps extends SliderSingleProps {
4
- }
5
- export declare const SliderV2: React.FC<SliderProps | SliderRangeProps>;
@@ -1,23 +0,0 @@
1
- // Libraries
2
- import React, { useState } from 'react';
3
- // Antd Components
4
- import { Slider as AntdSlider } from 'antd';
5
- // React.FC<SliderProps>
6
- export const SliderV2 = props => {
7
- const [value, setValue] = useState(0);
8
- // console.log('sliderRef:: ', sliderRef);
9
- // const min = props.min || 0;
10
- // const max = props.max || 100;
11
- const { min, max, onChange, styles, range } = props;
12
- if (min && max && min < 0 && max > 0 && !range) {
13
- const sliderWidth = max - min;
14
- const leftTrackPosition = `${(Math.abs(value > 0 ? min : min - value) / sliderWidth) * 100}%`;
15
- const sliderTrackWidth = `${(Math.abs(value) / sliderWidth) * 100}%`;
16
- return (React.createElement(AntdSlider, Object.assign({ value: value, onChange: value => {
17
- setValue(value);
18
- if (onChange)
19
- onChange(value);
20
- }, styles: Object.assign({ track: Object.assign({ left: leftTrackPosition, width: sliderTrackWidth }, styles === null || styles === void 0 ? void 0 : styles.track) }, styles), marks: { 0: ' ' } }, props)));
21
- }
22
- return React.createElement(AntdSlider, Object.assign({}, props));
23
- };