@mozaic-ds/web-components 0.12.0-beta.0 → 0.12.0-beta.1
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 +2 -1
- package/public/ClickOutside-63071e7a.js +1 -15
- package/public/ClickOutside-63071e7a.js.map +1 -1
- package/public/EventForward-8492ff62.js +1 -109
- package/public/EventForward-8492ff62.js.map +1 -1
- package/public/EventHandler-02058705.js +1 -15
- package/public/EventHandler-02058705.js.map +1 -1
- package/public/adeo/components/datatable/DataTable.js +1 -1
- package/public/adeo/components/datatable/DataTable.js.map +1 -1
- package/public/adeo/components/datatable/DataTable.svelte +9 -13
- package/public/array-5b770a93.js +1 -13
- package/public/array-5b770a93.js.map +1 -1
- package/public/axis-fbc0f7b5.js +1 -174
- package/public/axis-fbc0f7b5.js.map +1 -1
- package/public/band-d7a07d2c.js +1 -186
- package/public/band-d7a07d2c.js.map +1 -1
- package/public/bricoman/components/datatable/DataTable.js +1 -1
- package/public/bricoman/components/datatable/DataTable.js.map +1 -1
- package/public/bricoman/components/datatable/DataTable.svelte +9 -13
- package/public/bundle.js +60 -56
- package/public/components/accordion/Accordion.js +1 -365
- package/public/components/accordion/Accordion.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.js +1 -1515
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.svelte +41 -20
- package/public/components/badge/Badge.js +1 -155
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.nested.js +1 -101
- package/public/components/badge/Badge.nested.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.js +1 -372
- package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js +1 -319
- package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
- package/public/components/button/Button.js +1 -1141
- package/public/components/button/Button.js.map +1 -1
- package/public/components/button/Button.svelte +2 -2
- package/public/components/card/Card.js +1 -369
- package/public/components/card/Card.js.map +1 -1
- package/public/components/chart/BarChart.js +1 -583
- package/public/components/chart/BarChart.js.map +1 -1
- package/public/components/chart/Donut.js +1 -1189
- package/public/components/chart/Donut.js.map +1 -1
- package/public/components/chart/GroupedBarChart.js +1 -750
- package/public/components/chart/GroupedBarChart.js.map +1 -1
- package/public/components/chart/LineChart.js +1 -1731
- package/public/components/chart/LineChart.js.map +1 -1
- package/public/components/chart/Radar.js +1 -729
- package/public/components/chart/Radar.js.map +1 -1
- package/public/components/chart/StackedBarChart.js +1 -745
- package/public/components/chart/StackedBarChart.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +1 -307
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js +1 -404
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/checkboxgroup/checkboxgroup.types.d.ts.map +1 -1
- package/public/components/datatable/DataTable.js +1 -3098
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTable.svelte +41 -20
- package/public/components/datatable/DataTableDefaultAction.nested.js +1 -4
- package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -164
- package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -380
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -424
- package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -263
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +1 -637
- package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
- package/public/components/datatable/data.d.ts.map +1 -1
- package/public/components/datatable/datatable.types.d.ts +16 -2
- package/public/components/datatable/datatable.types.d.ts.map +1 -1
- package/public/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +18 -0
- package/public/components/dropdown/Dropdown.js +1 -1426
- package/public/components/dropdown/Dropdown.js.map +1 -1
- package/public/components/field/Field.js +1 -375
- package/public/components/field/Field.js.map +1 -1
- package/public/components/fileuploader/FileUploader.js +1 -603
- package/public/components/fileuploader/FileUploader.js.map +1 -1
- package/public/components/fileuploader/ResultFile.nested.js +1 -344
- package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/components/flag/Flag.js +1 -174
- package/public/components/flag/Flag.js.map +1 -1
- package/public/components/header/Header.js +1 -918
- package/public/components/header/Header.js.map +1 -1
- package/public/components/header/Header.types.d.ts.map +1 -1
- package/public/components/hero/Hero.js +1 -271
- package/public/components/hero/Hero.js.map +1 -1
- package/public/components/kpi/Kpi.js +1 -404
- package/public/components/kpi/Kpi.js.map +1 -1
- package/public/components/layer/Layer.js +1 -471
- package/public/components/layer/Layer.js.map +1 -1
- package/public/components/link/Link.js +1 -380
- package/public/components/link/Link.js.map +1 -1
- package/public/components/listbox/Listbox.js +1 -595
- package/public/components/listbox/Listbox.js.map +1 -1
- package/public/components/listbox/Listbox.nested.js +1 -629
- package/public/components/listbox/Listbox.nested.js.map +1 -1
- package/public/components/loader/Loader.js +1 -246
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.nested.js +1 -176
- package/public/components/loader/Loader.nested.js.map +1 -1
- package/public/components/modal/Modal.js +1 -395
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/notification/Notification.js +1 -458
- package/public/components/notification/Notification.js.map +1 -1
- package/public/components/optionbutton/OptionButton.js +1 -316
- package/public/components/optionbutton/OptionButton.js.map +1 -1
- package/public/components/overlay/Overlay.js +1 -104
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/OverlayLoader.js +1 -151
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/pagination/Pagination.js +1 -613
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/pagination/Pagination.svelte +5 -4
- package/public/components/passwordinput/PasswordInput.js +1 -291
- package/public/components/passwordinput/PasswordInput.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.js +1 -6894
- package/public/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.svelte +1 -1
- package/public/components/price/Price.js +1 -768
- package/public/components/price/Price.js.map +1 -1
- package/public/components/progressbar/ProgressBar.js +1 -278
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.js +1 -397
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/radio/Radio.js +1 -273
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.js +1 -414
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/radiogroup/radioGroup.types.d.ts.map +1 -1
- package/public/components/ratings/StarsInput.js +1 -292
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/ratings/StarsResult.js +1 -246
- package/public/components/ratings/StarsResult.js.map +1 -1
- package/public/components/select/Select.js +1 -451
- package/public/components/select/Select.js.map +1 -1
- package/public/components/sidebar/Sidebar.js +1 -784
- package/public/components/sidebar/Sidebar.js.map +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js +1 -592
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-feature.nested.js +1 -402
- package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-section.nested.js +1 -394
- package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +1 -198
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-separator.nested.js +1 -49
- package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-service.d.ts.map +1 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js +1 -312
- package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +1 -733
- package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/components/sidebar/sidebar.types.d.ts.map +1 -1
- package/public/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +1 -1
- package/public/components/sidebar-segment/sidebar-segment.nested.svelte +1 -1
- package/public/components/sidebar-user/sidebar-user.nested.svelte +1 -0
- package/public/components/starsinput/StarsInput.svelte +9 -2
- package/public/components/stepper/Stepper.js +1 -371
- package/public/components/stepper/Stepper.js.map +1 -1
- package/public/components/tabs/Tabs.js +1 -615
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +1 -472
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tag/Tag.js +1 -665
- package/public/components/tag/Tag.js.map +1 -1
- package/public/components/tag/Tag.nested.js +1 -554
- package/public/components/tag/Tag.nested.js.map +1 -1
- package/public/components/tag/Tag.nested.svelte +5 -5
- package/public/components/tag/Tag.svelte +5 -5
- package/public/components/taglist/TagList.js +1 -475
- package/public/components/taglist/TagList.js.map +1 -1
- package/public/components/textarea/Textarea.js +1 -303
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +1 -497
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.nested.js +1 -320
- package/public/components/textinput/Textinput.nested.js.map +1 -1
- package/public/components/toggle/Toggle.js +1 -278
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/tooltip/Tooltip.js +1 -173
- package/public/components/tooltip/Tooltip.js.map +1 -1
- package/public/index-c33b3772.js +1 -873
- package/public/index-c33b3772.js.map +1 -1
- package/public/linear-f46d7e9e.js +1 -700
- package/public/linear-f46d7e9e.js.map +1 -1
- package/public/main.d.ts +0 -1
- package/public/main.d.ts.map +1 -1
- package/public/path-1b5da959.js +1 -186
- package/public/path-1b5da959.js.map +1 -1
- package/public/sidebar-service-275bf9ef.js +1 -129
- package/public/sidebar-service-275bf9ef.js.map +1 -1
- package/public/symbol-b05a6e2b.js +1 -169
- package/public/symbol-b05a6e2b.js.map +1 -1
- package/public/transform-15d69d5d.js +1 -2743
- package/public/transform-15d69d5d.js.map +1 -1
- package/public/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/utilities/DataTableUtilities.ts +12 -0
- package/public/utilities/EventForward.js +1 -136
- package/public/utilities/EventForward.js.map +1 -1
- package/public/utilities/EventHandler.js +1 -36
- package/public/utilities/EventHandler.js.map +1 -1
- package/public/utilities/components/datatable/data.d.ts.map +1 -1
- package/public/utilities/components/datatable/datatable.types.d.ts +16 -2
- package/public/utilities/components/datatable/datatable.types.d.ts.map +1 -1
- package/public/utilities/main.d.ts +0 -1
- package/public/utilities/main.d.ts.map +1 -1
- package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +1 -1
- package/public/utilities/stories/ratings/StarsResult.stories.d.ts.map +1 -1
- package/public/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/DataTableDefaultAction.nested-46712849.js +0 -762
- package/public/DataTableDefaultAction.nested-46712849.js.map +0 -1
- package/public/DataTableUtilities-313a448d.js +0 -386
- package/public/DataTableUtilities-313a448d.js.map +0 -1
- package/public/components/button/Button.nested.js +0 -1005
- package/public/components/button/Button.nested.js.map +0 -1
- package/public/components/button/Button.nested.svelte +0 -173
- package/public/components/carousel/Carousel.js +0 -710
- package/public/components/carousel/Carousel.js.map +0 -1
- package/public/components/carousel/Carousel.svelte +0 -408
- package/public/components/carousel/CarouselCard.nested.js +0 -140
- package/public/components/carousel/CarouselCard.nested.js.map +0 -1
- package/public/components/carousel/carousel.types.d.ts +0 -20
- package/public/components/carousel/carousel.types.d.ts.map +0 -1
- package/public/components/carouselcard/CarouselCard.nested.svelte +0 -54
- package/public/components/link/Link.nested.js +0 -285
- package/public/components/link/Link.nested.js.map +0 -1
- package/public/components/link/Link.nested.svelte +0 -78
- package/public/sidebar-service-589b271b.js +0 -125
- package/public/sidebar-service-589b271b.js.map +0 -1
- package/public/stories/carousel/items.d.ts +0 -3
- package/public/stories/carousel/items.d.ts.map +0 -1
- package/public/utilities/components/carousel/carousel.types.d.ts +0 -20
- package/public/utilities/components/carousel/carousel.types.d.ts.map +0 -1
- package/public/utilities/stories/carousel/Carousel.stories.d.ts +0 -8
- package/public/utilities/stories/carousel/Carousel.stories.d.ts.map +0 -1
- package/public/utilities/stories/carousel/items.d.ts +0 -3
- package/public/utilities/stories/carousel/items.d.ts.map +0 -1
|
@@ -1,293 +1,2 @@
|
|
|
1
|
-
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert, f as flush, s as safe_not_equal, c as assign, e as element, d as space, n as noop, g as attr, h as set_attributes, j as append, m as get_spread_update, o as detach, J as destroy_each, p as compute_rest_props, q as exclude_internal_props, t as text, k as set_data } from '../../index-c33b3772.js';
|
|
2
|
-
|
|
3
|
-
/* src/components/ratings/StarsInput.svelte generated by Svelte v3.58.0 */
|
|
4
|
-
|
|
5
|
-
function get_each_context(ctx, list, i) {
|
|
6
|
-
const child_ctx = ctx.slice();
|
|
7
|
-
child_ctx[5] = list[i];
|
|
8
|
-
child_ctx[7] = i;
|
|
9
|
-
return child_ctx;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// (34:2) {#each Array(ratingValue) as _, i}
|
|
13
|
-
function create_each_block(ctx) {
|
|
14
|
-
let input;
|
|
15
|
-
let input_id_value;
|
|
16
|
-
let t0;
|
|
17
|
-
let label;
|
|
18
|
-
let span;
|
|
19
|
-
let t1_value = /*ratinglabels*/ ctx[3][/*i*/ ctx[7]] + "";
|
|
20
|
-
let t1;
|
|
21
|
-
let t2;
|
|
22
|
-
let label_for_value;
|
|
23
|
-
let label_title_value;
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
c() {
|
|
27
|
-
input = element("input");
|
|
28
|
-
t0 = space();
|
|
29
|
-
label = element("label");
|
|
30
|
-
span = element("span");
|
|
31
|
-
t1 = text(t1_value);
|
|
32
|
-
t2 = space();
|
|
33
|
-
attr(input, "id", input_id_value = setInputId(/*name*/ ctx[1], /*i*/ ctx[7]));
|
|
34
|
-
attr(input, "type", "radio");
|
|
35
|
-
attr(input, "name", /*name*/ ctx[1]);
|
|
36
|
-
input.value = /*i*/ ctx[7] + 1;
|
|
37
|
-
attr(input, "class", "mc-stars-input__radio");
|
|
38
|
-
attr(span, "class", "mc-stars-input__text");
|
|
39
|
-
attr(label, "for", label_for_value = setInputId(/*name*/ ctx[1], /*i*/ ctx[7]));
|
|
40
|
-
attr(label, "title", label_title_value = /*ratinglabels*/ ctx[3][/*i*/ ctx[7]]);
|
|
41
|
-
attr(label, "class", "mc-stars-input__label");
|
|
42
|
-
},
|
|
43
|
-
m(target, anchor) {
|
|
44
|
-
insert(target, input, anchor);
|
|
45
|
-
insert(target, t0, anchor);
|
|
46
|
-
insert(target, label, anchor);
|
|
47
|
-
append(label, span);
|
|
48
|
-
append(span, t1);
|
|
49
|
-
append(label, t2);
|
|
50
|
-
},
|
|
51
|
-
p(ctx, dirty) {
|
|
52
|
-
if (dirty & /*name*/ 2 && input_id_value !== (input_id_value = setInputId(/*name*/ ctx[1], /*i*/ ctx[7]))) {
|
|
53
|
-
attr(input, "id", input_id_value);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (dirty & /*name*/ 2) {
|
|
57
|
-
attr(input, "name", /*name*/ ctx[1]);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (dirty & /*ratinglabels*/ 8 && t1_value !== (t1_value = /*ratinglabels*/ ctx[3][/*i*/ ctx[7]] + "")) set_data(t1, t1_value);
|
|
61
|
-
|
|
62
|
-
if (dirty & /*name*/ 2 && label_for_value !== (label_for_value = setInputId(/*name*/ ctx[1], /*i*/ ctx[7]))) {
|
|
63
|
-
attr(label, "for", label_for_value);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (dirty & /*ratinglabels*/ 8 && label_title_value !== (label_title_value = /*ratinglabels*/ ctx[3][/*i*/ ctx[7]])) {
|
|
67
|
-
attr(label, "title", label_title_value);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
d(detaching) {
|
|
71
|
-
if (detaching) detach(input);
|
|
72
|
-
if (detaching) detach(t0);
|
|
73
|
-
if (detaching) detach(label);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function create_fragment(ctx) {
|
|
79
|
-
let div;
|
|
80
|
-
let input;
|
|
81
|
-
let t;
|
|
82
|
-
let div_class_value;
|
|
83
|
-
let each_value = Array(ratingValue);
|
|
84
|
-
let each_blocks = [];
|
|
85
|
-
|
|
86
|
-
for (let i = 0; i < each_value.length; i += 1) {
|
|
87
|
-
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let div_levels = [
|
|
91
|
-
{
|
|
92
|
-
class: div_class_value = setClasses(/*size*/ ctx[2])
|
|
93
|
-
},
|
|
94
|
-
/*$$restProps*/ ctx[4]
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
let div_data = {};
|
|
98
|
-
|
|
99
|
-
for (let i = 0; i < div_levels.length; i += 1) {
|
|
100
|
-
div_data = assign(div_data, div_levels[i]);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
c() {
|
|
105
|
-
div = element("div");
|
|
106
|
-
input = element("input");
|
|
107
|
-
t = space();
|
|
108
|
-
|
|
109
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
110
|
-
each_blocks[i].c();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
this.c = noop;
|
|
114
|
-
attr(input, "id", "no-rate");
|
|
115
|
-
attr(input, "type", "radio");
|
|
116
|
-
attr(input, "name", /*name*/ ctx[1]);
|
|
117
|
-
input.value = "0";
|
|
118
|
-
attr(input, "class", "mc-stars-input__radio");
|
|
119
|
-
input.checked = true;
|
|
120
|
-
attr(input, "aria-label", /*unselectedText*/ ctx[0]);
|
|
121
|
-
set_attributes(div, div_data);
|
|
122
|
-
},
|
|
123
|
-
m(target, anchor) {
|
|
124
|
-
insert(target, div, anchor);
|
|
125
|
-
append(div, input);
|
|
126
|
-
append(div, t);
|
|
127
|
-
|
|
128
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
129
|
-
if (each_blocks[i]) {
|
|
130
|
-
each_blocks[i].m(div, null);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
p(ctx, [dirty]) {
|
|
135
|
-
if (dirty & /*name*/ 2) {
|
|
136
|
-
attr(input, "name", /*name*/ ctx[1]);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (dirty & /*unselectedText*/ 1) {
|
|
140
|
-
attr(input, "aria-label", /*unselectedText*/ ctx[0]);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (dirty & /*setInputId, name, ratinglabels*/ 10) {
|
|
144
|
-
each_value = Array(ratingValue);
|
|
145
|
-
let i;
|
|
146
|
-
|
|
147
|
-
for (i = 0; i < each_value.length; i += 1) {
|
|
148
|
-
const child_ctx = get_each_context(ctx, each_value, i);
|
|
149
|
-
|
|
150
|
-
if (each_blocks[i]) {
|
|
151
|
-
each_blocks[i].p(child_ctx, dirty);
|
|
152
|
-
} else {
|
|
153
|
-
each_blocks[i] = create_each_block(child_ctx);
|
|
154
|
-
each_blocks[i].c();
|
|
155
|
-
each_blocks[i].m(div, null);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
for (; i < each_blocks.length; i += 1) {
|
|
160
|
-
each_blocks[i].d(1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
each_blocks.length = each_value.length;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
set_attributes(div, div_data = get_spread_update(div_levels, [
|
|
167
|
-
dirty & /*size*/ 4 && div_class_value !== (div_class_value = setClasses(/*size*/ ctx[2])) && { class: div_class_value },
|
|
168
|
-
dirty & /*$$restProps*/ 16 && /*$$restProps*/ ctx[4]
|
|
169
|
-
]));
|
|
170
|
-
},
|
|
171
|
-
i: noop,
|
|
172
|
-
o: noop,
|
|
173
|
-
d(detaching) {
|
|
174
|
-
if (detaching) detach(div);
|
|
175
|
-
destroy_each(each_blocks, detaching);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const ratingValue = 5;
|
|
181
|
-
|
|
182
|
-
function setClasses(size) {
|
|
183
|
-
const mainClass = 'mc-stars-input';
|
|
184
|
-
return size ? `${mainClass} ${mainClass}--${size}` : mainClass;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function setInputId(name, index) {
|
|
188
|
-
return `${name}${index + 1}`;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function instance($$self, $$props, $$invalidate) {
|
|
192
|
-
const omit_props_names = ["unselectedText","name","size","ratinglabels"];
|
|
193
|
-
let $$restProps = compute_rest_props($$props, omit_props_names);
|
|
194
|
-
let { unselectedText = 'No opinion given' } = $$props;
|
|
195
|
-
let { name = 'rating' } = $$props;
|
|
196
|
-
let { size = 'm' } = $$props;
|
|
197
|
-
let { ratinglabels = ['Very bad', 'Bad', 'Medium', 'Good', 'Excellent'] } = $$props;
|
|
198
|
-
|
|
199
|
-
$$self.$$set = $$new_props => {
|
|
200
|
-
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
|
|
201
|
-
$$invalidate(4, $$restProps = compute_rest_props($$props, omit_props_names));
|
|
202
|
-
if ('unselectedText' in $$new_props) $$invalidate(0, unselectedText = $$new_props.unselectedText);
|
|
203
|
-
if ('name' in $$new_props) $$invalidate(1, name = $$new_props.name);
|
|
204
|
-
if ('size' in $$new_props) $$invalidate(2, size = $$new_props.size);
|
|
205
|
-
if ('ratinglabels' in $$new_props) $$invalidate(3, ratinglabels = $$new_props.ratinglabels);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
return [unselectedText, name, size, ratinglabels, $$restProps];
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
class StarsInput extends SvelteElement {
|
|
212
|
-
constructor(options) {
|
|
213
|
-
super();
|
|
214
|
-
const style = document.createElement('style');
|
|
215
|
-
style.textContent = `.mc-stars-input{height:1.5rem;width:7.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.mc-stars-input__text,.mc-stars-input__radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-stars-input__radio::-ms-check{display:none}.mc-stars-input__label{height:1.5rem;width:1.5rem;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E");background-position:center center;background-repeat:repeat-x;background-size:1.5rem 1.5rem;border-radius:4px;cursor:pointer}.mc-stars-input__label::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E");background-position:left center;background-repeat:repeat-x;background-size:1.5rem 1.5rem;content:"";left:0;top:0;bottom:0;display:block;position:absolute;opacity:0;pointer-events:none}.mc-stars-input__label:nth-of-type(5)::before{width:80%}.mc-stars-input__label:nth-of-type(4)::before{width:60%}.mc-stars-input__label:nth-of-type(3)::before{width:40%}.mc-stars-input__label:nth-of-type(2)::before{width:20%}.mc-stars-input__label:nth-of-type(1)::before{width:0%}:checked~.mc-stars-input__label,:focus~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E")}:checked+.mc-stars-input__label,:focus+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E")}:focus+.mc-stars-input__label{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E")}.mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E")}.mc-stars-input__radio:hover+.mc-stars-input__label::before{opacity:1}.mc-stars-input--s{height:1rem;width:5rem}.mc-stars-input--s .mc-stars-input__label{height:1rem;width:1rem;background-size:1rem 1rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E")}.mc-stars-input--s .mc-stars-input__label::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E");background-size:1rem 1rem}.mc-stars-input--s .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--s .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8 1.5a1 1 0 01.906.577l1.536 3.292 3.254.65a1 1 0 01.437 1.755l-2.296 1.879.648 3.673a1 1 0 01-1.566.988L8 12.229l-2.919 2.085a1 1 0 01-1.566-.988l.648-3.673-2.296-1.879a1 1 0 01.437-1.755l3.254-.65 1.536-3.292A1 1 0 018 1.5zm0 3.365l-.844 1.808-.214.458-.496.1-1.675.335 1.112.91.454.371-.102.577-.325 1.84 1.509-1.078L8 9.771l.581.415 1.509 1.078-.325-1.84-.102-.577.454-.371 1.112-.91-1.675-.335-.496-.1-.214-.458L8 4.865z'/%3E%3C/svg%3E")}.mc-stars-input--s .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--s .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E")}.mc-stars-input--s .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8 1.5a1 1 0 01.906.577l1.536 3.292 3.254.65a1 1 0 01.437 1.755l-2.296 1.879.648 3.673a1 1 0 01-1.566.988L8 12.229l-2.919 2.085a1 1 0 01-1.566-.988l.648-3.673-2.296-1.879a1 1 0 01.437-1.755l3.254-.65 1.536-3.292A1 1 0 018 1.5zm0 3.365l-.844 1.808-.214.458-.496.1-1.675.335 1.112.91.454.371-.102.577-.325 1.84 1.509-1.078L8 9.771l.581.415 1.509 1.078-.325-1.84-.102-.577.454-.371 1.112-.91-1.675-.335-.496-.1-.214-.458L8 4.865z'/%3E%3C/svg%3E")}.mc-stars-input--s .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E")}.mc-stars-input--l{height:2rem;width:10rem}.mc-stars-input--l .mc-stars-input__label{height:2rem;width:2rem;background-size:2rem 2rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E")}.mc-stars-input--l .mc-stars-input__label::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E");background-size:2rem 2rem}.mc-stars-input--l .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--l .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E")}.mc-stars-input--l .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--l .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E")}.mc-stars-input--l .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E")}.mc-stars-input--l .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E")}.mc-stars-input--xl{height:3rem;width:15rem}.mc-stars-input--xl .mc-stars-input__label{height:3rem;width:3rem;background-size:3rem 3rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E")}.mc-stars-input--xl .mc-stars-input__label::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E");background-size:3rem 3rem}.mc-stars-input--xl .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--xl .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24 3.5a1.5 1.5 0 011.362.871l5.658 12.26 13.192 1.884a1.5 1.5 0 01.738 2.646l-10.237 8.375 3.73 13.052a1.5 1.5 0 01-2.23 1.69L24 36.76l-12.214 7.517a1.5 1.5 0 01-2.228-1.69l3.729-13.052L3.05 21.161a1.5 1.5 0 01.738-2.646l13.192-1.884 5.658-12.26A1.5 1.5 0 0124 3.5zm0 5.08l-4.638 10.049-.342.74-.808.116-10.619 1.517 8.357 6.837.763.625-.27.948-2.94 10.286 9.71-5.976.787-.483.786.483 9.71 5.976-2.938-10.286-.271-.948.763-.625 8.357-6.837-10.62-1.517-.807-.116-.342-.74L24 8.579z'/%3E%3C/svg%3E")}.mc-stars-input--xl .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--xl .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E")}.mc-stars-input--xl .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24 3.5a1.5 1.5 0 011.362.871l5.658 12.26 13.192 1.884a1.5 1.5 0 01.738 2.646l-10.237 8.375 3.73 13.052a1.5 1.5 0 01-2.23 1.69L24 36.76l-12.214 7.517a1.5 1.5 0 01-2.228-1.69l3.729-13.052L3.05 21.161a1.5 1.5 0 01.738-2.646l13.192-1.884 5.658-12.26A1.5 1.5 0 0124 3.5zm0 5.08l-4.638 10.049-.342.74-.808.116-10.619 1.517 8.357 6.837.763.625-.27.948-2.94 10.286 9.71-5.976.787-.483.786.483 9.71 5.976-2.938-10.286-.271-.948.763-.625 8.357-6.837-10.62-1.517-.807-.116-.342-.74L24 8.579z'/%3E%3C/svg%3E")}.mc-stars-input--xl .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E")}`;
|
|
216
|
-
this.shadowRoot.appendChild(style);
|
|
217
|
-
|
|
218
|
-
init(
|
|
219
|
-
this,
|
|
220
|
-
{
|
|
221
|
-
target: this.shadowRoot,
|
|
222
|
-
props: attribute_to_object(this.attributes),
|
|
223
|
-
customElement: true
|
|
224
|
-
},
|
|
225
|
-
instance,
|
|
226
|
-
create_fragment,
|
|
227
|
-
safe_not_equal,
|
|
228
|
-
{
|
|
229
|
-
unselectedText: 0,
|
|
230
|
-
name: 1,
|
|
231
|
-
size: 2,
|
|
232
|
-
ratinglabels: 3
|
|
233
|
-
},
|
|
234
|
-
null
|
|
235
|
-
);
|
|
236
|
-
|
|
237
|
-
if (options) {
|
|
238
|
-
if (options.target) {
|
|
239
|
-
insert(options.target, this, options.anchor);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (options.props) {
|
|
243
|
-
this.$set(options.props);
|
|
244
|
-
flush();
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
static get observedAttributes() {
|
|
250
|
-
return ["unselectedText", "name", "size", "ratinglabels"];
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
get unselectedText() {
|
|
254
|
-
return this.$$.ctx[0];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
set unselectedText(unselectedText) {
|
|
258
|
-
this.$$set({ unselectedText });
|
|
259
|
-
flush();
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
get name() {
|
|
263
|
-
return this.$$.ctx[1];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
set name(name) {
|
|
267
|
-
this.$$set({ name });
|
|
268
|
-
flush();
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
get size() {
|
|
272
|
-
return this.$$.ctx[2];
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
set size(size) {
|
|
276
|
-
this.$$set({ size });
|
|
277
|
-
flush();
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
get ratinglabels() {
|
|
281
|
-
return this.$$.ctx[3];
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
set ratinglabels(ratinglabels) {
|
|
285
|
-
this.$$set({ ratinglabels });
|
|
286
|
-
flush();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
customElements.define("m-stars-input", StarsInput);
|
|
291
|
-
|
|
292
|
-
export { StarsInput as default };
|
|
1
|
+
import{S as e,i as a,a as t,b as l,f as s,s as i,c as r,e as m,d as n,n as o,g,h as d,j as u,m as c,o as h,J as p,p as w,q as v,t as _,l as b,k as x}from"../../index-c33b3772.js";import{E as f}from"../../EventHandler-02058705.js";function E(e,a,t){const l=e.slice();return l[8]=a[t],l[10]=t,l}function C(e){let a,t,s,i,r,o,d,c,p,w,v,f=e[3][e[10]]+"";function E(){return e[6](e[10])}return{c(){a=m("input"),s=n(),i=m("label"),r=m("span"),o=_(f),d=n(),g(a,"id",t=B(e[1],e[10])),g(a,"type","radio"),g(a,"name",e[1]),a.value=e[10]+1,g(a,"class","mc-stars-input__radio"),g(r,"class","mc-stars-input__text"),g(i,"for",c=B(e[1],e[10])),g(i,"title",p=e[3][e[10]]),g(i,"class","mc-stars-input__label")},m(e,t){l(e,a,t),l(e,s,t),l(e,i,t),u(i,r),u(r,o),u(i,d),w||(v=b(i,"click",E),w=!0)},p(l,s){e=l,2&s&&t!==(t=B(e[1],e[10]))&&g(a,"id",t),2&s&&g(a,"name",e[1]),8&s&&f!==(f=e[3][e[10]]+"")&&x(o,f),2&s&&c!==(c=B(e[1],e[10]))&&g(i,"for",c),8&s&&p!==(p=e[3][e[10]])&&g(i,"title",p)},d(e){e&&h(a),e&&h(s),e&&h(i),w=!1,v()}}}function L(e){let a,t,s,i,w=Array(k),v=[];for(let a=0;a<w.length;a+=1)v[a]=C(E(e,w,a));let _=[{class:i=z(e[2])},e[5]],b={};for(let e=0;e<_.length;e+=1)b=r(b,_[e]);return{c(){a=m("div"),t=m("input"),s=n();for(let e=0;e<v.length;e+=1)v[e].c();this.c=o,g(t,"id","no-rate"),g(t,"type","radio"),g(t,"name",e[1]),t.value="0",g(t,"class","mc-stars-input__radio"),t.checked=!0,g(t,"aria-label",e[0]),d(a,b)},m(e,i){l(e,a,i),u(a,t),u(a,s);for(let e=0;e<v.length;e+=1)v[e]&&v[e].m(a,null)},p(e,[l]){if(2&l&&g(t,"name",e[1]),1&l&&g(t,"aria-label",e[0]),26&l){let t;for(w=Array(k),t=0;t<w.length;t+=1){const s=E(e,w,t);v[t]?v[t].p(s,l):(v[t]=C(s),v[t].c(),v[t].m(a,null))}for(;t<v.length;t+=1)v[t].d(1);v.length=w.length}d(a,b=c(_,[4&l&&i!==(i=z(e[2]))&&{class:i},32&l&&e[5]]))},i:o,o:o,d(e){e&&h(a),p(v,e)}}}const k=5;function z(e){const a="mc-stars-input";return e?`${a} ${a}--${e}`:a}function B(e,a){return`${e}${a+1}`}function M(e,a,t){const l=["unselectedText","name","size","ratinglabels"];let s=w(a,l),{unselectedText:i="No opinion given"}=a,{name:m="rating"}=a,{size:n="m"}=a,{ratinglabels:o=["Very bad","Bad","Medium","Good","Excellent"]}=a,g=new f;function d(e){g.dispatch("star-selected",e+1)}return e.$$set=e=>{a=r(r({},a),v(e)),t(5,s=w(a,l)),"unselectedText"in e&&t(0,i=e.unselectedText),"name"in e&&t(1,m=e.name),"size"in e&&t(2,n=e.size),"ratinglabels"in e&&t(3,o=e.ratinglabels)},[i,m,n,o,d,s,e=>d(e)]}class $ extends e{constructor(e){super();const r=document.createElement("style");r.textContent=".mc-stars-input{height:1.5rem;width:7.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.mc-stars-input__text,.mc-stars-input__radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-stars-input__radio::-ms-check{display:none}.mc-stars-input__label{height:1.5rem;width:1.5rem;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\");background-position:center center;background-repeat:repeat-x;background-size:1.5rem 1.5rem;border-radius:4px;cursor:pointer}.mc-stars-input__label::before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\");background-position:left center;background-repeat:repeat-x;background-size:1.5rem 1.5rem;content:\"\";left:0;top:0;bottom:0;display:block;position:absolute;opacity:0;pointer-events:none}.mc-stars-input__label:nth-of-type(5)::before{width:80%}.mc-stars-input__label:nth-of-type(4)::before{width:60%}.mc-stars-input__label:nth-of-type(3)::before{width:40%}.mc-stars-input__label:nth-of-type(2)::before{width:20%}.mc-stars-input__label:nth-of-type(1)::before{width:0%}:checked~.mc-stars-input__label,:focus~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E\")}:checked+.mc-stars-input__label,:focus+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\")}:focus+.mc-stars-input__label{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E\")}.mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\")}.mc-stars-input__radio:hover+.mc-stars-input__label::before{opacity:1}.mc-stars-input--s{height:1rem;width:5rem}.mc-stars-input--s .mc-stars-input__label{height:1rem;width:1rem;background-size:1rem 1rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E\")}.mc-stars-input--s .mc-stars-input__label::before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E\");background-size:1rem 1rem}.mc-stars-input--s .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--s .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8 1.5a1 1 0 01.906.577l1.536 3.292 3.254.65a1 1 0 01.437 1.755l-2.296 1.879.648 3.673a1 1 0 01-1.566.988L8 12.229l-2.919 2.085a1 1 0 01-1.566-.988l.648-3.673-2.296-1.879a1 1 0 01.437-1.755l3.254-.65 1.536-3.292A1 1 0 018 1.5zm0 3.365l-.844 1.808-.214.458-.496.1-1.675.335 1.112.91.454.371-.102.577-.325 1.84 1.509-1.078L8 9.771l.581.415 1.509 1.078-.325-1.84-.102-.577.454-.371 1.112-.91-1.675-.335-.496-.1-.214-.458L8 4.865z'/%3E%3C/svg%3E\")}.mc-stars-input--s .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--s .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E\")}.mc-stars-input--s .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8 1.5a1 1 0 01.906.577l1.536 3.292 3.254.65a1 1 0 01.437 1.755l-2.296 1.879.648 3.673a1 1 0 01-1.566.988L8 12.229l-2.919 2.085a1 1 0 01-1.566-.988l.648-3.673-2.296-1.879a1 1 0 01.437-1.755l3.254-.65 1.536-3.292A1 1 0 018 1.5zm0 3.365l-.844 1.808-.214.458-.496.1-1.675.335 1.112.91.454.371-.102.577-.325 1.84 1.509-1.078L8 9.771l.581.415 1.509 1.078-.325-1.84-.102-.577.454-.371 1.112-.91-1.675-.335-.496-.1-.214-.458L8 4.865z'/%3E%3C/svg%3E\")}.mc-stars-input--s .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' viewBox='0 0 16 16' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M8.906 2.077a1 1 0 00-1.812 0L5.558 5.37l-3.254.65a1 1 0 00-.437 1.755l2.296 1.879-.648 3.673a1 1 0 001.566.988L8 12.229l2.919 2.085a1 1 0 001.566-.988l-.648-3.673 2.296-1.879a1 1 0 00-.437-1.755l-3.254-.65-1.536-3.292z'/%3E%3C/svg%3E\")}.mc-stars-input--l{height:2rem;width:10rem}.mc-stars-input--l .mc-stars-input__label{height:2rem;width:2rem;background-size:2rem 2rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\")}.mc-stars-input--l .mc-stars-input__label::before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\");background-size:2rem 2rem}.mc-stars-input--l .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--l .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E\")}.mc-stars-input--l .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--l .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\")}.mc-stars-input--l .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16 2.333a1 1 0 01.908.581l3.772 8.173 8.795 1.256a1 1 0 01.492 1.764l-6.825 5.584 2.487 8.7a1 1 0 01-1.486 1.127L16 24.508l-8.142 5.01a1 1 0 01-1.486-1.126l2.486-8.701-6.824-5.584a1 1 0 01.492-1.764l8.794-1.256 3.772-8.173a1 1 0 01.908-.58zm0 3.387l-3.092 6.699-.228.494-.538.077L5.062 14l5.572 4.558.508.417-.18.632-1.96 6.857 6.474-3.983.524-.323.524.323 6.474 3.983-1.96-6.857-.18-.632.51-.417L26.938 14l-7.08-1.011-.538-.077-.228-.494L16 5.719z'/%3E%3C/svg%3E\")}.mc-stars-input--l .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M16.908 2.914a1 1 0 00-1.816 0l-3.772 8.173-8.794 1.256a1 1 0 00-.492 1.764l6.824 5.584-2.486 8.7a1 1 0 001.486 1.127L16 24.508l8.143 5.01a1 1 0 001.486-1.126l-2.487-8.701 6.825-5.584a1 1 0 00-.492-1.764l-8.795-1.256-3.772-8.173z'/%3E%3C/svg%3E\")}.mc-stars-input--xl{height:3rem;width:15rem}.mc-stars-input--xl .mc-stars-input__label{height:3rem;width:3rem;background-size:3rem 3rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E\")}.mc-stars-input--xl .mc-stars-input__label::before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E\");background-size:3rem 3rem}.mc-stars-input--xl .mc-stars-input__radio:checked~.mc-stars-input__label,.mc-stars-input--xl .mc-stars-input__radio:focus~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24 3.5a1.5 1.5 0 011.362.871l5.658 12.26 13.192 1.884a1.5 1.5 0 01.738 2.646l-10.237 8.375 3.73 13.052a1.5 1.5 0 01-2.23 1.69L24 36.76l-12.214 7.517a1.5 1.5 0 01-2.228-1.69l3.729-13.052L3.05 21.161a1.5 1.5 0 01.738-2.646l13.192-1.884 5.658-12.26A1.5 1.5 0 0124 3.5zm0 5.08l-4.638 10.049-.342.74-.808.116-10.619 1.517 8.357 6.837.763.625-.27.948-2.94 10.286 9.71-5.976.787-.483.786.483 9.71 5.976-2.938-10.286-.271-.948.763-.625 8.357-6.837-10.62-1.517-.807-.116-.342-.74L24 8.579z'/%3E%3C/svg%3E\")}.mc-stars-input--xl .mc-stars-input__radio:checked+.mc-stars-input__label,.mc-stars-input--xl .mc-stars-input__radio:focus+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E\")}.mc-stars-input--xl .mc-stars-input__radio:hover~.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24 3.5a1.5 1.5 0 011.362.871l5.658 12.26 13.192 1.884a1.5 1.5 0 01.738 2.646l-10.237 8.375 3.73 13.052a1.5 1.5 0 01-2.23 1.69L24 36.76l-12.214 7.517a1.5 1.5 0 01-2.228-1.69l3.729-13.052L3.05 21.161a1.5 1.5 0 01.738-2.646l13.192-1.884 5.658-12.26A1.5 1.5 0 0124 3.5zm0 5.08l-4.638 10.049-.342.74-.808.116-10.619 1.517 8.357 6.837.763.625-.27.948-2.94 10.286 9.71-5.976.787-.483.786.483 9.71 5.976-2.938-10.286-.271-.948.763-.625 8.357-6.837-10.62-1.517-.807-.116-.342-.74L24 8.579z'/%3E%3C/svg%3E\")}.mc-stars-input--xl .mc-stars-input__radio:hover+.mc-stars-input__label{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='3rem' width='3rem' viewBox='0 0 48 48' fill='%23ea7315'%3E%3Cpath fill-rule='evenodd' d='M24.908 4.58a1 1 0 00-1.816 0L17.32 17.088 3.86 19.01a1 1 0 00-.492 1.764l10.49 8.584-3.818 13.367a1 1 0 001.485 1.127L24 36.174l12.476 7.678a1 1 0 001.486-1.127l-3.82-13.367 10.491-8.584a1 1 0 00-.492-1.764L30.68 17.087 24.908 4.581z'/%3E%3C/svg%3E\")}",this.shadowRoot.appendChild(r),a(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},M,L,i,{unselectedText:0,name:1,size:2,ratinglabels:3},null),e&&(e.target&&l(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["unselectedText","name","size","ratinglabels"]}get unselectedText(){return this.$$.ctx[0]}set unselectedText(e){this.$$set({unselectedText:e}),s()}get name(){return this.$$.ctx[1]}set name(e){this.$$set({name:e}),s()}get size(){return this.$$.ctx[2]}set size(e){this.$$set({size:e}),s()}get ratinglabels(){return this.$$.ctx[3]}set ratinglabels(e){this.$$set({ratinglabels:e}),s()}}export{$ as default};
|
|
293
2
|
//# sourceMappingURL=StarsInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarsInput.js","sources":["../../../src/components/ratings/StarsInput.svelte"],"sourcesContent":["<svelte:options tag
|
|
1
|
+
{"version":3,"file":"StarsInput.js","sources":["../../../src/components/ratings/StarsInput.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import type { RatingsSize } from './ratings.types';\n import { EventHandler } from '../../utilities/EventHandler';\n const ratingValue = 5;\n export let unselectedText = 'No opinion given';\n export let name = 'rating';\n export let size: RatingsSize = 'm';\n export let ratinglabels: Array<string> = [\n 'Very bad',\n 'Bad',\n 'Medium',\n 'Good',\n 'Excellent',\n ];\n\n let eventHandler = new EventHandler();\n function setClasses(size: RatingsSize): string {\n const mainClass = 'mc-stars-input';\n\n return size ? `${mainClass} ${mainClass}--${size}` : mainClass;\n }\n\n function setInputId(name: string, index: number): string {\n return `${name}${index + 1}`;\n }\n\n function selectStar(i: number) {\n eventHandler.dispatch('star-selected', i + 1);\n }\n</script>\n\n<div class={setClasses(size)} {...$$restProps}>\n <input\n id=\"no-rate\"\n type=\"radio\"\n {name}\n value=\"0\"\n class=\"mc-stars-input__radio\"\n checked\n aria-label={unselectedText}\n />\n\n {#each Array(ratingValue) as _, i}\n <input\n id={setInputId(name, i)}\n type=\"radio\"\n {name}\n value={i + 1}\n class=\"mc-stars-input__radio\"\n />\n\n <!-- svelte-ignore a11y-click-events-have-key-events -->\n <label\n for={setInputId(name, i)}\n title={ratinglabels[i]}\n class=\"mc-stars-input__label\"\n on:click={() => selectStar(i)}\n >\n <span class=\"mc-stars-input__text\">\n {ratinglabels[i]}\n </span>\n </label>\n {/each}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/_c.stars-input';\n</style>\n"],"names":["t1_value","ctx","setInputId","input","value","attr","label","label_title_value","insert","target","anchor","append","span","dirty","set_data","t1","each_value","Array","ratingValue","length","i","class","div_class_value","setClasses","div","size","mainClass","name","index","unselectedText","$$props","ratinglabels","eventHandler","EventHandler","selectStar","dispatch"],"mappings":"6UA6DSA,EAAAC,KAAaA,EAAC,KAAA,kHAfbC,EAAWD,EAAI,GAAEA,EAAC,2CAGfE,EAAAC,MAAAH,MAAI,uFAMNC,EAAWD,EAAI,GAAEA,EAAC,MAChBI,EAAAC,EAAA,QAAAC,EAAAN,KAAaA,EAAC,mDAXvBO,EAMCC,EAAAN,EAAAO,YAGDF,EASOC,EAAAH,EAAAI,GAHLC,EAEML,EAAAM,oEAhBFV,EAAWD,EAAI,GAAEA,EAAC,yCAenB,EAAAY,GAAAb,KAAAA,EAAAC,KAAaA,EAAC,KAAA,KAAAa,EAAAC,EAAAf,eANZE,EAAWD,EAAI,GAAEA,EAAC,oBAChB,EAAAY,GAAAN,KAAAA,EAAAN,KAAaA,EAAC,yFAZlBe,EAAAC,MAAMC,wBAAXC,OAAIC,GAAA,2BAXIC,MAAAC,EAAAC,EAAWtB,EAAI,KAAOA,EAAW,gRAQ7BA,EAAc,mBAR9BO,EAgCKC,EAAAe,EAAAd,GA/BHC,EAQCa,EAAArB,oHADaF,EAAc,oBAGrBe,EAAAC,MAAMC,WAAXC,OAAIC,GAAA,EAAA,iHAAJD,kBAXQ,EAAAN,GAAAS,KAAAA,EAAAC,EAAWtB,EAAI,MAAA,CAAAoB,MAAAC,SAAOrB,EAAW,qCA5BrC,MAAAiB,EAAc,EAaX,SAAAK,EAAWE,GACZ,MAAAC,EAAY,iBAEX,OAAAD,KAAUC,KAAaA,MAAcD,IAASC,WAG9CxB,EAAWyB,EAAcC,YACtBD,IAAOC,EAAQ,4FAnBhBC,eAAAA,EAAiB,oBAAkBC,GACnCH,KAAAA,EAAO,UAAQG,GACfL,KAAAA,EAAoB,KAAGK,gBACvBC,EAAY,CACrB,WACA,MACA,SACA,OACA,cAAWD,EAGTE,MAAmBC,EAWd,SAAAC,EAAWd,GAClBY,EAAaG,SAAS,gBAAiBf,EAAI,gNA6BzBA,GAAAc,EAAWd"}
|