sti-antd-package 0.0.55 → 0.0.56
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.
|
@@ -10,7 +10,7 @@ import RefIcon$1 from '../../../../node_modules/@ant-design/icons/es/icons/Close
|
|
|
10
10
|
import RefIcon$2 from '../../../../node_modules/@ant-design/icons/es/icons/SaveOutlined.js';
|
|
11
11
|
import RefIcon$3 from '../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js';
|
|
12
12
|
|
|
13
|
-
const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit = true, editing, setEditing, showTextbutton, textBack, textCancel, textSave, textEdit, onBack, onSave, classNames, className, }) => {
|
|
13
|
+
const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit = true, editing, setEditing, showTextbutton, textBack, textCancel, textSave, textEdit, onBack, onCancel, onSave, onEdit, classNames, className, }) => {
|
|
14
14
|
const saveMethod = onSave
|
|
15
15
|
? { onClick: onSave }
|
|
16
16
|
: { htmlType: 'submit' };
|
|
@@ -49,7 +49,13 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
49
49
|
(className === null || className === void 0 ? void 0 : className.buttonEdit) && classButtonEditNames.push(...className.buttonEdit);
|
|
50
50
|
return classButtonEditNames;
|
|
51
51
|
}, [styleButton, className, allowEdit, editing]);
|
|
52
|
-
const buttonGroup = (jsxRuntimeExports.jsxs("div", { className: classButton.join(' '), children: [jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !showTextbutton ? { title: textBack !== null && textBack !== void 0 ? textBack : 'Back' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon, {}), classNames: classButtonBack, disabled: disabled, onClick: onBack, children: showTextbutton ? (textBack !== null && textBack !== void 0 ? textBack : 'Back') : undefined }), jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !showTextbutton ? { title: textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: classButtonCancel, disabled: disabled, onClick:
|
|
52
|
+
const buttonGroup = (jsxRuntimeExports.jsxs("div", { className: classButton.join(' '), children: [jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !showTextbutton ? { title: textBack !== null && textBack !== void 0 ? textBack : 'Back' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon, {}), classNames: classButtonBack, disabled: disabled, onClick: onBack, children: showTextbutton ? (textBack !== null && textBack !== void 0 ? textBack : 'Back') : undefined }), jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !showTextbutton ? { title: textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: classButtonCancel, disabled: disabled, onClick: event => {
|
|
53
|
+
setEditing === null || setEditing === void 0 ? void 0 : setEditing(false);
|
|
54
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel(event);
|
|
55
|
+
}, children: showTextbutton ? (textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel') : undefined }), jsxRuntimeExports.jsx(ButtonComponent, Object.assign({ tooltip: !showTextbutton ? { title: textSave !== null && textSave !== void 0 ? textSave : 'Save' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$2, {}), type: "primary", classNames: classButtonSave, disabled: disabled, loading: loading, children: showTextbutton ? (textSave !== null && textSave !== void 0 ? textSave : 'Save') : undefined }, saveMethod)), jsxRuntimeExports.jsx(ButtonComponent, { tooltip: !showTextbutton ? { title: textEdit !== null && textEdit !== void 0 ? textEdit : 'Edit' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$3, {}), classNames: classButtonEdit, disabled: disabled, onClick: event => {
|
|
56
|
+
setEditing === null || setEditing === void 0 ? void 0 : setEditing(true);
|
|
57
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(event);
|
|
58
|
+
}, children: showTextbutton ? (textEdit !== null && textEdit !== void 0 ? textEdit : 'Edit') : undefined })] }));
|
|
53
59
|
return col ? (jsxRuntimeExports.jsx(Row, { children: jsxRuntimeExports.jsx(Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
54
60
|
};
|
|
55
61
|
var Component = React__default.memo(ButtonGroupEditComponent);
|
|
@@ -12,7 +12,7 @@ var CloseCircleOutlined = require('../../../../node_modules/@ant-design/icons/es
|
|
|
12
12
|
var SaveOutlined = require('../../../../node_modules/@ant-design/icons/es/icons/SaveOutlined.js');
|
|
13
13
|
var EditOutlined = require('../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js');
|
|
14
14
|
|
|
15
|
-
const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit = true, editing, setEditing, showTextbutton, textBack, textCancel, textSave, textEdit, onBack, onSave, classNames, className, }) => {
|
|
15
|
+
const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit = true, editing, setEditing, showTextbutton, textBack, textCancel, textSave, textEdit, onBack, onCancel, onSave, onEdit, classNames, className, }) => {
|
|
16
16
|
const saveMethod = onSave
|
|
17
17
|
? { onClick: onSave }
|
|
18
18
|
: { htmlType: 'submit' };
|
|
@@ -51,7 +51,13 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
51
51
|
(className === null || className === void 0 ? void 0 : className.buttonEdit) && classButtonEditNames.push(...className.buttonEdit);
|
|
52
52
|
return classButtonEditNames;
|
|
53
53
|
}, [style_module, className, allowEdit, editing]);
|
|
54
|
-
const buttonGroup = (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: classButton.join(' '), children: [jsxRuntime.jsxRuntimeExports.jsx(Component$1, { tooltip: !showTextbutton ? { title: textBack !== null && textBack !== void 0 ? textBack : 'Back' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(ArrowLeftOutlined, {}), classNames: classButtonBack, disabled: disabled, onClick: onBack, children: showTextbutton ? (textBack !== null && textBack !== void 0 ? textBack : 'Back') : undefined }), jsxRuntime.jsxRuntimeExports.jsx(Component$1, { tooltip: !showTextbutton ? { title: textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(CloseCircleOutlined, {}), classNames: classButtonCancel, disabled: disabled, onClick:
|
|
54
|
+
const buttonGroup = (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: classButton.join(' '), children: [jsxRuntime.jsxRuntimeExports.jsx(Component$1, { tooltip: !showTextbutton ? { title: textBack !== null && textBack !== void 0 ? textBack : 'Back' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(ArrowLeftOutlined, {}), classNames: classButtonBack, disabled: disabled, onClick: onBack, children: showTextbutton ? (textBack !== null && textBack !== void 0 ? textBack : 'Back') : undefined }), jsxRuntime.jsxRuntimeExports.jsx(Component$1, { tooltip: !showTextbutton ? { title: textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(CloseCircleOutlined, {}), classNames: classButtonCancel, disabled: disabled, onClick: event => {
|
|
55
|
+
setEditing === null || setEditing === void 0 ? void 0 : setEditing(false);
|
|
56
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel(event);
|
|
57
|
+
}, children: showTextbutton ? (textCancel !== null && textCancel !== void 0 ? textCancel : 'Cancel') : undefined }), jsxRuntime.jsxRuntimeExports.jsx(Component$1, Object.assign({ tooltip: !showTextbutton ? { title: textSave !== null && textSave !== void 0 ? textSave : 'Save' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(SaveOutlined, {}), type: "primary", classNames: classButtonSave, disabled: disabled, loading: loading, children: showTextbutton ? (textSave !== null && textSave !== void 0 ? textSave : 'Save') : undefined }, saveMethod)), jsxRuntime.jsxRuntimeExports.jsx(Component$1, { tooltip: !showTextbutton ? { title: textEdit !== null && textEdit !== void 0 ? textEdit : 'Edit' } : undefined, icon: jsxRuntime.jsxRuntimeExports.jsx(EditOutlined, {}), classNames: classButtonEdit, disabled: disabled, onClick: event => {
|
|
58
|
+
setEditing === null || setEditing === void 0 ? void 0 : setEditing(true);
|
|
59
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(event);
|
|
60
|
+
}, children: showTextbutton ? (textEdit !== null && textEdit !== void 0 ? textEdit : 'Edit') : undefined })] }));
|
|
55
61
|
return col ? (jsxRuntime.jsxRuntimeExports.jsx(antd.Row, { children: jsxRuntime.jsxRuntimeExports.jsx(antd.Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
56
62
|
};
|
|
57
63
|
var Component = React.memo(ButtonGroupEditComponent);
|
|
@@ -13,7 +13,9 @@ export interface ButtonGroupEditComponentProps {
|
|
|
13
13
|
textSave?: string;
|
|
14
14
|
textEdit?: string;
|
|
15
15
|
onBack?: ButtonComponentProps['onClick'];
|
|
16
|
+
onCancel?: ButtonComponentProps['onClick'];
|
|
16
17
|
onSave?: ButtonComponentProps['onClick'];
|
|
18
|
+
onEdit?: ButtonComponentProps['onClick'];
|
|
17
19
|
classNames?: string[];
|
|
18
20
|
className?: {
|
|
19
21
|
buttonBack?: string[];
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sti-antd-package",
|
|
3
3
|
"description": "STI ANT Design",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"type": "module",
|
|
4
|
+
"version": "0.0.56",
|
|
6
5
|
"main": "dist/lib/index.js",
|
|
7
6
|
"module": "dist/esm/index.js",
|
|
8
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -72,6 +71,8 @@
|
|
|
72
71
|
"tslib": "^2.8.1"
|
|
73
72
|
},
|
|
74
73
|
"dependencies": {
|
|
75
|
-
"dayjs": "^1.11.13"
|
|
74
|
+
"dayjs": "^1.11.13",
|
|
75
|
+
"rc-table": "^7.55.1",
|
|
76
|
+
"rc-upload": "^4.11.0"
|
|
76
77
|
}
|
|
77
78
|
}
|