officialblock 2.1.0 → 2.1.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "officialblock",
3
3
  "private": false,
4
- "version": "2.1.0",
4
+ "version": "2.1.2",
5
5
  "description": "A Vue 3 article list component library",
6
6
  "author": "Your Name",
7
7
  "license": "MIT",
@@ -1,414 +0,0 @@
1
- import { defineComponent as X, defineAsyncComponent as Z, ref as C, computed as w, resolveComponent as g, createBlock as L, openBlock as h, withCtx as r, createElementVNode as a, createVNode as s, createTextVNode as V, unref as R, mergeProps as ee, createElementBlock as D, normalizeClass as $, toDisplayString as F, createCommentVNode as E, getCurrentInstance as te, watch as q, onMounted as ae, normalizeStyle as ne, withDirectives as z, Fragment as oe, renderList as le, vShow as M } from "vue";
2
- import { P as se, r as T, _ as j, u as de, a as ie, T as ue, b as re, c as me, O as ce, $ as pe } from "./index-C_l0k6dm.mjs";
3
- const ve = { class: "setting-content" }, fe = { class: "setting-header flex items-center" }, ye = { class: "setting-body" }, be = { class: "setting-toolbar" }, ge = { class: "tools" }, Ve = { class: "setting-item" }, we = { class: "item-header" }, he = { class: "btn-group" }, ke = {
4
- key: 0,
5
- class: "drag-handle"
6
- }, Ce = { class: "components-content" }, xe = /* @__PURE__ */ X({
7
- __name: "setting",
8
- props: {
9
- show: {
10
- type: Boolean,
11
- default: !1
12
- },
13
- data: {
14
- type: Object,
15
- default: () => {
16
- }
17
- }
18
- },
19
- emits: ["update:show"],
20
- setup(l, { emit: H }) {
21
- const B = Z(() => import("vuedraggable")), f = C(!1), J = w(() => ({
22
- animation: 200,
23
- group: "gallerys",
24
- disabled: !1,
25
- ghostClass: "ghost",
26
- handle: ".drag-handle",
27
- filter: ".arco-input, .arco-select, .arco-checkbox",
28
- preventOnFilter: !1
29
- })), S = (i) => i && i.length > 1, P = l, d = H, K = () => {
30
- d("update:show", !1);
31
- }, c = (i) => {
32
- P.data.data.push({
33
- id: T(),
34
- type: "Video",
35
- videoSrc: "",
36
- imgSrc: "",
37
- name: "",
38
- key: "",
39
- componentsDataJson: []
40
- });
41
- }, O = (i) => {
42
- P.data.data = P.data.data.filter((e) => e.id !== i);
43
- };
44
- return (i, e) => {
45
- const y = g("a-option"), p = g("a-select"), x = g("icon-plus"), k = g("a-button"), _ = g("icon-drag-arrow"), A = g("icon-delete"), I = g("a-input"), U = g("a-drawer");
46
- return h(), L(U, {
47
- width: "60%",
48
- visible: l.show,
49
- footer: !1,
50
- onCancel: K,
51
- unmountOnClose: ""
52
- }, {
53
- title: r(() => [
54
- V(F(l.data.type) + "组件编辑 ", 1)
55
- ]),
56
- default: r(() => [
57
- a("div", ve, [
58
- a("div", fe, [
59
- e[11] || (e[11] = a("span", { class: "header-title" }, "组件宽度", -1)),
60
- s(p, {
61
- modelValue: l.data.width,
62
- "onUpdate:modelValue": e[0] || (e[0] = (o) => l.data.width = o),
63
- placeholder: "请选择",
64
- "allow-clear": ""
65
- }, {
66
- default: r(() => [
67
- s(y, { value: "default" }, {
68
- default: r(() => [...e[7] || (e[7] = [
69
- V("默认", -1)
70
- ])]),
71
- _: 1
72
- }),
73
- s(y, { value: "small" }, {
74
- default: r(() => [...e[8] || (e[8] = [
75
- V("小", -1)
76
- ])]),
77
- _: 1
78
- }),
79
- s(y, { value: "medium" }, {
80
- default: r(() => [...e[9] || (e[9] = [
81
- V("中", -1)
82
- ])]),
83
- _: 1
84
- }),
85
- s(y, { value: "max" }, {
86
- default: r(() => [...e[10] || (e[10] = [
87
- V("大", -1)
88
- ])]),
89
- _: 1
90
- })
91
- ]),
92
- _: 1
93
- }, 8, ["modelValue"])
94
- ]),
95
- a("div", ye, [
96
- a("div", be, [
97
- e[14] || (e[14] = a("h4", null, "List", -1)),
98
- a("div", ge, [
99
- s(k, {
100
- type: "primary",
101
- onClick: e[1] || (e[1] = (o) => c())
102
- }, {
103
- icon: r(() => [
104
- s(x)
105
- ]),
106
- default: r(() => [
107
- e[12] || (e[12] = V(" 添加 Tab ", -1))
108
- ]),
109
- _: 1
110
- }),
111
- s(k, {
112
- type: "primary",
113
- onClick: e[2] || (e[2] = (o) => c())
114
- }, {
115
- default: r(() => [...e[13] || (e[13] = [
116
- V("粘贴 Tab", -1)
117
- ])]),
118
- _: 1
119
- })
120
- ])
121
- ]),
122
- a("div", Ve, [
123
- s(R(B), ee({
124
- modelValue: l.data.data,
125
- "onUpdate:modelValue": e[4] || (e[4] = (o) => l.data.data = o),
126
- "component-data": {
127
- tag: "div",
128
- type: "transition-group",
129
- name: f.value ? null : "flip-list"
130
- }
131
- }, J.value, {
132
- disabled: !S(l.data.data),
133
- onStart: e[5] || (e[5] = (o) => f.value = !0),
134
- onEnd: e[6] || (e[6] = (o) => f.value = !1),
135
- "item-key": "id"
136
- }), {
137
- item: r(({ element: o }) => [
138
- (h(), D("div", {
139
- class: $(["item-button draggable-item", {
140
- "sortable-disabled": !S(l.data.data)
141
- }]),
142
- key: o.id
143
- }, [
144
- a("div", we, [
145
- a("div", null, [
146
- a("h5", null, F(o.name), 1),
147
- a("span", null, F(o.key), 1)
148
- ]),
149
- a("div", he, [
150
- S(l.data.data) ? (h(), D("div", ke, [
151
- s(_, { class: "drag-icon" })
152
- ])) : E("", !0),
153
- s(A, {
154
- class: "btn-delete",
155
- onClick: (v) => O(o.id)
156
- }, null, 8, ["onClick"]),
157
- s(k, {
158
- size: "mini",
159
- type: "primary",
160
- onClick: e[3] || (e[3] = (v) => c())
161
- }, {
162
- default: r(() => [...e[15] || (e[15] = [
163
- V("复制 Tab", -1)
164
- ])]),
165
- _: 1
166
- })
167
- ])
168
- ]),
169
- e[16] || (e[16] = a("p", { class: "item-title" }, "Tab名称", -1)),
170
- s(I, {
171
- modelValue: o.name,
172
- "onUpdate:modelValue": (v) => o.name = v,
173
- placeholder: "请输入标题",
174
- "allow-clear": ""
175
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
176
- e[17] || (e[17] = a("p", { class: "item-title" }, "Key", -1)),
177
- s(I, {
178
- modelValue: o.key,
179
- "onUpdate:modelValue": (v) => o.key = v,
180
- placeholder: "请输入key",
181
- "allow-clear": ""
182
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
183
- e[18] || (e[18] = a("p", null, "components", -1)),
184
- a("div", Ce, [
185
- s(se, {
186
- data: o.componentsDataJson,
187
- onUpdate: (v) => o.componentsDataJson = v
188
- }, null, 8, ["data", "onUpdate"])
189
- ])
190
- ], 2))
191
- ]),
192
- _: 1
193
- }, 16, ["modelValue", "component-data", "disabled"])
194
- ])
195
- ])
196
- ])
197
- ]),
198
- _: 1
199
- }, 8, ["visible"]);
200
- };
201
- }
202
- }), _e = /* @__PURE__ */ j(xe, [["__scopeId", "data-v-f4b12dfa"]]), $e = { class: "tab-default__content" }, Te = {
203
- "data-aos": "fade-in",
204
- "data-aos-duration": "1500",
205
- class: "aos-init aos-animate"
206
- }, De = { class: "component-wrapper" }, Se = { class: "tab-timeline__mobile" }, Pe = {
207
- __name: "index",
208
- props: {
209
- modelValue: {
210
- type: Object,
211
- default: () => {
212
- }
213
- },
214
- // 是否预览
215
- isPreview: {
216
- type: Boolean,
217
- default: !0
218
- }
219
- },
220
- emits: ["update:modelValue", "handleDelete", "handleCopy", "handlePaste"],
221
- setup(l, { emit: H }) {
222
- const { proxy: B } = te(), { $_vsWidth: f, $_vsScrollY: J, $vsScreenAddListener: S, $vsScreenDestroyListener: P } = B, d = l, K = H, c = de(), O = ie(), i = C(null), e = C(null), y = w(() => {
223
- var t;
224
- return (t = d.modelValue) == null ? void 0 : t.data;
225
- }), p = C(0), x = C(!1), k = C(!1), _ = C(!1), A = w(() => {
226
- var t;
227
- return ((t = d.modelValue) == null ? void 0 : t.classes) ?? null;
228
- }), I = w(() => {
229
- var t;
230
- return ((t = d.modelValue) == null ? void 0 : t.style) ?? null;
231
- });
232
- w(() => {
233
- var t;
234
- return (t = d.modelValue) == null ? void 0 : t.width;
235
- });
236
- const U = w(() => {
237
- var t;
238
- return (t = d.modelValue) == null ? void 0 : t.id;
239
- }), o = w(() => {
240
- var t;
241
- return (t = d.modelValue) != null && t.bgColor ? d.modelValue.bgColor : f.value >= 768 ? "bg-neutral-lightest" : null;
242
- }), v = w(() => {
243
- var n;
244
- if (!((n = d.modelValue) != null && n.data) || !Array.isArray(d.modelValue.data))
245
- return [];
246
- const t = d.modelValue.data[p.value];
247
- return t ? t.componentsDataJson || [] : [];
248
- }), W = () => {
249
- var n;
250
- if (d.modelValue && d.modelValue.data) {
251
- setTimeout(() => {
252
- var u;
253
- selectTab((u = d.modelValue) == null ? void 0 : u.data[0].id);
254
- }, 0);
255
- return;
256
- }
257
- const t = {
258
- id: ((n = d.modelValue) == null ? void 0 : n.id) || T(),
259
- //componentKey
260
- type: "TabTimeLine",
261
- containerWidth: "",
262
- bgColor: "",
263
- classes: "custom-class another-class",
264
- style: {
265
- // marginTop: "20px",
266
- // backgroundColor: "#f5f5f5",
267
- },
268
- width: "container-content-middle",
269
- data: [
270
- //list
271
- {
272
- id: T(),
273
- key: "11111111",
274
- name: "tab1",
275
- componentsDataJson: []
276
- },
277
- {
278
- id: T(),
279
- key: "2222",
280
- name: "tab2",
281
- componentsDataJson: []
282
- },
283
- {
284
- id: T(),
285
- key: "33333",
286
- name: "tab3",
287
- componentsDataJson: []
288
- }
289
- ]
290
- };
291
- K("update:modelValue", t), p.value = t.data[0].id;
292
- }, Y = () => {
293
- if (!e.value || !i.value) return;
294
- const t = e.value.getBoundingClientRect().top, n = i.value.getBoundingClientRect().top, u = i.value.getBoundingClientRect().bottom, b = +window.getComputedStyle(document.body).getPropertyValue("--header-height-calc").split("px")[0];
295
- if (n > b || u < b) {
296
- x.value = !1;
297
- return;
298
- }
299
- t <= b && (x.value = !0);
300
- }, Q = () => {
301
- if (f.value <= 768) return;
302
- const t = i.value, u = pe(t).y - 150;
303
- window.scroll({ top: u, left: 0, behavior: "smooth" });
304
- }, N = () => {
305
- var u;
306
- const t = c.query.tab_timeline, n = (u = y.value) == null ? void 0 : u.findIndex((b) => b.key == t);
307
- n > -1 ? p.value = n : p.value = 0;
308
- }, G = (t) => {
309
- debugger;
310
- p.value = t, O.push({
311
- path: c.path,
312
- query: {
313
- ...c.query,
314
- tab_timeline: y.value[t].key
315
- },
316
- hash: c.hash
317
- });
318
- };
319
- return q(
320
- () => J.value,
321
- () => {
322
- console.log("==========$_vsScrollY.value"), Y();
323
- }
324
- ), q(p, () => {
325
- Q();
326
- }), q(
327
- () => c.query.tab_line,
328
- () => {
329
- N();
330
- }
331
- ), W(), ae(() => {
332
- N();
333
- }), (t, n) => {
334
- var u, b;
335
- return h(), D("div", {
336
- class: $(["tab-timeline", A.value]),
337
- ref_key: "wrapper",
338
- ref: i,
339
- style: ne(I.value),
340
- onMouseover: n[3] || (n[3] = (m) => _.value = !0),
341
- onMouseout: n[4] || (n[4] = (m) => _.value = !1)
342
- }, [
343
- a("div", {
344
- class: $(["tab-timeline__wrapper", [(u = l.modelValue) != null && u.width ? `container-content-${(b = l.modelValue) == null ? void 0 : b.width}` : "container-content"]])
345
- }, [
346
- z(a("div", {
347
- class: $(["tab-timeline__desktop", [o.value]])
348
- }, [
349
- a("div", {
350
- class: $(["tab-timeline__hold", { "is-fixed": x.value }])
351
- }, [
352
- a("div", {
353
- class: "tab-timeline__nav",
354
- ref_key: "tab",
355
- ref: e
356
- }, [
357
- s(ue, {
358
- list: y.value,
359
- isFixed: x.value,
360
- currentIdx: p.value,
361
- onUpdateIdx: G,
362
- componentKey: U.value
363
- }, null, 8, ["list", "isFixed", "currentIdx", "componentKey"])
364
- ], 512)
365
- ], 2),
366
- a("div", $e, [
367
- a("div", Te, [
368
- (h(!0), D(oe, null, le(v.value, (m, Ie) => (h(), D("div", {
369
- key: m.id,
370
- class: "page-item"
371
- }, [
372
- a("div", De, [
373
- s(re, {
374
- type: m.type,
375
- "props-data": { modelValue: m }
376
- }, null, 8, ["type", "props-data"])
377
- ])
378
- ]))), 128))
379
- ])
380
- ])
381
- ], 2), [
382
- [M, R(f) >= 768]
383
- ]),
384
- z(a("div", Se, [
385
- s(me, {
386
- modelValue: l.modelValue,
387
- componentKey: U.value
388
- }, null, 8, ["modelValue", "componentKey"])
389
- ], 512), [
390
- [M, R(f) < 768]
391
- ]),
392
- l.isPreview ? E("", !0) : (h(), L(ce, {
393
- key: 0,
394
- show: _.value,
395
- "onUpdate:show": n[0] || (n[0] = (m) => _.value = m),
396
- onHandleEdit: n[1] || (n[1] = (m) => k.value = !0),
397
- onHandleDelete: t.handleDelete,
398
- onHandleCopy: t.handleCopy,
399
- onHandlePaste: t.handlePaste
400
- }, null, 8, ["show", "onHandleDelete", "onHandleCopy", "onHandlePaste"]))
401
- ], 2),
402
- l.isPreview ? E("", !0) : (h(), L(_e, {
403
- key: 0,
404
- show: k.value,
405
- "onUpdate:show": n[2] || (n[2] = (m) => k.value = m),
406
- data: l.modelValue
407
- }, null, 8, ["show", "data"]))
408
- ], 38);
409
- };
410
- }
411
- }, Be = /* @__PURE__ */ j(Pe, [["__scopeId", "data-v-1d36ae44"]]);
412
- export {
413
- Be as default
414
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C0VvLaXk.js");exports.default=e.d;
@@ -1,4 +0,0 @@
1
- import { d as f } from "./index-C_l0k6dm.mjs";
2
- export {
3
- f as default
4
- };