@thefreshop/tb 1.0.24 → 1.0.26
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/cjs/index.js +8 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/antBaseTable.types.d.ts +13 -13
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/antBaseTable.types.d.ts +13 -13
- package/dist/index.d.ts +10 -10
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AnyObject } from
|
|
2
|
-
import type { ExpandableConfig, GetRowKey, TablePaginationConfig, TableRowSelection } from
|
|
3
|
-
import type { ColumnGroupType, ColumnType, TableProps } from
|
|
1
|
+
import type { AnyObject } from "antd/es/_util/type";
|
|
2
|
+
import type { ExpandableConfig, GetRowKey, TablePaginationConfig, TableRowSelection } from "antd/es/table/interface";
|
|
3
|
+
import type { ColumnGroupType, ColumnType, TableProps } from "antd/es/table";
|
|
4
4
|
export interface AntBaseTableRefProps<ItemType> {
|
|
5
5
|
resetSelection: () => void;
|
|
6
6
|
reSelection: () => void;
|
|
@@ -19,7 +19,7 @@ export type antBasePropsType<T = AnyObject, K = string | GetRowKey<T>> = {
|
|
|
19
19
|
customValue?: (data: any) => any;
|
|
20
20
|
columns: antBaseColumnType[];
|
|
21
21
|
expandable?: ExpandableConfig<AnyObject>;
|
|
22
|
-
size?:
|
|
22
|
+
size?: "large" | "middle" | "small";
|
|
23
23
|
onClick?: (record: T, index?: number) => void;
|
|
24
24
|
onDoubleClick?: (record: T, index?: number) => void;
|
|
25
25
|
selectProps?: selectType<T>;
|
|
@@ -39,11 +39,11 @@ export type antBasePropsType<T = AnyObject, K = string | GetRowKey<T>> = {
|
|
|
39
39
|
upProps?: btnReturnTType<T>;
|
|
40
40
|
downProps?: btnReturnTType<T>;
|
|
41
41
|
pageProps?: TablePaginationConfig | false;
|
|
42
|
-
scroll?: TableProps<AnyObject>[
|
|
42
|
+
scroll?: TableProps<AnyObject>["scroll"];
|
|
43
43
|
onRefresh?: () => void;
|
|
44
44
|
isCounter?: boolean;
|
|
45
45
|
autoRefreshTime?: number;
|
|
46
|
-
createModalWidth?: React.CSSProperties[
|
|
46
|
+
createModalWidth?: React.CSSProperties["width"];
|
|
47
47
|
onCreateClose?: () => void;
|
|
48
48
|
};
|
|
49
49
|
export type antBaseColumnType = {
|
|
@@ -52,9 +52,9 @@ export type antBaseColumnType = {
|
|
|
52
52
|
};
|
|
53
53
|
formatProps?: {
|
|
54
54
|
hidden?: boolean;
|
|
55
|
-
type:
|
|
55
|
+
type: "tag" | "json_tags" | "tagarr" | "switch" | "price" | "length" | "tel" | "file" | "files" | "copy" | "email" | "image" | "images" | "addcount" | "tostring" | "jsonarr" | "arr" | "sleeptime" | "sleeptimes" | "compute" | "answer" | "number" | "select" | "DateTime" | "imageCrop" | "password" | "code" | "textEditer" | "string" | "custom" | "remainingtime";
|
|
56
56
|
formatter?: {
|
|
57
|
-
text:
|
|
57
|
+
text: "default" | string | undefined | null;
|
|
58
58
|
asText: string;
|
|
59
59
|
color: string;
|
|
60
60
|
}[];
|
|
@@ -68,8 +68,8 @@ export type antBaseColumnType = {
|
|
|
68
68
|
title: any;
|
|
69
69
|
onChange: (data: any) => void;
|
|
70
70
|
}) => any;
|
|
71
|
-
image_width?: React.CSSProperties[
|
|
72
|
-
image_height?: React.CSSProperties[
|
|
71
|
+
image_width?: React.CSSProperties["width"];
|
|
72
|
+
image_height?: React.CSSProperties["height"];
|
|
73
73
|
imagesId?: string;
|
|
74
74
|
};
|
|
75
75
|
sort?: boolean;
|
|
@@ -80,7 +80,7 @@ export type antBaseColumnType = {
|
|
|
80
80
|
countIndex?: string;
|
|
81
81
|
tooltip?: any;
|
|
82
82
|
placeholder?: any;
|
|
83
|
-
|
|
83
|
+
initialValues?: any;
|
|
84
84
|
rules?: any[];
|
|
85
85
|
};
|
|
86
86
|
export type btnReturnTType<T> = {
|
|
@@ -105,8 +105,8 @@ export type customBtnReturnFType = {
|
|
|
105
105
|
rightRender?: () => React.ReactNode;
|
|
106
106
|
};
|
|
107
107
|
export type selectType<T> = {
|
|
108
|
-
type:
|
|
108
|
+
type: "radio" | "checkbox";
|
|
109
109
|
onFun?: (key: T | React.Key[]) => void;
|
|
110
|
-
checkboxProps?: TableRowSelection<AnyObject>[
|
|
110
|
+
checkboxProps?: TableRowSelection<AnyObject>["getCheckboxProps"];
|
|
111
111
|
onUpdateData?: (data?: T) => void;
|
|
112
112
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -554,7 +554,7 @@ const TbFrame = ({ setting, top, bottom, nav, top_banner, hashmode = false, }) =
|
|
|
554
554
|
},
|
|
555
555
|
]);
|
|
556
556
|
}
|
|
557
|
-
}, [hashmode, user]);
|
|
557
|
+
}, [hashmode, user, top, nav, setting, top_banner, bottom]);
|
|
558
558
|
return React__default.createElement(RouterProvider, { router: router });
|
|
559
559
|
};
|
|
560
560
|
const MainLayout = ({ errMsg, setting, top_banner, nav, user, top, bottom, }) => {
|
|
@@ -23064,7 +23064,7 @@ const useFormColumns = ({ isModify, columns, onChange, }) => {
|
|
|
23064
23064
|
}
|
|
23065
23065
|
else if (i.formatProps.type === "code") {
|
|
23066
23066
|
ant_form.push(React__default.createElement(Form.Item, { key: i.tableProps.dataIndex, name: i.tableProps.dataIndex, label: i.tableProps.title, tooltip: i.tooltip, rules: i.rules, hidden: i.formatProps.hidden },
|
|
23067
|
-
React__default.createElement(Input, { ...i.formatProps.itemProps, placeholder: i.placeholder,
|
|
23067
|
+
React__default.createElement(Input, { ...i.formatProps.itemProps, placeholder: i.placeholder, initialValues: moment$1().format("X") })));
|
|
23068
23068
|
}
|
|
23069
23069
|
else if (i.formatProps.type === "switch") {
|
|
23070
23070
|
ant_form.push(React__default.createElement(Form.Item, { key: i.tableProps.dataIndex, name: i.tableProps.dataIndex, label: i.tableProps.title, tooltip: i.tooltip, rules: i.rules, hidden: i.formatProps.hidden },
|
|
@@ -23202,7 +23202,7 @@ const useFormColumns = ({ isModify, columns, onChange, }) => {
|
|
|
23202
23202
|
* @author 송영내
|
|
23203
23203
|
*/
|
|
23204
23204
|
const UploadImage = (props) => {
|
|
23205
|
-
const { onChange, value } = props;
|
|
23205
|
+
const { onChange, value, maxWidth = 500, maxHeight = 500, compressFormat = "PNG", quality = 100, outputType = "blob" } = props;
|
|
23206
23206
|
// const readfileData = (file: any) => {
|
|
23207
23207
|
// return new Promise<string>((resolve, reject) => {
|
|
23208
23208
|
// if (file) {
|
|
@@ -23217,17 +23217,17 @@ const UploadImage = (props) => {
|
|
|
23217
23217
|
// })
|
|
23218
23218
|
// }
|
|
23219
23219
|
const resizeFile = (file) => new Promise((resolve) => {
|
|
23220
|
-
Resizer.imageFileResizer(file,
|
|
23220
|
+
Resizer.imageFileResizer(file, maxWidth, maxHeight, compressFormat, quality, 0, (uri) => {
|
|
23221
23221
|
resolve(uri);
|
|
23222
|
-
},
|
|
23222
|
+
}, outputType);
|
|
23223
23223
|
});
|
|
23224
23224
|
return (React__default.createElement(Flex, { style: { padding: 2, alignItems: "center" }, gap: 3 },
|
|
23225
23225
|
React__default.createElement(Image$1, { src: value ?? baseImage, width: 50, height: 50 }),
|
|
23226
|
-
React__default.createElement(ImgCrop, { showGrid: true, modalWidth: 800, zoomSlider: true, quality: 1, modalClassName: "ImgCropModal", modalProps: { style: { height:
|
|
23227
|
-
cropSize: { width:
|
|
23226
|
+
React__default.createElement(ImgCrop, { showGrid: true, modalWidth: 800, zoomSlider: true, quality: 1, minZoom: 0.1, modalClassName: "ImgCropModal", modalProps: { style: { height: 600 } }, cropperProps: {
|
|
23227
|
+
cropSize: { width: maxWidth, height: maxHeight },
|
|
23228
23228
|
style: {},
|
|
23229
23229
|
mediaProps: {},
|
|
23230
|
-
zoomSpeed: 1,
|
|
23230
|
+
zoomSpeed: 0.1,
|
|
23231
23231
|
restrictPosition: false,
|
|
23232
23232
|
keyboardStep: 1,
|
|
23233
23233
|
} },
|