@antscorp/antsomi-ui 1.3.3-beta.2 → 1.3.3-beta.3
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/es/components/atoms/Button/index.d.ts +8 -1
- 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/Space/Space.d.ts +1 -1
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/Statistic/Statistic.d.ts +4 -1
- package/es/components/molecules/ColorSetting/styled.d.ts +8 -1
- package/es/components/molecules/FontFamilySelect/constants.d.ts +307 -0
- package/es/components/molecules/FontFamilySelect/constants.js +257 -0
- package/es/components/molecules/FontFamilySelect/index.d.ts +17 -0
- package/es/components/molecules/FontFamilySelect/index.js +53 -0
- package/es/components/molecules/FontSetting/index.d.ts +18 -0
- package/es/components/molecules/FontSetting/index.js +53 -0
- package/es/components/molecules/FontSetting/types.d.ts +22 -0
- package/es/components/molecules/FontSetting/types.js +1 -0
- package/es/components/molecules/FontWeightSelect/constants.d.ts +28 -0
- package/es/components/molecules/FontWeightSelect/constants.js +11 -0
- package/es/components/molecules/FontWeightSelect/index.d.ts +9 -0
- package/es/components/molecules/FontWeightSelect/index.js +39 -0
- package/es/components/molecules/IconSelection/styled.d.ts +8 -1
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/Select/Select.d.ts +4 -3
- package/es/components/molecules/SettingWrapper/index.d.ts +1 -2
- package/es/components/molecules/SettingWrapperPopover/index.d.ts +16 -0
- package/es/components/molecules/SettingWrapperPopover/index.js +17 -0
- package/es/components/molecules/TextDecorationSelect/constants.d.ts +19 -0
- package/es/components/molecules/TextDecorationSelect/constants.js +26 -0
- package/es/components/molecules/TextDecorationSelect/index.d.ts +15 -0
- package/es/components/molecules/TextDecorationSelect/index.js +45 -0
- package/es/components/molecules/TextTransformSelect/constants.d.ts +13 -0
- package/es/components/molecules/TextTransformSelect/constants.js +19 -0
- package/es/components/molecules/TextTransformSelect/index.d.ts +9 -0
- package/es/components/molecules/TextTransformSelect/index.js +39 -0
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -3
- package/es/components/molecules/index.d.ts +7 -0
- package/es/components/molecules/index.js +6 -0
- package/es/components/organism/Help/styled.d.ts +16 -6
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
// Libraries
|
|
13
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
14
|
+
// Molecules
|
|
15
|
+
import { Select } from '../Select';
|
|
16
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
17
|
+
// Constants
|
|
18
|
+
import { OPTION_FONT_FAMILY } from './constants';
|
|
19
|
+
import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
20
|
+
/**
|
|
21
|
+
* Renders a select input for font family options.
|
|
22
|
+
*
|
|
23
|
+
* @param {FontFamilySelectProps} props - The props for the component.
|
|
24
|
+
* @return {ReactNode} The rendered React node.
|
|
25
|
+
*/
|
|
26
|
+
export const FontFamilySelect = (props) => {
|
|
27
|
+
const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
|
|
28
|
+
const [selected, setSelected] = useState(defaultValue || value);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setSelected(value);
|
|
31
|
+
}, [value]);
|
|
32
|
+
const { t } = i18nInstance;
|
|
33
|
+
const filteredFontFamilyOptions = useMemo(() => {
|
|
34
|
+
let filteredOptions = [...OPTION_FONT_FAMILY];
|
|
35
|
+
if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
|
|
36
|
+
filteredOptions = OPTION_FONT_FAMILY.filter(({ value }) => showOptions.some(font => font === value));
|
|
37
|
+
}
|
|
38
|
+
return filteredOptions;
|
|
39
|
+
}, [showOptions]);
|
|
40
|
+
const handleChange = (value) => {
|
|
41
|
+
if (typeof onChange === 'function') {
|
|
42
|
+
onChange(value);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
|
|
46
|
+
React.createElement(Select, Object.assign({ value: selected, options: [...filteredFontFamilyOptions], style: { fontFamily: value, width: '100%' }, onChange: select => {
|
|
47
|
+
setSelected(select);
|
|
48
|
+
handleChange(select);
|
|
49
|
+
}, showSearch: true }, selectProps))));
|
|
50
|
+
};
|
|
51
|
+
FontFamilySelect.defaultProps = {
|
|
52
|
+
showOptions: [],
|
|
53
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverProps } from 'antd';
|
|
3
|
+
import { SettingWrapperProps } from '../SettingWrapper';
|
|
4
|
+
import { TFontSettings, TFontStyles } from './types';
|
|
5
|
+
export type TFontSettingProps = {
|
|
6
|
+
label?: string;
|
|
7
|
+
settings: TFontSettings;
|
|
8
|
+
wrapperProps?: Omit<SettingWrapperProps, 'label'>;
|
|
9
|
+
popoverProps?: Omit<PopoverProps, 'content'>;
|
|
10
|
+
childrenProps?: Omit<TFontSettingEditProps, 'settings' | 'styles' | 'onChange'>;
|
|
11
|
+
onChange?: TFontSettingEditProps['onChange'];
|
|
12
|
+
};
|
|
13
|
+
export type TFontSettingEditProps = {
|
|
14
|
+
settings: TFontSettings;
|
|
15
|
+
onChange?: (settings: Partial<TFontSettings>, styles?: TFontStyles) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const FontSettingEdit: React.FC<TFontSettingEditProps>;
|
|
18
|
+
export declare const FontSetting: React.FC<TFontSettingProps>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/* Components */
|
|
3
|
+
import { Space, Switch } from '../../atoms';
|
|
4
|
+
import { ColorSetting } from '../ColorSetting';
|
|
5
|
+
import { SliderWithInputNumber } from '../SliderWithInputNumber';
|
|
6
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
7
|
+
import { SettingWrapperPopover } from '../SettingWrapperPopover';
|
|
8
|
+
import { FontFamilySelect } from '../FontFamilySelect';
|
|
9
|
+
import { FontWeightSelect } from '../FontWeightSelect';
|
|
10
|
+
import { TextTransformSelect } from '../TextTransformSelect';
|
|
11
|
+
import { TextDecorationSelect } from '../TextDecorationSelect';
|
|
12
|
+
export const FontSettingEdit = (props) => {
|
|
13
|
+
const { settings, onChange } = props;
|
|
14
|
+
const generateStyles = (settings) => ({
|
|
15
|
+
fontFamily: settings.fontFamily,
|
|
16
|
+
fontColor: settings.fontColor,
|
|
17
|
+
fontSize: settings.fontSize,
|
|
18
|
+
fontWeight: settings.fontWeight,
|
|
19
|
+
lineHeight: settings.lineHeight,
|
|
20
|
+
letterSpacing: settings.letterSpacing,
|
|
21
|
+
textTransform: settings.textTransform,
|
|
22
|
+
textDecoration: settings.textDecoration,
|
|
23
|
+
fontStyle: settings.fontItalic ? 'italic' : 'normal',
|
|
24
|
+
});
|
|
25
|
+
const handleChange = (setting) => {
|
|
26
|
+
if (typeof onChange === 'function') {
|
|
27
|
+
const newSettings = Object.assign(Object.assign({}, settings), setting);
|
|
28
|
+
const newStyles = generateStyles(newSettings);
|
|
29
|
+
onChange(newSettings, newStyles);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return (React.createElement(Space, { direction: "vertical" },
|
|
33
|
+
React.createElement(FontFamilySelect, { label: "Font Family", value: settings === null || settings === void 0 ? void 0 : settings.fontFamily, onChange: family => handleChange({ fontFamily: family }) }),
|
|
34
|
+
React.createElement(ColorSetting, { label: "Font Color", color: settings === null || settings === void 0 ? void 0 : settings.fontColor, onChange: fontColor => handleChange({ fontColor }) }),
|
|
35
|
+
React.createElement(SettingWrapper, { label: "Font Size", vertical: true },
|
|
36
|
+
React.createElement(SliderWithInputNumber, { value: typeof (settings === null || settings === void 0 ? void 0 : settings.fontSize) !== 'undefined' ? +settings.fontSize : 0, onAfterChange: fontSize => handleChange({ fontSize }) })),
|
|
37
|
+
React.createElement(FontWeightSelect, { label: "Font Weight", value: settings === null || settings === void 0 ? void 0 : settings.fontWeight, showOptions: ['Light', 'Black'], onChange: fontWeight => handleChange({ fontWeight }) }),
|
|
38
|
+
React.createElement(SettingWrapper, { label: "Line Height", vertical: true },
|
|
39
|
+
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.lineHeight) !== 'undefined' ? +settings.lineHeight : 0, min: 1, max: 5, step: 0.1, onAfterChange: lineHeight => handleChange({ lineHeight }) })),
|
|
40
|
+
React.createElement(SettingWrapper, { label: "Letter Spacing", vertical: true },
|
|
41
|
+
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.letterSpacing) !== 'undefined' ? +settings.letterSpacing : 0, min: -10, max: 10, onAfterChange: letterSpacing => handleChange({ letterSpacing }) })),
|
|
42
|
+
React.createElement(TextTransformSelect, { label: "Text Transform", value: settings === null || settings === void 0 ? void 0 : settings.textTransform, onChange: textTransform => handleChange({ textTransform }) }),
|
|
43
|
+
React.createElement(TextDecorationSelect, { label: "Text Decoration", value: settings === null || settings === void 0 ? void 0 : settings.textDecoration, onChange: textDecoration => handleChange({ textDecoration }) }),
|
|
44
|
+
React.createElement(SettingWrapper, { label: "Font Style Italic" },
|
|
45
|
+
React.createElement(Switch, { checked: settings === null || settings === void 0 ? void 0 : settings.fontItalic, onChange: fontItalic => handleChange({ fontItalic }) }))));
|
|
46
|
+
};
|
|
47
|
+
export const FontSetting = (props) => {
|
|
48
|
+
const { label, settings, wrapperProps, popoverProps, childrenProps, onChange } = props;
|
|
49
|
+
return (React.createElement(SettingWrapperPopover, { label: label !== null && label !== void 0 ? label : 'Font Settings',
|
|
50
|
+
// labelStyle={{ fontWeight: 'bold', ...wrapperProps?.labelStyle }}
|
|
51
|
+
popoverProps: Object.assign({ overlayStyle: { top: 0 }, placement: 'bottomRight' }, popoverProps), wrapperProps: Object.assign({ containerStyle: { minWidth: '288px' } }, wrapperProps) },
|
|
52
|
+
React.createElement(FontSettingEdit, Object.assign({ settings: settings, onChange: onChange }, childrenProps))));
|
|
53
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TFontSettings = {
|
|
2
|
+
fontFamily: string;
|
|
3
|
+
fontColor: string;
|
|
4
|
+
fontSize: string | number;
|
|
5
|
+
fontWeight: string | number;
|
|
6
|
+
lineHeight: string | number;
|
|
7
|
+
letterSpacing: string | number;
|
|
8
|
+
textTransform: string | number;
|
|
9
|
+
textDecoration: string;
|
|
10
|
+
fontItalic: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TFontStyles = {
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
fontColor: string;
|
|
15
|
+
fontSize: string | number;
|
|
16
|
+
fontWeight: string | number;
|
|
17
|
+
lineHeight: string | number;
|
|
18
|
+
letterSpacing: string | number;
|
|
19
|
+
textTransform: string | number;
|
|
20
|
+
textDecoration: string;
|
|
21
|
+
fontStyle: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const OPTION_FONT_WEIGHT: readonly [{
|
|
2
|
+
readonly label: "Thin";
|
|
3
|
+
readonly value: "100";
|
|
4
|
+
}, {
|
|
5
|
+
readonly label: "Extra Light";
|
|
6
|
+
readonly value: "200";
|
|
7
|
+
}, {
|
|
8
|
+
readonly label: "Light";
|
|
9
|
+
readonly value: "300";
|
|
10
|
+
}, {
|
|
11
|
+
readonly label: "Regular";
|
|
12
|
+
readonly value: "400";
|
|
13
|
+
}, {
|
|
14
|
+
readonly label: "Medium";
|
|
15
|
+
readonly value: "500";
|
|
16
|
+
}, {
|
|
17
|
+
readonly label: "Semi Bold";
|
|
18
|
+
readonly value: "600";
|
|
19
|
+
}, {
|
|
20
|
+
readonly label: "Bold";
|
|
21
|
+
readonly value: "700";
|
|
22
|
+
}, {
|
|
23
|
+
readonly label: "Extra Bold";
|
|
24
|
+
readonly value: "800";
|
|
25
|
+
}, {
|
|
26
|
+
readonly label: "Black";
|
|
27
|
+
readonly value: "900";
|
|
28
|
+
}];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const OPTION_FONT_WEIGHT = [
|
|
2
|
+
{ label: 'Thin', value: '100' },
|
|
3
|
+
{ label: 'Extra Light', value: '200' },
|
|
4
|
+
{ label: 'Light', value: '300' },
|
|
5
|
+
{ label: 'Regular', value: '400' },
|
|
6
|
+
{ label: 'Medium', value: '500' },
|
|
7
|
+
{ label: 'Semi Bold', value: '600' },
|
|
8
|
+
{ label: 'Bold', value: '700' },
|
|
9
|
+
{ label: 'Extra Bold', value: '800' },
|
|
10
|
+
{ label: 'Black', value: '900' },
|
|
11
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from '../Select';
|
|
3
|
+
import { OPTION_FONT_WEIGHT } from './constants';
|
|
4
|
+
export type FontWeightSelectProps = Omit<SelectProps, 'onChange'> & {
|
|
5
|
+
label?: string;
|
|
6
|
+
showOptions?: (typeof OPTION_FONT_WEIGHT)[number]['label'][];
|
|
7
|
+
onChange?: (family: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const FontWeightSelect: React.FC<FontWeightSelectProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { Select } from '../Select';
|
|
14
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
15
|
+
import { OPTION_FONT_WEIGHT } from './constants';
|
|
16
|
+
export const FontWeightSelect = props => {
|
|
17
|
+
const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
|
|
18
|
+
const [selected, setSelected] = useState(defaultValue || value);
|
|
19
|
+
const fontWeightOptions = useMemo(() => {
|
|
20
|
+
let draftFontFamily = [...OPTION_FONT_WEIGHT];
|
|
21
|
+
if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
|
|
22
|
+
draftFontFamily = OPTION_FONT_WEIGHT.filter(({ label }) => showOptions.some(font => font === label));
|
|
23
|
+
}
|
|
24
|
+
return draftFontFamily;
|
|
25
|
+
}, [showOptions]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setSelected(value === null || value === void 0 ? void 0 : value.toString());
|
|
28
|
+
}, [value]);
|
|
29
|
+
const handleChange = (value) => {
|
|
30
|
+
if (onChange && typeof onChange === 'function') {
|
|
31
|
+
onChange(value);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
|
|
35
|
+
React.createElement(Select, Object.assign({ value: selected, options: [...fontWeightOptions], style: { fontFamily: value, width: '100%' }, onChange: select => {
|
|
36
|
+
setSelected(select);
|
|
37
|
+
handleChange(select);
|
|
38
|
+
}, showSearch: true }, selectProps))));
|
|
39
|
+
};
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
export declare const IconSelectionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const WrapperListRender: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const WrapperListItemRender: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const CustomButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
5
|
+
export declare const CustomButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Partial<{
|
|
6
|
+
href: string;
|
|
7
|
+
target?: string | undefined;
|
|
8
|
+
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
9
|
+
} & import("antd/es/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "type" | "onClick"> & {
|
|
10
|
+
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
11
|
+
onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
12
|
+
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick">> & import("react").RefAttributes<HTMLElement>> & {
|
|
6
13
|
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
7
14
|
}, any, {}, never>;
|
|
8
15
|
export declare const Overlay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -14,10 +14,10 @@ export declare const Modal: string & import("styled-components").StyledComponent
|
|
|
14
14
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
15
15
|
destroyAll: () => void;
|
|
16
16
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
17
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
17
|
+
_InternalPanelDoNotUseOrYouWillBeFired: React.FC<import("antd/es/modal/PurePanel").PurePanelProps>;
|
|
18
18
|
}, any, import("./styled").CustomModalProps, never> & import("hoist-non-react-statics").NonReactStatics<React.FC<AntdModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
19
19
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
20
20
|
destroyAll: () => void;
|
|
21
21
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
22
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
22
|
+
_InternalPanelDoNotUseOrYouWillBeFired: React.FC<import("antd/es/modal/PurePanel").PurePanelProps>;
|
|
23
23
|
}, {}> & React.FC<ModalProps>;
|
|
@@ -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: (
|
|
13
|
+
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/modal/PurePanel").PurePanelProps>;
|
|
14
14
|
}, any, CustomModalProps, never>;
|
|
15
15
|
export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Popconfirm: import("react").ForwardRefExoticComponent<import("antd").PopconfirmProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
_InternalPanelDoNotUseOrYouWillBeFired: import("
|
|
3
|
+
_InternalPanelDoNotUseOrYouWillBeFired: typeof import("antd/es/popconfirm/PurePanel").default;
|
|
4
4
|
};
|
|
@@ -4,11 +4,12 @@ export interface SelectProps extends AntdSelectProps {
|
|
|
4
4
|
}
|
|
5
5
|
declare const Select: (<ValueType = any, OptionType extends import("rc-select/lib/Select").DefaultOptionType | import("rc-select/lib/Select").BaseOptionType = import("rc-select/lib/Select").DefaultOptionType>(props: AntdSelectProps<ValueType, OptionType> & {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
} &
|
|
8
|
-
|
|
7
|
+
} & {
|
|
8
|
+
ref?: React.Ref<import("antd").RefSelectProps> | undefined;
|
|
9
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
9
10
|
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
|
|
10
11
|
Option: import("rc-select/lib/Option").OptionFC;
|
|
11
12
|
OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
|
|
12
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
13
|
+
_InternalPanelDoNotUseOrYouWillBeFired: any;
|
|
13
14
|
} & React.FC<SelectProps>;
|
|
14
15
|
export { Select };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
interface SettingWrapperProps {
|
|
2
|
+
export interface SettingWrapperProps {
|
|
3
3
|
label: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
labelColor?: string;
|
|
@@ -10,4 +10,3 @@ interface SettingWrapperProps {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export declare const SettingWrapper: React.FC<SettingWrapperProps>;
|
|
13
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SettingWrapperProps } from '../SettingWrapper';
|
|
3
|
+
import { PopoverProps } from 'antd';
|
|
4
|
+
export type SettingWrapperPopoverProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
wrapperProps?: Omit<SettingWrapperProps, 'label'>;
|
|
7
|
+
popoverProps?: Omit<PopoverProps, 'content'>;
|
|
8
|
+
iconPopover?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Renders a popover wrapper for a setting.
|
|
12
|
+
*
|
|
13
|
+
* @param {React.PropsWithChildren<SettingWrapperPopoverProps>} props - The props object containing the label, children, wrapperProps and popoverProps.
|
|
14
|
+
* @returns {React.ReactElement} The rendered popover wrapper.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SettingWrapperPopover: React.FC<React.PropsWithChildren<SettingWrapperPopoverProps>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
3
|
+
import { Button, Icon, Popover } from '../../atoms';
|
|
4
|
+
/**
|
|
5
|
+
* Renders a popover wrapper for a setting.
|
|
6
|
+
*
|
|
7
|
+
* @param {React.PropsWithChildren<SettingWrapperPopoverProps>} props - The props object containing the label, children, wrapperProps and popoverProps.
|
|
8
|
+
* @returns {React.ReactElement} The rendered popover wrapper.
|
|
9
|
+
*/
|
|
10
|
+
export const SettingWrapperPopover = ({ label, children, wrapperProps, popoverProps, iconPopover, }) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return (React.createElement(SettingWrapper, Object.assign({ label: label, labelStyle: Object.assign({ fontWeight: 'bold' }, ((_a = wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.labelStyle) !== null && _a !== void 0 ? _a : {})) }, (wrapperProps !== null && wrapperProps !== void 0 ? wrapperProps : {})),
|
|
13
|
+
React.createElement(Popover, Object.assign({ content: children, trigger: ['click'], overlayInnerStyle: Object.assign({ padding: '12px 16px', minWidth: 288, maxHeight: '90vh', overflow: 'auto' }, ((_b = popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.overlayInnerStyle) !== null && _b !== void 0 ? _b : {})) }, (popoverProps !== null && popoverProps !== void 0 ? popoverProps : {})), iconPopover)));
|
|
14
|
+
};
|
|
15
|
+
SettingWrapperPopover.defaultProps = {
|
|
16
|
+
iconPopover: React.createElement(Button, { icon: React.createElement(Icon, { type: "icon-ants-edit-2" }), type: "text" }),
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const OPTION_TEXT_DECORATION: readonly [{
|
|
2
|
+
readonly label: "None";
|
|
3
|
+
readonly value: "none";
|
|
4
|
+
}, {
|
|
5
|
+
readonly label: "Underline";
|
|
6
|
+
readonly value: "underline";
|
|
7
|
+
}, {
|
|
8
|
+
readonly label: "Overline";
|
|
9
|
+
readonly value: "overline";
|
|
10
|
+
}, {
|
|
11
|
+
readonly label: "Line Through";
|
|
12
|
+
readonly value: "line-through";
|
|
13
|
+
}, {
|
|
14
|
+
readonly label: "Underline - Overline";
|
|
15
|
+
readonly value: "underline overline";
|
|
16
|
+
}, {
|
|
17
|
+
readonly label: "Underline - Line Through";
|
|
18
|
+
readonly value: "underline line-through";
|
|
19
|
+
}];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const OPTION_TEXT_DECORATION = [
|
|
2
|
+
{
|
|
3
|
+
label: 'None',
|
|
4
|
+
value: 'none',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
label: 'Underline',
|
|
8
|
+
value: 'underline',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: 'Overline',
|
|
12
|
+
value: 'overline',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: 'Line Through',
|
|
16
|
+
value: 'line-through',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'Underline - Overline',
|
|
20
|
+
value: 'underline overline',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'Underline - Line Through',
|
|
24
|
+
value: 'underline line-through',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from '../Select';
|
|
3
|
+
import { OPTION_TEXT_DECORATION } from './constants';
|
|
4
|
+
export type TextDecorationSelectProps = Omit<SelectProps, 'onChange'> & {
|
|
5
|
+
label?: string;
|
|
6
|
+
showOptions?: (typeof OPTION_TEXT_DECORATION)[number]['label'][];
|
|
7
|
+
onChange?: (textTransform: (typeof OPTION_TEXT_DECORATION)[number]['value']) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Generates a function comment for the given function body.
|
|
11
|
+
*
|
|
12
|
+
* @param {TextDecorationSelectProps} props - the props for the TextDecorationSelect component
|
|
13
|
+
* @return {React.FC<TextDecorationSelectProps>} the TextDecorationSelect component
|
|
14
|
+
*/
|
|
15
|
+
export declare const TextDecorationSelect: React.FC<TextDecorationSelectProps>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { Select } from '../Select';
|
|
14
|
+
import { OPTION_TEXT_DECORATION } from './constants';
|
|
15
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
16
|
+
/**
|
|
17
|
+
* Generates a function comment for the given function body.
|
|
18
|
+
*
|
|
19
|
+
* @param {TextDecorationSelectProps} props - the props for the TextDecorationSelect component
|
|
20
|
+
* @return {React.FC<TextDecorationSelectProps>} the TextDecorationSelect component
|
|
21
|
+
*/
|
|
22
|
+
export const TextDecorationSelect = (props) => {
|
|
23
|
+
const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
|
|
24
|
+
const [selected, setSelected] = useState(defaultValue || value);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setSelected(value === null || value === void 0 ? void 0 : value.toString());
|
|
27
|
+
}, [value]);
|
|
28
|
+
const textDecorationOptions = useMemo(() => {
|
|
29
|
+
let draftFontFamily = [...OPTION_TEXT_DECORATION];
|
|
30
|
+
if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
|
|
31
|
+
draftFontFamily = OPTION_TEXT_DECORATION.filter(({ label }) => showOptions.some(font => font === label));
|
|
32
|
+
}
|
|
33
|
+
return draftFontFamily;
|
|
34
|
+
}, [showOptions]);
|
|
35
|
+
const handleChange = (value) => {
|
|
36
|
+
if (onChange && typeof onChange === 'function') {
|
|
37
|
+
onChange(value);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
|
|
41
|
+
React.createElement(Select, Object.assign({ value: selected, options: [...textDecorationOptions], style: { width: '100%' }, onChange: select => {
|
|
42
|
+
setSelected(select);
|
|
43
|
+
handleChange(select);
|
|
44
|
+
}, showSearch: true }, selectProps))));
|
|
45
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const OPTION_TEXT_TRANSFORM: readonly [{
|
|
2
|
+
readonly label: "None";
|
|
3
|
+
readonly value: "none";
|
|
4
|
+
}, {
|
|
5
|
+
readonly label: "Capitalize";
|
|
6
|
+
readonly value: "capitalize";
|
|
7
|
+
}, {
|
|
8
|
+
readonly label: "Uppercase";
|
|
9
|
+
readonly value: "uppercase";
|
|
10
|
+
}, {
|
|
11
|
+
readonly label: "Lowercase";
|
|
12
|
+
readonly value: "lowercase";
|
|
13
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// export const LABEL_TEXT_TRANSFORM = 'None' || 'Capitalize' || 'Uppercase' || 'Lowercase';
|
|
2
|
+
export const OPTION_TEXT_TRANSFORM = [
|
|
3
|
+
{
|
|
4
|
+
label: 'None',
|
|
5
|
+
value: 'none',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
label: 'Capitalize',
|
|
9
|
+
value: 'capitalize',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'Uppercase',
|
|
13
|
+
value: 'uppercase',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Lowercase',
|
|
17
|
+
value: 'lowercase',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from '../Select';
|
|
3
|
+
import { OPTION_TEXT_TRANSFORM } from './constants';
|
|
4
|
+
export type TextTransformSelectProps = Omit<SelectProps, 'onChange'> & {
|
|
5
|
+
label?: string;
|
|
6
|
+
showOptions?: (typeof OPTION_TEXT_TRANSFORM)[number]['label'][];
|
|
7
|
+
onChange?: (textTransform: (typeof OPTION_TEXT_TRANSFORM)[number]['value']) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const TextTransformSelect: React.FC<TextTransformSelectProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { Select } from '../Select';
|
|
14
|
+
import { SettingWrapper } from '../SettingWrapper';
|
|
15
|
+
import { OPTION_TEXT_TRANSFORM } from './constants';
|
|
16
|
+
export const TextTransformSelect = (props) => {
|
|
17
|
+
const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
|
|
18
|
+
const [selected, setSelected] = useState(defaultValue || value);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setSelected(value === null || value === void 0 ? void 0 : value.toString());
|
|
21
|
+
}, [value]);
|
|
22
|
+
const textTransformOptions = useMemo(() => {
|
|
23
|
+
let draftFontFamily = [...OPTION_TEXT_TRANSFORM];
|
|
24
|
+
if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
|
|
25
|
+
draftFontFamily = OPTION_TEXT_TRANSFORM.filter(({ label }) => showOptions.some(font => font === label));
|
|
26
|
+
}
|
|
27
|
+
return draftFontFamily;
|
|
28
|
+
}, [showOptions]);
|
|
29
|
+
const handleChange = (value) => {
|
|
30
|
+
if (onChange && typeof onChange === 'function') {
|
|
31
|
+
onChange(value);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
|
|
35
|
+
React.createElement(Select, Object.assign({ value: selected, options: [...textTransformOptions], style: { width: '100%' }, onChange: select => {
|
|
36
|
+
setSelected(select);
|
|
37
|
+
handleChange(select);
|
|
38
|
+
}, showSearch: true }, selectProps))));
|
|
39
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const TreeSelect: (<ValueType = any, OptionType extends import("rc-tree-select/lib/TreeSelect").BaseOptionType | import("rc-tree-select/lib/TreeSelect").DefaultOptionType = import("rc-tree-select/lib/TreeSelect").DefaultOptionType>(props: import("antd").TreeSelectProps<ValueType, OptionType> & {
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
|
-
} &
|
|
5
|
-
|
|
4
|
+
} & {
|
|
5
|
+
ref?: import("react").Ref<import("antd").RefSelectProps> | undefined;
|
|
6
|
+
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
6
7
|
TreeNode: import("react").FC<import("rc-tree-select/lib/TreeNode").TreeNodeProps>;
|
|
7
8
|
SHOW_ALL: "SHOW_ALL";
|
|
8
9
|
SHOW_PARENT: "SHOW_PARENT";
|
|
9
10
|
SHOW_CHILD: "SHOW_CHILD";
|
|
10
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
11
|
+
_InternalPanelDoNotUseOrYouWillBeFired: any;
|
|
11
12
|
};
|
|
@@ -25,6 +25,13 @@ 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';
|
|
28
34
|
export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
|
|
29
35
|
export type { ColorPickerProps } from './ColorPicker';
|
|
30
36
|
export type { AlignEditProps, AlignSettingProps } from './AlignSetting';
|
|
37
|
+
export type { TFontSettingProps, TFontSettingEditProps } from './FontSetting';
|
|
@@ -25,3 +25,9 @@ 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';
|