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

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
@@ -47,42 +47,42 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
47
47
 
48
48
  ### Type aliases
49
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)
50
+ - [BaseItemProps](#baseitemprops)
51
+ - [BaseOption](#baseoption)
52
+ - [BlankProps](#blankprops)
53
+ - [DescriptionItemProps](#descriptionitemprops)
54
+ - [DescriptionProps](#descriptionprops)
55
+ - [DrawerProps](#drawerprops)
56
+ - [ExtendDescriptionItemProps](#extenddescriptionitemprops)
57
+ - [ExtendDescriptionTypeProps](#extenddescriptiontypeprops)
58
+ - [ExtendFormItemProps](#extendformitemprops)
59
+ - [ExtendFormTypeProps](#extendformtypeprops)
60
+ - [ExtendTableItemProps](#extendtableitemprops)
61
+ - [ExtendTableTypeProps](#extendtabletypeprops)
62
+ - [FaasItemProps](#faasitemprops)
63
+ - [FaasItemType](#faasitemtype)
64
+ - [FaasItemTypeValue](#faasitemtypevalue)
65
+ - [FaasState](#faasstate)
66
+ - [FormItemProps](#formitemprops)
67
+ - [FormProps](#formprops)
68
+ - [RoutesProps](#routesprops)
69
+ - [TableItemProps](#tableitemprops)
70
+ - [TableProps](#tableprops)
71
+ - [TitleProps](#titleprops)
72
72
 
73
73
  ### Functions
74
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)
75
+ - [Blank](#blank)
76
+ - [Config](#config)
77
+ - [Description](#description)
78
+ - [Form](#form)
79
+ - [FormItem](#formitem)
80
+ - [Routes](#routes)
81
+ - [Table](#table)
82
+ - [Title](#title)
83
+ - [transferOptions](#transferoptions)
84
+ - [useDrawer](#usedrawer)
85
+ - [useFaasState](#usefaasstate)
86
86
 
87
87
  ## Type aliases
88
88
 
@@ -95,7 +95,7 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
95
95
  | Name | Type |
96
96
  | :------ | :------ |
97
97
  | `id` | `string` |
98
- | `options?` | [`BaseOption`](modules.md#baseoption)[] |
98
+ | `options?` | [`BaseOption`](#baseoption)[] |
99
99
  | `title?` | `string` |
100
100
 
101
101
  ___
@@ -121,7 +121,7 @@ ___
121
121
 
122
122
  ### DescriptionItemProps
123
123
 
124
- Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `render?`: (`value`: `T`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` } & [`FaasItemProps`](modules.md#faasitemprops)
124
+ Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `render?`: (`value`: `T`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` } & [`FaasItemProps`](#faasitemprops)
125
125
 
126
126
  #### Type parameters
127
127
 
@@ -133,7 +133,7 @@ ___
133
133
 
134
134
  ### DescriptionProps
135
135
 
136
- Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](modules.md#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](modules.md#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
136
+ Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
137
137
 
138
138
  #### Type parameters
139
139
 
@@ -152,7 +152,7 @@ ___
152
152
 
153
153
  ### ExtendDescriptionItemProps
154
154
 
155
- Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](modules.md#baseitemprops)
155
+ Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](#baseitemprops)
156
156
 
157
157
  ___
158
158
 
@@ -171,7 +171,7 @@ ___
171
171
 
172
172
  ### ExtendFormItemProps
173
173
 
174
- Ƭ **ExtendFormItemProps**: [`BaseItemProps`](modules.md#baseitemprops) & `AntdFormItemProps`
174
+ Ƭ **ExtendFormItemProps**: [`BaseItemProps`](#baseitemprops) & `AntdFormItemProps`
175
175
 
176
176
  ___
177
177
 
@@ -189,7 +189,7 @@ ___
189
189
 
190
190
  ### ExtendTableItemProps
191
191
 
192
- Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](modules.md#baseitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
192
+ Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](#baseitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
193
193
 
194
194
  #### Type parameters
195
195
 
@@ -214,7 +214,7 @@ ___
214
214
 
215
215
  ### FaasItemProps
216
216
 
217
- Ƭ **FaasItemProps**: [`BaseItemProps`](modules.md#baseitemprops) & { `type?`: [`FaasItemType`](modules.md#faasitemtype) }
217
+ Ƭ **FaasItemProps**: [`BaseItemProps`](#baseitemprops) & { `type?`: [`FaasItemType`](#faasitemtype) }
218
218
 
219
219
  ___
220
220
 
@@ -266,7 +266,7 @@ ___
266
266
 
267
267
  ### FormItemProps
268
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`\>
269
+ Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `label?`: `string` \| ``false`` ; `rules?`: `RuleObject`[] ; `render?`: () => `Element` } & `FormItemInputProps`<`T`\> & [`FaasItemProps`](#faasitemprops) & `AntdFormItemProps`<`T`\>
270
270
 
271
271
  #### Type parameters
272
272
 
@@ -278,7 +278,7 @@ ___
278
278
 
279
279
  ### FormProps
280
280
 
281
- Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](modules.md#extendformtypeprops); } ; `items?`: ([`FormItemProps`](modules.md#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
281
+ Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `items?`: ([`FormItemProps`](#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
282
282
 
283
283
  #### Type parameters
284
284
 
@@ -305,7 +305,7 @@ ___
305
305
 
306
306
  ### TableItemProps
307
307
 
308
- Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](modules.md#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
308
+ Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
309
309
 
310
310
  #### Type parameters
311
311
 
@@ -317,7 +317,7 @@ ___
317
317
 
318
318
  ### TableProps
319
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`\>
320
+ Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { [key: string]: [`ExtendTableTypeProps`](#extendtabletypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`TableItemProps`](#tableitemprops) \| `ExtendTypes` & [`ExtendTableItemProps`](#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
321
 
322
322
  #### Type parameters
323
323
 
@@ -346,33 +346,49 @@ ___
346
346
 
347
347
  ▸ **Blank**(`options?`): `any`
348
348
 
349
+ If value is undefined or null, return text, otherwise return value.
350
+
349
351
  #### Parameters
350
352
 
351
353
  | Name | Type |
352
354
  | :------ | :------ |
353
- | `options?` | [`BlankProps`](modules.md#blankprops) |
355
+ | `options?` | [`BlankProps`](#blankprops) |
354
356
 
355
357
  #### Returns
356
358
 
357
359
  `any`
358
360
 
361
+ ```ts
362
+ <Blank value={undefined} text="Empty" />
363
+ ```
364
+
359
365
  ___
360
366
 
361
367
  ### Config
362
368
 
363
369
  ▸ **Config**(`props`): `JSX.Element`
364
370
 
371
+ Config for all @faasjs/ant-design components.
372
+
365
373
  #### Parameters
366
374
 
367
375
  | Name | Type |
368
376
  | :------ | :------ |
369
377
  | `props` | `Object` |
370
- | `props.config` | `Partial`<[`FaasState`](modules.md#faasstate)\> |
378
+ | `props.config` | `Partial`<[`FaasState`](#faasstate)\> |
371
379
 
372
380
  #### Returns
373
381
 
374
382
  `JSX.Element`
375
383
 
384
+ ```ts
385
+ <Config config={{
386
+ common: {
387
+ blank: '空',
388
+ },
389
+ }} />
390
+ ```
391
+
376
392
  ___
377
393
 
378
394
  ### Description
@@ -389,7 +405,7 @@ ___
389
405
 
390
406
  | Name | Type |
391
407
  | :------ | :------ |
392
- | `props` | [`DescriptionProps`](modules.md#descriptionprops)<`T`, `any`\> |
408
+ | `props` | [`DescriptionProps`](#descriptionprops)<`T`, `any`\> |
393
409
 
394
410
  #### Returns
395
411
 
@@ -411,7 +427,7 @@ ___
411
427
 
412
428
  | Name | Type |
413
429
  | :------ | :------ |
414
- | `props` | [`FormProps`](modules.md#formprops)<`Values`, `any`\> |
430
+ | `props` | [`FormProps`](#formprops)<`Values`, `any`\> |
415
431
 
416
432
  #### Returns
417
433
 
@@ -433,7 +449,7 @@ ___
433
449
 
434
450
  | Name | Type |
435
451
  | :------ | :------ |
436
- | `props` | [`FormItemProps`](modules.md#formitemprops)<`T`\> |
452
+ | `props` | [`FormItemProps`](#formitemprops)<`T`\> |
437
453
 
438
454
  #### Returns
439
455
 
@@ -449,7 +465,7 @@ ___
449
465
 
450
466
  | Name | Type |
451
467
  | :------ | :------ |
452
- | `props` | [`RoutesProps`](modules.md#routesprops) |
468
+ | `props` | [`RoutesProps`](#routesprops) |
453
469
 
454
470
  #### Returns
455
471
 
@@ -472,7 +488,7 @@ ___
472
488
 
473
489
  | Name | Type |
474
490
  | :------ | :------ |
475
- | `props` | [`TableProps`](modules.md#tableprops)<`T`, `ExtendTypes`\> |
491
+ | `props` | [`TableProps`](#tableprops)<`T`, `ExtendTypes`\> |
476
492
 
477
493
  #### Returns
478
494
 
@@ -488,7 +504,7 @@ ___
488
504
 
489
505
  | Name | Type |
490
506
  | :------ | :------ |
491
- | `props` | [`TitleProps`](modules.md#titleprops) |
507
+ | `props` | [`TitleProps`](#titleprops) |
492
508
 
493
509
  #### Returns
494
510
 
@@ -504,7 +520,7 @@ ___
504
520
 
505
521
  | Name | Type |
506
522
  | :------ | :------ |
507
- | `options` | [`BaseOption`](modules.md#baseoption)[] |
523
+ | `options` | [`BaseOption`](#baseoption)[] |
508
524
 
509
525
  #### Returns
510
526
 
@@ -520,7 +536,7 @@ ___
520
536
 
521
537
  | Name | Type |
522
538
  | :------ | :------ |
523
- | `init?` | [`DrawerProps`](modules.md#drawerprops) |
539
+ | `init?` | [`DrawerProps`](#drawerprops) |
524
540
 
525
541
  #### Returns
526
542
 
@@ -529,15 +545,15 @@ ___
529
545
  | Name | Type |
530
546
  | :------ | :------ |
531
547
  | `drawer` | `Element` |
532
- | `drawerProps` | [`DrawerProps`](modules.md#drawerprops) |
533
- | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](modules.md#drawerprops)\>) => `void` |
548
+ | `drawerProps` | [`DrawerProps`](#drawerprops) |
549
+ | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](#drawerprops)\>) => `void` |
534
550
 
535
551
  ___
536
552
 
537
553
  ### useFaasState
538
554
 
539
- ▸ `Const` **useFaasState**(): [[`FaasState`](modules.md#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](modules.md#faasstate)\>) => `void`]
555
+ ▸ `Const` **useFaasState**(): [[`FaasState`](#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](#faasstate)\>) => `void`]
540
556
 
541
557
  #### Returns
542
558
 
543
- [[`FaasState`](modules.md#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](modules.md#faasstate)\>) => `void`]
559
+ [[`FaasState`](#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](#faasstate)\>) => `void`]
package/dist/index.d.ts CHANGED
@@ -12,6 +12,18 @@ declare type BlankProps = {
12
12
  value?: any;
13
13
  text?: string;
14
14
  };
15
+ /**
16
+ * If value is undefined or null, return text, otherwise return value.
17
+ *
18
+ * @param options {object}
19
+ * @param options.value {any}
20
+ * @param options.text {string} Default is 'Empty'
21
+ * @returns {JSX.Element}
22
+ *
23
+ * ```ts
24
+ * <Blank value={undefined} text="Empty" />
25
+ * ```
26
+ */
15
27
  declare function Blank(options?: BlankProps): any;
16
28
 
17
29
  declare type FaasState = {
@@ -35,6 +47,20 @@ declare type FaasState = {
35
47
  };
36
48
  };
37
49
  declare const useFaasState: () => [FaasState, (state: react_use_lib_misc_hookState.IHookStateSetAction<FaasState>) => void];
50
+ /**
51
+ * Config for all @faasjs/ant-design components.
52
+ * @param props {object}
53
+ * @param props.config {Partial<FaasState>}
54
+ * @returns {null}
55
+ *
56
+ * ```ts
57
+ * <Config config={{
58
+ * common: {
59
+ * blank: '空',
60
+ * },
61
+ * }} />
62
+ * ```
63
+ */
38
64
  declare function Config(props: {
39
65
  config: Partial<FaasState>;
40
66
  }): JSX.Element;
package/dist/index.js CHANGED
@@ -309,7 +309,8 @@ function FormItem(props) {
309
309
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
310
310
  key: field.key
311
311
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
312
- gutter: 24
312
+ gutter: 24,
313
+ style: { flexFlow: "row nowrap" }
313
314
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
314
315
  span: 23
315
316
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, __spreadProps(__spreadValues({}, field), {
@@ -351,7 +352,8 @@ function FormItem(props) {
351
352
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
352
353
  key: field.key
353
354
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
354
- gutter: 24
355
+ gutter: 24,
356
+ style: { flexFlow: "row nowrap" }
355
357
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
356
358
  span: 23
357
359
  }, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, __spreadProps(__spreadValues({}, field), {
package/dist/index.mjs CHANGED
@@ -286,7 +286,8 @@ function FormItem(props) {
286
286
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ React.createElement(AntdForm.Item, {
287
287
  key: field.key
288
288
  }, /* @__PURE__ */ React.createElement(Row, {
289
- gutter: 24
289
+ gutter: 24,
290
+ style: { flexFlow: "row nowrap" }
290
291
  }, /* @__PURE__ */ React.createElement(Col, {
291
292
  span: 23
292
293
  }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
@@ -328,7 +329,8 @@ function FormItem(props) {
328
329
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ React.createElement(AntdForm.Item, {
329
330
  key: field.key
330
331
  }, /* @__PURE__ */ React.createElement(Row, {
331
- gutter: 24
332
+ gutter: 24,
333
+ style: { flexFlow: "row nowrap" }
332
334
  }, /* @__PURE__ */ React.createElement(Col, {
333
335
  span: 23
334
336
  }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.362",
3
+ "version": "0.0.2-beta.363",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
- "homepage": "https://faasjs.com/doc/ant-design.html",
8
+ "homepage": "https://faasjs.com/doc/ant-design",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/faasjs/faasjs.git",
@@ -28,7 +28,7 @@
28
28
  "lodash": "*",
29
29
  "react": "*",
30
30
  "react-dom": "*",
31
- "@faasjs/react": "^0.0.2-beta.362",
31
+ "@faasjs/react": "^0.0.2-beta.363",
32
32
  "react-use": "*",
33
33
  "react-router-dom": "*"
34
34
  },