sti-antd-package 0.0.35 → 0.0.37
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CardProps } from "antd";
|
|
2
|
+
import { CardMetaProps } from "antd/es/card";
|
|
2
3
|
import { CardSize } from "antd/es/card/Card";
|
|
3
4
|
export interface CardComponentProps {
|
|
4
5
|
size?: CardSize;
|
|
@@ -6,7 +7,11 @@ export interface CardComponentProps {
|
|
|
6
7
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
7
8
|
classNames?: string[];
|
|
8
9
|
className?: CardProps['classNames'];
|
|
10
|
+
actions?: React.ReactNode[];
|
|
9
11
|
style?: React.CSSProperties;
|
|
10
12
|
styles?: CardProps['styles'];
|
|
11
13
|
children?: React.ReactNode;
|
|
12
14
|
}
|
|
15
|
+
export type CardComponentType = React.FC<CardComponentProps> & {
|
|
16
|
+
Meta: React.FC<CardMetaProps>;
|
|
17
|
+
};
|
|
@@ -12,16 +12,19 @@ export interface TableButtonMiddle {
|
|
|
12
12
|
export interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
|
|
13
13
|
noPagination?: boolean;
|
|
14
14
|
buttonReload?: {
|
|
15
|
+
text?: boolean;
|
|
15
16
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
16
17
|
href?: string;
|
|
17
18
|
};
|
|
18
19
|
buttonAdd?: {
|
|
20
|
+
text?: boolean;
|
|
19
21
|
disabled?: boolean;
|
|
20
22
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
21
23
|
href?: string;
|
|
22
24
|
};
|
|
23
25
|
buttonMiddle?: TableButtonMiddle[];
|
|
24
26
|
buttonDelete?: {
|
|
27
|
+
text?: boolean;
|
|
25
28
|
disabled?: boolean;
|
|
26
29
|
onClick?: (event: React.MouseEvent<HTMLElement>, selectedRowKeys: React.Key[] | undefined) => void;
|
|
27
30
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { TooltipPlacement } from 'antd/es/tooltip';
|
|
|
4
4
|
import React$1, { Ref, JSXElementConstructor } from 'react';
|
|
5
5
|
import { CardProps, CheckboxChangeEvent, CheckboxOptionType, DatePickerProps as DatePickerProps$1, DatePicker, DropDownProps, RadioChangeEvent, SelectProps, ThemeConfig, TablePaginationConfig as TablePaginationConfig$1, FormInstance, TagProps } from 'antd';
|
|
6
6
|
export { Form } from 'antd';
|
|
7
|
+
import { CardMetaProps } from 'antd/es/card';
|
|
7
8
|
import { CardSize } from 'antd/es/card/Card';
|
|
8
9
|
import { Variant } from 'antd/es/config-provider';
|
|
9
10
|
import { ValidateStatus } from 'antd/es/form/FormItem';
|
|
@@ -153,12 +154,16 @@ interface CardComponentProps {
|
|
|
153
154
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
154
155
|
classNames?: string[];
|
|
155
156
|
className?: CardProps['classNames'];
|
|
157
|
+
actions?: React.ReactNode[];
|
|
156
158
|
style?: React.CSSProperties;
|
|
157
159
|
styles?: CardProps['styles'];
|
|
158
160
|
children?: React.ReactNode;
|
|
159
161
|
}
|
|
162
|
+
type CardComponentType = React.FC<CardComponentProps> & {
|
|
163
|
+
Meta: React.FC<CardMetaProps>;
|
|
164
|
+
};
|
|
160
165
|
|
|
161
|
-
declare const CardComponent:
|
|
166
|
+
declare const CardComponent: CardComponentType;
|
|
162
167
|
|
|
163
168
|
interface CascaderComponentRef<OptionType extends DefaultOptionType, ValueField extends keyof OptionType> {
|
|
164
169
|
value: () => CascaderProps<OptionType, ValueField>['value'];
|
|
@@ -730,16 +735,19 @@ interface TableButtonMiddle {
|
|
|
730
735
|
interface TableComponentProps<T extends (BaseModel<T> | AnyObject)> {
|
|
731
736
|
noPagination?: boolean;
|
|
732
737
|
buttonReload?: {
|
|
738
|
+
text?: boolean;
|
|
733
739
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
734
740
|
href?: string;
|
|
735
741
|
};
|
|
736
742
|
buttonAdd?: {
|
|
743
|
+
text?: boolean;
|
|
737
744
|
disabled?: boolean;
|
|
738
745
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
739
746
|
href?: string;
|
|
740
747
|
};
|
|
741
748
|
buttonMiddle?: TableButtonMiddle[];
|
|
742
749
|
buttonDelete?: {
|
|
750
|
+
text?: boolean;
|
|
743
751
|
disabled?: boolean;
|
|
744
752
|
onClick?: (event: React.MouseEvent<HTMLElement>, selectedRowKeys: React.Key[] | undefined) => void;
|
|
745
753
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -3880,9 +3880,10 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
3880
3880
|
};
|
|
3881
3881
|
var Component$6 = React__default.memo(ButtonGroupEditComponent);
|
|
3882
3882
|
|
|
3883
|
-
const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
|
|
3884
|
-
return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
|
|
3883
|
+
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
|
|
3884
|
+
return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
|
|
3885
3885
|
};
|
|
3886
|
+
CardComponent.Meta = Card.Meta;
|
|
3886
3887
|
|
|
3887
3888
|
const { Item: Item$1 } = Form$2;
|
|
3888
3889
|
const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, getValueFromEvent, validateStatus, help, shouldUpdate, children, }) => {
|
|
@@ -8413,7 +8414,7 @@ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, b
|
|
|
8413
8414
|
classNames: classNamesClone,
|
|
8414
8415
|
});
|
|
8415
8416
|
};
|
|
8416
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(Col, Object.assign({}, styleProps$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: { title:
|
|
8417
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(Col, Object.assign({}, styleProps$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: [styleTable['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$5, {}), classNames: [styleTable['button']], disabled: buttonAdd.disabled, onClick: buttonAdd.onClick, href: buttonAdd.href, children: buttonAdd.text ? 'Add' : undefined })), (_b = buttonMiddle === null || buttonMiddle === void 0 ? void 0 : buttonMiddle.map) === null || _b === void 0 ? void 0 : _b.call(buttonMiddle, buttonMiddleClone), buttonDelete && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$b, {}), classNames: [styleTable['button']], disabled: buttonDelete.disabled || loading, onClick: event => { var _a; (_a = buttonDelete.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonDelete, event, undefined); }, children: buttonDelete.text ? 'Delete' : undefined }))] })), jsxRuntimeExports.jsxs(Col, Object.assign({}, styleProps$1.col, { children: [search && (jsxRuntimeExports.jsx(InputComponent$1, { noItem: true, placeholder: "Search", classNames: [styleTable['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntimeExports.jsx(RefIcon$2, { onClick: search.onSearch }), allowClear: {
|
|
8417
8418
|
clearIcon: (jsxRuntimeExports.jsx(RefIcon$e, { onClick: search.onClear })),
|
|
8418
8419
|
} })), buttonFilter] }))] }), jsxRuntimeExports.jsx(Table, { showSorterTooltip: true, tableLayout: "fixed", className: "table-data", rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
8419
8420
|
};
|
package/dist/index.js
CHANGED
|
@@ -3899,9 +3899,10 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
3899
3899
|
};
|
|
3900
3900
|
var Component$6 = React.memo(ButtonGroupEditComponent);
|
|
3901
3901
|
|
|
3902
|
-
const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
|
|
3903
|
-
return (jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
|
|
3902
|
+
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
|
|
3903
|
+
return (jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
|
|
3904
3904
|
};
|
|
3905
|
+
CardComponent.Meta = antd.Card.Meta;
|
|
3905
3906
|
|
|
3906
3907
|
const { Item: Item$1 } = antd.Form;
|
|
3907
3908
|
const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, getValueFromEvent, validateStatus, help, shouldUpdate, children, }) => {
|
|
@@ -8432,7 +8433,7 @@ const TableComponent = ({ noPagination, buttonReload, buttonAdd, buttonMiddle, b
|
|
|
8432
8433
|
classNames: classNamesClone,
|
|
8433
8434
|
});
|
|
8434
8435
|
};
|
|
8435
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(antd.Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: { title:
|
|
8436
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(antd.Row, { className: styleTable['row-top'], children: [jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps$1.col, { children: [buttonReload && (jsxRuntimeExports.jsx(ButtonComponent$1, { tooltip: !buttonReload.text ? { title: 'Reload' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), classNames: [styleTable['button']], loading: loading, onClick: buttonReload.onClick, href: buttonReload.href, children: buttonReload.text ? 'Reload' : undefined })), buttonAdd && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonAdd.text ? { title: 'Add' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$5, {}), classNames: [styleTable['button']], disabled: buttonAdd.disabled, onClick: buttonAdd.onClick, href: buttonAdd.href, children: buttonAdd.text ? 'Add' : undefined })), (_b = buttonMiddle === null || buttonMiddle === void 0 ? void 0 : buttonMiddle.map) === null || _b === void 0 ? void 0 : _b.call(buttonMiddle, buttonMiddleClone), buttonDelete && (jsxRuntimeExports.jsx(ButtonComponent$1, { type: "primary", tooltip: !buttonDelete.text ? { title: 'Delete' } : undefined, icon: jsxRuntimeExports.jsx(RefIcon$b, {}), classNames: [styleTable['button']], disabled: buttonDelete.disabled || loading, onClick: event => { var _a; (_a = buttonDelete.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonDelete, event, undefined); }, children: buttonDelete.text ? 'Delete' : undefined }))] })), jsxRuntimeExports.jsxs(antd.Col, Object.assign({}, styleProps$1.col, { children: [search && (jsxRuntimeExports.jsx(InputComponent$1, { noItem: true, placeholder: "Search", classNames: [styleTable['input-search']], readOnly: loading, onChange: search.onChange, onPressEnter: search.onPressEnter, suffix: jsxRuntimeExports.jsx(RefIcon$2, { onClick: search.onSearch }), allowClear: {
|
|
8436
8437
|
clearIcon: (jsxRuntimeExports.jsx(RefIcon$e, { onClick: search.onClear })),
|
|
8437
8438
|
} })), buttonFilter] }))] }), jsxRuntimeExports.jsx(antd.Table, { showSorterTooltip: true, tableLayout: "fixed", className: "table-data", rowClassName: rowClassName, size: size !== null && size !== void 0 ? size : 'middle', columns: columns, rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : 'id', dataSource: data, expandable: expandable, pagination: !noPagination && Object.assign({ pageSizeOptions: ['10', '20', '50', '100', '200'], showSizeChanger: true, showQuickJumper: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items` }, pagination), loading: loading, scroll: scroll !== null && scroll !== void 0 ? scroll : { y: 'calc(100vh - 300px)' }, sticky: sticky, components: components, summary: summary, onChange: onChange, rowSelection: rowSelectionTable, style: style })] }));
|
|
8438
8439
|
};
|