@bigbinary/neeto-filters-frontend 2.13.0 → 2.13.1
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.js +20 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3233,6 +3233,13 @@ var groupByGroup = ramda.groupBy(function (_ref) {
|
|
|
3233
3233
|
var group = _ref.group;
|
|
3234
3234
|
return group || "individual";
|
|
3235
3235
|
});
|
|
3236
|
+
var standardizeColumnType = function standardizeColumnType(kind) {
|
|
3237
|
+
// neeto-fields-nano supports `monetary` and `number` as type of fields, which will be acting as `decimal` in action.
|
|
3238
|
+
if (["custom.monetary", "custom.number"].includes(kind)) {
|
|
3239
|
+
return "custom.decimal";
|
|
3240
|
+
}
|
|
3241
|
+
return kind;
|
|
3242
|
+
};
|
|
3236
3243
|
var isBoolean = function isBoolean(type) {
|
|
3237
3244
|
return type === "boolean" || type === "custom.boolean";
|
|
3238
3245
|
};
|
|
@@ -3258,7 +3265,7 @@ var isText = function isText(type) {
|
|
|
3258
3265
|
return type === "text" || type === "custom.text";
|
|
3259
3266
|
};
|
|
3260
3267
|
var isDigit = function isDigit(type) {
|
|
3261
|
-
return
|
|
3268
|
+
return ["number", "decimal", "custom.decimal", "custom.number"].includes(type);
|
|
3262
3269
|
};
|
|
3263
3270
|
var isCustomDateRange = function isCustomDateRange(value) {
|
|
3264
3271
|
return !ramda.pluck("value", DATE_OPTIONS).includes(value);
|
|
@@ -3797,6 +3804,13 @@ var buildFilterColumnsFromFields = function buildFilterColumnsFromFields(fields)
|
|
|
3797
3804
|
return columns;
|
|
3798
3805
|
}, []);
|
|
3799
3806
|
};
|
|
3807
|
+
var getColumnsWithStandardizedType = function getColumnsWithStandardizedType(columns) {
|
|
3808
|
+
return columns.map(function (column) {
|
|
3809
|
+
return _objectSpread$3(_objectSpread$3({}, column), {}, {
|
|
3810
|
+
type: standardizeColumnType(column.type)
|
|
3811
|
+
});
|
|
3812
|
+
});
|
|
3813
|
+
};
|
|
3800
3814
|
|
|
3801
3815
|
var buildCustomDateValue = function buildCustomDateValue(value) {
|
|
3802
3816
|
var isBeforeOrAfter = Math.abs(dayjs__default["default"](value[1]).diff(dayjs__default["default"](value[0]), "year")) >= 90;
|
|
@@ -7590,6 +7604,9 @@ var Pane = function Pane(_ref) {
|
|
|
7590
7604
|
var history = reactRouterDom.useHistory();
|
|
7591
7605
|
var _useTranslation = useTranslation(),
|
|
7592
7606
|
t = _useTranslation.t;
|
|
7607
|
+
columns = React.useMemo(function () {
|
|
7608
|
+
return getColumnsWithStandardizedType(columns);
|
|
7609
|
+
}, [columns]);
|
|
7593
7610
|
var _buildFilteredColumns = buildFilteredColumns({
|
|
7594
7611
|
searchTerm: searchTerm,
|
|
7595
7612
|
columns: columns
|
|
@@ -7674,9 +7691,9 @@ var Pane = function Pane(_ref) {
|
|
|
7674
7691
|
autoFocus: column.key === isOpen,
|
|
7675
7692
|
column: column,
|
|
7676
7693
|
filters: filters,
|
|
7694
|
+
onClose: onClose,
|
|
7677
7695
|
key: column.key,
|
|
7678
|
-
onChange: handleChange
|
|
7679
|
-
onClose: onClose
|
|
7696
|
+
onChange: handleChange
|
|
7680
7697
|
});
|
|
7681
7698
|
}), pure.isPresent(groupedColumns) && /*#__PURE__*/React__default["default"].createElement(neetoui.Accordion, {
|
|
7682
7699
|
defaultActiveKey: groupedColumns.findIndex(function (_ref4) {
|