@faasjs/ant-design 0.0.2-beta.419 → 0.0.2-beta.421

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as antd_es_calendar_generateCalendar_js from 'antd/es/calendar/generateCalendar.js';
2
2
  import { Dayjs } from 'dayjs';
3
- import { CalendarProps as CalendarProps$1, DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, DatePickerProps as DatePickerProps$1, TimePickerProps as TimePickerProps$1, SelectProps, FormProps as FormProps$1, ButtonProps, ModalProps as ModalProps$1, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1 } from 'antd';
3
+ import { CalendarProps as CalendarProps$1, DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, DatePickerProps as DatePickerProps$1, TimePickerProps as TimePickerProps$1, SelectProps, FormProps as FormProps$1, ButtonProps, ModalProps as ModalProps$1, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, PageHeaderProps } from 'antd';
4
4
  export { Drawer, Modal } from 'antd';
5
5
  import * as react from 'react';
6
6
  import { CSSProperties, ReactNode, LazyExoticComponent, ComponentType } from 'react';
@@ -420,6 +420,10 @@ declare type TitleProps = {
420
420
  className?: string;
421
421
  style?: React.CSSProperties;
422
422
  };
423
+ /** return a pure text element */
424
+ plain?: boolean;
425
+ /** return a PageHeader element */
426
+ header?: PageHeaderProps;
423
427
  /** return children */
424
428
  children?: JSX.Element;
425
429
  };
package/dist/index.js CHANGED
@@ -1261,13 +1261,14 @@ function Table(props) {
1261
1261
 
1262
1262
  // src/Title.tsx
1263
1263
  var import_react14 = require("react");
1264
+ var import_antd11 = require("antd");
1264
1265
  var import_jsx_runtime12 = require("react/jsx-runtime");
1265
1266
  function Title(props) {
1266
- const config = useConfigContext();
1267
+ const { Title: Title2 } = useConfigContext();
1267
1268
  (0, import_react14.useEffect)(() => {
1268
1269
  const title = Array.isArray(props.title) ? props.title : [props.title];
1269
- document.title = title.concat(props.suffix || config.Title.suffix).filter((t) => !!t).join(props.separator || config.Title.separator);
1270
- }, []);
1270
+ document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1271
+ }, [props.title]);
1271
1272
  if (props.h1) {
1272
1273
  if (typeof props.h1 === "boolean")
1273
1274
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h1", {
@@ -1279,6 +1280,15 @@ function Title(props) {
1279
1280
  children: Array.isArray(props.title) ? props.title[0] : props.title
1280
1281
  });
1281
1282
  }
1283
+ if (props.plain)
1284
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, {
1285
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1286
+ });
1287
+ if (props.header)
1288
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd11.PageHeader, {
1289
+ title: Array.isArray(props.title) ? props.title[0] : props.title,
1290
+ ...props.header
1291
+ });
1282
1292
  if (props.children)
1283
1293
  return (0, import_react14.cloneElement)(props.children, { title: props.title });
1284
1294
  return null;
package/dist/index.mjs CHANGED
@@ -1255,13 +1255,14 @@ function Table(props) {
1255
1255
 
1256
1256
  // src/Title.tsx
1257
1257
  import { useEffect as useEffect6, cloneElement as cloneElement3 } from "react";
1258
- import { jsx as jsx12 } from "react/jsx-runtime";
1258
+ import { PageHeader } from "antd";
1259
+ import { Fragment as Fragment3, jsx as jsx12 } from "react/jsx-runtime";
1259
1260
  function Title(props) {
1260
- const config = useConfigContext();
1261
+ const { Title: Title2 } = useConfigContext();
1261
1262
  useEffect6(() => {
1262
1263
  const title = Array.isArray(props.title) ? props.title : [props.title];
1263
- document.title = title.concat(props.suffix || config.Title.suffix).filter((t) => !!t).join(props.separator || config.Title.separator);
1264
- }, []);
1264
+ document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1265
+ }, [props.title]);
1265
1266
  if (props.h1) {
1266
1267
  if (typeof props.h1 === "boolean")
1267
1268
  return /* @__PURE__ */ jsx12("h1", {
@@ -1273,6 +1274,15 @@ function Title(props) {
1273
1274
  children: Array.isArray(props.title) ? props.title[0] : props.title
1274
1275
  });
1275
1276
  }
1277
+ if (props.plain)
1278
+ return /* @__PURE__ */ jsx12(Fragment3, {
1279
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1280
+ });
1281
+ if (props.header)
1282
+ return /* @__PURE__ */ jsx12(PageHeader, {
1283
+ title: Array.isArray(props.title) ? props.title[0] : props.title,
1284
+ ...props.header
1285
+ });
1276
1286
  if (props.children)
1277
1287
  return cloneElement3(props.children, { title: props.title });
1278
1288
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.419",
3
+ "version": "0.0.2-beta.421",
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.419",
31
+ "@faasjs/react": "^0.0.2-beta.421",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },