x-runtime-lib 0.2.1 → 0.2.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.
- package/dist/element/_pkgs/index.d.ts +2 -0
- package/dist/element/_pkgs/v1/index.d.ts +3 -0
- package/dist/element/elements.d.ts +2 -0
- package/dist/element/index.d.ts +3 -3
- package/dist/element/types.d.ts +1 -0
- package/dist/element/utils.d.ts +4 -0
- package/dist/index.js +136 -38
- package/package.json +1 -1
package/dist/element/index.d.ts
CHANGED
package/dist/element/types.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { resolveComponent as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return
|
|
1
|
+
import { resolveComponent as b, openBlock as _, createBlock as p, nextTick as h } from "vue";
|
|
2
|
+
const $ = (e, o) => {
|
|
3
|
+
const n = e.__vccOpts || e;
|
|
4
|
+
for (const [r, t] of o)
|
|
5
|
+
n[r] = t;
|
|
6
|
+
return n;
|
|
7
|
+
}, w = {};
|
|
8
|
+
function x(e, o) {
|
|
9
|
+
const n = b("v-btn");
|
|
10
|
+
return _(), p(n);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
},
|
|
12
|
+
const M = /* @__PURE__ */ $(w, [["render", x]]), P = (e) => {
|
|
13
|
+
e.component("z-btn-v1", M);
|
|
14
|
+
}, C = [
|
|
15
15
|
{ title: "default", value: "default" },
|
|
16
16
|
{ title: "comfortable", value: "comfortable" },
|
|
17
17
|
{ title: "compact", value: "compact" }
|
|
18
|
-
],
|
|
18
|
+
], m = {
|
|
19
19
|
key: "settings",
|
|
20
20
|
keyFlag: !0,
|
|
21
21
|
name: "settings",
|
|
@@ -24,11 +24,11 @@ const v = /* @__PURE__ */ m(u, [["render", p]]), f = (t) => {
|
|
|
24
24
|
key: "density",
|
|
25
25
|
name: "density",
|
|
26
26
|
ui: "select",
|
|
27
|
-
items:
|
|
27
|
+
items: C,
|
|
28
28
|
default: "default"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
|
-
},
|
|
31
|
+
}, I = {
|
|
32
32
|
key: "btn_v1",
|
|
33
33
|
name: "button",
|
|
34
34
|
comp: "z-btn-v1",
|
|
@@ -41,39 +41,137 @@ const v = /* @__PURE__ */ m(u, [["render", p]]), f = (t) => {
|
|
|
41
41
|
],
|
|
42
42
|
methods: [],
|
|
43
43
|
props: {
|
|
44
|
-
pageCommon: [
|
|
45
|
-
compCommon: [
|
|
44
|
+
pageCommon: [m],
|
|
45
|
+
compCommon: [m]
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, d = {
|
|
48
|
+
// basic
|
|
49
|
+
btn_v1: I
|
|
50
|
+
}, E = /* @__PURE__ */ new Set([
|
|
51
|
+
"globality_v1",
|
|
52
|
+
"btn_v1",
|
|
53
|
+
"ref_v1"
|
|
54
|
+
]), K = [
|
|
48
55
|
{
|
|
49
56
|
key: "basic",
|
|
50
57
|
name: "basic",
|
|
51
58
|
items: ["globality_v1", "btn_v1"]
|
|
52
59
|
}
|
|
53
|
-
],
|
|
60
|
+
], N = {
|
|
54
61
|
version: "v1",
|
|
55
62
|
globalityKey: "globality_v1",
|
|
56
63
|
refKey: "ref_v1",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
elements: E,
|
|
65
|
+
groups: K
|
|
66
|
+
}, O = {
|
|
67
|
+
v1: N
|
|
68
|
+
}, g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
69
|
+
function z(e) {
|
|
70
|
+
let o = "";
|
|
71
|
+
for (let n = 0; n < e; n++) {
|
|
72
|
+
const r = Math.floor(Math.random() * g.length);
|
|
73
|
+
o += g[r];
|
|
74
|
+
}
|
|
75
|
+
return o;
|
|
76
|
+
}
|
|
77
|
+
function B(e, o) {
|
|
78
|
+
if (e === "page") {
|
|
79
|
+
if (o == "common")
|
|
80
|
+
return "pageCommon";
|
|
81
|
+
} else if (e === "comp" && o === "common")
|
|
82
|
+
return "compCommon";
|
|
83
|
+
}
|
|
84
|
+
function y(e) {
|
|
85
|
+
return JSON.parse(JSON.stringify(e));
|
|
86
|
+
}
|
|
87
|
+
function v(e) {
|
|
88
|
+
if (e.array)
|
|
89
|
+
return e.default instanceof Array ? y(e.default) : [];
|
|
90
|
+
switch (e.ui) {
|
|
91
|
+
case "void":
|
|
92
|
+
return e.default !== void 0 ? y(e.default) : null;
|
|
93
|
+
case "strInput":
|
|
94
|
+
return typeof e.default == "string" ? e.default : "";
|
|
95
|
+
case "numInput":
|
|
96
|
+
return typeof e.default == "number" ? e.default : 0;
|
|
97
|
+
default:
|
|
98
|
+
console.assert(!1, `not implemented ui=${e.ui}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function k(e, o) {
|
|
102
|
+
function n(r, t) {
|
|
103
|
+
t.static || (t.children ? t.array ? r[t.key] = v(t) : t.children.forEach((s) => {
|
|
104
|
+
t.keyFlag ? n(r, s) : (r[t.key] = {}, n(r[t.key], s));
|
|
105
|
+
}) : r[t.key] = v(t));
|
|
106
|
+
}
|
|
107
|
+
o.forEach((r) => n(e, r));
|
|
108
|
+
}
|
|
109
|
+
function q(e, o, n, r, t) {
|
|
110
|
+
const s = B(e, o);
|
|
111
|
+
if (!s) {
|
|
112
|
+
console.error("invalid prop tag");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const a = O[n];
|
|
116
|
+
if (!a) {
|
|
117
|
+
console.error(`pkg not found version=${n}`);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const c = {}, f = z(16);
|
|
121
|
+
if (r) {
|
|
122
|
+
const l = a.refKey;
|
|
123
|
+
if (!a.elements.has(l)) {
|
|
124
|
+
console.error(`[ref] element not found in pkg key=${t}`);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const i = d[l];
|
|
128
|
+
if (!i) {
|
|
129
|
+
console.error(`[ref] element not found in global key=${t}`);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const u = i.props[s];
|
|
133
|
+
if (!u) {
|
|
134
|
+
console.error(`[ref] props not found key=${t} tag=${s}`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
k(c, u), c.id = f, c.ref = {
|
|
138
|
+
id: t
|
|
139
|
+
};
|
|
140
|
+
} else {
|
|
141
|
+
if (!a.elements.has(t)) {
|
|
142
|
+
console.error(`[key] element not found in pkg key=${t}`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const l = d[t];
|
|
146
|
+
if (!l) {
|
|
147
|
+
console.error(`[key] element not found in global key=${t}`);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const i = l.props[s];
|
|
151
|
+
if (!i) {
|
|
152
|
+
console.error(`[key] props not found key=${t} tag=${s}`);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
k(c, i), c.id = f, c.key = t, l.leaf || (c.children = []);
|
|
156
|
+
}
|
|
157
|
+
return c;
|
|
158
|
+
}
|
|
159
|
+
const S = (e, o) => {
|
|
160
|
+
const n = e[o];
|
|
161
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, t) => {
|
|
162
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(t.bind(null, new Error("Unknown variable dynamic import: " + o)));
|
|
67
163
|
});
|
|
68
164
|
};
|
|
69
|
-
async function
|
|
70
|
-
const
|
|
71
|
-
return
|
|
165
|
+
async function D(e, o) {
|
|
166
|
+
const n = await S(/* @__PURE__ */ Object.assign({ "./locales/en.ts": () => import("./en-DKTWxIj4.js"), "./locales/zhHans.ts": () => import("./zhHans-QtZriYRu.js") }), `./locales/${o}.ts`);
|
|
167
|
+
return e.global.setLocaleMessage(o, n.default), h();
|
|
72
168
|
}
|
|
73
|
-
const
|
|
169
|
+
const F = { install: P };
|
|
74
170
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
171
|
+
F as default,
|
|
172
|
+
d as elements,
|
|
173
|
+
B as getPropTag,
|
|
174
|
+
D as loadLocaleMessageElement,
|
|
175
|
+
O as pkgs,
|
|
176
|
+
q as spawnNode
|
|
79
177
|
};
|