@antscorp/antsomi-ui 1.3.5-beta.690 → 1.3.5-beta.692
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/es/components/icons/EditFilledIcon.d.ts +3 -0
- package/es/components/icons/EditFilledIcon.js +8 -0
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +1 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +1 -0
- package/es/components/icons/index.d.ts +1 -0
- package/es/components/icons/index.js +1 -0
- package/es/components/molecules/EditableName/EditableName.d.ts +1 -0
- package/es/components/molecules/EditableName/EditableName.js +5 -6
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useIcon } from './hooks/useIcon';
|
|
3
|
+
export const EditFilledIcon = forwardRef((props, ref) => {
|
|
4
|
+
const { width, height } = useIcon(props);
|
|
5
|
+
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor" }, props, { ref: ref, width: width, height: height }),
|
|
6
|
+
React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
7
|
+
React.createElement("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" })));
|
|
8
|
+
});
|
|
@@ -120,6 +120,7 @@ export declare const LazyIcon: {
|
|
|
120
120
|
DynamicFormIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
121
121
|
DynamicImageIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
122
122
|
DynamicTextIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
123
|
+
EditFilledIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
123
124
|
EditIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
124
125
|
ElbowConnectorIcon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
125
126
|
EmailTemplate30Icon: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<import("../types").IconProps & import("react").RefAttributes<SVGSVGElement>>>;
|
|
@@ -126,6 +126,7 @@ export const LazyIcon = {
|
|
|
126
126
|
DynamicFormIcon: lazy(() => import('../DynamicFormIcon').then(m => ({ default: m.DynamicFormIcon }))),
|
|
127
127
|
DynamicImageIcon: lazy(() => import('../DynamicImageIcon').then(m => ({ default: m.DynamicImageIcon }))),
|
|
128
128
|
DynamicTextIcon: lazy(() => import('../DynamicTextIcon').then(m => ({ default: m.DynamicTextIcon }))),
|
|
129
|
+
EditFilledIcon: lazy(() => import('../EditFilledIcon').then(m => ({ default: m.EditFilledIcon }))),
|
|
129
130
|
EditIcon: lazy(() => import('../EditIcon').then(m => ({ default: m.EditIcon }))),
|
|
130
131
|
ElbowConnectorIcon: lazy(() => import('../ElbowConnectorIcon').then(m => ({ default: m.ElbowConnectorIcon }))),
|
|
131
132
|
EmailTemplate30Icon: lazy(() => import('../EmailTemplate30Icon').then(m => ({ default: m.EmailTemplate30Icon }))),
|
|
@@ -118,6 +118,7 @@ export { DuplicateIcon } from './DuplicateIcon';
|
|
|
118
118
|
export { DynamicFormIcon } from './DynamicFormIcon';
|
|
119
119
|
export { DynamicImageIcon } from './DynamicImageIcon';
|
|
120
120
|
export { DynamicTextIcon } from './DynamicTextIcon';
|
|
121
|
+
export { EditFilledIcon } from './EditFilledIcon';
|
|
121
122
|
export { EditIcon } from './EditIcon';
|
|
122
123
|
export { ElbowConnectorIcon } from './ElbowConnectorIcon';
|
|
123
124
|
export { EmailTemplate30Icon } from './EmailTemplate30Icon';
|
|
@@ -118,6 +118,7 @@ export { DuplicateIcon } from './DuplicateIcon';
|
|
|
118
118
|
export { DynamicFormIcon } from './DynamicFormIcon';
|
|
119
119
|
export { DynamicImageIcon } from './DynamicImageIcon';
|
|
120
120
|
export { DynamicTextIcon } from './DynamicTextIcon';
|
|
121
|
+
export { EditFilledIcon } from './EditFilledIcon';
|
|
121
122
|
export { EditIcon } from './EditIcon';
|
|
122
123
|
export { ElbowConnectorIcon } from './ElbowConnectorIcon';
|
|
123
124
|
export { EmailTemplate30Icon } from './EmailTemplate30Icon';
|
|
@@ -8,7 +8,7 @@ import { Spin } from '../../atoms';
|
|
|
8
8
|
import { EditIcon } from '../../icons';
|
|
9
9
|
export const EditableName = React.forwardRef((props, ref) => {
|
|
10
10
|
var _a;
|
|
11
|
-
const { className, isLoading, required, error, value, style, readonly, maxLength = 255, onBlur, onChange, } = props;
|
|
11
|
+
const { className, isLoading, required, error, value, style, readonly, maxLength = 255, editIcon, onBlur, onChange, } = props;
|
|
12
12
|
const defaultValue = useRef(props.defaultValue);
|
|
13
13
|
const [inputWidth, setInputWidth] = useState(1);
|
|
14
14
|
const [internalValue, setInternalValue] = useState(value || defaultValue.current || '');
|
|
@@ -70,10 +70,9 @@ export const EditableName = React.forwardRef((props, ref) => {
|
|
|
70
70
|
isLoading ? (React.createElement(Spin, { indicatorSize: 20, style: { paddingLeft: '5px', marginLeft: '10px', alignSelf: 'center' } })) : null,
|
|
71
71
|
(error || requiredError) && !isLoading ? (React.createElement("div", { className: "suffix-icon-error" },
|
|
72
72
|
React.createElement(Tooltip, { title: error || requiredError },
|
|
73
|
-
React.createElement(Icon, { type: "icon-ants-warning-circle", style: { color: '#F44336', fontSize: '19.2px' } })))) : readonly ? null : (React.createElement("div", { className: "suffix-icon" },
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} }))),
|
|
73
|
+
React.createElement(Icon, { type: "icon-ants-warning-circle", style: { color: '#F44336', fontSize: '19.2px' } })))) : readonly ? null : (React.createElement("div", { className: "suffix-icon" }, editIcon || (React.createElement(EditIcon, { style: { color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.blue7 }, onClick: () => {
|
|
74
|
+
var _a;
|
|
75
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
76
|
+
} })))),
|
|
78
77
|
React.createElement("span", { ref: spanRef, className: "hidden-span" })));
|
|
79
78
|
});
|