@rippling/rippling-sdk 0.2.0-alpha.37 → 0.2.0-alpha.39
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/examples/sdui/sdui-crud-todo/sdui-crud-todo.ts +3 -3
- package/examples/sdui/sdui-showcase/sdui-showcase.ts +6 -11
- package/examples/sdui/sdui-tab-multi-view/sdui-tab-multi-view.ts +14 -24
- package/examples/sdui/vote/vote.ts +7 -11
- package/lib/manifest/app.d.mts +11 -1
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +11 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +42 -1
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +42 -1
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +14 -3
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +14 -3
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +25 -3
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +25 -3
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +13 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +13 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +22 -1
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +22 -1
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +23 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +23 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +45 -2
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +45 -2
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +41 -2
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +41 -2
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +70 -3
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +70 -3
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +87 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -0
- package/lib/manifest/existing-manifest-context.d.ts +87 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -0
- package/lib/manifest/existing-manifest-context.js +511 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -0
- package/lib/manifest/existing-manifest-context.mjs +506 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -0
- package/lib/manifest/field.d.mts +44 -2
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +44 -2
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +134 -3
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +134 -3
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/index.d.mts +8 -7
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +8 -7
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js +3 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs +5 -4
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +17 -0
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +17 -0
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +38 -1
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +38 -1
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +60 -7
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +60 -7
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +62 -4
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +62 -4
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +18 -3
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +18 -3
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +44 -3
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +44 -3
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +17 -0
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +17 -0
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +45 -1
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +45 -1
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +10 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +10 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +28 -1
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +28 -1
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +17 -0
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +17 -0
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +31 -1
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +31 -1
- package/lib/manifest/validation.mjs.map +1 -1
- package/lib/sdui/actions.d.mts.map +1 -1
- package/lib/sdui/actions.d.ts.map +1 -1
- package/lib/sdui/actions.js +23 -13
- package/lib/sdui/actions.js.map +1 -1
- package/lib/sdui/actions.mjs +23 -13
- package/lib/sdui/actions.mjs.map +1 -1
- package/lib/sdui/component.d.mts +28 -11
- package/lib/sdui/component.d.mts.map +1 -1
- package/lib/sdui/component.d.ts +28 -11
- package/lib/sdui/component.d.ts.map +1 -1
- package/lib/sdui/component.js +69 -36
- package/lib/sdui/component.js.map +1 -1
- package/lib/sdui/component.mjs +69 -36
- package/lib/sdui/component.mjs.map +1 -1
- package/lib/sdui/components.d.mts +1141 -132
- package/lib/sdui/components.d.mts.map +1 -1
- package/lib/sdui/components.d.ts +1141 -132
- package/lib/sdui/components.d.ts.map +1 -1
- package/lib/sdui/components.js +834 -206
- package/lib/sdui/components.js.map +1 -1
- package/lib/sdui/components.mjs +830 -203
- package/lib/sdui/components.mjs.map +1 -1
- package/lib/sdui/directives.d.mts.map +1 -1
- package/lib/sdui/directives.d.ts.map +1 -1
- package/lib/sdui/directives.js +4 -1
- package/lib/sdui/directives.js.map +1 -1
- package/lib/sdui/directives.mjs +4 -1
- package/lib/sdui/directives.mjs.map +1 -1
- package/lib/sdui/index.d.mts +314 -261
- package/lib/sdui/index.d.mts.map +1 -1
- package/lib/sdui/index.d.ts +314 -261
- package/lib/sdui/index.d.ts.map +1 -1
- package/lib/sdui/index.js +255 -204
- package/lib/sdui/index.js.map +1 -1
- package/lib/sdui/index.mjs +128 -103
- package/lib/sdui/index.mjs.map +1 -1
- package/lib/sdui/propTypes.d.mts +6330 -0
- package/lib/sdui/propTypes.d.mts.map +1 -0
- package/lib/sdui/propTypes.d.ts +6330 -0
- package/lib/sdui/propTypes.d.ts.map +1 -0
- package/lib/sdui/propTypes.js +14 -0
- package/lib/sdui/propTypes.js.map +1 -0
- package/lib/sdui/propTypes.mjs +13 -0
- package/lib/sdui/propTypes.mjs.map +1 -0
- package/lib/sdui/render.d.mts +1 -1
- package/lib/sdui/render.d.mts.map +1 -1
- package/lib/sdui/render.d.ts +1 -1
- package/lib/sdui/render.d.ts.map +1 -1
- package/lib/sdui/render.js +11 -3
- package/lib/sdui/render.js.map +1 -1
- package/lib/sdui/render.mjs +11 -3
- package/lib/sdui/render.mjs.map +1 -1
- package/lib/sdui/state.d.mts.map +1 -1
- package/lib/sdui/state.d.ts.map +1 -1
- package/lib/sdui/state.js +3 -1
- package/lib/sdui/state.js.map +1 -1
- package/lib/sdui/state.mjs +3 -1
- package/lib/sdui/state.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/app.ts +46 -2
- package/src/lib/manifest/category.ts +35 -7
- package/src/lib/manifest/custom-object-field-section.ts +37 -1
- package/src/lib/manifest/custom-object-page-layout.ts +67 -2
- package/src/lib/manifest/custom-object.ts +88 -4
- package/src/lib/manifest/existing-manifest-context.ts +673 -0
- package/src/lib/manifest/field.ts +160 -3
- package/src/lib/manifest/index.ts +39 -4
- package/src/lib/manifest/list-view.ts +50 -1
- package/src/lib/manifest/manifest-builder.ts +115 -5
- package/src/lib/manifest/manifest-function.ts +44 -4
- package/src/lib/manifest/rule.ts +60 -1
- package/src/lib/manifest/sdui-page.ts +37 -2
- package/src/lib/manifest/validation.ts +48 -1
- package/src/lib/sdui/actions.ts +23 -10
- package/src/lib/sdui/component.ts +84 -44
- package/src/lib/sdui/components.ts +1627 -212
- package/src/lib/sdui/directives.ts +4 -1
- package/src/lib/sdui/index.ts +565 -200
- package/src/lib/sdui/propTypes.ts +8470 -0
- package/src/lib/sdui/render.ts +13 -5
- package/src/lib/sdui/state.ts +8 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ValidationLevel, type ValidationState } from "./_helpers.mjs";
|
|
2
2
|
import type { CustomObject } from "./custom-object.mjs";
|
|
3
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.mjs";
|
|
3
4
|
import type { Field } from "./field.mjs";
|
|
5
|
+
import type { ManifestComponentDeletion } from "./manifest-builder.mjs";
|
|
6
|
+
export interface ValidationDeletionIdentifier {
|
|
7
|
+
ruleId: string;
|
|
8
|
+
modelRqlName: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Initialization properties for {@link Validation}.
|
|
6
12
|
*/
|
|
@@ -57,6 +63,9 @@ export interface ValidationProps {
|
|
|
57
63
|
*/
|
|
58
64
|
fieldRef?: Field;
|
|
59
65
|
}
|
|
66
|
+
export interface ValidationLoadFromExistingOptions extends ExistingManifestContextOptions {
|
|
67
|
+
customObjectApiName?: string;
|
|
68
|
+
}
|
|
60
69
|
/**
|
|
61
70
|
* Defines a validation rule and registers it with the manifest.
|
|
62
71
|
*
|
|
@@ -83,6 +92,8 @@ export interface ValidationProps {
|
|
|
83
92
|
* ```
|
|
84
93
|
*/
|
|
85
94
|
export declare class Validation {
|
|
95
|
+
static readonly componentType: "CUSTOM_OBJECT_VALIDATION_RULE";
|
|
96
|
+
static toDeletionIdentifier(identifier: ValidationDeletionIdentifier): ManifestComponentDeletion;
|
|
86
97
|
private readonly _ruleId;
|
|
87
98
|
private readonly _customObjectApiName;
|
|
88
99
|
private readonly _displayName;
|
|
@@ -97,6 +108,12 @@ export declare class Validation {
|
|
|
97
108
|
* @param props - Initialization properties.
|
|
98
109
|
*/
|
|
99
110
|
constructor(customObject: CustomObject, props: ValidationProps);
|
|
111
|
+
/**
|
|
112
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
113
|
+
*/
|
|
114
|
+
static loadFromExisting(ruleId: string, options?: ValidationLoadFromExistingOptions): Validation;
|
|
115
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
116
|
+
static _fromExistingComponent(customObject: CustomObject, component: Record<string, any>, resolveField: (apiName: string) => Field): Validation;
|
|
100
117
|
/**
|
|
101
118
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
102
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,KAAK,EAAE,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"validation.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,yBAAyB,EAAE;AAEzC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB;;;;OAIG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,WAAW,iCAAkC,SAAQ,8BAA8B;IACvF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAG,+BAA+B,CAAU;IAEzE,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,4BAA4B,GAAG,yBAAyB;IAQhG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C;;;OAGG;gBACS,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAa9D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iCAAsC,GAAG,UAAU;IAIpG,6EAA6E;IAC7E,MAAM,CAAC,sBAAsB,CAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GACvC,UAAU;IAcb;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe9B"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ValidationLevel, type ValidationState } from "./_helpers.js";
|
|
2
2
|
import type { CustomObject } from "./custom-object.js";
|
|
3
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
3
4
|
import type { Field } from "./field.js";
|
|
5
|
+
import type { ManifestComponentDeletion } from "./manifest-builder.js";
|
|
6
|
+
export interface ValidationDeletionIdentifier {
|
|
7
|
+
ruleId: string;
|
|
8
|
+
modelRqlName: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Initialization properties for {@link Validation}.
|
|
6
12
|
*/
|
|
@@ -57,6 +63,9 @@ export interface ValidationProps {
|
|
|
57
63
|
*/
|
|
58
64
|
fieldRef?: Field;
|
|
59
65
|
}
|
|
66
|
+
export interface ValidationLoadFromExistingOptions extends ExistingManifestContextOptions {
|
|
67
|
+
customObjectApiName?: string;
|
|
68
|
+
}
|
|
60
69
|
/**
|
|
61
70
|
* Defines a validation rule and registers it with the manifest.
|
|
62
71
|
*
|
|
@@ -83,6 +92,8 @@ export interface ValidationProps {
|
|
|
83
92
|
* ```
|
|
84
93
|
*/
|
|
85
94
|
export declare class Validation {
|
|
95
|
+
static readonly componentType: "CUSTOM_OBJECT_VALIDATION_RULE";
|
|
96
|
+
static toDeletionIdentifier(identifier: ValidationDeletionIdentifier): ManifestComponentDeletion;
|
|
86
97
|
private readonly _ruleId;
|
|
87
98
|
private readonly _customObjectApiName;
|
|
88
99
|
private readonly _displayName;
|
|
@@ -97,6 +108,12 @@ export declare class Validation {
|
|
|
97
108
|
* @param props - Initialization properties.
|
|
98
109
|
*/
|
|
99
110
|
constructor(customObject: CustomObject, props: ValidationProps);
|
|
111
|
+
/**
|
|
112
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
113
|
+
*/
|
|
114
|
+
static loadFromExisting(ruleId: string, options?: ValidationLoadFromExistingOptions): Validation;
|
|
115
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
116
|
+
static _fromExistingComponent(customObject: CustomObject, component: Record<string, any>, resolveField: (apiName: string) => Field): Validation;
|
|
100
117
|
/**
|
|
101
118
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
102
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAA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AAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C;;;OAGG;gBACS,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAa9D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iCAAsC,GAAG,UAAU;IAIpG,6EAA6E;IAC7E,MAAM,CAAC,sBAAsB,CAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GACvC,UAAU;IAcb;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe9B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Validation = void 0;
|
|
4
4
|
const _helpers_1 = require("./_helpers.js");
|
|
5
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
5
6
|
/**
|
|
6
7
|
* Defines a validation rule and registers it with the manifest.
|
|
7
8
|
*
|
|
@@ -28,6 +29,13 @@ const _helpers_1 = require("./_helpers.js");
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
class Validation {
|
|
32
|
+
static toDeletionIdentifier(identifier) {
|
|
33
|
+
return {
|
|
34
|
+
type: Validation.componentType,
|
|
35
|
+
rule_id: identifier.ruleId,
|
|
36
|
+
model_rql_name: identifier.modelRqlName,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
31
39
|
/**
|
|
32
40
|
* @param customObject - The custom object this rule applies to.
|
|
33
41
|
* @param props - Initialization properties.
|
|
@@ -44,6 +52,27 @@ class Validation {
|
|
|
44
52
|
this._fieldRef = props.fieldRef;
|
|
45
53
|
customObject._register(this);
|
|
46
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
57
|
+
*/
|
|
58
|
+
static loadFromExisting(ruleId, options = {}) {
|
|
59
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadValidation(ruleId, options);
|
|
60
|
+
}
|
|
61
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
62
|
+
static _fromExistingComponent(customObject, component, resolveField) {
|
|
63
|
+
const props = {
|
|
64
|
+
ruleId: component['rule_id'],
|
|
65
|
+
displayName: component['display_name'] ?? component['rule_id'],
|
|
66
|
+
rqlFormula: component['rql_formula'] ?? '',
|
|
67
|
+
errorMessage: component['custom_error_message'] ?? '',
|
|
68
|
+
state: component['state'],
|
|
69
|
+
level: component['level'],
|
|
70
|
+
ruleDescription: component['rule_description'] ?? '',
|
|
71
|
+
};
|
|
72
|
+
if (component['field_rql_name'] != null)
|
|
73
|
+
props.fieldRef = resolveField(component['field_rql_name']);
|
|
74
|
+
return new Validation(customObject, props);
|
|
75
|
+
}
|
|
47
76
|
/**
|
|
48
77
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
49
78
|
*/
|
|
@@ -64,7 +93,7 @@ class Validation {
|
|
|
64
93
|
*/
|
|
65
94
|
toDict() {
|
|
66
95
|
const component = {
|
|
67
|
-
type:
|
|
96
|
+
type: Validation.componentType,
|
|
68
97
|
model_rql_name: this._customObjectApiName,
|
|
69
98
|
rule_id: this._ruleId,
|
|
70
99
|
state: this._state,
|
|
@@ -80,4 +109,5 @@ class Validation {
|
|
|
80
109
|
}
|
|
81
110
|
}
|
|
82
111
|
exports.Validation = Validation;
|
|
112
|
+
Validation.componentType = 'CUSTOM_OBJECT_VALIDATION_RULE';
|
|
83
113
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":";;;AAAA,4CAAoF;
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":";;;AAAA,4CAAoF;AAEpF,8EAA8G;AAsE9G;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,UAAU;IAGrB,MAAM,CAAC,oBAAoB,CAAC,UAAwC;QAClE,OAAO;YACL,IAAI,EAAE,UAAU,CAAC,aAAa;YAC9B,OAAO,EAAE,UAAU,CAAC,MAAM;YAC1B,cAAc,EAAE,UAAU,CAAC,YAAY;SACxC,CAAC;IACJ,CAAC;IAYD;;;OAGG;IACH,YAAY,YAA0B,EAAE,KAAsB;QAC5D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,IAAI,IAAA,qBAAU,EAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,oBAAoB,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,CAA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CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,oBAAoB,EAAE,IAAI,CAAC,aAAa;YACxC,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QACF,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI;YAAE,SAAS,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QACtF,OAAO,SAAS,CAAC;IACnB,CAAC;;AAlGH,gCAmGC;AAlGiB,wBAAa,GAAG,+BAAwC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { generateId } from "./_helpers.mjs";
|
|
2
|
+
import { getExistingManifestContext } from "./existing-manifest-context.mjs";
|
|
2
3
|
/**
|
|
3
4
|
* Defines a validation rule and registers it with the manifest.
|
|
4
5
|
*
|
|
@@ -25,6 +26,13 @@ import { generateId } from "./_helpers.mjs";
|
|
|
25
26
|
* ```
|
|
26
27
|
*/
|
|
27
28
|
export class Validation {
|
|
29
|
+
static toDeletionIdentifier(identifier) {
|
|
30
|
+
return {
|
|
31
|
+
type: Validation.componentType,
|
|
32
|
+
rule_id: identifier.ruleId,
|
|
33
|
+
model_rql_name: identifier.modelRqlName,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
28
36
|
/**
|
|
29
37
|
* @param customObject - The custom object this rule applies to.
|
|
30
38
|
* @param props - Initialization properties.
|
|
@@ -41,6 +49,27 @@ export class Validation {
|
|
|
41
49
|
this._fieldRef = props.fieldRef;
|
|
42
50
|
customObject._register(this);
|
|
43
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
54
|
+
*/
|
|
55
|
+
static loadFromExisting(ruleId, options = {}) {
|
|
56
|
+
return getExistingManifestContext(options).loadValidation(ruleId, options);
|
|
57
|
+
}
|
|
58
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
59
|
+
static _fromExistingComponent(customObject, component, resolveField) {
|
|
60
|
+
const props = {
|
|
61
|
+
ruleId: component['rule_id'],
|
|
62
|
+
displayName: component['display_name'] ?? component['rule_id'],
|
|
63
|
+
rqlFormula: component['rql_formula'] ?? '',
|
|
64
|
+
errorMessage: component['custom_error_message'] ?? '',
|
|
65
|
+
state: component['state'],
|
|
66
|
+
level: component['level'],
|
|
67
|
+
ruleDescription: component['rule_description'] ?? '',
|
|
68
|
+
};
|
|
69
|
+
if (component['field_rql_name'] != null)
|
|
70
|
+
props.fieldRef = resolveField(component['field_rql_name']);
|
|
71
|
+
return new Validation(customObject, props);
|
|
72
|
+
}
|
|
44
73
|
/**
|
|
45
74
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
46
75
|
*/
|
|
@@ -61,7 +90,7 @@ export class Validation {
|
|
|
61
90
|
*/
|
|
62
91
|
toDict() {
|
|
63
92
|
const component = {
|
|
64
|
-
type:
|
|
93
|
+
type: Validation.componentType,
|
|
65
94
|
model_rql_name: this._customObjectApiName,
|
|
66
95
|
rule_id: this._ruleId,
|
|
67
96
|
state: this._state,
|
|
@@ -76,4 +105,5 @@ export class Validation {
|
|
|
76
105
|
return component;
|
|
77
106
|
}
|
|
78
107
|
}
|
|
108
|
+
Validation.componentType = 'CUSTOM_OBJECT_VALIDATION_RULE';
|
|
79
109
|
//# sourceMappingURL=validation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.mjs","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAA8C;
|
|
1
|
+
{"version":3,"file":"validation.mjs","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAA8C;OAE1D,EAAE,0BAA0B,EAAuC;AAsE1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e,wBAAa,GAAG,+BAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.mts","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,aAAa,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC7D,OAAO,CAAC,EAAE,aAAa,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CAC5D;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,CAE/D;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"actions.d.mts","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,aAAa,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC7D,OAAO,CAAC,EAAE,aAAa,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CAC5D;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,CAE/D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AG,aAAa,CAEnF;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAEtE;AAED,wBAAgB,QAAQ,CAAC,SAAS,SAAoB,GAAG,aAAa,CAErE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAExD;AAED,wBAAgB,UAAU,IAAI,aAAa,CAE1C"}
|
package/lib/sdui/actions.js
CHANGED
|
@@ -14,25 +14,35 @@ function set(ref, value) {
|
|
|
14
14
|
return { action: 'setState', params: { statePath: (0, state_1.extractPath)(ref), value } };
|
|
15
15
|
}
|
|
16
16
|
function push(ref, value, opts) {
|
|
17
|
-
const params = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const params = {
|
|
18
|
+
statePath: (0, state_1.extractPath)(ref),
|
|
19
|
+
value,
|
|
20
|
+
...(opts?.clear ? { clearStatePath: (0, state_1.extractPath)(opts.clear) } : {}),
|
|
21
|
+
};
|
|
21
22
|
return { action: 'pushState', params };
|
|
22
23
|
}
|
|
23
24
|
function remove(ref, index) {
|
|
24
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
action: 'removeState',
|
|
27
|
+
params: { statePath: (0, state_1.extractPath)(ref), index },
|
|
28
|
+
};
|
|
25
29
|
}
|
|
26
30
|
function callFunction(functionId, action, opts) {
|
|
27
31
|
const { responsePath, onSuccess, onError, ...rest } = opts || {};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
// Spread rest FIRST so explicit functionId/action always win if opts
|
|
33
|
+
// happens to carry colliding keys.
|
|
34
|
+
const params = {
|
|
35
|
+
...rest,
|
|
36
|
+
functionId,
|
|
37
|
+
action,
|
|
38
|
+
...(responsePath !== undefined ? { responsePath } : {}),
|
|
39
|
+
};
|
|
40
|
+
const binding = {
|
|
41
|
+
action: 'triggerFunction',
|
|
42
|
+
params,
|
|
43
|
+
...(onSuccess ? { onSuccess: onSuccess } : {}),
|
|
44
|
+
...(onError ? { onError: onError } : {}),
|
|
45
|
+
};
|
|
36
46
|
return binding;
|
|
37
47
|
}
|
|
38
48
|
function nav(config) {
|
package/lib/sdui/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":";;AASA,kBAEC;AAED,
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":";;AASA,kBAEC;AAED,oBAOC;AAED,wBAKC;AAED,oCAqBC;AAED,kBAEC;AAED,wBAEC;AAED,4BAEC;AAED,8BAEC;AAED,gCAEC;AAtED,sCAAsC;AAStC,SAAgB,GAAG,CAAC,GAAY,EAAE,KAAc;IAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAA,mBAAW,EAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;AAChF,CAAC;AAED,SAAgB,IAAI,CAAC,GAAY,EAAE,KAAc,EAAE,IAA0B;IAC3E,MAAM,MAAM,GAA4B;QACtC,SAAS,EAAE,IAAA,mBAAW,EAAC,GAAG,CAAC;QAC3B,KAAK;QACL,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAA,mBAAW,EAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC;AAED,SAAgB,MAAM,CAAC,GAAY,EAAE,KAAc;IACjD,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAA,mBAAW,EAAC,GAAG,CAAC,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AAO,EAAE,EAAE,CAAC;AACtD,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClC,CAAC"}
|
package/lib/sdui/actions.mjs
CHANGED
|
@@ -3,25 +3,35 @@ export function set(ref, value) {
|
|
|
3
3
|
return { action: 'setState', params: { statePath: extractPath(ref), value } };
|
|
4
4
|
}
|
|
5
5
|
export function push(ref, value, opts) {
|
|
6
|
-
const params = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const params = {
|
|
7
|
+
statePath: extractPath(ref),
|
|
8
|
+
value,
|
|
9
|
+
...(opts?.clear ? { clearStatePath: extractPath(opts.clear) } : {}),
|
|
10
|
+
};
|
|
10
11
|
return { action: 'pushState', params };
|
|
11
12
|
}
|
|
12
13
|
export function remove(ref, index) {
|
|
13
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
action: 'removeState',
|
|
16
|
+
params: { statePath: extractPath(ref), index },
|
|
17
|
+
};
|
|
14
18
|
}
|
|
15
19
|
export function callFunction(functionId, action, opts) {
|
|
16
20
|
const { responsePath, onSuccess, onError, ...rest } = opts || {};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
// Spread rest FIRST so explicit functionId/action always win if opts
|
|
22
|
+
// happens to carry colliding keys.
|
|
23
|
+
const params = {
|
|
24
|
+
...rest,
|
|
25
|
+
functionId,
|
|
26
|
+
action,
|
|
27
|
+
...(responsePath !== undefined ? { responsePath } : {}),
|
|
28
|
+
};
|
|
29
|
+
const binding = {
|
|
30
|
+
action: 'triggerFunction',
|
|
31
|
+
params,
|
|
32
|
+
...(onSuccess ? { onSuccess: onSuccess } : {}),
|
|
33
|
+
...(onError ? { onError: onError } : {}),
|
|
34
|
+
};
|
|
25
35
|
return binding;
|
|
26
36
|
}
|
|
27
37
|
export function nav(config) {
|
package/lib/sdui/actions.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.mjs","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;AAStB,MAAM,UAAU,GAAG,CAAC,GAAY,EAAE,KAAc;IAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAY,EAAE,KAAc,EAAE,IAA0B;IAC3E,MAAM,MAAM,GAA4B,
|
|
1
|
+
{"version":3,"file":"actions.mjs","sourceRoot":"","sources":["../../src/lib/sdui/actions.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;AAStB,MAAM,UAAU,GAAG,CAAC,GAAY,EAAE,KAAc;IAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAY,EAAE,KAAc,EAAE,IAA0B;IAC3E,MAAM,MAAM,GAA4B;QACtC,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC;QAC3B,KAAK;QACL,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAY,EAAE,KAAc;IACjD,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,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AAM,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClC,CAAC"}
|
package/lib/sdui/component.d.mts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* component() — creates a stateful component boundary.
|
|
3
3
|
*
|
|
4
|
-
* Provides ctx.
|
|
5
|
-
*
|
|
4
|
+
* Provides ctx.localState (scoped local state slot) and ctx.onMount (an
|
|
5
|
+
* action that fires once when the component mounts on the client). The
|
|
6
|
+
* runtime handles state setup and mount firing; consumers don't need to
|
|
7
|
+
* know how the wrapping is implemented.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: these are NOT React hooks. The factory runs ONCE at spec-build
|
|
10
|
+
* time, producing a JSON description of the UI. `localState` returns a
|
|
11
|
+
* path-builder proxy (not a [value, setter] tuple); `onMount` registers
|
|
12
|
+
* a JSON action that fires on first client render (not an effect that
|
|
13
|
+
* re-runs).
|
|
6
14
|
*
|
|
7
15
|
* Usage:
|
|
8
16
|
* function MembersGrid(props) {
|
|
9
17
|
* return component((ctx) => {
|
|
10
|
-
* const local = ctx.
|
|
11
|
-
* ctx.
|
|
12
|
-
* return { element: DataGrid({ ... })
|
|
18
|
+
* const local = ctx.localState({ data: [], loading: true })
|
|
19
|
+
* ctx.onMount(fetchAction)
|
|
20
|
+
* return { element: DataGrid({ ... }) }
|
|
13
21
|
* })
|
|
14
22
|
* }
|
|
15
23
|
*/
|
|
16
|
-
import type { SpecNode } from "./components.mjs";
|
|
17
24
|
import type { ActionBinding } from "./actions.mjs";
|
|
25
|
+
import type { SpecNode } from "./components.mjs";
|
|
18
26
|
export declare function _resetIdCounter(): void;
|
|
19
27
|
export interface StateScope {
|
|
20
28
|
/** Read state value: { $state: "/auto_xxx/field" } */
|
|
@@ -27,14 +35,23 @@ export interface StateScope {
|
|
|
27
35
|
readonly $path: string;
|
|
28
36
|
}
|
|
29
37
|
interface ComponentContext {
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Declare a scoped local state slot. Returns a path-builder proxy whose
|
|
40
|
+
* property accesses produce `{ $state: '/path' }` references for reading
|
|
41
|
+
* and `.$bind` for two-way binding. Not a React hook — runs once when
|
|
42
|
+
* the factory is invoked, never returns `[value, setter]`.
|
|
43
|
+
*/
|
|
44
|
+
localState<T extends Record<string, unknown>>(initial: T): StateScope;
|
|
45
|
+
/**
|
|
46
|
+
* Register a JSON action to fire once when the component mounts on the
|
|
47
|
+
* client. Not a React effect — does not re-run, has no dependency
|
|
48
|
+
* tracking. Pass an `ActionBinding` (e.g. from `set(...)`, `callFunction(...)`)
|
|
49
|
+
* or an array of them.
|
|
50
|
+
*/
|
|
51
|
+
onMount(action: ActionBinding | ActionBinding[]): void;
|
|
34
52
|
}
|
|
35
53
|
interface ComponentResult {
|
|
36
54
|
element: SpecNode;
|
|
37
|
-
[key: string]: any;
|
|
38
55
|
}
|
|
39
56
|
export declare function component(factory: (ctx: ComponentContext) => ComponentResult): ComponentResult;
|
|
40
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.mts","sourceRoot":"","sources":["../../src/lib/sdui/component.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component.d.mts","sourceRoot":"","sources":["../../src/lib/sdui/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;OAEI,KAAK,EAAE,aAAa,EAAE;OACtB,KAAK,EAAE,QAAQ,EAAE;AAaxB,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,sBAAsB;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;IAEtE;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC;CACxD;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,QAAQ,CAAC;CACnB;AAkBD,wBAAgB,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,eAAe,GAAG,eAAe,CAwE9F"}
|
package/lib/sdui/component.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* component() — creates a stateful component boundary.
|
|
3
3
|
*
|
|
4
|
-
* Provides ctx.
|
|
5
|
-
*
|
|
4
|
+
* Provides ctx.localState (scoped local state slot) and ctx.onMount (an
|
|
5
|
+
* action that fires once when the component mounts on the client). The
|
|
6
|
+
* runtime handles state setup and mount firing; consumers don't need to
|
|
7
|
+
* know how the wrapping is implemented.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: these are NOT React hooks. The factory runs ONCE at spec-build
|
|
10
|
+
* time, producing a JSON description of the UI. `localState` returns a
|
|
11
|
+
* path-builder proxy (not a [value, setter] tuple); `onMount` registers
|
|
12
|
+
* a JSON action that fires on first client render (not an effect that
|
|
13
|
+
* re-runs).
|
|
6
14
|
*
|
|
7
15
|
* Usage:
|
|
8
16
|
* function MembersGrid(props) {
|
|
9
17
|
* return component((ctx) => {
|
|
10
|
-
* const local = ctx.
|
|
11
|
-
* ctx.
|
|
12
|
-
* return { element: DataGrid({ ... })
|
|
18
|
+
* const local = ctx.localState({ data: [], loading: true })
|
|
19
|
+
* ctx.onMount(fetchAction)
|
|
20
|
+
* return { element: DataGrid({ ... }) }
|
|
13
21
|
* })
|
|
14
22
|
* }
|
|
15
23
|
*/
|
|
16
|
-
import type { SpecNode } from "./components.js";
|
|
17
24
|
import type { ActionBinding } from "./actions.js";
|
|
25
|
+
import type { SpecNode } from "./components.js";
|
|
18
26
|
export declare function _resetIdCounter(): void;
|
|
19
27
|
export interface StateScope {
|
|
20
28
|
/** Read state value: { $state: "/auto_xxx/field" } */
|
|
@@ -27,14 +35,23 @@ export interface StateScope {
|
|
|
27
35
|
readonly $path: string;
|
|
28
36
|
}
|
|
29
37
|
interface ComponentContext {
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Declare a scoped local state slot. Returns a path-builder proxy whose
|
|
40
|
+
* property accesses produce `{ $state: '/path' }` references for reading
|
|
41
|
+
* and `.$bind` for two-way binding. Not a React hook — runs once when
|
|
42
|
+
* the factory is invoked, never returns `[value, setter]`.
|
|
43
|
+
*/
|
|
44
|
+
localState<T extends Record<string, unknown>>(initial: T): StateScope;
|
|
45
|
+
/**
|
|
46
|
+
* Register a JSON action to fire once when the component mounts on the
|
|
47
|
+
* client. Not a React effect — does not re-run, has no dependency
|
|
48
|
+
* tracking. Pass an `ActionBinding` (e.g. from `set(...)`, `callFunction(...)`)
|
|
49
|
+
* or an array of them.
|
|
50
|
+
*/
|
|
51
|
+
onMount(action: ActionBinding | ActionBinding[]): void;
|
|
34
52
|
}
|
|
35
53
|
interface ComponentResult {
|
|
36
54
|
element: SpecNode;
|
|
37
|
-
[key: string]: any;
|
|
38
55
|
}
|
|
39
56
|
export declare function component(factory: (ctx: ComponentContext) => ComponentResult): ComponentResult;
|
|
40
57
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/lib/sdui/component.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/lib/sdui/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;OAEI,KAAK,EAAE,aAAa,EAAE;OACtB,KAAK,EAAE,QAAQ,EAAE;AAaxB,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,sBAAsB;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;IAEtE;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC;CACxD;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,QAAQ,CAAC;CACnB;AAkBD,wBAAgB,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,eAAe,GAAG,eAAe,CAwE9F"}
|