graphql-form 0.0.21 → 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 +4 -4
- package/lib/createWidget.js.map +1 -1
- package/lib/models.d.ts +4 -3
- package/package.json +1 -1
- package/src/createWidget.tsx +9 -2
- package/src/models.ts +5 -3
package/lib/createWidget.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, displayName }:
|
|
2
|
+
import { WidgetProps } from "./models";
|
|
3
|
+
export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, displayName, }: WidgetProps<Props>): {
|
|
4
4
|
displayName: string | undefined;
|
|
5
|
-
Component: import("react").FC<import("@/models").PassedFormProps<
|
|
6
|
-
Settings: import("react").FC<import("@/models").CastToWidgetSettingsPassedForm<
|
|
5
|
+
Component: import("react").FC<import("@/models").PassedFormProps<Props>>;
|
|
6
|
+
Settings: import("react").FC<import("@/models").CastToWidgetSettingsPassedForm<Props>> | undefined;
|
|
7
7
|
Description: import("react").FC<{}> | undefined;
|
|
8
8
|
requirements: (props: import("./models").PassedFormProps<any>) => boolean;
|
|
9
9
|
props: Props;
|
package/lib/createWidget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWidget.js","sourceRoot":"","sources":["../src/createWidget.tsx"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAQ,
|
|
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,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetProps } from '@/models';
|
|
2
2
|
|
|
3
|
-
export function createWidget<Props>({
|
|
3
|
+
export function createWidget<Props>({
|
|
4
|
+
name,
|
|
5
|
+
Component,
|
|
6
|
+
Settings,
|
|
7
|
+
Description,
|
|
8
|
+
requirements,
|
|
9
|
+
displayName,
|
|
10
|
+
}: WidgetProps<Props>) {
|
|
4
11
|
return {
|
|
5
12
|
displayName,
|
|
6
13
|
Component,
|
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
|
| {
|