el-plus 0.0.86 → 0.0.87-beta.0

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 (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/index.full.js +2 -2
  3. package/dist/index.full.min.js +2 -2
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +2 -2
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +2 -2
  8. package/docs/components/form.md +15 -0
  9. package/docs/components/use-choose-dialog.md +2 -2
  10. package/docs/components/use-confirm-dialog.md +2 -2
  11. package/docs/components/use-form-dialog.md +2 -2
  12. package/docs/pages/detail.md +7 -15
  13. package/docs/pages/list.md +2 -1
  14. package/es/cli/src/fetcher/browser-fetcher.d.ts +8 -3
  15. package/es/cli/src/fetcher/fetcher-factory.d.ts +2 -2
  16. package/es/cli/src/fetcher/index.d.ts +4 -5
  17. package/es/cli/src/fetcher/node-fetcher.d.ts +5 -3
  18. package/es/cli/src/fetcher/types.d.ts +6 -9
  19. package/es/cli/src/fetcher/utils.d.ts +1 -5
  20. package/es/cli/src/parser/base-parser.d.ts +19 -0
  21. package/es/cli/src/parser/extractors.d.ts +9 -0
  22. package/es/cli/src/parser/figma-parser.d.ts +0 -0
  23. package/es/cli/src/parser/index.d.ts +2 -0
  24. package/es/cli/src/parser/modao-parser.d.ts +4 -13
  25. package/es/components/form/src/form-item-vue.d.ts +1 -1
  26. package/es/components/header/index.d.ts +3 -3
  27. package/es/components/header/src/header.vue.d.ts +1 -1
  28. package/es/components/search-list-page/index.d.ts +6 -6
  29. package/es/components/search-list-page/src/search-list-page.vue.d.ts +2 -2
  30. package/es/components/search-list-page/src/use-search-list-page.d.ts +2 -2
  31. package/es/package.json.mjs +1 -1
  32. package/lib/cli/src/fetcher/browser-fetcher.d.ts +8 -3
  33. package/lib/cli/src/fetcher/fetcher-factory.d.ts +2 -2
  34. package/lib/cli/src/fetcher/index.d.ts +4 -5
  35. package/lib/cli/src/fetcher/node-fetcher.d.ts +5 -3
  36. package/lib/cli/src/fetcher/types.d.ts +6 -9
  37. package/lib/cli/src/fetcher/utils.d.ts +1 -5
  38. package/lib/cli/src/parser/base-parser.d.ts +19 -0
  39. package/lib/cli/src/parser/extractors.d.ts +9 -0
  40. package/lib/cli/src/parser/figma-parser.d.ts +0 -0
  41. package/lib/cli/src/parser/index.d.ts +2 -0
  42. package/lib/cli/src/parser/modao-parser.d.ts +4 -13
  43. package/lib/components/form/src/form-item-vue.d.ts +1 -1
  44. package/lib/components/header/index.d.ts +3 -3
  45. package/lib/components/header/src/header.vue.d.ts +1 -1
  46. package/lib/components/search-list-page/index.d.ts +6 -6
  47. package/lib/components/search-list-page/src/search-list-page.vue.d.ts +2 -2
  48. package/lib/components/search-list-page/src/use-search-list-page.d.ts +2 -2
  49. package/lib/package.json.js +1 -1
  50. package/package.json +1 -1
  51. package/es/cli/src/fetcher/browser-instance.d.ts +0 -8
  52. package/lib/cli/src/fetcher/browser-instance.d.ts +0 -8
@@ -1,4 +1,4 @@
1
- /*! ElPlus v0.0.86 */
1
+ /*! ElPlus v0.0.87-beta.0 */
2
2
 
3
3
  import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, reactive, onBeforeUpdate, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw } from 'vue';
4
4
  import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, configProviderContextKey, ElConfigProvider, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1, ElSkeleton } from 'element-plus';
@@ -4461,7 +4461,7 @@ var components = [
4461
4461
  EpFooterInfo
4462
4462
  ];
4463
4463
 
4464
- var version = "0.0.86";
4464
+ var version = "0.0.87-beta.0";
4465
4465
 
4466
4466
  var globalProperties = {
4467
4467
  install(app) {
@@ -40,6 +40,12 @@ const formItemList = ref<FormProps['formItemList']>([
40
40
  ])
41
41
  </script>
42
42
  ```
43
+ ## 表单数据
44
+
45
+ - 表单数据:不需要预定义所有字段,reactive({}) 即可
46
+ - 仅以下类型需要预定义:
47
+ - dateRange:需定义开始/结束字段
48
+ - 表格数组、附件数组等复杂类型
43
49
 
44
50
  ## Props
45
51
 
@@ -160,8 +166,17 @@ const formItemList = computed<FormProps['formItemList']>(() => [
160
166
  type: 'EpAttachment',
161
167
  props: {
162
168
  modelValue: formData.fileList,
169
+ openType: 'normal',
163
170
  },
164
171
  },
172
+ // 页脚信息
173
+ {
174
+ col: 24,
175
+ type:'EpFooterInfo',
176
+ props: {
177
+ modelValue: formData,
178
+ },
179
+ }
165
180
  ])
166
181
  ```
167
182
 
@@ -31,7 +31,7 @@ const ChooseDialog = useChooseDialog({
31
31
 
32
32
  const handleChoose = async () => {
33
33
  try {
34
- const selection = await ChooseDialog.start()
34
+ const selection = await ChooseDialog.open()
35
35
  console.log('选中', selection)
36
36
  } catch (e) {
37
37
  console.log('取消')
@@ -110,6 +110,6 @@ const ChooseDialog = useChooseDialog({
110
110
 
111
111
  | 方法 | 说明 | 类型 |
112
112
  |------|------|------|
113
- | start | 打开对话框并返回 Promise | `() => Promise<Selection>` |
113
+ | open | 打开对话框并返回 Promise | `() => Promise<Selection>` |
114
114
  | open | 打开对话框 | `() => void` |
115
115
  | close | 关闭对话框 | `() => void` |
@@ -20,7 +20,7 @@ const ConfirmDialog = useConfirmDialog({
20
20
 
21
21
  const handleConfirm = async () => {
22
22
  try {
23
- const result = await ConfirmDialog.start()
23
+ const result = await ConfirmDialog.open()
24
24
  console.log '确认,意见:', result.value)
25
25
  } catch (e) {
26
26
  console.log('取消')
@@ -82,6 +82,6 @@ const ConfirmDialog = useConfirmDialog({
82
82
 
83
83
  | 方法 | 说明 | 类型 |
84
84
  |------|------|------|
85
- | start | 打开对话框并返回 Promise | `() => Promise<{ value: string }>` |
85
+ | open | 打开对话框并返回 Promise | `() => Promise<{ value: string }>` |
86
86
  | open | 打开对话框 | `() => void` |
87
87
  | close | 关闭对话框 | `() => void` |
@@ -28,7 +28,7 @@ const FormDialog = useFormDialog({
28
28
 
29
29
  const openDialog = async () => {
30
30
  try {
31
- const formData = await FormDialog.start()
31
+ const formData = await FormDialog.open()
32
32
  console.log('表单数据', formData)
33
33
  } catch (e) {
34
34
  console.log('取消')
@@ -82,6 +82,6 @@ const FormDialog = useFormDialog({
82
82
 
83
83
  | 方法 | 说明 | 类型 |
84
84
  |------|------|------|
85
- | start | 打开对话框并返回 Promise | `() => Promise<FormData>` |
85
+ | open | 打开对话框并返回 Promise | `() => Promise<FormData>` |
86
86
  | open | 打开对话框 | `() => void` |
87
87
  | close | 关闭对话框 | `() => void` |
@@ -10,16 +10,13 @@
10
10
  ## 完整示例
11
11
 
12
12
  ```vue
13
- <template>
14
- <div>
15
-
16
- <EpForm
17
- ref="epForm"
18
- :formItemList="formItemList"
19
- v-model="formData"
20
- labelPosition="left"
21
- ></EpForm>
22
- </div>
13
+ <template>
14
+ <EpForm
15
+ ref="epForm"
16
+ :formItemList="formItemList"
17
+ v-model="formData"
18
+ labelPosition="left"
19
+ ></EpForm>
23
20
  </template>
24
21
 
25
22
  <script setup lang="tsx">
@@ -38,12 +35,7 @@ const { isEdit } = useNavigation()
38
35
  const id = route.query.id
39
36
 
40
37
 
41
- // 表单数据:不需要预定义所有字段,reactive({}) 即可
42
- // 仅以下类型需要预定义:
43
- // - dateRange:需定义开始/结束字段
44
- // - 表格数组、附件数组
45
38
  const formData = reactive({
46
- // dateRange 示例:orderDateStart: '', orderDateEnd: '',
47
39
  detailList: [] as Record<string, any>[], // 明细表格
48
40
  fileList: [] as Record<string, any>[], // 附件列表
49
41
  })
@@ -35,7 +35,8 @@ defineOptions({
35
35
  const { $goto } = useNavigation()
36
36
 
37
37
  const formData = reactive({
38
- // 表单数据
38
+ orderDateStart: '',
39
+ orderDateEnd: '',
39
40
  })
40
41
 
41
42
  // 搜索表单配置 - 组件自由组合
@@ -1,4 +1,9 @@
1
- import type { RequestPayload } from './types.js';
2
- export declare class BrowserFetcher {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
1
+ import { IFetcher } from './types.js';
2
+ export declare class BrowserFetcher implements IFetcher {
3
+ private browser;
4
+ private initBrowser;
5
+ close(): Promise<void>;
6
+ fetchHtml(url: string, options?: any): Promise<string>;
7
+ fetchJson(url: string, options?: any): Promise<any>;
8
+ fetchText(url: string, options?: any): Promise<string>;
4
9
  }
@@ -1,4 +1,4 @@
1
- import type { RequestPayload } from './types.js';
1
+ import { IFetcher, RequestPayload } from './types.js';
2
2
  export declare class FetcherFactory {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
3
+ static createFetcher(requestPayload: RequestPayload): IFetcher;
4
4
  }
@@ -1,6 +1,5 @@
1
+ export * from './fetcher-factory.js';
2
+ export * from './node-fetcher.js';
3
+ export * from './browser-fetcher.js';
1
4
  export * from './types.js';
2
- export { getRandomUserAgent, getSystemProxy, isAccessDeniedError, isNetworkError, setupProxy, } from './utils.js';
3
- export { BrowserInstance } from './browser-instance.js';
4
- export { NodeFetcher } from './node-fetcher.js';
5
- export { BrowserFetcher } from './browser-fetcher.js';
6
- export { FetcherFactory } from './fetcher-factory.js';
5
+ export * from './utils.js';
@@ -1,4 +1,6 @@
1
- import type { RequestPayload } from './types.js';
2
- export declare class NodeFetcher {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
1
+ import { IFetcher } from './types.js';
2
+ export declare class NodeFetcher implements IFetcher {
3
+ fetchHtml(url: string, options?: any): Promise<string>;
4
+ fetchJson(url: string, options?: any): Promise<any>;
5
+ fetchText(url: string, options?: any): Promise<string>;
4
6
  }
@@ -1,15 +1,12 @@
1
1
  export interface RequestPayload {
2
- url: string;
3
- headers?: Record<string, string>;
4
- proxy?: string;
5
- timeout?: number;
6
- useSystemProxy?: boolean;
7
2
  useBrowser?: boolean;
8
3
  useNodeFetch?: boolean;
9
4
  autoDetectMode?: boolean;
10
- waitForSelector?: string;
11
- waitForTimeout?: number;
12
- scrollToBottom?: boolean;
13
- closeBrowser?: boolean;
14
5
  debug?: boolean;
6
+ [key: string]: any;
7
+ }
8
+ export interface IFetcher {
9
+ fetchHtml(url: string, options?: any): Promise<string>;
10
+ fetchJson(url: string, options?: any): Promise<any>;
11
+ fetchText(url: string, options?: any): Promise<string>;
15
12
  }
@@ -1,6 +1,2 @@
1
- import type { Agent } from 'http';
2
1
  export declare function getRandomUserAgent(): string;
3
- export declare function getSystemProxy(useSystemProxy?: boolean): string | undefined;
4
- export declare function isAccessDeniedError(errorText: string): boolean;
5
- export declare function isNetworkError(errorText: string): boolean;
6
- export declare function setupProxy(url: string, proxy: string | undefined): Agent | undefined;
2
+ export declare function isAccessDeniedError(content: string): boolean;
@@ -0,0 +1,19 @@
1
+ import type { Browser, Page } from 'puppeteer';
2
+ import type { ParsedPageData } from './types.js';
3
+ import type { IFetcher } from '../fetcher/types.js';
4
+ export declare abstract class BaseParser {
5
+ protected browser: Browser | null;
6
+ protected page: Page | null;
7
+ protected debug: boolean;
8
+ protected fetcher: IFetcher | null;
9
+ constructor(options?: {
10
+ debug?: boolean;
11
+ });
12
+ protected checkAccessDenied(url?: string): Promise<boolean>;
13
+ protected checkPageContentValid(url?: string): Promise<boolean>;
14
+ init(fetcher?: IFetcher): Promise<void>;
15
+ close(): Promise<void>;
16
+ static forceCloseBrowser(): Promise<void>;
17
+ protected delay(ms: number): Promise<void>;
18
+ abstract parse(url: string): Promise<ParsedPageData>;
19
+ }
@@ -0,0 +1,9 @@
1
+ export declare function extractButtons(container: Element): string[];
2
+ export declare function extractTableHeaders(container: Element): string[];
3
+ export declare function extractLabels(container: Element, exclude: Set<string>): string[];
4
+ export declare function extractFormFields(container: Element): Array<{
5
+ label: string;
6
+ fieldType: string;
7
+ required: boolean;
8
+ }>;
9
+ export declare function extractSectionTitle(container: Element): string | undefined;
File without changes
@@ -1,2 +1,4 @@
1
1
  export * from './types.js';
2
+ export { BaseParser } from './base-parser.js';
3
+ export * from './extractors.js';
2
4
  export { ModaoParser, parseModaoPage, parseModaoPageWithFallback, generateBrowserAgentPrompt, } from './modao-parser.js';
@@ -1,20 +1,11 @@
1
1
  import type { ParsedPageData, ParseResult } from './types.js';
2
+ import { BaseParser } from './base-parser.js';
3
+ import type { IFetcher } from '../fetcher/types.js';
2
4
  export * from './types.js';
3
- export declare class ModaoParser {
4
- private browser;
5
- private page;
6
- private proxy?;
7
- constructor(options?: {
8
- proxy?: string;
9
- });
10
- private checkAccessDenied;
11
- private checkPageContentValid;
12
- init(): Promise<void>;
13
- close(): Promise<void>;
5
+ export declare class ModaoParser extends BaseParser {
14
6
  static forceCloseBrowser(): Promise<void>;
15
7
  parse(url: string): Promise<ParsedPageData>;
16
- private delay;
17
8
  }
18
- export declare function parseModaoPage(url: string): Promise<ParsedPageData>;
9
+ export declare function parseModaoPage(url: string, fetcher?: IFetcher): Promise<ParsedPageData>;
19
10
  export declare function parseModaoPageWithFallback(url: string): Promise<ParseResult>;
20
11
  export declare function generateBrowserAgentPrompt(url: string): string;
@@ -123,8 +123,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
123
123
  __epPropKey: true;
124
124
  };
125
125
  }>> & Readonly<{}>, {
126
- readonly type: string;
127
126
  readonly required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
127
+ readonly type: string;
128
128
  readonly isShowLabel: boolean;
129
129
  readonly hideRequiredAsterisk: boolean;
130
130
  readonly labelPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "top" | "right" | "left", unknown>;
@@ -58,7 +58,6 @@ export declare const EpHeader: {
58
58
  readonly isShowAttachmentButton: boolean;
59
59
  readonly fileList: Record<string, any>[];
60
60
  readonly attachmentProps: {
61
- readonly permission?: `${string}:${string}` | undefined;
62
61
  readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
63
62
  readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
64
63
  [key: string]: any;
@@ -74,6 +73,7 @@ export declare const EpHeader: {
74
73
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
75
74
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
76
75
  }>[] | undefined;
76
+ readonly permission?: `${string}:${string}` | undefined;
77
77
  readonly openType?: "dialog" | "normal" | undefined;
78
78
  readonly isType?: boolean | undefined;
79
79
  readonly isNote?: boolean | undefined;
@@ -146,7 +146,6 @@ export declare const EpHeader: {
146
146
  readonly isShowAttachmentButton: boolean;
147
147
  readonly fileList: Record<string, any>[];
148
148
  readonly attachmentProps: {
149
- readonly permission?: `${string}:${string}` | undefined;
150
149
  readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
151
150
  readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
152
151
  [key: string]: any;
@@ -162,6 +161,7 @@ export declare const EpHeader: {
162
161
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
163
162
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
164
163
  }>[] | undefined;
164
+ readonly permission?: `${string}:${string}` | undefined;
165
165
  readonly openType?: "dialog" | "normal" | undefined;
166
166
  readonly isType?: boolean | undefined;
167
167
  readonly isNote?: boolean | undefined;
@@ -219,7 +219,6 @@ export declare const EpHeader: {
219
219
  readonly isShowAttachmentButton: boolean;
220
220
  readonly fileList: Record<string, any>[];
221
221
  readonly attachmentProps: {
222
- readonly permission?: `${string}:${string}` | undefined;
223
222
  readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
224
223
  readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
225
224
  [key: string]: any;
@@ -235,6 +234,7 @@ export declare const EpHeader: {
235
234
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
236
235
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
237
236
  }>[] | undefined;
237
+ readonly permission?: `${string}:${string}` | undefined;
238
238
  readonly openType?: "dialog" | "normal" | undefined;
239
239
  readonly isType?: boolean | undefined;
240
240
  readonly isNote?: boolean | undefined;
@@ -74,7 +74,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
74
74
  readonly isShowAttachmentButton: boolean;
75
75
  readonly fileList: Record<string, any>[];
76
76
  readonly attachmentProps: {
77
- readonly permission?: `${string}:${string}` | undefined;
78
77
  readonly mode?: import("el-plus/es/hooks").PageMode | undefined;
79
78
  readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
80
79
  [key: string]: any;
@@ -90,6 +89,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
90
89
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
91
90
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
92
91
  }>[] | undefined;
92
+ readonly permission?: `${string}:${string}` | undefined;
93
93
  readonly openType?: "dialog" | "normal" | undefined;
94
94
  readonly isType?: boolean | undefined;
95
95
  readonly isNote?: boolean | undefined;
@@ -357,9 +357,8 @@ export declare const EpSearchListPage: {
357
357
  readonly preserveExpandedContent: boolean;
358
358
  readonly nativeScrollbar: boolean;
359
359
  readonly load?: ((row: any, treeNode: import("element-plus").TreeNode, resolve: (data: any[]) => void) => void) | undefined;
360
- readonly width?: string | number | undefined;
361
- readonly height?: string | number | undefined;
362
360
  readonly method?: import("axios").Method | undefined;
361
+ readonly width?: string | number | undefined;
363
362
  readonly api?: import("el-plus/es/types/axios").Api | undefined;
364
363
  readonly reqData?: Record<string, any> | undefined;
365
364
  readonly reqParams?: Record<string, any> | undefined;
@@ -392,6 +391,7 @@ export declare const EpSearchListPage: {
392
391
  readonly selectable?: ((row: import("element-plus/es/components/table/src/table/defaults.js").DefaultRow, index: number) => boolean) | undefined;
393
392
  readonly indexFormatter?: number | ((index: number) => number) | undefined;
394
393
  readonly customColumnModule?: string | number | undefined;
394
+ readonly height?: string | number | undefined;
395
395
  readonly maxHeight?: string | number | undefined;
396
396
  readonly sumText?: string | undefined;
397
397
  readonly currentRowKey?: string | number | undefined;
@@ -3004,9 +3004,8 @@ export declare const EpSearchListPage: {
3004
3004
  readonly preserveExpandedContent: boolean;
3005
3005
  readonly nativeScrollbar: boolean;
3006
3006
  readonly load?: ((row: any, treeNode: import("element-plus").TreeNode, resolve: (data: any[]) => void) => void) | undefined;
3007
- readonly width?: string | number | undefined;
3008
- readonly height?: string | number | undefined;
3009
3007
  readonly method?: import("axios").Method | undefined;
3008
+ readonly width?: string | number | undefined;
3010
3009
  readonly api?: import("el-plus/es/types/axios").Api | undefined;
3011
3010
  readonly reqData?: Record<string, any> | undefined;
3012
3011
  readonly reqParams?: Record<string, any> | undefined;
@@ -3039,6 +3038,7 @@ export declare const EpSearchListPage: {
3039
3038
  readonly selectable?: ((row: import("element-plus/es/components/table/src/table/defaults.js").DefaultRow, index: number) => boolean) | undefined;
3040
3039
  readonly indexFormatter?: number | ((index: number) => number) | undefined;
3041
3040
  readonly customColumnModule?: string | number | undefined;
3041
+ readonly height?: string | number | undefined;
3042
3042
  readonly maxHeight?: string | number | undefined;
3043
3043
  readonly sumText?: string | undefined;
3044
3044
  readonly currentRowKey?: string | number | undefined;
@@ -5598,9 +5598,8 @@ export declare const EpSearchListPage: {
5598
5598
  readonly preserveExpandedContent: boolean;
5599
5599
  readonly nativeScrollbar: boolean;
5600
5600
  readonly load?: ((row: any, treeNode: import("element-plus").TreeNode, resolve: (data: any[]) => void) => void) | undefined;
5601
- readonly width?: string | number | undefined;
5602
- readonly height?: string | number | undefined;
5603
5601
  readonly method?: import("axios").Method | undefined;
5602
+ readonly width?: string | number | undefined;
5604
5603
  readonly api?: import("el-plus/es/types/axios").Api | undefined;
5605
5604
  readonly reqData?: Record<string, any> | undefined;
5606
5605
  readonly reqParams?: Record<string, any> | undefined;
@@ -5633,6 +5632,7 @@ export declare const EpSearchListPage: {
5633
5632
  readonly selectable?: ((row: import("element-plus/es/components/table/src/table/defaults.js").DefaultRow, index: number) => boolean) | undefined;
5634
5633
  readonly indexFormatter?: number | ((index: number) => number) | undefined;
5635
5634
  readonly customColumnModule?: string | number | undefined;
5635
+ readonly height?: string | number | undefined;
5636
5636
  readonly maxHeight?: string | number | undefined;
5637
5637
  readonly sumText?: string | undefined;
5638
5638
  readonly currentRowKey?: string | number | undefined;
@@ -310,9 +310,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
310
310
  readonly preserveExpandedContent: boolean;
311
311
  readonly nativeScrollbar: boolean;
312
312
  readonly load?: ((row: any, treeNode: import("element-plus").TreeNode, resolve: (data: any[]) => void) => void) | undefined;
313
- readonly width?: string | number | undefined;
314
- readonly height?: string | number | undefined;
315
313
  readonly method?: import("axios").Method | undefined;
314
+ readonly width?: string | number | undefined;
316
315
  readonly api?: import("el-plus/es/types").Api | undefined;
317
316
  readonly reqData?: Record<string, any> | undefined;
318
317
  readonly reqParams?: Record<string, any> | undefined;
@@ -345,6 +344,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
345
344
  readonly selectable?: ((row: import("element-plus/es/components/table/src/table/defaults").DefaultRow, index: number) => boolean) | undefined;
346
345
  readonly indexFormatter?: number | ((index: number) => number) | undefined;
347
346
  readonly customColumnModule?: string | number | undefined;
347
+ readonly height?: string | number | undefined;
348
348
  readonly maxHeight?: string | number | undefined;
349
349
  readonly sumText?: string | undefined;
350
350
  readonly currentRowKey?: string | number | undefined;
@@ -308,9 +308,8 @@ export declare const useSearchListPage: (props: SearchListPageProps, config?: {}
308
308
  readonly preserveExpandedContent: boolean;
309
309
  readonly nativeScrollbar: boolean;
310
310
  readonly load?: ((row: any, treeNode: import("element-plus").TreeNode, resolve: (data: any[]) => void) => void) | undefined;
311
- readonly width?: string | number | undefined;
312
- readonly height?: string | number | undefined;
313
311
  readonly method?: import("axios").Method | undefined;
312
+ readonly width?: string | number | undefined;
314
313
  readonly api?: import("el-plus/es/types").Api | undefined;
315
314
  readonly reqData?: Record<string, any> | undefined;
316
315
  readonly reqParams?: Record<string, any> | undefined;
@@ -343,6 +342,7 @@ export declare const useSearchListPage: (props: SearchListPageProps, config?: {}
343
342
  readonly selectable?: ((row: import("element-plus/es/components/table/src/table/defaults").DefaultRow, index: number) => boolean) | undefined;
344
343
  readonly indexFormatter?: number | ((index: number) => number) | undefined;
345
344
  readonly customColumnModule?: string | number | undefined;
345
+ readonly height?: string | number | undefined;
346
346
  readonly maxHeight?: string | number | undefined;
347
347
  readonly sumText?: string | undefined;
348
348
  readonly currentRowKey?: string | number | undefined;
@@ -1,4 +1,4 @@
1
- var version = "0.0.86";
1
+ var version = "0.0.87-beta.0";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.mjs.map
@@ -1,4 +1,9 @@
1
- import type { RequestPayload } from './types.js';
2
- export declare class BrowserFetcher {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
1
+ import { IFetcher } from './types.js';
2
+ export declare class BrowserFetcher implements IFetcher {
3
+ private browser;
4
+ private initBrowser;
5
+ close(): Promise<void>;
6
+ fetchHtml(url: string, options?: any): Promise<string>;
7
+ fetchJson(url: string, options?: any): Promise<any>;
8
+ fetchText(url: string, options?: any): Promise<string>;
4
9
  }
@@ -1,4 +1,4 @@
1
- import type { RequestPayload } from './types.js';
1
+ import { IFetcher, RequestPayload } from './types.js';
2
2
  export declare class FetcherFactory {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
3
+ static createFetcher(requestPayload: RequestPayload): IFetcher;
4
4
  }
@@ -1,6 +1,5 @@
1
+ export * from './fetcher-factory.js';
2
+ export * from './node-fetcher.js';
3
+ export * from './browser-fetcher.js';
1
4
  export * from './types.js';
2
- export { getRandomUserAgent, getSystemProxy, isAccessDeniedError, isNetworkError, setupProxy, } from './utils.js';
3
- export { BrowserInstance } from './browser-instance.js';
4
- export { NodeFetcher } from './node-fetcher.js';
5
- export { BrowserFetcher } from './browser-fetcher.js';
6
- export { FetcherFactory } from './fetcher-factory.js';
5
+ export * from './utils.js';
@@ -1,4 +1,6 @@
1
- import type { RequestPayload } from './types.js';
2
- export declare class NodeFetcher {
3
- static fetchHtml(payload: RequestPayload): Promise<string>;
1
+ import { IFetcher } from './types.js';
2
+ export declare class NodeFetcher implements IFetcher {
3
+ fetchHtml(url: string, options?: any): Promise<string>;
4
+ fetchJson(url: string, options?: any): Promise<any>;
5
+ fetchText(url: string, options?: any): Promise<string>;
4
6
  }
@@ -1,15 +1,12 @@
1
1
  export interface RequestPayload {
2
- url: string;
3
- headers?: Record<string, string>;
4
- proxy?: string;
5
- timeout?: number;
6
- useSystemProxy?: boolean;
7
2
  useBrowser?: boolean;
8
3
  useNodeFetch?: boolean;
9
4
  autoDetectMode?: boolean;
10
- waitForSelector?: string;
11
- waitForTimeout?: number;
12
- scrollToBottom?: boolean;
13
- closeBrowser?: boolean;
14
5
  debug?: boolean;
6
+ [key: string]: any;
7
+ }
8
+ export interface IFetcher {
9
+ fetchHtml(url: string, options?: any): Promise<string>;
10
+ fetchJson(url: string, options?: any): Promise<any>;
11
+ fetchText(url: string, options?: any): Promise<string>;
15
12
  }
@@ -1,6 +1,2 @@
1
- import type { Agent } from 'http';
2
1
  export declare function getRandomUserAgent(): string;
3
- export declare function getSystemProxy(useSystemProxy?: boolean): string | undefined;
4
- export declare function isAccessDeniedError(errorText: string): boolean;
5
- export declare function isNetworkError(errorText: string): boolean;
6
- export declare function setupProxy(url: string, proxy: string | undefined): Agent | undefined;
2
+ export declare function isAccessDeniedError(content: string): boolean;
@@ -0,0 +1,19 @@
1
+ import type { Browser, Page } from 'puppeteer';
2
+ import type { ParsedPageData } from './types.js';
3
+ import type { IFetcher } from '../fetcher/types.js';
4
+ export declare abstract class BaseParser {
5
+ protected browser: Browser | null;
6
+ protected page: Page | null;
7
+ protected debug: boolean;
8
+ protected fetcher: IFetcher | null;
9
+ constructor(options?: {
10
+ debug?: boolean;
11
+ });
12
+ protected checkAccessDenied(url?: string): Promise<boolean>;
13
+ protected checkPageContentValid(url?: string): Promise<boolean>;
14
+ init(fetcher?: IFetcher): Promise<void>;
15
+ close(): Promise<void>;
16
+ static forceCloseBrowser(): Promise<void>;
17
+ protected delay(ms: number): Promise<void>;
18
+ abstract parse(url: string): Promise<ParsedPageData>;
19
+ }
@@ -0,0 +1,9 @@
1
+ export declare function extractButtons(container: Element): string[];
2
+ export declare function extractTableHeaders(container: Element): string[];
3
+ export declare function extractLabels(container: Element, exclude: Set<string>): string[];
4
+ export declare function extractFormFields(container: Element): Array<{
5
+ label: string;
6
+ fieldType: string;
7
+ required: boolean;
8
+ }>;
9
+ export declare function extractSectionTitle(container: Element): string | undefined;
File without changes
@@ -1,2 +1,4 @@
1
1
  export * from './types.js';
2
+ export { BaseParser } from './base-parser.js';
3
+ export * from './extractors.js';
2
4
  export { ModaoParser, parseModaoPage, parseModaoPageWithFallback, generateBrowserAgentPrompt, } from './modao-parser.js';
@@ -1,20 +1,11 @@
1
1
  import type { ParsedPageData, ParseResult } from './types.js';
2
+ import { BaseParser } from './base-parser.js';
3
+ import type { IFetcher } from '../fetcher/types.js';
2
4
  export * from './types.js';
3
- export declare class ModaoParser {
4
- private browser;
5
- private page;
6
- private proxy?;
7
- constructor(options?: {
8
- proxy?: string;
9
- });
10
- private checkAccessDenied;
11
- private checkPageContentValid;
12
- init(): Promise<void>;
13
- close(): Promise<void>;
5
+ export declare class ModaoParser extends BaseParser {
14
6
  static forceCloseBrowser(): Promise<void>;
15
7
  parse(url: string): Promise<ParsedPageData>;
16
- private delay;
17
8
  }
18
- export declare function parseModaoPage(url: string): Promise<ParsedPageData>;
9
+ export declare function parseModaoPage(url: string, fetcher?: IFetcher): Promise<ParsedPageData>;
19
10
  export declare function parseModaoPageWithFallback(url: string): Promise<ParseResult>;
20
11
  export declare function generateBrowserAgentPrompt(url: string): string;
@@ -123,8 +123,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
123
123
  __epPropKey: true;
124
124
  };
125
125
  }>> & Readonly<{}>, {
126
- readonly type: string;
127
126
  readonly required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
127
+ readonly type: string;
128
128
  readonly isShowLabel: boolean;
129
129
  readonly hideRequiredAsterisk: boolean;
130
130
  readonly labelPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "top" | "right" | "left", unknown>;