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