@pubinfo-pr/module-crypto 0.188.1 → 0.189.2

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,2 @@
1
+ import { t as drawerCryptoUrl_default } from "./drawerCryptoUrl-DiezF2QX.js";
2
+ export { drawerCryptoUrl_default as default };
@@ -0,0 +1,109 @@
1
+ import { Button, Drawer, Form, FormItem, Input, Space, Textarea } from "ant-design-vue/es";
2
+ import { createBlock, createTextVNode, createVNode, defineComponent, isRef, onMounted, openBlock, reactive, ref, shallowRef, toValue, unref, withCtx } from "vue";
3
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4
+ /* @__NO_SIDE_EFFECTS__ */
5
+ function useToggle(e = !1, c = {}) {
6
+ let { truthyValue: l = !0, falsyValue: u = !1 } = c, d = isRef(e), f = shallowRef(e);
7
+ function p(e) {
8
+ if (arguments.length) return f.value = e, f.value;
9
+ {
10
+ let e = toValue(l);
11
+ return f.value = f.value === e ? toValue(u) : e, f.value;
12
+ }
13
+ }
14
+ return d ? p : [f, p];
15
+ }
16
+ var drawerCryptoUrl_default = /* @__PURE__ */ defineComponent({
17
+ name: "DrawerCryptoUrl",
18
+ __name: "drawerCryptoUrl",
19
+ emits: ["submit"],
20
+ setup(m, { expose: h, emit: g }) {
21
+ let v = g, y = { url: [{
22
+ required: !0,
23
+ validator: O,
24
+ trigger: ["blur", "change"]
25
+ }] }, [x, S] = /* @__PURE__ */ useToggle(!1), C = ref(), w = ref({}), T = ref(!1), E = ref([]), D = ref(0);
26
+ function O(e, c, l) {
27
+ c ? /^\/(?!.*\*{3})(?:[\w-]+|:\w+|\*{1,2})(?:\/(?:[\w-]+|:\w+|\*{1,2}))*$/.test(c) ? l() : l(/* @__PURE__ */ Error("url格式不正确")) : l(/* @__PURE__ */ Error("请输入url"));
28
+ }
29
+ async function k(e, c, l) {
30
+ S(!0), E.value = c || [], D.value = l || 0, e ? (T.value = !0, w.value = { ...c?.[l || 0] }) : (T.value = !1, w.value = {});
31
+ }
32
+ let [A, j] = /* @__PURE__ */ useToggle(!1);
33
+ function M() {
34
+ C.value?.validate().then(() => {
35
+ j(!0);
36
+ let e = { ...w.value };
37
+ T.value ? E.value[D.value] = e : E.value.push(e), j(!1), N(), v("submit", E.value);
38
+ });
39
+ }
40
+ function N() {
41
+ S(!1);
42
+ }
43
+ return h({ open: k }), (m, h) => {
44
+ let g = Input, _ = FormItem, v = Textarea, b = Form, S = Button, T = Space, E = Drawer;
45
+ return openBlock(), createBlock(E, {
46
+ open: unref(x),
47
+ "onUpdate:open": h[3] ||= (e) => isRef(x) ? x.value = e : null,
48
+ title: "url信息",
49
+ placement: "right",
50
+ width: 600,
51
+ "destroy-on-close": "",
52
+ "footer-style": { textAlign: "right" },
53
+ onClose: N
54
+ }, {
55
+ footer: withCtx(() => [createVNode(T, null, {
56
+ default: withCtx(() => [createVNode(S, { onClick: N }, {
57
+ default: withCtx(() => h[4] ||= [createTextVNode(" 取消 ")]),
58
+ _: 1,
59
+ __: [4]
60
+ }), createVNode(S, {
61
+ type: "primary",
62
+ loading: unref(A),
63
+ onClick: h[2] ||= (e) => M()
64
+ }, {
65
+ default: withCtx(() => h[5] ||= [createTextVNode(" 提交 ")]),
66
+ _: 1,
67
+ __: [5]
68
+ }, 8, ["loading"])]),
69
+ _: 1
70
+ })]),
71
+ default: withCtx(() => [createVNode(b, {
72
+ ref_key: "formRef",
73
+ ref: C,
74
+ model: unref(w),
75
+ rules: y,
76
+ "label-col": { style: { width: "90px" } }
77
+ }, {
78
+ default: withCtx(() => [createVNode(_, {
79
+ label: "url地址",
80
+ name: "url",
81
+ tooltip: "支持url通配符,示例:/api/v1/user/*,/api/login/**"
82
+ }, {
83
+ default: withCtx(() => [createVNode(g, {
84
+ value: unref(w).url,
85
+ "onUpdate:value": h[0] ||= (e) => unref(w).url = e,
86
+ maxlength: 200
87
+ }, null, 8, ["value"])]),
88
+ _: 1
89
+ }), createVNode(_, {
90
+ label: "描述",
91
+ name: "description"
92
+ }, {
93
+ default: withCtx(() => [createVNode(v, {
94
+ value: unref(w).description,
95
+ "onUpdate:value": h[1] ||= (e) => unref(w).description = e,
96
+ rows: 3,
97
+ "show-count": "",
98
+ maxlength: 200
99
+ }, null, 8, ["value"])]),
100
+ _: 1
101
+ })]),
102
+ _: 1
103
+ }, 8, ["model"])]),
104
+ _: 1
105
+ }, 8, ["open"]);
106
+ };
107
+ }
108
+ });
109
+ export { useToggle as n, drawerCryptoUrl_default as t };