geekplus-digital-ui 0.1.4 → 0.1.6
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/components/copy/index.js +3 -2
- package/components/copy/src/copy.vue.js +12 -11
- package/hooks/index.js +4 -0
- package/hooks/use-locale/index.js +4 -3
- package/index.js +8 -15
- package/install.js +6 -5
- package/locale/index.js +11 -0
- package/package.json +3 -2
package/components/copy/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ref as p, toRef as d, computed as f, onMounted as x, onBeforeUnmount as L, openBlock as s, createBlock as v, unref as y, withModifiers as S, normalizeStyle as M, withCtx as g, createElementBlock as N, normalizeClass as B, createVNode as b, renderSlot as w, createCommentVNode as I } from "vue";
|
|
2
2
|
import { useClipboard as R } from "@vueuse/core";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { ElMessage as $, ElLink as z, ElIcon as V } from "element-plus";
|
|
4
|
+
import "../../../hooks/index.js";
|
|
5
|
+
import j from "./copy-icon.vue.js";
|
|
6
6
|
import './copy.css';/* empty css */
|
|
7
|
-
import
|
|
7
|
+
import D from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
8
|
+
import { useLocale as H } from "../../../hooks/use-locale/index.js";
|
|
8
9
|
const O = /* @__PURE__ */ Object.assign({
|
|
9
10
|
name: "DCopy"
|
|
10
11
|
}, {
|
|
@@ -22,7 +23,7 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
22
23
|
setup(a, { expose: E }) {
|
|
23
24
|
const o = a, r = p(null), l = p(!1), h = d(o, "text"), u = d(o, "icon"), { copy: k } = R({
|
|
24
25
|
source: h
|
|
25
|
-
}), { t: C } =
|
|
26
|
+
}), { t: C } = H(), e = f(() => {
|
|
26
27
|
const n = r.value?.$el ?? r.value;
|
|
27
28
|
if (!o.triggerElement || !n)
|
|
28
29
|
return null;
|
|
@@ -37,7 +38,7 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
37
38
|
display: o.triggerElement && !l.value ? "none" : ""
|
|
38
39
|
})), c = () => {
|
|
39
40
|
k().then(() => {
|
|
40
|
-
|
|
41
|
+
$.success(C("d.copy.success"));
|
|
41
42
|
});
|
|
42
43
|
}, i = () => {
|
|
43
44
|
l.value = !0;
|
|
@@ -51,7 +52,7 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
51
52
|
}), E({
|
|
52
53
|
rootRef: r,
|
|
53
54
|
handleCopy: c
|
|
54
|
-
}), (n, t) => (s(), v(y(
|
|
55
|
+
}), (n, t) => (s(), v(y(z), {
|
|
55
56
|
ref_key: "rootRef",
|
|
56
57
|
ref: r,
|
|
57
58
|
class: "d-copy",
|
|
@@ -64,9 +65,9 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
64
65
|
u.value ? (s(), N("i", {
|
|
65
66
|
key: 0,
|
|
66
67
|
class: B(u.value)
|
|
67
|
-
}, null, 2)) : (s(), v(y(
|
|
68
|
+
}, null, 2)) : (s(), v(y(V), { key: 1 }, {
|
|
68
69
|
default: g(() => [
|
|
69
|
-
b(
|
|
70
|
+
b(j)
|
|
70
71
|
]),
|
|
71
72
|
_: 1
|
|
72
73
|
})),
|
|
@@ -75,7 +76,7 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
75
76
|
_: 3
|
|
76
77
|
}, 8, ["type", "style"]));
|
|
77
78
|
}
|
|
78
|
-
}),
|
|
79
|
+
}), Q = /* @__PURE__ */ D(O, [["__scopeId", "data-v-cad5f2ba"]]);
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
Q as default
|
|
81
82
|
};
|
package/hooks/index.js
ADDED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../locale/index.js";
|
|
2
|
+
import { setLocale as o, getLocale as e, t } from "../../locale/i18n.js";
|
|
2
3
|
const a = () => ({
|
|
3
4
|
t,
|
|
4
|
-
getLocale:
|
|
5
|
-
setLocale:
|
|
5
|
+
getLocale: e,
|
|
6
|
+
setLocale: o
|
|
6
7
|
});
|
|
7
8
|
export {
|
|
8
9
|
a as useLocale
|
package/index.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { install as o } from "./install.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const t = { install: o };
|
|
2
|
+
import "./components/index.js";
|
|
3
|
+
import "./hooks/index.js";
|
|
4
|
+
import { DCopy as a } from "./components/copy/index.js";
|
|
5
|
+
import { useLocale as l } from "./hooks/use-locale/index.js";
|
|
6
|
+
const p = { install: o };
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
n as en,
|
|
12
|
-
c as getLocale,
|
|
13
|
-
d as initI18n,
|
|
8
|
+
a as DCopy,
|
|
9
|
+
p as default,
|
|
14
10
|
o as install,
|
|
15
|
-
|
|
16
|
-
L as t,
|
|
17
|
-
p as useLocale,
|
|
18
|
-
x as zhCn
|
|
11
|
+
l as useLocale
|
|
19
12
|
};
|
package/install.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import "./locale/index.js";
|
|
2
|
+
import * as r from "./components/index.js";
|
|
1
3
|
import { initI18n as s } from "./locale/i18n.js";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
i?.name && n.component(i.name, i);
|
|
4
|
+
const c = (o, t = {}) => {
|
|
5
|
+
const { locale: n } = t, e = s(n);
|
|
6
|
+
o.use(e), Object.values(r).forEach((i) => {
|
|
7
|
+
i?.name && o.component(i.name, i);
|
|
7
8
|
});
|
|
8
9
|
};
|
|
9
10
|
export {
|
package/locale/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as o } from "./lang/en.js";
|
|
2
|
+
import { default as r } from "./lang/zh-cn.js";
|
|
3
|
+
import { getLocale as l, initI18n as n, setLocale as m, t as p } from "./i18n.js";
|
|
4
|
+
export {
|
|
5
|
+
o as en,
|
|
6
|
+
l as getLocale,
|
|
7
|
+
n as initI18n,
|
|
8
|
+
m as setLocale,
|
|
9
|
+
p as t,
|
|
10
|
+
r as zhCn
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geekplus-digital-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./index.js"
|
|
10
|
-
}
|
|
10
|
+
},
|
|
11
|
+
"./*": "./*"
|
|
11
12
|
},
|
|
12
13
|
"sideEffects": [
|
|
13
14
|
"**/*.css"
|