Releases: lawvs/fn-sphere
@fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
Patch Changes
-
caeeb9c: Move
createFilterGroup
andcreateSingleFilter
to core package.Add
getFilterRule
method tocreateFilterSphere
. -
79abaa0: Update readme
-
Updated dependencies [caeeb9c]
-
Updated dependencies [79abaa0]
- @fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
Patch Changes
- 2a8d304: Add new
reset
method touseFilterSphere
hook - 3ccf45a: Update styles for default templates
- @fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
Patch Changes
-
aef8fbc: Fix
numberOfRules
should only count the SingleRule and not the RuleGroup.Return
countTotalRules
function touseFilterSphere
hook.- @fn-sphere/[email protected]
@fn-sphere/[email protected]
Minor Changes
-
49df2cd: Add new
FilterSphereProvider
component to provide filter context to children components.Add
useFilterSphere
hook to access filter predicate.The
FilterBuilder
component no longer adds a provider to its child components.const { filterRule, schema, predicate } = useFilterSphere<YourData>(); const filteredData = data.filter(predicate);
-
c66db35: Redesign
useFilterSphere
hook to return agetPredicate
function and acontext
object.import { useFilterSphere } from "@fn-sphere/filter"; const { getPredicate, context } = useFilterSphere<YourData>({ schema: yourDataSchema, }); const predicate = getPredicate(); const filteredData = data.filter(predicate);
Patch Changes
-
1c4bfae: Rename
BasicFilterBuilderProps
toBasicFilterSphereInput
and update type definitions.Export new type
BasicFilterSphereProps
.export interface BasicFilterSphereInput<Data = unknown> { filterRule: FilterGroup; schema: ZodType<Data>; filterFnList?: FnSchema[]; fieldDeepLimit?: number; mapFieldName?: (field: FilterField) => string; mapFilterName?: ( filterSchema: StandardFnSchema, field: FilterField, ) => string; onRuleChange?: (rule: FilterGroup) => void; } export type BasicFilterSphereProps<Data = unknown> = Required< BasicFilterSphereInput<Data> >;
-
1ac1c43: Rename
createEmptyFilter
tocreateEmptySingleFilter
andcreateEmptyFilterGroup
tocreateFilterGroup
. -
1ac1c43: Add
SingleFilterContainer
to template. -
991d8e7: Export
useRootRule
anduseFilterSelect
hooks. -
b31b201: Rename
filterList
tofilterFnList
-
Updated dependencies [b31b201]
- @fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
@fn-sphere/[email protected]
Patch Changes
- b31b201: Rename
filterList
tofilterFnList