@beinformed/ui 1.65.8 → 1.65.9

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.65.9](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.8...v1.65.9) (2026-01-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **hooks:** extract `useSearch` and enhance `useList` with memoized navigation methods ([7dc27df](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/7dc27df7511abebc356fa94303cb8cd4990d8e22))
11
+
5
12
  ## [1.65.8](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.5...v1.65.8) (2026-01-07)
6
13
 
7
14
 
@@ -12,11 +12,11 @@ import {
12
12
  useCaseView,
13
13
  useGroupingPanel,
14
14
  useDetailPanel,
15
- useQuicksearch,
16
15
  useUserProfile,
17
16
  } from "../useModularUIModel";
18
17
  import { useList, useListDetail } from "../useList";
19
18
  import { usePanel } from "../usePanel";
19
+ import { useQuicksearch } from "../useSearch";
20
20
  import {
21
21
  ApplicationModel,
22
22
  CaseSearchModel,
@@ -1,3 +1,4 @@
1
+ export * from "./useAllFormsOnModel";
1
2
  export * from "./useAuthentication";
2
3
  export * from "./useContent";
3
4
  export * from "./useForm";
@@ -16,5 +17,5 @@ export * from "./usePanel";
16
17
  export * from "./usePreference";
17
18
  export * from "./useProgressIndicator";
18
19
  export * from "./useRouter";
19
- export * from "./useAllFormsOnModel";
20
+ export * from "./useSearch";
20
21
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  // @flow
2
+ export * from "./useAllFormsOnModel";
2
3
  export * from "./useAuthentication";
3
4
  export * from "./useContent";
4
5
  export * from "./useForm";
@@ -17,4 +18,4 @@ export * from "./usePanel";
17
18
  export * from "./usePreference";
18
19
  export * from "./useProgressIndicator";
19
20
  export * from "./useRouter";
20
- export * from "./useAllFormsOnModel";
21
+ export * from "./useSearch";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/hooks/index.js"],"sourcesContent":["// @flow\nexport * from \"./useAuthentication\";\nexport * from \"./useContent\";\nexport * from \"./useForm\";\nexport * from \"./useI18n\";\nexport * from \"./useList\";\nexport * from \"./useLookup\";\nexport * from \"./useModal\";\nexport * from \"./useModelCatalog\";\nexport * from \"./useModels\";\nexport * from \"./useModularUI\";\nexport * from \"./useModularUIBasic\";\nexport * from \"./useModularUIModel\";\nexport * from \"./useModularUIRequest\";\nexport * from \"./useNotification\";\nexport * from \"./usePanel\";\nexport * from \"./usePreference\";\nexport * from \"./useProgressIndicator\";\nexport * from \"./useRouter\";\nexport * from \"./useAllFormsOnModel\";\n"],"mappings":"AACA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,mBAAmB;AACjC,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,aAAa;AAC3B,cAAc,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/hooks/index.js"],"sourcesContent":["// @flow\nexport * from \"./useAllFormsOnModel\";\nexport * from \"./useAuthentication\";\nexport * from \"./useContent\";\nexport * from \"./useForm\";\nexport * from \"./useI18n\";\nexport * from \"./useList\";\nexport * from \"./useLookup\";\nexport * from \"./useModal\";\nexport * from \"./useModelCatalog\";\nexport * from \"./useModels\";\nexport * from \"./useModularUI\";\nexport * from \"./useModularUIBasic\";\nexport * from \"./useModularUIModel\";\nexport * from \"./useModularUIRequest\";\nexport * from \"./useNotification\";\nexport * from \"./usePanel\";\nexport * from \"./usePreference\";\nexport * from \"./useProgressIndicator\";\nexport * from \"./useRouter\";\nexport * from \"./useSearch\";\n"],"mappings":"AACA,cAAc,sBAAsB;AACpC,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,mBAAmB;AACjC,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,aAAa;AAC3B,cAAc,aAAa","ignoreList":[]}
@@ -11,6 +11,7 @@ import Href from "../models/href/Href";
11
11
  import FilterCollection from "../models/filters/FilterCollection";
12
12
  import AssignmentFilterModel from "../models/filters/AssignmentFilterModel";
13
13
  import FilterModel from "../models/filters/FilterModel";
14
+ import { useCallback, useMemo } from "react";
14
15
  /**
15
16
  */
16
17
  export const useList = (href, options) => useModularUIBasic("list", href, {
@@ -38,39 +39,49 @@ export const useListDetail = (href, options) => useModularUIBasic("listdetail",
38
39
 
39
40
  /**
40
41
  */
41
- export const useListNavigation = () => {
42
+ export const useListNavigation = ({
43
+ syncLocation,
44
+ historyAction
45
+ } = {
46
+ syncLocation: true,
47
+ historyAction: "push"
48
+ }) => {
42
49
  const history = useHistory();
43
50
  const dispatch = useDispatch();
44
- const update = (list, resetPage = false) => {
51
+ const update = useCallback((list, resetPage = false) => {
45
52
  const listHref = list.selfhref;
46
53
  if (resetPage) {
47
54
  listHref.page = null;
48
55
  }
49
56
  if (list.requestMethod === HTTP_METHODS.POST) {
50
- history.push({
51
- search: listHref.querystring,
52
- state: list.formdata
53
- });
57
+ if (syncLocation) {
58
+ history[historyAction]({
59
+ search: listHref.querystring,
60
+ state: list.formdata
61
+ });
62
+ }
54
63
  dispatch(loadModularUI(list.connectKey, listHref, {
55
64
  method: HTTP_METHODS.POST,
56
65
  data: list.formdata,
57
66
  targetModel: [ListModel, CaseSearchModel]
58
67
  }));
59
68
  } else {
60
- history.push({
61
- search: listHref.querystring
62
- });
69
+ if (syncLocation) {
70
+ history[historyAction]({
71
+ search: listHref.querystring
72
+ });
73
+ }
63
74
  dispatch(loadModularUI(list.connectKey, listHref, {
64
75
  method: HTTP_METHODS.GET,
65
76
  targetModel: [ListModel, CaseSearchModel]
66
77
  }));
67
78
  }
68
- };
69
- const updateFilters = (list, filters) => {
79
+ }, [dispatch, history, historyAction, syncLocation]);
80
+ const updateFilters = useCallback((list, filters) => {
70
81
  list.filterCollection = filters;
71
82
  update(list, true);
72
- };
73
- const updateFilter = (list, filter, value, attribute) => {
83
+ }, [update]);
84
+ const updateFilter = useCallback((list, filter, value, attribute) => {
74
85
  if (attribute) {
75
86
  filter.update(attribute, value);
76
87
  } else if (filter instanceof AssignmentFilterModel) {
@@ -79,28 +90,28 @@ export const useListNavigation = () => {
79
90
  filter.update(filter.attribute, value);
80
91
  }
81
92
  update(list, true);
82
- };
83
- const resetFilters = list => {
93
+ }, [update]);
94
+ const resetFilters = useCallback(list => {
84
95
  list.filterCollection.reset();
85
96
  update(list, true);
86
- };
87
- const removeFilter = (list, filter) => {
97
+ }, [update]);
98
+ const removeFilter = useCallback((list, filter) => {
88
99
  list.filterCollection.getFilterByName(filter.name)?.reset();
89
100
  update(list, true);
90
- };
91
- const updateSort = (list, sortOption) => {
101
+ }, [update]);
102
+ const updateSort = useCallback((list, sortOption) => {
92
103
  list.sorting.value = sortOption;
93
104
  update(list, true);
94
- };
95
- const updatePage = (list, page) => {
105
+ }, [update]);
106
+ const updatePage = useCallback((list, page) => {
96
107
  list.paging.page = page;
97
108
  update(list);
98
- };
99
- const updatePageSize = (list, pagesize) => {
109
+ }, [update]);
110
+ const updatePageSize = useCallback((list, pagesize) => {
100
111
  list.paging.pagesize.value = pagesize;
101
112
  update(list);
102
- };
103
- return {
113
+ }, [update]);
114
+ return useMemo(() => ({
104
115
  update,
105
116
  updateFilters,
106
117
  updateFilter,
@@ -109,6 +120,6 @@ export const useListNavigation = () => {
109
120
  updatePageSize,
110
121
  resetFilters,
111
122
  removeFilter
112
- };
123
+ }), [removeFilter, resetFilters, update, updateFilter, updateFilters, updatePage, updatePageSize, updateSort]);
113
124
  };
114
125
  //# sourceMappingURL=useList.js.map
@@ -18,6 +18,7 @@ import FilterModel from "../models/filters/FilterModel";
18
18
 
19
19
  import type { HookOptions } from "./useModularUIBasic";
20
20
  import type { AttributeType, IFilter } from "../models/types";
21
+ import { useCallback, useMemo } from "react";
21
22
 
22
23
  type ListNavigationHook = {
23
24
  update: (list: ListModel, resetPage?: boolean) => void,
@@ -35,6 +36,11 @@ type ListNavigationHook = {
35
36
  removeFilter: (list: ListModel, filter: IFilter) => void,
36
37
  };
37
38
 
39
+ type ListNavigationOptions = {
40
+ syncLocation: boolean,
41
+ historyAction: "push" | "replace",
42
+ };
43
+
38
44
  /**
39
45
  */
40
46
  export const useList = (
@@ -74,90 +80,141 @@ export const useListDetail = (
74
80
 
75
81
  /**
76
82
  */
77
- export const useListNavigation = (): ListNavigationHook => {
83
+ export const useListNavigation = (
84
+ { syncLocation, historyAction }: ListNavigationOptions = {
85
+ syncLocation: true,
86
+ historyAction: "push",
87
+ },
88
+ ): ListNavigationHook => {
78
89
  const history = useHistory();
79
90
  const dispatch = useDispatch();
80
91
 
81
- const update = (list: ListModel, resetPage: boolean = false) => {
82
- const listHref = list.selfhref;
83
- if (resetPage) {
84
- listHref.page = null;
85
- }
86
-
87
- if (list.requestMethod === HTTP_METHODS.POST) {
88
- history.push({ search: listHref.querystring, state: list.formdata });
89
- dispatch(
90
- loadModularUI(list.connectKey, listHref, {
91
- method: HTTP_METHODS.POST,
92
- data: list.formdata,
93
- targetModel: [ListModel, CaseSearchModel],
94
- }),
95
- );
96
- } else {
97
- history.push({ search: listHref.querystring });
98
- dispatch(
99
- loadModularUI(list.connectKey, listHref, {
100
- method: HTTP_METHODS.GET,
101
- targetModel: [ListModel, CaseSearchModel],
102
- }),
103
- );
104
- }
105
- };
106
-
107
- const updateFilters = (list: ListModel, filters: FilterCollection) => {
108
- list.filterCollection = filters;
109
- update(list, true);
110
- };
111
-
112
- const updateFilter = (
113
- list: ListModel,
114
- filter: IFilter,
115
- value: string,
116
- attribute?: AttributeType,
117
- ) => {
118
- if (attribute) {
119
- filter.update(attribute, value);
120
- } else if (filter instanceof AssignmentFilterModel) {
121
- throw new Error("Need the attribute to update for AssigmentFilterModel");
122
- } else if (filter instanceof FilterModel) {
123
- filter.update(filter.attribute, value);
124
- }
125
- update(list, true);
126
- };
127
-
128
- const resetFilters = (list: ListModel) => {
129
- list.filterCollection.reset();
130
- update(list, true);
131
- };
132
-
133
- const removeFilter = (list: ListModel, filter: IFilter) => {
134
- list.filterCollection.getFilterByName(filter.name)?.reset();
135
- update(list, true);
136
- };
137
-
138
- const updateSort = (list: ListModel, sortOption: string) => {
139
- list.sorting.value = sortOption;
140
- update(list, true);
141
- };
142
-
143
- const updatePage = (list: ListModel, page: number) => {
144
- list.paging.page = page;
145
- update(list);
146
- };
147
-
148
- const updatePageSize = (list: ListModel, pagesize: number) => {
149
- list.paging.pagesize.value = pagesize;
150
- update(list);
151
- };
152
-
153
- return {
154
- update,
155
- updateFilters,
156
- updateFilter,
157
- updateSort,
158
- updatePage,
159
- updatePageSize,
160
- resetFilters,
161
- removeFilter,
162
- };
92
+ const update = useCallback(
93
+ (list: ListModel, resetPage: boolean = false) => {
94
+ const listHref = list.selfhref;
95
+ if (resetPage) {
96
+ listHref.page = null;
97
+ }
98
+
99
+ if (list.requestMethod === HTTP_METHODS.POST) {
100
+ if (syncLocation) {
101
+ history[historyAction]({
102
+ search: listHref.querystring,
103
+ state: list.formdata,
104
+ });
105
+ }
106
+
107
+ dispatch(
108
+ loadModularUI(list.connectKey, listHref, {
109
+ method: HTTP_METHODS.POST,
110
+ data: list.formdata,
111
+ targetModel: [ListModel, CaseSearchModel],
112
+ }),
113
+ );
114
+ } else {
115
+ if (syncLocation) {
116
+ history[historyAction]({ search: listHref.querystring });
117
+ }
118
+ dispatch(
119
+ loadModularUI(list.connectKey, listHref, {
120
+ method: HTTP_METHODS.GET,
121
+ targetModel: [ListModel, CaseSearchModel],
122
+ }),
123
+ );
124
+ }
125
+ },
126
+ [dispatch, history, historyAction, syncLocation],
127
+ );
128
+
129
+ const updateFilters = useCallback(
130
+ (list: ListModel, filters: FilterCollection) => {
131
+ list.filterCollection = filters;
132
+ update(list, true);
133
+ },
134
+ [update],
135
+ );
136
+
137
+ const updateFilter = useCallback(
138
+ (
139
+ list: ListModel,
140
+ filter: IFilter,
141
+ value: string,
142
+ attribute?: AttributeType,
143
+ ) => {
144
+ if (attribute) {
145
+ filter.update(attribute, value);
146
+ } else if (filter instanceof AssignmentFilterModel) {
147
+ throw new Error(
148
+ "Need the attribute to update for AssigmentFilterModel",
149
+ );
150
+ } else if (filter instanceof FilterModel) {
151
+ filter.update(filter.attribute, value);
152
+ }
153
+ update(list, true);
154
+ },
155
+ [update],
156
+ );
157
+
158
+ const resetFilters = useCallback(
159
+ (list: ListModel) => {
160
+ list.filterCollection.reset();
161
+ update(list, true);
162
+ },
163
+ [update],
164
+ );
165
+
166
+ const removeFilter = useCallback(
167
+ (list: ListModel, filter: IFilter) => {
168
+ list.filterCollection.getFilterByName(filter.name)?.reset();
169
+ update(list, true);
170
+ },
171
+ [update],
172
+ );
173
+
174
+ const updateSort = useCallback(
175
+ (list: ListModel, sortOption: string) => {
176
+ list.sorting.value = sortOption;
177
+ update(list, true);
178
+ },
179
+ [update],
180
+ );
181
+
182
+ const updatePage = useCallback(
183
+ (list: ListModel, page: number) => {
184
+ list.paging.page = page;
185
+ update(list);
186
+ },
187
+ [update],
188
+ );
189
+
190
+ const updatePageSize = useCallback(
191
+ (list: ListModel, pagesize: number) => {
192
+ list.paging.pagesize.value = pagesize;
193
+ update(list);
194
+ },
195
+ [update],
196
+ );
197
+
198
+ return useMemo(
199
+ () => ({
200
+ update,
201
+ updateFilters,
202
+ updateFilter,
203
+ updateSort,
204
+ updatePage,
205
+ updatePageSize,
206
+ resetFilters,
207
+ removeFilter,
208
+ }),
209
+ [
210
+ removeFilter,
211
+ resetFilters,
212
+ update,
213
+ updateFilter,
214
+ updateFilters,
215
+ updatePage,
216
+ updatePageSize,
217
+ updateSort,
218
+ ],
219
+ );
163
220
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useList.js","names":["useHistory","useDispatch","useModularUIBasic","HTTP_METHODS","loadModularUI","DetailModel","ListModel","CaseSearchModel","ListDetailModel","Href","FilterCollection","AssignmentFilterModel","FilterModel","useList","href","options","expectedModels","targetModel","useListOrDetail","useListDetail","forceTargetModel","useListNavigation","history","dispatch","update","list","resetPage","listHref","selfhref","page","requestMethod","POST","push","search","querystring","state","formdata","connectKey","method","data","GET","updateFilters","filters","filterCollection","updateFilter","filter","value","attribute","Error","resetFilters","reset","removeFilter","getFilterByName","name","updateSort","sortOption","sorting","updatePage","paging","updatePageSize","pagesize"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useHistory } from \"react-router\";\nimport { useDispatch } from \"react-redux\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport { loadModularUI } from \"../redux\";\n\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\nimport FilterCollection from \"../models/filters/FilterCollection\";\nimport AssignmentFilterModel from \"../models/filters/AssignmentFilterModel\";\nimport FilterModel from \"../models/filters/FilterModel\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport type { AttributeType, IFilter } from \"../models/types\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => void,\n updateFilters: (list: ListModel, filters: FilterCollection) => void,\n updateFilter: (\n list: ListModel,\n filter: IFilter,\n value: string,\n attribute?: AttributeType,\n ) => void,\n updateSort: (list: ListModel, sortOption: string) => void,\n updatePage: (list: ListModel, page: number) => void,\n updatePageSize: (list: ListModel, pagesize: number) => void,\n resetFilters: (list: ListModel) => void,\n removeFilter: (list: ListModel, filter: IFilter) => void,\n};\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\"],\n targetModel: [ListModel, CaseSearchModel],\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\", \"Detail\"],\n targetModel: [ListModel, CaseSearchModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useListNavigation = (): ListNavigationHook => {\n const history = useHistory();\n const dispatch = useDispatch();\n\n const update = (list: ListModel, resetPage: boolean = false) => {\n const listHref = list.selfhref;\n if (resetPage) {\n listHref.page = null;\n }\n\n if (list.requestMethod === HTTP_METHODS.POST) {\n history.push({ search: listHref.querystring, state: list.formdata });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.POST,\n data: list.formdata,\n targetModel: [ListModel, CaseSearchModel],\n }),\n );\n } else {\n history.push({ search: listHref.querystring });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.GET,\n targetModel: [ListModel, CaseSearchModel],\n }),\n );\n }\n };\n\n const updateFilters = (list: ListModel, filters: FilterCollection) => {\n list.filterCollection = filters;\n update(list, true);\n };\n\n const updateFilter = (\n list: ListModel,\n filter: IFilter,\n value: string,\n attribute?: AttributeType,\n ) => {\n if (attribute) {\n filter.update(attribute, value);\n } else if (filter instanceof AssignmentFilterModel) {\n throw new Error(\"Need the attribute to update for AssigmentFilterModel\");\n } else if (filter instanceof FilterModel) {\n filter.update(filter.attribute, value);\n }\n update(list, true);\n };\n\n const resetFilters = (list: ListModel) => {\n list.filterCollection.reset();\n update(list, true);\n };\n\n const removeFilter = (list: ListModel, filter: IFilter) => {\n list.filterCollection.getFilterByName(filter.name)?.reset();\n update(list, true);\n };\n\n const updateSort = (list: ListModel, sortOption: string) => {\n list.sorting.value = sortOption;\n update(list, true);\n };\n\n const updatePage = (list: ListModel, page: number) => {\n list.paging.page = page;\n update(list);\n };\n\n const updatePageSize = (list: ListModel, pagesize: number) => {\n list.paging.pagesize.value = pagesize;\n update(list);\n };\n\n return {\n update,\n updateFilters,\n updateFilter,\n updateSort,\n updatePage,\n updatePageSize,\n resetFilters,\n removeFilter,\n };\n};\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,QAAQ,aAAa;AAEzC,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,YAAY,QAAQ,wBAAwB;AAErD,SAASC,aAAa,QAAQ,UAAU;AAExC,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,IAAI,MAAM,qBAAqB;AACtC,OAAOC,gBAAgB,MAAM,oCAAoC;AACjE,OAAOC,qBAAqB,MAAM,yCAAyC;AAC3E,OAAOC,WAAW,MAAM,+BAA+B;AAqBvD;AACA;AACA,OAAO,MAAMC,OAAO,GAAG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CAACkB,gBAAgB,CAACO,KAAK,CAAC,CAAC;IAC7B1B,MAAM,CAACC,IAAI,EAAE,IAAI,CAAC;EACpB,CAAC;EAED,MAAM0B,YAAY,GAAGA,CAAC1B,IAAe,EAAEoB,MAAe,KAAK;IACzDpB,IAAI,CAACkB,gBAAgB,CAACS,eAAe,CAACP,MAAM,CAACQ,IAAI,CAAC,EAAEH,KAAK,CAAC,CAAC;IAC3D1B,MAAM,CAACC,IAAI,EAAE,IAAI,CAAC;EACpB,CAAC;EAED,MAAM6B,UAAU,GAAGA,CAAC7B,IAAe,EAAE8B,UAAkB,KAAK;IAC1D9B,IAAI,CAAC+B,OAAO,CAACV,KAAK,GAAGS,UAAU;IAC/B/B,MAAM,CAACC,IAAI,EAAE,IAAI,CAAC;EACpB,CAAC;EAED,MAAMgC,UAAU,GAAGA,CAAChC,IAAe,EAAEI,IAAY,KAAK;IACpDJ,IAAI,CAACiC,MAAM,CAAC7B,IAAI,GAAGA,IAAI;IACvBL,MAAM,CAACC,IAAI,CAAC;EACd,CAAC;EAED,MAAMkC,cAAc,GAAGA,CAAClC,IAAe,EAAEmC,QAAgB,KAAK;IAC5DnC,IAAI,CAACiC,MAAM,CAACE,QAAQ,CAACd,KAAK,GAAGc,QAAQ;IACrCpC,MAAM,CAACC,IAAI,CAAC;EACd,CAAC;EAED,OAAO;IACLD,MAAM;IACNiB,aAAa;IACbG,YAAY;IACZU,UAAU;IACVG,UAAU;IACVE,cAAc;IACdV,YAAY;IACZE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useList.js","names":["useHistory","useDispatch","useModularUIBasic","HTTP_METHODS","loadModularUI","DetailModel","ListModel","CaseSearchModel","ListDetailModel","Href","FilterCollection","AssignmentFilterModel","FilterModel","useCallback","useMemo","useList","href","options","expectedModels","targetModel","useListOrDetail","useListDetail","forceTargetModel","useListNavigation","syncLocation","historyAction","history","dispatch","update","list","resetPage","listHref","selfhref","page","requestMethod","POST","search","querystring","state","formdata","connectKey","method","data","GET","updateFilters","filters","filterCollection","updateFilter","filter","value","attribute","Error","resetFilters","reset","removeFilter","getFilterByName","name","updateSort","sortOption","sorting","updatePage","paging","updatePageSize","pagesize"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useHistory } from \"react-router\";\nimport { useDispatch } from \"react-redux\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport { loadModularUI } from \"../redux\";\n\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\nimport FilterCollection from \"../models/filters/FilterCollection\";\nimport AssignmentFilterModel from \"../models/filters/AssignmentFilterModel\";\nimport FilterModel from \"../models/filters/FilterModel\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport type { AttributeType, IFilter } from \"../models/types\";\nimport { useCallback, useMemo } from \"react\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => void,\n updateFilters: (list: ListModel, filters: FilterCollection) => void,\n updateFilter: (\n list: ListModel,\n filter: IFilter,\n value: string,\n attribute?: AttributeType,\n ) => void,\n updateSort: (list: ListModel, sortOption: string) => void,\n updatePage: (list: ListModel, page: number) => void,\n updatePageSize: (list: ListModel, pagesize: number) => void,\n resetFilters: (list: ListModel) => void,\n removeFilter: (list: ListModel, filter: IFilter) => void,\n};\n\ntype ListNavigationOptions = {\n syncLocation: boolean,\n historyAction: \"push\" | \"replace\",\n};\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\"],\n targetModel: [ListModel, CaseSearchModel],\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\", \"Detail\"],\n targetModel: [ListModel, CaseSearchModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useListNavigation = (\n { syncLocation, historyAction }: ListNavigationOptions = {\n syncLocation: true,\n historyAction: \"push\",\n },\n): ListNavigationHook => {\n const history = useHistory();\n const dispatch = useDispatch();\n\n const update = useCallback(\n (list: ListModel, resetPage: boolean = false) => {\n const listHref = list.selfhref;\n if (resetPage) {\n listHref.page = null;\n }\n\n if (list.requestMethod === HTTP_METHODS.POST) {\n if (syncLocation) {\n history[historyAction]({\n search: listHref.querystring,\n state: list.formdata,\n });\n }\n\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.POST,\n data: list.formdata,\n targetModel: [ListModel, CaseSearchModel],\n }),\n );\n } else {\n if (syncLocation) {\n history[historyAction]({ search: listHref.querystring });\n }\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.GET,\n targetModel: [ListModel, CaseSearchModel],\n }),\n );\n }\n },\n [dispatch, history, historyAction, syncLocation],\n );\n\n const updateFilters = useCallback(\n (list: ListModel, filters: FilterCollection) => {\n list.filterCollection = filters;\n update(list, true);\n },\n [update],\n );\n\n const updateFilter = useCallback(\n (\n list: ListModel,\n filter: IFilter,\n value: string,\n attribute?: AttributeType,\n ) => {\n if (attribute) {\n filter.update(attribute, value);\n } else if (filter instanceof AssignmentFilterModel) {\n throw new Error(\n \"Need the attribute to update for AssigmentFilterModel\",\n );\n } else if (filter instanceof FilterModel) {\n filter.update(filter.attribute, value);\n }\n update(list, true);\n },\n [update],\n );\n\n const resetFilters = useCallback(\n (list: ListModel) => {\n list.filterCollection.reset();\n update(list, true);\n },\n [update],\n );\n\n const removeFilter = useCallback(\n (list: ListModel, filter: IFilter) => {\n list.filterCollection.getFilterByName(filter.name)?.reset();\n update(list, true);\n },\n [update],\n );\n\n const updateSort = useCallback(\n (list: ListModel, sortOption: string) => {\n list.sorting.value = sortOption;\n update(list, true);\n },\n [update],\n );\n\n const updatePage = useCallback(\n (list: ListModel, page: number) => {\n list.paging.page = page;\n update(list);\n },\n [update],\n );\n\n const updatePageSize = useCallback(\n (list: ListModel, pagesize: number) => {\n list.paging.pagesize.value = pagesize;\n update(list);\n },\n [update],\n );\n\n return useMemo(\n () => ({\n update,\n updateFilters,\n updateFilter,\n updateSort,\n updatePage,\n updatePageSize,\n resetFilters,\n removeFilter,\n }),\n [\n removeFilter,\n resetFilters,\n update,\n updateFilter,\n updateFilters,\n updatePage,\n updatePageSize,\n updateSort,\n ],\n );\n};\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,QAAQ,aAAa;AAEzC,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,YAAY,QAAQ,wBAAwB;AAErD,SAASC,aAAa,QAAQ,UAAU;AAExC,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,IAAI,MAAM,qBAAqB;AACtC,OAAOC,gBAAgB,MAAM,oCAAoC;AACjE,OAAOC,qBAAqB,MAAM,yCAAyC;AAC3E,OAAOC,WAAW,MAAM,+BAA+B;AAIvD,SAASC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAuB5C;AACA;AACA,OAAO,MAAMC,OAAO,GAAGA,CACrBC,IAAmB,EACnBC,OAAqB,KAErBf,iBAAiB,CAAC,MAAM,EAAEc,IAAI,EAAE;EAC9BE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;EACtCC,WAAW,EAAE,CAAC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,MAAM;IACNgB,aAAa;IACbG,YAAY;IACZU,UAAU;IACVG,UAAU;IACVE,cAAc;IACdV,YAAY;IACZE;EACF,CAAC,CAAC,EACF,CACEA,YAAY,EACZF,YAAY,EACZxB,MAAM,EACNmB,YAAY,EACZH,aAAa,EACbgB,UAAU,EACVE,cAAc,EACdL,UAAU,CAEd,CAAC;AACH,CAAC","ignoreList":[]}
@@ -3,7 +3,6 @@ import CaseViewModel from "../models/caseview/CaseViewModel";
3
3
  import TabModel from "../models/tab/TabModel";
4
4
  import GroupingPanelModel from "../models/panels/GroupingPanelModel";
5
5
  import DetailModel from "../models/detail/DetailModel";
6
- import CaseSearchModel from "../models/search/CaseSearchModel";
7
6
  import UserProfileModel from "../models/user/UserProfileModel";
8
7
  import { useModularUIBasic } from "./useModularUIBasic";
9
8
  /**
@@ -49,22 +48,6 @@ export const useDetailPanel = (href, options) => useModularUIBasic("detailpanel"
49
48
  ...options
50
49
  });
51
50
 
52
- /**
53
- */
54
- export const useQuicksearch = (href, options) => useModularUIBasic("quicksearch", href, {
55
- expectedModels: ["CaseSearch"],
56
- targetModel: CaseSearchModel,
57
- ...options
58
- });
59
-
60
- /**
61
- */
62
- export const useSearch = (href, options) => useModularUIBasic("search", href, {
63
- expectedModels: ["CaseSearch"],
64
- targetModel: CaseSearchModel,
65
- ...options
66
- });
67
-
68
51
  /**
69
52
  */
70
53
  export const useUserProfile = (href, options) => useModularUIBasic("userprofile", href, {
@@ -4,7 +4,6 @@ import CaseViewModel from "../models/caseview/CaseViewModel";
4
4
  import TabModel from "../models/tab/TabModel";
5
5
  import GroupingPanelModel from "../models/panels/GroupingPanelModel";
6
6
  import DetailModel from "../models/detail/DetailModel";
7
- import CaseSearchModel from "../models/search/CaseSearchModel";
8
7
  import UserProfileModel from "../models/user/UserProfileModel";
9
8
 
10
9
  import { useModularUIBasic } from "./useModularUIBasic";
@@ -74,30 +73,6 @@ export const useDetailPanel = (
74
73
  ...options,
75
74
  });
76
75
 
77
- /**
78
- */
79
- export const useQuicksearch = (
80
- href: string | Href,
81
- options?: HookOptions,
82
- ): CaseSearchModel | null =>
83
- useModularUIBasic("quicksearch", href, {
84
- expectedModels: ["CaseSearch"],
85
- targetModel: CaseSearchModel,
86
- ...options,
87
- });
88
-
89
- /**
90
- */
91
- export const useSearch = (
92
- href: string | Href,
93
- options?: HookOptions,
94
- ): CaseSearchModel | null =>
95
- useModularUIBasic("search", href, {
96
- expectedModels: ["CaseSearch"],
97
- targetModel: CaseSearchModel,
98
- ...options,
99
- });
100
-
101
76
  /**
102
77
  */
103
78
  export const useUserProfile = (
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUIModel.js","names":["ApplicationModel","CaseViewModel","TabModel","GroupingPanelModel","DetailModel","CaseSearchModel","UserProfileModel","useModularUIBasic","useApplication","options","expectedModels","targetModel","useTab","href","useCaseView","useGroupingPanel","useDetailPanel","useQuicksearch","useSearch","useUserProfile"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\nimport type Href from \"../models/href/Href\";\nimport type { HookOptions } from \"./useModularUIBasic\";\n\n/**\n * Load application\n */\nexport const useApplication = (\n options?: HookOptions,\n): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n ...options,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (\n href: string | Href,\n options?: HookOptions,\n): TabModel | null =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n ...options,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (\n href: string | Href,\n options?: HookOptions,\n): CaseViewModel | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n ...options,\n });\n\n/**\n */\nexport const useGroupingPanel = (\n href: string | Href,\n options?: HookOptions,\n): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n ...options,\n });\n\n/**\n */\nexport const useDetailPanel = (\n href: string | Href,\n options?: HookOptions,\n): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n ...options,\n });\n\n/**\n */\nexport const useQuicksearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\n/**\n */\nexport const useSearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\n/**\n */\nexport const useUserProfile = (\n href: string | Href,\n options?: HookOptions,\n): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n ...options,\n });\n"],"mappings":"AACA,OAAOA,gBAAgB,MAAM,wCAAwC;AACrE,OAAOC,aAAa,MAAM,kCAAkC;AAC5D,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,kBAAkB,MAAM,qCAAqC;AACpE,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,gBAAgB,MAAM,iCAAiC;AAE9D,SAASC,iBAAiB,QAAQ,qBAAqB;AAKvD;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GACzBC,OAAq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AGI;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMS,SAAS,GAAGA,CACvBL,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,QAAQ,EAAEM,IAAI,EAAE;EAChCH,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN,eAAe;EAC5B,GAAGI;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMU,cAAc,GAAGA,CAC5BN,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,aAAa,EAAEM,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEL,gBAAgB;EAC7B,GAAGG;AACL,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useModularUIModel.js","names":["ApplicationModel","CaseViewModel","TabModel","GroupingPanelModel","DetailModel","UserProfileModel","useModularUIBasic","useApplication","options","expectedModels","targetModel","useTab","href","useCaseView","useGroupingPanel","useDetailPanel","useUserProfile"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\nimport type Href from \"../models/href/Href\";\nimport type { HookOptions } from \"./useModularUIBasic\";\n\n/**\n * Load application\n */\nexport const useApplication = (\n options?: HookOptions,\n): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n ...options,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (\n href: string | Href,\n options?: HookOptions,\n): TabModel | null =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n ...options,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (\n href: string | Href,\n options?: HookOptions,\n): CaseViewModel | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n ...options,\n });\n\n/**\n */\nexport const useGroupingPanel = (\n href: string | Href,\n options?: HookOptions,\n): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n ...options,\n });\n\n/**\n */\nexport const useDetailPanel = (\n href: string | Href,\n options?: HookOptions,\n): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n ...options,\n });\n\n/**\n */\nexport const useUserProfile = (\n href: string | Href,\n options?: HookOptions,\n): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n ...options,\n });\n"],"mappings":"AACA,OAAOA,gBAAgB,MAAM,wCAAwC;AACrE,OAAOC,aAAa,MAAM,kCAAkC;AAC5D,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,kBAAkB,MAAM,qCAAqC;AACpE,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,gBAAgB,MAAM,iCAAiC;AAE9D,SAASC,iBAAiB,QAAQ,qBAAqB;AAKvD;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GACzBC,OAAqB,IAErBF,iBAAiB,CAAC,aAAa,EAAE,GAAG,EAAE;EACpCG,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEV,gBAAgB;EAC7B,GAAGQ;AACL,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,OAAO,MAAMG,MAAM,GAAGA,CACpBC,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,KAAK,EAAEM,IAAI,EAAE;EAC7BH,cAAc,EAAE,CAAC,KAAK,CAAC;EACvBC,WAAW,EAAER,QAAQ;EACrB,GAAGM;AACL,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,OAAO,MAAMK,WAAW,GAAGA,CACzBD,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,UAAU,EAAEM,IAAI,EAAE;EAClCH,cAAc,EAAE,CAAC,UAAU,CAAC;EAC5BC,WAAW,EAAET,aAAa;EAC1B,GAAGO;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMM,gBAAgB,GAAGA,CAC9BF,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,eAAe,EAAEM,IAAI,EAAE;EACvCH,cAAc,EAAE,CAAC,eAAe,CAAC;EACjCC,WAAW,EAAEP,kBAAkB;EAC/B,GAAGK;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMO,cAAc,GAAGA,CAC5BH,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,aAAa,EAAEM,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,QAAQ,CAAC;EAC1BC,WAAW,EAAEN,WAAW;EACxB,GAAGI;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMQ,cAAc,GAAGA,CAC5BJ,IAAmB,EACnBJ,OAAqB,KAErBF,iBAAiB,CAAC,aAAa,EAAEM,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEL,gBAAgB;EAC7B,GAAGG;AACL,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ import Href from "../models/href/Href";
2
+ import CaseSearchModel from "../models/search/CaseSearchModel";
3
+ import { useModularUIBasic } from "./useModularUIBasic";
4
+ /**
5
+ */
6
+ export const useQuicksearch = (href, options) => useModularUIBasic("quicksearch", href, {
7
+ expectedModels: ["CaseSearch"],
8
+ targetModel: CaseSearchModel,
9
+ ...options
10
+ });
11
+
12
+ /**
13
+ */
14
+ export const useSearch = (href, options) => useModularUIBasic("search", href, {
15
+ expectedModels: ["CaseSearch"],
16
+ targetModel: CaseSearchModel,
17
+ ...options
18
+ });
19
+ //# sourceMappingURL=useSearch.js.map
@@ -0,0 +1,31 @@
1
+ // @flow
2
+ import Href from "../models/href/Href";
3
+ import CaseSearchModel from "../models/search/CaseSearchModel";
4
+
5
+ import { useModularUIBasic } from "./useModularUIBasic";
6
+
7
+ import type { HookOptions } from "./useModularUIBasic";
8
+
9
+ /**
10
+ */
11
+ export const useQuicksearch = (
12
+ href: string | Href,
13
+ options?: HookOptions,
14
+ ): CaseSearchModel | null =>
15
+ useModularUIBasic("quicksearch", href, {
16
+ expectedModels: ["CaseSearch"],
17
+ targetModel: CaseSearchModel,
18
+ ...options,
19
+ });
20
+
21
+ /**
22
+ */
23
+ export const useSearch = (
24
+ href: string | Href,
25
+ options?: HookOptions,
26
+ ): CaseSearchModel | null =>
27
+ useModularUIBasic("search", href, {
28
+ expectedModels: ["CaseSearch"],
29
+ targetModel: CaseSearchModel,
30
+ ...options,
31
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearch.js","names":["Href","CaseSearchModel","useModularUIBasic","useQuicksearch","href","options","expectedModels","targetModel","useSearch"],"sources":["../../src/hooks/useSearch.js"],"sourcesContent":["// @flow\nimport Href from \"../models/href/Href\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\n\n/**\n */\nexport const useQuicksearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\n/**\n */\nexport const useSearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n"],"mappings":"AACA,OAAOA,IAAI,MAAM,qBAAqB;AACtC,OAAOC,eAAe,MAAM,kCAAkC;AAE9D,SAASC,iBAAiB,QAAQ,qBAAqB;AAIvD;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAC5BC,IAAmB,EACnBC,OAAqB,KAErBH,iBAAiB,CAAC,aAAa,EAAEE,IAAI,EAAE;EACrCE,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN,eAAe;EAC5B,GAAGI;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMG,SAAS,GAAGA,CACvBJ,IAAmB,EACnBC,OAAqB,KAErBH,iBAAiB,CAAC,QAAQ,EAAEE,IAAI,EAAE;EAChCE,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN,eAAe;EAC5B,GAAGI;AACL,CAAC,CAAC","ignoreList":[]}