sti-antd-package 0.0.50 → 0.0.52
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.
|
@@ -6,7 +6,7 @@ export interface CheckboxGroupComponentRef<T> {
|
|
|
6
6
|
setValue: React.Dispatch<React.SetStateAction<T[]>>;
|
|
7
7
|
}
|
|
8
8
|
export interface CheckboxOptionAdditional {
|
|
9
|
-
|
|
9
|
+
readOnly?: boolean;
|
|
10
10
|
}
|
|
11
11
|
interface CheckboxGroup<T> {
|
|
12
12
|
options?: (CheckboxOptionType<T> & CheckboxOptionAdditional | string | number)[];
|
|
@@ -6,7 +6,7 @@ export interface CheckboxComponentRef {
|
|
|
6
6
|
setChecked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
7
|
}
|
|
8
8
|
interface Checkbox {
|
|
9
|
-
|
|
9
|
+
readOnly?: boolean;
|
|
10
10
|
checked?: boolean;
|
|
11
11
|
defaultChecked?: boolean;
|
|
12
12
|
onChange?: (event: CheckboxChangeEvent) => void;
|
|
@@ -5,7 +5,7 @@ import { UploadChangeParam, UploadFile, UploadListType } from "antd/es/upload/in
|
|
|
5
5
|
import { UploadRequestOption } from "rc-upload/lib/interface";
|
|
6
6
|
interface UploadDragger {
|
|
7
7
|
multiple?: boolean;
|
|
8
|
-
|
|
8
|
+
readOnly?: boolean;
|
|
9
9
|
listType?: UploadListType;
|
|
10
10
|
rootClassNames?: string[];
|
|
11
11
|
classNames?: string[];
|
|
@@ -16,6 +16,7 @@ interface UploadDragger {
|
|
|
16
16
|
customRequest?: (options: UploadRequestOption<any>) => void;
|
|
17
17
|
onChange?: (info: UploadChangeParam<UploadFile<any>>) => void;
|
|
18
18
|
onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
19
|
+
onPreview?: (file: UploadFile<any>) => void;
|
|
19
20
|
defaultFileList?: UploadFile<any>[];
|
|
20
21
|
}
|
|
21
22
|
export type UploadDraggerComponentProps = FormItemUploadDragger & UploadDragger;
|
package/dist/index.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ interface CheckboxComponentRef {
|
|
|
271
271
|
setChecked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
272
272
|
}
|
|
273
273
|
interface Checkbox {
|
|
274
|
-
|
|
274
|
+
readOnly?: boolean;
|
|
275
275
|
checked?: boolean;
|
|
276
276
|
defaultChecked?: boolean;
|
|
277
277
|
onChange?: (event: CheckboxChangeEvent) => void;
|
|
@@ -287,7 +287,7 @@ interface CheckboxGroupComponentRef<T> {
|
|
|
287
287
|
setValue: React$1.Dispatch<React$1.SetStateAction<T[]>>;
|
|
288
288
|
}
|
|
289
289
|
interface CheckboxOptionAdditional {
|
|
290
|
-
|
|
290
|
+
readOnly?: boolean;
|
|
291
291
|
}
|
|
292
292
|
interface CheckboxGroup<T> {
|
|
293
293
|
options?: (CheckboxOptionType<T> & CheckboxOptionAdditional | string | number)[];
|
|
@@ -1093,7 +1093,7 @@ type BeforeUploadValueType = void | boolean | string | Blob | File;
|
|
|
1093
1093
|
|
|
1094
1094
|
interface UploadDragger {
|
|
1095
1095
|
multiple?: boolean;
|
|
1096
|
-
|
|
1096
|
+
readOnly?: boolean;
|
|
1097
1097
|
listType?: UploadListType;
|
|
1098
1098
|
rootClassNames?: string[];
|
|
1099
1099
|
classNames?: string[];
|
|
@@ -1104,6 +1104,7 @@ interface UploadDragger {
|
|
|
1104
1104
|
customRequest?: (options: UploadRequestOption<any>) => void;
|
|
1105
1105
|
onChange?: (info: UploadChangeParam<UploadFile<any>>) => void;
|
|
1106
1106
|
onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
1107
|
+
onPreview?: (file: UploadFile<any>) => void;
|
|
1107
1108
|
defaultFileList?: UploadFile<any>[];
|
|
1108
1109
|
}
|
|
1109
1110
|
type UploadDraggerComponentProps = FormItemUploadDragger & UploadDragger;
|
package/dist/index.esm.js
CHANGED
|
@@ -3962,7 +3962,7 @@ var css_248z$f = ".style-module_readonly__EYTp- {\n cursor: default !important;
|
|
|
3962
3962
|
var style$3 = {"readonly":"style-module_readonly__EYTp-"};
|
|
3963
3963
|
styleInject(css_248z$f);
|
|
3964
3964
|
|
|
3965
|
-
const CheckboxComponent$1 = ({ noItem, loading, disabled,
|
|
3965
|
+
const CheckboxComponent$1 = ({ noItem, loading, disabled, readOnly, checked, defaultChecked, removeError, onChange, formColLayout, name, label, formClassNames, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, children, ref, }) => {
|
|
3966
3966
|
const [checkedValue, setCheckedValue] = useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
3967
3967
|
const handleChange = (event) => {
|
|
3968
3968
|
var _a;
|
|
@@ -3974,7 +3974,7 @@ const CheckboxComponent$1 = ({ noItem, loading, disabled, readonly, checked, def
|
|
|
3974
3974
|
checked: () => checkedValue,
|
|
3975
3975
|
setChecked: setCheckedValue,
|
|
3976
3976
|
}));
|
|
3977
|
-
const checkbox = !loading ? (jsxRuntimeExports.jsx(Checkbox, { disabled: disabled ||
|
|
3977
|
+
const checkbox = !loading ? (jsxRuntimeExports.jsx(Checkbox, { disabled: disabled || readOnly, className: readOnly ? style$3['readonly'] : undefined, checked: checked !== null && checked !== void 0 ? checked : checkedValue, defaultChecked: checkedValue, onChange: handleChange, children: children })) : jsxRuntimeExports.jsx(Skeleton.Input, { active: true });
|
|
3978
3978
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: checkbox })))
|
|
3979
3979
|
: checkbox }));
|
|
3980
3980
|
};
|
|
@@ -3999,8 +3999,8 @@ const CheckboxComponent = ({ noItem, loading, disabled, options, value, defaultV
|
|
|
3999
3999
|
value: option,
|
|
4000
4000
|
};
|
|
4001
4001
|
const className = [];
|
|
4002
|
-
if (isObject && option.
|
|
4003
|
-
checkboxProps.disabled = option.
|
|
4002
|
+
if (isObject && option.readOnly) {
|
|
4003
|
+
checkboxProps.disabled = option.readOnly;
|
|
4004
4004
|
className.push(style$3['readonly']);
|
|
4005
4005
|
}
|
|
4006
4006
|
checkboxProps.className = className.length ? className.join(' ') : undefined;
|
|
@@ -7485,8 +7485,8 @@ const RadioComponent = ({ noItem, loading, disabled, buttonStyle, formClassNames
|
|
|
7485
7485
|
value: option,
|
|
7486
7486
|
};
|
|
7487
7487
|
const className = [];
|
|
7488
|
-
if (isObject && option.
|
|
7489
|
-
checkboxProps.disabled = option.
|
|
7488
|
+
if (isObject && option.readOnly) {
|
|
7489
|
+
checkboxProps.disabled = option.readOnly;
|
|
7490
7490
|
className.push(style$2['readonly']);
|
|
7491
7491
|
}
|
|
7492
7492
|
checkboxProps.className = className.length ? className.join(' ') : undefined;
|
|
@@ -23339,7 +23339,7 @@ const normFile = (event) => {
|
|
|
23339
23339
|
return event;
|
|
23340
23340
|
return event && event['fileList'];
|
|
23341
23341
|
};
|
|
23342
|
-
const UploadDraggerComponent = ({ noItem,
|
|
23342
|
+
const UploadDraggerComponent = ({ noItem, readOnly, multiple, loading, disabled, listType, formClassNames, rootClassNames, classNames, accept, action, withCredentials, beforeUpload, customRequest, removeError, onChange, onDrop, onPreview, defaultFileList, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
23343
23343
|
const handleChange = (info) => {
|
|
23344
23344
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
23345
23345
|
onChange === null || onChange === void 0 ? void 0 : onChange(info);
|
|
@@ -23348,8 +23348,8 @@ const UploadDraggerComponent = ({ noItem, readonly, multiple, loading, disabled,
|
|
|
23348
23348
|
rootClassNames && rootClassDragger.push(...rootClassNames);
|
|
23349
23349
|
const classDragger = [];
|
|
23350
23350
|
classNames && classDragger.push(...classNames);
|
|
23351
|
-
|
|
23352
|
-
const dragger = !loading ? (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled ||
|
|
23351
|
+
readOnly && classDragger.push(style['readonly']);
|
|
23352
|
+
const dragger = !loading ? (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readOnly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), accept: accept === null || accept === void 0 ? void 0 : accept.map(accept => acceptFormat(accept)).join(', '), action: action, withCredentials: withCredentials, beforeUpload: beforeUpload, customRequest: customRequest, onChange: handleChange, onDrop: onDrop, onPreview: onPreview, 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." })] })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
23353
23353
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "fileList", getValueFromEvent: normFile, validateStatus: validateStatus, help: help, children: dragger })))
|
|
23354
23354
|
: dragger }));
|
|
23355
23355
|
};
|
package/dist/index.js
CHANGED
|
@@ -3981,7 +3981,7 @@ var css_248z$f = ".style-module_readonly__EYTp- {\n cursor: default !important;
|
|
|
3981
3981
|
var style$3 = {"readonly":"style-module_readonly__EYTp-"};
|
|
3982
3982
|
styleInject(css_248z$f);
|
|
3983
3983
|
|
|
3984
|
-
const CheckboxComponent$1 = ({ noItem, loading, disabled,
|
|
3984
|
+
const CheckboxComponent$1 = ({ noItem, loading, disabled, readOnly, checked, defaultChecked, removeError, onChange, formColLayout, name, label, formClassNames, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, children, ref, }) => {
|
|
3985
3985
|
const [checkedValue, setCheckedValue] = React.useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
3986
3986
|
const handleChange = (event) => {
|
|
3987
3987
|
var _a;
|
|
@@ -3993,7 +3993,7 @@ const CheckboxComponent$1 = ({ noItem, loading, disabled, readonly, checked, def
|
|
|
3993
3993
|
checked: () => checkedValue,
|
|
3994
3994
|
setChecked: setCheckedValue,
|
|
3995
3995
|
}));
|
|
3996
|
-
const checkbox = !loading ? (jsxRuntimeExports.jsx(antd.Checkbox, { disabled: disabled ||
|
|
3996
|
+
const checkbox = !loading ? (jsxRuntimeExports.jsx(antd.Checkbox, { disabled: disabled || readOnly, className: readOnly ? style$3['readonly'] : undefined, checked: checked !== null && checked !== void 0 ? checked : checkedValue, defaultChecked: checkedValue, onChange: handleChange, children: children })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { active: true });
|
|
3997
3997
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: checkbox })))
|
|
3998
3998
|
: checkbox }));
|
|
3999
3999
|
};
|
|
@@ -4018,8 +4018,8 @@ const CheckboxComponent = ({ noItem, loading, disabled, options, value, defaultV
|
|
|
4018
4018
|
value: option,
|
|
4019
4019
|
};
|
|
4020
4020
|
const className = [];
|
|
4021
|
-
if (isObject && option.
|
|
4022
|
-
checkboxProps.disabled = option.
|
|
4021
|
+
if (isObject && option.readOnly) {
|
|
4022
|
+
checkboxProps.disabled = option.readOnly;
|
|
4023
4023
|
className.push(style$3['readonly']);
|
|
4024
4024
|
}
|
|
4025
4025
|
checkboxProps.className = className.length ? className.join(' ') : undefined;
|
|
@@ -7504,8 +7504,8 @@ const RadioComponent = ({ noItem, loading, disabled, buttonStyle, formClassNames
|
|
|
7504
7504
|
value: option,
|
|
7505
7505
|
};
|
|
7506
7506
|
const className = [];
|
|
7507
|
-
if (isObject && option.
|
|
7508
|
-
checkboxProps.disabled = option.
|
|
7507
|
+
if (isObject && option.readOnly) {
|
|
7508
|
+
checkboxProps.disabled = option.readOnly;
|
|
7509
7509
|
className.push(style$2['readonly']);
|
|
7510
7510
|
}
|
|
7511
7511
|
checkboxProps.className = className.length ? className.join(' ') : undefined;
|
|
@@ -23358,7 +23358,7 @@ const normFile = (event) => {
|
|
|
23358
23358
|
return event;
|
|
23359
23359
|
return event && event['fileList'];
|
|
23360
23360
|
};
|
|
23361
|
-
const UploadDraggerComponent = ({ noItem,
|
|
23361
|
+
const UploadDraggerComponent = ({ noItem, readOnly, multiple, loading, disabled, listType, formClassNames, rootClassNames, classNames, accept, action, withCredentials, beforeUpload, customRequest, removeError, onChange, onDrop, onPreview, defaultFileList, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
23362
23362
|
const handleChange = (info) => {
|
|
23363
23363
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
23364
23364
|
onChange === null || onChange === void 0 ? void 0 : onChange(info);
|
|
@@ -23367,8 +23367,8 @@ const UploadDraggerComponent = ({ noItem, readonly, multiple, loading, disabled,
|
|
|
23367
23367
|
rootClassNames && rootClassDragger.push(...rootClassNames);
|
|
23368
23368
|
const classDragger = [];
|
|
23369
23369
|
classNames && classDragger.push(...classNames);
|
|
23370
|
-
|
|
23371
|
-
const dragger = !loading ? (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled ||
|
|
23370
|
+
readOnly && classDragger.push(style['readonly']);
|
|
23371
|
+
const dragger = !loading ? (jsxRuntimeExports.jsxs(Dragger, { multiple: multiple, disabled: disabled || readOnly, listType: listType, rootClassName: rootClassDragger.join(' '), className: classDragger.join(' '), accept: accept === null || accept === void 0 ? void 0 : accept.map(accept => acceptFormat(accept)).join(', '), action: action, withCredentials: withCredentials, beforeUpload: beforeUpload, customRequest: customRequest, onChange: handleChange, onDrop: onDrop, onPreview: onPreview, 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." })] })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
23372
23372
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, valuePropName: "fileList", getValueFromEvent: normFile, validateStatus: validateStatus, help: help, children: dragger })))
|
|
23373
23373
|
: dragger }));
|
|
23374
23374
|
};
|