officialblock 1.0.8 → 1.0.9

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 (41) hide show
  1. package/dist/official-block.cjs.js +1 -1
  2. package/dist/official-block.es.js +43 -11
  3. package/dist/official-block.umd.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/icon-email.svg +3 -0
  7. package/src/components/ArticleList/setting.vue +316 -142
  8. package/src/components/BannerImageWithLink/index.ts +11 -0
  9. package/src/components/BannerImageWithLink/index.vue +323 -0
  10. package/src/components/BannerImageWithLink/setting.vue +344 -0
  11. package/src/components/BannerImageWithLink/type.ts +17 -0
  12. package/src/components/ContactUsList/index.ts +11 -0
  13. package/src/components/ContactUsList/index.vue +369 -0
  14. package/src/components/ContactUsList/setting.vue +497 -0
  15. package/src/components/ContactUsList/type.ts +17 -0
  16. package/src/components/CountDown/index.ts +11 -0
  17. package/src/components/CountDown/index.vue +315 -0
  18. package/src/components/CountDown/setting.vue +302 -0
  19. package/src/components/CountDown/type.ts +17 -0
  20. package/src/components/CustomIframe/index.ts +11 -0
  21. package/src/components/CustomIframe/index.vue +118 -0
  22. package/src/components/CustomIframe/setting.vue +323 -0
  23. package/src/components/CustomIframe/type.ts +17 -0
  24. package/src/components/Operate/index.vue +1 -2
  25. package/src/components/ScrollKeyInfo/index.ts +11 -0
  26. package/src/components/ScrollKeyInfo/index.vue +1345 -0
  27. package/src/components/ScrollKeyInfo/setting.vue +302 -0
  28. package/src/components/ScrollKeyInfo/type.ts +17 -0
  29. package/src/components/TabDefault/components/ComponentSelector/compsData.js +143 -0
  30. package/src/components/TabDefault/components/ComponentSelector/index.vue +188 -0
  31. package/src/components/TabDefault/components/PageContent.vue +207 -0
  32. package/src/components/TabDefault/index.vue +475 -0
  33. package/src/components/TabDefault/setting.vue +581 -0
  34. package/src/components/TabDefault/type.ts +17 -0
  35. package/src/components/TableTwo/index.ts +11 -0
  36. package/src/components/TableTwo/index.vue +232 -0
  37. package/src/components/TableTwo/setting.vue +558 -0
  38. package/src/components/TableTwo/type.ts +17 -0
  39. package/src/components/index.ts +17 -0
  40. package/src/styles/component-isolation.scss +2 -1
  41. package/src/views/components/ArticleListDemo.vue +50 -49
@@ -0,0 +1,497 @@
1
+ <template>
2
+ <a-drawer
3
+ :width="500"
4
+ :visible="show"
5
+ :footer="false"
6
+ @cancel="handleCancel"
7
+ unmountOnClose
8
+ >
9
+ <template #title> {{ data?.type }}组件编辑 </template>
10
+ <div class="seting-box">
11
+ <div class="setting-header items-center">
12
+ <p class="item-title">组件高度(最小值: 1, 最大值: 2)</p>
13
+ <a-slider
14
+ v-model="data.columns"
15
+ :min="1"
16
+ :max="2"
17
+ :default-value="2"
18
+ show-input
19
+ />
20
+ <p class="item-title">Contact Person</p>
21
+ <p v-if="!data.data.length">No items found.</p>
22
+ <!-- <div>==={{ data.data }}</div> -->
23
+ <draggable
24
+ v-model="data.data"
25
+ :component-data="{
26
+ tag: 'div',
27
+ type: 'transition-group',
28
+ name: !drag ? 'flip-list' : null,
29
+ }"
30
+ v-bind="linkDragOptions"
31
+ :disabled="false"
32
+ @start="drag = true"
33
+ @end="drag = false"
34
+ item-key="id"
35
+ >
36
+ <template #item="{ element: link }">
37
+ <div class="draggable_box">
38
+ <!-- <div class="btn-group">
39
+ <div class="drag-handle">
40
+ <icon-drag-arrow class="drag-icon" />
41
+ </div>
42
+ <icon-delete class="btn-delete" />
43
+ </div> -->
44
+ <div class="drag_top_box">
45
+ <div @click="toggleCollapse(link)">
46
+ <icon-drag-dot style="margin-right: 10px" />{{ link.name }}
47
+ </div>
48
+ <div>
49
+ <icon-drag-arrow class="icon_drag" />
50
+ <icon-delete
51
+ class="btn-delete"
52
+ @click.stop="handleDelete(link.id)"
53
+ />
54
+ </div>
55
+ </div>
56
+ <!-- {{ link }} -->
57
+ <transition name="collapse">
58
+ <div v-show="!isCollapsed(link)">
59
+ <p class="item-title" style="margin-top: 20px">Name</p>
60
+ <a-input
61
+ v-model="link.name"
62
+ placeholder="请输入标题"
63
+ allow-clear
64
+ />
65
+ <p class="item-title">Title</p>
66
+ <a-input
67
+ v-model="link.title"
68
+ placeholder="请输入标题"
69
+ allow-clear
70
+ />
71
+ <p class="item-title">Region</p>
72
+ <a-input
73
+ v-model="link.region"
74
+ placeholder="请输入标题"
75
+ allow-clear
76
+ />
77
+ <p class="item-title">Email</p>
78
+ <a-input
79
+ v-model="link.link"
80
+ placeholder="请输入标题"
81
+ allow-clear
82
+ />
83
+ </div>
84
+ </transition>
85
+
86
+ <!-- <h6 class="contact-us-list__item__name">{{ link.name }}</h6>
87
+ <p class="contact-us-list__item__title">{{ link.title }}</p>
88
+ <div class="contact-us-list__item__region">
89
+ {{ link.region }}
90
+ </div>
91
+ <div class="contact-us-list__item__link">
92
+ <div class="icon-link icon-link--md">
93
+ <a
94
+ href="mailto:111"
95
+ target="_blank"
96
+ class="icon-link__wrapper"
97
+ ><span
98
+ class="icon-link__icon"
99
+ :style="{ '--icon-url': `url(${iconEmailUrl})` }"
100
+ ></span>
101
+ <div class="icon-link__text">
102
+ <span>{{ link.link }}</span>
103
+ </div></a
104
+ >
105
+ </div>
106
+ </div> -->
107
+ </div>
108
+ </template>
109
+ </draggable>
110
+ <a-button type="primary" @click="handleClickAdd">
111
+ <template #icon>
112
+ <icon-plus />
113
+ </template>
114
+ 联系人
115
+ </a-button>
116
+ </div>
117
+ </div>
118
+ </a-drawer>
119
+ </template>
120
+
121
+ <script lang="ts" setup>
122
+ import draggable from "vuedraggable";
123
+ import { ref, computed, nextTick } from "vue";
124
+ import iconEmailUrl from "@/assets/icon-email.svg";
125
+ import RichTextEditor from "@/components/RichTextEditor";
126
+ import { randomString } from "@/utils/common";
127
+ // 不同类型的拖拽配置选项
128
+ const linkDragOptions = computed(() => ({
129
+ animation: 200,
130
+ group: "links", // 链接专用分组
131
+ disabled: false,
132
+ ghostClass: "ghost",
133
+ }));
134
+ // 拖拽相关状态
135
+ const drag = ref(false);
136
+ const props = defineProps({
137
+ show: {
138
+ type: Boolean,
139
+ default: false,
140
+ },
141
+
142
+ data: {
143
+ type: Object,
144
+ default: () => {},
145
+ },
146
+ });
147
+
148
+ // 折叠状态管理 - 使用Set存储已折叠项的ID
149
+ const collapsedItems = ref(new Set());
150
+
151
+ // 切换指定项的折叠状态
152
+ const toggleCollapse = (item: any) => {
153
+ if (collapsedItems.value.has(item.id)) {
154
+ collapsedItems.value.delete(item.id);
155
+ } else {
156
+ collapsedItems.value.add(item.id);
157
+ }
158
+ };
159
+ const handleDelete = (id: string) => {
160
+ props.data.data = props.data.data.filter((item: any) => item.id !== id);
161
+ };
162
+ const handleClickAdd = () => {
163
+ const detail = props.data;
164
+ detail.data.push({
165
+ name: "New Contact",
166
+ title: "",
167
+ region: "",
168
+ link: "",
169
+ id: randomString(),
170
+ });
171
+ nextTick(() => {
172
+ const drawerContent = document.querySelector(".arco-drawer-body");
173
+ if (drawerContent) {
174
+ drawerContent.scrollTop = drawerContent.scrollHeight;
175
+ }
176
+ });
177
+ };
178
+
179
+ // 检查指定项是否已折叠
180
+ const isCollapsed = (item) => {
181
+ return collapsedItems.value.has(item.id);
182
+ };
183
+
184
+ const emit = defineEmits(["update:show"]);
185
+
186
+ const handleCancel = () => {
187
+ emit("update:show", false);
188
+ };
189
+
190
+ // 检查是否应该显示拖拽图标
191
+ const shouldShowDragHandle = (list: any[]) => {
192
+ return list && list.length > 1;
193
+ };
194
+ </script>
195
+
196
+ <style lang="scss" scoped>
197
+ .icon_drag {
198
+ margin-right: 15px;
199
+ cursor: pointer;
200
+ &:hover {
201
+ opacity: 0.8;
202
+ }
203
+ }
204
+ .drag_top_box {
205
+ position: absolute;
206
+ top: 0px;
207
+ left: 0px;
208
+ right: 0px;
209
+ display: flex;
210
+ justify-content: space-between;
211
+ padding: 8px;
212
+ cursor: pointer;
213
+ background-color: #f5f5f5;
214
+ border-radius: 4px;
215
+
216
+ &:hover {
217
+ background-color: #e8e8e8;
218
+ }
219
+ }
220
+
221
+ // 折叠动画
222
+ .collapse-enter-active,
223
+ .collapse-leave-active {
224
+ transition: all 0.3s ease;
225
+ max-height: 500px;
226
+ overflow: hidden;
227
+ opacity: 1;
228
+ }
229
+
230
+ .collapse-enter-from,
231
+ .collapse-leave-to {
232
+ max-height: 0;
233
+ opacity: 0;
234
+ overflow: hidden;
235
+ }
236
+
237
+ .draggable_box {
238
+ margin-bottom: 25px;
239
+ background: #fff;
240
+ padding: 10px;
241
+ position: relative;
242
+ border-radius: 4px;
243
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
244
+ &:hover {
245
+ transform: translateY(-2px);
246
+ }
247
+ }
248
+ // :deep(.arco-input-wrapper) {
249
+ // background-color: #ffffff;
250
+ // }
251
+ .item-title {
252
+ padding: 12px 0 8px 0;
253
+ font-size: 14px;
254
+ font-weight: 600;
255
+ margin-top: 10px;
256
+ }
257
+ .item-img {
258
+ height: 100px;
259
+ }
260
+ .seting-box {
261
+ padding: 20px;
262
+ background: #f0f2f5;
263
+ border-radius: 3px;
264
+ // .arco-input-wrapper {
265
+ // background: #ffffff;
266
+ // }
267
+ }
268
+ .setting-content {
269
+ .setting-header {
270
+ padding-bottom: 12px;
271
+
272
+ .header-title {
273
+ width: 120px;
274
+ padding-right: 12px;
275
+ text-align: right;
276
+ }
277
+ }
278
+
279
+ .setting-body {
280
+ margin-top: 12px;
281
+
282
+ .setting-item {
283
+ position: relative;
284
+ padding: 16px 12px;
285
+ background: #f0f2f5;
286
+ border-radius: 8px;
287
+ margin-bottom: 20px;
288
+
289
+ .btn-group {
290
+ position: absolute;
291
+ right: 0;
292
+ top: 0;
293
+ display: flex;
294
+ align-items: center;
295
+ padding: 4px;
296
+
297
+ .btn-delete {
298
+ padding: 4px;
299
+ font-size: 24px;
300
+ cursor: pointer;
301
+ }
302
+ }
303
+
304
+ .item-name {
305
+ font-size: 16px;
306
+ font-weight: 600;
307
+ padding-bottom: 10px;
308
+ border-bottom: 1px solid #fff;
309
+ }
310
+
311
+ .item-title {
312
+ padding: 12px 0 8px 0;
313
+ font-size: 14px;
314
+ font-weight: 600;
315
+ }
316
+
317
+ .arco-input-wrapper {
318
+ background: #fff;
319
+ }
320
+
321
+ .item-button {
322
+ position: relative;
323
+ padding: 12px 8px 4px;
324
+ background: #fff;
325
+ border-radius: 4px;
326
+ margin: 4px 0;
327
+ transition: all 0.3s ease;
328
+
329
+ &.draggable-item {
330
+ cursor: move;
331
+
332
+ &:hover {
333
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
334
+ transform: translateY(-1px);
335
+ }
336
+
337
+ // 当禁用拖拽时,不显示拖拽效果
338
+ &.sortable-disabled {
339
+ cursor: default;
340
+
341
+ &:hover {
342
+ box-shadow: none;
343
+ transform: none;
344
+ }
345
+ }
346
+ }
347
+
348
+ .arco-input-wrapper {
349
+ background: #f2f3f5;
350
+ }
351
+ }
352
+
353
+ // 拖拽相关样式
354
+ .flip-list-move {
355
+ transition: transform 0.5s;
356
+ }
357
+
358
+ .no-move {
359
+ transition: transform 0s;
360
+ }
361
+
362
+ .ghost {
363
+ opacity: 0.5;
364
+ background: #c8ebfb;
365
+ }
366
+
367
+ .list-group {
368
+ min-height: 20px;
369
+ }
370
+
371
+ .list-group-item {
372
+ cursor: move;
373
+ }
374
+
375
+ .list-group-item i {
376
+ cursor: pointer;
377
+ }
378
+
379
+ .item-action {
380
+ padding: 10px 0;
381
+
382
+ .action-text {
383
+ width: 150px;
384
+ margin-right: 8px;
385
+ }
386
+ }
387
+
388
+ .item-add-btn {
389
+ display: inline-block;
390
+ padding: 2px 8px;
391
+ margin-top: 5px;
392
+ font-size: 11px;
393
+ color: #165dff;
394
+ border-radius: 4px;
395
+ font-weight: 600;
396
+ border: 1px solid #165dff;
397
+ cursor: pointer;
398
+ }
399
+
400
+ .item-img {
401
+ margin-top: 12px;
402
+ height: 160px;
403
+ }
404
+
405
+ .fit-content {
406
+ width: fit-content;
407
+ }
408
+
409
+ .item-img-list {
410
+ .img-list-item {
411
+ margin: 4px 0;
412
+ position: relative;
413
+ padding: 8px;
414
+ border-radius: 4px;
415
+ transition: all 0.3s ease;
416
+ background: #fff;
417
+ border-radius: 4px;
418
+
419
+ &.draggable-item {
420
+ cursor: move;
421
+
422
+ &:hover {
423
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
424
+ transform: translateY(-1px);
425
+ }
426
+
427
+ // 当禁用拖拽时,不显示拖拽效果
428
+ &.sortable-disabled {
429
+ cursor: default;
430
+
431
+ &:hover {
432
+ box-shadow: none;
433
+ transform: none;
434
+ }
435
+ }
436
+ }
437
+
438
+ .arco-input-wrapper {
439
+ background: #f2f3f5;
440
+ }
441
+
442
+ .img-drag-handle {
443
+ top: 0 !important;
444
+ }
445
+ }
446
+
447
+ .item-img-box {
448
+ margin-right: 12px;
449
+ position: relative;
450
+ width: 133px;
451
+ height: 100px;
452
+
453
+ .item-img-dlete {
454
+ position: absolute;
455
+ padding: 8px;
456
+ font-size: 32px;
457
+ top: -16px;
458
+ right: -16px;
459
+ color: red;
460
+ cursor: pointer;
461
+ }
462
+ }
463
+
464
+ .small-img {
465
+ margin: 0;
466
+ height: 100px;
467
+ object-fit: cover;
468
+ }
469
+
470
+ .item-right {
471
+ padding-top: 24px;
472
+ }
473
+ }
474
+ }
475
+ }
476
+
477
+ .drag-handle {
478
+ padding: 4px;
479
+ cursor: grab;
480
+ padding: 4px;
481
+ border-radius: 4px;
482
+
483
+ &:hover {
484
+ background-color: #f0f2f5;
485
+ }
486
+
487
+ &:active {
488
+ cursor: grabbing;
489
+ }
490
+
491
+ .drag-icon {
492
+ font-size: 16px;
493
+ color: #86909c;
494
+ }
495
+ }
496
+ }
497
+ </style>
@@ -0,0 +1,17 @@
1
+ export interface ContactUsListProps {
2
+ /** 双向绑定的值 */
3
+ modelValue: any
4
+ }
5
+
6
+ export interface ContactUsListEmits {
7
+ (e: 'update:modelValue', value: any): void
8
+ (e: 'handleDelete', value: string | number): void
9
+ (e: 'handleCopy', value: any): void
10
+ }
11
+
12
+ // export type ComponentSlots = {
13
+ // /** 默认插槽内容 */
14
+ // default?: (props: { value: string | number }) => VNode[]
15
+ // /** 头部内容 */
16
+ // header?: (props: { title: string }) => VNode[]
17
+ // }
@@ -0,0 +1,11 @@
1
+ import type { App, Plugin } from 'vue'
2
+ import CountDown from './index.vue'
3
+
4
+ export default {
5
+ install: (app: App) => {
6
+ app.component('CountDown', CountDown)
7
+ },
8
+ } satisfies Plugin
9
+
10
+ export { default as CountDown } from './index.vue'
11
+ export type { CountDownProps, CountDownEmits } from './type'