sti-antd-package 0.0.16 → 0.0.18
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,7 +1,9 @@
|
|
|
1
1
|
import { DatePickerFormatType } from "../../../../constants";
|
|
2
2
|
import { SelectOption } from "../../../Select";
|
|
3
|
+
import { DatePickerProps } from "antd";
|
|
3
4
|
import { valueType } from "antd/es/statistic/utils";
|
|
4
5
|
import { Dayjs } from "dayjs";
|
|
6
|
+
import { RuleObject } from "rc-field-form/lib/interface";
|
|
5
7
|
import React from "react";
|
|
6
8
|
export type TableAsyncSearchItemType = "text" | "select" | "select-multiple" | "switch" | "checkbox" | "date" | "date-range";
|
|
7
9
|
interface BaseAsyncSearchItem {
|
|
@@ -17,6 +19,7 @@ export type TableAsyncSearchSelect = BaseAsyncSearchItem & {
|
|
|
17
19
|
type: "select";
|
|
18
20
|
options?: SelectOption[];
|
|
19
21
|
initValue?: valueType;
|
|
22
|
+
ruleType?: RuleObject['type'];
|
|
20
23
|
};
|
|
21
24
|
export type TableAsyncSearchLocalSelectMultiple = BaseAsyncSearchItem & {
|
|
22
25
|
type: "select-multiple";
|
|
@@ -42,11 +45,13 @@ export type TableAsyncSearchCheckbox = BaseAsyncSearchItem & {
|
|
|
42
45
|
};
|
|
43
46
|
export type TableAsyncSearchDate = BaseAsyncSearchItem & {
|
|
44
47
|
type: "date";
|
|
48
|
+
picker?: DatePickerProps['picker'];
|
|
45
49
|
format?: DatePickerFormatType;
|
|
46
50
|
initValue?: Dayjs;
|
|
47
51
|
};
|
|
48
52
|
export type TableAsyncSearchDateRange = BaseAsyncSearchItem & {
|
|
49
53
|
type: "date-range";
|
|
54
|
+
picker?: DatePickerProps['picker'];
|
|
50
55
|
format?: DatePickerFormatType;
|
|
51
56
|
initValue?: [Dayjs, Dayjs];
|
|
52
57
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -869,6 +869,7 @@ type TableAsyncSearchSelect = BaseAsyncSearchItem & {
|
|
|
869
869
|
type: "select";
|
|
870
870
|
options?: SelectOption[];
|
|
871
871
|
initValue?: valueType;
|
|
872
|
+
ruleType?: RuleObject$1['type'];
|
|
872
873
|
};
|
|
873
874
|
type TableAsyncSearchLocalSelectMultiple = BaseAsyncSearchItem & {
|
|
874
875
|
type: "select-multiple";
|
|
@@ -894,11 +895,13 @@ type TableAsyncSearchCheckbox = BaseAsyncSearchItem & {
|
|
|
894
895
|
};
|
|
895
896
|
type TableAsyncSearchDate = BaseAsyncSearchItem & {
|
|
896
897
|
type: "date";
|
|
898
|
+
picker?: DatePickerProps$1['picker'];
|
|
897
899
|
format?: DatePickerFormatType;
|
|
898
900
|
initValue?: Dayjs;
|
|
899
901
|
};
|
|
900
902
|
type TableAsyncSearchDateRange = BaseAsyncSearchItem & {
|
|
901
903
|
type: "date-range";
|
|
904
|
+
picker?: DatePickerProps$1['picker'];
|
|
902
905
|
format?: DatePickerFormatType;
|
|
903
906
|
initValue?: [Dayjs, Dayjs];
|
|
904
907
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -8425,8 +8425,8 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8425
8425
|
'date-range',
|
|
8426
8426
|
].includes(type))
|
|
8427
8427
|
result[name] = Array.isArray(currentValue)
|
|
8428
|
-
? currentValue.map(item => toDayjs(item))
|
|
8429
|
-
: toDayjs(currentValue);
|
|
8428
|
+
? currentValue.map(item => toDayjs(item, true))
|
|
8429
|
+
: toDayjs(currentValue, true);
|
|
8430
8430
|
return result;
|
|
8431
8431
|
}, {});
|
|
8432
8432
|
const handleSubmit = (inputs) => {
|
|
@@ -8485,9 +8485,7 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8485
8485
|
case 'text': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_a = item.space) !== null && _a !== void 0 ? _a : 1}`], { children: jsxRuntimeExports.jsx(InputComponent, { name: item.name, label: item.label,
|
|
8486
8486
|
// width={item.width}
|
|
8487
8487
|
disabled: loading }) }), `col-${item.name}`));
|
|
8488
|
-
case 'select': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_b = item.space) !== null && _b !== void 0 ? _b : 1}`], { children: jsxRuntimeExports.jsx(SelectComponent, { options: item.options, name: item.name, label: item.label,
|
|
8489
|
-
// width={item.width}
|
|
8490
|
-
disabled: loading }) }), `col-${item.name}`));
|
|
8488
|
+
case 'select': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_b = item.space) !== null && _b !== void 0 ? _b : 1}`], { children: jsxRuntimeExports.jsx(SelectComponent, { options: item.options, name: item.name, label: item.label, disabled: loading, ruleType: item.ruleType }) }), `col-${item.name}`));
|
|
8491
8489
|
case 'select-multiple': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_c = item.space) !== null && _c !== void 0 ? _c : 1}`], { children: item.static ? (jsxRuntimeExports.jsx(SelectComponent, { mode: "multiple", label: item.label, name: item.name, disabled: loading, options: item.options, onChange: (value, options) => {
|
|
8492
8490
|
item.name
|
|
8493
8491
|
&& Array.isArray(options)
|
|
@@ -8499,8 +8497,8 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8499
8497
|
}, ruleType: "array" })) }), `col-${item.name}`));
|
|
8500
8498
|
case 'switch': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_d = item.space) !== null && _d !== void 0 ? _d : 1}`], { children: jsxRuntimeExports.jsx(SwitchComponent, { name: item.name, label: item.label, disabled: loading }) }), `col-${item.name}`));
|
|
8501
8499
|
case 'checkbox': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_e = item.space) !== null && _e !== void 0 ? _e : 1}`], { children: jsxRuntimeExports.jsx(CheckboxComponent$1, { name: item.name, label: item.label, disabled: loading, children: item.children }) }), `col-${item.name}`));
|
|
8502
|
-
case 'date': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_f = item.space) !== null && _f !== void 0 ? _f : 1}`], { children: jsxRuntimeExports.jsx(DatePickerComponent, { name: item.name, label: item.label, format: (_g = item.format) !== null && _g !== void 0 ? _g : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8503
|
-
case 'date-range': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_h = item.space) !== null && _h !== void 0 ? _h : 2}`], { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { name: item.name, label: item.label, format: (_j = item.format) !== null && _j !== void 0 ? _j : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8500
|
+
case 'date': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_f = item.space) !== null && _f !== void 0 ? _f : 1}`], { children: jsxRuntimeExports.jsx(DatePickerComponent, { name: item.name, label: item.label, picker: item.picker, format: (_g = item.format) !== null && _g !== void 0 ? _g : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8501
|
+
case 'date-range': return (jsxRuntimeExports.jsx(Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_h = item.space) !== null && _h !== void 0 ? _h : 2}`], { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { name: item.name, label: item.label, picker: item.picker, format: (_j = item.format) !== null && _j !== void 0 ? _j : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8504
8502
|
}
|
|
8505
8503
|
}) })) })) }), "filter")] }));
|
|
8506
8504
|
};
|
package/dist/index.js
CHANGED
|
@@ -8444,8 +8444,8 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8444
8444
|
'date-range',
|
|
8445
8445
|
].includes(type))
|
|
8446
8446
|
result[name] = Array.isArray(currentValue)
|
|
8447
|
-
? currentValue.map(item => toDayjs(item))
|
|
8448
|
-
: toDayjs(currentValue);
|
|
8447
|
+
? currentValue.map(item => toDayjs(item, true))
|
|
8448
|
+
: toDayjs(currentValue, true);
|
|
8449
8449
|
return result;
|
|
8450
8450
|
}, {});
|
|
8451
8451
|
const handleSubmit = (inputs) => {
|
|
@@ -8504,9 +8504,7 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8504
8504
|
case 'text': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_a = item.space) !== null && _a !== void 0 ? _a : 1}`], { children: jsxRuntimeExports.jsx(InputComponent, { name: item.name, label: item.label,
|
|
8505
8505
|
// width={item.width}
|
|
8506
8506
|
disabled: loading }) }), `col-${item.name}`));
|
|
8507
|
-
case 'select': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_b = item.space) !== null && _b !== void 0 ? _b : 1}`], { children: jsxRuntimeExports.jsx(SelectComponent, { options: item.options, name: item.name, label: item.label,
|
|
8508
|
-
// width={item.width}
|
|
8509
|
-
disabled: loading }) }), `col-${item.name}`));
|
|
8507
|
+
case 'select': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_b = item.space) !== null && _b !== void 0 ? _b : 1}`], { children: jsxRuntimeExports.jsx(SelectComponent, { options: item.options, name: item.name, label: item.label, disabled: loading, ruleType: item.ruleType }) }), `col-${item.name}`));
|
|
8510
8508
|
case 'select-multiple': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_c = item.space) !== null && _c !== void 0 ? _c : 1}`], { children: item.static ? (jsxRuntimeExports.jsx(SelectComponent, { mode: "multiple", label: item.label, name: item.name, disabled: loading, options: item.options, onChange: (value, options) => {
|
|
8511
8509
|
item.name
|
|
8512
8510
|
&& Array.isArray(options)
|
|
@@ -8518,8 +8516,8 @@ const TableAsyncSearchComponent = ({ noInitSubmit, noButton, name, items, header
|
|
|
8518
8516
|
}, ruleType: "array" })) }), `col-${item.name}`));
|
|
8519
8517
|
case 'switch': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_d = item.space) !== null && _d !== void 0 ? _d : 1}`], { children: jsxRuntimeExports.jsx(SwitchComponent, { name: item.name, label: item.label, disabled: loading }) }), `col-${item.name}`));
|
|
8520
8518
|
case 'checkbox': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_e = item.space) !== null && _e !== void 0 ? _e : 1}`], { children: jsxRuntimeExports.jsx(CheckboxComponent$1, { name: item.name, label: item.label, disabled: loading, children: item.children }) }), `col-${item.name}`));
|
|
8521
|
-
case 'date': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_f = item.space) !== null && _f !== void 0 ? _f : 1}`], { children: jsxRuntimeExports.jsx(DatePickerComponent, { name: item.name, label: item.label, format: (_g = item.format) !== null && _g !== void 0 ? _g : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8522
|
-
case 'date-range': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_h = item.space) !== null && _h !== void 0 ? _h : 2}`], { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { name: item.name, label: item.label, format: (_j = item.format) !== null && _j !== void 0 ? _j : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8519
|
+
case 'date': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_f = item.space) !== null && _f !== void 0 ? _f : 1}`], { children: jsxRuntimeExports.jsx(DatePickerComponent, { name: item.name, label: item.label, picker: item.picker, format: (_g = item.format) !== null && _g !== void 0 ? _g : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8520
|
+
case 'date-range': return (jsxRuntimeExports.jsx(antd.Col, Object.assign({ className: "gutter-row" }, styleProps[`col${(_h = item.space) !== null && _h !== void 0 ? _h : 2}`], { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { name: item.name, label: item.label, picker: item.picker, format: (_j = item.format) !== null && _j !== void 0 ? _j : 'default', disabled: loading }) }), `col-${item.name}`));
|
|
8523
8521
|
}
|
|
8524
8522
|
}) })) })) }), "filter")] }));
|
|
8525
8523
|
};
|