x-next 1.3.1 → 1.4.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.
Files changed (159) hide show
  1. package/AI_USAGE.md +2 -2
  2. package/CHANGELOG.md +36 -0
  3. package/dist/_utils/constant.d.ts +1 -1
  4. package/dist/_utils/palette.d.ts +6 -14
  5. package/dist/components/alert/Alert.vue.d.ts +9 -9
  6. package/dist/components/alert/index.d.ts +6 -6
  7. package/dist/components/button/ButtonGroup.vue.d.ts +22 -18
  8. package/dist/components/date-picker/DatePanel.vue.d.ts +342 -1
  9. package/dist/components/date-picker/DatePicker.vue.d.ts +343 -2
  10. package/dist/components/date-picker/index.d.ts +1765 -1083
  11. package/dist/components/form-input-tag/index.d.ts +26 -25
  12. package/dist/components/form-input-tag/interface.d.ts +8 -0
  13. package/dist/components/link/Link.vue.d.ts +4 -4
  14. package/dist/components/link/index.d.ts +6 -6
  15. package/dist/components/message/index.d.ts +3 -3
  16. package/dist/components/message/message.vue.d.ts +1 -1
  17. package/dist/components/notification/Notification.d.ts +1 -1
  18. package/dist/components/notification/index.d.ts +3 -3
  19. package/dist/components/popconfirm/src/types.d.ts +1 -1
  20. package/dist/components/progress/Progress.vue.d.ts +3 -3
  21. package/dist/components/progress/index.d.ts +3 -3
  22. package/dist/components/tag/Tag.vue.d.ts +14 -0
  23. package/dist/components/tag/index.d.ts +9 -0
  24. package/dist/components/tag/interface.d.ts +5 -0
  25. package/dist/components/trend-chart/components/TrendChart.d.ts +127 -17
  26. package/dist/components/trend-chart/components/trend-chart-curve.d.ts +27 -7
  27. package/dist/components/trend-chart/components/trend-chart-labels.d.ts +4 -0
  28. package/dist/components/trend-chart/helpers/getPadding.d.ts +3 -2
  29. package/dist/components/trend-chart/index.d.ts +223 -28
  30. package/dist/components/trend-chart/props.d.ts +63 -5
  31. package/dist/es/_styles/palette-aliases.js +182 -127
  32. package/dist/es/_utils/palette.js +49 -43
  33. package/dist/es/components/_components/picker/input-range.vue2.js +10 -10
  34. package/dist/es/components/_components/picker/input.vue2.js +20 -20
  35. package/dist/es/components/_components/select-view/select-view.js +2 -2
  36. package/dist/es/components/alert/Alert.vue.js +2 -2
  37. package/dist/es/components/alert/Alert.vue2.js +21 -20
  38. package/dist/es/components/button/Button.js +17 -17
  39. package/dist/es/components/button/ButtonGroup.vue2.js +11 -9
  40. package/dist/es/components/date-picker/DatePanel.vue.js +71 -62
  41. package/dist/es/components/date-picker/DatePanel.vue2.js +50 -40
  42. package/dist/es/components/date-picker/DatePicker.vue2.js +1 -1
  43. package/dist/es/components/form/form-item-label.vue.js +25 -22
  44. package/dist/es/components/form/form-item-label.vue2.js +1 -1
  45. package/dist/es/components/form-checkbox/icon-check.js +12 -43
  46. package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
  47. package/dist/es/components/form-input/InputSearch.js +1 -1
  48. package/dist/es/components/form-input-number/InputNumber.js +4 -4
  49. package/dist/es/components/form-input-tag/InputTag.js +168 -147
  50. package/dist/es/components/form-input-tag/utils.js +21 -19
  51. package/dist/es/components/form-textarea/Textarea.vue2.js +1 -1
  52. package/dist/es/components/link/Link.vue2.js +1 -1
  53. package/dist/es/components/popconfirm/src/popup.vue.js +1 -1
  54. package/dist/es/components/progress/Progress.vue2.js +1 -1
  55. package/dist/es/components/table/Table.js +1 -1
  56. package/dist/es/components/table/table-th.js +2 -2
  57. package/dist/es/components/tabs/tabs-button.js +2 -2
  58. package/dist/es/components/tabs/tabs-nav.js +1 -1
  59. package/dist/es/components/tag/Tag.vue.js +20 -20
  60. package/dist/es/components/tag/Tag.vue2.js +35 -28
  61. package/dist/es/components/time-picker/TimePanel.vue.js +30 -29
  62. package/dist/es/components/time-picker/TimePicker.vue2.js +1 -1
  63. package/dist/es/components/time-picker/TimeRangePanel.js +26 -23
  64. package/dist/es/components/trend-chart/components/TrendChart.js +208 -142
  65. package/dist/es/components/trend-chart/components/trend-chart-curve.js +124 -59
  66. package/dist/es/components/trend-chart/components/trend-chart-labels.js +43 -41
  67. package/dist/es/components/trend-chart/helpers/getPadding.js +3 -3
  68. package/dist/es/components/trend-chart/props.js +101 -33
  69. package/dist/es/components/trend-chart/themes.js +15 -15
  70. package/dist/es/components/watermark/controller.js +40 -40
  71. package/dist/es/icons/default/calendar.js +15 -0
  72. package/dist/es/icons/default/clock-circle.js +15 -0
  73. package/dist/es/icons/default/double-left.js +15 -0
  74. package/dist/es/icons/default/double-right.js +15 -0
  75. package/dist/es/icons/default/down.js +16 -0
  76. package/dist/es/icons/default/eye-invisible.js +20 -0
  77. package/dist/es/icons/default/eye.js +18 -0
  78. package/dist/es/icons/default/left.js +15 -0
  79. package/dist/es/icons/default/minus.js +16 -0
  80. package/dist/es/icons/default/plus.js +16 -0
  81. package/dist/es/icons/default/question-circle.js +18 -0
  82. package/dist/es/icons/default/right.js +15 -0
  83. package/dist/es/icons/default/search.js +16 -0
  84. package/dist/es/icons/default/up.js +16 -0
  85. package/dist/es/icons/icon.js +26 -25
  86. package/dist/es/icons/public/boxicons/basic.js +1893 -0
  87. package/dist/es/icons/public/boxicons/brands.js +304 -0
  88. package/dist/es/icons/public/boxicons/filled.js +1893 -0
  89. package/dist/es/icons/public/boxicons/index.js +24 -0
  90. package/dist/es/icons/public/boxicons/names.js +4082 -0
  91. package/dist/es/icons/registry.js +15 -15
  92. package/dist/es/style.css +1 -1
  93. package/dist/icons/default/calendar.d.ts +93 -0
  94. package/dist/icons/default/clock-circle.d.ts +93 -0
  95. package/dist/icons/{_self/down.d.ts → default/double-left.d.ts} +6 -0
  96. package/dist/icons/{_self/eye-invisible.d.ts → default/double-right.d.ts} +6 -0
  97. package/dist/icons/default/down.d.ts +93 -0
  98. package/dist/icons/default/eye-invisible.d.ts +93 -0
  99. package/dist/icons/default/eye.d.ts +93 -0
  100. package/dist/icons/{_self/eye.d.ts → default/left.d.ts} +7 -0
  101. package/dist/icons/default/minus.d.ts +93 -0
  102. package/dist/icons/{_self → default}/plus.d.ts +7 -0
  103. package/dist/icons/default/question-circle.d.ts +93 -0
  104. package/dist/icons/{_self/minus.d.ts → default/right.d.ts} +7 -0
  105. package/dist/icons/{_self → default}/search.d.ts +7 -0
  106. package/dist/icons/{_self → default}/up.d.ts +7 -0
  107. package/dist/icons/public/boxicons/basic.cjs +1 -0
  108. package/dist/icons/public/boxicons/basic.d.ts +2 -0
  109. package/dist/icons/public/boxicons/brands.cjs +1 -0
  110. package/dist/icons/public/boxicons/brands.d.ts +2 -0
  111. package/dist/icons/public/boxicons/filled.cjs +1 -0
  112. package/dist/icons/public/boxicons/filled.d.ts +2 -0
  113. package/dist/icons/public/boxicons/index.cjs +1 -0
  114. package/dist/icons/public/boxicons/index.d.ts +10 -0
  115. package/dist/icons/public/boxicons/names.d.ts +10 -0
  116. package/dist/icons/registry.d.ts +5 -0
  117. package/dist/index.cjs +4 -4
  118. package/dist/index.umd.js +4 -4
  119. package/dist/style/alert.css +1 -1
  120. package/dist/style/base.css +1 -1
  121. package/dist/style/button.css +1 -1
  122. package/dist/style/date-picker.css +1 -1
  123. package/dist/style/dialog.css +1 -1
  124. package/dist/style/drawer.css +1 -1
  125. package/dist/style/dropdown.css +1 -1
  126. package/dist/style/form-input-number.css +1 -1
  127. package/dist/style/form-input-tag.css +1 -1
  128. package/dist/style/form-input.css +1 -1
  129. package/dist/style/form-radio.css +1 -1
  130. package/dist/style/form-select.css +1 -1
  131. package/dist/style/form-textarea.css +1 -1
  132. package/dist/style/form.css +1 -1
  133. package/dist/style/link.css +1 -1
  134. package/dist/style/menu.css +1 -1
  135. package/dist/style/message-box.css +1 -1
  136. package/dist/style/network.css +1 -1
  137. package/dist/style/popconfirm.css +1 -1
  138. package/dist/style/popover.css +1 -1
  139. package/dist/style/popup.css +1 -1
  140. package/dist/style/progress.css +1 -1
  141. package/dist/style/rate.css +1 -1
  142. package/dist/style/spin.css +1 -1
  143. package/dist/style/steps.css +1 -1
  144. package/dist/style/table.css +1 -1
  145. package/dist/style/tag.css +1 -1
  146. package/dist/style/time-picker.css +1 -1
  147. package/dist/style/time-range-selector.css +1 -1
  148. package/dist/style.css +1 -1
  149. package/package.json +30 -4
  150. package/dist/es/icons/_self/down.js +0 -16
  151. package/dist/es/icons/_self/eye-invisible.js +0 -13
  152. package/dist/es/icons/_self/eye.js +0 -13
  153. package/dist/es/icons/_self/minus.js +0 -13
  154. package/dist/es/icons/_self/plus.js +0 -12
  155. package/dist/es/icons/_self/question-message.js +0 -12
  156. package/dist/es/icons/_self/search.js +0 -13
  157. package/dist/es/icons/_self/up.js +0 -16
  158. package/dist/es/icons/_ui/calendar.js +0 -13
  159. package/dist/es/icons/_ui/time.js +0 -12
@@ -1,73 +1,75 @@
1
- import { defineComponent as f, reactive as v, ref as x, onMounted as C, computed as c, h as n } from "vue";
2
- import { getComponentPrefix as Y } from "../../../_utils/config.js";
3
- import { trendChartLabelsProps as X } from "../props.js";
1
+ import { defineComponent as h, computed as l, h as t } from "vue";
2
+ import { getComponentPrefix as v } from "../../../_utils/config.js";
3
+ import { trendChartLabelsProps as Y } from "../props.js";
4
4
  import { TrendChartAxisColor as d } from "../themes.js";
5
- const T = f({
6
- name: Y("TrendChartLabels"),
7
- props: X,
5
+ const S = h({
6
+ name: v("TrendChartLabels"),
7
+ props: Y,
8
8
  setup(e) {
9
- const l = v({
10
- xLabelHeight: 0,
11
- yLabelHeight: 0
12
- }), u = x(null), b = x(null), L = (a) => {
9
+ const u = l(() => {
10
+ if (e.fontSize)
11
+ return e.fontSize;
12
+ const a = e.boundary.maxY - e.boundary.minY;
13
+ return a >= 100 ? 12 : a >= 60 ? 11 : 10;
14
+ }), c = l(() => e.color ?? "var(--x-color-text-secondary)"), b = l(() => ({
15
+ fill: c.value,
16
+ fontSize: `${u.value}px`
17
+ })), x = (a) => {
13
18
  var y;
14
- const t = ((y = e.xLabels) == null ? void 0 : y.length) ?? 0, s = t > 1 ? (e.boundary.maxX - e.boundary.minX) / (t - 1) : 0, r = t > 1 ? e.boundary.minX + s * a : e.boundary.minX + (e.boundary.maxX - e.boundary.minX) / 2, i = e.boundary.maxY;
15
- return { transform: `translate(${r}, ${i})` };
16
- }, h = (a) => {
17
- const t = e.yLabels ?? 0, s = t > 1 ? (e.boundary.maxY - e.boundary.minY) / (t - 1) : 0, r = e.boundary.minX, i = t > 1 ? e.boundary.maxY - s * a : e.boundary.minY + (e.boundary.maxY - e.boundary.minY) / 2;
18
- return { transform: `translate(${r}, ${i})` };
19
- }, g = (a) => {
20
- const t = e.yLabels ?? 0;
21
- return t <= 1 ? e.minValue : e.minValue + (e.maxValue - e.minValue) / (t - 1) * a;
22
- };
23
- C(() => {
24
- var a, t;
25
- u.value && e.xLabels && e.xLabels.length && (l.xLabelHeight = ((a = u.value.querySelector("text")) == null ? void 0 : a.getBoundingClientRect().height) || 0), b.value && e.yLabels && e.yLabels > 0 && (l.yLabelHeight = ((t = b.value.querySelector("text")) == null ? void 0 : t.getBoundingClientRect().height) || 0);
26
- });
27
- const m = c(() => e.xLabels && e.xLabels.length ? n(
19
+ const n = ((y = e.xLabels) == null ? void 0 : y.length) ?? 0, r = n > 1 ? (e.boundary.maxX - e.boundary.minX) / (n - 1) : 0, o = n > 1 ? e.boundary.minX + r * a : e.boundary.minX + (e.boundary.maxX - e.boundary.minX) / 2, s = e.boundary.maxY;
20
+ return { transform: `translate(${o}, ${s})` };
21
+ }, f = (a) => {
22
+ const n = e.yLabels ?? 0, r = n > 1 ? (e.boundary.maxY - e.boundary.minY) / (n - 1) : 0, o = e.boundary.minX, s = n > 1 ? e.boundary.maxY - r * a : e.boundary.minY + (e.boundary.maxY - e.boundary.minY) / 2;
23
+ return { transform: `translate(${o}, ${s})` };
24
+ }, L = (a) => {
25
+ const n = e.yLabels ?? 0;
26
+ return n <= 1 ? e.minValue : e.minValue + (e.maxValue - e.minValue) / (n - 1) * a;
27
+ }, m = l(() => e.xLabels && e.xLabels.length ? t(
28
28
  "g",
29
- { class: "x-labels", ref: u },
29
+ { class: "x-labels" },
30
30
  e.xLabels.map(
31
- (a, t) => n("g", { class: "label", ...L(t) }, [
32
- n(
31
+ (a, n) => t("g", { class: "label", ...x(n) }, [
32
+ t(
33
33
  "text",
34
34
  {
35
- dy: l.xLabelHeight + 5,
36
- "text-anchor": "middle"
35
+ dy: u.value + 5,
36
+ "text-anchor": "middle",
37
+ style: b.value
37
38
  },
38
39
  a
39
40
  ),
40
- n("line", { style: { stroke: d }, y2: 5 })
41
+ t("line", { style: { stroke: d }, y2: 5 })
41
42
  ])
42
43
  )
43
- ) : null), o = c(() => {
44
+ ) : null), i = l(() => {
44
45
  if (e.yLabels && e.yLabels > 0) {
45
46
  const a = [];
46
- for (let t = 0; t < e.yLabels; t++)
47
+ for (let n = 0; n < e.yLabels; n++)
47
48
  a.push(
48
- n("g", { class: "label", ...h(t) }, [
49
- n(
49
+ t("g", { class: "label", ...f(n) }, [
50
+ t(
50
51
  "text",
51
52
  {
52
53
  dx: -10,
53
- dy: l.yLabelHeight / 4,
54
- "text-anchor": "end"
54
+ dy: u.value / 4,
55
+ "text-anchor": "end",
56
+ style: b.value
55
57
  },
56
- e.yLabelsTextFormatter(g(t))
58
+ e.yLabelsTextFormatter(L(n))
57
59
  ),
58
- n("line", { style: { stroke: d }, x1: 0, x2: -5 })
60
+ t("line", { style: { stroke: d }, x1: 0, x2: -5 })
59
61
  ])
60
62
  );
61
- return n("g", { class: "y-labels", ref: b }, a);
63
+ return t("g", { class: "y-labels" }, a);
62
64
  }
63
65
  return null;
64
66
  });
65
67
  return () => {
66
68
  const a = [];
67
- return m.value && a.push(m.value), o.value && a.push(o.value), n("g", a);
69
+ return m.value && a.push(m.value), i.value && a.push(i.value), t("g", a);
68
70
  };
69
71
  }
70
72
  });
71
73
  export {
72
- T as default
74
+ S as default
73
75
  };
@@ -1,5 +1,5 @@
1
- const r = (a) => {
2
- const t = a.split(" ").filter((o) => o !== "").map((o) => Number(o));
1
+ const l = (o) => {
2
+ const t = (typeof o == "number" ? `${o}` : o).split(" ").filter((r) => r !== "").map((r) => Number(r));
3
3
  let e = {};
4
4
  switch (t.length) {
5
5
  case 4:
@@ -17,5 +17,5 @@ const r = (a) => {
17
17
  return e;
18
18
  };
19
19
  export {
20
- r as default
20
+ l as default
21
21
  };
@@ -1,56 +1,103 @@
1
- import { definePropType as e } from "../../_utils/vue-eco.js";
1
+ import { definePropType as t } from "../../_utils/vue-eco.js";
2
2
  import r from "./helpers/validatePadding.js";
3
- const l = {
3
+ const o = {
4
4
  // 数据集
5
5
  dataset: {
6
6
  required: !0,
7
- type: e(Array),
7
+ type: t(Array),
8
8
  default: () => []
9
9
  },
10
10
  status: {
11
- type: e(String),
11
+ type: t(String),
12
12
  default: void 0
13
13
  },
14
+ // 图表高度,数字按 px 处理,也可传 '100%' 等 CSS 值
15
+ height: {
16
+ type: [Number, String],
17
+ default: 60
18
+ },
19
+ // 图表宽度,数字按 px 处理
20
+ width: {
21
+ type: [Number, String],
22
+ default: "100%"
23
+ },
14
24
  // 网格属性
15
25
  grid: {
16
26
  default: null,
17
- type: e(Object)
27
+ type: t(Object)
18
28
  },
19
29
  // 标签属性
20
30
  labels: {
21
31
  default: null,
22
- type: e(Object)
32
+ type: t(Object)
23
33
  },
24
- // 最大值,默认数据集最大值
34
+ // 最大值,传入后锁定数据域上界,超出部分被裁剪
25
35
  max: {
26
36
  type: Number
27
37
  },
28
- // 最小值,默认数据集最小值
38
+ // 最小值,传入后锁定数据域下界,超出部分被裁剪
29
39
  min: {
30
40
  type: Number
31
41
  },
32
- // 绘制边距
42
+ // 绘制边距,支持 1-4 个非负数字字符串或单个非负数字
33
43
  padding: {
34
44
  default: "5",
35
- type: String,
36
- validator(t) {
37
- return r(t);
45
+ type: [String, Number],
46
+ validator(e) {
47
+ return typeof e == "number" ? Number.isFinite(e) && e >= 0 : r(e);
38
48
  }
39
49
  },
40
- // 开启交互,开启后启用onmousemove事件
50
+ // 平滑曲线
51
+ smooth: {
52
+ default: !0,
53
+ type: Boolean
54
+ },
55
+ // 是否渲染描边
56
+ stroke: {
57
+ default: !0,
58
+ type: Boolean
59
+ },
60
+ // 是否渲染填充
61
+ fill: {
62
+ default: !0,
63
+ type: Boolean
64
+ },
65
+ // 数据点显示策略
66
+ showPoints: {
67
+ default: "auto",
68
+ type: t([Boolean, String]),
69
+ validator(e) {
70
+ return typeof e == "boolean" || e === "auto";
71
+ }
72
+ },
73
+ // 开启交互,开启后启用 mousemove 事件
41
74
  interactive: {
42
75
  default: !1,
43
76
  type: Boolean
44
77
  },
78
+ // 开启后 hover 时在激活点旁显示数值提示
79
+ tooltip: {
80
+ default: !1,
81
+ type: Boolean
82
+ },
83
+ // 数值提示的文本格式化
84
+ tooltipFormatter: {
85
+ default: (e) => `${e}`,
86
+ type: Function
87
+ },
88
+ // 无障碍名称,设置后为图表添加 role="img"
89
+ ariaLabel: {
90
+ type: String
91
+ },
45
92
  // 主题
46
93
  theme: {
47
- type: e(Object),
94
+ type: t(Object),
48
95
  default: () => ({})
49
96
  }
50
- }, d = {
97
+ }, l = {
51
98
  boundary: {
52
99
  required: !0,
53
- type: e(Object),
100
+ type: t(Object),
54
101
  default: () => {
55
102
  }
56
103
  },
@@ -67,16 +114,20 @@ const l = {
67
114
  type: Number
68
115
  },
69
116
  activeLineParams: {
70
- type: e(Object)
117
+ type: t(Object)
71
118
  },
72
119
  data: {
73
120
  required: !0,
74
- type: e(Array),
121
+ type: t(Array),
75
122
  default: () => []
76
123
  },
77
124
  className: {
78
125
  type: String
79
126
  },
127
+ // 绘图区裁剪路径,避免 min/max 收窄后越界点画到图表外
128
+ clipPath: {
129
+ type: String
130
+ },
80
131
  // 平滑
81
132
  smooth: {
82
133
  default: !0,
@@ -91,21 +142,30 @@ const l = {
91
142
  default: !0,
92
143
  type: Boolean
93
144
  },
94
- // 鼠标
145
+ // 数据点显示策略
95
146
  showPoints: {
96
- default: !0,
147
+ default: "auto",
148
+ type: t([Boolean, String]),
149
+ validator(e) {
150
+ return typeof e == "boolean" || e === "auto";
151
+ }
152
+ },
153
+ // 鼠标
154
+ tooltip: {
155
+ default: !1,
97
156
  type: Boolean
98
157
  },
99
- theme: {
100
- type: e(Object)
158
+ tooltipFormatter: {
159
+ default: (e) => `${e}`,
160
+ type: Function
101
161
  },
102
- mainTheme: {
103
- type: e(Object)
162
+ theme: {
163
+ type: t(Object)
104
164
  }
105
- }, o = {
165
+ }, i = {
106
166
  boundary: {
107
167
  required: !0,
108
- type: e(Object),
168
+ type: t(Object),
109
169
  default: () => {
110
170
  }
111
171
  },
@@ -125,10 +185,10 @@ const l = {
125
185
  default: 0,
126
186
  type: Number
127
187
  }
128
- }, i = {
188
+ }, n = {
129
189
  boundary: {
130
190
  required: !0,
131
- type: e(Object),
191
+ type: t(Object),
132
192
  default: () => {
133
193
  }
134
194
  },
@@ -148,13 +208,21 @@ const l = {
148
208
  required: !0
149
209
  },
150
210
  yLabelsTextFormatter: {
151
- default: (t) => t,
211
+ default: (e) => e,
152
212
  type: Function
213
+ },
214
+ // 标签字号,默认按绘图区高度自适应
215
+ fontSize: {
216
+ type: Number
217
+ },
218
+ // 标签颜色
219
+ color: {
220
+ type: String
153
221
  }
154
222
  };
155
223
  export {
156
- d as trendChartCurveProps,
157
- o as trendChartGridProps,
158
- i as trendChartLabelsProps,
159
- l as trendChartProps
224
+ l as trendChartCurveProps,
225
+ i as trendChartGridProps,
226
+ n as trendChartLabelsProps,
227
+ o as trendChartProps
160
228
  };
@@ -9,9 +9,9 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
9
9
  },
10
10
  // 描边
11
11
  stroke: {
12
- width: 3,
12
+ width: 2,
13
13
  color: o,
14
- opacity: 0.8
14
+ opacity: 1
15
15
  },
16
16
  // 填充
17
17
  fill: {
@@ -29,13 +29,13 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
29
29
  color: r,
30
30
  // 点
31
31
  point: {
32
- width: 4,
32
+ width: 3,
33
33
  color: r
34
34
  },
35
35
  stroke: {
36
- width: 3,
36
+ width: 2,
37
37
  color: r,
38
- opacity: 0.8
38
+ opacity: 1
39
39
  },
40
40
  fill: {
41
41
  color: r,
@@ -52,11 +52,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
52
52
  color: i,
53
53
  // 点
54
54
  point: {
55
- width: 4,
55
+ width: 3,
56
56
  color: i
57
57
  },
58
58
  stroke: {
59
- width: 3,
59
+ width: 2,
60
60
  color: i,
61
61
  opacity: 1
62
62
  },
@@ -75,11 +75,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
75
75
  color: t,
76
76
  // 点
77
77
  point: {
78
- width: 4,
78
+ width: 3,
79
79
  color: t
80
80
  },
81
81
  stroke: {
82
- width: 3,
82
+ width: 2,
83
83
  color: t,
84
84
  opacity: 1
85
85
  },
@@ -94,15 +94,15 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
94
94
  }
95
95
  },
96
96
  INFO: {
97
- // 主题色
97
+ // 主题色(次要指标语义,保留中性文本色作为数据色)
98
98
  color: c,
99
99
  // 点
100
100
  point: {
101
- width: 4,
101
+ width: 3,
102
102
  color: c
103
103
  },
104
104
  stroke: {
105
- width: 3,
105
+ width: 2,
106
106
  color: c,
107
107
  opacity: 1
108
108
  },
@@ -121,13 +121,13 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
121
121
  color: l,
122
122
  // 点
123
123
  point: {
124
- width: 4,
124
+ width: 3,
125
125
  color: l
126
126
  },
127
127
  stroke: {
128
- width: 3,
128
+ width: 2,
129
129
  color: l,
130
- opacity: 0.9
130
+ opacity: 1
131
131
  },
132
132
  fill: {
133
133
  color: l,
@@ -1,11 +1,11 @@
1
1
  import { getClassNameMixin as lt } from "../../_utils/config.js";
2
- import { canvasToGray as dt, getPixelRatio as ft, styleToString as gt } from "./utils.js";
3
- const J = [90, 90], K = 3, mt = lt("watermark"), ut = () => typeof document > "u" ? "rgba(0, 0, 0, 0.15)" : document.documentElement.classList.contains("dark") || document.documentElement.getAttribute("data-theme") === "dark" ? "rgba(255, 255, 255, 0.15)" : "rgba(0, 0, 0, 0.15)", pt = (l) => Array.isArray(l) ? l.filter((h) => h !== "") : l ? [l] : [], yt = (l, h = {}) => {
4
- let e = h, i, c, x = !1, y = 0;
5
- const u = () => {
6
- i != null && i.parentNode && i.parentNode.removeChild(i), i = void 0;
7
- }, Q = (a, d, r, o) => {
8
- const t = r - a / 2, n = o - d / 2;
2
+ import { canvasToGray as ft, getPixelRatio as dt, styleToString as gt } from "./utils.js";
3
+ const q = [90, 90], J = 3, mt = lt("watermark"), ut = (i) => typeof document > "u" || typeof getComputedStyle != "function" ? "rgba(0, 0, 0, 0.15)" : getComputedStyle(i).getPropertyValue("--x-watermark-color").trim() || "rgba(0, 0, 0, 0.15)", pt = (i) => Array.isArray(i) ? i.filter((u) => u !== "") : i ? [i] : [], xt = (i, u = {}) => {
4
+ let e = u, c, l, y = !1, x = 0;
5
+ const p = () => {
6
+ c != null && c.parentNode && c.parentNode.removeChild(c), c = void 0;
7
+ }, K = (a, f, r, o) => {
8
+ const t = r - a / 2, n = o - f / 2;
9
9
  return {
10
10
  position: "absolute",
11
11
  inset: "0",
@@ -18,41 +18,41 @@ const J = [90, 90], K = 3, mt = lt("watermark"), ut = () => typeof document > "u
18
18
  backgroundPosition: `${t > 0 ? 0 : t}px ${n > 0 ? 0 : n}px`,
19
19
  zIndex: e.zIndex ?? 6
20
20
  };
21
- }, V = (a, d, r) => {
22
- x = !0, u();
21
+ }, Q = (a, f, r) => {
22
+ y = !0, p();
23
23
  const o = document.createElement("div");
24
24
  o.className = mt.element("layer"), o.setAttribute(
25
25
  "style",
26
26
  gt({
27
27
  ...r,
28
28
  backgroundImage: `url('${a}')`,
29
- backgroundSize: `${d}px`
29
+ backgroundSize: `${f}px`
30
30
  })
31
- ), l.append(o), i = o, Promise.resolve().then(() => {
32
- x = !1;
31
+ ), i.append(o), c = o, Promise.resolve().then(() => {
32
+ y = !1;
33
33
  });
34
- }, k = (a) => {
35
- var H, G, O, X, Y, U, _, B, j, q;
34
+ }, v = (a) => {
35
+ var D, G, O, X, Y, U, _, B, V, j;
36
36
  if (typeof document > "u") return;
37
37
  a && (e = a);
38
- const d = ++y, r = pt(e.content);
38
+ const f = ++x, r = pt(e.content);
39
39
  if (!e.image && !r.length) {
40
- u();
40
+ p();
41
41
  return;
42
42
  }
43
43
  const o = document.createElement("canvas"), t = o.getContext("2d");
44
44
  if (!t) return;
45
- const n = ft(), f = ((H = e.gap) == null ? void 0 : H[0]) ?? J[0], p = ((G = e.gap) == null ? void 0 : G[1]) ?? J[1], Z = ((O = e.offset) == null ? void 0 : O[0]) ?? f / 2, tt = ((X = e.offset) == null ? void 0 : X[1]) ?? p / 2, b = ((Y = e.font) == null ? void 0 : Y.fontSize) ?? 16, W = ((U = e.font) == null ? void 0 : U.fontWeight) ?? "normal", z = ((_ = e.font) == null ? void 0 : _.fontStyle) ?? "normal", C = ((B = e.font) == null ? void 0 : B.fontFamily) ?? "sans-serif", et = ((j = e.font) == null ? void 0 : j.textAlign) ?? "center", nt = ((q = e.font) == null ? void 0 : q.color) ?? ut(), ot = e.rotate ?? -22, rt = e.alpha ?? 1, I = e.repeat !== !1 && e.staggered !== !1, at = Q(f, p, Z, tt);
46
- let M = 120, N = 64;
45
+ const n = dt(), d = ((D = e.gap) == null ? void 0 : D[0]) ?? q[0], h = ((G = e.gap) == null ? void 0 : G[1]) ?? q[1], Z = ((O = e.offset) == null ? void 0 : O[0]) ?? d / 2, tt = ((X = e.offset) == null ? void 0 : X[1]) ?? h / 2, $ = ((Y = e.font) == null ? void 0 : Y.fontSize) ?? 16, W = ((U = e.font) == null ? void 0 : U.fontWeight) ?? "normal", C = ((_ = e.font) == null ? void 0 : _.fontStyle) ?? "normal", P = ((B = e.font) == null ? void 0 : B.fontFamily) ?? "sans-serif", et = ((V = e.font) == null ? void 0 : V.textAlign) ?? "center", nt = ((j = e.font) == null ? void 0 : j.color) ?? ut(i), ot = e.rotate ?? -22, rt = e.alpha ?? 1, z = e.repeat !== !1 && e.staggered !== !1, at = K(d, h, Z, tt);
46
+ let I = 120, M = 64;
47
47
  if (!e.image && r.length && t.measureText) {
48
- t.font = `${z} normal ${W} ${b}px ${C}`;
48
+ t.font = `${C} normal ${W} ${$}px ${P}`;
49
49
  const s = r.map((A) => t.measureText(A).width);
50
- M = Math.ceil(Math.max(...s)), N = b * r.length + K * (r.length - 1);
50
+ I = Math.ceil(Math.max(...s)), M = $ * r.length + J * (r.length - 1);
51
51
  }
52
- const v = e.width ?? M, $ = e.height ?? N, g = (f + v) * n, m = (p + $) * n, w = I ? 2 : 1, st = (f + v) * w, P = f * n / 2, R = p * n / 2, S = v * n, it = $ * n, E = g / 2, D = m / 2;
53
- o.width = g * w, o.height = m * w, t.globalAlpha = rt, t.save(), t.translate(E, D), t.rotate(Math.PI / 180 * ot), t.translate(-E, -D);
54
- const F = () => {
55
- t.restore(), I && t.drawImage(
52
+ const k = e.width ?? I, b = e.height ?? M, g = (d + k) * n, m = (h + b) * n, w = z ? 2 : 1, st = (d + k) * w, N = d * n / 2, R = h * n / 2, S = k * n, it = b * n, F = g / 2, E = m / 2;
53
+ o.width = g * w, o.height = m * w, t.globalAlpha = rt, t.save(), t.translate(F, E), t.rotate(Math.PI / 180 * ot), t.translate(-F, -E);
54
+ const H = () => {
55
+ t.restore(), z && t.drawImage(
56
56
  o,
57
57
  0,
58
58
  0,
@@ -64,44 +64,44 @@ const J = [90, 90], K = 3, mt = lt("watermark"), ut = () => typeof document > "u
64
64
  m
65
65
  );
66
66
  }, L = () => {
67
- e.grayscale && dt(o), V(o.toDataURL(), st, at);
67
+ e.grayscale && ft(o), Q(o.toDataURL(), st, at);
68
68
  };
69
69
  if (e.image) {
70
70
  const s = new Image();
71
71
  s.onload = () => {
72
- d === y && (t.drawImage(s, P, R, S, it), F(), L());
72
+ f === x && (t.drawImage(s, N, R, S, it), H(), L());
73
73
  }, s.onerror = () => {
74
- d === y && u();
74
+ f === x && p();
75
75
  }, s.crossOrigin = "anonymous", s.referrerPolicy = "no-referrer", s.src = e.image;
76
76
  } else {
77
- const s = b * n;
78
- t.font = `${z} normal ${W} ${s}px/${$ * n}px ${C}`, t.fillStyle = nt, t.textAlign = et, t.textBaseline = "top", t.translate(S / 2, 0), r.forEach((A, ct) => {
79
- t.fillText(A, P, R + ct * (s + K * n));
80
- }), t.translate(-S / 2, 0), F(), L();
77
+ const s = $ * n;
78
+ t.font = `${C} normal ${W} ${s}px/${b * n}px ${P}`, t.fillStyle = nt, t.textAlign = et, t.textBaseline = "top", t.translate(S / 2, 0), r.forEach((A, ct) => {
79
+ t.fillText(A, N, R + ct * (s + J * n));
80
+ }), t.translate(-S / 2, 0), H(), L();
81
81
  }
82
82
  }, T = () => {
83
- typeof MutationObserver > "u" || (c == null || c.disconnect(), c = new MutationObserver((a) => {
84
- if (e.antiTamper === !1 || x) return;
83
+ typeof MutationObserver > "u" || (l == null || l.disconnect(), l = new MutationObserver((a) => {
84
+ if (e.antiTamper === !1 || y) return;
85
85
  a.some((r) => {
86
- const o = Array.from(r.removedNodes).some((n) => n === i), t = r.type === "attributes" && r.target === i;
86
+ const o = Array.from(r.removedNodes).some((n) => n === c), t = r.type === "attributes" && r.target === c;
87
87
  return o || t;
88
- }) && k();
89
- }), c.observe(l, {
88
+ }) && v();
89
+ }), l.observe(i, {
90
90
  attributes: !0,
91
91
  childList: !0,
92
92
  subtree: !0
93
93
  }));
94
94
  };
95
95
  return T(), {
96
- render: k,
96
+ render: v,
97
97
  update(a) {
98
- a && (e = a), k(), T();
98
+ a && (e = a), v(), T();
99
99
  },
100
100
  destroy() {
101
- c == null || c.disconnect(), c = void 0, u();
101
+ l == null || l.disconnect(), l = void 0, p();
102
102
  }
103
103
  };
104
104
  };
105
105
  export {
106
- yt as createWatermarkController
106
+ xt as createWatermarkController
107
107
  };
@@ -0,0 +1,15 @@
1
+ import { h as o, createVNode as e } from "vue";
2
+ import { generateIcon as t } from "../icon.js";
3
+ const a = t("Calendar", o(e("svg", {
4
+ viewBox: "0 0 48 48",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ stroke: "currentColor",
8
+ "stroke-width": "4",
9
+ "stroke-linecap": "butt"
10
+ }, [e("path", {
11
+ d: "M7 22H41M14 5V13M34 5V13M8 41H40C40.5523 41 41 40.5523 41 40V10C41 9.44772 40.5523 9 40 9H8C7.44772 9 7 9.44772 7 10V40C7 40.5523 7.44772 41 8 41Z"
12
+ }, null)])));
13
+ export {
14
+ a as default
15
+ };
@@ -0,0 +1,15 @@
1
+ import { h as e, createVNode as o } from "vue";
2
+ import { generateIcon as t } from "../icon.js";
3
+ const n = t("ClockCircle", e(o("svg", {
4
+ viewBox: "0 0 48 48",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ stroke: "currentColor",
8
+ "stroke-width": "4",
9
+ "stroke-linecap": "butt"
10
+ }, [o("path", {
11
+ d: "M24 14V24H33.5M42 24C42 33.9411 33.9411 42 24 42C14.0589 42 6 33.9411 6 24C6 14.0589 14.0589 6 24 6C33.9411 6 42 14.0589 42 24Z"
12
+ }, null)])));
13
+ export {
14
+ n as default
15
+ };
@@ -0,0 +1,15 @@
1
+ import { h as o, createVNode as e } from "vue";
2
+ import { generateIcon as t } from "../icon.js";
3
+ const n = t("DoubleLeft", o(e("svg", {
4
+ viewBox: "0 0 48 48",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ stroke: "currentColor",
8
+ "stroke-width": "4",
9
+ "stroke-linecap": "butt"
10
+ }, [e("path", {
11
+ d: "M36.8574 9.8999L22.7153 24.042L36.8574 38.1842M25.5437 9.8999L11.4016 24.042L25.5437 38.1842"
12
+ }, null)])));
13
+ export {
14
+ n as default
15
+ };
@@ -0,0 +1,15 @@
1
+ import { h as t, createVNode as o } from "vue";
2
+ import { generateIcon as e } from "../icon.js";
3
+ const n = e("DoubleRight", t(o("svg", {
4
+ viewBox: "0 0 48 48",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ stroke: "currentColor",
8
+ "stroke-width": "4",
9
+ "stroke-linecap": "butt"
10
+ }, [o("path", {
11
+ d: "M11.1426 38.1001L25.2847 23.958L11.1426 9.81583M22.4563 38.1001L36.5984 23.958L22.4563 9.81583"
12
+ }, null)])));
13
+ export {
14
+ n as default
15
+ };
@@ -0,0 +1,16 @@
1
+ import { h as t, createVNode as o } from "vue";
2
+ import { generateIcon as e } from "../icon.js";
3
+ const i = e("Down", t(o("svg", {
4
+ viewBox: "0 0 48 48",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ stroke: "currentColor",
8
+ "stroke-width": "4",
9
+ "stroke-linecap": "butt",
10
+ "stroke-linejoin": "miter"
11
+ }, [o("path", {
12
+ d: "M39.5996 17.4434L24.0433 32.9997C24.0433 32.9997 13.1813 22.1378 8.48691 17.4434"
13
+ }, null)])));
14
+ export {
15
+ i as default
16
+ };