@antscorp/antsomi-ui 1.3.3-beta.3 → 1.3.3-beta.30
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/public/icons/stars_slider.png +0 -0
- package/es/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Button/index.d.ts +1 -8
- package/es/components/atoms/Flex/Flex.d.ts +2 -0
- package/es/components/atoms/Flex/Flex.js +1 -0
- package/es/components/atoms/Flex/index.d.ts +1 -0
- package/es/components/atoms/Flex/index.js +1 -0
- package/es/components/atoms/Input/Input.d.ts +14 -3
- package/es/components/atoms/Input/Input.js +7 -3
- package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +29 -0
- package/es/components/atoms/InputDynamic/InputDynamic.js +320 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.js +98 -0
- package/es/components/atoms/InputDynamic/index.d.ts +2 -0
- package/es/components/atoms/InputDynamic/index.js +1 -0
- package/es/components/atoms/InputDynamic/styled.d.ts +12 -0
- package/es/components/atoms/InputDynamic/styled.js +279 -0
- package/es/components/atoms/InputDynamic/utils.d.ts +22 -0
- package/es/components/atoms/InputDynamic/utils.js +751 -0
- package/es/components/atoms/Pagination/index.d.ts +1 -0
- package/es/components/atoms/Popover/Popover.d.ts +1 -1
- package/es/components/atoms/Popover/styled.d.ts +1 -1
- package/es/components/atoms/Progress/Progress.d.ts +1 -1
- package/es/components/atoms/Radio/index.d.ts +3 -3
- package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
- package/es/components/atoms/RequiredLabel/index.js +4 -3
- package/es/components/atoms/Slider/index.d.ts +2 -1
- package/es/components/atoms/Slider/index.js +7 -14
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Space/Space.d.ts +1 -1
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/Statistic/Statistic.d.ts +1 -4
- package/es/components/atoms/index.d.ts +6 -0
- package/es/components/atoms/index.js +4 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +69 -2
- package/es/components/molecules/Collapse/Collapse.d.ts +3 -3
- package/es/components/molecules/Collapse/Collapse.js +9 -0
- package/es/components/molecules/ColorSetting/styled.d.ts +1 -8
- package/es/components/molecules/FontSetting/constants.d.ts +3 -0
- package/es/components/molecules/FontSetting/constants.js +22 -0
- package/es/components/molecules/FontSetting/index.d.ts +10 -4
- package/es/components/molecules/FontSetting/index.js +36 -35
- package/es/components/molecules/FontSetting/types.d.ts +1 -1
- package/es/components/molecules/Form/Form.d.ts +1 -0
- package/es/components/molecules/Form/Form.js +1 -0
- package/es/components/molecules/Form/index.d.ts +1 -0
- package/es/components/molecules/Form/index.js +1 -0
- package/es/components/molecules/IconSelection/styled.d.ts +1 -8
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/index.d.ts +1 -0
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
- package/es/components/molecules/ModalV2/ModalV2.js +26 -0
- package/es/components/molecules/ModalV2/index.d.ts +2 -0
- package/es/components/molecules/ModalV2/index.js +1 -0
- package/es/components/molecules/ModalV2/styled.d.ts +7 -0
- package/es/components/molecules/ModalV2/styled.js +22 -0
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
- package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
- package/es/components/molecules/PreviewModal/index.d.ts +2 -0
- package/es/components/molecules/PreviewModal/index.js +1 -0
- package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
- package/es/components/molecules/PreviewModal/styled.js +39 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +640 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +85 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
- package/es/components/molecules/ResizeGrid/constant.js +111 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
- package/es/components/molecules/ResizeGrid/styled.js +55 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +144 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/Select/Select.d.ts +6 -4
- package/es/components/molecules/Select/Select.js +23 -2
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +3 -4
- package/es/components/molecules/index.d.ts +6 -0
- package/es/components/molecules/index.js +4 -0
- package/es/components/organism/Help/styled.d.ts +6 -16
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +1 -0
- package/es/constants/theme.js +30 -3
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/locales/en/translation.json +2 -1
- package/es/locales/i18n.d.ts +2 -0
- package/es/locales/translations.d.ts +1 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/test.js +164 -66
- package/es/utils/common.d.ts +2 -0
- package/es/utils/common.js +16 -0
- package/package.json +8 -4
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const DropDown: import("styled-components").StyledComponent<import("react").FC<import("antd").DropDownProps> & {
|
|
3
|
+
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd").DropDownProps>;
|
|
4
|
+
} & {
|
|
3
5
|
Button: import("react").FC<import("antd/es/dropdown").DropdownButtonProps>;
|
|
4
|
-
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd").DropDownProps) => JSX.Element;
|
|
5
6
|
}, any, {}, never>;
|
|
6
|
-
export declare const ButtonFeedback: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
7
|
-
href: string;
|
|
8
|
-
target?: string | undefined;
|
|
9
|
-
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
10
|
-
} & import("antd/es/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "type" | "onClick"> & {
|
|
11
|
-
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
12
|
-
onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
13
|
-
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick">> & import("react").RefAttributes<HTMLElement>> & {
|
|
7
|
+
export declare const ButtonFeedback: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
|
|
14
8
|
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
15
9
|
}, any, {
|
|
16
10
|
height?: number | undefined;
|
|
@@ -21,7 +15,7 @@ export declare const Overlay: import("styled-components").StyledComponent<"div",
|
|
|
21
15
|
export declare const Text: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
22
16
|
export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
17
|
export declare const SendFeedback: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
|
-
export declare const ControlGroup: import("styled-components").StyledComponent<import("react").
|
|
18
|
+
export declare const ControlGroup: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").SpaceProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
25
19
|
Compact: import("react").FC<import("antd/es/space/Compact").SpaceCompactProps>;
|
|
26
20
|
}, any, {}, never>;
|
|
27
21
|
export declare const ControlLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
@@ -64,15 +58,11 @@ export declare const TitleSearch: import("styled-components").StyledComponent<"s
|
|
|
64
58
|
export declare const WrapperSearch: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/input").SearchProps & import("react").RefAttributes<import("antd").InputRef>>, any, {}, never>;
|
|
65
59
|
export declare const TreeContent: import("styled-components").StyledComponent<(<T extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd").TreeProps<T> & {
|
|
66
60
|
children?: import("react").ReactNode;
|
|
67
|
-
} & {
|
|
68
|
-
ref?: import("react").Ref<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>> | undefined;
|
|
69
|
-
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
61
|
+
} & import("react").RefAttributes<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
70
62
|
TreeNode: import("react").FC<import("rc-tree").TreeNodeProps<import("antd").TreeDataNode>>;
|
|
71
63
|
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
|
|
72
64
|
children?: import("react").ReactNode;
|
|
73
|
-
} & {
|
|
74
|
-
ref?: import("react").Ref<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>> | undefined;
|
|
75
|
-
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
65
|
+
} & import("react").RefAttributes<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
76
66
|
displayName?: string | undefined;
|
|
77
67
|
};
|
|
78
68
|
}, any, {}, never>;
|
package/es/constants/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
2
2
|
// Types
|
|
3
3
|
import { theme } from 'antd';
|
|
4
4
|
// Variables
|
|
@@ -64,8 +64,12 @@ export const THEME = {
|
|
|
64
64
|
accent2: '#dddddd',
|
|
65
65
|
accent3: '#d2d2d2',
|
|
66
66
|
accent5: '#999999',
|
|
67
|
+
accent6: '#f2f2f2',
|
|
68
|
+
accent7: '#cccccc',
|
|
69
|
+
gray5: '#d9d9d9',
|
|
67
70
|
gold1,
|
|
68
71
|
gold6,
|
|
72
|
+
scrollBarSize: '8px',
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
THEME.components = {
|
|
@@ -128,19 +132,42 @@ THEME.components = {
|
|
|
128
132
|
controlHeight: 31,
|
|
129
133
|
},
|
|
130
134
|
Divider: {
|
|
131
|
-
marginLG:
|
|
135
|
+
marginLG: 15,
|
|
136
|
+
marginXL: 15,
|
|
137
|
+
colorSplit: (_r = THEME.token) === null || _r === void 0 ? void 0 : _r.accent3,
|
|
132
138
|
},
|
|
133
139
|
Checkbox: {
|
|
134
140
|
controlInteractiveSize: 18,
|
|
135
141
|
},
|
|
136
142
|
Modal: {
|
|
143
|
+
titleFontSize: 16,
|
|
137
144
|
borderRadiusSM: 3,
|
|
145
|
+
fontSizeLG: 18,
|
|
138
146
|
paddingContentHorizontalLG: 0,
|
|
139
147
|
paddingLG: 0,
|
|
140
148
|
paddingMD: 0,
|
|
141
149
|
},
|
|
142
150
|
Tabs: {
|
|
143
151
|
colorPrimary: '#1F5FAC',
|
|
144
|
-
|
|
152
|
+
horizontalItemPadding: '10px 20px',
|
|
153
|
+
horizontalItemGutter: 0,
|
|
154
|
+
lineWidthBold: 3,
|
|
155
|
+
titleFontSize: 14,
|
|
156
|
+
titleFontSizeLG: 14,
|
|
157
|
+
titleFontSizeSM: 14,
|
|
158
|
+
horizontalMargin: '0px',
|
|
159
|
+
},
|
|
160
|
+
Collapse: {
|
|
161
|
+
headerBg: '#FFF',
|
|
162
|
+
borderRadiusLG: 0,
|
|
163
|
+
headerPadding: '15px 10px',
|
|
164
|
+
},
|
|
165
|
+
Switch: {
|
|
166
|
+
colorTextQuaternary: (_s = THEME.token) === null || _s === void 0 ? void 0 : _s.bw0,
|
|
167
|
+
colorTextTertiary: (_t = THEME.token) === null || _t === void 0 ? void 0 : _t.bw0,
|
|
168
|
+
handleSize: 12,
|
|
169
|
+
handleSizeSM: 7,
|
|
170
|
+
trackMinWidth: 30,
|
|
171
|
+
handleBg: (_u = THEME.token) === null || _u === void 0 ? void 0 : _u.colorPrimary,
|
|
145
172
|
},
|
|
146
173
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDeepCompareEffect(callback: any, dependencies: any): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import isEqual from 'react-fast-compare';
|
|
3
|
+
function deepCompareEquals(a, b) {
|
|
4
|
+
// TODO: implement deep comparison here
|
|
5
|
+
// something like lodash
|
|
6
|
+
// return _.isEqual(a, b);
|
|
7
|
+
return isEqual(a, b);
|
|
8
|
+
}
|
|
9
|
+
function useDeepCompareMemoize(value) {
|
|
10
|
+
const ref = useRef();
|
|
11
|
+
// it can be done by using useMemo as well
|
|
12
|
+
// but useRef is rather cleaner and easier
|
|
13
|
+
if (!deepCompareEquals(value, ref.current)) {
|
|
14
|
+
ref.current = value;
|
|
15
|
+
}
|
|
16
|
+
return ref.current;
|
|
17
|
+
}
|
|
18
|
+
export function useDeepCompareEffect(callback, dependencies) {
|
|
19
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
+
useEffect(callback, dependencies.map(useDeepCompareMemoize));
|
|
21
|
+
}
|
package/es/locales/i18n.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const translationsJson: {
|
|
|
65
65
|
ninth: string;
|
|
66
66
|
tenth: string;
|
|
67
67
|
};
|
|
68
|
+
close: string;
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
vi: {
|
|
@@ -133,6 +134,7 @@ export declare const translationsJson: {
|
|
|
133
134
|
ninth: string;
|
|
134
135
|
tenth: string;
|
|
135
136
|
};
|
|
137
|
+
close: string;
|
|
136
138
|
};
|
|
137
139
|
};
|
|
138
140
|
};
|
|
@@ -65,6 +65,7 @@ export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: C
|
|
|
65
65
|
ninth: string;
|
|
66
66
|
tenth: string;
|
|
67
67
|
};
|
|
68
|
+
close: string;
|
|
68
69
|
}>, current?: string) => void;
|
|
69
70
|
export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
|
|
70
71
|
export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
|
package/es/test.js
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { createRoot } from 'react-dom/client';
|
|
4
4
|
import '@antscorp/icons/main.css';
|
|
5
|
-
import { ConfigProvider,
|
|
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 { ConfigProvider, InputDynamic, } from './components';
|
|
11
6
|
export const BACKGROUND_COLOR_STYLE = {
|
|
12
7
|
SOLID: {
|
|
13
8
|
value: 'color',
|
|
@@ -31,6 +26,8 @@ export const customColors = [
|
|
|
31
26
|
'#57b8c2',
|
|
32
27
|
];
|
|
33
28
|
export const App = () => {
|
|
29
|
+
// const [valueShortlink, setValueShortlink] = useState('#{shortlink(https://test.com.vn)}');
|
|
30
|
+
const [valueShortlink, setValueShortlink] = useState('');
|
|
34
31
|
const [state, setState] = useState({
|
|
35
32
|
option: {
|
|
36
33
|
dateType: 'today',
|
|
@@ -49,6 +46,7 @@ export const App = () => {
|
|
|
49
46
|
const [sliderValue, setSliderValue] = useState(10);
|
|
50
47
|
const [edge, setEdge] = useState(['auto', 'auto', 700, 700]);
|
|
51
48
|
const [icon, setIcon] = useState('');
|
|
49
|
+
console.log('valueShortlink :>', valueShortlink);
|
|
52
50
|
const callbackColorSetting = (key, dataIn) => {
|
|
53
51
|
switch (key) {
|
|
54
52
|
case 'ON_ADD_NEW_PRESET':
|
|
@@ -78,6 +76,17 @@ export const App = () => {
|
|
|
78
76
|
const handleSetIcon = value => {
|
|
79
77
|
setIcon(value);
|
|
80
78
|
};
|
|
79
|
+
// ---------------------------- Test Input Dynamic start ------------------------------
|
|
80
|
+
return (React.createElement("div", { style: {
|
|
81
|
+
width: 500,
|
|
82
|
+
height: 500,
|
|
83
|
+
border: '1px solid black',
|
|
84
|
+
margin: '0 auto',
|
|
85
|
+
padding: 12,
|
|
86
|
+
borderRadius: '10px',
|
|
87
|
+
} },
|
|
88
|
+
React.createElement(InputDynamic, { errors: [], onChange: dataOut => setValueShortlink(dataOut), onError: () => { }, isViewMode: false, canMultipleLine: false, value: valueShortlink })));
|
|
89
|
+
// ---------------------------- Test Input Dynamic End ------------------------------
|
|
81
90
|
// ---------------------------- Test Helps Start ------------------------------
|
|
82
91
|
// return (
|
|
83
92
|
// <div style={{ display: 'flex', justifyContent: 'center', width: '100vw', height: '100vh' }}>
|
|
@@ -86,67 +95,156 @@ export const App = () => {
|
|
|
86
95
|
// );
|
|
87
96
|
// ---------------------------- Test Helps End ------------------------------
|
|
88
97
|
// ------------------------ Media template components test start -------------------------
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
98
|
+
// return (
|
|
99
|
+
// <ConfigProvider>
|
|
100
|
+
// <div
|
|
101
|
+
// style={{
|
|
102
|
+
// width: 500,
|
|
103
|
+
// height: 1000,
|
|
104
|
+
// border: '1px solid black',
|
|
105
|
+
// margin: '0 auto',
|
|
106
|
+
// padding: 12,
|
|
107
|
+
// borderRadius: '10px',
|
|
108
|
+
// marginTop: 12,
|
|
109
|
+
// }}
|
|
110
|
+
// >
|
|
111
|
+
// <h2 style={{ textAlign: 'center' }}>Test component of media template</h2>
|
|
112
|
+
// <Space size={20} direction="vertical">
|
|
113
|
+
// {/* <SettingWrapper vertical label="Color Setting">
|
|
114
|
+
// <ColorSetting
|
|
115
|
+
// label="Background Color"
|
|
116
|
+
// labelStyling={{ color: THEME.token?.colorIcon }}
|
|
117
|
+
// color={colorSettingState.color}
|
|
118
|
+
// customColors={colorSettingState.customColors}
|
|
119
|
+
// callback={callbackColorSetting}
|
|
120
|
+
// onChange={handleChangeColorSetting}
|
|
121
|
+
// />
|
|
122
|
+
// </SettingWrapper>
|
|
123
|
+
// <SettingWrapper vertical label="Input number with unit">
|
|
124
|
+
// <InputNumberWithUnit
|
|
125
|
+
// unit="px"
|
|
126
|
+
// min={0}
|
|
127
|
+
// max={2000}
|
|
128
|
+
// value={700}
|
|
129
|
+
// onChange={value => {
|
|
130
|
+
// console.log('onChange:: ', value);
|
|
131
|
+
// }}
|
|
132
|
+
// onChangeUnit={unit => {
|
|
133
|
+
// console.log('onChangeUnit:: ', unit);
|
|
134
|
+
// }}
|
|
135
|
+
// />
|
|
136
|
+
// </SettingWrapper>
|
|
137
|
+
// <SettingWrapper label="Radio Group">
|
|
138
|
+
// <RadioGroup
|
|
139
|
+
// options={Object.values(BACKGROUND_COLOR_STYLE)}
|
|
140
|
+
// value={radioValue}
|
|
141
|
+
// onChange={e => handleChangeRadio(e)}
|
|
142
|
+
// />
|
|
143
|
+
// </SettingWrapper> */}
|
|
144
|
+
// <SettingWrapper vertical label="Color Setting">
|
|
145
|
+
// <GradientSetting />
|
|
146
|
+
// </SettingWrapper>
|
|
147
|
+
// <SliderWithInputNumber
|
|
148
|
+
// label="Size (px)"
|
|
149
|
+
// labelStyling={{ marginTop: 10 }}
|
|
150
|
+
// min={0}
|
|
151
|
+
// max={100}
|
|
152
|
+
// value={sliderValue}
|
|
153
|
+
// onAfterChange={handleChangeSlider}
|
|
154
|
+
// />
|
|
155
|
+
// <EdgeSetting
|
|
156
|
+
// label="Notification Spacing"
|
|
157
|
+
// unit="px"
|
|
158
|
+
// linked={false}
|
|
159
|
+
// values={edge}
|
|
160
|
+
// // edgeLabels={[t(translations.column.title), t(translations.row.title)]}
|
|
161
|
+
// onChange={({ values, linked, unit }) => {
|
|
162
|
+
// setEdge(values);
|
|
163
|
+
// // onUpdateSettings({
|
|
164
|
+
// // gapX: values[0] + unit,
|
|
165
|
+
// // gapY: values[1] + unit,
|
|
166
|
+
// // gapSuffix: unit,
|
|
167
|
+
// // linkedGapInput: linked,
|
|
168
|
+
// // });
|
|
169
|
+
// }}
|
|
170
|
+
// />
|
|
171
|
+
// <PositionSetting
|
|
172
|
+
// settings={{ linkedPositionInput: false, positionSuffix: 'px' }}
|
|
173
|
+
// styles={{ top: '10px', right: '20px', bottom: '30', left: '40' }}
|
|
174
|
+
// onChange={() => {}}
|
|
175
|
+
// />
|
|
176
|
+
// </Space>
|
|
177
|
+
// <Space size={10} direction="vertical">
|
|
178
|
+
// <SettingWrapper vertical label="Background Image" containerStyle={{ gap: '20px' }}>
|
|
179
|
+
// <UploadImage
|
|
180
|
+
// domainMedia="https://sandbox-media-template.antsomi.com"
|
|
181
|
+
// slug="cdp/api/v1"
|
|
182
|
+
// labelButtonSelect="Select Toggle from Computor"
|
|
183
|
+
// labelHeadingModal="Toggle Selection"
|
|
184
|
+
// searchPlaceholder="Search toggle"
|
|
185
|
+
// paramConfigs={{
|
|
186
|
+
// token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
|
|
187
|
+
// userId: '1600084695',
|
|
188
|
+
// accountId: '1600084695',
|
|
189
|
+
// }}
|
|
190
|
+
// // title="Background Image"
|
|
191
|
+
// selectedImage={{
|
|
192
|
+
// url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
|
|
193
|
+
// }}
|
|
194
|
+
// onChangeImage={image =>
|
|
195
|
+
// // onChangeSettings('backgroundImageObj', {
|
|
196
|
+
// // name: image.name,
|
|
197
|
+
// // previewUrl: image.url,
|
|
198
|
+
// // })
|
|
199
|
+
// {}
|
|
200
|
+
// }
|
|
201
|
+
// onRemoveImage={() => {
|
|
202
|
+
// // onChangeSettings('backgroundImageObj', {
|
|
203
|
+
// // name: '',
|
|
204
|
+
// // previewUrl: '',
|
|
205
|
+
// // });
|
|
206
|
+
// }}
|
|
207
|
+
// />
|
|
208
|
+
// </SettingWrapper>
|
|
209
|
+
// <SettingWrapper vertical label="Icon">
|
|
210
|
+
// <IconSelection
|
|
211
|
+
// isOpen={false}
|
|
212
|
+
// labelHeadingModal="Toggle Selection"
|
|
213
|
+
// searchPlaceholder="Search for toggle..."
|
|
214
|
+
// icon={icon}
|
|
215
|
+
// onChange={handleSetIcon}
|
|
216
|
+
// iconTypes={['cus', 'font-awesome']}
|
|
217
|
+
// onChangeSvg={value => {
|
|
218
|
+
// console.log('onChangeSvg', value);
|
|
219
|
+
// }}
|
|
220
|
+
// />
|
|
221
|
+
// </SettingWrapper>
|
|
222
|
+
// </Space>
|
|
223
|
+
// </div>
|
|
224
|
+
// </ConfigProvider>
|
|
225
|
+
// );
|
|
136
226
|
// ------------------------ Media template components test end -------------------------
|
|
137
|
-
return (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
227
|
+
// return (
|
|
228
|
+
// <div style={{ width: '500px', margin: '32px' }}>
|
|
229
|
+
// <GradientSetting onChange={e => console.log('gradient change')} />
|
|
230
|
+
// <br />
|
|
231
|
+
// <br />
|
|
232
|
+
// <br />
|
|
233
|
+
// <br />
|
|
234
|
+
// <Slider
|
|
235
|
+
// className="test-classname"
|
|
236
|
+
// min={-10}
|
|
237
|
+
// max={10}
|
|
238
|
+
// onChange={e => console.log('slider change', e)}
|
|
239
|
+
// />
|
|
240
|
+
// <br />
|
|
241
|
+
// <br />
|
|
242
|
+
// <Rate />
|
|
243
|
+
// <br />
|
|
244
|
+
// <br />
|
|
245
|
+
// <Slider className="test-classname" />
|
|
246
|
+
// </div>
|
|
247
|
+
// );
|
|
150
248
|
};
|
|
151
249
|
const container = document.getElementById('root');
|
|
152
250
|
const root = createRoot(container);
|
package/es/utils/common.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const reorder: (list: Array<Record<string, unknown> | string | number>, startIndex: number, endIndex: number) => any[];
|
|
9
9
|
export declare const safeParse: (val: any, defaultVal: any) => any;
|
|
10
|
+
export declare const getObjectPropSafely: (fn: any, defaultValue?: string) => any;
|
|
11
|
+
export declare const random: (number: any) => string;
|
|
10
12
|
export declare function getPortalId(config: any): any;
|
|
11
13
|
export declare const safeParseInt: (val: any, defaultVal: any) => any;
|
|
12
14
|
export declare function isUrlEmbedded(): boolean;
|
package/es/utils/common.js
CHANGED
|
@@ -26,6 +26,22 @@ export const safeParse = (val, defaultVal) => {
|
|
|
26
26
|
}
|
|
27
27
|
return val;
|
|
28
28
|
};
|
|
29
|
+
export const getObjectPropSafely = (fn, defaultValue = '') => {
|
|
30
|
+
try {
|
|
31
|
+
return fn();
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return defaultValue;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const random = number => {
|
|
38
|
+
let text = '';
|
|
39
|
+
const possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
40
|
+
for (let i = 0; i < number; i++) {
|
|
41
|
+
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
|
42
|
+
}
|
|
43
|
+
return text;
|
|
44
|
+
};
|
|
29
45
|
export function getPortalId(config) {
|
|
30
46
|
const portalId = safeParse(getSessionStorage('api_pid', config), 0);
|
|
31
47
|
if (portalId === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.3-beta.
|
|
3
|
+
"version": "1.3.3-beta.30",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"unpkg": "dist/index.js",
|
|
20
20
|
"types": "es/index.d.ts",
|
|
21
21
|
"scripts": {
|
|
22
|
+
"publish": "npm run clean && npm run build:es",
|
|
22
23
|
"build:es": "npm run copy-files && npm run ts-compile",
|
|
23
24
|
"clean": "rimraf dist lib es",
|
|
24
25
|
"dev": "vite",
|
|
@@ -65,14 +66,18 @@
|
|
|
65
66
|
"@fortawesome/free-solid-svg-icons": "6.1.1",
|
|
66
67
|
"@fortawesome/react-fontawesome": "0.2.0",
|
|
67
68
|
"@tinymce/tinymce-react": "^3.7.0",
|
|
68
|
-
"antd": "
|
|
69
|
+
"antd": "5.12.6",
|
|
69
70
|
"axios": "^1.4.0",
|
|
70
71
|
"babel-plugin-file-loader": "^2.0.0",
|
|
71
72
|
"dayjs": "^1.11.7",
|
|
72
73
|
"font-awesome": "4.7.0",
|
|
73
74
|
"highlight.js": "^11.8.0",
|
|
75
|
+
"html-entities": "^2.0.2",
|
|
74
76
|
"html-to-image": "^1.11.11",
|
|
75
77
|
"html2canvas": "^1.4.1",
|
|
78
|
+
"i18next": "21.6.16",
|
|
79
|
+
"i18next-browser-languagedetector": "6.1.2",
|
|
80
|
+
"immer": "^10.0.3",
|
|
76
81
|
"lodash": "^4.17.21",
|
|
77
82
|
"moment": "2.29.2",
|
|
78
83
|
"qs": "6.10.3",
|
|
@@ -84,8 +89,7 @@
|
|
|
84
89
|
"remark-gfm": "^3.0.1",
|
|
85
90
|
"ts-dedent": "^2.2.0",
|
|
86
91
|
"tui-image-editor": "^3.15.3",
|
|
87
|
-
"
|
|
88
|
-
"i18next-browser-languagedetector": "6.1.2"
|
|
92
|
+
"use-immer": "^0.9.0"
|
|
89
93
|
},
|
|
90
94
|
"devDependencies": {
|
|
91
95
|
"@ant-design/cssinjs": "^1.6.2",
|