szld-libs 0.0.20 → 0.0.21

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.
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "antd";
3
+ interface AuthProps {
4
+ PId: number;
5
+ }
6
+ export interface CoralButtonProps extends ButtonProps {
7
+ PId: number;
8
+ auths?: AuthProps[];
9
+ }
10
+ declare const CoralButton: (props: CoralButtonProps) => JSX.Element;
11
+ export default CoralButton;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import AuthButton from "../AuthButton";
4
+ const CoralButton = (props) => {
5
+ const { PId, auths, ...rest } = props;
6
+ const auth = useMemo(() => {
7
+ if (auths && auths.find((v) => v.PId === PId)) {
8
+ return true;
9
+ }
10
+ return false;
11
+ }, [PId, auths]);
12
+ return /* @__PURE__ */ jsx(AuthButton, { ...rest, auth });
13
+ };
14
+ export {
15
+ CoralButton as default
16
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/es/index.js CHANGED
@@ -4,6 +4,7 @@ import ReactDOM from "react-dom/client";
4
4
  import { BrowserRouter } from "react-router-dom";
5
5
  import { BackHeader, AuthButton, SearchTable, EditTable, VirtualTable } from "./main";
6
6
  import { UploadFile } from "../es/main";
7
+ import CoralButton from "./components/CoralButton";
7
8
  const Demo = () => {
8
9
  const [list, setList] = useState([
9
10
  {
@@ -75,6 +76,7 @@ const Demo = () => {
75
76
  return /* @__PURE__ */ jsxs("div", { children: [
76
77
  /* @__PURE__ */ jsx(BackHeader, { title: "标题111", subTitle: /* @__PURE__ */ jsx("span", { children: "副标题" }) }),
77
78
  /* @__PURE__ */ jsx(AuthButton, { type: "primary", children: "按钮1" }),
79
+ /* @__PURE__ */ jsx(CoralButton, { PId: 100, auths: [{ PId: 100 }], children: "123" }),
78
80
  /* @__PURE__ */ jsx(
79
81
  SearchTable,
80
82
  {
package/es/main.d.ts CHANGED
@@ -6,9 +6,10 @@ import Echarts from "./components/Echarts";
6
6
  import EditTable from "./components/EditTable";
7
7
  import VirtualTable from "./components/VirtualTable";
8
8
  import AuthButton from "./components/AuthButton";
9
+ import CoralButton from "./components/CoralButton";
9
10
  import showWorkFlow from "./components/WorkFlowNode";
10
11
  import * as download from "./utils/download";
11
12
  import * as fileType from "./utils/filetype";
12
13
  import * as verfyCode from "./utils/verify-code";
13
14
  import * as utils from "./utils/index";
14
- export { AuthButton, Echarts, EditTable, VirtualTable, BackHeader, CreateForm, SearchTable, UploadFile, showWorkFlow, download, fileType, verfyCode, utils, };
15
+ export { AuthButton, CoralButton, Echarts, EditTable, VirtualTable, BackHeader, CreateForm, SearchTable, UploadFile, showWorkFlow, download, fileType, verfyCode, utils, };
package/es/main.js CHANGED
@@ -6,7 +6,8 @@ import { default as default6 } from "./components/Echarts";
6
6
  import { default as default7 } from "./components/EditTable";
7
7
  import { default as default8 } from "./components/VirtualTable";
8
8
  import { default as default9 } from "./components/AuthButton";
9
- import { default as default10 } from "./components/WorkFlowNode";
9
+ import { default as default10 } from "./components/CoralButton";
10
+ import { default as default11 } from "./components/WorkFlowNode";
10
11
  import * as download from "./utils/download";
11
12
  import * as filetype from "./utils/filetype";
12
13
  import * as verifyCode from "./utils/verify-code";
@@ -14,6 +15,7 @@ import * as index from "./utils/index";
14
15
  export {
15
16
  default9 as AuthButton,
16
17
  default2 as BackHeader,
18
+ default10 as CoralButton,
17
19
  default3 as CreateForm,
18
20
  default6 as Echarts,
19
21
  default7 as EditTable,
@@ -22,7 +24,7 @@ export {
22
24
  default8 as VirtualTable,
23
25
  download,
24
26
  filetype as fileType,
25
- default10 as showWorkFlow,
27
+ default11 as showWorkFlow,
26
28
  index as utils,
27
29
  verifyCode as verfyCode
28
30
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "antd";
3
+ interface AuthProps {
4
+ PId: number;
5
+ }
6
+ export interface CoralButtonProps extends ButtonProps {
7
+ PId: number;
8
+ auths?: AuthProps[];
9
+ }
10
+ declare const CoralButton: (props: CoralButtonProps) => JSX.Element;
11
+ export default CoralButton;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const AuthButton = require("../AuthButton");
5
+ const CoralButton = (props) => {
6
+ const { PId, auths, ...rest } = props;
7
+ const auth = react.useMemo(() => {
8
+ if (auths && auths.find((v) => v.PId === PId)) {
9
+ return true;
10
+ }
11
+ return false;
12
+ }, [PId, auths]);
13
+ return /* @__PURE__ */ jsxRuntime.jsx(AuthButton, { ...rest, auth });
14
+ };
15
+ module.exports = CoralButton;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/lib/index.js CHANGED
@@ -5,6 +5,7 @@ const ReactDOM = require("react-dom/client");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const main = require("./main");
7
7
  const main$1 = require("../es/main");
8
+ const CoralButton = require("./components/CoralButton");
8
9
  const Demo = () => {
9
10
  const [list, setList] = react.useState([
10
11
  {
@@ -76,6 +77,7 @@ const Demo = () => {
76
77
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
77
78
  /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "标题111", subTitle: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "副标题" }) }),
78
79
  /* @__PURE__ */ jsxRuntime.jsx(main.AuthButton, { type: "primary", children: "按钮1" }),
80
+ /* @__PURE__ */ jsxRuntime.jsx(CoralButton, { PId: 100, auths: [{ PId: 100 }], children: "123" }),
79
81
  /* @__PURE__ */ jsxRuntime.jsx(
80
82
  main.SearchTable,
81
83
  {
package/lib/main.d.ts CHANGED
@@ -6,9 +6,10 @@ import Echarts from "./components/Echarts";
6
6
  import EditTable from "./components/EditTable";
7
7
  import VirtualTable from "./components/VirtualTable";
8
8
  import AuthButton from "./components/AuthButton";
9
+ import CoralButton from "./components/CoralButton";
9
10
  import showWorkFlow from "./components/WorkFlowNode";
10
11
  import * as download from "./utils/download";
11
12
  import * as fileType from "./utils/filetype";
12
13
  import * as verfyCode from "./utils/verify-code";
13
14
  import * as utils from "./utils/index";
14
- export { AuthButton, Echarts, EditTable, VirtualTable, BackHeader, CreateForm, SearchTable, UploadFile, showWorkFlow, download, fileType, verfyCode, utils, };
15
+ export { AuthButton, CoralButton, Echarts, EditTable, VirtualTable, BackHeader, CreateForm, SearchTable, UploadFile, showWorkFlow, download, fileType, verfyCode, utils, };
package/lib/main.js CHANGED
@@ -8,6 +8,7 @@ const Echarts = require("./components/Echarts");
8
8
  const EditTable = require("./components/EditTable");
9
9
  const VirtualTable = require("./components/VirtualTable");
10
10
  const AuthButton = require("./components/AuthButton");
11
+ const CoralButton = require("./components/CoralButton");
11
12
  const WorkFlowNode = require("./components/WorkFlowNode");
12
13
  const download = require("./utils/download");
13
14
  const filetype = require("./utils/filetype");
@@ -41,6 +42,7 @@ exports.Echarts = Echarts;
41
42
  exports.EditTable = EditTable;
42
43
  exports.VirtualTable = VirtualTable;
43
44
  exports.AuthButton = AuthButton;
45
+ exports.CoralButton = CoralButton;
44
46
  exports.showWorkFlow = WorkFlowNode;
45
47
  exports.download = download__namespace;
46
48
  exports.fileType = filetype__namespace;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",