jvs-ppt-ui 0.0.29 → 0.0.32
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/lib/jvs-ppt-ui.es.js +35729 -33022
- package/dist/lib/jvs-ppt-ui.umd.js +105 -114
- package/dist/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/components/AIPptDialog.vue +1 -1
- package/src/components/CanvasArea.vue +9 -1
- package/src/components/ChartTypeSelector.vue +69 -29
- package/src/components/DslInputDialog.vue +1 -1
- package/src/components/FormulaDialog.vue +1 -1
- package/src/components/Header.vue +44 -3
- package/src/components/PitchImportDialog.vue +459 -0
- package/src/components/SidebarLeft.vue +1 -0
- package/src/components/SidebarRight.vue +75 -35
- package/src/components/StyleBuilderDialog.vue +285 -113
- package/src/components/SvgChart.vue +1242 -833
- package/src/components/canvas/elements/CanvasGroupElement.vue +16 -2
- package/src/components/canvas/elements/CanvasMediaElement.vue +2 -1
- package/src/components/sidebar/dialogs/ChartDataEditorDialog.vue +1040 -0
- package/src/components/sidebar/panels/SidebarChartFormatPanel.vue +1479 -641
- package/src/components/sidebar/panels/SidebarDesignPanel.vue +33 -1
- package/src/composables/presetThemes.ts +49 -1
- package/src/composables/sidebar/useSidebarChart.ts +357 -194
- package/src/composables/sidebar/useSidebarDesign.ts +2 -0
- package/src/composables/useSlides.ts +95 -18
- package/src/style.css +2 -2
- package/src/utils/pitchConverter.ts +1226 -0
|
@@ -1,641 +1,1479 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import SidebarAlignGroup from '../common/SidebarAlignGroup.vue'
|
|
4
|
-
import SidebarPositionGroup from '../common/SidebarPositionGroup.vue'
|
|
5
|
-
import SidebarBorderAccordion from '../common/SidebarBorderAccordion.vue'
|
|
6
|
-
import SidebarShadowAccordion from '../common/SidebarShadowAccordion.vue'
|
|
7
|
-
import SidebarReflectionAccordion from '../common/SidebarReflectionAccordion.vue'
|
|
8
|
-
import ChartTypeSelector from '../../ChartTypeSelector.vue'
|
|
9
|
-
import QuickColorPopover from '../../QuickColorPopover.vue'
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(e: '
|
|
84
|
-
(e: '
|
|
85
|
-
(e: '
|
|
86
|
-
(e: '
|
|
87
|
-
(e: '
|
|
88
|
-
|
|
89
|
-
(e: 'update:
|
|
90
|
-
(e: 'update:
|
|
91
|
-
(e: 'update:
|
|
92
|
-
(e: 'update:
|
|
93
|
-
(e: 'update:
|
|
94
|
-
(e: 'update:
|
|
95
|
-
(e: '
|
|
96
|
-
|
|
97
|
-
(e: '
|
|
98
|
-
(e: '
|
|
99
|
-
(e: '
|
|
100
|
-
(e: 'update:
|
|
101
|
-
(e: 'update:
|
|
102
|
-
(e: 'update:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
'
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
'
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
'
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
:
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
.
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
.
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
:
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
:
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
</
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, nextTick } from 'vue'
|
|
3
|
+
import SidebarAlignGroup from '../common/SidebarAlignGroup.vue'
|
|
4
|
+
import SidebarPositionGroup from '../common/SidebarPositionGroup.vue'
|
|
5
|
+
import SidebarBorderAccordion from '../common/SidebarBorderAccordion.vue'
|
|
6
|
+
import SidebarShadowAccordion from '../common/SidebarShadowAccordion.vue'
|
|
7
|
+
import SidebarReflectionAccordion from '../common/SidebarReflectionAccordion.vue'
|
|
8
|
+
import ChartTypeSelector from '../../ChartTypeSelector.vue'
|
|
9
|
+
import QuickColorPopover from '../../QuickColorPopover.vue'
|
|
10
|
+
import GradientEditor from './GradientEditor.vue'
|
|
11
|
+
import { generateMonoPalette } from '../../../utils/palette'
|
|
12
|
+
import {
|
|
13
|
+
parseColor,
|
|
14
|
+
hexToRgba,
|
|
15
|
+
generateGradientEndColor,
|
|
16
|
+
PATTERN_PRESETS,
|
|
17
|
+
buildPatternSvgDataUrl,
|
|
18
|
+
parsePatternSvgMeta
|
|
19
|
+
} from '../../../composables/sidebar/useSidebarShapeFormat'
|
|
20
|
+
import {
|
|
21
|
+
getElementGradientConfig,
|
|
22
|
+
getElementGradientCss
|
|
23
|
+
} from '../../../utils/canvas/elementStyles'
|
|
24
|
+
|
|
25
|
+
const props = defineProps<{
|
|
26
|
+
element: any
|
|
27
|
+
elementX: number
|
|
28
|
+
elementY: number
|
|
29
|
+
elementW: number
|
|
30
|
+
elementH: number
|
|
31
|
+
elementRotate: number
|
|
32
|
+
isFixedRatio?: boolean
|
|
33
|
+
isFlipH?: boolean
|
|
34
|
+
isFlipV?: boolean
|
|
35
|
+
chartPrimaryColor: string
|
|
36
|
+
chartGridColor: string
|
|
37
|
+
chartTextColor: string
|
|
38
|
+
currentChartColors: string[]
|
|
39
|
+
currentChartPaletteId: string
|
|
40
|
+
chartPresetPalettes: any[]
|
|
41
|
+
recentColors?: string[]
|
|
42
|
+
// Fill props
|
|
43
|
+
isFillEnabled?: boolean
|
|
44
|
+
isFillExpanded?: boolean
|
|
45
|
+
shapeFillType?: string
|
|
46
|
+
fillHex?: string
|
|
47
|
+
fillOpacity?: number
|
|
48
|
+
gradientPathType?: string
|
|
49
|
+
gradientDirection?: string
|
|
50
|
+
gradientStartHex?: string
|
|
51
|
+
gradientEndHex?: string
|
|
52
|
+
gradientAngle?: number
|
|
53
|
+
shapePatternFill?: string
|
|
54
|
+
shapePatternType?: string
|
|
55
|
+
shapePatternFg?: string
|
|
56
|
+
shapePatternBg?: string
|
|
57
|
+
// Border props
|
|
58
|
+
isBorderEnabled?: boolean
|
|
59
|
+
isBorderExpanded?: boolean
|
|
60
|
+
borderHex?: string
|
|
61
|
+
borderStyle?: string
|
|
62
|
+
borderWidth?: number
|
|
63
|
+
borderAlpha?: number
|
|
64
|
+
// Shadow props
|
|
65
|
+
isShadowEnabled?: boolean
|
|
66
|
+
isShadowExpanded?: boolean
|
|
67
|
+
shadowHex?: string
|
|
68
|
+
shadowAngle?: number
|
|
69
|
+
shadowSize?: number
|
|
70
|
+
shadowBlur?: number
|
|
71
|
+
shadowDistance?: number
|
|
72
|
+
shadowAlpha?: number
|
|
73
|
+
// Reflection props
|
|
74
|
+
enableReflection?: boolean
|
|
75
|
+
isReflectionExpanded?: boolean
|
|
76
|
+
reflectionDistance?: number
|
|
77
|
+
reflectionSize?: number
|
|
78
|
+
reflectionOpacity?: number
|
|
79
|
+
reflectionBlur?: number
|
|
80
|
+
}>()
|
|
81
|
+
|
|
82
|
+
const emit = defineEmits<{
|
|
83
|
+
(e: 'alignLeft'): void
|
|
84
|
+
(e: 'alignCenter'): void
|
|
85
|
+
(e: 'alignRight'): void
|
|
86
|
+
(e: 'alignTop'): void
|
|
87
|
+
(e: 'alignMiddle'): void
|
|
88
|
+
(e: 'alignBottom'): void
|
|
89
|
+
(e: 'update:elementX', val: number): void
|
|
90
|
+
(e: 'update:elementY', val: number): void
|
|
91
|
+
(e: 'update:elementW', val: number): void
|
|
92
|
+
(e: 'update:elementH', val: number): void
|
|
93
|
+
(e: 'update:elementRotate', val: number): void
|
|
94
|
+
(e: 'update:isFixedRatio', val: boolean): void
|
|
95
|
+
(e: 'toggleFlipH'): void
|
|
96
|
+
(e: 'toggleFlipV'): void
|
|
97
|
+
(e: 'adjustZIndex', cmd: any): void
|
|
98
|
+
(e: 'openChartDataDialog'): void
|
|
99
|
+
(e: 'changeChartType', type: any): void
|
|
100
|
+
(e: 'update:chartPrimaryColor', val: string): void
|
|
101
|
+
(e: 'update:chartGridColor', val: string): void
|
|
102
|
+
(e: 'update:chartTextColor', val: string): void
|
|
103
|
+
(e: 'selectChartPalette', palette: any): void
|
|
104
|
+
// Fill
|
|
105
|
+
(e: 'update:isFillEnabled', val: boolean): void
|
|
106
|
+
(e: 'update:isFillExpanded', val: boolean): void
|
|
107
|
+
(e: 'update:shapeFillType', val: string): void
|
|
108
|
+
(e: 'update:fillHex', val: string): void
|
|
109
|
+
(e: 'update:fillOpacity', val: number): void
|
|
110
|
+
(e: 'update:gradientPathType', val: string): void
|
|
111
|
+
(e: 'update:gradientDirection', val: string): void
|
|
112
|
+
(e: 'update:gradientStartHex', val: string): void
|
|
113
|
+
(e: 'update:gradientEndHex', val: string): void
|
|
114
|
+
(e: 'update:gradientAngle', val: number): void
|
|
115
|
+
(e: 'update:elementGradient', config: any, css: string, commit?: boolean): void
|
|
116
|
+
(e: 'update:shapePatternFill', val: string): void
|
|
117
|
+
(e: 'update:shapePatternType', val: string): void
|
|
118
|
+
(e: 'update:shapePatternFg', val: string): void
|
|
119
|
+
(e: 'update:shapePatternBg', val: string): void
|
|
120
|
+
(e: 'handleShapePatternUpload', event: Event): void
|
|
121
|
+
(e: 'clearShapePatternFill'): void
|
|
122
|
+
// Border
|
|
123
|
+
(e: 'update:isBorderEnabled', val: boolean): void
|
|
124
|
+
(e: 'update:isBorderExpanded', val: boolean): void
|
|
125
|
+
(e: 'update:borderHex', val: string): void
|
|
126
|
+
(e: 'update:borderStyle', val: string): void
|
|
127
|
+
(e: 'update:borderWidth', val: number): void
|
|
128
|
+
(e: 'update:borderAlpha', val: number): void
|
|
129
|
+
// Shadow
|
|
130
|
+
(e: 'update:isShadowEnabled', val: boolean): void
|
|
131
|
+
(e: 'update:isShadowExpanded', val: boolean): void
|
|
132
|
+
(e: 'update:shadowHex', val: string): void
|
|
133
|
+
(e: 'update:shadowAngle', val: number): void
|
|
134
|
+
(e: 'update:shadowSize', val: number): void
|
|
135
|
+
(e: 'update:shadowBlur', val: number): void
|
|
136
|
+
(e: 'update:shadowDistance', val: number): void
|
|
137
|
+
(e: 'update:shadowAlpha', val: number): void
|
|
138
|
+
// Reflection
|
|
139
|
+
(e: 'update:enableReflection', val: boolean): void
|
|
140
|
+
(e: 'update:isReflectionExpanded', val: boolean): void
|
|
141
|
+
(e: 'update:reflectionDistance', val: number): void
|
|
142
|
+
(e: 'update:reflectionSize', val: number): void
|
|
143
|
+
(e: 'update:reflectionOpacity', val: number): void
|
|
144
|
+
(e: 'update:reflectionBlur', val: number): void
|
|
145
|
+
}>()
|
|
146
|
+
|
|
147
|
+
const chartTypePopoverVisible = ref(false)
|
|
148
|
+
const chartPrimaryColorPopoverVisible = ref(false)
|
|
149
|
+
const chartPalettePopoverVisible = ref(false)
|
|
150
|
+
const chartGridColorPopoverVisible = ref(false)
|
|
151
|
+
const chartTextColorPopoverVisible = ref(false)
|
|
152
|
+
const fillPopoverVisible = ref(false)
|
|
153
|
+
const patternFgPopoverVisible = ref(false)
|
|
154
|
+
const patternBgPopoverVisible = ref(false)
|
|
155
|
+
const imageFileInputRef = ref<HTMLInputElement | null>(null)
|
|
156
|
+
const gradientEditorRef = ref<any>(null)
|
|
157
|
+
|
|
158
|
+
const localRecentColors = ref<string[]>(props.recentColors || [])
|
|
159
|
+
|
|
160
|
+
const legendPositions = [
|
|
161
|
+
'top-left', 'top', 'top-right', 'bottom-left',
|
|
162
|
+
'bottom', 'bottom-right', 'right-top', 'right',
|
|
163
|
+
'right-bottom', 'left-top', 'left', 'left-bottom'
|
|
164
|
+
]
|
|
165
|
+
|
|
166
|
+
const legendIcons: Record<string, string> = {
|
|
167
|
+
'top-left': 'icon-ppt-a-zu9437',
|
|
168
|
+
'top': 'icon-ppt-a-zu9436',
|
|
169
|
+
'top-right': 'icon-ppt-a-zu9435',
|
|
170
|
+
'bottom-left': 'icon-ppt-a-zu9440',
|
|
171
|
+
'bottom': 'icon-ppt-a-zu9439',
|
|
172
|
+
'bottom-right': 'icon-ppt-a-zu9438',
|
|
173
|
+
'right-top': 'icon-ppt-a-zu9432',
|
|
174
|
+
'right': 'icon-ppt-a-zu9433',
|
|
175
|
+
'right-bottom': 'icon-ppt-a-zu9434',
|
|
176
|
+
'left-top': 'icon-ppt-a-zu9429',
|
|
177
|
+
'left': 'icon-ppt-a-zu9430',
|
|
178
|
+
'left-bottom': 'icon-ppt-a-zu9431'
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function getChartTypeName(type: string | undefined): string {
|
|
182
|
+
if (!type) return '基础柱状图'
|
|
183
|
+
const map: Record<string, string> = {
|
|
184
|
+
'pie': '基础饼图',
|
|
185
|
+
'donut': '环图',
|
|
186
|
+
'rose-pie': '玫瑰图',
|
|
187
|
+
'rose-donut': '玫瑰环图',
|
|
188
|
+
'bar': '基础柱状图',
|
|
189
|
+
'percent-bar': '百分比柱状图',
|
|
190
|
+
'stacked-bar': '堆叠柱状图',
|
|
191
|
+
'line': '折线图',
|
|
192
|
+
'compare-line': '对比折线图',
|
|
193
|
+
'step-line': '其他折线图',
|
|
194
|
+
'horizontal-bar': '基础条形图',
|
|
195
|
+
'stacked-horizontal-bar': '堆叠条形图',
|
|
196
|
+
'area': '基础面积图',
|
|
197
|
+
'stacked-area': '堆叠面积图',
|
|
198
|
+
'scatter': '散点图',
|
|
199
|
+
'radar': '雷达图'
|
|
200
|
+
}
|
|
201
|
+
return map[type] || '基础柱状图'
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const normalizedChartType = computed(() => {
|
|
205
|
+
let t = (props.element?.chartType as string) || 'bar'
|
|
206
|
+
if (t === 'doughnutChart' || t === 'ring') t = 'donut'
|
|
207
|
+
if (t === 'pieChart' || t === 'pie3DChart') t = 'pie'
|
|
208
|
+
if (t === 'barChart' || t === 'bar3DChart') t = 'bar'
|
|
209
|
+
if (t === 'lineChart' || t === 'line3DChart') t = 'line'
|
|
210
|
+
if (t === 'areaChart' || t === 'area3DChart') t = 'area'
|
|
211
|
+
return t
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
const isPieOrDonut = computed(() =>
|
|
215
|
+
['pie', 'donut', 'rose-pie', 'rose-donut'].includes(normalizedChartType.value)
|
|
216
|
+
)
|
|
217
|
+
const isCartesianChart = computed(() =>
|
|
218
|
+
['bar', 'percent-bar', 'stacked-bar', 'horizontal-bar', 'stacked-horizontal-bar', 'line', 'compare-line', 'step-line', 'area', 'stacked-area', 'scatter'].includes(normalizedChartType.value)
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
const chartShowAxes = computed({
|
|
222
|
+
get: () => props.element?.showAxes !== false,
|
|
223
|
+
set: (val: boolean) => { if (props.element) props.element.showAxes = val }
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
const chartShowGridlines = computed({
|
|
227
|
+
get: () => props.element?.showGridlines !== false,
|
|
228
|
+
set: (val: boolean) => { if (props.element) props.element.showGridlines = val }
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
const chartShowLegend = computed({
|
|
232
|
+
get: () => {
|
|
233
|
+
if (props.element?.showLegend !== undefined) return Boolean(props.element.showLegend)
|
|
234
|
+
if (props.element?.options?.showLegend !== undefined) return Boolean(props.element.options.showLegend)
|
|
235
|
+
return true
|
|
236
|
+
},
|
|
237
|
+
set: (val: boolean) => {
|
|
238
|
+
if (!props.element) return
|
|
239
|
+
props.element.showLegend = val
|
|
240
|
+
if (props.element.options) props.element.options.showLegend = val
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
const chartShowDataLabels = computed({
|
|
245
|
+
get: () => {
|
|
246
|
+
if (props.element?.showDataLabels !== undefined) return Boolean(props.element.showDataLabels)
|
|
247
|
+
if (isPieOrDonut.value) {
|
|
248
|
+
if (props.element?.showPercent !== undefined) return Boolean(props.element.showPercent)
|
|
249
|
+
if (props.element?.options?.showPercent !== undefined) return Boolean(props.element.options.showPercent)
|
|
250
|
+
return true
|
|
251
|
+
}
|
|
252
|
+
return false
|
|
253
|
+
},
|
|
254
|
+
set: (val: boolean) => {
|
|
255
|
+
if (!props.element) return
|
|
256
|
+
props.element.showDataLabels = val
|
|
257
|
+
if (isPieOrDonut.value) {
|
|
258
|
+
props.element.showPercent = val
|
|
259
|
+
if (props.element.options) props.element.options.showPercent = val
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
const chartShowTitle = computed({
|
|
265
|
+
get: () => Boolean(props.element?.showTitle),
|
|
266
|
+
set: (val: boolean) => {
|
|
267
|
+
if (!props.element) return
|
|
268
|
+
props.element.showTitle = val
|
|
269
|
+
if (val && !props.element.chartTitle) {
|
|
270
|
+
props.element.chartTitle = '图表标题'
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
const chartShowAxisTitles = computed({
|
|
276
|
+
get: () => Boolean(props.element?.showAxisTitles),
|
|
277
|
+
set: (val: boolean) => {
|
|
278
|
+
if (!props.element) return
|
|
279
|
+
props.element.showAxisTitles = val
|
|
280
|
+
if (val) {
|
|
281
|
+
if (!props.element.xAxisTitle) props.element.xAxisTitle = normalizedChartType.value === 'horizontal-bar' ? '数值' : '分类'
|
|
282
|
+
if (!props.element.yAxisTitle) props.element.yAxisTitle = normalizedChartType.value === 'horizontal-bar' ? '分类' : '数值'
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
const chartShowDataTable = computed({
|
|
288
|
+
get: () => Boolean(props.element?.showDataTable),
|
|
289
|
+
set: (val: boolean) => { if (props.element) props.element.showDataTable = val }
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
const chartShowErrorBars = computed({
|
|
293
|
+
get: () => Boolean(props.element?.showErrorBars),
|
|
294
|
+
set: (val: boolean) => { if (props.element) props.element.showErrorBars = val }
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
const donutHoleSize = computed({
|
|
298
|
+
get: () => {
|
|
299
|
+
const h = parseFloat(props.element?.holeSize ?? props.element?.options?.holeSize)
|
|
300
|
+
return !isNaN(h) && h > 0 && h < 100 ? Math.round(h) : 72
|
|
301
|
+
},
|
|
302
|
+
set: (val: number) => {
|
|
303
|
+
if (!props.element) return
|
|
304
|
+
const clamped = Math.max(25, Math.min(85, val))
|
|
305
|
+
props.element.holeSize = clamped
|
|
306
|
+
if (props.element.options) props.element.options.holeSize = clamped
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
function formatHexDisplay(val: any): string {
|
|
311
|
+
if (!val || val === 'transparent') return '无'
|
|
312
|
+
let str = ''
|
|
313
|
+
if (typeof val === 'string') {
|
|
314
|
+
str = val
|
|
315
|
+
} else if (typeof val === 'object' && val !== null) {
|
|
316
|
+
if (val.type === 'color' && typeof val.value === 'string') {
|
|
317
|
+
str = val.value
|
|
318
|
+
} else if (val.colors && Array.isArray(val.colors) && val.colors[0]?.color) {
|
|
319
|
+
str = val.colors[0].color
|
|
320
|
+
} else if (val.value && typeof val.value === 'object' && val.value.colors && Array.isArray(val.value.colors)) {
|
|
321
|
+
str = val.value.colors[0]?.color || ''
|
|
322
|
+
} else if (typeof val.value === 'string') {
|
|
323
|
+
str = val.value
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (!str || str === 'transparent') return '无'
|
|
327
|
+
let clean = str.replace('#', '').trim().toUpperCase()
|
|
328
|
+
if (clean.length === 8) clean = clean.slice(0, 6)
|
|
329
|
+
return clean
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function getPaletteColors(palette: any): string[] {
|
|
333
|
+
if (palette.id === 'mono') {
|
|
334
|
+
return generateMonoPalette(props.chartPrimaryColor, 8)
|
|
335
|
+
}
|
|
336
|
+
return palette.colors || []
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function onSelectChartType(type: any) {
|
|
340
|
+
emit('changeChartType', type)
|
|
341
|
+
chartTypePopoverVisible.value = false
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function onSelectChartPalette(palette: any) {
|
|
345
|
+
emit('selectChartPalette', palette)
|
|
346
|
+
chartPalettePopoverVisible.value = false
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Fill mode & gradient/pattern helpers (aligned with SidebarShapeFormatPanel)
|
|
350
|
+
const currentShapeGradient = computed(() => {
|
|
351
|
+
if (!props.element) return 'linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%)'
|
|
352
|
+
const g = getElementGradientConfig(props.element) || props.element?._lastGradient
|
|
353
|
+
if (g?.css) return g.css
|
|
354
|
+
const css = getElementGradientCss(props.element)
|
|
355
|
+
if (css) return css
|
|
356
|
+
if (g) return g
|
|
357
|
+
const startColor = (props.fillHex && props.fillHex !== 'transparent' && props.fillHex !== 'none') ? props.fillHex : '#3b82f6'
|
|
358
|
+
const endColor = props.gradientEndHex || generateGradientEndColor(startColor)
|
|
359
|
+
return `linear-gradient(135deg, ${startColor} 0%, ${endColor} 100%)`
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
const activeGradientStart = computed(() => {
|
|
363
|
+
const g = getElementGradientConfig(props.element) || props.element?._lastGradient
|
|
364
|
+
if (g?.colors && g.colors.length > 0 && g.colors[0]?.color) {
|
|
365
|
+
return parseColor(g.colors[0].color).hex
|
|
366
|
+
}
|
|
367
|
+
if (props.gradientStartHex) return props.gradientStartHex
|
|
368
|
+
if (props.fillHex && props.fillHex !== 'transparent' && props.fillHex !== 'none') {
|
|
369
|
+
return props.fillHex
|
|
370
|
+
}
|
|
371
|
+
return '#3b82f6'
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
const activeGradientEnd = computed(() => {
|
|
375
|
+
const g = getElementGradientConfig(props.element) || props.element?._lastGradient
|
|
376
|
+
if (g?.colors && g.colors.length > 1 && g.colors[g.colors.length - 1]?.color) {
|
|
377
|
+
return parseColor(g.colors[g.colors.length - 1]?.color).hex
|
|
378
|
+
}
|
|
379
|
+
if (props.gradientEndHex) return props.gradientEndHex
|
|
380
|
+
return generateGradientEndColor(activeGradientStart.value)
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
const activeGradientMid = computed(() => {
|
|
384
|
+
const g = getElementGradientConfig(props.element) || props.element?._lastGradient
|
|
385
|
+
if (g?.colors && g.colors.length > 2) {
|
|
386
|
+
const midIdx = Math.floor(g.colors.length / 2)
|
|
387
|
+
return parseColor(g.colors[midIdx].color).hex
|
|
388
|
+
}
|
|
389
|
+
return generateGradientEndColor(activeGradientStart.value)
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
function onShapeGradientRealtime(config: any, css: string) {
|
|
393
|
+
emit('update:elementGradient', config, css, false)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function onShapeGradientCommit(config: any, css: string) {
|
|
397
|
+
emit('update:elementGradient', config, css, true)
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const activeFillMode = computed(() => {
|
|
401
|
+
const fillType = props.shapeFillType || 'solid'
|
|
402
|
+
if (fillType === 'solid') return 'solid'
|
|
403
|
+
if (fillType === 'gradient') {
|
|
404
|
+
if (gradientEditorRef.value?.currentType) {
|
|
405
|
+
const ct = gradientEditorRef.value.currentType
|
|
406
|
+
return ct === 'path' ? 'gradient-linear' : `gradient-${ct}`
|
|
407
|
+
}
|
|
408
|
+
const g = getElementGradientConfig(props.element) || props.element?._lastGradient
|
|
409
|
+
if (g?.type) {
|
|
410
|
+
return g.type === 'path' ? 'gradient-linear' : `gradient-${g.type}`
|
|
411
|
+
}
|
|
412
|
+
if (props.gradientPathType === 'circle') return 'gradient-radial'
|
|
413
|
+
if (props.gradientPathType === 'rect') return 'gradient-rect'
|
|
414
|
+
return 'gradient-linear'
|
|
415
|
+
}
|
|
416
|
+
if (fillType === 'image') return 'image'
|
|
417
|
+
if (fillType === 'pattern') return 'pattern'
|
|
418
|
+
return 'solid'
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
function selectFillMode(mode: string) {
|
|
422
|
+
if (!props.isFillEnabled) {
|
|
423
|
+
emit('update:isFillEnabled', true)
|
|
424
|
+
emit('update:isFillExpanded', true)
|
|
425
|
+
}
|
|
426
|
+
if (mode === 'solid') {
|
|
427
|
+
emit('update:shapeFillType', 'solid')
|
|
428
|
+
} else if (mode.startsWith('gradient-')) {
|
|
429
|
+
const gType = mode.replace('gradient-', '') as 'linear' | 'radial' | 'rect'
|
|
430
|
+
const path = gType === 'linear' ? 'line' : (gType === 'radial' ? 'circle' : 'rect')
|
|
431
|
+
emit('update:gradientPathType', path)
|
|
432
|
+
if (props.shapeFillType !== 'gradient') {
|
|
433
|
+
emit('update:shapeFillType', 'gradient')
|
|
434
|
+
}
|
|
435
|
+
nextTick(() => {
|
|
436
|
+
if (gradientEditorRef.value?.changeType) {
|
|
437
|
+
gradientEditorRef.value.changeType(gType)
|
|
438
|
+
}
|
|
439
|
+
})
|
|
440
|
+
} else if (mode === 'image') {
|
|
441
|
+
emit('update:shapeFillType', 'image')
|
|
442
|
+
} else if (mode === 'pattern') {
|
|
443
|
+
emit('update:shapeFillType', 'pattern')
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function toggleFillHeader() {
|
|
448
|
+
if (!props.isFillEnabled) return
|
|
449
|
+
emit('update:isFillExpanded', !props.isFillExpanded)
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function toggleFillSwitch(val: any) {
|
|
453
|
+
const boolVal = !!val
|
|
454
|
+
emit('update:isFillEnabled', boolVal)
|
|
455
|
+
emit('update:isFillExpanded', boolVal)
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const currentPatternImage = computed(() => {
|
|
459
|
+
return props.shapePatternFill || props.element?.pattern || props.element?.style?.pattern || ''
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
function triggerImageUpload() {
|
|
463
|
+
imageFileInputRef.value?.click()
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function handleImageFileChange(e: Event) {
|
|
467
|
+
emit('handleShapePatternUpload', e)
|
|
468
|
+
if (imageFileInputRef.value) {
|
|
469
|
+
imageFileInputRef.value.value = ''
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
const activePatternType = computed(() => {
|
|
474
|
+
if (props.shapePatternType && props.shapePatternType !== 'pattern' && props.shapePatternType !== 'solid') {
|
|
475
|
+
return props.shapePatternType
|
|
476
|
+
}
|
|
477
|
+
const meta = parsePatternSvgMeta(currentPatternImage.value)
|
|
478
|
+
return meta.type || 'diag-up'
|
|
479
|
+
})
|
|
480
|
+
|
|
481
|
+
const parsedPatternFg = computed(() => {
|
|
482
|
+
const raw = props.shapePatternFg || parsePatternSvgMeta(currentPatternImage.value).fg || '#3B82F6'
|
|
483
|
+
return parseColor(raw)
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
const parsedPatternBg = computed(() => {
|
|
487
|
+
const raw = props.shapePatternBg || parsePatternSvgMeta(currentPatternImage.value).bg || '#FFFFFF'
|
|
488
|
+
return parseColor(raw)
|
|
489
|
+
})
|
|
490
|
+
|
|
491
|
+
function getPatternPresetPreviewUrl(p: { key: string; url: string }) {
|
|
492
|
+
const fg = props.shapePatternFg || '#3B82F6'
|
|
493
|
+
const bg = props.shapePatternBg || '#FFFFFF'
|
|
494
|
+
return buildPatternSvgDataUrl(p.key, fg, bg)
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function isPatternPresetActive(p: { key: string; url: string }) {
|
|
498
|
+
return activePatternType.value === p.key
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function selectPatternPreset(p: { key: string; url: string }) {
|
|
502
|
+
emit('update:shapePatternType', p.key)
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function onSelectPatternFgColor(color: string) {
|
|
506
|
+
if (!color || color === 'transparent' || color === 'none') {
|
|
507
|
+
emit('update:shapePatternFg', 'transparent')
|
|
508
|
+
return
|
|
509
|
+
}
|
|
510
|
+
emit('update:shapePatternFg', color)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function handlePatternFgOpacityInput(e: Event) {
|
|
514
|
+
const target = e.target as HTMLInputElement
|
|
515
|
+
let val = parseInt(target.value)
|
|
516
|
+
if (isNaN(val)) val = 100
|
|
517
|
+
val = Math.max(0, Math.min(100, val))
|
|
518
|
+
if (val === 0) {
|
|
519
|
+
emit('update:shapePatternFg', 'transparent')
|
|
520
|
+
} else if (val === 100) {
|
|
521
|
+
const hex = parsedPatternFg.value.hex === 'transparent' ? '#3B82F6' : parsedPatternFg.value.hex
|
|
522
|
+
emit('update:shapePatternFg', hex)
|
|
523
|
+
} else {
|
|
524
|
+
const hex = parsedPatternFg.value.hex === 'transparent' ? '#3B82F6' : parsedPatternFg.value.hex
|
|
525
|
+
emit('update:shapePatternFg', hexToRgba(hex, val))
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function onSelectPatternBgColor(color: string) {
|
|
530
|
+
if (!color || color === 'transparent' || color === 'none') {
|
|
531
|
+
emit('update:shapePatternBg', 'transparent')
|
|
532
|
+
return
|
|
533
|
+
}
|
|
534
|
+
emit('update:shapePatternBg', color)
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function handlePatternBgOpacityInput(e: Event) {
|
|
538
|
+
const target = e.target as HTMLInputElement
|
|
539
|
+
let val = parseInt(target.value)
|
|
540
|
+
if (isNaN(val)) val = 100
|
|
541
|
+
val = Math.max(0, Math.min(100, val))
|
|
542
|
+
if (val === 0) {
|
|
543
|
+
emit('update:shapePatternBg', 'transparent')
|
|
544
|
+
} else if (val === 100) {
|
|
545
|
+
const hex = parsedPatternBg.value.hex === 'transparent' ? '#FFFFFF' : parsedPatternBg.value.hex
|
|
546
|
+
emit('update:shapePatternBg', hex)
|
|
547
|
+
} else {
|
|
548
|
+
const hex = parsedPatternBg.value.hex === 'transparent' ? '#FFFFFF' : parsedPatternBg.value.hex
|
|
549
|
+
emit('update:shapePatternBg', hexToRgba(hex, val))
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const displayFillOpacity = computed(() => {
|
|
554
|
+
if (props.fillHex === 'transparent' || props.fillHex === 'none') {
|
|
555
|
+
return 0
|
|
556
|
+
}
|
|
557
|
+
const alpha = props.fillOpacity !== undefined ? props.fillOpacity : 100
|
|
558
|
+
return Math.max(0, Math.min(100, Math.round(alpha)))
|
|
559
|
+
})
|
|
560
|
+
|
|
561
|
+
function handleFillOpacityInput(e: Event) {
|
|
562
|
+
const target = e.target as HTMLInputElement
|
|
563
|
+
let val = parseInt(target.value)
|
|
564
|
+
if (isNaN(val)) val = 100
|
|
565
|
+
val = Math.max(0, Math.min(100, val))
|
|
566
|
+
emit('update:fillOpacity', val)
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function onSelectFillColor(color: string) {
|
|
570
|
+
if (!color || color === 'transparent' || color === 'none') {
|
|
571
|
+
emit('update:fillHex', 'transparent')
|
|
572
|
+
emit('update:fillOpacity', 0)
|
|
573
|
+
return
|
|
574
|
+
}
|
|
575
|
+
const parsed = parseColor(color)
|
|
576
|
+
emit('update:fillHex', parsed.hex)
|
|
577
|
+
if (parsed.alpha !== undefined && parsed.alpha < 100) {
|
|
578
|
+
emit('update:fillOpacity', parsed.alpha)
|
|
579
|
+
} else if (!props.fillOpacity || props.fillOpacity === 0) {
|
|
580
|
+
emit('update:fillOpacity', 100)
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
</script>
|
|
584
|
+
|
|
585
|
+
<template>
|
|
586
|
+
<div class="sidebar-chart-format-panel flex-column" style="display: flex; flex-direction: column;">
|
|
587
|
+
<!-- Alignment Row -->
|
|
588
|
+
<SidebarAlignGroup @align-left="emit('alignLeft')" @align-center="emit('alignCenter')"
|
|
589
|
+
@align-right="emit('alignRight')" @align-top="emit('alignTop')" @align-middle="emit('alignMiddle')"
|
|
590
|
+
@align-bottom="emit('alignBottom')" />
|
|
591
|
+
|
|
592
|
+
<!-- Position & Dimensions without rotate and flips, with "编辑数据" inside the group -->
|
|
593
|
+
<SidebarPositionGroup :element-x="elementX" :element-y="elementY" :element-w="elementW" :element-h="elementH"
|
|
594
|
+
:element-rotate="elementRotate" :is-fixed-ratio="isFixedRatio" :is-flip-h="isFlipH" :is-flip-v="isFlipV"
|
|
595
|
+
:show-rotate="false" :show-flips="false" @update:element-x="emit('update:elementX', $event)"
|
|
596
|
+
@update:element-y="emit('update:elementY', $event)" @update:element-w="emit('update:elementW', $event)"
|
|
597
|
+
@update:element-h="emit('update:elementH', $event)" @update:element-rotate="emit('update:elementRotate', $event)"
|
|
598
|
+
@update:is-fixed-ratio="emit('update:isFixedRatio', $event)" @toggle-flip-h="emit('toggleFlipH')"
|
|
599
|
+
@toggle-flip-v="emit('toggleFlipV')" @adjust-z-index="emit('adjustZIndex', $event)">
|
|
600
|
+
<!-- Edit Chart Data Button placed inside position group before bottom border divider -->
|
|
601
|
+
<el-button type="primary" class="edit-chart-data-btn" @click="emit('openChartDataDialog')">
|
|
602
|
+
编辑数据
|
|
603
|
+
</el-button>
|
|
604
|
+
</SidebarPositionGroup>
|
|
605
|
+
|
|
606
|
+
<!-- Chart Specific Settings -->
|
|
607
|
+
<div style="padding: 0 16px; display: flex; flex-direction: column; gap: 12px; margin-top: 8px;">
|
|
608
|
+
<!-- Chart Type -->
|
|
609
|
+
<div class="shape-property-row"
|
|
610
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
611
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">图表类型</span>
|
|
612
|
+
<el-popover placement="bottom" :width="568" trigger="click" popper-class="chart-popover-popper"
|
|
613
|
+
v-model:visible="chartTypePopoverVisible" :show-arrow="false">
|
|
614
|
+
<template #reference>
|
|
615
|
+
<div
|
|
616
|
+
style="flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: #f5f6f7; border-radius: 4px; cursor: pointer; height: 32px; box-sizing: border-box;">
|
|
617
|
+
<span style="font-size: 12px; color: var(--text-primary); font-weight: 500;">
|
|
618
|
+
{{ getChartTypeName(normalizedChartType) }}
|
|
619
|
+
</span>
|
|
620
|
+
<span style="font-size: 10px; color: var(--text-muted);">▼</span>
|
|
621
|
+
</div>
|
|
622
|
+
</template>
|
|
623
|
+
<ChartTypeSelector :current-type="normalizedChartType" @select="onSelectChartType" />
|
|
624
|
+
</el-popover>
|
|
625
|
+
</div>
|
|
626
|
+
|
|
627
|
+
<!-- Chart Primary Color (图表主色) -->
|
|
628
|
+
<div class="shape-property-row"
|
|
629
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
630
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">图表主色</span>
|
|
631
|
+
<QuickColorPopover v-model:visible="chartPrimaryColorPopoverVisible" :color="chartPrimaryColor"
|
|
632
|
+
v-model:recentColors="localRecentColors" @select-color="(val) => emit('update:chartPrimaryColor', val)">
|
|
633
|
+
<template #reference>
|
|
634
|
+
<div class="color-picker-pill-wrapper" style="flex: 1; height: 32px;">
|
|
635
|
+
<div class="color-pill-inner" style="height: 32px;">
|
|
636
|
+
<div :style="{ background: chartPrimaryColor }" class="color-square-preview"></div>
|
|
637
|
+
<span style="font-size: 11px; color: var(--text-primary); font-family: monospace; font-weight: 500;">
|
|
638
|
+
{{ formatHexDisplay(chartPrimaryColor) }}
|
|
639
|
+
</span>
|
|
640
|
+
</div>
|
|
641
|
+
</div>
|
|
642
|
+
</template>
|
|
643
|
+
</QuickColorPopover>
|
|
644
|
+
</div>
|
|
645
|
+
|
|
646
|
+
<!-- Chart Palette (调色板) -->
|
|
647
|
+
<div class="shape-property-row"
|
|
648
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
649
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">调色板</span>
|
|
650
|
+
<el-popover placement="bottom-end" :width="250" trigger="click" v-model:visible="chartPalettePopoverVisible"
|
|
651
|
+
popper-class="chart-palette-popover">
|
|
652
|
+
<template #reference>
|
|
653
|
+
<div
|
|
654
|
+
style="flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: #f5f6f7; border-radius: 4px; cursor: pointer; height: 32px; box-sizing: border-box;">
|
|
655
|
+
<div style="display: flex; gap: 4px; align-items: center; overflow: hidden;">
|
|
656
|
+
<div v-for="(c, idx) in currentChartColors" :key="idx" :style="{ background: c }"
|
|
657
|
+
style="width: 14px; height: 14px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.08); flex-shrink: 0;">
|
|
658
|
+
</div>
|
|
659
|
+
</div>
|
|
660
|
+
<span style="font-size: 10px; color: var(--text-muted); margin-left: 6px;">▼</span>
|
|
661
|
+
</div>
|
|
662
|
+
</template>
|
|
663
|
+
<div
|
|
664
|
+
style="padding: 4px 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto;">
|
|
665
|
+
<div v-for="item in chartPresetPalettes" :key="item.id" class="chart-palette-option-item"
|
|
666
|
+
:class="{ active: currentChartPaletteId === item.id }" @click="onSelectChartPalette(item)"
|
|
667
|
+
style="padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: background 0.15s ease;">
|
|
668
|
+
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
669
|
+
<span style="font-size: 12px; font-weight: 500; color: var(--text-primary);">{{ item.name }}</span>
|
|
670
|
+
<span v-if="currentChartPaletteId === item.id"
|
|
671
|
+
style="color: var(--accent-primary); font-size: 12px; font-weight: bold;">✔</span>
|
|
672
|
+
</div>
|
|
673
|
+
<div style="display: flex; gap: 4px; align-items: center;">
|
|
674
|
+
<div v-for="(col, cIdx) in getPaletteColors(item)" :key="cIdx" :style="{ background: col }"
|
|
675
|
+
style="flex: 1; height: 14px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.08);"></div>
|
|
676
|
+
</div>
|
|
677
|
+
</div>
|
|
678
|
+
</div>
|
|
679
|
+
</el-popover>
|
|
680
|
+
</div>
|
|
681
|
+
|
|
682
|
+
<!-- Axis Color (坐标轴色 - 仅直角坐标系/雷达图或开启数据表时显示) -->
|
|
683
|
+
<div v-if="!isPieOrDonut || chartShowDataTable" class="shape-property-row"
|
|
684
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
685
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">{{ isPieOrDonut ? '表格线色' : '坐标轴色' }}</span>
|
|
686
|
+
<QuickColorPopover v-model:visible="chartGridColorPopoverVisible" :color="chartGridColor"
|
|
687
|
+
v-model:recentColors="localRecentColors" @select-color="(val) => emit('update:chartGridColor', val)">
|
|
688
|
+
<template #reference>
|
|
689
|
+
<div class="color-picker-pill-wrapper" style="flex: 1; height: 32px;">
|
|
690
|
+
<div class="color-pill-inner" style="height: 32px;">
|
|
691
|
+
<div :style="{ background: chartGridColor }" class="color-square-preview"></div>
|
|
692
|
+
<span style="font-size: 11px; color: var(--text-primary); font-family: monospace; font-weight: 500;">
|
|
693
|
+
{{ formatHexDisplay(chartGridColor) }}
|
|
694
|
+
</span>
|
|
695
|
+
</div>
|
|
696
|
+
</div>
|
|
697
|
+
</template>
|
|
698
|
+
</QuickColorPopover>
|
|
699
|
+
</div>
|
|
700
|
+
|
|
701
|
+
<!-- Text Color (文字颜色) -->
|
|
702
|
+
<div class="shape-property-row"
|
|
703
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
704
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">文字颜色</span>
|
|
705
|
+
<QuickColorPopover v-model:visible="chartTextColorPopoverVisible" :color="chartTextColor"
|
|
706
|
+
v-model:recentColors="localRecentColors" @select-color="(val) => emit('update:chartTextColor', val)">
|
|
707
|
+
<template #reference>
|
|
708
|
+
<div class="color-picker-pill-wrapper" style="flex: 1; height: 32px;">
|
|
709
|
+
<div class="color-pill-inner" style="height: 32px;">
|
|
710
|
+
<div :style="{ background: chartTextColor }" class="color-square-preview"></div>
|
|
711
|
+
<span style="font-size: 11px; color: var(--text-primary); font-family: monospace; font-weight: 500;">
|
|
712
|
+
{{ formatHexDisplay(chartTextColor) }}
|
|
713
|
+
</span>
|
|
714
|
+
</div>
|
|
715
|
+
</div>
|
|
716
|
+
</template>
|
|
717
|
+
</QuickColorPopover>
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
<!-- Donut Hole Size (环形图 / 玫瑰环图专属:内径比例调节) -->
|
|
721
|
+
<div v-if="normalizedChartType === 'donut' || normalizedChartType === 'rose-donut'" class="shape-property-row"
|
|
722
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
723
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">环形内径</span>
|
|
724
|
+
<div style="flex: 1; display: flex; align-items: center; gap: 8px;">
|
|
725
|
+
<el-slider v-model="donutHoleSize" :min="25" :max="85" :show-tooltip="false" size="small" style="flex: 1;" />
|
|
726
|
+
<span style="font-size: 11px; color: var(--text-secondary, #475569); width: 34px; text-align: right; font-variant-numeric: tabular-nums;">
|
|
727
|
+
{{ donutHoleSize }}%
|
|
728
|
+
</span>
|
|
729
|
+
</div>
|
|
730
|
+
</div>
|
|
731
|
+
|
|
732
|
+
<!-- Elements Checkboxes (根据当前图表类型智能过滤有效元素) -->
|
|
733
|
+
<div class="shape-property-row"
|
|
734
|
+
style="display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; height: auto;">
|
|
735
|
+
<span class="shape-property-label"
|
|
736
|
+
style="flex-shrink: 0; width: 64px; text-align: left; margin-top: 4px;">图表元素</span>
|
|
737
|
+
<div style="flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;">
|
|
738
|
+
<el-checkbox v-if="!isPieOrDonut" v-model="chartShowAxes" size="small">坐标轴</el-checkbox>
|
|
739
|
+
<el-checkbox v-if="isCartesianChart" v-model="chartShowAxisTitles" size="small">轴标题</el-checkbox>
|
|
740
|
+
<el-checkbox v-model="chartShowTitle" size="small">图表标题</el-checkbox>
|
|
741
|
+
<el-checkbox v-model="chartShowDataLabels" size="small">数据标签</el-checkbox>
|
|
742
|
+
<el-checkbox v-if="!isPieOrDonut" v-model="chartShowGridlines" size="small">网格线</el-checkbox>
|
|
743
|
+
<el-checkbox v-model="chartShowLegend" size="small">图例</el-checkbox>
|
|
744
|
+
<el-checkbox v-model="chartShowDataTable" size="small">数据表</el-checkbox>
|
|
745
|
+
<el-checkbox v-if="isCartesianChart" v-model="chartShowErrorBars" size="small">误差线</el-checkbox>
|
|
746
|
+
</div>
|
|
747
|
+
</div>
|
|
748
|
+
|
|
749
|
+
<!-- 图表标题文字编辑 (开启图表标题时展示) -->
|
|
750
|
+
<div v-if="chartShowTitle" class="shape-property-row"
|
|
751
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
752
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">标题内容</span>
|
|
753
|
+
<el-input v-model="element.chartTitle" size="small" placeholder="请输入图表标题" style="flex: 1;" />
|
|
754
|
+
</div>
|
|
755
|
+
|
|
756
|
+
<!-- 坐标轴标题文字编辑 (直角坐标系开启轴标题时展示) -->
|
|
757
|
+
<div v-if="isCartesianChart && chartShowAxisTitles" class="shape-property-row"
|
|
758
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto;">
|
|
759
|
+
<span class="shape-property-label" style="flex-shrink: 0; width: 64px; text-align: left;">轴标题名</span>
|
|
760
|
+
<div style="flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;">
|
|
761
|
+
<el-input v-model="element.xAxisTitle" size="small" placeholder="横轴标题" />
|
|
762
|
+
<el-input v-model="element.yAxisTitle" size="small" placeholder="纵轴标题" />
|
|
763
|
+
</div>
|
|
764
|
+
</div>
|
|
765
|
+
|
|
766
|
+
<!-- Legend Positions (12 grid buttons - 开启图例时显示) -->
|
|
767
|
+
<div v-if="chartShowLegend" class="shape-property-row"
|
|
768
|
+
style="display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; height: auto;">
|
|
769
|
+
<span class="shape-property-label"
|
|
770
|
+
style="flex-shrink: 0; width: 64px; text-align: left; margin-top: 4px;">图例位置</span>
|
|
771
|
+
<div style="flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;">
|
|
772
|
+
<div v-for="pos in legendPositions" :key="pos" class="grid-btn" :style="{
|
|
773
|
+
border: (element.legendPosition || 'bottom') === pos ? '1.5px solid var(--accent-primary, #6366f1)' : '1px solid var(--border-color, #e2e8f0)',
|
|
774
|
+
color: (element.legendPosition || 'bottom') === pos ? 'var(--accent-primary, #6366f1)' : 'inherit',
|
|
775
|
+
background: (element.legendPosition || 'bottom') === pos ? '#f5f3ff' : '#ffffff'
|
|
776
|
+
}"
|
|
777
|
+
style="height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-sizing: border-box; transition: all 0.15s ease;"
|
|
778
|
+
@click="element.legendPosition = pos">
|
|
779
|
+
<svg class="icon" style="width: 20px; height: 20px;">
|
|
780
|
+
<use :xlink:href="`#${legendIcons[pos]}`"></use>
|
|
781
|
+
</svg>
|
|
782
|
+
</div>
|
|
783
|
+
</div>
|
|
784
|
+
</div>
|
|
785
|
+
</div>
|
|
786
|
+
|
|
787
|
+
<!-- Accordions: Fill, Border, Shadow, Reflection -->
|
|
788
|
+
<!-- Fill Accordion (aligned with SidebarShapeFormatPanel & SidebarBorderAccordion) -->
|
|
789
|
+
<div class="control-group shape-accordion-group"
|
|
790
|
+
style="border-top: 1px solid #f1f5f9; margin-top: 12px; padding-top: 12px;">
|
|
791
|
+
<div class="shape-accordion-header" @click="toggleFillHeader">
|
|
792
|
+
<span class="control-label shape-accordion-header-label">
|
|
793
|
+
<span>填充</span>
|
|
794
|
+
<span class="accordion-arrow">
|
|
795
|
+
<svg class="icon" style="width: 14px; height: 14px;">
|
|
796
|
+
<use :href="(isFillEnabled && isFillExpanded) ? '#icon-ppt-xiala-zhankai' : '#icon-ppt-xiala-shouqi'"
|
|
797
|
+
:xlink:href="(isFillEnabled && isFillExpanded) ? '#icon-ppt-xiala-zhankai' : '#icon-ppt-xiala-shouqi'"></use>
|
|
798
|
+
</svg>
|
|
799
|
+
</span>
|
|
800
|
+
</span>
|
|
801
|
+
<el-switch :model-value="isFillEnabled" size="small" @click.stop @change="toggleFillSwitch" />
|
|
802
|
+
</div>
|
|
803
|
+
|
|
804
|
+
<div v-show="isFillExpanded && isFillEnabled" class="shape-accordion-content">
|
|
805
|
+
<!-- 6 Fill Type Buttons Bar -->
|
|
806
|
+
<div class="fill-types-bar">
|
|
807
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'solid' }"
|
|
808
|
+
@click="selectFillMode('solid')" title="纯色填充">
|
|
809
|
+
<svg viewBox="0 0 18 18" width="18" height="18">
|
|
810
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2"
|
|
811
|
+
:fill="activeFillMode === 'solid' ? (props.fillHex && props.fillHex !== 'transparent' ? props.fillHex : '#3b82f6') : '#cbd5e1'"
|
|
812
|
+
:stroke="activeFillMode === 'solid' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
813
|
+
</svg>
|
|
814
|
+
</button>
|
|
815
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'gradient-linear' }"
|
|
816
|
+
@click="selectFillMode('gradient-linear')" title="线性渐变">
|
|
817
|
+
<svg viewBox="0 0 18 18" width="18" height="18">
|
|
818
|
+
<defs>
|
|
819
|
+
<linearGradient id="chartFillBarLinear" x1="0" y1="0" x2="0" y2="1">
|
|
820
|
+
<stop offset="0%" :stop-color="activeFillMode === 'gradient-linear' ? activeGradientStart : '#94a3b8'" />
|
|
821
|
+
<stop offset="100%" :stop-color="activeFillMode === 'gradient-linear' ? activeGradientEnd : '#ffffff'" />
|
|
822
|
+
</linearGradient>
|
|
823
|
+
</defs>
|
|
824
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2" fill="url(#chartFillBarLinear)" :stroke="activeFillMode === 'gradient-linear' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
825
|
+
</svg>
|
|
826
|
+
</button>
|
|
827
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'gradient-radial' }"
|
|
828
|
+
@click="selectFillMode('gradient-radial')" title="径向渐变">
|
|
829
|
+
<svg viewBox="0 0 18 18" width="18" height="18">
|
|
830
|
+
<defs>
|
|
831
|
+
<radialGradient id="chartFillBarRadial" cx="50%" cy="50%" r="50%">
|
|
832
|
+
<stop offset="15%" :stop-color="activeFillMode === 'gradient-radial' ? activeGradientEnd : '#ffffff'" />
|
|
833
|
+
<stop offset="100%" :stop-color="activeFillMode === 'gradient-radial' ? activeGradientStart : '#cbd5e1'" />
|
|
834
|
+
</radialGradient>
|
|
835
|
+
</defs>
|
|
836
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2" fill="url(#chartFillBarRadial)" :stroke="activeFillMode === 'gradient-radial' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
837
|
+
</svg>
|
|
838
|
+
</button>
|
|
839
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'gradient-rect' }"
|
|
840
|
+
@click="selectFillMode('gradient-rect')" title="菱形渐变">
|
|
841
|
+
<svg viewBox="0 0 18 18" width="18" height="18">
|
|
842
|
+
<defs>
|
|
843
|
+
<radialGradient id="chartFillBarRect" cx="50%" cy="50%" r="50%">
|
|
844
|
+
<stop offset="0%" :stop-color="activeFillMode === 'gradient-rect' ? activeGradientEnd : '#ffffff'" />
|
|
845
|
+
<stop offset="60%" :stop-color="activeFillMode === 'gradient-rect' ? activeGradientMid : '#e2e8f0'" />
|
|
846
|
+
<stop offset="100%" :stop-color="activeFillMode === 'gradient-rect' ? activeGradientStart : '#94a3b8'" />
|
|
847
|
+
</radialGradient>
|
|
848
|
+
</defs>
|
|
849
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2" fill="url(#chartFillBarRect)" :stroke="activeFillMode === 'gradient-rect' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
850
|
+
</svg>
|
|
851
|
+
</button>
|
|
852
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'image' }"
|
|
853
|
+
@click="selectFillMode('image')" title="图片填充">
|
|
854
|
+
<svg viewBox="0 0 18 18" width="18" height="18" fill="none">
|
|
855
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2" :stroke="activeFillMode === 'image' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" fill="#ffffff" />
|
|
856
|
+
<circle cx="6" cy="6" r="1.5" :fill="activeFillMode === 'image' ? '#1E6FFF' : '#94a3b8'" />
|
|
857
|
+
<path d="M2.5 14L7 9.5L10.5 13L12.5 11L15.5 14" :stroke="activeFillMode === 'image' ? '#1E6FFF' : '#94a3b8'" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round" />
|
|
858
|
+
</svg>
|
|
859
|
+
</button>
|
|
860
|
+
<button type="button" class="fill-type-icon-btn" :class="{ active: activeFillMode === 'pattern' }"
|
|
861
|
+
@click="selectFillMode('pattern')" title="图案填充">
|
|
862
|
+
<svg viewBox="0 0 18 18" width="18" height="18">
|
|
863
|
+
<defs>
|
|
864
|
+
<pattern id="chartFillBarPattern" width="4" height="4" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
|
865
|
+
<line x1="0" y1="0" x2="0" y2="4" :stroke="activeFillMode === 'pattern' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
866
|
+
</pattern>
|
|
867
|
+
</defs>
|
|
868
|
+
<rect x="0.5" y="0.5" width="17" height="17" rx="2" fill="url(#chartFillBarPattern)" :stroke="activeFillMode === 'pattern' ? '#1E6FFF' : '#94a3b8'" stroke-width="1" />
|
|
869
|
+
</svg>
|
|
870
|
+
</button>
|
|
871
|
+
</div>
|
|
872
|
+
|
|
873
|
+
<!-- Solid Fill (Full-width Color Pill) -->
|
|
874
|
+
<template v-if="(shapeFillType || 'solid') === 'solid'">
|
|
875
|
+
<div class="full-color-pill">
|
|
876
|
+
<QuickColorPopover v-model:visible="fillPopoverVisible" :color="fillHex || '#FFFFFF'" :alpha="props.fillOpacity"
|
|
877
|
+
v-model:recentColors="localRecentColors" @select-color="onSelectFillColor">
|
|
878
|
+
<template #reference>
|
|
879
|
+
<div class="color-left-info">
|
|
880
|
+
<div :style="{ background: fillHex || '#FFFFFF' }" class="color-square-preview"></div>
|
|
881
|
+
<span class="color-hex-text">
|
|
882
|
+
{{ formatHexDisplay(fillHex || '#FFFFFF') }}
|
|
883
|
+
</span>
|
|
884
|
+
</div>
|
|
885
|
+
</template>
|
|
886
|
+
</QuickColorPopover>
|
|
887
|
+
<div class="color-opacity-input-wrapper" @click.stop title="不透明度 (0%为完全透明,100%为完全不透明)">
|
|
888
|
+
<input
|
|
889
|
+
type="number"
|
|
890
|
+
class="color-opacity-num-input"
|
|
891
|
+
:value="displayFillOpacity"
|
|
892
|
+
min="0"
|
|
893
|
+
max="100"
|
|
894
|
+
@input="handleFillOpacityInput"
|
|
895
|
+
@keydown.enter="($event.target as HTMLElement).blur()"
|
|
896
|
+
/>
|
|
897
|
+
<span class="percent-unit">%</span>
|
|
898
|
+
</div>
|
|
899
|
+
</div>
|
|
900
|
+
</template>
|
|
901
|
+
|
|
902
|
+
<!-- Gradient Fill -->
|
|
903
|
+
<template v-else-if="shapeFillType === 'gradient'">
|
|
904
|
+
<div style="padding: 0;">
|
|
905
|
+
<GradientEditor
|
|
906
|
+
ref="gradientEditorRef"
|
|
907
|
+
:hide-type-buttons="true"
|
|
908
|
+
:model-value="currentShapeGradient"
|
|
909
|
+
:recent-colors="localRecentColors"
|
|
910
|
+
@update:config="onShapeGradientRealtime"
|
|
911
|
+
@change:config="onShapeGradientCommit"
|
|
912
|
+
/>
|
|
913
|
+
</div>
|
|
914
|
+
</template>
|
|
915
|
+
|
|
916
|
+
<!-- Image Fill -->
|
|
917
|
+
<template v-else-if="shapeFillType === 'image'">
|
|
918
|
+
<div class="image-fill-section">
|
|
919
|
+
<input
|
|
920
|
+
ref="imageFileInputRef"
|
|
921
|
+
type="file"
|
|
922
|
+
accept="image/*"
|
|
923
|
+
style="display: none;"
|
|
924
|
+
@change="handleImageFileChange"
|
|
925
|
+
/>
|
|
926
|
+
<div v-if="currentPatternImage" class="image-fill-preview-card">
|
|
927
|
+
<div class="image-fill-thumb" :style="{ backgroundImage: `url(${currentPatternImage})` }"></div>
|
|
928
|
+
<div class="image-fill-btn-group">
|
|
929
|
+
<button type="button" class="image-fill-sub-btn" @click="triggerImageUpload">更换图片</button>
|
|
930
|
+
<button type="button" class="image-fill-sub-btn danger" @click="emit('clearShapePatternFill')">清除</button>
|
|
931
|
+
</div>
|
|
932
|
+
</div>
|
|
933
|
+
<div v-else class="image-fill-upload-card" @click="triggerImageUpload">
|
|
934
|
+
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.6">
|
|
935
|
+
<rect x="3" y="3" width="18" height="18" rx="3" stroke="currentColor" />
|
|
936
|
+
<circle cx="8.5" cy="8.5" r="1.5" fill="currentColor" />
|
|
937
|
+
<path d="M21 15l-5-5L5 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
|
938
|
+
</svg>
|
|
939
|
+
<span class="upload-tip-text">点击上传图片</span>
|
|
940
|
+
</div>
|
|
941
|
+
</div>
|
|
942
|
+
</template>
|
|
943
|
+
|
|
944
|
+
<!-- Pattern Fill -->
|
|
945
|
+
<template v-else-if="shapeFillType === 'pattern'">
|
|
946
|
+
<div class="pattern-fill-container">
|
|
947
|
+
<div class="pattern-presets-grid">
|
|
948
|
+
<div
|
|
949
|
+
v-for="p in PATTERN_PRESETS"
|
|
950
|
+
:key="p.key"
|
|
951
|
+
class="pattern-preset-card"
|
|
952
|
+
:class="{ active: isPatternPresetActive(p) }"
|
|
953
|
+
:title="p.name"
|
|
954
|
+
:style="{ backgroundImage: `url('${getPatternPresetPreviewUrl(p)}')` }"
|
|
955
|
+
@click="selectPatternPreset(p)"
|
|
956
|
+
></div>
|
|
957
|
+
</div>
|
|
958
|
+
|
|
959
|
+
<div class="pattern-colors-section">
|
|
960
|
+
<div class="shape-property-row">
|
|
961
|
+
<span class="shape-property-label" style="width: 44px;">前景</span>
|
|
962
|
+
<div class="full-color-pill" style="flex: 1;">
|
|
963
|
+
<QuickColorPopover
|
|
964
|
+
v-model:visible="patternFgPopoverVisible"
|
|
965
|
+
:color="parsedPatternFg.hex === 'transparent' ? '#3B82F6' : parsedPatternFg.hex"
|
|
966
|
+
:alpha="parsedPatternFg.alpha"
|
|
967
|
+
:recent-colors="localRecentColors"
|
|
968
|
+
@select-color="onSelectPatternFgColor"
|
|
969
|
+
>
|
|
970
|
+
<template #reference>
|
|
971
|
+
<div class="color-left-info">
|
|
972
|
+
<div :style="{ background: parsedPatternFg.hex === 'transparent' ? 'transparent' : parsedPatternFg.hex }" class="color-square-preview"></div>
|
|
973
|
+
<span class="color-hex-text">{{ formatHexDisplay(parsedPatternFg.hex) }}</span>
|
|
974
|
+
</div>
|
|
975
|
+
</template>
|
|
976
|
+
</QuickColorPopover>
|
|
977
|
+
<div class="color-opacity-input-wrapper" @click.stop title="前景不透明度">
|
|
978
|
+
<input
|
|
979
|
+
type="number"
|
|
980
|
+
class="color-opacity-num-input"
|
|
981
|
+
:value="parsedPatternFg.alpha"
|
|
982
|
+
min="0"
|
|
983
|
+
max="100"
|
|
984
|
+
@input="handlePatternFgOpacityInput"
|
|
985
|
+
@keydown.enter="($event.target as HTMLElement).blur()"
|
|
986
|
+
/>
|
|
987
|
+
<span class="percent-unit">%</span>
|
|
988
|
+
</div>
|
|
989
|
+
</div>
|
|
990
|
+
</div>
|
|
991
|
+
|
|
992
|
+
<div class="shape-property-row">
|
|
993
|
+
<span class="shape-property-label" style="width: 44px;">背景</span>
|
|
994
|
+
<div class="full-color-pill" style="flex: 1;">
|
|
995
|
+
<QuickColorPopover
|
|
996
|
+
v-model:visible="patternBgPopoverVisible"
|
|
997
|
+
:color="parsedPatternBg.hex === 'transparent' ? '#FFFFFF' : parsedPatternBg.hex"
|
|
998
|
+
:alpha="parsedPatternBg.alpha"
|
|
999
|
+
:recent-colors="localRecentColors"
|
|
1000
|
+
@select-color="onSelectPatternBgColor"
|
|
1001
|
+
>
|
|
1002
|
+
<template #reference>
|
|
1003
|
+
<div class="color-left-info">
|
|
1004
|
+
<div :style="{ background: parsedPatternBg.hex === 'transparent' ? 'transparent' : parsedPatternBg.hex }" class="color-square-preview"></div>
|
|
1005
|
+
<span class="color-hex-text">{{ formatHexDisplay(parsedPatternBg.hex) }}</span>
|
|
1006
|
+
</div>
|
|
1007
|
+
</template>
|
|
1008
|
+
</QuickColorPopover>
|
|
1009
|
+
<div class="color-opacity-input-wrapper" @click.stop title="背景不透明度">
|
|
1010
|
+
<input
|
|
1011
|
+
type="number"
|
|
1012
|
+
class="color-opacity-num-input"
|
|
1013
|
+
:value="parsedPatternBg.alpha"
|
|
1014
|
+
min="0"
|
|
1015
|
+
max="100"
|
|
1016
|
+
@input="handlePatternBgOpacityInput"
|
|
1017
|
+
@keydown.enter="($event.target as HTMLElement).blur()"
|
|
1018
|
+
/>
|
|
1019
|
+
<span class="percent-unit">%</span>
|
|
1020
|
+
</div>
|
|
1021
|
+
</div>
|
|
1022
|
+
</div>
|
|
1023
|
+
</div>
|
|
1024
|
+
</div>
|
|
1025
|
+
</template>
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
|
|
1029
|
+
<!-- Border Accordion -->
|
|
1030
|
+
<SidebarBorderAccordion
|
|
1031
|
+
:is-border-enabled="isBorderEnabled"
|
|
1032
|
+
:is-border-expanded="isBorderExpanded"
|
|
1033
|
+
:border-hex="borderHex"
|
|
1034
|
+
:border-style="borderStyle"
|
|
1035
|
+
:border-width="borderWidth"
|
|
1036
|
+
:border-alpha="borderAlpha"
|
|
1037
|
+
:recent-colors="localRecentColors"
|
|
1038
|
+
@update:is-border-enabled="emit('update:isBorderEnabled', $event)"
|
|
1039
|
+
@update:is-border-expanded="emit('update:isBorderExpanded', $event)"
|
|
1040
|
+
@update:border-hex="emit('update:borderHex', $event)"
|
|
1041
|
+
@update:border-style="emit('update:borderStyle', $event)"
|
|
1042
|
+
@update:border-width="emit('update:borderWidth', $event)"
|
|
1043
|
+
@update:border-alpha="emit('update:borderAlpha', $event)"
|
|
1044
|
+
/>
|
|
1045
|
+
|
|
1046
|
+
<!-- Shadow Accordion -->
|
|
1047
|
+
<SidebarShadowAccordion
|
|
1048
|
+
:is-shadow-enabled="isShadowEnabled"
|
|
1049
|
+
:is-shadow-expanded="isShadowExpanded"
|
|
1050
|
+
:shadow-hex="shadowHex"
|
|
1051
|
+
:shadow-angle="shadowAngle"
|
|
1052
|
+
:shadow-size="shadowSize"
|
|
1053
|
+
:shadow-blur="shadowBlur"
|
|
1054
|
+
:shadow-distance="shadowDistance"
|
|
1055
|
+
:shadow-alpha="shadowAlpha"
|
|
1056
|
+
:recent-colors="localRecentColors"
|
|
1057
|
+
@update:is-shadow-enabled="emit('update:isShadowEnabled', $event)"
|
|
1058
|
+
@update:is-shadow-expanded="emit('update:isShadowExpanded', $event)"
|
|
1059
|
+
@update:shadow-hex="emit('update:shadowHex', $event)"
|
|
1060
|
+
@update:shadow-angle="emit('update:shadowAngle', $event)"
|
|
1061
|
+
@update:shadow-size="emit('update:shadowSize', $event)"
|
|
1062
|
+
@update:shadow-blur="emit('update:shadowBlur', $event)"
|
|
1063
|
+
@update:shadow-distance="emit('update:shadowDistance', $event)"
|
|
1064
|
+
@update:shadow-alpha="emit('update:shadowAlpha', $event)"
|
|
1065
|
+
/>
|
|
1066
|
+
|
|
1067
|
+
<!-- Reflection Accordion -->
|
|
1068
|
+
<SidebarReflectionAccordion
|
|
1069
|
+
:enable-reflection="enableReflection"
|
|
1070
|
+
:is-reflection-expanded="isReflectionExpanded"
|
|
1071
|
+
:reflection-distance="reflectionDistance"
|
|
1072
|
+
:reflection-size="reflectionSize"
|
|
1073
|
+
:reflection-opacity="reflectionOpacity"
|
|
1074
|
+
:reflection-blur="reflectionBlur"
|
|
1075
|
+
style="margin-bottom: 24px;"
|
|
1076
|
+
@update:enable-reflection="emit('update:enableReflection', $event)"
|
|
1077
|
+
@update:is-reflection-expanded="emit('update:isReflectionExpanded', $event)"
|
|
1078
|
+
@update:reflection-distance="emit('update:reflectionDistance', $event)"
|
|
1079
|
+
@update:reflection-size="emit('update:reflectionSize', $event)"
|
|
1080
|
+
@update:reflection-opacity="emit('update:reflectionOpacity', $event)"
|
|
1081
|
+
@update:reflection-blur="emit('update:reflectionBlur', $event)"
|
|
1082
|
+
/>
|
|
1083
|
+
</div>
|
|
1084
|
+
</template>
|
|
1085
|
+
|
|
1086
|
+
<style scoped lang="scss">
|
|
1087
|
+
.edit-chart-data-btn {
|
|
1088
|
+
width: 100%;
|
|
1089
|
+
height: 34px;
|
|
1090
|
+
margin-top: 4px;
|
|
1091
|
+
background-color: #1E6FFF !important;
|
|
1092
|
+
border-color: #1E6FFF !important;
|
|
1093
|
+
color: #ffffff !important;
|
|
1094
|
+
border-radius: 8px !important;
|
|
1095
|
+
font-size: 13px !important;
|
|
1096
|
+
font-weight: 500 !important;
|
|
1097
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
1098
|
+
|
|
1099
|
+
&:hover,
|
|
1100
|
+
&:focus {
|
|
1101
|
+
background-color: #195ee6 !important;
|
|
1102
|
+
border-color: #195ee6 !important;
|
|
1103
|
+
color: #ffffff !important;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
.shape-accordion-group {
|
|
1108
|
+
border-bottom: 1px solid #f1f5f9;
|
|
1109
|
+
padding-bottom: 12px;
|
|
1110
|
+
margin-bottom: 12px;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.shape-accordion-header {
|
|
1114
|
+
display: flex;
|
|
1115
|
+
align-items: center;
|
|
1116
|
+
justify-content: space-between;
|
|
1117
|
+
padding: 0 16px;
|
|
1118
|
+
height: 34px;
|
|
1119
|
+
cursor: pointer;
|
|
1120
|
+
user-select: none;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.shape-accordion-header-label {
|
|
1124
|
+
font-size: 14px;
|
|
1125
|
+
font-weight: 400;
|
|
1126
|
+
color: #1e293b;
|
|
1127
|
+
display: flex;
|
|
1128
|
+
align-items: center;
|
|
1129
|
+
gap: 6px;
|
|
1130
|
+
flex-shrink: 0;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.accordion-arrow {
|
|
1134
|
+
display: flex;
|
|
1135
|
+
align-items: center;
|
|
1136
|
+
justify-content: center;
|
|
1137
|
+
color: #64748b;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
:deep(.el-switch) {
|
|
1141
|
+
--el-switch-on-color: #2563eb;
|
|
1142
|
+
--el-switch-off-color: #cbd5e1;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.shape-accordion-content {
|
|
1146
|
+
padding: 8px 16px 0 16px;
|
|
1147
|
+
display: flex;
|
|
1148
|
+
flex-direction: column;
|
|
1149
|
+
gap: 8px;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.fill-types-bar {
|
|
1153
|
+
display: flex;
|
|
1154
|
+
align-items: center;
|
|
1155
|
+
justify-content: space-between;
|
|
1156
|
+
margin-bottom: 4px;
|
|
1157
|
+
width: 100%;
|
|
1158
|
+
height: 40px;
|
|
1159
|
+
background: #f8f9fa;
|
|
1160
|
+
border: 1px solid #edf0f3;
|
|
1161
|
+
border-radius: 10px;
|
|
1162
|
+
padding: 3px 4px;
|
|
1163
|
+
box-sizing: border-box;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
.fill-type-icon-btn {
|
|
1167
|
+
width: 32px;
|
|
1168
|
+
height: 32px;
|
|
1169
|
+
flex: 0 0 32px;
|
|
1170
|
+
border-radius: 9px;
|
|
1171
|
+
background: transparent;
|
|
1172
|
+
border: 1px solid transparent;
|
|
1173
|
+
display: flex;
|
|
1174
|
+
align-items: center;
|
|
1175
|
+
justify-content: center;
|
|
1176
|
+
cursor: pointer;
|
|
1177
|
+
padding: 0;
|
|
1178
|
+
transition: all 0.15s ease;
|
|
1179
|
+
box-sizing: border-box;
|
|
1180
|
+
|
|
1181
|
+
&:hover:not(.active) {
|
|
1182
|
+
background: rgba(0, 0, 0, 0.04);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
&.active {
|
|
1186
|
+
width: 32px;
|
|
1187
|
+
height: 32px;
|
|
1188
|
+
background: #FFFFFF;
|
|
1189
|
+
border-radius: 9px;
|
|
1190
|
+
border: 1px solid #E5E7EB;
|
|
1191
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
.full-color-pill {
|
|
1196
|
+
width: 100%;
|
|
1197
|
+
height: 32px;
|
|
1198
|
+
background: #FAFAFA;
|
|
1199
|
+
border: 1px solid #edf0f3;
|
|
1200
|
+
border-radius: 8px;
|
|
1201
|
+
padding: 0 10px;
|
|
1202
|
+
box-sizing: border-box;
|
|
1203
|
+
display: flex;
|
|
1204
|
+
align-items: center;
|
|
1205
|
+
justify-content: space-between;
|
|
1206
|
+
cursor: pointer;
|
|
1207
|
+
transition: all 0.15s ease;
|
|
1208
|
+
|
|
1209
|
+
&:hover {
|
|
1210
|
+
border-color: #cbd5e1;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
&:focus-within {
|
|
1214
|
+
border-color: #2563eb;
|
|
1215
|
+
box-shadow: 0 0 0 1px #2563eb;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.color-left-info {
|
|
1220
|
+
display: flex;
|
|
1221
|
+
align-items: center;
|
|
1222
|
+
gap: 8px;
|
|
1223
|
+
cursor: pointer;
|
|
1224
|
+
height: 100%;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
.color-hex-text {
|
|
1228
|
+
font-size: 13px;
|
|
1229
|
+
font-weight: 500;
|
|
1230
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
1231
|
+
color: #1e293b;
|
|
1232
|
+
letter-spacing: 0.2px;
|
|
1233
|
+
user-select: none;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.color-opacity-input-wrapper {
|
|
1237
|
+
display: inline-flex;
|
|
1238
|
+
align-items: center;
|
|
1239
|
+
justify-content: flex-end;
|
|
1240
|
+
height: 24px;
|
|
1241
|
+
padding: 0 2px;
|
|
1242
|
+
border-radius: 4px;
|
|
1243
|
+
transition: all 0.15s ease;
|
|
1244
|
+
background: transparent;
|
|
1245
|
+
cursor: text;
|
|
1246
|
+
|
|
1247
|
+
&:hover {
|
|
1248
|
+
background: rgba(0, 0, 0, 0.04);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
&:focus-within {
|
|
1252
|
+
background: rgba(37, 99, 235, 0.08);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.color-opacity-num-input {
|
|
1257
|
+
width: 28px;
|
|
1258
|
+
border: none;
|
|
1259
|
+
background: transparent;
|
|
1260
|
+
outline: none;
|
|
1261
|
+
font-size: 13px;
|
|
1262
|
+
font-weight: 500;
|
|
1263
|
+
color: #1e293b;
|
|
1264
|
+
text-align: right;
|
|
1265
|
+
padding: 0;
|
|
1266
|
+
margin: 0;
|
|
1267
|
+
font-family: inherit;
|
|
1268
|
+
font-variant-numeric: tabular-nums;
|
|
1269
|
+
|
|
1270
|
+
&::-webkit-outer-spin-button,
|
|
1271
|
+
&::-webkit-inner-spin-button {
|
|
1272
|
+
-webkit-appearance: none;
|
|
1273
|
+
display: none !important;
|
|
1274
|
+
margin: 0;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.percent-unit {
|
|
1279
|
+
font-size: 12px;
|
|
1280
|
+
font-weight: 500;
|
|
1281
|
+
color: #1e293b;
|
|
1282
|
+
margin-left: 2px;
|
|
1283
|
+
user-select: none;
|
|
1284
|
+
line-height: 1;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.image-fill-section {
|
|
1288
|
+
display: flex;
|
|
1289
|
+
flex-direction: column;
|
|
1290
|
+
gap: 8px;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.image-fill-upload-card {
|
|
1294
|
+
width: 100%;
|
|
1295
|
+
height: 76px;
|
|
1296
|
+
border: 1px dashed #cbd5e1;
|
|
1297
|
+
border-radius: 8px;
|
|
1298
|
+
background: #f8fafc;
|
|
1299
|
+
display: flex;
|
|
1300
|
+
flex-direction: column;
|
|
1301
|
+
align-items: center;
|
|
1302
|
+
justify-content: center;
|
|
1303
|
+
gap: 6px;
|
|
1304
|
+
color: #64748b;
|
|
1305
|
+
cursor: pointer;
|
|
1306
|
+
transition: all 0.15s ease;
|
|
1307
|
+
|
|
1308
|
+
&:hover {
|
|
1309
|
+
border-color: #1E6FFF;
|
|
1310
|
+
color: #1E6FFF;
|
|
1311
|
+
background: #eff6ff;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.upload-tip-text {
|
|
1316
|
+
font-size: 12px;
|
|
1317
|
+
font-weight: 500;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.image-fill-preview-card {
|
|
1321
|
+
display: flex;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
gap: 10px;
|
|
1324
|
+
padding: 8px;
|
|
1325
|
+
background: #f8fafc;
|
|
1326
|
+
border: 1px solid #edf0f3;
|
|
1327
|
+
border-radius: 8px;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.image-fill-thumb {
|
|
1331
|
+
width: 48px;
|
|
1332
|
+
height: 36px;
|
|
1333
|
+
border-radius: 4px;
|
|
1334
|
+
background-size: cover;
|
|
1335
|
+
background-position: center;
|
|
1336
|
+
border: 1px solid #e2e8f0;
|
|
1337
|
+
flex-shrink: 0;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.image-fill-btn-group {
|
|
1341
|
+
display: flex;
|
|
1342
|
+
gap: 6px;
|
|
1343
|
+
flex: 1;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
.image-fill-sub-btn {
|
|
1347
|
+
flex: 1;
|
|
1348
|
+
height: 28px;
|
|
1349
|
+
border-radius: 6px;
|
|
1350
|
+
border: 1px solid #e2e8f0;
|
|
1351
|
+
background: #ffffff;
|
|
1352
|
+
color: #334155;
|
|
1353
|
+
font-size: 12px;
|
|
1354
|
+
cursor: pointer;
|
|
1355
|
+
transition: all 0.15s ease;
|
|
1356
|
+
|
|
1357
|
+
&:hover {
|
|
1358
|
+
border-color: #cbd5e1;
|
|
1359
|
+
background: #f1f5f9;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
&.danger {
|
|
1363
|
+
color: #ef4444;
|
|
1364
|
+
&:hover {
|
|
1365
|
+
background: #fef2f2;
|
|
1366
|
+
border-color: #fecaca;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.pattern-fill-container {
|
|
1372
|
+
display: flex;
|
|
1373
|
+
flex-direction: column;
|
|
1374
|
+
gap: 10px;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
.pattern-presets-grid {
|
|
1378
|
+
display: grid;
|
|
1379
|
+
grid-template-columns: repeat(6, 1fr);
|
|
1380
|
+
gap: 6px;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
.pattern-preset-card {
|
|
1384
|
+
aspect-ratio: 1;
|
|
1385
|
+
border-radius: 6px;
|
|
1386
|
+
border: 1px solid #e2e8f0;
|
|
1387
|
+
background-repeat: repeat;
|
|
1388
|
+
background-size: 10px 10px;
|
|
1389
|
+
cursor: pointer;
|
|
1390
|
+
transition: all 0.15s ease;
|
|
1391
|
+
|
|
1392
|
+
&:hover {
|
|
1393
|
+
border-color: #94a3b8;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
&.active {
|
|
1397
|
+
border: 1.5px solid #1E6FFF;
|
|
1398
|
+
box-shadow: 0 0 0 2px rgba(30, 111, 255, 0.15);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.pattern-colors-section {
|
|
1403
|
+
display: flex;
|
|
1404
|
+
flex-direction: column;
|
|
1405
|
+
gap: 8px;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.shape-property-row {
|
|
1409
|
+
display: flex;
|
|
1410
|
+
align-items: center;
|
|
1411
|
+
justify-content: space-between;
|
|
1412
|
+
height: 32px;
|
|
1413
|
+
padding: 0;
|
|
1414
|
+
gap: 8px;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.shape-property-label {
|
|
1418
|
+
font-size: 12px;
|
|
1419
|
+
color: var(--text-secondary, #64748b);
|
|
1420
|
+
width: 80px;
|
|
1421
|
+
flex-shrink: 0;
|
|
1422
|
+
text-align: left;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.color-picker-pill-wrapper {
|
|
1426
|
+
position: relative;
|
|
1427
|
+
display: flex;
|
|
1428
|
+
align-items: center;
|
|
1429
|
+
justify-content: space-between;
|
|
1430
|
+
background: #F5F6F7;
|
|
1431
|
+
border-radius: 4px;
|
|
1432
|
+
padding: 0 10px;
|
|
1433
|
+
height: 32px;
|
|
1434
|
+
flex: 1;
|
|
1435
|
+
cursor: pointer;
|
|
1436
|
+
border: none;
|
|
1437
|
+
box-sizing: border-box;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
.color-pill-inner {
|
|
1441
|
+
display: flex;
|
|
1442
|
+
align-items: center;
|
|
1443
|
+
gap: 8px;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.color-square-preview {
|
|
1447
|
+
width: 16px;
|
|
1448
|
+
height: 16px;
|
|
1449
|
+
border-radius: 4px;
|
|
1450
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
1451
|
+
flex-shrink: 0;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
.chart-palette-option-item:hover {
|
|
1455
|
+
background: var(--bg-hover, #f1f5f9);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.chart-palette-option-item.active {
|
|
1459
|
+
background: var(--bg-active, #eff6ff);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.grid-btn {
|
|
1463
|
+
border: 1px solid var(--border-color, #e2e8f0);
|
|
1464
|
+
background: #ffffff;
|
|
1465
|
+
transition: all 0.2s;
|
|
1466
|
+
|
|
1467
|
+
&:hover {
|
|
1468
|
+
background: var(--bg-hover, #f8fafc);
|
|
1469
|
+
border-color: #cbd5e1;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
:deep(.color-span-box) {
|
|
1474
|
+
width: 100%;
|
|
1475
|
+
display: flex !important;
|
|
1476
|
+
align-items: center !important;
|
|
1477
|
+
height: 100% !important;
|
|
1478
|
+
}
|
|
1479
|
+
</style>
|