@okyiww/form 0.0.23 → 0.0.24

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,9 +1,10 @@
1
1
  import { default as Runtime } from '../runtime';
2
- import { CustomAdapter } from '../../helpers/defineFormSetup/types';
2
+ import { CustomAdapter, ResolvedKeys } from '../../helpers/defineFormSetup/types';
3
3
  export declare class ArcoVueAdapter implements CustomAdapter {
4
4
  runtime: Runtime;
5
5
  constructor(runtime: Runtime);
6
6
  formModelName: string;
7
7
  formModelKey: string;
8
8
  validate(): Promise<void>;
9
+ resolveKeys(componentProps: any): ResolvedKeys | null;
9
10
  }
@@ -1,9 +1,10 @@
1
1
  import { default as Runtime } from '../runtime';
2
- import { CustomAdapter } from '../../helpers/defineFormSetup/types';
2
+ import { CustomAdapter, ResolvedKeys } from '../../helpers/defineFormSetup/types';
3
3
  export declare class NaiveUIAdapter implements CustomAdapter {
4
4
  runtime: Runtime;
5
5
  constructor(runtime: Runtime);
6
6
  formModelName: string;
7
7
  formModelKey: string;
8
8
  validate(): Promise<void>;
9
+ resolveKeys(componentProps: any): ResolvedKeys | null;
9
10
  }
@@ -1,9 +1,10 @@
1
1
  import { default as Runtime } from '../runtime';
2
- import { CustomAdapter } from '../../helpers/defineFormSetup/types';
2
+ import { CustomAdapter, ResolvedKeys } from '../../helpers/defineFormSetup/types';
3
3
  export declare class NutUIAdapter implements CustomAdapter {
4
4
  runtime: Runtime;
5
5
  constructor(runtime: Runtime);
6
6
  formModelName: string;
7
7
  formModelKey: string;
8
8
  validate(): Promise<void>;
9
+ resolveKeys(_componentProps: any): ResolvedKeys | null;
9
10
  }
@@ -0,0 +1,6 @@
1
+ import { ParsedSchemas } from '../lifecycle/Schema/types';
2
+ import { CustomAdapter } from '../../helpers/defineFormSetup/types';
3
+ export type LabelMode = "leaf" | "path" | "parent";
4
+ export type DisplayLabels = Record<string, string | string[]>;
5
+ export declare function buildDisplayLabelConfig(schemas: any[], config?: Record<string, LabelMode>): Record<string, LabelMode>;
6
+ export declare function collectDisplayLabels(parsedSchemas: ParsedSchemas, model: Record<string, any>, adapter: CustomAdapter, displayLabelConfig?: Record<string, LabelMode>): DisplayLabels;
@@ -3,3 +3,4 @@ export * from './isPromise';
3
3
  export * from './isValidComponent';
4
4
  export * from './isNumericLike';
5
5
  export * from './checkPath';
6
+ export * from './collectDisplayLabels';
@@ -1,9 +1,15 @@
1
1
  export type Component = any;
2
2
  export type BuiltInAdapter = "ArcoVue" | (string & {});
3
+ export type ResolvedKeys = {
4
+ labelKey: string;
5
+ valueKey: string;
6
+ childrenKey: string;
7
+ };
3
8
  export type CustomAdapter = {
4
9
  formModelName: string;
5
10
  formModelKey: string;
6
11
  validate: () => Promise<void>;
12
+ resolveKeys?: (componentProps: any) => ResolvedKeys | null;
7
13
  };
8
14
  export type Template = {
9
15
  id: string;
@@ -10,4 +10,5 @@ export type UseFormOptions = {
10
10
  formSlots?: any;
11
11
  ssr?: SSR;
12
12
  namesToRemember?: Record<string, string>;
13
+ includeLabel?: boolean;
13
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okyiww/form",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",