@stenajs-webui/filter 17.5.0 → 17.8.0

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/features/search-filter/components/SearchFilterButton.d.ts +6 -6
  3. package/dist/features/search-filter/components/SearchFilterDrawer.d.ts +7 -7
  4. package/dist/features/search-filter/components/SearchFilterPanelHeader.d.ts +7 -7
  5. package/dist/features/search-filter/components/SearchFilterSection.d.ts +14 -14
  6. package/dist/features/search-filter/components/context/SearchFilterContext.d.ts +10 -10
  7. package/dist/features/search-filter/components/context/SearchFilterLocalStateContext.d.ts +7 -7
  8. package/dist/features/search-filter/config/SearchFilterConfig.d.ts +13 -13
  9. package/dist/features/search-filter/context/SearchFilterActionsContext.d.ts +4 -4
  10. package/dist/features/search-filter/context/SearchFilterDispatchContext.d.ts +4 -4
  11. package/dist/features/search-filter/context/SearchFilterModelContext.d.ts +3 -3
  12. package/dist/features/search-filter/context/SearchFilterStateContext.d.ts +4 -4
  13. package/dist/features/search-filter/features/chips/ChipSpacer.d.ts +5 -5
  14. package/dist/features/search-filter/features/chips/EmptyChip.d.ts +7 -7
  15. package/dist/features/search-filter/features/chips/SearchFilterChip.d.ts +10 -10
  16. package/dist/features/search-filter/features/chips/SearchFilterChips.d.ts +8 -8
  17. package/dist/features/search-filter/features/chips/SectionChips.d.ts +9 -9
  18. package/dist/features/search-filter/hooks/UseLocalSearchFilterState.d.ts +11 -11
  19. package/dist/features/search-filter/redux/SearchFilterRedux.d.ts +30 -30
  20. package/dist/features/search-filter/section-factories/boolean-record/BooleanRecordChips.d.ts +6 -6
  21. package/dist/features/search-filter/section-factories/boolean-record/BooleanRecordTypes.d.ts +6 -6
  22. package/dist/features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection.d.ts +10 -10
  23. package/dist/features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection.d.ts +8 -8
  24. package/dist/features/search-filter/section-factories/date-range/DateRangeChips.d.ts +6 -6
  25. package/dist/features/search-filter/section-factories/date-range/DateRangePropsFactory.d.ts +2 -2
  26. package/dist/features/search-filter/section-factories/date-range/components/DateRangeCalendarSection.d.ts +13 -13
  27. package/dist/features/search-filter/types/FilterEntity.d.ts +5 -5
  28. package/dist/index.d.ts +28 -28
  29. package/dist/index.es.js +471 -387
  30. package/dist/index.es.js.map +1 -1
  31. package/dist/index.js +4 -467
  32. package/dist/index.js.map +1 -1
  33. package/package.json +14 -15
  34. package/dist/features/search-filter/stories/SearchFilter.stories.d.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # v17.7.0 (Fri Jul 01 2022)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Build packages with vite [#475](https://github.com/StenaIT/stenajs-webui/pull/475) ([@lindskogen](https://github.com/lindskogen))
6
+
7
+ #### Authors: 1
8
+
9
+ - Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
10
+
11
+ ---
12
+
13
+ # v17.6.0 (Fri Jul 01 2022)
14
+
15
+ #### 🚀 Enhancement
16
+
17
+ - Use Stena icons instead of Font Awesome icons [#471](https://github.com/StenaIT/stenajs-webui/pull/471) (david.zetterdahl@stenaline.com [@LordDz](https://github.com/LordDz) [@lindskogen](https://github.com/lindskogen))
18
+
19
+ #### Authors: 3
20
+
21
+ - David ([@LordDz](https://github.com/LordDz))
22
+ - David Zetterdahl (david.zetterdahl@stenaline.com)
23
+ - Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
24
+
25
+ ---
26
+
1
27
  # v17.4.1 (Wed Jun 29 2022)
2
28
 
3
29
  #### 🐛 Bug Fix
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
- interface SearchFilterDrawerButtonProps {
3
- label?: string;
4
- }
5
- export declare const SearchFilterButton: React.VFC<SearchFilterDrawerButtonProps>;
6
- export {};
1
+ import * as React from "react";
2
+ interface SearchFilterDrawerButtonProps {
3
+ label?: string;
4
+ }
5
+ export declare const SearchFilterButton: React.VFC<SearchFilterDrawerButtonProps>;
6
+ export {};
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import { DrawerProps } from "@stenajs-webui/modal";
3
- interface SearchFilterDrawerProps extends Omit<DrawerProps, "isOpen" | "onRequestClose"> {
4
- header?: string;
5
- }
6
- export declare const SearchFilterDrawer: React.FC<SearchFilterDrawerProps>;
7
- export {};
1
+ import * as React from "react";
2
+ import { DrawerProps } from "@stenajs-webui/modal";
3
+ interface SearchFilterDrawerProps extends Omit<DrawerProps, "isOpen" | "onRequestClose"> {
4
+ header?: string;
5
+ }
6
+ export declare const SearchFilterDrawer: React.FC<SearchFilterDrawerProps>;
7
+ export {};
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- interface SearchFilterPanelHeaderProps {
3
- onRequestClose: () => void;
4
- header?: string;
5
- }
6
- export declare const SearchFilterPanelHeader: React.FC<SearchFilterPanelHeaderProps>;
7
- export {};
1
+ import * as React from "react";
2
+ interface SearchFilterPanelHeaderProps {
3
+ onRequestClose: () => void;
4
+ header?: string;
5
+ }
6
+ export declare const SearchFilterPanelHeader: React.FC<SearchFilterPanelHeaderProps>;
7
+ export {};
@@ -1,14 +1,14 @@
1
- import * as React from "react";
2
- import { PropsWithChildren } from "react";
3
- export interface SearchFilterSectionProps<TSectionKey extends string> {
4
- sectionId: TSectionKey;
5
- contentLeft?: React.ReactNode;
6
- contentRight?: React.ReactNode;
7
- disableContentPadding?: boolean;
8
- loading?: boolean;
9
- error?: string;
10
- onRetry?: () => void;
11
- label?: string;
12
- }
13
- export declare const SearchFilterSection: <TSectionKey extends string>({ sectionId, label, contentLeft, contentRight, loading, error, onRetry, disableContentPadding, children, }: React.PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) => JSX.Element;
14
- export declare const formatColumnIdToHeaderCellLabel: (columnId: string) => string;
1
+ import * as React from "react";
2
+ import { PropsWithChildren } from "react";
3
+ export interface SearchFilterSectionProps<TSectionKey extends string> {
4
+ sectionId: TSectionKey;
5
+ contentLeft?: React.ReactNode;
6
+ contentRight?: React.ReactNode;
7
+ disableContentPadding?: boolean;
8
+ loading?: boolean;
9
+ error?: string;
10
+ onRetry?: () => void;
11
+ label?: string;
12
+ }
13
+ export declare const SearchFilterSection: <TSectionKey extends string>({ sectionId, label, contentLeft, contentRight, loading, error, onRetry, disableContentPadding, children, }: React.PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) => JSX.Element;
14
+ export declare const formatColumnIdToHeaderCellLabel: (columnId: string) => string;
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import { PropsWithChildren } from "react";
3
- import { SearchFilterActions, SearchFilterDispatch, SearchFilterState } from "../../redux/SearchFilterRedux";
4
- interface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {
5
- state: SearchFilterState<TFormModel>;
6
- dispatch: SearchFilterDispatch<TFormModel>;
7
- actions: SearchFilterActions<TFormModel, TSectionKey>;
8
- }
9
- export declare const SearchFilterContext: <TFormModel, TSectionKey extends string>({ state, dispatch, actions, children, }: React.PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) => JSX.Element;
10
- export {};
1
+ import * as React from "react";
2
+ import { PropsWithChildren } from "react";
3
+ import { SearchFilterActions, SearchFilterDispatch, SearchFilterState } from "../../redux/SearchFilterRedux";
4
+ interface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {
5
+ state: SearchFilterState<TFormModel>;
6
+ dispatch: SearchFilterDispatch<TFormModel>;
7
+ actions: SearchFilterActions<TFormModel, TSectionKey>;
8
+ }
9
+ export declare const SearchFilterContext: <TFormModel, TSectionKey extends string>({ state, dispatch, actions, children, }: React.PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) => JSX.Element;
10
+ export {};
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import { PropsWithChildren } from "react";
3
- interface SearchFilterLocalScopeProps<TFormModel> {
4
- initialFormModel: TFormModel;
5
- }
6
- export declare const SearchFilterLocalStateContext: <TFormModel>({ initialFormModel, children, }: React.PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) => JSX.Element;
7
- export {};
1
+ import * as React from "react";
2
+ import { PropsWithChildren } from "react";
3
+ interface SearchFilterLocalScopeProps<TFormModel> {
4
+ initialFormModel: TFormModel;
5
+ }
6
+ export declare const SearchFilterLocalStateContext: <TFormModel>({ initialFormModel, children, }: React.PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) => JSX.Element;
7
+ export {};
@@ -1,13 +1,13 @@
1
- export interface SearchFilterSectionChipModel {
2
- value: string;
3
- label: string;
4
- }
5
- export declare type SearchFilterSectionOnClickRemoveOnChip<TFormModel> = (arg: OnClickRemoveOnChipArg<TFormModel>) => void;
6
- export interface ChipsArg<TSearchFilterModel> {
7
- formModel: TSearchFilterModel;
8
- }
9
- export declare type FormFieldsSetter<TFormModel> = (fields: Partial<TFormModel>) => void;
10
- export interface OnClickRemoveOnChipArg<TFormModel> {
11
- value: string;
12
- setFormModelFields: FormFieldsSetter<TFormModel>;
13
- }
1
+ export interface SearchFilterSectionChipModel {
2
+ value: string;
3
+ label: string;
4
+ }
5
+ export declare type SearchFilterSectionOnClickRemoveOnChip<TFormModel> = (arg: OnClickRemoveOnChipArg<TFormModel>) => void;
6
+ export interface ChipsArg<TSearchFilterModel> {
7
+ formModel: TSearchFilterModel;
8
+ }
9
+ export declare type FormFieldsSetter<TFormModel> = (fields: Partial<TFormModel>) => void;
10
+ export interface OnClickRemoveOnChipArg<TFormModel> {
11
+ value: string;
12
+ setFormModelFields: FormFieldsSetter<TFormModel>;
13
+ }
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
2
- import { SearchFilterActions } from "../redux/SearchFilterRedux";
3
- export declare const SearchFilterActionsContext: import("react").Context<SearchFilterActions<unknown, any>>;
4
- export declare const useSearchFilterActions: <TFormModel, TSectionKey extends string>() => SearchFilterActions<TFormModel, TSectionKey>;
1
+ /// <reference types="react" />
2
+ import { SearchFilterActions } from "../redux/SearchFilterRedux";
3
+ export declare const SearchFilterActionsContext: import("react").Context<SearchFilterActions<unknown, any>>;
4
+ export declare const useSearchFilterActions: <TFormModel, TSectionKey extends string>() => SearchFilterActions<TFormModel, TSectionKey>;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
2
- import { SearchFilterDispatch } from "../redux/SearchFilterRedux";
3
- export declare const SearchFilterDispatchContext: import("react").Context<SearchFilterDispatch<unknown>>;
4
- export declare const useSearchFilterDispatch: () => SearchFilterDispatch<unknown>;
1
+ /// <reference types="react" />
2
+ import { SearchFilterDispatch } from "../redux/SearchFilterRedux";
3
+ export declare const SearchFilterDispatchContext: import("react").Context<SearchFilterDispatch<unknown>>;
4
+ export declare const useSearchFilterDispatch: () => SearchFilterDispatch<unknown>;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- export declare const SearchFilterModelContext: import("react").Context<unknown>;
3
- export declare const useSearchFilterModel: <TFormModel>() => TFormModel;
1
+ /// <reference types="react" />
2
+ export declare const SearchFilterModelContext: import("react").Context<unknown>;
3
+ export declare const useSearchFilterModel: <TFormModel>() => TFormModel;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
2
- import { SearchFilterState } from "../redux/SearchFilterRedux";
3
- export declare const SearchFilterStateContext: import("react").Context<SearchFilterState<unknown>>;
4
- export declare const useSearchFilterState: <TFormModel>() => SearchFilterState<TFormModel>;
1
+ /// <reference types="react" />
2
+ import { SearchFilterState } from "../redux/SearchFilterRedux";
3
+ export declare const SearchFilterStateContext: import("react").Context<SearchFilterState<unknown>>;
4
+ export declare const useSearchFilterState: <TFormModel>() => SearchFilterState<TFormModel>;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
- export declare const ChipSpacer: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /// <reference types="react" />
2
+ export declare const ChipSpacer: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- interface EmptyChipProps<TSectionKey extends string> {
3
- sectionId: TSectionKey;
4
- label: string;
5
- }
6
- export declare const EmptyChip: <TSectionKey extends string>({ label, sectionId, }: EmptyChipProps<TSectionKey>) => JSX.Element;
7
- export {};
1
+ /// <reference types="react" />
2
+ interface EmptyChipProps<TSectionKey extends string> {
3
+ sectionId: TSectionKey;
4
+ label: string;
5
+ }
6
+ export declare const EmptyChip: <TSectionKey extends string>({ label, sectionId, }: EmptyChipProps<TSectionKey>) => JSX.Element;
7
+ export {};
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
- import { SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
- interface SearchFilterChipProps<TFormModel, TSectionKey> {
4
- sectionId: TSectionKey;
5
- label: string;
6
- value: string;
7
- onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
8
- }
9
- export declare const SearchFilterChip: <TFormModel, TSectionKey extends string>({ sectionId, label, value, onClickRemove, }: SearchFilterChipProps<TFormModel, TSectionKey>) => JSX.Element;
10
- export {};
1
+ /// <reference types="react" />
2
+ import { SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
+ interface SearchFilterChipProps<TFormModel, TSectionKey> {
4
+ sectionId: TSectionKey;
5
+ label: string;
6
+ value: string;
7
+ onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
8
+ }
9
+ export declare const SearchFilterChip: <TFormModel, TSectionKey extends string>({ sectionId, label, value, onClickRemove, }: SearchFilterChipProps<TFormModel, TSectionKey>) => JSX.Element;
10
+ export {};
@@ -1,8 +1,8 @@
1
- import * as React from "react";
2
- import { ReactNode } from "react";
3
- interface SearchFilterChipsProps {
4
- disableClearAllButton?: boolean;
5
- children?: ReactNode;
6
- }
7
- export declare const SearchFilterChips: React.FC<SearchFilterChipsProps>;
8
- export {};
1
+ import * as React from "react";
2
+ import { ReactNode } from "react";
3
+ interface SearchFilterChipsProps {
4
+ disableClearAllButton?: boolean;
5
+ children?: ReactNode;
6
+ }
7
+ export declare const SearchFilterChips: React.FC<SearchFilterChipsProps>;
8
+ export {};
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
- import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
- export interface SectionChipsProps<TFormModel, TSectionKey extends string> {
4
- sectionId: TSectionKey;
5
- chips?: Array<SearchFilterSectionChipModel>;
6
- emptyChipLabel?: string;
7
- onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
8
- }
9
- export declare const SectionChips: <TFormModel, TSectionKey extends string>({ sectionId, chips, emptyChipLabel, onClickRemoveOnChip, }: SectionChipsProps<TFormModel, TSectionKey>) => JSX.Element | null;
1
+ /// <reference types="react" />
2
+ import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
+ export interface SectionChipsProps<TFormModel, TSectionKey extends string> {
4
+ sectionId: TSectionKey;
5
+ chips?: Array<SearchFilterSectionChipModel>;
6
+ emptyChipLabel?: string;
7
+ onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
8
+ }
9
+ export declare const SectionChips: <TFormModel, TSectionKey extends string>({ sectionId, chips, emptyChipLabel, onClickRemoveOnChip, }: SectionChipsProps<TFormModel, TSectionKey>) => JSX.Element | null;
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
2
- import { SearchFilterState } from "../redux/SearchFilterRedux";
3
- export declare const useLocalSearchFilterState: <TFormModel, TSectionKey extends string>(initialState: SearchFilterState<TFormModel>) => {
4
- actions: import("../redux/SearchFilterRedux").SearchFilterActions<TFormModel, TSectionKey>;
5
- state: import("redux").CombinedState<{
6
- expandedSections: import("@stenajs-webui/redux").ValueByIdState<boolean>;
7
- formModel: TFormModel;
8
- settings: import("../redux/SearchFilterRedux").SearchFilterSettings;
9
- }>;
10
- dispatch: import("react").Dispatch<import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").ValueByIdAction<boolean>> | import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").EntityAction<import("../redux/SearchFilterRedux").SearchFilterSettings>> | import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").EntityAction<TFormModel>>>;
11
- };
1
+ /// <reference types="react" />
2
+ import { SearchFilterState } from "../redux/SearchFilterRedux";
3
+ export declare const useLocalSearchFilterState: <TFormModel, TSectionKey extends string>(initialState: SearchFilterState<TFormModel>) => {
4
+ actions: import("../redux/SearchFilterRedux").SearchFilterActions<TFormModel, TSectionKey>;
5
+ state: import("redux").CombinedState<{
6
+ expandedSections: import("@stenajs-webui/redux").ValueByIdState<boolean>;
7
+ formModel: TFormModel;
8
+ settings: import("../redux/SearchFilterRedux").SearchFilterSettings;
9
+ }>;
10
+ dispatch: import("react").Dispatch<import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").ValueByIdAction<boolean>> | import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").EntityAction<import("../redux/SearchFilterRedux").SearchFilterSettings>> | import("@stenajs-webui/redux").ReducerIdGateAction<import("@stenajs-webui/redux").EntityAction<TFormModel>>>;
11
+ };
@@ -1,30 +1,30 @@
1
- import { EntityAction, EntityState, ReducerIdGateAction, ValueByIdAction, ValueByIdState } from "@stenajs-webui/redux";
2
- import { Dispatch } from "react";
3
- export interface SearchFilterSettings {
4
- open: boolean;
5
- }
6
- export declare type SearchFilterDispatch<TFormModel> = Dispatch<SearchFilterAction<TFormModel>>;
7
- export interface SearchFilterState<TFormModel> {
8
- expandedSections: ValueByIdState<boolean>;
9
- formModel: EntityState<TFormModel>;
10
- settings: EntityState<SearchFilterSettings>;
11
- }
12
- export declare type SearchFilterAction<TFormModel> = ReducerIdGateAction<ValueByIdAction<boolean>> | ReducerIdGateAction<EntityAction<TFormModel>> | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;
13
- export declare const createSearchFilterInitialState: <TFormModel>(initialFormModel: TFormModel) => SearchFilterState<TFormModel>;
14
- export declare const createSearchFilterReducer: <TFormModel>(reducerId: string, initialState: SearchFilterState<TFormModel>) => import("redux").Reducer<import("redux").CombinedState<{
15
- expandedSections: ValueByIdState<boolean>;
16
- formModel: TFormModel;
17
- settings: SearchFilterSettings;
18
- }>, ReducerIdGateAction<ValueByIdAction<boolean>> | ReducerIdGateAction<EntityAction<TFormModel>> | ReducerIdGateAction<EntityAction<SearchFilterSettings>>>;
19
- export interface SearchFilterActions<TFormModel, TSectionKey extends string> {
20
- openFilters: () => SearchFilterAction<TFormModel>;
21
- closeFilters: () => SearchFilterAction<TFormModel>;
22
- setFormModelFields: (fields: Partial<TFormModel>) => SearchFilterAction<TFormModel>;
23
- clearFormModel: () => SearchFilterAction<TFormModel>;
24
- expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;
25
- collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;
26
- setSectionExpanded: (section: TSectionKey, expanded: boolean) => SearchFilterAction<TFormModel>;
27
- clearExpandedSections: () => SearchFilterAction<TFormModel>;
28
- }
29
- export declare const createSearchFilterActions: <TFormModel, TSectionKey extends string>(reducerId: string, initialFormModel: TFormModel) => SearchFilterActions<TFormModel, TSectionKey>;
30
- export declare const getReducerIdFor: (reducerId: string, reducerIdSuffix: keyof SearchFilterState<unknown>) => string;
1
+ import { EntityAction, EntityState, ReducerIdGateAction, ValueByIdAction, ValueByIdState } from "@stenajs-webui/redux";
2
+ import { Dispatch } from "react";
3
+ export interface SearchFilterSettings {
4
+ open: boolean;
5
+ }
6
+ export declare type SearchFilterDispatch<TFormModel> = Dispatch<SearchFilterAction<TFormModel>>;
7
+ export interface SearchFilterState<TFormModel> {
8
+ expandedSections: ValueByIdState<boolean>;
9
+ formModel: EntityState<TFormModel>;
10
+ settings: EntityState<SearchFilterSettings>;
11
+ }
12
+ export declare type SearchFilterAction<TFormModel> = ReducerIdGateAction<ValueByIdAction<boolean>> | ReducerIdGateAction<EntityAction<TFormModel>> | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;
13
+ export declare const createSearchFilterInitialState: <TFormModel>(initialFormModel: TFormModel) => SearchFilterState<TFormModel>;
14
+ export declare const createSearchFilterReducer: <TFormModel>(reducerId: string, initialState: SearchFilterState<TFormModel>) => import("redux").Reducer<import("redux").CombinedState<{
15
+ expandedSections: ValueByIdState<boolean>;
16
+ formModel: TFormModel;
17
+ settings: SearchFilterSettings;
18
+ }>, ReducerIdGateAction<ValueByIdAction<boolean>> | ReducerIdGateAction<EntityAction<TFormModel>> | ReducerIdGateAction<EntityAction<SearchFilterSettings>>>;
19
+ export interface SearchFilterActions<TFormModel, TSectionKey extends string> {
20
+ openFilters: () => SearchFilterAction<TFormModel>;
21
+ closeFilters: () => SearchFilterAction<TFormModel>;
22
+ setFormModelFields: (fields: Partial<TFormModel>) => SearchFilterAction<TFormModel>;
23
+ clearFormModel: () => SearchFilterAction<TFormModel>;
24
+ expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;
25
+ collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;
26
+ setSectionExpanded: (section: TSectionKey, expanded: boolean) => SearchFilterAction<TFormModel>;
27
+ clearExpandedSections: () => SearchFilterAction<TFormModel>;
28
+ }
29
+ export declare const createSearchFilterActions: <TFormModel, TSectionKey extends string>(reducerId: string, initialFormModel: TFormModel) => SearchFilterActions<TFormModel, TSectionKey>;
30
+ export declare const getReducerIdFor: (reducerId: string, reducerIdSuffix: keyof SearchFilterState<unknown>) => string;
@@ -1,6 +1,6 @@
1
- import { BooleanRecord, BooleanRecordOptions } from "./BooleanRecordTypes";
2
- import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
- import { SectionChipsProps } from "../../features/chips/SectionChips";
4
- export declare const createChipsPropsForBooleanRecord: <TFormModel, TSectionKey extends string, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends BooleanRecord ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, fieldName: TField, options?: BooleanRecordOptions) => Pick<SectionChipsProps<TFormModel, TSectionKey>, "chips" | "onClickRemoveOnChip">;
5
- export declare const createChipsForBooleanRecord: (booleanRecord: BooleanRecord, options?: BooleanRecordOptions) => Array<SearchFilterSectionChipModel>;
6
- export declare const createOnClickRemoveOnChipForBooleanRecord: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends BooleanRecord ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, fieldName: TField) => SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
1
+ import { BooleanRecord, BooleanRecordOptions } from "./BooleanRecordTypes";
2
+ import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
+ import { SectionChipsProps } from "../../features/chips/SectionChips";
4
+ export declare const createChipsPropsForBooleanRecord: <TFormModel, TSectionKey extends string, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends BooleanRecord ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, fieldName: TField, options?: BooleanRecordOptions) => Pick<SectionChipsProps<TFormModel, TSectionKey>, "chips" | "onClickRemoveOnChip">;
5
+ export declare const createChipsForBooleanRecord: (booleanRecord: BooleanRecord, options?: BooleanRecordOptions) => Array<SearchFilterSectionChipModel>;
6
+ export declare const createOnClickRemoveOnChipForBooleanRecord: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends BooleanRecord ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, fieldName: TField) => SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
@@ -1,6 +1,6 @@
1
- export declare type BooleanRecord = Record<string, boolean>;
2
- export interface BooleanRecordOption {
3
- value: string;
4
- label: string;
5
- }
6
- export declare type BooleanRecordOptions = Array<BooleanRecordOption>;
1
+ export declare type BooleanRecord = Record<string, boolean>;
2
+ export interface BooleanRecordOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ export declare type BooleanRecordOptions = Array<BooleanRecordOption>;
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
3
- import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
4
- import { BooleanRecord, BooleanRecordOptions } from "../BooleanRecordTypes";
5
- interface ChipMultiSelectSectionProps<TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, ValueAndOnValueChangeProps<BooleanRecord> {
6
- noneSelectedLabel?: string;
7
- options?: BooleanRecordOptions;
8
- }
9
- export declare const ChipMultiSelectSection: <TSectionKey extends string>({ options, value, noneSelectedLabel, onValueChange, ...sectionProps }: ChipMultiSelectSectionProps<TSectionKey>) => React.ReactElement;
10
- export {};
1
+ import * as React from "react";
2
+ import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
3
+ import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
4
+ import { BooleanRecord, BooleanRecordOptions } from "../BooleanRecordTypes";
5
+ interface ChipMultiSelectSectionProps<TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, ValueAndOnValueChangeProps<BooleanRecord> {
6
+ noneSelectedLabel?: string;
7
+ options?: BooleanRecordOptions;
8
+ }
9
+ export declare const ChipMultiSelectSection: <TSectionKey extends string>({ options, value, noneSelectedLabel, onValueChange, ...sectionProps }: ChipMultiSelectSectionProps<TSectionKey>) => React.ReactElement;
10
+ export {};
@@ -1,8 +1,8 @@
1
- import * as React from "react";
2
- import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
3
- import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
4
- import { BooleanRecord, BooleanRecordOptions } from "../BooleanRecordTypes";
5
- export interface SimpleCheckboxSectionProps<TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, ValueAndOnValueChangeProps<BooleanRecord> {
6
- options?: BooleanRecordOptions;
7
- }
8
- export declare const SimpleCheckboxListSection: <TSectionKey extends string>({ options, value, onValueChange, ...sectionProps }: SimpleCheckboxSectionProps<TSectionKey>) => React.ReactElement;
1
+ import * as React from "react";
2
+ import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
3
+ import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
4
+ import { BooleanRecord, BooleanRecordOptions } from "../BooleanRecordTypes";
5
+ export interface SimpleCheckboxSectionProps<TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, ValueAndOnValueChangeProps<BooleanRecord> {
6
+ options?: BooleanRecordOptions;
7
+ }
8
+ export declare const SimpleCheckboxListSection: <TSectionKey extends string>({ options, value, onValueChange, ...sectionProps }: SimpleCheckboxSectionProps<TSectionKey>) => React.ReactElement;
@@ -1,6 +1,6 @@
1
- import { DateStringRange } from "@stenajs-webui/calendar";
2
- import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
- import { SectionChipsProps } from "../../features/chips/SectionChips";
4
- export declare const createChipsPropsForDateRange: <TFormModel, TSectionKey extends string, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends string | undefined ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, startDateFieldName: TField, endDateFieldName: TField) => Pick<SectionChipsProps<TFormModel, TSectionKey>, "chips" | "onClickRemoveOnChip">;
5
- export declare const createChipsForDateRange: (startDate: string | undefined, endDate: string | undefined) => Array<SearchFilterSectionChipModel>;
6
- export declare const createOnClickRemoveOnChipForDateRange: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends DateStringRange ? Key : never; }[keyof TFormModel]>(startDateFieldName: TField, endDateFieldName: TField) => SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
1
+ import { DateStringRange } from "@stenajs-webui/calendar";
2
+ import { SearchFilterSectionChipModel, SearchFilterSectionOnClickRemoveOnChip } from "../../config/SearchFilterConfig";
3
+ import { SectionChipsProps } from "../../features/chips/SectionChips";
4
+ export declare const createChipsPropsForDateRange: <TFormModel, TSectionKey extends string, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends string | undefined ? Key : never; }[keyof TFormModel]>(formModel: TFormModel, startDateFieldName: TField, endDateFieldName: TField) => Pick<SectionChipsProps<TFormModel, TSectionKey>, "chips" | "onClickRemoveOnChip">;
5
+ export declare const createChipsForDateRange: (startDate: string | undefined, endDate: string | undefined) => Array<SearchFilterSectionChipModel>;
6
+ export declare const createOnClickRemoveOnChipForDateRange: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends DateStringRange ? Key : never; }[keyof TFormModel]>(startDateFieldName: TField, endDateFieldName: TField) => SearchFilterSectionOnClickRemoveOnChip<TFormModel>;
@@ -1,2 +1,2 @@
1
- import { DateRangeCalendarSectionProps } from "./components/DateRangeCalendarSection";
2
- export declare const createDateRangeSectionProps: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends string | undefined ? Key : never; }[keyof TFormModel], TSectionKey extends string>(formModel: TFormModel, startDateFieldName: TField, endDateFieldName: TField) => Pick<DateRangeCalendarSectionProps<TFormModel, TSectionKey>, "value" | "onValueChange">;
1
+ import { DateRangeCalendarSectionProps } from "./components/DateRangeCalendarSection";
2
+ export declare const createDateRangeSectionProps: <TFormModel, TField extends { [Key in keyof TFormModel]-?: TFormModel[Key] extends string | undefined ? Key : never; }[keyof TFormModel], TSectionKey extends string>(formModel: TFormModel, startDateFieldName: TField, endDateFieldName: TField) => Pick<DateRangeCalendarSectionProps<TFormModel, TSectionKey>, "value" | "onValueChange">;
@@ -1,13 +1,13 @@
1
- /// <reference types="react" />
2
- import { DateRangeCalendarProps, DateStringRange } from "@stenajs-webui/calendar";
3
- import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
4
- import { SearchFilterActions, SearchFilterDispatch } from "../../../redux/SearchFilterRedux";
5
- export interface DateRangeCalendarSectionProps<TFormModel, TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, Omit<DateRangeCalendarProps<{}>, "value" | "onValueChange" | "focusedInput" | "setFocusedInput"> {
6
- value: DateStringRange;
7
- onValueChange: (value: DateStringRange, options: SetDateOptions<TFormModel, TSectionKey>) => void;
8
- }
9
- export interface SetDateOptions<TFormModel, TSectionKey extends string> {
10
- dispatch: SearchFilterDispatch<TFormModel>;
11
- actions: SearchFilterActions<TFormModel, TSectionKey>;
12
- }
13
- export declare const DateRangeCalendarSection: <TFormModel, TSectionKey extends string>({ value, onValueChange, sectionId, ...dateRangeCalendarProps }: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { DateRangeCalendarProps, DateStringRange } from "@stenajs-webui/calendar";
3
+ import { SearchFilterSectionProps } from "../../../components/SearchFilterSection";
4
+ import { SearchFilterActions, SearchFilterDispatch } from "../../../redux/SearchFilterRedux";
5
+ export interface DateRangeCalendarSectionProps<TFormModel, TSectionKey extends string> extends SearchFilterSectionProps<TSectionKey>, Omit<DateRangeCalendarProps<{}>, "value" | "onValueChange" | "focusedInput" | "setFocusedInput"> {
6
+ value: DateStringRange;
7
+ onValueChange: (value: DateStringRange, options: SetDateOptions<TFormModel, TSectionKey>) => void;
8
+ }
9
+ export interface SetDateOptions<TFormModel, TSectionKey extends string> {
10
+ dispatch: SearchFilterDispatch<TFormModel>;
11
+ actions: SearchFilterActions<TFormModel, TSectionKey>;
12
+ }
13
+ export declare const DateRangeCalendarSection: <TFormModel, TSectionKey extends string>({ value, onValueChange, sectionId, ...dateRangeCalendarProps }: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => JSX.Element;
@@ -1,5 +1,5 @@
1
- import { EntityWithId } from "@stenajs-webui/redux";
2
- export interface FilterEntity extends EntityWithId {
3
- name: string;
4
- code: string;
5
- }
1
+ import { EntityWithId } from "@stenajs-webui/redux";
2
+ export interface FilterEntity extends EntityWithId {
3
+ name: string;
4
+ code: string;
5
+ }
package/dist/index.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- /**
2
- * Search filter
3
- **/
4
- export * from "./features/search-filter/components/SearchFilterDrawer";
5
- export * from "./features/search-filter/components/SearchFilterButton";
6
- export * from "./features/search-filter/components/SearchFilterSection";
7
- export * from "./features/search-filter/components/SearchFilterPanelHeader";
8
- export * from "./features/search-filter/components/context/SearchFilterContext";
9
- export * from "./features/search-filter/components/context/SearchFilterLocalStateContext";
10
- export * from "./features/search-filter/config/SearchFilterConfig";
11
- export * from "./features/search-filter/context/SearchFilterActionsContext";
12
- export * from "./features/search-filter/context/SearchFilterModelContext";
13
- export * from "./features/search-filter/context/SearchFilterStateContext";
14
- export * from "./features/search-filter/context/SearchFilterDispatchContext";
15
- export * from "./features/search-filter/hooks/UseLocalSearchFilterState";
16
- export * from "./features/search-filter/redux/SearchFilterRedux";
17
- export * from "./features/search-filter/types/FilterEntity";
18
- export * from "./features/search-filter/features/chips/SearchFilterChips";
19
- export * from "./features/search-filter/features/chips/SectionChips";
20
- export * from "./features/search-filter/features/chips/SearchFilterChip";
21
- export * from "./features/search-filter/features/chips/EmptyChip";
22
- export * from "./features/search-filter/section-factories/boolean-record/BooleanRecordTypes";
23
- export * from "./features/search-filter/section-factories/boolean-record/BooleanRecordChips";
24
- export * from "./features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection";
25
- export * from "./features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection";
26
- export * from "./features/search-filter/section-factories/date-range/DateRangeChips";
27
- export * from "./features/search-filter/section-factories/date-range/DateRangePropsFactory";
28
- export * from "./features/search-filter/section-factories/date-range/components/DateRangeCalendarSection";
1
+ /**
2
+ * Search filter
3
+ **/
4
+ export * from "./features/search-filter/components/SearchFilterDrawer";
5
+ export * from "./features/search-filter/components/SearchFilterButton";
6
+ export * from "./features/search-filter/components/SearchFilterSection";
7
+ export * from "./features/search-filter/components/SearchFilterPanelHeader";
8
+ export * from "./features/search-filter/components/context/SearchFilterContext";
9
+ export * from "./features/search-filter/components/context/SearchFilterLocalStateContext";
10
+ export * from "./features/search-filter/config/SearchFilterConfig";
11
+ export * from "./features/search-filter/context/SearchFilterActionsContext";
12
+ export * from "./features/search-filter/context/SearchFilterModelContext";
13
+ export * from "./features/search-filter/context/SearchFilterStateContext";
14
+ export * from "./features/search-filter/context/SearchFilterDispatchContext";
15
+ export * from "./features/search-filter/hooks/UseLocalSearchFilterState";
16
+ export * from "./features/search-filter/redux/SearchFilterRedux";
17
+ export * from "./features/search-filter/types/FilterEntity";
18
+ export * from "./features/search-filter/features/chips/SearchFilterChips";
19
+ export * from "./features/search-filter/features/chips/SectionChips";
20
+ export * from "./features/search-filter/features/chips/SearchFilterChip";
21
+ export * from "./features/search-filter/features/chips/EmptyChip";
22
+ export * from "./features/search-filter/section-factories/boolean-record/BooleanRecordTypes";
23
+ export * from "./features/search-filter/section-factories/boolean-record/BooleanRecordChips";
24
+ export * from "./features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection";
25
+ export * from "./features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection";
26
+ export * from "./features/search-filter/section-factories/date-range/DateRangeChips";
27
+ export * from "./features/search-filter/section-factories/date-range/DateRangePropsFactory";
28
+ export * from "./features/search-filter/section-factories/date-range/components/DateRangeCalendarSection";