szld-libs 0.2.45 → 0.2.46

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,13 +1,23 @@
1
- import { CSSProperties, ReactNode } from "react";
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  interface BackHeaderProps {
3
+ /** 是否显示返回按钮 */
3
4
  isBack?: boolean;
5
+ /** 页头标题 */
4
6
  title: string | ReactNode;
7
+ /** 页头副标题 */
5
8
  subTitle?: string | ReactNode;
9
+ /** 标题右侧元素 */
6
10
  extra?: ReactNode;
11
+ /** 自定义class */
7
12
  className?: string;
13
+ /** 自定义页头style */
8
14
  style?: CSSProperties;
15
+ /** 自定义标题style */
9
16
  titleStyle?: CSSProperties;
17
+ /** 重要程度,相当于 h1、h2、h3、h4、h5 */
10
18
  level?: 1 | 2 | 3 | 4 | 5;
19
+ /** 自定义图标 */
20
+ icon?: React.ReactNode;
11
21
  }
12
22
  declare const BackHeader: (props: BackHeaderProps) => import("react/jsx-runtime").JSX.Element;
13
23
  export default BackHeader;
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Space, Typography } from "antd";
2
+ import { Space, Button, Typography } from "antd";
3
3
  import { ArrowLeftOutlined } from "@ant-design/icons";
4
4
  import { useNavigate } from "react-router-dom";
5
5
  import classNames from "classnames";
@@ -13,16 +13,7 @@ const styles = {
13
13
  };
14
14
  const { Title, Text } = Typography;
15
15
  const BackHeader = (props) => {
16
- const {
17
- isBack = true,
18
- title: title2,
19
- extra,
20
- subTitle = null,
21
- className,
22
- style,
23
- titleStyle,
24
- level = 2
25
- } = props;
16
+ const { isBack = true, title: title2, extra, subTitle = null, className, style, titleStyle, level = 2, icon } = props;
26
17
  const navigate = useNavigate();
27
18
  const renderSubtitle = () => {
28
19
  if (typeof subTitle === "string") {
@@ -35,7 +26,7 @@ const BackHeader = (props) => {
35
26
  };
36
27
  return /* @__PURE__ */ jsxs("div", { className: classNames(styles.main, className), style, children: [
37
28
  /* @__PURE__ */ jsxs(Space, { children: [
38
- isBack && /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { fontSize: 24 }, onClick: goBack }),
29
+ isBack && /* @__PURE__ */ jsx(Button, { type: "text", icon: icon || /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { fontSize: 24 } }), onClick: goBack }),
39
30
  /* @__PURE__ */ jsxs(Title, { level, className: styles.title, style: titleStyle, children: [
40
31
  title2,
41
32
  renderSubtitle()
package/es/index.js CHANGED
@@ -4,7 +4,7 @@ import ReactDOM from "react-dom/client";
4
4
  import { BrowserRouter } from "react-router-dom";
5
5
  import { Table, Button } from "antd";
6
6
  import useConfig from "./hooks/useConfig";
7
- import { useRowSelection, SearchTable } from "./main";
7
+ import { useRowSelection, BackHeader, SearchTable } from "./main";
8
8
  let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
9
9
  const Demo = () => {
10
10
  useConfig(key);
@@ -41,6 +41,7 @@ const Demo = () => {
41
41
  setSelectedKeys([1, 12, 21]);
42
42
  }, []);
43
43
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh" }, children: [
44
+ /* @__PURE__ */ jsx(BackHeader, { title: "新增系统", isBack: true }),
44
45
  /* @__PURE__ */ jsx(Button, { onClick: () => setList(columns), children: "test" }),
45
46
  /* @__PURE__ */ jsx(
46
47
  "div",
@@ -1,13 +1,23 @@
1
- import { CSSProperties, ReactNode } from "react";
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  interface BackHeaderProps {
3
+ /** 是否显示返回按钮 */
3
4
  isBack?: boolean;
5
+ /** 页头标题 */
4
6
  title: string | ReactNode;
7
+ /** 页头副标题 */
5
8
  subTitle?: string | ReactNode;
9
+ /** 标题右侧元素 */
6
10
  extra?: ReactNode;
11
+ /** 自定义class */
7
12
  className?: string;
13
+ /** 自定义页头style */
8
14
  style?: CSSProperties;
15
+ /** 自定义标题style */
9
16
  titleStyle?: CSSProperties;
17
+ /** 重要程度,相当于 h1、h2、h3、h4、h5 */
10
18
  level?: 1 | 2 | 3 | 4 | 5;
19
+ /** 自定义图标 */
20
+ icon?: React.ReactNode;
11
21
  }
12
22
  declare const BackHeader: (props: BackHeaderProps) => import("react/jsx-runtime").JSX.Element;
13
23
  export default BackHeader;
@@ -14,16 +14,7 @@ const styles = {
14
14
  };
15
15
  const { Title, Text } = antd.Typography;
16
16
  const BackHeader = (props) => {
17
- const {
18
- isBack = true,
19
- title: title2,
20
- extra,
21
- subTitle = null,
22
- className,
23
- style,
24
- titleStyle,
25
- level = 2
26
- } = props;
17
+ const { isBack = true, title: title2, extra, subTitle = null, className, style, titleStyle, level = 2, icon } = props;
27
18
  const navigate = reactRouterDom.useNavigate();
28
19
  const renderSubtitle = () => {
29
20
  if (typeof subTitle === "string") {
@@ -36,7 +27,7 @@ const BackHeader = (props) => {
36
27
  };
37
28
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames(styles.main, className), style, children: [
38
29
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
39
- isBack && /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, { style: { fontSize: 24 }, onClick: goBack }),
30
+ isBack && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", icon: icon || /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, { style: { fontSize: 24 } }), onClick: goBack }),
40
31
  /* @__PURE__ */ jsxRuntime.jsxs(Title, { level, className: styles.title, style: titleStyle, children: [
41
32
  title2,
42
33
  renderSubtitle()
package/lib/index.js CHANGED
@@ -42,6 +42,7 @@ const Demo = () => {
42
42
  setSelectedKeys([1, 12, 21]);
43
43
  }, []);
44
44
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh" }, children: [
45
+ /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "新增系统", isBack: true }),
45
46
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setList(columns), children: "test" }),
46
47
  /* @__PURE__ */ jsxRuntime.jsx(
47
48
  "div",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.45",
4
+ "version": "0.2.46",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",