@contember/react-binding 1.3.0-alpha.8 → 1.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/accessorPropagation/useEntityListSubTreeLoader.cjs +47 -0
- package/dist/development/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -0
- package/dist/development/accessorPropagation/useEntityListSubTreeLoader.js +47 -0
- package/dist/development/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -0
- package/dist/development/accessorSorting/sortEntities.cjs +1 -4
- package/dist/development/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/development/accessorSorting/sortEntities.js +1 -4
- package/dist/development/accessorSorting/sortEntities.js.map +1 -1
- package/dist/development/helperComponents/DimensionRenderer.cjs +29 -0
- package/dist/development/helperComponents/DimensionRenderer.cjs.map +1 -0
- package/dist/development/helperComponents/DimensionRenderer.js +29 -0
- package/dist/development/helperComponents/DimensionRenderer.js.map +1 -0
- package/dist/development/helperComponents/If.cjs +22 -19
- package/dist/development/helperComponents/If.cjs.map +1 -1
- package/dist/development/helperComponents/If.js +22 -19
- package/dist/development/helperComponents/If.js.map +1 -1
- package/dist/development/helperComponents/Variable.cjs +18 -0
- package/dist/development/helperComponents/Variable.cjs.map +1 -0
- package/dist/development/helperComponents/Variable.js +18 -0
- package/dist/development/helperComponents/Variable.js.map +1 -0
- package/dist/development/index.cjs +6 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +6 -0
- package/dist/development/index.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTreeLoader.cjs +47 -0
- package/dist/production/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -0
- package/dist/production/accessorPropagation/useEntityListSubTreeLoader.js +47 -0
- package/dist/production/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -0
- package/dist/production/accessorSorting/sortEntities.cjs +1 -4
- package/dist/production/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/production/accessorSorting/sortEntities.js +1 -4
- package/dist/production/accessorSorting/sortEntities.js.map +1 -1
- package/dist/production/helperComponents/DimensionRenderer.cjs +18 -0
- package/dist/production/helperComponents/DimensionRenderer.cjs.map +1 -0
- package/dist/production/helperComponents/DimensionRenderer.js +18 -0
- package/dist/production/helperComponents/DimensionRenderer.js.map +1 -0
- package/dist/production/helperComponents/If.cjs +9 -6
- package/dist/production/helperComponents/If.cjs.map +1 -1
- package/dist/production/helperComponents/If.js +9 -6
- package/dist/production/helperComponents/If.js.map +1 -1
- package/dist/production/helperComponents/Variable.cjs +14 -0
- package/dist/production/helperComponents/Variable.cjs.map +1 -0
- package/dist/production/helperComponents/Variable.js +14 -0
- package/dist/production/helperComponents/Variable.js.map +1 -0
- package/dist/production/index.cjs +6 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +6 -0
- package/dist/production/index.js.map +1 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts +1 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/index.d.ts +1 -0
- package/dist/types/accessorPropagation/index.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts +10 -0
- package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts.map +1 -0
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +2 -2
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +2 -2
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +1 -1
- package/dist/types/accessorSorting/sortEntities.d.ts.map +1 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
- package/dist/types/coreComponents/EntityList.d.ts.map +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/Field.d.ts.map +1 -1
- package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
- package/dist/types/coreComponents/HasOne.d.ts.map +1 -1
- package/dist/types/entityEvents/useDerivedField.d.ts.map +1 -1
- package/dist/types/helperComponents/DimensionRenderer.d.ts +9 -0
- package/dist/types/helperComponents/DimensionRenderer.d.ts.map +1 -0
- package/dist/types/helperComponents/If.d.ts +4 -0
- package/dist/types/helperComponents/If.d.ts.map +1 -1
- package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
- package/dist/types/helperComponents/SugaredField.d.ts.map +1 -1
- package/dist/types/helperComponents/Variable.d.ts +8 -0
- package/dist/types/helperComponents/Variable.d.ts.map +1 -0
- package/dist/types/helperComponents/index.d.ts +2 -0
- package/dist/types/helperComponents/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/accessorPropagation/index.ts +1 -0
- package/src/accessorPropagation/useEntityListSubTreeLoader.ts +69 -0
- package/src/accessorSorting/sortEntities.ts +1 -4
- package/src/helperComponents/DimensionRenderer.tsx +25 -0
- package/src/helperComponents/If.tsx +15 -10
- package/src/helperComponents/Variable.tsx +18 -0
- package/src/helperComponents/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("react");
|
|
4
|
+
const useExtendTree = require("./useExtendTree.cjs");
|
|
5
|
+
const EntityListSubTree = require("../coreComponents/EntityListSubTree.cjs");
|
|
6
|
+
const useEntityListSubTreeLoader = (entities, children, state) => {
|
|
7
|
+
const [displayedState, setDisplayedState] = react.useState({
|
|
8
|
+
entities: void 0,
|
|
9
|
+
treeRootId: void 0,
|
|
10
|
+
state: void 0
|
|
11
|
+
});
|
|
12
|
+
const currentlyLoading = react.useRef();
|
|
13
|
+
const [loadingState, setLoadingState] = react.useState("initial");
|
|
14
|
+
const extendTree = useExtendTree.useExtendTree();
|
|
15
|
+
react.useEffect(() => {
|
|
16
|
+
(async () => {
|
|
17
|
+
if (!entities || displayedState.state === state && displayedState.entities === entities || currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
currentlyLoading.current = {
|
|
21
|
+
entities,
|
|
22
|
+
state
|
|
23
|
+
};
|
|
24
|
+
if (displayedState.entities) {
|
|
25
|
+
setLoadingState("refreshing");
|
|
26
|
+
}
|
|
27
|
+
const newTreeRootId = await extendTree(
|
|
28
|
+
react.createElement(EntityListSubTree.EntityListSubTree, {
|
|
29
|
+
...entities,
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
currentlyLoading.current = void 0;
|
|
34
|
+
if (newTreeRootId) {
|
|
35
|
+
setDisplayedState({
|
|
36
|
+
entities,
|
|
37
|
+
treeRootId: newTreeRootId,
|
|
38
|
+
state
|
|
39
|
+
});
|
|
40
|
+
setLoadingState("loaded");
|
|
41
|
+
}
|
|
42
|
+
})();
|
|
43
|
+
}, [displayedState, extendTree, entities, children, state]);
|
|
44
|
+
return [displayedState, loadingState];
|
|
45
|
+
};
|
|
46
|
+
exports.useEntityListSubTreeLoader = useEntityListSubTreeLoader;
|
|
47
|
+
//# sourceMappingURL=useEntityListSubTreeLoader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\n\nexport type UseEntityListSubTreeLoaderResult<State> = {\n\tentities: SugaredQualifiedEntityList | undefined\n\ttreeRootId: TreeRootId | undefined\n\tstate: State | undefined\n}\n\nexport type EntityListSubTreeLoaderState =\n\t| 'initial'\n\t| 'refreshing'\n\t| 'loaded'\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderResult<State>, EntityListSubTreeLoaderState] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderResult<State>>({\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tstate: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst [loadingState, setLoadingState] = useState<EntityListSubTreeLoaderState>('initial')\n\tconst extendTree = useExtendTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (\n\t\t\t\t!entities\n\t\t\t\t|| displayedState.state === state && displayedState.entities === entities\n\t\t\t\t|| currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tif (displayedState.entities) {\n\t\t\t\tsetLoadingState('refreshing')\n\t\t\t}\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...entities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tcurrentlyLoading.current = undefined\n\t\t\tif (newTreeRootId) {\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tentities: entities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tstate: state,\n\t\t\t\t})\n\t\t\t\tsetLoadingState('loaded')\n\t\t\t}\n\t\t})()\n\t}, [displayedState, extendTree, entities, children, state])\n\n\treturn [displayedState, loadingState]\n}\n"],"names":["useState","useRef","useExtendTree","useEffect","createElement","EntityListSubTree"],"mappings":";;;;;AAgBO,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAA2F;AACnN,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAkD;AAAA,IAC7F,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA,CACP;AACD,QAAM,mBAAmBC,MAAAA;AAKzB,QAAM,CAAC,cAAc,eAAe,IAAID,eAAuC,SAAS;AACxF,QAAM,aAAaE,cAAAA;AAEnBC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UACC,CAAC,YACE,eAAe,UAAU,SAAS,eAAe,aAAa,YAC9D,iBAAiB,SAAS,aAAa,YAAY,iBAAiB,SAAS,UAAU,OACzF;AACD;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B;AAAA,QACA;AAAA,MAAA;AAGD,UAAI,eAAe,UAAU;AAC5B,wBAAgB,YAAY;AAAA,MAC7B;AAEA,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,kBAAAA,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AACA,0BAAA;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QAAA,CACA;AACD,wBAAgB,QAAQ;AAAA,MACzB;AAAA,IAAA;EACE,GACD,CAAC,gBAAgB,YAAY,UAAU,UAAU,KAAK,CAAC;AAEnD,SAAA,CAAC,gBAAgB,YAAY;AACrC;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, createElement } from "react";
|
|
2
|
+
import { useExtendTree } from "./useExtendTree.js";
|
|
3
|
+
import { EntityListSubTree } from "../coreComponents/EntityListSubTree.js";
|
|
4
|
+
const useEntityListSubTreeLoader = (entities, children, state) => {
|
|
5
|
+
const [displayedState, setDisplayedState] = useState({
|
|
6
|
+
entities: void 0,
|
|
7
|
+
treeRootId: void 0,
|
|
8
|
+
state: void 0
|
|
9
|
+
});
|
|
10
|
+
const currentlyLoading = useRef();
|
|
11
|
+
const [loadingState, setLoadingState] = useState("initial");
|
|
12
|
+
const extendTree = useExtendTree();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
(async () => {
|
|
15
|
+
if (!entities || displayedState.state === state && displayedState.entities === entities || currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
currentlyLoading.current = {
|
|
19
|
+
entities,
|
|
20
|
+
state
|
|
21
|
+
};
|
|
22
|
+
if (displayedState.entities) {
|
|
23
|
+
setLoadingState("refreshing");
|
|
24
|
+
}
|
|
25
|
+
const newTreeRootId = await extendTree(
|
|
26
|
+
createElement(EntityListSubTree, {
|
|
27
|
+
...entities,
|
|
28
|
+
children
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
currentlyLoading.current = void 0;
|
|
32
|
+
if (newTreeRootId) {
|
|
33
|
+
setDisplayedState({
|
|
34
|
+
entities,
|
|
35
|
+
treeRootId: newTreeRootId,
|
|
36
|
+
state
|
|
37
|
+
});
|
|
38
|
+
setLoadingState("loaded");
|
|
39
|
+
}
|
|
40
|
+
})();
|
|
41
|
+
}, [displayedState, extendTree, entities, children, state]);
|
|
42
|
+
return [displayedState, loadingState];
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
useEntityListSubTreeLoader
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=useEntityListSubTreeLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.js","sources":["../../../src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\n\nexport type UseEntityListSubTreeLoaderResult<State> = {\n\tentities: SugaredQualifiedEntityList | undefined\n\ttreeRootId: TreeRootId | undefined\n\tstate: State | undefined\n}\n\nexport type EntityListSubTreeLoaderState =\n\t| 'initial'\n\t| 'refreshing'\n\t| 'loaded'\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderResult<State>, EntityListSubTreeLoaderState] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderResult<State>>({\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tstate: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst [loadingState, setLoadingState] = useState<EntityListSubTreeLoaderState>('initial')\n\tconst extendTree = useExtendTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (\n\t\t\t\t!entities\n\t\t\t\t|| displayedState.state === state && displayedState.entities === entities\n\t\t\t\t|| currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tif (displayedState.entities) {\n\t\t\t\tsetLoadingState('refreshing')\n\t\t\t}\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...entities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tcurrentlyLoading.current = undefined\n\t\t\tif (newTreeRootId) {\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tentities: entities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tstate: state,\n\t\t\t\t})\n\t\t\t\tsetLoadingState('loaded')\n\t\t\t}\n\t\t})()\n\t}, [displayedState, extendTree, entities, children, state])\n\n\treturn [displayedState, loadingState]\n}\n"],"names":[],"mappings":";;;AAgBO,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAA2F;AACnN,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAkD;AAAA,IAC7F,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA,CACP;AACD,QAAM,mBAAmB;AAKzB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAuC,SAAS;AACxF,QAAM,aAAa;AAEnB,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UACC,CAAC,YACE,eAAe,UAAU,SAAS,eAAe,aAAa,YAC9D,iBAAiB,SAAS,aAAa,YAAY,iBAAiB,SAAS,UAAU,OACzF;AACD;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B;AAAA,QACA;AAAA,MAAA;AAGD,UAAI,eAAe,UAAU;AAC5B,wBAAgB,YAAY;AAAA,MAC7B;AAEA,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AACA,0BAAA;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QAAA,CACA;AACD,wBAAgB,QAAQ;AAAA,MACzB;AAAA,IAAA;EACE,GACD,CAAC,gBAAgB,YAAY,UAAU,UAAU,KAAK,CAAC;AAEnD,SAAA,CAAC,gBAAgB,YAAY;AACrC;"}
|
|
@@ -7,10 +7,7 @@ const sortEntities = (entities, sortByField) => {
|
|
|
7
7
|
return entities.sort((a, b) => {
|
|
8
8
|
const aField = a.getRelativeSingleField(sortByField);
|
|
9
9
|
const bField = b.getRelativeSingleField(sortByField);
|
|
10
|
-
|
|
11
|
-
return aField.value - bField.value;
|
|
12
|
-
}
|
|
13
|
-
return 0;
|
|
10
|
+
return (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER);
|
|
14
11
|
});
|
|
15
12
|
};
|
|
16
13
|
exports.sortEntities = sortEntities;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortEntities.cjs","sources":["../../../src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getRelativeSingleField<number>(sortByField)\n\t\tconst bField = b.getRelativeSingleField<number>(sortByField)\n\n\t\
|
|
1
|
+
{"version":3,"file":"sortEntities.cjs","sources":["../../../src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getRelativeSingleField<number>(sortByField)\n\t\tconst bField = b.getRelativeSingleField<number>(sortByField)\n\n\t\treturn (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER)\n\t})\n}\n"],"names":[],"mappings":";;AAEa,MAAA,eAAe,CAC3B,UACA,gBACsB;AACtB,MAAI,CAAC,aAAa;AACV,WAAA;AAAA,EACR;AACA,SAAO,SAAS,KAAK,CAAC,GAAG,MAAM;AACxB,UAAA,SAAS,EAAE,uBAA+B,WAAW;AACrD,UAAA,SAAS,EAAE,uBAA+B,WAAW;AAE3D,YAAQ,OAAO,SAAS,OAAO,qBAAqB,OAAO,SAAS,OAAO;AAAA,EAAA,CAC3E;AACF;;"}
|
|
@@ -5,10 +5,7 @@ const sortEntities = (entities, sortByField) => {
|
|
|
5
5
|
return entities.sort((a, b) => {
|
|
6
6
|
const aField = a.getRelativeSingleField(sortByField);
|
|
7
7
|
const bField = b.getRelativeSingleField(sortByField);
|
|
8
|
-
|
|
9
|
-
return aField.value - bField.value;
|
|
10
|
-
}
|
|
11
|
-
return 0;
|
|
8
|
+
return (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER);
|
|
12
9
|
});
|
|
13
10
|
};
|
|
14
11
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortEntities.js","sources":["../../../src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getRelativeSingleField<number>(sortByField)\n\t\tconst bField = b.getRelativeSingleField<number>(sortByField)\n\n\t\
|
|
1
|
+
{"version":3,"file":"sortEntities.js","sources":["../../../src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getRelativeSingleField<number>(sortByField)\n\t\tconst bField = b.getRelativeSingleField<number>(sortByField)\n\n\t\treturn (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER)\n\t})\n}\n"],"names":[],"mappings":"AAEa,MAAA,eAAe,CAC3B,UACA,gBACsB;AACtB,MAAI,CAAC,aAAa;AACV,WAAA;AAAA,EACR;AACA,SAAO,SAAS,KAAK,CAAC,GAAG,MAAM;AACxB,UAAA,SAAS,EAAE,uBAA+B,WAAW;AACrD,UAAA,SAAS,EAAE,uBAA+B,WAAW;AAE3D,YAAQ,OAAO,SAAS,OAAO,qBAAqB,OAAO,SAAS,OAAO;AAAA,EAAA,CAC3E;AACF;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const EnvironmentContext = require("../accessorPropagation/EnvironmentContext.cjs");
|
|
5
|
+
const Component = require("../coreComponents/Component.cjs");
|
|
6
|
+
const DimensionRenderer = Component.Component(({ dimension, as, children }, env) => {
|
|
7
|
+
const dimensions = env.getDimensionOrElse(dimension, []);
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dimensions.map((value) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
EnvironmentContext.EnvironmentMiddleware,
|
|
10
|
+
{
|
|
11
|
+
create: (it) => it.withVariables({ [as]: value }),
|
|
12
|
+
children
|
|
13
|
+
},
|
|
14
|
+
value
|
|
15
|
+
)) });
|
|
16
|
+
});
|
|
17
|
+
exports.DimensionRenderer = DimensionRenderer;
|
|
18
|
+
//# sourceMappingURL=DimensionRenderer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DimensionRenderer.cjs","sources":["../../../src/helperComponents/DimensionRenderer.tsx"],"sourcesContent":["import * as React from 'react'\nimport { ReactNode } from 'react'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\n\nexport type DimensionRendererProps = {\n\tdimension: string\n\tas: string\n\tchildren: ReactNode\n}\n\nexport const DimensionRenderer = Component<DimensionRendererProps>(({ dimension, as, children }, env) => {\n\tconst dimensions = env.getDimensionOrElse(dimension, [])\n\n\treturn <>\n\t\t{dimensions.map(value => (\n\t\t\t<EnvironmentMiddleware\n\t\t\t\tcreate={it => it.withVariables({ [as]: value })}\n\t\t\t\tkey={value}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</EnvironmentMiddleware>\n\t\t))}\n\t</>\n})\n"],"names":["Component","jsx","Fragment","EnvironmentMiddleware"],"mappings":";;;;;AAWa,MAAA,oBAAoBA,oBAAkC,CAAC,EAAE,WAAW,IAAI,YAAY,QAAQ;AACxG,QAAM,aAAa,IAAI,mBAAmB,WAAW,CAAE,CAAA;AAEhD,SAAAC,2BAAAA,IAAAC,WAAAA,UAAA,EACL,UAAW,WAAA,IAAI,CACf,UAAAD,2BAAA;AAAA,IAACE,mBAAA;AAAA,IAAA;AAAA,MACA,QAAQ,QAAM,GAAG,cAAc,EAAE,CAAC,EAAE,GAAG,OAAO;AAAA,MAG7C;AAAA,IAAA;AAAA,IAFI;AAAA,EAIN,CAAA,EACF,CAAA;AACD,CAAC;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { EnvironmentMiddleware } from "../accessorPropagation/EnvironmentContext.js";
|
|
3
|
+
import { Component } from "../coreComponents/Component.js";
|
|
4
|
+
const DimensionRenderer = Component(({ dimension, as, children }, env) => {
|
|
5
|
+
const dimensions = env.getDimensionOrElse(dimension, []);
|
|
6
|
+
return /* @__PURE__ */ jsx(Fragment, { children: dimensions.map((value) => /* @__PURE__ */ jsx(
|
|
7
|
+
EnvironmentMiddleware,
|
|
8
|
+
{
|
|
9
|
+
create: (it) => it.withVariables({ [as]: value }),
|
|
10
|
+
children
|
|
11
|
+
},
|
|
12
|
+
value
|
|
13
|
+
)) });
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
DimensionRenderer
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=DimensionRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DimensionRenderer.js","sources":["../../../src/helperComponents/DimensionRenderer.tsx"],"sourcesContent":["import * as React from 'react'\nimport { ReactNode } from 'react'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\n\nexport type DimensionRendererProps = {\n\tdimension: string\n\tas: string\n\tchildren: ReactNode\n}\n\nexport const DimensionRenderer = Component<DimensionRendererProps>(({ dimension, as, children }, env) => {\n\tconst dimensions = env.getDimensionOrElse(dimension, [])\n\n\treturn <>\n\t\t{dimensions.map(value => (\n\t\t\t<EnvironmentMiddleware\n\t\t\t\tcreate={it => it.withVariables({ [as]: value })}\n\t\t\t\tkey={value}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</EnvironmentMiddleware>\n\t\t))}\n\t</>\n})\n"],"names":[],"mappings":";;;AAWa,MAAA,oBAAoB,UAAkC,CAAC,EAAE,WAAW,IAAI,YAAY,QAAQ;AACxG,QAAM,aAAa,IAAI,mBAAmB,WAAW,CAAE,CAAA;AAEhD,SAAA,oBAAA,UAAA,EACL,UAAW,WAAA,IAAI,CACf,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,QAAQ,QAAM,GAAG,cAAc,EAAE,CAAC,EAAE,GAAG,OAAO;AAAA,MAG7C;AAAA,IAAA;AAAA,IAFI;AAAA,EAIN,CAAA,EACF,CAAA;AACD,CAAC;"}
|
|
@@ -10,16 +10,19 @@ const Component = require("../coreComponents/Component.cjs");
|
|
|
10
10
|
const useEntity = require("../accessorPropagation/useEntity.cjs");
|
|
11
11
|
const useEnvironment = require("../accessorPropagation/useEnvironment.cjs");
|
|
12
12
|
const If = Component.Component(
|
|
13
|
-
(props) => {
|
|
14
|
-
|
|
13
|
+
({ condition, ...props }) => {
|
|
14
|
+
if (props.children && props.then) {
|
|
15
|
+
throw new Error("If component cannot have both children and then prop");
|
|
16
|
+
}
|
|
17
|
+
return typeof condition !== "function" ? /* @__PURE__ */ jsxRuntime.jsx(IfFilter, { condition, ...props }) : /* @__PURE__ */ jsxRuntime.jsx(IfCallback, { condition, ...props });
|
|
15
18
|
},
|
|
16
19
|
"If"
|
|
17
20
|
);
|
|
18
21
|
const IfCallback = Component.Component(
|
|
19
|
-
({ children, condition }) => {
|
|
22
|
+
({ children, condition, then, else: elseIn }) => {
|
|
20
23
|
const entity = useEntity.useEntity();
|
|
21
24
|
const evaluated = react.useMemo(() => condition(entity), [condition, entity]);
|
|
22
|
-
return
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: evaluated ? children ?? then : elseIn });
|
|
23
26
|
},
|
|
24
27
|
({ children }) => {
|
|
25
28
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
@@ -27,7 +30,7 @@ const IfCallback = Component.Component(
|
|
|
27
30
|
"IfCallback"
|
|
28
31
|
);
|
|
29
32
|
const IfFilter = Component.Component(
|
|
30
|
-
({ children, condition }) => {
|
|
33
|
+
({ children, condition, then, else: elseIn }) => {
|
|
31
34
|
const env = useEnvironment.useEnvironment();
|
|
32
35
|
const entity = useEntity.useEntity();
|
|
33
36
|
const schema = env.getSchema();
|
|
@@ -35,7 +38,7 @@ const IfFilter = Component.Component(
|
|
|
35
38
|
() => new FilterEvaluator.FilterEvaluator(schema).evaluateFilter(entity, binding.QueryLanguage.desugarFilter(condition, env)),
|
|
36
39
|
[condition, entity, env, schema]
|
|
37
40
|
);
|
|
38
|
-
return
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: evaluated ? children ?? then : elseIn });
|
|
39
42
|
},
|
|
40
43
|
({ children, condition }, env) => {
|
|
41
44
|
const desugaredFilter = binding.QueryLanguage.desugarFilter(condition, env);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"If.cjs","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof
|
|
1
|
+
{"version":3,"file":"If.cjs","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\t\tif (props.children && props.then) {\n\t\t\tthrow new Error('If component cannot have both children and then prop')\n\t\t}\n\t\treturn typeof condition !== 'function'\n\t\t\t? <IfFilter condition={condition} {...props} />\n\t\t\t: <IfCallback condition={condition} {...props} />\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n"],"names":["Component","jsx","useEntity","useMemo","Fragment","useEnvironment","FilterEvaluator","QueryLanguage","FilterFieldsCollector","Field","jsxs"],"mappings":";;;;;;;;;;;AA+BO,MAAM,KAAKA,UAAA;AAAA,EAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AAC5D,QAAA,MAAM,YAAY,MAAM,MAAM;AAC3B,YAAA,IAAI,MAAM,sDAAsD;AAAA,IACvE;AACA,WAAO,OAAO,cAAc,aACzBC,2BAAA,IAAC,UAAS,EAAA,WAAuB,GAAG,MAAA,CAAO,IAC3CA,2BAAA,IAAC,YAAW,EAAA,WAAuB,GAAG,MAAO,CAAA;AAAA,EACjD;AAAA,EACA;AACD;AAEA,MAAM,aAAaD,UAAA;AAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAASE,UAAAA;AACT,UAAA,YAAYC,cAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAUF,2BAAA,IAAAG,WAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,OAAO,CAAA;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,SAAA,MAAe;AACjB,iEAAU,SAAS,CAAA;AAAA,EACpB;AAAA,EACA;AACD;AAEA,MAAM,WAAWJ,UAAA;AAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAMK,eAAAA;AACZ,UAAM,SAASH,UAAAA;AAET,UAAA,SAAS,IAAI;AACnB,UAAM,YAAYC,MAAA;AAAA,MACjB,MAAM,IAAIG,gBAAAA,gBAAgB,MAAM,EAAE,eAAe,QAAQC,QAAAA,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAEhC,WAAUN,2BAAA,IAAAG,WAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,OAAO,CAAA;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,aAAa,QAAQ;AACjC,UAAM,kBAAkBG,QAAA,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAIC,4CAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmBP,2BAAA,IAAAG,qBAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAM,OAAAH,2BAAAA,IAACQ,MAAAA,OAAM,EAAA,OAAO,MAAS,EAAI,CAAE,EAAE,CAAA;AAEjG,WACEC,2BAAA,KAAAN,qBAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,IACF,EAAA,CAAA;AAAA,EACD;AAAA,EACA;AACD;;"}
|
|
@@ -8,16 +8,19 @@ import { Component } from "../coreComponents/Component.js";
|
|
|
8
8
|
import { useEntity } from "../accessorPropagation/useEntity.js";
|
|
9
9
|
import { useEnvironment } from "../accessorPropagation/useEnvironment.js";
|
|
10
10
|
const If = Component(
|
|
11
|
-
(props) => {
|
|
12
|
-
|
|
11
|
+
({ condition, ...props }) => {
|
|
12
|
+
if (props.children && props.then) {
|
|
13
|
+
throw new Error("If component cannot have both children and then prop");
|
|
14
|
+
}
|
|
15
|
+
return typeof condition !== "function" ? /* @__PURE__ */ jsx(IfFilter, { condition, ...props }) : /* @__PURE__ */ jsx(IfCallback, { condition, ...props });
|
|
13
16
|
},
|
|
14
17
|
"If"
|
|
15
18
|
);
|
|
16
19
|
const IfCallback = Component(
|
|
17
|
-
({ children, condition }) => {
|
|
20
|
+
({ children, condition, then, else: elseIn }) => {
|
|
18
21
|
const entity = useEntity();
|
|
19
22
|
const evaluated = useMemo(() => condition(entity), [condition, entity]);
|
|
20
|
-
return
|
|
23
|
+
return /* @__PURE__ */ jsx(Fragment, { children: evaluated ? children ?? then : elseIn });
|
|
21
24
|
},
|
|
22
25
|
({ children }) => {
|
|
23
26
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
@@ -25,7 +28,7 @@ const IfCallback = Component(
|
|
|
25
28
|
"IfCallback"
|
|
26
29
|
);
|
|
27
30
|
const IfFilter = Component(
|
|
28
|
-
({ children, condition }) => {
|
|
31
|
+
({ children, condition, then, else: elseIn }) => {
|
|
29
32
|
const env = useEnvironment();
|
|
30
33
|
const entity = useEntity();
|
|
31
34
|
const schema = env.getSchema();
|
|
@@ -33,7 +36,7 @@ const IfFilter = Component(
|
|
|
33
36
|
() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),
|
|
34
37
|
[condition, entity, env, schema]
|
|
35
38
|
);
|
|
36
|
-
return
|
|
39
|
+
return /* @__PURE__ */ jsx(Fragment, { children: evaluated ? children ?? then : elseIn });
|
|
37
40
|
},
|
|
38
41
|
({ children, condition }, env) => {
|
|
39
42
|
const desugaredFilter = QueryLanguage.desugarFilter(condition, env);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"If.js","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof
|
|
1
|
+
{"version":3,"file":"If.js","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\t\tif (props.children && props.then) {\n\t\t\tthrow new Error('If component cannot have both children and then prop')\n\t\t}\n\t\treturn typeof condition !== 'function'\n\t\t\t? <IfFilter condition={condition} {...props} />\n\t\t\t: <IfCallback condition={condition} {...props} />\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n"],"names":[],"mappings":";;;;;;;;;AA+BO,MAAM,KAAK;AAAA,EAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AAC5D,QAAA,MAAM,YAAY,MAAM,MAAM;AAC3B,YAAA,IAAI,MAAM,sDAAsD;AAAA,IACvE;AACA,WAAO,OAAO,cAAc,aACzB,oBAAC,UAAS,EAAA,WAAuB,GAAG,MAAA,CAAO,IAC3C,oBAAC,YAAW,EAAA,WAAuB,GAAG,MAAO,CAAA;AAAA,EACjD;AAAA,EACA;AACD;AAEA,MAAM,aAAa;AAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAAS;AACT,UAAA,YAAY,QAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAU,oBAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,OAAO,CAAA;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,SAAA,MAAe;AACjB,2CAAU,SAAS,CAAA;AAAA,EACpB;AAAA,EACA;AACD;AAEA,MAAM,WAAW;AAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAM;AACZ,UAAM,SAAS;AAET,UAAA,SAAS,IAAI;AACnB,UAAM,YAAY;AAAA,MACjB,MAAM,IAAI,gBAAgB,MAAM,EAAE,eAAe,QAAQ,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAEhC,WAAU,oBAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,OAAO,CAAA;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,aAAa,QAAQ;AACjC,UAAM,kBAAkB,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAI,sBAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmB,oBAAA,UAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAM,OAAA,oBAAC,OAAM,EAAA,OAAO,MAAS,EAAI,CAAE,EAAE,CAAA;AAEjG,WACE,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,IACF,EAAA,CAAA;AAAA,EACD;AAAA,EACA;AACD;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const useEnvironment = require("../accessorPropagation/useEnvironment.cjs");
|
|
6
|
+
const Variable = react.memo(({ name, format }) => {
|
|
7
|
+
const environment = useEnvironment.useEnvironment();
|
|
8
|
+
const value = environment.getVariableOrElse(name, void 0) ?? environment.getParameter(name);
|
|
9
|
+
const formatted = react.useMemo(() => format ? format(value) : value, [format, value]);
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: formatted });
|
|
11
|
+
});
|
|
12
|
+
Variable.displayName = "Variable";
|
|
13
|
+
exports.Variable = Variable;
|
|
14
|
+
//# sourceMappingURL=Variable.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variable.cjs","sources":["../../../src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":["memo","useEnvironment","useMemo"],"mappings":";;;;;AASO,MAAM,WAAWA,MAAAA,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAcC,eAAAA;AACd,QAAA,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEjI,QAAA,YAAYC,MAAAA,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,+DAAU,UAAU,UAAA,CAAA;AACrB,CAAC;AACD,SAAS,cAAc;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { useEnvironment } from "../accessorPropagation/useEnvironment.js";
|
|
4
|
+
const Variable = memo(({ name, format }) => {
|
|
5
|
+
const environment = useEnvironment();
|
|
6
|
+
const value = environment.getVariableOrElse(name, void 0) ?? environment.getParameter(name);
|
|
7
|
+
const formatted = useMemo(() => format ? format(value) : value, [format, value]);
|
|
8
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatted });
|
|
9
|
+
});
|
|
10
|
+
Variable.displayName = "Variable";
|
|
11
|
+
export {
|
|
12
|
+
Variable
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variable.js","sources":["../../../src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":[],"mappings":";;;AASO,MAAM,WAAW,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAc;AACd,QAAA,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEjI,QAAA,YAAY,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,yCAAU,UAAU,UAAA,CAAA;AACrB,CAAC;AACD,SAAS,cAAc;"}
|
|
@@ -26,6 +26,7 @@ const useHasEntity = require("./accessorPropagation/useHasEntity.cjs");
|
|
|
26
26
|
const useEntityList = require("./accessorPropagation/useEntityList.cjs");
|
|
27
27
|
const useEntityListSubTree = require("./accessorPropagation/useEntityListSubTree.cjs");
|
|
28
28
|
const useEntityListSubTreeParameters = require("./accessorPropagation/useEntityListSubTreeParameters.cjs");
|
|
29
|
+
const useEntityListSubTreeLoader = require("./accessorPropagation/useEntityListSubTreeLoader.cjs");
|
|
29
30
|
const useEntitySubTree = require("./accessorPropagation/useEntitySubTree.cjs");
|
|
30
31
|
const useEntitySubTreeParameters = require("./accessorPropagation/useEntitySubTreeParameters.cjs");
|
|
31
32
|
const useEnvironment = require("./accessorPropagation/useEnvironment.cjs");
|
|
@@ -61,12 +62,14 @@ const useEntityPersistError = require("./entityEvents/useEntityPersistError.cjs"
|
|
|
61
62
|
const useEntityPersistSuccess = require("./entityEvents/useEntityPersistSuccess.cjs");
|
|
62
63
|
const useOnConnectionUpdate = require("./entityEvents/useOnConnectionUpdate.cjs");
|
|
63
64
|
const DeferredSubTrees = require("./helperComponents/DeferredSubTrees.cjs");
|
|
65
|
+
const DimensionRenderer = require("./helperComponents/DimensionRenderer.cjs");
|
|
64
66
|
const EntityView = require("./helperComponents/EntityView.cjs");
|
|
65
67
|
const If = require("./helperComponents/If.cjs");
|
|
66
68
|
const FieldView = require("./helperComponents/FieldView.cjs");
|
|
67
69
|
const LabelMiddleware = require("./helperComponents/LabelMiddleware.cjs");
|
|
68
70
|
const StaticRender = require("./helperComponents/StaticRender.cjs");
|
|
69
71
|
const SugaredField = require("./helperComponents/SugaredField.cjs");
|
|
72
|
+
const Variable = require("./helperComponents/Variable.cjs");
|
|
70
73
|
exports.MarkerTreeGenerator = MarkerTreeGenerator.MarkerTreeGenerator;
|
|
71
74
|
exports.AccessorTree = AccessorTree.AccessorTree;
|
|
72
75
|
exports.accessorTreeStateReducer = accessorTreeStateReducer.accessorTreeStateReducer;
|
|
@@ -94,6 +97,7 @@ exports.useHasEntity = useHasEntity.useHasEntity;
|
|
|
94
97
|
exports.useEntityList = useEntityList.useEntityList;
|
|
95
98
|
exports.useEntityListSubTree = useEntityListSubTree.useEntityListSubTree;
|
|
96
99
|
exports.useEntityListSubTreeParameters = useEntityListSubTreeParameters.useEntityListSubTreeParameters;
|
|
100
|
+
exports.useEntityListSubTreeLoader = useEntityListSubTreeLoader.useEntityListSubTreeLoader;
|
|
97
101
|
exports.useEntitySubTree = useEntitySubTree.useEntitySubTree;
|
|
98
102
|
exports.useEntitySubTreeParameters = useEntitySubTreeParameters.useEntitySubTreeParameters;
|
|
99
103
|
exports.useEnvironment = useEnvironment.useEnvironment;
|
|
@@ -130,6 +134,7 @@ exports.useEntityPersistError = useEntityPersistError.useEntityPersistError;
|
|
|
130
134
|
exports.useEntityPersistSuccess = useEntityPersistSuccess.useEntityPersistSuccess;
|
|
131
135
|
exports.useOnConnectionUpdate = useOnConnectionUpdate.useOnConnectionUpdate;
|
|
132
136
|
exports.DeferredSubTrees = DeferredSubTrees.DeferredSubTrees;
|
|
137
|
+
exports.DimensionRenderer = DimensionRenderer.DimensionRenderer;
|
|
133
138
|
exports.EntityView = EntityView.EntityView;
|
|
134
139
|
exports.If = If.If;
|
|
135
140
|
exports.FieldView = FieldView.FieldView;
|
|
@@ -138,6 +143,7 @@ exports.LabelMiddlewareProvider = LabelMiddleware.LabelMiddlewareProvider;
|
|
|
138
143
|
exports.useLabelMiddleware = LabelMiddleware.useLabelMiddleware;
|
|
139
144
|
exports.StaticRender = StaticRender.StaticRender;
|
|
140
145
|
exports.SugaredField = SugaredField.SugaredField;
|
|
146
|
+
exports.Variable = Variable.Variable;
|
|
141
147
|
Object.keys(binding).forEach((k) => {
|
|
142
148
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
143
149
|
Object.defineProperty(exports, k, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/production/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { useHasEntity } from "./accessorPropagation/useHasEntity.js";
|
|
|
24
24
|
import { useEntityList } from "./accessorPropagation/useEntityList.js";
|
|
25
25
|
import { useEntityListSubTree } from "./accessorPropagation/useEntityListSubTree.js";
|
|
26
26
|
import { useEntityListSubTreeParameters } from "./accessorPropagation/useEntityListSubTreeParameters.js";
|
|
27
|
+
import { useEntityListSubTreeLoader } from "./accessorPropagation/useEntityListSubTreeLoader.js";
|
|
27
28
|
import { useEntitySubTree } from "./accessorPropagation/useEntitySubTree.js";
|
|
28
29
|
import { useEntitySubTreeParameters } from "./accessorPropagation/useEntitySubTreeParameters.js";
|
|
29
30
|
import { useEnvironment } from "./accessorPropagation/useEnvironment.js";
|
|
@@ -59,12 +60,14 @@ import { useEntityPersistError } from "./entityEvents/useEntityPersistError.js";
|
|
|
59
60
|
import { useEntityPersistSuccess } from "./entityEvents/useEntityPersistSuccess.js";
|
|
60
61
|
import { useOnConnectionUpdate } from "./entityEvents/useOnConnectionUpdate.js";
|
|
61
62
|
import { DeferredSubTrees } from "./helperComponents/DeferredSubTrees.js";
|
|
63
|
+
import { DimensionRenderer } from "./helperComponents/DimensionRenderer.js";
|
|
62
64
|
import { EntityView } from "./helperComponents/EntityView.js";
|
|
63
65
|
import { If } from "./helperComponents/If.js";
|
|
64
66
|
import { FieldView } from "./helperComponents/FieldView.js";
|
|
65
67
|
import { LabelMiddlewareContext, LabelMiddlewareProvider, useLabelMiddleware } from "./helperComponents/LabelMiddleware.js";
|
|
66
68
|
import { StaticRender } from "./helperComponents/StaticRender.js";
|
|
67
69
|
import { SugaredField } from "./helperComponents/SugaredField.js";
|
|
70
|
+
import { Variable } from "./helperComponents/Variable.js";
|
|
68
71
|
export {
|
|
69
72
|
AccessorProvider,
|
|
70
73
|
AccessorTree,
|
|
@@ -72,6 +75,7 @@ export {
|
|
|
72
75
|
Component,
|
|
73
76
|
DataBindingProvider,
|
|
74
77
|
DeferredSubTrees,
|
|
78
|
+
DimensionRenderer,
|
|
75
79
|
DirtinessContext,
|
|
76
80
|
Entity,
|
|
77
81
|
EntityKeyProvider,
|
|
@@ -96,6 +100,7 @@ export {
|
|
|
96
100
|
StaticRender,
|
|
97
101
|
SugaredField,
|
|
98
102
|
TreeRootIdProvider,
|
|
103
|
+
Variable,
|
|
99
104
|
accessorTreeStateReducer,
|
|
100
105
|
addEntityAtIndex,
|
|
101
106
|
moveEntity,
|
|
@@ -118,6 +123,7 @@ export {
|
|
|
118
123
|
useEntityKey,
|
|
119
124
|
useEntityList,
|
|
120
125
|
useEntityListSubTree,
|
|
126
|
+
useEntityListSubTreeLoader,
|
|
121
127
|
useEntityListSubTreeParameters,
|
|
122
128
|
useEntityPersistError,
|
|
123
129
|
useEntityPersistSuccess,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Environment } from '@contember/binding';
|
|
3
|
-
export declare const EnvironmentContext: import("react").Context<Environment
|
|
3
|
+
export declare const EnvironmentContext: import("react").Context<Environment<Environment.AnyNode | undefined>>;
|
|
4
4
|
export interface EnvironmentMiddlewareProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
create: (env: Environment) => Environment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAe,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAe,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,eAAO,MAAM,kBAAkB,uEAAmD,CAAA;AAGlF,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,WAAW,CAAA;CACzC;AAED,eAAO,MAAM,qBAAqB,kEAajC,CAAA;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC,EAAE,CAAC;IAClD,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,KAAK,EAAE,CAAC,CAAA;CACR;AAED,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAShG,CAAA"}
|
|
@@ -14,6 +14,7 @@ export * from './useHasEntity';
|
|
|
14
14
|
export * from './useEntityList';
|
|
15
15
|
export * from './useEntityListSubTree';
|
|
16
16
|
export * from './useEntityListSubTreeParameters';
|
|
17
|
+
export * from './useEntityListSubTreeLoader';
|
|
17
18
|
export * from './useEntitySubTree';
|
|
18
19
|
export * from './useEntitySubTreeParameters';
|
|
19
20
|
export * from './useEnvironment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding';
|
|
3
|
+
export type UseEntityListSubTreeLoaderResult<State> = {
|
|
4
|
+
entities: SugaredQualifiedEntityList | undefined;
|
|
5
|
+
treeRootId: TreeRootId | undefined;
|
|
6
|
+
state: State | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type EntityListSubTreeLoaderState = 'initial' | 'refreshing' | 'loaded';
|
|
9
|
+
export declare const useEntityListSubTreeLoader: <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State) => [UseEntityListSubTreeLoaderResult<State>, EntityListSubTreeLoaderState];
|
|
10
|
+
//# sourceMappingURL=useEntityListSubTreeLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntityListSubTreeLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAA+B,MAAM,OAAO,CAAA;AAC7E,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI3E,MAAM,MAAM,gCAAgC,CAAC,KAAK,IAAI;IACrD,QAAQ,EAAE,0BAA0B,GAAG,SAAS,CAAA;IAChD,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,4BAA4B,GACrC,SAAS,GACT,YAAY,GACZ,QAAQ,CAAA;AAEX,eAAO,MAAM,0BAA0B,oBAAqB,0BAA0B,GAAG,SAAS,YAAY,SAAS,UAAU,KAAK,KAAG,CAAC,iCAAiC,KAAK,CAAC,EAAE,4BAA4B,CAoD9M,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntityListAccessor } from '@contember/binding';
|
|
2
2
|
import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding';
|
|
3
|
-
export declare const useGetEntityListSubTree: () => (parametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [
|
|
4
|
-
]) => EntityListAccessor;
|
|
3
|
+
export declare const useGetEntityListSubTree: () => ((parametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [
|
|
4
|
+
]) => EntityListAccessor);
|
|
5
5
|
//# sourceMappingURL=useGetEntityListSubTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useGetEntityListSubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EACX,KAAK,EACL,0BAA0B,EAC1B,uCAAuC,EACvC,UAAU,EACV,MAAM,oBAAoB,CAAA;AAK3B,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"useGetEntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useGetEntityListSubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EACX,KAAK,EACL,0BAA0B,EAC1B,uCAAuC,EACvC,UAAU,EACV,MAAM,oBAAoB,CAAA;AAK3B,eAAO,MAAM,uBAAuB,QAAO,CAAC,CAC3C,iBAAiB,EAAE,KAAK,GAAG,0BAA0B,GAAG,uCAAuC,EAC/F,GAAG,MAAM,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG;CAAE,KACpC,kBAAkB,CAYtB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntityAccessor } from '@contember/binding';
|
|
2
2
|
import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding';
|
|
3
|
-
export declare const useGetEntitySubTree: () => (parametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [
|
|
4
|
-
]) => EntityAccessor;
|
|
3
|
+
export declare const useGetEntitySubTree: () => ((parametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [
|
|
4
|
+
]) => EntityAccessor);
|
|
5
5
|
//# sourceMappingURL=useGetEntitySubTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntitySubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useGetEntitySubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EACX,KAAK,EACL,4BAA4B,EAC5B,yCAAyC,EACzC,UAAU,EACV,MAAM,oBAAoB,CAAA;AAK3B,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useGetEntitySubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useGetEntitySubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EACX,KAAK,EACL,4BAA4B,EAC5B,yCAAyC,EACzC,UAAU,EACV,MAAM,oBAAoB,CAAA;AAK3B,eAAO,MAAM,mBAAmB,QAAO,CAAC,CACvC,iBAAiB,EAAE,KAAK,GAAG,4BAA4B,GAAG,yCAAyC,EACnG,GAAG,MAAM,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG;CAAE,KACpC,cAAc,CAYlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortEntities.d.ts","sourceRoot":"","sources":["../../../src/accessorSorting/sortEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExE,eAAO,MAAM,YAAY,aACd,cAAc,EAAE,eACb,mBAAmB,GAAG,SAAS,KAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"sortEntities.d.ts","sourceRoot":"","sources":["../../../src/accessorSorting/sortEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExE,eAAO,MAAM,YAAY,aACd,cAAc,EAAE,eACb,mBAAmB,GAAG,SAAS,KAC1C,cAAc,EAUhB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataBindingProvider.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,EAAgB,iBAAiB,EAAE,wBAAwB,EAAkB,MAAM,iBAAiB,CAAA;AAE3G,MAAM,MAAM,iCAAiC,CAAC,UAAU,IAAI,CACzD;IACD,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC;CACnB,GACC;IACD,cAAc,EAAE,aAAa,CAAC,UAAU,GAAG,8BAA8B,CAAC,CAAA;IAC1E,UAAU,CAAC,EAAE,UAAU,CAAA;CACvB,CACD,CAAA;AAED,MAAM,MAAM,4BAA4B,GACrC,wBAAwB,CAAA;AAE3B,MAAM,WAAW,8BAA8B;IAC9C,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,MAAM,wBAAwB,CAAC,UAAU,IAC5C,4BAA4B,GAC5B,iCAAiC,CAAC,UAAU,CAAC,CAAA;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"DataBindingProvider.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,EAAgB,iBAAiB,EAAE,wBAAwB,EAAkB,MAAM,iBAAiB,CAAA;AAE3G,MAAM,MAAM,iCAAiC,CAAC,UAAU,IAAI,CACzD;IACD,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC;CACnB,GACC;IACD,cAAc,EAAE,aAAa,CAAC,UAAU,GAAG,8BAA8B,CAAC,CAAA;IAC1E,UAAU,CAAC,EAAE,UAAU,CAAA;CACvB,CACD,CAAA;AAED,MAAM,MAAM,4BAA4B,GACrC,wBAAwB,CAAA;AAE3B,MAAM,WAAW,8BAA8B;IAC9C,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,MAAM,wBAAwB,CAAC,UAAU,IAC5C,4BAA4B,GAC5B,iCAAiC,CAAC,UAAU,CAAC,CAAA;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,sBAiBN,yBAAyB,UAAU,CAAC,KAAK,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/EntityList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAI5D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,MAAM,eAAe,CAAC,SAAS,IAAI,mBAAmB,GAC3D,CACG,EAAE,GACF;IACA,aAAa,EAAE,aAAa,CAAC,SAAS,GAAG,mBAAmB,CAAC,CAAA;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAA;CACpB,CACH,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/EntityList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAI5D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,MAAM,eAAe,CAAC,SAAS,IAAI,mBAAmB,GAC3D,CACG,EAAE,GACF;IACA,aAAa,EAAE,aAAa,CAAC,SAAS,GAAG,mBAAmB,CAAC,CAAA;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAA;CACpB,CACH,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,qBAgCC,gBAAgB,SAAS,CAAC,KAAK,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAO3E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,uCAAuC,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEzH,OAAO,EAAc,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAI9D,MAAM,WAAW,gCAAgC;IAChD,SAAS,CAAC,EAAE,WAAW,CAAC,oBAAoB,CAAA;CAC5C;AAED,MAAM,MAAM,sBAAsB,CAAC,SAAS,EAAE,WAAW,IAAI;IAC5D,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB,GAAG,gCAAgC,GACnC,CAAC,0BAA0B,GAAG,uCAAuC,CAAC,GACtE,CACG,EAAE,GACF;IACA,aAAa,EAAE,aAAa,CAAC,SAAS,GAAG,mBAAmB,CAAC,CAAA;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAA;CACpB,CACH,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"EntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAO3E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,uCAAuC,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEzH,OAAO,EAAc,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAI9D,MAAM,WAAW,gCAAgC;IAChD,SAAS,CAAC,EAAE,WAAW,CAAC,oBAAoB,CAAA;CAC5C;AAED,MAAM,MAAM,sBAAsB,CAAC,SAAS,EAAE,WAAW,IAAI;IAC5D,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACpB,GAAG,gCAAgC,GACnC,CAAC,0BAA0B,GAAG,uCAAuC,CAAC,GACtE,CACG,EAAE,GACF;IACA,aAAa,EAAE,aAAa,CAAC,SAAS,GAAG,mBAAmB,CAAC,CAAA;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAA;CACpB,CACH,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,kCAuCO,uBAAuB,SAAS,EAAE,WAAW,CAAC,KAAK,YAAY,CAAA"}
|