@opentiny/tiny-engine-toolbar-breadcrumb 1.0.1

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 ADDED
@@ -0,0 +1,84 @@
1
+ import "./style.css";
2
+ import { reactive as k, computed as v, resolveComponent as i, openBlock as m, createElementBlock as p, Fragment as _, createElementVNode as T, createVNode as y, withCtx as u, renderList as D, createBlock as f, createTextVNode as B, toDisplayString as x, createCommentVNode as g } from "vue";
3
+ import { Breadcrumb as N, BreadcrumbItem as V, Button as h } from "@opentiny/vue";
4
+ import { useBreadcrumb as C } from "@opentiny/tiny-engine-controller";
5
+ import { BlockDeployDialog as w } from "@opentiny/tiny-engine-common";
6
+ const S = (r, t) => {
7
+ const n = r.__vccOpts || r;
8
+ for (const [e, a] of t)
9
+ n[e] = a;
10
+ return n;
11
+ }, E = {
12
+ components: {
13
+ TinyBreadcrumb: N,
14
+ TinyBreadcrumbItem: V,
15
+ BlockDeployDialog: w,
16
+ TinyButton: h
17
+ },
18
+ setup() {
19
+ const r = k({
20
+ showDeployBlock: !1
21
+ }), { CONSTANTS: t, getBreadcrumbData: n } = C(), e = n(), a = () => {
22
+ r.showDeployBlock = !0;
23
+ }, b = v(() => {
24
+ const d = n().value[2] || [];
25
+ let l = "1.0.0", s = 0;
26
+ return d.forEach((c) => {
27
+ const o = new Date(c.created_at).getTime();
28
+ o > s && (s = o, l = c.version);
29
+ }), l.replace(/\d+$/, (c) => Number(c) + 1);
30
+ });
31
+ return {
32
+ breadcrumbData: e,
33
+ publishBlock: a,
34
+ state: r,
35
+ nextVersion: b,
36
+ CONSTANTS: t
37
+ };
38
+ }
39
+ }, O = { class: "top-panel-breadcrumb" };
40
+ function I(r, t, n, e, a, b) {
41
+ const d = i("tiny-breadcrumb-item"), l = i("tiny-breadcrumb"), s = i("tiny-button"), c = i("block-deploy-dialog");
42
+ return m(), p(_, null, [
43
+ T("div", O, [
44
+ y(l, { separator: ":" }, {
45
+ default: u(() => [
46
+ (m(!0), p(_, null, D(e.breadcrumbData.slice(0, 2), (o) => (m(), f(d, { key: o }, {
47
+ default: u(() => [
48
+ B(x(o), 1)
49
+ ]),
50
+ _: 2
51
+ }, 1024))), 128))
52
+ ]),
53
+ _: 1
54
+ }),
55
+ e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT ? (m(), f(s, {
56
+ key: 0,
57
+ class: "publish",
58
+ onClick: t[0] || (t[0] = (o) => e.publishBlock()),
59
+ type: "primary",
60
+ size: "small"
61
+ }, {
62
+ default: u(() => [
63
+ B("发布区块")
64
+ ]),
65
+ _: 1
66
+ })) : g("", !0)
67
+ ]),
68
+ y(c, {
69
+ visible: e.state.showDeployBlock,
70
+ "onUpdate:visible": t[1] || (t[1] = (o) => e.state.showDeployBlock = o),
71
+ nextVersion: e.nextVersion
72
+ }, null, 8, ["visible", "nextVersion"])
73
+ ], 64);
74
+ }
75
+ const L = /* @__PURE__ */ S(E, [["render", I], ["__scopeId", "data-v-a3e6939f"]]), U = {
76
+ id: "breadcrumb",
77
+ title: "breadcrumb",
78
+ icon: "",
79
+ align: "left",
80
+ component: L
81
+ };
82
+ export {
83
+ U as default
84
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .top-panel-breadcrumb[data-v-a3e6939f]{display:flex;justify-content:flex-start;align-items:center;width:auto;height:100%}.top-panel-breadcrumb .breadcrumb-label[data-v-a3e6939f]{color:var(--ti-lowcode-toolbar-title-color);border-right:1px solid var(--ti-lowcode-toolbar-border-color);margin:0 6px;padding-right:6px;line-height:1}.top-panel-breadcrumb .tiny-breadcrumb[data-v-a3e6939f]{height:100%;line-height:var(--base-top-panel-height);padding:0 24px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;cursor:inherit}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-a3e6939f]{cursor:inherit;-webkit-user-select:none;user-select:none}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-a3e6939f] .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-title-color);text-decoration:none}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-a3e6939f] .tiny-breadcrumb__separator{padding:0;margin:0}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-a3e6939f]:last-child .tiny-breadcrumb__inner{font-weight:400;color:var(--ti-lowcode-toolbar-title-color)}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@opentiny/tiny-engine-toolbar-breadcrumb",
3
+ "version": "1.0.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "scripts": {
8
+ "build": "vite build"
9
+ },
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.js",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "dependencies": {
16
+ "@opentiny/tiny-engine-controller": "^1.0.0",
17
+ "@opentiny/vue": "^3.8.0",
18
+ "vue": "3.2.45"
19
+ },
20
+ "devDependencies": {
21
+ "@vitejs/plugin-vue": "^4.2.3",
22
+ "@vitejs/plugin-vue-jsx": "^1.3.10",
23
+ "vite": "^4.3.7"
24
+ }
25
+ }