es-grid-template 1.3.0 → 1.3.2
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/assets/index.css +16 -0
- package/assets/index.scss +37 -3
- package/es/grid-component/CheckboxFilter.js +4 -0
- package/es/grid-component/CheckboxFilter2.d.ts +20 -0
- package/es/grid-component/CheckboxFilter2.js +248 -0
- package/es/grid-component/ColumnsGroup/ColumnsGroup.js +4 -4
- package/es/grid-component/ContextMenu.js +1 -0
- package/es/grid-component/ConvertColumnTable.js +1 -0
- package/es/grid-component/EditableCell.js +11 -8
- package/es/grid-component/InternalTable.js +47 -11
- package/es/grid-component/TableGrid.d.ts +3 -0
- package/es/grid-component/TableGrid.js +71 -7
- package/es/grid-component/hooks/columns/index.js +14 -45
- package/es/grid-component/hooks/content/HeaderContent.js +54 -58
- package/es/grid-component/hooks/useColumns.d.ts +4 -2
- package/es/grid-component/hooks/useColumns.js +32 -13
- package/es/grid-component/hooks/utils.d.ts +9 -0
- package/es/grid-component/hooks/utils.js +278 -1
- package/es/grid-component/number-range/index.d.ts +10 -0
- package/es/grid-component/number-range/index.js +59 -0
- package/es/grid-component/styles.scss +24 -0
- package/es/grid-component/table/Grid.d.ts +3 -0
- package/es/grid-component/table/GridEdit.js +360 -106
- package/es/grid-component/table/Group.d.ts +1 -0
- package/es/grid-component/table/Group.js +1 -1
- package/es/grid-component/type.d.ts +2 -1
- package/lib/grid-component/CheckboxFilter.js +4 -0
- package/lib/grid-component/CheckboxFilter2.d.ts +20 -0
- package/lib/grid-component/CheckboxFilter2.js +257 -0
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +4 -4
- package/lib/grid-component/ContextMenu.js +1 -0
- package/lib/grid-component/ConvertColumnTable.js +1 -0
- package/lib/grid-component/EditableCell.js +11 -8
- package/lib/grid-component/InternalTable.js +41 -10
- package/lib/grid-component/TableGrid.d.ts +3 -0
- package/lib/grid-component/TableGrid.js +68 -7
- package/lib/grid-component/hooks/columns/index.js +14 -45
- package/lib/grid-component/hooks/content/HeaderContent.js +53 -55
- package/lib/grid-component/hooks/useColumns.d.ts +4 -2
- package/lib/grid-component/hooks/useColumns.js +31 -12
- package/lib/grid-component/hooks/utils.d.ts +9 -0
- package/lib/grid-component/hooks/utils.js +293 -4
- package/lib/grid-component/number-range/index.d.ts +10 -0
- package/lib/grid-component/number-range/index.js +67 -0
- package/lib/grid-component/styles.scss +24 -0
- package/lib/grid-component/table/Grid.d.ts +3 -0
- package/lib/grid-component/table/GridEdit.js +358 -104
- package/lib/grid-component/table/Group.d.ts +1 -0
- package/lib/grid-component/table/Group.js +1 -1
- package/lib/grid-component/type.d.ts +2 -1
- package/package.json +109 -108
|
@@ -6,11 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.addRowIdArray = void 0;
|
|
8
8
|
exports.addRows8 = addRows8;
|
|
9
|
-
exports.
|
|
9
|
+
exports.checkThousandSeparator = exports.checkFieldKey = exports.checkDecimalSeparator = exports.checkChild = void 0;
|
|
10
|
+
exports.compareDate = compareDate;
|
|
11
|
+
exports.compareDates = compareDates;
|
|
12
|
+
exports.filterDataByColumns3 = exports.filterDataByColumns2 = exports.filterDataByColumns = exports.editAbleColumns = exports.customWeekStartEndFormat = exports.countItemsBeforeIndex = exports.convertLabelToTitle = exports.convertFlatColumn = exports.convertDayjsToDate = exports.convertDateToDayjs = exports.convertColumns = exports.convertArrayWithIndent = void 0;
|
|
10
13
|
exports.findAllChildrenKeys = findAllChildrenKeys;
|
|
11
|
-
exports.getFirstSelectCell = exports.getEditType = exports.getDefaultValue = exports.getDatepickerFormat = exports.getDateString = exports.getColumnsVisible = exports.getAllVisibleKeys = exports.genPresets = exports.flattenData = exports.flattenArray = exports.findItemByKey = void 0;
|
|
14
|
+
exports.getFirstSelectCell = exports.getEditType = exports.getDefaultValue = exports.getDatepickerFormat = exports.getDateString = exports.getColumnsVisible = exports.getAllVisibleKeys = exports.genPresets = exports.flattenData = exports.flattenArray = exports.findItemPath = exports.findItemByKey = void 0;
|
|
12
15
|
exports.getHiddenParentKeys = getHiddenParentKeys;
|
|
13
|
-
exports.
|
|
16
|
+
exports.getVisibleColumnKeys = exports.getTypeFilter = exports.getTemplate = exports.getRowsPasteIndex = exports.getRowNumber = exports.getLastSelectCell = void 0;
|
|
17
|
+
exports.invalidDate = invalidDate;
|
|
18
|
+
exports.isColor = exports.isArraysEqual = void 0;
|
|
19
|
+
exports.isDateString = isDateString;
|
|
20
|
+
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = exports.transformColumns1 = exports.transformColumns = exports.totalFixedWidth = exports.sumDataByField = exports.removeFieldRecursive = exports.removeColumns = exports.parseBooleanToValue = exports.newGuid = exports.isObjEmpty = exports.isNullOrUndefined = exports.isNameColor = exports.isEmpty = exports.isEditable = exports.isDisable = void 0;
|
|
14
21
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
15
22
|
var _moment = _interopRequireDefault(require("moment/moment"));
|
|
16
23
|
var _uuid = require("uuid");
|
|
@@ -850,4 +857,286 @@ exports.isArraysEqual = isArraysEqual;
|
|
|
850
857
|
const editAbleColumns = columns => {
|
|
851
858
|
return columns.filter(col => col.field !== '#' && col.field !== 'index' && col.field !== 'command' && col.visible !== false);
|
|
852
859
|
};
|
|
853
|
-
exports.editAbleColumns = editAbleColumns;
|
|
860
|
+
exports.editAbleColumns = editAbleColumns;
|
|
861
|
+
const findItemPath = (tree, targetItem, rowKey) => {
|
|
862
|
+
let result = null;
|
|
863
|
+
function dfs(nodes, path = []) {
|
|
864
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
865
|
+
const currentPath = [...path, i + 1];
|
|
866
|
+
const node = nodes[i];
|
|
867
|
+
if (node?.[rowKey] === targetItem?.[rowKey]) {
|
|
868
|
+
result = currentPath.join('.');
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
if (node?.children) {
|
|
872
|
+
if (dfs(node.children, currentPath)) {
|
|
873
|
+
return true;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
dfs(tree);
|
|
880
|
+
return result;
|
|
881
|
+
};
|
|
882
|
+
exports.findItemPath = findItemPath;
|
|
883
|
+
const filterDataByColumns = (data, queries) => {
|
|
884
|
+
if (!queries || queries.length === 0) {
|
|
885
|
+
return data;
|
|
886
|
+
}
|
|
887
|
+
return data.filter(item => {
|
|
888
|
+
let result = null;
|
|
889
|
+
for (const query of queries) {
|
|
890
|
+
const {
|
|
891
|
+
field,
|
|
892
|
+
value,
|
|
893
|
+
operator,
|
|
894
|
+
predicate
|
|
895
|
+
} = query;
|
|
896
|
+
const itemValue = item[field];
|
|
897
|
+
let condition = false;
|
|
898
|
+
|
|
899
|
+
// Normalize string values for comparison
|
|
900
|
+
const itemStr = itemValue?.toString().toLowerCase?.();
|
|
901
|
+
const queryStr = value?.toString().toLowerCase?.();
|
|
902
|
+
switch (operator.toLowerCase()) {
|
|
903
|
+
case "equal":
|
|
904
|
+
if (isDateString(value)) {
|
|
905
|
+
condition = compareDate(itemValue, value);
|
|
906
|
+
} else {
|
|
907
|
+
condition = itemValue == value;
|
|
908
|
+
}
|
|
909
|
+
break;
|
|
910
|
+
case "notequal":
|
|
911
|
+
if (isDateString(value)) {
|
|
912
|
+
condition = !compareDate(itemValue, value);
|
|
913
|
+
} else {
|
|
914
|
+
condition = itemValue != value;
|
|
915
|
+
}
|
|
916
|
+
break;
|
|
917
|
+
case "greaterthan":
|
|
918
|
+
condition = itemValue > value;
|
|
919
|
+
break;
|
|
920
|
+
case "greaterthanorequal":
|
|
921
|
+
condition = itemValue >= value;
|
|
922
|
+
break;
|
|
923
|
+
case "lessthan":
|
|
924
|
+
condition = itemValue < value;
|
|
925
|
+
break;
|
|
926
|
+
case "lessthanorequal":
|
|
927
|
+
condition = itemValue <= value;
|
|
928
|
+
break;
|
|
929
|
+
case "contains":
|
|
930
|
+
condition = itemStr?.includes(queryStr);
|
|
931
|
+
break;
|
|
932
|
+
case "startswith":
|
|
933
|
+
condition = itemStr?.startsWith(queryStr);
|
|
934
|
+
break;
|
|
935
|
+
case "endswith":
|
|
936
|
+
condition = itemStr?.endsWith(queryStr);
|
|
937
|
+
break;
|
|
938
|
+
default:
|
|
939
|
+
console.warn(`Unknown operator: ${operator}`);
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
if (predicate === "and") {
|
|
943
|
+
result = result === null ? condition : result && condition;
|
|
944
|
+
} else if (predicate === "or") {
|
|
945
|
+
result = result === null ? condition : result || condition;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return result;
|
|
949
|
+
});
|
|
950
|
+
};
|
|
951
|
+
exports.filterDataByColumns = filterDataByColumns;
|
|
952
|
+
const filterDataByColumns2 = (data, queries) => {
|
|
953
|
+
if (!queries || queries.length === 0) {
|
|
954
|
+
return data;
|
|
955
|
+
}
|
|
956
|
+
return data.filter(item => {
|
|
957
|
+
// Nếu isFilterState = true thì giữ lại dòng này, không cần kiểm tra filter
|
|
958
|
+
if (item.isFilterState) {
|
|
959
|
+
return true;
|
|
960
|
+
}
|
|
961
|
+
let result = null;
|
|
962
|
+
for (const query of queries) {
|
|
963
|
+
const {
|
|
964
|
+
field,
|
|
965
|
+
value,
|
|
966
|
+
operator,
|
|
967
|
+
predicate
|
|
968
|
+
} = query;
|
|
969
|
+
const itemValue = item[field];
|
|
970
|
+
let condition = false;
|
|
971
|
+
|
|
972
|
+
// Normalize string values for comparison
|
|
973
|
+
const itemStr = itemValue?.toString().toLowerCase?.();
|
|
974
|
+
const queryStr = value?.toString().toLowerCase?.();
|
|
975
|
+
switch (operator.toLowerCase()) {
|
|
976
|
+
case "equal":
|
|
977
|
+
condition = isDateString(value) ? compareDate(itemValue, value) : itemValue == value;
|
|
978
|
+
break;
|
|
979
|
+
case "notequal":
|
|
980
|
+
condition = isDateString(value) ? !compareDate(itemValue, value) : itemValue != value;
|
|
981
|
+
break;
|
|
982
|
+
case "greaterthan":
|
|
983
|
+
condition = itemValue > value;
|
|
984
|
+
break;
|
|
985
|
+
case "greaterthanorequal":
|
|
986
|
+
condition = itemValue >= value;
|
|
987
|
+
break;
|
|
988
|
+
case "lessthan":
|
|
989
|
+
condition = itemValue < value;
|
|
990
|
+
break;
|
|
991
|
+
case "lessthanorequal":
|
|
992
|
+
condition = itemValue <= value;
|
|
993
|
+
break;
|
|
994
|
+
case "contains":
|
|
995
|
+
condition = itemStr?.includes(queryStr);
|
|
996
|
+
break;
|
|
997
|
+
case "startswith":
|
|
998
|
+
condition = itemStr?.startsWith(queryStr);
|
|
999
|
+
break;
|
|
1000
|
+
case "endswith":
|
|
1001
|
+
condition = itemStr?.endsWith(queryStr);
|
|
1002
|
+
break;
|
|
1003
|
+
default:
|
|
1004
|
+
console.warn(`Unknown operator: ${operator}`);
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
// Áp dụng toán tử logic (and/or)
|
|
1009
|
+
if (predicate === "and") {
|
|
1010
|
+
result = result === null ? condition : result && condition;
|
|
1011
|
+
} else if (predicate === "or") {
|
|
1012
|
+
result = result === null ? condition : result || condition;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return result;
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
exports.filterDataByColumns2 = filterDataByColumns2;
|
|
1019
|
+
const removeFieldRecursive = (data, field) => {
|
|
1020
|
+
return data.map(item => {
|
|
1021
|
+
const {
|
|
1022
|
+
[field]: _,
|
|
1023
|
+
...rest
|
|
1024
|
+
} = item;
|
|
1025
|
+
if (rest.children && Array.isArray(rest.children)) {
|
|
1026
|
+
rest.children = removeFieldRecursive(rest.children, field);
|
|
1027
|
+
}
|
|
1028
|
+
return rest;
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
exports.removeFieldRecursive = removeFieldRecursive;
|
|
1032
|
+
const filterDataByColumns3 = (data, queries) => {
|
|
1033
|
+
if (!queries || queries.length === 0) {
|
|
1034
|
+
return data;
|
|
1035
|
+
}
|
|
1036
|
+
return data.filter(item => {
|
|
1037
|
+
if (item.isFilterState === true) {
|
|
1038
|
+
return true;
|
|
1039
|
+
}
|
|
1040
|
+
let result = null;
|
|
1041
|
+
for (const query of queries) {
|
|
1042
|
+
const {
|
|
1043
|
+
field,
|
|
1044
|
+
value,
|
|
1045
|
+
operator,
|
|
1046
|
+
predicate
|
|
1047
|
+
} = query;
|
|
1048
|
+
const itemValue = item[field];
|
|
1049
|
+
let condition = false;
|
|
1050
|
+
const isDateComparison = isDate(itemValue) || isDateString(value);
|
|
1051
|
+
const itemDate = isDateComparison ? new Date(itemValue) : null;
|
|
1052
|
+
const queryDate = isDateComparison ? parseToDate(value) : null;
|
|
1053
|
+
const itemStr = itemValue?.toString().toLowerCase?.();
|
|
1054
|
+
const queryStr = value?.toString().toLowerCase?.();
|
|
1055
|
+
switch (operator.toLowerCase()) {
|
|
1056
|
+
case "equal":
|
|
1057
|
+
condition = isDateComparison ? compareDates(itemDate, queryDate) : itemValue == value;
|
|
1058
|
+
break;
|
|
1059
|
+
case "notequal":
|
|
1060
|
+
condition = isDateComparison ? !compareDates(itemDate, queryDate) : itemValue != value;
|
|
1061
|
+
break;
|
|
1062
|
+
case "greaterthan":
|
|
1063
|
+
// @ts-ignore
|
|
1064
|
+
condition = isDateComparison ? itemDate > queryDate : itemValue > value;
|
|
1065
|
+
|
|
1066
|
+
// condition = isDateComparison ? invalidDate(itemDate) && invalidDate(queryDate) && itemDate > queryDate : itemValue > value;
|
|
1067
|
+
break;
|
|
1068
|
+
case "greaterthanorequal":
|
|
1069
|
+
// @ts-ignore
|
|
1070
|
+
condition = isDateComparison ? itemDate >= queryDate : itemValue >= value;
|
|
1071
|
+
break;
|
|
1072
|
+
case "lessthan":
|
|
1073
|
+
// @ts-ignore
|
|
1074
|
+
condition = isDateComparison ? itemDate < queryDate : itemValue < value;
|
|
1075
|
+
break;
|
|
1076
|
+
case "lessthanorequal":
|
|
1077
|
+
// @ts-ignore
|
|
1078
|
+
condition = isDateComparison ? itemDate <= queryDate : itemValue <= value;
|
|
1079
|
+
break;
|
|
1080
|
+
case "contains":
|
|
1081
|
+
condition = itemStr?.includes(queryStr);
|
|
1082
|
+
break;
|
|
1083
|
+
case "startswith":
|
|
1084
|
+
condition = itemStr?.startsWith(queryStr);
|
|
1085
|
+
break;
|
|
1086
|
+
case "endswith":
|
|
1087
|
+
condition = itemStr?.endsWith(queryStr);
|
|
1088
|
+
break;
|
|
1089
|
+
default:
|
|
1090
|
+
console.warn(`Unknown operator: ${operator}`);
|
|
1091
|
+
break;
|
|
1092
|
+
}
|
|
1093
|
+
if (predicate === "and") {
|
|
1094
|
+
result = result === null ? condition : result && condition;
|
|
1095
|
+
} else if (predicate === "or") {
|
|
1096
|
+
result = result === null ? condition : result || condition;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
return result;
|
|
1100
|
+
});
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
// ======= Helper functions ========
|
|
1104
|
+
|
|
1105
|
+
// Kiểm tra có phải Date object không
|
|
1106
|
+
exports.filterDataByColumns3 = filterDataByColumns3;
|
|
1107
|
+
function isDate(value) {
|
|
1108
|
+
return value instanceof Date || !isNaN(Date.parse(value));
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// Chuỗi MM/YYYY → Date
|
|
1112
|
+
function isDateString(str) {
|
|
1113
|
+
return typeof str === "string" && (/^\d{2}\/\d{4}$/.test(str) || /^\d{4}-\d{2}-\d{2}$/.test(str));
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// // Helper: check if a string is in MM/YYYY format
|
|
1117
|
+
// export function isDateString(str: any) {
|
|
1118
|
+
// return typeof str === "string" && /^\d{2}\/\d{4}$/.test(str);
|
|
1119
|
+
// }
|
|
1120
|
+
|
|
1121
|
+
function parseToDate(str) {
|
|
1122
|
+
if (/^\d{2}\/\d{4}$/.test(str)) {
|
|
1123
|
+
const [month, year] = str.split('/');
|
|
1124
|
+
return new Date(parseInt(year), parseInt(month) - 1, 1);
|
|
1125
|
+
}
|
|
1126
|
+
return new Date(str);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// So sánh ngày (cùng ngày/tháng/năm)
|
|
1130
|
+
function compareDates(date1, date2) {
|
|
1131
|
+
return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
// Helper: compare MM/YYYY date string with itemValue
|
|
1135
|
+
function compareDate(itemValue, value) {
|
|
1136
|
+
const [month, year] = value.split('/').map(Number);
|
|
1137
|
+
const date = new Date(itemValue);
|
|
1138
|
+
return date.getMonth() + 1 === month && date.getFullYear() === year;
|
|
1139
|
+
}
|
|
1140
|
+
function invalidDate(date) {
|
|
1141
|
+
return date instanceof Date && !isNaN(date.getTime());
|
|
1142
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
t?: any;
|
|
4
|
+
format?: any;
|
|
5
|
+
min: number | string | undefined;
|
|
6
|
+
max: number | string | undefined;
|
|
7
|
+
onChange?: (values: any[]) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const NumberRange: (props: Props) => React.JSX.Element;
|
|
10
|
+
export default NumberRange;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNumericComponent = require("react-numeric-component");
|
|
9
|
+
var _rcMasterUi = require("rc-master-ui");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const NumberRange = props => {
|
|
13
|
+
const {
|
|
14
|
+
t,
|
|
15
|
+
max,
|
|
16
|
+
min,
|
|
17
|
+
onChange
|
|
18
|
+
} = props;
|
|
19
|
+
const values = _react.default.useMemo(() => [min, max], [min, max]);
|
|
20
|
+
|
|
21
|
+
// const [values, setValues] = React.useState<any[]>(() =>
|
|
22
|
+
// mergedValues,
|
|
23
|
+
// );
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: '',
|
|
27
|
+
style: {
|
|
28
|
+
display: 'flex'
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
style: {
|
|
32
|
+
marginBottom: 8
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
|
|
35
|
+
value: values[0] ?? ''
|
|
36
|
+
// value={min}
|
|
37
|
+
// thousandSeparator={checkThousandSeparator(thousandSeparator, decimalSeparator)}
|
|
38
|
+
// decimalSeparator={checkDecimalSeparator(thousandSeparator, decimalSeparator)}
|
|
39
|
+
,
|
|
40
|
+
allowNegative: true,
|
|
41
|
+
customInput: _rcMasterUi.Input,
|
|
42
|
+
className: ' rounded-0 input-element form-control',
|
|
43
|
+
onValueChange: vals => {
|
|
44
|
+
// onChangeValueFilter(type, values.floatValue, 'min')
|
|
45
|
+
|
|
46
|
+
// setValues([vals.floatValue, values[1]])
|
|
47
|
+
onChange?.([vals.floatValue, max]);
|
|
48
|
+
},
|
|
49
|
+
placeholder: t ? t('Min') : 'Min',
|
|
50
|
+
autoFocus: true
|
|
51
|
+
})), /*#__PURE__*/_react.default.createElement("span", null, "-"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
|
|
52
|
+
value: values[1] ?? ''
|
|
53
|
+
// value={max}
|
|
54
|
+
// thousandSeparator={checkThousandSeparator(thousandSeparator, decimalSeparator)}
|
|
55
|
+
// decimalSeparator={checkDecimalSeparator(thousandSeparator, decimalSeparator)}
|
|
56
|
+
,
|
|
57
|
+
allowNegative: true,
|
|
58
|
+
customInput: _rcMasterUi.Input,
|
|
59
|
+
className: ' rounded-0 input-element form-control',
|
|
60
|
+
onValueChange: vals => {
|
|
61
|
+
// setValues([values[0], vals.floatValue])
|
|
62
|
+
onChange?.([min, vals.floatValue]);
|
|
63
|
+
},
|
|
64
|
+
placeholder: t ? t('Max') : 'Max'
|
|
65
|
+
}))));
|
|
66
|
+
};
|
|
67
|
+
var _default = exports.default = NumberRange;
|
|
@@ -133,6 +133,21 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
133
133
|
|
|
134
134
|
.#{$prefix}-table-tbody {
|
|
135
135
|
|
|
136
|
+
|
|
137
|
+
.#{$prefix}-table-cell {
|
|
138
|
+
line-height: 22px;
|
|
139
|
+
|
|
140
|
+
.ui-rc-table-cell-content {
|
|
141
|
+
line-height: 22px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&.#{$prefix}-table-cell-fix-left-last {
|
|
145
|
+
.#{$prefix}-table-cell-content {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
136
151
|
.#{$prefix}-table-row {
|
|
137
152
|
|
|
138
153
|
&.#{$prefix}-table-row-selected {
|
|
@@ -212,6 +227,10 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
212
227
|
|
|
213
228
|
.#{$prefix}-table-cell {
|
|
214
229
|
|
|
230
|
+
.ui-rc-table-cell-content {
|
|
231
|
+
line-height: 22px;
|
|
232
|
+
}
|
|
233
|
+
|
|
215
234
|
&.#{$prefix}-table-cell-fix-left-last {
|
|
216
235
|
.#{$prefix}-table-cell-content {
|
|
217
236
|
//overflow: visible;
|
|
@@ -604,6 +623,10 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
604
623
|
background-color: $cell-selected-bg;
|
|
605
624
|
}
|
|
606
625
|
|
|
626
|
+
.ui-rc_cell-content.disable {
|
|
627
|
+
background-color: #f0f0f0;
|
|
628
|
+
}
|
|
629
|
+
|
|
607
630
|
.ui-rc_cell-content--index {
|
|
608
631
|
&.focus {
|
|
609
632
|
background-color: $cell-index-focus-bg;
|
|
@@ -688,6 +711,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
688
711
|
transition: 0.3s;
|
|
689
712
|
white-space: nowrap;
|
|
690
713
|
overflow: hidden;
|
|
714
|
+
line-height: 22px;
|
|
691
715
|
}
|
|
692
716
|
}
|
|
693
717
|
}
|
|
@@ -3,11 +3,14 @@ import type { ColumnsTable, GridTableProps } from "../type";
|
|
|
3
3
|
import type { GetRowKey } from "../type";
|
|
4
4
|
type Props<T> = GridTableProps<T> & {
|
|
5
5
|
tableRef: any;
|
|
6
|
+
triggerFilter?: (queries: any) => void;
|
|
6
7
|
triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
|
|
7
8
|
triggerChangeData?: (newData: T[], type: string) => void;
|
|
8
9
|
getRowKey: GetRowKey<T>;
|
|
9
10
|
triggerGroupColumns?: (groupedColumns: string[]) => void;
|
|
10
11
|
triggerPaste?: (pastedRows: T[], pastedColumnsArray: string[], newData: T[]) => void;
|
|
12
|
+
isFilter?: boolean;
|
|
13
|
+
setIsFilter?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
14
|
};
|
|
12
15
|
declare const Grid: <RecordType extends object>(props: Props<RecordType>) => React.JSX.Element;
|
|
13
16
|
export default Grid;
|