graphql-form 0.0.20 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/createWidget.d.ts +7 -14
- package/lib/createWidget.js.map +1 -1
- package/lib/models.d.ts +5 -4
- package/package.json +1 -1
- package/src/createWidget.tsx +2 -10
- package/src/models.ts +6 -4
package/lib/createWidget.d.ts
CHANGED
@@ -1,18 +1,11 @@
|
|
1
|
-
|
2
|
-
import
|
3
|
-
export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, displayName, }: {
|
4
|
-
name: string;
|
5
|
-
displayName?: string;
|
6
|
-
Component: React.FC<PassedFormProps<Props>>;
|
7
|
-
Settings?: React.FC<CastToWidgetSettingsPassedForm<Props>>;
|
8
|
-
Description?: React.FC;
|
9
|
-
requirements: (props: PassedFormProps) => boolean;
|
10
|
-
}): {
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { WidgetProps } from "./models";
|
3
|
+
export declare function createWidget<Props>({ name, Component, Settings, Description, requirements, displayName, }: WidgetProps<Props>): {
|
11
4
|
displayName: string | undefined;
|
12
|
-
Component:
|
13
|
-
Settings:
|
14
|
-
Description:
|
15
|
-
requirements: (props: PassedFormProps) => boolean;
|
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;
|
16
9
|
props: Props;
|
17
10
|
name: string;
|
18
11
|
};
|
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
|
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,
|
@@ -8,14 +7,7 @@ export function createWidget<Props>({
|
|
8
7
|
Description,
|
9
8
|
requirements,
|
10
9
|
displayName,
|
11
|
-
}: {
|
12
|
-
name: string;
|
13
|
-
displayName?: string;
|
14
|
-
Component: React.FC<PassedFormProps<Props>>;
|
15
|
-
Settings?: React.FC<CastToWidgetSettingsPassedForm<Props>>;
|
16
|
-
Description?: React.FC;
|
17
|
-
requirements: (props: PassedFormProps) => boolean;
|
18
|
-
}) {
|
10
|
+
}: WidgetProps<Props>) {
|
19
11
|
return {
|
20
12
|
displayName,
|
21
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
|
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
|
| {
|