graphql-form 0.0.19 → 0.0.22
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 +8 -13
- package/lib/createWidget.js +2 -1
- package/lib/createWidget.js.map +1 -1
- package/lib/models.d.ts +5 -4
- package/package.json +1 -1
- package/src/createWidget.tsx +4 -9
- package/src/models.ts +6 -4
package/lib/createWidget.d.ts
CHANGED
@@ -1,16 +1,11 @@
|
|
1
|
-
|
2
|
-
import
|
3
|
-
export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, }: {
|
4
|
-
|
5
|
-
Component:
|
6
|
-
Settings
|
7
|
-
Description
|
8
|
-
requirements: (props: PassedFormProps) => boolean;
|
9
|
-
}): {
|
10
|
-
Component: React.FC<PassedFormProps<Props>>;
|
11
|
-
Settings: React.FC<CastToWidgetSettingsPassedForm<Props>> | undefined;
|
12
|
-
Description: React.FC<{}> | undefined;
|
13
|
-
requirements: (props: PassedFormProps) => boolean;
|
1
|
+
/// <reference types="react" />
|
2
|
+
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;
|
14
9
|
props: Props;
|
15
10
|
name: string;
|
16
11
|
};
|
package/lib/createWidget.js
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.createWidget = void 0;
|
4
4
|
function createWidget(_a) {
|
5
|
-
var name = _a.name, Component = _a.Component, Settings = _a.Settings, Description = _a.Description, requirements = _a.requirements;
|
5
|
+
var name = _a.name, Component = _a.Component, Settings = _a.Settings, Description = _a.Description, requirements = _a.requirements, displayName = _a.displayName;
|
6
6
|
return {
|
7
|
+
displayName: displayName,
|
7
8
|
Component: Component,
|
8
9
|
Settings: Settings,
|
9
10
|
Description: Description,
|
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,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"}
|
package/lib/models.d.ts
CHANGED
@@ -70,14 +70,15 @@ export declare type FormLibraryProps = Omit<FormDisplayerProps, 'required' | 'co
|
|
70
70
|
export declare type CastToWidgetSettingsPassedForm<WidgetData = ReturnedDictType> = Partial<PassedFormProps<Partial<WidgetData>>> & {
|
71
71
|
widgetSettingsChange: (data: WidgetData) => void;
|
72
72
|
};
|
73
|
-
export declare type
|
74
|
-
Component: React.FC<PassedFormProps
|
75
|
-
Settings: React.FC<CastToWidgetSettingsPassedForm
|
73
|
+
export declare type WidgetProps<Props> = {
|
74
|
+
Component: React.FC<PassedFormProps<Props>>;
|
75
|
+
Settings: React.FC<CastToWidgetSettingsPassedForm<Props>> | undefined;
|
76
76
|
Description?: React.FC;
|
77
77
|
requirements: (props: PassedFormProps) => boolean;
|
78
|
-
|
78
|
+
displayName?: string;
|
79
79
|
name: string;
|
80
80
|
};
|
81
|
+
export declare type WidgetType = WidgetProps<ReturnedDictType>;
|
81
82
|
export declare type FormValue = {
|
82
83
|
value: FormValue;
|
83
84
|
} | {
|
package/package.json
CHANGED
package/src/createWidget.tsx
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import React from 'react';
|
1
|
+
import { WidgetProps } from '@/models';
|
3
2
|
|
4
3
|
export function createWidget<Props>({
|
5
4
|
name,
|
@@ -7,14 +6,10 @@ export function createWidget<Props>({
|
|
7
6
|
Settings,
|
8
7
|
Description,
|
9
8
|
requirements,
|
10
|
-
|
11
|
-
|
12
|
-
Component: React.FC<PassedFormProps<Props>>;
|
13
|
-
Settings?: React.FC<CastToWidgetSettingsPassedForm<Props>>;
|
14
|
-
Description?: React.FC;
|
15
|
-
requirements: (props: PassedFormProps) => boolean;
|
16
|
-
}) {
|
9
|
+
displayName,
|
10
|
+
}: WidgetProps<Props>) {
|
17
11
|
return {
|
12
|
+
displayName,
|
18
13
|
Component,
|
19
14
|
Settings,
|
20
15
|
Description,
|
package/src/models.ts
CHANGED
@@ -90,15 +90,17 @@ export type CastToWidgetSettingsPassedForm<WidgetData = ReturnedDictType> = Part
|
|
90
90
|
widgetSettingsChange: (data: WidgetData) => void;
|
91
91
|
};
|
92
92
|
|
93
|
-
export type
|
94
|
-
Component: React.FC<PassedFormProps
|
95
|
-
Settings: React.FC<CastToWidgetSettingsPassedForm
|
93
|
+
export type WidgetProps<Props> = {
|
94
|
+
Component: React.FC<PassedFormProps<Props>>;
|
95
|
+
Settings: React.FC<CastToWidgetSettingsPassedForm<Props>> | undefined;
|
96
96
|
Description?: React.FC;
|
97
97
|
requirements: (props: PassedFormProps) => boolean;
|
98
|
-
|
98
|
+
displayName?: string;
|
99
99
|
name: string;
|
100
100
|
};
|
101
101
|
|
102
|
+
export type WidgetType = WidgetProps<ReturnedDictType>;
|
103
|
+
|
102
104
|
export type FormValue =
|
103
105
|
| { value: FormValue }
|
104
106
|
| {
|