@nbreak/ui 0.1.0

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.
@@ -0,0 +1,1735 @@
1
+ import { defineComponentExtension } from "@nbreak/sdk";
2
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, watch } from "vue";
3
+ //#region \0plugin-vue:export-helper
4
+ var _plugin_vue_export_helper_default = (sfc, props) => {
5
+ const target = sfc.__vccOpts || sfc;
6
+ for (const [key, val] of props) target[key] = val;
7
+ return target;
8
+ };
9
+ var DsText_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
10
+ __name: "DsText",
11
+ props: {
12
+ content: {
13
+ type: String,
14
+ default: "文本内容"
15
+ },
16
+ color: {
17
+ type: String,
18
+ default: "#ffffff"
19
+ },
20
+ fontSize: {
21
+ type: Number,
22
+ default: 16
23
+ },
24
+ fontWeight: {
25
+ type: [String, Number],
26
+ default: 400
27
+ },
28
+ textAlign: {
29
+ type: String,
30
+ default: "left"
31
+ },
32
+ padding: {
33
+ type: Number,
34
+ default: 8
35
+ }
36
+ },
37
+ setup(__props) {
38
+ return (_ctx, _cache) => {
39
+ return openBlock(), createElementBlock("div", {
40
+ class: "ds-text",
41
+ style: normalizeStyle({
42
+ color: __props.color,
43
+ fontSize: __props.fontSize + "px",
44
+ fontWeight: __props.fontWeight,
45
+ textAlign: __props.textAlign,
46
+ padding: __props.padding + "px"
47
+ })
48
+ }, toDisplayString(__props.content), 5);
49
+ };
50
+ }
51
+ }, [["__scopeId", "data-v-145be8f0"]]);
52
+ var DsLineChart_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
53
+ __name: "DsLineChart",
54
+ props: {
55
+ data: {
56
+ type: Array,
57
+ default: () => []
58
+ },
59
+ color: {
60
+ type: String,
61
+ default: "#1890ff"
62
+ },
63
+ showLegend: {
64
+ type: Boolean,
65
+ default: true
66
+ },
67
+ smooth: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ areaStyle: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ xAxisTitle: {
76
+ type: String,
77
+ default: ""
78
+ },
79
+ yAxisTitle: {
80
+ type: String,
81
+ default: ""
82
+ }
83
+ },
84
+ setup(__props) {
85
+ const props = __props;
86
+ const chartRef = ref(null);
87
+ const chartInstance = shallowRef(null);
88
+ async function getEcharts() {
89
+ return await import("echarts");
90
+ }
91
+ async function initChart() {
92
+ if (!chartRef.value) return;
93
+ const echarts = await getEcharts();
94
+ if (chartInstance.value) chartInstance.value.dispose();
95
+ chartInstance.value = echarts.init(chartRef.value);
96
+ renderChart();
97
+ }
98
+ function renderChart() {
99
+ if (!chartInstance.value) return;
100
+ const series = Array.isArray(props.data) && props.data.length > 0 && props.data[0]?.series ? props.data[0].series : [{
101
+ name: "默认",
102
+ data: props.data
103
+ }];
104
+ chartInstance.value.setOption({
105
+ color: [props.color],
106
+ legend: {
107
+ show: props.showLegend,
108
+ textStyle: { color: "#fff" }
109
+ },
110
+ tooltip: { trigger: "axis" },
111
+ grid: {
112
+ left: "8%",
113
+ right: "8%",
114
+ top: "10%",
115
+ bottom: "8%"
116
+ },
117
+ xAxis: {
118
+ type: "category",
119
+ name: props.xAxisTitle,
120
+ data: series[0]?.data?.map((_, i) => i + 1) || [],
121
+ axisLine: { lineStyle: { color: "#888" } }
122
+ },
123
+ yAxis: {
124
+ type: "value",
125
+ name: props.yAxisTitle,
126
+ axisLine: { lineStyle: { color: "#888" } },
127
+ splitLine: { lineStyle: { color: "rgba(255,255,255,0.08)" } }
128
+ },
129
+ series: series.map((s) => ({
130
+ name: s.name,
131
+ type: "line",
132
+ data: s.data,
133
+ smooth: props.smooth,
134
+ areaStyle: props.areaStyle ? {} : null
135
+ }))
136
+ }, true);
137
+ }
138
+ onMounted(() => {
139
+ initChart();
140
+ window.addEventListener("resize", handleResize);
141
+ });
142
+ onUnmounted(() => {
143
+ window.removeEventListener("resize", handleResize);
144
+ chartInstance.value?.dispose();
145
+ });
146
+ function handleResize() {
147
+ chartInstance.value?.resize();
148
+ }
149
+ watch(() => props, renderChart, { deep: true });
150
+ return (_ctx, _cache) => {
151
+ return openBlock(), createElementBlock("div", {
152
+ ref_key: "chartRef",
153
+ ref: chartRef,
154
+ class: "ds-line-chart"
155
+ }, null, 512);
156
+ };
157
+ }
158
+ }, [["__scopeId", "data-v-7814c43a"]]);
159
+ var DsBarChart_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
160
+ __name: "DsBarChart",
161
+ props: {
162
+ data: {
163
+ type: Array,
164
+ default: () => []
165
+ },
166
+ color: {
167
+ type: String,
168
+ default: "#1890ff"
169
+ },
170
+ horizontal: {
171
+ type: Boolean,
172
+ default: false
173
+ },
174
+ showLegend: {
175
+ type: Boolean,
176
+ default: false
177
+ },
178
+ showLabel: {
179
+ type: Boolean,
180
+ default: false
181
+ },
182
+ barWidth: {
183
+ type: [String, Number],
184
+ default: "auto"
185
+ },
186
+ xAxisTitle: {
187
+ type: String,
188
+ default: ""
189
+ },
190
+ yAxisTitle: {
191
+ type: String,
192
+ default: ""
193
+ }
194
+ },
195
+ setup(__props) {
196
+ const props = __props;
197
+ const chartRef = ref(null);
198
+ const chartInstance = shallowRef(null);
199
+ async function initChart() {
200
+ if (!chartRef.value) return;
201
+ const echarts = await import("echarts");
202
+ if (chartInstance.value) chartInstance.value.dispose();
203
+ chartInstance.value = echarts.init(chartRef.value);
204
+ renderChart();
205
+ }
206
+ function renderChart() {
207
+ if (!chartInstance.value) return;
208
+ const series = Array.isArray(props.data) && props.data.length > 0 && props.data[0]?.series ? props.data[0].series : [{
209
+ name: "默认",
210
+ data: props.data
211
+ }];
212
+ const categoryAxis = {
213
+ type: "category",
214
+ data: Array.isArray(props.data) && props.data[0]?.categories ? props.data[0].categories : series[0]?.data?.map((_, i) => `${i + 1}`) || [],
215
+ name: props.xAxisTitle,
216
+ axisLine: { lineStyle: { color: "#888" } },
217
+ axisLabel: { color: "#aaa" }
218
+ };
219
+ const valueAxis = {
220
+ type: "value",
221
+ name: props.yAxisTitle,
222
+ axisLine: { lineStyle: { color: "#888" } },
223
+ axisLabel: { color: "#aaa" },
224
+ splitLine: { lineStyle: { color: "rgba(255,255,255,0.08)" } }
225
+ };
226
+ chartInstance.value.setOption({
227
+ color: [
228
+ props.color,
229
+ "#8b5cf6",
230
+ "#22c55e",
231
+ "#f59e0b",
232
+ "#ef4444"
233
+ ],
234
+ legend: {
235
+ show: props.showLegend,
236
+ textStyle: { color: "#fff" }
237
+ },
238
+ tooltip: {
239
+ trigger: "axis",
240
+ axisPointer: { type: "shadow" }
241
+ },
242
+ grid: {
243
+ left: "8%",
244
+ right: "8%",
245
+ top: "10%",
246
+ bottom: "8%"
247
+ },
248
+ xAxis: props.horizontal ? valueAxis : categoryAxis,
249
+ yAxis: props.horizontal ? categoryAxis : valueAxis,
250
+ series: series.map((s) => ({
251
+ name: s.name,
252
+ type: "bar",
253
+ data: s.data,
254
+ barWidth: props.barWidth === "auto" ? void 0 : props.barWidth,
255
+ label: {
256
+ show: props.showLabel,
257
+ position: props.horizontal ? "right" : "top",
258
+ color: "#fff"
259
+ }
260
+ }))
261
+ }, true);
262
+ }
263
+ function handleResize() {
264
+ chartInstance.value?.resize();
265
+ }
266
+ onMounted(() => {
267
+ initChart();
268
+ window.addEventListener("resize", handleResize);
269
+ });
270
+ onUnmounted(() => {
271
+ window.removeEventListener("resize", handleResize);
272
+ chartInstance.value?.dispose();
273
+ });
274
+ watch(() => props, renderChart, { deep: true });
275
+ return (_ctx, _cache) => {
276
+ return openBlock(), createElementBlock("div", {
277
+ ref_key: "chartRef",
278
+ ref: chartRef,
279
+ class: "ds-bar-chart"
280
+ }, null, 512);
281
+ };
282
+ }
283
+ }, [["__scopeId", "data-v-37086186"]]);
284
+ var DsPieChart_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
285
+ __name: "DsPieChart",
286
+ props: {
287
+ data: {
288
+ type: Array,
289
+ default: () => []
290
+ },
291
+ colors: {
292
+ type: Array,
293
+ default: () => [
294
+ "#1890ff",
295
+ "#8b5cf6",
296
+ "#22c55e",
297
+ "#f59e0b",
298
+ "#ef4444",
299
+ "#06b6d4"
300
+ ]
301
+ },
302
+ showLegend: {
303
+ type: Boolean,
304
+ default: true
305
+ },
306
+ showLabel: {
307
+ type: Boolean,
308
+ default: true
309
+ },
310
+ ringMode: {
311
+ type: Boolean,
312
+ default: false
313
+ },
314
+ innerRadius: {
315
+ type: Number,
316
+ default: 0
317
+ },
318
+ outerRadius: {
319
+ type: Number,
320
+ default: 80
321
+ }
322
+ },
323
+ setup(__props) {
324
+ const props = __props;
325
+ const chartRef = ref(null);
326
+ const chartInstance = shallowRef(null);
327
+ async function initChart() {
328
+ if (!chartRef.value) return;
329
+ const echarts = await import("echarts");
330
+ if (chartInstance.value) chartInstance.value.dispose();
331
+ chartInstance.value = echarts.init(chartRef.value);
332
+ renderChart();
333
+ }
334
+ function renderChart() {
335
+ if (!chartInstance.value) return;
336
+ let pieData = [];
337
+ if (Array.isArray(props.data)) if (props.data[0]?.data) pieData = props.data[0].data;
338
+ else if (props.data[0]?.value) pieData = props.data;
339
+ else pieData = props.data.map((v, i) => ({
340
+ name: `项${i + 1}`,
341
+ value: v
342
+ }));
343
+ chartInstance.value.setOption({
344
+ color: props.colors,
345
+ legend: {
346
+ show: props.showLegend,
347
+ orient: "horizontal",
348
+ bottom: 0,
349
+ textStyle: { color: "#fff" }
350
+ },
351
+ tooltip: {
352
+ trigger: "item",
353
+ formatter: "{a} <br/>{b}: {c} ({d}%)"
354
+ },
355
+ series: [{
356
+ name: "占比",
357
+ type: "pie",
358
+ radius: props.ringMode ? [props.innerRadius || 40, props.outerRadius] : `${props.outerRadius}%`,
359
+ center: ["50%", "45%"],
360
+ data: pieData,
361
+ label: {
362
+ show: props.showLabel,
363
+ color: "#fff",
364
+ formatter: "{b}: {d}%"
365
+ },
366
+ labelLine: { lineStyle: { color: "#888" } },
367
+ itemStyle: {
368
+ borderColor: "#0d1a2d",
369
+ borderWidth: 2
370
+ }
371
+ }]
372
+ }, true);
373
+ }
374
+ function handleResize() {
375
+ chartInstance.value?.resize();
376
+ }
377
+ onMounted(() => {
378
+ initChart();
379
+ window.addEventListener("resize", handleResize);
380
+ });
381
+ onUnmounted(() => {
382
+ window.removeEventListener("resize", handleResize);
383
+ chartInstance.value?.dispose();
384
+ });
385
+ watch(() => props, renderChart, { deep: true });
386
+ return (_ctx, _cache) => {
387
+ return openBlock(), createElementBlock("div", {
388
+ ref_key: "chartRef",
389
+ ref: chartRef,
390
+ class: "ds-pie-chart"
391
+ }, null, 512);
392
+ };
393
+ }
394
+ }, [["__scopeId", "data-v-71ef0ee1"]]);
395
+ //#endregion
396
+ //#region src/components/DsBorderTech.vue
397
+ var _hoisted_1$5 = { class: "ds-border-tech-content" };
398
+ var DsBorderTech_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
399
+ __name: "DsBorderTech",
400
+ props: {
401
+ color: {
402
+ type: String,
403
+ default: "#1890ff"
404
+ },
405
+ radius: {
406
+ type: Number,
407
+ default: 0
408
+ }
409
+ },
410
+ setup(__props) {
411
+ return (_ctx, _cache) => {
412
+ return openBlock(), createElementBlock("div", {
413
+ class: "ds-border-tech",
414
+ style: normalizeStyle({
415
+ borderColor: __props.color,
416
+ borderRadius: __props.radius + "px"
417
+ })
418
+ }, [
419
+ createElementVNode("div", {
420
+ class: "ds-border-tech-corner top-left",
421
+ style: normalizeStyle({ borderColor: __props.color })
422
+ }, null, 4),
423
+ createElementVNode("div", {
424
+ class: "ds-border-tech-corner top-right",
425
+ style: normalizeStyle({ borderColor: __props.color })
426
+ }, null, 4),
427
+ createElementVNode("div", {
428
+ class: "ds-border-tech-corner bottom-left",
429
+ style: normalizeStyle({ borderColor: __props.color })
430
+ }, null, 4),
431
+ createElementVNode("div", {
432
+ class: "ds-border-tech-corner bottom-right",
433
+ style: normalizeStyle({ borderColor: __props.color })
434
+ }, null, 4),
435
+ createElementVNode("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
436
+ ], 4);
437
+ };
438
+ }
439
+ }, [["__scopeId", "data-v-1e01cd34"]]);
440
+ //#endregion
441
+ //#region src/components/DsCounter.vue
442
+ var _hoisted_1$4 = {
443
+ key: 0,
444
+ class: "ds-counter-label"
445
+ };
446
+ var _hoisted_2$3 = { class: "ds-counter-number" };
447
+ var _hoisted_3$3 = {
448
+ key: 0,
449
+ class: "ds-counter-suffix"
450
+ };
451
+ var DsCounter_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
452
+ __name: "DsCounter",
453
+ props: {
454
+ value: {
455
+ type: [Number, String],
456
+ default: 0
457
+ },
458
+ label: {
459
+ type: String,
460
+ default: ""
461
+ },
462
+ suffix: {
463
+ type: String,
464
+ default: ""
465
+ },
466
+ color: {
467
+ type: String,
468
+ default: "#00d4ff"
469
+ },
470
+ fontSize: {
471
+ type: Number,
472
+ default: 32
473
+ },
474
+ duration: {
475
+ type: Number,
476
+ default: 1e3
477
+ },
478
+ decimals: {
479
+ type: Number,
480
+ default: 0
481
+ }
482
+ },
483
+ setup(__props) {
484
+ const props = __props;
485
+ const displayValue = ref(0);
486
+ function animateTo(target) {
487
+ const start = Number(displayValue.value) || 0;
488
+ const end = Number(target) || 0;
489
+ const startTime = performance.now();
490
+ const duration = props.duration;
491
+ function step(now) {
492
+ const elapsed = now - startTime;
493
+ const progress = Math.min(elapsed / duration, 1);
494
+ const eased = 1 - Math.pow(1 - progress, 3);
495
+ displayValue.value = formatNumber(start + (end - start) * eased);
496
+ if (progress < 1) requestAnimationFrame(step);
497
+ else displayValue.value = formatNumber(end);
498
+ }
499
+ requestAnimationFrame(step);
500
+ }
501
+ function formatNumber(n) {
502
+ return n.toLocaleString("zh-CN", {
503
+ minimumFractionDigits: props.decimals,
504
+ maximumFractionDigits: props.decimals
505
+ });
506
+ }
507
+ onMounted(() => {
508
+ animateTo(props.value);
509
+ });
510
+ watch(() => props.value, (val) => {
511
+ animateTo(val);
512
+ });
513
+ return (_ctx, _cache) => {
514
+ return openBlock(), createElementBlock("div", {
515
+ class: "ds-counter",
516
+ style: normalizeStyle({ color: __props.color })
517
+ }, [__props.label ? (openBlock(), createElementBlock("div", _hoisted_1$4, toDisplayString(__props.label), 1)) : createCommentVNode("", true), createElementVNode("div", {
518
+ class: "ds-counter-value",
519
+ style: normalizeStyle({ fontSize: __props.fontSize + "px" })
520
+ }, [createElementVNode("span", _hoisted_2$3, toDisplayString(displayValue.value), 1), __props.suffix ? (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(__props.suffix), 1)) : createCommentVNode("", true)], 4)], 4);
521
+ };
522
+ }
523
+ }, [["__scopeId", "data-v-626c08f2"]]);
524
+ //#endregion
525
+ //#region src/components/DsRing.vue
526
+ var _hoisted_1$3 = { class: "content-overlay" };
527
+ var DsRing_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
528
+ __name: "DsRing",
529
+ props: {
530
+ color: {
531
+ type: String,
532
+ default: "#00f5ff"
533
+ },
534
+ size: {
535
+ type: Number,
536
+ default: 100
537
+ },
538
+ opacity: {
539
+ type: Number,
540
+ default: .8
541
+ },
542
+ width: {
543
+ type: [String, Number],
544
+ default: "100%"
545
+ },
546
+ height: {
547
+ type: [String, Number],
548
+ default: "100%"
549
+ }
550
+ },
551
+ setup(__props) {
552
+ const props = __props;
553
+ const containerStyle = computed(() => ({
554
+ width: props.width,
555
+ height: props.height,
556
+ "--deco-color": props.color,
557
+ "--deco-size": props.size + "px",
558
+ "--deco-opacity": props.opacity
559
+ }));
560
+ return (_ctx, _cache) => {
561
+ return openBlock(), createElementBlock("div", {
562
+ class: "ds-ring",
563
+ style: normalizeStyle(containerStyle.value)
564
+ }, [_cache[0] || (_cache[0] = createStaticVNode("<div class=\"ring-container\" data-v-a555123f><div class=\"orbit orbit-1\" data-v-a555123f><div class=\"orbit-path\" data-v-a555123f></div><div class=\"orbit-dot dot-1\" data-v-a555123f></div><div class=\"orbit-dot dot-1b\" data-v-a555123f></div></div><div class=\"orbit orbit-2\" data-v-a555123f><div class=\"orbit-path\" data-v-a555123f></div><div class=\"orbit-dot dot-2\" data-v-a555123f></div><div class=\"orbit-dot dot-2b\" data-v-a555123f></div></div><div class=\"orbit orbit-3\" data-v-a555123f><div class=\"orbit-path\" data-v-a555123f></div><div class=\"orbit-dot dot-3\" data-v-a555123f></div></div><div class=\"ring-core\" data-v-a555123f><div class=\"core-inner\" data-v-a555123f></div><div class=\"core-pulse\" data-v-a555123f></div><div class=\"core-pulse core-pulse-2\" data-v-a555123f></div></div></div>", 1)), createElementVNode("div", _hoisted_1$3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 4);
565
+ };
566
+ }
567
+ }, [["__scopeId", "data-v-a555123f"]]);
568
+ //#endregion
569
+ //#region src/components/DsSparkLine.vue
570
+ var _hoisted_1$2 = { class: "ds-spark-header" };
571
+ var _hoisted_2$2 = { class: "ds-spark-label" };
572
+ var _hoisted_3$2 = {
573
+ viewBox: "0 0 300 80",
574
+ class: "ds-spark-svg",
575
+ preserveAspectRatio: "none"
576
+ };
577
+ var _hoisted_4$2 = ["id"];
578
+ var _hoisted_5$2 = ["stop-color"];
579
+ var _hoisted_6$2 = ["stop-color"];
580
+ var _hoisted_7$1 = ["d", "fill"];
581
+ var _hoisted_8$1 = ["points", "stroke"];
582
+ var _hoisted_9$1 = [
583
+ "cx",
584
+ "cy",
585
+ "fill"
586
+ ];
587
+ var _hoisted_10$1 = [
588
+ "cx",
589
+ "cy",
590
+ "stroke"
591
+ ];
592
+ var _hoisted_11$1 = { class: "ds-spark-footer" };
593
+ var _hoisted_12$1 = { class: "ds-spark-min" };
594
+ var _hoisted_13$1 = { class: "ds-spark-max" };
595
+ var _hoisted_14$1 = { class: "ds-spark-avg" };
596
+ var DsSparkLine_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
597
+ __name: "DsSparkLine",
598
+ props: {
599
+ data: {
600
+ type: Array,
601
+ default: () => []
602
+ },
603
+ label: {
604
+ type: String,
605
+ default: "趋势"
606
+ },
607
+ color: {
608
+ type: String,
609
+ default: "#00c8ff"
610
+ },
611
+ width: {
612
+ type: [String, Number],
613
+ default: "100%"
614
+ },
615
+ height: {
616
+ type: [String, Number],
617
+ default: 160
618
+ }
619
+ },
620
+ setup(__props) {
621
+ const props = __props;
622
+ const uid = Math.random().toString(36).slice(2, 8);
623
+ const containerStyle = computed(() => ({
624
+ width: typeof props.width === "number" ? `${props.width}px` : props.width,
625
+ height: typeof props.height === "number" ? `${props.height}px` : props.height
626
+ }));
627
+ const values = computed(() => {
628
+ if (Array.isArray(props.data)) {
629
+ if (props.data.length === 0) return [];
630
+ if (typeof props.data[0] === "number") return props.data;
631
+ if (props.data[0]?.values) return props.data[0].values;
632
+ if (props.data[0]?.data) return props.data[0].data;
633
+ }
634
+ return [];
635
+ });
636
+ const minVal = computed(() => values.value.length ? Math.min(...values.value) : 0);
637
+ const maxVal = computed(() => values.value.length ? Math.max(...values.value) : 0);
638
+ const avgVal = computed(() => values.value.length ? Math.round(values.value.reduce((a, b) => a + b, 0) / values.value.length) : 0);
639
+ const currentDisplay = computed(() => {
640
+ const v = values.value[values.value.length - 1];
641
+ return v != null ? Number(v).toLocaleString() : "-";
642
+ });
643
+ const linePoints = computed(() => {
644
+ if (values.value.length === 0) return "";
645
+ const w = 300;
646
+ const h = 80;
647
+ const pad = 8;
648
+ const n = values.value.length;
649
+ const range = maxVal.value - minVal.value || 1;
650
+ return values.value.map((v, i) => {
651
+ return `${pad + i / Math.max(n - 1, 1) * (w - pad * 2)},${h - pad - (v - minVal.value) / range * (h - pad * 2)}`;
652
+ }).join(" ");
653
+ });
654
+ const areaPath = computed(() => {
655
+ if (!linePoints.value) return "";
656
+ const points = linePoints.value.split(" ");
657
+ if (points.length === 0) return "";
658
+ const first = points[0].split(",")[0];
659
+ const last = points[points.length - 1].split(",")[0];
660
+ return `M${first},80 L${points.join(" L")} L${last},80 Z`;
661
+ });
662
+ const lastX = computed(() => {
663
+ const pts = linePoints.value.split(" ");
664
+ return pts.length ? parseFloat(pts[pts.length - 1].split(",")[0]) : 0;
665
+ });
666
+ const lastY = computed(() => {
667
+ const pts = linePoints.value.split(" ");
668
+ return pts.length ? parseFloat(pts[pts.length - 1].split(",")[1]) : 0;
669
+ });
670
+ return (_ctx, _cache) => {
671
+ return openBlock(), createElementBlock("div", {
672
+ class: "ds-spark",
673
+ style: normalizeStyle(containerStyle.value)
674
+ }, [
675
+ createElementVNode("div", _hoisted_1$2, [createElementVNode("span", _hoisted_2$2, toDisplayString(__props.label), 1), createElementVNode("span", {
676
+ class: "ds-spark-current",
677
+ style: normalizeStyle({ color: __props.color })
678
+ }, toDisplayString(currentDisplay.value), 5)]),
679
+ (openBlock(), createElementBlock("svg", _hoisted_3$2, [
680
+ createElementVNode("defs", null, [createElementVNode("linearGradient", {
681
+ id: `spark-grad-${unref(uid)}`,
682
+ x1: "0",
683
+ y1: "0",
684
+ x2: "0",
685
+ y2: "1"
686
+ }, [createElementVNode("stop", {
687
+ offset: "0%",
688
+ "stop-color": __props.color,
689
+ "stop-opacity": "0.3"
690
+ }, null, 8, _hoisted_5$2), createElementVNode("stop", {
691
+ offset: "100%",
692
+ "stop-color": __props.color,
693
+ "stop-opacity": "0"
694
+ }, null, 8, _hoisted_6$2)], 8, _hoisted_4$2)]),
695
+ createElementVNode("path", {
696
+ d: areaPath.value,
697
+ fill: `url(#spark-grad-${unref(uid)})`
698
+ }, null, 8, _hoisted_7$1),
699
+ createElementVNode("polyline", {
700
+ points: linePoints.value,
701
+ fill: "none",
702
+ stroke: __props.color,
703
+ "stroke-width": "2",
704
+ "stroke-linejoin": "round"
705
+ }, null, 8, _hoisted_8$1),
706
+ createElementVNode("circle", {
707
+ cx: lastX.value,
708
+ cy: lastY.value,
709
+ r: "4",
710
+ fill: __props.color
711
+ }, null, 8, _hoisted_9$1),
712
+ createElementVNode("circle", {
713
+ cx: lastX.value,
714
+ cy: lastY.value,
715
+ r: "7",
716
+ fill: "none",
717
+ stroke: __props.color,
718
+ "stroke-width": "1.5",
719
+ opacity: "0.4"
720
+ }, null, 8, _hoisted_10$1)
721
+ ])),
722
+ createElementVNode("div", _hoisted_11$1, [
723
+ createElementVNode("span", _hoisted_12$1, "低: " + toDisplayString(minVal.value), 1),
724
+ createElementVNode("span", _hoisted_13$1, "高: " + toDisplayString(maxVal.value), 1),
725
+ createElementVNode("span", _hoisted_14$1, "均: " + toDisplayString(avgVal.value), 1)
726
+ ])
727
+ ], 4);
728
+ };
729
+ }
730
+ }, [["__scopeId", "data-v-9408656c"]]);
731
+ //#endregion
732
+ //#region src/components/DsDigitalClock.vue
733
+ var _hoisted_1$1 = { class: "ds-clock-time-row" };
734
+ var _hoisted_2$1 = { class: "ds-clock-digit-group" };
735
+ var _hoisted_3$1 = { class: "ds-clock-digit" };
736
+ var _hoisted_4$1 = { class: "ds-clock-digit" };
737
+ var _hoisted_5$1 = { class: "ds-clock-digit-group" };
738
+ var _hoisted_6$1 = { class: "ds-clock-digit" };
739
+ var _hoisted_7 = { class: "ds-clock-digit" };
740
+ var _hoisted_8 = { class: "ds-clock-digit-group ds-clock-digit-group--sec" };
741
+ var _hoisted_9 = { class: "ds-clock-digit ds-clock-digit--sec" };
742
+ var _hoisted_10 = { class: "ds-clock-digit ds-clock-digit--sec" };
743
+ var _hoisted_11 = {
744
+ key: 1,
745
+ class: "ds-clock-ampm"
746
+ };
747
+ var _hoisted_12 = {
748
+ key: 0,
749
+ class: "ds-clock-date-row"
750
+ };
751
+ var _hoisted_13 = { class: "ds-clock-date-text" };
752
+ var _hoisted_14 = { class: "ds-clock-weekday" };
753
+ var DsDigitalClock_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
754
+ __name: "DsDigitalClock",
755
+ props: {
756
+ color: {
757
+ type: String,
758
+ default: "#00d4ff"
759
+ },
760
+ secondColor: {
761
+ type: String,
762
+ default: "#ff6b6b"
763
+ },
764
+ showSeconds: {
765
+ type: Boolean,
766
+ default: true
767
+ },
768
+ showDate: {
769
+ type: Boolean,
770
+ default: true
771
+ },
772
+ blink: {
773
+ type: Boolean,
774
+ default: true
775
+ },
776
+ timeFormat: {
777
+ type: String,
778
+ default: "24h"
779
+ },
780
+ dateFormat: {
781
+ type: String,
782
+ default: "YYYY-MM-DD"
783
+ },
784
+ width: {
785
+ type: [String, Number],
786
+ default: "100%"
787
+ },
788
+ height: {
789
+ type: [String, Number],
790
+ default: "100%"
791
+ }
792
+ },
793
+ setup(__props) {
794
+ const props = __props;
795
+ const now = ref(/* @__PURE__ */ new Date());
796
+ const blinkOn = ref(true);
797
+ let tickTimer = null;
798
+ let blinkTimer = null;
799
+ const is12h = computed(() => props.timeFormat === "12h");
800
+ const WEEKDAYS = [
801
+ "星期日",
802
+ "星期一",
803
+ "星期二",
804
+ "星期三",
805
+ "星期四",
806
+ "星期五",
807
+ "星期六"
808
+ ];
809
+ const time = computed(() => {
810
+ let h = now.value.getHours();
811
+ const m = String(now.value.getMinutes()).padStart(2, "0");
812
+ const s = String(now.value.getSeconds()).padStart(2, "0");
813
+ let ampm = "";
814
+ if (is12h.value) {
815
+ ampm = h >= 12 ? "PM" : "AM";
816
+ h = h % 12 || 12;
817
+ }
818
+ return {
819
+ hh: String(h).padStart(2, "0"),
820
+ mm: m,
821
+ ss: s,
822
+ ampm
823
+ };
824
+ });
825
+ const dateStr = computed(() => {
826
+ const d = now.value;
827
+ const y = d.getFullYear();
828
+ const mo = String(d.getMonth() + 1).padStart(2, "0");
829
+ const da = String(d.getDate()).padStart(2, "0");
830
+ if (props.dateFormat === "YYYY年MM月DD日") return `${y}年${mo}月${da}日`;
831
+ if (props.dateFormat === "DD/MM/YYYY") return `${da}/${mo}/${y}`;
832
+ if (props.dateFormat === "MM/DD/YYYY") return `${mo}/${da}/${y}`;
833
+ return `${y}-${mo}-${da}`;
834
+ });
835
+ const weekdayStr = computed(() => WEEKDAYS[now.value.getDay()]);
836
+ function hexToRgb(hex) {
837
+ return {
838
+ r: parseInt(hex.slice(1, 3), 16),
839
+ g: parseInt(hex.slice(3, 5), 16),
840
+ b: parseInt(hex.slice(5, 7), 16)
841
+ };
842
+ }
843
+ function rgba(hex, a) {
844
+ const { r, g, b } = hexToRgb(hex);
845
+ return `rgba(${r},${g},${b},${a})`;
846
+ }
847
+ const cssVars = computed(() => {
848
+ const c = props.color;
849
+ const sc = props.secondColor;
850
+ return {
851
+ "--dsc-color": c,
852
+ "--dsc-sec-color": sc,
853
+ "--dsc-glow-08": rgba(c, .08),
854
+ "--dsc-glow-60": rgba(c, .6),
855
+ "--dsc-glow-25": rgba(c, .25),
856
+ "--dsc-glow-30": rgba(c, .3),
857
+ "--dsc-glow-50": rgba(c, .5),
858
+ "--dsc-glow-40": rgba(c, .4),
859
+ "--dsc-sec-glow-50": rgba(sc, .5),
860
+ "--dsc-sec-glow-20": rgba(sc, .2),
861
+ "--dsc-sec-glow-25": rgba(sc, .25)
862
+ };
863
+ });
864
+ const wrapStyle = computed(() => ({
865
+ width: props.width,
866
+ height: props.height
867
+ }));
868
+ onMounted(() => {
869
+ tickTimer = setInterval(() => {
870
+ now.value = /* @__PURE__ */ new Date();
871
+ }, 1e3);
872
+ if (props.blink) blinkTimer = setInterval(() => {
873
+ blinkOn.value = !blinkOn.value;
874
+ }, 500);
875
+ });
876
+ onUnmounted(() => {
877
+ clearInterval(tickTimer);
878
+ clearInterval(blinkTimer);
879
+ });
880
+ return (_ctx, _cache) => {
881
+ return openBlock(), createElementBlock("div", {
882
+ class: "ds-clock",
883
+ style: normalizeStyle([wrapStyle.value, cssVars.value])
884
+ }, [
885
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "ds-clock-bg-grid" }, null, -1)),
886
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "ds-clock-bg-glow" }, null, -1)),
887
+ createElementVNode("div", _hoisted_1$1, [
888
+ createElementVNode("div", _hoisted_2$1, [createElementVNode("span", _hoisted_3$1, toDisplayString(time.value.hh[0]), 1), createElementVNode("span", _hoisted_4$1, toDisplayString(time.value.hh[1]), 1)]),
889
+ createElementVNode("span", { class: normalizeClass(["ds-clock-sep", { "ds-clock-sep--off": !blinkOn.value }]) }, ":", 2),
890
+ createElementVNode("div", _hoisted_5$1, [createElementVNode("span", _hoisted_6$1, toDisplayString(time.value.mm[0]), 1), createElementVNode("span", _hoisted_7, toDisplayString(time.value.mm[1]), 1)]),
891
+ __props.showSeconds ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", { class: normalizeClass(["ds-clock-sep ds-clock-sep--sec", { "ds-clock-sep--off": !blinkOn.value }]) }, ":", 2), createElementVNode("div", _hoisted_8, [createElementVNode("span", _hoisted_9, toDisplayString(time.value.ss[0]), 1), createElementVNode("span", _hoisted_10, toDisplayString(time.value.ss[1]), 1)])], 64)) : createCommentVNode("", true),
892
+ is12h.value ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(time.value.ampm), 1)) : createCommentVNode("", true)
893
+ ]),
894
+ __props.showDate ? (openBlock(), createElementBlock("div", _hoisted_12, [createElementVNode("span", _hoisted_13, toDisplayString(dateStr.value), 1), createElementVNode("span", _hoisted_14, toDisplayString(weekdayStr.value), 1)])) : createCommentVNode("", true)
895
+ ], 4);
896
+ };
897
+ }
898
+ }, [["__scopeId", "data-v-cf84c4e0"]]);
899
+ //#endregion
900
+ //#region src/components/DsRankList.vue
901
+ var _hoisted_1 = { class: "ds-rank-list" };
902
+ var _hoisted_2 = { class: "ds-rank-content" };
903
+ var _hoisted_3 = { class: "ds-rank-info" };
904
+ var _hoisted_4 = { class: "ds-rank-name" };
905
+ var _hoisted_5 = { class: "ds-rank-bar-track" };
906
+ var _hoisted_6 = {
907
+ key: 0,
908
+ class: "ds-rank-empty"
909
+ };
910
+ var DsRankList_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
911
+ __name: "DsRankList",
912
+ props: {
913
+ data: {
914
+ type: Array,
915
+ default: () => []
916
+ },
917
+ title: {
918
+ type: String,
919
+ default: ""
920
+ },
921
+ color: {
922
+ type: String,
923
+ default: "#00d4ff"
924
+ },
925
+ max: {
926
+ type: Number,
927
+ default: 0
928
+ },
929
+ unit: {
930
+ type: String,
931
+ default: ""
932
+ },
933
+ showTop3: {
934
+ type: Boolean,
935
+ default: true
936
+ },
937
+ width: {
938
+ type: [String, Number],
939
+ default: "100%"
940
+ },
941
+ height: {
942
+ type: [String, Number],
943
+ default: "100%"
944
+ }
945
+ },
946
+ setup(__props) {
947
+ const props = __props;
948
+ const containerStyle = computed(() => ({
949
+ width: typeof props.width === "number" ? `${props.width}px` : props.width,
950
+ height: typeof props.height === "number" ? `${props.height}px` : props.height
951
+ }));
952
+ const items = computed(() => {
953
+ if (!Array.isArray(props.data)) return [];
954
+ return props.data.map((item) => ({
955
+ name: item.name || item.label || "未命名",
956
+ value: Number(item.value) || 0
957
+ })).sort((a, b) => b.value - a.value);
958
+ });
959
+ const maxValue = computed(() => {
960
+ if (props.max > 0) return props.max;
961
+ return items.value.length ? Math.max(...items.value.map((i) => i.value), 1) : 1;
962
+ });
963
+ function getPercent(value) {
964
+ return Math.max(0, Math.min(100, value / maxValue.value * 100));
965
+ }
966
+ function formatValue(value) {
967
+ const v = Number(value) || 0;
968
+ const formatted = Math.abs(v) >= 1e3 ? v.toLocaleString() : String(v);
969
+ return props.unit ? `${formatted} ${props.unit}` : formatted;
970
+ }
971
+ return (_ctx, _cache) => {
972
+ return openBlock(), createElementBlock("div", {
973
+ class: "ds-rank",
974
+ style: normalizeStyle(containerStyle.value)
975
+ }, [__props.title ? (openBlock(), createElementBlock("div", {
976
+ key: 0,
977
+ class: "ds-rank-title",
978
+ style: normalizeStyle({ color: __props.color })
979
+ }, toDisplayString(__props.title), 5)) : createCommentVNode("", true), createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, i) => {
980
+ return openBlock(), createElementBlock("div", {
981
+ key: i,
982
+ class: normalizeClass(["ds-rank-item", { "ds-rank-item--top": i < 3 }])
983
+ }, [createElementVNode("div", {
984
+ class: normalizeClass(["ds-rank-index", `ds-rank-index--${i < 3 ? i + 1 : "n"}`]),
985
+ style: normalizeStyle(i >= 3 ? { color: __props.color } : null)
986
+ }, toDisplayString(i + 1), 7), createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("span", _hoisted_4, toDisplayString(item.name), 1), createElementVNode("span", {
987
+ class: "ds-rank-value",
988
+ style: normalizeStyle({ color: __props.color })
989
+ }, toDisplayString(formatValue(item.value)), 5)]), createElementVNode("div", _hoisted_5, [createElementVNode("div", {
990
+ class: "ds-rank-bar-fill",
991
+ style: normalizeStyle({
992
+ width: getPercent(item.value) + "%",
993
+ background: `linear-gradient(90deg, ${__props.color}33, ${__props.color})`
994
+ })
995
+ }, null, 4)])])], 2);
996
+ }), 128)), items.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6, "暂无数据")) : createCommentVNode("", true)])], 4);
997
+ };
998
+ }
999
+ }, [["__scopeId", "data-v-f3072169"]]);
1000
+ //#endregion
1001
+ //#region src/index.js
1002
+ /**
1003
+ * @nbreak/ui - 入口
1004
+ *
1005
+ * 导出 10 个示例组件扩展,覆盖六大类:
1006
+ * - 文本/控制:DsText、DsCounter、DsSparkLine
1007
+ * - 图表:DsLineChart、DsBarChart、DsPieChart
1008
+ * - 边框:DsBorderTech
1009
+ * - 装饰:DsRing
1010
+ * - 列表:DsRankList
1011
+ * - 时间:DsDigitalClock
1012
+ *
1013
+ * 完整 178 个内置组件可按相同模式批量迁移
1014
+ */
1015
+ var textSchema = [
1016
+ {
1017
+ key: "content",
1018
+ label: "内容",
1019
+ type: "textarea",
1020
+ group: "基础",
1021
+ default: "文本内容"
1022
+ },
1023
+ {
1024
+ key: "color",
1025
+ label: "颜色",
1026
+ type: "color",
1027
+ group: "样式",
1028
+ default: "#ffffff"
1029
+ },
1030
+ {
1031
+ key: "fontSize",
1032
+ label: "字号",
1033
+ type: "number",
1034
+ group: "样式",
1035
+ default: 16,
1036
+ min: 8,
1037
+ max: 200
1038
+ },
1039
+ {
1040
+ key: "fontWeight",
1041
+ label: "字重",
1042
+ type: "select",
1043
+ group: "样式",
1044
+ default: 400,
1045
+ options: [
1046
+ {
1047
+ label: "细",
1048
+ value: 300
1049
+ },
1050
+ {
1051
+ label: "常规",
1052
+ value: 400
1053
+ },
1054
+ {
1055
+ label: "粗",
1056
+ value: 700
1057
+ },
1058
+ {
1059
+ label: "特粗",
1060
+ value: 900
1061
+ }
1062
+ ]
1063
+ },
1064
+ {
1065
+ key: "textAlign",
1066
+ label: "对齐",
1067
+ type: "select",
1068
+ group: "样式",
1069
+ default: "left",
1070
+ options: [
1071
+ {
1072
+ label: "左",
1073
+ value: "left"
1074
+ },
1075
+ {
1076
+ label: "中",
1077
+ value: "center"
1078
+ },
1079
+ {
1080
+ label: "右",
1081
+ value: "right"
1082
+ }
1083
+ ]
1084
+ },
1085
+ {
1086
+ key: "padding",
1087
+ label: "内边距",
1088
+ type: "slider",
1089
+ group: "样式",
1090
+ default: 8,
1091
+ min: 0,
1092
+ max: 40
1093
+ }
1094
+ ];
1095
+ var lineChartSchema = [
1096
+ {
1097
+ key: "data",
1098
+ label: "数据",
1099
+ type: "json",
1100
+ group: "数据",
1101
+ default: []
1102
+ },
1103
+ {
1104
+ key: "color",
1105
+ label: "线条颜色",
1106
+ type: "color",
1107
+ group: "样式",
1108
+ default: "#1890ff"
1109
+ },
1110
+ {
1111
+ key: "showLegend",
1112
+ label: "显示图例",
1113
+ type: "switch",
1114
+ group: "样式",
1115
+ default: true
1116
+ },
1117
+ {
1118
+ key: "smooth",
1119
+ label: "平滑曲线",
1120
+ type: "switch",
1121
+ group: "样式",
1122
+ default: false
1123
+ },
1124
+ {
1125
+ key: "areaStyle",
1126
+ label: "面积填充",
1127
+ type: "switch",
1128
+ group: "样式",
1129
+ default: false
1130
+ },
1131
+ {
1132
+ key: "xAxisTitle",
1133
+ label: "X 轴标题",
1134
+ type: "text",
1135
+ group: "轴",
1136
+ default: ""
1137
+ },
1138
+ {
1139
+ key: "yAxisTitle",
1140
+ label: "Y 轴标题",
1141
+ type: "text",
1142
+ group: "轴",
1143
+ default: ""
1144
+ }
1145
+ ];
1146
+ var barChartSchema = [
1147
+ {
1148
+ key: "data",
1149
+ label: "数据",
1150
+ type: "json",
1151
+ group: "数据",
1152
+ default: []
1153
+ },
1154
+ {
1155
+ key: "color",
1156
+ label: "柱子颜色",
1157
+ type: "color",
1158
+ group: "样式",
1159
+ default: "#1890ff"
1160
+ },
1161
+ {
1162
+ key: "horizontal",
1163
+ label: "横向",
1164
+ type: "switch",
1165
+ group: "样式",
1166
+ default: false
1167
+ },
1168
+ {
1169
+ key: "showLegend",
1170
+ label: "显示图例",
1171
+ type: "switch",
1172
+ group: "样式",
1173
+ default: false
1174
+ },
1175
+ {
1176
+ key: "showLabel",
1177
+ label: "显示数值",
1178
+ type: "switch",
1179
+ group: "样式",
1180
+ default: false
1181
+ },
1182
+ {
1183
+ key: "barWidth",
1184
+ label: "柱宽",
1185
+ type: "text",
1186
+ group: "样式",
1187
+ default: "auto",
1188
+ placeholder: "auto 或数字"
1189
+ },
1190
+ {
1191
+ key: "xAxisTitle",
1192
+ label: "X 轴标题",
1193
+ type: "text",
1194
+ group: "轴",
1195
+ default: ""
1196
+ },
1197
+ {
1198
+ key: "yAxisTitle",
1199
+ label: "Y 轴标题",
1200
+ type: "text",
1201
+ group: "轴",
1202
+ default: ""
1203
+ }
1204
+ ];
1205
+ var pieChartSchema = [
1206
+ {
1207
+ key: "data",
1208
+ label: "数据",
1209
+ type: "json",
1210
+ group: "数据",
1211
+ default: []
1212
+ },
1213
+ {
1214
+ key: "colors",
1215
+ label: "配色",
1216
+ type: "json",
1217
+ group: "样式",
1218
+ default: [
1219
+ "#1890ff",
1220
+ "#8b5cf6",
1221
+ "#22c55e",
1222
+ "#f59e0b",
1223
+ "#ef4444"
1224
+ ]
1225
+ },
1226
+ {
1227
+ key: "showLegend",
1228
+ label: "显示图例",
1229
+ type: "switch",
1230
+ group: "样式",
1231
+ default: true
1232
+ },
1233
+ {
1234
+ key: "showLabel",
1235
+ label: "显示标签",
1236
+ type: "switch",
1237
+ group: "样式",
1238
+ default: true
1239
+ },
1240
+ {
1241
+ key: "ringMode",
1242
+ label: "环形",
1243
+ type: "switch",
1244
+ group: "样式",
1245
+ default: false
1246
+ },
1247
+ {
1248
+ key: "innerRadius",
1249
+ label: "内径",
1250
+ type: "number",
1251
+ group: "样式",
1252
+ default: 40,
1253
+ min: 0,
1254
+ max: 90
1255
+ },
1256
+ {
1257
+ key: "outerRadius",
1258
+ label: "外径",
1259
+ type: "number",
1260
+ group: "样式",
1261
+ default: 80,
1262
+ min: 10,
1263
+ max: 100
1264
+ }
1265
+ ];
1266
+ var borderTechSchema = [{
1267
+ key: "color",
1268
+ label: "边框颜色",
1269
+ type: "color",
1270
+ group: "样式",
1271
+ default: "#1890ff"
1272
+ }, {
1273
+ key: "radius",
1274
+ label: "圆角",
1275
+ type: "slider",
1276
+ group: "样式",
1277
+ default: 0,
1278
+ min: 0,
1279
+ max: 30
1280
+ }];
1281
+ var counterSchema = [
1282
+ {
1283
+ key: "value",
1284
+ label: "数值",
1285
+ type: "number",
1286
+ group: "基础",
1287
+ default: 0
1288
+ },
1289
+ {
1290
+ key: "label",
1291
+ label: "标签",
1292
+ type: "text",
1293
+ group: "基础",
1294
+ default: ""
1295
+ },
1296
+ {
1297
+ key: "suffix",
1298
+ label: "后缀",
1299
+ type: "text",
1300
+ group: "基础",
1301
+ default: ""
1302
+ },
1303
+ {
1304
+ key: "color",
1305
+ label: "颜色",
1306
+ type: "color",
1307
+ group: "样式",
1308
+ default: "#00d4ff"
1309
+ },
1310
+ {
1311
+ key: "fontSize",
1312
+ label: "字号",
1313
+ type: "slider",
1314
+ group: "样式",
1315
+ default: 32,
1316
+ min: 12,
1317
+ max: 120
1318
+ },
1319
+ {
1320
+ key: "duration",
1321
+ label: "动画时长",
1322
+ type: "number",
1323
+ group: "动画",
1324
+ default: 1e3,
1325
+ min: 0,
1326
+ max: 5e3
1327
+ },
1328
+ {
1329
+ key: "decimals",
1330
+ label: "小数位",
1331
+ type: "number",
1332
+ group: "基础",
1333
+ default: 0,
1334
+ min: 0,
1335
+ max: 6
1336
+ }
1337
+ ];
1338
+ var ringSchema = [
1339
+ {
1340
+ key: "color",
1341
+ label: "颜色",
1342
+ type: "color",
1343
+ group: "样式",
1344
+ default: "#00f5ff"
1345
+ },
1346
+ {
1347
+ key: "size",
1348
+ label: "尺寸",
1349
+ type: "number",
1350
+ group: "样式",
1351
+ default: 100,
1352
+ min: 40,
1353
+ max: 400
1354
+ },
1355
+ {
1356
+ key: "opacity",
1357
+ label: "不透明度",
1358
+ type: "slider",
1359
+ group: "样式",
1360
+ default: .8,
1361
+ min: .1,
1362
+ max: 1,
1363
+ step: .1
1364
+ }
1365
+ ];
1366
+ var sparkLineSchema = [
1367
+ {
1368
+ key: "data",
1369
+ label: "数据",
1370
+ type: "json",
1371
+ group: "数据",
1372
+ default: []
1373
+ },
1374
+ {
1375
+ key: "label",
1376
+ label: "标题",
1377
+ type: "text",
1378
+ group: "基础",
1379
+ default: "趋势"
1380
+ },
1381
+ {
1382
+ key: "color",
1383
+ label: "颜色",
1384
+ type: "color",
1385
+ group: "样式",
1386
+ default: "#00c8ff"
1387
+ }
1388
+ ];
1389
+ var digitalClockSchema = [
1390
+ {
1391
+ key: "color",
1392
+ label: "主色",
1393
+ type: "color",
1394
+ group: "样式",
1395
+ default: "#00d4ff"
1396
+ },
1397
+ {
1398
+ key: "secondColor",
1399
+ label: "秒数颜色",
1400
+ type: "color",
1401
+ group: "样式",
1402
+ default: "#ff6b6b"
1403
+ },
1404
+ {
1405
+ key: "showSeconds",
1406
+ label: "显示秒",
1407
+ type: "switch",
1408
+ group: "基础",
1409
+ default: true
1410
+ },
1411
+ {
1412
+ key: "showDate",
1413
+ label: "显示日期",
1414
+ type: "switch",
1415
+ group: "基础",
1416
+ default: true
1417
+ },
1418
+ {
1419
+ key: "blink",
1420
+ label: "冒号闪烁",
1421
+ type: "switch",
1422
+ group: "基础",
1423
+ default: true
1424
+ },
1425
+ {
1426
+ key: "timeFormat",
1427
+ label: "时间制",
1428
+ type: "select",
1429
+ group: "基础",
1430
+ default: "24h",
1431
+ options: [{
1432
+ label: "24小时",
1433
+ value: "24h"
1434
+ }, {
1435
+ label: "12小时",
1436
+ value: "12h"
1437
+ }]
1438
+ },
1439
+ {
1440
+ key: "dateFormat",
1441
+ label: "日期格式",
1442
+ type: "select",
1443
+ group: "基础",
1444
+ default: "YYYY-MM-DD",
1445
+ options: [
1446
+ {
1447
+ label: "2026-01-01",
1448
+ value: "YYYY-MM-DD"
1449
+ },
1450
+ {
1451
+ label: "2026年01月01日",
1452
+ value: "YYYY年MM月DD日"
1453
+ },
1454
+ {
1455
+ label: "01/01/2026",
1456
+ value: "DD/MM/YYYY"
1457
+ },
1458
+ {
1459
+ label: "01/01/2026",
1460
+ value: "MM/DD/YYYY"
1461
+ }
1462
+ ]
1463
+ }
1464
+ ];
1465
+ var rankListSchema = [
1466
+ {
1467
+ key: "data",
1468
+ label: "数据",
1469
+ type: "json",
1470
+ group: "数据",
1471
+ default: []
1472
+ },
1473
+ {
1474
+ key: "title",
1475
+ label: "标题",
1476
+ type: "text",
1477
+ group: "基础",
1478
+ default: ""
1479
+ },
1480
+ {
1481
+ key: "color",
1482
+ label: "颜色",
1483
+ type: "color",
1484
+ group: "样式",
1485
+ default: "#00d4ff"
1486
+ },
1487
+ {
1488
+ key: "max",
1489
+ label: "最大值",
1490
+ type: "number",
1491
+ group: "基础",
1492
+ default: 0,
1493
+ description: "0 表示自动"
1494
+ },
1495
+ {
1496
+ key: "unit",
1497
+ label: "单位",
1498
+ type: "text",
1499
+ group: "基础",
1500
+ default: ""
1501
+ }
1502
+ ];
1503
+ var textExt = defineComponentExtension({
1504
+ type: "ds-text",
1505
+ name: "文本",
1506
+ category: "controls",
1507
+ component: DsText_default,
1508
+ schema: textSchema,
1509
+ defaults: {
1510
+ content: "文本内容",
1511
+ color: "#ffffff",
1512
+ fontSize: 16,
1513
+ fontWeight: 400,
1514
+ textAlign: "left",
1515
+ padding: 8
1516
+ },
1517
+ tags: ["文本", "文字"],
1518
+ icon: "FontSizeOutlined",
1519
+ description: "基础文本组件,支持颜色、字号、对齐配置"
1520
+ });
1521
+ var lineChartExt = defineComponentExtension({
1522
+ type: "ds-line-chart",
1523
+ name: "折线图",
1524
+ category: "charts",
1525
+ component: DsLineChart_default,
1526
+ schema: lineChartSchema,
1527
+ defaults: {
1528
+ data: [],
1529
+ color: "#1890ff",
1530
+ showLegend: true,
1531
+ smooth: false,
1532
+ areaStyle: false
1533
+ },
1534
+ tags: [
1535
+ "图表",
1536
+ "趋势",
1537
+ "折线"
1538
+ ],
1539
+ icon: "LineChartOutlined",
1540
+ description: "ECharts 折线图,支持平滑曲线与面积填充"
1541
+ });
1542
+ var barChartExt = defineComponentExtension({
1543
+ type: "ds-bar-chart",
1544
+ name: "柱状图",
1545
+ category: "charts",
1546
+ component: DsBarChart_default,
1547
+ schema: barChartSchema,
1548
+ defaults: {
1549
+ data: [],
1550
+ color: "#1890ff",
1551
+ horizontal: false,
1552
+ showLegend: false,
1553
+ showLabel: false,
1554
+ barWidth: "auto"
1555
+ },
1556
+ tags: [
1557
+ "图表",
1558
+ "柱状",
1559
+ "对比"
1560
+ ],
1561
+ icon: "BarChartOutlined",
1562
+ description: "ECharts 柱状图,支持横向、多系列与数值标签"
1563
+ });
1564
+ var pieChartExt = defineComponentExtension({
1565
+ type: "ds-pie-chart",
1566
+ name: "饼图",
1567
+ category: "charts",
1568
+ component: DsPieChart_default,
1569
+ schema: pieChartSchema,
1570
+ defaults: {
1571
+ data: [],
1572
+ showLegend: true,
1573
+ showLabel: true,
1574
+ ringMode: false,
1575
+ innerRadius: 40,
1576
+ outerRadius: 80
1577
+ },
1578
+ tags: [
1579
+ "图表",
1580
+ "占比",
1581
+ "饼图"
1582
+ ],
1583
+ icon: "PieChartOutlined",
1584
+ description: "ECharts 饼图,支持环形模式与自定义配色"
1585
+ });
1586
+ var borderTechExt = defineComponentExtension({
1587
+ type: "ds-border-tech",
1588
+ name: "科技边框",
1589
+ category: "borders",
1590
+ component: DsBorderTech_default,
1591
+ schema: borderTechSchema,
1592
+ defaults: {
1593
+ color: "#1890ff",
1594
+ radius: 0
1595
+ },
1596
+ tags: ["边框", "科技"],
1597
+ icon: "BorderOutlined",
1598
+ description: "科技风边框,四角装饰"
1599
+ });
1600
+ var counterExt = defineComponentExtension({
1601
+ type: "ds-counter",
1602
+ name: "数字翻牌器",
1603
+ category: "controls",
1604
+ component: DsCounter_default,
1605
+ schema: counterSchema,
1606
+ defaults: {
1607
+ value: 0,
1608
+ label: "",
1609
+ suffix: "",
1610
+ color: "#00d4ff",
1611
+ fontSize: 32,
1612
+ duration: 1e3,
1613
+ decimals: 0
1614
+ },
1615
+ tags: [
1616
+ "数字",
1617
+ "翻牌",
1618
+ "动画"
1619
+ ],
1620
+ icon: "FieldNumberOutlined",
1621
+ description: "数字翻牌器,支持动画过渡与格式化"
1622
+ });
1623
+ var ringExt = defineComponentExtension({
1624
+ type: "ds-ring",
1625
+ name: "装饰环",
1626
+ category: "decorations",
1627
+ component: DsRing_default,
1628
+ schema: ringSchema,
1629
+ defaults: {
1630
+ color: "#00f5ff",
1631
+ size: 100,
1632
+ opacity: .8
1633
+ },
1634
+ tags: [
1635
+ "装饰",
1636
+ "动画",
1637
+ "环形"
1638
+ ],
1639
+ icon: "RadiusSettingOutlined",
1640
+ description: "科技装饰环,三层轨道旋转动画,支持自定义颜色"
1641
+ });
1642
+ var sparkLineExt = defineComponentExtension({
1643
+ type: "ds-spark-line",
1644
+ name: "迷你折线",
1645
+ category: "controls",
1646
+ component: DsSparkLine_default,
1647
+ schema: sparkLineSchema,
1648
+ defaults: {
1649
+ data: [],
1650
+ label: "趋势",
1651
+ color: "#00c8ff"
1652
+ },
1653
+ tags: [
1654
+ "图表",
1655
+ "迷你",
1656
+ "趋势"
1657
+ ],
1658
+ icon: "DotChartOutlined",
1659
+ description: "SVG 迷你折线图,纯 CSS 实现,体积小"
1660
+ });
1661
+ var digitalClockExt = defineComponentExtension({
1662
+ type: "ds-digital-clock",
1663
+ name: "数字时钟",
1664
+ category: "time",
1665
+ component: DsDigitalClock_default,
1666
+ schema: digitalClockSchema,
1667
+ defaults: {
1668
+ color: "#00d4ff",
1669
+ secondColor: "#ff6b6b",
1670
+ showSeconds: true,
1671
+ showDate: true,
1672
+ blink: true,
1673
+ timeFormat: "24h",
1674
+ dateFormat: "YYYY-MM-DD"
1675
+ },
1676
+ tags: [
1677
+ "时间",
1678
+ "时钟",
1679
+ "日期"
1680
+ ],
1681
+ icon: "ClockCircleOutlined",
1682
+ description: "数字时钟,支持 12/24 小时制与多种日期格式"
1683
+ });
1684
+ var rankListExt = defineComponentExtension({
1685
+ type: "ds-rank-list",
1686
+ name: "排行榜",
1687
+ category: "lists",
1688
+ component: DsRankList_default,
1689
+ schema: rankListSchema,
1690
+ defaults: {
1691
+ data: [],
1692
+ title: "",
1693
+ color: "#00d4ff",
1694
+ max: 0,
1695
+ unit: ""
1696
+ },
1697
+ tags: [
1698
+ "列表",
1699
+ "排行",
1700
+ "对比"
1701
+ ],
1702
+ icon: "TrophyOutlined",
1703
+ description: "排行榜,自动降序,前三名特殊样式"
1704
+ });
1705
+ var extensions = [
1706
+ textExt,
1707
+ lineChartExt,
1708
+ barChartExt,
1709
+ pieChartExt,
1710
+ borderTechExt,
1711
+ counterExt,
1712
+ ringExt,
1713
+ sparkLineExt,
1714
+ digitalClockExt,
1715
+ rankListExt
1716
+ ];
1717
+ var components = {
1718
+ "ds-text": textExt,
1719
+ "ds-line-chart": lineChartExt,
1720
+ "ds-bar-chart": barChartExt,
1721
+ "ds-pie-chart": pieChartExt,
1722
+ "ds-border-tech": borderTechExt,
1723
+ "ds-counter": counterExt,
1724
+ "ds-ring": ringExt,
1725
+ "ds-spark-line": sparkLineExt,
1726
+ "ds-digital-clock": digitalClockExt,
1727
+ "ds-rank-list": rankListExt
1728
+ };
1729
+ var src_default = { extensions };
1730
+ var VERSION = "0.1.0";
1731
+ var PACKAGE_NAME = "@nbreak/ui";
1732
+ //#endregion
1733
+ export { DsBarChart_default as DsBarChart, DsBorderTech_default as DsBorderTech, DsCounter_default as DsCounter, DsDigitalClock_default as DsDigitalClock, DsLineChart_default as DsLineChart, DsPieChart_default as DsPieChart, DsRankList_default as DsRankList, DsRing_default as DsRing, DsSparkLine_default as DsSparkLine, DsText_default as DsText, PACKAGE_NAME, VERSION, components, src_default as default, extensions };
1734
+
1735
+ //# sourceMappingURL=index.js.map