Skip to content

Releases: lawvs/fn-sphere

@fn-sphere/[email protected]

06 Aug 09:34
3d04bc5
Compare
Choose a tag to compare

@fn-sphere/[email protected]

05 Aug 15:37
6404a4e
Compare
Choose a tag to compare

Patch Changes

  • caeeb9c: Move createFilterGroup and createSingleFilter to core package.

    Add getFilterRule method to createFilterSphere.

  • 79abaa0: Update readme

  • Updated dependencies [caeeb9c]

  • Updated dependencies [79abaa0]

@fn-sphere/[email protected]

05 Aug 15:37
6404a4e
Compare
Choose a tag to compare

Patch Changes

  • caeeb9c: Move createFilterGroup and createSingleFilter to core package.

    Add getFilterRule method to createFilterSphere.

  • 79abaa0: Update readme

@fn-sphere/[email protected]

04 Aug 14:37
c3d9483
Compare
Choose a tag to compare

Patch Changes

@fn-sphere/[email protected]

04 Aug 14:37
c3d9483
Compare
Choose a tag to compare

@fn-sphere/[email protected]

03 Aug 15:54
70f61b1
Compare
Choose a tag to compare

Patch Changes

  • aef8fbc: Fix numberOfRules should only count the SingleRule and not the RuleGroup.

    Return countTotalRules function to useFilterSphere hook.

@fn-sphere/[email protected]

03 Aug 10:52
cba1c98
Compare
Choose a tag to compare

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 a getPredicate function and a context 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 to BasicFilterSphereInput 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 to createEmptySingleFilter and createEmptyFilterGroup to createFilterGroup.

  • 1ac1c43: Add SingleFilterContainer to template.

  • 991d8e7: Export useRootRule and useFilterSelect hooks.

  • b31b201: Rename filterList to filterFnList

  • Updated dependencies [b31b201]

@fn-sphere/[email protected]

03 Aug 15:54
70f61b1
Compare
Choose a tag to compare

@fn-sphere/[email protected]

03 Aug 10:52
cba1c98
Compare
Choose a tag to compare

Patch Changes

  • b31b201: Rename filterList to filterFnList

@fn-sphere/[email protected]

31 Jul 20:17
7a6872c
Compare
Choose a tag to compare

Minor Changes

Patch Changes