@dartech/arsenal-ui 1.5.96 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/index.esm.js +1 -1
  2. package/package.json +1 -2
  3. package/src/consts/index.d.ts +3 -0
  4. package/src/interfaces/{definition3.d.ts → dem.d.ts} +59 -2
  5. package/src/interfaces/index.d.ts +1 -2
  6. package/src/interfaces/ui.d.ts +1 -1
  7. package/src/lib/Definition/CreateDefinition/CreateDefinition.d.ts +5 -8
  8. package/src/lib/Definition/CreateDefinition/index.d.ts +0 -1
  9. package/src/lib/Definition/DefinitionFiller/DefinitionFiller.d.ts +4 -8
  10. package/src/lib/Definition/DefinitionFiller/index.d.ts +0 -1
  11. package/src/lib/Definition/{Dem3DefinitionView/Dem3DefinitionView.d.ts → DefinitionView/DefinitionView.d.ts} +2 -2
  12. package/src/lib/Definition/DefinitionView/index.d.ts +1 -0
  13. package/src/lib/Definition/index.d.ts +1 -2
  14. package/src/lib/{Property/PropertyValidator/PropertyValidator.d.ts → DefinitionNode/DemValidator/DemValidator.d.ts} +2 -2
  15. package/src/lib/DefinitionNode/DemValidator/DemValidatorContext.d.ts +3 -0
  16. package/src/lib/DefinitionNode/DemValidator/index.d.ts +2 -0
  17. package/src/lib/DefinitionNode/UpsertNode/NodeAdditionalFields/NodeAdditionalFields.d.ts +1 -2
  18. package/src/lib/Forms/{ControlAceEditor.d.ts → ControlCodeEditor.d.ts} +3 -3
  19. package/src/lib/Forms/index.d.ts +1 -1
  20. package/src/lib/Table/DataGrid/DataGrid.styled.d.ts +1 -1
  21. package/src/lib/index.d.ts +0 -1
  22. package/src/utils/dem.d.ts +16 -15
  23. package/src/utils/index.d.ts +0 -1
  24. package/src/utils/validators.d.ts +0 -2
  25. package/src/interfaces/definition.d.ts +0 -174
  26. package/src/lib/Definition/CreateDefinition/Dem3CreateDefinition.d.ts +0 -23
  27. package/src/lib/Definition/DefinitionFiller/Dem3DefinitionFiller.d.ts +0 -17
  28. package/src/lib/Definition/DefinitionValueView/DefinitionValueView.d.ts +0 -8
  29. package/src/lib/Definition/DefinitionValueView/FileDefinitionValueView.d.ts +0 -8
  30. package/src/lib/Definition/DefinitionValueView/PropertyDataView.d.ts +0 -9
  31. package/src/lib/Definition/DefinitionValueView/index.d.ts +0 -1
  32. package/src/lib/Definition/Dem3DefinitionView/index.d.ts +0 -1
  33. package/src/lib/DefinitionNode/ViewNode/PropertyItem.d.ts +0 -9
  34. package/src/lib/Property/PropertyFiller/ControlFiller/ControlMultiplePropertyFiller.d.ts +0 -26
  35. package/src/lib/Property/PropertyFiller/ControlFiller/ControlMultiplePropertyWidget.d.ts +0 -24
  36. package/src/lib/Property/PropertyFiller/ControlFiller/ControlPropertyFiller.d.ts +0 -26
  37. package/src/lib/Property/PropertyFiller/ControlFiller/index.d.ts +0 -3
  38. package/src/lib/Property/PropertyFiller/JsonEditor.d.ts +0 -9
  39. package/src/lib/Property/PropertyFiller/MultiplePropertyFiller.d.ts +0 -24
  40. package/src/lib/Property/PropertyFiller/MultiplePropertyWidget.d.ts +0 -22
  41. package/src/lib/Property/PropertyFiller/PropertyFiller.d.ts +0 -24
  42. package/src/lib/Property/PropertyFiller/index.d.ts +0 -2
  43. package/src/lib/Property/PropertyFiller/styled.d.ts +0 -18
  44. package/src/lib/Property/PropertyFiller/usePropertyFiller.d.ts +0 -26
  45. package/src/lib/Property/PropertyValidator/PropertyValidatorContext.d.ts +0 -3
  46. package/src/lib/Property/PropertyValidator/index.d.ts +0 -1
  47. package/src/lib/Property/PropertyWidget/PropertyWidget.d.ts +0 -23
  48. package/src/lib/Property/PropertyWidget/index.d.ts +0 -1
  49. package/src/lib/Property/UpsertProperty/CreatePropertiesList/CreatePropertiesList.d.ts +0 -36
  50. package/src/lib/Property/UpsertProperty/CreatePropertiesList/ListItem.d.ts +0 -29
  51. package/src/lib/Property/UpsertProperty/CreatePropertiesList/index.d.ts +0 -2
  52. package/src/lib/Property/UpsertProperty/CreatePropertiesListContext.d.ts +0 -30
  53. package/src/lib/Property/UpsertProperty/CreatePropertyFormFields.d.ts +0 -24
  54. package/src/lib/Property/UpsertProperty/CustomPropertyField.d.ts +0 -7
  55. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/BigDecimalPropertyFields.d.ts +0 -8
  56. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/DateAdditionalFields.d.ts +0 -9
  57. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityAdditionalFields.d.ts +0 -22
  58. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityReferencePropertyFields.d.ts +0 -12
  59. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/PropertyAdditionalFields.d.ts +0 -23
  60. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/StringPropertyFields.d.ts +0 -8
  61. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/index.d.ts +0 -1
  62. package/src/lib/Property/UpsertProperty/PropertyValueField/BooleanValueField.d.ts +0 -9
  63. package/src/lib/Property/UpsertProperty/PropertyValueField/DateTimeValueField.d.ts +0 -9
  64. package/src/lib/Property/UpsertProperty/PropertyValueField/DateValueField.d.ts +0 -9
  65. package/src/lib/Property/UpsertProperty/PropertyValueField/FileValueWidget.d.ts +0 -6
  66. package/src/lib/Property/UpsertProperty/PropertyValueField/JsonValueField.d.ts +0 -8
  67. package/src/lib/Property/UpsertProperty/PropertyValueField/PropertyValueField.d.ts +0 -23
  68. package/src/lib/Property/UpsertProperty/PropertyValueField/StringValueField.d.ts +0 -14
  69. package/src/lib/Property/UpsertProperty/PropertyValueField/TimeValueField.d.ts +0 -9
  70. package/src/lib/Property/UpsertProperty/PropertyValueField/index.d.ts +0 -1
  71. package/src/lib/Property/UpsertProperty/index.d.ts +0 -4
  72. package/src/lib/Property/UpsertProperty/useCustomFields.d.ts +0 -6
  73. package/src/lib/Property/ViewPropertiesList/ViewPropertiesList.d.ts +0 -8
  74. package/src/lib/Property/ViewPropertiesList/index.d.ts +0 -1
  75. package/src/lib/Property/ViewProperty/EntityPropertiesShortView.d.ts +0 -7
  76. package/src/lib/Property/ViewProperty/EntityPropertiesView.d.ts +0 -8
  77. package/src/lib/Property/ViewProperty/PropertyDataTable.d.ts +0 -7
  78. package/src/lib/Property/ViewProperty/PropertyItem.d.ts +0 -9
  79. package/src/lib/Property/ViewProperty/ViewProperty.d.ts +0 -9
  80. package/src/lib/Property/ViewProperty/index.d.ts +0 -1
  81. package/src/lib/Property/index.d.ts +0 -4
  82. package/src/utils/dem3.d.ts +0 -28
  83. package/src/utils/test-mocks.d.ts +0 -166
  84. /package/src/lib/Definition/{Dem3DefinitionView → DefinitionView}/FileDefinitionValueView.d.ts +0 -0
  85. /package/src/lib/Definition/{Dem3DefinitionView → DefinitionView}/NodeDataView.d.ts +0 -0
  86. /package/src/lib/{Property/PropertyValidator → DefinitionNode/DemValidator}/NodeValidator.d.ts +0 -0
  87. /package/src/lib/{Property/PropertyValidator → DefinitionNode/DemValidator}/NodesList.d.ts +0 -0
  88. /package/src/lib/{Property/PropertyValidator → DefinitionNode/DemValidator}/NumericTypeValidator.d.ts +0 -0
  89. /package/src/lib/{Property/PropertyValidator → DefinitionNode/DemValidator}/StringTypeValidator.d.ts +0 -0
  90. /package/src/lib/{Property/PropertyValidator → DefinitionNode/DemValidator}/ValidationNodeSelector.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.5.96",
3
+ "version": "1.6.0",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,7 +21,6 @@
21
21
  "@emotion/styled": "^11.10.5",
22
22
  "date-fns": "^2.22.1",
23
23
  "duration-fns": "^3.0.2",
24
- "ace-builds": "^1.5.3",
25
24
  "react-router-dom": "6.8.0",
26
25
  "react-toastify": "^9.1.1",
27
26
  "classnames": "^2.3.1",
@@ -12,3 +12,6 @@ export declare const defaultDefinitionObjectValue: {
12
12
  };
13
13
  export declare const DEFAULT_REQUIRED_ERROR_TEXT = "Please, fill this field";
14
14
  export declare const DEFAULT_DATE_VALIDATION_ERROR_TEXT = "Incorrect date format";
15
+ export declare const DATE_DEFAULT_FORMAT = "yyyy-MM-dd";
16
+ export declare const TIME_DEFAULT_FORMAT = "HH:mm:ss";
17
+ export declare const DATE_TIME_DEFAULT_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
@@ -1,5 +1,4 @@
1
1
  import { RoundingMode } from './common';
2
- import { UiSettings } from './definition';
3
2
  export declare enum NodeType {
4
3
  STRING = "STRING",
5
4
  INTEGER = "INTEGER",
@@ -34,7 +33,7 @@ export interface Node {
34
33
  validationNode: unknown | null;
35
34
  key?: string;
36
35
  }
37
- export interface Definition3<T = Record<string, never>> {
36
+ export interface Definition<T = Record<string, never>> {
38
37
  code: string;
39
38
  version: number;
40
39
  name: string;
@@ -43,6 +42,64 @@ export interface Definition3<T = Record<string, never>> {
43
42
  export type ObjectPropertiesType<T = Record<string, never>> = Record<string, NodeUnion & T>;
44
43
  export type ObjectPropertiesArrayType<T = Record<string, never>> = Array<NodeUnion & T>;
45
44
  export type ObjectNodeType<T = Record<string, never>> = NodeUnion & T;
45
+ export interface UiSettings {
46
+ label?: string;
47
+ name?: string;
48
+ paramJson?: {
49
+ columns?: number;
50
+ size?: number;
51
+ type?: 'email' | 'phone' | 'iin' | 'currency' | 'iban' | 'radio';
52
+ radioValues?: string[] | {
53
+ value: string | boolean;
54
+ label: string;
55
+ }[];
56
+ maxLength?: number;
57
+ placeholder?: string;
58
+ description?: string;
59
+ fileRefParams?: {
60
+ acceptTypes?: string;
61
+ limit?: number;
62
+ description?: string;
63
+ photoUploader?: boolean;
64
+ };
65
+ date?: 'gte' | 'lte' | 'gt' | 'lt' | 'current';
66
+ alphabet?: 'cyrillic' | 'latin';
67
+ styleProps?: Record<string, any>;
68
+ withRequestToStateDatabase?: boolean;
69
+ gbdflDataPath?: string;
70
+ gbdflDataPath2?: string;
71
+ itemArrayPriorityValue?: string;
72
+ itemArrayPriorityKey?: string;
73
+ itemDataPath?: string;
74
+ isFirstLetterUppercase?: boolean;
75
+ replaceGbdflEntityValues?: Record<string, string>;
76
+ formatDateFrom?: string;
77
+ formatDateTo?: string;
78
+ copyValueToField?: string;
79
+ ifEmptyReplaceWithNull?: boolean;
80
+ formatToNumber?: boolean;
81
+ };
82
+ behaviorJson: {
83
+ showDependOn?: string;
84
+ hideDependOn?: string;
85
+ dynamicEntity?: boolean;
86
+ filterByEntity?: string;
87
+ filterField?: string;
88
+ findEntityByField?: string;
89
+ findEntityByValue?: string;
90
+ getEntityField?: string;
91
+ copyValueFrom?: string;
92
+ /**
93
+ * simple q filter for entity reference
94
+ * `property: 'some.json.path'`
95
+ */
96
+ qFilter?: {
97
+ property: string;
98
+ value?: string | number;
99
+ valueFrom?: string;
100
+ };
101
+ };
102
+ }
46
103
  export interface BigDecimalNode extends Node {
47
104
  nodeType: NodeType.BIG_DECIMAL;
48
105
  precisionScale: number;
@@ -1,4 +1,3 @@
1
- export * from './definition';
2
- export * from './definition3';
1
+ export * from './dem';
3
2
  export * from './ui';
4
3
  export * from './common';
@@ -1,5 +1,5 @@
1
1
  import { PaginateData } from './common';
2
- import { ObjectPropertiesArrayType } from './definition3';
2
+ import { ObjectPropertiesArrayType } from './dem';
3
3
  import { ReactNode } from 'react';
4
4
  type PaginateParams = {
5
5
  page: string;
@@ -1,26 +1,23 @@
1
1
  /// <reference types="react" />
2
- import { type RefMethods } from '../../Property/UpsertProperty';
2
+ import { type NodeRefMethods } from '../../DefinitionNode';
3
3
  import { Control } from 'react-hook-form';
4
- import { EntityReferenceProperty } from '../../../interfaces';
4
+ import { EntityReferenceNode } from '../../../interfaces';
5
5
  type Props = {
6
6
  control?: Control<any>;
7
7
  definitionFieldName?: string;
8
+ isObjectNode?: boolean;
8
9
  title?: string;
9
10
  hideCodeField?: boolean;
10
11
  hideVersionField?: boolean;
11
12
  hideNameField?: boolean;
12
13
  required?: boolean;
13
- entityReferenceDefinitionSources?: {
14
- label: string;
15
- value: string;
16
- }[];
17
14
  entityReferenceValueComponent?: React.ElementType<{
18
15
  name: string;
19
- property: EntityReferenceProperty;
16
+ node: EntityReferenceNode;
20
17
  }>;
21
18
  fileReferenceValueComponent?: React.ElementType<{
22
19
  name: string;
23
20
  }>;
24
21
  };
25
- export declare const CreateDefinition: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<RefMethods>>;
22
+ export declare const CreateDefinition: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<NodeRefMethods>>;
26
23
  export default CreateDefinition;
@@ -1,2 +1 @@
1
1
  export * from './CreateDefinition';
2
- export * from './Dem3CreateDefinition';
@@ -1,21 +1,17 @@
1
1
  /// <reference types="react" />
2
- import { EntityReferenceProperty, PropertiesArrayType } from '../../../interfaces';
2
+ import { EntityReferenceNode, NodeUnion } from '../../../interfaces';
3
3
  type Props = {
4
- properties: PropertiesArrayType;
4
+ node: NodeUnion | null;
5
5
  dataFieldName: string;
6
6
  useExpression?: boolean;
7
7
  title?: string;
8
- entityReferenceDefinitionSources?: {
9
- label: string;
10
- value: string;
11
- }[];
12
8
  entityReferenceValueComponent?: React.ElementType<{
13
9
  name: string;
14
- property: EntityReferenceProperty;
10
+ node: EntityReferenceNode;
15
11
  }>;
16
12
  fileReferenceValueComponent?: React.ElementType<{
17
13
  name: string;
18
14
  }>;
19
15
  };
20
- export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
16
+ export declare const DefinitionFiller: ({ node, dataFieldName, useExpression, title, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
21
17
  export default DefinitionFiller;
@@ -1,2 +1 @@
1
1
  export * from './DefinitionFiller';
2
- export * from './Dem3DefinitionFiller';
@@ -4,5 +4,5 @@ type Props = {
4
4
  node: NodeUnion;
5
5
  data: unknown;
6
6
  };
7
- export declare const Dem3DefinitionView: ({ node, data }: Props) => JSX.Element;
8
- export default Dem3DefinitionView;
7
+ export declare const DefinitionView: ({ node, data }: Props) => JSX.Element;
8
+ export default DefinitionView;
@@ -0,0 +1 @@
1
+ export * from './DefinitionView';
@@ -1,4 +1,3 @@
1
1
  export * from './CreateDefinition';
2
2
  export * from './DefinitionFiller';
3
- export * from './DefinitionValueView';
4
- export * from './Dem3DefinitionView';
3
+ export * from './DefinitionView';
@@ -6,5 +6,5 @@ type Props = {
6
6
  setValue: UseFormSetValue<any>;
7
7
  validator: boolean;
8
8
  };
9
- export declare const PropertyValidator: ({ name, control, setValue, validator }: Props) => JSX.Element;
10
- export default PropertyValidator;
9
+ export declare const DemValidator: ({ name, control, setValue, validator }: Props) => JSX.Element;
10
+ export default DemValidator;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { NodeType } from '../../../interfaces';
3
+ export declare const DemValidatorContext: import("react").Context<"" | NodeType>;
@@ -0,0 +1,2 @@
1
+ export * from './DemValidator';
2
+ export * from './DemValidatorContext';
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { NodeType } from '../../../../interfaces';
2
+ import { NodeType, EntityReferenceNode } from '../../../../interfaces';
3
3
  import { UseFormSetValue, Control } from 'react-hook-form';
4
- import { EntityReferenceNode } from '../../../../interfaces';
5
4
  type Props = {
6
5
  setValue: UseFormSetValue<any>;
7
6
  control: Control<any>;
@@ -1,7 +1,7 @@
1
1
  import { ReactCodeMirrorRef } from '@uiw/react-codemirror';
2
2
  import { Control } from 'react-hook-form';
3
3
  import { ReactNode } from 'react';
4
- export interface ControlAceEditorProps {
4
+ export interface ControlCodeEditorProps {
5
5
  name: string;
6
6
  control: Control<any>;
7
7
  mode?: 'json' | 'javascript' | 'python' | 'text';
@@ -19,5 +19,5 @@ export interface ControlAceEditorProps {
19
19
  [key: string]: unknown;
20
20
  useCleanValue?: boolean;
21
21
  }
22
- export declare const ControlAceEditor: import("react").ForwardRefExoticComponent<Omit<ControlAceEditorProps, "ref"> & import("react").RefAttributes<ReactCodeMirrorRef>>;
23
- export default ControlAceEditor;
22
+ export declare const ControlCodeEditor: import("react").ForwardRefExoticComponent<Omit<ControlCodeEditorProps, "ref"> & import("react").RefAttributes<ReactCodeMirrorRef>>;
23
+ export default ControlCodeEditor;
@@ -6,7 +6,7 @@ export * from './ControlRadio';
6
6
  export * from './ControlAutocomplete';
7
7
  export * from './CopyButton';
8
8
  export * from './BackButton';
9
- export * from './ControlAceEditor';
9
+ export * from './ControlCodeEditor';
10
10
  export * from './ControlNumberInput';
11
11
  export * from './ControlSwitch';
12
12
  export * from './ControlDate';
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledDataGrid: import("@emotion/styled").StyledComponent<Omit<Partial<import("@mui/x-data-grid/models/props/DataGridProps").DataGridPropsWithDefaultValues> & import("@mui/x-data-grid/models/props/DataGridProps").DataGridPropsWithComplexDefaultValueBeforeProcessing & import("@mui/x-data-grid/models/props/DataGridProps").DataGridPropsWithoutDefaultValue<import("@mui/x-data-grid").GridValidRowModel>, import("@mui/x-data-grid/models/props/DataGridProps").DataGridForcedPropsKey> & {
2
+ export declare const StyledDataGrid: import("@emotion/styled").StyledComponent<Omit<Partial<import("@mui/x-data-grid/internals").DataGridPropsWithDefaultValues<import("@mui/x-data-grid").GridValidRowModel>> & import("@mui/x-data-grid/internals").DataGridPropsWithComplexDefaultValueBeforeProcessing & import("@mui/x-data-grid/internals").DataGridPropsWithoutDefaultValue<import("@mui/x-data-grid").GridValidRowModel>, import("@mui/x-data-grid/internals").DataGridForcedPropsKey> & {
3
3
  pagination?: true;
4
4
  } & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -6,7 +6,6 @@ export * from './Tabs';
6
6
  export * from './Modals';
7
7
  export * from './InfoItem';
8
8
  export * from './Definition';
9
- export * from './Property';
10
9
  export * from './Status';
11
10
  export * from './JsonView';
12
11
  export * from './JsonPathPicker';
@@ -1,27 +1,28 @@
1
- import { PropertyType, EntityTypeProperty, PropertiesArrayType, PropertiesObjectType, PropertyFillType } from '../interfaces';
2
- export declare const isPropertyValueEmpty: (value: unknown) => boolean;
3
- export declare const formatDefinitionData: (properties: PropertiesArrayType<unknown>, data: unknown) => {};
4
- export declare const propertiesArrayToObject: (properties: any, isGlobalParameter?: boolean) => PropertiesObjectType<any>;
5
- export declare function propertiesObjectToArray(properties: any, fields?: {
6
- [key: string]: unknown;
7
- }): any[];
8
- export declare const getDemPropertyDateFormat: (defaultFormat: string, propertyFormat: string) => string;
9
- export declare const getEntityStarterValue: (property: EntityTypeProperty) => any;
10
- export declare const getMultiplePropertyFillOptions: ({ propertyType, useExpression, required, }: {
11
- propertyType: PropertyType;
1
+ import { NodeType, ObjectNode, NodeUnion, NodeFillType } from '../interfaces';
2
+ export declare const isValueEmpty: (value: unknown) => boolean;
3
+ export declare const formatDefinitionNodeData: (node: Partial<NodeUnion>, data: unknown) => {};
4
+ export declare const nodePropertiesArrayToObject: <T extends NodeUnion = NodeUnion>(node: T, isGlobalParameter?: boolean) => T;
5
+ export declare function nodePropertiesObjectToArray<T extends NodeUnion = NodeUnion>(node: T, fields?: {
6
+ [key: string]: any;
7
+ }): T;
8
+ export declare const getDemNodeDateFormat: (defaultFormat: string, propertyFormat: string) => string;
9
+ export declare const getObjectStarterValue: (node: ObjectNode) => any;
10
+ export declare const getMultipleNodeFillOptions: ({ nodeType, useExpression, required, }: {
11
+ nodeType: NodeType;
12
12
  required: boolean;
13
13
  useExpression?: boolean;
14
14
  }) => {
15
- value: PropertyFillType;
15
+ value: NodeFillType;
16
16
  label: string;
17
17
  sortOrder: number;
18
18
  }[];
19
- export declare const getSinglePropertyFillOptions: ({ propertyType, useExpression, required, }: {
20
- propertyType: PropertyType;
19
+ export declare const getNodeType: (node: Partial<NodeUnion>) => NodeType;
20
+ export declare const getSingleNodeFillOptions: ({ nodeType, useExpression, required, }: {
21
+ nodeType: NodeType;
21
22
  required: boolean;
22
23
  useExpression?: boolean;
23
24
  }) => {
24
- value: PropertyFillType;
25
+ value: NodeFillType;
25
26
  label: string;
26
27
  sortOrder: number;
27
28
  }[];
@@ -3,4 +3,3 @@ export * from './ui-utils';
3
3
  export * from './hooks';
4
4
  export * from './validators';
5
5
  export * from './dem';
6
- export * from './dem3';
@@ -1,6 +1,4 @@
1
- import { PropertyType } from '../interfaces';
2
1
  export declare const digitsOnly: RegExp;
3
2
  export declare const floatsOnly: RegExp;
4
3
  export declare const isExpression: (value: unknown, useRecursion?: boolean) => boolean;
5
- export declare const isDateType: (propertyType: PropertyType) => boolean;
6
4
  export declare const numberFormat: Intl.NumberFormat;
@@ -1,174 +0,0 @@
1
- import { RoundingMode } from './common';
2
- export declare enum PropertyType {
3
- STRING = "STRING",
4
- INTEGER = "INTEGER",
5
- BIG_INTEGER = "BIG_INTEGER",
6
- BIG_DECIMAL = "BIG_DECIMAL",
7
- FLOAT = "FLOAT",
8
- LONG = "LONG",
9
- DOUBLE = "DOUBLE",
10
- BOOLEAN = "BOOLEAN",
11
- ENTITY_REFERENCE = "ENTITY_REFERENCE",
12
- ENTITY = "ENTITY",
13
- FILE = "FILE",
14
- FILE_REFERENCE = "FILE_REFERENCE",
15
- JSON = "JSON",
16
- DATE = "DATE",
17
- TIME = "TIME",
18
- DATE_TIME = "DATE_TIME",
19
- ANY = "ANY"
20
- }
21
- export interface Definition<T = Record<string, never>> {
22
- code: string;
23
- version: number;
24
- name: string;
25
- properties: PropertiesObjectType<T>;
26
- }
27
- export type PropertiesObjectType<T = Record<string, never>> = Record<string, PropertyUnion & T>;
28
- export type PropertiesArrayType<T = Record<string, never>> = Array<PropertyUnion & T>;
29
- export interface CreateDefinitionType<T = Record<string, never>> extends Omit<Definition<T>, 'properties'> {
30
- properties: PropertiesArrayType<T>;
31
- }
32
- export interface UpdateDefinitionType<T = Record<string, never>> extends Omit<Definition<T>, 'properties'> {
33
- properties: PropertiesArrayType<T>;
34
- }
35
- export interface UiSettings {
36
- label?: string;
37
- name?: string;
38
- paramJson?: {
39
- columns?: number;
40
- size?: number;
41
- type?: 'email' | 'phone' | 'iin' | 'currency' | 'iban' | 'radio';
42
- radioValues?: string[] | {
43
- value: string | boolean;
44
- label: string;
45
- }[];
46
- maxLength?: number;
47
- placeholder?: string;
48
- description?: string;
49
- fileRefParams?: {
50
- acceptTypes?: string;
51
- limit?: number;
52
- description?: string;
53
- photoUploader?: boolean;
54
- };
55
- date?: 'gte' | 'lte' | 'gt' | 'lt' | 'current';
56
- alphabet?: 'cyrillic' | 'latin';
57
- styleProps?: Record<string, any>;
58
- withRequestToStateDatabase?: boolean;
59
- gbdflDataPath?: string;
60
- gbdflDataPath2?: string;
61
- itemArrayPriorityValue?: string;
62
- itemArrayPriorityKey?: string;
63
- itemDataPath?: string;
64
- isFirstLetterUppercase?: boolean;
65
- replaceGbdflEntityValues?: Record<string, string>;
66
- formatDateFrom?: string;
67
- formatDateTo?: string;
68
- copyValueToField?: string;
69
- ifEmptyReplaceWithNull?: boolean;
70
- formatToNumber?: boolean;
71
- };
72
- behaviorJson: {
73
- showDependOn?: string;
74
- hideDependOn?: string;
75
- dynamicEntity?: boolean;
76
- filterByEntity?: string;
77
- filterField?: string;
78
- findEntityByField?: string;
79
- findEntityByValue?: string;
80
- getEntityField?: string;
81
- copyValueFrom?: string;
82
- /**
83
- * simple q filter for entity reference
84
- * `property: 'some.json.path'`
85
- */
86
- qFilter?: {
87
- property: string;
88
- value?: string | number;
89
- valueFrom?: string;
90
- };
91
- };
92
- }
93
- export interface Property {
94
- propertyType: keyof typeof PropertyType | {
95
- value: keyof typeof PropertyType;
96
- };
97
- name: string;
98
- defaultValue: unknown;
99
- defaultValues: unknown[];
100
- isRequired: boolean;
101
- isMultiple: boolean;
102
- sortOrder: number;
103
- isEnabled: boolean;
104
- uiSettings: UiSettings | null;
105
- validationNode: unknown | null;
106
- key?: string;
107
- }
108
- export interface BigDecimalProperty extends Property {
109
- propertyType: PropertyType.BIG_DECIMAL;
110
- precisionScale: number;
111
- roundingMode: keyof typeof RoundingMode;
112
- }
113
- export interface BigIntegerProperty extends Property {
114
- propertyType: PropertyType.BIG_INTEGER;
115
- }
116
- export interface BooleanProperty extends Property {
117
- propertyType: PropertyType.BOOLEAN;
118
- }
119
- export interface DateProperty extends Property {
120
- propertyType: PropertyType.DATE;
121
- format: string;
122
- }
123
- export interface DateTimeProperty extends Property {
124
- propertyType: PropertyType.DATE_TIME;
125
- format: string;
126
- }
127
- export interface DoubleProperty extends Property {
128
- propertyType: PropertyType.DOUBLE;
129
- }
130
- export interface EntityTypeProperty<T = Record<string, never>> extends Property {
131
- propertyType: PropertyType.ENTITY;
132
- properties: PropertiesObjectType<T> | PropertiesArrayType<T>;
133
- }
134
- export interface EntityReferenceProperty extends Property {
135
- propertyType: PropertyType.ENTITY_REFERENCE;
136
- source: string;
137
- definitionCode: string;
138
- definitionVersion: string;
139
- labelPropertyCode: string;
140
- valuePropertyCode: string;
141
- }
142
- export interface FloatProperty extends Property {
143
- propertyType: PropertyType.FLOAT;
144
- }
145
- export interface StringProperty extends Property {
146
- propertyType: PropertyType.STRING;
147
- restrictedValues: string[];
148
- }
149
- export interface IntegerProperty extends Property {
150
- propertyType: PropertyType.INTEGER;
151
- }
152
- export interface JsonProperty extends Property {
153
- propertyType: PropertyType.JSON;
154
- }
155
- export interface LongProperty extends Property {
156
- propertyType: PropertyType.LONG;
157
- }
158
- export interface TimeProperty extends Property {
159
- propertyType: PropertyType.TIME;
160
- format: string;
161
- }
162
- export interface AnyProperty extends Property {
163
- propertyType: PropertyType.ANY;
164
- }
165
- export interface FileProperty extends Property {
166
- propertyType: PropertyType.FILE;
167
- }
168
- export interface FileReferenceProperty extends Property {
169
- propertyType: PropertyType.FILE_REFERENCE;
170
- }
171
- export type PropertyUnion<T = Record<string, never>> = BigDecimalProperty | BigIntegerProperty | BooleanProperty | DateProperty | DateTimeProperty | DoubleProperty | EntityTypeProperty<T> | EntityReferenceProperty | FloatProperty | StringProperty | IntegerProperty | JsonProperty | LongProperty | TimeProperty | AnyProperty | EntityReferenceProperty | FileProperty | FileReferenceProperty;
172
- export declare const DATE_DEFAULT_FORMAT = "yyyy-MM-dd";
173
- export declare const TIME_DEFAULT_FORMAT = "HH:mm:ss";
174
- export declare const DATE_TIME_DEFAULT_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import { type NodeRefMethods } from '../../DefinitionNode';
3
- import { Control } from 'react-hook-form';
4
- import { EntityReferenceNode } from '../../../interfaces';
5
- type Props = {
6
- control?: Control<any>;
7
- definitionFieldName?: string;
8
- isObjectNode?: boolean;
9
- title?: string;
10
- hideCodeField?: boolean;
11
- hideVersionField?: boolean;
12
- hideNameField?: boolean;
13
- required?: boolean;
14
- entityReferenceValueComponent?: React.ElementType<{
15
- name: string;
16
- node: EntityReferenceNode;
17
- }>;
18
- fileReferenceValueComponent?: React.ElementType<{
19
- name: string;
20
- }>;
21
- };
22
- export declare const Dem3CreateDefinition: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<NodeRefMethods>>;
23
- export default Dem3CreateDefinition;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { EntityReferenceNode, NodeUnion } from '../../../interfaces';
3
- type Props = {
4
- node: NodeUnion | null;
5
- dataFieldName: string;
6
- useExpression?: boolean;
7
- title?: string;
8
- entityReferenceValueComponent?: React.ElementType<{
9
- name: string;
10
- node: EntityReferenceNode;
11
- }>;
12
- fileReferenceValueComponent?: React.ElementType<{
13
- name: string;
14
- }>;
15
- };
16
- export declare const Dem3DefinitionFiller: ({ node, dataFieldName, useExpression, title, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
17
- export default Dem3DefinitionFiller;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { PropertiesArrayType } from '../../../interfaces';
3
- type Props = {
4
- properties: PropertiesArrayType<unknown>;
5
- data: unknown;
6
- };
7
- export declare const DefinitionValueView: ({ properties, data }: Props) => JSX.Element;
8
- export default DefinitionValueView;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { FileProperty } from '../../../interfaces';
3
- type Props = {
4
- property: FileProperty;
5
- data: string;
6
- };
7
- declare const FileDefinitionValueView: ({ property, data }: Props) => JSX.Element;
8
- export default FileDefinitionValueView;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { PropertyUnion } from '../../../interfaces';
3
- type Props = {
4
- property: PropertyUnion;
5
- data: unknown;
6
- hasBackground?: boolean;
7
- };
8
- export declare const PropertyDataView: ({ property, data, hasBackground, }: Props) => JSX.Element;
9
- export default PropertyDataView;
@@ -1 +0,0 @@
1
- export * from './DefinitionValueView';
@@ -1 +0,0 @@
1
- export * from './Dem3DefinitionView';
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { PropertyUnion } from '../../../interfaces';
3
- type PropertyItemProps = {
4
- property: PropertyUnion;
5
- showName: boolean;
6
- showType: boolean;
7
- };
8
- declare const PropertyItem: ({ property, showName, showType }: PropertyItemProps) => JSX.Element;
9
- export default PropertyItem;
@@ -1,26 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control } from 'react-hook-form';
3
- import { EntityReferenceProperty, PropertyUnion } from '../../../../interfaces';
4
- type Props = {
5
- control: Control<any>;
6
- property: PropertyUnion;
7
- name: string;
8
- useExpression?: boolean;
9
- required?: boolean;
10
- label?: string;
11
- title?: string;
12
- entityReferenceDefinitionSources?: {
13
- label: string;
14
- value: string;
15
- }[];
16
- entityReferenceValueComponent?: React.ElementType<{
17
- name: string;
18
- property: EntityReferenceProperty;
19
- }>;
20
- fileReferenceValueComponent?: React.ElementType<{
21
- name: string;
22
- }>;
23
- requiredErrorText?: string;
24
- };
25
- export declare const ControlMultiplePropertyFiller: ({ control, property, name, useExpression, required, label, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, requiredErrorText, }: Props) => JSX.Element;
26
- export default ControlMultiplePropertyFiller;