@farmzone/fz-react-ui 1.0.16 → 1.0.17
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/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -652,6 +652,7 @@ interface Column<T> {
|
|
|
652
652
|
sortable?: boolean;
|
|
653
653
|
sort?: "asc" | "desc" | null;
|
|
654
654
|
fixed?: TableFixed;
|
|
655
|
+
tooltipText?: (value: unknown, record: T, index: number) => ReactNode;
|
|
655
656
|
}
|
|
656
657
|
|
|
657
658
|
interface CheckboxInfo {
|
|
@@ -970,6 +971,7 @@ type SelectOption<P> = BaseOption<P> & {
|
|
|
970
971
|
placeholder?: string;
|
|
971
972
|
containerClassName?: string;
|
|
972
973
|
canReset?: boolean;
|
|
974
|
+
autoSubmit?: boolean;
|
|
973
975
|
};
|
|
974
976
|
type RadioOption<P> = BaseOption<P> & {
|
|
975
977
|
type: "radio";
|
package/dist/index.d.ts
CHANGED
|
@@ -652,6 +652,7 @@ interface Column<T> {
|
|
|
652
652
|
sortable?: boolean;
|
|
653
653
|
sort?: "asc" | "desc" | null;
|
|
654
654
|
fixed?: TableFixed;
|
|
655
|
+
tooltipText?: (value: unknown, record: T, index: number) => ReactNode;
|
|
655
656
|
}
|
|
656
657
|
|
|
657
658
|
interface CheckboxInfo {
|
|
@@ -970,6 +971,7 @@ type SelectOption<P> = BaseOption<P> & {
|
|
|
970
971
|
placeholder?: string;
|
|
971
972
|
containerClassName?: string;
|
|
972
973
|
canReset?: boolean;
|
|
974
|
+
autoSubmit?: boolean;
|
|
973
975
|
};
|
|
974
976
|
type RadioOption<P> = BaseOption<P> & {
|
|
975
977
|
type: "radio";
|
package/dist/index.js
CHANGED
|
@@ -4706,7 +4706,13 @@ function Table(props) {
|
|
|
4706
4706
|
showHorizontalDivider = true,
|
|
4707
4707
|
showVerticalDivider = true
|
|
4708
4708
|
} = props;
|
|
4709
|
-
const {
|
|
4709
|
+
const {
|
|
4710
|
+
fixed = false,
|
|
4711
|
+
onSelectionChange,
|
|
4712
|
+
selectedKeys = [],
|
|
4713
|
+
disabledKeys = [],
|
|
4714
|
+
disabledTooltip
|
|
4715
|
+
} = checkboxInfo ?? {};
|
|
4710
4716
|
const scrollRef = useRef(null);
|
|
4711
4717
|
const footerRef = useRef(null);
|
|
4712
4718
|
const [tableHeight, setTableHeight] = useState(500);
|
|
@@ -5095,7 +5101,7 @@ function Table(props) {
|
|
|
5095
5101
|
TableCellContent,
|
|
5096
5102
|
{
|
|
5097
5103
|
cellContent,
|
|
5098
|
-
tooltipText: String(record[col.key] ?? ""),
|
|
5104
|
+
tooltipText: col.tooltipText ? col.tooltipText(record[col.key], record, rowIdx) : String(record[col.key] ?? ""),
|
|
5099
5105
|
align: align ?? "",
|
|
5100
5106
|
tooltipConfig: col.key === "__checkbox__" ? false : tooltipConfig,
|
|
5101
5107
|
onCellClick: col.key !== "__checkbox__" && onRowClickRef.current ? () => onRowClickRef.current?.(record, rowIdx) : void 0
|
|
@@ -7747,8 +7753,9 @@ function PageFilter(props) {
|
|
|
7747
7753
|
const handleInputChange = (key) => (e) => {
|
|
7748
7754
|
onChange({ [key]: e.target.value });
|
|
7749
7755
|
};
|
|
7750
|
-
const handleSelectChange = (key) => (value) => {
|
|
7756
|
+
const handleSelectChange = (key, autoSubmit) => (value) => {
|
|
7751
7757
|
onChange({ [key]: value });
|
|
7758
|
+
if (autoSubmit) onSubmit();
|
|
7752
7759
|
};
|
|
7753
7760
|
const handleRadioChange = (key) => (value) => {
|
|
7754
7761
|
onChange({ [key]: value });
|
|
@@ -7791,7 +7798,7 @@ function PageFilter(props) {
|
|
|
7791
7798
|
Select2,
|
|
7792
7799
|
{
|
|
7793
7800
|
value: currentValue,
|
|
7794
|
-
onChange: handleSelectChange(optionKey),
|
|
7801
|
+
onChange: handleSelectChange(optionKey, option.autoSubmit),
|
|
7795
7802
|
options: option.options,
|
|
7796
7803
|
placeholder: option.placeholder || "\uC120\uD0DD",
|
|
7797
7804
|
canReset: option.canReset ?? true,
|