@react-typed-forms/schemas 1.0.0-dev.13 → 1.0.0-dev.14

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.
@@ -0,0 +1 @@
1
+ Invoking: rimraf ./lib/ && tsc
@@ -0,0 +1,3 @@
1
+ {
2
+ "nonCachedDurationMs": 1494.587678000331
3
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "files": {
3
- "packages/schemas/.rush/temp/shrinkwrap-deps.json": "5ce6417fae765db5c61e400f851ecafe0ce756f0",
3
+ "packages/schemas/.rush/temp/shrinkwrap-deps.json": "fcda66f5b02125cdb1f0d7e28e4758e5995db661",
4
4
  "packages/schemas/package.json": "79985efc8187507266d546ccc1dd712980e27936",
5
5
  "packages/schemas/src/controlRender.tsx": "7edc71570ea821a36f0260d9263dc41d577168ce",
6
6
  "packages/schemas/src/hooks.ts": "4eb4946f7b1c685e0b51cd011b4d39a1fdd6aa2e",
@@ -1,12 +1,12 @@
1
1
  {
2
- "../../packages/schemas": "../../packages/schemas:vY3D5bPwBzOGJtSnpoQLPVXnewF01wtTbcozE4xaygA=:",
2
+ "../../packages/schemas": "../../packages/schemas:Fos6869wBFfU7PR4ceDSdzh37iy8L7XOCnvmuFQwVpU=:",
3
3
  "/@types/prop-types/15.7.5": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==",
4
- "/@types/react/18.0.22": "sha512-4yWc5PyCkZN8ke8K9rQHkTXxHIWHxLzzW6RI1kXVoepkD3vULpKzC2sDtAMKn78h92BRYuzf+7b/ms7ajE6hFw==",
4
+ "/@types/react/18.2.28": "sha512-ad4aa/RaaJS3hyGz0BGegdnSRXQBkd1CCYDCdNjBPg90UUpLgo+WlJqb9fMYUxtehmzF3PJaTWqRZjko6BRzBg==",
5
5
  "/@types/scheduler/0.16.2": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==",
6
6
  "/balanced-match/1.0.2": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
7
7
  "/brace-expansion/1.1.11": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
8
8
  "/concat-map/0.0.1": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
9
- "/csstype/3.0.11": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==",
9
+ "/csstype/3.1.1": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==",
10
10
  "/fs.realpath/1.0.0": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
11
11
  "/glob/7.2.0": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
12
12
  "/inflight/1.0.6": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
@@ -1,11 +1,13 @@
1
- import { ActionControlDefinition, CompoundField, ControlDefinition, DataControlDefinition, DisplayControlDefinition, FieldOption, GroupedControlsDefinition, SchemaField } from "./types";
2
- import { Key, ReactElement, ReactNode } from "react";
1
+ import { ActionControlDefinition, CompoundField, ControlDefinition, DataControlDefinition, DisplayControlDefinition, EntityExpression, FieldOption, GroupedControlsDefinition, SchemaField } from "./types";
2
+ import React, { Key, ReactElement, ReactNode } from "react";
3
3
  import { Control } from "@react-typed-forms/core";
4
+ export type ExpressionHook = (expr: EntityExpression, formState: FormEditState) => any;
4
5
  export interface FormEditHooks {
5
6
  useDataProperties(formState: FormEditState, definition: DataControlDefinition, field: SchemaField): DataControlProperties;
6
7
  useGroupProperties(formState: FormEditState, definition: GroupedControlsDefinition, currentHooks: FormEditHooks): GroupControlProperties;
7
8
  useDisplayProperties(formState: FormEditState, definition: DisplayControlDefinition): DisplayControlProperties;
8
9
  useActionProperties(formState: FormEditState, definition: ActionControlDefinition): ActionControlProperties;
10
+ useExpression: ExpressionHook;
9
11
  }
10
12
  export interface DataControlProperties {
11
13
  control: Control<any>;
@@ -45,7 +47,7 @@ export interface FormRendererComponents {
45
47
  export declare function FormRendererProvider({ value, children, }: {
46
48
  value: FormRendererComponents;
47
49
  children: ReactNode;
48
- }): JSX.Element;
50
+ }): React.JSX.Element;
49
51
  export declare function useFormRendererComponents(): FormRendererComponents;
50
52
  export interface DisplayRendererProps {
51
53
  definition: DisplayControlDefinition;
package/lib/hooks.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { ControlDefinition, DataControlDefinition, EntityExpression, FieldOption, SchemaField } from "./types";
2
- import { DataControlProperties, FormEditHooks, FormEditState } from "./controlRender";
1
+ import { ControlDefinition, DataControlDefinition, FieldOption, SchemaField } from "./types";
2
+ import { DataControlProperties, ExpressionHook, FormEditHooks, FormEditState } from "./controlRender";
3
3
  import { Control } from "@react-typed-forms/core";
4
- export type ExpressionHook = (expr: EntityExpression, formState: FormEditState) => any;
5
4
  export declare function useDefaultValue(definition: DataControlDefinition, field: SchemaField, formState: FormEditState, useExpression: ExpressionHook): any;
6
5
  export declare function useIsControlVisible(definition: ControlDefinition, formState: FormEditState, useExpression: ExpressionHook): boolean;
7
6
  export declare function getDefaultScalarControlProperties(definition: DataControlDefinition, field: SchemaField, visible: boolean, defaultValue: any, control: Control<any>, readonly?: boolean): DataControlProperties;
package/lib/hooks.js CHANGED
@@ -72,6 +72,7 @@ const defaultExpressionHook = (expr, formState) => {
72
72
  exports.defaultExpressionHook = defaultExpressionHook;
73
73
  function createFormEditHooks(useExpression) {
74
74
  return {
75
+ useExpression,
75
76
  useDataProperties(formState, definition, field) {
76
77
  const visible = useIsControlVisible(definition, formState, useExpression);
77
78
  const defaultValue = useDefaultValue(definition, field, formState, useExpression);
package/lib/types.js CHANGED
@@ -14,30 +14,30 @@ var FieldType;
14
14
  FieldType["AutoId"] = "AutoId";
15
15
  FieldType["Image"] = "Image";
16
16
  FieldType["Any"] = "Any";
17
- })(FieldType = exports.FieldType || (exports.FieldType = {}));
17
+ })(FieldType || (exports.FieldType = FieldType = {}));
18
18
  var ControlDefinitionType;
19
19
  (function (ControlDefinitionType) {
20
20
  ControlDefinitionType["Data"] = "Data";
21
21
  ControlDefinitionType["Group"] = "Group";
22
22
  ControlDefinitionType["Display"] = "Display";
23
23
  ControlDefinitionType["Action"] = "Action";
24
- })(ControlDefinitionType = exports.ControlDefinitionType || (exports.ControlDefinitionType = {}));
24
+ })(ControlDefinitionType || (exports.ControlDefinitionType = ControlDefinitionType = {}));
25
25
  var DynamicPropertyType;
26
26
  (function (DynamicPropertyType) {
27
27
  DynamicPropertyType["Visible"] = "Visible";
28
28
  DynamicPropertyType["DefaultValue"] = "DefaultValue";
29
- })(DynamicPropertyType = exports.DynamicPropertyType || (exports.DynamicPropertyType = {}));
29
+ })(DynamicPropertyType || (exports.DynamicPropertyType = DynamicPropertyType = {}));
30
30
  var ExpressionType;
31
31
  (function (ExpressionType) {
32
32
  ExpressionType["Jsonata"] = "Jsonata";
33
33
  ExpressionType["FieldValue"] = "FieldValue";
34
34
  ExpressionType["UserMatch"] = "UserMatch";
35
- })(ExpressionType = exports.ExpressionType || (exports.ExpressionType = {}));
35
+ })(ExpressionType || (exports.ExpressionType = ExpressionType = {}));
36
36
  var ControlAdornmentType;
37
37
  (function (ControlAdornmentType) {
38
38
  ControlAdornmentType["Tooltip"] = "Tooltip";
39
39
  ControlAdornmentType["Accordion"] = "Accordion";
40
- })(ControlAdornmentType = exports.ControlAdornmentType || (exports.ControlAdornmentType = {}));
40
+ })(ControlAdornmentType || (exports.ControlAdornmentType = ControlAdornmentType = {}));
41
41
  var DataRenderType;
42
42
  (function (DataRenderType) {
43
43
  DataRenderType["Standard"] = "Standard";
@@ -49,24 +49,24 @@ var DataRenderType;
49
49
  DataRenderType["Synchronised"] = "Synchronised";
50
50
  DataRenderType["IconSelector"] = "IconSelector";
51
51
  DataRenderType["DateTime"] = "DateTime";
52
- })(DataRenderType = exports.DataRenderType || (exports.DataRenderType = {}));
52
+ })(DataRenderType || (exports.DataRenderType = DataRenderType = {}));
53
53
  var SyncTextType;
54
54
  (function (SyncTextType) {
55
55
  SyncTextType["Camel"] = "Camel";
56
56
  SyncTextType["Snake"] = "Snake";
57
57
  SyncTextType["Pascal"] = "Pascal";
58
- })(SyncTextType = exports.SyncTextType || (exports.SyncTextType = {}));
58
+ })(SyncTextType || (exports.SyncTextType = SyncTextType = {}));
59
59
  var GroupRenderType;
60
60
  (function (GroupRenderType) {
61
61
  GroupRenderType["Standard"] = "Standard";
62
62
  GroupRenderType["Grid"] = "Grid";
63
63
  GroupRenderType["GroupElement"] = "GroupElement";
64
- })(GroupRenderType = exports.GroupRenderType || (exports.GroupRenderType = {}));
64
+ })(GroupRenderType || (exports.GroupRenderType = GroupRenderType = {}));
65
65
  var DisplayDataType;
66
66
  (function (DisplayDataType) {
67
67
  DisplayDataType["Text"] = "Text";
68
68
  DisplayDataType["Html"] = "Html";
69
- })(DisplayDataType = exports.DisplayDataType || (exports.DisplayDataType = {}));
69
+ })(DisplayDataType || (exports.DisplayDataType = DisplayDataType = {}));
70
70
  function isDataControlDefinition(x) {
71
71
  return x.type === ControlDefinitionType.Data;
72
72
  }
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
1
  {
2
- "name": "@react-typed-forms/schemas",
3
- "version": "1.0.0-dev.13",
4
- "description": "",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/doolse/react-typed-forms.git"
10
- },
11
- "author": "Jolse Maginnis",
12
- "license": "ISC",
13
- "bugs": {
14
- "url": "https://github.com/doolse/react-typed-forms/issues"
15
- },
16
- "homepage": "https://github.com/doolse/react-typed-forms#readme",
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "keywords": [
21
- "react",
22
- "typescript",
23
- "forms",
24
- "material-ui"
25
- ],
26
- "dependencies": {
27
- "@react-typed-forms/core": "^3.0.0-dev"
28
- },
29
- "devDependencies": {
30
- "@types/react": "^18.0.22",
31
- "nswag": "^13.18.2",
32
- "react": "^18.2.0",
33
- "react-dom": "^18.2.0",
34
- "rimraf": "^3.0.2"
35
- },
36
- "gitHead": "698e16cd3ab31b7dd0528fc76536f4d3205ce8c6",
37
- "scripts": {
38
- "build": "rimraf ./lib/ && tsc",
39
- "watch": "tsc -w",
40
- "gencode": "nswag swagger2tsclient /input:http://localhost:5216/swagger/v1/swagger.json /runtime:Net60 /output:src/types.ts /GenerateClientClasses:false /MarkOptionalProperties:false /Template:Fetch /TypeStyle:Interface /DateTimeType:string"
41
- }
2
+ "name": "@react-typed-forms/schemas",
3
+ "version": "1.0.0-dev.14",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/doolse/react-typed-forms.git"
10
+ },
11
+ "author": "Jolse Maginnis",
12
+ "license": "ISC",
13
+ "bugs": {
14
+ "url": "https://github.com/doolse/react-typed-forms/issues"
15
+ },
16
+ "homepage": "https://github.com/doolse/react-typed-forms#readme",
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "keywords": [
21
+ "react",
22
+ "typescript",
23
+ "forms",
24
+ "material-ui"
25
+ ],
26
+ "dependencies": {
27
+ "@react-typed-forms/core": "^*"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "^18.2.28",
31
+ "nswag": "^13.18.2",
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0",
34
+ "rimraf": "^3.0.2"
35
+ },
36
+ "gitHead": "698e16cd3ab31b7dd0528fc76536f4d3205ce8c6",
37
+ "scripts": {
38
+ "build": "rimraf ./lib/ && tsc",
39
+ "watch": "tsc -w",
40
+ "gencode": "nswag swagger2tsclient /input:http://localhost:5216/swagger/v1/swagger.json /runtime:Net60 /output:src/types.ts /GenerateClientClasses:false /MarkOptionalProperties:false /Template:Fetch /TypeStyle:Interface /DateTimeType:string"
41
+ }
42
42
  }
package/schemas.build.log CHANGED
@@ -1,2 +1 @@
1
1
  Invoking: rimraf ./lib/ && tsc
2
-
@@ -6,6 +6,7 @@ import {
6
6
  ControlDefinitionType,
7
7
  DataControlDefinition,
8
8
  DisplayControlDefinition,
9
+ EntityExpression,
9
10
  FieldOption,
10
11
  FieldType,
11
12
  GroupedControlsDefinition,
@@ -23,6 +24,11 @@ import React, {
23
24
  import { Control, newControl } from "@react-typed-forms/core";
24
25
  import { fieldDisplayName } from "./index";
25
26
 
27
+ export type ExpressionHook = (
28
+ expr: EntityExpression,
29
+ formState: FormEditState
30
+ ) => any;
31
+
26
32
  export interface FormEditHooks {
27
33
  useDataProperties(
28
34
  formState: FormEditState,
@@ -42,6 +48,7 @@ export interface FormEditHooks {
42
48
  formState: FormEditState,
43
49
  definition: ActionControlDefinition
44
50
  ): ActionControlProperties;
51
+ useExpression: ExpressionHook;
45
52
  }
46
53
 
47
54
  export interface DataControlProperties {
package/src/hooks.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  ActionControlProperties,
14
14
  controlForField,
15
15
  DataControlProperties,
16
+ ExpressionHook,
16
17
  fieldForControl,
17
18
  findField,
18
19
  FormEditHooks,
@@ -23,10 +24,6 @@ import {
23
24
  import { useEffect, useMemo } from "react";
24
25
  import { Control, newControl } from "@react-typed-forms/core";
25
26
 
26
- export type ExpressionHook = (
27
- expr: EntityExpression,
28
- formState: FormEditState
29
- ) => any;
30
27
  export function useDefaultValue(
31
28
  definition: DataControlDefinition,
32
29
  field: SchemaField,
@@ -127,6 +124,7 @@ export function createFormEditHooks(
127
124
  useExpression: ExpressionHook
128
125
  ): FormEditHooks {
129
126
  return {
127
+ useExpression,
130
128
  useDataProperties(
131
129
  formState: FormEditState,
132
130
  definition: DataControlDefinition,
File without changes