easy-ep-ui 0.1.0 → 0.1.2

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.
Files changed (113) hide show
  1. package/LICENSE +172 -0
  2. package/README.md +29 -14
  3. package/dist/easy-ep-ui.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/es/charts/BaseBar/index.d.ts +2 -0
  6. package/es/charts/BaseBar/src/index.vue.d.ts +45 -0
  7. package/es/charts/BaseLine/index.d.ts +2 -0
  8. package/es/charts/BaseLine/src/index.vue.d.ts +47 -0
  9. package/es/charts/BasePie/index.d.ts +2 -0
  10. package/es/charts/BasePie/src/index.vue.d.ts +41 -0
  11. package/es/charts/BaseRadar/index.d.ts +2 -0
  12. package/es/charts/BaseRadar/src/index.vue.d.ts +47 -0
  13. package/es/charts/config.d.ts +32 -0
  14. package/es/charts/index.d.ts +8 -0
  15. package/es/charts/useChart.d.ts +21 -0
  16. package/es/components/ee-dept-cascader/index.d.ts +2 -0
  17. package/es/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
  18. package/es/components/ee-dept-cascader/type.d.ts +39 -0
  19. package/es/components/ee-dict-select/src/index.vue.d.ts +20 -17
  20. package/es/components/ee-dict-select/type.d.ts +54 -0
  21. package/es/components/ee-form-dialog/src/index.vue.d.ts +110 -8
  22. package/es/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
  23. package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +311 -0
  24. package/es/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
  25. package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +43 -0
  26. package/es/components/ee-form-table/src/constants.d.ts +31 -0
  27. package/es/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
  28. package/es/components/ee-form-table/src/hooks/useCrud.d.ts +41 -0
  29. package/es/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
  30. package/es/components/ee-form-table/src/hooks/useExport.d.ts +34 -0
  31. package/es/components/ee-form-table/src/hooks/useForm.d.ts +33 -0
  32. package/es/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
  33. package/es/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
  34. package/es/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
  35. package/es/components/ee-form-table/src/index.vue.d.ts +1090 -533
  36. package/es/components/ee-form-table/types.d.ts +238 -0
  37. package/es/components/ee-remote-select/index.d.ts +2 -0
  38. package/es/components/ee-remote-select/src/index.vue.d.ts +30 -0
  39. package/es/components/ee-remote-select/type.d.ts +53 -0
  40. package/es/components/ee-role-select/index.d.ts +2 -0
  41. package/es/components/ee-role-select/src/index.vue.d.ts +29 -0
  42. package/es/components/ee-role-select/type.d.ts +44 -0
  43. package/es/components/ee-search-bar/src/index.vue.d.ts +82 -10
  44. package/es/components/ee-status-tag/src/index.vue.d.ts +1 -1
  45. package/es/components/ee-user-select/index.d.ts +2 -0
  46. package/es/components/ee-user-select/src/index.vue.d.ts +29 -0
  47. package/es/components/ee-user-select/type.d.ts +46 -0
  48. package/es/hooks/index.d.ts +4 -0
  49. package/es/hooks/useRemoteSelectPagination.d.ts +68 -0
  50. package/es/hooks/useSelectEcho.d.ts +27 -0
  51. package/es/index.d.ts +51 -2
  52. package/es/index.mjs +3135 -345
  53. package/es/locale/en.d.ts +3 -0
  54. package/es/locale/index.d.ts +86 -0
  55. package/es/locale/useLocale.d.ts +13 -0
  56. package/es/locale/zh-cn.d.ts +3 -0
  57. package/es/style.css +1 -1
  58. package/es/utils/types.d.ts +39 -0
  59. package/lib/charts/BaseBar/index.d.ts +2 -0
  60. package/lib/charts/BaseBar/src/index.vue.d.ts +45 -0
  61. package/lib/charts/BaseLine/index.d.ts +2 -0
  62. package/lib/charts/BaseLine/src/index.vue.d.ts +47 -0
  63. package/lib/charts/BasePie/index.d.ts +2 -0
  64. package/lib/charts/BasePie/src/index.vue.d.ts +41 -0
  65. package/lib/charts/BaseRadar/index.d.ts +2 -0
  66. package/lib/charts/BaseRadar/src/index.vue.d.ts +47 -0
  67. package/lib/charts/config.d.ts +32 -0
  68. package/lib/charts/index.d.ts +8 -0
  69. package/lib/charts/useChart.d.ts +21 -0
  70. package/lib/components/ee-dept-cascader/index.d.ts +2 -0
  71. package/lib/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
  72. package/lib/components/ee-dept-cascader/type.d.ts +39 -0
  73. package/lib/components/ee-dict-select/src/index.vue.d.ts +20 -17
  74. package/lib/components/ee-dict-select/type.d.ts +54 -0
  75. package/lib/components/ee-form-dialog/src/index.vue.d.ts +110 -8
  76. package/lib/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
  77. package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +311 -0
  78. package/lib/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
  79. package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +43 -0
  80. package/lib/components/ee-form-table/src/constants.d.ts +31 -0
  81. package/lib/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
  82. package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +41 -0
  83. package/lib/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
  84. package/lib/components/ee-form-table/src/hooks/useExport.d.ts +34 -0
  85. package/lib/components/ee-form-table/src/hooks/useForm.d.ts +33 -0
  86. package/lib/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
  87. package/lib/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
  88. package/lib/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
  89. package/lib/components/ee-form-table/src/index.vue.d.ts +1090 -533
  90. package/lib/components/ee-form-table/types.d.ts +238 -0
  91. package/lib/components/ee-remote-select/index.d.ts +2 -0
  92. package/lib/components/ee-remote-select/src/index.vue.d.ts +30 -0
  93. package/lib/components/ee-remote-select/type.d.ts +53 -0
  94. package/lib/components/ee-role-select/index.d.ts +2 -0
  95. package/lib/components/ee-role-select/src/index.vue.d.ts +29 -0
  96. package/lib/components/ee-role-select/type.d.ts +44 -0
  97. package/lib/components/ee-search-bar/src/index.vue.d.ts +82 -10
  98. package/lib/components/ee-status-tag/src/index.vue.d.ts +1 -1
  99. package/lib/components/ee-user-select/index.d.ts +2 -0
  100. package/lib/components/ee-user-select/src/index.vue.d.ts +29 -0
  101. package/lib/components/ee-user-select/type.d.ts +46 -0
  102. package/lib/hooks/index.d.ts +4 -0
  103. package/lib/hooks/useRemoteSelectPagination.d.ts +68 -0
  104. package/lib/hooks/useSelectEcho.d.ts +27 -0
  105. package/lib/index.cjs +1 -1
  106. package/lib/index.d.ts +51 -2
  107. package/lib/locale/en.d.ts +3 -0
  108. package/lib/locale/index.d.ts +86 -0
  109. package/lib/locale/useLocale.d.ts +13 -0
  110. package/lib/locale/zh-cn.d.ts +3 -0
  111. package/lib/style.css +1 -1
  112. package/lib/utils/types.d.ts +39 -0
  113. package/package.json +9 -5
@@ -0,0 +1,68 @@
1
+ import { AxiosInstance } from 'axios';
2
+ /**
3
+ * 远程分页下拉配置选项
4
+ */
5
+ export interface RemotePaginationOption {
6
+ /** 外部 axios 请求实例,不传则从全局配置获取 */
7
+ requestInstance?: AxiosInstance;
8
+ /** 远程接口地址(必填) */
9
+ apiUrl: string;
10
+ /** 页码字段名,默认 pageNum */
11
+ pageNumKey?: string;
12
+ /** 每页条数字段名,默认 pageSize */
13
+ pageSizeKey?: string;
14
+ /** 每页条数,默认 20 */
15
+ pageSize?: number;
16
+ /** 搜索关键词字段名,默认 keyword */
17
+ searchKey?: string;
18
+ /** 附加请求参数 */
19
+ extraParams?: Record<string, any>;
20
+ /** 选项文本字段名,默认 label */
21
+ labelField?: string;
22
+ /** 选项值字段名,默认 value */
23
+ valueField?: string;
24
+ /** 子节点字段名(树形数据预留),默认 children */
25
+ childrenField?: string;
26
+ /** 关键词防抖延迟(毫秒),默认 300 */
27
+ debounceDelay?: number;
28
+ }
29
+ /**
30
+ * 远程下拉选项项类型
31
+ */
32
+ export interface RemoteSelectOption {
33
+ [key: string]: any;
34
+ /** 显示文本 */
35
+ label?: string;
36
+ /** 选项值 */
37
+ value?: any;
38
+ }
39
+ /**
40
+ * 创建远程分页下拉控制器
41
+ *
42
+ * @param option - 远程分页配置
43
+ * @returns loading / options / noMore / loadData / loadMore / resetList / onKeywordChange
44
+ */
45
+ export declare function useRemoteSelectPagination(option: RemotePaginationOption): {
46
+ /** 是否正在加载 */
47
+ loading: import('vue').Ref<boolean, boolean>;
48
+ /** 当前选项列表 */
49
+ options: import('vue').Ref<{
50
+ [x: string]: any;
51
+ label?: string
52
+ /** 选项值 */
53
+ | undefined;
54
+ value?: any;
55
+ }[], RemoteSelectOption[] | {
56
+ [x: string]: any;
57
+ label?: string
58
+ /** 选项值 */
59
+ | undefined;
60
+ value?: any;
61
+ }[]>;
62
+ /** 是否没有更多数据 */
63
+ noMore: import('vue').Ref<boolean, boolean>;
64
+ loadData: (searchVal?: string, reset?: boolean) => Promise<void>;
65
+ loadMore: () => Promise<void>;
66
+ resetList: () => void;
67
+ onKeywordChange: (val: string) => void;
68
+ };
@@ -0,0 +1,27 @@
1
+ import { AxiosInstance } from 'axios';
2
+ /**
3
+ * 回显配置选项
4
+ */
5
+ export interface EchoOption {
6
+ /** 外部 axios 请求实例,不传则从全局配置获取 */
7
+ requestInstance?: AxiosInstance;
8
+ /** 详情回显接口地址(必填) */
9
+ detailApiUrl: string;
10
+ /** 选项文本字段名,默认 label */
11
+ labelField?: string;
12
+ /** 选项值字段名,默认 value */
13
+ valueField?: string;
14
+ /** 选择模式,默认 single */
15
+ mode?: 'single' | 'multiple';
16
+ }
17
+ /**
18
+ * 创建选项回显控制器
19
+ *
20
+ * @param option - 回显配置
21
+ * @returns echoText / echoValue
22
+ */
23
+ export declare function useSelectEcho(option: EchoOption): {
24
+ /** 当前回显文本(单选为 string,多选为 string[]) */
25
+ echoText: import('vue').Ref<string | string[], string | string[]>;
26
+ echoValue: (modelVal: any) => Promise<void>;
27
+ };
package/es/index.d.ts CHANGED
@@ -1,13 +1,62 @@
1
1
  import { App } from 'vue';
2
+ import { AxiosInstance } from 'axios';
3
+ import { ComponentSize } from './components/ee-form-table/types';
2
4
  import { default as EeDictSelect } from './components/ee-dict-select';
3
5
  import { default as EeStatusTag } from './components/ee-status-tag';
4
6
  import { default as EeSearchBar } from './components/ee-search-bar';
5
7
  import { default as EeFormDialog } from './components/ee-form-dialog';
6
8
  import { default as EeFormTable } from './components/ee-form-table';
9
+ import { default as EeRemoteSelect } from './components/ee-remote-select';
10
+ import { default as EeDeptCascader } from './components/ee-dept-cascader';
11
+ import { default as EeUserSelect } from './components/ee-user-select';
12
+ import { default as EeRoleSelect } from './components/ee-role-select';
13
+ import { EeBaseBar, EeBaseLine, EeBasePie, EeBaseRadar } from './charts';
14
+ import { Locale } from './locale';
15
+ export type { Locale };
16
+ /** 全局 requestInstance 注入 key,组件通过 inject 获取 */
17
+ export declare const EE_REQUEST_KEY = "eeRequestInstance";
18
+ /** Easy EP UI 全局配置选项 */
19
+ export interface EasyEpUIOptions {
20
+ /** 全局 axios 请求实例,所有选择组件共享,组件内通过 inject 获取 */
21
+ requestInstance?: AxiosInstance;
22
+ size?: ComponentSize;
23
+ locale?: string | Partial<Locale>;
24
+ formTable?: Record<string, unknown>;
25
+ searchBar?: Record<string, unknown>;
26
+ formDialog?: Record<string, unknown>;
27
+ dictSelect?: Record<string, unknown>;
28
+ statusTag?: Record<string, unknown>;
29
+ remoteSelect?: Record<string, unknown>;
30
+ deptCascader?: Record<string, unknown>;
31
+ userSelect?: Record<string, unknown>;
32
+ roleSelect?: Record<string, unknown>;
33
+ /** 图表组件全局默认配置覆盖 */
34
+ baseChart?: Record<string, unknown>;
35
+ }
7
36
  export type { DictOption, SearchField, TableColumn, FormField, Pagination, StatusMapping } from './utils/types';
8
- export declare function install(app: App): void;
37
+ export type { ColumnSearchItem, SearchConfig, PaginationConfig, ActionConfig, ActionButton, ToolbarConfig, ToolbarButton, CrudConfig, CrudApi, SelectionConfig, ExportConfig, DrawerConfig, ColumnSettingConfig, AutoHeightConfig, } from './components/ee-form-table/types';
38
+ export type { EeFormTableProps } from './components/ee-form-table/types';
39
+ /**
40
+ * 全局注册 Easy EP UI 组件和配置
41
+ *
42
+ * @param app - Vue 应用实例
43
+ * @param options - 全局配置(locale / requestInstance / size / per-component 配置)
44
+ */
45
+ export declare function install(app: App, options?: EasyEpUIOptions): void;
9
46
  declare const EasyEpUI: {
10
47
  install: typeof install;
11
48
  };
12
49
  export default EasyEpUI;
13
- export { EeDictSelect, EeStatusTag, EeSearchBar, EeFormDialog, EeFormTable, };
50
+ export { EeDictSelect, EeStatusTag, EeSearchBar, EeFormDialog, EeFormTable, EeRemoteSelect, EeDeptCascader, EeUserSelect, EeRoleSelect, EeBaseBar, EeBaseLine, EeBasePie, EeBaseRadar, };
51
+ export { GLOBAL_CHART_CONFIG, deepMerge } from './charts/config';
52
+ export { useChart } from './charts/useChart';
53
+ export { EE_LOCALE_KEY } from './locale/useLocale';
54
+ export { mergeLocale } from './locale';
55
+ export { useRemoteSelectPagination, useSelectEcho } from './hooks';
56
+ export type { RemotePaginationOption, RemoteSelectOption } from './hooks';
57
+ export type { EchoOption } from './hooks';
58
+ export type { EeRemoteSelectProps, EeRemoteSelectEmits } from './components/ee-remote-select/type';
59
+ export type { EeDictSelectProps, EeDictSelectEmits } from './components/ee-dict-select/type';
60
+ export type { EeDeptCascaderProps, EeDeptCascaderEmits } from './components/ee-dept-cascader/type';
61
+ export type { EeUserSelectProps, EeUserSelectEmits } from './components/ee-user-select/type';
62
+ export type { EeRoleSelectProps, EeRoleSelectEmits } from './components/ee-role-select/type';