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.
@@ -1,11 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { WidgetProps } from "./models";
3
- export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, displayName, }: WidgetProps<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
  };
@@ -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(_a) {
5
- var name = _a.name, Component = _a.Component, Settings = _a.Settings, Description = _a.Description, requirements = _a.requirements, displayName = _a.displayName;
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
@@ -1 +1 @@
1
- {"version":3,"file":"createWidget.js","sourceRoot":"","sources":["../src/createWidget.tsx"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAQ,EAOf;QANjB,IAAI,UAAA,EACJ,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,WAAW,iBAAA;IAEX,OAAO;QACH,WAAW,aAAA;QACX,SAAS,WAAA;QACT,QAAQ,UAAA;QACR,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,KAAK,EAAE,EAAW;QAClB,IAAI,MAAA;KACP,CAAC;AACN,CAAC;AAjBD,oCAiBC"}
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.23",
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": "ttsc --build tsconfig.build.json",
10
- "start": "ttsc --build tsconfig.build.json --watch",
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",
@@ -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
- displayName,
13
- Component,
14
- Settings,
15
- Description,
16
- requirements,
5
+ ...params,
17
6
  props: {} as Props,
18
- name,
19
7
  };
20
8
  }