@faasjs/ant-design 0.0.2-beta.358 → 0.0.2-beta.362

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.
package/README.md CHANGED
@@ -38,3 +38,506 @@ Form are based on [Ant Design's Form component](https://ant.design/components/fo
38
38
  Form are based on [Ant Design's Form.Item component](https://ant.design/components/form/#Form.Item).
39
39
 
40
40
  <iframe src="https://codesandbox.io/embed/faasjs-ant-design-formitem-olqg5" style="width:100%;height:500px;border:0;overflow:hidden;" title="faasjs-ant-design-formitem" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
41
+
42
+ ## Modules
43
+
44
+ ### Namespaces
45
+
46
+ - [Form](modules/Form.md)
47
+
48
+ ### Type aliases
49
+
50
+ - [BaseItemProps](modules.md#baseitemprops)
51
+ - [BaseOption](modules.md#baseoption)
52
+ - [BlankProps](modules.md#blankprops)
53
+ - [DescriptionItemProps](modules.md#descriptionitemprops)
54
+ - [DescriptionProps](modules.md#descriptionprops)
55
+ - [DrawerProps](modules.md#drawerprops)
56
+ - [ExtendDescriptionItemProps](modules.md#extenddescriptionitemprops)
57
+ - [ExtendDescriptionTypeProps](modules.md#extenddescriptiontypeprops)
58
+ - [ExtendFormItemProps](modules.md#extendformitemprops)
59
+ - [ExtendFormTypeProps](modules.md#extendformtypeprops)
60
+ - [ExtendTableItemProps](modules.md#extendtableitemprops)
61
+ - [ExtendTableTypeProps](modules.md#extendtabletypeprops)
62
+ - [FaasItemProps](modules.md#faasitemprops)
63
+ - [FaasItemType](modules.md#faasitemtype)
64
+ - [FaasItemTypeValue](modules.md#faasitemtypevalue)
65
+ - [FaasState](modules.md#faasstate)
66
+ - [FormItemProps](modules.md#formitemprops)
67
+ - [FormProps](modules.md#formprops)
68
+ - [RoutesProps](modules.md#routesprops)
69
+ - [TableItemProps](modules.md#tableitemprops)
70
+ - [TableProps](modules.md#tableprops)
71
+ - [TitleProps](modules.md#titleprops)
72
+
73
+ ### Functions
74
+
75
+ - [Blank](modules.md#blank)
76
+ - [Config](modules.md#config)
77
+ - [Description](modules.md#description)
78
+ - [Form](modules.md#form)
79
+ - [FormItem](modules.md#formitem)
80
+ - [Routes](modules.md#routes)
81
+ - [Table](modules.md#table)
82
+ - [Title](modules.md#title)
83
+ - [transferOptions](modules.md#transferoptions)
84
+ - [useDrawer](modules.md#usedrawer)
85
+ - [useFaasState](modules.md#usefaasstate)
86
+
87
+ ## Type aliases
88
+
89
+ ### BaseItemProps
90
+
91
+ Ƭ **BaseItemProps**: `Object`
92
+
93
+ #### Type declaration
94
+
95
+ | Name | Type |
96
+ | :------ | :------ |
97
+ | `id` | `string` |
98
+ | `options?` | [`BaseOption`](modules.md#baseoption)[] |
99
+ | `title?` | `string` |
100
+
101
+ ___
102
+
103
+ ### BaseOption
104
+
105
+ Ƭ **BaseOption**: `string` \| `number` \| { `label`: `string` ; `value?`: `string` \| `number` }
106
+
107
+ ___
108
+
109
+ ### BlankProps
110
+
111
+ Ƭ **BlankProps**: `Object`
112
+
113
+ #### Type declaration
114
+
115
+ | Name | Type |
116
+ | :------ | :------ |
117
+ | `text?` | `string` |
118
+ | `value?` | `any` |
119
+
120
+ ___
121
+
122
+ ### DescriptionItemProps
123
+
124
+ Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `render?`: (`value`: `T`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` } & [`FaasItemProps`](modules.md#faasitemprops)
125
+
126
+ #### Type parameters
127
+
128
+ | Name | Type |
129
+ | :------ | :------ |
130
+ | `T` | `any` |
131
+
132
+ ___
133
+
134
+ ### DescriptionProps
135
+
136
+ Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](modules.md#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](modules.md#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
137
+
138
+ #### Type parameters
139
+
140
+ | Name | Type |
141
+ | :------ | :------ |
142
+ | `T` | `any` |
143
+ | `ExtendItemProps` | `any` |
144
+
145
+ ___
146
+
147
+ ### DrawerProps
148
+
149
+ Ƭ **DrawerProps**: `AntdDrawerProps` & { `children?`: `JSX.Element` \| `JSX.Element`[] }
150
+
151
+ ___
152
+
153
+ ### ExtendDescriptionItemProps
154
+
155
+ Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](modules.md#baseitemprops)
156
+
157
+ ___
158
+
159
+ ### ExtendDescriptionTypeProps
160
+
161
+ Ƭ **ExtendDescriptionTypeProps**: `Object`
162
+
163
+ #### Type declaration
164
+
165
+ | Name | Type |
166
+ | :------ | :------ |
167
+ | `children?` | `JSX.Element` \| ``null`` |
168
+ | `render?` | (`value`: `any`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` |
169
+
170
+ ___
171
+
172
+ ### ExtendFormItemProps
173
+
174
+ Ƭ **ExtendFormItemProps**: [`BaseItemProps`](modules.md#baseitemprops) & `AntdFormItemProps`
175
+
176
+ ___
177
+
178
+ ### ExtendFormTypeProps
179
+
180
+ Ƭ **ExtendFormTypeProps**: `Object`
181
+
182
+ #### Type declaration
183
+
184
+ | Name | Type |
185
+ | :------ | :------ |
186
+ | `children?` | `JSX.Element` \| ``null`` |
187
+
188
+ ___
189
+
190
+ ### ExtendTableItemProps
191
+
192
+ Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](modules.md#baseitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
193
+
194
+ #### Type parameters
195
+
196
+ | Name | Type |
197
+ | :------ | :------ |
198
+ | `T` | `any` |
199
+
200
+ ___
201
+
202
+ ### ExtendTableTypeProps
203
+
204
+ Ƭ **ExtendTableTypeProps**: `Object`
205
+
206
+ #### Type declaration
207
+
208
+ | Name | Type |
209
+ | :------ | :------ |
210
+ | `children?` | `JSX.Element` \| ``null`` |
211
+ | `render?` | (`value`: `any`, `values`: `any`, `index`: `number`) => `string` \| `number` \| `boolean` \| `Element` |
212
+
213
+ ___
214
+
215
+ ### FaasItemProps
216
+
217
+ Ƭ **FaasItemProps**: [`BaseItemProps`](modules.md#baseitemprops) & { `type?`: [`FaasItemType`](modules.md#faasitemtype) }
218
+
219
+ ___
220
+
221
+ ### FaasItemType
222
+
223
+ Ƭ **FaasItemType**: ``"string"`` \| ``"string[]"`` \| ``"number"`` \| ``"number[]"`` \| ``"boolean"``
224
+
225
+ ___
226
+
227
+ ### FaasItemTypeValue
228
+
229
+ Ƭ **FaasItemTypeValue**: `Object`
230
+
231
+ #### Type declaration
232
+
233
+ | Name | Type |
234
+ | :------ | :------ |
235
+ | `boolean` | `boolean` |
236
+ | `number` | `number` |
237
+ | `number[]` | `number`[] |
238
+ | `string` | `string` |
239
+ | `string[]` | `string`[] |
240
+
241
+ ___
242
+
243
+ ### FaasState
244
+
245
+ Ƭ **FaasState**: `Object`
246
+
247
+ #### Type declaration
248
+
249
+ | Name | Type |
250
+ | :------ | :------ |
251
+ | `Blank` | `Object` |
252
+ | `Blank.text` | `string` |
253
+ | `Form` | `Object` |
254
+ | `Form.submit` | `Object` |
255
+ | `Form.submit.text` | `string` |
256
+ | `Title` | `Object` |
257
+ | `Title.separator` | `string` |
258
+ | `Title.suffix` | `string` |
259
+ | `common` | `Object` |
260
+ | `common.all` | `string` |
261
+ | `common.blank` | `string` |
262
+ | `common.pageNotFound` | `string` |
263
+ | `common.submit` | `string` |
264
+
265
+ ___
266
+
267
+ ### FormItemProps
268
+
269
+ Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](modules.md#extendformtypeprops); } ; `label?`: `string` \| ``false`` ; `rules?`: `RuleObject`[] ; `render?`: () => `Element` } & `FormItemInputProps`<`T`\> & [`FaasItemProps`](modules.md#faasitemprops) & `AntdFormItemProps`<`T`\>
270
+
271
+ #### Type parameters
272
+
273
+ | Name | Type |
274
+ | :------ | :------ |
275
+ | `T` | `any` |
276
+
277
+ ___
278
+
279
+ ### FormProps
280
+
281
+ Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](modules.md#extendformtypeprops); } ; `items?`: ([`FormItemProps`](modules.md#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
282
+
283
+ #### Type parameters
284
+
285
+ | Name | Type |
286
+ | :------ | :------ |
287
+ | `Values` | `any` |
288
+ | `ExtendItemProps` | `any` |
289
+
290
+ ___
291
+
292
+ ### RoutesProps
293
+
294
+ Ƭ **RoutesProps**: `Object`
295
+
296
+ #### Type declaration
297
+
298
+ | Name | Type |
299
+ | :------ | :------ |
300
+ | `fallback?` | `JSX.Element` |
301
+ | `notFound?` | `JSX.Element` |
302
+ | `routes` | `RouteProps` & { `page?`: `LazyExoticComponent`<`ComponentType`<`any`\>\> }[] |
303
+
304
+ ___
305
+
306
+ ### TableItemProps
307
+
308
+ Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](modules.md#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
309
+
310
+ #### Type parameters
311
+
312
+ | Name | Type |
313
+ | :------ | :------ |
314
+ | `T` | `any` |
315
+
316
+ ___
317
+
318
+ ### TableProps
319
+
320
+ Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { [key: string]: [`ExtendTableTypeProps`](modules.md#extendtabletypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`TableItemProps`](modules.md#tableitemprops) \| `ExtendTypes` & [`ExtendTableItemProps`](modules.md#extendtableitemprops))[] ; `onChange?`: (`pagination`: `TablePaginationConfig`, `filters`: `Record`<`string`, `FilterValue`\>, `sorter`: `SorterResult`<`T`\> \| `SorterResult`<`T`\>[], `extra`: `TableCurrentDataSource`<`T`\>) => { `extra`: `TableCurrentDataSource`<`T`\> ; `filters`: `Record`<`string`, `FilterValue` \| ``null``\> ; `pagination`: `TablePaginationConfig` ; `sorter`: `SorterResult`<`T`\> \| `SorterResult`<`T`\>[] } } & `AntdTableProps`<`T`\>
321
+
322
+ #### Type parameters
323
+
324
+ | Name | Type |
325
+ | :------ | :------ |
326
+ | `T` | `any` |
327
+ | `ExtendTypes` | `any` |
328
+
329
+ ___
330
+
331
+ ### TitleProps
332
+
333
+ Ƭ **TitleProps**: `Object`
334
+
335
+ #### Type declaration
336
+
337
+ | Name | Type | Description |
338
+ | :------ | :------ | :------ |
339
+ | `separator?` | `string` | ` - ` as default |
340
+ | `suffix?` | `string` | - |
341
+ | `title` | `string` \| `string`[] | - |
342
+
343
+ ## Functions
344
+
345
+ ### Blank
346
+
347
+ ▸ **Blank**(`options?`): `any`
348
+
349
+ #### Parameters
350
+
351
+ | Name | Type |
352
+ | :------ | :------ |
353
+ | `options?` | [`BlankProps`](modules.md#blankprops) |
354
+
355
+ #### Returns
356
+
357
+ `any`
358
+
359
+ ___
360
+
361
+ ### Config
362
+
363
+ ▸ **Config**(`props`): `JSX.Element`
364
+
365
+ #### Parameters
366
+
367
+ | Name | Type |
368
+ | :------ | :------ |
369
+ | `props` | `Object` |
370
+ | `props.config` | `Partial`<[`FaasState`](modules.md#faasstate)\> |
371
+
372
+ #### Returns
373
+
374
+ `JSX.Element`
375
+
376
+ ___
377
+
378
+ ### Description
379
+
380
+ ▸ **Description**<`T`\>(`props`): `Element`
381
+
382
+ #### Type parameters
383
+
384
+ | Name | Type |
385
+ | :------ | :------ |
386
+ | `T` | `any` |
387
+
388
+ #### Parameters
389
+
390
+ | Name | Type |
391
+ | :------ | :------ |
392
+ | `props` | [`DescriptionProps`](modules.md#descriptionprops)<`T`, `any`\> |
393
+
394
+ #### Returns
395
+
396
+ `Element`
397
+
398
+ ___
399
+
400
+ ### Form
401
+
402
+ ▸ **Form**<`Values`\>(`props`): `Element`
403
+
404
+ #### Type parameters
405
+
406
+ | Name | Type |
407
+ | :------ | :------ |
408
+ | `Values` | `any` |
409
+
410
+ #### Parameters
411
+
412
+ | Name | Type |
413
+ | :------ | :------ |
414
+ | `props` | [`FormProps`](modules.md#formprops)<`Values`, `any`\> |
415
+
416
+ #### Returns
417
+
418
+ `Element`
419
+
420
+ ___
421
+
422
+ ### FormItem
423
+
424
+ ▸ **FormItem**<`T`\>(`props`): `Element`
425
+
426
+ #### Type parameters
427
+
428
+ | Name | Type |
429
+ | :------ | :------ |
430
+ | `T` | `any` |
431
+
432
+ #### Parameters
433
+
434
+ | Name | Type |
435
+ | :------ | :------ |
436
+ | `props` | [`FormItemProps`](modules.md#formitemprops)<`T`\> |
437
+
438
+ #### Returns
439
+
440
+ `Element`
441
+
442
+ ___
443
+
444
+ ### Routes
445
+
446
+ ▸ **Routes**(`props`): `Element`
447
+
448
+ #### Parameters
449
+
450
+ | Name | Type |
451
+ | :------ | :------ |
452
+ | `props` | [`RoutesProps`](modules.md#routesprops) |
453
+
454
+ #### Returns
455
+
456
+ `Element`
457
+
458
+ ___
459
+
460
+ ### Table
461
+
462
+ ▸ **Table**<`T`, `ExtendTypes`\>(`props`): `Element`
463
+
464
+ #### Type parameters
465
+
466
+ | Name | Type |
467
+ | :------ | :------ |
468
+ | `T` | `any` |
469
+ | `ExtendTypes` | `any` |
470
+
471
+ #### Parameters
472
+
473
+ | Name | Type |
474
+ | :------ | :------ |
475
+ | `props` | [`TableProps`](modules.md#tableprops)<`T`, `ExtendTypes`\> |
476
+
477
+ #### Returns
478
+
479
+ `Element`
480
+
481
+ ___
482
+
483
+ ### Title
484
+
485
+ ▸ **Title**(`props`): `JSX.Element`
486
+
487
+ #### Parameters
488
+
489
+ | Name | Type |
490
+ | :------ | :------ |
491
+ | `props` | [`TitleProps`](modules.md#titleprops) |
492
+
493
+ #### Returns
494
+
495
+ `JSX.Element`
496
+
497
+ ___
498
+
499
+ ### transferOptions
500
+
501
+ ▸ **transferOptions**(`options`): { `label`: `string` ; `value?`: `string` \| `number` }[]
502
+
503
+ #### Parameters
504
+
505
+ | Name | Type |
506
+ | :------ | :------ |
507
+ | `options` | [`BaseOption`](modules.md#baseoption)[] |
508
+
509
+ #### Returns
510
+
511
+ { `label`: `string` ; `value?`: `string` \| `number` }[]
512
+
513
+ ___
514
+
515
+ ### useDrawer
516
+
517
+ ▸ **useDrawer**(`init?`): `Object`
518
+
519
+ #### Parameters
520
+
521
+ | Name | Type |
522
+ | :------ | :------ |
523
+ | `init?` | [`DrawerProps`](modules.md#drawerprops) |
524
+
525
+ #### Returns
526
+
527
+ `Object`
528
+
529
+ | Name | Type |
530
+ | :------ | :------ |
531
+ | `drawer` | `Element` |
532
+ | `drawerProps` | [`DrawerProps`](modules.md#drawerprops) |
533
+ | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](modules.md#drawerprops)\>) => `void` |
534
+
535
+ ___
536
+
537
+ ### useFaasState
538
+
539
+ ▸ `Const` **useFaasState**(): [[`FaasState`](modules.md#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](modules.md#faasstate)\>) => `void`]
540
+
541
+ #### Returns
542
+
543
+ [[`FaasState`](modules.md#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](modules.md#faasstate)\>) => `void`]
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import * as react_use_lib_misc_hookState from 'react-use/lib/misc/hookState';
2
- import { DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, FormProps as FormProps$1, TableColumnProps, TableProps as TableProps$1 } from 'antd';
2
+ import { DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, FormProps as FormProps$1, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1 } from 'antd';
3
3
  export { Drawer } from 'antd';
4
4
  import { FaasDataWrapperProps } from '@faasjs/react';
5
5
  import * as antd_lib_form_Form from 'antd/lib/form/Form';
6
6
  import { RuleObject } from 'rc-field-form/lib/interface';
7
7
  import { LazyExoticComponent, ComponentType } from 'react';
8
8
  import { RouteProps } from 'react-router-dom';
9
+ import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/lib/table/interface';
9
10
 
10
11
  declare type BlankProps = {
11
12
  value?: any;
@@ -118,7 +119,7 @@ declare type BooleanProps = {
118
119
  input?: SwitchProps;
119
120
  };
120
121
  declare type OptionsProps = {
121
- options: BaseOption[];
122
+ options?: BaseOption[];
122
123
  type?: 'string' | 'string[]' | 'number' | 'number[]';
123
124
  input?: SelectProps<any>;
124
125
  };
@@ -179,6 +180,12 @@ declare type TableProps<T = any, ExtendTypes = any> = {
179
180
  [key: string]: ExtendTableTypeProps;
180
181
  };
181
182
  faasData?: FaasDataWrapperProps<T>;
183
+ onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<T> | SorterResult<T>[], extra: TableCurrentDataSource<T>) => {
184
+ pagination: TablePaginationConfig;
185
+ filters: Record<string, FilterValue | null>;
186
+ sorter: SorterResult<T> | SorterResult<T>[];
187
+ extra: TableCurrentDataSource<T>;
188
+ };
182
189
  } & TableProps$1<T>;
183
190
  declare function Table<T = any, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): JSX.Element;
184
191
 
package/dist/index.js CHANGED
@@ -200,6 +200,9 @@ function Description(props) {
200
200
  extendTypes: props.extendTypes
201
201
  }))));
202
202
  return /* @__PURE__ */ import_react.default.createElement(import_react4.FaasDataWrapper, __spreadValues({
203
+ fallback: props.faasData.fallback || /* @__PURE__ */ import_react.default.createElement(import_antd2.Skeleton, {
204
+ active: true
205
+ }),
203
206
  render: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_antd2.Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ import_react.default.createElement(import_antd2.Descriptions.Item, {
204
207
  key: item.id,
205
208
  label: item.title || (0, import_lodash3.upperFirst)(item.id)
@@ -431,10 +434,11 @@ function Routes(props) {
431
434
  key: r.path
432
435
  }, r), {
433
436
  element: r.element || /* @__PURE__ */ import_react.default.createElement(import_react8.Suspense, {
434
- fallback: props.fallback || /* @__PURE__ */ import_react.default.createElement(import_antd6.Skeleton, {
435
- active: true,
437
+ fallback: props.fallback || /* @__PURE__ */ import_react.default.createElement("div", {
436
438
  style: { padding: "24px" }
437
- })
439
+ }, /* @__PURE__ */ import_react.default.createElement(import_antd6.Skeleton, {
440
+ active: true
441
+ }))
438
442
  }, /* @__PURE__ */ import_react.default.createElement(r.page, null))
439
443
  }))), /* @__PURE__ */ import_react.default.createElement(import_react_router_dom.Route, {
440
444
  key: "*",
@@ -591,6 +595,9 @@ function Table(props) {
591
595
  dataSource: props.dataSource
592
596
  }));
593
597
  return /* @__PURE__ */ import_react.default.createElement(import_react10.FaasDataWrapper, __spreadValues({
598
+ fallback: props.faasData.fallback || /* @__PURE__ */ import_react.default.createElement(import_antd7.Skeleton, {
599
+ active: true
600
+ }),
594
601
  render: ({
595
602
  data,
596
603
  params,
@@ -613,7 +620,16 @@ function Table(props) {
613
620
  columns,
614
621
  dataSource: data.rows,
615
622
  pagination: __spreadValues(__spreadValues({}, props.pagination), data.pagination),
616
- onChange: (pagination, filters, sorter) => {
623
+ onChange: (pagination, filters, sorter, extra) => {
624
+ if (props.onChange) {
625
+ const processed = props.onChange(pagination, filters, sorter, extra);
626
+ reload(__spreadProps(__spreadValues({}, params), {
627
+ pagination: processed.pagination,
628
+ filters: processed.filters,
629
+ sorter: processed.sorter
630
+ }));
631
+ return;
632
+ }
617
633
  reload(__spreadProps(__spreadValues({}, params), {
618
634
  pagination,
619
635
  filters,
package/dist/index.mjs CHANGED
@@ -78,7 +78,10 @@ function transferOptions(options) {
78
78
 
79
79
  // src/Description.tsx
80
80
  import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
81
- import { Descriptions } from "antd";
81
+ import {
82
+ Descriptions,
83
+ Skeleton
84
+ } from "antd";
82
85
  import { upperFirst as upperFirst2 } from "lodash";
83
86
  import {
84
87
  cloneElement,
@@ -162,6 +165,9 @@ function Description(props) {
162
165
  extendTypes: props.extendTypes
163
166
  }))));
164
167
  return /* @__PURE__ */ React.createElement(FaasDataWrapper, __spreadValues({
168
+ fallback: props.faasData.fallback || /* @__PURE__ */ React.createElement(Skeleton, {
169
+ active: true
170
+ }),
165
171
  render: ({ data }) => /* @__PURE__ */ React.createElement(Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ React.createElement(Descriptions.Item, {
166
172
  key: item.id,
167
173
  label: item.title || upperFirst2(item.id)
@@ -390,7 +396,7 @@ Form.useForm = AntdForm2.useForm;
390
396
  Form.Item = FormItem;
391
397
 
392
398
  // src/Routers.tsx
393
- import { Result, Skeleton } from "antd";
399
+ import { Result, Skeleton as Skeleton2 } from "antd";
394
400
  import {
395
401
  Suspense
396
402
  } from "react";
@@ -410,10 +416,11 @@ function Routes(props) {
410
416
  key: r.path
411
417
  }, r), {
412
418
  element: r.element || /* @__PURE__ */ React.createElement(Suspense, {
413
- fallback: props.fallback || /* @__PURE__ */ React.createElement(Skeleton, {
414
- active: true,
419
+ fallback: props.fallback || /* @__PURE__ */ React.createElement("div", {
415
420
  style: { padding: "24px" }
416
- })
421
+ }, /* @__PURE__ */ React.createElement(Skeleton2, {
422
+ active: true
423
+ }))
417
424
  }, /* @__PURE__ */ React.createElement(r.page, null))
418
425
  }))), /* @__PURE__ */ React.createElement(Route, {
419
426
  key: "*",
@@ -430,7 +437,8 @@ import {
430
437
  } from "react";
431
438
  import {
432
439
  Table as AntdTable,
433
- Radio
440
+ Radio,
441
+ Skeleton as Skeleton3
434
442
  } from "antd";
435
443
  import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
436
444
  import { isNil as isNil2, upperFirst as upperFirst4 } from "lodash";
@@ -577,6 +585,9 @@ function Table(props) {
577
585
  dataSource: props.dataSource
578
586
  }));
579
587
  return /* @__PURE__ */ React.createElement(FaasDataWrapper2, __spreadValues({
588
+ fallback: props.faasData.fallback || /* @__PURE__ */ React.createElement(Skeleton3, {
589
+ active: true
590
+ }),
580
591
  render: ({
581
592
  data,
582
593
  params,
@@ -599,7 +610,16 @@ function Table(props) {
599
610
  columns,
600
611
  dataSource: data.rows,
601
612
  pagination: __spreadValues(__spreadValues({}, props.pagination), data.pagination),
602
- onChange: (pagination, filters, sorter) => {
613
+ onChange: (pagination, filters, sorter, extra) => {
614
+ if (props.onChange) {
615
+ const processed = props.onChange(pagination, filters, sorter, extra);
616
+ reload(__spreadProps(__spreadValues({}, params), {
617
+ pagination: processed.pagination,
618
+ filters: processed.filters,
619
+ sorter: processed.sorter
620
+ }));
621
+ return;
622
+ }
603
623
  reload(__spreadProps(__spreadValues({}, params), {
604
624
  pagination,
605
625
  filters,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.358",
3
+ "version": "0.0.2-beta.362",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "lodash": "*",
29
29
  "react": "*",
30
30
  "react-dom": "*",
31
- "@faasjs/react": "^0.0.2-beta.358",
31
+ "@faasjs/react": "^0.0.2-beta.362",
32
32
  "react-use": "*",
33
33
  "react-router-dom": "*"
34
34
  },