Skip to content

Commit

Permalink
Version Packages (#40)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed Aug 11, 2024
1 parent f707d11 commit 3b53224
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 115 deletions.
7 changes: 0 additions & 7 deletions .changeset/dull-ants-lick.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/hip-pumas-build.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/moody-snakes-knock.md

This file was deleted.

20 changes: 0 additions & 20 deletions .changeset/proud-monkeys-bake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/seven-years-exercise.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/silent-jars-suffer.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/stupid-pigs-help.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twenty-jars-poke.md

This file was deleted.

32 changes: 0 additions & 32 deletions .changeset/wild-hairs-tan.md

This file was deleted.

11 changes: 11 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @fn-sphere/core

## 0.4.0

### Patch Changes

- e0f5632: Fix `isValidRule` incorrectly returned `false` for functions with `skipValidate` enabled

Now, even if `skipValidate` is enabled, the input data is still checked for length.

- 744b13e: Allow attaching meta to filter rule
- b042713: Add countValidRules function

## 0.3.8

## 0.3.7
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fn-sphere/core",
"version": "0.3.8",
"version": "0.4.0",
"description": "",
"type": "module",
"main": "src/index.ts",
Expand Down
93 changes: 93 additions & 0 deletions packages/filter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,98 @@
# @fn-sphere/filter

## 0.4.0

### Minor Changes

- 55b7fb1: - In `useFilterSelect`:
- The `updateField` function has been deprecated and replaced with `setField` for clarity and consistency.
- The `updateFilter` function has been deprecated and replaced with `setFilter`.
- In `useFilterRule`:
- The `updateRule` function has been renamed to `setRule`
- Added a new `duplicateRule` function to duplicate a rule.
- Added a new `invertRule` function.
- In `useFilterGroup` and `useFilterRule`:
- The parameter `SingleFilter` has been changed to `SingleFilterInput` for simplicity.
- The parameter `FilterGroup` has been changed to `FilterGroupInput` for simplicity.
- e05bcbe: Removed inline theme merging logic from `FilterSphereProvider`.

Introduced `createFilterTheme` for theme merging.

Migration guide:

```diff
- <FilterSphereProvider theme={customTheme}>
+ const theme = createFilterTheme(customTheme);
+ <FilterSphereProvider theme={theme}>
```

### Patch Changes

- 0ce4129: Add `tryRetainArgs` to allow retaining `args` when filter is changed
- d4c6a7d: - Update `useFilterSphere` hook to use `predicate` instead of `getPredicate`:

```diff
import { useFilterSphere } from "@fn-sphere/filter";

- const { rule, predicate, context } = useFilterSphere({
+ const { rule, getPredicate, context } = useFilterSphere({
schema: YOUR_DATA_SCHEMA,
});

- const filteredData = YOUR_DATA.filter(getPredicate());
+ const filteredData = YOUR_DATA.filter(predicate);
```

- Update `countTotalRules()` to `get totalRuleCount` in `useFilterSphere` hook
- Add `validRuleCount` to `useFilterSphere` hook to get the count of valid rules

- c5ad41a: Add `countValidRules` function to `useFilterSphere` hook

```ts
const { countValidRules } = useFilterSphere();
const validRulesCount = countValidRules();
```

- 311f306: - Added the ability to retain the current filter and arguments when the field is changed in the `useFilterSelect` hook.

- Introduced the `UpdateFieldOptions` type to specify the behavior when updating the field.
- Updated the `FieldSelect` component to pass the `updateFieldOptions` to the `updateField` function.

```tsx
export type UpdateFieldOptions = {
/**
* Try to continue using the current filter when the field is changed.
*
* @default true
*/
tryRetainFilter?: boolean;
/**
* Automatically select the first filter when the field is changed and the filter is not retained.
*
* @default true
*/
autoSelectFirstFilter?: boolean;
/**
* Try to continue using the current args when the field is changed.
*
* @default true
*/
tryRetainArgs?: boolean;
};

<FieldSelect
rule={rule}
tryRetainFilter
autoSelectFirstFilter
tryRetainArgs
/>;
```

- Updated dependencies [e0f5632]
- Updated dependencies [744b13e]
- Updated dependencies [b042713]
- @fn-sphere/core@0.4.0

## 0.3.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/filter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fn-sphere/filter",
"version": "0.3.8",
"version": "0.4.0",
"type": "module",
"main": "src/index.ts",
"scripts": {
Expand Down

0 comments on commit 3b53224

Please sign in to comment.