@masterteam/components 0.0.92 → 0.0.93

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.
@@ -28,6 +28,30 @@ interface FieldRelationConfig {
28
28
  value: any;
29
29
  action: FieldRelationAction;
30
30
  }
31
+ type FormulaConditionMode = 'auto' | 'show' | 'hide' | 'enable' | 'disable';
32
+ interface FormulaConditionConfig {
33
+ formulaTokens: string;
34
+ formulaText?: string;
35
+ mode?: FormulaConditionMode;
36
+ }
37
+ type FormulaValidationSeverity = 'error' | 'warning';
38
+ interface FormulaValidationRuleConfig {
39
+ id: string | number;
40
+ formulaTokens: string;
41
+ formulaText?: string;
42
+ message: string;
43
+ severity: FormulaValidationSeverity;
44
+ enabled: boolean;
45
+ }
46
+ type FormulaRuntimeMessageCode = 'FORMULA_PARSE_ERROR' | 'FORMULA_EVALUATION_ERROR' | 'FORMULA_FALSE';
47
+ interface FormulaRuntimeMessage {
48
+ code: FormulaRuntimeMessageCode;
49
+ severity: FormulaValidationSeverity;
50
+ message: string;
51
+ formulaText?: string;
52
+ ruleId?: string | number;
53
+ fieldKey?: string;
54
+ }
31
55
  interface ResponsiveColSpan {
32
56
  xs?: number;
33
57
  sm?: number;
@@ -73,6 +97,7 @@ declare abstract class BaseFieldConfig {
73
97
  defaultValue?: any;
74
98
  customTemplate: string;
75
99
  relations: FieldRelationConfig[];
100
+ formulaCondition?: FormulaConditionConfig;
76
101
  constructor(config: {
77
102
  key?: string;
78
103
  label?: string;
@@ -87,6 +112,7 @@ declare abstract class BaseFieldConfig {
87
112
  validators?: ValidatorConfig[];
88
113
  order?: number;
89
114
  relations?: FieldRelationConfig[];
115
+ formulaCondition?: FormulaConditionConfig;
90
116
  colSpan?: number | ResponsiveColSpan;
91
117
  });
92
118
  }
@@ -404,6 +430,7 @@ interface LayoutConfig {
404
430
  interface DynamicFormConfig {
405
431
  sections: SectionConfig[];
406
432
  layout?: LayoutConfig;
433
+ validationRules?: FormulaValidationRuleConfig[];
407
434
  }
408
435
  interface SectionConfig {
409
436
  key?: string;
@@ -740,4 +767,4 @@ declare function getLightColor(hexColor: string): string;
740
767
  declare function getContrastColor(bgColor: string): string;
741
768
 
742
769
  export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DateFieldConfig, EditorFieldConfig, IconFieldConfig, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTMessages, setLoadingError, startLoading, wrapValidatorWithMessage };
743
- export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, LayoutConfig, LoadingStateShape, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, SectionConfig, ValidatorType };
770
+ export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, SectionConfig, ValidatorType };