@para-ui/core 3.0.7 → 3.0.9

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,5 +1,17 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { EmptyProps } from "../Empty";
3
+ import { ReqFuncProps } from "./util";
4
+ /** 搜索方法 */
5
+ export interface SearchFuncProps {
6
+ page?: number;
7
+ size?: number;
8
+ [name: string]: any;
9
+ }
10
+ /** 搜索接口返回数据 */
11
+ export interface SearchReqDataProps {
12
+ data?: any;
13
+ err?: any;
14
+ }
3
15
  /** 面包屑 */
4
16
  export interface BreadcrumbsListItem {
5
17
  /** 每一项显示名 */
@@ -39,6 +51,8 @@ export interface SelectorAnyJson {
39
51
  children?: SelectorAnyJson[];
40
52
  /** 禁用 */
41
53
  disabled?: boolean;
54
+ /** 禁用下级 */
55
+ disabledChild?: boolean;
42
56
  /** 是否可选 */
43
57
  choice?: boolean;
44
58
  /** 是否具有详情 */
@@ -88,6 +102,17 @@ export interface SelectorConstData {
88
102
  searchVal: string;
89
103
  /** 搜索点了下级,记录搜索前的面包屑 null说明没有储存过 */
90
104
  beforeSearchBreadcrumbs: BreadcrumbsListItem[] | null;
105
+ /** 搜索配置 */
106
+ searchConfig: {
107
+ /** 页码 */
108
+ page: number;
109
+ /** 每页条数 */
110
+ size: number;
111
+ /** 请求id */
112
+ reqId: string;
113
+ /** 当前页数据源 */
114
+ currentSourceData: SelectorAnyJson[];
115
+ };
91
116
  [name: string]: any;
92
117
  }
93
118
  /** 字段配置,对应数据字段 */
@@ -139,6 +164,8 @@ export interface SelectorNodeProps {
139
164
  close?: boolean;
140
165
  /** 禁用 */
141
166
  disabled?: boolean;
167
+ /** 禁用下级 */
168
+ disabledChild?: boolean;
142
169
  /** 选中 */
143
170
  checked?: boolean;
144
171
  /** 半选 */
@@ -207,12 +234,16 @@ export interface SelectorMainProps {
207
234
  detailRender?: (item: SelectorAnyJson, bol: boolean) => ReactNode;
208
235
  /** 加载更多 */
209
236
  loadMore?: boolean;
237
+ /** 搜索模块加载更多 */
238
+ searchLoadMore?: boolean;
210
239
  /** 是否全选 */
211
240
  isAllCheck?: boolean;
212
241
  /** 渲染数据 */
213
242
  list?: SelectorAnyJson[];
214
243
  /** 禁用 */
215
244
  disabled?: string[] | boolean;
245
+ /** 禁用下级 */
246
+ disabledChild?: string[] | boolean;
216
247
  /** 字段配置,对应数据字段 */
217
248
  fieldConfig?: SelectorFieldConfigProps;
218
249
  /** 选择事件 */
@@ -220,7 +251,7 @@ export interface SelectorMainProps {
220
251
  /** 点击下级 */
221
252
  onLevel?: (item: SelectorAnyJson, isSearch?: boolean) => void;
222
253
  /** 查看更多 */
223
- onLoad?: () => void;
254
+ onLoad?: (isSearch?: boolean) => void;
224
255
  /** 点击全选 */
225
256
  onAllCheck?: (bol?: boolean) => void;
226
257
  /** 点击面包屑 */
@@ -297,7 +328,7 @@ export interface SelectorProps {
297
328
  pagination?: boolean;
298
329
  /** 一页条数 */
299
330
  size?: number;
300
- /** 是否懒加载 true为全量数据 */
331
+ /** 是否懒加载 false为全量数据 */
301
332
  isLazy?: boolean;
302
333
  /** 请求参数 */
303
334
  params?: Record<string, any>;
@@ -331,6 +362,8 @@ export interface SelectorProps {
331
362
  isAllCheck?: boolean;
332
363
  /** 禁用 */
333
364
  disabled?: string[] | boolean;
365
+ /** 禁用下级 */
366
+ disabledChild?: string[] | boolean;
334
367
  /** 字段配置,对应数据字段 */
335
368
  fieldConfig?: SelectorFieldConfigProps;
336
369
  /** 返回数据字段配置,对应数据字段 */
@@ -340,9 +373,9 @@ export interface SelectorProps {
340
373
  /** 处理选中数据的节点信息 */
341
374
  handSelectorNodeInfo?: (item: SelectorAnyJson) => SelectorAnyJson;
342
375
  /** 处理请求参数 */
343
- paramsCallback?: (data: any) => Record<string, any>;
376
+ paramsCallback?: (data: ReqFuncProps, isSearch?: boolean) => ReqFuncProps;
344
377
  /** 请求回调参数 requestCallback(data, cb) cb(data) 需要回调数据回来 */
345
- requestCallback?: (data: any, cb: (data: any) => void) => void;
378
+ requestCallback?: (data: any, cb: (data: any) => void, isSearch?: boolean) => void;
346
379
  /** 选中数据标题render */
347
380
  selectDataTitleRender?: (list?: SelectorAnyJson[]) => ReactNode;
348
381
  /** 空状态属性 */
@@ -352,7 +385,7 @@ export interface SelectorProps {
352
385
  * @param val 搜索框的值
353
386
  * @return [] 返回平铺数组
354
387
  * */
355
- onSearch?: (val: string) => (Promise<SelectorAnyJson[]> | SelectorAnyJson[]);
388
+ onSearch?: (val: string, reqParams: SearchFuncProps) => (Promise<SearchReqDataProps> | SearchReqDataProps);
356
389
  /** 选择事件 返回true不触发onChange事件
357
390
  * item 点击数据, 全选时候的数据
358
391
  * bol 选中/不选中
@@ -5,5 +5,7 @@ declare const _default: {
5
5
  selected: string;
6
6
  pleaseEnter: string;
7
7
  searchResult: string;
8
+ detail: string;
9
+ child: string;
8
10
  };
9
11
  export default _default;
@@ -5,5 +5,7 @@ declare const _default: {
5
5
  selected: string;
6
6
  pleaseEnter: string;
7
7
  searchResult: string;
8
+ detail: string;
9
+ child: string;
8
10
  };
9
11
  export default _default;
@@ -26,6 +26,8 @@ import '../Checkbox/index.js';
26
26
  import '../Popover/index.js';
27
27
  import '../Loading/index.js';
28
28
  import '@para-ui/icons/LoadingF';
29
+ import '../_verture/useFormatMessage-f4452258.js';
30
+ import '@para-ui/core/GlobalContext';
29
31
  import '../Search/index.js';
30
32
  import '../TextField/index.js';
31
33
  import '../_verture/typeof-498dd2b1.js';
@@ -34,10 +36,8 @@ import '@para-ui/icons/PreviewClose';
34
36
  import '@para-ui/icons/PreviewOpen';
35
37
  import '../AutoTips/index.js';
36
38
  import '../_verture/useGlobalProps-af9a2af6.js';
37
- import '@para-ui/core/GlobalContext';
38
39
  import '../Button/index.js';
39
40
  import '@para-ui/icons/Forbid';
40
- import '../_verture/useFormatMessage-f4452258.js';
41
41
  import '@para-ui/icons/Search';
42
42
  import '../Breadcrumbs/index.js';
43
43
  import '@para-ui/icons/More';