@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.
- package/dist/index.js +1 -1
- package/dist/main.css +1 -101
- package/es/assets/css/main.scss +0 -4
- package/es/components/atoms/Slider/index.d.ts +1 -2
- package/es/components/atoms/Slider/index.js +16 -9
- package/es/components/atoms/Spin/Spin.d.ts +1 -2
- package/es/components/atoms/index.d.ts +0 -2
- package/es/components/atoms/index.js +0 -2
- package/es/components/common/ConfigProvider/ConfigProvider.d.ts +0 -1
- package/es/components/common/ConfigProvider/ConfigProvider.js +0 -1
- package/es/components/icons/ArrowGrowIcon.d.ts +1 -2
- package/es/components/icons/AudioRecordIcon.d.ts +1 -2
- package/es/components/icons/BugIcon.d.ts +1 -2
- package/es/components/icons/CameraIcon.d.ts +1 -2
- package/es/components/icons/CaptureIcon.d.ts +1 -2
- package/es/components/icons/CheckSlimIcon.d.ts +1 -2
- package/es/components/icons/CloseIcon.d.ts +1 -2
- package/es/components/icons/CommentIcon.d.ts +1 -2
- package/es/components/icons/EventIcon.d.ts +1 -2
- package/es/components/icons/FreeDrawIcon.d.ts +1 -2
- package/es/components/icons/GPTIcon.d.ts +1 -2
- package/es/components/icons/GPTIconV2.d.ts +1 -2
- package/es/components/icons/GPTIconV3.d.ts +1 -2
- package/es/components/icons/HighlightIcon.d.ts +1 -2
- package/es/components/icons/IdeaIcon.d.ts +1 -2
- package/es/components/icons/InvisibleIcon.d.ts +1 -2
- package/es/components/icons/MuteIcon.d.ts +1 -2
- package/es/components/icons/OpenUrlIcon.d.ts +1 -2
- package/es/components/icons/PauseIcon.d.ts +1 -2
- package/es/components/icons/PlaneIcon.d.ts +1 -2
- package/es/components/icons/RequestIcon.d.ts +1 -2
- package/es/components/icons/StopRecordIcon.d.ts +1 -2
- package/es/components/icons/UserIcon.d.ts +1 -2
- package/es/components/icons/VerticalDotsIcon.d.ts +1 -2
- package/es/components/icons/WarningIcon.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +1 -2
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +18 -9
- package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +1 -5
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +3 -14
- package/es/components/molecules/ColorPicker/index.js +3 -3
- package/es/components/molecules/ColorSetting/index.js +3 -3
- package/es/components/molecules/GradientSetting/index.d.ts +2 -19
- package/es/components/molecules/GradientSetting/index.js +30 -52
- package/es/components/molecules/InputNumber/index.js +2 -2
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/Select/Test.d.ts +1 -2
- package/es/components/molecules/SettingWrapper/index.d.ts +2 -1
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +1 -2
- package/es/components/molecules/index.d.ts +0 -7
- package/es/components/molecules/index.js +0 -6
- package/es/constants/storybook.d.ts +1 -2
- package/es/test.d.ts +1 -2
- package/es/test.js +39 -26
- package/package.json +1 -1
- package/es/components/atoms/Popover/styled.d.ts +0 -4
- package/es/components/atoms/Popover/styled.js +0 -5
- package/es/components/atoms/SliderV2/index.d.ts +0 -5
- package/es/components/atoms/SliderV2/index.js +0 -23
- package/es/components/molecules/FontFamilySelect/constants.d.ts +0 -307
- package/es/components/molecules/FontFamilySelect/constants.js +0 -257
- package/es/components/molecules/FontFamilySelect/index.d.ts +0 -17
- package/es/components/molecules/FontFamilySelect/index.js +0 -53
- package/es/components/molecules/FontSetting/constants.d.ts +0 -3
- package/es/components/molecules/FontSetting/constants.js +0 -22
- package/es/components/molecules/FontSetting/index.d.ts +0 -24
- package/es/components/molecules/FontSetting/index.js +0 -54
- package/es/components/molecules/FontSetting/types.d.ts +0 -22
- package/es/components/molecules/FontSetting/types.js +0 -1
- package/es/components/molecules/FontWeightSelect/constants.d.ts +0 -28
- package/es/components/molecules/FontWeightSelect/constants.js +0 -11
- package/es/components/molecules/FontWeightSelect/index.d.ts +0 -9
- package/es/components/molecules/FontWeightSelect/index.js +0 -39
- package/es/components/molecules/GradientSetting/styled.d.ts +0 -1
- package/es/components/molecules/GradientSetting/styled.js +0 -59
- package/es/components/molecules/SettingWrapperPopover/index.d.ts +0 -16
- package/es/components/molecules/SettingWrapperPopover/index.js +0 -17
- package/es/components/molecules/TextDecorationSelect/constants.d.ts +0 -19
- package/es/components/molecules/TextDecorationSelect/constants.js +0 -26
- package/es/components/molecules/TextDecorationSelect/index.d.ts +0 -15
- package/es/components/molecules/TextDecorationSelect/index.js +0 -45
- package/es/components/molecules/TextTransformSelect/constants.d.ts +0 -13
- package/es/components/molecules/TextTransformSelect/constants.js +0 -19
- package/es/components/molecules/TextTransformSelect/index.d.ts +0 -9
- 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 =
|
|
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)))
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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(
|
|
58
|
-
React.createElement(SettingWrapper, { className: "
|
|
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: "
|
|
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: "
|
|
66
|
-
React.createElement(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
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",
|
|
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) =>
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
|
|
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) =>
|
|
10
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element;
|
|
11
11
|
};
|
|
@@ -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) =>
|
|
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: () =>
|
|
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
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
4
|
import '@antscorp/icons/main.css';
|
|
5
|
-
import { ConfigProvider, EdgeSetting,
|
|
6
|
-
//
|
|
7
|
-
|
|
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(
|
|
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 (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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,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,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
|
-
};
|