x-next 1.6.0 → 1.8.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 (166) hide show
  1. package/AI_USAGE.md +182 -4
  2. package/CHANGELOG.md +74 -0
  3. package/dist/_hooks/use-chart-size.d.ts +25 -0
  4. package/dist/_utils/chart/index.d.ts +6 -0
  5. package/dist/_utils/chart/padding.d.ts +15 -0
  6. package/dist/_utils/chart/path.d.ts +34 -0
  7. package/dist/_utils/chart/scale.d.ts +55 -0
  8. package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
  9. package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
  10. package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
  11. package/dist/components/_components/chart/colors.d.ts +10 -0
  12. package/dist/components/_components/chart/interface.d.ts +38 -0
  13. package/dist/components/bar-chart/BarChart.d.ts +278 -0
  14. package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
  15. package/dist/components/bar-chart/index.d.ts +600 -0
  16. package/dist/components/bar-chart/interface.d.ts +74 -0
  17. package/dist/components/bar-chart/props.d.ts +145 -0
  18. package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
  19. package/dist/components/date-picker/index.d.ts +6 -6
  20. package/dist/components/draggable/Draggable.d.ts +1 -1
  21. package/dist/components/draggable/index.d.ts +2 -2
  22. package/dist/components/drawer/index.d.ts +6 -6
  23. package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
  24. package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
  25. package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
  26. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
  27. package/dist/components/dropdown/index.d.ts +29 -29
  28. package/dist/components/form/FormItem.vue.d.ts +12 -12
  29. package/dist/components/form/form-item-label.vue.d.ts +3 -3
  30. package/dist/components/form/index.d.ts +24 -24
  31. package/dist/components/form-select/Select.d.ts +3 -3
  32. package/dist/components/form-select/index.d.ts +6 -6
  33. package/dist/components/form-slider/Slider.vue.d.ts +3 -3
  34. package/dist/components/form-slider/index.d.ts +6 -6
  35. package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
  36. package/dist/components/grid/Row.vue.d.ts +3 -3
  37. package/dist/components/grid/index.d.ts +9 -9
  38. package/dist/components/heatmap/Heatmap.d.ts +10 -0
  39. package/dist/components/heatmap/index.d.ts +30 -0
  40. package/dist/components/image/Image.vue.d.ts +125 -17
  41. package/dist/components/image/ImagePreview.vue.d.ts +97 -7
  42. package/dist/components/image/ImagePreviewAction.d.ts +3 -3
  43. package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
  44. package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
  45. package/dist/components/image/index.d.ts +712 -124
  46. package/dist/components/image/interface.d.ts +9 -1
  47. package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
  48. package/dist/components/index.d.ts +4 -0
  49. package/dist/components/line-chart/LineChart.d.ts +295 -0
  50. package/dist/components/line-chart/helpers/layout.d.ts +74 -0
  51. package/dist/components/line-chart/index.d.ts +614 -0
  52. package/dist/components/line-chart/interface.d.ts +76 -0
  53. package/dist/components/line-chart/props.d.ts +173 -0
  54. package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
  55. package/dist/components/pagination/page-options.vue.d.ts +6 -6
  56. package/dist/components/pie-chart/PieChart.d.ts +219 -0
  57. package/dist/components/pie-chart/index.d.ts +470 -0
  58. package/dist/components/pie-chart/interface.d.ts +58 -0
  59. package/dist/components/pie-chart/props.d.ts +107 -0
  60. package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
  61. package/dist/components/popover/Popover.d.ts +1 -1
  62. package/dist/components/popover/index.d.ts +3 -3
  63. package/dist/components/popup/Popup.d.ts +1 -1
  64. package/dist/components/popup/index.d.ts +3 -3
  65. package/dist/components/space/Space.d.ts +1 -1
  66. package/dist/components/space/index.d.ts +3 -3
  67. package/dist/components/tabs/Tabs.d.ts +1 -1
  68. package/dist/components/tabs/index.d.ts +3 -3
  69. package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
  70. package/dist/components/time-picker/index.d.ts +6 -6
  71. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  72. package/dist/components/tooltip/index.d.ts +3 -3
  73. package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
  74. package/dist/components/trend-chart/index.d.ts +33 -187
  75. package/dist/components/trend-chart/props.d.ts +9 -78
  76. package/dist/components/trend-chart/themes.d.ts +0 -1
  77. package/dist/components/trigger/Trigger.d.ts +1 -1
  78. package/dist/components/trigger/index.d.ts +3 -3
  79. package/dist/components/upload/Upload.d.ts +372 -0
  80. package/dist/components/upload/context.d.ts +28 -0
  81. package/dist/components/upload/index.d.ts +656 -0
  82. package/dist/components/upload/interface.d.ts +110 -0
  83. package/dist/components/upload/props.d.ts +321 -0
  84. package/dist/components/upload/upload-list-item.d.ts +15 -0
  85. package/dist/components/upload/upload-list.d.ts +11 -0
  86. package/dist/components/upload/upload-picture-item.d.ts +20 -0
  87. package/dist/components/upload/upload-trigger.d.ts +8 -0
  88. package/dist/components/upload/utils.d.ts +48 -0
  89. package/dist/es/_hooks/use-chart-size.js +25 -0
  90. package/dist/es/_styles/palette-aliases.js +7 -4
  91. package/dist/es/_utils/chart/padding.js +22 -0
  92. package/dist/es/_utils/chart/path.js +69 -0
  93. package/dist/es/_utils/chart/scale.js +77 -0
  94. package/dist/es/components/_components/chart/ChartAxis.js +79 -0
  95. package/dist/es/components/_components/chart/ChartLegend.js +53 -0
  96. package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
  97. package/dist/es/components/_components/chart/colors.js +12 -0
  98. package/dist/es/components/bar-chart/BarChart.js +470 -0
  99. package/dist/es/components/bar-chart/helpers/layout.js +53 -0
  100. package/dist/es/components/bar-chart/index.js +8 -0
  101. package/dist/es/components/bar-chart/props.js +148 -0
  102. package/dist/es/components/heatmap/Heatmap.js +244 -169
  103. package/dist/es/components/image/Image.vue.js +55 -45
  104. package/dist/es/components/image/Image.vue2.js +113 -92
  105. package/dist/es/components/image/ImagePreview.vue.js +66 -53
  106. package/dist/es/components/image/ImagePreview.vue2.js +219 -171
  107. package/dist/es/components/image/ImagePreviewAction.js +12 -15
  108. package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
  109. package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
  110. package/dist/es/components/image/hooks/use-image-drag.js +16 -14
  111. package/dist/es/components/index.js +136 -128
  112. package/dist/es/components/line-chart/LineChart.js +532 -0
  113. package/dist/es/components/line-chart/helpers/layout.js +80 -0
  114. package/dist/es/components/line-chart/index.js +8 -0
  115. package/dist/es/components/line-chart/props.js +178 -0
  116. package/dist/es/components/pie-chart/PieChart.js +397 -0
  117. package/dist/es/components/pie-chart/index.js +8 -0
  118. package/dist/es/components/pie-chart/props.js +104 -0
  119. package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
  120. package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
  121. package/dist/es/components/trend-chart/props.js +28 -74
  122. package/dist/es/components/trend-chart/themes.js +30 -31
  123. package/dist/es/components/upload/Upload.js +420 -0
  124. package/dist/es/components/upload/context.js +4 -0
  125. package/dist/es/components/upload/index.js +8 -0
  126. package/dist/es/components/upload/props.js +321 -0
  127. package/dist/es/components/upload/upload-list-item.js +138 -0
  128. package/dist/es/components/upload/upload-list.js +48 -0
  129. package/dist/es/components/upload/upload-picture-item.js +109 -0
  130. package/dist/es/components/upload/upload-trigger.js +89 -0
  131. package/dist/es/components/upload/utils.js +195 -0
  132. package/dist/es/icons/_self/upload-icons.js +103 -0
  133. package/dist/es/index.js +197 -189
  134. package/dist/es/locale/en-US.js +30 -1
  135. package/dist/es/locale/zh-CN.js +30 -1
  136. package/dist/es/style.css +1 -1
  137. package/dist/icons/_self/upload-icons.d.ts +523 -0
  138. package/dist/index.cjs +4 -4
  139. package/dist/index.umd.js +4 -4
  140. package/dist/locale/interface.d.ts +45 -0
  141. package/dist/style/bar-chart.css +1 -0
  142. package/dist/style/bar-chart.js +2 -0
  143. package/dist/style/base.css +1 -1
  144. package/dist/style/heatmap.css +1 -1
  145. package/dist/style/image.css +1 -1
  146. package/dist/style/line-chart.css +1 -0
  147. package/dist/style/line-chart.js +2 -0
  148. package/dist/style/pie-chart.css +1 -0
  149. package/dist/style/pie-chart.js +2 -0
  150. package/dist/style/upload.css +1 -0
  151. package/dist/style/upload.js +2 -0
  152. package/dist/style.css +1 -1
  153. package/dist/types.d.ts +4 -0
  154. package/package.json +1 -1
  155. package/volar.d.ts +4 -0
  156. package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
  157. package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
  158. package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
  159. package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
  160. package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
  161. package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
  162. package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
  163. package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
  164. package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
  165. package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
  166. package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
@@ -1,13 +1,13 @@
1
- import { defineComponent as W, createVNode as l, toRefs as $, computed as n, ref as q, Fragment as j } from "vue";
2
- import { getClassNameMixin as P } from "../../_utils/config.js";
3
- import { useSize as T } from "../../_hooks/use-size.js";
4
- import { useLocale as V } from "../../locale/index.js";
5
- import { isObject as _ } from "../../_utils/is.js";
6
- import { throttleByRaf as F } from "../../_utils/throttle-by-raf.js";
7
- import { Spin as H } from "../spin/index.js";
8
- import { getWeekdayLabels as G } from "../date-picker/utils.js";
9
- import { CELL_SIZE as A, resolveRange as U, indexDataByDay as Z, getValueExtent as J, buildMatrix as K, DEFAULT_COLOR_LEVELS as Q, getMonthLabels as X, isCellInRequestedRange as ee } from "./helpers/matrix.js";
10
- const ue = /* @__PURE__ */ W({
1
+ import { defineComponent as ee, createVNode as n, useId as te, toRefs as le, computed as a, ref as Y, watch as ae, nextTick as ne, Fragment as oe } from "vue";
2
+ import { getClassNameMixin as re } from "../../_utils/config.js";
3
+ import { useSize as ie } from "../../_hooks/use-size.js";
4
+ import { useLocale as se } from "../../locale/index.js";
5
+ import { isObject as ue } from "../../_utils/is.js";
6
+ import { throttleByRaf as ce } from "../../_utils/throttle-by-raf.js";
7
+ import { Spin as de } from "../spin/index.js";
8
+ import { getWeekdayLabels as me } from "../date-picker/utils.js";
9
+ import { CELL_SIZE as U, resolveRange as ve, indexDataByDay as fe, getValueExtent as he, buildMatrix as pe, DEFAULT_COLOR_LEVELS as ye, getMonthLabels as ge, isCellInRequestedRange as xe } from "./helpers/matrix.js";
10
+ const Z = 2, Ae = /* @__PURE__ */ ee({
11
11
  name: "Heatmap",
12
12
  props: {
13
13
  /**
@@ -70,7 +70,7 @@ const ue = /* @__PURE__ */ W({
70
70
  firstDayOfWeek: {
71
71
  type: Number,
72
72
  default: 0,
73
- validator: (e) => e >= 0 && e <= 6
73
+ validator: (t) => t >= 0 && t <= 6
74
74
  },
75
75
  /**
76
76
  * @zh 是否展示星期标签
@@ -132,203 +132,278 @@ const ue = /* @__PURE__ */ W({
132
132
  * @param {HeatmapCell} cell
133
133
  * @param {MouseEvent} ev
134
134
  */
135
- cellClick: (e, b) => !0
135
+ cellClick: (t, D) => !0
136
136
  },
137
137
  slots: Object,
138
- setup(e, {
139
- emit: b,
140
- slots: I
138
+ setup(t, {
139
+ emit: D,
140
+ slots: S
141
141
  }) {
142
142
  const {
143
- t: v,
144
- locale: O
145
- } = V(), h = P("heatmap"), {
146
- mergedSize: x
147
- } = T($(e).size, {
143
+ t: g,
144
+ locale: z
145
+ } = se(), C = re("heatmap"), E = `x-heatmap-cell-${te()}`, {
146
+ mergedSize: A
147
+ } = ie(le(t).size, {
148
148
  defaultValue: "medium"
149
- }), c = n(() => A[x.value] ?? A.medium), d = n(() => {
150
- var t;
151
- return (t = e.activeColors) != null && t.length ? e.activeColors : ["var(--x-heatmap-color-level-1)", "var(--x-heatmap-color-level-2)", "var(--x-heatmap-color-level-3)", "var(--x-heatmap-color-level-4)", "var(--x-heatmap-color-level-5)"];
152
- }), C = n(() => e.minimumColor ?? "var(--x-heatmap-color-empty)"), k = n(() => [C.value, ...d.value]), i = n(() => U({
153
- year: e.year,
154
- startDate: e.startDate,
155
- endDate: e.endDate,
156
- data: e.data
157
- }, e.firstDayOfWeek)), y = n(() => Z(e.data)), E = n(() => J(e.data)), p = n(() => i.value ? K(i.value, y.value, E.value, d.value.length || Q) : []), R = n(() => {
158
- const t = Array.from({
149
+ }), d = a(() => U[A.value] ?? U.medium), p = a(() => {
150
+ var e;
151
+ return (e = t.activeColors) != null && e.length ? t.activeColors : ["var(--x-heatmap-color-level-1)", "var(--x-heatmap-color-level-2)", "var(--x-heatmap-color-level-3)", "var(--x-heatmap-color-level-4)", "var(--x-heatmap-color-level-5)"];
152
+ }), O = a(() => t.minimumColor ?? "var(--x-heatmap-color-empty)"), R = a(() => [O.value, ...p.value]), i = a(() => ve({
153
+ year: t.year,
154
+ startDate: t.startDate,
155
+ endDate: t.endDate,
156
+ data: t.data
157
+ }, t.firstDayOfWeek)), P = a(() => fe(t.data)), q = a(() => he(t.data)), m = a(() => i.value ? pe(i.value, P.value, q.value, p.value.length || ye) : []), F = a(() => {
158
+ const e = Array.from({
159
159
  length: 7
160
160
  }, () => []);
161
- return p.value.forEach((a) => {
162
- t[a.rowIndex].push(a);
163
- }), t;
164
- }), N = n(() => G(e.firstDayOfWeek, O.value.datePicker)), L = n(() => {
161
+ return m.value.forEach((l) => {
162
+ e[l.rowIndex].push(l);
163
+ }), e;
164
+ }), V = a(() => me(t.firstDayOfWeek, z.value.datePicker)), _ = a(() => {
165
165
  if (!i.value) return [];
166
- const t = i.value.requestedStart.year() !== i.value.requestedEnd.year();
167
- return X(i.value, p.value, (a) => t ? a.format("YYYY-MM") : v("heatmap.month", {
168
- month: a.month() + 1
166
+ const e = i.value.requestedStart.year() !== i.value.requestedEnd.year();
167
+ return ge(i.value, m.value, (l) => e ? l.format("YYYY-MM") : g("heatmap.month", {
168
+ month: l.month() + 1
169
169
  }));
170
- }), r = (t) => k.value[t.level] ?? C.value, w = (t) => {
171
- const a = t.date.format("YYYY-MM-DD"), m = t.value;
172
- return m === null ? v("heatmap.noData", {
173
- date: a
174
- }) : v("heatmap.value", {
175
- date: a,
176
- value: m
170
+ }), j = (e) => R.value[e.level] ?? O.value, $ = (e) => {
171
+ const l = e.date.format("YYYY-MM-DD"), o = e.value;
172
+ return o === null ? g("heatmap.noData", {
173
+ date: l
174
+ }) : g("heatmap.value", {
175
+ date: l,
176
+ value: o
177
177
  });
178
- }, f = q(null), g = n(() => e.tooltip !== !1), S = n(() => f.value === null ? null : p.value[f.value] ?? null), Y = n(() => {
179
- const t = S.value;
180
- if (!t) return {};
181
- const a = 2, m = t.colIndex * (c.value + a) + c.value / 2, D = t.rowIndex * (c.value + a) + c.value;
182
- return {
183
- left: `${m}px`,
184
- top: `${D + 6}px`
178
+ }, v = Y(null), L = a(() => t.tooltip !== !1), b = Y(null), s = {
179
+ tooltip: b
180
+ }, w = Y(0), M = a(() => v.value === null ? null : m.value[v.value] ?? null), k = a(() => m.value.reduce((e, l) => Math.max(e, l.colIndex + 1), 0)), G = a(() => {
181
+ const e = Z;
182
+ return k.value <= 0 ? 0 : k.value * d.value + (k.value - 1) * e;
183
+ }), B = a(() => {
184
+ const e = M.value;
185
+ if (!e) return {};
186
+ const l = Z, o = e.colIndex * (d.value + l) + d.value / 2, c = e.rowIndex * (d.value + l) + d.value, h = w.value / 2, f = G.value;
187
+ let K = o;
188
+ return h > 0 && f > 0 && (K = f >= w.value ? Math.min(Math.max(o, h), f - h) : f / 2), {
189
+ left: `${K}px`,
190
+ top: `${c + 6}px`
185
191
  };
186
- }), z = (t) => {
187
- var D;
188
- if (!g.value) return;
189
- const a = t.target, m = (D = a == null ? void 0 : a.dataset) == null ? void 0 : D.index;
190
- f.value = m === void 0 ? null : Number(m);
191
- }, B = () => {
192
- f.value = null;
193
- }, o = (t, a) => {
194
- b("cellClick", t, a);
195
- }, u = F(z), s = n(() => ({
196
- "--x-heatmap-cell-size": `${c.value}px`,
197
- gridTemplateRows: `repeat(7, ${c.value}px)`
192
+ });
193
+ ae(v, (e) => {
194
+ if (e === null) {
195
+ w.value = 0;
196
+ return;
197
+ }
198
+ ne(() => {
199
+ var o;
200
+ const l = ((o = b.value) == null ? void 0 : o.offsetWidth) ?? 0;
201
+ l !== w.value && (w.value = l);
202
+ });
203
+ });
204
+ const H = (e) => {
205
+ var c;
206
+ if (!L.value) return;
207
+ const l = e.target, o = (c = l == null ? void 0 : l.dataset) == null ? void 0 : c.index;
208
+ x.value = !1, v.value = o === void 0 ? null : Number(o);
209
+ }, N = () => {
210
+ v.value = null, x.value = !1;
211
+ }, x = Y(!1), T = (e, l = !1) => {
212
+ x.value = l, v.value = e;
213
+ }, W = (e) => {
214
+ if (!L.value || m.value.length === 0) return;
215
+ const l = m.value.length - 1, o = v.value;
216
+ let c = null;
217
+ if (e.key === "ArrowRight") c = Math.min(l, (o ?? -1) + 1);
218
+ else if (e.key === "ArrowLeft") c = Math.max(0, (o ?? l + 1) - 1);
219
+ else if (e.key === "ArrowDown") c = Math.min(l, (o ?? -7) + 7);
220
+ else if (e.key === "ArrowUp") c = Math.max(0, (o ?? 7) - 7);
221
+ else if (e.key === "Home") {
222
+ const h = o ?? 0, f = m.value[h];
223
+ c = f ? Math.max(0, h - f.rowIndex) : 0;
224
+ } else if (e.key === "End") {
225
+ const h = o ?? l, f = m.value[h];
226
+ c = f ? Math.min(l, h + (6 - f.rowIndex)) : l;
227
+ } else if (e.key === "Escape") {
228
+ N();
229
+ return;
230
+ }
231
+ c !== null && (e.preventDefault(), T(c, !0));
232
+ }, r = () => {
233
+ v.value === null && T(0, !0);
234
+ }, y = a(() => x.value && v.value !== null ? `${E}-${v.value}` : void 0), u = a(() => t.ariaLabel ?? g("heatmap.gridLabel")), I = a(() => {
235
+ const e = M.value;
236
+ return !x.value || !e ? "" : $(e);
237
+ }), J = (e, l) => {
238
+ D("cellClick", e, l);
239
+ }, Q = ce(H), X = a(() => ({
240
+ "--x-heatmap-cell-size": `${d.value}px`,
241
+ gridTemplateRows: `repeat(7, ${d.value}px)`
198
242
  }));
199
243
  return {
200
- t: v,
201
- className: h,
202
- mergedSize: x,
203
- cells: p,
204
- rows: R,
244
+ t: g,
245
+ className: C,
246
+ mergedSize: A,
247
+ cells: m,
248
+ rows: F,
205
249
  range: i,
206
- gridStyle: s,
207
- weekdayLabels: N,
208
- monthLabels: L,
209
- activeCell: S,
210
- tooltipEnabled: g,
211
- tooltipStyle: Y,
212
- cellColor: r,
213
- cellLabel: w,
214
- handleCellClick: o,
215
- throttledMove: u,
216
- clearActive: B,
217
- isInRange: (t) => i.value ? ee(t, i.value.requestedStart, i.value.requestedEnd) : !0,
218
- colorPalette: k,
219
- slots: I
250
+ gridStyle: X,
251
+ weekdayLabels: V,
252
+ monthLabels: _,
253
+ activeCell: M,
254
+ tooltipEnabled: L,
255
+ tooltipStyle: B,
256
+ cellColor: j,
257
+ cellLabel: $,
258
+ handleCellClick: J,
259
+ throttledMove: Q,
260
+ clearActive: N,
261
+ handleKeydown: W,
262
+ handleGridFocus: r,
263
+ activeDescendant: y,
264
+ gridLabel: u,
265
+ cellIdPrefix: E,
266
+ liveText: I,
267
+ isInRange: (e) => i.value ? xe(e, i.value.requestedStart, i.value.requestedEnd) : !0,
268
+ colorPalette: R,
269
+ slots: S,
270
+ refs: s,
271
+ setTooltipElement: (e) => {
272
+ b.value = e;
273
+ }
220
274
  };
221
275
  },
222
276
  render() {
223
277
  const {
224
- className: e,
225
- mergedSize: b,
226
- cells: I,
227
- rows: v,
228
- range: O,
229
- gridStyle: h,
230
- weekdayLabels: x,
231
- monthLabels: c,
278
+ className: t,
279
+ mergedSize: D,
280
+ cells: S,
281
+ rows: g,
282
+ range: z,
283
+ gridStyle: C,
284
+ weekdayLabels: E,
285
+ monthLabels: A,
232
286
  activeCell: d,
233
- tooltipEnabled: C,
234
- tooltipStyle: k,
235
- cellColor: i,
236
- cellLabel: y,
237
- handleCellClick: E,
238
- throttledMove: p,
239
- clearActive: R,
240
- isInRange: N,
241
- colorPalette: L,
242
- slots: r,
243
- t: w
287
+ tooltipEnabled: p,
288
+ tooltipStyle: O,
289
+ cellColor: R,
290
+ cellLabel: i,
291
+ handleCellClick: P,
292
+ throttledMove: q,
293
+ clearActive: m,
294
+ handleKeydown: F,
295
+ handleGridFocus: V,
296
+ activeDescendant: _,
297
+ gridLabel: j,
298
+ cellIdPrefix: $,
299
+ liveText: v,
300
+ isInRange: L,
301
+ colorPalette: b,
302
+ slots: s,
303
+ refs: w,
304
+ setTooltipElement: M,
305
+ t: k
244
306
  } = this;
245
- if (!O) return null;
246
- const f = _(this.loading) ? this.loading : {
307
+ if (!z) return null;
308
+ const G = ue(this.loading) ? this.loading : {
247
309
  loading: this.loading,
248
310
  dot: "color"
249
- }, g = C && d !== null, S = () => l("div", {
250
- class: e.element("grid"),
311
+ }, B = p && d !== null, H = () => n("div", {
312
+ class: t.element("grid"),
251
313
  style: {
252
- ...h,
314
+ ...C,
253
315
  "--x-heatmap-cell-gap": "var(--x-spacing-1)"
254
316
  },
255
- onMousemove: p,
256
- onMouseleave: R
257
- }, [v.map((o, u) => o.map((s) => l("div", {
258
- key: s.timestamp,
259
- class: [e.element("cell"), e.modifier(`level-${s.level}`), {
260
- [e.is("out-of-range")]: !N(s)
317
+ role: p ? "grid" : void 0,
318
+ tabindex: p ? 0 : void 0,
319
+ "aria-activedescendant": _,
320
+ "aria-label": p ? j : void 0,
321
+ onMousemove: q,
322
+ onMouseleave: m,
323
+ onFocus: V,
324
+ onBlur: m,
325
+ onKeydown: F
326
+ }, [g.map((r, y) => r.map((u) => n("div", {
327
+ key: u.timestamp,
328
+ id: `${$}-${S.indexOf(u)}`,
329
+ class: [t.element("cell"), t.modifier(`level-${u.level}`), {
330
+ [t.is("out-of-range")]: !L(u)
261
331
  }],
262
332
  style: {
263
- backgroundColor: i(s)
333
+ backgroundColor: R(u)
264
334
  },
265
- "data-index": I.indexOf(s),
266
- title: g ? void 0 : y(s),
267
- onClick: (M) => E(s, M),
335
+ "data-index": S.indexOf(u),
336
+ title: B ? void 0 : i(u),
337
+ onClick: (I) => P(u, I),
268
338
  role: "gridcell",
269
- "aria-label": y(s)
270
- }, [])))]), Y = () => {
271
- if (!g || !d) return null;
272
- const o = {
339
+ "aria-label": i(u)
340
+ }, []))), N()]), N = () => {
341
+ if (!B || !d) return null;
342
+ const r = {
273
343
  ...d,
274
- label: y(d)
344
+ label: i(d)
275
345
  };
276
- return l("div", {
277
- class: [e.element("tooltip"), e.is("visible")],
278
- style: k,
346
+ return n("div", {
347
+ ref: M,
348
+ class: [t.element("tooltip"), t.is("visible")],
349
+ style: O,
279
350
  role: "tooltip"
280
- }, [r.tooltip ? r.tooltip(o) : o.label]);
281
- }, z = () => {
282
- var o, u;
283
- return this.showColorIndicator ? l("div", {
284
- class: e.element("indicator")
285
- }, [r.indicator ? r.indicator({
286
- colors: L
287
- }) : l(j, null, [l("span", {
288
- class: e.element("indicator-leading")
289
- }, [((o = r["indicator-leading-text"]) == null ? void 0 : o.call(r)) ?? w("heatmap.less")]), L.map((s, M) => l("span", {
290
- key: M,
291
- class: e.element("indicator-swatch"),
351
+ }, [s.tooltip ? s.tooltip(r) : r.label]);
352
+ }, x = () => {
353
+ var r, y;
354
+ return this.showColorIndicator ? n("div", {
355
+ class: t.element("indicator")
356
+ }, [s.indicator ? s.indicator({
357
+ colors: b
358
+ }) : n(oe, null, [n("span", {
359
+ class: t.element("indicator-leading")
360
+ }, [((r = s["indicator-leading-text"]) == null ? void 0 : r.call(s)) ?? k("heatmap.less")]), b.map((u, I) => n("span", {
361
+ key: I,
362
+ class: t.element("indicator-swatch"),
292
363
  style: {
293
- backgroundColor: s
364
+ backgroundColor: u
294
365
  }
295
- }, null)), l("span", {
296
- class: e.element("indicator-trailing")
297
- }, [((u = r["indicator-trailing-text"]) == null ? void 0 : u.call(r)) ?? w("heatmap.more")])])]) : null;
298
- }, B = () => l("div", {
299
- class: e.element("body")
300
- }, [this.showWeekLabels && l("div", {
301
- class: e.element("week-labels"),
302
- style: h
303
- }, [x.map((o, u) => l("span", {
304
- key: u,
305
- class: e.element("week-label"),
366
+ }, null)), n("span", {
367
+ class: t.element("indicator-trailing")
368
+ }, [((y = s["indicator-trailing-text"]) == null ? void 0 : y.call(s)) ?? k("heatmap.more")])])]) : null;
369
+ }, T = () => n("div", {
370
+ class: t.element("body")
371
+ }, [this.showWeekLabels && n("div", {
372
+ class: t.element("week-labels"),
373
+ style: C
374
+ }, [E.map((r, y) => n("span", {
375
+ key: y,
376
+ class: t.element("week-label"),
306
377
  style: {
307
- visibility: u % 2 === 1 ? "visible" : "hidden"
378
+ visibility: y % 2 === 1 ? "visible" : "hidden"
308
379
  }
309
- }, [o]))]), l("div", {
310
- class: e.element("grid-wrapper")
311
- }, [this.showMonthLabels && l("div", {
312
- class: e.element("month-labels"),
313
- style: h
314
- }, [c.map((o) => l("span", {
315
- key: o.text,
316
- class: e.element("month-label"),
380
+ }, [r]))]), n("div", {
381
+ class: t.element("grid-wrapper")
382
+ }, [this.showMonthLabels && n("div", {
383
+ class: t.element("month-labels"),
384
+ style: C
385
+ }, [A.map((r) => n("span", {
386
+ key: r.text,
387
+ class: t.element("month-label"),
317
388
  style: {
318
- gridColumn: o.colIndex + 1
389
+ gridColumn: r.colIndex + 1
319
390
  }
320
- }, [o.text]))]), S()]), Y()]);
321
- return l("div", {
322
- class: [e.block, e.modifier(`size-${b}`)],
323
- role: this.ariaLabel ? "img" : void 0,
324
- "aria-label": this.ariaLabel
325
- }, [l(H, f, {
326
- default: () => [B(), z(), r.footer && l("div", {
327
- class: e.element("footer")
328
- }, [r.footer()])]
329
- })]);
391
+ }, [r.text]))]), H()])]), W = p;
392
+ return n("div", {
393
+ class: [t.block, t.modifier(`size-${D}`)]
394
+ }, [n("div", {
395
+ role: !W && this.ariaLabel ? "img" : void 0,
396
+ "aria-label": W ? void 0 : this.ariaLabel
397
+ }, [n(de, G, {
398
+ default: () => [T(), x(), s.footer && n("div", {
399
+ class: t.element("footer")
400
+ }, [s.footer()])]
401
+ })]), n("span", {
402
+ class: t.element("live"),
403
+ "aria-live": "polite"
404
+ }, [v])]);
330
405
  }
331
406
  });
332
407
  export {
333
- ue as default
408
+ Ae as default
334
409
  };
@@ -1,91 +1,101 @@
1
1
  import C from "./Image.vue2.js";
2
- import { resolveComponent as m, openBlock as n, createElementBlock as t, normalizeStyle as N, normalizeClass as o, createElementVNode as r, mergeProps as d, renderSlot as i, createVNode as p, toDisplayString as w, createCommentVNode as l, createBlock as g, createSlots as L, withCtx as v } from "vue";
2
+ import { resolveComponent as m, openBlock as i, createElementBlock as d, normalizeStyle as p, normalizeClass as o, mergeProps as t, renderSlot as l, createElementVNode as a, createVNode as g, toDisplayString as v, createCommentVNode as n, createBlock as y, createSlots as w, withCtx as P } from "vue";
3
3
  import u from "../../_virtual/_plugin-vue_export-helper.js";
4
- const $ = ["title", "alt"];
5
- function c(e, s, P, S, b, E) {
6
- const y = m("IconImageClose"), I = m("IconLoading"), f = m("ImageFooter"), k = m("ImagePreview");
7
- return n(), t("div", {
4
+ const N = ["title", "src", "alt", "role", "tabindex", "aria-label", "aria-haspopup"];
5
+ function L(e, r, $, S, E, V) {
6
+ const I = m("IconImageClose"), b = m("IconLoading"), f = m("ImageFooter"), k = m("ImagePreview");
7
+ return i(), d("div", {
8
8
  class: o(e.wrapperClassNames),
9
- style: N(e.wrapperStyles)
9
+ style: p(e.wrapperStyles)
10
10
  }, [
11
- r("img", d({
11
+ (i(), d("img", t({
12
12
  ref: "refImg",
13
+ key: e.src,
13
14
  class: e.className.element("img")
14
15
  }, e.imgProps, {
15
16
  style: { ...e.imgStyle, ...e.fitStyle },
16
17
  title: e.title,
17
- alt: e.alt,
18
- onLoad: s[0] || (s[0] = (...a) => e.onImgLoaded && e.onImgLoaded(...a)),
19
- onError: s[1] || (s[1] = (...a) => e.onImgLoadError && e.onImgLoadError(...a)),
20
- onClick: s[2] || (s[2] = (...a) => e.onImgClick && e.onImgClick(...a))
21
- }), null, 16, $),
22
- e.isLoaded ? l("", !0) : (n(), t("div", {
18
+ src: e.src || void 0,
19
+ alt: e.alt ?? e.description,
20
+ role: e.canOpenPreview ? "button" : e.imgProps.role,
21
+ tabindex: e.canOpenPreview ? e.imgProps.tabindex ?? 0 : e.imgProps.tabindex,
22
+ "aria-label": e.canOpenPreview ? e.imgProps["aria-label"] || e.alt || e.description || e.title || e.t("imagePreview.openLabel") : e.imgProps["aria-label"],
23
+ "aria-haspopup": e.canOpenPreview ? "dialog" : void 0,
24
+ onLoad: r[0] || (r[0] = (...s) => e.onImgLoaded && e.onImgLoaded(...s)),
25
+ onError: r[1] || (r[1] = (...s) => e.onImgLoadError && e.onImgLoadError(...s)),
26
+ onClick: r[2] || (r[2] = (...s) => e.onImgClick && e.onImgClick(...s)),
27
+ onKeydown: r[3] || (r[3] = (...s) => e.onImgKeydown && e.onImgKeydown(...s))
28
+ }), null, 16, N)),
29
+ e.isLoaded ? n("", !0) : (i(), d("div", {
23
30
  key: 0,
24
- class: o(e.className.element("overlay"))
31
+ class: o(e.className.element("overlay")),
32
+ style: p(e.overlayStyles)
25
33
  }, [
26
- e.isError ? i(e.$slots, "error", { key: 0 }, () => [
27
- r("div", {
34
+ e.isError ? l(e.$slots, "error", { key: 0 }, () => [
35
+ a("div", {
28
36
  class: o(e.className.element("error"))
29
37
  }, [
30
- r("div", {
38
+ a("div", {
31
39
  class: o(e.className.element("error-icon"))
32
40
  }, [
33
- i(e.$slots, "error-icon", {}, () => [
34
- p(y)
41
+ l(e.$slots, "error-icon", {}, () => [
42
+ g(I)
35
43
  ])
36
44
  ], 2),
37
- e.alt || e.description ? (n(), t("div", {
38
- key: 0,
45
+ a("div", {
39
46
  class: o(e.className.element("error-alt"))
40
- }, w(e.alt || e.description), 3)) : l("", !0)
47
+ }, v(e.alt || e.description || e.t("imagePreview.loadError")), 3)
41
48
  ], 2)
42
- ]) : l("", !0),
43
- e.isLoading && (e.showLoader || e.$slots.loader) ? i(e.$slots, "loader", { key: 1 }, () => [
44
- r("div", {
49
+ ]) : n("", !0),
50
+ e.isLoading && (e.showLoader || e.$slots.loader) ? l(e.$slots, "loader", { key: 1 }, () => [
51
+ a("div", {
45
52
  class: o([e.className.element("loader")])
46
53
  }, [
47
- r("div", {
54
+ a("div", {
48
55
  class: o(e.className.element("loader-spin"))
49
56
  }, [
50
- p(I),
51
- r("div", {
57
+ g(b),
58
+ a("div", {
52
59
  class: o(e.className.element("loader-spin-text"))
53
- }, " Loading ", 2)
60
+ }, v(e.t("imagePreview.loading")), 3)
54
61
  ], 2)
55
62
  ], 2)
56
- ]) : l("", !0)
57
- ], 2)),
58
- e.showFooter ? (n(), g(f, {
63
+ ]) : n("", !0)
64
+ ], 6)),
65
+ e.showFooter ? (i(), y(f, {
59
66
  key: 1,
60
67
  class: o(e.footerClass),
61
68
  "prefix-cls": e.className.block,
62
69
  title: e.title,
63
70
  description: e.description
64
- }, L({ _: 2 }, [
71
+ }, w({ _: 2 }, [
65
72
  e.$slots.extra ? {
66
73
  name: "extra",
67
- fn: v(() => [
68
- i(e.$slots, "extra")
74
+ fn: P(() => [
75
+ l(e.$slots, "extra")
69
76
  ]),
70
77
  key: "0"
71
78
  } : void 0
72
- ]), 1032, ["class", "prefix-cls", "title", "description"])) : l("", !0),
73
- e.isLoaded && e.mergePreview ? (n(), g(k, d({
79
+ ]), 1032, ["class", "prefix-cls", "title", "description"])) : n("", !0),
80
+ e.mergePreview && (e.isLoaded || e.mergedPreviewVisible) ? (i(), y(k, t({
74
81
  key: 2,
75
82
  src: e.src
76
83
  }, e.previewProps, {
77
84
  visible: e.mergedPreviewVisible,
78
85
  "render-to-body": e.renderToBody,
79
86
  onClose: e.onPreviewClose
80
- }), {
81
- actions: v(() => [
82
- i(e.$slots, "preview-actions")
83
- ]),
84
- _: 3
85
- }, 16, ["src", "visible", "render-to-body", "onClose"])) : l("", !0)
87
+ }), w({ _: 2 }, [
88
+ e.$slots["preview-actions"] ? {
89
+ name: "actions",
90
+ fn: P(() => [
91
+ l(e.$slots, "preview-actions")
92
+ ]),
93
+ key: "0"
94
+ } : void 0
95
+ ]), 1040, ["src", "visible", "render-to-body", "onClose"])) : n("", !0)
86
96
  ], 6);
87
97
  }
88
- const z = /* @__PURE__ */ u(C, [["render", c]]);
98
+ const K = /* @__PURE__ */ u(C, [["render", L]]);
89
99
  export {
90
- z as default
100
+ K as default
91
101
  };