@ironsource/shared-ui 2.1.7-rc.4 → 2.1.7-rc.5

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 (40) hide show
  1. package/Chart.vue_vue_type_style_index_0_scoped_f06a4764_lang.css +1 -0
  2. package/ChartHeader.vue_vue_type_style_index_0_scoped_88d4532f_lang.css +1 -0
  3. package/ChartLegend.vue_vue_type_style_index_0_scoped_efc608f9_lang.css +1 -0
  4. package/ChartLoader.vue_vue_type_style_index_0_scoped_142c444a_lang.css +1 -0
  5. package/ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css +1 -0
  6. package/SortableItem.vue_vue_type_style_index_0_scoped_9dd4d372_lang.css +1 -0
  7. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_1386ae20_lang.css +1 -0
  8. package/SortableList.vue_vue_type_style_index_0_scoped_21842d59_lang.css +1 -0
  9. package/components/chart/Chart.vue.js +7 -0
  10. package/components/chart/Chart.vue2.js +281 -0
  11. package/components/chart/ChartHeader.vue.js +7 -0
  12. package/components/chart/ChartHeader.vue2.js +51 -0
  13. package/components/chart/ChartLegend.vue.js +7 -0
  14. package/components/chart/ChartLegend.vue2.js +65 -0
  15. package/components/chart/ChartLoader.vue.js +25 -0
  16. package/components/chart/ChartLoader.vue2.js +0 -0
  17. package/components/chart/ChartTooltip.vue.js +7 -0
  18. package/components/chart/ChartTooltip.vue2.js +81 -0
  19. package/components/chart/composables/useChartValues.js +32 -0
  20. package/components/chart/composables/useTooltipPosition.js +22 -0
  21. package/components/chart/consts.js +21 -0
  22. package/components/chart/index.js +6 -0
  23. package/components/chart/plugins/HoverVerticalLine.js +12 -0
  24. package/components/chart/types.js +4 -0
  25. package/components/chart/utils/formatNumber.js +11 -0
  26. package/components/chart/utils/utils.js +12 -0
  27. package/components/sortableList/SortableItem.vue.js +7 -0
  28. package/components/sortableList/SortableItem.vue2.js +140 -0
  29. package/components/sortableList/SortableItemLabel.vue.js +7 -0
  30. package/components/sortableList/SortableItemLabel.vue2.js +60 -0
  31. package/components/sortableList/SortableList.vue.js +7 -0
  32. package/components/sortableList/SortableList.vue2.js +120 -0
  33. package/components/sortableList/composables/useHoverEffect.js +19 -0
  34. package/components/sortableList/consts.js +4 -0
  35. package/components/sortableList/index.js +6 -0
  36. package/index.d.ts +593 -0
  37. package/index.js +131 -126
  38. package/package.json +9 -1
  39. package/testids/index.js +5 -4
  40. package/utils/search.js +4 -0
@@ -0,0 +1 @@
1
+ .chart-container[data-v-f06a4764]{border:1px solid var(--common-divider);background:var(--background-paper);display:flex;height:388px}.header-wrapper[data-v-f06a4764]{height:76px}.chart-content[data-v-f06a4764]{flex:1}.chart-sidebar[data-v-f06a4764]{border-left:1px solid var(--common-divider)}.chart[data-v-f06a4764]{width:100%;height:312px;position:relative}.chart__canvas[data-v-f06a4764]{width:100%;height:100%}.chart__tooltip[data-v-f06a4764]{position:absolute;pointer-events:none;transition:all .1s ease;min-width:214px;max-width:270px}
@@ -0,0 +1 @@
1
+ .chart-header[data-v-88d4532f]{display:flex;align-items:center;justify-content:space-between;padding:24px 24px 0}.header-texts[data-v-88d4532f]{display:flex;flex-direction:column;color:var(--text-primary);gap:4px}.type-switch[data-v-88d4532f]{display:flex;align-items:center;gap:4px}
@@ -0,0 +1 @@
1
+ .chart-legend[data-v-efc608f9]{display:flex;flex-direction:column;width:220px;height:100%;padding-bottom:8px}.search-box[data-v-efc608f9]{padding:12px 12px 4px}.legend[data-v-efc608f9]{overflow-y:auto;color:var(--text-primary)}.legend__list[data-v-efc608f9]{list-style:none;padding:0 12px 0 20px}.legend__list>li[data-v-efc608f9]{display:flex;align-items:center;gap:8px;height:32px}
@@ -0,0 +1 @@
1
+ .label[data-v-142c444a]{color:#41454d}.chart-loader[data-v-142c444a]{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:80px 31px 31px}.chart-loader[data-v-142c444a]:after{position:absolute;inset:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0));animation:shimmer-142c444a 2s infinite;content:""}@keyframes shimmer-142c444a{to{transform:translate(100%)}}
@@ -0,0 +1 @@
1
+ .chart-tooltip[data-v-ec636f18]{color:var(--text-primary);background:var(--common-white);box-shadow:0 4px 8px -2px #1018281f;border:1px solid var(--common-divider-elevation-0);border-radius:var(--border-radius-md);padding:calc(var(--spacing-100) - 1px)}.tooltip-title[data-v-ec636f18]{color:var(--text-primary);margin-bottom:var(--spacing-100)}.color-box[data-v-ec636f18]{width:var(--spacing-150);height:var(--spacing-150);border-radius:2px;display:inline-block;margin-right:var(--spacing-100)}.list[data-v-ec636f18]{list-style:none;margin:0;padding:0}.list__item[data-v-ec636f18]{display:flex;align-items:center;margin-bottom:var(--spacing-50);color:var(--text-secondary)}.list__item[data-v-ec636f18]:last-child{margin-bottom:0}.tooltip-footer[data-v-ec636f18]{display:flex;align-items:center;margin-top:var(--spacing-100);color:var(--text-primary)}.flex-grow[data-v-ec636f18]{flex-grow:1}
@@ -0,0 +1 @@
1
+ .sortable-item[data-v-9dd4d372]{display:flex;position:relative;flex-direction:column;border:1px solid var(--common-divider);border-radius:var(--border-radius-sm);background:var(--background-paper)}.sortable-item--selected[data-v-9dd4d372]{outline:2px solid var(--primary-main);outline-offset:-2px}.sortable-item--hovered[data-v-9dd4d372]{border-color:var(--action-active)}.sortable-item.sortable-drag[data-v-9dd4d372]{border-color:var(--common-divider)!important}.sortable-item.sortable-drag .child-list[data-v-9dd4d372]{display:none}.sortable-item--hovered .drag-allowed .draggable-handle[data-v-9dd4d372],.sortable-item.sortable-drag .drag-allowed .draggable-handle[data-v-9dd4d372]{display:flex}.sortable-item--hovered .drag-allowed .order-num[data-v-9dd4d372],.sortable-item.sortable-drag .drag-allowed .order-num[data-v-9dd4d372]{display:none}.item[data-v-9dd4d372]{height:38px;display:flex;align-items:center}.item__prefix[data-v-9dd4d372]{width:36px;display:flex;align-items:center;justify-content:center}.item__text[data-v-9dd4d372]{flex:1;height:38px;display:flex;align-items:center}.item__menu[data-v-9dd4d372]{width:26px}.country-flag[data-v-9dd4d372]{margin-right:var(--spacing-100)}.child-list[data-v-9dd4d372]{max-height:176px}.child-list ul[data-v-9dd4d372]{list-style:none;display:flex;flex-direction:column;padding-left:16px;padding-right:8px;margin-bottom:4px;gap:2px}.child-list li[data-v-9dd4d372]{min-height:32px;display:flex;align-items:center;border-radius:var(--border-radius-lg);padding:0 8px}.child-list li[data-v-9dd4d372]:hover{cursor:pointer;background:var(--action-selected)}.child-list li.selected[data-v-9dd4d372]{background:var(--action-selected)}.expand-icon[data-v-9dd4d372]{cursor:pointer;padding-right:7px;padding-left:1px;height:38px;display:flex;justify-content:center;align-items:center;color:var(--action-active)}.expand-icon[data-v-9dd4d372]:hover{color:var(--text-primary)}.locked-icon[data-v-9dd4d372]{color:var(--action-active)}.draggable-handle[data-v-9dd4d372]{display:none;align-items:center;justify-content:center;position:absolute;left:0;top:0;width:36px;height:38px;color:var(--action-active)}.draggable-handle[data-v-9dd4d372]:hover{cursor:grab;color:var(--text-primary)}.sortable-ghost[data-v-9dd4d372]{position:relative;outline:none}.sortable-ghost[data-v-9dd4d372]:after{content:"";display:block;position:absolute;z-index:10;inset:-1px;background:rgb(242,242,242);border-radius:var(--border-radius-sm)}
@@ -0,0 +1 @@
1
+ .decorated-text[data-v-1386ae20]{border-bottom:1px dashed var(--action-active)}.tooltip-content[data-v-1386ae20]{max-width:260px}.help[data-v-1386ae20]{margin-bottom:8px}.help__title[data-v-1386ae20]{margin-bottom:4px}.help__text[data-v-1386ae20]{color:var(--text-secondary)}.help[data-v-1386ae20]:last-child{margin-bottom:0}
@@ -0,0 +1 @@
1
+ .list-search[data-v-21842d59]{margin-bottom:var(--spacing-100)}.sortable-list[data-v-21842d59],.locked-list[data-v-21842d59]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--spacing-75);color:var(--text-primary)}.locked-list[data-v-21842d59]{margin-top:var(--spacing-75)}.force-grabbing-cursor *[data-v-21842d59]{cursor:move!important;cursor:-webkit-grabbing!important;cursor:-moz-grabbing!important;cursor:grabbing!important}
@@ -0,0 +1,7 @@
1
+ import o from "./Chart.vue2.js";
2
+ /* empty css */import _ from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../Chart.vue_vue_type_style_index_0_scoped_f06a4764_lang.css"; //*');
4
+ const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-f06a4764"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,281 @@
1
+ import "../../Chart.vue_vue_type_style_index_0_scoped_f06a4764_lang.css"; import { defineComponent as W, ref as y, computed as r, onMounted as Z, watch as b, nextTick as $, openBlock as d, createElementBlock as C, unref as c, Fragment as G, createElementVNode as u, createVNode as V, isRef as X, normalizeStyle as j, createBlock as g, createCommentVNode as T } from "vue";
2
+ import { useVModel as q } from "@vueuse/core";
3
+ import { Chart as O, ArcElement as J, LineElement as Q, BarElement as Y, PointElement as ee, LineController as te, BarController as ae, PieController as oe, ScatterController as re, CategoryScale as ie, LinearScale as le, Filler as ne, Tooltip as se } from "chart.js";
4
+ import { HoverVerticalLine as de } from "./plugins/HoverVerticalLine.js";
5
+ import { formatValue as D, calcStepSize as ce } from "./utils/utils.js";
6
+ import { DEFAULT_TICK_COUNT as ue, DEFAULT_MIN_VISIBLE as pe, DEFAULT_MAX_VISIBLE as fe, COLOR_PALETTE as me, POINT_BORDER_COLOR as he, TICK_LABEL_COLOR as F, TICK_LABEL_FONT as _, GRID_LINE_COLOR as w } from "./consts.js";
7
+ import { ChartType as n } from "./types.js";
8
+ import { useTooltipPosition as ve } from "./composables/useTooltipPosition.js";
9
+ import ye from "./ChartTooltip.vue.js";
10
+ import be from "./ChartLegend.vue.js";
11
+ import Ce from "./ChartHeader.vue.js";
12
+ import { hexColorToRgba as ge } from "../../utils/color.js";
13
+ import { useChartValues as Te } from "./composables/useChartValues.js";
14
+ import ke from "./ChartLoader.vue.js";
15
+ import Le from "../emptyState/v4/EmptyStateV4.vue.js";
16
+ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = { class: "header-wrapper" }, Be = { class: "chart" }, Ae = {
17
+ key: 0,
18
+ class: "chart-sidebar"
19
+ }, We = /* @__PURE__ */ W({
20
+ __name: "Chart",
21
+ props: {
22
+ dataSets: { default: () => [] },
23
+ visibleIds: { default: () => [] },
24
+ chartType: { default: n.Line },
25
+ parsing: { default: void 0 },
26
+ xAxisFormat: { default: "string" },
27
+ yAxisFormat: { default: "number" },
28
+ tickCount: { default: ue },
29
+ header: { default: "" },
30
+ subheader: { default: "" },
31
+ hideLegend: { type: Boolean, default: !1 },
32
+ minVisible: { default: pe },
33
+ maxVisible: { default: fe },
34
+ loading: { type: Boolean, default: !1 },
35
+ noDataIcon: { default: "file-x" },
36
+ noDataTitle: { default: "No data to display" },
37
+ noDataSubtitle: { default: "Search again with different filters" }
38
+ },
39
+ emits: ["update:chartType", "update:visibleIds"],
40
+ setup(a, { emit: k }) {
41
+ const e = a;
42
+ O.register(
43
+ J,
44
+ Q,
45
+ Y,
46
+ ee,
47
+ te,
48
+ ae,
49
+ oe,
50
+ re,
51
+ ie,
52
+ le,
53
+ ne,
54
+ se,
55
+ de
56
+ );
57
+ const m = q(e, "chartType", k), p = y(null);
58
+ let s = null;
59
+ const L = r(() => e.dataSets.length === 0), x = r(() => !e.loading && !L.value), h = () => {
60
+ p.value && (s && s.destroy(), s = new O(p.value, I.value));
61
+ }, N = () => {
62
+ s && (s.data.datasets = v.value, s.options = I.value.options, s.update());
63
+ };
64
+ Z(h), b(() => e.chartType, h), b(x, async (t) => {
65
+ t && (await $(), h());
66
+ }), b([() => e.visibleIds, () => e.dataSets], N);
67
+ const f = r(
68
+ () => e.chartType === n.StackedLine || e.chartType === n.StackedBar
69
+ ), P = r(
70
+ () => e.chartType === n.Line || e.chartType === n.StackedLine
71
+ ), S = r(
72
+ () => e.dataSets.filter((t) => e.visibleIds.includes(t.id))
73
+ ), v = r(() => S.value.map((t, o) => {
74
+ const i = t.color || me[o] || "#000000";
75
+ return {
76
+ ...t,
77
+ fill: f.value ? "start" : void 0,
78
+ backgroundColor: ge(
79
+ i,
80
+ e.chartType === n.StackedLine ? 10 : 70
81
+ ),
82
+ borderColor: i,
83
+ pointBackgroundColor: i,
84
+ pointHoverBorderColor: i,
85
+ maxBarThickness: 50,
86
+ clip: 5
87
+ // draw a bit outside the chart area
88
+ };
89
+ })), I = r(
90
+ () => ({
91
+ type: e.chartType == n.Bar || e.chartType === n.StackedBar ? "bar" : "line",
92
+ // Chart Data
93
+ data: {
94
+ datasets: v.value
95
+ },
96
+ // Chart Options
97
+ options: {
98
+ parsing: e.parsing,
99
+ interaction: {
100
+ intersect: !1,
101
+ mode: "index",
102
+ axis: "x"
103
+ },
104
+ // plugins
105
+ plugins: {
106
+ legend: { display: !1 },
107
+ title: { display: !1 },
108
+ hoverVerticalLine: P.value,
109
+ // tooltip
110
+ tooltip: {
111
+ enabled: !1,
112
+ position: "average",
113
+ external: ({ tooltip: t }) => {
114
+ l.value = { ...t };
115
+ },
116
+ callbacks: {
117
+ footer: (t) => {
118
+ const o = t.reduce((i, K) => i + (K.parsed.y || 0), 0);
119
+ return ["Total", String(o)];
120
+ }
121
+ }
122
+ }
123
+ },
124
+ // chart layout
125
+ responsive: !0,
126
+ maintainAspectRatio: !1,
127
+ layout: {
128
+ padding: {
129
+ left: 18,
130
+ top: 18,
131
+ bottom: 13
132
+ }
133
+ },
134
+ // basic styles
135
+ elements: {
136
+ line: {
137
+ borderWidth: 2,
138
+ tension: 0.3
139
+ },
140
+ point: {
141
+ radius: 1,
142
+ hitRadius: 8,
143
+ borderWidth: 0,
144
+ hoverRadius: 4,
145
+ hoverBorderWidth: 2,
146
+ pointHoverBackgroundColor: he
147
+ },
148
+ bar: {
149
+ borderRadius: 4
150
+ }
151
+ },
152
+ scales: {
153
+ // Horizontal Axis (X)
154
+ x: {
155
+ beginAtZero: !0,
156
+ border: { display: !1 },
157
+ stacked: f.value,
158
+ // stack on top of each other
159
+ // ticks
160
+ ticks: {
161
+ color: F,
162
+ font: _,
163
+ padding: 4,
164
+ callback: function(t) {
165
+ return D(
166
+ this.getLabelForValue(t),
167
+ e.xAxisFormat
168
+ );
169
+ }
170
+ },
171
+ // grid lines
172
+ grid: {
173
+ color: w,
174
+ drawOnChartArea: !1,
175
+ drawTicks: !0,
176
+ drawBorder: !1,
177
+ tickLength: 7
178
+ }
179
+ },
180
+ // Vertical Axis (Y)
181
+ y: {
182
+ beginAtZero: !0,
183
+ border: { display: !1 },
184
+ // hide left borderline
185
+ stacked: f.value,
186
+ // stack on top of each other
187
+ // ticks
188
+ ticks: {
189
+ color: F,
190
+ font: _,
191
+ padding: 8,
192
+ stepSize: R.value,
193
+ min: E.value,
194
+ max: R.value * e.tickCount,
195
+ callback: (t) => D(t, e.yAxisFormat)
196
+ },
197
+ // grid lines
198
+ grid: {
199
+ color: w,
200
+ drawOnChartArea: !0,
201
+ drawTicks: !1
202
+ }
203
+ }
204
+ }
205
+ }
206
+ })
207
+ ), M = r(
208
+ () => v.value.reduce((t, o) => (t[o.id] = o.borderColor, t), {})
209
+ ), U = r(() => e.dataSets.map((t) => ({
210
+ id: t.id,
211
+ label: t.label,
212
+ color: M.value[t.id] || null
213
+ }))), B = y(null), l = y(null), { position: A } = ve(
214
+ p,
215
+ B,
216
+ l
217
+ ), z = r(() => ({
218
+ left: `${A.value.left}px`,
219
+ top: `${A.value.top}px`,
220
+ opacity: l.value?.opacity || 0
221
+ })), { minValue: E, maxValue: H } = Te({
222
+ parsingConfig: e.parsing,
223
+ dataSets: S,
224
+ isStacked: f
225
+ }), R = r(
226
+ () => ce(E.value, H.value, e.tickCount)
227
+ );
228
+ return (t, o) => (d(), C("div", xe, [
229
+ c(x) ? (d(), C(G, { key: 0 }, [
230
+ u("section", Se, [
231
+ u("div", Ie, [
232
+ V(Ce, {
233
+ "chart-type": c(m),
234
+ "onUpdate:chart-type": o[0] || (o[0] = (i) => X(m) ? m.value = i : null),
235
+ header: a.header,
236
+ subheader: a.subheader
237
+ }, null, 8, ["chart-type", "header", "subheader"])
238
+ ]),
239
+ u("div", Be, [
240
+ u("canvas", {
241
+ ref_key: "chartRef",
242
+ ref: p,
243
+ class: "chart__canvas"
244
+ }, null, 512),
245
+ u("div", {
246
+ ref_key: "tooltipRef",
247
+ ref: B,
248
+ class: "chart__tooltip",
249
+ style: j(c(z))
250
+ }, [
251
+ l.value ? (d(), g(ye, {
252
+ key: 0,
253
+ title: String(l.value.title),
254
+ "data-points": l.value.dataPoints,
255
+ "x-axis-format": a.xAxisFormat,
256
+ "y-axis-format": a.yAxisFormat,
257
+ "total-label": l.value.footer[0],
258
+ "total-value": Number(l.value.footer[1])
259
+ }, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : T("", !0)
260
+ ], 4)
261
+ ])
262
+ ]),
263
+ a.hideLegend ? T("", !0) : (d(), C("section", Ae, [
264
+ V(be, {
265
+ items: c(U),
266
+ "visible-ids": a.visibleIds,
267
+ "onUpdate:visibleIds": o[1] || (o[1] = (i) => k("update:visibleIds", i))
268
+ }, null, 8, ["items", "visible-ids"])
269
+ ]))
270
+ ], 64)) : a.loading ? (d(), g(ke, { key: 1 })) : c(L) ? (d(), g(c(Le), {
271
+ key: 2,
272
+ title: a.noDataTitle,
273
+ subtitle: a.noDataSubtitle,
274
+ "icon-name": a.noDataIcon
275
+ }, null, 8, ["title", "subtitle", "icon-name"])) : T("", !0)
276
+ ]));
277
+ }
278
+ });
279
+ export {
280
+ We as default
281
+ };
@@ -0,0 +1,7 @@
1
+ import e from "./ChartHeader.vue2.js";
2
+ /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../ChartHeader.vue_vue_type_style_index_0_scoped_88d4532f_lang.css"; //*');
4
+ const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-88d4532f"]]);
5
+ export {
6
+ s as default
7
+ };
@@ -0,0 +1,51 @@
1
+ import "../../ChartHeader.vue_vue_type_style_index_0_scoped_88d4532f_lang.css"; import { defineComponent as f, computed as y, openBlock as T, createElementBlock as V, createElementVNode as _, createVNode as n, unref as t, withCtx as c, createTextVNode as l, toDisplayString as p, isRef as v } from "vue";
2
+ import s from "../typography/v4/Typography.vue.js";
3
+ import x from "../switch/v4/SwitchV4.vue.js";
4
+ import { ChartType as a } from "./types.js";
5
+ const C = { class: "chart-header" }, b = { class: "header-texts" }, N = /* @__PURE__ */ f({
6
+ __name: "ChartHeader",
7
+ props: {
8
+ chartType: { default: a.Line },
9
+ header: { default: "" },
10
+ subheader: { default: "" }
11
+ },
12
+ emits: ["update:chartType"],
13
+ setup(r, { emit: u }) {
14
+ const h = r, d = [
15
+ { id: a.Line, icon: "chart-line-up" },
16
+ { id: a.Bar, icon: "chart-bar" },
17
+ { id: a.StackedLine, icon: "chart-line" }
18
+ ], o = y({
19
+ get() {
20
+ return d.find(({ id: e }) => e === h.chartType);
21
+ },
22
+ set(e) {
23
+ u("update:chartType", e.id);
24
+ }
25
+ });
26
+ return (e, i) => (T(), V("div", C, [
27
+ _("div", b, [
28
+ n(t(s), { variant: "chart2" }, {
29
+ default: c(() => [
30
+ l(p(r.header), 1)
31
+ ]),
32
+ _: 1
33
+ }),
34
+ n(t(s), { variant: "caption" }, {
35
+ default: c(() => [
36
+ l(p(r.subheader), 1)
37
+ ]),
38
+ _: 1
39
+ })
40
+ ]),
41
+ n(t(x), {
42
+ modelValue: t(o),
43
+ "onUpdate:modelValue": i[0] || (i[0] = (m) => v(o) ? o.value = m : null),
44
+ options: d
45
+ }, null, 8, ["modelValue"])
46
+ ]));
47
+ }
48
+ });
49
+ export {
50
+ N as default
51
+ };
@@ -0,0 +1,7 @@
1
+ import e from "./ChartLegend.vue2.js";
2
+ /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../ChartLegend.vue_vue_type_style_index_0_scoped_efc608f9_lang.css"; //*');
4
+ const c = /* @__PURE__ */ o(e, [["__scopeId", "data-v-efc608f9"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -0,0 +1,65 @@
1
+ import "../../ChartLegend.vue_vue_type_style_index_0_scoped_efc608f9_lang.css"; import { defineComponent as E, ref as T, computed as a, openBlock as d, createElementBlock as n, createElementVNode as c, createVNode as u, unref as l, mergeProps as m, Fragment as y, renderList as S, withCtx as U, createTextVNode as w, toDisplayString as B } from "vue";
2
+ import { useVirtualList as D } from "@vueuse/core";
3
+ import N from "../typography/v4/Typography.vue.js";
4
+ import A from "../checkbox/v4/CheckboxV4.vue.js";
5
+ import F from "../search/v4/SearchV4.vue.js";
6
+ import { DEFAULT_MIN_VISIBLE as H, DEFAULT_MAX_VISIBLE as M } from "./consts.js";
7
+ const P = { class: "chart-legend" }, R = { class: "search-box" }, K = /* @__PURE__ */ E({
8
+ __name: "ChartLegend",
9
+ props: {
10
+ items: { default: () => [] },
11
+ visibleIds: { default: () => [] },
12
+ minVisible: { default: H },
13
+ maxVisible: { default: M }
14
+ },
15
+ emits: ["update:visibleIds"],
16
+ setup(p, { emit: b }) {
17
+ const t = p, h = 32, o = T(""), f = a(() => {
18
+ const e = o.value.toLowerCase();
19
+ return t.items.filter(
20
+ (i) => i.label.toLowerCase().includes(e)
21
+ );
22
+ }), r = (e) => t.visibleIds.includes(e.id), v = a(
23
+ () => t.visibleIds.length >= t.maxVisible
24
+ ), I = a(
25
+ () => t.visibleIds.length <= t.minVisible
26
+ ), _ = (e) => I.value && r(e) || v.value && !r(e), V = (e, i) => {
27
+ b(
28
+ "update:visibleIds",
29
+ e ? [...t.visibleIds, i.id] : t.visibleIds.filter((s) => s !== i.id)
30
+ );
31
+ }, { list: L, containerProps: g, wrapperProps: k } = D(f, {
32
+ itemHeight: h,
33
+ overscan: 10
34
+ });
35
+ return (e, i) => (d(), n("div", P, [
36
+ c("div", R, [
37
+ u(l(F), {
38
+ modelValue: o.value,
39
+ "onUpdate:modelValue": i[0] || (i[0] = (s) => o.value = s)
40
+ }, null, 8, ["modelValue"])
41
+ ]),
42
+ c("div", m({ class: "legend" }, l(g)), [
43
+ c("ul", m({ class: "legend__list" }, l(k)), [
44
+ (d(!0), n(y, null, S(l(L), ({ data: s, index: C }) => (d(), n("li", { key: C }, [
45
+ u(l(A), {
46
+ color: s.color,
47
+ "is-checked": r(s),
48
+ disabled: _(s),
49
+ "onUpdate:isChecked": (x) => V(x, s)
50
+ }, null, 8, ["color", "is-checked", "disabled", "onUpdate:isChecked"]),
51
+ u(l(N), { variant: "body2" }, {
52
+ default: U(() => [
53
+ w(B(s.label), 1)
54
+ ]),
55
+ _: 2
56
+ }, 1024)
57
+ ]))), 128))
58
+ ], 16)
59
+ ], 16)
60
+ ]));
61
+ }
62
+ });
63
+ export {
64
+ K as default
65
+ };
@@ -0,0 +1,25 @@
1
+ import { openBlock as o, createElementBlock as c, pushScopeId as r, popScopeId as s, createElementVNode as t } from "vue";
2
+ /* empty css */import a from "../../_virtual/_plugin-vue_export-helper.js";
3
+ const d = {}, i = (e) => (r("data-v-142c444a"), e = e(), s(), e), n = { class: "chart-loader" }, p = /* @__PURE__ */ i(() => /* @__PURE__ */ t("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ viewBox: "0 0 1072 275",
6
+ preserveAspectRatio: "none",
7
+ width: "100%",
8
+ height: "100%",
9
+ fill: "none"
10
+ }, [
11
+ /* @__PURE__ */ t("path", {
12
+ d: "M499.744 87.7024L499 87.4816C399.137 70.0475 293 138.418 218 173.72C120 219.848 87 235.892 0 275L1072 275C979 -57.3526 836.258 -31.5829 732 59.404C648.885 131.939 570.549 108.704 499.744 87.7024Z",
13
+ fill: "black",
14
+ "fill-opacity": "0.05"
15
+ })
16
+ ], -1)), _ = [
17
+ p
18
+ ];
19
+ function l(e, h) {
20
+ return o(), c("div", n, _);
21
+ }
22
+ const w = /* @__PURE__ */ a(d, [["render", l], ["__scopeId", "data-v-142c444a"]]);
23
+ export {
24
+ w as default
25
+ };
File without changes
@@ -0,0 +1,7 @@
1
+ import o from "./ChartTooltip.vue2.js";
2
+ /* empty css */import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css"; //*');
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec636f18"]]);
5
+ export {
6
+ s as default
7
+ };
@@ -0,0 +1,81 @@
1
+ import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css"; import { defineComponent as y, computed as b, openBlock as a, createElementBlock as s, createElementVNode as u, createBlock as g, unref as e, withCtx as l, createTextVNode as o, toDisplayString as r, createCommentVNode as f, Fragment as h, renderList as k, normalizeStyle as v, createVNode as d } from "vue";
2
+ import i from "../typography/v4/Typography.vue.js";
3
+ import { formatValue as c } from "./utils/utils.js";
4
+ const F = { class: "chart-tooltip" }, V = { class: "tooltip-title" }, p = { class: "list" }, A = {
5
+ key: 0,
6
+ class: "tooltip-footer"
7
+ }, T = /* @__PURE__ */ y({
8
+ __name: "ChartTooltip",
9
+ props: {
10
+ title: { default: "" },
11
+ dataPoints: { default: () => [] },
12
+ xAxisFormat: { default: null },
13
+ yAxisFormat: { default: null },
14
+ totalLabel: { default: "Total" },
15
+ totalValue: { default: null }
16
+ },
17
+ setup(t) {
18
+ const m = t, x = b(() => m.xAxisFormat === "date" ? "dateLong" : m.xAxisFormat);
19
+ return (C, _) => (a(), s("div", F, [
20
+ u("div", V, [
21
+ t.title ? (a(), g(e(i), {
22
+ key: 0,
23
+ variant: "subtitle2"
24
+ }, {
25
+ default: l(() => [
26
+ o(r(e(c)(t.title, e(x))), 1)
27
+ ]),
28
+ _: 1
29
+ })) : f("", !0)
30
+ ]),
31
+ u("ul", p, [
32
+ (a(!0), s(h, null, k(t.dataPoints, (n) => (a(), s("li", {
33
+ key: n.datasetIndex,
34
+ class: "list__item"
35
+ }, [
36
+ u("span", {
37
+ class: "color-box",
38
+ style: v({
39
+ backgroundColor: String(n.dataset.pointBackgroundColor)
40
+ })
41
+ }, null, 4),
42
+ d(e(i), {
43
+ variant: "body2",
44
+ class: "flex-grow"
45
+ }, {
46
+ default: l(() => [
47
+ o(r(n.dataset.label), 1)
48
+ ]),
49
+ _: 2
50
+ }, 1024),
51
+ d(e(i), { variant: "body2" }, {
52
+ default: l(() => [
53
+ o(r(e(c)(n.parsed.y, t.yAxisFormat)), 1)
54
+ ]),
55
+ _: 2
56
+ }, 1024)
57
+ ]))), 128))
58
+ ]),
59
+ t.totalValue !== null ? (a(), s("div", A, [
60
+ d(e(i), {
61
+ variant: "body2",
62
+ class: "flex-grow"
63
+ }, {
64
+ default: l(() => [
65
+ o(r(t.totalLabel), 1)
66
+ ]),
67
+ _: 1
68
+ }),
69
+ d(e(i), { variant: "body2" }, {
70
+ default: l(() => [
71
+ o(r(e(c)(t.totalValue, t.yAxisFormat)), 1)
72
+ ]),
73
+ _: 1
74
+ })
75
+ ])) : f("", !0)
76
+ ]));
77
+ }
78
+ });
79
+ export {
80
+ T as default
81
+ };
@@ -0,0 +1,32 @@
1
+ import { computed as t } from "vue";
2
+ const V = ({
3
+ parsingConfig: s,
4
+ dataSets: m,
5
+ isStacked: v
6
+ }) => {
7
+ const l = (e) => e ? e[s?.yAxisKey] : null, r = (e) => e ? e[s?.xAxisKey] : null, o = t(
8
+ () => m.value.flatMap(
9
+ (e) => e.data.map(l)
10
+ )
11
+ ), p = t(() => m.value.reduce((e, n) => (n.data.forEach((a) => {
12
+ const u = String(r(a));
13
+ e[u] || (e[u] = []), e[u].push(l(a));
14
+ }), e), {})), x = t(() => Math.min(0, ...o.value.map(Number))), h = t(() => {
15
+ if (v.value) {
16
+ const e = Object.values(p.value).map(
17
+ (n) => n.reduce((a, u) => a + u, 0)
18
+ );
19
+ return Math.max(...e);
20
+ }
21
+ return Math.max(...o.value.map(Number));
22
+ });
23
+ return {
24
+ getXValue: r,
25
+ getYValue: l,
26
+ minValue: x,
27
+ maxValue: h
28
+ };
29
+ };
30
+ export {
31
+ V as useChartValues
32
+ };
@@ -0,0 +1,22 @@
1
+ import { computed as c } from "vue";
2
+ import { useElementSize as u } from "@vueuse/core";
3
+ const a = (o, s, n) => {
4
+ const t = u(s);
5
+ return {
6
+ position: c(() => {
7
+ if (!o.value || !n.value)
8
+ return { top: 0, left: 0 };
9
+ const i = o.value.getBoundingClientRect(), { caretX: F, caretY: e } = n.value, E = F + t.width.value + 20 >= i.width, _ = e + t.height.value + -20 >= i.height;
10
+ return {
11
+ left: F + (E ? -(t.width.value + 20) : 20),
12
+ top: e + (_ ? -1 * Math.min(
13
+ e - 8,
14
+ t.height.value + 8
15
+ ) : -20)
16
+ };
17
+ })
18
+ };
19
+ };
20
+ export {
21
+ a as useTooltipPosition
22
+ };
@@ -0,0 +1,21 @@
1
+ const E = "#fcfcfc", L = "#E4E4E4", _ = "#646464", C = {
2
+ size: 12,
3
+ weight: 400,
4
+ family: "Inter"
5
+ }, I = [
6
+ "#80BCFE",
7
+ "#9999FF",
8
+ "#5883E4",
9
+ "#80CBC4",
10
+ "#FFC670"
11
+ ], O = 4, c = 1, t = 5;
12
+ export {
13
+ I as COLOR_PALETTE,
14
+ t as DEFAULT_MAX_VISIBLE,
15
+ c as DEFAULT_MIN_VISIBLE,
16
+ O as DEFAULT_TICK_COUNT,
17
+ L as GRID_LINE_COLOR,
18
+ E as POINT_BORDER_COLOR,
19
+ _ as TICK_LABEL_COLOR,
20
+ C as TICK_LABEL_FONT
21
+ };
@@ -0,0 +1,6 @@
1
+ import r from "./Chart.vue.js";
2
+ const o = () => [r];
3
+ export {
4
+ r as Chart,
5
+ o as ChartTypes
6
+ };