@planeasyinc/fe-core 0.1.18 → 0.1.19

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +31 -8
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -125,16 +125,31 @@ interface UpdateApiActionBase {
125
125
  body?: {
126
126
  [key: string]: any;
127
127
  };
128
- onSuccess?: Array<FeUpdateFormAction | FeUpdateValueAction | FeInvokeAction | FeShowPopupAction>;
129
- onError?: Array<FeShowPopupAction>;
128
+ onSuccess?: FeControlAction[];
129
+ onError?: FeControlAction[];
130
+ }
131
+ interface ControlSourceStatic {
132
+ type: 'static';
133
+ static_value: Record<string, any>;
134
+ }
135
+ interface ControlSourceDynamic {
136
+ type: 'dynamic';
137
+ dynamic_value: {
138
+ entity_name: string;
139
+ type: 'transaction' | 'object';
140
+ body?: {
141
+ [key: string]: any;
142
+ };
143
+ };
130
144
  }
131
145
  interface FeUpdateValueAction extends FeActionBase {
132
146
  type: 'update_value';
133
147
  field_id: string;
134
- value: string;
148
+ value: any;
135
149
  }
136
- interface FeUpdateFormAction extends FeActionBase, UpdateApiActionBase {
150
+ interface FeUpdateFormAction extends FeActionBase {
137
151
  type: 'update_form';
152
+ control_source: ControlSourceDynamic | ControlSourceStatic;
138
153
  }
139
154
  interface FeInvokeAction extends FeActionBase, UpdateApiActionBase {
140
155
  type: 'invoke';
@@ -143,14 +158,22 @@ interface FeShowPopupAction extends FeActionBase {
143
158
  type: 'show_popup';
144
159
  [key: string]: any;
145
160
  }
146
- interface NavigateToSectionAction extends FeActionBase {
161
+ interface FeNavigateToSectionAction extends FeActionBase {
147
162
  type: 'navigate_to_section';
148
163
  section_id: string;
149
164
  }
150
- interface OpenUrlAction extends FeActionBase {
165
+ interface FeOpenUrlAction extends FeActionBase {
151
166
  type: 'open_url';
152
167
  url: string;
153
168
  }
169
+ interface FeDownloadAction extends FeActionBase {
170
+ type: 'download';
171
+ payload: any;
172
+ }
173
+ interface FeScrollTopAction extends FeActionBase {
174
+ type: 'scroll_top';
175
+ }
176
+ type FeControlAction = FeInvokeAction | FeUpdateFormAction | FeUpdateValueAction | FeShowPopupAction | FeNavigateToSectionAction | FeOpenUrlAction | FeDownloadAction | FeScrollTopAction;
154
177
  /**
155
178
  * Base form item configuration (shared by all control types)
156
179
  *
@@ -231,7 +254,7 @@ interface FeBaseFormItemConfig {
231
254
  label: string;
232
255
  action?: 'submit' | 'next' | 'custom';
233
256
  payload?: any;
234
- actions?: Array<FeUpdateFormAction | FeUpdateValueAction | FeInvokeAction | FeShowPopupAction | NavigateToSectionAction | OpenUrlAction>;
257
+ actions?: FeControlAction[];
235
258
  };
236
259
  chatMeta?: {
237
260
  endpoint: string;
@@ -539,4 +562,4 @@ declare class FeFormEngine {
539
562
  }
540
563
  declare function createEngine(schema: FeForm, options?: FeFormEngineOptions, resolvers?: FeFormEngineResolvers): FeFormEngine;
541
564
 
542
- export { type AsyncValidator, type FeActivatorConfig, type FeArrayControlConfig, type FeBackendCondition, type FeBackendConditionGroup, type FeBackendSimpleCondition, type FeBackendValidation, type FeBaseControlConfig, type FeBaseFormItemConfig, type FeCondition, type FeControlConfig, type FeControlType, type FeControlValidatorConfig, type FeControlValueType, type FeDictControlConfig, type FeForm, FeFormEngine, type FeFormEngineEvents, type FeFormEngineOptions, type FeFormEngineResolvers, type FeFormEngineState, type FeGroupCondition, type FeGroupControlConfig, type FeGroupValidatorConfig, type FeInvokeAction, type FeMultiSelectControlConfig, type FeNumberOperationsControlConfig, type FeNumberSliderControlConfig, type FeObjectControlConfig, type FeSection, type FeShowPopupAction, type FeSimpleCondition, type FeSingleSelectControlConfig, type FeTextControlConfig, type FeTextMask, type FeUpdateFormAction, type FeUpdateValueAction, type FieldState, type NavigateToSectionAction, type OpenUrlAction, type RuntimeAPI, type RuntimeState, type Status, type SyncValidator, type ValidationResult, type ValidatorContext, assertFeForm, createEngine, createRuntime, getAsyncValidator, getValidator, registerAsyncValidator, registerValidator };
565
+ export { type AsyncValidator, type FeActivatorConfig, type FeArrayControlConfig, type FeBackendCondition, type FeBackendConditionGroup, type FeBackendSimpleCondition, type FeBackendValidation, type FeBaseControlConfig, type FeBaseFormItemConfig, type FeCondition, type FeControlAction, type FeControlConfig, type FeControlType, type FeControlValidatorConfig, type FeControlValueType, type FeDictControlConfig, type FeDownloadAction, type FeForm, FeFormEngine, type FeFormEngineEvents, type FeFormEngineOptions, type FeFormEngineResolvers, type FeFormEngineState, type FeGroupCondition, type FeGroupControlConfig, type FeGroupValidatorConfig, type FeInvokeAction, type FeMultiSelectControlConfig, type FeNavigateToSectionAction, type FeNumberOperationsControlConfig, type FeNumberSliderControlConfig, type FeObjectControlConfig, type FeOpenUrlAction, type FeScrollTopAction, type FeSection, type FeShowPopupAction, type FeSimpleCondition, type FeSingleSelectControlConfig, type FeTextControlConfig, type FeTextMask, type FeUpdateFormAction, type FeUpdateValueAction, type FieldState, type RuntimeAPI, type RuntimeState, type Status, type SyncValidator, type ValidationResult, type ValidatorContext, assertFeForm, createEngine, createRuntime, getAsyncValidator, getValidator, registerAsyncValidator, registerValidator };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planeasyinc/fe-core",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",