@react-typed-forms/schemas 1.0.0-dev.10 → 1.0.0-dev.11
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"packages/schemas/.rush/temp/shrinkwrap-deps.json": "fcda66f5b02125cdb1f0d7e28e4758e5995db661",
|
|
4
|
-
"packages/schemas/package.json": "
|
|
4
|
+
"packages/schemas/package.json": "5c0f8b72decd8954153f0266278c3541646b7ed1",
|
|
5
5
|
"packages/schemas/src/controlRender.tsx": "3a1df1f3ade46594dbc15bca1228dc0d57e55da0",
|
|
6
6
|
"packages/schemas/src/hooks.ts": "4eb4946f7b1c685e0b51cd011b4d39a1fdd6aa2e",
|
|
7
7
|
"packages/schemas/src/index.ts": "67f656f1d7f717bce7e933b9f4d7dc5dc50274dc",
|
|
8
8
|
"packages/schemas/src/schemaBuilder.ts": "1af97440b88f064ad67aa804cbaa0f96622f0a6a",
|
|
9
|
-
"packages/schemas/src/types.ts": "
|
|
9
|
+
"packages/schemas/src/types.ts": "c013bf09120147d7a19e48ce4c8772ee34a2061c",
|
|
10
10
|
"packages/schemas/tsconfig.json": "52e4f044fa580f4e0ad5830f3cfca574e2788372"
|
|
11
11
|
},
|
|
12
12
|
"arguments": "rimraf ./lib/ && tsc "
|
|
File without changes
|
package/lib/types.d.ts
CHANGED
|
@@ -229,3 +229,6 @@ export interface ControlVisitor<A> {
|
|
|
229
229
|
action(d: ActionControlDefinition): A;
|
|
230
230
|
}
|
|
231
231
|
export declare function visitControlDefinition<A>(x: ControlDefinition, visitor: ControlVisitor<A>, defaultValue: (c: ControlDefinition) => A): A;
|
|
232
|
+
export declare function dataControl(field: string, options?: Partial<DataControlDefinition>): DataControlDefinition;
|
|
233
|
+
export declare function fieldValueExpr(field: string, value: any): FieldValueExpression;
|
|
234
|
+
export declare function visibility(expr: EntityExpression): DynamicProperty;
|
package/lib/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visitControlDefinition = exports.isActionControlsDefinition = exports.isDisplayControlsDefinition = exports.isGroupControlsDefinition = exports.isDataControlDefinition = exports.DisplayDataType = exports.GroupRenderType = exports.SyncTextType = exports.DataRenderType = exports.ControlAdornmentType = exports.ExpressionType = exports.DynamicPropertyType = exports.ControlDefinitionType = exports.FieldType = void 0;
|
|
3
|
+
exports.visibility = exports.fieldValueExpr = exports.dataControl = exports.visitControlDefinition = exports.isActionControlsDefinition = exports.isDisplayControlsDefinition = exports.isGroupControlsDefinition = exports.isDataControlDefinition = exports.DisplayDataType = exports.GroupRenderType = exports.SyncTextType = exports.DataRenderType = exports.ControlAdornmentType = exports.ExpressionType = exports.DynamicPropertyType = exports.ControlDefinitionType = exports.FieldType = void 0;
|
|
4
4
|
var FieldType;
|
|
5
5
|
(function (FieldType) {
|
|
6
6
|
FieldType["String"] = "String";
|
|
@@ -98,3 +98,15 @@ function visitControlDefinition(x, visitor, defaultValue) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
exports.visitControlDefinition = visitControlDefinition;
|
|
101
|
+
function dataControl(field, options) {
|
|
102
|
+
return Object.assign({ type: ControlDefinitionType.Data, field }, options);
|
|
103
|
+
}
|
|
104
|
+
exports.dataControl = dataControl;
|
|
105
|
+
function fieldValueExpr(field, value) {
|
|
106
|
+
return { type: ExpressionType.FieldValue, field, value };
|
|
107
|
+
}
|
|
108
|
+
exports.fieldValueExpr = fieldValueExpr;
|
|
109
|
+
function visibility(expr) {
|
|
110
|
+
return { type: DynamicPropertyType.Visible, expr };
|
|
111
|
+
}
|
|
112
|
+
exports.visibility = visibility;
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -319,3 +319,21 @@ export function visitControlDefinition<A>(
|
|
|
319
319
|
return defaultValue(x);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
+
|
|
323
|
+
export function dataControl(
|
|
324
|
+
field: string,
|
|
325
|
+
options?: Partial<DataControlDefinition>
|
|
326
|
+
): DataControlDefinition {
|
|
327
|
+
return { type: ControlDefinitionType.Data, field, ...options };
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export function fieldValueExpr(
|
|
331
|
+
field: string,
|
|
332
|
+
value: any
|
|
333
|
+
): FieldValueExpression {
|
|
334
|
+
return { type: ExpressionType.FieldValue, field, value };
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export function visibility(expr: EntityExpression): DynamicProperty {
|
|
338
|
+
return { type: DynamicPropertyType.Visible, expr };
|
|
339
|
+
}
|