json-react-layouts-data-loader
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -5,3 +5,3 @@ import React from 'react'; | ||
}>; | ||
export declare const testCompositionRegistration: import("json-react-layouts").CompositionRegistration<"test-composition", "main", {}>; | ||
export declare const testCompositionRegistration: import("json-react-layouts").CompositionRegistration<"test-composition", "main", {}, {}>; | ||
export declare const testComponentWithDataRegistration: import("json-react-layouts").ComponentRegistration<"test-with-data", { | ||
@@ -8,0 +8,0 @@ dataDefinitionArgs: { |
@@ -28,6 +28,3 @@ "use strict"; | ||
var _a = _1.init(resources), middleware = _a.middleware, createRegisterableComponentWithData = _a.createRegisterableComponentWithData; | ||
exports.testCompositionRegistration = createRegisterableComposition()('test-composition', function (_a) { | ||
var contentAreas = _a.contentAreas; | ||
return react_1.default.createElement(exports.TestComposition, { main: contentAreas.main }); | ||
}); | ||
exports.testCompositionRegistration = createRegisterableComposition()('test-composition', function (contentAreas) { return react_1.default.createElement(exports.TestComposition, { main: contentAreas.main }); }); | ||
exports.testComponentWithDataRegistration = createRegisterableComponentWithData('test-with-data', lengthCalculatorDataDefinition, function (props, data) { | ||
@@ -51,5 +48,16 @@ return (react_1.default.createElement(exports.TestComponentWithData, tslib_1.__assign({ length: data.loaded ? data.result : undefined }, props, { dataProps: { data: data } }))); | ||
wrapper = enzyme_1.mount(react_1.default.createElement(react_ssr_data_loader_1.DataProvider, { resources: resources, globalProps: {} }, | ||
react_1.default.createElement(layout.ContentAreaRenderer, { componentRenderPath: "test", contentArea: [ | ||
{ type: 'test-with-data', props: { dataDefinitionArgs: { dataArg: 'Foo' } } }, | ||
], layoutApi: layout, services: {} }))); | ||
react_1.default.createElement(layout.CompositionsRenderer, { compositions: [ | ||
{ | ||
type: 'test-composition', | ||
contentAreas: { | ||
main: [ | ||
{ | ||
type: 'test-with-data', | ||
props: { dataDefinitionArgs: { dataArg: 'Foo' } }, | ||
}, | ||
], | ||
}, | ||
props: {}, | ||
}, | ||
], services: {} }))); | ||
expect(wrapper.find(exports.TestComponentWithData).text()).toBe('Loading'); | ||
@@ -56,0 +64,0 @@ return [4, new Promise(function (resolve) { return setTimeout(resolve); })]; |
@@ -19,3 +19,3 @@ import { LayoutApi } from 'json-react-layouts'; | ||
dataDefinitionArgs: any; | ||
layout: LayoutApi<any, any, Services, any>; | ||
layout: LayoutApi<any, any, Services, any, any>; | ||
} |
import { LayoutApi } from 'json-react-layouts'; | ||
import { DataDefinition } from './DataLoading'; | ||
export declare function getComponentDataArgs<Services>(layout: LayoutApi<any, any, any, any>, componentType: string): DataDefinition<any, any, Services> | undefined; | ||
export declare function getComponentDataArgs<Services>(layout: LayoutApi<any, any, any, any, any>, componentType: string): DataDefinition<any, any, Services> | undefined; |
@@ -5,3 +5,3 @@ import React from 'react'; | ||
}>; | ||
export declare const testCompositionRegistration: import("json-react-layouts").CompositionRegistration<"test-composition", "main", {}>; | ||
export declare const testCompositionRegistration: import("json-react-layouts").CompositionRegistration<"test-composition", "main", {}, {}>; | ||
export declare const testComponentWithDataRegistration: import("json-react-layouts").ComponentRegistration<"test-with-data", { | ||
@@ -8,0 +8,0 @@ dataDefinitionArgs: { |
@@ -26,6 +26,3 @@ var _this = this; | ||
var _a = init(resources), middleware = _a.middleware, createRegisterableComponentWithData = _a.createRegisterableComponentWithData; | ||
export var testCompositionRegistration = createRegisterableComposition()('test-composition', function (_a) { | ||
var contentAreas = _a.contentAreas; | ||
return React.createElement(TestComposition, { main: contentAreas.main }); | ||
}); | ||
export var testCompositionRegistration = createRegisterableComposition()('test-composition', function (contentAreas) { return React.createElement(TestComposition, { main: contentAreas.main }); }); | ||
export var testComponentWithDataRegistration = createRegisterableComponentWithData('test-with-data', lengthCalculatorDataDefinition, function (props, data) { | ||
@@ -49,5 +46,16 @@ return (React.createElement(TestComponentWithData, tslib_1.__assign({ length: data.loaded ? data.result : undefined }, props, { dataProps: { data: data } }))); | ||
wrapper = mount(React.createElement(DataProvider, { resources: resources, globalProps: {} }, | ||
React.createElement(layout.ContentAreaRenderer, { componentRenderPath: "test", contentArea: [ | ||
{ type: 'test-with-data', props: { dataDefinitionArgs: { dataArg: 'Foo' } } }, | ||
], layoutApi: layout, services: {} }))); | ||
React.createElement(layout.CompositionsRenderer, { compositions: [ | ||
{ | ||
type: 'test-composition', | ||
contentAreas: { | ||
main: [ | ||
{ | ||
type: 'test-with-data', | ||
props: { dataDefinitionArgs: { dataArg: 'Foo' } }, | ||
}, | ||
], | ||
}, | ||
props: {}, | ||
}, | ||
], services: {} }))); | ||
expect(wrapper.find(TestComponentWithData).text()).toBe('Loading'); | ||
@@ -54,0 +62,0 @@ return [4, new Promise(function (resolve) { return setTimeout(resolve); })]; |
@@ -19,3 +19,3 @@ import { LayoutApi } from 'json-react-layouts'; | ||
dataDefinitionArgs: any; | ||
layout: LayoutApi<any, any, Services, any>; | ||
layout: LayoutApi<any, any, Services, any, any>; | ||
} |
import { LayoutApi } from 'json-react-layouts'; | ||
import { DataDefinition } from './DataLoading'; | ||
export declare function getComponentDataArgs<Services>(layout: LayoutApi<any, any, any, any>, componentType: string): DataDefinition<any, any, Services> | undefined; | ||
export declare function getComponentDataArgs<Services>(layout: LayoutApi<any, any, any, any, any>, componentType: string): DataDefinition<any, any, Services> | undefined; |
{ | ||
"name": "json-react-layouts-data-loader", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -47,3 +47,3 @@ "module": "dist/esm/index.js", | ||
"typescript": "3.5.3", | ||
"json-react-layouts": "^1.1.1" | ||
"json-react-layouts": "^2.0.0" | ||
}, | ||
@@ -54,5 +54,5 @@ "dependencies": { | ||
"peerDependencies": { | ||
"json-react-layouts": "^1.1.1", | ||
"json-react-layouts": "^2.0.0", | ||
"react-ssr-data-loader": "^1.1.0" | ||
} | ||
} |
@@ -17,3 +17,3 @@ import { LayoutApi } from 'json-react-layouts' | ||
dataDefinitionArgs: any | ||
layout: LayoutApi<any, any, Services, any> | ||
layout: LayoutApi<any, any, Services, any, any> | ||
} |
@@ -5,3 +5,3 @@ import { getRegistrars, LayoutApi } from 'json-react-layouts' | ||
export function getComponentDataArgs<Services>( | ||
layout: LayoutApi<any, any, any, any>, | ||
layout: LayoutApi<any, any, any, any, any>, | ||
componentType: string, | ||
@@ -8,0 +8,0 @@ ): DataDefinition<any, any, Services> | undefined { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46665
651
13