@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.
Files changed (2) hide show
  1. package/dist/index.js +45 -51
  2. package/package.json +10 -8
package/dist/index.js CHANGED
@@ -1,85 +1,79 @@
1
- import { getCurrentInstance as d, ref as u, watch as v, createVNode as c, resolveComponent as l, openBlock as f, createElementBlock as _, withCtx as g, createElementVNode as y, normalizeClass as k } from "vue";
2
- import { Popover as C, Modal as S } from "@opentiny/vue";
3
- import { useCanvas as b, useLayout as h } from "@opentiny/tiny-engine-meta-register";
4
- import { constants as x } from "@opentiny/tiny-engine-utils";
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: p
7
- } = x, L = {
7
+ PAGE_STATUS: i
8
+ } = y, S = {
8
9
  components: {
9
- TinyPopover: C
10
+ ToolbarBase: C
10
11
  },
11
12
  props: {
12
- icon: {
13
- type: String,
14
- default: "clear"
13
+ options: {
14
+ type: Object,
15
+ default: () => ({})
15
16
  }
16
17
  },
17
18
  setup() {
18
- const e = d().appContext.components.SvgIcon, {
19
+ const s = u().appContext.components.SvgIcon, {
19
20
  pageState: o,
20
- clearCanvas: n
21
- } = b(), t = u(o.isLock);
22
- return v(
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
- (a) => t.value = a
26
+ (n) => t.value = n
26
27
  ), {
27
28
  clean: () => {
28
- var a, r;
29
- [p.Occupy, p.Guest].includes((r = (a = h().layoutState) == null ? void 0 : a.pageStatus) == null ? void 0 : r.state) && (t.value || S.confirm({
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(e, {
36
+ }, [c(s, {
36
37
  name: "warning"
37
38
  }, null), c("span", null, ["您确定要清除屏幕吗?"])])])]
38
- }).then((i) => {
39
- i === "confirm" && n();
39
+ }).then((p) => {
40
+ p === "confirm" && e();
40
41
  }));
41
42
  },
42
43
  isLock: t
43
44
  };
44
45
  }
45
- }, w = (s, e) => {
46
- const o = s.__vccOpts || s;
47
- for (const [n, t] of e)
48
- o[n] = t;
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
- }, E = { class: "toolbar-itm-clean" };
51
- function I(s, e, o, n, t, m) {
52
- const a = l("svg-icon"), r = l("tiny-popover");
53
- return f(), _("div", E, [
54
- c(r, {
55
- trigger: "hover",
56
- "open-delay": 1e3,
57
- "popper-class": "toolbar-right-popover",
58
- "append-to-body": "",
59
- content: "清除屏幕"
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 P = /* @__PURE__ */ w(L, [["render", I]]), T = {
63
+ const L = /* @__PURE__ */ x(S, [["render", A]]), T = {
74
64
  id: "engine.toolbars.clean",
75
65
  type: "toolbars",
76
66
  title: "clean",
77
- icon: "",
78
- align: "right"
79
- }, O = {
67
+ options: {
68
+ icon: {
69
+ default: "clear"
70
+ },
71
+ renderType: "icon"
72
+ }
73
+ }, G = {
80
74
  ...T,
81
- entry: P
75
+ entry: L
82
76
  };
83
77
  export {
84
- O as default
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.2",
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-meta-register": "2.0.0-alpha.2",
28
- "@opentiny/tiny-engine-utils": "2.0.0-alpha.2"
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.2",
32
- "@vitejs/plugin-vue": "^4.2.3",
33
- "@vitejs/plugin-vue-jsx": "^3.1.0",
34
- "vite": "^4.3.7"
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": "695ecd00f21aa39965a9ddb02590ae274f92cd8e"
42
+ "gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
41
43
  }