@vulcanjs/react-ui 0.4.1 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.md +21 -0
- package/dist/components/VulcanCurrentUser/Consumer.d.ts +4 -0
- package/dist/components/VulcanCurrentUser/Consumer.d.ts.map +1 -0
- package/dist/components/VulcanCurrentUser/Context.d.ts +11 -0
- package/dist/components/VulcanCurrentUser/Context.d.ts.map +1 -0
- package/dist/components/VulcanCurrentUser/Provider.d.ts +7 -0
- package/dist/components/VulcanCurrentUser/Provider.d.ts.map +1 -0
- package/dist/components/VulcanCurrentUser/index.d.ts +3 -0
- package/dist/components/VulcanCurrentUser/index.d.ts.map +1 -0
- package/dist/components/form/Form/typings.d.ts +2 -2
- package/dist/components/form/Form/typings.d.ts.map +1 -1
- package/dist/components/form/FormContainer.d.ts +3 -0
- package/dist/components/form/FormContainer.d.ts.map +1 -1
- package/dist/components/form/FormGroup.d.ts +2 -2
- package/dist/components/form/FormGroup.d.ts.map +1 -1
- package/dist/components/form/VulcanComponents/Provider.d.ts.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/componentsHelpers.d.ts +10 -0
- package/dist/componentsHelpers.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +8 -8
package/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 VulcanJS
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const VulcanCurrentUserConsumer: import("react").Consumer<import("./Context").VulcanCurrentUserContextType>;
|
3
|
+
export declare const useVulcanCurrentUser: () => import("./Context").VulcanCurrentUserContextType;
|
4
|
+
//# sourceMappingURL=Consumer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Consumer.d.ts","sourceRoot":"","sources":["../../../components/VulcanCurrentUser/Consumer.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,yBAAyB,4EAAoC,CAAC;AAE3E,eAAO,MAAM,oBAAoB,wDAA6C,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { VulcanUser } from "@vulcanjs/permissions";
|
3
|
+
export declare type VulcanCurrentUserContextType = {
|
4
|
+
currentUser: VulcanUser | null;
|
5
|
+
loading: false;
|
6
|
+
} | {
|
7
|
+
loading: true;
|
8
|
+
currentUser: any;
|
9
|
+
};
|
10
|
+
export declare const VulcanCurrentUserContext: React.Context<VulcanCurrentUserContextType>;
|
11
|
+
//# sourceMappingURL=Context.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../components/VulcanCurrentUser/Context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,oBAAY,4BAA4B,GACpC;IAAE,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,GAClD;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,GAAG,CAAA;CAAE,CAAC;AAGxC,eAAO,MAAM,wBAAwB,6CAIjC,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { VulcanCurrentUserContextType } from "./Context";
|
3
|
+
export declare const VulcanCurrentUserProvider: ({ value, ...props }: {
|
4
|
+
value: VulcanCurrentUserContextType;
|
5
|
+
children: React.ReactNode;
|
6
|
+
}) => JSX.Element;
|
7
|
+
//# sourceMappingURL=Provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../components/VulcanCurrentUser/Provider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AAGnB,eAAO,MAAM,yBAAyB;WAI7B,4BAA4B;cACzB,MAAM,SAAS;iBAM1B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/VulcanCurrentUser/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { CreateVariables, UpdateVariables, DeleteVariables } from "@vulcanjs/graphql";
|
3
3
|
import { VulcanModel } from "@vulcanjs/model";
|
4
|
-
import {
|
4
|
+
import { VulcanUser } from "@vulcanjs/permissions";
|
5
5
|
import { VulcanSchema } from "@vulcanjs/schema";
|
6
6
|
export interface FormState {
|
7
7
|
schema: any;
|
@@ -24,7 +24,7 @@ export interface FormProps<TModel = {
|
|
24
24
|
schema?: VulcanSchema;
|
25
25
|
document?: any;
|
26
26
|
disabled?: boolean;
|
27
|
-
currentUser?:
|
27
|
+
currentUser?: VulcanUser;
|
28
28
|
addFields?: Array<string>;
|
29
29
|
removeFields?: Array<string>;
|
30
30
|
warnUnsavedChanges?: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../../components/form/Form/typings.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../../components/form/Form/typings.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,GAAG,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,GAAG,CAAC;IACnB,MAAM,EAAE,GAAG,CAAC;IACZ,aAAa,EAAE,GAAG,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,GAAG,CAAC;CACrB;AACD,MAAM,WAAW,SAAS,CAAC,MAAM,GAAG;KAAG,GAAG,IAAI,MAAM,GAAG,GAAG;CAAE;IAK1D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAIrB,EAAE,CAAC,EAAE,MAAM,CAAC;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IAAI,CAAC;IAE/D,cAAc,CAAC,EAAE,CAAC,QAAQ,KAAA,KAAK,IAAI,CAAC;IAEpC,qBAAqB,CAAC,EAAE,CAAC,QAAQ,KAAA,KAAK,IAAI,CAAC;IAG3C,cAAc,EAAE,CAAC,eAAe,KAAA,KAAK,IAAI,CAAC;IAK1C,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAQ1B,cAAc,EAAE,CAAC,MAAM,GAAG,GAAG,EAC3B,UAAU,EAAE,eAAe,KACxB,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,cAAc,EAAE,CAAC,MAAM,GAAG,GAAG,EAC3B,IAAI,EAAE,eAAe,KAClB,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,cAAc,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAMzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB,CAAC,SAAS,GAAG,GAAG;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,SAAS,GAAG,GAAG;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACpB"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { VulcanGraphqlModel } from "@vulcanjs/graphql";
|
2
|
+
import { VulcanUser } from "@vulcanjs/permissions";
|
2
3
|
export interface FormContainerProps {
|
3
4
|
model: VulcanGraphqlModel;
|
4
5
|
documentId?: string;
|
@@ -9,6 +10,8 @@ export interface FormContainerProps {
|
|
9
10
|
mutationFragment?: string;
|
10
11
|
queryFragmentName?: string;
|
11
12
|
mutationFragmentName?: string;
|
13
|
+
currentUser?: VulcanUser | null;
|
14
|
+
loadingCurrentUser?: boolean;
|
12
15
|
}
|
13
16
|
export declare type SmartFormProps = FormContainerProps;
|
14
17
|
export declare const FormContainer: (props: FormContainerProps) => JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormContainer.d.ts","sourceRoot":"","sources":["../../../components/form/FormContainer.tsx"],"names":[],"mappings":"AAgDA,OAAO,EACL,kBAAkB,EAInB,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"FormContainer.d.ts","sourceRoot":"","sources":["../../../components/form/FormContainer.tsx"],"names":[],"mappings":"AAgDA,OAAO,EACL,kBAAkB,EAInB,MAAM,mBAAmB,CAAC;AAc3B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,kBAAkB,CAAC;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAIvB,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE1B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAU9B,WAAW,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AACD,oBAAY,cAAc,GAAG,kBAAkB,CAAC;AAGhD,eAAO,MAAM,aAAa,UAAW,kBAAkB,gBAgOtD,CAAC;AAqDF,eAAO,MAAM,SAAS,UArRe,kBAAkB,gBAqRjB,CAAC;AAEvC,eAAe,aAAa,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { VulcanUser } from "@vulcanjs/permissions";
|
2
2
|
import { FieldGroup } from "@vulcanjs/schema";
|
3
3
|
import { FormField } from "./typings";
|
4
4
|
export interface FormGroupProps {
|
@@ -9,7 +9,7 @@ export interface FormGroupProps {
|
|
9
9
|
hidden?: boolean | Function;
|
10
10
|
disabled?: boolean;
|
11
11
|
document: any;
|
12
|
-
currentUser?:
|
12
|
+
currentUser?: VulcanUser;
|
13
13
|
itemProperties: any;
|
14
14
|
formType: any;
|
15
15
|
prefilledProps: any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormGroup.d.ts","sourceRoot":"","sources":["../../../components/form/FormGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"FormGroup.d.ts","sourceRoot":"","sources":["../../../components/form/FormGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAW,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,CAGZ;IACL,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,cAAc,EAAE,GAAG,CAAC;CACrB;AAOD,eAAO,MAAM,eAAe;;;;;;;;iBAU3B,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA+B,CAAC;AAE5D,eAAO,MAAM,SAAS,UACb,cAAc,uBAuGtB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../components/form/VulcanComponents/Provider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../components/form/VulcanComponents/Provider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAOrD,eAAO,MAAM,wBAAwB;;cAKzB,MAAM,SAAS;iBAM1B,CAAC"}
|
@@ -2,4 +2,6 @@ export * from "./FormContainer";
|
|
2
2
|
export * from "./Form";
|
3
3
|
export * from "./VulcanComponents/Provider";
|
4
4
|
export * from "./VulcanComponents/Context";
|
5
|
+
export * from "./VulcanComponents/Consumer";
|
6
|
+
export * from "./VulcanComponents/typings";
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
export declare const Components: {};
|
3
|
+
export declare const ComponentsTable: {};
|
4
|
+
export declare const coreComponents: string[];
|
5
|
+
export declare const componentExists: (name: any) => boolean;
|
6
|
+
export declare const getRawComponent: (name: any) => any;
|
7
|
+
export declare const instantiateComponent: (component?: React.ComponentType | Function | any, props?: any) => any;
|
8
|
+
export declare const delayedComponent: (name: any) => (props: any) => any;
|
9
|
+
export declare const mergeWithComponents: (myComponents: any) => any;
|
10
|
+
//# sourceMappingURL=componentsHelpers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"componentsHelpers.d.ts","sourceRoot":"","sources":["../componentsHelpers.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,UAAU,IAAK,CAAC;AAC7B,eAAO,MAAM,eAAe,IAAK,CAAC;AAElC,eAAO,MAAM,cAAc,UAyB1B,CAAC;AAuDF,eAAO,MAAM,eAAe,wBAG3B,CAAC;AA2EF,eAAO,MAAM,eAAe,oBAE3B,CAAC;AAyDF,eAAO,MAAM,oBAAoB,eACnB,MAAM,aAAa,GAAG,QAAQ,GAAG,GAAG,UACxC,GAAG,QA4BZ,CAAC;AAyBF,eAAO,MAAM,gBAAgB,oCAK5B,CAAC;AAYF,eAAO,MAAM,mBAAmB,4BACgC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC"}
|