@beinformed/ui 1.65.2 → 1.65.4
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 +26 -0
- package/esm/hooks/useList.js +4 -4
- package/esm/hooks/useList.js.flow +5 -5
- package/esm/hooks/useList.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +3 -2
- package/esm/models/concepts/ConceptIndexModel.js.flow +5 -4
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +7 -1
- package/esm/models/content/ContentIndexModel.js.flow +8 -3
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +3 -2
- package/esm/models/content/ContentModel.js.flow +4 -3
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +6 -2
- package/esm/models/content/ContentTOCModel.js.flow +6 -2
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +54 -26
- package/esm/models/filters/AssignmentFilterModel.js.flow +68 -37
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +0 -110
- package/esm/models/filters/BaseFilterModel.js.flow +2 -133
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +2 -2
- package/esm/models/filters/ConceptIndexFilterModel.js.flow +2 -2
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterModel.js +117 -2
- package/esm/models/filters/FilterModel.js.flow +146 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +2 -2
- package/esm/models/filters/RangeFilterModel.js.flow +2 -2
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/href/Href.js +1 -1
- package/esm/models/href/Href.js.flow +1 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/list/ListModel.js +5 -1
- package/esm/models/list/ListModel.js.flow +7 -3
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +7 -0
- package/esm/models/sorting/SortOptionModel.js.flow +7 -0
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +14 -2
- package/esm/models/sorting/SortingModel.js.flow +14 -2
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/types.js.flow +1 -3
- package/esm/models/types.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js +7 -6
- package/esm/redux/_modularui/ModularUIConnector.js.flow +6 -4
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/hooks/useList.js +4 -4
- package/lib/hooks/useList.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +3 -2
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +6 -1
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +3 -2
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +6 -2
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +54 -26
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +0 -109
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterModel.js +117 -1
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +2 -2
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/href/Href.js +1 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/list/ListModel.js +5 -1
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +7 -0
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +14 -2
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +7 -6
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/package.json +6 -6
- package/src/hooks/useList.js +5 -5
- package/src/models/concepts/ConceptIndexModel.js +5 -4
- package/src/models/content/ContentIndexModel.js +8 -3
- package/src/models/content/ContentModel.js +4 -3
- package/src/models/content/ContentTOCModel.js +6 -2
- package/src/models/filters/AssignmentFilterModel.js +68 -37
- package/src/models/filters/BaseFilterModel.js +2 -133
- package/src/models/filters/ConceptIndexFilterModel.js +2 -2
- package/src/models/filters/FilterModel.js +146 -1
- package/src/models/filters/RangeFilterModel.js +2 -2
- package/src/models/href/Href.js +1 -1
- package/src/models/list/ListModel.js +7 -3
- package/src/models/sorting/SortOptionModel.js +7 -0
- package/src/models/sorting/SortingModel.js +14 -2
- package/src/models/types.js +1 -3
- package/src/redux/_modularui/ModularUIConnector.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.1...v1.65.4) (2026-01-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **hooks:** correct useEffect cleanup syntax and loosen `undefined` check in Href methods ([452cb01](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/452cb01180a852996bae753d108004e35d9f52bc))
|
|
11
|
+
* **hooks:** modularui basic hook, add removeOnUnmount ([137c86c](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/137c86ca5bf9b4c934b16ef4477e3d6f6fddf657))
|
|
12
|
+
* **hooks:** refactor key generation and reload handling for modular UI hooks ([11f3131](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/11f3131cadf4b79139f0ad8d8dd1357c429367f4))
|
|
13
|
+
* **list:** update list filters from filter array ([26039b7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/26039b77b58b8172cb39514399367726e98b2d85))
|
|
14
|
+
* **login:** handle failing login attempt ([1ace402](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/1ace402589fdfe9270feec9d342452358edbac59))
|
|
15
|
+
* **sorting:** add reset functionality and improve sort value handling ([c39188d](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c39188d96f5986301b18d2d236cfd77db8c5a101))
|
|
16
|
+
* **use-panel:** improve panel key in store ([79e55fb](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/79e55fb932db26e6a2112f182d9ff4741003565e))
|
|
17
|
+
|
|
18
|
+
## [1.65.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.1...v1.65.3) (2026-01-05)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **hooks:** correct useEffect cleanup syntax and loosen `undefined` check in Href methods ([452cb01](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/452cb01180a852996bae753d108004e35d9f52bc))
|
|
24
|
+
* **hooks:** modularui basic hook, add removeOnUnmount ([137c86c](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/137c86ca5bf9b4c934b16ef4477e3d6f6fddf657))
|
|
25
|
+
* **hooks:** refactor key generation and reload handling for modular UI hooks ([11f3131](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/11f3131cadf4b79139f0ad8d8dd1357c429367f4))
|
|
26
|
+
* **list:** update list filters from filter array ([26039b7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/26039b77b58b8172cb39514399367726e98b2d85))
|
|
27
|
+
* **login:** handle failing login attempt ([1ace402](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/1ace402589fdfe9270feec9d342452358edbac59))
|
|
28
|
+
* **sorting:** add reset functionality and improve sort value handling ([c39188d](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c39188d96f5986301b18d2d236cfd77db8c5a101))
|
|
29
|
+
* **use-panel:** improve panel key in store ([79e55fb](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/79e55fb932db26e6a2112f182d9ff4741003565e))
|
|
30
|
+
|
|
5
31
|
## [1.65.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.1...v1.65.2) (2025-12-19)
|
|
6
32
|
|
|
7
33
|
|
package/esm/hooks/useList.js
CHANGED
|
@@ -37,7 +37,7 @@ export const useListDetail = (href, options) => useModularUIBasic("listdetail",
|
|
|
37
37
|
export const useListNavigation = () => {
|
|
38
38
|
const history = useHistory();
|
|
39
39
|
const dispatch = useDispatch();
|
|
40
|
-
const
|
|
40
|
+
const update = (list, resetPage = false) => {
|
|
41
41
|
const listHref = list.selfhref;
|
|
42
42
|
if (resetPage) {
|
|
43
43
|
listHref.page = null;
|
|
@@ -47,7 +47,7 @@ export const useListNavigation = () => {
|
|
|
47
47
|
search: listHref.querystring,
|
|
48
48
|
state: list.formdata
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
dispatch(loadModularUI(list.connectKey, listHref, {
|
|
51
51
|
method: HTTP_METHODS.POST,
|
|
52
52
|
data: list.formdata,
|
|
53
53
|
targetModel: ListModel
|
|
@@ -56,14 +56,14 @@ export const useListNavigation = () => {
|
|
|
56
56
|
history.push({
|
|
57
57
|
search: listHref.querystring
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
dispatch(loadModularUI(list.connectKey, listHref, {
|
|
60
60
|
method: HTTP_METHODS.GET,
|
|
61
61
|
targetModel: ListModel
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
return {
|
|
66
|
-
|
|
66
|
+
update
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=useList.js.map
|
|
@@ -12,7 +12,7 @@ import type { HookOptions } from "./useModularUIBasic";
|
|
|
12
12
|
import { useHistory } from "react-router";
|
|
13
13
|
|
|
14
14
|
type ListNavigationHook = {
|
|
15
|
-
|
|
15
|
+
update: (list: ListModel, resetPage?: boolean) => void,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -58,7 +58,7 @@ export const useListNavigation = (): ListNavigationHook => {
|
|
|
58
58
|
const history = useHistory();
|
|
59
59
|
const dispatch = useDispatch();
|
|
60
60
|
|
|
61
|
-
const
|
|
61
|
+
const update = (list: ListModel, resetPage: boolean = false) => {
|
|
62
62
|
const listHref = list.selfhref;
|
|
63
63
|
if (resetPage) {
|
|
64
64
|
listHref.page = null;
|
|
@@ -66,7 +66,7 @@ export const useListNavigation = (): ListNavigationHook => {
|
|
|
66
66
|
|
|
67
67
|
if (list.requestMethod === HTTP_METHODS.POST) {
|
|
68
68
|
history.push({ search: listHref.querystring, state: list.formdata });
|
|
69
|
-
|
|
69
|
+
dispatch(
|
|
70
70
|
loadModularUI(list.connectKey, listHref, {
|
|
71
71
|
method: HTTP_METHODS.POST,
|
|
72
72
|
data: list.formdata,
|
|
@@ -75,7 +75,7 @@ export const useListNavigation = (): ListNavigationHook => {
|
|
|
75
75
|
);
|
|
76
76
|
} else {
|
|
77
77
|
history.push({ search: listHref.querystring });
|
|
78
|
-
|
|
78
|
+
dispatch(
|
|
79
79
|
loadModularUI(list.connectKey, listHref, {
|
|
80
80
|
method: HTTP_METHODS.GET,
|
|
81
81
|
targetModel: ListModel,
|
|
@@ -85,6 +85,6 @@ export const useListNavigation = (): ListNavigationHook => {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
return {
|
|
88
|
-
|
|
88
|
+
update,
|
|
89
89
|
};
|
|
90
90
|
};
|
package/esm/hooks/useList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.js","names":["useModularUIBasic","useDispatch","HTTP_METHODS","loadModularUI","DetailModel","ListModel","ListDetailModel","Href","useHistory","useList","href","options","expectedModels","targetModel","useListOrDetail","useListDetail","forceTargetModel","useListNavigation","history","dispatch","
|
|
1
|
+
{"version":3,"file":"useList.js","names":["useModularUIBasic","useDispatch","HTTP_METHODS","loadModularUI","DetailModel","ListModel","ListDetailModel","Href","useHistory","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"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { useDispatch } from \"react-redux\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\nimport { loadModularUI } from \"../redux\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport { useHistory } from \"react-router\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => 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\"],\n targetModel: ListModel,\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\", \"Detail\"],\n targetModel: [ListModel, 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,\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,\n }),\n );\n }\n };\n\n return {\n update,\n };\n};\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,UAAU;AACxC,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,IAAI,MAAM,qBAAqB;AAGtC,SAASC,UAAU,QAAQ,cAAc;AAMzC;AACA;AACA,OAAO,MAAMC,OAAO,GAAGA,CACrBC,IAAmB,EACnBC,OAAqB,KAErBX,iBAAiB,CAAC,MAAM,EAAEU,IAAI,EAAE;EAC9BE,cAAc,EAAE,CAAC,MAAM,CAAC;EACxBC,WAAW,EAAER,SAAS;EACtB,GAAGM;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMG,eAAe,GAAGA,CAC7BJ,IAAmB,EACnBC,OAAqB,KAErBX,iBAAiB,CAAC,MAAM,EAAEU,IAAI,EAAE;EAC9BE,cAAc,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;EAClCC,WAAW,EAAE,CAACR,SAAS,EAAED,WAA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BvB,WAAW,EAAER;MACf,CAAC,CACH,CAAC;IACH;EACF,CAAC;EAED,OAAO;IACLe;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -105,8 +105,9 @@ export default class ConceptIndexModel extends ResourceModel {
|
|
|
105
105
|
*/
|
|
106
106
|
get entryDate() {
|
|
107
107
|
const timeversionFilter = this.filterCollection.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const date = timeversionFilter?.value;
|
|
109
|
+
if (typeof date === "string") {
|
|
110
|
+
return date;
|
|
110
111
|
}
|
|
111
112
|
return null;
|
|
112
113
|
}
|
|
@@ -129,14 +129,15 @@ export default class ConceptIndexModel extends ResourceModel {
|
|
|
129
129
|
/**
|
|
130
130
|
* Retrieve modelcatalog.js of content toc
|
|
131
131
|
*/
|
|
132
|
-
get entryDate():
|
|
132
|
+
get entryDate(): ISO_DATE | null {
|
|
133
133
|
const timeversionFilter = this.filterCollection.getFilterByAttributeKey(
|
|
134
134
|
TIMEVERSION_FILTER_NAME,
|
|
135
135
|
);
|
|
136
|
-
if (timeversionFilter && timeversionFilter.attribute) {
|
|
137
|
-
return timeversionFilter.attribute.value;
|
|
138
|
-
}
|
|
139
136
|
|
|
137
|
+
const date = timeversionFilter?.value;
|
|
138
|
+
if (typeof date === "string") {
|
|
139
|
+
return date;
|
|
140
|
+
}
|
|
140
141
|
return null;
|
|
141
142
|
}
|
|
142
143
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","
|
|
1
|
+
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","date","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n const date = timeversionFilter?.value;\n if (typeof date === \"string\") {\n return date;\n }\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAQnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIR,gBAAgB,CAAAS,uBAAA,CAC3C,IAAI,CAACC,IAAI,GACT;MACEC,MAAM,EAAAF,uBAAA,CAAE,IAAI,CAACG,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,EACD,IAAI,CAACC,YACP,CAAC;IAED,IAAI,CAACC,SAAS,GAAG,IAAIhB,kBAAkB,CAAC,CAAC;IACzC,IAAI,CAACgB,SAAS,CAACC,UAAU,GAAG,IAAI,CAACN,IAAI,CAACO,SAAS,GAC3CC,oBAAA,CAAAZ,QAAA,OAAI,CAACI,IAAI,CAACO,SAAS,CAACE,OAAO,EAAAC,IAAA,CAAAd,QAAA,EACxBe,OAAO,IACN,IAAIpB,gBAAgB,CAClBoB,OAAO,CAACA,OAAO,EACf,IAAI,CAACC,SAAS,EACd,IAAI,CAACR,YACP,CACJ,CAAC,GACD,EAAE;EACR;;EAEA;AACF;EACE,IAAIS,IAAIA,CAAA,EAAW;IACjB,IAAI,IAAI,CAACC,YAAY,KAAK,iBAAiB,EAAE;MAC3C,OAAO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BA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAAC5B,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE,IAAIuC,WAAWA,CAAA,EAAsB;IACnC,OAAO,IAAI,CAACX,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAI1B,SAASA,CAAA,EAAoB;IAC/B,MAAM2B,iBAAiB,GAAG,IAAI,CAACb,gBAAgB,CAACY,uBAAuB,CACrE9C,uBACF,CAAC;IAED,MAAMgD,IAAI,GAAGD,iBAAiB,EAAER,KAAK;IACrC,IAAI,OAAOS,IAAI,KAAK,QAAQ,EAAE;MAC5B,OAAOA,IAAI;IACb;IACA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAACf,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAII,mBAAmBA,CAAA,EAAsB;IAC3C,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,eAAe,CAAC;EACvE;;EAEA;AACF;AACA;EACE,IAAInB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAACd,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIc,KAAKA,CAACwB,cAAoD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
|
|
@@ -7,6 +7,8 @@ import FilterCollection from "../filters/FilterCollection";
|
|
|
7
7
|
import ContentLinkModel from "./ContentLinkModel";
|
|
8
8
|
import Href from "../href/Href";
|
|
9
9
|
import ChoiceAttributeModel from "../attributes/ChoiceAttributeModel";
|
|
10
|
+
import ConceptIndexFilterModel from "../filters/ConceptIndexFilterModel";
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Get Index of concepts, to filter model catalog
|
|
12
14
|
*/
|
|
@@ -90,7 +92,11 @@ export default class ContentIndexModel extends ResourceModel {
|
|
|
90
92
|
* Get index filter
|
|
91
93
|
*/
|
|
92
94
|
get indexfilter() {
|
|
93
|
-
|
|
95
|
+
const indexFilter = this._filterCollection.getFilterByAttributeKey("index");
|
|
96
|
+
if (indexFilter instanceof ConceptIndexFilterModel) {
|
|
97
|
+
return indexFilter;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
/**
|
|
@@ -6,10 +6,11 @@ import ContentLinkModel from "./ContentLinkModel";
|
|
|
6
6
|
import Href from "../href/Href";
|
|
7
7
|
import ChoiceAttributeModel from "../attributes/ChoiceAttributeModel";
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { ModularUIModel } from "../types";
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type LinkModel from "../links/LinkModel";
|
|
12
12
|
import type ErrorResponse from "../error/ErrorResponse";
|
|
13
|
+
import ConceptIndexFilterModel from "../filters/ConceptIndexFilterModel";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Get Index of concepts, to filter model catalog
|
|
@@ -109,8 +110,12 @@ export default class ContentIndexModel extends ResourceModel {
|
|
|
109
110
|
/**
|
|
110
111
|
* Get index filter
|
|
111
112
|
*/
|
|
112
|
-
get indexfilter():
|
|
113
|
-
|
|
113
|
+
get indexfilter(): ConceptIndexFilterModel | null {
|
|
114
|
+
const indexFilter = this._filterCollection.getFilterByAttributeKey("index");
|
|
115
|
+
if (indexFilter instanceof ConceptIndexFilterModel) {
|
|
116
|
+
return indexFilter;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ContentLinkModel","Href","ChoiceAttributeModel","ContentIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_content","collection","_embedded","_mapInstanceProperty","results","call","content","type","modelName","isApplicableModel","resourcetype","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","hasIndexFilter","filterAttribute","attribute","options","length","hasFiltersSet","some","isActive","hasNoFiltersSet","getFirstCharHref","firstChar","_context2","option","code","addParameter"],"sources":["../../../src/models/content/ContentIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport Href from \"../href/Href\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\nimport type {
|
|
1
|
+
{"version":3,"file":"ContentIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ContentLinkModel","Href","ChoiceAttributeModel","ConceptIndexFilterModel","ContentIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_content","collection","_embedded","_mapInstanceProperty","results","call","content","type","modelName","isApplicableModel","resourcetype","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","indexFilter","getFilterByAttributeKey","hasIndexFilter","filterAttribute","attribute","options","length","hasFiltersSet","some","isActive","hasNoFiltersSet","getFirstCharHref","firstChar","_context2","option","code","addParameter"],"sources":["../../../src/models/content/ContentIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport Href from \"../href/Href\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\nimport ConceptIndexFilterModel from \"../filters/ConceptIndexFilterModel\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ContentIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _content: ResourceCollection<ContentLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._content = new ResourceCollection();\n this._content.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (content) =>\n new ContentLinkModel(content.content, null, this.modelOptions),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n return \"ContentIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentSearch\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = this.selflink.href;\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): ConceptIndexFilterModel | null {\n const indexFilter = this._filterCollection.getFilterByAttributeKey(\"index\");\n if (indexFilter instanceof ConceptIndexFilterModel) {\n return indexFilter;\n }\n return null;\n }\n\n /**\n * Retrieve content collection\n */\n get items(): ResourceCollection<ContentLinkModel> {\n return this._content;\n }\n\n /**\n */\n hasIndexFilter(): boolean {\n const filterAttribute = this.indexfilter?.attribute;\n\n return (\n filterAttribute instanceof ChoiceAttributeModel &&\n filterAttribute.options.length > 0\n );\n }\n\n /**\n */\n hasFiltersSet(): boolean {\n return this.filterCollection.some((filter) => filter.isActive());\n }\n\n /**\n */\n hasNoFiltersSet(): boolean {\n return !this.hasFiltersSet();\n }\n\n /**\n */\n getFirstCharHref(): Href {\n const filterAttribute = this.indexfilter?.attribute;\n\n let firstChar = \"#\";\n if (filterAttribute instanceof ChoiceAttributeModel) {\n firstChar = filterAttribute.options.filter(\n (option) => option.code !== \"0\",\n )[0].code;\n }\n\n return new Href(this.selfhref).addParameter(\"index\", firstChar);\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,oBAAoB,MAAM,oCAAoC;AAMrE,OAAOC,uBAAuB,MAAM,oCAAoC;;AAExE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASP,aAAa,CAAC;EAI3D;AACF;EACEQ,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIV,gBAAgB,CAAAW,uBAAA,CAC3C,IAAI,CAACC,IAAI,GACT;MACEC,MAAM,EAAAF,uBAAA,CAAE,IAAI,CAACG,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CA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G;IACnB,IAAIT,eAAe,YAAY/C,oBAAoB,EAAE;MAAA,IAAAyD,SAAA;MACnDD,SAAS,GAAGhD,uBAAA,CAAAiD,SAAA,GAAAV,eAAe,CAACE,OAAO,EAAA9B,IAAA,CAAAsC,SAAA,EAChCC,MAAM,IAAKA,MAAM,CAACC,IAAI,KAAK,GAC9B,CAAC,CAAC,CAAC,CAAC,CAACA,IAAI;IACX;IAEA,OAAO,IAAI5D,IAAI,CAAC,IAAI,CAAC+B,QAAQ,CAAC,CAAC8B,YAAY,CAAC,OAAO,EAAEJ,SAAS,CAAC;EACjE;AACF","ignoreList":[]}
|
|
@@ -87,8 +87,9 @@ export default class ContentModel extends ResourceModel {
|
|
|
87
87
|
*/
|
|
88
88
|
get entryDate() {
|
|
89
89
|
const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
const date = entryDateFilter?.value;
|
|
91
|
+
if (typeof date === "string") {
|
|
92
|
+
return date;
|
|
92
93
|
}
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
@@ -110,10 +110,11 @@ export default class ContentModel extends ResourceModel {
|
|
|
110
110
|
const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(
|
|
111
111
|
TIMEVERSION_FILTER_NAME,
|
|
112
112
|
);
|
|
113
|
-
if (entryDateFilter && entryDateFilter.attribute) {
|
|
114
|
-
return entryDateFilter.attribute.value;
|
|
115
|
-
}
|
|
116
113
|
|
|
114
|
+
const date = entryDateFilter?.value;
|
|
115
|
+
if (typeof date === "string") {
|
|
116
|
+
return date;
|
|
117
|
+
}
|
|
117
118
|
return null;
|
|
118
119
|
}
|
|
119
120
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_defineProperty","_section","data","entryDate","modelOptions","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","call","model","section","id","_id","filterCollection","_filterCollection","_filterInstanceProperty","filter","entryDateFilter","getFilterByAttributeKey","
|
|
1
|
+
{"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_defineProperty","_section","data","entryDate","modelOptions","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","call","model","section","id","_id","filterCollection","_filterCollection","_filterInstanceProperty","filter","entryDateFilter","getFilterByAttributeKey","date","value","_contentType","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","setReferenceHash","referenceHash"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(\n this.data,\n this.entryDate,\n this.modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n const date = entryDateFilter?.value;\n if (typeof date === \"string\") {\n return date;\n }\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,eAAe,MAAMC,YAAY,SAASP,aAAa,CAAC;EAKtDQ,WAAWA,CAACC,QAA2B,EAAE;IACvC,KAAK,CAACA,QAAQ,CAAC;IAACC,eAAA;IAAAA,eAAA,uBAJsB,IAAI;IAAAA,eAAA;IAM1C,IAAI,CAACC,QAAQ,GAAG,IAAIL,YAAY,CAC9B,IAAI,CAACM,IAAI,EACT,IAAI,CAACC,SAAS,EACd,IAAI,CAACC,YACP,CAAC;EACH;;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AAQ,IAAI,EAAE;EAC7C;;EAEA;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAA2B;IACxC,OAAO,IAAI,CAACnB,OAAO,CAACmB,WAAW;EACjC;;EAEA;AACF;EACE,IAAIC,oBAAoBA,CAAA,EAAgB;IACtC,MAAMC,KAAK,GAAG,EAAE;IAChB,IAAI,IAAI,CAACC,mBAAmB,EAAE;MAC5BD,KAAK,CAACE,IAAI,CAAC,IAAI,CAACD,mBAAmB,CAAC;IACtC;IAEA,IAAI,CAACH,WAAW,CAACK,OAAO,CAAEC,UAAU,IAAK;MACvCJ,KAAK,CAACE,IAAI,CAAC,GAAGE,UAAU,CAACL,oBAAoB,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOC,KAAK;EACd;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAgB;IACrC,MAAMI,mBAAmB,GAAG,IAAI,CAAClC,KAAK,CAACC,YAAY,CAAC,iBAAiB,CAAC;IAEtE,IAAIiC,mBAAmB,EAAE;MACvB,MAAM;QAAEC;MAAK,CAAC,GAAGD,mBAAmB;MACpCC,IAAI,CAACC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC7C,SAAS,CAAC;MAC9C4C,IAAI,CAACE,gBAAgB,CAAC,IAAI,CAACC,aAAa,CAAC;MACzC,OAAOH,IAAI;IACb;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAAC9B,OAAO,CAAC8B,aAAa;EACnC;AACF","ignoreList":[]}
|
|
@@ -191,14 +191,18 @@ export default class ContentTOCModel extends ResourceModel {
|
|
|
191
191
|
*/
|
|
192
192
|
get entryDate() {
|
|
193
193
|
const timeversionFilter = this.filterCollection.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
|
|
194
|
-
|
|
194
|
+
const date = timeversionFilter?.value;
|
|
195
|
+
if (typeof date === "string") {
|
|
196
|
+
return date;
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
/**
|
|
198
202
|
*/
|
|
199
203
|
get isCompleteSource() {
|
|
200
204
|
const completeFilter = this.filterCollection.getFilterByAttributeKey("complete");
|
|
201
|
-
return completeFilter?.
|
|
205
|
+
return completeFilter?.value === "true";
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
//# sourceMappingURL=ContentTOCModel.js.map
|
|
@@ -220,7 +220,11 @@ export default class ContentTOCModel extends ResourceModel {
|
|
|
220
220
|
TIMEVERSION_FILTER_NAME,
|
|
221
221
|
);
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
const date = timeversionFilter?.value;
|
|
224
|
+
if (typeof date === "string") {
|
|
225
|
+
return date;
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
224
228
|
}
|
|
225
229
|
|
|
226
230
|
/**
|
|
@@ -228,6 +232,6 @@ export default class ContentTOCModel extends ResourceModel {
|
|
|
228
232
|
get isCompleteSource(): boolean {
|
|
229
233
|
const completeFilter =
|
|
230
234
|
this.filterCollection.getFilterByAttributeKey("complete");
|
|
231
|
-
return completeFilter?.
|
|
235
|
+
return completeFilter?.value === "true";
|
|
232
236
|
}
|
|
233
237
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","SectionModel","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","modelOptions","_mapInstanceProperty","call","item","link","section","_id","sections","ContentTOCModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","model","label","getData","abbreviation","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","relatedConceptsHref","relatedConceptsLink","addParameter","selfContentLink","_context","categories","_context2","category","_contentType","_filterCollection","_context3","_filterInstanceProperty","_context4","key","_Object$keys","timeversionFilter","getFilterByAttributeKey","attribute","isCompleteSource","completeFilter"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport SectionModel from \"./SectionModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type { ModelOptions, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate,\n modelOptions,\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate, modelOptions);\n }\n if (item.sections) {\n link.items = getItems(item.sections, entryDate, modelOptions);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTOCModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return data.contributions?.resourcetype === \"ContentTOC\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n */\n get abbreviation(): string | null {\n return this.getData(\"abbreviation\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate, this.modelOptions);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n if (this.data.items) {\n return getItems(this.data.items, this.entryDate, this.modelOptions);\n }\n\n if (this.data.sections) {\n return getItems(this.data.sections, this.entryDate, this.modelOptions);\n }\n\n return [];\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n if (this.data.sections) {\n return this.data.sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category, null, this.modelOptions),\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n return timeversionFilter?.attribute?.value ?? null;\n }\n\n /**\n */\n get isCompleteSource(): boolean {\n const completeFilter =\n this.filterCollection.getFilterByAttributeKey(\"complete\");\n return completeFilter?.attribute?.value === \"true\";\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAE/B,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE;AACA;AACA;AACA,MAAMC,QAAQ,GAAGA,CACfC,KAAoB,EACpBC,SAA0B,EAC1BC,YAA2B,KAE3BC,oBAAA,CAAAH,KAAK,EAAAI,IAAA,CAALJ,KAAK,EAAMK,IAAI,IAAK;EAClB,MAAMC,IAAI,GAAG,IAAIZ,gBAAgB,CAC/B;IACE,GAAGW,IAAI;IACPE,OAAO,EAAEF,IAAI,CAACG;EAChB,CAAC,EACDP,SAAS,EACTC,YACF,CAAC;EAED,IAAIG,IAAI,CAACL,KAAK,EAAE;IACdM,IAAI,CAACN,KAAK,GAAGD,QAAQ,CAACM,IAAI,CAACL,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;EAC5D;EACA,IAAIG,IAAI,CAACI,QAAQ,EAAE;IACjBH,IAAI,CAACN,KAAK,GAAGD,QAAQ,CAACM,IAAI,CAACI,QAAQ,EAAER,SAAS,EAAEC,YAAY,CAAC;EAC/D;EAEA,OAAOI,IAAI;AACb,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,eAAe,MAA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AC,GAAGC,YAAA,CAAYrB,MAAM,CAAC;UACjC,OAAO9C,GAAG,EAAAiE,SAAA,GAAC,IAAI,CAACvC,IAAI,qBAAAsC,uBAAA,CAAAC,SAAA,GAAUC,GAAG,CAAC;QACpC,CAAC;MACH,CAAC,EACD,IAAI,CAACvD,YACP,CAAC;IACH;IAEA,OAAO,IAAI,CAACmD,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE,IAAIpD,SAASA,CAAA,EAAoB;IAC/B,MAAM0D,iBAAiB,GAAG,IAAI,CAACxB,gBAAgB,CAACyB,uBAAuB,CACrE9D,uBACF,CAAC;IAED,OAAO6D,iBAAiB,EAAEE,SAAS,EAAErB,KAAK,IAAI,IAAI;EACpD;;EAEA;AACF;EACE,IAAIsB,gBAAgBA,CAAA,EAAY;IAC9B,MAAMC,cAAc,GAClB,IAAI,CAAC5B,gBAAgB,CAACyB,uBAAuB,CAAC,UAAU,CAAC;IAC3D,OAAOG,cAAc,EAAEF,SAAS,EAAErB,KAAK,KAAK,MAAM;EACpD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","SectionModel","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","modelOptions","_mapInstanceProperty","call","item","link","section","_id","sections","ContentTOCModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","model","label","getData","abbreviation","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","relatedConceptsHref","relatedConceptsLink","addParameter","selfContentLink","_context","categories","_context2","category","_contentType","_filterCollection","_context3","_filterInstanceProperty","_context4","key","_Object$keys","timeversionFilter","getFilterByAttributeKey","date","isCompleteSource","completeFilter"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport SectionModel from \"./SectionModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type { ModelOptions, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate,\n modelOptions,\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate, modelOptions);\n }\n if (item.sections) {\n link.items = getItems(item.sections, entryDate, modelOptions);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTOCModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return data.contributions?.resourcetype === \"ContentTOC\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n */\n get abbreviation(): string | null {\n return this.getData(\"abbreviation\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate, this.modelOptions);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n if (this.data.items) {\n return getItems(this.data.items, this.entryDate, this.modelOptions);\n }\n\n if (this.data.sections) {\n return getItems(this.data.sections, this.entryDate, this.modelOptions);\n }\n\n return [];\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n if (this.data.sections) {\n return this.data.sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category, null, this.modelOptions),\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n const date = timeversionFilter?.value;\n if (typeof date === \"string\") {\n return date;\n }\n return null;\n }\n\n /**\n */\n get isCompleteSource(): boolean {\n const completeFilter =\n this.filterCollection.getFilterByAttributeKey(\"complete\");\n return completeFilter?.value === \"true\";\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAE/B,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE;AACA;AACA;AACA,MAAMC,QAAQ,GAAGA,CACfC,KAAoB,EACpBC,SAA0B,EAC1BC,YAA2B,KAE3BC,oBAAA,CAAAH,KAAK,EAAAI,IAAA,CAALJ,KAAK,EAAMK,IAAI,IAAK;EAClB,MAAMC,IAAI,GAAG,IAAIZ,gBAAgB,CAC/B;IACE,GAAGW,IAAI;IACPE,OAAO,EAAEF,IAAI,CAACG;EAChB,CAAC,EACDP,SAAS,EACTC,YACF,CAAC;EAED,IAAIG,IAAI,CAACL,KAAK,EAAE;IACdM,IAAI,CAACN,KAAK,GAAGD,QAAQ,CAACM,IAAI,CAACL,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;EAC5D;EACA,IAAIG,IAAI,CAACI,QAAQ,EAAE;IACjBH,IAAI,CAACN,KAAK,GAAGD,QAAQ,CAACM,IAAI,CAACI,QAAQ,EAAER,SAAS,EAAEC,YAAY,CAAC;EAC/D;EAEA,OAAOI,IAAI;AACb,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,eAAe,MAAMI,eAAe,SAASlB,aAAa,CAAC;EAAAmB,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBACjB,IAAI;IAAAA,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