@yelingfeng/pandora2 0.1.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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/dist/packages/components/PdCharts/index.d.ts +7 -0
  4. package/dist/packages/components/PdCharts/src/charts/pie/index.d.ts +2 -0
  5. package/dist/packages/components/PdCharts/src/charts/pie/pie01.d.ts +6 -0
  6. package/dist/packages/components/PdCharts/src/charts/pie/pie02.d.ts +6 -0
  7. package/dist/packages/components/PdCharts/src/constant/index.d.ts +21 -0
  8. package/dist/packages/components/PdCharts/src/hooks/index.d.ts +5 -0
  9. package/dist/packages/components/PdCharts/src/hooks/useApi.d.ts +7 -0
  10. package/dist/packages/components/PdCharts/src/hooks/useAutosize.d.ts +4 -0
  11. package/dist/packages/components/PdCharts/src/hooks/useCharts.d.ts +2 -0
  12. package/dist/packages/components/PdCharts/src/hooks/useEventListener.d.ts +7 -0
  13. package/dist/packages/components/PdCharts/src/hooks/useLoading.d.ts +4 -0
  14. package/dist/packages/components/PdCharts/src/props/index.d.ts +40 -0
  15. package/dist/packages/components/PdCharts/src/transform/index.d.ts +18 -0
  16. package/dist/packages/components/PdCharts/src/transform/seriesHelper.d.ts +31 -0
  17. package/dist/packages/components/PdCharts/src/types/chart.d.ts +19 -0
  18. package/dist/packages/components/PdCharts/src/types/index.d.ts +94 -0
  19. package/dist/packages/components/PdCharts/src/types/props.d.ts +31 -0
  20. package/dist/packages/components/PdCharts/src/utils/core.d.ts +7 -0
  21. package/dist/packages/components/PdCharts/src/utils/defaultOpt.d.ts +100 -0
  22. package/dist/packages/components/PdCharts/src/utils/index.d.ts +18 -0
  23. package/dist/packages/components/PdCharts/src/utils/wc.d.ts +5 -0
  24. package/dist/packages/components/PdForm/index.d.ts +14 -0
  25. package/dist/packages/components/PdForm/src/componentsMap.d.ts +6 -0
  26. package/dist/packages/components/PdForm/src/helper.d.ts +14 -0
  27. package/dist/packages/components/PdForm/src/hooks/useAdvanced.d.ts +15 -0
  28. package/dist/packages/components/PdForm/src/hooks/useAutoFocus.d.ts +10 -0
  29. package/dist/packages/components/PdForm/src/hooks/useComponentRegister.d.ts +3 -0
  30. package/dist/packages/components/PdForm/src/hooks/useForm.d.ts +4 -0
  31. package/dist/packages/components/PdForm/src/hooks/useFormContext.d.ts +8 -0
  32. package/dist/packages/components/PdForm/src/hooks/useFormEvents.d.ts +28 -0
  33. package/dist/packages/components/PdForm/src/hooks/useFormValues.d.ts +13 -0
  34. package/dist/packages/components/PdForm/src/props/index.d.ts +112 -0
  35. package/dist/packages/components/PdForm/src/types/formItem.d.ts +81 -0
  36. package/dist/packages/components/PdForm/src/types/hooks.d.ts +6 -0
  37. package/dist/packages/components/PdForm/src/types/index.d.ts +133 -0
  38. package/dist/packages/components/PdPageLayout/index.d.ts +6 -0
  39. package/dist/packages/components/PdTable/index.d.ts +5 -0
  40. package/dist/packages/components/PdTable/src/hooks/useTable.d.ts +4 -0
  41. package/dist/packages/components/PdTable/src/pagination/config.d.ts +8 -0
  42. package/dist/packages/components/PdTable/src/props/index.d.ts +20 -0
  43. package/dist/packages/components/PdTable/src/props/useTableProps.d.ts +381 -0
  44. package/dist/packages/components/PdTable/src/render/column.d.ts +11 -0
  45. package/dist/packages/components/PdTable/src/render/pager.d.ts +5 -0
  46. package/dist/packages/components/PdTable/src/sort/index.d.ts +12 -0
  47. package/dist/packages/components/PdTable/src/sort/sortService.d.ts +91 -0
  48. package/dist/packages/components/PdTable/src/types/element-type.d.ts +226 -0
  49. package/dist/packages/components/PdTable/src/types/index.d.ts +90 -0
  50. package/dist/packages/components/index.d.ts +4 -0
  51. package/dist/packages/hooks/index.d.ts +1 -0
  52. package/dist/packages/index.d.ts +6 -0
  53. package/dist/packages/pandora/component.d.ts +3 -0
  54. package/dist/packages/pandora/defaults.d.ts +4 -0
  55. package/dist/packages/pandora/make-installer.d.ts +4 -0
  56. package/dist/packages/pandora/plugin.d.ts +3 -0
  57. package/dist/pandora2.css +1 -0
  58. package/dist/pandora2.es.js +52230 -0
  59. package/dist/pandora2.umd.js +78 -0
  60. package/dist/src/_utils/create/index.d.ts +1 -0
  61. package/dist/src/_utils/dateUtil.d.ts +7 -0
  62. package/dist/src/_utils/env.d.ts +26 -0
  63. package/dist/src/_utils/helper/index.d.ts +4 -0
  64. package/dist/src/_utils/helper/tsxHelper.d.ts +13 -0
  65. package/dist/src/_utils/index.d.ts +8 -0
  66. package/dist/src/_utils/is/index.d.ts +21 -0
  67. package/dist/src/_utils/log/index.d.ts +2 -0
  68. package/dist/src/_utils/propTypes.d.ts +9 -0
  69. package/dist/src/_utils/props/index.d.ts +2 -0
  70. package/dist/src/_utils/vue/index.d.ts +3 -0
  71. package/dist/src/_utils/vue/install.d.ts +5 -0
  72. package/dist/src/_utils/vue/refs.d.ts +3 -0
  73. package/dist/src/_utils/vue/typescript.d.ts +5 -0
  74. package/dist/src/enums/breakpointEnum.d.ts +18 -0
  75. package/dist/src/hooks/component/useFormItem.d.ts +2 -0
  76. package/dist/src/hooks/core/useAttrs.d.ts +9 -0
  77. package/dist/src/hooks/core/useContext.d.ts +11 -0
  78. package/dist/src/hooks/event/useBreakpoint.d.ts +22 -0
  79. package/dist/src/hooks/event/useEventListener.d.ts +14 -0
  80. package/dist/src/types/axios.d.ts +53 -0
  81. package/dist/src/types/config.d.ts +25 -0
  82. package/dist/src/types/global.d.ts +107 -0
  83. package/dist/src/vue-sfc-shim.d.ts +19 -0
  84. package/package.json +129 -0
  85. package/volar.d.ts +9 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 yelingfeng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # Pandora2
2
+
3
+ [![version](https://img.shields.io/github/package-json/v/yelingfeng/Pandora2)](https://github.com/yelingfeng/Pandora2)
4
+ [![npm](https://img.shields.io/npm/v/%40yelingfeng%2Fpandora2)](https://www.npmjs.com/package/@yelingfeng/pandora2)
5
+ [![test](https://github.com/yelingfeng/Pandora2/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/yelingfeng/Pandora2/actions/workflows/node.js.yml)
6
+ [![coverage](https://codecov.io/gh/yelingfeng/Pandora2/branch/main/graph/badge.svg)](https://codecov.io/gh/yelingfeng/Pandora2)
7
+
8
+ <p align="center">
9
+ <img src="https://github.com/yelingfeng/Pandora2/blob/main/src/assets/logo.svg?raw=true" alt="Pandora2 Logo" />
10
+ </p>
11
+
12
+ ### 介绍
13
+ ---
14
+
15
+ `Pandora2` 是一套基于 `Vue 3` + `TypeScript` + `Vite` + `Element Plus` 的业务组件库,核心目标是用更少的 View 层代码完成常见的后台管理开发:
16
+
17
+ - 表单:Schema(JSON)驱动,支持动态显示/禁用、联动与自定义渲染
18
+ - 表格:列配置驱动,分页/选择/排序等能力封装
19
+ - 页面布局:表单 + 表格的常用布局封装(PageLayout / TreeLayout)
20
+ - 图表:ECharts WebComponent 封装(Charts)
21
+
22
+
23
+ ### 安装
24
+
25
+ ```bash
26
+ pnpm add @yelingfeng/pandora2
27
+ ```
28
+
29
+ ```ts
30
+ import { createApp } from 'vue'
31
+ import App from './App.vue'
32
+
33
+ import Pandora2 from '@yelingfeng/pandora2'
34
+ import '@yelingfeng/pandora2/dist/style.css'
35
+
36
+ const app = createApp(App)
37
+ app.use(Pandora2)
38
+ app.mount('#app')
39
+ ```
40
+
41
+ ### 技术栈与版本
42
+ | 依赖 | 版本(当前) |
43
+ | ------ | ------ |
44
+ | Vue | ^3.5.26 |
45
+ | Element Plus | ^2.13.1 |
46
+ | TypeScript | ^5.9.3 |
47
+ | Vite | ^7.3.1 |
48
+ | Vitest | ^4.0.18 |
49
+ | pnpm(推荐) | 9.x(与 CI 一致) |
50
+ | Node(推荐) | 22.21.1(与 CI 一致) |
51
+
52
+ ### 测试与覆盖率
53
+ 徽章说明:
54
+
55
+ - test:GitHub Actions `CI & Publish Pandora2` 在 `main` 分支的测试状态
56
+ - coverage:Codecov 展示的覆盖率(点击可查看图表与文件级明细)
57
+
58
+ 本地运行:
59
+
60
+ ```bash
61
+ pnpm run test:ci
62
+ pnpm run test:coverage
63
+ ```
64
+
65
+ 覆盖率产物:
66
+
67
+ - `coverage/lcov.info`:用于 CI 上传到 Codecov
68
+ - `coverage/index.html`:本地可视化覆盖率报告(图表 + 文件明细)
69
+
70
+ ### 发布(自动打 Tag)
71
+ 该仓库的 GitHub Actions 会在推送 `v*` tag 时触发 `npm publish`。
72
+
73
+ 本地发布(会自动生成 changelog、提交、打 tag 并 push):
74
+
75
+ ```bash
76
+ pnpm run release:patch
77
+ # pnpm run release:minor
78
+ # pnpm run release:major
79
+ ```
80
+
81
+ 如果出现 `Tag already exists: vX.Y.Z`,说明该版本 tag 已经存在(本地或远端),需要先提升 `package.json` 的 version,再重新发布。
82
+
83
+ #
84
+
85
+ ### 开发者 👨‍💻
86
+ | Author | E-mail |
87
+ | ------ | ----- |
88
+ | [yelingfeng](http://github.com/yelingfeng) | 315977815@qq.com |
@@ -0,0 +1,7 @@
1
+ import Charts from './src/index.vue';
2
+ export { Charts };
3
+ export declare const PdCharts: any;
4
+ export default PdCharts;
5
+ export type ChartsInstance = InstanceType<typeof PdCharts>;
6
+ export { useAutoresize, useCharts, useEventListener, useLoading, usePublicAPI } from './src/hooks/index';
7
+ export * from './src/types';
@@ -0,0 +1,2 @@
1
+ declare const result: any;
2
+ export default result;
@@ -0,0 +1,6 @@
1
+ import type { EChartsOption } from 'echarts';
2
+ /**
3
+ *
4
+ * @param originData 原始数据
5
+ */
6
+ export declare const build: (originData: any) => EChartsOption;
@@ -0,0 +1,6 @@
1
+ import type { EChartsOption } from 'echarts';
2
+ /**
3
+ *
4
+ * @param originData 原始数据
5
+ */
6
+ export declare const build: (originData: any) => EChartsOption;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 默认主题 Colors
3
+ */
4
+ export declare const COMMON_COLORS: string[];
5
+ /**
6
+ * backgroundColor
7
+ */
8
+ export declare const BG_COLOR = "#fff";
9
+ /**
10
+ * axisLable Color
11
+ */
12
+ export declare const AXIS_LBAEL_COLOR = "#C8E6E8";
13
+ export declare const AXIS_LINE_COLOR = "#83D2EE";
14
+ /**
15
+ * 默认line 类型
16
+ */
17
+ export declare const DEAULT_LINE_TYPE = "dashed";
18
+ /**
19
+ * splitLine color
20
+ */
21
+ export declare const SPLIT_LINE_COLOR = "rgba(61,73,124,1)";
@@ -0,0 +1,5 @@
1
+ export * from './useApi';
2
+ export * from './useLoading';
3
+ export * from './useAutosize';
4
+ export * from './useEventListener';
5
+ export * from './useCharts';
@@ -0,0 +1,7 @@
1
+ import { type Ref } from 'vue';
2
+ import { EChartsType } from '../types';
3
+ declare const METHOD_NAMES: readonly ["getWidth", "getHeight", "getDom", "getOption", "resize", "dispatchAction", "convertToPixel", "convertFromPixel", "containPixel", "getDataURL", "getConnectedDataURL", "appendData", "clear", "isDisposed", "dispose"];
4
+ type MethodName = typeof METHOD_NAMES[number];
5
+ type PublicMethods = Pick<EChartsType, MethodName>;
6
+ export declare function usePublicAPI(chart: Ref<EChartsType | undefined>): PublicMethods;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type Ref } from 'vue';
2
+ import type { EChartsType } from '../types';
3
+ import type { AutoresizeProp } from '../types';
4
+ export declare function useAutoresize(chart: Ref<EChartsType | undefined>, autoresize: Ref<AutoresizeProp | undefined>, root: Ref<HTMLElement | undefined>): void;
@@ -0,0 +1,2 @@
1
+ import type { ChartsProps, UseChartsReturnType } from '../types';
2
+ export declare function useCharts(props?: Partial<ChartsProps>): UseChartsReturnType;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 监听事件
3
+ * @param instance 实例
4
+ * @param attrs 属性
5
+ * @param listeners 监听
6
+ */
7
+ export declare function useEventListener(instance: any, attrs: any, listeners: any): void;
@@ -0,0 +1,4 @@
1
+ import { type Ref, type InjectionKey } from 'vue';
2
+ import type { EChartsType, LoadingOptions } from '../types';
3
+ export declare const LOADING_OPTIONS_KEY: InjectionKey<LoadingOptions | Ref<LoadingOptions, LoadingOptions>>;
4
+ export declare function useLoading(chart: Ref<EChartsType | undefined>, loading: Ref<boolean>, loadingOptions: Ref<LoadingOptions | undefined>): void;
@@ -0,0 +1,40 @@
1
+ import { type PropType } from 'vue';
2
+ import type { AutoresizeProp, LoadingOptions, OriginData, Theme } from '../types';
3
+ import type { ChartTypes, SubChartType } from '../types/chart';
4
+ export declare const defaultProps: {
5
+ data: {
6
+ type: PropType<OriginData<any>[]>;
7
+ default: () => never[];
8
+ };
9
+ theme: {
10
+ type: PropType<Theme>;
11
+ };
12
+ options: {
13
+ type: PropType<import("echarts/types/dist/shared").ECBasicOption>;
14
+ default: () => void;
15
+ };
16
+ group: StringConstructor;
17
+ initOptions: PropType<import("echarts/types/dist/shared").EChartsInitOpts>;
18
+ updateOptions: PropType<import("echarts/types/dist/shared").SetOptionOpts>;
19
+ manualUpdate: BooleanConstructor;
20
+ autoresize: {
21
+ type: PropType<AutoresizeProp>;
22
+ default: boolean;
23
+ };
24
+ loading: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ loadingOptions: {
29
+ type: PropType<LoadingOptions>;
30
+ default: () => void;
31
+ };
32
+ /**
33
+ * 一级图表类型
34
+ */
35
+ chartType: PropType<ChartTypes>;
36
+ /**
37
+ * 二级图标类型
38
+ */
39
+ subChartType: PropType<SubChartType>;
40
+ };
@@ -0,0 +1,18 @@
1
+ import type { ChartTypes } from '../types/chart';
2
+ /**
3
+ * 转换数据 生成 echarts Series 对象
4
+ * @param data
5
+ * @param chartName
6
+ */
7
+ export declare const transformOriginDataToSeries: (data: any, chartName: ChartTypes) => {
8
+ series: any;
9
+ category: any;
10
+ };
11
+ /**
12
+ *
13
+ * 转化饼图数据 生成 echarts Series 对象
14
+ */
15
+ export declare const transformPieDataToSeries: (data: any, colors: any) => {
16
+ category: any;
17
+ series: any;
18
+ };
@@ -0,0 +1,31 @@
1
+ import type { ChartTypes } from '../types/chart';
2
+ /**
3
+ * 多分组构建 用于线图 柱图 地图等多分组类图表
4
+ * getGroupSeriesObj
5
+ * @param {Array} originData 原始数据集合
6
+ * @param {Object} props 属性集合对象
7
+ * @param {String} __chartName__ 图表标识
8
+ * @return {category,xAxis,series,data}
9
+ */
10
+ export declare const getGroupSeriesObj: (originData: any, name: any) => {
11
+ category: never[];
12
+ xAxis: never[];
13
+ series: never[];
14
+ } | {
15
+ xAxis: any;
16
+ series: any;
17
+ };
18
+ /**
19
+ * 普通非分组类图表series构建方法
20
+ * [ 2.0需求 也需要支持xAixs功能 ]
21
+ * getNormalSeriesObj
22
+ * @param {Array} originData 原始数据
23
+ * @param {Object} props 属性对象
24
+ * @param {String} __chartName__ 图表表示 bar line map
25
+ * @return
26
+ */
27
+ export declare const getNormalSeriesObj: (originData: any, __chartName__: ChartTypes) => {
28
+ category: any;
29
+ seriesObj: any;
30
+ };
31
+ export declare const getCategory: (originData: any) => any;
@@ -0,0 +1,19 @@
1
+ export declare enum ChartTypeEnum {
2
+ Bar = "bar",
3
+ Pie = "pie",
4
+ Line = "line",
5
+ Map = "map",
6
+ Radar = "radar"
7
+ }
8
+ export interface IChartType {
9
+ Bar: 'bar';
10
+ Pie: 'pie';
11
+ Line: 'line';
12
+ Map: 'map';
13
+ Radar: 'radar';
14
+ }
15
+ export type ChartTypes = IChartType[keyof IChartType];
16
+ /**
17
+ * 二级图表
18
+ */
19
+ export type SubChartType = 'pie01' | 'pie02' | 'pie03';
@@ -0,0 +1,94 @@
1
+ import { init, type ECElementEvent, type ElementEvent, type SetOptionOpts } from 'echarts/core';
2
+ import { Ref } from 'vue';
3
+ export type Injection<T> = T | null | Ref<T | null> | {
4
+ value: T | null;
5
+ };
6
+ type InitType = typeof init;
7
+ export type Theme = NonNullable<InitParameters[1]>;
8
+ export type ThemeInjection = Injection<Theme>;
9
+ export type InitParameters = Parameters<InitType>;
10
+ export type InitOptions = NonNullable<InitParameters[2]>;
11
+ export type InitOptionsInjection = Injection<InitOptions>;
12
+ export type UpdateOptions = SetOptionOpts;
13
+ export type UpdateOptionsInjection = Injection<UpdateOptions>;
14
+ export type EChartsType = ReturnType<InitType>;
15
+ type ZRenderType = ReturnType<EChartsType['getZr']>;
16
+ export type EventTarget = EChartsType | ZRenderType;
17
+ type SetOptionType = EChartsType['setOption'];
18
+ export type ChartsOption = Parameters<SetOptionType>[0];
19
+ type MouseEventName = 'click' | 'dblclick' | 'mouseout' | 'mouseover' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu' | 'globalout';
20
+ type ElementEventName = MouseEventName | 'drag' | 'dragstart' | 'dragend' | 'dragenter' | 'dragleave' | 'dragover' | 'drop';
21
+ type ZRenderEventName = `zr:${ElementEventName}`;
22
+ type OtherEventName = 'highlight' | 'downplay' | 'selectchanged' | 'legendselectchanged' | 'legendselected' | 'legendunselected' | 'legendselectall' | 'legendinverseselect' | 'legendscroll' | 'datazoom' | 'datarangeselected' | 'graphroam' | 'georoam' | 'treeroam' | 'timelinechanged' | 'timelineplaychanged' | 'restore' | 'dataviewchanged' | 'magictypechanged' | 'geoselectchanged' | 'geoselected' | 'geounselected' | 'axisareaselected' | 'brush' | 'brushEnd' | 'brushselected' | 'globalcursortaken';
23
+ export type LoadingOptions = {
24
+ text?: string;
25
+ textColor?: string;
26
+ fontSize?: number | string;
27
+ fontWeight?: number | string;
28
+ fontStyle?: string;
29
+ fontFamily?: string;
30
+ maskColor?: string;
31
+ showSpinner?: boolean;
32
+ color?: string;
33
+ spinnerRadius?: number;
34
+ lineWidth?: number;
35
+ zlevel?: number;
36
+ };
37
+ type MouseEmits = {
38
+ [key in MouseEventName]: (params: ECElementEvent) => boolean;
39
+ };
40
+ type ZRenderEmits = {
41
+ [key in ZRenderEventName]: (params: ElementEvent) => boolean;
42
+ };
43
+ type OtherEmits = {
44
+ [key in OtherEventName]: null;
45
+ };
46
+ export type Emits = MouseEmits & OtherEmits & {
47
+ rendered: (params: {
48
+ elapsedTime: number;
49
+ }) => boolean;
50
+ finished: () => boolean;
51
+ register: (instance: ChartsActionType) => void;
52
+ } & ZRenderEmits;
53
+ /**
54
+ * 原始数据类型
55
+ */
56
+ export type OriginData<T> = {
57
+ [index: number]: T | null;
58
+ };
59
+ /**
60
+ * 自动Resize刷新
61
+ */
62
+ export type AutoresizeProp = boolean | {
63
+ throttle?: number;
64
+ onResize?: () => void;
65
+ };
66
+ export interface ChartsProps {
67
+ data?: any[];
68
+ options?: ChartsOption;
69
+ theme?: Theme;
70
+ chartType?: string;
71
+ subChartType?: string;
72
+ manualUpdate?: boolean;
73
+ autoresize?: AutoresizeProp;
74
+ loading?: boolean;
75
+ loadingOptions?: LoadingOptions;
76
+ initOptions?: InitOptions;
77
+ updateOptions?: UpdateOptions;
78
+ group?: string;
79
+ }
80
+ export interface ChartsActionType {
81
+ setOptions: (options: ChartsOption) => void;
82
+ setProps: (props: Partial<ChartsProps>) => void;
83
+ resize: () => void;
84
+ getInstance: () => EChartsType | undefined;
85
+ showLoading: (type?: string, opts?: LoadingOptions) => void;
86
+ hideLoading: () => void;
87
+ clear: () => void;
88
+ dispose: () => void;
89
+ }
90
+ export type UseChartsReturnType = [
91
+ (instance: ChartsActionType) => void,
92
+ ChartsActionType
93
+ ];
94
+ export {};
@@ -0,0 +1,31 @@
1
+ export type Fn = (...args: any[]) => any;
2
+ export type LineType = 'solid' | 'dashed' | 'dotted';
3
+ export interface BaseLineType {
4
+ lineType?: LineType;
5
+ color?: string;
6
+ xAxis?: boolean;
7
+ yAxis?: boolean;
8
+ originOpt?: any;
9
+ }
10
+ /**
11
+ * AxisLine Type
12
+ */
13
+ export interface AxisLineType extends BaseLineType {
14
+ symbol?: string | Array<any>;
15
+ symbolSize?: Array<any>;
16
+ }
17
+ /**
18
+ * AxisLable Type
19
+ */
20
+ export interface AxisLabelType extends BaseLineType {
21
+ rotate?: number;
22
+ interval?: string;
23
+ formatter?: Fn | string;
24
+ }
25
+ /**
26
+ * DataZoom
27
+ */
28
+ export interface DataZoomType {
29
+ show?: boolean;
30
+ start?: number;
31
+ }
@@ -0,0 +1,7 @@
1
+ import { EChartsOption } from 'echarts';
2
+ import { ChartTypes, SubChartType } from '../types/chart';
3
+ /**
4
+ * echarts 构建 封装
5
+ * build
6
+ */
7
+ export declare const build: (data: any, chartType: ChartTypes, subChartType: SubChartType) => EChartsOption;
@@ -0,0 +1,100 @@
1
+ import { AxisLabelType, AxisLineType, BaseLineType, DataZoomType } from '../types/props';
2
+ /**
3
+ * @param opt
4
+ * @returns
5
+ */
6
+ export declare function getSplitLineOpt(opt: BaseLineType): {
7
+ xAxis: {
8
+ show: boolean;
9
+ lineStyle: {
10
+ type: import("../types/props").LineType;
11
+ color: string;
12
+ };
13
+ };
14
+ yAxis: {
15
+ show: boolean;
16
+ lineStyle: {
17
+ type: import("../types/props").LineType;
18
+ color: string;
19
+ };
20
+ };
21
+ };
22
+ /**
23
+ *
24
+ * @param opt
25
+ * @returns
26
+ */
27
+ export declare function getAxisLineOpt(opt: AxisLineType): {
28
+ xAxis: {
29
+ show: boolean;
30
+ symbol: string | any[];
31
+ symbolSize: any[];
32
+ lineStyle: {
33
+ type: import("../types/props").LineType;
34
+ color: string;
35
+ };
36
+ };
37
+ yAxis: {
38
+ show: boolean;
39
+ symbol: string | any[];
40
+ symbolSize: any[];
41
+ lineStyle: {
42
+ type: import("../types/props").LineType;
43
+ color: string;
44
+ };
45
+ };
46
+ };
47
+ /**
48
+ *
49
+ * @param opt
50
+ * @returns
51
+ */
52
+ export declare function getAxisLabelOpt(opt: AxisLabelType): {
53
+ xAxis: {
54
+ show: boolean;
55
+ textStyle: {
56
+ color: string;
57
+ };
58
+ rotate: number;
59
+ interval: string;
60
+ formatter: string | import("../types/props").Fn;
61
+ };
62
+ yAxis: {
63
+ show: boolean;
64
+ textStyle: {
65
+ color: string;
66
+ };
67
+ };
68
+ };
69
+ /**
70
+ *
71
+ * @param opt
72
+ * @returns
73
+ */
74
+ export declare const getDataZoomOpt: (opt: DataZoomType) => {
75
+ show: boolean | undefined;
76
+ backgroundColor: string;
77
+ borderColor: string;
78
+ height: number;
79
+ xAxisIndex: number;
80
+ radiusAxisIndex: number;
81
+ bottom: number;
82
+ brushSelect: boolean;
83
+ startValue: number | undefined;
84
+ endValue: number;
85
+ handleIcon: string;
86
+ handleSize: string;
87
+ fillerColor: string;
88
+ handleStyle: {
89
+ borderColor: string;
90
+ backgroundColor: string;
91
+ color: string;
92
+ };
93
+ textStyle: {
94
+ color: string;
95
+ };
96
+ }[];
97
+ export declare const defaultThemeOpt: () => {
98
+ color: string[];
99
+ backgroundColor: string;
100
+ };
@@ -0,0 +1,18 @@
1
+ import type { Injection } from '../types';
2
+ type Attrs = {
3
+ [key: string]: any;
4
+ };
5
+ /**
6
+ * 对象深度合并
7
+ * @param obj1
8
+ * @param obj2
9
+ */
10
+ export declare const _merge: (source: Recordable, target: Recordable) => Recordable<any>;
11
+ export declare const isOn: (key: string) => boolean;
12
+ export declare function omitOn(attrs: Attrs): Attrs;
13
+ export declare function unwrapInjected<T, V>(injection: Injection<T>, defaultValue?: V): T | V;
14
+ export declare const trim: (string: string) => string;
15
+ export declare const isFunction: (obj: any) => boolean;
16
+ export declare const isArray: (obj: any) => boolean;
17
+ export declare const hexToRgba: (hex: string, opacity: number) => string;
18
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const TAG_NAME = "pandora-charts";
2
+ export interface EChartsElement extends HTMLElement {
3
+ __dispose: (() => void) | null;
4
+ }
5
+ export declare function register(): boolean;
@@ -0,0 +1,14 @@
1
+ import Form from './src/index.vue';
2
+ import FormItem from './src/components/FormItem.vue';
3
+ import type { SFCWithInstall } from '../../../src/_utils/vue/typescript';
4
+ export { useComponentRegister } from './src/hooks/useComponentRegister';
5
+ export { useForm } from './src/hooks/useForm';
6
+ export declare const PdForm: SFCWithInstall<typeof Form> & {
7
+ FormItem: typeof FormItem;
8
+ };
9
+ export default PdForm;
10
+ export declare const PdFormItem: SFCWithInstall<typeof FormItem>;
11
+ export type { IFormItem } from './src/types/formItem';
12
+ export type { IFormSchema, IFormProps, IFormActionType, RenderCallbackParams } from './src/types/index';
13
+ export type FormInstance = InstanceType<typeof Form>;
14
+ export type FormItemInstance = InstanceType<typeof FormItem>;
@@ -0,0 +1,6 @@
1
+ import type { Component } from 'vue';
2
+ import type { ComponentType } from './types';
3
+ declare const componentMap: Map<ComponentType, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>>;
4
+ export declare function add(compName: ComponentType, component: Component): void;
5
+ export declare function del(compName: ComponentType): void;
6
+ export { componentMap };
@@ -0,0 +1,14 @@
1
+ import type { ComponentType } from './types/index';
2
+ import { FormRules } from 'element-plus';
3
+ /**
4
+ * @description: 生成placeholder
5
+ */
6
+ export declare function createPlaceholderMessage(component: ComponentType): "" | "请输入内容" | "请选择内容";
7
+ export declare function setComponentRuleType(rule: FormRules, component: ComponentType, valueFormat: string): void;
8
+ export declare function processDateValue(attr: Recordable, component: string): void;
9
+ export declare function handleInputNumberValue(component?: ComponentType, val?: any): any;
10
+ /**
11
+ * 时间字段
12
+ */
13
+ export declare const dateItemType: string[];
14
+ export declare const defaultValueComponents: string[];
@@ -0,0 +1,15 @@
1
+ import type { AdvanceState } from '../types/hooks';
2
+ import type { EmitType, IFormProps, IFormSchema } from '../types';
3
+ import { ComputedRef, Ref } from 'vue';
4
+ interface UseAdvancedContext {
5
+ advanceState: AdvanceState;
6
+ emit: EmitType;
7
+ getProps: ComputedRef<IFormProps>;
8
+ getSchema: ComputedRef<IFormSchema[]>;
9
+ formModel: Recordable;
10
+ defaultValueRef: Ref<Recordable>;
11
+ }
12
+ export default function ({ advanceState, emit, getProps, getSchema, formModel, defaultValueRef }: UseAdvancedContext): {
13
+ handleToggleAdvanced: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { IFormSchema, IFormActionType, IFormProps } from '../types';
3
+ interface UseAutoFocusContext {
4
+ getSchema: ComputedRef<IFormSchema[]>;
5
+ getProps: ComputedRef<IFormProps>;
6
+ isInitedDefault: Ref<boolean>;
7
+ formElRef: Ref<IFormActionType>;
8
+ }
9
+ export declare function useAutoFocus({ getSchema, getProps, formElRef, isInitedDefault }: UseAutoFocusContext): Promise<void>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { ComponentType } from '../types/index';
2
+ import type { Component } from 'vue';
3
+ export declare function useComponentRegister(compName: ComponentType, comp: Component): void;
@@ -0,0 +1,4 @@
1
+ import type { IFormProps, DynamicProps, UseFormReturnType } from '../types';
2
+ type Props = Partial<DynamicProps<IFormProps>>;
3
+ export declare function useForm(props?: Props): UseFormReturnType;
4
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface FormContextProps {
2
+ resetAction: () => Promise<void>;
3
+ submitAction: () => Promise<void>;
4
+ }
5
+ export declare function createFormContext(context: FormContextProps): {
6
+ state: any;
7
+ };
8
+ export declare function useFormContext(): FormContextProps;