@uf_lee/leeui 1.0.27 → 1.0.28

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,3 +1,5 @@
1
1
  import type { Component } from "vue";
2
+ import type { ComponentName } from "./types";
3
+ import type { Recordable } from "../../../global";
2
4
  declare const componentMap: Recordable<Component, ComponentName>;
3
5
  export { componentMap };
@@ -1,6 +1,8 @@
1
1
  import { Slots } from "vue";
2
+ import type { Recordable } from "../../../global";
2
3
  import type { ComData } from "./types";
3
- import type { FormSchema, TableSchema } from "@/types";
4
+ import type { FormSchema } from "../../LElForm/src/types";
5
+ import type { TableSchema } from "../../LElTable/src/types";
4
6
  /**
5
7
  *
6
8
  * @param item 传入的组件属性
@@ -1,3 +1,22 @@
1
+ import type { Recordable } from "../../../global";
2
+ import type { FormValueType } from "../../LElForm/src/types";
3
+ export type ComponentOptions = {
4
+ label?: string;
5
+ value?: FormValueType;
6
+ disabled?: boolean;
7
+ key?: string | number;
8
+ children?: ComponentOptions[];
9
+ options?: ComponentOptions[];
10
+ } & Recordable;
11
+ declare type ComponentOptionsAlias = {
12
+ labelField?: string;
13
+ valueField?: string;
14
+ };
15
+ export type ComponentProps = {
16
+ optionsAlias?: ComponentOptionsAlias;
17
+ options?: ComponentOptions[];
18
+ optionsSlot?: boolean;
19
+ } & Recordable;
1
20
  export type ComData = {
2
21
  field: string;
3
22
  component?: ComponentName;
@@ -6,3 +25,5 @@ export type ComData = {
6
25
  } & ComponentProps;
7
26
  slots?: Recordable;
8
27
  };
28
+ export type ComponentName = "Text" | "Link" | "Button" | "Icon" | "Avatar" | "Image" | "Divider" | "Badge" | "Radio" | "RadioButton" | "Checkbox" | "CheckboxButton" | "Input" | "Autocomplete" | "InputNumber" | "Select" | "Cascader" | "Switch" | "Slider" | "TimePicker" | "DatePicker" | "Rate" | "ColorPicker" | "Transfer" | "TimeSelect" | "SelectV2" | "Mention" | "InputTag";
29
+ export {};
@@ -1,5 +1,7 @@
1
1
  import { PropType } from "vue";
2
2
  import { FormRules } from "element-plus";
3
+ import type { FormSchema } from "./types";
4
+ import type { Recordable } from "../../../global";
3
5
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
6
  schema: {
5
7
  type: PropType<FormSchema[]>;
@@ -30,7 +32,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
30
32
  onRegister?: ((...args: any[]) => any) | undefined;
31
33
  }>, {
32
34
  schema: FormSchema[];
33
- model: Recordable<any, string>;
35
+ model: Recordable;
34
36
  rules: Partial<Record<string, import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>>>;
35
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
38
  export default _default;
@@ -1,3 +1,5 @@
1
+ import { ColProps, FormSchema } from "./types";
2
+ import type { Recordable } from "../../../global";
1
3
  /**
2
4
  *
3
5
  * @param col 内置栅格
@@ -12,4 +14,4 @@ export declare const setGridProp: (col?: ColProps) => ColProps;
12
14
  * @returns FormMoel
13
15
  * @description 生成对应的formModel
14
16
  */
15
- export declare const initModel: (schema: FormSchema[], formModel: Recordable) => Recordable<any, string>;
17
+ export declare const initModel: (schema: FormSchema[], formModel: Recordable) => Recordable;
@@ -1,4 +1,7 @@
1
- import { AxiosPromise } from "axios";
1
+ import type { Recordable } from "../../../global";
2
+ import type { AxiosPromise } from "axios";
3
+ import type { ComponentName, ComponentProps } from "../../LElCom/src/types";
4
+ import type { CSSProperties } from "vue";
2
5
  export type FormProps = {
3
6
  schema?: FormSchema[];
4
7
  isCol?: boolean;
@@ -22,3 +25,22 @@ export type FormSchema = {
22
25
  hidden?: boolean;
23
26
  api?: <T = any>() => AxiosPromise<T>;
24
27
  };
28
+ export type ColProps = {
29
+ span?: number;
30
+ xs?: number;
31
+ sm?: number;
32
+ md?: number;
33
+ lg?: number;
34
+ xl?: number;
35
+ tag?: string;
36
+ };
37
+ export type FormItemProps = {
38
+ labelWidth?: string | number;
39
+ required?: boolean;
40
+ rules?: Recordable;
41
+ error?: string;
42
+ showMessage?: boolean;
43
+ inlineMessage?: boolean;
44
+ style?: CSSProperties;
45
+ };
46
+ export type FormValueType = string | number | string[] | number[] | boolean | undefined | null;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from "vue";
2
+ import type { Recordable } from "../../../global";
2
3
  import type { TableSchema } from "./types.ts";
3
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  data: {
@@ -19,7 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
19
20
  default: () => never[];
20
21
  };
21
22
  }>> & Readonly<{}>, {
22
- data: Recordable<any, string>[];
23
+ data: Recordable[];
23
24
  schema: TableSchema[];
24
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
26
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import { TableSchema } from "./types";
2
+ import type { Recordable } from "../../../global";
2
3
  /**
3
4
  *
4
5
  * @param item 传入的组件属性
@@ -1,3 +1,6 @@
1
+ import type { ComponentProps, ComponentName } from "../../LElCom/src/types";
2
+ import type { FormValueType } from "../../LElForm/src/types";
3
+ import type { Recordable } from "../../../global";
1
4
  export type TableSchema = {
2
5
  field: string;
3
6
  label?: string;
@@ -0,0 +1,2 @@
1
+ export type Recordable<T = any, K extends keyof any = string> = Record<K, T>;
2
+ export type ComponentRef<T extends new (...args: any) => any> = InstanceType<T>;
@@ -1,4 +1,8 @@
1
1
  import { LElForm } from "./components/LElForm";
2
2
  import { LElCom } from "./components/LElCom";
3
3
  import { LElTable } from "./components/LElTable";
4
- export { LElForm, LElCom, LElTable };
4
+ import type { FormProps } from "./components/LElForm/src/types";
5
+ import type { FormSchema } from "./components/LElForm/src/types";
6
+ import type { TableSchema } from "./components/LElTable/src/types";
7
+ import type { ComData } from "./components/LElCom/src/types";
8
+ export { LElForm, LElCom, LElTable, FormProps, FormSchema, TableSchema, ComData, };
@@ -1,4 +1,5 @@
1
1
  import { Slots } from "vue";
2
+ import type { Recordable } from "../global";
2
3
  export declare const getSlot: (slots: Slots, slot?: string, data?: Recordable) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
4
  [key: string]: any;
4
5
  }>[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uf_lee/leeui",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "自己的组件库",
5
5
  "main": "dist/leeui.umd.js",
6
6
  "module": "dist/leeui.es.js",
@@ -40,4 +40,4 @@
40
40
  "peerDependencies": {
41
41
  "vue": ">=3.0.0"
42
42
  }
43
- }
43
+ }
@@ -1,5 +0,0 @@
1
- import { FormProps } from "./components/LElForm/src/types";
2
- import { FormSchema } from "./components/LElForm/src/types";
3
- import { TableSchema } from "./components/LElTable/src/types";
4
- import { ComData } from "./components/LElCom/src/types";
5
- export { FormProps, FormSchema, TableSchema, ComData };