@bigbinary/neeto-fields-frontend 1.0.7 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-fields-frontend",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/bigbinary/neeto-fields-nano",
package/types.d.ts CHANGED
@@ -16,6 +16,7 @@ interface PaneProps {
16
16
  validations?: KeyValuePair;
17
17
  initialValues?: KeyValuePair;
18
18
  hideRequiredSwitch?: boolean;
19
+ onMutationSuccess?: (...args: any[]) => void;
19
20
  }
20
21
 
21
22
  type OnDeleteClickFunction = (field: KeyValuePair) => void;
@@ -44,23 +45,16 @@ interface FieldsDashboardProps {
44
45
  }) => KeyValuePair[];
45
46
  }
46
47
 
47
- interface AddFieldProps {
48
- resourceType: string;
49
- allowedKinds?: string[];
50
- additionalValidations?: KeyValuePair;
51
- initialValues?: KeyValuePair;
52
- children?: React.ReactNode;
53
- hideRequiredSwitch?: boolean;
54
- }
55
-
56
48
  interface EditProps {
57
49
  fieldId: string;
58
50
  allowedKinds: string[];
59
- onClose: (values: any) => void;
51
+ onClose: () => void;
60
52
  children?: React.ReactNode;
61
53
  additionalValidations?: KeyValuePair;
62
54
  initialValues?: KeyValuePair;
63
55
  hideRequiredSwitch?: boolean;
56
+ ownerId?: string;
57
+ onMutationSuccess?: (...args: any[]) => void;
64
58
  }
65
59
 
66
60
  interface AddProps {
@@ -71,17 +65,21 @@ interface AddProps {
71
65
  additionalValidations?: KeyValuePair;
72
66
  initialValues?: KeyValuePair;
73
67
  hideRequiredSwitch?: boolean;
68
+ ownerId?: string;
69
+ onMutationSuccess?: (...args: any[]) => void;
74
70
  }
75
71
  interface FieldsPaneProps {
76
- allowedKinds: string[];
77
72
  isOpen: boolean;
78
73
  resourceType: string;
79
74
  onClose: () => void;
75
+ allowedKinds?: string[];
80
76
  additionalValidations?: KeyValuePair;
81
77
  initialValues?: KeyValuePair;
82
78
  selectedField?: KeyValuePair;
83
79
  children?: React.ReactNode;
84
80
  hideRequiredSwitch?: boolean;
81
+ ownerId?: string;
82
+ onMutationSuccess?: (...args: any[]) => void;
85
83
  }
86
84
  interface FieldFormProps {
87
85
  chosenKind: string[];
@@ -95,28 +93,34 @@ interface FieldValuesContainerProps {
95
93
  resourceType: string;
96
94
  fieldValues: KeyValuePair[];
97
95
  resourceId: string;
96
+ fields?: KeyValuePair[];
98
97
  ownerId?: string;
99
- queryKeysToBeInvalidatedOnSuccess?: string[];
100
98
  customComponents?: KeyValuePair;
101
99
  className?: string;
102
100
  showBorder?: boolean;
103
- formRefs?: React.RefObject<any>
101
+ formRefs?: React.RefObject<any>;
104
102
  disabled?: boolean;
105
103
  isRequiredColumnName?: string;
106
- fieldContainerClassName?: string,
107
- fieldClassName?: string,
108
- labelClassName?: string,
104
+ fieldContainerClassName?: string;
105
+ fieldClassName?: string;
106
+ labelClassName?: string;
107
+ onMutationSuccess?: (...args: any[]) => void;
109
108
  }
110
109
 
111
110
  interface FieldInputsProps {
112
111
  fields: KeyValuePair[];
113
112
  customComponents?: KeyValuePair;
114
- formRef?: React.RefObject<any>
113
+ formRef?: React.RefObject<any>;
115
114
  disabled?: boolean;
116
115
  isRequiredColumnName?: string;
117
116
  }
118
117
 
119
- type FieldsParams = { resourceType?: string; ownerId?: string; state?: string, prefixQueryKeys?: string[] };
118
+ type FieldsParams = {
119
+ resourceType?: string;
120
+ ownerId?: string;
121
+ state?: string;
122
+ prefixQueryKeys?: string[];
123
+ };
120
124
 
121
125
  type Field = {
122
126
  fields: KeyValuePair[];
@@ -128,7 +132,7 @@ type Field = {
128
132
  type UseFetchFieldsResult = UseQueryResult<Field>;
129
133
 
130
134
  export const FieldsDashboard: React.FC<FieldsDashboardProps>;
131
- export const AddField: React.FC<AddFieldProps>;
135
+ export const FieldsPane: React.FC<FieldsPaneProps>;
132
136
  export const FieldValuesContainer: React.FC<FieldValuesContainerProps>;
133
137
  export const FieldInputs: React.FC<FieldInputsProps>;
134
138
 
@@ -138,7 +142,10 @@ export const useFetchFields: (
138
142
  ) => UseFetchFieldsResult;
139
143
 
140
144
  export const useShowField: (
141
- fieldId: string,
145
+ params: {
146
+ fieldId: string;
147
+ ownerId?: string;
148
+ },
142
149
  options?: UseQueryOptions
143
150
  ) => UseFetchFieldsResult;
144
151