@opentiny/tiny-engine-toolbar-breadcrumb 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 +94 -80
- package/dist/style.css +1 -1
- package/package.json +11 -10
package/dist/index.js
CHANGED
|
@@ -1,126 +1,140 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as
|
|
2
|
+
import { reactive as E, computed as S, resolveComponent as c, openBlock as i, createBlock as B, withCtx as m, createElementVNode as D, normalizeClass as C, createVNode as k, createElementBlock as N, Fragment as O, renderList as I, createTextVNode as v, toDisplayString as x, createCommentVNode as A, ref as L } from "vue";
|
|
3
3
|
import { Breadcrumb as V, BreadcrumbItem as K, Button as P } from "@opentiny/vue";
|
|
4
4
|
import { useLayout as X, useBreadcrumb as w, HOOK_NAME as G } from "@opentiny/tiny-engine-meta-register";
|
|
5
|
-
import { BlockDeployDialog as h } from "@opentiny/tiny-engine-common";
|
|
5
|
+
import { BlockDeployDialog as h, ToolbarBase as z } from "@opentiny/tiny-engine-common";
|
|
6
6
|
const M = (o, t) => {
|
|
7
7
|
const n = o.__vccOpts || o;
|
|
8
8
|
for (const [e, a] of t)
|
|
9
9
|
n[e] = a;
|
|
10
10
|
return n;
|
|
11
|
-
},
|
|
11
|
+
}, U = {
|
|
12
12
|
components: {
|
|
13
13
|
TinyBreadcrumb: V,
|
|
14
14
|
TinyBreadcrumbItem: K,
|
|
15
15
|
BlockDeployDialog: h,
|
|
16
|
-
TinyButton: P
|
|
16
|
+
TinyButton: P,
|
|
17
|
+
ToolbarBase: z
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
options: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => ({})
|
|
23
|
+
}
|
|
17
24
|
},
|
|
18
25
|
setup() {
|
|
19
26
|
const o = {
|
|
20
27
|
PAGEID: "engine.plugins.appmanage",
|
|
21
28
|
BLOCKID: "engine.plugins.blockmanage"
|
|
22
|
-
}, { layoutState: t } = X(), { plugins: n } = t || {}, e =
|
|
29
|
+
}, { layoutState: t } = X(), { plugins: n } = t || {}, e = E({
|
|
23
30
|
showDeployBlock: !1
|
|
24
|
-
}), { CONSTANTS: a, getBreadcrumbData:
|
|
31
|
+
}), { CONSTANTS: a, getBreadcrumbData: b } = w(), s = b(), d = () => {
|
|
25
32
|
e.showDeployBlock = !0;
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
return
|
|
30
|
-
const g = new Date(
|
|
31
|
-
g >
|
|
32
|
-
}),
|
|
33
|
+
}, u = S(() => {
|
|
34
|
+
const p = b().value[2] || [];
|
|
35
|
+
let r = "1.0.0", f = 0;
|
|
36
|
+
return p.forEach((l) => {
|
|
37
|
+
const g = new Date(l.created_at).getTime();
|
|
38
|
+
g > f && (f = g, r = l.version);
|
|
39
|
+
}), r.replace(/\d+$/, (l) => Number(l) + 1);
|
|
33
40
|
});
|
|
34
41
|
return {
|
|
35
|
-
breadcrumbData:
|
|
36
|
-
publishBlock:
|
|
42
|
+
breadcrumbData: s,
|
|
43
|
+
publishBlock: d,
|
|
37
44
|
state: e,
|
|
38
|
-
nextVersion:
|
|
45
|
+
nextVersion: u,
|
|
39
46
|
CONSTANTS: a,
|
|
40
47
|
open: () => {
|
|
41
|
-
n && (n.render =
|
|
48
|
+
n && (n.render = s.value[0] === a.PAGETEXT ? o.PAGEID : o.BLOCKID);
|
|
42
49
|
}
|
|
43
50
|
};
|
|
44
51
|
}
|
|
45
|
-
},
|
|
46
|
-
function F(o, t, n, e, a,
|
|
47
|
-
const
|
|
48
|
-
return i(),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
}, j = { class: "top-panel-breadcrumb" };
|
|
53
|
+
function F(o, t, n, e, a, b) {
|
|
54
|
+
const s = c("tiny-breadcrumb-item"), d = c("tiny-breadcrumb"), u = c("tiny-button"), y = c("block-deploy-dialog"), p = c("toolbar-base");
|
|
55
|
+
return i(), B(p, { options: n.options }, {
|
|
56
|
+
default: m(() => [
|
|
57
|
+
D("div", j, [
|
|
58
|
+
D("div", {
|
|
59
|
+
class: C([
|
|
60
|
+
"top-panel-breadcrumb-title",
|
|
61
|
+
{ "top-panel-breadcrumb-title-block": e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT }
|
|
62
|
+
])
|
|
63
|
+
}, [
|
|
64
|
+
k(d, {
|
|
65
|
+
separator: ":",
|
|
66
|
+
onSelect: e.open
|
|
67
|
+
}, {
|
|
68
|
+
default: m(() => [
|
|
69
|
+
(i(!0), N(O, null, I(e.breadcrumbData.slice(0, 2), (r) => (i(), B(s, { key: r }, {
|
|
70
|
+
default: m(() => [
|
|
71
|
+
v(x(r), 1)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1024))), 128))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["onSelect"])
|
|
78
|
+
], 2),
|
|
79
|
+
e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT ? (i(), B(u, {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "publish",
|
|
82
|
+
onClick: t[0] || (t[0] = (r) => e.publishBlock()),
|
|
83
|
+
type: "primary",
|
|
84
|
+
size: "small"
|
|
59
85
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
S(I(r), 1)
|
|
64
|
-
]),
|
|
65
|
-
_: 2
|
|
66
|
-
}, 1024))), 128))
|
|
67
|
-
]),
|
|
86
|
+
default: m(() => t[2] || (t[2] = [
|
|
87
|
+
v("发布区块 ")
|
|
88
|
+
])),
|
|
68
89
|
_: 1
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
size: "small"
|
|
77
|
-
}, {
|
|
78
|
-
default: d(() => t[2] || (t[2] = [
|
|
79
|
-
S("区块")
|
|
80
|
-
])),
|
|
81
|
-
_: 1
|
|
82
|
-
})) : A("", !0)
|
|
90
|
+
})) : A("", !0)
|
|
91
|
+
]),
|
|
92
|
+
k(y, {
|
|
93
|
+
visible: e.state.showDeployBlock,
|
|
94
|
+
"onUpdate:visible": t[1] || (t[1] = (r) => e.state.showDeployBlock = r),
|
|
95
|
+
nextVersion: e.nextVersion
|
|
96
|
+
}, null, 8, ["visible", "nextVersion"])
|
|
83
97
|
]),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"onUpdate:visible": t[1] || (t[1] = (r) => e.state.showDeployBlock = r),
|
|
87
|
-
nextVersion: e.nextVersion
|
|
88
|
-
}, null, 8, ["visible", "nextVersion"])
|
|
89
|
-
], 64);
|
|
98
|
+
_: 1
|
|
99
|
+
}, 8, ["options"]);
|
|
90
100
|
}
|
|
91
|
-
const H = /* @__PURE__ */ M(
|
|
101
|
+
const H = /* @__PURE__ */ M(U, [["render", F], ["__scopeId", "data-v-ef2dd37f"]]), q = {
|
|
92
102
|
id: "engine.toolbars.breadcrumb",
|
|
93
103
|
type: "toolbars",
|
|
94
104
|
title: "breadcrumb",
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
options: {
|
|
106
|
+
icon: {
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
|
+
renderType: "slot"
|
|
110
|
+
}
|
|
97
111
|
};
|
|
98
|
-
let
|
|
99
|
-
const
|
|
112
|
+
let _ = L([]);
|
|
113
|
+
const T = {
|
|
100
114
|
PAGETEXT: "页面",
|
|
101
115
|
BLOCKTEXT: "区块"
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
CONSTANTS:
|
|
108
|
-
setBreadcrumbPage:
|
|
109
|
-
setBreadcrumbBlock:
|
|
110
|
-
getBreadcrumbData:
|
|
111
|
-
}),
|
|
116
|
+
}, J = (o) => {
|
|
117
|
+
_.value = [T.PAGETEXT, ...o], sessionStorage.setItem("pageInfo", o);
|
|
118
|
+
}, Q = (o, t = []) => {
|
|
119
|
+
_.value = [T.BLOCKTEXT, ...o, t];
|
|
120
|
+
}, R = () => _, W = () => ({
|
|
121
|
+
CONSTANTS: T,
|
|
122
|
+
setBreadcrumbPage: J,
|
|
123
|
+
setBreadcrumbBlock: Q,
|
|
124
|
+
getBreadcrumbData: R
|
|
125
|
+
}), Y = {
|
|
112
126
|
id: "engine.service.breadcrumb",
|
|
113
127
|
type: "MetaService",
|
|
114
|
-
apis:
|
|
128
|
+
apis: W(),
|
|
115
129
|
composable: {
|
|
116
130
|
name: G.useBreadcrumb
|
|
117
131
|
}
|
|
118
|
-
},
|
|
119
|
-
...
|
|
132
|
+
}, re = {
|
|
133
|
+
...q,
|
|
120
134
|
entry: H,
|
|
121
|
-
metas: [
|
|
135
|
+
metas: [Y]
|
|
122
136
|
};
|
|
123
137
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
138
|
+
Y as BreadcrumbService,
|
|
139
|
+
re as default
|
|
126
140
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.top-panel-breadcrumb[data-v-
|
|
1
|
+
.top-panel-breadcrumb[data-v-ef2dd37f]{padding-left:12px;box-sizing:border-box;display:flex;justify-content:flex-start;align-items:center;width:auto;height:100%;margin-right:3px;cursor:pointer}.top-panel-breadcrumb-title[data-v-ef2dd37f]{height:28px;padding:0 8px;background-color:var(--ti-lowcode-toolbar-button-bg);display:flex;border-radius:4px}.top-panel-breadcrumb-title[data-v-ef2dd37f] .reference-wrapper{line-height:22px}.top-panel-breadcrumb .tiny-breadcrumb[data-v-ef2dd37f]{line-height:var(--base-top-panel-breadcrumb-line-height);padding-right:4px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;cursor:inherit}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f]{cursor:inherit;-webkit-user-select:none;user-select:none}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__inner{color:var(--ti-lowcode-media-popover-title-color);text-decoration:none;cursor:pointer}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__separator{padding:0;margin:0 4px 0 0}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f]:last-child .tiny-breadcrumb__inner{font-weight:400;color:var(--ti-lowcode-media-popover-title-color)}.top-panel-breadcrumb-title-block[data-v-ef2dd37f]{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-ef2dd37f]:last-child .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block[data-v-ef2dd37f]:hover{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg-hover)}.top-panel-breadcrumb .publish[data-v-ef2dd37f]{margin-left:8px;height:28px;line-height:28px}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-breadcrumb",
|
|
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,20 +25,20 @@
|
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@opentiny/tiny-engine-common": "2.0.0-alpha.
|
|
28
|
-
"@opentiny/tiny-engine-http": "2.0.0-alpha.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.
|
|
30
|
-
"@opentiny/tiny-engine-utils": "2.0.0-alpha.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.0.0-alpha.3",
|
|
29
|
+
"@opentiny/tiny-engine-http": "2.0.0-alpha.3",
|
|
30
|
+
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3",
|
|
31
|
+
"@opentiny/tiny-engine-utils": "2.0.0-alpha.3"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.
|
|
34
|
-
"@vitejs/plugin-vue": "^
|
|
35
|
-
"@vitejs/plugin-vue-jsx": "^
|
|
36
|
-
"vite": "^4.
|
|
34
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
|
|
35
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
36
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
37
|
+
"vite": "^5.4.2"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"@opentiny/vue": "^3.14.0",
|
|
40
41
|
"vue": "^3.4.15"
|
|
41
42
|
},
|
|
42
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
|
|
43
44
|
}
|