btxui 1.0.9 → 1.0.11

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 CHANGED
@@ -1,14 +1,1482 @@
1
- const styles = /* @__PURE__ */ Object.assign({ "./src/components/core/styles/index.vue": () => import("./index-3f640b42.js") });
2
- const bView = /* @__PURE__ */ Object.assign({ "./src/components/core/b-view.vue": () => import("./b-view-fa2f9966.js") });
3
- const bText = /* @__PURE__ */ Object.assign({ "./src/components/core/b-text.vue": () => import("./b-text-306818aa.js") });
4
- const initGlobalComponents = { ...styles, ...bView, ...bText };
1
+ import { defineComponent, ref, computed, reactive, onMounted, renderSlot, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle, withModifiers, watch, createVNode, resolveComponent, createElementBlock, Fragment, createCommentVNode, withDirectives, vModelDynamic, vModelText } from "vue";
2
+ function _mergeNamespaces(n, m) {
3
+ for (var i = 0; i < m.length; i++) {
4
+ const e = m[i];
5
+ if (typeof e !== "string" && !Array.isArray(e)) {
6
+ for (const k in e) {
7
+ if (k !== "default" && !(k in n)) {
8
+ const d = Object.getOwnPropertyDescriptor(e, k);
9
+ if (d) {
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: () => e[k]
13
+ });
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
20
+ }
21
+ const prestyles = {
22
+ //预置样式-----------------------------------------------------------------------------------
23
+ // 文字加粗
24
+ "bold": `font-weight: bold;`,
25
+ // 隐藏显示
26
+ "show": `display: block;`,
27
+ "hide": `display: none;`,
28
+ // 布局
29
+ "wrap": `flex-wrap: wrap;`,
30
+ "flex": `display: flex; justify-content: flex-start; align-items: stretch;`,
31
+ "flex-column": `display: flex; flex-direction: column;`,
32
+ "flex-between": `display: flex; justify-content: space-between; align-items: center;`,
33
+ "flex-around": `display: flex; justify-content: space-around; align-items: center;`,
34
+ "grid": `display: flex; flex-wrap: wrap; align-content: flex-start;`,
35
+ // 布局 - 九宫格
36
+ "flex-1": `display: flex; justify-content: flex-start; align-items: flex-start;`,
37
+ "flex-2": `display: flex; justify-content: center; align-items: flex-start;`,
38
+ "flex-3": `display: flex; justify-content: flex-end; align-items: flex-start;`,
39
+ "flex-4": `display: flex; justify-content: flex-start; align-items: center`,
40
+ "flex-5": `display: flex; justify-content: center; align-items: center;`,
41
+ "flex-6": `display: flex; justify-content: flex-end; align-items: center;`,
42
+ "flex-7": `display: flex; justify-content: flex-start; align-items: flex-end;`,
43
+ "flex-8": `display: flex; justify-content: center; align-items: flex-end;`,
44
+ "flex-9": `display: flex; justify-content: flex-end; align-items: flex-end;`,
45
+ // 布局 - 尺寸
46
+ "max-h": `height: 100%;`,
47
+ "max-w": `width: 100%;`,
48
+ "max": `height: 100%; width: 100%;`,
49
+ "max-fixed": `height: 100%; width: 100%; position: fixed; left: 0; top: 0;`,
50
+ "max-screen": `height: 100vh; width: 100%;`,
51
+ "item": {
52
+ breakInside: "avoid",
53
+ mozPageBreakInside: "avoid",
54
+ webkitColumnBreakInside: "avoid"
55
+ },
56
+ // 定位
57
+ "fixed": `position: fixed;`,
58
+ "rel": `position: relative;`,
59
+ "abs": `position: absolute;`,
60
+ // 溢出处理
61
+ "over-hide": `overflow: hidden;`,
62
+ "over-show": `overflow: visible;`,
63
+ "over-scroll": `overflow: auto;`,
64
+ // 背景 - 重复
65
+ "bg-repeat": `background-repeat: repeat;`,
66
+ "bg-repeat-x": `background-repeat: repeat-x;`,
67
+ "bg-repeat-y": `background-repeat: repeat-y;`,
68
+ // 背景 - 尺寸
69
+ "bg-size-cover": `background-size: cover;`,
70
+ "bg-size-contain": `background-size: contain;`,
71
+ "bg-size-max": `background-size: 100% 100%;`,
72
+ "bg-size-max-h": `background-size: auto 100%;`,
73
+ "bg-size-max-w": `background-size: 100% auto;`,
74
+ // 背景 - 布局 - 九宫格
75
+ "bg-pos-1": `background-position: left top;`,
76
+ "bg-pos-2": `background-position: center top;`,
77
+ "bg-pos-3": `background-position: right top;`,
78
+ "bg-pos-4": `background-position: left center;`,
79
+ "bg-pos-5": `background-position: center center;`,
80
+ "bg-pos-6": `background-position: right center;`,
81
+ "bg-pos-7": `background-position: left bottom;`,
82
+ "bg-pos-8": `background-position: center bottom;`,
83
+ "bg-pos-9": `background-position: right bottom;`,
84
+ // 圆角
85
+ "round": `border-radius: 50%;`,
86
+ "round-lg": `borderRadius: 24px;`,
87
+ "round-md": `border-radius: 10px;`,
88
+ "round-sm": `border-radius: 4px;`,
89
+ "round-t": `border-bottom-right-radius: 0; border-bottom-left-radius: 0;`,
90
+ "round-b": `border-top-right-radius: 0; border-top-left-radius: 0;`,
91
+ "round-l": `border-top-right-radius: 0; border-bottom-right-radius: 0;`,
92
+ "round-r": `border-top-left-radius: 0; border-bottom-left-radius: 0;`,
93
+ // 描边
94
+ "solid": `border-style: solid;`,
95
+ "dashed": `border-style: dashed;`,
96
+ "solid-l": `border-left-style: solid;`,
97
+ "solid-r": `border-right-style: solid;`,
98
+ "solid-t": `border-top-style: solid;`,
99
+ "solid-b": `border-bottom-style: solid;`,
100
+ "dashed-l": `border-left-style: dashed;`,
101
+ "dashed-r": `border-right-style: dashed;`,
102
+ "dashed-t": `border-top-style: dashed;`,
103
+ "dashed-b": `border-bottom-style: dashed;`,
104
+ "line-outside": `background-clip: padding-box;`,
105
+ // 阴影
106
+ "shadow": `box-shadow: 0 4px 17px;`,
107
+ "shadow-sm": `box-shadow: 0 2px 4px;`,
108
+ "shadow-lg": `box-shadow: 0 14px 40px;`,
109
+ "shadow-relief": `box-shadow: 1px 1px 0 rgba(0,0,0,.7) inset, 1px 1px 0 rgba(255,255,255,.4);`,
110
+ // 过渡动画
111
+ "trans": `transition: all .7s;`,
112
+ "trans-fast": `transition: all .4s;`,
113
+ "trans-slow": `transition: all 1.4s;`,
114
+ "trans-no": `transition: none;`,
115
+ // 模糊滤镜
116
+ "blur-no": `filter: blur(0px);`,
117
+ "blur-sm": `filter: blur(2px);`,
118
+ "blur-md": `filter: blur(7px);`,
119
+ "blur-lg": `filter: blur(17px);`,
120
+ // 明度滤镜
121
+ "dark-no": `filter: brightness(100%);`,
122
+ "dark-sm": `filter: brightness(80%);`,
123
+ "dark-md": `filter: brightness(50%);`,
124
+ "dark-lg": `filter: brightness(20%);`,
125
+ // 纯度滤镜
126
+ "gray-no": `filter: grayscale(0%);`,
127
+ "gray-sm": `filter: grayscale(40%);`,
128
+ "gray-md": `filter: grayscale(70%);`,
129
+ "gray-lg": `filter: grayscale(100%);`,
130
+ // 特殊
131
+ "bg-none": `pointerEvents: none;`,
132
+ "bg-use": `pointerEvents: auto;`,
133
+ "touch-none": `touchAction: none;`,
134
+ "ellipsis": `overflow: hidden; text-overflow: ellipsis; white-space: nowrap;`,
135
+ "text-line": `textShadow: 1px 0 0 rgba(200, 200, 200, .5), -1px 0 0 rgba(200, 200, 200, .5), 0 1px 0 rgba(200, 200, 200, .5), 0 -1px 0 rgba(200, 200, 200, .5);`,
136
+ "alpha-0": `opacity: 0; visibility: hidden;`,
137
+ // 图像布局
138
+ "objfit-fill": `object-fit: fill;`,
139
+ "objfit-cover": `object-fit: cover;`,
140
+ "objfit-contain": `object-fit: contain;`,
141
+ "objfit-none": `object-fit: none;`,
142
+ "objfit-scaledown": `object-fit: scale-down;`,
143
+ // 二段赋值-----------------------------------------------------------------------------------
144
+ // 文本对齐
145
+ "p": {
146
+ pro: "text-align"
147
+ },
148
+ // 文字颜色
149
+ "color": {
150
+ pro: "color"
151
+ },
152
+ // 背景色
153
+ "bg": {
154
+ pro: "background"
155
+ },
156
+ // 不透明度
157
+ "alpha": {
158
+ pro: "opacity"
159
+ },
160
+ // 字体
161
+ "font": {
162
+ pro: "font-family"
163
+ },
164
+ // 行高
165
+ "lh": {
166
+ pro: "line-height"
167
+ },
168
+ // z 轴层级
169
+ "z": {
170
+ pro: "z-index"
171
+ },
172
+ // 描边颜色
173
+ "line": {
174
+ pro: "border-color"
175
+ },
176
+ // 变形中心点
177
+ "origin": {
178
+ pro: "transform-origin"
179
+ },
180
+ // 弹性布局项目排序
181
+ "order": {
182
+ pro: "order"
183
+ },
184
+ // 自生长比率
185
+ "grow": {
186
+ pro: "flex-grow"
187
+ },
188
+ // 自收缩比率
189
+ "basis": {
190
+ pro: "flex-basis"
191
+ },
192
+ // 字符间距
193
+ "lspace": {
194
+ pro: "letter-spacing",
195
+ unit: "rem"
196
+ },
197
+ // 宽度
198
+ "w": {
199
+ pro: "width",
200
+ unit: "rem"
201
+ },
202
+ // 高度
203
+ "h": {
204
+ pro: "height",
205
+ unit: "rem"
206
+ },
207
+ // 最大宽
208
+ "rw": {
209
+ pro: "max-width",
210
+ unit: "rem"
211
+ },
212
+ // 最小宽
213
+ "lw": {
214
+ pro: "min-width",
215
+ unit: "rem"
216
+ },
217
+ // 最大高
218
+ "th": {
219
+ pro: "max-height",
220
+ unit: "rem"
221
+ },
222
+ // 最小高
223
+ "bh": {
224
+ pro: "min-height",
225
+ unit: "rem"
226
+ },
227
+ // 内边距
228
+ "pad": {
229
+ pro: "padding",
230
+ unit: "rem"
231
+ },
232
+ // 外边距
233
+ "mrg": {
234
+ pro: "margin",
235
+ unit: "rem"
236
+ },
237
+ // 字号
238
+ "fsize": {
239
+ pro: "font-size",
240
+ unit: "rem"
241
+ },
242
+ // 水平基准左侧位移
243
+ "l": {
244
+ pro: "left",
245
+ unit: "rem"
246
+ },
247
+ // 水平基准右侧位移
248
+ "r": {
249
+ pro: "right",
250
+ unit: "rem"
251
+ },
252
+ // 垂直基准上侧位移
253
+ "t": {
254
+ pro: "top",
255
+ unit: "rem"
256
+ },
257
+ // 垂直基准下侧位移
258
+ "b": {
259
+ pro: "bottom",
260
+ unit: "rem"
261
+ },
262
+ // 描边粗细
263
+ "thick": {
264
+ pro: "border-width",
265
+ unit: "px"
266
+ },
267
+ // 过渡动画延迟
268
+ "delay": {
269
+ pro: "transition-delay",
270
+ unit: "s"
271
+ },
272
+ "rule_2": {
273
+ //多列布局容器
274
+ "column": {
275
+ pro: "columnCount",
276
+ extra: {
277
+ columnGap: 0
278
+ }
279
+ }
280
+ },
281
+ //三段赋值-----------------------------------------------------------------------------------
282
+ "rule_3": {
283
+ //背景颜色
284
+ "gradient": {
285
+ pro: ["Image"],
286
+ tmp: "-webkit-linear-gradient(%{}%)"
287
+ }
288
+ }
289
+ };
290
+ const theme = {
291
+ // 预置主题色
292
+ colors: {
293
+ none: "transparent",
294
+ main: "#051c24",
295
+ sub: "#b4967a",
296
+ light: "#fff",
297
+ lgray: "#eee",
298
+ mgray: "#a7a7a7",
299
+ dgray: "#373737",
300
+ dark: "#111",
301
+ blue: "#4085f3",
302
+ green: "#02b9a1",
303
+ yellow: "#fdba00",
304
+ red: "#ec4334",
305
+ neutral: "rgba(134,134,134,.17)"
306
+ },
307
+ // 追加或覆盖主题色
308
+ append(colors) {
309
+ this.colors = { ...this.colors, ...colors };
310
+ }
311
+ };
312
+ function getDefaultExportFromCjs(x) {
313
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
314
+ }
315
+ var md5$2 = { exports: {} };
316
+ var crypt = { exports: {} };
317
+ (function() {
318
+ var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", crypt$1 = {
319
+ // Bit-wise rotation left
320
+ rotl: function(n, b) {
321
+ return n << b | n >>> 32 - b;
322
+ },
323
+ // Bit-wise rotation right
324
+ rotr: function(n, b) {
325
+ return n << 32 - b | n >>> b;
326
+ },
327
+ // Swap big-endian to little-endian and vice versa
328
+ endian: function(n) {
329
+ if (n.constructor == Number) {
330
+ return crypt$1.rotl(n, 8) & 16711935 | crypt$1.rotl(n, 24) & 4278255360;
331
+ }
332
+ for (var i = 0; i < n.length; i++)
333
+ n[i] = crypt$1.endian(n[i]);
334
+ return n;
335
+ },
336
+ // Generate an array of any length of random bytes
337
+ randomBytes: function(n) {
338
+ for (var bytes = []; n > 0; n--)
339
+ bytes.push(Math.floor(Math.random() * 256));
340
+ return bytes;
341
+ },
342
+ // Convert a byte array to big-endian 32-bit words
343
+ bytesToWords: function(bytes) {
344
+ for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
345
+ words[b >>> 5] |= bytes[i] << 24 - b % 32;
346
+ return words;
347
+ },
348
+ // Convert big-endian 32-bit words to a byte array
349
+ wordsToBytes: function(words) {
350
+ for (var bytes = [], b = 0; b < words.length * 32; b += 8)
351
+ bytes.push(words[b >>> 5] >>> 24 - b % 32 & 255);
352
+ return bytes;
353
+ },
354
+ // Convert a byte array to a hex string
355
+ bytesToHex: function(bytes) {
356
+ for (var hex = [], i = 0; i < bytes.length; i++) {
357
+ hex.push((bytes[i] >>> 4).toString(16));
358
+ hex.push((bytes[i] & 15).toString(16));
359
+ }
360
+ return hex.join("");
361
+ },
362
+ // Convert a hex string to a byte array
363
+ hexToBytes: function(hex) {
364
+ for (var bytes = [], c = 0; c < hex.length; c += 2)
365
+ bytes.push(parseInt(hex.substr(c, 2), 16));
366
+ return bytes;
367
+ },
368
+ // Convert a byte array to a base-64 string
369
+ bytesToBase64: function(bytes) {
370
+ for (var base64 = [], i = 0; i < bytes.length; i += 3) {
371
+ var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];
372
+ for (var j = 0; j < 4; j++)
373
+ if (i * 8 + j * 6 <= bytes.length * 8)
374
+ base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 63));
375
+ else
376
+ base64.push("=");
377
+ }
378
+ return base64.join("");
379
+ },
380
+ // Convert a base-64 string to a byte array
381
+ base64ToBytes: function(base64) {
382
+ base64 = base64.replace(/[^A-Z0-9+\/]/ig, "");
383
+ for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {
384
+ if (imod4 == 0)
385
+ continue;
386
+ bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2);
387
+ }
388
+ return bytes;
389
+ }
390
+ };
391
+ crypt.exports = crypt$1;
392
+ })();
393
+ var cryptExports = crypt.exports;
394
+ var charenc = {
395
+ // UTF-8 encoding
396
+ utf8: {
397
+ // Convert a string to a byte array
398
+ stringToBytes: function(str) {
399
+ return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
400
+ },
401
+ // Convert a byte array to a string
402
+ bytesToString: function(bytes) {
403
+ return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
404
+ }
405
+ },
406
+ // Binary encoding
407
+ bin: {
408
+ // Convert a string to a byte array
409
+ stringToBytes: function(str) {
410
+ for (var bytes = [], i = 0; i < str.length; i++)
411
+ bytes.push(str.charCodeAt(i) & 255);
412
+ return bytes;
413
+ },
414
+ // Convert a byte array to a string
415
+ bytesToString: function(bytes) {
416
+ for (var str = [], i = 0; i < bytes.length; i++)
417
+ str.push(String.fromCharCode(bytes[i]));
418
+ return str.join("");
419
+ }
420
+ }
421
+ };
422
+ var charenc_1 = charenc;
423
+ /*!
424
+ * Determine if an object is a Buffer
425
+ *
426
+ * @author Feross Aboukhadijeh <https://feross.org>
427
+ * @license MIT
428
+ */
429
+ var isBuffer_1 = function(obj) {
430
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
431
+ };
432
+ function isBuffer(obj) {
433
+ return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
434
+ }
435
+ function isSlowBuffer(obj) {
436
+ return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0));
437
+ }
438
+ (function() {
439
+ var crypt2 = cryptExports, utf8 = charenc_1.utf8, isBuffer2 = isBuffer_1, bin = charenc_1.bin, md52 = function(message, options) {
440
+ if (message.constructor == String)
441
+ if (options && options.encoding === "binary")
442
+ message = bin.stringToBytes(message);
443
+ else
444
+ message = utf8.stringToBytes(message);
445
+ else if (isBuffer2(message))
446
+ message = Array.prototype.slice.call(message, 0);
447
+ else if (!Array.isArray(message) && message.constructor !== Uint8Array)
448
+ message = message.toString();
449
+ var m = crypt2.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878;
450
+ for (var i = 0; i < m.length; i++) {
451
+ m[i] = (m[i] << 8 | m[i] >>> 24) & 16711935 | (m[i] << 24 | m[i] >>> 8) & 4278255360;
452
+ }
453
+ m[l >>> 5] |= 128 << l % 32;
454
+ m[(l + 64 >>> 9 << 4) + 14] = l;
455
+ var FF = md52._ff, GG = md52._gg, HH = md52._hh, II = md52._ii;
456
+ for (var i = 0; i < m.length; i += 16) {
457
+ var aa = a, bb = b, cc = c, dd = d;
458
+ a = FF(a, b, c, d, m[i + 0], 7, -680876936);
459
+ d = FF(d, a, b, c, m[i + 1], 12, -389564586);
460
+ c = FF(c, d, a, b, m[i + 2], 17, 606105819);
461
+ b = FF(b, c, d, a, m[i + 3], 22, -1044525330);
462
+ a = FF(a, b, c, d, m[i + 4], 7, -176418897);
463
+ d = FF(d, a, b, c, m[i + 5], 12, 1200080426);
464
+ c = FF(c, d, a, b, m[i + 6], 17, -1473231341);
465
+ b = FF(b, c, d, a, m[i + 7], 22, -45705983);
466
+ a = FF(a, b, c, d, m[i + 8], 7, 1770035416);
467
+ d = FF(d, a, b, c, m[i + 9], 12, -1958414417);
468
+ c = FF(c, d, a, b, m[i + 10], 17, -42063);
469
+ b = FF(b, c, d, a, m[i + 11], 22, -1990404162);
470
+ a = FF(a, b, c, d, m[i + 12], 7, 1804603682);
471
+ d = FF(d, a, b, c, m[i + 13], 12, -40341101);
472
+ c = FF(c, d, a, b, m[i + 14], 17, -1502002290);
473
+ b = FF(b, c, d, a, m[i + 15], 22, 1236535329);
474
+ a = GG(a, b, c, d, m[i + 1], 5, -165796510);
475
+ d = GG(d, a, b, c, m[i + 6], 9, -1069501632);
476
+ c = GG(c, d, a, b, m[i + 11], 14, 643717713);
477
+ b = GG(b, c, d, a, m[i + 0], 20, -373897302);
478
+ a = GG(a, b, c, d, m[i + 5], 5, -701558691);
479
+ d = GG(d, a, b, c, m[i + 10], 9, 38016083);
480
+ c = GG(c, d, a, b, m[i + 15], 14, -660478335);
481
+ b = GG(b, c, d, a, m[i + 4], 20, -405537848);
482
+ a = GG(a, b, c, d, m[i + 9], 5, 568446438);
483
+ d = GG(d, a, b, c, m[i + 14], 9, -1019803690);
484
+ c = GG(c, d, a, b, m[i + 3], 14, -187363961);
485
+ b = GG(b, c, d, a, m[i + 8], 20, 1163531501);
486
+ a = GG(a, b, c, d, m[i + 13], 5, -1444681467);
487
+ d = GG(d, a, b, c, m[i + 2], 9, -51403784);
488
+ c = GG(c, d, a, b, m[i + 7], 14, 1735328473);
489
+ b = GG(b, c, d, a, m[i + 12], 20, -1926607734);
490
+ a = HH(a, b, c, d, m[i + 5], 4, -378558);
491
+ d = HH(d, a, b, c, m[i + 8], 11, -2022574463);
492
+ c = HH(c, d, a, b, m[i + 11], 16, 1839030562);
493
+ b = HH(b, c, d, a, m[i + 14], 23, -35309556);
494
+ a = HH(a, b, c, d, m[i + 1], 4, -1530992060);
495
+ d = HH(d, a, b, c, m[i + 4], 11, 1272893353);
496
+ c = HH(c, d, a, b, m[i + 7], 16, -155497632);
497
+ b = HH(b, c, d, a, m[i + 10], 23, -1094730640);
498
+ a = HH(a, b, c, d, m[i + 13], 4, 681279174);
499
+ d = HH(d, a, b, c, m[i + 0], 11, -358537222);
500
+ c = HH(c, d, a, b, m[i + 3], 16, -722521979);
501
+ b = HH(b, c, d, a, m[i + 6], 23, 76029189);
502
+ a = HH(a, b, c, d, m[i + 9], 4, -640364487);
503
+ d = HH(d, a, b, c, m[i + 12], 11, -421815835);
504
+ c = HH(c, d, a, b, m[i + 15], 16, 530742520);
505
+ b = HH(b, c, d, a, m[i + 2], 23, -995338651);
506
+ a = II(a, b, c, d, m[i + 0], 6, -198630844);
507
+ d = II(d, a, b, c, m[i + 7], 10, 1126891415);
508
+ c = II(c, d, a, b, m[i + 14], 15, -1416354905);
509
+ b = II(b, c, d, a, m[i + 5], 21, -57434055);
510
+ a = II(a, b, c, d, m[i + 12], 6, 1700485571);
511
+ d = II(d, a, b, c, m[i + 3], 10, -1894986606);
512
+ c = II(c, d, a, b, m[i + 10], 15, -1051523);
513
+ b = II(b, c, d, a, m[i + 1], 21, -2054922799);
514
+ a = II(a, b, c, d, m[i + 8], 6, 1873313359);
515
+ d = II(d, a, b, c, m[i + 15], 10, -30611744);
516
+ c = II(c, d, a, b, m[i + 6], 15, -1560198380);
517
+ b = II(b, c, d, a, m[i + 13], 21, 1309151649);
518
+ a = II(a, b, c, d, m[i + 4], 6, -145523070);
519
+ d = II(d, a, b, c, m[i + 11], 10, -1120210379);
520
+ c = II(c, d, a, b, m[i + 2], 15, 718787259);
521
+ b = II(b, c, d, a, m[i + 9], 21, -343485551);
522
+ a = a + aa >>> 0;
523
+ b = b + bb >>> 0;
524
+ c = c + cc >>> 0;
525
+ d = d + dd >>> 0;
526
+ }
527
+ return crypt2.endian([a, b, c, d]);
528
+ };
529
+ md52._ff = function(a, b, c, d, x, s, t) {
530
+ var n = a + (b & c | ~b & d) + (x >>> 0) + t;
531
+ return (n << s | n >>> 32 - s) + b;
532
+ };
533
+ md52._gg = function(a, b, c, d, x, s, t) {
534
+ var n = a + (b & d | c & ~d) + (x >>> 0) + t;
535
+ return (n << s | n >>> 32 - s) + b;
536
+ };
537
+ md52._hh = function(a, b, c, d, x, s, t) {
538
+ var n = a + (b ^ c ^ d) + (x >>> 0) + t;
539
+ return (n << s | n >>> 32 - s) + b;
540
+ };
541
+ md52._ii = function(a, b, c, d, x, s, t) {
542
+ var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
543
+ return (n << s | n >>> 32 - s) + b;
544
+ };
545
+ md52._blocksize = 16;
546
+ md52._digestsize = 16;
547
+ md5$2.exports = function(message, options) {
548
+ if (message === void 0 || message === null)
549
+ throw new Error("Illegal argument " + message);
550
+ var digestbytes = crypt2.wordsToBytes(md52(message, options));
551
+ return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt2.bytesToHex(digestbytes);
552
+ };
553
+ })();
554
+ var md5Exports = md5$2.exports;
555
+ const md5 = /* @__PURE__ */ getDefaultExportFromCjs(md5Exports);
556
+ const md5$1 = /* @__PURE__ */ _mergeNamespaces({
557
+ __proto__: null,
558
+ default: md5
559
+ }, [md5Exports]);
560
+ const GLOBAL_STYLE_NAME = "BTXUIGlobal";
561
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
562
+ __name: "b-style",
563
+ props: {
564
+ class: {},
565
+ focus: {},
566
+ hover: {},
567
+ active: {},
568
+ states: {}
569
+ },
570
+ setup(__props) {
571
+ const props = __props;
572
+ const $style = ref();
573
+ const className = ref("");
574
+ const styleMap = computed(() => {
575
+ const list = [];
576
+ for (let item of $style.value.sheet.rules) {
577
+ list.push(item.selectorText.substr(1));
578
+ }
579
+ return list;
580
+ });
581
+ const initStyle = () => {
582
+ let $_style = document.head.querySelector(`#${GLOBAL_STYLE_NAME}`);
583
+ if (!$_style) {
584
+ $_style = document.createElement("style");
585
+ $_style.setAttribute("type", "text/css");
586
+ $_style.setAttribute("id", GLOBAL_STYLE_NAME);
587
+ document.head.appendChild($_style);
588
+ }
589
+ $style.value = $_style;
590
+ };
591
+ const styles = reactive({});
592
+ const validNumber = (val) => {
593
+ if (!isNaN(val * 1))
594
+ return val;
595
+ let num = val;
596
+ if (/^f\d+$/.test(num))
597
+ num = num.substr(1) * -1;
598
+ if (/^\d*d\d+$/.test(num))
599
+ num = num.replace("d", ".") * 1;
600
+ return isNaN(num) ? false : num;
601
+ };
602
+ const validColor = (val) => {
603
+ if (theme.colors[val])
604
+ return theme.colors[val];
605
+ if (val && val.search("C") === 0)
606
+ return `#${val.substr(1)}`;
607
+ return false;
608
+ };
609
+ const validValue = (val) => {
610
+ if (val && val.search("_") === 0)
611
+ return val.substr(1);
612
+ const num = validNumber(val);
613
+ if (num !== false)
614
+ return num;
615
+ const color = validColor(val);
616
+ if (color !== false)
617
+ return color;
618
+ return false;
619
+ };
620
+ const parseStyle = (rule) => {
621
+ let style = prestyles[rule];
622
+ if (style)
623
+ return style;
624
+ const rules = rule.split("-");
625
+ const dirs = {
626
+ l: ["left"],
627
+ t: ["top"],
628
+ r: ["right"],
629
+ b: ["bottom"],
630
+ v: ["top", "bottom"],
631
+ h: ["left", "right"]
632
+ };
633
+ let [r1, r2, r3, r4] = rules;
634
+ style = prestyles[r1];
635
+ if (style) {
636
+ let value = validValue(r2);
637
+ if (value)
638
+ return `${style.pro}: ${value}${r3 || style.unit || ""}`;
639
+ value = validValue(r3);
640
+ if (value) {
641
+ const dir = dirs[r2];
642
+ if (dir) {
643
+ let dirStyle = "";
644
+ dir.forEach((_dir) => {
645
+ dirStyle += `${style.pro}-${_dir}: ${value}${r4 || style.unit || ""};`;
646
+ });
647
+ return dirStyle;
648
+ } else {
649
+ return `${style.pro}-${r2}: ${value}${r4 || style.unit || ""}`;
650
+ }
651
+ }
652
+ }
653
+ };
654
+ const combineStyles = (_class) => {
655
+ if (!_class)
656
+ return "";
657
+ const combineStyle = _class.split(" ").reduce((total, rule) => {
658
+ const validateRule = parseStyle(rule);
659
+ if (!validateRule)
660
+ return;
661
+ total += `${validateRule};`;
662
+ return total;
663
+ }, "");
664
+ return combineStyle.replace(/;+/g, ";");
665
+ };
666
+ const appendStyle = (selector, rules) => {
667
+ const validateRule = combineStyles(rules);
668
+ if (!validateRule)
669
+ return;
670
+ if (!styleMap.value.includes(selector)) {
671
+ styleMap.value.push(selector);
672
+ styles[selector] = validateRule;
673
+ }
674
+ };
675
+ const parseStyles = (_class) => {
676
+ if (!_class)
677
+ return;
678
+ _class.split(" ").forEach((selector) => {
679
+ appendStyle(selector, selector);
680
+ });
681
+ };
682
+ const combineClassName = (_class) => {
683
+ const classArr = _class.split(" ").sort();
684
+ const compSelector = `B-${md5$1(classArr.join("&"))}`;
685
+ className.value = `${_class} ${compSelector}`;
686
+ if (!styleMap.value.includes(compSelector)) {
687
+ styleMap.value.push(compSelector);
688
+ }
689
+ return compSelector;
690
+ };
691
+ const genFocusStyles = (compSelector) => {
692
+ if (props.focus)
693
+ appendStyle(compSelector, props.focus);
694
+ };
695
+ const genHoverStyles = (compSelector) => {
696
+ if (props.hover)
697
+ appendStyle(compSelector, props.hover);
698
+ };
699
+ const genActiveStyles = (compSelector) => {
700
+ if (props.active)
701
+ appendStyle(compSelector, props.active);
702
+ };
703
+ const genStateStyles = (baseSelector) => {
704
+ if (!props.states)
705
+ return;
706
+ Object.keys(props.states).forEach((state) => {
707
+ appendStyle(`${baseSelector}[state="${state}"]`, props.states[state]);
708
+ });
709
+ };
710
+ const setStyle = () => {
711
+ Object.keys(styles).forEach((key) => {
712
+ $style.value.sheet.addRule(`.${key}`, styles[key]);
713
+ });
714
+ };
715
+ onMounted(() => {
716
+ if (props.class) {
717
+ initStyle();
718
+ parseStyles(props.class);
719
+ const compSelector = combineClassName(props.class);
720
+ genFocusStyles(`${compSelector}[focus='true']:focus`);
721
+ genHoverStyles(`${compSelector}[hover='true']:hover`);
722
+ genActiveStyles(`${compSelector}[active='true']:active`);
723
+ genStateStyles(compSelector);
724
+ setStyle();
725
+ }
726
+ });
727
+ return (_ctx, _cache) => {
728
+ return renderSlot(_ctx.$slots, "className", { className: className.value });
729
+ };
730
+ }
731
+ });
732
+ const _hoisted_1$9 = ["state"];
733
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
734
+ __name: "b-view",
735
+ props: {
736
+ class: {},
737
+ state: { type: [String, Boolean] },
738
+ states: {},
739
+ bgImg: {},
740
+ matrix: {}
741
+ },
742
+ setup(__props) {
743
+ const props = __props;
744
+ const lineStyle = computed(() => {
745
+ var _a, _b, _c, _d, _e, _f, _g, _h;
746
+ const bgImg = props.bgImg ? { backgroundImage: `url(${props.bgImg})` } : {};
747
+ const translate = ((_a = props.matrix) == null ? void 0 : _a.translate) ? `translate(${(_b = props.matrix) == null ? void 0 : _b.translate})` : "";
748
+ const scale = ((_c = props.matrix) == null ? void 0 : _c.scale) ? `scale(${(_d = props.matrix) == null ? void 0 : _d.scale})` : "";
749
+ const rotate = ((_e = props.matrix) == null ? void 0 : _e.rotate) ? `rotate(${(_f = props.matrix) == null ? void 0 : _f.rotate})` : "";
750
+ const skew = ((_g = props.matrix) == null ? void 0 : _g.skew) ? `skew(${(_h = props.matrix) == null ? void 0 : _h.skew})` : "";
751
+ const transform = props.matrix ? {
752
+ transform: `${translate} ${scale} ${rotate} ${skew}`
753
+ } : {};
754
+ return {
755
+ ...bgImg,
756
+ ...transform
757
+ };
758
+ });
759
+ return (_ctx, _cache) => {
760
+ return openBlock(), createBlock(_sfc_main$f, {
761
+ class: normalizeClass(_ctx.class),
762
+ states: _ctx.states
763
+ }, {
764
+ className: withCtx((scope) => [
765
+ createElementVNode("div", {
766
+ class: normalizeClass(scope.className),
767
+ state: _ctx.state,
768
+ style: normalizeStyle(lineStyle.value)
769
+ }, [
770
+ renderSlot(_ctx.$slots, "default")
771
+ ], 14, _hoisted_1$9)
772
+ ]),
773
+ _: 3
774
+ }, 8, ["class", "states"]);
775
+ };
776
+ }
777
+ });
778
+ const _hoisted_1$8 = ["state"];
779
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
780
+ __name: "b-text",
781
+ props: {
782
+ class: {},
783
+ state: { type: [String, Boolean] },
784
+ states: {}
785
+ },
786
+ setup(__props) {
787
+ return (_ctx, _cache) => {
788
+ return openBlock(), createBlock(_sfc_main$f, {
789
+ class: normalizeClass(_ctx.class),
790
+ states: _ctx.states
791
+ }, {
792
+ className: withCtx((scope) => [
793
+ createElementVNode("span", {
794
+ class: normalizeClass(scope.className),
795
+ state: _ctx.state
796
+ }, [
797
+ renderSlot(_ctx.$slots, "default")
798
+ ], 10, _hoisted_1$8)
799
+ ]),
800
+ _: 3
801
+ }, 8, ["class", "states"]);
802
+ };
803
+ }
804
+ });
805
+ const _hoisted_1$7 = ["onClick", "onDblclick", "target", "hover", "state", "active", "href"];
806
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
807
+ __name: "b-hot",
808
+ props: {
809
+ link: {},
810
+ class: {},
811
+ state: { type: [String, Boolean] },
812
+ states: {},
813
+ hover: {},
814
+ active: {},
815
+ forbid: { type: Boolean },
816
+ download: {},
817
+ anchor: {}
818
+ },
819
+ emits: ["on_click", "on_enter", "on_move", "on_leave", "on_dblclick"],
820
+ setup(__props, { emit }) {
821
+ const props = __props;
822
+ const $anchor = ref();
823
+ const target = ref("");
824
+ const url = computed(() => {
825
+ const link = props.link;
826
+ if (props.forbid || !link)
827
+ return "javascript: void 0;";
828
+ if (link.search("http") === 0) {
829
+ target.value = "_blank";
830
+ return link;
831
+ }
832
+ if (link.search(/^(tel|mailto):/) === 0)
833
+ return link;
834
+ return link;
835
+ });
836
+ const cursor = computed(() => props.forbid ? "" : "pointer");
837
+ const click = (e) => {
838
+ if (props.anchor) {
839
+ const $section = document.querySelector(props.anchor);
840
+ if ($section)
841
+ $section.scrollIntoView({
842
+ behavior: "smooth"
843
+ });
844
+ }
845
+ !props.forbid && emit("on_click", e);
846
+ };
847
+ const dblclick = (e) => {
848
+ !props.forbid && emit("on_dblclick", e);
849
+ };
850
+ const enter = (e) => {
851
+ emit("on_enter", e);
852
+ };
853
+ const move = (e) => {
854
+ emit("on_move", e);
855
+ };
856
+ const leave = (e) => {
857
+ emit("on_leave", e);
858
+ };
859
+ onMounted(() => {
860
+ if (props.download)
861
+ $anchor.value.download = props.download;
862
+ });
863
+ return (_ctx, _cache) => {
864
+ return openBlock(), createBlock(_sfc_main$f, {
865
+ class: normalizeClass(_ctx.class),
866
+ states: _ctx.states,
867
+ hover: _ctx.hover,
868
+ active: _ctx.active
869
+ }, {
870
+ className: withCtx((scope) => [
871
+ createElementVNode("a", {
872
+ style: normalizeStyle(`user-select: none; cursor: ${cursor.value};`),
873
+ ref_key: "$anchor",
874
+ ref: $anchor,
875
+ onMouseenter: enter,
876
+ onTouchstart: enter,
877
+ onMousemove: move,
878
+ onTouchmove: move,
879
+ onMouseleave: leave,
880
+ onTouchend: leave,
881
+ onClick: withModifiers(click, ["stop"]),
882
+ onDblclick: withModifiers(dblclick, ["stop"]),
883
+ target: target.value,
884
+ class: normalizeClass(scope.className),
885
+ hover: _ctx.hover ? true : "",
886
+ state: _ctx.state,
887
+ active: _ctx.active ? true : "",
888
+ href: url.value
889
+ }, [
890
+ renderSlot(_ctx.$slots, "default")
891
+ ], 46, _hoisted_1$7)
892
+ ]),
893
+ _: 3
894
+ }, 8, ["class", "states", "hover", "active"]);
895
+ };
896
+ }
897
+ });
898
+ const _hoisted_1$6 = ["src", "alt"];
899
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
900
+ __name: "b-img",
901
+ props: {
902
+ img: {},
903
+ class: {},
904
+ defaultSrc: {},
905
+ alt: {}
906
+ },
907
+ emits: ["on_load"],
908
+ setup(__props, { emit }) {
909
+ const props = __props;
910
+ const img = computed(() => props.img);
911
+ const src = ref("");
912
+ const setSrc = () => {
913
+ if (props.defaultSrc)
914
+ src.value = props.defaultSrc;
915
+ const imgLoader = new Image();
916
+ imgLoader.onload = () => {
917
+ src.value = props.img;
918
+ emit("on_load");
919
+ };
920
+ imgLoader.src = props.img;
921
+ };
922
+ watch(img, setSrc);
923
+ onMounted(() => {
924
+ setSrc();
925
+ });
926
+ return (_ctx, _cache) => {
927
+ return openBlock(), createBlock(_sfc_main$f, {
928
+ class: normalizeClass(_ctx.class)
929
+ }, {
930
+ className: withCtx((scope) => [
931
+ createElementVNode("img", {
932
+ src: src.value,
933
+ class: normalizeClass(scope.className),
934
+ style: { "display": "block" },
935
+ alt: _ctx.alt
936
+ }, null, 10, _hoisted_1$6)
937
+ ]),
938
+ _: 1
939
+ }, 8, ["class"]);
940
+ };
941
+ }
942
+ });
943
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
944
+ __name: "ani-success",
945
+ setup(__props) {
946
+ return (_ctx, _cache) => {
947
+ return openBlock(), createBlock(_sfc_main$e, {
948
+ class: "flex-5",
949
+ matrix: { translate: "0,9px", rotate: "45deg" }
950
+ }, {
951
+ default: withCtx(() => [
952
+ createVNode(_sfc_main$d, { class: "ani-success-part1 w-1 h-3-px bg-color-green round-sm" }),
953
+ createVNode(_sfc_main$d, { class: "ani-success-part2 w-1d7 h-3-px bg-color-green round-sm rel t-1-px l-f1-px" })
954
+ ]),
955
+ _: 1
956
+ });
957
+ };
958
+ }
959
+ });
960
+ const aniSuccess_vue_vue_type_style_index_0_lang = "";
961
+ const aniFail_vue_vue_type_style_index_0_lang = "";
962
+ const _export_sfc = (sfc, props) => {
963
+ const target = sfc.__vccOpts || sfc;
964
+ for (const [key, val] of props) {
965
+ target[key] = val;
966
+ }
967
+ return target;
968
+ };
969
+ const _sfc_main$9 = {};
970
+ function _sfc_render$2(_ctx, _cache) {
971
+ const _component_b_text = resolveComponent("b-text");
972
+ const _component_b_view = resolveComponent("b-view");
973
+ return openBlock(), createBlock(_component_b_view, { class: "flex-5" }, {
974
+ default: withCtx(() => [
975
+ createVNode(_component_b_text, { class: "ani-fail-part1 w-3-px h-1d7 rel l-2-px bg-color-red round-sm" }),
976
+ createVNode(_component_b_text, { class: "ani-fail-part2 w-3-px h-1d7 rel r-1-px bg-color-red round-sm" })
977
+ ]),
978
+ _: 1
979
+ });
980
+ }
981
+ const AniFail = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$2]]);
982
+ const aniNotic_vue_vue_type_style_index_0_lang = "";
983
+ const _sfc_main$8 = {};
984
+ function _sfc_render$1(_ctx, _cache) {
985
+ const _component_b_text = resolveComponent("b-text");
986
+ const _component_b_view = resolveComponent("b-view");
987
+ return openBlock(), createBlock(_component_b_view, {
988
+ class: "flex-5",
989
+ matrix: { rotate: "90deg" }
990
+ }, {
991
+ default: withCtx(() => [
992
+ createVNode(_component_b_text, { class: "ani-notic-part1 w-3-px h-3-px bg-color-blue round" }),
993
+ createVNode(_component_b_text, { class: "ani-notic-part2 w-1d3 h-3-px mrg-l-4-px bg-color-blue round-sm" })
994
+ ]),
995
+ _: 1
996
+ });
997
+ }
998
+ const AniNotic = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$1]]);
999
+ const aniLoading_vue_vue_type_style_index_0_lang = "";
1000
+ const _sfc_main$7 = {};
1001
+ function _sfc_render(_ctx, _cache) {
1002
+ const _component_b_view = resolveComponent("b-view");
1003
+ return openBlock(), createBlock(_component_b_view, { class: "flex-5" }, {
1004
+ default: withCtx(() => [
1005
+ createVNode(_component_b_view, { class: "ani-loading rel w-2d2 h-2d2 round" })
1006
+ ]),
1007
+ _: 1
1008
+ });
1009
+ }
1010
+ const AniLoading = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render]]);
1011
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1012
+ __name: "b-icon",
1013
+ props: {
1014
+ icon: {},
1015
+ class: {}
1016
+ },
1017
+ setup(__props) {
1018
+ const props = __props;
1019
+ return (_ctx, _cache) => {
1020
+ return openBlock(), createBlock(_sfc_main$f, {
1021
+ class: normalizeClass(_ctx.class)
1022
+ }, {
1023
+ className: withCtx((scope) => [
1024
+ _ctx.icon.search("ani_") === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1025
+ _ctx.icon === "ani_success" ? (openBlock(), createBlock(_sfc_main$a, { key: "success" })) : createCommentVNode("", true),
1026
+ _ctx.icon === "ani_fail" ? (openBlock(), createBlock(AniFail, { key: "fail" })) : createCommentVNode("", true),
1027
+ _ctx.icon === "ani_notic" ? (openBlock(), createBlock(AniNotic, { key: "notic" })) : createCommentVNode("", true),
1028
+ _ctx.icon === "ani_loading" ? (openBlock(), createBlock(AniLoading, { key: "loading" })) : createCommentVNode("", true)
1029
+ ], 64)) : createCommentVNode("", true),
1030
+ _ctx.icon.search("/") > -1 ? (openBlock(), createBlock(_sfc_main$b, {
1031
+ key: 1,
1032
+ img: _ctx.icon,
1033
+ class: normalizeClass(scope.className)
1034
+ }, null, 8, ["img", "class"])) : (openBlock(), createElementBlock("i", {
1035
+ key: 2,
1036
+ class: normalizeClass(`ico-${props.icon} ${scope.className}`)
1037
+ }, null, 2))
1038
+ ]),
1039
+ _: 1
1040
+ }, 8, ["class"]);
1041
+ };
1042
+ }
1043
+ });
1044
+ const _hoisted_1$5 = ["type", "name", "focus", "state", "placeholder", "maxlength", "readonly"];
1045
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1046
+ __name: "b-input",
1047
+ props: {
1048
+ type: {},
1049
+ name: {},
1050
+ class: {},
1051
+ state: { type: [String, Boolean] },
1052
+ states: {},
1053
+ text: {},
1054
+ placeholder: {},
1055
+ maxlength: {},
1056
+ readonly: { type: Boolean },
1057
+ focus: {},
1058
+ rule: {}
1059
+ },
1060
+ emits: ["update:text", "on_focus", "on_blur", "on_change"],
1061
+ setup(__props, { expose: __expose, emit }) {
1062
+ const props = __props;
1063
+ const val = ref(props.text);
1064
+ const preset_rules = {
1065
+ required: {
1066
+ regexp: /[\w\.\-_\u4e00-\u9fa5]+/,
1067
+ notic: "输入内容为空!"
1068
+ },
1069
+ tel: {
1070
+ regexp: /^1[3-9]\d{9}$/,
1071
+ notic: "手机号格式有误!"
1072
+ },
1073
+ email: {
1074
+ regexp: /^[\w\.]+@(\w+\.)+(com|net|org|wiki|cn|cc)$/,
1075
+ notic: "邮箱格式有误!"
1076
+ },
1077
+ url: {
1078
+ regexp: /^((http|https):\/\/)?(wwww\.)?(\w+\.)+(com|net|org|wiki|cn|cc)$/,
1079
+ notic: "url 格式有误!"
1080
+ },
1081
+ uname: {
1082
+ regexp: /^[\w_]+$/,
1083
+ notic: "请输入英文字母、数字或下划线!"
1084
+ },
1085
+ zh: {
1086
+ regexp: /^[\u4e00-\u9fa5]+$/,
1087
+ notic: "请输入中文字符!"
1088
+ },
1089
+ uid: {
1090
+ regexp: /^\d{15}(\d{2}[0-9x])?$/i,
1091
+ notic: "身份证号输入有误!"
1092
+ }
1093
+ };
1094
+ const input = () => {
1095
+ var _a;
1096
+ emit("update:text", (_a = val.value) == null ? void 0 : _a.trim());
1097
+ };
1098
+ const change = (e) => {
1099
+ emit("on_change", check(), e);
1100
+ };
1101
+ const blur = (e) => {
1102
+ emit("on_blur", check(), e);
1103
+ };
1104
+ const check = () => {
1105
+ if (props.rule) {
1106
+ const pre_rule = preset_rules[props.rule.type];
1107
+ const regexp = pre_rule ? pre_rule.regexp : props.rule.type;
1108
+ return {
1109
+ name: props.name,
1110
+ notic: props.rule.notic ? props.rule.notic : pre_rule ? pre_rule.notic : `${props.name}格式有误!`,
1111
+ pass: regexp.test(val.value)
1112
+ };
1113
+ }
1114
+ return true;
1115
+ };
1116
+ __expose({
1117
+ check
1118
+ });
1119
+ return (_ctx, _cache) => {
1120
+ return openBlock(), createBlock(_sfc_main$f, {
1121
+ class: normalizeClass(_ctx.class),
1122
+ focus: _ctx.focus,
1123
+ states: _ctx.states
1124
+ }, {
1125
+ className: withCtx((scope) => [
1126
+ withDirectives(createElementVNode("input", {
1127
+ class: normalizeClass(scope.className),
1128
+ type: _ctx.type,
1129
+ onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("on_focus", $event)),
1130
+ onBlur: blur,
1131
+ onChange: change,
1132
+ onInput: input,
1133
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => val.value = $event),
1134
+ name: _ctx.name,
1135
+ focus: _ctx.focus ? true : "",
1136
+ state: _ctx.state,
1137
+ placeholder: _ctx.placeholder,
1138
+ maxlength: _ctx.maxlength,
1139
+ readonly: _ctx.readonly,
1140
+ autocomplete: "off"
1141
+ }, null, 42, _hoisted_1$5), [
1142
+ [vModelDynamic, val.value]
1143
+ ])
1144
+ ]),
1145
+ _: 1
1146
+ }, 8, ["class", "focus", "states"]);
1147
+ };
1148
+ }
1149
+ });
1150
+ const _hoisted_1$4 = ["name", "focus", "state", "placeholder", "maxlength", "readonly", "rows"];
1151
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1152
+ __name: "b-textarea",
1153
+ props: {
1154
+ text: {},
1155
+ name: {},
1156
+ class: {},
1157
+ state: { type: [String, Boolean] },
1158
+ states: {},
1159
+ rows: {},
1160
+ placeholder: {},
1161
+ maxlength: {},
1162
+ readonly: { type: Boolean },
1163
+ focus: {}
1164
+ },
1165
+ emits: ["on_focus", "on_blur", "on_change", "update:text"],
1166
+ setup(__props, { emit }) {
1167
+ const props = __props;
1168
+ const val = ref(props.text);
1169
+ const formatText = (text) => text.replace(/[\n\r]/g, "<br>");
1170
+ const inputText = () => {
1171
+ emit("update:text", formatText(val.value));
1172
+ };
1173
+ return (_ctx, _cache) => {
1174
+ return openBlock(), createBlock(_sfc_main$f, {
1175
+ class: normalizeClass(_ctx.class),
1176
+ focus: _ctx.focus,
1177
+ states: _ctx.states
1178
+ }, {
1179
+ className: withCtx((scope) => [
1180
+ withDirectives(createElementVNode("textarea", {
1181
+ class: normalizeClass(scope.className),
1182
+ onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("on_focus", $event)),
1183
+ onBlur: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("on_blur", $event)),
1184
+ onChange: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("on_change", $event)),
1185
+ onInput: inputText,
1186
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => val.value = $event),
1187
+ name: _ctx.name,
1188
+ focus: _ctx.focus ? true : "",
1189
+ state: _ctx.state,
1190
+ placeholder: _ctx.placeholder,
1191
+ maxlength: _ctx.maxlength,
1192
+ readonly: _ctx.readonly,
1193
+ rows: _ctx.rows || 7
1194
+ }, null, 42, _hoisted_1$4), [
1195
+ [vModelText, val.value]
1196
+ ])
1197
+ ]),
1198
+ _: 1
1199
+ }, 8, ["class", "focus", "states"]);
1200
+ };
1201
+ }
1202
+ });
1203
+ const _hoisted_1$3 = ["muted", "src", "autoplay", "loop"];
1204
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1205
+ __name: "b-video",
1206
+ props: {
1207
+ video: {},
1208
+ class: {},
1209
+ autoPlay: { type: Boolean },
1210
+ loop: { type: Boolean }
1211
+ },
1212
+ setup(__props) {
1213
+ const $video = ref();
1214
+ return (_ctx, _cache) => {
1215
+ return openBlock(), createBlock(_sfc_main$f, {
1216
+ class: normalizeClass(_ctx.class)
1217
+ }, {
1218
+ className: withCtx((scope) => [
1219
+ createElementVNode("video", {
1220
+ ref_key: "$video",
1221
+ ref: $video,
1222
+ class: normalizeClass(scope.className),
1223
+ muted: _ctx.autoPlay,
1224
+ src: _ctx.video,
1225
+ autoplay: _ctx.autoPlay,
1226
+ loop: _ctx.loop
1227
+ }, null, 10, _hoisted_1$3)
1228
+ ]),
1229
+ _: 1
1230
+ }, 8, ["class"]);
1231
+ };
1232
+ }
1233
+ });
1234
+ const _hoisted_1$2 = ["state"];
1235
+ const tolerance = 2;
1236
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1237
+ __name: "b-list",
1238
+ props: {
1239
+ scroll: {},
1240
+ class: {},
1241
+ state: { type: [String, Boolean] },
1242
+ states: {},
1243
+ scrollType: {}
1244
+ },
1245
+ emits: ["on_scroll", "on_to_top", "on_to_bottom"],
1246
+ setup(__props, { expose: __expose, emit }) {
1247
+ const props = __props;
1248
+ const $list = ref();
1249
+ const scrollTypeClass = computed(() => {
1250
+ if (props.scrollType)
1251
+ return `${props.scrollType}-scroll`;
1252
+ return "thin-scroll";
1253
+ });
1254
+ const reset = () => {
1255
+ $list.value.scrollTop = 0;
1256
+ };
1257
+ let origScrollPos = { x: 0, y: 0 };
1258
+ const watchPos = () => {
1259
+ $list.value.onscroll = (e) => {
1260
+ const st = e.target.scrollTop;
1261
+ const sl = e.target.scrollLeft;
1262
+ const h_offset = sl - origScrollPos.x;
1263
+ const v_offset = st - origScrollPos.y;
1264
+ let dir;
1265
+ if (Math.abs(h_offset) >= Math.abs(v_offset)) {
1266
+ e.stopPropagation();
1267
+ dir = h_offset >= 0 ? "l2r" : "r2l";
1268
+ } else {
1269
+ dir = v_offset >= 0 ? "t2b" : "b2t";
1270
+ }
1271
+ origScrollPos.x = sl;
1272
+ origScrollPos.y = st;
1273
+ emit("on_scroll", { dir, left: sl, top: st });
1274
+ if (st === 0)
1275
+ emit("on_to_top", e);
1276
+ if (st >= e.target.scrollHeight - e.target.clientHeight - tolerance)
1277
+ emit("on_to_bottom", e);
1278
+ };
1279
+ };
1280
+ __expose({ reset });
1281
+ onMounted(() => {
1282
+ watchPos();
1283
+ });
1284
+ return (_ctx, _cache) => {
1285
+ return openBlock(), createBlock(_sfc_main$f, {
1286
+ class: normalizeClass(_ctx.class),
1287
+ states: _ctx.states
1288
+ }, {
1289
+ className: withCtx((scope) => [
1290
+ createElementVNode("div", {
1291
+ class: normalizeClass(scope.className),
1292
+ style: { "position": "relative" },
1293
+ state: _ctx.state
1294
+ }, [
1295
+ createElementVNode("div", {
1296
+ ref_key: "$list",
1297
+ ref: $list,
1298
+ class: normalizeClass(scrollTypeClass.value),
1299
+ style: normalizeStyle(`overflow-x: ${_ctx.scroll.x}; overflow-y: ${_ctx.scroll.y}; width: 100%; height: 100%;`),
1300
+ onTouchmove: _cache[0] || (_cache[0] = withModifiers(() => {
1301
+ }, ["stop"]))
1302
+ }, [
1303
+ renderSlot(_ctx.$slots, "default")
1304
+ ], 38)
1305
+ ], 10, _hoisted_1$2)
1306
+ ]),
1307
+ _: 3
1308
+ }, 8, ["class", "states"]);
1309
+ };
1310
+ }
1311
+ });
1312
+ const _hoisted_1$1 = ["state", "draggable"];
1313
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1314
+ __name: "b-drag",
1315
+ props: {
1316
+ class: {},
1317
+ dataInfo: {},
1318
+ dragStart: {},
1319
+ dragOver: {},
1320
+ freeDrag: { type: Boolean }
1321
+ },
1322
+ emits: ["on_drag_start", "on_drag_end", "on_drag_over", "on_drag_leave", "on_drop", "on_move"],
1323
+ setup(__props, { emit }) {
1324
+ const props = __props;
1325
+ const $el = ref();
1326
+ const state = ref("");
1327
+ const dragState = ref(false);
1328
+ const freeDragState = ref(false);
1329
+ const movePos = reactive({ x: 0, y: 0 });
1330
+ const bindEvent = () => {
1331
+ const $dom = $el.value;
1332
+ if (props.freeDrag) {
1333
+ $dom.onmousedown = freeDragBegin;
1334
+ $dom.ontouchstart = freeDragBegin;
1335
+ } else {
1336
+ $dom.ondragstart = dragBegin;
1337
+ $dom.ondrag = dragMove;
1338
+ $dom.ondragend = dragEnd;
1339
+ $dom.ondragover = dragEnterArea;
1340
+ $dom.ondragleave = dragLeaveArea;
1341
+ $dom.ondrop = drop;
1342
+ }
1343
+ };
1344
+ const dragBegin = (e) => {
1345
+ emit("on_drag_start", e);
1346
+ state.value = "dragStart";
1347
+ e.dataTransfer.setData("info", JSON.stringify(props.dataInfo));
1348
+ };
1349
+ const dragMove = (e) => {
1350
+ e.preventDefault();
1351
+ dragState.value = true;
1352
+ };
1353
+ const dragEnd = (e) => {
1354
+ emit("on_drag_end", e);
1355
+ dragState.value = false;
1356
+ state.value = "";
1357
+ };
1358
+ const dragEnterArea = (e) => {
1359
+ e.preventDefault();
1360
+ emit("on_drag_over", e);
1361
+ state.value = "dragOver";
1362
+ };
1363
+ const dragLeaveArea = (e) => {
1364
+ emit("on_drag_leave", e);
1365
+ state.value = "";
1366
+ };
1367
+ const drop = (e) => {
1368
+ emit("on_drop", e.dataTransfer.getData("info"), e);
1369
+ state.value = "";
1370
+ };
1371
+ let $offsetParent;
1372
+ const relPos = reactive({ x: 0, y: 0 });
1373
+ const blockSize = reactive({ width: 0, height: 0 });
1374
+ const initOffsetParent = () => {
1375
+ $offsetParent = $el.value.offsetParent;
1376
+ $offsetParent.onmousemove = freeDragMove;
1377
+ $offsetParent.ontouchmove = freeDragMove;
1378
+ $offsetParent.onmouseleave = freeDragEnd;
1379
+ $offsetParent.onmouseup = freeDragEnd;
1380
+ $offsetParent.ontouchend = freeDragEnd;
1381
+ Array.prototype.forEach.call($offsetParent.children, ($dom) => {
1382
+ if ($dom !== $el.value)
1383
+ $dom.style.pointerEvents = "none";
1384
+ });
1385
+ blockSize.width = $el.value.offsetWidth;
1386
+ blockSize.height = $el.value.offsetHeight;
1387
+ };
1388
+ const freeDragBegin = (e) => {
1389
+ e.preventDefault();
1390
+ if (!$offsetParent)
1391
+ initOffsetParent();
1392
+ state.value = "dragStart";
1393
+ freeDragState.value = true;
1394
+ relPos.x = e.offsetX;
1395
+ relPos.y = e.offsetY;
1396
+ $el.value.style.pointerEvents = "none";
1397
+ };
1398
+ const freeDragMove = (e) => {
1399
+ if (!freeDragState.value)
1400
+ return;
1401
+ const x = e.offsetX - relPos.x;
1402
+ const y = e.offsetY - relPos.y;
1403
+ movePos.x = Math.max(0, x);
1404
+ movePos.y = Math.max(0, y);
1405
+ movePos.x = Math.min(movePos.x + blockSize.width, $offsetParent.offsetWidth) - blockSize.width;
1406
+ movePos.y = Math.min(movePos.y + blockSize.height, $offsetParent.offsetHeight) - blockSize.height;
1407
+ emit("on_move", movePos, e);
1408
+ };
1409
+ const freeDragEnd = () => {
1410
+ if (!freeDragState.value)
1411
+ return;
1412
+ state.value = "";
1413
+ freeDragState.value = false;
1414
+ relPos.x = 0;
1415
+ relPos.y = 0;
1416
+ $el.value.style.pointerEvents = "auto";
1417
+ };
1418
+ onMounted(() => {
1419
+ bindEvent();
1420
+ });
1421
+ return (_ctx, _cache) => {
1422
+ return openBlock(), createBlock(_sfc_main$f, {
1423
+ class: normalizeClass(_ctx.class),
1424
+ states: { dragStart: _ctx.dragStart, dragOver: _ctx.dragOver }
1425
+ }, {
1426
+ className: withCtx((scope) => [
1427
+ createElementVNode("div", {
1428
+ style: normalizeStyle({
1429
+ cursor: _ctx.dragOver ? "default" : "move",
1430
+ visibility: dragState.value ? "hidden" : "visible",
1431
+ position: _ctx.freeDrag ? "absolute" : "relative",
1432
+ left: 0,
1433
+ top: 0,
1434
+ transform: `translate(${movePos.x}px, ${movePos.y}px)`
1435
+ }),
1436
+ ref_key: "$el",
1437
+ ref: $el,
1438
+ class: normalizeClass(scope.className),
1439
+ state: state.value,
1440
+ draggable: _ctx.dragStart ? true : false
1441
+ }, [
1442
+ renderSlot(_ctx.$slots, "default")
1443
+ ], 14, _hoisted_1$1)
1444
+ ]),
1445
+ _: 3
1446
+ }, 8, ["class", "states"]);
1447
+ };
1448
+ }
1449
+ });
1450
+ const _hoisted_1 = ["src"];
1451
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1452
+ __name: "b-webview",
1453
+ props: {
1454
+ src: {},
1455
+ class: {}
1456
+ },
1457
+ setup(__props) {
1458
+ return (_ctx, _cache) => {
1459
+ return openBlock(), createBlock(_sfc_main$f, {
1460
+ class: normalizeClass(_ctx.class)
1461
+ }, {
1462
+ className: withCtx((scope) => [
1463
+ createElementVNode("iframe", {
1464
+ class: normalizeClass(scope.className),
1465
+ frameborder: "0",
1466
+ src: _ctx.src
1467
+ }, null, 10, _hoisted_1)
1468
+ ]),
1469
+ _: 1
1470
+ }, 8, ["class"]);
1471
+ };
1472
+ }
1473
+ });
1474
+ const initGlobalComponents = [_sfc_main$f, _sfc_main$e, _sfc_main$d, _sfc_main$c, _sfc_main$b, _sfc_main$6, _sfc_main$3, _sfc_main$2, _sfc_main, _sfc_main$5, _sfc_main$1, _sfc_main$4];
5
1475
  const index = {
6
1476
  name: "btxui",
7
1477
  install(app) {
8
- Object.keys(initGlobalComponents).forEach((path) => {
9
- const pathBlocks = path.split("/");
10
- pathBlocks.pop();
11
- app.component(pathBlocks.pop(), initGlobalComponents[path]);
1478
+ initGlobalComponents.forEach((wid) => {
1479
+ app.component(wid.__name, wid);
12
1480
  });
13
1481
  }
14
1482
  };