@dovetail-v2/refine 0.3.19-alpha.1 → 0.3.19-alpha.3

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.
@@ -1,15 +1,14 @@
1
1
  import { DeleteDialogProps } from '@cloudtower/eagle';
2
2
  import React from 'react';
3
+ import { ResourceConfig } from 'src/types';
3
4
  import { ResourceModel } from '../../../models';
4
5
  export type DropdownSize = 'normal' | 'large';
5
6
  interface K8sDropdownProps {
6
7
  record: ResourceModel;
7
8
  size?: DropdownSize;
8
9
  customButton?: React.ReactNode;
9
- resourceName?: string;
10
- displayName?: string;
10
+ resourceConfig?: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig' | 'hideEdit'>;
11
11
  deleteDialogProps?: Partial<DeleteDialogProps>;
12
- hideEdit?: boolean;
13
12
  }
14
13
  export declare function K8sDropdown(props: React.PropsWithChildren<K8sDropdownProps>): JSX.Element;
15
14
  export default K8sDropdown;
@@ -1,6 +1,7 @@
1
1
  import { WizardDialogProps } from '@cloudtower/eagle/dist/src/core/WizardDialog/type';
2
2
  import { BaseRecord, CreateResponse, UpdateResponse } from '@refinedev/core';
3
3
  import React from 'react';
4
+ import { ResourceConfig } from 'src/types';
4
5
  import { YamlFormProps } from './YamlForm';
5
6
  export type SaveButtonProps = {
6
7
  disabled: boolean;
@@ -15,8 +16,8 @@ export interface ConfirmModalProps {
15
16
  onOk?: () => void;
16
17
  }
17
18
  export type FormModalProps = {
18
- resource?: string;
19
19
  id?: string;
20
+ resourceConfig: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig'>;
20
21
  yamlFormProps?: YamlFormProps;
21
22
  options?: {
22
23
  initialValues?: Record<string, unknown>;
@@ -7,7 +7,7 @@ import { YamlFormProps } from './YamlForm';
7
7
  interface RefineFormContainerProps {
8
8
  id: string;
9
9
  isYamlMode: boolean;
10
- config: ResourceConfig;
10
+ resourceConfig: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'basePath' | 'formConfig'>;
11
11
  step: number;
12
12
  formConfig: (RefineFormConfig & CommonFormConfig) | undefined;
13
13
  customYamlFormProps?: YamlFormProps;
@@ -5,7 +5,7 @@ import { RefineFormFieldRenderProps } from 'src/components/Form/type';
5
5
  import { ResourceModel } from 'src/models';
6
6
  import { CommonFormConfig, RefineFormConfig, ResourceConfig } from 'src/types';
7
7
  type RefineFormContentProps<Model extends ResourceModel> = {
8
- config?: ResourceConfig<Model>;
8
+ resourceConfig?: Pick<ResourceConfig<Model>, 'name' | 'displayName' | 'kind' | 'initValue' | 'basePath' | 'formConfig'>;
9
9
  step?: number;
10
10
  formConfig?: CommonFormConfig & RefineFormConfig;
11
11
  formResult: UseFormReturnType;
@@ -14,7 +14,7 @@ export interface YamlFormProps<Model extends ResourceModel = ResourceModel> {
14
14
  id?: string;
15
15
  resource?: string;
16
16
  action?: FormAction;
17
- config: ResourceConfig<Model>;
17
+ resourceConfig: Pick<ResourceConfig<Model>, 'displayName' | 'dataProviderName' | 'basePath' | 'kind' | 'parent'>;
18
18
  initialValuesForCreate?: Record<string, unknown>;
19
19
  initialValuesForEdit?: Record<string, unknown>;
20
20
  schemaStrategy?: SchemaStrategy;
@@ -7,12 +7,12 @@ import { YamlFormConfig } from 'src/types';
7
7
  import { YamlFormProps } from './YamlForm';
8
8
  interface YamlFormContainerProps {
9
9
  id: string;
10
- config: ResourceConfig;
10
+ resourceConfig: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig' | 'dataProviderName' | 'parent'>;
11
11
  customYamlFormProps?: YamlFormProps;
12
12
  formConfig?: YamlFormConfig & CommonFormConfig;
13
13
  onSuccess?: (data: UpdateResponse<BaseRecord> | CreateResponse<BaseRecord>) => void;
14
14
  onError?: () => void;
15
15
  onSaveButtonPropsChange?: (props: SaveButtonProps) => void;
16
16
  }
17
- declare function YamlFormContainer({ id, customYamlFormProps, config, formConfig, onSuccess, onError, onSaveButtonPropsChange, }: YamlFormContainerProps): JSX.Element;
17
+ declare function YamlFormContainer({ id, customYamlFormProps, resourceConfig, formConfig, onSuccess, onError, onSaveButtonPropsChange, }: YamlFormContainerProps): JSX.Element;
18
18
  export default YamlFormContainer;
@@ -1,7 +1,7 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { ResourceModel } from 'src/models';
3
3
  import { RefineFormConfig, ResourceConfig } from 'src/types';
4
- declare function useFieldsConfig<Model extends ResourceModel>(config?: ResourceConfig<Model>, formConfig?: {
4
+ declare function useFieldsConfig<Model extends ResourceModel>(resourceConfig?: Pick<ResourceConfig<Model>, 'name' | 'displayName' | 'kind' | 'initValue' | 'basePath' | 'formConfig'>, formConfig?: {
5
5
  fields: RefineFormConfig['fields'];
6
6
  }, resourceId?: string, step?: number, customOptions?: Record<string, unknown>, transformedInitValues?: FieldValues): (import("./type").RefineFormField | import("./type").RefineFormSection)[] | undefined;
7
7
  export default useFieldsConfig;
@@ -7,7 +7,7 @@ interface UseRefineFormOptions {
7
7
  export declare const useRefineForm: (props: {
8
8
  formConfig?: RefineFormConfig & CommonFormConfig;
9
9
  id?: string;
10
- config: ResourceConfig;
10
+ resourceConfig: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'formConfig'>;
11
11
  refineProps?: UseFormProps['refineCoreProps'];
12
12
  options?: UseRefineFormOptions;
13
13
  }) => {
@@ -2,7 +2,7 @@
2
2
  import { ResourceModel } from '../../../models';
3
3
  import { ResourceConfig } from '../../../types';
4
4
  type Props<Model extends ResourceModel> = {
5
- config: ResourceConfig<Model>;
5
+ resourceConfig: ResourceConfig<Model>;
6
6
  };
7
7
  export declare function ResourceForm<Model extends ResourceModel>(props: Props<Model>): JSX.Element;
8
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import { CreateResponse, UpdateResponse, BaseRecord } from '@refinedev/core';
2
+ import { ResourceConfig } from 'src/types';
2
3
  interface OpenFormOptions {
3
4
  id?: string;
5
+ resourceConfig?: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig'>;
4
6
  resourceName?: string;
5
7
  initialValues?: Record<string, unknown>;
6
8
  customOptions?: Record<string, unknown>;