react-table-edit 1.4.29 → 1.4.31
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/component/type/index.d.ts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -120,6 +120,8 @@ export type ISettingNumericElement = {
|
|
|
120
120
|
export type IColumnTable = {
|
|
121
121
|
/** Tên thuộc tính */
|
|
122
122
|
field: string;
|
|
123
|
+
/** Tên thuộc tính lọc*/
|
|
124
|
+
fieldFilter?: string;
|
|
123
125
|
/** Tiêu đề hiển thị ở header */
|
|
124
126
|
headerText?: string;
|
|
125
127
|
/** Khóa chính */
|
|
@@ -277,6 +279,8 @@ export type IFCurrentPageConfig = {
|
|
|
277
279
|
export type IHeaderColumnTable = {
|
|
278
280
|
/** Tên thuộc tính */
|
|
279
281
|
field: string;
|
|
282
|
+
/** Tên thuộc tính lọc*/
|
|
283
|
+
fieldFilter?: string;
|
|
280
284
|
/** Tiêu đề header */
|
|
281
285
|
headerText?: string;
|
|
282
286
|
/** Chiều rộng */
|
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ type ISettingNumericElement = {
|
|
|
124
124
|
type IColumnTable = {
|
|
125
125
|
/** Tên thuộc tính */
|
|
126
126
|
field: string;
|
|
127
|
+
/** Tên thuộc tính lọc*/
|
|
128
|
+
fieldFilter?: string;
|
|
127
129
|
/** Tiêu đề hiển thị ở header */
|
|
128
130
|
headerText?: string;
|
|
129
131
|
/** Khóa chính */
|
|
@@ -281,6 +283,8 @@ type IFCurrentPageConfig = {
|
|
|
281
283
|
type IHeaderColumnTable = {
|
|
282
284
|
/** Tên thuộc tính */
|
|
283
285
|
field: string;
|
|
286
|
+
/** Tên thuộc tính lọc*/
|
|
287
|
+
fieldFilter?: string;
|
|
284
288
|
/** Tiêu đề header */
|
|
285
289
|
headerText?: string;
|
|
286
290
|
/** Chiều rộng */
|
package/dist/index.js
CHANGED
|
@@ -41906,6 +41906,7 @@ const RenderFilterElement$1 = ({ filter, optionsFilter, formatSetting, filterBy,
|
|
|
41906
41906
|
const { t } = reactI18next.useTranslation();
|
|
41907
41907
|
const [operator, setOperator] = React$5.useState(filter?.ope ?? ((!column.filterType && column.type === 'numeric') || column.filterType === 'select' ? 'equal' : 'contains'));
|
|
41908
41908
|
const [valueFilter, setValueFilter] = React$5.useState(filter?.value ?? '');
|
|
41909
|
+
const fieldFilter = column.fieldFilter ?? column.field;
|
|
41909
41910
|
const RenderStringFilter = () => {
|
|
41910
41911
|
const options = [
|
|
41911
41912
|
{ label: 'Bắt đầu bởi', value: 'startswith' },
|
|
@@ -41949,7 +41950,7 @@ const RenderFilterElement$1 = ({ filter, optionsFilter, formatSetting, filterBy,
|
|
|
41949
41950
|
} })] }));
|
|
41950
41951
|
};
|
|
41951
41952
|
const RenderSelectFilter = () => {
|
|
41952
|
-
return (jsxRuntime.jsx("div", { className: 'mb-1', children: jsxRuntime.jsx(SelectTable, { value: optionsFilter ? optionsFilter[
|
|
41953
|
+
return (jsxRuntime.jsx("div", { className: 'mb-1', children: jsxRuntime.jsx(SelectTable, { value: optionsFilter ? optionsFilter[fieldFilter]?.find((x) => x.value === valueFilter) : undefined, options: (optionsFilter && optionsFilter[fieldFilter]) ?? [], isClearable: true, onChange: (val) => {
|
|
41953
41954
|
setValueFilter(val?.value);
|
|
41954
41955
|
}, placeholder: t('Select') }) }));
|
|
41955
41956
|
};
|
|
@@ -41959,7 +41960,7 @@ const RenderFilterElement$1 = ({ filter, optionsFilter, formatSetting, filterBy,
|
|
|
41959
41960
|
filter.value = valueFilter ?? '';
|
|
41960
41961
|
}
|
|
41961
41962
|
else {
|
|
41962
|
-
filterBy.push({ key:
|
|
41963
|
+
filterBy.push({ key: fieldFilter, ope: operator, value: valueFilter ?? '' });
|
|
41963
41964
|
}
|
|
41964
41965
|
changeFilter([...filterBy]);
|
|
41965
41966
|
setOpenFilter(false);
|
|
@@ -41971,7 +41972,7 @@ const RenderFilterElement$1 = ({ filter, optionsFilter, formatSetting, filterBy,
|
|
|
41971
41972
|
}
|
|
41972
41973
|
}, children: [((!column.filterType && column.type === 'numeric') || column.filterType === 'numeric') ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderNumberFilter(), " "] }) : (column.filterType === 'select' ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderSelectFilter(), " "] }) : RenderStringFilter()), jsxRuntime.jsxs("div", { className: 'd-flex justify-content-end', children: [jsxRuntime.jsx(Button$1, { color: 'primary', style: { borderRadius: 3 }, className: 'me-50 py-25 px-50 fw-bold', onClick: handleSave, children: t('Filter') }), jsxRuntime.jsx(Button$1, { className: 'py-25 px-50 fw-bold', color: 'white', style: { borderRadius: 3, borderWidth: 0 }, onClick: () => {
|
|
41973
41974
|
if (filterBy) {
|
|
41974
|
-
changeFilter(filterBy.filter((x) => x.key !==
|
|
41975
|
+
changeFilter(filterBy.filter((x) => x.key !== fieldFilter));
|
|
41975
41976
|
}
|
|
41976
41977
|
setOpenFilter(false);
|
|
41977
41978
|
}, children: t('Clear') })] })] }));
|
|
@@ -65515,7 +65516,7 @@ const HeaderTableCol = (props) => {
|
|
|
65515
65516
|
const headerRef = React$5.useRef(null);
|
|
65516
65517
|
const order = orderBy.find((item) => item.key === col.field);
|
|
65517
65518
|
const [openFilter, setOpenFilter] = React$5.useState(false);
|
|
65518
|
-
const filter = filterBy.find((item) => item.key === col.field);
|
|
65519
|
+
const filter = filterBy.find((item) => item.key === (col.fieldFilter ?? col.field));
|
|
65519
65520
|
const handleResize = (e, { size }) => {
|
|
65520
65521
|
// Update the column width here
|
|
65521
65522
|
// You might need to update the state or call a callback to update the width
|
|
@@ -65577,6 +65578,7 @@ const RenderFilterElement = ({ filter, optionsFilter, formatSetting, filterBy, s
|
|
|
65577
65578
|
const { t } = reactI18next.useTranslation();
|
|
65578
65579
|
const [operator, setOperator] = React$5.useState(filter?.ope ?? ((!column.filterType && column.type === 'numeric') || column.filterType === 'select' ? 'equal' : 'contains'));
|
|
65579
65580
|
const [valueFilter, setValueFilter] = React$5.useState(filter?.value ?? '');
|
|
65581
|
+
const fieldFilter = column.fieldFilter ?? column.field;
|
|
65580
65582
|
const RenderStringFilter = () => {
|
|
65581
65583
|
const options = [
|
|
65582
65584
|
{ label: 'Bắt đầu bởi', value: 'startswith' },
|
|
@@ -65620,7 +65622,7 @@ const RenderFilterElement = ({ filter, optionsFilter, formatSetting, filterBy, s
|
|
|
65620
65622
|
} })] }));
|
|
65621
65623
|
};
|
|
65622
65624
|
const RenderSelectFilter = () => {
|
|
65623
|
-
return (jsxRuntime.jsx("div", { className: 'mb-1', children: jsxRuntime.jsx(SelectTable, { value: optionsFilter ? optionsFilter[
|
|
65625
|
+
return (jsxRuntime.jsx("div", { className: 'mb-1', children: jsxRuntime.jsx(SelectTable, { value: optionsFilter ? optionsFilter[fieldFilter]?.find((x) => x.value === valueFilter) : undefined, options: (optionsFilter && optionsFilter[fieldFilter]) ?? [], isClearable: true, onChange: (val) => {
|
|
65624
65626
|
setValueFilter(val?.value);
|
|
65625
65627
|
}, placeholder: t('Select') }) }));
|
|
65626
65628
|
};
|
|
@@ -65630,7 +65632,7 @@ const RenderFilterElement = ({ filter, optionsFilter, formatSetting, filterBy, s
|
|
|
65630
65632
|
filter.value = valueFilter ?? '';
|
|
65631
65633
|
}
|
|
65632
65634
|
else {
|
|
65633
|
-
filterBy.push({ key:
|
|
65635
|
+
filterBy.push({ key: fieldFilter, ope: operator, value: valueFilter ?? '' });
|
|
65634
65636
|
}
|
|
65635
65637
|
changeFilter([...filterBy]);
|
|
65636
65638
|
setOpenFilter(false);
|
|
@@ -65644,7 +65646,7 @@ const RenderFilterElement = ({ filter, optionsFilter, formatSetting, filterBy, s
|
|
|
65644
65646
|
}
|
|
65645
65647
|
}, children: [((!column.filterType && column.type === 'numeric') || column.filterType === 'numeric') ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderNumberFilter(), " "] }) : (column.filterType === 'select' ? jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [RenderSelectFilter(), " "] }) : RenderStringFilter()), jsxRuntime.jsxs("div", { className: 'd-flex justify-content-end', children: [jsxRuntime.jsx(Button$1, { color: 'primary', style: { borderRadius: 3 }, className: 'me-50 py-25 px-50 fw-bold', onClick: handleSave, children: t('Filter') }), jsxRuntime.jsx(Button$1, { className: 'py-25 px-50 fw-bold', outline: true, style: { borderRadius: 3 }, onClick: () => {
|
|
65646
65648
|
if (filterBy) {
|
|
65647
|
-
changeFilter(filterBy.filter((x) => x.key !==
|
|
65649
|
+
changeFilter(filterBy.filter((x) => x.key !== fieldFilter));
|
|
65648
65650
|
}
|
|
65649
65651
|
setOpenFilter(false);
|
|
65650
65652
|
}, children: t('Clear') })] })] }));
|