@opentiny/tiny-engine-toolbar-clean 2.4.0 → 2.5.0-alpha.0

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