@opentiny/tiny-robot 0.3.0-rc.4 → 0.3.0-rc.6

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as v, computed as y, createBlock as u, openBlock as t, Transition as F, withCtx as m, createElementBlock as o, createCommentVNode as h, normalizeStyle as _, normalizeClass as w, renderSlot as x, createElementVNode as l, toDisplayString as s, Fragment as D, renderList as B } from "vue";
2
- import { a as M } from "../index2.js";
1
+ import { defineComponent as v, computed as y, createBlock as u, openBlock as t, Transition as F, withCtx as m, createElementBlock as r, createCommentVNode as h, normalizeStyle as x, normalizeClass as _, renderSlot as w, createElementVNode as l, toDisplayString as n, Fragment as D, renderList as B } from "vue";
2
+ import { a as M } from "../index3.js";
3
3
  import { _ as Z } from "../_plugin-vue_export-helper.js";
4
4
  const k = "data:image/svg+xml,%3csvg%20width='80.000000'%20height='80.000000'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs/%3e%3crect%20width='80.000000'%20height='80.000000'%20fill='%23FFFFFF'%20fill-opacity='0'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M6%2047.27L24.56%2029.06C25.73%2027.91%2027.6%2027.91%2028.77%2029.06L44.52%2044.51C45.69%2045.66%2047.56%2045.66%2048.72%2044.51L56.64%2036.75C57.8%2035.6%2059.67%2035.6%2060.84%2036.75L74%2049.67L74%2062C74%2064.76%2071.76%2067%2069%2067L11%2067C8.23%2067%206%2064.76%206%2062L6%2047.27Z'%20fill='%23F0F0F0'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d=''%20fill='%23808080'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cellipse%20cx='40.000000'%20cy='40.000000'%20rx='8.000001'%20ry='8.000002'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3cpath%20d='M40%2035.5C40.27%2035.5%2040.5%2035.72%2040.5%2036L40.5%2039.49L44%2039.5C44.27%2039.5%2044.5%2039.72%2044.5%2040C44.5%2040.27%2044.27%2040.5%2044%2040.5L40.5%2040.5L40.5%2044C40.5%2044.27%2040.27%2044.5%2040%2044.5C39.72%2044.5%2039.5%2044.27%2039.5%2044L39.5%2040.5L36%2040.5C35.72%2040.5%2035.5%2040.27%2035.5%2040C35.5%2039.72%2035.72%2039.5%2036%2039.5L39.5%2039.5L39.5%2036C39.5%2035.72%2039.72%2035.5%2040%2035.5Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3ccircle%20cx='58.000000'%20cy='27.000000'%20r='5.000000'%20fill='%23DBDBDB'%20fill-opacity='1.000000'/%3e%3c/svg%3e", T = { class: "tr-drag-overlay__content" }, $ = { class: "tr-drag-overlay__text" }, S = { class: "tr-drag-overlay__title" }, E = { class: "tr-drag-overlay__description" }, z = /* @__PURE__ */ v({
5
5
  __name: "index",
@@ -10,33 +10,33 @@ const k = "data:image/svg+xml,%3csvg%20width='80.000000'%20height='80.000000'%20
10
10
  dragTarget: {},
11
11
  fullscreen: { type: Boolean }
12
12
  },
13
- setup(r) {
14
- const a = r, { top: c, left: d, width: p, height: C } = M(() => a.dragTarget), f = y(() => !a.isDragging || !a.dragTarget ? { display: "none" } : {
13
+ setup(e) {
14
+ const a = e, { top: c, left: s, width: d, height: C } = M(() => a.dragTarget), f = y(() => !a.isDragging || !a.dragTarget ? { display: "none" } : {
15
15
  position: "fixed",
16
16
  top: `${c.value}px`,
17
- left: `${d.value}px`,
18
- width: `${p.value}px`,
17
+ left: `${s.value}px`,
18
+ width: `${d.value}px`,
19
19
  height: `${C.value}px`
20
20
  });
21
- return (e, n) => (t(), u(F, { name: "tr-fade" }, {
21
+ return (g, o) => (t(), u(F, { name: "tr-fade" }, {
22
22
  default: m(() => [
23
- e.isDragging ? (t(), o("div", {
23
+ e.isDragging ? (t(), r("div", {
24
24
  key: 0,
25
- class: w(["tr-drag-overlay", { fullscreen: e.fullscreen }]),
26
- style: _(f.value)
25
+ class: _(["tr-drag-overlay", { fullscreen: e.fullscreen }]),
26
+ style: x(f.value)
27
27
  }, [
28
- x(e.$slots, "overlay", { isDragging: e.isDragging }, () => [
28
+ w(g.$slots, "overlay", { isDragging: e.isDragging }, () => [
29
29
  l("div", T, [
30
- n[0] || (n[0] = l("div", { class: "tr-drag-overlay__icon" }, [
30
+ o[0] || (o[0] = l("div", { class: "tr-drag-overlay__icon" }, [
31
31
  l("img", {
32
32
  src: k,
33
33
  alt: "上传文件"
34
34
  })
35
35
  ], -1)),
36
36
  l("div", $, [
37
- l("div", S, s(e.overlayTitle), 1),
37
+ l("div", S, n(e.overlayTitle), 1),
38
38
  l("div", E, [
39
- (t(!0), o(D, null, B(e.overlayDescription, (g, L) => (t(), o("span", { key: L }, s(g), 1))), 128))
39
+ (t(!0), r(D, null, B(e.overlayDescription, (p, L) => (t(), r("span", { key: L }, n(p), 1))), 128))
40
40
  ])
41
41
  ])
42
42
  ])
@@ -48,8 +48,8 @@ const k = "data:image/svg+xml,%3csvg%20width='80.000000'%20height='80.000000'%20
48
48
  }
49
49
  }), i = /* @__PURE__ */ Z(z, [["__scopeId", "data-v-93553cc8"]]);
50
50
  i.name = "TrDragOverlay";
51
- const N = function(r) {
52
- r.component(i.name, i);
51
+ const N = function(e) {
52
+ e.component(i.name, i);
53
53
  };
54
54
  i.install = N;
55
55
  export {
@@ -1,6 +1,6 @@
1
1
  import { ref as k, onUnmounted as T, watch as C, defineComponent as E, mergeModels as y, useModel as H, computed as p, createBlock as I, openBlock as w, unref as X, withCtx as _, createElementVNode as j, createElementBlock as b, Fragment as D, renderList as L, toDisplayString as Y, renderSlot as O } from "vue";
2
- import { w as S, b as M, o as $ } from "../index2.js";
3
- import { B as A } from "../index3.js";
2
+ import { w as S, b as M, o as $ } from "../index3.js";
3
+ import { B as A } from "../index4.js";
4
4
  import { u as F } from "../utils.js";
5
5
  import { _ as G } from "../_plugin-vue_export-helper.js";
6
6
  const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.bottom, N = (o, t, g = !1) => {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as I, Fragment as C, renderList as D, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as S, nextTick as H } from "vue";
2
2
  import { IconArrowDown as X } from "@opentiny/tiny-robot-svgs";
3
- import { e as j, o as J } from "../index2.js";
3
+ import { d as j, o as J } from "../index3.js";
4
4
  import { _ as K } from "../_plugin-vue_export-helper.js";
5
5
  const P = ["onClick"], Q = {
6
6
  key: 0,
@@ -115,7 +115,7 @@ const P = ["onClick"], Q = {
115
115
  ])
116
116
  ], 512));
117
117
  }
118
- }), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-f82cf3dc"]]);
118
+ }), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-df81e3e1"]]);
119
119
  p.name = "TrFlowLayout";
120
120
  const te = function(d) {
121
121
  d.component(p.name, p);
@@ -1,226 +1,4 @@
1
- import { defineComponent as V, createElementBlock as u, openBlock as a, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as y, unref as e, ref as S, watchEffect as Y, nextTick as Z, mergeModels as A, useCssVars as q, computed as h, useModel as G, createCommentVNode as w, Fragment as T, renderList as $, createBlock as N, withDirectives as ee, mergeProps as te, withCtx as R, withModifiers as H, vModelText as re } from "vue";
2
- import { IconEmptySearch as oe, IconSearch as se, IconEditPen as ne, IconDelete as ae, IconClose as ie } from "@opentiny/tiny-robot-svgs";
3
- import { TinyInput as le, TinyTooltip as U } from "@opentiny/vue";
4
- import B from "../icon-button/index.js";
5
- import { o as ce } from "../index2.js";
6
- import { _ as M } from "../_plugin-vue_export-helper.js";
7
- const ue = /* @__PURE__ */ V({
8
- __name: "item-tag",
9
- props: {
10
- text: {},
11
- type: { default: "default" },
12
- style: {}
13
- },
14
- setup(i) {
15
- const t = i;
16
- return (n, _) => (a(), u("div", {
17
- class: D(["tr-history__item-tag", t.type]),
18
- style: X(t.style)
19
- }, [
20
- p("span", null, k(t.text), 1)
21
- ], 6));
22
- }
23
- }), de = /* @__PURE__ */ M(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, ye = /* @__PURE__ */ V({
24
- __name: "search-empty",
25
- props: {
26
- text: { default: "暂无内容" }
27
- },
28
- setup(i) {
29
- const t = i;
30
- return (n, _) => (a(), u("div", _e, [
31
- p("span", pe, [
32
- y(e(oe))
33
- ]),
34
- p("span", he, k(t.text), 1)
35
- ]));
36
- }
37
- }), me = /* @__PURE__ */ M(ye, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
38
- const t = S(), n = (l) => {
39
- t.value = {
40
- id: l.id,
41
- title: l.title,
42
- rawData: l
43
- };
44
- }, _ = S(null), m = (l) => {
45
- l && Z(() => {
46
- _.value = l, _.value.focus();
47
- });
48
- };
49
- let r;
50
- const v = () => {
51
- if (t.value) {
52
- if (t.value.title !== t.value.rawData.title) {
53
- const { title: l, rawData: I } = t.value;
54
- i("item-title-change", l, I);
55
- }
56
- t.value = void 0;
57
- }
58
- r == null || r(), r = void 0;
59
- }, g = () => {
60
- t.value = void 0, r == null || r(), r = void 0;
61
- }, b = (l) => {
62
- l.key === "Enter" ? v() : l.key === "Escape" && g();
63
- };
64
- return Y(() => {
65
- _.value && (r == null || r(), r = ce(_, () => {
66
- v();
67
- }));
68
- }), {
69
- editingItem: t,
70
- handleEdit: n,
71
- handleEditorInputRef: m,
72
- handleKeyDown: b
73
- };
74
- }, fe = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
75
- key: 0,
76
- class: "tr-history__search"
77
- }, Ce = { class: "tr-history__content" }, xe = {
78
- key: 0,
79
- class: "tr-history__group-title"
80
- }, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, Ee = { class: "tr-history__item-actions" }, we = { class: "tr-history__close" }, $e = /* @__PURE__ */ V({
81
- __name: "index",
82
- props: /* @__PURE__ */ A({
83
- tabTitle: {},
84
- data: {},
85
- activeTab: {},
86
- searchBar: { type: Boolean },
87
- searchQuery: {},
88
- searchPlaceholder: {},
89
- searchFn: { type: Function, default: (i, { title: t }) => i ? t.toLowerCase().includes(i.toLowerCase()) : !0 },
90
- selected: {},
91
- tabs: {}
92
- }, {
93
- activeTab: {},
94
- activeTabModifiers: {},
95
- searchQuery: {},
96
- searchQueryModifiers: {}
97
- }),
98
- emits: /* @__PURE__ */ A(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
99
- setup(i, { emit: t }) {
100
- q((c) => ({
101
- "3a9ca538": b.value ? "1px solid rgb(240, 240, 240)" : "none",
102
- "0b9d3e32": b.value ? "2px solid rgb(25, 25, 25)" : "none"
103
- }));
104
- const n = i, _ = G(i, "activeTab"), m = G(i, "searchQuery"), r = t, v = h(() => Array.isArray(n.tabs) ? n.tabs : [{ title: n.tabTitle, id: "0" }]), g = h(() => _.value || v.value[0].id), b = h(() => v.value.length > 1), l = (c) => {
105
- var s;
106
- const o = typeof ((s = c[0]) == null ? void 0 : s.group);
107
- return o === "string" || o === "symbol";
108
- }, I = h(() => Array.isArray(n.data) ? n.data || [] : n.data[g.value] || []), E = Symbol("NO_GROUP"), O = h(() => {
109
- const c = I.value;
110
- return l(c) ? c : [{ group: E, items: c }];
111
- }), C = h(() => n.searchBar ? O.value.map((o) => ({
112
- ...o,
113
- items: o.items.filter((s) => n.searchFn(m.value || "", s))
114
- })).filter((o) => o.items.length > 0) : O.value), L = h(() => C.value.length === 0 ? !1 : C.value[0].group === E ? C.value[0].items.length > 0 : !0), z = (c) => {
115
- var o;
116
- c.id !== ((o = x.value) == null ? void 0 : o.id) && r("item-click", c);
117
- }, W = () => {
118
- r("close");
119
- }, F = (c) => {
120
- r("item-delete", c);
121
- }, { editingItem: x, handleEdit: j, handleEditorInputRef: J, handleKeyDown: P } = ve(r);
122
- return (c, o) => (a(), u("div", fe, [
123
- p("div", ke, [
124
- (a(!0), u(T, null, $(v.value, (s) => (a(), u("div", {
125
- key: s.id,
126
- class: D(["tr-history__tab", { active: g.value === s.id }]),
127
- onClick: (d) => _.value = s.id
128
- }, k(s.title), 11, ge))), 128))
129
- ]),
130
- n.searchBar ? (a(), u("div", be, [
131
- y(e(le), {
132
- modelValue: m.value,
133
- "onUpdate:modelValue": o[0] || (o[0] = (s) => m.value = s),
134
- placeholder: n.searchPlaceholder || "搜索对话名称",
135
- "prefix-icon": e(se),
136
- clearable: ""
137
- }, null, 8, ["modelValue", "placeholder", "prefix-icon"])
138
- ])) : w("", !0),
139
- p("div", Ce, [
140
- L.value ? (a(!0), u(T, { key: 0 }, $(C.value, (s) => (a(), u("div", {
141
- key: s.group,
142
- class: "tr-history__group"
143
- }, [
144
- s.group !== e(E) ? (a(), u("div", xe, [
145
- p("span", null, k(s.group), 1)
146
- ])) : w("", !0),
147
- (a(!0), u(T, null, $(s.items, (d) => {
148
- var Q;
149
- return a(), u("div", {
150
- key: `${d.id}-${d.title}`,
151
- class: D(["tr-history__item", { selected: n.selected === d.id }]),
152
- onClick: (f) => z(d)
153
- }, [
154
- ((Q = e(x)) == null ? void 0 : Q.id) !== d.id ? (a(), u(T, { key: 0 }, [
155
- p("span", Ie, k(d.title), 1),
156
- d.tag ? (a(), N(e(de), te({
157
- key: 0,
158
- class: "tr-history__item-tag"
159
- }, { ref_for: !0 }, d.tag), null, 16)) : w("", !0),
160
- p("div", Ee, [
161
- y(e(U), {
162
- content: "编辑",
163
- effect: "dark",
164
- placement: "top",
165
- "open-delay": 500
166
- }, {
167
- default: R(() => [
168
- y(e(B), {
169
- icon: e(ne),
170
- onClick: H((f) => e(j)(d), ["stop"])
171
- }, null, 8, ["icon", "onClick"])
172
- ]),
173
- _: 2
174
- }, 1024),
175
- y(e(U), {
176
- content: "删除",
177
- effect: "dark",
178
- placement: "top",
179
- "open-delay": 500
180
- }, {
181
- default: R(() => [
182
- y(e(B), {
183
- icon: e(ae),
184
- onClick: H((f) => F(d), ["stop"])
185
- }, null, 8, ["icon", "onClick"])
186
- ]),
187
- _: 2
188
- }, 1024)
189
- ])
190
- ], 64)) : ee((a(), u("input", {
191
- key: 1,
192
- "onUpdate:modelValue": o[1] || (o[1] = (f) => e(x).title = f),
193
- class: "tr-history__item-edit",
194
- ref_for: !0,
195
- ref: e(J),
196
- onKeydown: o[2] || (o[2] = //@ts-ignore
197
- (...f) => e(P) && e(P)(...f))
198
- }, null, 544)), [
199
- [re, e(x).title]
200
- ])
201
- ], 10, Te);
202
- }), 128))
203
- ]))), 128)) : (a(), N(e(me), {
204
- key: 1,
205
- text: m.value ? "暂无搜索结果" : "暂无内容"
206
- }, null, 8, ["text"]))
207
- ]),
208
- p("div", we, [
209
- y(e(B), {
210
- icon: e(ie),
211
- rounded: "",
212
- onClick: W
213
- }, null, 8, ["icon"])
214
- ])
215
- ]));
216
- }
217
- }), K = /* @__PURE__ */ M($e, [["__scopeId", "data-v-87ea1242"]]), Be = function(i) {
218
- i.component("TrHistory", K);
219
- }, Se = {
220
- ...K,
221
- install: Be,
222
- name: "TrHistory"
223
- };
1
+ import { H as f } from "../index2.js";
224
2
  export {
225
- Se as default
3
+ f as default
226
4
  };