@bigbinary/neeto-filters-frontend 2.11.20 → 2.12.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/README.md +29 -0
- package/dist/index.cjs.js +2302 -2953
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +2304 -2956
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/types.d.ts +16 -0
package/README.md
CHANGED
|
@@ -188,6 +188,35 @@ const [filters, setFilters] = useState(() => buildFiltersFromURL([...SAMPLE_FIL
|
|
|
188
188
|
const [selectors, setSelectors] = useState(() => buildSelectorsFromURL(FILTER_COLUMNS));
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
+
### 5. `buildFilterColumnsFromFields` function
|
|
192
|
+
|
|
193
|
+
The `buildFilterColumnsFromFields` function is used to generate an array of filter columns based on the provided fields and selected field names.
|
|
194
|
+
|
|
195
|
+
#### Parameters
|
|
196
|
+
|
|
197
|
+
- `fields` (array): An array of field objects representing the available fields.
|
|
198
|
+
- `selectedFields` (array, optional): An array of strings representing the selected field names. Defaults to an empty array.
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
const fields = [
|
|
202
|
+
{
|
|
203
|
+
id: '1',
|
|
204
|
+
name: 'name',
|
|
205
|
+
kind: 'text',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: '2',
|
|
209
|
+
name: 'age',
|
|
210
|
+
kind: 'number',
|
|
211
|
+
},
|
|
212
|
+
// Add more field objects as needed
|
|
213
|
+
];
|
|
214
|
+
|
|
215
|
+
const selectedFields = ['name', 'age'];
|
|
216
|
+
|
|
217
|
+
const filterColumns = buildFilterColumnsFromFields(fields, selectedFields);
|
|
218
|
+
```
|
|
219
|
+
|
|
191
220
|
## Development
|
|
192
221
|
|
|
193
222
|
Install all the dependencies by executing the following command
|