@ironsource/shared-ui 2.1.12-test.49 → 2.1.12-test.52
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.
- package/Chart.vue_vue_type_style_index_0_scoped_e8f25a03_lang.css +1 -0
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +1 -6
- package/components/chart/Chart.vue.js +4 -4
- package/components/chart/Chart.vue2.js +16 -18
- package/components/chart/ChartStoryArgs.d.ts +0 -5
- package/components/chart/TooltipHeader.vue.js +2 -2
- package/components/chart/TooltipHeader.vue2.js +21 -20
- package/components/chart/colorPalette.d.ts +1 -2
- package/components/chart/colorPalette.js +33 -47
- package/components/chart/composables/useColorsMap.d.ts +1 -3
- package/components/chart/composables/useColorsMap.js +30 -32
- package/components/chart/index.d.ts +1 -20
- package/components/chart/types.d.ts +0 -1
- package/components/chart/utils/utils.js +14 -13
- package/components/dateRange/common/DateRange.common.js +60 -60
- package/package.json +1 -1
- package/utils/date.d.ts +1 -0
- package/utils/date.js +9 -0
- package/Chart.vue_vue_type_style_index_0_scoped_fa533a3d_lang.css +0 -1
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chart-container[data-v-e8f25a03]{border:1px solid var(--common-divider);background:var(--background-paper);display:flex;border-radius:0 0 6px 6px;width:100%}.chart-planes[data-v-e8f25a03]{width:100%;height:100%;overflow-y:auto}.chart-planes.with-legend[data-v-e8f25a03]{width:calc(100% - 221px)}.chart-planes .extra-chart-plane[data-v-e8f25a03]{border-top:1px solid var(--common-divider)}.chart-sidebar[data-v-e8f25a03]{border-left:1px solid var(--common-divider)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tooltip-title-wrapper[data-v-5160f12d]{display:flex;flex-direction:column;color:var(--text-primary);margin-bottom:var(--spacing-100)}.tooltip-title-wrapper .main-title[data-v-5160f12d]{display:flex;align-items:center;gap:.25rem}.tooltip-title-wrapper .title-text[data-v-5160f12d]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tooltip-title-wrapper .title-image[data-v-5160f12d]{width:20px;height:20px;border-radius:4px}.tooltip-title-wrapper .tooltip-sub-title[data-v-5160f12d]{color:var(--text-secondary)}.tooltip-title-wrapper .platform-icon[data-v-5160f12d]{color:var(--action-active)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartDataSet, ChartParsingConfig, ChartType,
|
|
1
|
+
import { ChartDataSet, ChartParsingConfig, ChartType, DateInterval, TooltipOrder, TrendDirection, ValueFormat } from './types';
|
|
2
2
|
import { TotalType } from '@/utils/totals';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
dataSets: ChartDataSet[];
|
|
@@ -48,7 +48,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
48
48
|
fullHeightBottomSpacing?: number;
|
|
49
49
|
withSettingsHeader?: boolean;
|
|
50
50
|
extraCharts?: Record<string, unknown>[];
|
|
51
|
-
colorVariant?: ColorVariant;
|
|
52
51
|
}>, {
|
|
53
52
|
chartType: ChartType;
|
|
54
53
|
dataSets: () => any[];
|
|
@@ -90,7 +89,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
90
89
|
fullHeightBottomSpacing: number;
|
|
91
90
|
withSettingsHeader: boolean;
|
|
92
91
|
extraCharts: () => any[];
|
|
93
|
-
colorVariant: string;
|
|
94
92
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
95
93
|
"update:chartType": (chartType: ChartType) => void;
|
|
96
94
|
"update:visibleIds": (visibleIds: unknown[]) => void;
|
|
@@ -143,7 +141,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
143
141
|
fullHeightBottomSpacing?: number;
|
|
144
142
|
withSettingsHeader?: boolean;
|
|
145
143
|
extraCharts?: Record<string, unknown>[];
|
|
146
|
-
colorVariant?: ColorVariant;
|
|
147
144
|
}>, {
|
|
148
145
|
chartType: ChartType;
|
|
149
146
|
dataSets: () => any[];
|
|
@@ -185,7 +182,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
185
182
|
fullHeightBottomSpacing: number;
|
|
186
183
|
withSettingsHeader: boolean;
|
|
187
184
|
extraCharts: () => any[];
|
|
188
|
-
colorVariant: string;
|
|
189
185
|
}>>> & {
|
|
190
186
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
191
187
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
@@ -231,7 +227,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
231
227
|
fullHeightBottomSpacing: number;
|
|
232
228
|
withSettingsHeader: boolean;
|
|
233
229
|
extraCharts: Record<string, unknown>[];
|
|
234
|
-
colorVariant: ColorVariant;
|
|
235
230
|
}>, {
|
|
236
231
|
"before-chart-type"?(_: {}): any;
|
|
237
232
|
metric?(_: {}): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Chart.vue2.js";
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../Chart.
|
|
4
|
-
const
|
|
2
|
+
/* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../Chart.vue_vue_type_style_index_0_scoped_e8f25a03_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e8f25a03"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../Chart.
|
|
2
|
-
import { useVModel as
|
|
1
|
+
import "../../Chart.vue_vue_type_style_index_0_scoped_e8f25a03_lang.css"; import { defineComponent as U, ref as O, computed as n, openBlock as s, createElementBlock as m, Fragment as C, createBlock as I, unref as i, isRef as b, withCtx as d, renderSlot as u, createCommentVNode as D, createElementVNode as k, mergeProps as g, normalizeClass as E, createVNode as L, createSlots as N, renderList as M } from "vue";
|
|
2
|
+
import { useVModel as A } from "@vueuse/core";
|
|
3
3
|
import $ from "./ChartLegend.vue.js";
|
|
4
4
|
import K from "./SettingsHeader.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import B from "./ChartPlane.vue.js";
|
|
6
6
|
import { useColorsMap as z } from "./composables/useColorsMap.js";
|
|
7
7
|
import { DEFAULT_TICK_COUNT as R, DEFAULT_MIN_VISIBLE as X, DEFAULT_MAX_VISIBLE as Y } from "./consts.js";
|
|
8
8
|
import { ChartType as j, DateInterval as q, TooltipOrder as G, TrendDirection as J } from "./types.js";
|
|
@@ -53,12 +53,11 @@ const _ = {
|
|
|
53
53
|
fullHeight: { type: Boolean, default: !1 },
|
|
54
54
|
fullHeightBottomSpacing: { default: 50 },
|
|
55
55
|
withSettingsHeader: { type: Boolean, default: !0 },
|
|
56
|
-
extraCharts: { default: () => [] }
|
|
57
|
-
colorVariant: { default: "default" }
|
|
56
|
+
extraCharts: { default: () => [] }
|
|
58
57
|
},
|
|
59
58
|
emits: ["update:chartType", "update:visibleIds", "update:sortSelected"],
|
|
60
59
|
setup(a, { emit: p }) {
|
|
61
|
-
const e = a, r =
|
|
60
|
+
const e = a, r = A(e, "chartType", p), c = A(e, "sortSelected", p), h = O(null), y = n(() => ({
|
|
62
61
|
dataSets: e.dataSets,
|
|
63
62
|
visibleIds: e.visibleIds,
|
|
64
63
|
parsing: e.parsing,
|
|
@@ -85,22 +84,21 @@ const _ = {
|
|
|
85
84
|
totalsChart: e.totalsChart,
|
|
86
85
|
subheaderTooltip: e.subheaderTooltip,
|
|
87
86
|
keepSubheaderVisible: e.keepSubheaderVisible,
|
|
88
|
-
colorsMap:
|
|
87
|
+
colorsMap: f.value,
|
|
89
88
|
tooltipTotalType: e.tooltipTotalType,
|
|
90
89
|
tooltipTotalCalcFn: e.tooltipTotalCalcFn,
|
|
91
90
|
tooltipOrder: e.tooltipOrder,
|
|
92
|
-
highlightedId:
|
|
91
|
+
highlightedId: h.value,
|
|
93
92
|
valueSuffix: e.valueSuffix,
|
|
94
93
|
valuePrefix: e.valuePrefix
|
|
95
|
-
})),
|
|
96
|
-
dataSets:
|
|
97
|
-
visibleIds: T
|
|
98
|
-
variant: e.colorVariant
|
|
94
|
+
})), V = n(() => e.dataSets), T = n(() => e.visibleIds), v = n(() => e.extraCharts.length), x = n(() => 1 + v.value), F = (t) => t === v.value - 1, { colorsMap: f } = z({
|
|
95
|
+
dataSets: V,
|
|
96
|
+
visibleIds: T
|
|
99
97
|
}), w = n(() => e.dataSets.map((t) => ({
|
|
100
98
|
id: t.id,
|
|
101
99
|
label: t.label,
|
|
102
100
|
caption: t.caption || null,
|
|
103
|
-
color:
|
|
101
|
+
color: f.value[t.id] || null,
|
|
104
102
|
icon: t.icon || null,
|
|
105
103
|
iconType: t.iconType || "branded"
|
|
106
104
|
}))), { containerProps: H, eachPlaneHeight: P } = Q({
|
|
@@ -130,7 +128,7 @@ const _ = {
|
|
|
130
128
|
k("section", {
|
|
131
129
|
class: E(["chart-planes", [{ "with-legend": !a.hideLegend }]])
|
|
132
130
|
}, [
|
|
133
|
-
L(
|
|
131
|
+
L(B, g({
|
|
134
132
|
"chart-type": i(r),
|
|
135
133
|
"onUpdate:chart-type": o[1] || (o[1] = (l) => b(r) ? r.value = l : null)
|
|
136
134
|
}, i(y)), N({ _: 2 }, [
|
|
@@ -142,12 +140,12 @@ const _ = {
|
|
|
142
140
|
key: "0"
|
|
143
141
|
} : void 0
|
|
144
142
|
]), 1040, ["chart-type"]),
|
|
145
|
-
(s(!0), m(C, null, M(a.extraCharts, (l, S) => (s(), I(
|
|
143
|
+
(s(!0), m(C, null, M(a.extraCharts, (l, S) => (s(), I(B, g({
|
|
146
144
|
key: S,
|
|
147
145
|
class: "extra-chart-plane"
|
|
148
146
|
}, { ...i(y), ...l }, {
|
|
149
147
|
"chart-type": i(r),
|
|
150
|
-
"colors-map": i(
|
|
148
|
+
"colors-map": i(f),
|
|
151
149
|
"type-switcher": !1,
|
|
152
150
|
"tooltip-respects-top-edge": !F(S)
|
|
153
151
|
}), null, 16, ["chart-type", "colors-map", "tooltip-respects-top-edge"]))), 128))
|
|
@@ -156,8 +154,8 @@ const _ = {
|
|
|
156
154
|
L($, {
|
|
157
155
|
"sort-selected": i(c),
|
|
158
156
|
"onUpdate:sort-selected": o[2] || (o[2] = (l) => b(c) ? c.value = l : null),
|
|
159
|
-
"highlighted-id":
|
|
160
|
-
"onUpdate:highlighted-id": o[3] || (o[3] = (l) =>
|
|
157
|
+
"highlighted-id": h.value,
|
|
158
|
+
"onUpdate:highlighted-id": o[3] || (o[3] = (l) => h.value = l),
|
|
161
159
|
items: i(w),
|
|
162
160
|
"visible-ids": i(T),
|
|
163
161
|
"max-limit-tooltip-text": a.maxLimitTooltipText,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TooltipHeader.vue2.js";
|
|
2
2
|
/* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../TooltipHeader.
|
|
4
|
-
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-5160f12d"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import "../../TooltipHeader.
|
|
1
|
+
import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css"; import { defineComponent as v, computed as u, openBlock as i, createElementBlock as f, createElementVNode as A, unref as t, createCommentVNode as s, createBlock as m, createVNode as D, withCtx as d, createTextVNode as x, toDisplayString as p } from "vue";
|
|
2
|
+
import { getUTCDate as T } from "../../utils/date.js";
|
|
2
3
|
import { formatValue as r } from "./utils/utils.js";
|
|
3
4
|
import y from "../typography/v4/Typography.vue.js";
|
|
4
5
|
import { DateInterval as c } from "./types.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { startOfWeek as
|
|
8
|
-
import { LONG_DATE_FORMAT as
|
|
9
|
-
const
|
|
6
|
+
import k from "../icon/v4/IconV4.vue.js";
|
|
7
|
+
import C from "../icon/v4/IconFlag.vue.js";
|
|
8
|
+
import { startOfWeek as F, endOfWeek as I, startOfMonth as O, endOfMonth as E } from "date-fns";
|
|
9
|
+
import { LONG_DATE_FORMAT as n } from "./consts.js";
|
|
10
|
+
const N = { class: "tooltip-title-wrapper" }, L = { class: "main-title" }, M = ["src"], S = /* @__PURE__ */ v({
|
|
10
11
|
__name: "TooltipHeader",
|
|
11
12
|
props: {
|
|
12
13
|
title: { default: "" },
|
|
@@ -16,25 +17,25 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
16
17
|
totalsChart: { type: Boolean, default: !1 }
|
|
17
18
|
},
|
|
18
19
|
setup(a) {
|
|
19
|
-
const e = a, o =
|
|
20
|
-
${r(
|
|
21
|
-
${r(
|
|
20
|
+
const e = a, o = u(() => e.dataPoints.length ? e.dataPoints[0].dataset : null), h = u(() => e.totalsChart ? o.value?.label || e.title : e.xAxisFormat === "date" ? g(T(e.title)) : r(e.title, e.xAxisFormat)), g = (l) => e.xAxisDateInterval === c.WEEKLY ? `
|
|
21
|
+
${r(F(l), n)} -
|
|
22
|
+
${r(I(l), n)}
|
|
22
23
|
` : e.xAxisDateInterval === c.MONTHLY ? `
|
|
23
|
-
${r(
|
|
24
|
-
${r(
|
|
25
|
-
` : r(l,
|
|
26
|
-
return (l,
|
|
27
|
-
A("div",
|
|
28
|
-
a.totalsChart && t(o)?.image ? (
|
|
24
|
+
${r(O(l), n)} -
|
|
25
|
+
${r(E(l), n)}
|
|
26
|
+
` : r(l, n);
|
|
27
|
+
return (l, V) => (i(), f("div", N, [
|
|
28
|
+
A("div", L, [
|
|
29
|
+
a.totalsChart && t(o)?.image ? (i(), f("img", {
|
|
29
30
|
key: 0,
|
|
30
31
|
class: "title-image",
|
|
31
32
|
src: t(o)?.image
|
|
32
|
-
}, null, 8,
|
|
33
|
-
a.totalsChart && t(o)?.countryFlag ? (
|
|
33
|
+
}, null, 8, M)) : s("", !0),
|
|
34
|
+
a.totalsChart && t(o)?.countryFlag ? (i(), m(t(C), {
|
|
34
35
|
key: 1,
|
|
35
36
|
"country-code": t(o).countryFlag
|
|
36
37
|
}, null, 8, ["country-code"])) : s("", !0),
|
|
37
|
-
a.totalsChart && t(o)?.icon ? (
|
|
38
|
+
a.totalsChart && t(o)?.icon ? (i(), m(t(k), {
|
|
38
39
|
key: 2,
|
|
39
40
|
class: "platform-icon",
|
|
40
41
|
type: t(o)?.iconType,
|
|
@@ -51,7 +52,7 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
51
52
|
_: 1
|
|
52
53
|
})
|
|
53
54
|
]),
|
|
54
|
-
a.xAxisFormat === "date" && a.xAxisDateInterval !== t(c).WEEKLY && a.xAxisDateInterval !== t(c).MONTHLY ? (
|
|
55
|
+
a.xAxisFormat === "date" && a.xAxisDateInterval !== t(c).WEEKLY && a.xAxisDateInterval !== t(c).MONTHLY ? (i(), m(t(y), {
|
|
55
56
|
key: 0,
|
|
56
57
|
class: "tooltip-sub-title",
|
|
57
58
|
variant: "caption"
|
|
@@ -65,5 +66,5 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
S as default
|
|
69
70
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HexColor } from '@/components/chart/types';
|
|
2
2
|
export declare const DEFAULT_CHART_COLOR: HexColor;
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const MEDIATION_COLOR_PALETTE: HexColor[];
|
|
3
|
+
export declare const COLOR_PALETTE: HexColor[];
|
|
5
4
|
export declare const RESERVED_COLORS_MAP: Record<string, HexColor>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NETWORK_UNITY_ADS as
|
|
2
|
-
const I = "#c9c9c9",
|
|
1
|
+
import { NETWORK_UNITY_ADS as _, BIDDING_PREFIX as F, NETWORK_AD_MOB as N, NETWORK_IRON_SOURCE as E, NETWORK_MINTEGRAL as T, NETWORK_APPLOVIN as A, NETWORK_FACEBOOK_META as $, NETWORK_LIFTOFF as O, NETWORK_PANGLE as C, NETWORK_INMOBI as R, NETWORK_DT_EXCHANGE as B } from "./consts.js";
|
|
2
|
+
const I = "#c9c9c9", K = [
|
|
3
3
|
"#80BCFE",
|
|
4
4
|
"#9999FF",
|
|
5
5
|
"#5883E4",
|
|
@@ -10,59 +10,45 @@ const I = "#c9c9c9", L = [
|
|
|
10
10
|
"#673AFF",
|
|
11
11
|
"#CA80DC",
|
|
12
12
|
"#FEBBB2"
|
|
13
|
-
], t =
|
|
14
|
-
"#487BEC",
|
|
15
|
-
"#FFC670",
|
|
16
|
-
"#80CBC4",
|
|
17
|
-
"#FF7557",
|
|
18
|
-
"#7856FF",
|
|
19
|
-
"#FEBBB2",
|
|
20
|
-
"#DA88EE",
|
|
21
|
-
"#0D7EA0",
|
|
22
|
-
"#01AB01",
|
|
23
|
-
"#B3596E"
|
|
24
|
-
], K = {
|
|
13
|
+
], t = {
|
|
25
14
|
Total: "#646464",
|
|
26
15
|
// AB tests
|
|
27
16
|
A: "#FFC134",
|
|
28
17
|
B: "#4F4FF5",
|
|
29
18
|
// Countries
|
|
30
|
-
US: "#
|
|
31
|
-
CN: "#
|
|
32
|
-
GB: "#
|
|
33
|
-
DE: "#
|
|
34
|
-
JP: "#
|
|
35
|
-
AU: "#
|
|
36
|
-
FR: "#
|
|
37
|
-
RU: "#FF70AA",
|
|
19
|
+
US: "#272EC4",
|
|
20
|
+
CN: "#F52E1E",
|
|
21
|
+
GB: "#0082FF",
|
|
22
|
+
DE: "#FFD600",
|
|
23
|
+
JP: "#BA0029",
|
|
24
|
+
AU: "#009BCB",
|
|
25
|
+
FR: "#34A853",
|
|
38
26
|
// Ad formats
|
|
39
|
-
Rewarded: "#
|
|
40
|
-
Interstitial: "#
|
|
41
|
-
Banner: "#
|
|
42
|
-
Native: "#
|
|
43
|
-
Offerwall: "#9999FF",
|
|
27
|
+
Rewarded: "#0082FF",
|
|
28
|
+
Interstitial: "#009BCB",
|
|
29
|
+
Banner: "#9668FF",
|
|
30
|
+
Native: "#FF35A2",
|
|
44
31
|
// Ad sources
|
|
45
|
-
[`${
|
|
46
|
-
[`${
|
|
47
|
-
[`${E} ${F}`]: "#
|
|
48
|
-
[`${E}`]: "#
|
|
49
|
-
[`${
|
|
50
|
-
[`${
|
|
51
|
-
[`${
|
|
52
|
-
[`${
|
|
53
|
-
[`${
|
|
54
|
-
[`${
|
|
55
|
-
[`${
|
|
56
|
-
[`${
|
|
57
|
-
[`${
|
|
58
|
-
[`${
|
|
59
|
-
[`${
|
|
60
|
-
[`${
|
|
61
|
-
[`${
|
|
32
|
+
[`${_} ${F}`]: "#9668FF",
|
|
33
|
+
[`${N} ${F}`]: "#34A853",
|
|
34
|
+
[`${E} ${F}`]: "#272EC4",
|
|
35
|
+
[`${E}`]: "#5C63E7",
|
|
36
|
+
[`${T} ${F}`]: "#00D8B2",
|
|
37
|
+
[`${A} ${F}`]: "#009BCB",
|
|
38
|
+
[`${A}`]: "#80CDE5",
|
|
39
|
+
[`${$} ${F}`]: "#0082FF",
|
|
40
|
+
[`${$}`]: "#52AAFF",
|
|
41
|
+
[`${O} ${F}`]: "#FF35A2",
|
|
42
|
+
[`${O}`]: "#FF9AD1",
|
|
43
|
+
[`${C} ${F}`]: "#F52E1E",
|
|
44
|
+
[`${C}`]: "#FA9F97",
|
|
45
|
+
[`${R} ${F}`]: "#FFD600",
|
|
46
|
+
[`${R}`]: "#FFEC8A",
|
|
47
|
+
[`${B} ${F}`]: "#BA0029",
|
|
48
|
+
[`${B}`]: "#DD8094"
|
|
62
49
|
};
|
|
63
50
|
export {
|
|
51
|
+
K as COLOR_PALETTE,
|
|
64
52
|
I as DEFAULT_CHART_COLOR,
|
|
65
|
-
|
|
66
|
-
t as MEDIATION_COLOR_PALETTE,
|
|
67
|
-
K as RESERVED_COLORS_MAP
|
|
53
|
+
t as RESERVED_COLORS_MAP
|
|
68
54
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ChartDataSet } from '@/components/chart';
|
|
3
|
-
import { ColorVariant } from '@/components/chart/types';
|
|
4
3
|
type UseColorsMapArgs = {
|
|
5
4
|
dataSets: Ref<ChartDataSet[]>;
|
|
6
5
|
visibleIds: Ref<unknown[]>;
|
|
7
|
-
variant?: ColorVariant;
|
|
8
6
|
};
|
|
9
|
-
export declare const useColorsMap: ({ dataSets, visibleIds
|
|
7
|
+
export declare const useColorsMap: ({ dataSets, visibleIds }: UseColorsMapArgs) => {
|
|
10
8
|
colorsMap: Ref<Record<string, `#${string}`>>;
|
|
11
9
|
};
|
|
12
10
|
export {};
|
|
@@ -1,48 +1,46 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { RESERVED_COLORS_MAP as c,
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => {
|
|
8
|
-
const s = r(
|
|
9
|
-
() => i.value.filter(
|
|
10
|
-
(o) => u.value.includes(o.id)
|
|
1
|
+
import { computed as n, ref as r, watch as E } from "vue";
|
|
2
|
+
import { RESERVED_COLORS_MAP as c, COLOR_PALETTE as O, DEFAULT_CHART_COLOR as R } from "../colorPalette.js";
|
|
3
|
+
const T = ({ dataSets: u, visibleIds: i }) => {
|
|
4
|
+
const a = n(
|
|
5
|
+
() => u.value.filter(
|
|
6
|
+
(o) => i.value.includes(o.id)
|
|
11
7
|
)
|
|
12
|
-
),
|
|
8
|
+
), l = r({
|
|
13
9
|
...c
|
|
14
10
|
// destructuring is important to avoid mutating the reserved colors object
|
|
15
|
-
}),
|
|
16
|
-
|
|
11
|
+
}), s = r([]), v = n(
|
|
12
|
+
() => O.filter((o) => !s.value.includes(o))
|
|
13
|
+
), d = () => {
|
|
14
|
+
a.value.forEach((o) => {
|
|
17
15
|
const e = String(o.id);
|
|
18
|
-
if (!
|
|
19
|
-
const
|
|
20
|
-
|
|
16
|
+
if (!l.value[e]) {
|
|
17
|
+
const t = o.color || v.value[0] || R;
|
|
18
|
+
C(e, t);
|
|
21
19
|
}
|
|
22
20
|
});
|
|
23
|
-
},
|
|
24
|
-
Object.keys(
|
|
25
|
-
const e =
|
|
26
|
-
!e && !
|
|
21
|
+
}, f = () => {
|
|
22
|
+
Object.keys(l.value).forEach((o) => {
|
|
23
|
+
const e = a.value.find((m) => String(m.id) === o), t = !!c[o];
|
|
24
|
+
!e && !t && p(o);
|
|
27
25
|
});
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
const e =
|
|
32
|
-
delete
|
|
33
|
-
const
|
|
34
|
-
|
|
26
|
+
}, C = (o, e) => {
|
|
27
|
+
l.value[String(o)] = e, s.value.push(e);
|
|
28
|
+
}, p = (o) => {
|
|
29
|
+
const e = l.value[o];
|
|
30
|
+
delete l.value[o];
|
|
31
|
+
const t = s.value.indexOf(e);
|
|
32
|
+
t > -1 && s.value.splice(t, 1);
|
|
35
33
|
};
|
|
36
|
-
return
|
|
37
|
-
|
|
34
|
+
return E(
|
|
35
|
+
a,
|
|
38
36
|
() => {
|
|
39
|
-
|
|
37
|
+
f(), d();
|
|
40
38
|
},
|
|
41
39
|
{ immediate: !0 }
|
|
42
40
|
), {
|
|
43
|
-
colorsMap:
|
|
41
|
+
colorsMap: l
|
|
44
42
|
};
|
|
45
43
|
};
|
|
46
44
|
export {
|
|
47
|
-
|
|
45
|
+
T as useColorsMap
|
|
48
46
|
};
|
|
@@ -45,7 +45,6 @@ declare const ChartTypes: () => ({
|
|
|
45
45
|
fullHeightBottomSpacing: number;
|
|
46
46
|
withSettingsHeader: boolean;
|
|
47
47
|
extraCharts: Record<string, unknown>[];
|
|
48
|
-
colorVariant: import("./types").ColorVariant;
|
|
49
48
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
50
49
|
header: {
|
|
51
50
|
type: import("vue").PropType<string>;
|
|
@@ -216,15 +215,11 @@ declare const ChartTypes: () => ({
|
|
|
216
215
|
type: import("vue").PropType<Record<string, unknown>[]>;
|
|
217
216
|
default: () => any[];
|
|
218
217
|
};
|
|
219
|
-
colorVariant: {
|
|
220
|
-
type: import("vue").PropType<import("./types").ColorVariant>;
|
|
221
|
-
default: string;
|
|
222
|
-
};
|
|
223
218
|
}>> & {
|
|
224
219
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
225
220
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
226
221
|
"onUpdate:chartType"?: (chartType: ChartType) => any;
|
|
227
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "header" | "loading" | "visibleIds" | "minVisible" | "maxVisible" | "maxLimitTooltipText" | "sortSelected" | "sortOptions" | "sortOptionNameKey" | "chartType" | "hideLegend" | "xAxisFormat" | "xAxisDateInterval" | "totalsChart" | "parsing" | "yAxisFormat" | "valueSuffix" | "valuePrefix" | "trendTooltip" | "subheader" | "subheaderTooltip" | "trendValue" | "trendDirection" | "noteText" | "dataSets" | "tickCount" | "truncateTickLabels" | "keepSubheaderVisible" | "empty" | "noDataIcon" | "noDataTitle" | "noDataSubtitle" | "withAnimation" | "tooltipTotalType" | "tooltipTotalCalcFn" | "tooltipOrder" | "fullHeight" | "fullHeightBottomSpacing" | "withSettingsHeader" | "extraCharts"
|
|
222
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "header" | "loading" | "visibleIds" | "minVisible" | "maxVisible" | "maxLimitTooltipText" | "sortSelected" | "sortOptions" | "sortOptionNameKey" | "chartType" | "hideLegend" | "xAxisFormat" | "xAxisDateInterval" | "totalsChart" | "parsing" | "yAxisFormat" | "valueSuffix" | "valuePrefix" | "trendTooltip" | "subheader" | "subheaderTooltip" | "trendValue" | "trendDirection" | "noteText" | "dataSets" | "tickCount" | "truncateTickLabels" | "keepSubheaderVisible" | "empty" | "noDataIcon" | "noDataTitle" | "noDataSubtitle" | "withAnimation" | "tooltipTotalType" | "tooltipTotalCalcFn" | "tooltipOrder" | "fullHeight" | "fullHeightBottomSpacing" | "withSettingsHeader" | "extraCharts">;
|
|
228
223
|
$attrs: {
|
|
229
224
|
[x: string]: unknown;
|
|
230
225
|
};
|
|
@@ -408,10 +403,6 @@ declare const ChartTypes: () => ({
|
|
|
408
403
|
type: import("vue").PropType<Record<string, unknown>[]>;
|
|
409
404
|
default: () => any[];
|
|
410
405
|
};
|
|
411
|
-
colorVariant: {
|
|
412
|
-
type: import("vue").PropType<import("./types").ColorVariant>;
|
|
413
|
-
default: string;
|
|
414
|
-
};
|
|
415
406
|
}>> & {
|
|
416
407
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
417
408
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
@@ -461,7 +452,6 @@ declare const ChartTypes: () => ({
|
|
|
461
452
|
fullHeightBottomSpacing: number;
|
|
462
453
|
withSettingsHeader: boolean;
|
|
463
454
|
extraCharts: Record<string, unknown>[];
|
|
464
|
-
colorVariant: import("./types").ColorVariant;
|
|
465
455
|
}, {}, string> & {
|
|
466
456
|
beforeCreate?: (() => void) | (() => void)[];
|
|
467
457
|
created?: (() => void) | (() => void)[];
|
|
@@ -652,10 +642,6 @@ declare const ChartTypes: () => ({
|
|
|
652
642
|
type: import("vue").PropType<Record<string, unknown>[]>;
|
|
653
643
|
default: () => any[];
|
|
654
644
|
};
|
|
655
|
-
colorVariant: {
|
|
656
|
-
type: import("vue").PropType<import("./types").ColorVariant>;
|
|
657
|
-
default: string;
|
|
658
|
-
};
|
|
659
645
|
}>> & {
|
|
660
646
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
661
647
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
@@ -834,10 +820,6 @@ declare const ChartTypes: () => ({
|
|
|
834
820
|
type: import("vue").PropType<Record<string, unknown>[]>;
|
|
835
821
|
default: () => any[];
|
|
836
822
|
};
|
|
837
|
-
colorVariant: {
|
|
838
|
-
type: import("vue").PropType<import("./types").ColorVariant>;
|
|
839
|
-
default: string;
|
|
840
|
-
};
|
|
841
823
|
}>> & {
|
|
842
824
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
843
825
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
@@ -887,7 +869,6 @@ declare const ChartTypes: () => ({
|
|
|
887
869
|
fullHeightBottomSpacing: number;
|
|
888
870
|
withSettingsHeader: boolean;
|
|
889
871
|
extraCharts: Record<string, unknown>[];
|
|
890
|
-
colorVariant: import("./types").ColorVariant;
|
|
891
872
|
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
892
873
|
$slots: {
|
|
893
874
|
"before-chart-type"?(_: {}): any;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import { getUTCDate as n } from "../../../utils/date.js";
|
|
1
2
|
import { format as e } from "date-fns";
|
|
2
|
-
import { TICK_LABEL_FONT as
|
|
3
|
-
import { nFormatter as
|
|
4
|
-
import { truncateTextToFit as
|
|
5
|
-
import { REGEX_LINEBREAK as
|
|
6
|
-
const
|
|
3
|
+
import { TICK_LABEL_FONT as E } from "../consts.js";
|
|
4
|
+
import { nFormatter as c } from "../../../utils/formatNumbers.js";
|
|
5
|
+
import { truncateTextToFit as T } from "../../../utils/text.js";
|
|
6
|
+
import { REGEX_LINEBREAK as i } from "../../../consts/regex.js";
|
|
7
|
+
const u = (r, t, o = !1) => t === "day" ? e(n(r), "EEEE") : t === "number" ? c(r, o) : t === "date" ? e(n(r), "MMM dd") : t === "dateLong" ? e(n(r), "MMM dd, yyyy") : String(r), _ = ({
|
|
7
8
|
label: r,
|
|
8
9
|
format: t,
|
|
9
|
-
availableSpace:
|
|
10
|
-
truncate:
|
|
10
|
+
availableSpace: o,
|
|
11
|
+
truncate: s = !1
|
|
11
12
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const p = i.test(r), f = (d) => {
|
|
14
|
+
const m = u(d, t);
|
|
15
|
+
return s && o > 0 ? T(m, E, o) : m;
|
|
15
16
|
};
|
|
16
|
-
return
|
|
17
|
+
return p ? r.split(i).map(f) : f(r);
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
u as formatValue,
|
|
21
|
+
_ as prepareTickLabel
|
|
21
22
|
};
|
|
@@ -3,13 +3,13 @@ import { useToggle as fe } from "../../../composables/useToggle.js";
|
|
|
3
3
|
import { ref as r, computed as b, onMounted as de, onBeforeMount as ce, onUnmounted as ve, watch as Q } from "vue";
|
|
4
4
|
import { min as me, addDays as ge, format as X } from "date-fns";
|
|
5
5
|
import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
|
|
6
|
-
import
|
|
6
|
+
import d from "./DateServices.common.js";
|
|
7
7
|
const pe = (o, y) => {
|
|
8
|
-
const N = r(null),
|
|
8
|
+
const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, T = r({ from: null, to: null }), u = r({}), g = r([]), k = r(null), i = r({}), p = r({}), E = r(!1), w = r(null), s = r(null), j = r("left"), P = r(null), O = r(null), C = r([]), K = r(null), [D] = fe({ initialValue: !1 }), q = r(null);
|
|
9
9
|
ie(q, () => {
|
|
10
10
|
D.value = !1;
|
|
11
11
|
});
|
|
12
|
-
const
|
|
12
|
+
const U = (e, t) => {
|
|
13
13
|
const a = {
|
|
14
14
|
weeks: [],
|
|
15
15
|
days: {},
|
|
@@ -17,20 +17,20 @@ const pe = (o, y) => {
|
|
|
17
17
|
year: t
|
|
18
18
|
};
|
|
19
19
|
let n, l;
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
const f =
|
|
20
|
+
const v = new Date(t, e, 1).getDay();
|
|
21
|
+
let m = 1;
|
|
22
|
+
const f = d.getCurrentTimeUTC();
|
|
23
23
|
f.setHours(0, 0, 0, 0);
|
|
24
|
-
const ue =
|
|
24
|
+
const ue = d.daysInMonth(e, t);
|
|
25
25
|
for (let I = 0; I < 6; I++) {
|
|
26
26
|
l = [];
|
|
27
27
|
for (let H = 0; H < 7; H++)
|
|
28
|
-
n = {}, I === 0 &&
|
|
28
|
+
n = {}, I === 0 && v > 0 && H < v && (n.value = 0), m > ue && (n.value = 0), !n.value && n.value !== 0 && (n.value = m, m += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), f < n.date ? n.isFuture = !0 : n.date.getTime() === f.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
|
|
29
29
|
a.weeks.push(l);
|
|
30
30
|
}
|
|
31
31
|
return a;
|
|
32
|
-
},
|
|
33
|
-
let e =
|
|
32
|
+
}, S = () => {
|
|
33
|
+
let e = d.getCurrentTimeUTC();
|
|
34
34
|
if (s.value && s.value.toEnd ? e = s.value.toEnd : o.range && o.range.to && (e = o.range.to), !u.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
|
|
35
35
|
u.value = {}, g.value = [];
|
|
36
36
|
for (let t = 0; t < _; t++) {
|
|
@@ -38,7 +38,7 @@ const pe = (o, y) => {
|
|
|
38
38
|
a.setDate(1), a.setMonth(e.getMonth() - t);
|
|
39
39
|
const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
|
|
40
40
|
u.value[n] = {
|
|
41
|
-
parsedMonth:
|
|
41
|
+
parsedMonth: U(
|
|
42
42
|
a.getMonth(),
|
|
43
43
|
a.getFullYear()
|
|
44
44
|
),
|
|
@@ -49,28 +49,28 @@ const pe = (o, y) => {
|
|
|
49
49
|
}, z = (e, t) => {
|
|
50
50
|
w.value = e;
|
|
51
51
|
let a = e;
|
|
52
|
-
e === "date" && (a = o.datePresetList),
|
|
52
|
+
e === "date" && (a = o.datePresetList), C.value = he[a], t && (s.value = {
|
|
53
53
|
fromStart: null,
|
|
54
54
|
fromEnd: null,
|
|
55
55
|
toStart: null,
|
|
56
56
|
toEnd: null
|
|
57
|
-
},
|
|
57
|
+
}, T.value.from = "", T.value.to = "", c.value = { started: !1, date: null }, i.value = "custom"), y("rangeTypeChanged", w.value);
|
|
58
58
|
}, ee = (e) => {
|
|
59
|
-
i.value = e.id, M(k.value[e.id].dates()),
|
|
59
|
+
i.value = e.id, M(k.value[e.id].dates()), S();
|
|
60
60
|
}, M = (e, t = !1) => {
|
|
61
61
|
let a = e;
|
|
62
|
-
return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[
|
|
62
|
+
return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[C.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), E.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, E.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, E.value = !0, !1) : (s.value = R(a), T.value.from = X(
|
|
63
63
|
s.value.fromStart,
|
|
64
64
|
o.dateFormat
|
|
65
|
-
),
|
|
65
|
+
), T.value.to = X(s.value.toEnd, o.dateFormat), !0);
|
|
66
66
|
}, F = () => {
|
|
67
|
-
i.value === "custom" ? P.value =
|
|
67
|
+
i.value === "custom" ? P.value = d.getDateRangeString(s.value) : P.value = J.value, y("currentDateChanged", P.value);
|
|
68
68
|
}, te = () => {
|
|
69
69
|
if (s.value.fromStart == null || s.value.toEnd == null) {
|
|
70
|
-
|
|
70
|
+
E.value = !0, O.value = Me;
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const e =
|
|
73
|
+
const e = d.getCurrentTimeUTC();
|
|
74
74
|
s.value.toEnd > e && (s.value.toEnd = e), F(), p.value = i.value, y("rangeChanged", {
|
|
75
75
|
from: s.value.fromStart,
|
|
76
76
|
to: s.value.toEnd,
|
|
@@ -79,29 +79,29 @@ const pe = (o, y) => {
|
|
|
79
79
|
}, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
|
|
80
80
|
let t = null, a = null;
|
|
81
81
|
const n = _ - 1;
|
|
82
|
-
let l = "", h = null,
|
|
82
|
+
let l = "", h = null, v = null;
|
|
83
83
|
switch (e) {
|
|
84
84
|
case V:
|
|
85
|
-
Object.keys(u.value).forEach((
|
|
86
|
-
const f = u.value[
|
|
85
|
+
Object.keys(u.value).forEach((m) => {
|
|
86
|
+
const f = u.value[m];
|
|
87
87
|
f.order === 0 && (h = f), f.order === n ? (g.value.splice(
|
|
88
|
-
g.value.indexOf(
|
|
88
|
+
g.value.indexOf(m),
|
|
89
89
|
1
|
|
90
|
-
), delete u.value[
|
|
90
|
+
), delete u.value[m]) : f.order += 1;
|
|
91
91
|
}), t = h.parsedMonth.month + 1, a = h.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
92
|
-
parsedMonth:
|
|
92
|
+
parsedMonth: U(t, a),
|
|
93
93
|
order: 0
|
|
94
94
|
}, g.value.push(l);
|
|
95
95
|
break;
|
|
96
96
|
case Z:
|
|
97
|
-
Object.keys(u.value).forEach((
|
|
98
|
-
const f = u.value[
|
|
99
|
-
f.order === n && (
|
|
100
|
-
g.value.indexOf(
|
|
97
|
+
Object.keys(u.value).forEach((m) => {
|
|
98
|
+
const f = u.value[m];
|
|
99
|
+
f.order === n && (v = f), f.order === 0 ? (g.value.splice(
|
|
100
|
+
g.value.indexOf(m),
|
|
101
101
|
1
|
|
102
|
-
), delete u.value[
|
|
103
|
-
}), t =
|
|
104
|
-
parsedMonth:
|
|
102
|
+
), delete u.value[m]) : f.order -= 1;
|
|
103
|
+
}), t = v.parsedMonth.month - 1, a = v.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
104
|
+
parsedMonth: U(t, a),
|
|
105
105
|
order: n
|
|
106
106
|
}, g.value.unshift(l);
|
|
107
107
|
break;
|
|
@@ -111,10 +111,10 @@ const pe = (o, y) => {
|
|
|
111
111
|
switch (w.value) {
|
|
112
112
|
case "week":
|
|
113
113
|
t = {
|
|
114
|
-
fromStart:
|
|
115
|
-
fromEnd:
|
|
116
|
-
toStart:
|
|
117
|
-
toEnd:
|
|
114
|
+
fromStart: d.getFirstDayOfWeek(e.from),
|
|
115
|
+
fromEnd: d.getLastDayOfWeek(e.from),
|
|
116
|
+
toStart: d.getFirstDayOfWeek(e.to),
|
|
117
|
+
toEnd: d.getLastDayOfWeek(e.to)
|
|
118
118
|
};
|
|
119
119
|
break;
|
|
120
120
|
case "month":
|
|
@@ -124,13 +124,13 @@ const pe = (o, y) => {
|
|
|
124
124
|
e.from.getMonth(),
|
|
125
125
|
1
|
|
126
126
|
),
|
|
127
|
-
fromEnd:
|
|
127
|
+
fromEnd: d.getLastDayOfMonth(e.from),
|
|
128
128
|
toStart: new Date(
|
|
129
129
|
e.to.getFullYear(),
|
|
130
130
|
e.to.getMonth(),
|
|
131
131
|
1
|
|
132
132
|
),
|
|
133
|
-
toEnd:
|
|
133
|
+
toEnd: d.getLastDayOfMonth(e.to)
|
|
134
134
|
};
|
|
135
135
|
break;
|
|
136
136
|
case "date":
|
|
@@ -144,10 +144,10 @@ const pe = (o, y) => {
|
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
return t;
|
|
147
|
-
},
|
|
147
|
+
}, L = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
|
|
148
148
|
let t = !1;
|
|
149
149
|
if (!e.from && !e.to && e.preset) {
|
|
150
|
-
const l =
|
|
150
|
+
const l = C.value.find(
|
|
151
151
|
(h) => h.id === e.preset
|
|
152
152
|
);
|
|
153
153
|
i.value = l.id, t = !0;
|
|
@@ -157,15 +157,15 @@ const pe = (o, y) => {
|
|
|
157
157
|
to: new Date(e.to)
|
|
158
158
|
};
|
|
159
159
|
a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
|
|
160
|
-
const n =
|
|
160
|
+
const n = C.value.map((l) => l.id);
|
|
161
161
|
if (Object.keys(k.value).forEach((l) => {
|
|
162
162
|
const h = k.value[l];
|
|
163
163
|
if (l !== "custom" && !t && n.indexOf(l) !== -1) {
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const v = h.dates();
|
|
165
|
+
v.from.setHours(0, 0, 0, 0), v.to.setHours(0, 0, 0, 0), L(v.from, a.from) && L(v.to, a.to) && (i.value = l, t = !0);
|
|
166
166
|
}
|
|
167
167
|
}), t) {
|
|
168
|
-
const l =
|
|
168
|
+
const l = C.value.find(
|
|
169
169
|
(h) => h.id === i.value
|
|
170
170
|
);
|
|
171
171
|
y("dateRangePresetNameChanged", l.name);
|
|
@@ -173,24 +173,24 @@ const pe = (o, y) => {
|
|
|
173
173
|
y("dateRangePresetNameChanged", null), i.value = "custom";
|
|
174
174
|
p.value = i.value;
|
|
175
175
|
}, A = (e, t, a) => {
|
|
176
|
-
if (!
|
|
177
|
-
i.value = "custom",
|
|
178
|
-
{ from:
|
|
176
|
+
if (!c.value.started)
|
|
177
|
+
i.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), M(
|
|
178
|
+
{ from: c.value.date, to: c.value.date },
|
|
179
179
|
!0
|
|
180
180
|
);
|
|
181
181
|
else {
|
|
182
|
-
const n = new Date(a, t, e.value), l =
|
|
183
|
-
|
|
182
|
+
const n = new Date(a, t, e.value), l = c.value.date;
|
|
183
|
+
c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : M({ from: l, to: n });
|
|
184
184
|
}
|
|
185
185
|
}, B = () => {
|
|
186
186
|
const e = N.value.offsetLeft;
|
|
187
187
|
return window.innerWidth - e > 930 ? "left" : "right";
|
|
188
188
|
}, W = (e = !0) => {
|
|
189
|
-
D.value = !D.value, D.value ? (j.value = B(), M(o.range),
|
|
189
|
+
D.value = !D.value, D.value ? (j.value = B(), M(o.range), S(), y("opened")) : (M(o.range), S(), i.value = p.value, e && y("dismissed"));
|
|
190
190
|
}, G = () => {
|
|
191
191
|
D.value && W();
|
|
192
192
|
}, le = () => {
|
|
193
|
-
k.value =
|
|
193
|
+
k.value = d.getPresetsFunctions(o.includeToday), k.value.custom = {
|
|
194
194
|
dates: () => o.range
|
|
195
195
|
};
|
|
196
196
|
}, oe = b(() => (g.value || []).reduce((e, t) => {
|
|
@@ -199,7 +199,7 @@ const pe = (o, y) => {
|
|
|
199
199
|
).length;
|
|
200
200
|
return e && !n;
|
|
201
201
|
}, !0)), Y = () => {
|
|
202
|
-
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range),
|
|
202
|
+
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range), S(), F());
|
|
203
203
|
};
|
|
204
204
|
de(() => {
|
|
205
205
|
Y();
|
|
@@ -216,10 +216,10 @@ const pe = (o, y) => {
|
|
|
216
216
|
e && e !== t && (x.value ? ($(e), M(e), F()) : Y());
|
|
217
217
|
}
|
|
218
218
|
), Q(D, (e) => {
|
|
219
|
-
e || (
|
|
219
|
+
e || (c.value.started = !1);
|
|
220
220
|
});
|
|
221
221
|
const J = b(() => {
|
|
222
|
-
const e =
|
|
222
|
+
const e = C.value.find(
|
|
223
223
|
(t) => t.id === i.value
|
|
224
224
|
);
|
|
225
225
|
return e ? e.name : "";
|
|
@@ -233,21 +233,21 @@ const pe = (o, y) => {
|
|
|
233
233
|
getMaxAllowedDate: se,
|
|
234
234
|
selectedPresetName: J,
|
|
235
235
|
selectedPreset: i,
|
|
236
|
-
displayError:
|
|
236
|
+
displayError: E,
|
|
237
237
|
rangeType: w,
|
|
238
238
|
selectedRange: s,
|
|
239
239
|
placement: j,
|
|
240
240
|
currentDate: P,
|
|
241
241
|
error: O,
|
|
242
|
-
presets:
|
|
242
|
+
presets: C,
|
|
243
243
|
isOpen: D,
|
|
244
244
|
popup: q,
|
|
245
|
-
selectionStart:
|
|
245
|
+
selectionStart: c,
|
|
246
246
|
initialized: x,
|
|
247
|
-
textDates:
|
|
247
|
+
textDates: T,
|
|
248
248
|
currentMonths: u,
|
|
249
249
|
displayedMonthsKeys: g,
|
|
250
|
-
initMonths:
|
|
250
|
+
initMonths: S,
|
|
251
251
|
changeType: z,
|
|
252
252
|
presetChanged: ee,
|
|
253
253
|
initRange: M,
|
|
@@ -256,7 +256,7 @@ const pe = (o, y) => {
|
|
|
256
256
|
getNavigation: ae,
|
|
257
257
|
navigationCallback: ne,
|
|
258
258
|
getSelectedRangeByType: R,
|
|
259
|
-
compareDates:
|
|
259
|
+
compareDates: L,
|
|
260
260
|
determinePreset: $,
|
|
261
261
|
selectionChanged: A,
|
|
262
262
|
checkPlacement: B,
|
package/package.json
CHANGED
package/utils/date.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUTCDate: (date: Date | string | number) => Date;
|
package/utils/date.js
ADDED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.chart-container[data-v-fa533a3d]{border:1px solid var(--common-divider);background:var(--background-paper);display:flex;border-radius:0 0 6px 6px;width:100%}.chart-planes[data-v-fa533a3d]{width:100%;height:100%;overflow-y:auto}.chart-planes.with-legend[data-v-fa533a3d]{width:calc(100% - 221px)}.chart-planes .extra-chart-plane[data-v-fa533a3d]{border-top:1px solid var(--common-divider)}.chart-sidebar[data-v-fa533a3d]{border-left:1px solid var(--common-divider)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.tooltip-title-wrapper[data-v-3b15c693]{display:flex;flex-direction:column;color:var(--text-primary);margin-bottom:var(--spacing-100)}.tooltip-title-wrapper .main-title[data-v-3b15c693]{display:flex;align-items:center;gap:.25rem}.tooltip-title-wrapper .title-text[data-v-3b15c693]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tooltip-title-wrapper .title-image[data-v-3b15c693]{width:20px;height:20px;border-radius:4px}.tooltip-title-wrapper .tooltip-sub-title[data-v-3b15c693]{color:var(--text-secondary)}.tooltip-title-wrapper .platform-icon[data-v-3b15c693]{color:var(--action-active)}
|