@mattilsynet/design 2.2.21 → 2.2.23
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/mtds/atlas/atlas-element.d.ts +3 -1
- package/mtds/atlas/atlas-element.js +54 -41
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas.css.js +91 -39
- package/mtds/atlas/atlas.css.js.map +1 -1
- package/mtds/atlas/atlas.stories.d.ts +1 -0
- package/mtds/atlas/cluster.js +1 -1
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +99 -47
- package/mtds/chart/chart-element.d.ts +1 -2
- package/mtds/chart/chart-element.js +41 -47
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart.css.js +60 -260
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.js +11 -10
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chart/chart.stories.d.ts +2 -0
- package/mtds/field/field-observer.js +40 -38
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.d.ts +1 -0
- package/mtds/field/field.js +100 -95
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.iife.js +74 -274
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +43 -43
- package/mtds/styles.module.css.js +35 -35
- package/mtds/utils.d.ts +10 -5
- package/mtds/utils.js +52 -47
- package/mtds/utils.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { MTDSElement } from '../utils';
|
|
2
2
|
export type ChartData = ReturnType<typeof toData>;
|
|
3
3
|
export declare class MTDSChartElement extends MTDSElement {
|
|
4
|
-
|
|
5
|
-
_resize?: ResizeObserver;
|
|
4
|
+
#private;
|
|
6
5
|
static get observedAttributes(): string[];
|
|
7
6
|
constructor();
|
|
8
7
|
connectedCallback(): void;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IS_BROWSER as
|
|
3
|
-
import
|
|
4
|
-
import { toAxis as
|
|
5
|
-
import { toBars as
|
|
1
|
+
import C from "../styles.module.css.js";
|
|
2
|
+
import { IS_BROWSER as g, tag as c, MTDSElement as v, onResize as k, onMutation as w, on as S, off as T, attr as d } from "../utils.js";
|
|
3
|
+
import R from "./chart.css.js";
|
|
4
|
+
import { toAxis as $ } from "./chart-axis.js";
|
|
5
|
+
import { toBars as x } from "./chart-bars.js";
|
|
6
6
|
import { toLines as O } from "./chart-lines.js";
|
|
7
|
-
import { toPies as
|
|
8
|
-
const u = "click,keydown,mousemove,mouseout", f = "mtds-chart-tooltip",
|
|
7
|
+
import { toPies as A } from "./chart-pies.js";
|
|
8
|
+
const u = "click,keydown,mousemove,mouseout", f = "mtds-chart-tooltip", i = g ? document.getElementById(f) || c("div", {
|
|
9
9
|
"aria-hidden": "true",
|
|
10
|
-
class:
|
|
10
|
+
class: C._tooltip,
|
|
11
11
|
hidden: "",
|
|
12
12
|
id: f
|
|
13
13
|
}) : null;
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_resize;
|
|
14
|
+
class L extends v {
|
|
15
|
+
#t;
|
|
16
|
+
#e;
|
|
18
17
|
static get observedAttributes() {
|
|
19
18
|
return ["data-variant", "data-aspect"];
|
|
20
19
|
}
|
|
@@ -22,69 +21,64 @@ class $ extends C {
|
|
|
22
21
|
super(), this.attachShadow({ mode: "open" });
|
|
23
22
|
}
|
|
24
23
|
connectedCallback() {
|
|
25
|
-
this
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
attributes: !0,
|
|
30
|
-
characterData: !0,
|
|
31
|
-
childList: !0,
|
|
32
|
-
subtree: !0
|
|
33
|
-
}), this.attributeChangedCallback(), w(this, u, this);
|
|
24
|
+
this.#e = k(() => this.handleResize(), this), this.#t = w(() => this.attributeChangedCallback(), {
|
|
25
|
+
attr: "data-tooltip",
|
|
26
|
+
root: this
|
|
27
|
+
}), this.attributeChangedCallback(), S(this, u, this);
|
|
34
28
|
}
|
|
35
29
|
disconnectedCallback() {
|
|
36
|
-
|
|
30
|
+
i && (i.hidden = !0), T(this, u, this), this.#e?.(), this.#t?.(), this.#t = this.#e = void 0;
|
|
37
31
|
}
|
|
38
32
|
attributeChangedCallback() {
|
|
39
33
|
Array.from(this.shadowRoot?.children || []).map((p) => p.remove());
|
|
40
|
-
const [t, e] = (d(this, "data-variant") || "column").split("-"),
|
|
34
|
+
const [t, e] = (d(this, "data-variant") || "column").split("-"), a = d(this, "data-aspect") || void 0, s = q(this.querySelector("table")), n = c("style", {}, R), r = c("div", {
|
|
41
35
|
"aria-hidden": "hidden",
|
|
42
36
|
class: "legends",
|
|
43
37
|
role: "group"
|
|
44
38
|
});
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
s.slice(1).forEach(([{ value: p, style: E }]) => {
|
|
40
|
+
r.appendChild(c("div", { class: "legend", style: E }, p));
|
|
47
41
|
});
|
|
48
|
-
const { axis: h, groups: m, total:
|
|
49
|
-
(t === "column" || t === "bar") && m.append(...
|
|
42
|
+
const { axis: h, groups: m, total: y } = $(s, { aspect: a, type: e });
|
|
43
|
+
(t === "column" || t === "bar") && m.append(...x(s)), (t === "line" || t === "area") && m.append(O(s, { total: y, variant: t, type: e })), (t === "doughnut" || t === "pie") && this.shadowRoot?.append(A(s, { aspect: a, variant: t })), this.shadowRoot?.append(h, r, n);
|
|
50
44
|
}
|
|
51
45
|
handleEvent(t) {
|
|
52
|
-
t.type === "click" || t.type === "keydown" ?
|
|
46
|
+
t.type === "click" || t.type === "keydown" ? P(t, this) : H(t);
|
|
53
47
|
}
|
|
54
48
|
handleResize() {
|
|
55
49
|
const t = this.shadowRoot?.firstElementChild, e = t?.firstElementChild;
|
|
56
50
|
t?.classList.toggle("axisStepsYHalf", (e?.offsetHeight || 0) < 400), t?.classList.toggle("axisStepsXHalf", (e?.offsetWidth || 0) < 500);
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
61
|
-
const e =
|
|
62
|
-
|
|
53
|
+
function P(o, t) {
|
|
54
|
+
if (o instanceof KeyboardEvent && o.key !== "Enter") return;
|
|
55
|
+
const e = o.composedPath()[0], a = t.querySelector("table"), [s, n] = e instanceof Element && d(e, "data-event")?.split("-").map(Number) || [];
|
|
56
|
+
a?.rows[s]?.cells[n]?.querySelector("a,button")?.click?.();
|
|
63
57
|
}
|
|
64
58
|
let b = "";
|
|
65
|
-
function
|
|
66
|
-
if (!
|
|
67
|
-
|
|
68
|
-
const t =
|
|
69
|
-
e && (
|
|
59
|
+
function H(o) {
|
|
60
|
+
if (!i) return;
|
|
61
|
+
i?.isConnected || document.body.append(i);
|
|
62
|
+
const t = o.composedPath()[0], e = t instanceof Element && t.getAttribute("aria-label") || "";
|
|
63
|
+
e && (i.style.transform = `translate(${o.pageX}px, ${o.pageY}px)`), e !== b && (e && (i.textContent = e), b = e, i.hidden = !e);
|
|
70
64
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
(t, e) => Array.from(t.cells, (
|
|
74
|
-
const
|
|
65
|
+
const l = (o) => o?.textContent?.trim() || "", q = (o) => Array.from(
|
|
66
|
+
o?.rows || [],
|
|
67
|
+
(t, e) => Array.from(t.cells, (a, s) => {
|
|
68
|
+
const n = l(t.cells[0]), r = l(o?.rows[0].cells[s]), h = `${n}: ${l(a)}${r ? ` (${r})` : ""}`;
|
|
75
69
|
return {
|
|
76
|
-
number:
|
|
70
|
+
number: s && e && Number.parseFloat(l(a)) || 0,
|
|
77
71
|
// First row and column is not a number
|
|
78
|
-
event:
|
|
72
|
+
event: a.querySelector("a,button") && `${e}-${s}`,
|
|
79
73
|
// Reference to proxy events
|
|
80
74
|
style: `--color: var(--mtdsc-chart-color-${e}, var(--mtdsc-chart-color-base))`,
|
|
81
|
-
value:
|
|
82
|
-
tooltip: d(
|
|
75
|
+
value: l(a),
|
|
76
|
+
tooltip: d(a, "data-tooltip") || h
|
|
83
77
|
};
|
|
84
78
|
})
|
|
85
79
|
);
|
|
86
|
-
|
|
80
|
+
g && !window.customElements.get("mtds-chart") && window.customElements.define("mtds-chart", L);
|
|
87
81
|
export {
|
|
88
|
-
|
|
82
|
+
L as MTDSChartElement
|
|
89
83
|
};
|
|
90
84
|
//# sourceMappingURL=chart-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {
|
|
1
|
+
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport {\n\tattr,\n\tIS_BROWSER,\n\tMTDSElement,\n\toff,\n\ton,\n\tonMutation,\n\tonResize,\n\ttag,\n} from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\nconst EVENTS = \"click,keydown,mousemove,mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = IS_BROWSER\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\tclass: styles._tooltip,\n\t\t\thidden: \"\",\n\t\t\tid: TOOLTIP_ID,\n\t\t})\n\t: null;\n\nexport class MTDSChartElement extends MTDSElement {\n\t#unmutate?: () => void;\n\t#unresize?: () => void;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-variant\", \"data-aspect\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\tconnectedCallback() {\n\t\tthis.#unresize = onResize(() => this.handleResize(), this);\n\t\tthis.#unmutate = onMutation(() => this.attributeChangedCallback(), {\n\t\t\tattr: \"data-tooltip\",\n\t\t\troot: this,\n\t\t});\n\t\tthis.attributeChangedCallback(); // Initial setup\n\t\ton(this, EVENTS, this);\n\t}\n\tdisconnectedCallback() {\n\t\tif (TOOLTIP) TOOLTIP.hidden = true;\n\t\toff(this, EVENTS, this);\n\t\tthis.#unresize?.();\n\t\tthis.#unmutate?.();\n\t\tthis.#unmutate = this.#unresize = undefined;\n\t}\n\tattributeChangedCallback() {\n\t\tArray.from(this.shadowRoot?.children || []).map((el) => el.remove()); // Clear shadowRoot\n\n\t\tconst [variant, type] = (attr(this, \"data-variant\") || \"column\").split(\"-\");\n\t\tconst aspect = attr(this, \"data-aspect\") || undefined;\n\t\tconst data = toData(this.querySelector(\"table\"));\n\t\tconst style = tag(\"style\", {}, css);\n\t\tconst legend = tag(\"div\", {\n\t\t\t\"aria-hidden\": \"hidden\",\n\t\t\tclass: \"legends\",\n\t\t\trole: \"group\",\n\t\t});\n\t\tdata.slice(1).forEach(([{ value, style }]) => {\n\t\t\tlegend.appendChild(tag(\"div\", { class: \"legend\", style }, value));\n\t\t});\n\n\t\tconst { axis, groups, total } = toAxis(data, { aspect, type });\n\t\tif (variant === \"column\" || variant === \"bar\")\n\t\t\tgroups.append(...toBars(data));\n\t\tif (variant === \"line\" || variant === \"area\")\n\t\t\tgroups.append(toLines(data, { total, variant, type }));\n\t\tif (variant === \"doughnut\" || variant === \"pie\")\n\t\t\tthis.shadowRoot?.append(toPies(data, { aspect, variant }));\n\n\t\tthis.shadowRoot?.append(axis, legend, style); // Axis must be first\n\t}\n\thandleEvent(e: Event) {\n\t\tif (e.type === \"click\" || e.type === \"keydown\") onClick(e, this);\n\t\telse onMoveTooltip(e as MouseEvent);\n\t}\n\thandleResize() {\n\t\tconst axis = this.shadowRoot?.firstElementChild as HTMLElement | null;\n\t\tconst steps = axis?.firstElementChild as HTMLElement | null;\n\t\taxis?.classList.toggle(\"axisStepsYHalf\", (steps?.offsetHeight || 0) < 400);\n\t\taxis?.classList.toggle(\"axisStepsXHalf\", (steps?.offsetWidth || 0) < 500);\n\t}\n}\n\nfunction onClick(event: Event, self: MTDSChartElement) {\n\tif (event instanceof KeyboardEvent && event.key !== \"Enter\") return; // Only handle enter key\n\tconst el = event.composedPath()[0];\n\tconst table = self.querySelector(\"table\");\n\tconst [tr, td] =\n\t\t(el instanceof Element && attr(el, \"data-event\")?.split(\"-\").map(Number)) ||\n\t\t[];\n\n\ttable?.rows[tr]?.cells[td]?.querySelector<HTMLElement>(\"a,button\")?.click?.();\n}\n\nlet TOOLTIP_TEXT = \"\";\nfunction onMoveTooltip(event: MouseEvent) {\n\tif (!TOOLTIP) return;\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\n\tconst el = event.composedPath()[0];\n\tconst tip = (el instanceof Element && el.getAttribute(\"aria-label\")) || \"\";\n\n\tif (tip)\n\t\tTOOLTIP.style.transform = `translate(${event.pageX}px, ${event.pageY}px)`;\n\tif (tip !== TOOLTIP_TEXT) {\n\t\tif (tip) TOOLTIP.textContent = tip;\n\t\tTOOLTIP_TEXT = tip;\n\t\tTOOLTIP.hidden = !tip;\n\t}\n}\n\nconst text = (el?: Element | null) => el?.textContent?.trim() || \"\"; // Helper to get trimmed text\nconst toData = (table?: HTMLTableElement | null) =>\n\tArray.from(table?.rows || [], (row, rowIndex) =>\n\t\tArray.from(row.cells, (cell, cellIndex) => {\n\t\t\tconst rowHeading = text(row.cells[0]);\n\t\t\tconst colHeading = text(table?.rows[0].cells[cellIndex]);\n\t\t\tconst tooltip = `${rowHeading}: ${text(cell)}${colHeading ? ` (${colHeading})` : \"\"}`;\n\n\t\t\treturn {\n\t\t\t\tnumber: (cellIndex && rowIndex && Number.parseFloat(text(cell))) || 0, // First row and column is not a number\n\t\t\t\tevent: cell.querySelector(\"a,button\") && `${rowIndex}-${cellIndex}`, // Reference to proxy events\n\t\t\t\tstyle: `--color: var(--mtdsc-chart-color-${rowIndex}, var(--mtdsc-chart-color-base))`,\n\t\t\t\tvalue: text(cell),\n\t\t\t\ttooltip: attr(cell, \"data-tooltip\") || tooltip,\n\t\t\t};\n\t\t}),\n\t);\n\nif (IS_BROWSER && !window.customElements.get(\"mtds-chart\"))\n\twindow.customElements.define(\"mtds-chart\", MTDSChartElement);\n"],"names":["EVENTS","TOOLTIP_ID","TOOLTIP","IS_BROWSER","tag","styles","MTDSChartElement","MTDSElement","#unmutate","#unresize","onResize","onMutation","on","off","el","variant","type","attr","aspect","data","toData","style","css","legend","value","axis","groups","total","toAxis","toBars","toLines","toPies","e","onClick","steps","event","self","table","tr","td","TOOLTIP_TEXT","onMoveTooltip","tip","text","row","rowIndex","cell","cellIndex","rowHeading","colHeading","tooltip"],"mappings":"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"}
|
package/mtds/chart/chart.css.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
const t =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
[data-event-proxy] {
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
}
|
|
1
|
+
const t = `/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
|
|
2
|
+
:host(:not([hidden])) { display: grid; gap: var(--mtds-6) }
|
|
3
|
+
[data-event] { cursor: pointer } /* Used to forward clicks from Chart ShaowDOM to relevant cell in child table */
|
|
9
4
|
|
|
10
|
-
.pie {
|
|
11
|
-
overflow: visible;
|
|
12
|
-
aspect-ratio: var(--mtdsc-chart-aspect);
|
|
13
|
-
}
|
|
5
|
+
.pie { overflow: visible; aspect-ratio: var(--mtdsc-chart-aspect) }
|
|
14
6
|
.pie > path {
|
|
15
7
|
fill: var(--color);
|
|
16
8
|
outline: none;
|
|
@@ -21,18 +13,15 @@ const t = `:host(:not([hidden])) {
|
|
|
21
13
|
vector-effect: non-scaling-stroke;
|
|
22
14
|
}
|
|
23
15
|
.pie > path:focus-visible,
|
|
24
|
-
.pie > path:hover {
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
16
|
+
.pie > path:hover { scale: 1.05 }
|
|
17
|
+
:host([data-steps="false"]) .axisStep::before,
|
|
28
18
|
:host([data-variant="doughnut"]) .axis,
|
|
29
|
-
:host([data-variant="pie"]) .axis {
|
|
30
|
-
|
|
31
|
-
}
|
|
19
|
+
:host([data-variant="pie"]) .axis { display: none }
|
|
20
|
+
:host([data-labels="false"]) .axisGroup::before { position: absolute; pointer-events: none; opacity: 0 } /* Keep available for screen readers */
|
|
32
21
|
|
|
33
22
|
.axis {
|
|
34
|
-
font-size: var(--mtds-body-sm-font-size);
|
|
35
23
|
display: grid;
|
|
24
|
+
font-size: var(--mtds-body-sm-font-size);
|
|
36
25
|
gap: var(--mtdsc-chart-axis-gap);
|
|
37
26
|
grid-template-columns: fit-content(7em) 1fr;
|
|
38
27
|
grid-template-rows: 1fr auto;
|
|
@@ -45,8 +34,7 @@ const t = `:host(:not([hidden])) {
|
|
|
45
34
|
border-bottom-left-radius: var(--mtdsc-chart-axis-edge-radius);
|
|
46
35
|
border-color: var(--mtdsc-chart-axis-edge-color);
|
|
47
36
|
border-style: solid;
|
|
48
|
-
border-width: 0 0 var(--mtdsc-chart-axis-edge-width)
|
|
49
|
-
var(--mtdsc-chart-axis-edge-width);
|
|
37
|
+
border-width: 0 0 var(--mtdsc-chart-axis-edge-width) var(--mtdsc-chart-axis-edge-width);
|
|
50
38
|
content: "";
|
|
51
39
|
grid-area: chart;
|
|
52
40
|
pointer-events: none;
|
|
@@ -56,20 +44,9 @@ const t = `:host(:not([hidden])) {
|
|
|
56
44
|
.axisSteps,
|
|
57
45
|
.axisStep,
|
|
58
46
|
.axisGroups,
|
|
59
|
-
.axisGroup {
|
|
60
|
-
box-sizing: border-box;
|
|
61
|
-
display: grid;
|
|
62
|
-
position: relative; /* Help .lineContainer positioning */
|
|
63
|
-
}
|
|
47
|
+
.axisGroup { box-sizing: border-box; display: grid; position: relative } /* Help .lineContainer positioning */
|
|
64
48
|
.axisGroups {
|
|
65
|
-
--gap: max(
|
|
66
|
-
1px,
|
|
67
|
-
clamp(
|
|
68
|
-
.5%,
|
|
69
|
-
calc(10% / var(--bars) * var(--groups)),
|
|
70
|
-
var(--mtdsc-chart-axis-gap)
|
|
71
|
-
)
|
|
72
|
-
);
|
|
49
|
+
--gap: max(1px, clamp(.5%, calc(10% / var(--bars) * var(--groups)), var(--mtdsc-chart-axis-gap)));
|
|
73
50
|
gap: var(--mtdsc-chart-axis-gap) var(--gap);
|
|
74
51
|
grid-area: chart / chart / x-axis / chart;
|
|
75
52
|
grid-auto-columns: 1fr;
|
|
@@ -77,83 +54,26 @@ const t = `:host(:not([hidden])) {
|
|
|
77
54
|
padding: 0 var(--mtdsc-chart-axis-gap);
|
|
78
55
|
text-align: center;
|
|
79
56
|
}
|
|
80
|
-
.axisGroup {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
.axisGroup::after {
|
|
85
|
-
content: attr(data-label);
|
|
86
|
-
direction: ltr; /* Prevent inherited rtl */
|
|
87
|
-
min-width: 0; /* Allow word-wrapping */
|
|
88
|
-
}
|
|
89
|
-
:host(:not([data-variant|="bar"])) {
|
|
90
|
-
.axisGroup::after {
|
|
91
|
-
justify-self: center;
|
|
92
|
-
text-align: start;
|
|
93
|
-
writing-mode: vertical-rl;
|
|
94
|
-
/* If wanting 45deg text: */
|
|
95
|
-
/* justify-self: center;
|
|
96
|
-
rotate: 45deg;
|
|
97
|
-
text-align: end;
|
|
98
|
-
writing-mode: sideways-lr;
|
|
99
|
-
transform-origin: 50% 0; */
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
.axisSteps {
|
|
103
|
-
align-items: end;
|
|
104
|
-
aspect-ratio: var(--mtdsc-chart-aspect);
|
|
105
|
-
grid-area: chart / y-axis / chart / chart;
|
|
106
|
-
grid-auto-rows: 1fr;
|
|
107
|
-
grid-template: 1px / subgrid;
|
|
108
|
-
}
|
|
109
|
-
.axisStep {
|
|
110
|
-
align-items: start;
|
|
111
|
-
grid-column: inherit;
|
|
112
|
-
grid-template-columns: inherit;
|
|
113
|
-
height: 1px;
|
|
114
|
-
text-align: right;
|
|
115
|
-
}
|
|
116
|
-
.axisStep::after {
|
|
117
|
-
border-bottom: var(--mtdsc-chart-axis-border);
|
|
118
|
-
content: "";
|
|
119
|
-
}
|
|
120
|
-
.axisStep::before {
|
|
121
|
-
content: attr(data-label);
|
|
122
|
-
translate: 0 -50%;
|
|
123
|
-
}
|
|
124
|
-
.axisStep[data-label="0"]::after {
|
|
125
|
-
opacity: 0; /* Hide 0 line as it overlapps with .axis::before */
|
|
126
|
-
}
|
|
57
|
+
.axisGroup { grid-row: inherit; grid-template: inherit }
|
|
58
|
+
.axisGroup::before { order: 1; content: attr(data-label); direction: ltr; min-width: 0 } /* Allow word-wrapping */
|
|
59
|
+
:host(:not([data-variant|="bar"])) { .axisGroup::before { justify-self: center; text-align: start; writing-mode: vertical-rl } }
|
|
127
60
|
|
|
128
|
-
|
|
129
|
-
:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
:host(:not([data-variant|="bar"]))
|
|
135
|
-
.axisStepsYHalf
|
|
136
|
-
.axisSteps:has(.axisStep:nth-last-child(even):first-child) {
|
|
137
|
-
grid-template-rows: 0.5fr;
|
|
138
|
-
}
|
|
61
|
+
.axisSteps { align-items: end; aspect-ratio: var(--mtdsc-chart-aspect); grid-area: chart / y-axis / chart / chart; grid-auto-rows: 1fr; grid-template: 1px / subgrid }
|
|
62
|
+
.axisStep { align-items: start; grid-column: inherit; grid-template-columns: inherit; height: 1px; text-align: right }
|
|
63
|
+
.axisStep::after { border-bottom: var(--mtdsc-chart-axis-border); content: "" }
|
|
64
|
+
.axisStep::before { content: attr(data-label) / ""; translate: 0 -50% } /* Hide form screen readers */
|
|
65
|
+
.axisStep[data-label="0"]::after { opacity: 0 } /* Hide 0 line as it overlapps with .axis::before */
|
|
139
66
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
:host([data-variant|="bar"])
|
|
144
|
-
|
|
145
|
-
.axisSteps:has(.axisStep:nth-last-child(even):first-child) {
|
|
146
|
-
grid-template-columns: 0.5fr;
|
|
147
|
-
}
|
|
67
|
+
/* Reduce amount of steps if small space */
|
|
68
|
+
:host(:not([data-variant|="bar"])) .axisStepsYHalf .axisStep:nth-last-child(even) { display: none }
|
|
69
|
+
:host(:not([data-variant|="bar"])) .axisStepsYHalf .axisSteps:has(.axisStep:nth-last-child(even):first-child) { grid-template-rows: 0.5fr }
|
|
70
|
+
:host([data-variant|="bar"]) .axisStepsXHalf .axisStep:nth-last-child(even) { display: none }
|
|
71
|
+
:host([data-variant|="bar"]) .axisStepsXHalf .axisSteps:has(.axisStep:nth-last-child(even):first-child) { grid-template-columns: 0.5fr }
|
|
148
72
|
|
|
149
73
|
:host([data-variant|="bar"]) .axisSteps,
|
|
150
|
-
:host([data-variant|="bar"]) .axisGroup {
|
|
151
|
-
direction: rtl; /* Reverse orders */
|
|
152
|
-
}
|
|
74
|
+
:host([data-variant|="bar"]) .axisGroup { direction: rtl }
|
|
153
75
|
:host([data-variant|="bar"]) .axisSteps > *,
|
|
154
|
-
:host([data-variant|="bar"]) .axisGroup > * {
|
|
155
|
-
direction: ltr;
|
|
156
|
-
}
|
|
76
|
+
:host([data-variant|="bar"]) .axisGroup > * { direction: ltr }
|
|
157
77
|
:host([data-variant|="bar"]) .axisGroups {
|
|
158
78
|
aspect-ratio: var(--mtdsc-chart-aspect);
|
|
159
79
|
gap: 1% var(--mtdsc-chart-axis-gap);
|
|
@@ -163,49 +83,17 @@ const t = `:host(:not([hidden])) {
|
|
|
163
83
|
row-gap: var(--mtdsc-chart-axis-gap);
|
|
164
84
|
text-align: right;
|
|
165
85
|
}
|
|
166
|
-
:host([data-variant|="bar"]) .axisGroup::
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
:host([data-variant|="bar"]) .
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
:host([data-variant|="bar"]) .axisSteps {
|
|
174
|
-
align-items: stretch;
|
|
175
|
-
aspect-ratio: auto;
|
|
176
|
-
grid-area: chart / chart / x-axis / chart;
|
|
177
|
-
grid-auto-columns: 1fr;
|
|
178
|
-
grid-template: subgrid / 1px;
|
|
179
|
-
}
|
|
180
|
-
:host([data-variant|="bar"]) .axisStep {
|
|
181
|
-
align-items: stretch;
|
|
182
|
-
grid-row: inherit;
|
|
183
|
-
grid-column: auto;
|
|
184
|
-
grid-template-rows: inherit;
|
|
185
|
-
grid-template-columns: none;
|
|
186
|
-
text-align: center;
|
|
187
|
-
}
|
|
188
|
-
:host([data-variant|="bar"]) .axisStep::after {
|
|
189
|
-
order: -1;
|
|
190
|
-
border-left: var(--mtdsc-chart-axis-border);
|
|
191
|
-
border-bottom: 0;
|
|
192
|
-
}
|
|
193
|
-
:host([data-variant|="bar"]) .axisStep::before {
|
|
194
|
-
translate: -50% 0;
|
|
195
|
-
}
|
|
86
|
+
:host([data-variant|="bar"]) .axisGroup::before { align-self: center }
|
|
87
|
+
:host([data-variant|="bar"]) .axisGroup { grid-column: inherit; grid-row: auto }
|
|
88
|
+
:host([data-variant|="bar"]) .axisSteps { align-items: stretch; aspect-ratio: auto; grid-area: chart / chart / x-axis / chart; grid-auto-columns: 1fr; grid-template: subgrid / 1px }
|
|
89
|
+
:host([data-variant|="bar"]) .axisStep { align-items: stretch; grid-row: inherit; grid-column: auto; grid-template-rows: inherit; grid-template-columns: none; text-align: center }
|
|
90
|
+
:host([data-variant|="bar"]) .axisStep::after { order: -1; border-left: var(--mtdsc-chart-axis-border); border-bottom: 0 }
|
|
91
|
+
:host([data-variant|="bar"]) .axisStep::before { translate: -50% 0 }
|
|
196
92
|
|
|
197
|
-
.axisGroupContent {
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
:host([data-variant="
|
|
201
|
-
flex-direction: column-reverse;
|
|
202
|
-
}
|
|
203
|
-
:host([data-variant="bar"]) .axisGroupContent {
|
|
204
|
-
flex-direction: column;
|
|
205
|
-
}
|
|
206
|
-
:host([data-variant="bar-stacked"]) .axisGroupContent {
|
|
207
|
-
flex-direction: row;
|
|
208
|
-
}
|
|
93
|
+
.axisGroupContent { display: flex }
|
|
94
|
+
:host([data-variant="column-stacked"]) .axisGroupContent { flex-direction: column-reverse }
|
|
95
|
+
:host([data-variant="bar"]) .axisGroupContent { flex-direction: column }
|
|
96
|
+
:host([data-variant="bar-stacked"]) .axisGroupContent { flex-direction: row }
|
|
209
97
|
|
|
210
98
|
.bar {
|
|
211
99
|
--size: calc(var(--value) / var(--total, 1) * 100%);
|
|
@@ -218,91 +106,30 @@ const t = `:host(:not([hidden])) {
|
|
|
218
106
|
width: 100%;
|
|
219
107
|
}
|
|
220
108
|
.bar:focus-visible,
|
|
221
|
-
.linePoint:focus-visible {
|
|
222
|
-
|
|
223
|
-
outline: var(--mtdsc-focus-outline);
|
|
224
|
-
outline-offset: var(--mtds-border-width-focus);
|
|
225
|
-
z-index: 2; /* z-index to place on top when outlined */
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
:host([data-variant|="bar"]) .bar {
|
|
229
|
-
border-radius: 0 var(--mtds-border-radius-sm) var(--mtds-border-radius-sm) 0;
|
|
230
|
-
width: var(--size);
|
|
231
|
-
height: 100%;
|
|
232
|
-
align-self: start;
|
|
233
|
-
}
|
|
109
|
+
.linePoint:focus-visible { box-shadow: var(--mtdsc-focus-boxShadow); outline: var(--mtdsc-focus-outline); outline-offset: var(--mtds-border-width-focus); z-index: 2 }
|
|
110
|
+
:host([data-variant|="bar"]) .bar { border-radius: 0 var(--mtds-border-radius-sm) var(--mtds-border-radius-sm) 0; width: var(--size); height: 100%; align-self: start }
|
|
234
111
|
|
|
235
112
|
/* Prevent double border - using margin to see border around bars */
|
|
236
113
|
/* Prevent double border - using border to avoid affecting size */
|
|
237
114
|
:host(:not([data-variant])) .bar + .bar,
|
|
238
|
-
:host([data-variant="column"]) .bar + .bar {
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
:host([data-variant="
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
:host([data-variant="bar-stacked"]) .bar:not(:last-child) {
|
|
251
|
-
border-radius: 0;
|
|
252
|
-
}
|
|
253
|
-
:host([data-variant="bar-stacked"]) .bar + .bar {
|
|
254
|
-
border-left: none;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.lineContainer {
|
|
258
|
-
align-items: flex-start;
|
|
259
|
-
display: flex;
|
|
260
|
-
justify-content: space-between;
|
|
261
|
-
pointer-events: none;
|
|
262
|
-
grid-row: chart;
|
|
263
|
-
}
|
|
264
|
-
.lineContainer > svg,
|
|
265
|
-
.lineContainer {
|
|
266
|
-
position: absolute;
|
|
267
|
-
width: 100%;
|
|
268
|
-
height: 100%;
|
|
269
|
-
}
|
|
270
|
-
.lineContainer > svg {
|
|
271
|
-
overflow: clip visible;
|
|
272
|
-
}
|
|
273
|
-
.lineContainer > div[role="listitem"] {
|
|
274
|
-
display: contents;
|
|
275
|
-
}
|
|
115
|
+
:host([data-variant="column"]) .bar + .bar { margin-left: -1px }
|
|
116
|
+
:host([data-variant="column-stacked"]) .bar:not(:last-child) { border-radius: 0 }
|
|
117
|
+
:host([data-variant="column-stacked"]) .bar + .bar { border-bottom: none }
|
|
118
|
+
:host([data-variant="bar"]) .bar + .bar { margin-top: -1px }
|
|
119
|
+
:host([data-variant="bar-stacked"]) .bar:not(:last-child) { border-radius: 0 }
|
|
120
|
+
:host([data-variant="bar-stacked"]) .bar + .bar { border-left: none }
|
|
121
|
+
|
|
122
|
+
.lineContainer { align-items: flex-start; display: flex; justify-content: space-between; pointer-events: none; grid-row: chart }
|
|
123
|
+
.lineContainer > svg, .lineContainer { position: absolute; width: 100%; height: 100% }
|
|
124
|
+
.lineContainer > svg { overflow: clip visible }
|
|
125
|
+
.lineContainer > div[role="listitem"] { display: contents }
|
|
276
126
|
|
|
277
127
|
:host([data-variant|="line"]) .axisGroups,
|
|
278
|
-
:host([data-variant|="area"]) .axisGroups {
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.line,
|
|
283
|
-
.lineShade {
|
|
284
|
-
fill: none;
|
|
285
|
-
stroke: var(--color);
|
|
286
|
-
stroke-linejoin: round;
|
|
287
|
-
stroke-linecap: round;
|
|
288
|
-
stroke-width: 1.5;
|
|
289
|
-
vector-effect: non-scaling-stroke;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.lineShade {
|
|
293
|
-
stroke: none;
|
|
294
|
-
fill: var(--color);
|
|
295
|
-
opacity: 0.3;
|
|
296
|
-
mask: linear-gradient(to bottom, black, transparent);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/* Ensure more contrast for line colors */
|
|
300
|
-
.line,
|
|
301
|
-
.linePoint,
|
|
302
|
-
:host:has(.linePoint) .legend::before {
|
|
303
|
-
filter: var(--_mtdsc-chart-line-filter);
|
|
304
|
-
}
|
|
128
|
+
:host([data-variant|="area"]) .axisGroups { padding: 0 }
|
|
129
|
+
.lineShade, .line { fill: none; stroke: var(--color); stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.5; vector-effect: non-scaling-stroke }
|
|
130
|
+
.lineShade { stroke: none; fill: var(--color); opacity: 0.3; mask: linear-gradient(to bottom, black, transparent) }
|
|
305
131
|
|
|
132
|
+
.linePoint, .line, :host:has(.linePoint) .legend::before { filter: var(--_mtdsc-chart-line-filter) } /* Ensure more contrast for line colors */
|
|
306
133
|
.linePoint {
|
|
307
134
|
--size: var(--mtds-2);
|
|
308
135
|
background: var(--color);
|
|
@@ -320,34 +147,13 @@ const t = `:host(:not([hidden])) {
|
|
|
320
147
|
z-index: 2;
|
|
321
148
|
}
|
|
322
149
|
.linePoint:focus-visible,
|
|
323
|
-
.linePoint:hover {
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
.linePoint::before {
|
|
327
|
-
content: "";
|
|
328
|
-
inset: calc(var(--mtds-3) * -1); /* Increase click surface */
|
|
329
|
-
position: absolute;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
:host([data-dots="false"]) .linePoint,
|
|
333
|
-
:host([data-dots="hidden"]) .linePoint,
|
|
334
|
-
:host([data-dots="none"]) .linePoint {
|
|
335
|
-
background: none;
|
|
336
|
-
border: none;
|
|
337
|
-
}
|
|
150
|
+
.linePoint:hover { scale: 1.3 }
|
|
151
|
+
.linePoint::before { content: ""; position: absolute; inset: calc(var(--mtds-3) * -1); /* Increase click surface */ }
|
|
152
|
+
:host([data-dots="false"]) .linePoint { background: none; border: none }
|
|
338
153
|
|
|
339
|
-
.legends {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
flex-wrap: wrap;
|
|
343
|
-
gap: var(--mtds-2) var(--mtds-5);
|
|
344
|
-
justify-content: center;
|
|
345
|
-
}
|
|
346
|
-
.legend {
|
|
347
|
-
display: flex;
|
|
348
|
-
align-items: center;
|
|
349
|
-
gap: var(--mtds-2);
|
|
350
|
-
}
|
|
154
|
+
:host([data-legend="false"]) .legends { display: none }
|
|
155
|
+
.legends { align-items: center; display: flex; flex-wrap: wrap; gap: var(--mtds-2) var(--mtds-5); justify-content: center }
|
|
156
|
+
.legend { display: flex; align-items: center; gap: var(--mtds-2) }
|
|
351
157
|
.legend::before {
|
|
352
158
|
background: var(--color);
|
|
353
159
|
border-radius: var(--mtds-border-radius-full);
|
|
@@ -359,12 +165,6 @@ const t = `:host(:not([hidden])) {
|
|
|
359
165
|
vertical-align: middle;
|
|
360
166
|
width: var(--mtds-5);
|
|
361
167
|
}
|
|
362
|
-
|
|
363
|
-
:host([data-legend="false"]) .legends,
|
|
364
|
-
:host([data-legend="hidden"]) .legends,
|
|
365
|
-
:host([data-legend="none"]) .legends {
|
|
366
|
-
display: none;
|
|
367
|
-
}
|
|
368
168
|
`;
|
|
369
169
|
export {
|
|
370
170
|
t as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.css.js","sources":["../../designsystem/chart/chart.css?raw"],"sourcesContent":["export default \":host(:not([hidden])) {\\n\\tdisplay: grid;\\n\\tgap: var(--ds-size-6);\\n}\\n\\n[data-event-proxy] {\\n\\tcursor: pointer;\\n}\\n\\n.pie {\\n\\toverflow: visible;\\n\\taspect-ratio: var(--mtdsc-chart-aspect);\\n}\\n.pie > path {\\n\\tfill: var(--color);\\n\\toutline: none;\\n\\tstroke-width: var(--mtdsc-chart-border-width);\\n\\tstroke: var(--mtdsc-chart-border-color);\\n\\ttransform-origin: center;\\n\\ttransition: scale 0.2s;\\n\\tvector-effect: non-scaling-stroke;\\n}\\n.pie > path:focus-visible,\\n.pie > path:hover {\\n\\tscale: 1.05;\\n}\\n\\n:host([data-variant=\\\"doughnut\\\"]) .axis,\\n:host([data-variant=\\\"pie\\\"]) .axis {\\n\\tdisplay: none;\\n}\\n\\n.axis {\\n\\tfont-size: var(--ds-body-sm-font-size);\\n\\tdisplay: grid;\\n\\tgap: var(--mtdsc-chart-axis-gap);\\n\\tgrid-template-columns: fit-content(7em) 1fr;\\n\\tgrid-template-rows: 1fr auto;\\n\\tgrid-template-areas:\\n\\t\\t\\\"y-axis chart\\\"\\n\\t\\t\\\"y-axis x-axis\\\";\\n}\\n\\n.axis::before {\\n\\tborder-bottom-left-radius: var(--mtdsc-chart-axis-edge-radius);\\n\\tborder-color: var(--mtdsc-chart-axis-edge-color);\\n\\tborder-style: solid;\\n\\tborder-width: 0 0 var(--mtdsc-chart-axis-edge-width)\\n\\t\\tvar(--mtdsc-chart-axis-edge-width);\\n\\tcontent: \\\"\\\";\\n\\tgrid-area: chart;\\n\\tpointer-events: none;\\n\\tz-index: 2;\\n}\\n\\n.axisSteps,\\n.axisStep,\\n.axisGroups,\\n.axisGroup {\\n\\tbox-sizing: border-box;\\n\\tdisplay: grid;\\n\\tposition: relative; /* Help .lineContainer positioning */\\n}\\n.axisGroups {\\n\\t--gap: max(\\n\\t\\t1px,\\n\\t\\tclamp(\\n\\t\\t\\t.5%,\\n\\t\\t\\tcalc(10% / var(--bars) * var(--groups)),\\n\\t\\t\\tvar(--mtdsc-chart-axis-gap)\\n\\t\\t)\\n\\t);\\n\\tgap: var(--mtdsc-chart-axis-gap) var(--gap);\\n\\tgrid-area: chart / chart / x-axis / chart;\\n\\tgrid-auto-columns: 1fr;\\n\\tgrid-template-rows: subgrid;\\n\\tpadding: 0 var(--mtdsc-chart-axis-gap);\\n\\ttext-align: center;\\n}\\n.axisGroup {\\n\\tgrid-row: inherit;\\n\\tgrid-template: inherit;\\n}\\n.axisGroup::after {\\n\\tcontent: attr(data-label);\\n\\tdirection: ltr; /* Prevent inherited rtl */\\n\\tmin-width: 0; /* Allow word-wrapping */\\n}\\n:host(:not([data-variant|=\\\"bar\\\"])) {\\n\\t.axisGroup::after {\\n\\t\\tjustify-self: center;\\n\\t\\ttext-align: start;\\n\\t\\twriting-mode: vertical-rl;\\n\\t\\t/* If wanting 45deg text: */\\n\\t\\t/* justify-self: center;\\n\\t\\trotate: 45deg;\\n\\t\\ttext-align: end;\\n\\t\\twriting-mode: sideways-lr;\\n\\t\\ttransform-origin: 50% 0; */\\n\\t}\\n}\\n.axisSteps {\\n\\talign-items: end;\\n\\taspect-ratio: var(--mtdsc-chart-aspect);\\n\\tgrid-area: chart / y-axis / chart / chart;\\n\\tgrid-auto-rows: 1fr;\\n\\tgrid-template: 1px / subgrid;\\n}\\n.axisStep {\\n\\talign-items: start;\\n\\tgrid-column: inherit;\\n\\tgrid-template-columns: inherit;\\n\\theight: 1px;\\n\\ttext-align: right;\\n}\\n.axisStep::after {\\n\\tborder-bottom: var(--mtdsc-chart-axis-border);\\n\\tcontent: \\\"\\\";\\n}\\n.axisStep::before {\\n\\tcontent: attr(data-label);\\n\\ttranslate: 0 -50%;\\n}\\n.axisStep[data-label=\\\"0\\\"]::after {\\n\\topacity: 0; /* Hide 0 line as it overlapps with .axis::before */\\n}\\n\\n/* Reduce amount of steps if small space */\\n:host(:not([data-variant|=\\\"bar\\\"]))\\n\\t.axisStepsYHalf\\n\\t.axisStep:nth-last-child(even) {\\n\\tdisplay: none;\\n}\\n:host(:not([data-variant|=\\\"bar\\\"]))\\n\\t.axisStepsYHalf\\n\\t.axisSteps:has(.axisStep:nth-last-child(even):first-child) {\\n\\tgrid-template-rows: 0.5fr;\\n}\\n\\n:host([data-variant|=\\\"bar\\\"]) .axisStepsXHalf .axisStep:nth-last-child(even) {\\n\\tdisplay: none;\\n}\\n:host([data-variant|=\\\"bar\\\"])\\n\\t.axisStepsXHalf\\n\\t.axisSteps:has(.axisStep:nth-last-child(even):first-child) {\\n\\tgrid-template-columns: 0.5fr;\\n}\\n\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps,\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup {\\n\\tdirection: rtl; /* Reverse orders */\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps > *,\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup > * {\\n\\tdirection: ltr;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisGroups {\\n\\taspect-ratio: var(--mtdsc-chart-aspect);\\n\\tgap: 1% var(--mtdsc-chart-axis-gap);\\n\\tgrid-area: chart / y-axis / chart / chart;\\n\\tgrid-template: none / subgrid;\\n\\tpadding: var(--mtdsc-chart-axis-gap) 0;\\n\\trow-gap: var(--mtdsc-chart-axis-gap);\\n\\ttext-align: right;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup::after {\\n\\talign-self: center; /* Since text-align does not work vertically */\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup {\\n\\tgrid-column: inherit;\\n\\tgrid-row: auto;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps {\\n\\talign-items: stretch;\\n\\taspect-ratio: auto;\\n\\tgrid-area: chart / chart / x-axis / chart;\\n\\tgrid-auto-columns: 1fr;\\n\\tgrid-template: subgrid / 1px;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisStep {\\n\\talign-items: stretch;\\n\\tgrid-row: inherit;\\n\\tgrid-column: auto;\\n\\tgrid-template-rows: inherit;\\n\\tgrid-template-columns: none;\\n\\ttext-align: center;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisStep::after {\\n\\torder: -1;\\n\\tborder-left: var(--mtdsc-chart-axis-border);\\n\\tborder-bottom: 0;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisStep::before {\\n\\ttranslate: -50% 0;\\n}\\n\\n.axisGroupContent {\\n\\tdisplay: flex;\\n}\\n:host([data-variant=\\\"column-stacked\\\"]) .axisGroupContent {\\n\\tflex-direction: column-reverse;\\n}\\n:host([data-variant=\\\"bar\\\"]) .axisGroupContent {\\n\\tflex-direction: column;\\n}\\n:host([data-variant=\\\"bar-stacked\\\"]) .axisGroupContent {\\n\\tflex-direction: row;\\n}\\n\\n.bar {\\n\\t--size: calc(var(--value) / var(--total, 1) * 100%);\\n\\talign-self: end;\\n\\tbackground: var(--color);\\n\\tborder: var(--mtdsc-chart-border-color) solid var(--mtdsc-chart-border-width);\\n\\tborder-radius: var(--ds-border-radius-sm) var(--ds-border-radius-sm) 0 0;\\n\\tbox-sizing: border-box;\\n\\theight: var(--size);\\n\\twidth: 100%;\\n}\\n.bar:focus-visible,\\n.linePoint:focus-visible {\\n\\tbox-shadow: var(--dsc-focus-boxShadow);\\n\\toutline: var(--dsc-focus-outline);\\n\\toutline-offset: var(--ds-border-width-focus);\\n\\tz-index: 2; /* z-index to place on top when outlined */\\n}\\n\\n:host([data-variant|=\\\"bar\\\"]) .bar {\\n\\tborder-radius: 0 var(--ds-border-radius-sm) var(--ds-border-radius-sm) 0;\\n\\twidth: var(--size);\\n\\theight: 100%;\\n\\talign-self: start;\\n}\\n\\n/* Prevent double border - using margin to see border around bars */\\n/* Prevent double border - using border to avoid affecting size */\\n:host(:not([data-variant])) .bar + .bar,\\n:host([data-variant=\\\"column\\\"]) .bar + .bar {\\n\\tmargin-left: -1px;\\n}\\n:host([data-variant=\\\"column-stacked\\\"]) .bar:not(:last-child) {\\n\\tborder-radius: 0;\\n}\\n:host([data-variant=\\\"column-stacked\\\"]) .bar + .bar {\\n\\tborder-bottom: none;\\n}\\n:host([data-variant=\\\"bar\\\"]) .bar + .bar {\\n\\tmargin-top: -1px;\\n}\\n:host([data-variant=\\\"bar-stacked\\\"]) .bar:not(:last-child) {\\n\\tborder-radius: 0;\\n}\\n:host([data-variant=\\\"bar-stacked\\\"]) .bar + .bar {\\n\\tborder-left: none;\\n}\\n\\n.lineContainer {\\n\\talign-items: flex-start;\\n\\tdisplay: flex;\\n\\tjustify-content: space-between;\\n\\tpointer-events: none;\\n\\tgrid-row: chart;\\n}\\n.lineContainer > svg,\\n.lineContainer {\\n\\tposition: absolute;\\n\\twidth: 100%;\\n\\theight: 100%;\\n}\\n.lineContainer > svg {\\n\\toverflow: clip visible;\\n}\\n.lineContainer > div[role=\\\"listitem\\\"] {\\n\\tdisplay: contents;\\n}\\n\\n:host([data-variant|=\\\"line\\\"]) .axisGroups,\\n:host([data-variant|=\\\"area\\\"]) .axisGroups {\\n\\tpadding: 0;\\n}\\n\\n.line,\\n.lineShade {\\n\\tfill: none;\\n\\tstroke: var(--color);\\n\\tstroke-linejoin: round;\\n\\tstroke-linecap: round;\\n\\tstroke-width: 1.5;\\n\\tvector-effect: non-scaling-stroke;\\n}\\n\\n.lineShade {\\n\\tstroke: none;\\n\\tfill: var(--color);\\n\\topacity: 0.3;\\n\\tmask: linear-gradient(to bottom, black, transparent);\\n}\\n\\n/* Ensure more contrast for line colors */\\n.line,\\n.linePoint,\\n:host:has(.linePoint) .legend::before {\\n\\tfilter: var(--_mtdsc-chart-line-filter);\\n}\\n\\n.linePoint {\\n\\t--size: var(--ds-size-2);\\n\\tbackground: var(--color);\\n\\tborder-radius: var(--ds-border-radius-full);\\n\\tborder: var(--mtdsc-chart-border-width) solid var(--mtdsc-chart-border-color);\\n\\tbox-sizing: border-box;\\n\\theight: var(--size);\\n\\tmargin: calc(var(--size) / -2);\\n\\tpadding: 0;\\n\\tpointer-events: all;\\n\\tposition: relative;\\n\\ttop: calc(100% - var(--value) / var(--total, 1) * 100%);\\n\\ttransition: scale 0.2s;\\n\\twidth: var(--size);\\n\\tz-index: 2;\\n}\\n.linePoint:focus-visible,\\n.linePoint:hover {\\n\\tscale: 1.3;\\n}\\n.linePoint::before {\\n\\tcontent: \\\"\\\";\\n\\tinset: calc(var(--ds-size-3) * -1); /* Increase click surface */\\n\\tposition: absolute;\\n}\\n\\n:host([data-dots=\\\"false\\\"]) .linePoint,\\n:host([data-dots=\\\"hidden\\\"]) .linePoint,\\n:host([data-dots=\\\"none\\\"]) .linePoint {\\n\\tbackground: none;\\n\\tborder: none;\\n}\\n\\n.legends {\\n\\talign-items: center;\\n\\tdisplay: flex;\\n\\tflex-wrap: wrap;\\n\\tgap: var(--ds-size-2) var(--ds-size-5);\\n\\tjustify-content: center;\\n}\\n.legend {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tgap: var(--ds-size-2);\\n}\\n.legend::before {\\n\\tbackground: var(--color);\\n\\tborder-radius: var(--ds-border-radius-full);\\n\\tborder: var(--mtdsc-chart-border-color) solid var(--mtdsc-chart-border-width);\\n\\tbox-sizing: border-box;\\n\\tcontent: \\\"\\\";\\n\\tdisplay: inline-block;\\n\\theight: var(--ds-size-5);\\n\\tvertical-align: middle;\\n\\twidth: var(--ds-size-5);\\n}\\n\\n:host([data-legend=\\\"false\\\"]) .legends,\\n:host([data-legend=\\\"hidden\\\"]) .legends,\\n:host([data-legend=\\\"none\\\"]) .legends {\\n\\tdisplay: none;\\n}\\n\""],"names":["css"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"chart.css.js","sources":["../../designsystem/chart/chart.css?raw"],"sourcesContent":["export default \"/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */\\n:host(:not([hidden])) { display: grid; gap: var(--mtds-6) }\\n[data-event] { cursor: pointer } /* Used to forward clicks from Chart ShaowDOM to relevant cell in child table */\\n\\n.pie { overflow: visible; aspect-ratio: var(--mtdsc-chart-aspect) }\\n.pie > path {\\n\\tfill: var(--color);\\n\\toutline: none;\\n\\tstroke-width: var(--mtdsc-chart-border-width);\\n\\tstroke: var(--mtdsc-chart-border-color);\\n\\ttransform-origin: center;\\n\\ttransition: scale 0.2s;\\n\\tvector-effect: non-scaling-stroke;\\n}\\n.pie > path:focus-visible,\\n.pie > path:hover { scale: 1.05 }\\n:host([data-steps=\\\"false\\\"]) .axisStep::before,\\n:host([data-variant=\\\"doughnut\\\"]) .axis,\\n:host([data-variant=\\\"pie\\\"]) .axis { display: none }\\n:host([data-labels=\\\"false\\\"]) .axisGroup::before { position: absolute; pointer-events: none; opacity: 0 } /* Keep available for screen readers */\\n\\n.axis {\\n\\tdisplay: grid;\\n\\tfont-size: var(--mtds-body-sm-font-size);\\n\\tgap: var(--mtdsc-chart-axis-gap);\\n\\tgrid-template-columns: fit-content(7em) 1fr;\\n\\tgrid-template-rows: 1fr auto;\\n\\tgrid-template-areas:\\n\\t\\t\\\"y-axis chart\\\"\\n\\t\\t\\\"y-axis x-axis\\\";\\n}\\n\\n.axis::before {\\n\\tborder-bottom-left-radius: var(--mtdsc-chart-axis-edge-radius);\\n\\tborder-color: var(--mtdsc-chart-axis-edge-color);\\n\\tborder-style: solid;\\n\\tborder-width: 0 0 var(--mtdsc-chart-axis-edge-width) var(--mtdsc-chart-axis-edge-width);\\n\\tcontent: \\\"\\\";\\n\\tgrid-area: chart;\\n\\tpointer-events: none;\\n\\tz-index: 2;\\n}\\n\\n.axisSteps,\\n.axisStep,\\n.axisGroups,\\n.axisGroup { box-sizing: border-box; display: grid; position: relative } /* Help .lineContainer positioning */\\n.axisGroups {\\n\\t--gap: max(1px, clamp(.5%, calc(10% / var(--bars) * var(--groups)), var(--mtdsc-chart-axis-gap)));\\n\\tgap: var(--mtdsc-chart-axis-gap) var(--gap);\\n\\tgrid-area: chart / chart / x-axis / chart;\\n\\tgrid-auto-columns: 1fr;\\n\\tgrid-template-rows: subgrid;\\n\\tpadding: 0 var(--mtdsc-chart-axis-gap);\\n\\ttext-align: center;\\n}\\n.axisGroup { grid-row: inherit; grid-template: inherit }\\n.axisGroup::before { order: 1; content: attr(data-label); direction: ltr; min-width: 0 } /* Allow word-wrapping */\\n:host(:not([data-variant|=\\\"bar\\\"])) { .axisGroup::before { justify-self: center; text-align: start; writing-mode: vertical-rl } }\\n\\n.axisSteps { align-items: end; aspect-ratio: var(--mtdsc-chart-aspect); grid-area: chart / y-axis / chart / chart; grid-auto-rows: 1fr; grid-template: 1px / subgrid }\\n.axisStep { align-items: start; grid-column: inherit; grid-template-columns: inherit; height: 1px; text-align: right }\\n.axisStep::after { border-bottom: var(--mtdsc-chart-axis-border); content: \\\"\\\" }\\n.axisStep::before { content: attr(data-label) / \\\"\\\"; translate: 0 -50% } /* Hide form screen readers */\\n.axisStep[data-label=\\\"0\\\"]::after { opacity: 0 } /* Hide 0 line as it overlapps with .axis::before */\\n\\n/* Reduce amount of steps if small space */\\n:host(:not([data-variant|=\\\"bar\\\"])) .axisStepsYHalf .axisStep:nth-last-child(even) { display: none }\\n:host(:not([data-variant|=\\\"bar\\\"])) .axisStepsYHalf .axisSteps:has(.axisStep:nth-last-child(even):first-child) { grid-template-rows: 0.5fr }\\n:host([data-variant|=\\\"bar\\\"]) .axisStepsXHalf .axisStep:nth-last-child(even) { display: none }\\n:host([data-variant|=\\\"bar\\\"]) .axisStepsXHalf .axisSteps:has(.axisStep:nth-last-child(even):first-child) { grid-template-columns: 0.5fr }\\n\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps,\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup { direction: rtl }\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps > *,\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup > * { direction: ltr }\\n:host([data-variant|=\\\"bar\\\"]) .axisGroups {\\n\\taspect-ratio: var(--mtdsc-chart-aspect);\\n\\tgap: 1% var(--mtdsc-chart-axis-gap);\\n\\tgrid-area: chart / y-axis / chart / chart;\\n\\tgrid-template: none / subgrid;\\n\\tpadding: var(--mtdsc-chart-axis-gap) 0;\\n\\trow-gap: var(--mtdsc-chart-axis-gap);\\n\\ttext-align: right;\\n}\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup::before { align-self: center }\\n:host([data-variant|=\\\"bar\\\"]) .axisGroup { grid-column: inherit; grid-row: auto }\\n:host([data-variant|=\\\"bar\\\"]) .axisSteps { align-items: stretch; aspect-ratio: auto; grid-area: chart / chart / x-axis / chart; grid-auto-columns: 1fr; grid-template: subgrid / 1px }\\n:host([data-variant|=\\\"bar\\\"]) .axisStep { align-items: stretch; grid-row: inherit; grid-column: auto; grid-template-rows: inherit; grid-template-columns: none; text-align: center }\\n:host([data-variant|=\\\"bar\\\"]) .axisStep::after { order: -1; border-left: var(--mtdsc-chart-axis-border); border-bottom: 0 }\\n:host([data-variant|=\\\"bar\\\"]) .axisStep::before { translate: -50% 0 }\\n\\n.axisGroupContent { display: flex }\\n:host([data-variant=\\\"column-stacked\\\"]) .axisGroupContent { flex-direction: column-reverse }\\n:host([data-variant=\\\"bar\\\"]) .axisGroupContent { flex-direction: column }\\n:host([data-variant=\\\"bar-stacked\\\"]) .axisGroupContent { flex-direction: row }\\n\\n.bar {\\n\\t--size: calc(var(--value) / var(--total, 1) * 100%);\\n\\talign-self: end;\\n\\tbackground: var(--color);\\n\\tborder: var(--mtdsc-chart-border-color) solid var(--mtdsc-chart-border-width);\\n\\tborder-radius: var(--mtds-border-radius-sm) var(--mtds-border-radius-sm) 0 0;\\n\\tbox-sizing: border-box;\\n\\theight: var(--size);\\n\\twidth: 100%;\\n}\\n.bar:focus-visible,\\n.linePoint:focus-visible { box-shadow: var(--mtdsc-focus-boxShadow); outline: var(--mtdsc-focus-outline); outline-offset: var(--mtds-border-width-focus); z-index: 2 }\\n:host([data-variant|=\\\"bar\\\"]) .bar { border-radius: 0 var(--mtds-border-radius-sm) var(--mtds-border-radius-sm) 0; width: var(--size); height: 100%; align-self: start }\\n\\n/* Prevent double border - using margin to see border around bars */\\n/* Prevent double border - using border to avoid affecting size */\\n:host(:not([data-variant])) .bar + .bar,\\n:host([data-variant=\\\"column\\\"]) .bar + .bar { margin-left: -1px }\\n:host([data-variant=\\\"column-stacked\\\"]) .bar:not(:last-child) { border-radius: 0 }\\n:host([data-variant=\\\"column-stacked\\\"]) .bar + .bar { border-bottom: none }\\n:host([data-variant=\\\"bar\\\"]) .bar + .bar { margin-top: -1px }\\n:host([data-variant=\\\"bar-stacked\\\"]) .bar:not(:last-child) { border-radius: 0 }\\n:host([data-variant=\\\"bar-stacked\\\"]) .bar + .bar { border-left: none }\\n\\n.lineContainer { align-items: flex-start; display: flex; justify-content: space-between; pointer-events: none; grid-row: chart }\\n.lineContainer > svg, .lineContainer { position: absolute; width: 100%; height: 100% }\\n.lineContainer > svg { overflow: clip visible }\\n.lineContainer > div[role=\\\"listitem\\\"] { display: contents }\\n\\n:host([data-variant|=\\\"line\\\"]) .axisGroups,\\n:host([data-variant|=\\\"area\\\"]) .axisGroups { padding: 0 }\\n.lineShade, .line { fill: none; stroke: var(--color); stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.5; vector-effect: non-scaling-stroke }\\n.lineShade { stroke: none; fill: var(--color); opacity: 0.3; mask: linear-gradient(to bottom, black, transparent) }\\n\\n.linePoint, .line, :host:has(.linePoint) .legend::before { filter: var(--_mtdsc-chart-line-filter) } /* Ensure more contrast for line colors */\\n.linePoint {\\n\\t--size: var(--mtds-2);\\n\\tbackground: var(--color);\\n\\tborder-radius: var(--mtds-border-radius-full);\\n\\tborder: var(--mtdsc-chart-border-width) solid var(--mtdsc-chart-border-color);\\n\\tbox-sizing: border-box;\\n\\theight: var(--size);\\n\\tmargin: calc(var(--size) / -2);\\n\\tpadding: 0;\\n\\tpointer-events: all;\\n\\tposition: relative;\\n\\ttop: calc(100% - var(--value) / var(--total, 1) * 100%);\\n\\ttransition: scale 0.2s;\\n\\twidth: var(--size);\\n\\tz-index: 2;\\n}\\n.linePoint:focus-visible,\\n.linePoint:hover { scale: 1.3 }\\n.linePoint::before { content: \\\"\\\"; position: absolute; inset: calc(var(--mtds-3) * -1); /* Increase click surface */ }\\n:host([data-dots=\\\"false\\\"]) .linePoint { background: none; border: none }\\n\\n:host([data-legend=\\\"false\\\"]) .legends { display: none }\\n.legends { align-items: center; display: flex; flex-wrap: wrap; gap: var(--mtds-2) var(--mtds-5); justify-content: center }\\n.legend { display: flex; align-items: center; gap: var(--mtds-2) }\\n.legend::before {\\n\\tbackground: var(--color);\\n\\tborder-radius: var(--mtds-border-radius-full);\\n\\tborder: var(--mtdsc-chart-border-color) solid var(--mtdsc-chart-border-width);\\n\\tbox-sizing: border-box;\\n\\tcontent: \\\"\\\";\\n\\tdisplay: inline-block;\\n\\theight: var(--mtds-5);\\n\\tvertical-align: middle;\\n\\twidth: var(--mtds-5);\\n}\\n\""],"names":["css"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|