@rainte/ant 0.0.64 → 0.0.70
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.js +128 -104
- package/dist/index.umd.cjs +1 -1
- package/dist/types/components/Editor/index.d.ts +1 -1
- package/dist/types/components/Form/index.d.ts +1 -2
- package/dist/types/components/Layout/index.d.ts +5 -0
- package/dist/types/components/Provider/index.d.ts +4 -2
- package/dist/types/components/Table/index.d.ts +1 -2
- package/dist/types/components/Upload/index.d.ts +4 -4
- package/dist/types/lib.d.ts +4 -2
- package/dist/types/utils/antd.d.ts +8 -0
- package/dist/types/utils/router.d.ts +9 -0
- package/dist/types/views/form/index.d.ts +2 -1
- package/dist/types/views/layout/index.d.ts +9 -0
- package/dist/types/views/table/index.d.ts +2 -1
- package/package.json +2 -8
- package/dist/types/router/index.d.ts +0 -7
- package/dist/types/utils/dialog.d.ts +0 -22
- package/dist/types/utils/i18n.d.ts +0 -3
- package/dist/types/views/layout/blank/index.d.ts +0 -1
- package/dist/types/views/layout/menu/index.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,105 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { lazy as e, useContext as t, useEffect as n, useRef as r } from "react";
|
|
2
|
+
import i from "quill";
|
|
3
3
|
import "quill/dist/quill.snow.css";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { BetaSchemaForm as
|
|
6
|
-
import { App as
|
|
7
|
-
import { AiOutlineUpload as
|
|
8
|
-
import {
|
|
9
|
-
import g, * as _ from "i18next";
|
|
10
|
-
import v from "i18next-http-backend";
|
|
11
|
-
import y from "i18next-browser-languagedetector";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { BetaSchemaForm as s, PageContainer as c, ProCard as l, ProForm as u, ProLayout as d, ProProvider as f, ProTable as p } from "@ant-design/pro-components";
|
|
6
|
+
import { App as m, Button as h, Space as g, Upload as _ } from "antd";
|
|
7
|
+
import { AiOutlineUpload as v } from "react-icons/ai";
|
|
8
|
+
import { Link as y, Navigate as b, Outlet as x, createHashRouter as S, useLocation as C } from "react-router";
|
|
12
9
|
// \0rolldown/runtime.js
|
|
13
|
-
var
|
|
10
|
+
var w = Object.defineProperty, T = (e, t) => {
|
|
14
11
|
let n = {};
|
|
15
|
-
for (var r in e)
|
|
12
|
+
for (var r in e) w(n, r, {
|
|
16
13
|
get: e[r],
|
|
17
14
|
enumerable: !0
|
|
18
15
|
});
|
|
19
|
-
return t ||
|
|
20
|
-
}
|
|
21
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = S(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !C.call(e, s) && s !== n && b(e, s, {
|
|
22
|
-
get: ((e) => t[e]).bind(null, s),
|
|
23
|
-
enumerable: !(r = x(t, s)) || r.enumerable
|
|
24
|
-
});
|
|
25
|
-
return e;
|
|
26
|
-
}, E = (e, t, n) => (T(e, t, "default"), n && T(n, t, "default"));
|
|
16
|
+
return t || w(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
17
|
+
};
|
|
27
18
|
// src/components/Editor/index.tsx
|
|
28
|
-
function
|
|
29
|
-
let { value:
|
|
30
|
-
return
|
|
19
|
+
function E(e) {
|
|
20
|
+
let { value: t, style: o, ...s } = e, c = r(null), l = r(null);
|
|
21
|
+
return n(() => {
|
|
31
22
|
let e = c.current, t = document.createElement("div");
|
|
32
23
|
Object.assign(t.style, o ?? {});
|
|
33
|
-
let
|
|
24
|
+
let n = new i(e.appendChild(t), {
|
|
34
25
|
theme: "snow",
|
|
35
26
|
...s
|
|
36
27
|
});
|
|
37
|
-
l.current =
|
|
38
|
-
let
|
|
39
|
-
return
|
|
40
|
-
|
|
28
|
+
l.current = n;
|
|
29
|
+
let r = () => s.onChange?.(n.root.innerHTML || "");
|
|
30
|
+
return n.on("text-change", r), () => {
|
|
31
|
+
n.off("text-change", r), l.current = null, e.innerHTML = "";
|
|
41
32
|
};
|
|
42
|
-
}, []),
|
|
33
|
+
}, []), n(() => {
|
|
43
34
|
let e = l.current;
|
|
44
35
|
if (!e) return;
|
|
45
|
-
let
|
|
46
|
-
e.root.innerHTML !==
|
|
47
|
-
}, [
|
|
36
|
+
let n = t || "";
|
|
37
|
+
e.root.innerHTML !== n && e.clipboard.dangerouslyPasteHTML(n);
|
|
38
|
+
}, [t]), /* @__PURE__ */ a("div", {
|
|
48
39
|
ref: c,
|
|
49
40
|
style: { height: "100%" }
|
|
50
41
|
});
|
|
51
42
|
}
|
|
52
43
|
// src/components/Upload/index.tsx
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
...
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
44
|
+
var D = (e) => {
|
|
45
|
+
if (Array.isArray(e)) return e;
|
|
46
|
+
if (e && typeof e == "object" && "fileList" in e) return e.fileList;
|
|
47
|
+
};
|
|
48
|
+
function O(e) {
|
|
49
|
+
let { value: t, onChange: n, maxCount: r = 1, multiple: i, listType: o, ...s } = e, c = D(t) ?? [], l = c.length >= r, u = o?.startsWith("picture-") ? /* @__PURE__ */ a(v, {}) : /* @__PURE__ */ a(h, {
|
|
50
|
+
icon: /* @__PURE__ */ a(v, {}),
|
|
51
|
+
children: "上传"
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ a(_, {
|
|
54
|
+
...s,
|
|
55
|
+
maxCount: r,
|
|
56
|
+
multiple: i ?? r > 1,
|
|
57
|
+
listType: o,
|
|
58
|
+
showUploadList: s.showUploadList ?? !0,
|
|
59
|
+
fileList: c,
|
|
60
|
+
onChange: (e) => n?.(e.fileList),
|
|
61
|
+
children: l ? null : u
|
|
67
62
|
});
|
|
68
63
|
}
|
|
69
64
|
// src/components/Provider/index.tsx
|
|
70
|
-
var
|
|
71
|
-
upload: { formItemRender: (e, t) => /* @__PURE__ */
|
|
72
|
-
editor: { formItemRender: (e, t) => /* @__PURE__ */
|
|
65
|
+
var k = {
|
|
66
|
+
upload: { formItemRender: (e, t) => /* @__PURE__ */ a(O, { ...t.fieldProps }) },
|
|
67
|
+
editor: { formItemRender: (e, t) => /* @__PURE__ */ a(E, { ...t.fieldProps }) }
|
|
73
68
|
};
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
function A({ children: e }) {
|
|
70
|
+
let n = t(f);
|
|
71
|
+
return /* @__PURE__ */ a(f.Provider, {
|
|
72
|
+
value: {
|
|
73
|
+
...n,
|
|
74
|
+
valueTypeMap: {
|
|
75
|
+
...n.valueTypeMap,
|
|
76
|
+
...k
|
|
77
|
+
}
|
|
78
|
+
},
|
|
77
79
|
children: e
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
82
|
// src/components/Form/index.tsx
|
|
81
|
-
var
|
|
83
|
+
var j = () => u.useForm()[0], M = (e) => /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(s, {
|
|
82
84
|
layout: "horizontal",
|
|
83
85
|
colon: !1,
|
|
84
|
-
labelCol: { span: 3 },
|
|
85
|
-
wrapperCol: { span: 6 },
|
|
86
86
|
scrollToFirstError: !0,
|
|
87
|
-
submitter: { render: (e, t) => /* @__PURE__ */
|
|
87
|
+
submitter: { render: (e, t) => /* @__PURE__ */ a(u.Item, {
|
|
88
88
|
wrapperCol: {
|
|
89
89
|
offset: 4,
|
|
90
90
|
span: 8
|
|
91
91
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ a(g, { children: t })
|
|
93
93
|
}) },
|
|
94
94
|
...e
|
|
95
95
|
}) });
|
|
96
|
-
|
|
96
|
+
M.useForm = j;
|
|
97
|
+
// src/components/Layout/index.tsx
|
|
98
|
+
var N = (e, t) => /* @__PURE__ */ a(y, {
|
|
99
|
+
to: e.path || "/",
|
|
100
|
+
children: t
|
|
101
|
+
});
|
|
102
|
+
function P({ routes: e, ...t }) {
|
|
103
|
+
let n = C();
|
|
104
|
+
return /* @__PURE__ */ a(d, {
|
|
105
|
+
title: "Rainte",
|
|
106
|
+
token: { bgLayout: "#fff" },
|
|
107
|
+
menuItemRender: N,
|
|
108
|
+
...t,
|
|
109
|
+
route: {
|
|
110
|
+
path: "/",
|
|
111
|
+
...t.route,
|
|
112
|
+
...e === void 0 ? {} : { routes: e }
|
|
113
|
+
},
|
|
114
|
+
location: t.location ?? { pathname: n.pathname },
|
|
115
|
+
children: /* @__PURE__ */ a(c, {
|
|
116
|
+
title: !1,
|
|
117
|
+
children: /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a(x, {}) })
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
}
|
|
97
121
|
// src/components/Table/index.tsx
|
|
98
|
-
function
|
|
99
|
-
return /* @__PURE__ */
|
|
122
|
+
function F(e) {
|
|
123
|
+
return /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(p, {
|
|
100
124
|
rowKey: "id",
|
|
101
125
|
pagination: { pageSize: 10 },
|
|
102
|
-
tableAlertRender: ({ selectedRowKeys: e }) => /* @__PURE__ */
|
|
126
|
+
tableAlertRender: ({ selectedRowKeys: e }) => /* @__PURE__ */ o(g, { children: [
|
|
103
127
|
"已选 ",
|
|
104
128
|
e.length,
|
|
105
129
|
" 项"
|
|
@@ -107,50 +131,50 @@ function P(e) {
|
|
|
107
131
|
...e
|
|
108
132
|
}) });
|
|
109
133
|
}
|
|
110
|
-
// src/utils/
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
message: () =>
|
|
114
|
-
modal: () =>
|
|
115
|
-
notification: () =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return
|
|
121
|
-
}, B = {
|
|
122
|
-
confirm: (e) => R.confirm({
|
|
134
|
+
// src/utils/antd.ts
|
|
135
|
+
var I = /* @__PURE__ */ T({
|
|
136
|
+
AntdAppHolder: () => B,
|
|
137
|
+
message: () => H,
|
|
138
|
+
modal: () => V,
|
|
139
|
+
notification: () => z
|
|
140
|
+
}), L, R, z, B = () => {
|
|
141
|
+
let e = m.useApp();
|
|
142
|
+
return L = e.message, R = e.modal, z = e.notification, null;
|
|
143
|
+
}, V = new Proxy({}, { get(e, t) {
|
|
144
|
+
return t === "confirm" ? (e) => R.confirm({
|
|
123
145
|
title: "提示",
|
|
124
146
|
content: "确认操作?",
|
|
125
147
|
...e
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
148
|
+
}) : R[t];
|
|
149
|
+
} }), H = new Proxy({}, { get(e, t) {
|
|
150
|
+
return t === "success" ? (e = "操作成功", t, n) => L.success(e, t, n) : L[t];
|
|
151
|
+
} }), U = /* @__PURE__ */ T({ onUpload: () => W }), W = async (e) => {
|
|
152
|
+
let { file: t, onProgress: n, onSuccess: r, onError: i } = e, a = URL.createObjectURL(t);
|
|
153
|
+
try {
|
|
154
|
+
await new Promise((e) => {
|
|
155
|
+
let t = 0, r = setInterval(() => {
|
|
156
|
+
t = Math.min(t + Math.floor(Math.random() * 10) + 1, 99), n?.({ percent: t }), t >= 99 && (clearInterval(r), e());
|
|
157
|
+
}, 100);
|
|
158
|
+
}), n?.({ percent: 100 }), t.url = a, r?.({ url: a });
|
|
159
|
+
} catch (e) {
|
|
160
|
+
URL.revokeObjectURL(a), i?.(e);
|
|
136
161
|
}
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
export { D as Editor, N as Form, j as Provider, P as Table, k as Upload, F as dialog, V as i18n, U as misc };
|
|
162
|
+
}, G = /* @__PURE__ */ T({ createRouter: () => K });
|
|
163
|
+
function K(t, n, r) {
|
|
164
|
+
let i = t.map((t) => ({
|
|
165
|
+
path: t.url,
|
|
166
|
+
Component: e(t.component)
|
|
167
|
+
})), o = /* @__PURE__ */ a(b, { to: n });
|
|
168
|
+
return S([{
|
|
169
|
+
path: "/",
|
|
170
|
+
Component: e(r),
|
|
171
|
+
children: [{
|
|
172
|
+
index: !0,
|
|
173
|
+
element: o
|
|
174
|
+
}, ...i]
|
|
175
|
+
}, {
|
|
176
|
+
path: "*",
|
|
177
|
+
element: o
|
|
178
|
+
}]);
|
|
179
|
+
}
|
|
180
|
+
export { E as Editor, M as Form, P as Layout, A as Provider, F as Table, O as Upload, I as antd, U as misc, G as router };
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("quill"),require("quill/dist/quill.snow.css"),require("react/jsx-runtime"),require("@ant-design/pro-components"),require("antd"),require("react-icons/ai"),require("
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("quill"),require("quill/dist/quill.snow.css"),require("react/jsx-runtime"),require("@ant-design/pro-components"),require("antd"),require("react-icons/ai"),require("react-router")):typeof define==`function`&&define.amd?define([`exports`,`react`,`quill`,`quill/dist/quill.snow.css`,`react/jsx-runtime`,`@ant-design/pro-components`,`antd`,`react-icons/ai`,`react-router`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@rainte/ant`]={},e.React,e.Quill,e.QuillSnowCSS,e.ReactJSXRuntime,e.ProComponents,e.antd,e.ReactIconsAI,e.ReactRouter))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},g=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:l(p(e)),g(u(n,`default`,{value:e,enumerable:!0}),e)))(n,1);function _(e){let{value:r,style:a,...o}=e,s=(0,t.useRef)(null),c=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=s.current,t=document.createElement(`div`);Object.assign(t.style,a??{});let r=new n.default(e.appendChild(t),{theme:`snow`,...o});c.current=r;let i=()=>o.onChange?.(r.root.innerHTML||``);return r.on(`text-change`,i),()=>{r.off(`text-change`,i),c.current=null,e.innerHTML=``}},[]),(0,t.useEffect)(()=>{let e=c.current;if(!e)return;let t=r||``;e.root.innerHTML!==t&&e.clipboard.dangerouslyPasteHTML(t)},[r]),(0,i.jsx)(`div`,{ref:s,style:{height:`100%`}})}var v=e=>{if(Array.isArray(e))return e;if(e&&typeof e==`object`&&`fileList`in e)return e.fileList};function y(e){let{value:t,onChange:n,maxCount:r=1,multiple:a,listType:c,...l}=e,u=v(t)??[],d=u.length>=r,f=c?.startsWith(`picture-`)?(0,i.jsx)(s.AiOutlineUpload,{}):(0,i.jsx)(o.Button,{icon:(0,i.jsx)(s.AiOutlineUpload,{}),children:`上传`});return(0,i.jsx)(o.Upload,{...l,maxCount:r,multiple:a??r>1,listType:c,showUploadList:l.showUploadList??!0,fileList:u,onChange:e=>n?.(e.fileList),children:d?null:f})}var b={upload:{formItemRender:(e,t)=>(0,i.jsx)(y,{...t.fieldProps})},editor:{formItemRender:(e,t)=>(0,i.jsx)(_,{...t.fieldProps})}};function x({children:e}){let n=(0,t.useContext)(a.ProProvider);return(0,i.jsx)(a.ProProvider.Provider,{value:{...n,valueTypeMap:{...n.valueTypeMap,...b}},children:e})}var S=()=>a.ProForm.useForm()[0],C=e=>(0,i.jsx)(x,{children:(0,i.jsx)(a.BetaSchemaForm,{layout:`horizontal`,colon:!1,scrollToFirstError:!0,submitter:{render:(e,t)=>(0,i.jsx)(a.ProForm.Item,{wrapperCol:{offset:4,span:8},children:(0,i.jsx)(o.Space,{children:t})})},...e})});C.useForm=S;var w=(e,t)=>(0,i.jsx)(c.Link,{to:e.path||`/`,children:t});function T({routes:e,...t}){let n=(0,c.useLocation)();return(0,i.jsx)(a.ProLayout,{title:`Rainte`,token:{bgLayout:`#fff`},menuItemRender:w,...t,route:{path:`/`,...t.route,...e===void 0?{}:{routes:e}},location:t.location??{pathname:n.pathname},children:(0,i.jsx)(a.PageContainer,{title:!1,children:(0,i.jsx)(a.ProCard,{children:(0,i.jsx)(c.Outlet,{})})})})}function E(e){return(0,i.jsx)(x,{children:(0,i.jsx)(a.ProTable,{rowKey:`id`,pagination:{pageSize:10},tableAlertRender:({selectedRowKeys:e})=>(0,i.jsxs)(o.Space,{children:[`已选 `,e.length,` 项`]}),...e})})}var D=h({AntdAppHolder:()=>j,message:()=>N,modal:()=>M,notification:()=>A}),O,k,A,j=()=>{let e=o.App.useApp();return O=e.message,k=e.modal,A=e.notification,null},M=new Proxy({},{get(e,t){return t===`confirm`?e=>k.confirm({title:`提示`,content:`确认操作?`,...e}):k[t]}}),N=new Proxy({},{get(e,t){return t===`success`?(e=`操作成功`,t,n)=>O.success(e,t,n):O[t]}}),P=h({onUpload:()=>F}),F=async e=>{let{file:t,onProgress:n,onSuccess:r,onError:i}=e,a=URL.createObjectURL(t);try{await new Promise(e=>{let t=0,r=setInterval(()=>{t=Math.min(t+Math.floor(Math.random()*10)+1,99),n?.({percent:t}),t>=99&&(clearInterval(r),e())},100)}),n?.({percent:100}),t.url=a,r?.({url:a})}catch(e){URL.revokeObjectURL(a),i?.(e)}},I=h({createRouter:()=>L});function L(e,n,r){let a=e.map(e=>({path:e.url,Component:(0,t.lazy)(e.component)})),o=(0,i.jsx)(c.Navigate,{to:n});return(0,c.createHashRouter)([{path:`/`,Component:(0,t.lazy)(r),children:[{index:!0,element:o},...a]},{path:`*`,element:o}])}e.Editor=_,e.Form=C,e.Layout=T,e.Provider=x,e.Table=E,e.Upload=y,Object.defineProperty(e,"antd",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"misc",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"router",{enumerable:!0,get:function(){return I}})});
|
|
@@ -3,7 +3,7 @@ import { type QuillOptions } from 'quill';
|
|
|
3
3
|
import 'quill/dist/quill.snow.css';
|
|
4
4
|
export type EditorProps = QuillOptions & {
|
|
5
5
|
value?: any;
|
|
6
|
-
onChange?:
|
|
6
|
+
onChange?: (...args: any[]) => void;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
};
|
|
9
9
|
export default function Editor(props: EditorProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
import { type ValueTypeProps } from '@/components/Provider';
|
|
3
2
|
import { BetaSchemaForm, type ProFormInstance } from '@ant-design/pro-components';
|
|
4
|
-
export type FormProps<T = any, ValueType =
|
|
3
|
+
export type FormProps<T = any, ValueType = string> = ComponentProps<typeof BetaSchemaForm<T, ValueType>> & {
|
|
5
4
|
form?: ProFormInstance;
|
|
6
5
|
};
|
|
7
6
|
export declare const useForm: () => import("antd").FormInstance<any>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProLayoutProps } from '@ant-design/pro-components';
|
|
2
|
+
export type LayoutProps = ProLayoutProps & {
|
|
3
|
+
routes?: NonNullable<ProLayoutProps['route']>['routes'];
|
|
4
|
+
};
|
|
5
|
+
export default function Layout({ routes, ...props }: LayoutProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Provider({ children }:
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export default function Provider({ children }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ValueTypeProps } from '@/components/Provider';
|
|
2
1
|
import { type ProTableProps } from '@ant-design/pro-components';
|
|
3
|
-
export type TableProps<T = any, U =
|
|
2
|
+
export type TableProps<T = any, U = Record<string, any>, ValueType = string> = ProTableProps<T, U, ValueType>;
|
|
4
3
|
export default function Table(props: TableProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type UploadProps as AntUploadProps } from 'antd';
|
|
2
|
-
export type UploadProps = AntUploadProps & {
|
|
3
|
-
value?:
|
|
4
|
-
onChange?:
|
|
2
|
+
export type UploadProps = Omit<AntUploadProps, 'onChange' | 'fileList'> & {
|
|
3
|
+
value?: AntUploadProps['fileList'];
|
|
4
|
+
onChange?: (fileList: NonNullable<AntUploadProps['fileList']>) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const files: (
|
|
6
|
+
export declare const files: (value: unknown) => AntUploadProps['fileList'];
|
|
7
7
|
export default function Upload(props: UploadProps): import("react").JSX.Element;
|
package/dist/types/lib.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ export { default as Editor } from './components/Editor';
|
|
|
2
2
|
export type { EditorProps } from './components/Editor';
|
|
3
3
|
export { default as Form } from './components/Form';
|
|
4
4
|
export type { FormProps } from './components/Form';
|
|
5
|
+
export { default as Layout } from './components/Layout';
|
|
6
|
+
export type { LayoutProps } from './components/Layout';
|
|
5
7
|
export { default as Provider } from './components/Provider';
|
|
6
8
|
export { default as Table } from './components/Table';
|
|
7
9
|
export type { TableProps } from './components/Table';
|
|
8
10
|
export { default as Upload } from './components/Upload';
|
|
9
11
|
export type { UploadProps } from './components/Upload';
|
|
10
|
-
export * as
|
|
11
|
-
export * as i18n from './utils/i18n';
|
|
12
|
+
export * as antd from './utils/antd';
|
|
12
13
|
export * as misc from './utils/misc';
|
|
14
|
+
export * as router from './utils/router';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MessageInstance } from 'antd/es/message/interface';
|
|
2
|
+
import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
3
|
+
import type { NotificationInstance } from 'antd/es/notification/interface';
|
|
4
|
+
declare let notification: NotificationInstance;
|
|
5
|
+
export declare const AntdAppHolder: () => null;
|
|
6
|
+
export declare const modal: Omit<ModalStaticFunctions, "warn">;
|
|
7
|
+
export declare const message: MessageInstance;
|
|
8
|
+
export { notification };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ComponentType = () => Promise<{
|
|
2
|
+
default: React.ComponentType<any>;
|
|
3
|
+
}>;
|
|
4
|
+
export type MenuItem = {
|
|
5
|
+
url: string;
|
|
6
|
+
label: string;
|
|
7
|
+
component: ComponentType;
|
|
8
|
+
};
|
|
9
|
+
export declare function createRouter(menus: MenuItem[], homePath: string, layoutPath: ComponentType): import("react-router").DataRouter;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export default _default;
|
|
2
|
+
declare function _default(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const home = "/form";
|
|
2
|
+
export declare const layout: () => Promise<typeof import("@/views/layout")>;
|
|
3
|
+
export declare const menus: {
|
|
4
|
+
url: string;
|
|
5
|
+
label: string;
|
|
6
|
+
component: () => Promise<typeof import("@/views/form")>;
|
|
7
|
+
}[];
|
|
8
|
+
export default _default;
|
|
9
|
+
declare function _default(): import("react").JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export default
|
|
1
|
+
export default _default;
|
|
2
|
+
declare function _default(): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainte/ant",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,15 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/pro-components": "^3.1.15-9",
|
|
35
|
-
"@rainte/js": "^0.0.51",
|
|
36
35
|
"antd": "^6.7.0",
|
|
37
|
-
"i18next": "^26.7.2",
|
|
38
|
-
"i18next-browser-languagedetector": "^8.3.0",
|
|
39
|
-
"i18next-http-backend": "^4.0.10",
|
|
40
36
|
"quill": "^2.0.3",
|
|
41
37
|
"react": "^19.3.1",
|
|
42
38
|
"react-dom": "^19.3.1",
|
|
43
|
-
"react-i18next": "^17.1.13",
|
|
44
39
|
"react-icons": "^5.7.0",
|
|
45
40
|
"react-router": "^8.5.1"
|
|
46
41
|
},
|
|
@@ -50,13 +45,12 @@
|
|
|
50
45
|
"@types/react-dom": "^19.3.0",
|
|
51
46
|
"@vitejs/plugin-react": "^6.2.1",
|
|
52
47
|
"happy-dom": "^21.0.4",
|
|
53
|
-
"oxlint": "^1.
|
|
48
|
+
"oxlint": "^1.92.0",
|
|
54
49
|
"typescript": "^7.0.2",
|
|
55
50
|
"vite": "^8.3.6"
|
|
56
51
|
},
|
|
57
52
|
"peerDependencies": {
|
|
58
53
|
"@ant-design/pro-components": "*",
|
|
59
|
-
"@rainte/js": "*",
|
|
60
54
|
"antd": "*",
|
|
61
55
|
"react": "*",
|
|
62
56
|
"react-dom": "*",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { MessageInstance, JointContent } from 'antd/es/message/interface';
|
|
2
|
-
import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
3
|
-
import type { NotificationInstance } from 'antd/es/notification/interface';
|
|
4
|
-
import type { ModalFuncProps } from 'antd/es/modal/interface';
|
|
5
|
-
declare let message: MessageInstance;
|
|
6
|
-
declare let notification: NotificationInstance;
|
|
7
|
-
declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
8
|
-
declare const useDialog: () => null;
|
|
9
|
-
export default useDialog;
|
|
10
|
-
declare const popup: {
|
|
11
|
-
confirm: (props: ModalFuncProps) => {
|
|
12
|
-
destroy: () => void;
|
|
13
|
-
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
14
|
-
};
|
|
15
|
-
success: (content?: JointContent, duration?: number | VoidFunction) => import("antd/es/message/interface").MessageType;
|
|
16
|
-
error: (content?: string, duration?: number | VoidFunction) => never;
|
|
17
|
-
ask: (onOk: (...args: any[]) => any, props?: ModalFuncProps) => {
|
|
18
|
-
destroy: () => void;
|
|
19
|
-
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export { message, notification, modal, popup, useDialog };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function App(): import("react").JSX.Element;
|