@opentiny/tiny-engine-toolbar-clean 2.0.0-alpha.2 → 2.0.0-alpha.3
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 +45 -51
- package/package.json +10 -8
package/dist/index.js
CHANGED
|
@@ -1,85 +1,79 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import {
|
|
3
|
-
import { useCanvas as
|
|
4
|
-
import { constants as
|
|
1
|
+
import { getCurrentInstance as u, ref as m, watch as f, createVNode as c, resolveComponent as d, openBlock as _, createElementBlock as v } from "vue";
|
|
2
|
+
import { Modal as b } from "@opentiny/vue";
|
|
3
|
+
import { useCanvas as g, useLayout as k } from "@opentiny/tiny-engine-meta-register";
|
|
4
|
+
import { constants as y } from "@opentiny/tiny-engine-utils";
|
|
5
|
+
import { ToolbarBase as C } from "@opentiny/tiny-engine-common";
|
|
5
6
|
const {
|
|
6
|
-
PAGE_STATUS:
|
|
7
|
-
} =
|
|
7
|
+
PAGE_STATUS: i
|
|
8
|
+
} = y, S = {
|
|
8
9
|
components: {
|
|
9
|
-
|
|
10
|
+
ToolbarBase: C
|
|
10
11
|
},
|
|
11
12
|
props: {
|
|
12
|
-
|
|
13
|
-
type:
|
|
14
|
-
default:
|
|
13
|
+
options: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => ({})
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
setup() {
|
|
18
|
-
const
|
|
19
|
+
const s = u().appContext.components.SvgIcon, {
|
|
19
20
|
pageState: o,
|
|
20
|
-
clearCanvas:
|
|
21
|
-
} =
|
|
22
|
-
return
|
|
21
|
+
clearCanvas: e
|
|
22
|
+
} = g(), t = m(o.isLock);
|
|
23
|
+
return f(
|
|
23
24
|
() => o.isLock,
|
|
24
25
|
// eslint-disable-next-line no-return-assign
|
|
25
|
-
(
|
|
26
|
+
(n) => t.value = n
|
|
26
27
|
), {
|
|
27
28
|
clean: () => {
|
|
28
|
-
var
|
|
29
|
-
[
|
|
29
|
+
var n, r;
|
|
30
|
+
[i.Occupy, i.Guest].includes((r = (n = k().layoutState) == null ? void 0 : n.pageStatus) == null ? void 0 : r.state) && (t.value || b.confirm({
|
|
30
31
|
title: "提示",
|
|
31
32
|
message: () => [c("div", {
|
|
32
33
|
class: "modal-content"
|
|
33
34
|
}, [c("div", {
|
|
34
35
|
class: "wrap"
|
|
35
|
-
}, [c(
|
|
36
|
+
}, [c(s, {
|
|
36
37
|
name: "warning"
|
|
37
38
|
}, null), c("span", null, ["您确定要清除屏幕吗?"])])])]
|
|
38
|
-
}).then((
|
|
39
|
-
|
|
39
|
+
}).then((p) => {
|
|
40
|
+
p === "confirm" && e();
|
|
40
41
|
}));
|
|
41
42
|
},
|
|
42
43
|
isLock: t
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
},
|
|
46
|
-
const o =
|
|
47
|
-
for (const [
|
|
48
|
-
o[
|
|
46
|
+
}, x = (a, s) => {
|
|
47
|
+
const o = a.__vccOpts || a;
|
|
48
|
+
for (const [e, t] of s)
|
|
49
|
+
o[e] = t;
|
|
49
50
|
return o;
|
|
50
|
-
},
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
c(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, {
|
|
61
|
-
reference: g(() => [
|
|
62
|
-
y("span", {
|
|
63
|
-
class: k(["icon", { disabled: n.isLock }]),
|
|
64
|
-
onClick: e[0] || (e[0] = (...i) => n.clean && n.clean(...i))
|
|
65
|
-
}, [
|
|
66
|
-
c(a, { name: o.icon }, null, 8, ["name"])
|
|
67
|
-
], 2)
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
})
|
|
51
|
+
}, h = { class: "toolbar-itm-clean" };
|
|
52
|
+
function A(a, s, o, e, t, l) {
|
|
53
|
+
const n = d("toolbar-base");
|
|
54
|
+
return _(), v("div", h, [
|
|
55
|
+
c(n, {
|
|
56
|
+
content: "清除屏幕",
|
|
57
|
+
icon: o.options.icon.default || o.options.icon,
|
|
58
|
+
options: o.options,
|
|
59
|
+
onClickApi: e.clean
|
|
60
|
+
}, null, 8, ["icon", "options", "onClickApi"])
|
|
71
61
|
]);
|
|
72
62
|
}
|
|
73
|
-
const
|
|
63
|
+
const L = /* @__PURE__ */ x(S, [["render", A]]), T = {
|
|
74
64
|
id: "engine.toolbars.clean",
|
|
75
65
|
type: "toolbars",
|
|
76
66
|
title: "clean",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
options: {
|
|
68
|
+
icon: {
|
|
69
|
+
default: "clear"
|
|
70
|
+
},
|
|
71
|
+
renderType: "icon"
|
|
72
|
+
}
|
|
73
|
+
}, G = {
|
|
80
74
|
...T,
|
|
81
|
-
entry:
|
|
75
|
+
entry: L
|
|
82
76
|
};
|
|
83
77
|
export {
|
|
84
|
-
|
|
78
|
+
G as default
|
|
85
79
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-clean",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "vite build"
|
|
9
9
|
},
|
|
10
|
+
"type": "module",
|
|
10
11
|
"main": "dist/index.js",
|
|
11
12
|
"module": "dist/index.js",
|
|
12
13
|
"files": [
|
|
@@ -24,18 +25,19 @@
|
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@opentiny/tiny-engine-
|
|
28
|
-
"@opentiny/tiny-engine-
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.0.0-alpha.3",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3",
|
|
30
|
+
"@opentiny/tiny-engine-utils": "2.0.0-alpha.3"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.
|
|
32
|
-
"@vitejs/plugin-vue": "^
|
|
33
|
-
"@vitejs/plugin-vue-jsx": "^
|
|
34
|
-
"vite": "^4.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
|
|
34
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
|
+
"vite": "^5.4.2"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@opentiny/vue": "^3.14.0",
|
|
38
40
|
"vue": "^3.4.15"
|
|
39
41
|
},
|
|
40
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
|
|
41
43
|
}
|