@nu-art/search 0.400.8 → 0.400.14

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.
@@ -43,6 +43,7 @@ export declare class SearchContext extends Logger {
43
43
  }>[];
44
44
  getSearchResults: () => SearchResult[] | undefined;
45
45
  getSearchTime: () => number | undefined;
46
+ getAddOns: () => SearchAddOn<any>[];
46
47
  filter: {
47
48
  set: <AddOn extends SearchAddOnDef<string, any, any, any>>(key: AddOn["key"], value: AddOn["valueType"]) => void;
48
49
  get: <AddOn extends SearchAddOnDef<string, any, any, any>>(key: AddOn["key"]) => AddOn["valueType"] | undefined;
@@ -104,6 +104,7 @@ export class SearchContext extends Logger {
104
104
  getActiveSearchItems = () => [...this.activeSearchItems];
105
105
  getSearchResults = () => this.searchResults;
106
106
  getSearchTime = () => this.searchTime;
107
+ getAddOns = () => [...this.addOns];
107
108
  filter = {
108
109
  set: (key, value) => {
109
110
  this.filterDictionary[key] = value;
@@ -1,3 +1,4 @@
1
1
  export * from './entity-filter/index.js';
2
2
  export * from './search-term/index.js';
3
3
  export * from './search-terms/index.js';
4
+ export * from './label/index.js';
@@ -1,3 +1,4 @@
1
1
  export * from './entity-filter/index.js';
2
2
  export * from './search-term/index.js';
3
3
  export * from './search-terms/index.js';
4
+ export * from './label/index.js';
@@ -0,0 +1 @@
1
+ export * from './types.js';
@@ -0,0 +1 @@
1
+ export * from './types.js';
@@ -0,0 +1,3 @@
1
+ import { SearchAddOn, SearchAddOnDef } from '../../../_core/SearchAddOn.js';
2
+ export type AddOnDef_Label = SearchAddOnDef<'label', void, 'getLabel', string>;
3
+ export declare const AddOn_Label: SearchAddOn<AddOnDef_Label>;
@@ -0,0 +1,6 @@
1
+ export const AddOn_Label = {
2
+ key: 'label',
3
+ methodName: 'getLabel',
4
+ resultFilter: () => ({ pass: true }),
5
+ isActive: () => true,
6
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './search-term/SearchSorter_SearchTerm.js';
2
2
  export * from './search-terms/SearchSorter_SearchTerms.js';
3
+ export * from './label/SearchSorter_Label.js';
@@ -1,2 +1,3 @@
1
1
  export * from './search-term/SearchSorter_SearchTerm.js';
2
2
  export * from './search-terms/SearchSorter_SearchTerms.js';
3
+ export * from './label/SearchSorter_Label.js';
@@ -0,0 +1,3 @@
1
+ import { SearchSorter } from '../../../_core/SearchSorter.js';
2
+ import { AddOnDef_Label } from '../../add-ons/label/types.js';
3
+ export declare const SearchSorter_Label: SearchSorter<AddOnDef_Label>;
@@ -0,0 +1,7 @@
1
+ import { sortArray } from '@nu-art/ts-common';
2
+ export const SearchSorter_Label = {
3
+ key: 'label',
4
+ sortFunction: (results) => {
5
+ sortArray(results, result => result.filterResults[SearchSorter_Label.key].value);
6
+ }
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/search",
3
- "version": "0.400.8",
3
+ "version": "0.400.14",
4
4
  "description": "Search",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -37,9 +37,9 @@
37
37
  "linkDirectory": true
38
38
  },
39
39
  "dependencies": {
40
- "@nu-art/ts-common": "0.400.8",
41
- "@nu-art/ts-styles": "0.400.8",
42
- "@nu-art/thunderstorm-frontend": "0.400.8",
40
+ "@nu-art/ts-common": "0.400.14",
41
+ "@nu-art/ts-styles": "0.400.14",
42
+ "@nu-art/thunderstorm-frontend": "0.400.14",
43
43
  "react": "^18.0.0"
44
44
  },
45
45
  "devDependencies": {