@bigbinary/neeto-filters-frontend 2.11.17 → 2.11.19
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/README.md +2 -0
- package/dist/index.cjs.js +3 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -0
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ export const SAMPLE_FILTER_FIELDS = [
|
|
|
71
71
|
label: "Name",
|
|
72
72
|
suffixComponent: () => <Component />
|
|
73
73
|
type: "text",
|
|
74
|
+
preprocessor: (value) => value.trim(),
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
key: "email",
|
|
@@ -92,6 +93,7 @@ export const SAMPLE_FILTER_FIELDS = [
|
|
|
92
93
|
- `node`: The column in DB table corresponding to the field.
|
|
93
94
|
- `label` The label to be shown just above the field in Pane.
|
|
94
95
|
- `suffixComponent` The component to be shown at the end of the respective Block in filters Bar.
|
|
96
|
+
- `preprocessor` The function to be used to preprocess the value before applying the filter.
|
|
95
97
|
- `type`: The nature/type of the field needed in pane.
|
|
96
98
|
- The supported types are `text`, `number`, `decimal`, `date`, `single_date`, `time`, `single_time`, `single_option`, `multi_option` and `boolean`
|
|
97
99
|
- `model`: If the node provided is **not** directly refering to the column within the table being queried for the filtered results, then we need to provide the **model** corresponding to the target table.
|
package/dist/index.cjs.js
CHANGED
|
@@ -3644,7 +3644,7 @@ var buildUpdatedFilter = function buildUpdatedFilter(_ref8) {
|
|
|
3644
3644
|
rule = _ref8$rule === void 0 ? "" : _ref8$rule,
|
|
3645
3645
|
_ref8$value = _ref8.value,
|
|
3646
3646
|
value = _ref8$value === void 0 ? "" : _ref8$value;
|
|
3647
|
-
var filter = ramda.
|
|
3647
|
+
var filter = ramda.omit(["values", "preprocessor"], column);
|
|
3648
3648
|
if (isMulti(defaultType)) {
|
|
3649
3649
|
return ramda.mergeLeft(filter, {
|
|
3650
3650
|
value: ramda.pluck("value", option),
|
|
@@ -3659,9 +3659,10 @@ var buildUpdatedFilter = function buildUpdatedFilter(_ref8) {
|
|
|
3659
3659
|
timezone: getTimezone()
|
|
3660
3660
|
});
|
|
3661
3661
|
} else if (isText(defaultType) || isDigit(defaultType)) {
|
|
3662
|
+
var _column$preprocessor;
|
|
3662
3663
|
return ramda.mergeLeft(filter, {
|
|
3663
3664
|
rule: rule,
|
|
3664
|
-
value: value
|
|
3665
|
+
value: (column === null || column === void 0 ? void 0 : (_column$preprocessor = column.preprocessor) === null || _column$preprocessor === void 0 ? void 0 : _column$preprocessor.call(column, value)) || value
|
|
3665
3666
|
});
|
|
3666
3667
|
} else if (isSingleTime(defaultType)) {
|
|
3667
3668
|
return ramda.mergeLeft(filter, {
|