sti-antd-package 0.0.32 → 0.0.34

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.
@@ -61,6 +61,12 @@ export type TableButtonMiddleAsync = TableButtonMiddle & {
61
61
  };
62
62
  export interface TableAsyncComponentRef {
63
63
  reload: () => void;
64
+ getTableStates: () => {
65
+ tableParams: TableParams | undefined;
66
+ tableSearch: string | undefined;
67
+ selectedRowKeys: React.Key[] | undefined;
68
+ };
69
+ tableParams: () => TableParams | undefined;
64
70
  filters: () => AnyObject | undefined;
65
71
  tableSearch: () => string | undefined;
66
72
  selectedRowKeys: () => React.Key[] | undefined;
@@ -1,8 +1,10 @@
1
1
  import { formColLayout } from "../../../constants";
2
2
  import { ValidateStatus } from "antd/es/form/FormItem";
3
3
  import { RcFile } from "antd/es/upload";
4
- import { UploadListType } from "antd/es/upload/interface";
4
+ import { UploadChangeParam, UploadFile, UploadListType } from "antd/es/upload/interface";
5
5
  import { Rule, RuleObject } from "rc-field-form/lib/interface";
6
+ import { UploadRequestOption } from "rc-upload/lib/interface";
7
+ type BeforeUploadValueType = void | boolean | string | Blob | File;
6
8
  export interface UploadDraggerComponentProps {
7
9
  noItem?: boolean;
8
10
  multiple?: boolean;
@@ -12,6 +14,12 @@ export interface UploadDraggerComponentProps {
12
14
  rootClassNames?: string[];
13
15
  classNames?: string[];
14
16
  action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
17
+ withCredentials?: boolean;
18
+ beforeUpload?: ((file: RcFile, fileList: RcFile[]) => BeforeUploadValueType | Promise<BeforeUploadValueType>);
19
+ customRequest?: (options: UploadRequestOption<any>) => void;
20
+ onChange?: (info: UploadChangeParam<UploadFile<any>>) => void;
21
+ onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
22
+ defaultFileList?: UploadFile<any>[];
15
23
  formColLayout?: typeof formColLayout;
16
24
  name?: string;
17
25
  label?: React.ReactNode;
@@ -22,3 +30,4 @@ export interface UploadDraggerComponentProps {
22
30
  validateStatus?: ValidateStatus;
23
31
  help?: React.ReactNode;
24
32
  }
33
+ export {};
package/dist/index.d.ts CHANGED
@@ -30,7 +30,8 @@ import { TableProps } from 'rc-table';
30
30
  import { GetRowKey, ExpandableConfig } from 'rc-table/lib/interface';
31
31
  import { TabsType, TabsPosition, TabsProps } from 'antd/es/tabs';
32
32
  import { RcFile } from 'antd/es/upload';
33
- import { UploadListType } from 'antd/es/upload/interface';
33
+ import { UploadListType, UploadChangeParam, UploadFile } from 'antd/es/upload/interface';
34
+ import { UploadRequestOption } from 'rc-upload/lib/interface';
34
35
  import { MessageInstance } from 'antd/es/message/interface';
35
36
  import { HookAPI } from 'antd/es/modal/useModal';
36
37
  import { NotificationInstance } from 'antd/es/notification/interface';
@@ -992,6 +993,12 @@ type TableButtonMiddleAsync = TableButtonMiddle & {
992
993
  };
993
994
  interface TableAsyncComponentRef {
994
995
  reload: () => void;
996
+ getTableStates: () => {
997
+ tableParams: TableParams | undefined;
998
+ tableSearch: string | undefined;
999
+ selectedRowKeys: React.Key[] | undefined;
1000
+ };
1001
+ tableParams: () => TableParams | undefined;
995
1002
  filters: () => AnyObject | undefined;
996
1003
  tableSearch: () => string | undefined;
997
1004
  selectedRowKeys: () => React.Key[] | undefined;
@@ -1100,6 +1107,7 @@ interface TextAreaComponentProps {
1100
1107
 
1101
1108
  declare const _default: React$1.NamedExoticComponent<TextAreaComponentProps>;
1102
1109
 
1110
+ type BeforeUploadValueType = void | boolean | string | Blob | File;
1103
1111
  interface UploadDraggerComponentProps {
1104
1112
  noItem?: boolean;
1105
1113
  multiple?: boolean;
@@ -1109,6 +1117,12 @@ interface UploadDraggerComponentProps {
1109
1117
  rootClassNames?: string[];
1110
1118
  classNames?: string[];
1111
1119
  action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
1120
+ withCredentials?: boolean;
1121
+ beforeUpload?: ((file: RcFile, fileList: RcFile[]) => BeforeUploadValueType | Promise<BeforeUploadValueType>);
1122
+ customRequest?: (options: UploadRequestOption<any>) => void;
1123
+ onChange?: (info: UploadChangeParam<UploadFile<any>>) => void;
1124
+ onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
1125
+ defaultFileList?: UploadFile<any>[];
1112
1126
  formColLayout?: typeof _default$i;
1113
1127
  name?: string;
1114
1128
  label?: React.ReactNode;
package/dist/index.esm.js CHANGED
@@ -8642,6 +8642,8 @@ const TableAsyncChildrenComponent = (_a) => {
8642
8642
  } : undefined;
8643
8643
  useImperativeHandle(ref, () => ({
8644
8644
  reload: () => fetchData === null || fetchData === void 0 ? void 0 : fetchData(),
8645
+ getTableStates: () => ({ tableParams, tableSearch, selectedRowKeys }),
8646
+ tableParams: () => tableParams,
8645
8647
  filters: () => filters,
8646
8648
  tableSearch: () => tableSearch,
8647
8649
  selectedRowKeys: () => selectedRowKeys,
@@ -23510,28 +23512,13 @@ const normFile = (event) => {
23510
23512
  return event;
23511
23513
  return event && event['fileList'];
23512
23514
  };
23513
- const UploadDraggerComponent = ({ noItem, readonly, multiple, disabled, listType, rootClassNames, classNames, action, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
23515
+ const UploadDraggerComponent = ({ noItem, readonly, multiple, disabled, listType, rootClassNames, classNames, action, withCredentials, beforeUpload, customRequest, onChange, onDrop, defaultFileList, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
23514
23516
  const rootClassDragger = [];
23515
23517
  rootClassNames && rootClassDragger.push(...rootClassNames);
23516
23518
  const classDragger = [];
23517
23519
  classNames && classDragger.push(...classNames);
23518
23520
  readonly && classDragger.push(styleDragger['readonly']);
23519
- const onChange = (info) => {
23520
- const { status } = info.file;
23521
- if (status !== 'uploading') {
23522
- console.log(info.file, info.fileList);
23523
- }
23524
- if (status === 'done') {
23525
- message.success(`${info.file.name} file uploaded successfully.`);
23526
- }
23527
- else if (status === 'error') {
23528
- message.error(`${info.file.name} file upload failed.`);
23529
- }
23530
- };
23531
- const onDrop = (e) => {
23532
- console.log('Dropped files', e.dataTransfer.files);
23533
- };
23534
- const dragger = (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readonly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), action: action, onChange: onChange, onDrop: onDrop, children: [jsxRuntimeExports.jsx("p", { className: "ant-upload-drag-icon", children: jsxRuntimeExports.jsx(RefIcon$6, {}) }), jsxRuntimeExports.jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), jsxRuntimeExports.jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] }));
23521
+ const dragger = (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readonly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), action: action, withCredentials: withCredentials, beforeUpload: beforeUpload, customRequest: customRequest, onChange: onChange, onDrop: onDrop, defaultFileList: defaultFileList, children: [jsxRuntimeExports.jsx("p", { className: "ant-upload-drag-icon", children: jsxRuntimeExports.jsx(RefIcon$6, {}) }), jsxRuntimeExports.jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), jsxRuntimeExports.jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] }));
23535
23522
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "fileList", getValueFromEvent: normFile, validateStatus: validateStatus, help: help, children: dragger })))
23536
23523
  : dragger }));
23537
23524
  };
package/dist/index.js CHANGED
@@ -8661,6 +8661,8 @@ const TableAsyncChildrenComponent = (_a) => {
8661
8661
  } : undefined;
8662
8662
  React.useImperativeHandle(ref, () => ({
8663
8663
  reload: () => fetchData === null || fetchData === void 0 ? void 0 : fetchData(),
8664
+ getTableStates: () => ({ tableParams, tableSearch, selectedRowKeys }),
8665
+ tableParams: () => tableParams,
8664
8666
  filters: () => filters,
8665
8667
  tableSearch: () => tableSearch,
8666
8668
  selectedRowKeys: () => selectedRowKeys,
@@ -23529,28 +23531,13 @@ const normFile = (event) => {
23529
23531
  return event;
23530
23532
  return event && event['fileList'];
23531
23533
  };
23532
- const UploadDraggerComponent = ({ noItem, readonly, multiple, disabled, listType, rootClassNames, classNames, action, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
23534
+ const UploadDraggerComponent = ({ noItem, readonly, multiple, disabled, listType, rootClassNames, classNames, action, withCredentials, beforeUpload, customRequest, onChange, onDrop, defaultFileList, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
23533
23535
  const rootClassDragger = [];
23534
23536
  rootClassNames && rootClassDragger.push(...rootClassNames);
23535
23537
  const classDragger = [];
23536
23538
  classNames && classDragger.push(...classNames);
23537
23539
  readonly && classDragger.push(styleDragger['readonly']);
23538
- const onChange = (info) => {
23539
- const { status } = info.file;
23540
- if (status !== 'uploading') {
23541
- console.log(info.file, info.fileList);
23542
- }
23543
- if (status === 'done') {
23544
- antd.message.success(`${info.file.name} file uploaded successfully.`);
23545
- }
23546
- else if (status === 'error') {
23547
- antd.message.error(`${info.file.name} file upload failed.`);
23548
- }
23549
- };
23550
- const onDrop = (e) => {
23551
- console.log('Dropped files', e.dataTransfer.files);
23552
- };
23553
- const dragger = (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readonly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), action: action, onChange: onChange, onDrop: onDrop, children: [jsxRuntimeExports.jsx("p", { className: "ant-upload-drag-icon", children: jsxRuntimeExports.jsx(RefIcon$6, {}) }), jsxRuntimeExports.jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), jsxRuntimeExports.jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] }));
23540
+ const dragger = (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readonly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), action: action, withCredentials: withCredentials, beforeUpload: beforeUpload, customRequest: customRequest, onChange: onChange, onDrop: onDrop, defaultFileList: defaultFileList, children: [jsxRuntimeExports.jsx("p", { className: "ant-upload-drag-icon", children: jsxRuntimeExports.jsx(RefIcon$6, {}) }), jsxRuntimeExports.jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), jsxRuntimeExports.jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] }));
23554
23541
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "fileList", getValueFromEvent: normFile, validateStatus: validateStatus, help: help, children: dragger })))
23555
23542
  : dragger }));
23556
23543
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sti-antd-package",
3
3
  "description": "STI ANT Design",
4
- "version": "0.0.32",
4
+ "version": "0.0.34",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",