@j2inn/resolvable-ui-elements 1.1.1 → 1.1.2-beta.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/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/resolvableElements/elements/section/resolveUtils.d.ts +12 -0
- package/dist/resolvableElements/elements/section/resolveUtils.js +40 -0
- package/dist/resolvableElements/elements/section/resolveUtils.js.map +1 -0
- package/dist/resolvableElements/react/useResolveSection.js +2 -8
- package/dist/resolvableElements/react/useResolveSection.js.map +1 -1
- package/dist_es/index.d.ts +2 -0
- package/dist_es/index.js +2 -0
- package/dist_es/index.js.map +1 -1
- package/dist_es/resolvableElements/elements/section/resolveUtils.d.ts +12 -0
- package/dist_es/resolvableElements/elements/section/resolveUtils.js +35 -0
- package/dist_es/resolvableElements/elements/section/resolveUtils.js.map +1 -0
- package/dist_es/resolvableElements/react/useResolveSection.js +1 -7
- package/dist_es/resolvableElements/react/useResolveSection.js.map +1 -1
- package/package.json +52 -52
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
1
2
|
export * from './resolvableElements/Resolver';
|
|
2
3
|
export { type ResolvableValueElementMeta } from './resolvableElements/elements/ResolvableValueElement';
|
|
3
4
|
export { type UiElementData } from './resolvableElements/elements/UiElement';
|
|
4
5
|
export { type ResolvableExprElementMeta } from './resolvableElements/elements/expr/ResolvableExprElementMeta';
|
|
5
6
|
export { type FunctionResult } from './resolvableElements/elements/function/FunctionElement';
|
|
6
7
|
export { isSectionData, type ParametersOfSection, type ResolvedSection, } from './resolvableElements/elements/section/SectionElementMeta';
|
|
8
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
7
9
|
export { resolveTemplateExpression } from './resolvableElements/resolveTemplatedExpression';
|
|
8
10
|
export * from './resolvableElements/react/SectionChecker';
|
|
9
11
|
export * from './resolvableElements/react/useResolveSection';
|
package/dist/index.js
CHANGED
|
@@ -21,9 +21,11 @@ exports.resolveTemplateExpression = exports.isSectionData = void 0;
|
|
|
21
21
|
//////////////////////////////////////////////////////////////////////////
|
|
22
22
|
// Elements
|
|
23
23
|
//////////////////////////////////////////////////////////////////////////
|
|
24
|
+
__exportStar(require("./resolvableElements/elements/section/resolveUtils"), exports);
|
|
24
25
|
__exportStar(require("./resolvableElements/Resolver"), exports);
|
|
25
26
|
var SectionElementMeta_1 = require("./resolvableElements/elements/section/SectionElementMeta");
|
|
26
27
|
Object.defineProperty(exports, "isSectionData", { enumerable: true, get: function () { return SectionElementMeta_1.isSectionData; } });
|
|
28
|
+
__exportStar(require("./resolvableElements/elements/section/resolveUtils"), exports);
|
|
27
29
|
var resolveTemplatedExpression_1 = require("./resolvableElements/resolveTemplatedExpression");
|
|
28
30
|
Object.defineProperty(exports, "resolveTemplateExpression", { enumerable: true, get: function () { return resolveTemplatedExpression_1.resolveTemplateExpression; } });
|
|
29
31
|
//////////////////////////////////////////////////////////////////////////
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,0EAA0E;AAC1E,WAAW;AACX,0EAA0E;AAC1E,gEAA6C;AAK7C,+FAIiE;AAHhE,mHAAA,aAAa,OAAA;AAId,8FAA2F;AAAlF,uIAAA,yBAAyB,OAAA;AAClC,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,4EAAyD;AACzD,+EAA4D;AAC5D,gFAA6D;AAC7D,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,mDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,0EAA0E;AAC1E,WAAW;AACX,0EAA0E;AAC1E,qFAAkE;AAClE,gEAA6C;AAK7C,+FAIiE;AAHhE,mHAAA,aAAa,OAAA;AAId,qFAAkE;AAClE,8FAA2F;AAAlF,uIAAA,yBAAyB,OAAA;AAClC,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,4EAAyD;AACzD,+EAA4D;AAC5D,gFAA6D;AAC7D,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,mDAAgC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Resolver } from 'resolvableElements/Resolver';
|
|
2
|
+
import { UiElementData } from '../UiElement';
|
|
3
|
+
import { ParametersOfSection, ResolvedSection } from './SectionElementMeta';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a section UI element.
|
|
6
|
+
* @param resolver the Resolver context
|
|
7
|
+
* @param sectionData section data object
|
|
8
|
+
* @param parameters parameters for the resolution
|
|
9
|
+
* @returns the resolved result of the section.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveSection<T extends UiElementData>(resolver: Resolver, sectionData: T, parameters?: ParametersOfSection<T>): Promise<ResolvedSection<T>>;
|
|
12
|
+
export declare const areParametersValid: <T extends UiElementData<import("../UiElement").UiElementMeta>>(parameters: ParametersOfSection<T>) => boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024, J2 Innovations. All Rights Reserved
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.areParametersValid = exports.resolveSection = void 0;
|
|
7
|
+
const FunctionElement_1 = require("../function/FunctionElement");
|
|
8
|
+
const ResolvableSectionElement_1 = require("./ResolvableSectionElement");
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a section UI element.
|
|
11
|
+
* @param resolver the Resolver context
|
|
12
|
+
* @param sectionData section data object
|
|
13
|
+
* @param parameters parameters for the resolution
|
|
14
|
+
* @returns the resolved result of the section.
|
|
15
|
+
*/
|
|
16
|
+
async function resolveSection(resolver, sectionData, parameters) {
|
|
17
|
+
const parametersDict = (0, FunctionElement_1.makeParametersDict)(parameters);
|
|
18
|
+
if ((0, exports.areParametersValid)(parameters)) {
|
|
19
|
+
const sectionElement = new ResolvableSectionElement_1.ResolvableSectionElement({
|
|
20
|
+
element: sectionData,
|
|
21
|
+
resolver,
|
|
22
|
+
onUpdate: (value) => console.log(value),
|
|
23
|
+
});
|
|
24
|
+
await sectionElement
|
|
25
|
+
.initialize(parametersDict)
|
|
26
|
+
.finally(() => sectionElement?.close());
|
|
27
|
+
return sectionElement.value;
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Parameters invalid for section ${sectionData}: ${parametersDict.toJSON()}`);
|
|
30
|
+
}
|
|
31
|
+
exports.resolveSection = resolveSection;
|
|
32
|
+
const areParametersValid = (parameters) => {
|
|
33
|
+
if (parameters &&
|
|
34
|
+
Object.entries(parameters).some(([, value]) => value == null)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
};
|
|
39
|
+
exports.areParametersValid = areParametersValid;
|
|
40
|
+
//# sourceMappingURL=resolveUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveUtils.js","sourceRoot":"","sources":["../../../../src/resolvableElements/elements/section/resolveUtils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,iEAAgE;AAChE,yEAAqE;AAGrE;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CACnC,QAAkB,EAClB,WAAc,EACd,UAAmC;IAEnC,MAAM,cAAc,GAAG,IAAA,oCAAkB,EAAC,UAAU,CAAC,CAAA;IACrD,IAAI,IAAA,0BAAkB,EAAC,UAAU,CAAC,EAAE;QACnC,MAAM,cAAc,GAAG,IAAI,mDAAwB,CAAC;YACnD,OAAO,EAAE,WAAW;YACpB,QAAQ;YACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;SACvC,CAAC,CAAA;QAEF,MAAM,cAAc;aAClB,UAAU,CAAC,cAAc,CAAC;aAC1B,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,CAAA;QAExC,OAAO,cAAc,CAAC,KAA2B,CAAA;KACjD;IAED,MAAM,IAAI,KAAK,CACd,kCAAkC,WAAW,KAAK,cAAc,CAAC,MAAM,EAAE,EAAE,CAC3E,CAAA;AACF,CAAC;AAvBD,wCAuBC;AAEM,MAAM,kBAAkB,GAAG,CACjC,UAAkC,EACjC,EAAE;IACH,IACC,UAAU;QACV,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,EAC5D;QACD,OAAO,KAAK,CAAA;KACZ;IACD,OAAO,IAAI,CAAA;AACZ,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useResolveSection = void 0;
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
+
const resolveUtils_1 = require("resolvableElements/elements/section/resolveUtils");
|
|
8
9
|
const FunctionElement_1 = require("../elements/function/FunctionElement");
|
|
9
10
|
const ResolvableSectionElement_1 = require("../elements/section/ResolvableSectionElement");
|
|
10
11
|
const useResolverContext_1 = require("./useResolverContext");
|
|
@@ -31,7 +32,7 @@ function useResolveSection(sectionData, parameters) {
|
|
|
31
32
|
}
|
|
32
33
|
const parametersDict = (0, FunctionElement_1.makeParametersDict)(parameters);
|
|
33
34
|
(0, react_1.useEffect)(() => {
|
|
34
|
-
if (areParametersValid(parameters)) {
|
|
35
|
+
if ((0, resolveUtils_1.areParametersValid)(parameters)) {
|
|
35
36
|
ref.current = new ResolvableSectionElement_1.ResolvableSectionElement({
|
|
36
37
|
element: sectionData,
|
|
37
38
|
resolver,
|
|
@@ -62,11 +63,4 @@ function useResolveSection(sectionData, parameters) {
|
|
|
62
63
|
];
|
|
63
64
|
}
|
|
64
65
|
exports.useResolveSection = useResolveSection;
|
|
65
|
-
const areParametersValid = (parameters) => {
|
|
66
|
-
if (parameters &&
|
|
67
|
-
Object.entries(parameters).some(([, value]) => value == null)) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
};
|
|
72
66
|
//# sourceMappingURL=useResolveSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResolveSection.js","sourceRoot":"","sources":["../../../src/resolvableElements/react/useResolveSection.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAA+D;
|
|
1
|
+
{"version":3,"file":"useResolveSection.js","sourceRoot":"","sources":["../../../src/resolvableElements/react/useResolveSection.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAA+D;AAC/D,mFAAqF;AAErF,0EAAyE;AACzE,2FAAuF;AAKvF,6DAAyD;AAEzD;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAChC,WAAc,EACd,UAAmC;IAEnC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9D,MAAM,QAAQ,GAAG,IAAA,uCAAkB,GAAE,CAAA;IACrC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,IAAA,kBAAU,EAAC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACxE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IACrC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;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ACpB,KAAK;YACL,SAAS;SACT;KACD,CAAA;AACF,CAAC;AAtDD,8CAsDC"}
|
package/dist_es/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
1
2
|
export * from './resolvableElements/Resolver';
|
|
2
3
|
export { type ResolvableValueElementMeta } from './resolvableElements/elements/ResolvableValueElement';
|
|
3
4
|
export { type UiElementData } from './resolvableElements/elements/UiElement';
|
|
4
5
|
export { type ResolvableExprElementMeta } from './resolvableElements/elements/expr/ResolvableExprElementMeta';
|
|
5
6
|
export { type FunctionResult } from './resolvableElements/elements/function/FunctionElement';
|
|
6
7
|
export { isSectionData, type ParametersOfSection, type ResolvedSection, } from './resolvableElements/elements/section/SectionElementMeta';
|
|
8
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
7
9
|
export { resolveTemplateExpression } from './resolvableElements/resolveTemplatedExpression';
|
|
8
10
|
export * from './resolvableElements/react/SectionChecker';
|
|
9
11
|
export * from './resolvableElements/react/useResolveSection';
|
package/dist_es/index.js
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
//////////////////////////////////////////////////////////////////////////
|
|
5
5
|
// Elements
|
|
6
6
|
//////////////////////////////////////////////////////////////////////////
|
|
7
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
7
8
|
export * from './resolvableElements/Resolver';
|
|
8
9
|
export { isSectionData, } from './resolvableElements/elements/section/SectionElementMeta';
|
|
10
|
+
export * from './resolvableElements/elements/section/resolveUtils';
|
|
9
11
|
export { resolveTemplateExpression } from './resolvableElements/resolveTemplatedExpression';
|
|
10
12
|
//////////////////////////////////////////////////////////////////////////
|
|
11
13
|
// React
|
package/dist_es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAC1E,WAAW;AACX,0EAA0E;AAC1E,cAAc,+BAA+B,CAAA;AAK7C,OAAO,EACN,aAAa,GAGb,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,cAAc,2CAA2C,CAAA;AACzD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+CAA+C,CAAA;AAC7D,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAC1E,WAAW;AACX,0EAA0E;AAC1E,cAAc,oDAAoD,CAAA;AAClE,cAAc,+BAA+B,CAAA;AAK7C,OAAO,EACN,aAAa,GAGb,MAAM,0DAA0D,CAAA;AACjE,cAAc,oDAAoD,CAAA;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,cAAc,2CAA2C,CAAA;AACzD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+CAA+C,CAAA;AAC7D,0EAA0E;AAC1E,QAAQ;AACR,0EAA0E;AAC1E,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Resolver } from 'resolvableElements/Resolver';
|
|
2
|
+
import { UiElementData } from '../UiElement';
|
|
3
|
+
import { ParametersOfSection, ResolvedSection } from './SectionElementMeta';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a section UI element.
|
|
6
|
+
* @param resolver the Resolver context
|
|
7
|
+
* @param sectionData section data object
|
|
8
|
+
* @param parameters parameters for the resolution
|
|
9
|
+
* @returns the resolved result of the section.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveSection<T extends UiElementData>(resolver: Resolver, sectionData: T, parameters?: ParametersOfSection<T>): Promise<ResolvedSection<T>>;
|
|
12
|
+
export declare const areParametersValid: <T extends UiElementData<import("../UiElement").UiElementMeta>>(parameters: ParametersOfSection<T>) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, J2 Innovations. All Rights Reserved
|
|
3
|
+
*/
|
|
4
|
+
import { makeParametersDict } from '../function/FunctionElement';
|
|
5
|
+
import { ResolvableSectionElement } from './ResolvableSectionElement';
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a section UI element.
|
|
8
|
+
* @param resolver the Resolver context
|
|
9
|
+
* @param sectionData section data object
|
|
10
|
+
* @param parameters parameters for the resolution
|
|
11
|
+
* @returns the resolved result of the section.
|
|
12
|
+
*/
|
|
13
|
+
export async function resolveSection(resolver, sectionData, parameters) {
|
|
14
|
+
const parametersDict = makeParametersDict(parameters);
|
|
15
|
+
if (areParametersValid(parameters)) {
|
|
16
|
+
const sectionElement = new ResolvableSectionElement({
|
|
17
|
+
element: sectionData,
|
|
18
|
+
resolver,
|
|
19
|
+
onUpdate: (value) => console.log(value),
|
|
20
|
+
});
|
|
21
|
+
await sectionElement
|
|
22
|
+
.initialize(parametersDict)
|
|
23
|
+
.finally(() => sectionElement?.close());
|
|
24
|
+
return sectionElement.value;
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`Parameters invalid for section ${sectionData}: ${parametersDict.toJSON()}`);
|
|
27
|
+
}
|
|
28
|
+
export const areParametersValid = (parameters) => {
|
|
29
|
+
if (parameters &&
|
|
30
|
+
Object.entries(parameters).some(([, value]) => value == null)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=resolveUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveUtils.js","sourceRoot":"","sources":["../../../../src/resolvableElements/elements/section/resolveUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAGrE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,QAAkB,EAClB,WAAc,EACd,UAAmC;IAEnC,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;IACrD,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE;QACnC,MAAM,cAAc,GAAG,IAAI,wBAAwB,CAAC;YACnD,OAAO,EAAE,WAAW;YACpB,QAAQ;YACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;SACvC,CAAC,CAAA;QAEF,MAAM,cAAc;aAClB,UAAU,CAAC,cAAc,CAAC;aAC1B,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,CAAA;QAExC,OAAO,cAAc,CAAC,KAA2B,CAAA;KACjD;IAED,MAAM,IAAI,KAAK,CACd,kCAAkC,WAAW,KAAK,cAAc,CAAC,MAAM,EAAE,EAAE,CAC3E,CAAA;AACF,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,UAAkC,EACjC,EAAE;IACH,IACC,UAAU;QACV,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,EAC5D;QACD,OAAO,KAAK,CAAA;KACZ;IACD,OAAO,IAAI,CAAA;AACZ,CAAC,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2022, J2 Innovations. All Rights Reserved
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect, useReducer, useRef, useState } from 'react';
|
|
5
|
+
import { areParametersValid } from 'resolvableElements/elements/section/resolveUtils';
|
|
5
6
|
import { makeParametersDict } from '../elements/function/FunctionElement';
|
|
6
7
|
import { ResolvableSectionElement } from '../elements/section/ResolvableSectionElement';
|
|
7
8
|
import { useResolverContext } from './useResolverContext';
|
|
@@ -58,11 +59,4 @@ export function useResolveSection(sectionData, parameters) {
|
|
|
58
59
|
},
|
|
59
60
|
];
|
|
60
61
|
}
|
|
61
|
-
const areParametersValid = (parameters) => {
|
|
62
|
-
if (parameters &&
|
|
63
|
-
Object.entries(parameters).some(([, value]) => value == null)) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
return true;
|
|
67
|
-
};
|
|
68
62
|
//# sourceMappingURL=useResolveSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResolveSection.js","sourceRoot":"","sources":["../../../src/resolvableElements/react/useResolveSection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useResolveSection.js","sourceRoot":"","sources":["../../../src/resolvableElements/react/useResolveSection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAA;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AAKvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAChC,WAAc,EACd,UAAmC;IAEnC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9D,MAAM,QAAQ,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CAAC,CAAC,CAAA;YACH,CAAC,CAAA;SACD;QACD,OAAM;IACP,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IAE/D,OAAO;QACN,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAuB;QAC/C;YACC,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,KAAK;YACL,SAAS;SACT;KACD,CAAA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@j2inn/resolvable-ui-elements",
|
|
3
|
-
"version": "1.1.1",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"module": "dist_es/index.js",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"clean": "rimraf ./dist && rimraf ./dist_es",
|
|
10
|
-
"prebuild": "npm run clean && npm run lint && npm run test",
|
|
11
|
-
"build": "tsc && npm run-script build:es",
|
|
12
|
-
"build:es": "tsc --module ESNext --outDir dist_es",
|
|
13
|
-
"checktypes": "tsc --noEmit",
|
|
14
|
-
"format": "prettier-eslint --list-different --write \"$(pwd)/src/**/*.{ts,tsx,js,jsx}\"",
|
|
15
|
-
"lint": "eslint --fix --ext ts,tsx,js,jsx src/",
|
|
16
|
-
"test": "jest --passWithNoTests",
|
|
17
|
-
"prepack": "npm run lint && npm run test && npm run build"
|
|
18
|
-
},
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist/**/*",
|
|
23
|
-
"dist_es/**/*"
|
|
24
|
-
],
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"haystack-core": "^2.0.45",
|
|
27
|
-
"haystack-nclient": "^3.0.32",
|
|
28
|
-
"haystack-react": "^3.0.17",
|
|
29
|
-
"haystack-units": "^1.0.22",
|
|
30
|
-
"react": "^18.2.0",
|
|
31
|
-
"react-dom": "^18.2.0"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/jest": "^27.4.0",
|
|
35
|
-
"@types/node": "^15.0.2",
|
|
36
|
-
"@types/react": "^18.0.18",
|
|
37
|
-
"@types/react-dom": "^18.0.6",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
39
|
-
"@typescript-eslint/parser": "^5.28.0",
|
|
40
|
-
"eslint": "^7.32.0",
|
|
41
|
-
"eslint-config-prettier": "^8.3.0",
|
|
42
|
-
"eslint-plugin-jest": "^26.1.3",
|
|
43
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
44
|
-
"eslint-plugin-react": "^7.29.4",
|
|
45
|
-
"prettier": "^2.6.1",
|
|
46
|
-
"prettier-eslint": "^13.0.0",
|
|
47
|
-
"prettier-eslint-cli": "^5.0.1",
|
|
48
|
-
"rimraf": "^3.0.2",
|
|
49
|
-
"ts-jest": "^28.0.8",
|
|
50
|
-
"typescript": "^4.8.2"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@j2inn/resolvable-ui-elements",
|
|
3
|
+
"version": "1.1.2-beta.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"module": "dist_es/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "rimraf ./dist && rimraf ./dist_es",
|
|
10
|
+
"prebuild": "npm run clean && npm run lint && npm run test",
|
|
11
|
+
"build": "tsc && npm run-script build:es",
|
|
12
|
+
"build:es": "tsc --module ESNext --outDir dist_es",
|
|
13
|
+
"checktypes": "tsc --noEmit",
|
|
14
|
+
"format": "prettier-eslint --list-different --write \"$(pwd)/src/**/*.{ts,tsx,js,jsx}\"",
|
|
15
|
+
"lint": "eslint --fix --ext ts,tsx,js,jsx src/",
|
|
16
|
+
"test": "jest --passWithNoTests",
|
|
17
|
+
"prepack": "npm run lint && npm run test && npm run build"
|
|
18
|
+
},
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/**/*",
|
|
23
|
+
"dist_es/**/*"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"haystack-core": "^2.0.45",
|
|
27
|
+
"haystack-nclient": "^3.0.32",
|
|
28
|
+
"haystack-react": "^3.0.17",
|
|
29
|
+
"haystack-units": "^1.0.22",
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"react-dom": "^18.2.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/jest": "^27.4.0",
|
|
35
|
+
"@types/node": "^15.0.2",
|
|
36
|
+
"@types/react": "^18.0.18",
|
|
37
|
+
"@types/react-dom": "^18.0.6",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.28.0",
|
|
40
|
+
"eslint": "^7.32.0",
|
|
41
|
+
"eslint-config-prettier": "^8.3.0",
|
|
42
|
+
"eslint-plugin-jest": "^26.1.3",
|
|
43
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
44
|
+
"eslint-plugin-react": "^7.29.4",
|
|
45
|
+
"prettier": "^2.6.1",
|
|
46
|
+
"prettier-eslint": "^13.0.0",
|
|
47
|
+
"prettier-eslint-cli": "^5.0.1",
|
|
48
|
+
"rimraf": "^3.0.2",
|
|
49
|
+
"ts-jest": "^28.0.8",
|
|
50
|
+
"typescript": "^4.8.2"
|
|
51
|
+
}
|
|
52
|
+
}
|