From c682a43d9ab09c25d95fd58f5cf879a005f69652 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 24 Dec 2024 14:13:41 +0100 Subject: [PATCH] Export stores --- .../src/components/grid/stores/filter.ts | 15 +++++++++++++-- .../src/components/grid/stores/index.ts | 6 ++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/filter.ts b/packages/frontend-core/src/components/grid/stores/filter.ts index 5eb67b6e7e..4061ee04d7 100644 --- a/packages/frontend-core/src/components/grid/stores/filter.ts +++ b/packages/frontend-core/src/components/grid/stores/filter.ts @@ -1,9 +1,20 @@ -import { get, derived } from "svelte/store" +import { get, derived, Writable } from "svelte/store" import { FieldType, UILogicalOperator } from "@budibase/types" import { Store as StoreContext } from "." import { memo } from "../../../utils/memo" -export const createStores = (context: StoreContext) => { +export interface FilterStore { + filter: Writable + inlineFilters: Writable +} + +export interface FilterDerivedStore { + allFilters: Writable +} + +export type Store = FilterStore & FilterDerivedStore + +export const createStores = (context: StoreContext): FilterStore => { const { props } = context // Initialise to default props diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 59293f579b..659f45d56a 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -63,12 +63,10 @@ export type Store = BaseStore & Datasource.Store & Validation.Store & Users.Store & - Menu.Store & { + Menu.Store & + Filter.Store & { // TODO while typing the rest of stores fetch: Writable - filter: Writable - inlineFilters: Writable - allFilters: Writable sort: Writable initialFilter: Writable initialSortColumn: Writable