@equinor/fusion-react-filter 2.1.0-filter.8 → 2.1.1
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.
- package/LICENSE +21 -0
- package/components/package.json +1 -1
- package/dist/FilterProvider.d.ts +3 -3
- package/dist/FilterProvider.d.ts.map +1 -1
- package/dist/FilterProvider.js +7 -7
- package/dist/actions.d.ts +3 -3
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +1 -1
- package/dist/components/filter/FilterOptionHeader.d.ts +4 -4
- package/dist/components/filter/FilterOptionHeader.d.ts.map +1 -1
- package/dist/components/filter/FilterOptionHeader.js +55 -48
- package/dist/components/filter/checkbox/CheckboxFilter.d.ts +16 -6
- package/dist/components/filter/checkbox/CheckboxFilter.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilter.js +4 -5
- package/dist/components/filter/checkbox/CheckboxFilter.style.d.ts +9 -4
- package/dist/components/filter/checkbox/CheckboxFilter.style.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilter.style.js +21 -19
- package/dist/components/filter/checkbox/CheckboxFilterOption.d.ts +8 -7
- package/dist/components/filter/checkbox/CheckboxFilterOption.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilterOption.js +4 -11
- package/dist/components/filter/checkbox/CheckboxFilterOption.style.d.ts +10 -2
- package/dist/components/filter/checkbox/CheckboxFilterOption.style.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilterOption.style.js +37 -41
- package/dist/components/filter/checkbox/CheckboxFilterOptionAll.d.ts +2 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptionAll.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptionAll.js +7 -8
- package/dist/components/filter/checkbox/CheckboxFilterOptions.d.ts +7 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptions.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptions.js +6 -8
- package/dist/components/filter/checkbox/CheckboxFilterProvider.d.ts +9 -5
- package/dist/components/filter/checkbox/CheckboxFilterProvider.d.ts.map +1 -1
- package/dist/components/filter/checkbox/CheckboxFilterProvider.js +12 -5
- package/dist/components/filter/checkbox/context.d.ts +1 -1
- package/dist/components/filter/checkbox/context.d.ts.map +1 -1
- package/dist/components/filter/checkbox/context.js +0 -1
- package/dist/components/filter/checkbox/index.d.ts +1 -1
- package/dist/components/filter/checkbox/index.d.ts.map +1 -1
- package/dist/components/filter/checkbox/index.js +0 -1
- package/dist/components/filter/checkbox/types.d.ts +2 -2
- package/dist/components/filter/checkbox/types.d.ts.map +1 -1
- package/dist/components/filter/checkbox/types.js +0 -1
- package/dist/components/filter/index.js +0 -1
- package/dist/components/filter/search/SearchFilter.d.ts +6 -5
- package/dist/components/filter/search/SearchFilter.d.ts.map +1 -1
- package/dist/components/filter/search/SearchFilter.js +9 -8
- package/dist/components/filter/search/index.js +0 -1
- package/dist/components/filter/types.d.ts +1 -1
- package/dist/components/filter/types.d.ts.map +1 -1
- package/dist/components/filter/types.js +0 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/misc/ClearFilterButton.d.ts +6 -4
- package/dist/components/misc/ClearFilterButton.d.ts.map +1 -1
- package/dist/components/misc/ClearFilterButton.js +8 -8
- package/dist/components/misc/FilterContainer.d.ts +7 -6
- package/dist/components/misc/FilterContainer.d.ts.map +1 -1
- package/dist/components/misc/FilterContainer.js +13 -14
- package/dist/components/misc/SelectionChips.d.ts +5 -4
- package/dist/components/misc/SelectionChips.d.ts.map +1 -1
- package/dist/components/misc/SelectionChips.js +29 -22
- package/dist/components/misc/index.js +0 -1
- package/dist/components/panel/FilterPanel.d.ts +7 -3
- package/dist/components/panel/FilterPanel.d.ts.map +1 -1
- package/dist/components/panel/FilterPanel.js +29 -30
- package/dist/components/panel/FilterPanelBar.d.ts +6 -2
- package/dist/components/panel/FilterPanelBar.d.ts.map +1 -1
- package/dist/components/panel/FilterPanelBar.js +29 -28
- package/dist/components/panel/FilterPanelFilters.d.ts +4 -4
- package/dist/components/panel/FilterPanelFilters.d.ts.map +1 -1
- package/dist/components/panel/FilterPanelFilters.js +4 -4
- package/dist/components/panel/FilterPanelProvider.d.ts +12 -12
- package/dist/components/panel/FilterPanelProvider.d.ts.map +1 -1
- package/dist/components/panel/FilterPanelProvider.js +4 -4
- package/dist/components/panel/FilterPanelSelector.d.ts +3 -3
- package/dist/components/panel/FilterPanelSelector.d.ts.map +1 -1
- package/dist/components/panel/FilterPanelSelector.js +4 -5
- package/dist/components/panel/index.js +0 -1
- package/dist/context.d.ts +1 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/useClearFilter.d.ts.map +1 -1
- package/dist/hooks/useClearFilter.js +4 -4
- package/dist/hooks/useFilter.d.ts +1 -1
- package/dist/hooks/useFilter.d.ts.map +1 -1
- package/dist/hooks/useFilter.js +0 -1
- package/dist/hooks/useFilterData.d.ts +4 -4
- package/dist/hooks/useFilterData.d.ts.map +1 -1
- package/dist/hooks/useFilterData.js +5 -3
- package/dist/hooks/useFilterSelection.d.ts +1 -1
- package/dist/hooks/useFilterSelection.d.ts.map +1 -1
- package/dist/hooks/useFilterSelection.js +4 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/options/FilterOptionProvider.d.ts +3 -3
- package/dist/options/FilterOptionProvider.d.ts.map +1 -1
- package/dist/options/FilterOptionProvider.js +2 -3
- package/dist/options/actions.d.ts +2 -2
- package/dist/options/actions.d.ts.map +1 -1
- package/dist/options/actions.js +0 -1
- package/dist/options/context.d.ts +1 -2
- package/dist/options/context.d.ts.map +1 -1
- package/dist/options/context.js +2 -2
- package/dist/options/create-options.d.ts +1 -1
- package/dist/options/create-options.d.ts.map +1 -1
- package/dist/options/create-options.js +3 -2
- package/dist/options/index.d.ts +1 -1
- package/dist/options/index.d.ts.map +1 -1
- package/dist/options/index.js +1 -2
- package/dist/options/reducer.d.ts +11 -11
- package/dist/options/reducer.d.ts.map +1 -1
- package/dist/options/reducer.js +1 -1
- package/dist/options/search/filter-option-match.d.ts.map +1 -1
- package/dist/options/search/filter-option-match.js +0 -1
- package/dist/options/search/filter-option-search.d.ts +1 -4
- package/dist/options/search/filter-option-search.d.ts.map +1 -1
- package/dist/options/search/filter-option-search.js +3 -2
- package/dist/options/search/index.js +0 -1
- package/dist/options/search/types.d.ts +2 -2
- package/dist/options/search/types.d.ts.map +1 -1
- package/dist/options/search/types.js +0 -1
- package/dist/options/search/useFilterOptionSearch.d.ts +1 -4
- package/dist/options/search/useFilterOptionSearch.d.ts.map +1 -1
- package/dist/options/search/useFilterOptionSearch.js +0 -1
- package/dist/options/types.d.ts +11 -11
- package/dist/options/types.d.ts.map +1 -1
- package/dist/options/types.js +0 -1
- package/dist/reducers.d.ts +34 -34
- package/dist/reducers.d.ts.map +1 -1
- package/dist/reducers.js +4 -2
- package/dist/types.d.ts +12 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -1
- package/options/package.json +2 -2
- package/package.json +30 -20
- package/dist/FilterProvider.js.map +0 -1
- package/dist/actions.js.map +0 -1
- package/dist/components/filter/FilterOptionHeader.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilter.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilter.style.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilterOption.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilterOption.style.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptionAll.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilterOptions.js.map +0 -1
- package/dist/components/filter/checkbox/CheckboxFilterProvider.js.map +0 -1
- package/dist/components/filter/checkbox/context.js.map +0 -1
- package/dist/components/filter/checkbox/index.js.map +0 -1
- package/dist/components/filter/checkbox/types.js.map +0 -1
- package/dist/components/filter/index.js.map +0 -1
- package/dist/components/filter/search/SearchFilter.js.map +0 -1
- package/dist/components/filter/search/index.js.map +0 -1
- package/dist/components/filter/types.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/misc/ClearFilterButton.js.map +0 -1
- package/dist/components/misc/FilterContainer.js.map +0 -1
- package/dist/components/misc/SelectionChips.js.map +0 -1
- package/dist/components/misc/index.js.map +0 -1
- package/dist/components/panel/FilterPanel.js.map +0 -1
- package/dist/components/panel/FilterPanelBar.js.map +0 -1
- package/dist/components/panel/FilterPanelFilters.js.map +0 -1
- package/dist/components/panel/FilterPanelProvider.js.map +0 -1
- package/dist/components/panel/FilterPanelSelector.js.map +0 -1
- package/dist/components/panel/index.js.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useClearFilter.js.map +0 -1
- package/dist/hooks/useFilter.js.map +0 -1
- package/dist/hooks/useFilterData.js.map +0 -1
- package/dist/hooks/useFilterSelection.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/options/FilterOptionProvider.js.map +0 -1
- package/dist/options/actions.js.map +0 -1
- package/dist/options/context.js.map +0 -1
- package/dist/options/create-options.js.map +0 -1
- package/dist/options/index.js.map +0 -1
- package/dist/options/reducer.js.map +0 -1
- package/dist/options/search/filter-option-match.js.map +0 -1
- package/dist/options/search/filter-option-search.js.map +0 -1
- package/dist/options/search/index.js.map +0 -1
- package/dist/options/search/types.js.map +0 -1
- package/dist/options/search/useFilterOptionSearch.js.map +0 -1
- package/dist/options/types.js.map +0 -1
- package/dist/reducers.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/options/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/options/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMjE,eAAO,MAAQ,QAAQ,OAAE,QAAQ,KAAgD,CAAC;AAElF,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,YAAY,GAAG,YAAY,EAC3C,MAAM,GAAG,MAAM,OACZ,mBAAmB,CAAC,OAAO,EAAE,MAAM,CACqB,CAAC;AAE9D,eAAe,sBAAsB,CAAC"}
|
package/dist/options/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
// @ts-
|
|
2
|
+
// @ts-expect-error
|
|
3
3
|
const context = createContext({});
|
|
4
|
+
// biome-ignore lint/suspicious/noExplicitAny: React context Provider/Consumer types require any for generic usage
|
|
4
5
|
export const { Provider, Consumer } = context;
|
|
5
6
|
export const useFilterOptionContext = () => useContext(context);
|
|
6
7
|
export default useFilterOptionContext;
|
|
7
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FilterOption, FilterOptionBuilder, FilterOptionSelector } from './types';
|
|
2
2
|
export declare const propertySelector: <TData extends Record<string, any>>(key: Extract<keyof TData, string>) => FilterOptionSelector<TData>;
|
|
3
|
-
export declare const createOptionBuilder: <TData extends Record<string, unknown>, TOption extends FilterOption, TOptions extends Record<string, TOption> = Record<string, TOption>, TValue =
|
|
3
|
+
export declare const createOptionBuilder: <TData extends Record<string, unknown>, TOption extends FilterOption, TOptions extends Record<string, TOption> = Record<string, TOption>, TValue = keyof TOptions | string>(selector: FilterOptionSelector<TData>, isSelected?: (key: keyof TOptions | string, selection: Set<TValue>, data?: TData) => boolean) => FilterOptionBuilder<TData, TOption, TValue>;
|
|
4
4
|
//# sourceMappingURL=create-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-options.d.ts","sourceRoot":"","sources":["../../src/options/create-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEvF,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"create-options.d.ts","sourceRoot":"","sources":["../../src/options/create-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEvF,eAAO,MAAM,gBAAgB,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChE,KAAK,OAAO,CAAC,MAAM,KAAK,EAAE,MAAM,CAAC,KAChC,oBAAoB,CAAC,KAAK,CAE5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAE5B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,OAAO,SAAS,YAAY,EAC5B,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,MAAM,GAAG,MAAM,QAAQ,GAAG,MAAM,EAEhC,UAAU,oBAAoB,CAAC,KAAK,CAAC,EACrC,aAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,KAAK,OAGzB,KAC1D,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAwB5C,CAAC"}
|
|
@@ -17,8 +17,9 @@ export const createOptionBuilder = (selector, isSelected = (key, selection) => s
|
|
|
17
17
|
count: dataCount(value),
|
|
18
18
|
totalCount: srcCount(value),
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
21
|
+
acc[key] = option;
|
|
22
|
+
return acc;
|
|
21
23
|
}, {});
|
|
22
24
|
return options;
|
|
23
25
|
};
|
|
24
|
-
//# sourceMappingURL=create-options.js.map
|
package/dist/options/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FilterOptionProvider, FilterComponentProviderProps, default } from './FilterOptionProvider';
|
|
1
|
+
export { FilterOptionProvider, type FilterComponentProviderProps, default, } from './FilterOptionProvider';
|
|
2
2
|
export { useFilterOptionSearch } from './search';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export { Consumer as FilterOptionConsumer, useFilterOptionContext } from './context';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/options/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/options/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,OAAO,GACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/options/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { FilterOptionProvider, default } from './FilterOptionProvider';
|
|
1
|
+
export { FilterOptionProvider, default, } from './FilterOptionProvider';
|
|
2
2
|
export { useFilterOptionSearch } from './search';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export { Consumer as FilterOptionConsumer, useFilterOptionContext } from './context';
|
|
5
5
|
export { propertySelector } from './create-options';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { FilterOption } from './types';
|
|
2
2
|
export declare const createOptionReducer: (initial: Record<string, FilterOption>) => import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
3
3
|
handlers: Record<"@FILTER_OPTIONS/SELECTION_SET", (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
4
|
-
handleAction: <TActionCreator extends (...args: any[]) => never, THandledAction extends ReturnType<TActionCreator>, TOutputAction extends never>(singleOrMultipleCreatorsAndTypes: TActionCreator | TActionCreator[], reducer: (state: Record<string, FilterOption>, action: THandledAction) => Record<string, FilterOption>) => [TOutputAction] extends [import("typesafe-actions").Action
|
|
4
|
+
handleAction: <TActionCreator extends (...args: any[]) => never, THandledAction extends ReturnType<TActionCreator>, TOutputAction extends never>(singleOrMultipleCreatorsAndTypes: TActionCreator | TActionCreator[], reducer: (state: Record<string, FilterOption>, action: THandledAction) => Record<string, FilterOption>) => [TOutputAction] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
5
5
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
6
|
-
handleAction: <TActionCreator_1 extends (...args: any[]) => TOutputAction, THandledAction_1 extends ReturnType<TActionCreator_1>, TOutputAction_1 extends Exclude<TOutputAction, THandledAction_1>>(singleOrMultipleCreatorsAndTypes: TActionCreator_1 | TActionCreator_1[], reducer: (state: Record<string, FilterOption>, action: THandledAction_1) => Record<string, FilterOption>) => [TOutputAction_1] extends [import("typesafe-actions").Action
|
|
6
|
+
handleAction: <TActionCreator_1 extends (...args: any[]) => TOutputAction, THandledAction_1 extends ReturnType<TActionCreator_1>, TOutputAction_1 extends Exclude<TOutputAction, THandledAction_1>>(singleOrMultipleCreatorsAndTypes: TActionCreator_1 | TActionCreator_1[], reducer: (state: Record<string, FilterOption>, action: THandledAction_1) => Record<string, FilterOption>) => [TOutputAction_1] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
7
7
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_1>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
8
|
-
handleAction: <TActionCreator_2 extends (...args: any[]) => TOutputAction_1, THandledAction_2 extends ReturnType<TActionCreator_2>, TOutputAction_2 extends Exclude<TOutputAction_1, THandledAction_2>>(singleOrMultipleCreatorsAndTypes: TActionCreator_2 | TActionCreator_2[], reducer: (state: Record<string, FilterOption>, action: THandledAction_2) => Record<string, FilterOption>) => [TOutputAction_2] extends [import("typesafe-actions").Action
|
|
8
|
+
handleAction: <TActionCreator_2 extends (...args: any[]) => TOutputAction_1, THandledAction_2 extends ReturnType<TActionCreator_2>, TOutputAction_2 extends Exclude<TOutputAction_1, THandledAction_2>>(singleOrMultipleCreatorsAndTypes: TActionCreator_2 | TActionCreator_2[], reducer: (state: Record<string, FilterOption>, action: THandledAction_2) => Record<string, FilterOption>) => [TOutputAction_2] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
9
9
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_2>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
10
|
-
handleAction: <TActionCreator_3 extends (...args: any[]) => TOutputAction_2, THandledAction_3 extends ReturnType<TActionCreator_3>, TOutputAction_3 extends Exclude<TOutputAction_2, THandledAction_3>>(singleOrMultipleCreatorsAndTypes: TActionCreator_3 | TActionCreator_3[], reducer: (state: Record<string, FilterOption>, action: THandledAction_3) => Record<string, FilterOption>) => [TOutputAction_3] extends [import("typesafe-actions").Action
|
|
10
|
+
handleAction: <TActionCreator_3 extends (...args: any[]) => TOutputAction_2, THandledAction_3 extends ReturnType<TActionCreator_3>, TOutputAction_3 extends Exclude<TOutputAction_2, THandledAction_3>>(singleOrMultipleCreatorsAndTypes: TActionCreator_3 | TActionCreator_3[], reducer: (state: Record<string, FilterOption>, action: THandledAction_3) => Record<string, FilterOption>) => [TOutputAction_3] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
11
11
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_3>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
12
|
-
handleAction: <TActionCreator_4 extends (...args: any[]) => TOutputAction_3, THandledAction_4 extends ReturnType<TActionCreator_4>, TOutputAction_4 extends Exclude<TOutputAction_3, THandledAction_4>>(singleOrMultipleCreatorsAndTypes: TActionCreator_4 | TActionCreator_4[], reducer: (state: Record<string, FilterOption>, action: THandledAction_4) => Record<string, FilterOption>) => [TOutputAction_4] extends [import("typesafe-actions").Action
|
|
12
|
+
handleAction: <TActionCreator_4 extends (...args: any[]) => TOutputAction_3, THandledAction_4 extends ReturnType<TActionCreator_4>, TOutputAction_4 extends Exclude<TOutputAction_3, THandledAction_4>>(singleOrMultipleCreatorsAndTypes: TActionCreator_4 | TActionCreator_4[], reducer: (state: Record<string, FilterOption>, action: THandledAction_4) => Record<string, FilterOption>) => [TOutputAction_4] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
13
13
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_4>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
14
|
-
handleAction: <TActionCreator_5 extends (...args: any[]) => TOutputAction_4, THandledAction_5 extends ReturnType<TActionCreator_5>, TOutputAction_5 extends Exclude<TOutputAction_4, THandledAction_5>>(singleOrMultipleCreatorsAndTypes: TActionCreator_5 | TActionCreator_5[], reducer: (state: Record<string, FilterOption>, action: THandledAction_5) => Record<string, FilterOption>) => [TOutputAction_5] extends [import("typesafe-actions").Action
|
|
14
|
+
handleAction: <TActionCreator_5 extends (...args: any[]) => TOutputAction_4, THandledAction_5 extends ReturnType<TActionCreator_5>, TOutputAction_5 extends Exclude<TOutputAction_4, THandledAction_5>>(singleOrMultipleCreatorsAndTypes: TActionCreator_5 | TActionCreator_5[], reducer: (state: Record<string, FilterOption>, action: THandledAction_5) => Record<string, FilterOption>) => [TOutputAction_5] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
15
15
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_5>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
16
|
-
handleAction: <TActionCreator_6 extends (...args: any[]) => TOutputAction_5, THandledAction_6 extends ReturnType<TActionCreator_6>, TOutputAction_6 extends Exclude<TOutputAction_5, THandledAction_6>>(singleOrMultipleCreatorsAndTypes: TActionCreator_6 | TActionCreator_6[], reducer: (state: Record<string, FilterOption>, action: THandledAction_6) => Record<string, FilterOption>) => [TOutputAction_6] extends [import("typesafe-actions").Action
|
|
16
|
+
handleAction: <TActionCreator_6 extends (...args: any[]) => TOutputAction_5, THandledAction_6 extends ReturnType<TActionCreator_6>, TOutputAction_6 extends Exclude<TOutputAction_5, THandledAction_6>>(singleOrMultipleCreatorsAndTypes: TActionCreator_6 | TActionCreator_6[], reducer: (state: Record<string, FilterOption>, action: THandledAction_6) => Record<string, FilterOption>) => [TOutputAction_6] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
17
17
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_6>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
18
|
-
handleAction: <TActionCreator_7 extends (...args: any[]) => TOutputAction_6, THandledAction_7 extends ReturnType<TActionCreator_7>, TOutputAction_7 extends Exclude<TOutputAction_6, THandledAction_7>>(singleOrMultipleCreatorsAndTypes: TActionCreator_7 | TActionCreator_7[], reducer: (state: Record<string, FilterOption>, action: THandledAction_7) => Record<string, FilterOption>) => [TOutputAction_7] extends [import("typesafe-actions").Action
|
|
18
|
+
handleAction: <TActionCreator_7 extends (...args: any[]) => TOutputAction_6, THandledAction_7 extends ReturnType<TActionCreator_7>, TOutputAction_7 extends Exclude<TOutputAction_6, THandledAction_7>>(singleOrMultipleCreatorsAndTypes: TActionCreator_7 | TActionCreator_7[], reducer: (state: Record<string, FilterOption>, action: THandledAction_7) => Record<string, FilterOption>) => [TOutputAction_7] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
19
19
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_7>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
20
|
-
handleAction: <TActionCreator_8 extends (...args: any[]) => TOutputAction_7, THandledAction_8 extends ReturnType<TActionCreator_8>, TOutputAction_8 extends Exclude<TOutputAction_7, THandledAction_8>>(singleOrMultipleCreatorsAndTypes: TActionCreator_8 | TActionCreator_8[], reducer: (state: Record<string, FilterOption>, action: THandledAction_8) => Record<string, FilterOption>) => [TOutputAction_8] extends [import("typesafe-actions").Action
|
|
20
|
+
handleAction: <TActionCreator_8 extends (...args: any[]) => TOutputAction_7, THandledAction_8 extends ReturnType<TActionCreator_8>, TOutputAction_8 extends Exclude<TOutputAction_7, THandledAction_8>>(singleOrMultipleCreatorsAndTypes: TActionCreator_8 | TActionCreator_8[], reducer: (state: Record<string, FilterOption>, action: THandledAction_8) => Record<string, FilterOption>) => [TOutputAction_8] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
21
21
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_8>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
22
|
-
handleAction: <TActionCreator_9 extends (...args: any[]) => TOutputAction_8, THandledAction_9 extends ReturnType<TActionCreator_9>, TOutputAction_9 extends Exclude<TOutputAction_8, THandledAction_9>>(singleOrMultipleCreatorsAndTypes: TActionCreator_9 | TActionCreator_9[], reducer: (state: Record<string, FilterOption>, action: THandledAction_9) => Record<string, FilterOption>) => [TOutputAction_9] extends [import("typesafe-actions").Action
|
|
22
|
+
handleAction: <TActionCreator_9 extends (...args: any[]) => TOutputAction_8, THandledAction_9 extends ReturnType<TActionCreator_9>, TOutputAction_9 extends Exclude<TOutputAction_8, THandledAction_9>>(singleOrMultipleCreatorsAndTypes: TActionCreator_9 | TActionCreator_9[], reducer: (state: Record<string, FilterOption>, action: THandledAction_9) => Record<string, FilterOption>) => [TOutputAction_9] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
23
23
|
handlers: Record<Exclude<import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>, TOutputAction_9>["type"], (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
24
|
-
handleAction: <TActionCreator_10 extends (...args: any[]) => TOutputAction_9, THandledAction_10 extends ReturnType<TActionCreator_10>, TOutputAction_10 extends Exclude<TOutputAction_9, THandledAction_10>>(singleOrMultipleCreatorsAndTypes: TActionCreator_10 | TActionCreator_10[], reducer: (state: Record<string, FilterOption>, action: THandledAction_10) => Record<string, FilterOption>) => [TOutputAction_10] extends [import("typesafe-actions").Action
|
|
24
|
+
handleAction: <TActionCreator_10 extends (...args: any[]) => TOutputAction_9, THandledAction_10 extends ReturnType<TActionCreator_10>, TOutputAction_10 extends Exclude<TOutputAction_9, THandledAction_10>>(singleOrMultipleCreatorsAndTypes: TActionCreator_10 | TActionCreator_10[], reducer: (state: Record<string, FilterOption>, action: THandledAction_10) => Record<string, FilterOption>) => [TOutputAction_10] extends [import("typesafe-actions").Action] ? import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & /*elided*/ any : import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
25
25
|
handlers: Record<"@FILTER_OPTIONS/SELECTION_SET", (state: Record<string, FilterOption>, action: import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>) => Record<string, FilterOption>>;
|
|
26
26
|
};
|
|
27
27
|
} : import("typesafe-actions").Reducer<Record<string, FilterOption>, import("typesafe-actions").PayloadAction<"@FILTER_OPTIONS/SELECTION_SET", Record<string, FilterOption>>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/options/reducer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/options/reducer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAItE,CAAC"}
|
package/dist/options/reducer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createReducer } from 'typesafe-actions';
|
|
2
2
|
import { actions } from './actions';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
3
4
|
export const createOptionReducer = (initial) => createReducer(initial).handleAction(actions.set, (_, { payload }) => payload);
|
|
4
|
-
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-option-match.d.ts","sourceRoot":"","sources":["../../../src/options/search/filter-option-match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"filter-option-match.d.ts","sourceRoot":"","sources":["../../../src/options/search/filter-option-match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,YAAY,EAAE,OAAO,MAAM,MAEnE,KAAK,MAAM,EAAE,OAAO,OAAO,KAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAKxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { FilterOption } from '../types';
|
|
2
2
|
import type { FilterOptionMatchFn } from './types';
|
|
3
|
-
export declare const filterOptionSearch: <TOption extends FilterOption>(matcher: FilterOptionMatchFn<TOption,
|
|
4
|
-
hide: boolean;
|
|
5
|
-
changed: boolean;
|
|
6
|
-
}>) => (options: Record<string, FilterOption>, query: string) => Record<string, TOption>;
|
|
3
|
+
export declare const filterOptionSearch: <TOption extends FilterOption>(matcher: FilterOptionMatchFn<TOption>) => (options: Record<string, FilterOption>, query: string) => Record<string, TOption>;
|
|
7
4
|
export default filterOptionSearch;
|
|
8
5
|
//# sourceMappingURL=filter-option-search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-option-search.d.ts","sourceRoot":"","sources":["../../../src/options/search/filter-option-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"filter-option-search.d.ts","sourceRoot":"","sources":["../../../src/options/search/filter-option-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,kBAAkB,GAC5B,OAAO,SAAS,YAAY,EAAE,SAAS,mBAAmB,CAAC,OAAO,CAAC,MACnE,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAc7E,CAAC;AAEJ,eAAe,kBAAkB,CAAC"}
|
|
@@ -3,10 +3,11 @@ export const filterOptionSearch = (matcher) => (options, query) => {
|
|
|
3
3
|
let hasChanged = false;
|
|
4
4
|
const res = Object.entries(options).reduce((acc, [key, value]) => {
|
|
5
5
|
const { hide, changed } = match(key, value);
|
|
6
|
-
!hasChanged && changed
|
|
6
|
+
if (!hasChanged && changed) {
|
|
7
|
+
hasChanged = true;
|
|
8
|
+
}
|
|
7
9
|
return Object.assign(acc, { [key]: { ...value, hide } });
|
|
8
10
|
}, {});
|
|
9
11
|
return (hasChanged ? res : options);
|
|
10
12
|
};
|
|
11
13
|
export default filterOptionSearch;
|
|
12
|
-
//# sourceMappingURL=filter-option-search.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FilterOption } from '../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type FilterOptionSearchFn<TOptions extends Record<string, FilterOption>> = (options: TOptions, query: string) => Record<string, TOptions>;
|
|
3
|
+
export type FilterOptionMatchFn<TOption extends FilterOption, TResult extends {
|
|
4
4
|
changed: boolean;
|
|
5
5
|
} = {
|
|
6
6
|
hide: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/options/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/options/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAChF,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE9B,MAAM,MAAM,mBAAmB,CAC7B,OAAO,SAAS,YAAY,EAC5B,OAAO,SAAS;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,IACxE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
2
|
import type { FilterOption } from '../types';
|
|
3
3
|
import type { FilterOptionMatchFn, FilterOptionSearchFn } from './types';
|
|
4
|
-
export declare const useFilterOptionSearch: <TOption extends FilterOption>(searchFn?: FilterOptionSearchFn<Record<string, FilterOption
|
|
5
|
-
hide: boolean;
|
|
6
|
-
changed: boolean;
|
|
7
|
-
}> | undefined) => {
|
|
4
|
+
export declare const useFilterOptionSearch: <TOption extends FilterOption>(searchFn?: FilterOptionSearchFn<Record<string, FilterOption>>, matchFn?: FilterOptionMatchFn<TOption>) => {
|
|
8
5
|
setQuery: (query: string) => void;
|
|
9
6
|
query$: Observable<string>;
|
|
10
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilterOptionSearch.d.ts","sourceRoot":"","sources":["../../../src/options/search/useFilterOptionSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEzE,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"useFilterOptionSearch.d.ts","sourceRoot":"","sources":["../../../src/options/search/useFilterOptionSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEzE,eAAO,MAAM,qBAAqB,GAAI,OAAO,SAAS,YAAY,EAChE,WAAW,oBAAoB,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAC7D,UAAU,mBAAmB,CAAC,OAAO,CAAC,KACrC;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CA4B5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
package/dist/options/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Observable,
|
|
2
|
-
import { Actions } from './actions';
|
|
3
|
-
export
|
|
1
|
+
import type { Observable, FlowSubject } from '@equinor/fusion-observable';
|
|
2
|
+
import type { Actions } from './actions';
|
|
3
|
+
export type FilterOption = {
|
|
4
4
|
label?: string;
|
|
5
5
|
count?: number;
|
|
6
6
|
totalCount?: number;
|
|
@@ -10,23 +10,23 @@ export declare type FilterOption = {
|
|
|
10
10
|
excluded?: boolean;
|
|
11
11
|
hide?: boolean;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
options$:
|
|
13
|
+
export type FilterOptionContext<TOption extends FilterOption, TValue = string> = {
|
|
14
|
+
options$: FlowSubject<Record<string, TOption>, Actions>;
|
|
15
15
|
selection$: Observable<Set<TValue>>;
|
|
16
16
|
setSelection: (selection?: Set<TValue>) => void;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type FilterOptionSelector<TData> = (data: TData) => {
|
|
19
19
|
key: string;
|
|
20
20
|
label?: string;
|
|
21
21
|
value: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type FilterOptionBuilder<TData, TOption extends FilterOption, TValue = string> = (source: TData[], selection: Set<TValue>, data: TData[]) => Record<string, TOption>;
|
|
24
|
+
export type FilterOptionType<T> = T extends (a: infer TData, b: infer TSelection) => infer C ? {
|
|
25
25
|
data: TData;
|
|
26
26
|
selection: TSelection;
|
|
27
27
|
options: C;
|
|
28
28
|
} : never;
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
29
|
+
export type FilterOptionDataType<T> = FilterOptionType<T>['data'];
|
|
30
|
+
export type FilterOptionsType<T> = FilterOptionType<T>['options'];
|
|
31
|
+
export type FilterOptionSelectionType<T> = FilterOptionType<T>['selection'];
|
|
32
32
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/options/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/options/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,YAAY,EAAE,MAAM,GAAG,MAAM,IAAI;IAC/E,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IACxD,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,KAAK,EAAE,OAAO,SAAS,YAAY,EAAE,MAAM,GAAG,MAAM,IAAI,CACtF,MAAM,EAAE,KAAK,EAAE,EACf,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,IAAI,EAAE,KAAK,EAAE,KACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7B,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,KAAK,MAAM,CAAC,GACxF;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,GAClD,KAAK,CAAC;AAEV,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAClE,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/options/types.js
CHANGED