@yuku123/z-meta-frontend-component 0.1.0
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 +25 -0
- package/dist/z-meta-frontend-component.es.js +291 -0
- package/dist/z-meta-frontend-component.umd.js +22 -0
- package/package.json +41 -0
- package/src/TenantTag.jsx +16 -0
- package/src/dev.jsx +12 -0
- package/src/index.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @yuku123/z-meta-frontend-component
|
|
2
|
+
|
|
3
|
+
> ��抽自 z-opc 对应 _frontend)
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @yuku123/z-meta-frontend-component
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
import { TenantTag } from '@yuku123/z-meta-frontend-component'
|
|
15
|
+
|
|
16
|
+
<TenantTag prop="value"/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 仓库
|
|
20
|
+
|
|
21
|
+
https://github.com/yuku123/z-opc-frontend/tree/main/packages/z-meta-frontend-component
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import K from "react";
|
|
2
|
+
import { Tag as ee } from "antd";
|
|
3
|
+
var b = { exports: {} }, _ = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var $;
|
|
14
|
+
function re() {
|
|
15
|
+
if ($) return _;
|
|
16
|
+
$ = 1;
|
|
17
|
+
var o = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
|
|
18
|
+
function i(f, s, l) {
|
|
19
|
+
var d = null;
|
|
20
|
+
if (l !== void 0 && (d = "" + l), s.key !== void 0 && (d = "" + s.key), "key" in s) {
|
|
21
|
+
l = {};
|
|
22
|
+
for (var m in s)
|
|
23
|
+
m !== "key" && (l[m] = s[m]);
|
|
24
|
+
} else l = s;
|
|
25
|
+
return s = l.ref, {
|
|
26
|
+
$$typeof: o,
|
|
27
|
+
type: f,
|
|
28
|
+
key: d,
|
|
29
|
+
ref: s !== void 0 ? s : null,
|
|
30
|
+
props: l
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return _.Fragment = u, _.jsx = i, _.jsxs = i, _;
|
|
34
|
+
}
|
|
35
|
+
var E = {};
|
|
36
|
+
/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.development.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
var I;
|
|
46
|
+
function te() {
|
|
47
|
+
return I || (I = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
48
|
+
function o(e) {
|
|
49
|
+
if (e == null) return null;
|
|
50
|
+
if (typeof e == "function")
|
|
51
|
+
return e.$$typeof === H ? null : e.displayName || e.name || null;
|
|
52
|
+
if (typeof e == "string") return e;
|
|
53
|
+
switch (e) {
|
|
54
|
+
case p:
|
|
55
|
+
return "Fragment";
|
|
56
|
+
case U:
|
|
57
|
+
return "Profiler";
|
|
58
|
+
case W:
|
|
59
|
+
return "StrictMode";
|
|
60
|
+
case z:
|
|
61
|
+
return "Suspense";
|
|
62
|
+
case G:
|
|
63
|
+
return "SuspenseList";
|
|
64
|
+
case B:
|
|
65
|
+
return "Activity";
|
|
66
|
+
}
|
|
67
|
+
if (typeof e == "object")
|
|
68
|
+
switch (typeof e.tag == "number" && console.error(
|
|
69
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
|
+
), e.$$typeof) {
|
|
71
|
+
case L:
|
|
72
|
+
return "Portal";
|
|
73
|
+
case J:
|
|
74
|
+
return e.displayName || "Context";
|
|
75
|
+
case q:
|
|
76
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
+
case V:
|
|
78
|
+
var r = e.render;
|
|
79
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
+
case X:
|
|
81
|
+
return r = e.displayName || null, r !== null ? r : o(e.type) || "Memo";
|
|
82
|
+
case T:
|
|
83
|
+
r = e._payload, e = e._init;
|
|
84
|
+
try {
|
|
85
|
+
return o(e(r));
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function u(e) {
|
|
92
|
+
return "" + e;
|
|
93
|
+
}
|
|
94
|
+
function i(e) {
|
|
95
|
+
try {
|
|
96
|
+
u(e);
|
|
97
|
+
var r = !1;
|
|
98
|
+
} catch {
|
|
99
|
+
r = !0;
|
|
100
|
+
}
|
|
101
|
+
if (r) {
|
|
102
|
+
r = console;
|
|
103
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
+
return t.call(
|
|
105
|
+
r,
|
|
106
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
+
n
|
|
108
|
+
), u(e);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function f(e) {
|
|
112
|
+
if (e === p) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === T)
|
|
114
|
+
return "<...>";
|
|
115
|
+
try {
|
|
116
|
+
var r = o(e);
|
|
117
|
+
return r ? "<" + r + ">" : "<...>";
|
|
118
|
+
} catch {
|
|
119
|
+
return "<...>";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function s() {
|
|
123
|
+
var e = k.A;
|
|
124
|
+
return e === null ? null : e.getOwner();
|
|
125
|
+
}
|
|
126
|
+
function l() {
|
|
127
|
+
return Error("react-stack-top-frame");
|
|
128
|
+
}
|
|
129
|
+
function d(e) {
|
|
130
|
+
if (y.call(e, "key")) {
|
|
131
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
|
+
if (r && r.isReactWarning) return !1;
|
|
133
|
+
}
|
|
134
|
+
return e.key !== void 0;
|
|
135
|
+
}
|
|
136
|
+
function m(e, r) {
|
|
137
|
+
function t() {
|
|
138
|
+
j || (j = !0, console.error(
|
|
139
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
+
r
|
|
141
|
+
));
|
|
142
|
+
}
|
|
143
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: t,
|
|
145
|
+
configurable: !0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function D() {
|
|
149
|
+
var e = o(this.type);
|
|
150
|
+
return h[e] || (h[e] = !0, console.error(
|
|
151
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
|
+
}
|
|
154
|
+
function M(e, r, t, n, v, A) {
|
|
155
|
+
var a = t.ref;
|
|
156
|
+
return e = {
|
|
157
|
+
$$typeof: x,
|
|
158
|
+
type: e,
|
|
159
|
+
key: r,
|
|
160
|
+
props: t,
|
|
161
|
+
_owner: n
|
|
162
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
get: D
|
|
165
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
|
+
configurable: !1,
|
|
167
|
+
enumerable: !1,
|
|
168
|
+
writable: !0,
|
|
169
|
+
value: 0
|
|
170
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
171
|
+
configurable: !1,
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
writable: !0,
|
|
174
|
+
value: null
|
|
175
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
176
|
+
configurable: !1,
|
|
177
|
+
enumerable: !1,
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: v
|
|
180
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: A
|
|
185
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
|
+
}
|
|
187
|
+
function P(e, r, t, n, v, A) {
|
|
188
|
+
var a = r.children;
|
|
189
|
+
if (a !== void 0)
|
|
190
|
+
if (n)
|
|
191
|
+
if (Z(a)) {
|
|
192
|
+
for (n = 0; n < a.length; n++)
|
|
193
|
+
g(a[n]);
|
|
194
|
+
Object.freeze && Object.freeze(a);
|
|
195
|
+
} else
|
|
196
|
+
console.error(
|
|
197
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
|
+
);
|
|
199
|
+
else g(a);
|
|
200
|
+
if (y.call(r, "key")) {
|
|
201
|
+
a = o(e);
|
|
202
|
+
var c = Object.keys(r).filter(function(Q) {
|
|
203
|
+
return Q !== "key";
|
|
204
|
+
});
|
|
205
|
+
n = 0 < c.length ? "{key: someKey, " + c.join(": ..., ") + ": ...}" : "{key: someKey}", Y[a + n] || (c = 0 < c.length ? "{" + c.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
207
|
+
let props = %s;
|
|
208
|
+
<%s {...props} />
|
|
209
|
+
React keys must be passed directly to JSX without using spread:
|
|
210
|
+
let props = %s;
|
|
211
|
+
<%s key={someKey} {...props} />`,
|
|
212
|
+
n,
|
|
213
|
+
a,
|
|
214
|
+
c,
|
|
215
|
+
a
|
|
216
|
+
), Y[a + n] = !0);
|
|
217
|
+
}
|
|
218
|
+
if (a = null, t !== void 0 && (i(t), a = "" + t), d(r) && (i(r.key), a = "" + r.key), "key" in r) {
|
|
219
|
+
t = {};
|
|
220
|
+
for (var S in r)
|
|
221
|
+
S !== "key" && (t[S] = r[S]);
|
|
222
|
+
} else t = r;
|
|
223
|
+
return a && m(
|
|
224
|
+
t,
|
|
225
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
+
), M(
|
|
227
|
+
e,
|
|
228
|
+
a,
|
|
229
|
+
t,
|
|
230
|
+
s(),
|
|
231
|
+
v,
|
|
232
|
+
A
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function g(e) {
|
|
236
|
+
w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
|
+
}
|
|
238
|
+
function w(e) {
|
|
239
|
+
return typeof e == "object" && e !== null && e.$$typeof === x;
|
|
240
|
+
}
|
|
241
|
+
var R = K, x = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), U = Symbol.for("react.profiler"), q = Symbol.for("react.consumer"), J = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), k = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, Z = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
242
|
+
return null;
|
|
243
|
+
};
|
|
244
|
+
R = {
|
|
245
|
+
react_stack_bottom_frame: function(e) {
|
|
246
|
+
return e();
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
var j, h = {}, N = R.react_stack_bottom_frame.bind(
|
|
250
|
+
R,
|
|
251
|
+
l
|
|
252
|
+
)(), C = O(f(l)), Y = {};
|
|
253
|
+
E.Fragment = p, E.jsx = function(e, r, t) {
|
|
254
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return P(
|
|
256
|
+
e,
|
|
257
|
+
r,
|
|
258
|
+
t,
|
|
259
|
+
!1,
|
|
260
|
+
n ? Error("react-stack-top-frame") : N,
|
|
261
|
+
n ? O(f(e)) : C
|
|
262
|
+
);
|
|
263
|
+
}, E.jsxs = function(e, r, t) {
|
|
264
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return P(
|
|
266
|
+
e,
|
|
267
|
+
r,
|
|
268
|
+
t,
|
|
269
|
+
!0,
|
|
270
|
+
n ? Error("react-stack-top-frame") : N,
|
|
271
|
+
n ? O(f(e)) : C
|
|
272
|
+
);
|
|
273
|
+
};
|
|
274
|
+
})()), E;
|
|
275
|
+
}
|
|
276
|
+
var F;
|
|
277
|
+
function ne() {
|
|
278
|
+
return F || (F = 1, process.env.NODE_ENV === "production" ? b.exports = re() : b.exports = te()), b.exports;
|
|
279
|
+
}
|
|
280
|
+
var ae = ne();
|
|
281
|
+
const oe = {
|
|
282
|
+
active: "green",
|
|
283
|
+
suspended: "orange",
|
|
284
|
+
deleted: "red"
|
|
285
|
+
};
|
|
286
|
+
function ue({ status: o = "active", tenantCode: u }) {
|
|
287
|
+
return /* @__PURE__ */ ae.jsx(ee, { color: oe[o] || "default", children: u ? `${u} · ${o}` : o });
|
|
288
|
+
}
|
|
289
|
+
export {
|
|
290
|
+
ue as TenantTag
|
|
291
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(function(l,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("antd")):typeof define=="function"&&define.amd?define(["exports","react","antd"],f):(l=typeof globalThis<"u"?globalThis:l||self,f(l.z_meta_frontend_component={},l.React,l.antd))})(this,(function(l,f,L){"use strict";var v={exports:{}},d={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var g;function W(){if(g)return d;g=1;var o=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function _(E,s,u){var p=null;if(u!==void 0&&(p=""+u),s.key!==void 0&&(p=""+s.key),"key"in s){u={};for(var R in s)R!=="key"&&(u[R]=s[R])}else u=s;return s=u.ref,{$$typeof:o,type:E,key:p,ref:s!==void 0?s:null,props:u}}return d.Fragment=c,d.jsx=_,d.jsxs=_,d}var m={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var j;function U(){return j||(j=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function c(e){return""+e}function _(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),c(e)}}function E(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=S.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function p(e){if(Y.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function t(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=o(this.type);return I[e]||(I[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function X(e,r,t,n,b,A){var a=t.ref;return e={$$typeof:C,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:b}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,r,t,n,b,A){var a=r.children;if(a!==void 0)if(n)if(se(a)){for(n=0;n<a.length;n++)w(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(a);if(Y.call(r,"key")){a=o(e);var i=Object.keys(r).filter(function(ue){return ue!=="key"});n=0<i.length?"{key: someKey, "+i.join(": ..., ")+": ...}":"{key: someKey}",M[a+n]||(i=0<i.length?"{"+i.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,a,i,a),M[a+n]=!0)}if(a=null,t!==void 0&&(_(t),a=""+t),p(r)&&(_(r.key),a=""+r.key),"key"in r){t={};for(var P in r)P!=="key"&&(t[P]=r[P])}else t=r;return a&&R(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),X(e,a,t,s(),b,A)}function w(e){N(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?N(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function N(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}var T=f,C=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),S=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,se=Array.isArray,y=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var $,I={},F=T.react_stack_bottom_frame.bind(T,u)(),D=y(E(u)),M={};m.Fragment=k,m.jsx=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return h(e,r,t,!1,n?Error("react-stack-top-frame"):F,n?y(E(e)):D)},m.jsxs=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return h(e,r,t,!0,n?Error("react-stack-top-frame"):F,n?y(E(e)):D)}})()),m}var x;function q(){return x||(x=1,process.env.NODE_ENV==="production"?v.exports=W():v.exports=U()),v.exports}var z=q();const J={active:"green",suspended:"orange",deleted:"red"};function V({status:o="active",tenantCode:c}){return z.jsx(L.Tag,{color:J[o]||"default",children:c?`${c} · ${o}`:o})}l.TenantTag=V,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuku123/z-meta-frontend-component",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "z-meta 模块共享前端组件(抽自 z-opc/z-meta/_frontend)",
|
|
6
|
+
"keywords": ["react", "antd", "meta", "z-opc"],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": { "name": "zifang", "email": "1340947819@qq.com" },
|
|
9
|
+
"homepage": "https://github.com/yuku123/z-opc-frontend/tree/main/packages/z-meta-frontend-component#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/yuku123/z-opc-frontend.git",
|
|
13
|
+
"directory": "packages/z-meta-frontend-component"
|
|
14
|
+
},
|
|
15
|
+
"bugs": { "url": "https://github.com/yuku123/z-opc-frontend/issues" },
|
|
16
|
+
"main": "./dist/z-meta-frontend-component.umd.js",
|
|
17
|
+
"module": "./dist/z-meta-frontend-component.es.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/z-meta-frontend-component.es.js",
|
|
22
|
+
"require": "./dist/z-meta-frontend-component.umd.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "src", "README.md"],
|
|
26
|
+
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite --port 3091",
|
|
29
|
+
"build": "vite build",
|
|
30
|
+
"preview": "vite preview"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^19.2.0",
|
|
34
|
+
"react-dom": "^19.2.0",
|
|
35
|
+
"antd": "^6.3.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
39
|
+
"vite": "^6.2.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Tag} from 'antd'
|
|
3
|
+
|
|
4
|
+
const colorMap = {
|
|
5
|
+
active: 'green',
|
|
6
|
+
suspended: 'orange',
|
|
7
|
+
deleted: 'red',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function TenantTag({status = 'active', tenantCode}) {
|
|
11
|
+
return (
|
|
12
|
+
<Tag color={colorMap[status] || 'default'}>
|
|
13
|
+
{tenantCode ? `${tenantCode} · ${status}` : status}
|
|
14
|
+
</Tag>
|
|
15
|
+
)
|
|
16
|
+
}
|
package/src/dev.jsx
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import TenantTag from './TenantTag'
|
|
4
|
+
|
|
5
|
+
const root = ReactDOM.createRoot(document.getElementById('root'))
|
|
6
|
+
root.render(
|
|
7
|
+
<div style={{padding: 40, display: 'flex', gap: 16}}>
|
|
8
|
+
<TenantTag status="active" tenantCode="T001"/>
|
|
9
|
+
<TenantTag status="suspended" tenantCode="T002"/>
|
|
10
|
+
<TenantTag status="deleted"/>
|
|
11
|
+
</div>
|
|
12
|
+
)
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as TenantTag} from './TenantTag'
|