graphql-form 0.0.23 → 0.0.24
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/lib/createWidget.d.ts +1 -8
- package/lib/createWidget.js +13 -11
- package/lib/createWidget.js.map +1 -1
- package/package.json +3 -3
- package/src/createWidget.tsx +2 -14
package/lib/createWidget.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { WidgetProps } from "./models";
|
|
3
|
-
export declare function createWidget<Props>(
|
|
4
|
-
displayName: string | undefined;
|
|
5
|
-
Component: import("react").FC<import("@/models").PassedFormProps<Props>>;
|
|
6
|
-
Settings: import("react").FC<import("@/models").CastToWidgetSettingsPassedForm<Props>> | undefined;
|
|
7
|
-
Description: import("react").FC<{}> | undefined;
|
|
8
|
-
requirements: (props: import("./models").PassedFormProps<any>) => boolean;
|
|
2
|
+
export declare function createWidget<Props>(params: WidgetProps<Props>): WidgetProps<Props> & {
|
|
9
3
|
props: Props;
|
|
10
|
-
name: string;
|
|
11
4
|
};
|
package/lib/createWidget.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.createWidget = void 0;
|
|
4
|
-
function createWidget(
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
displayName: displayName,
|
|
8
|
-
Component: Component,
|
|
9
|
-
Settings: Settings,
|
|
10
|
-
Description: Description,
|
|
11
|
-
requirements: requirements,
|
|
12
|
-
props: {},
|
|
13
|
-
name: name,
|
|
14
|
-
};
|
|
15
|
+
function createWidget(params) {
|
|
16
|
+
return __assign(__assign({}, params), { props: {} });
|
|
15
17
|
}
|
|
16
18
|
exports.createWidget = createWidget;
|
|
17
19
|
//# sourceMappingURL=createWidget.js.map
|
package/lib/createWidget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWidget.js","sourceRoot":"","sources":["../src/createWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createWidget.js","sourceRoot":"","sources":["../src/createWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,SAAgB,YAAY,CAAQ,MAA0B;IAC1D,6BACO,MAAM,KACT,KAAK,EAAE,EAAW,IACpB;AACN,CAAC;AALD,oCAKC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Easy form creation with GraphQL Editor and React",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
8
|
"test:watch": "jest --watch",
|
|
9
|
-
"build": "
|
|
10
|
-
"start": "
|
|
9
|
+
"build": "tsc -p tsconfig.build.json",
|
|
10
|
+
"start": "tsc -p tsconfig.build.json --watch",
|
|
11
11
|
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
|
|
12
12
|
},
|
|
13
13
|
"types": "lib/index.d.ts",
|
package/src/createWidget.tsx
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { WidgetProps } from '@/models';
|
|
2
2
|
|
|
3
|
-
export function createWidget<Props>({
|
|
4
|
-
name,
|
|
5
|
-
Component,
|
|
6
|
-
Settings,
|
|
7
|
-
Description,
|
|
8
|
-
requirements,
|
|
9
|
-
displayName,
|
|
10
|
-
}: WidgetProps<Props>) {
|
|
3
|
+
export function createWidget<Props>(params: WidgetProps<Props>): WidgetProps<Props> & { props: Props } {
|
|
11
4
|
return {
|
|
12
|
-
|
|
13
|
-
Component,
|
|
14
|
-
Settings,
|
|
15
|
-
Description,
|
|
16
|
-
requirements,
|
|
5
|
+
...params,
|
|
17
6
|
props: {} as Props,
|
|
18
|
-
name,
|
|
19
7
|
};
|
|
20
8
|
}
|