@faasjs/ant-design 0.0.2-beta.373 → 0.0.2-beta.374

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
@@ -158,7 +158,7 @@ ___
158
158
 
159
159
  ### DescriptionProps
160
160
 
161
- Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
161
+ Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { `[key: string]`: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
162
162
 
163
163
  #### Type parameters
164
164
 
@@ -293,7 +293,7 @@ ___
293
293
 
294
294
  ### FormItemProps
295
295
 
296
- Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `label?`: `string` \| ``false`` ; `rules?`: `RuleObject`[] ; `render?`: () => `Element` } & `FormItemInputProps`<`T`\> & [`FaasItemProps`](#faasitemprops) & `AntdFormItemProps`<`T`\>
296
+ Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { `[type: string]`: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `label?`: `string` \| ``false`` ; `rules?`: `RuleObject`[] ; `render?`: () => `Element` } & `FormItemInputProps`<`T`\> & [`FaasItemProps`](#faasitemprops) & `AntdFormItemProps`<`T`\>
297
297
 
298
298
  #### Type parameters
299
299
 
@@ -305,7 +305,7 @@ ___
305
305
 
306
306
  ### FormProps
307
307
 
308
- Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `items?`: ([`FormItemProps`](#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
308
+ Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { `[type: string]`: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `items?`: ([`FormItemProps`](#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
309
309
 
310
310
  #### Type parameters
311
311
 
@@ -350,7 +350,7 @@ ___
350
350
 
351
351
  ### TableProps
352
352
 
353
- Ƭ **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`\>
353
+ Ƭ **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`\>
354
354
 
355
355
  #### Type parameters
356
356
 
@@ -375,7 +375,8 @@ ___
375
375
 
376
376
  | Name | Type | Description |
377
377
  | :------ | :------ | :------ |
378
- | `h1?` | `boolean` \| { `className?`: `string` ; `style?`: `React.CSSProperties` } | - |
378
+ | `children?` | `JSX.Element` | return children |
379
+ | `h1?` | `boolean` \| { `className?`: `string` ; `style?`: `React.CSSProperties` } | return a h1 element |
379
380
  | `separator?` | `string` | ` - ` as default |
380
381
  | `suffix?` | `string` | - |
381
382
  | `title` | `string` \| `string`[] | - |
@@ -621,13 +622,19 @@ ___
621
622
  ▸ **Title**(`props`): `JSX.Element`
622
623
 
623
624
  Title is used to change the title of the page.
625
+ Return null by default.
624
626
 
625
627
  ```ts
626
- <Title title='hi' /> // => return null, change the document.title to 'hi'
627
- <Title title={['a', 'b']} /> // => return null, change the document.title to 'a - b'
628
+ // return null
629
+ <Title title='hi' /> // => change the document.title to 'hi'
630
+ <Title title={['a', 'b']} /> // => change the document.title to 'a - b'
628
631
 
629
- <Title title='hi' h1 /> // => return <h1>hi</h1>, change the document.title to 'hi'
630
- <Title title={['a', 'b']} h1 /> // => return <h1>a</h1>, change the document.title to 'a - b'
632
+ // return h1
633
+ <Title title='hi' h1 /> // => <h1>hi</h1>
634
+ <Title title={['a', 'b']} h1 /> // => <h1>a</h1>
635
+
636
+ // return children
637
+ <Title title='hi'><CustomTitle /></Title> // => <CustomTitle />
631
638
  ```
632
639
 
633
640
  #### Parameters
package/dist/index.d.ts CHANGED
@@ -305,20 +305,29 @@ declare type TitleProps = {
305
305
  /** ` - ` as default */
306
306
  separator?: string;
307
307
  suffix?: string;
308
+ /** return a h1 element */
308
309
  h1?: boolean | {
309
310
  className?: string;
310
311
  style?: React.CSSProperties;
311
312
  };
313
+ /** return children */
314
+ children?: JSX.Element;
312
315
  };
313
316
  /**
314
317
  * Title is used to change the title of the page.
318
+ * Return null by default.
315
319
  *
316
320
  * ```ts
317
- * <Title title='hi' /> // => return null, change the document.title to 'hi'
318
- * <Title title={['a', 'b']} /> // => return null, change the document.title to 'a - b'
321
+ * // return null
322
+ * <Title title='hi' /> // => change the document.title to 'hi'
323
+ * <Title title={['a', 'b']} /> // => change the document.title to 'a - b'
324
+ *
325
+ * // return h1
326
+ * <Title title='hi' h1 /> // => <h1>hi</h1>
327
+ * <Title title={['a', 'b']} h1 /> // => <h1>a</h1>
319
328
  *
320
- * <Title title='hi' h1 /> // => return <h1>hi</h1>, change the document.title to 'hi'
321
- * <Title title={['a', 'b']} h1 /> // => return <h1>a</h1>, change the document.title to 'a - b'
329
+ * // return children
330
+ * <Title title='hi'><CustomTitle /></Title> // => <CustomTitle />
322
331
  * ```
323
332
  */
324
333
  declare function Title(props: TitleProps): JSX.Element;
package/dist/index.js CHANGED
@@ -757,6 +757,8 @@ function Title(props) {
757
757
  style: props.h1.style
758
758
  }, Array.isArray(props.title) ? props.title[0] : props.title);
759
759
  }
760
+ if (props.children)
761
+ return (0, import_react13.cloneElement)(props.children, { title: props.title });
760
762
  return null;
761
763
  }
762
764
  module.exports = __toCommonJS(src_exports);
package/dist/index.mjs CHANGED
@@ -727,7 +727,7 @@ function Table(props) {
727
727
  }
728
728
 
729
729
  // src/Title.tsx
730
- import { useEffect as useEffect6 } from "react";
730
+ import { useEffect as useEffect6, cloneElement as cloneElement3 } from "react";
731
731
  function Title(props) {
732
732
  const [config] = useFaasState();
733
733
  useEffect6(() => {
@@ -742,6 +742,8 @@ function Title(props) {
742
742
  style: props.h1.style
743
743
  }, Array.isArray(props.title) ? props.title[0] : props.title);
744
744
  }
745
+ if (props.children)
746
+ return cloneElement3(props.children, { title: props.title });
745
747
  return null;
746
748
  }
747
749
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.373",
3
+ "version": "0.0.2-beta.374",
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.373",
31
+ "@faasjs/react": "^0.0.2-beta.374",
32
32
  "react-use": "*",
33
33
  "react-router-dom": "*",
34
34
  "dayjs": "*"