@mozaic-ds/web-components 0.4.1-beta.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/ClickOutside-63071e7a.js +15 -1
- package/public/ClickOutside-63071e7a.js.map +1 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js +759 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
- package/public/DataTableUtilities-60220c78.js +370 -1
- package/public/DataTableUtilities-60220c78.js.map +1 -1
- package/public/EventForward-8492ff62.js +109 -1
- package/public/EventForward-8492ff62.js.map +1 -1
- package/public/EventHandler-02058705.js +15 -1
- package/public/EventHandler-02058705.js.map +1 -1
- package/public/array-5b770a93.js +13 -1
- package/public/array-5b770a93.js.map +1 -1
- package/public/axis-fbc0f7b5.js +174 -1
- package/public/axis-fbc0f7b5.js.map +1 -1
- package/public/band-d7a07d2c.js +186 -1
- package/public/band-d7a07d2c.js.map +1 -1
- package/public/components/accordion/Accordion.js +365 -1
- package/public/components/accordion/Accordion.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.js +1515 -1
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/badge/Badge.js +155 -1
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.nested.js +101 -1
- package/public/components/badge/Badge.nested.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.js +372 -1
- package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js +319 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
- package/public/components/button/Button.js +1138 -1
- package/public/components/button/Button.js.map +1 -1
- package/public/components/card/Card.js +369 -1
- package/public/components/card/Card.js.map +1 -1
- package/public/components/chart/BarChart.js +582 -1
- package/public/components/chart/BarChart.js.map +1 -1
- package/public/components/chart/Donut.js +1189 -1
- package/public/components/chart/Donut.js.map +1 -1
- package/public/components/chart/GroupedBarChart.js +750 -1
- package/public/components/chart/GroupedBarChart.js.map +1 -1
- package/public/components/chart/LineChart.js +1731 -1
- package/public/components/chart/LineChart.js.map +1 -1
- package/public/components/chart/Radar.js +729 -1
- package/public/components/chart/Radar.js.map +1 -1
- package/public/components/chart/StackedBarChart.js +745 -1
- package/public/components/chart/StackedBarChart.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +307 -1
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js +404 -1
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/datatable/DataTable.js +3064 -1
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTableDefaultAction.nested.js +4 -1
- package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +164 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +380 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js +424 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +263 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +637 -1
- package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
- package/public/components/dropdown/Dropdown.js +1426 -1
- package/public/components/dropdown/Dropdown.js.map +1 -1
- package/public/components/field/Field.js +375 -1
- package/public/components/field/Field.js.map +1 -1
- package/public/components/fileuploader/FileUploader.js +555 -1
- package/public/components/fileuploader/FileUploader.js.map +1 -1
- package/public/components/fileuploader/ResultFile.nested.js +265 -1
- package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/components/flag/Flag.js +174 -1
- package/public/components/flag/Flag.js.map +1 -1
- package/public/components/header/Header.js +903 -1
- package/public/components/header/Header.js.map +1 -1
- package/public/components/hero/Hero.js +271 -1
- package/public/components/hero/Hero.js.map +1 -1
- package/public/components/layer/Layer.js +453 -1
- package/public/components/layer/Layer.js.map +1 -1
- package/public/components/link/Link.js +380 -1
- package/public/components/link/Link.js.map +1 -1
- package/public/components/listbox/Listbox.js +595 -1
- package/public/components/listbox/Listbox.js.map +1 -1
- package/public/components/listbox/Listbox.nested.js +629 -1
- package/public/components/listbox/Listbox.nested.js.map +1 -1
- package/public/components/loader/Loader.js +246 -1
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.nested.js +176 -1
- package/public/components/loader/Loader.nested.js.map +1 -1
- package/public/components/modal/Modal.js +395 -1
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/notification/Notification.js +458 -1
- package/public/components/notification/Notification.js.map +1 -1
- package/public/components/optionbutton/OptionButton.js +316 -1
- package/public/components/optionbutton/OptionButton.js.map +1 -1
- package/public/components/overlay/Overlay.js +104 -1
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/OverlayLoader.js +151 -1
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/pagination/Pagination.js +613 -1
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/passwordinput/PasswordInput.js +291 -1
- package/public/components/passwordinput/PasswordInput.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.js +6894 -1
- package/public/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/components/price/Price.js +768 -1
- package/public/components/price/Price.js.map +1 -1
- package/public/components/progressbar/ProgressBar.js +278 -1
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.js +333 -1
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/radio/Radio.js +273 -1
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.js +414 -1
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/ratings/StarsInput.js +292 -1
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/ratings/StarsResult.js +246 -1
- package/public/components/ratings/StarsResult.js.map +1 -1
- package/public/components/select/Select.js +451 -1
- package/public/components/select/Select.js.map +1 -1
- package/public/components/sidebar/Sidebar.js +784 -1
- package/public/components/sidebar/Sidebar.js.map +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js +594 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-feature.nested.js +402 -1
- package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-section.nested.js +394 -1
- package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +200 -1
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-separator.nested.js +49 -1
- package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js +312 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +733 -1
- package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/components/stepper/Stepper.js +371 -1
- package/public/components/stepper/Stepper.js.map +1 -1
- package/public/components/tabs/Tabs.js +615 -1
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +472 -1
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tag/Tag.js +665 -1
- package/public/components/tag/Tag.js.map +1 -1
- package/public/components/tag/Tag.nested.js +554 -1
- package/public/components/tag/Tag.nested.js.map +1 -1
- package/public/components/taglist/TagList.js +475 -1
- package/public/components/taglist/TagList.js.map +1 -1
- package/public/components/textarea/Textarea.js +303 -1
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +497 -1
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.nested.js +320 -1
- package/public/components/textinput/Textinput.nested.js.map +1 -1
- package/public/components/toggle/Toggle.js +278 -1
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/tooltip/Tooltip.js +173 -1
- package/public/components/tooltip/Tooltip.js.map +1 -1
- package/public/index-c33b3772.js +873 -1
- package/public/index-c33b3772.js.map +1 -1
- package/public/linear-f46d7e9e.js +700 -1
- package/public/linear-f46d7e9e.js.map +1 -1
- package/public/path-1b5da959.js +186 -1
- package/public/path-1b5da959.js.map +1 -1
- package/public/sidebar-service-275bf9ef.js +129 -1
- package/public/sidebar-service-275bf9ef.js.map +1 -1
- package/public/symbol-b05a6e2b.js +169 -1
- package/public/symbol-b05a6e2b.js.map +1 -1
- package/public/transform-15d69d5d.js +2743 -1
- package/public/transform-15d69d5d.js.map +1 -1
- package/public/utilities/stories/phonenumber/PhoneNumber.stories.d.ts.map +1 -1
|
@@ -1,2 +1,730 @@
|
|
|
1
|
-
import{S as
|
|
1
|
+
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert, f as flush, s as safe_not_equal, e as element, n as noop, g as attr, y as set_style, o as detach, a1 as onMount, t as text, d as space, j as append, k as set_data, J as destroy_each, K as empty, v as binding_callbacks } from '../../index-c33b3772.js';
|
|
2
|
+
import { s as select } from '../../transform-15d69d5d.js';
|
|
3
|
+
import { E as EventHandler } from '../../EventHandler-02058705.js';
|
|
4
|
+
import { S as Symbol, s as symbolSquare, b as symbolCircle, a as symbolTriangle, c as symbolDiamond, l as line } from '../../symbol-b05a6e2b.js';
|
|
5
|
+
import { a as sqrt, t as tau, c as cos, s as sin, p as pi } from '../../path-1b5da959.js';
|
|
6
|
+
import { l as linear } from '../../linear-f46d7e9e.js';
|
|
7
|
+
import '../../array-5b770a93.js';
|
|
8
|
+
|
|
9
|
+
const ka = 0.89081309152928522810;
|
|
10
|
+
const kr = sin(pi / 10) / sin(7 * pi / 10);
|
|
11
|
+
const kx = sin(tau / 10) * kr;
|
|
12
|
+
const ky = -cos(tau / 10) * kr;
|
|
13
|
+
|
|
14
|
+
var symbolStar = {
|
|
15
|
+
draw(context, size) {
|
|
16
|
+
const r = sqrt(size * ka);
|
|
17
|
+
const x = kx * r;
|
|
18
|
+
const y = ky * r;
|
|
19
|
+
context.moveTo(0, -r);
|
|
20
|
+
context.lineTo(x, y);
|
|
21
|
+
for (let i = 1; i < 5; ++i) {
|
|
22
|
+
const a = tau * i / 5;
|
|
23
|
+
const c = cos(a);
|
|
24
|
+
const s = sin(a);
|
|
25
|
+
context.lineTo(s * r, -c * r);
|
|
26
|
+
context.lineTo(c * x - s * y, s * x + c * y);
|
|
27
|
+
}
|
|
28
|
+
context.closePath();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/* src/components/chart/Radar.svelte generated by Svelte v3.58.0 */
|
|
33
|
+
|
|
34
|
+
function get_each_context(ctx, list, i) {
|
|
35
|
+
const child_ctx = ctx.slice();
|
|
36
|
+
child_ctx[1] = list[i];
|
|
37
|
+
return child_ctx;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// (267:2) {#if tooltipData.show}
|
|
41
|
+
function create_if_block(ctx) {
|
|
42
|
+
let div1;
|
|
43
|
+
let span;
|
|
44
|
+
let b;
|
|
45
|
+
let t0_value = /*tooltipData*/ ctx[3].title + "";
|
|
46
|
+
let t0;
|
|
47
|
+
let t1;
|
|
48
|
+
let div0;
|
|
49
|
+
let each_value = /*tooltipData*/ ctx[3].text;
|
|
50
|
+
let each_blocks = [];
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
53
|
+
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
c() {
|
|
58
|
+
div1 = element("div");
|
|
59
|
+
span = element("span");
|
|
60
|
+
b = element("b");
|
|
61
|
+
t0 = text(t0_value);
|
|
62
|
+
t1 = space();
|
|
63
|
+
div0 = element("div");
|
|
64
|
+
|
|
65
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
66
|
+
each_blocks[i].c();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
attr(div1, "class", "chart__tooltip");
|
|
70
|
+
set_style(div1, "left", /*tooltipData*/ ctx[3].left);
|
|
71
|
+
set_style(div1, "top", /*tooltipData*/ ctx[3].top);
|
|
72
|
+
},
|
|
73
|
+
m(target, anchor) {
|
|
74
|
+
insert(target, div1, anchor);
|
|
75
|
+
append(div1, span);
|
|
76
|
+
append(span, b);
|
|
77
|
+
append(b, t0);
|
|
78
|
+
append(div1, t1);
|
|
79
|
+
append(div1, div0);
|
|
80
|
+
|
|
81
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
82
|
+
if (each_blocks[i]) {
|
|
83
|
+
each_blocks[i].m(div0, null);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
p(ctx, dirty) {
|
|
88
|
+
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*tooltipData*/ ctx[3].title + "")) set_data(t0, t0_value);
|
|
89
|
+
|
|
90
|
+
if (dirty[0] & /*tooltipData*/ 8) {
|
|
91
|
+
each_value = /*tooltipData*/ ctx[3].text;
|
|
92
|
+
let i;
|
|
93
|
+
|
|
94
|
+
for (i = 0; i < each_value.length; i += 1) {
|
|
95
|
+
const child_ctx = get_each_context(ctx, each_value, i);
|
|
96
|
+
|
|
97
|
+
if (each_blocks[i]) {
|
|
98
|
+
each_blocks[i].p(child_ctx, dirty);
|
|
99
|
+
} else {
|
|
100
|
+
each_blocks[i] = create_each_block(child_ctx);
|
|
101
|
+
each_blocks[i].c();
|
|
102
|
+
each_blocks[i].m(div0, null);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
for (; i < each_blocks.length; i += 1) {
|
|
107
|
+
each_blocks[i].d(1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
each_blocks.length = each_value.length;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (dirty[0] & /*tooltipData*/ 8) {
|
|
114
|
+
set_style(div1, "left", /*tooltipData*/ ctx[3].left);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (dirty[0] & /*tooltipData*/ 8) {
|
|
118
|
+
set_style(div1, "top", /*tooltipData*/ ctx[3].top);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
d(detaching) {
|
|
122
|
+
if (detaching) detach(div1);
|
|
123
|
+
destroy_each(each_blocks, detaching);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// (279:10) {:else}
|
|
129
|
+
function create_else_block(ctx) {
|
|
130
|
+
let div;
|
|
131
|
+
let span0;
|
|
132
|
+
let t0_value = /*data*/ ctx[1].name + "";
|
|
133
|
+
let t0;
|
|
134
|
+
let t1;
|
|
135
|
+
let span1;
|
|
136
|
+
let t2_value = /*data*/ ctx[1].value + "";
|
|
137
|
+
let t2;
|
|
138
|
+
let t3;
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
c() {
|
|
142
|
+
div = element("div");
|
|
143
|
+
span0 = element("span");
|
|
144
|
+
t0 = text(t0_value);
|
|
145
|
+
t1 = space();
|
|
146
|
+
span1 = element("span");
|
|
147
|
+
t2 = text(t2_value);
|
|
148
|
+
t3 = space();
|
|
149
|
+
attr(span0, "class", "chart__legend");
|
|
150
|
+
attr(span1, "class", "chart__elem");
|
|
151
|
+
attr(div, "class", "chart__list");
|
|
152
|
+
},
|
|
153
|
+
m(target, anchor) {
|
|
154
|
+
insert(target, div, anchor);
|
|
155
|
+
append(div, span0);
|
|
156
|
+
append(span0, t0);
|
|
157
|
+
append(div, t1);
|
|
158
|
+
append(div, span1);
|
|
159
|
+
append(span1, t2);
|
|
160
|
+
append(div, t3);
|
|
161
|
+
},
|
|
162
|
+
p(ctx, dirty) {
|
|
163
|
+
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*data*/ ctx[1].name + "")) set_data(t0, t0_value);
|
|
164
|
+
if (dirty[0] & /*tooltipData*/ 8 && t2_value !== (t2_value = /*data*/ ctx[1].value + "")) set_data(t2, t2_value);
|
|
165
|
+
},
|
|
166
|
+
d(detaching) {
|
|
167
|
+
if (detaching) detach(div);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// (275:10) {#if data.customtooltip}
|
|
173
|
+
function create_if_block_1(ctx) {
|
|
174
|
+
let div;
|
|
175
|
+
let span;
|
|
176
|
+
let t0_value = /*data*/ ctx[1].customtooltip + "";
|
|
177
|
+
let t0;
|
|
178
|
+
let t1;
|
|
179
|
+
|
|
180
|
+
return {
|
|
181
|
+
c() {
|
|
182
|
+
div = element("div");
|
|
183
|
+
span = element("span");
|
|
184
|
+
t0 = text(t0_value);
|
|
185
|
+
t1 = space();
|
|
186
|
+
attr(span, "class", "chart__elem");
|
|
187
|
+
attr(div, "class", "chart__list");
|
|
188
|
+
},
|
|
189
|
+
m(target, anchor) {
|
|
190
|
+
insert(target, div, anchor);
|
|
191
|
+
append(div, span);
|
|
192
|
+
append(span, t0);
|
|
193
|
+
append(div, t1);
|
|
194
|
+
},
|
|
195
|
+
p(ctx, dirty) {
|
|
196
|
+
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*data*/ ctx[1].customtooltip + "")) set_data(t0, t0_value);
|
|
197
|
+
},
|
|
198
|
+
d(detaching) {
|
|
199
|
+
if (detaching) detach(div);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// (274:8) {#each tooltipData.text as data}
|
|
205
|
+
function create_each_block(ctx) {
|
|
206
|
+
let if_block_anchor;
|
|
207
|
+
|
|
208
|
+
function select_block_type(ctx, dirty) {
|
|
209
|
+
if (/*data*/ ctx[1].customtooltip) return create_if_block_1;
|
|
210
|
+
return create_else_block;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
let current_block_type = select_block_type(ctx);
|
|
214
|
+
let if_block = current_block_type(ctx);
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
c() {
|
|
218
|
+
if_block.c();
|
|
219
|
+
if_block_anchor = empty();
|
|
220
|
+
},
|
|
221
|
+
m(target, anchor) {
|
|
222
|
+
if_block.m(target, anchor);
|
|
223
|
+
insert(target, if_block_anchor, anchor);
|
|
224
|
+
},
|
|
225
|
+
p(ctx, dirty) {
|
|
226
|
+
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
|
|
227
|
+
if_block.p(ctx, dirty);
|
|
228
|
+
} else {
|
|
229
|
+
if_block.d(1);
|
|
230
|
+
if_block = current_block_type(ctx);
|
|
231
|
+
|
|
232
|
+
if (if_block) {
|
|
233
|
+
if_block.c();
|
|
234
|
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
d(detaching) {
|
|
239
|
+
if_block.d(detaching);
|
|
240
|
+
if (detaching) detach(if_block_anchor);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function create_fragment(ctx) {
|
|
246
|
+
let div;
|
|
247
|
+
let if_block = /*tooltipData*/ ctx[3].show && create_if_block(ctx);
|
|
248
|
+
|
|
249
|
+
return {
|
|
250
|
+
c() {
|
|
251
|
+
div = element("div");
|
|
252
|
+
if (if_block) if_block.c();
|
|
253
|
+
this.c = noop;
|
|
254
|
+
attr(div, "class", "chart");
|
|
255
|
+
set_style(div, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
256
|
+
},
|
|
257
|
+
m(target, anchor) {
|
|
258
|
+
insert(target, div, anchor);
|
|
259
|
+
if (if_block) if_block.m(div, null);
|
|
260
|
+
/*div_binding*/ ctx[11](div);
|
|
261
|
+
},
|
|
262
|
+
p(ctx, dirty) {
|
|
263
|
+
if (/*tooltipData*/ ctx[3].show) {
|
|
264
|
+
if (if_block) {
|
|
265
|
+
if_block.p(ctx, dirty);
|
|
266
|
+
} else {
|
|
267
|
+
if_block = create_if_block(ctx);
|
|
268
|
+
if_block.c();
|
|
269
|
+
if_block.m(div, null);
|
|
270
|
+
}
|
|
271
|
+
} else if (if_block) {
|
|
272
|
+
if_block.d(1);
|
|
273
|
+
if_block = null;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (dirty[0] & /*backgroundcolor*/ 1) {
|
|
277
|
+
set_style(div, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
i: noop,
|
|
281
|
+
o: noop,
|
|
282
|
+
d(detaching) {
|
|
283
|
+
if (detaching) detach(div);
|
|
284
|
+
if (if_block) if_block.d();
|
|
285
|
+
/*div_binding*/ ctx[11](null);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function instance($$self, $$props, $$invalidate) {
|
|
291
|
+
let parsedData;
|
|
292
|
+
let dataset;
|
|
293
|
+
let scale;
|
|
294
|
+
let { data = '' } = $$props;
|
|
295
|
+
let { backgroundcolor = '#fff' } = $$props;
|
|
296
|
+
let { delay = 500 } = $$props;
|
|
297
|
+
let { sides = 5 } = $$props;
|
|
298
|
+
let { levels = 10 } = $$props;
|
|
299
|
+
let { valuemax = 20 } = $$props;
|
|
300
|
+
let { scalemax = 20 } = $$props;
|
|
301
|
+
let { hasgrades = false } = $$props;
|
|
302
|
+
|
|
303
|
+
const symbolPath = [
|
|
304
|
+
Symbol(symbolSquare),
|
|
305
|
+
Symbol(symbolCircle),
|
|
306
|
+
Symbol(symbolTriangle),
|
|
307
|
+
Symbol(symbolDiamond),
|
|
308
|
+
Symbol(symbolStar)
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
const colors = ['#605F9D', '#00919F', '#758992', '#0B96CC'];
|
|
312
|
+
let chart;
|
|
313
|
+
let svg;
|
|
314
|
+
let hasMounted = false;
|
|
315
|
+
let eventHandler = new EventHandler();
|
|
316
|
+
|
|
317
|
+
let tooltipData = {
|
|
318
|
+
left: '0px',
|
|
319
|
+
top: '0px',
|
|
320
|
+
text: [],
|
|
321
|
+
title: '',
|
|
322
|
+
show: false
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
let size = Math.min(window.innerWidth, window.innerHeight, 400);
|
|
326
|
+
let offset = Math.PI;
|
|
327
|
+
let polyangle = Math.PI * 2 / sides;
|
|
328
|
+
let r = 0.8 * size;
|
|
329
|
+
let radius = r / 2;
|
|
330
|
+
let center = { x: size / 2, y: size / 2 };
|
|
331
|
+
|
|
332
|
+
const getPoint = (length, angle) => {
|
|
333
|
+
const point = {
|
|
334
|
+
x: center.x + length * Math.sin(offset - angle),
|
|
335
|
+
y: center.y + length * Math.cos(offset - angle)
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
return point;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
const graduations = levels => {
|
|
342
|
+
const grades = [];
|
|
343
|
+
const step = valuemax / levels;
|
|
344
|
+
|
|
345
|
+
for (let i = 0; i <= levels; i++) {
|
|
346
|
+
const num = step * i;
|
|
347
|
+
|
|
348
|
+
if (Number.isInteger(step)) {
|
|
349
|
+
grades.push(Number(num));
|
|
350
|
+
} else {
|
|
351
|
+
grades.push(num.toFixed(2));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return grades;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
const getPath = (points, parent) => {
|
|
359
|
+
const lineGenerator = line().x(d => d.x).y(d => d.y);
|
|
360
|
+
parent.append('path').attr('d', lineGenerator(points));
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
const getAxis = (ticks, levels) => {
|
|
364
|
+
const radarLines = svg.append('g').attr('class', 'radar-lines');
|
|
365
|
+
const point = getPoint(radius, 0);
|
|
366
|
+
getPath([center, point], radarLines);
|
|
367
|
+
const gradeLabel = svg.append('g').attr('class', 'ticks');
|
|
368
|
+
|
|
369
|
+
ticks.forEach((grade, i) => {
|
|
370
|
+
const r = i / levels * radius;
|
|
371
|
+
const p = getPoint(r, 0);
|
|
372
|
+
const points = [p, Object.assign(Object.assign({}, p), { x: p.x - 10 })];
|
|
373
|
+
getPath(points, radarLines);
|
|
374
|
+
|
|
375
|
+
if (hasgrades) {
|
|
376
|
+
getText(grade, p, true, gradeLabel);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const getLevels = (levels, sides) => {
|
|
382
|
+
for (let level = 1; level <= levels; level++) {
|
|
383
|
+
const hyp = level / levels * radius;
|
|
384
|
+
const points = [];
|
|
385
|
+
|
|
386
|
+
for (let vertex = 0; vertex < sides; vertex++) {
|
|
387
|
+
const angle = vertex * polyangle;
|
|
388
|
+
points.push(getPoint(hyp, angle));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const svgLevel = svg.append('g').style('fill', 'none').attr('stroke', '#CCCCCC');
|
|
392
|
+
getPath([...points, points[0]], svgLevel);
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const getLines = sides => {
|
|
397
|
+
for (let vertex = 1, i = 0; vertex <= sides; (vertex++, i++)) {
|
|
398
|
+
const svgLine = svg.append('g').attr('stroke', '#ccc');
|
|
399
|
+
const angle = vertex * polyangle;
|
|
400
|
+
|
|
401
|
+
const formatdata = () => {
|
|
402
|
+
const tooltipData = dataset.map((elem, dataIndex) => {
|
|
403
|
+
let elemPrincipal = elem[vertex];
|
|
404
|
+
|
|
405
|
+
if (dataset[0][vertex].name === elemPrincipal.name) {
|
|
406
|
+
return {
|
|
407
|
+
name: `Serie ${dataIndex + 1}`,
|
|
408
|
+
value: elemPrincipal.value
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return undefined;
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
return tooltipData;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
svgLine.on('mouseover', _e => {
|
|
419
|
+
svgLine.attr('stroke-dasharray', '4');
|
|
420
|
+
svgLine.attr('stroke-width', '4px');
|
|
421
|
+
|
|
422
|
+
$$invalidate(3, tooltipData = {
|
|
423
|
+
left: _e.pageX + 10 + 'px',
|
|
424
|
+
title: dataset[0][i + 1].name,
|
|
425
|
+
top: _e.pageY - 25 + 'px',
|
|
426
|
+
text: formatdata(),
|
|
427
|
+
show: true
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
svgLine.on('mouseout', _e => {
|
|
432
|
+
svgLine.attr('stroke-dasharray', 0);
|
|
433
|
+
svgLine.attr('stroke-width', '1px');
|
|
434
|
+
|
|
435
|
+
$$invalidate(3, tooltipData = {
|
|
436
|
+
left: _e.pageX + 10 + 'px',
|
|
437
|
+
top: _e.pageY - 25 + 'px',
|
|
438
|
+
show: false,
|
|
439
|
+
text: [],
|
|
440
|
+
title: ''
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
svgLine.on('click', (_e, chartEvent) => {
|
|
445
|
+
eventHandler.dispatch('serie-clicked', chartEvent);
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
const point = getPoint(radius, angle);
|
|
449
|
+
getPath([center, point], svgLine);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
const getSymbols = (points, colors, index) => {
|
|
454
|
+
svg.selectAll().data(points).enter().append('path').attr('fill', '#FFF').attr('stroke', colors[index]).attr('stroke-width', '2px').attr('d', symbolPath[index].size(50)).attr('opacity', 0.4).attr('transform', d => `translate(${d.x},${d.y})`);
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const getData = (dataset, side, index) => {
|
|
458
|
+
let points = [];
|
|
459
|
+
|
|
460
|
+
dataset.forEach((d, i) => {
|
|
461
|
+
const len = scale(d.value);
|
|
462
|
+
const theta = i * (2 * Math.PI / side);
|
|
463
|
+
points.push(Object.assign(Object.assign({}, getPoint(len, theta)), { value: 'hihihi' }));
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
const group = svg.append('g').attr('stroke', colors[index]).attr('stroke-width', '1.5px').attr('fill-opacity', '0.2').attr('fill', colors[index]);
|
|
467
|
+
|
|
468
|
+
group.on('mousemove', _e => {
|
|
469
|
+
$$invalidate(3, tooltipData = {
|
|
470
|
+
left: _e.pageX + 10 + 'px',
|
|
471
|
+
title: `Serie-${index}`,
|
|
472
|
+
top: _e.pageY - 25 + 'px',
|
|
473
|
+
text: dataset,
|
|
474
|
+
show: true
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
group.attr('fill-opacity', '0.6');
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
group.on('mouseout', _e => {
|
|
481
|
+
$$invalidate(3, tooltipData = {
|
|
482
|
+
left: '0px',
|
|
483
|
+
top: '0px',
|
|
484
|
+
text: [],
|
|
485
|
+
title: '',
|
|
486
|
+
show: false
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
group.attr('fill-opacity', '0.2');
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
getPath([...points, points[0]], group);
|
|
493
|
+
getSymbols(points, colors, index);
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
const getText = (text, point, isAxis, group) => {
|
|
497
|
+
if (isAxis) {
|
|
498
|
+
group.append('text').attr('x', point.x).attr('y', point.y).html(text).style('text-anchor', 'middle').attr('fill', '#3A3936').style('font-size', '11px');
|
|
499
|
+
} else {
|
|
500
|
+
group.append('text').attr('x', point.x).attr('y', point.y).html(text).style('text-anchor', 'middle').attr('fill', '#3A3936').style('font-size', '12px');
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
const drawLabels = (dataset, sides) => {
|
|
505
|
+
const groupL = svg.append('g').attr('class', 'labels');
|
|
506
|
+
|
|
507
|
+
for (let vertex = 0; vertex < sides; vertex++) {
|
|
508
|
+
const angle = vertex * polyangle;
|
|
509
|
+
const label = dataset[vertex].name;
|
|
510
|
+
const point = getPoint(0.9 * (size / 2), angle);
|
|
511
|
+
getText(label, point, false, groupL);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
const renderChart = () => {
|
|
516
|
+
const ticks = graduations(levels);
|
|
517
|
+
getLevels(levels, sides);
|
|
518
|
+
getAxis(ticks, levels);
|
|
519
|
+
getLines(sides);
|
|
520
|
+
|
|
521
|
+
dataset.forEach((dataValue, index) => {
|
|
522
|
+
getData(dataValue, sides, index);
|
|
523
|
+
drawLabels(dataValue, sides);
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
setTimeout(
|
|
527
|
+
() => {
|
|
528
|
+
updateChart(parsedData);
|
|
529
|
+
},
|
|
530
|
+
delay * parsedData.length
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
function updateChart(data) {
|
|
535
|
+
getLines(sides);
|
|
536
|
+
|
|
537
|
+
data.forEach((dataValue, index) => {
|
|
538
|
+
getData(dataValue, sides, index);
|
|
539
|
+
drawLabels(dataValue, sides);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
onMount(() => $$invalidate(10, hasMounted = true));
|
|
544
|
+
|
|
545
|
+
function div_binding($$value) {
|
|
546
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
547
|
+
chart = $$value;
|
|
548
|
+
$$invalidate(2, chart);
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
$$self.$$set = $$props => {
|
|
553
|
+
if ('data' in $$props) $$invalidate(1, data = $$props.data);
|
|
554
|
+
if ('backgroundcolor' in $$props) $$invalidate(0, backgroundcolor = $$props.backgroundcolor);
|
|
555
|
+
if ('delay' in $$props) $$invalidate(4, delay = $$props.delay);
|
|
556
|
+
if ('sides' in $$props) $$invalidate(5, sides = $$props.sides);
|
|
557
|
+
if ('levels' in $$props) $$invalidate(6, levels = $$props.levels);
|
|
558
|
+
if ('valuemax' in $$props) $$invalidate(7, valuemax = $$props.valuemax);
|
|
559
|
+
if ('scalemax' in $$props) $$invalidate(8, scalemax = $$props.scalemax);
|
|
560
|
+
if ('hasgrades' in $$props) $$invalidate(9, hasgrades = $$props.hasgrades);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
$$self.$$.update = () => {
|
|
564
|
+
if ($$self.$$.dirty[0] & /*data*/ 2) {
|
|
565
|
+
parsedData = data ? JSON.parse(data) : [];
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
if ($$self.$$.dirty[0] & /*data*/ 2) {
|
|
569
|
+
dataset = data ? JSON.parse(data) : [];
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if ($$self.$$.dirty[0] & /*scalemax*/ 256) {
|
|
573
|
+
scale = linear().domain([0, scalemax]).range([0, radius]);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
if ($$self.$$.dirty[0] & /*data, hasMounted, chart*/ 1030) {
|
|
577
|
+
if (data.length > 0 && hasMounted) {
|
|
578
|
+
svg = select(chart).append('svg').attr('width', size).attr('height', size).append('g');
|
|
579
|
+
renderChart();
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
return [
|
|
585
|
+
backgroundcolor,
|
|
586
|
+
data,
|
|
587
|
+
chart,
|
|
588
|
+
tooltipData,
|
|
589
|
+
delay,
|
|
590
|
+
sides,
|
|
591
|
+
levels,
|
|
592
|
+
valuemax,
|
|
593
|
+
scalemax,
|
|
594
|
+
hasgrades,
|
|
595
|
+
hasMounted,
|
|
596
|
+
div_binding
|
|
597
|
+
];
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
class Radar extends SvelteElement {
|
|
601
|
+
constructor(options) {
|
|
602
|
+
super();
|
|
603
|
+
const style = document.createElement('style');
|
|
604
|
+
style.textContent = `@media screen and (min-width: 680px){}@media screen and (min-width: 1024px){}@media screen and (min-width: 1280px){}@media screen and (min-width: 1920px){}.chart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:#ffffff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chart__tooltip{position:absolute;width:auto;height:auto;background-color:white;border:1px solid #000;border-radius:4px;min-width:152px;color:grey;padding:0.25rem 0.5rem}.chart__list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}`;
|
|
605
|
+
this.shadowRoot.appendChild(style);
|
|
606
|
+
|
|
607
|
+
init(
|
|
608
|
+
this,
|
|
609
|
+
{
|
|
610
|
+
target: this.shadowRoot,
|
|
611
|
+
props: attribute_to_object(this.attributes),
|
|
612
|
+
customElement: true
|
|
613
|
+
},
|
|
614
|
+
instance,
|
|
615
|
+
create_fragment,
|
|
616
|
+
safe_not_equal,
|
|
617
|
+
{
|
|
618
|
+
data: 1,
|
|
619
|
+
backgroundcolor: 0,
|
|
620
|
+
delay: 4,
|
|
621
|
+
sides: 5,
|
|
622
|
+
levels: 6,
|
|
623
|
+
valuemax: 7,
|
|
624
|
+
scalemax: 8,
|
|
625
|
+
hasgrades: 9
|
|
626
|
+
},
|
|
627
|
+
null,
|
|
628
|
+
[-1, -1]
|
|
629
|
+
);
|
|
630
|
+
|
|
631
|
+
if (options) {
|
|
632
|
+
if (options.target) {
|
|
633
|
+
insert(options.target, this, options.anchor);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (options.props) {
|
|
637
|
+
this.$set(options.props);
|
|
638
|
+
flush();
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
static get observedAttributes() {
|
|
644
|
+
return [
|
|
645
|
+
"data",
|
|
646
|
+
"backgroundcolor",
|
|
647
|
+
"delay",
|
|
648
|
+
"sides",
|
|
649
|
+
"levels",
|
|
650
|
+
"valuemax",
|
|
651
|
+
"scalemax",
|
|
652
|
+
"hasgrades"
|
|
653
|
+
];
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
get data() {
|
|
657
|
+
return this.$$.ctx[1];
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
set data(data) {
|
|
661
|
+
this.$$set({ data });
|
|
662
|
+
flush();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
get backgroundcolor() {
|
|
666
|
+
return this.$$.ctx[0];
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
set backgroundcolor(backgroundcolor) {
|
|
670
|
+
this.$$set({ backgroundcolor });
|
|
671
|
+
flush();
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
get delay() {
|
|
675
|
+
return this.$$.ctx[4];
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
set delay(delay) {
|
|
679
|
+
this.$$set({ delay });
|
|
680
|
+
flush();
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
get sides() {
|
|
684
|
+
return this.$$.ctx[5];
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
set sides(sides) {
|
|
688
|
+
this.$$set({ sides });
|
|
689
|
+
flush();
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
get levels() {
|
|
693
|
+
return this.$$.ctx[6];
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
set levels(levels) {
|
|
697
|
+
this.$$set({ levels });
|
|
698
|
+
flush();
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
get valuemax() {
|
|
702
|
+
return this.$$.ctx[7];
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
set valuemax(valuemax) {
|
|
706
|
+
this.$$set({ valuemax });
|
|
707
|
+
flush();
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
get scalemax() {
|
|
711
|
+
return this.$$.ctx[8];
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
set scalemax(scalemax) {
|
|
715
|
+
this.$$set({ scalemax });
|
|
716
|
+
flush();
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
get hasgrades() {
|
|
720
|
+
return this.$$.ctx[9];
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
set hasgrades(hasgrades) {
|
|
724
|
+
this.$$set({ hasgrades });
|
|
725
|
+
flush();
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
export { Radar as default };
|
|
2
730
|
//# sourceMappingURL=Radar.js.map
|