@mozaic-ds/web-components 0.10.1 → 0.11.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/README.md +2 -1
- package/package.json +2 -2
- package/public/{DataTableDefaultAction.nested-46712849.js → DataTableDefaultAction.nested-e758217a.js} +2 -2
- package/public/DataTableDefaultAction.nested-e758217a.js.map +1 -0
- package/public/DataTableUtilities-ccffa53e.js +2 -0
- package/public/DataTableUtilities-ccffa53e.js.map +1 -0
- package/public/adeo/{DataTableDefaultAction.nested-c4d942ab.js → DataTableDefaultAction.nested-be8d4e7b.js} +2 -2
- package/public/adeo/DataTableDefaultAction.nested-be8d4e7b.js.map +1 -0
- package/public/adeo/DataTableUtilities-ccffa53e.js +2 -0
- package/public/adeo/DataTableUtilities-ccffa53e.js.map +1 -0
- package/public/adeo/bundle.js +10 -0
- package/public/adeo/components/autocomplete/Autocomplete.js +1 -1
- package/public/adeo/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/adeo/components/autocomplete/Autocomplete.svelte +7 -5
- package/public/adeo/components/button/Button.js +1 -1
- package/public/adeo/components/button/Button.js.map +1 -1
- package/public/adeo/components/button/Button.svelte +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 +44 -19
- package/public/adeo/components/datatable/DataTableDefaultAction.nested.js +1 -1
- package/public/adeo/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
- package/public/adeo/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
- package/public/adeo/components/datatable/DataTableFooter.nested.js +1 -1
- package/public/adeo/components/datatable/data.d.ts.map +1 -1
- package/public/adeo/components/datatable/datatable.types.d.ts +16 -2
- package/public/adeo/components/datatable/datatable.types.d.ts.map +1 -1
- package/public/adeo/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +18 -0
- package/public/adeo/components/menu/Menu.js +2 -0
- package/public/adeo/components/menu/Menu.js.map +1 -0
- package/public/adeo/components/menu/Menu.svelte +54 -0
- package/public/adeo/components/menu/menu.types.d.ts +9 -0
- package/public/adeo/components/menu/menu.types.d.ts.map +1 -0
- package/public/adeo/components/pagination/Pagination.js +1 -1
- package/public/adeo/components/pagination/Pagination.js.map +1 -1
- package/public/adeo/components/pagination/Pagination.svelte +5 -4
- package/public/adeo/components/ratings/StarsInput.js +1 -1
- package/public/adeo/components/ratings/StarsInput.js.map +1 -1
- package/public/adeo/components/segmentedcontrol/SegmentedControl.js +2 -0
- package/public/adeo/components/segmentedcontrol/SegmentedControl.js.map +1 -0
- package/public/adeo/components/segmentedcontrol/SegmentedControl.svelte +52 -0
- package/public/adeo/components/segmentedcontrol/segmentedControl.types.d.ts +8 -0
- package/public/adeo/components/segmentedcontrol/segmentedControl.types.d.ts.map +1 -0
- package/public/adeo/components/sidebar/sidebar-feature-group.nested.js +1 -1
- package/public/adeo/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/adeo/components/sidebar/sidebar-segment.nested.js +1 -1
- package/public/adeo/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/adeo/components/sidebar/sidebar-user.nested.js +1 -1
- package/public/adeo/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/adeo/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +1 -1
- package/public/adeo/components/sidebar-segment/sidebar-segment.nested.svelte +1 -1
- package/public/adeo/components/sidebar-user/sidebar-user.nested.svelte +1 -0
- package/public/adeo/components/starsinput/StarsInput.svelte +9 -2
- package/public/adeo/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/adeo/utilities/DataTableUtilities.ts +12 -0
- package/public/bricoman/{DataTableDefaultAction.nested-b325de83.js → DataTableDefaultAction.nested-41f58b1f.js} +2 -2
- package/public/bricoman/DataTableDefaultAction.nested-41f58b1f.js.map +1 -0
- package/public/bricoman/DataTableUtilities-ccffa53e.js +2 -0
- package/public/bricoman/DataTableUtilities-ccffa53e.js.map +1 -0
- package/public/bricoman/bundle.js +10 -0
- package/public/bricoman/components/autocomplete/Autocomplete.js +1 -1
- package/public/bricoman/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/bricoman/components/autocomplete/Autocomplete.svelte +7 -5
- package/public/bricoman/components/button/Button.js +1 -1
- package/public/bricoman/components/button/Button.js.map +1 -1
- package/public/bricoman/components/button/Button.svelte +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 +44 -19
- package/public/bricoman/components/datatable/DataTableDefaultAction.nested.js +1 -1
- package/public/bricoman/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
- package/public/bricoman/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
- package/public/bricoman/components/datatable/DataTableFooter.nested.js +1 -1
- package/public/bricoman/components/datatable/data.d.ts.map +1 -1
- package/public/bricoman/components/datatable/datatable.types.d.ts +16 -2
- package/public/bricoman/components/datatable/datatable.types.d.ts.map +1 -1
- package/public/bricoman/components/datatabledefaultaction/DataTableDefaultAction.nested.svelte +18 -0
- package/public/bricoman/components/menu/Menu.js +2 -0
- package/public/bricoman/components/menu/Menu.js.map +1 -0
- package/public/bricoman/components/menu/Menu.svelte +54 -0
- package/public/bricoman/components/menu/menu.types.d.ts +9 -0
- package/public/bricoman/components/menu/menu.types.d.ts.map +1 -0
- package/public/bricoman/components/pagination/Pagination.js +1 -1
- package/public/bricoman/components/pagination/Pagination.js.map +1 -1
- package/public/bricoman/components/pagination/Pagination.svelte +5 -4
- package/public/bricoman/components/ratings/StarsInput.js +1 -1
- package/public/bricoman/components/ratings/StarsInput.js.map +1 -1
- package/public/bricoman/components/segmentedcontrol/SegmentedControl.js +2 -0
- package/public/bricoman/components/segmentedcontrol/SegmentedControl.js.map +1 -0
- package/public/bricoman/components/segmentedcontrol/SegmentedControl.svelte +52 -0
- package/public/bricoman/components/segmentedcontrol/segmentedControl.types.d.ts +8 -0
- package/public/bricoman/components/segmentedcontrol/segmentedControl.types.d.ts.map +1 -0
- package/public/bricoman/components/sidebar/sidebar-feature-group.nested.js +1 -1
- package/public/bricoman/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/bricoman/components/sidebar/sidebar-segment.nested.js +1 -1
- package/public/bricoman/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/bricoman/components/sidebar/sidebar-user.nested.js +1 -1
- package/public/bricoman/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/bricoman/components/sidebar-feature-group/sidebar-feature-group.nested.svelte +1 -1
- package/public/bricoman/components/sidebar-segment/sidebar-segment.nested.svelte +1 -1
- package/public/bricoman/components/sidebar-user/sidebar-user.nested.svelte +1 -0
- package/public/bricoman/components/starsinput/StarsInput.svelte +9 -2
- package/public/bricoman/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/bricoman/utilities/DataTableUtilities.ts +12 -0
- package/public/bundle.js +10 -0
- package/public/components/autocomplete/Autocomplete.js +1 -1
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.svelte +7 -5
- package/public/components/button/Button.js +1 -1
- package/public/components/button/Button.js.map +1 -1
- package/public/components/button/Button.svelte +1 -1
- package/public/components/datatable/DataTable.js +1 -1
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTable.svelte +44 -19
- package/public/components/datatable/DataTableDefaultAction.nested.js +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +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/menu/Menu.js +2 -0
- package/public/components/menu/Menu.js.map +1 -0
- package/public/components/menu/Menu.svelte +54 -0
- package/public/components/menu/menu.types.d.ts +9 -0
- package/public/components/menu/menu.types.d.ts.map +1 -0
- package/public/components/pagination/Pagination.js +1 -1
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/pagination/Pagination.svelte +5 -4
- package/public/components/ratings/StarsInput.js +1 -1
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/segmentedcontrol/SegmentedControl.js +2 -0
- package/public/components/segmentedcontrol/SegmentedControl.js.map +1 -0
- package/public/components/segmentedcontrol/SegmentedControl.svelte +52 -0
- package/public/components/segmentedcontrol/segmentedControl.types.d.ts +8 -0
- package/public/components/segmentedcontrol/segmentedControl.types.d.ts.map +1 -0
- package/public/components/sidebar/sidebar-feature-group.nested.js +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +1 -1
- package/public/components/sidebar/sidebar-user.nested.js.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/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/utilities/DataTableUtilities.ts +12 -0
- 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/components/menu/menu.types.d.ts +9 -0
- package/public/utilities/components/menu/menu.types.d.ts.map +1 -0
- package/public/utilities/components/segmentedcontrol/segmentedControl.types.d.ts +8 -0
- package/public/utilities/components/segmentedcontrol/segmentedControl.types.d.ts.map +1 -0
- package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +1 -1
- package/public/utilities/stories/menu/Menu.stories.d.ts +5 -0
- package/public/utilities/stories/menu/Menu.stories.d.ts.map +1 -0
- package/public/utilities/stories/ratings/StarsResult.stories.d.ts.map +1 -1
- package/public/utilities/stories/segmentedcontrol/segmentedcontrol.stories.d.ts +5 -0
- package/public/utilities/stories/segmentedcontrol/segmentedcontrol.stories.d.ts.map +1 -0
- package/public/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
- package/public/DataTableDefaultAction.nested-46712849.js.map +0 -1
- package/public/DataTableUtilities-313a448d.js +0 -2
- package/public/DataTableUtilities-313a448d.js.map +0 -1
- package/public/adeo/DataTableDefaultAction.nested-c4d942ab.js.map +0 -1
- package/public/adeo/DataTableUtilities-313a448d.js +0 -2
- package/public/adeo/DataTableUtilities-313a448d.js.map +0 -1
- package/public/bricoman/DataTableDefaultAction.nested-b325de83.js.map +0 -1
- package/public/bricoman/DataTableUtilities-313a448d.js +0 -2
- package/public/bricoman/DataTableUtilities-313a448d.js.map +0 -1
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
export let fixedFirstColumn: boolean;
|
|
26
26
|
export let fixedFirstColumnLabel: string;
|
|
27
27
|
export let searchValue = '';
|
|
28
|
+
export let showToggle = false;
|
|
29
|
+
export let toggleLabel = '';
|
|
30
|
+
export let toggleValue: boolean;
|
|
28
31
|
|
|
29
32
|
let eventHandler = new EventHandler();
|
|
30
33
|
let openLayer: any = null;
|
|
@@ -39,6 +42,7 @@
|
|
|
39
42
|
let hoveredItemIndex: any = null;
|
|
40
43
|
|
|
41
44
|
$: initDatas = headTitles ? headTitles.map((x) => Object.assign({}, x)) : [];
|
|
45
|
+
$: toggleValue = toggleValue ?? false;
|
|
42
46
|
|
|
43
47
|
$: {
|
|
44
48
|
if (
|
|
@@ -91,9 +95,23 @@
|
|
|
91
95
|
function onFixedFirstColumn() {
|
|
92
96
|
fixedFirstColumn = fixedFirstColumn ? false : true;
|
|
93
97
|
}
|
|
98
|
+
|
|
99
|
+
function onToggleAction() {
|
|
100
|
+
toggleValue = !toggleValue;
|
|
101
|
+
emitEvent('toggle-change', { toggleValue });
|
|
102
|
+
}
|
|
94
103
|
</script>
|
|
95
104
|
|
|
96
105
|
<div class="mc-datatable__topbar-actions">
|
|
106
|
+
{#if showToggle}
|
|
107
|
+
<m-toggle
|
|
108
|
+
name="topbar-actions-toggle"
|
|
109
|
+
size="s"
|
|
110
|
+
checked={toggleValue}
|
|
111
|
+
label={toggleLabel}
|
|
112
|
+
on:change={onToggleAction}
|
|
113
|
+
/>
|
|
114
|
+
{/if}
|
|
97
115
|
<div class="mc-left-icon-input">
|
|
98
116
|
<span class="mc-left-icon-input__icon">
|
|
99
117
|
<navigation-display-search-24px size="24px" />
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as e,i as t,a as i,b as n,f as s,s as l,e as a,n as o,g as r,j as m,o as c,J as d,d as u,t as f,z as g,l as h,k as b}from"../../index-c33b3772.js";import{E as _}from"../../EventHandler-02058705.js";function p(e,t,i){const n=e.slice();return n[7]=t[i],n[9]=i,n}function k(e){let t,i,s,l,o,d,_,p,k,x=`<${w(e[7].iconName,e[0]===e[9])} />`,v=e[7].label+"";function $(){return e[5](e[9],e[7])}return{c(){t=a("li"),i=a("div"),s=a("span"),l=u(),o=a("span"),d=f(v),_=u(),r(s,"class","mc-menu__icon"),r(o,"class","mc-menu__label"),r(i,"class","mc-menu__link"),g(i,"is-active",e[0]===e[9]),g(i,"is-disabled",e[7].disabled),r(t,"class","mc-menu__item")},m(e,a){n(e,t,a),m(t,i),m(i,s),s.innerHTML=x,m(i,l),m(i,o),m(o,d),m(t,_),p||(k=h(i,"click",$),p=!0)},p(t,n){e=t,3&n&&x!==(x=`<${w(e[7].iconName,e[0]===e[9])} />`)&&(s.innerHTML=x),2&n&&v!==(v=e[7].label+"")&&b(d,v),1&n&&g(i,"is-active",e[0]===e[9]),2&n&&g(i,"is-disabled",e[7].disabled)},d(e){e&&c(t),p=!1,k()}}}function x(e){let t,i,s=e[1],l=[];for(let t=0;t<s.length;t+=1)l[t]=k(p(e,s,t));return{c(){t=a("nav"),i=a("ul");for(let e=0;e<l.length;e+=1)l[e].c();this.c=o,r(i,"class","mc-menu__list"),r(t,"class","mc-menu"),r(t,"aria-label","menu")},m(e,s){n(e,t,s),m(t,i);for(let e=0;e<l.length;e+=1)l[e]&&l[e].m(i,null)},p(e,[t]){if(7&t){let n;for(s=e[1],n=0;n<s.length;n+=1){const a=p(e,s,n);l[n]?l[n].p(a,t):(l[n]=k(a),l[n].c(),l[n].m(i,null))}for(;n<l.length;n+=1)l[n].d(1);l.length=s.length}},i:o,o:o,d(e){e&&c(t),d(l,e)}}}function w(e,t){return t?`${e} fill="white" `:`${e} `}function v(e,t,i){let n,s,{items:l}=t,{selected:a}=t,o=new _;function r(e,t){i(0,s=e),o.dispatch("item-selected",{index:e,item:t})}return e.$$set=e=>{"items"in e&&i(3,l=e.items),"selected"in e&&i(4,a=e.selected)},e.$$.update=()=>{8&e.$$.dirty&&i(1,n=l?JSON.parse(l):[]),16&e.$$.dirty&&i(0,s=a?Number(a):"")},[s,n,r,l,a,(e,t)=>r(e,t)]}class $ extends e{constructor(e){super();const a=document.createElement("style");a.textContent=".mc-menu{max-width:16rem}.mc-menu,.mc-menu *{-webkit-box-sizing:border-box;box-sizing:border-box}.mc-menu__list{border-radius:0.25rem;list-style:none;overflow:hidden;padding:0;margin:0}.mc-menu__item{position:relative}.mc-menu__item:not(:last-child) .mc-menu__link::after{background:#b3b3b3;content:\"\";display:block;margin:0 auto;height:1px;width:100%}.mc-menu__item:not(:last-child) .mc-menu__link::after{bottom:0;position:absolute;left:0}.mc-menu__item:not(:last-child) .mc-menu__link.is-active::after{display:none}.mc-menu__link{font-weight:400;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#ffffff;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='%23191919'%3E%3Cpath d='M5.5 14a1 1 0 01-.71-.29 1 1 0 010-1.42L9.09 8l-4.3-4.29a1 1 0 011.42-1.42l5 5a1 1 0 010 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\");background-position:center right 1rem;background-repeat:no-repeat;background-size:1rem;border:none;cursor:pointer;color:#191919;display:-webkit-box;display:-ms-flexbox;display:flex;gap:0.5rem;height:3.5rem;font-family:inherit;padding-right:3rem;padding-left:1rem;position:relative;text-decoration:none;width:100%}.mc-menu__link.is-active,.mc-menu__link.is-disabled{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='%23ffffff'%3E%3Cpath d='M5.5 14a1 1 0 01-.71-.29 1 1 0 010-1.42L9.09 8l-4.3-4.29a1 1 0 011.42-1.42l5 5a1 1 0 010 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\");color:#ffffff}.mc-menu__link:hover{background-color:#eeedea}.mc-menu__link:active{background-color:#dddcd5}.mc-menu__link.is-active{background-color:#007f8c}.mc-menu__link.is-active .mc-menu__label{font-family:\"Roboto\", sans-serif;font-weight:700}.mc-menu__link.is-disabled{background-color:#e6e6e6;cursor:not-allowed}.mc-menu__icon{-ms-flex-negative:0;flex-shrink:0}.mc-menu__label{font-size:1rem;line-height:1.375;font-family:\"Roboto\", sans-serif;font-weight:400;display:-webkit-box;max-height:2.75rem;overflow:hidden;text-align:left;-webkit-line-clamp:2;-webkit-box-orient:vertical}",this.shadowRoot.appendChild(a),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},v,x,l,{items:3,selected:4},null),e&&(e.target&&n(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["items","selected"]}get items(){return this.$$.ctx[3]}set items(e){this.$$set({items:e}),s()}get selected(){return this.$$.ctx[4]}set selected(e){this.$$set({selected:e}),s()}}export{$ as default};
|
|
2
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../src/components/menu/Menu.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { EventHandler } from '../../utilities/EventHandler';\n import type { menuType } from './menu.types';\n export let items: string;\n export let selected: string;\n $: menuItems = items ? (JSON.parse(items) as menuType[]) : [];\n $: itemSelected = selected ? Number(selected) : '';\n\n let eventHandler = new EventHandler();\n\n function generateIconName(\n iconName: string | undefined,\n isActive: boolean,\n ): string {\n if (isActive) return `${iconName} fill=\"white\" `;\n else return `${iconName} `;\n }\n\n function manageMenu(index: any, item: any) {\n itemSelected = index;\n eventHandler.dispatch('item-selected', { index, item });\n }\n</script>\n\n<nav class=\"mc-menu\" aria-label=\"menu\">\n <ul class=\"mc-menu__list\">\n {#each menuItems as item, index}\n <li class=\"mc-menu__item\">\n <!-- svelte-ignore a11y-click-events-have-key-events -->\n <div\n class=\"mc-menu__link\"\n class:is-active={itemSelected === index}\n class:is-disabled={item.disabled}\n on:click={() => manageMenu(index, item)}\n >\n <span class=\"mc-menu__icon\">\n {@html `<${generateIconName(\n item.iconName,\n itemSelected === index,\n )} />`}\n </span>\n <span class=\"mc-menu__label\">{item.label}</span>\n </div>\n </li>\n {/each}\n </ul>\n</nav>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.menu';\n</style>\n"],"names":["raw_value","generateIconName","ctx","iconName","t1_value","label","toggle_class","div","disabled","insert","target","li","anchor","append","span0","span1","dirty","innerHTML","set_data","t1","length","i","nav","ul","isActive","items","$$props","selected","eventHandler","EventHandler","manageMenu","index","item","$$invalidate","itemSelected","dispatch","menuItems","JSON","parse","Number"],"mappings":"iTAsCuBA,EAAA,IAAAC,EACTC,EAAI,GAACC,SACLD,OAAiBA,EAAK,SAGIE,EAAAF,KAAKG,MAAK,0MAVvBC,EAAAC,EAAA,YAAAL,OAAiBA,EAAK,IACpBI,EAAAC,EAAA,cAAAL,KAAKM,+CAL5BC,EAgBIC,EAAAC,EAAAC,GAdFC,EAaKF,EAAAJ,GAPHM,EAKMN,EAAAO,wBACND,EAA+CN,EAAAQ,wDALlC,EAAAC,GAAAhB,KAAAA,EAAA,IAAAC,EACTC,EAAI,GAACC,SACLD,OAAiBA,EAAK,YAAAY,EAAAG,UAAAjB,GAGI,EAAAgB,GAAAZ,KAAAA,EAAAF,KAAKG,MAAK,KAAAa,EAAAC,EAAAf,QAVvBE,EAAAC,EAAA,YAAAL,OAAiBA,EAAK,SACpBI,EAAAC,EAAA,cAAAL,KAAKM,2DANvBN,EAAS,wBAAdkB,OAAIC,GAAA,sLAFVZ,EAsBKC,EAAAY,EAAAV,GArBHC,EAoBIS,EAAAC,kFAnBKrB,EAAS,WAAdkB,OAAIC,GAAA,EAAA,iHAAJD,gDAhBKnB,EACPE,EACAqB,UAEIA,EAAQ,GAAYrB,kBAAQ,GACjBA,sCAZNsB,GAAaC,YACbC,GAAgBD,EAIvBE,MAAmBC,WAUdC,EAAWC,EAAYC,GAC9BC,EAAA,EAAAC,EAAeH,GACfH,EAAaO,SAAS,gBAAmB,CAAAJ,QAAOC,0HAfjDC,EAAA,EAAEG,EAAYX,EAASY,KAAKC,MAAMb,GAAK,mBACvCQ,EAAA,EAAEC,EAAeP,EAAWY,OAAOZ,GAAY,uBA2BxBG,EAAWC,EAAOC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { EventHandler } from '../../utilities/EventHandler';
|
|
5
|
+
import type { menuType } from './menu.types';
|
|
6
|
+
export let items: string;
|
|
7
|
+
export let selected: string;
|
|
8
|
+
$: menuItems = items ? (JSON.parse(items) as menuType[]) : [];
|
|
9
|
+
$: itemSelected = selected ? Number(selected) : '';
|
|
10
|
+
|
|
11
|
+
let eventHandler = new EventHandler();
|
|
12
|
+
|
|
13
|
+
function generateIconName(
|
|
14
|
+
iconName: string | undefined,
|
|
15
|
+
isActive: boolean,
|
|
16
|
+
): string {
|
|
17
|
+
if (isActive) return `${iconName} fill="white" `;
|
|
18
|
+
else return `${iconName} `;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function manageMenu(index: any, item: any) {
|
|
22
|
+
itemSelected = index;
|
|
23
|
+
eventHandler.dispatch('item-selected', { index, item });
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<nav class="mc-menu" aria-label="menu">
|
|
28
|
+
<ul class="mc-menu__list">
|
|
29
|
+
{#each menuItems as item, index}
|
|
30
|
+
<li class="mc-menu__item">
|
|
31
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
32
|
+
<div
|
|
33
|
+
class="mc-menu__link"
|
|
34
|
+
class:is-active={itemSelected === index}
|
|
35
|
+
class:is-disabled={item.disabled}
|
|
36
|
+
on:click={() => manageMenu(index, item)}
|
|
37
|
+
>
|
|
38
|
+
<span class="mc-menu__icon">
|
|
39
|
+
{@html `<${generateIconName(
|
|
40
|
+
item.iconName,
|
|
41
|
+
itemSelected === index,
|
|
42
|
+
)} />`}
|
|
43
|
+
</span>
|
|
44
|
+
<span class="mc-menu__label">{item.label}</span>
|
|
45
|
+
</div>
|
|
46
|
+
</li>
|
|
47
|
+
{/each}
|
|
48
|
+
</ul>
|
|
49
|
+
</nav>
|
|
50
|
+
|
|
51
|
+
<style lang="scss">
|
|
52
|
+
@import '@mozaic-ds/styles/settings-tools/all-settings';
|
|
53
|
+
@import '@mozaic-ds/styles/components/c.menu';
|
|
54
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as t,i as e,a as o,b as r,f as i,s as n,c as m,e as c,d as l,n as a,h as b,j as d,m as s,o as h,p as u,r as g,a1 as f,q as p,g as x,a6 as w,a8 as _,l as v,J as k,H as y,t as M,k as z,a9 as I,L as A,Y as N}from"../../index-c33b3772.js";import{E as D}from"../../EventHandler-02058705.js";function E(t,e,o){const r=t.slice();return r[14]=e[o],r[16]=o,r}function C(t){let e,o,i,n,m;return{c(){e=c("button"),o=c("navigation-arrow-arrow--left-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"aria-label","Previous page"),e.disabled=i=1===Number(t[0])||1===Number(t[1])},m(i,c){r(i,e,c),d(e,o),n||(m=v(e,"click",N(t[7])),n=!0)},p(t,o){3&o&&i!==(i=1===Number(t[0])||1===Number(t[1]))&&(e.disabled=i)},d(t){t&&h(e),n=!1,m()}}}function $(t){let e,o,i;return{c(){e=c("a"),o=c("navigation-arrow-arrow--left-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"href",t[5]),x(e,"aria-label","Previous page"),x(e,"disabled",i=1===Number(t[0])||1===Number(t[1]))},m(t,i){r(t,e,i),d(e,o)},p(t,o){32&o&&x(e,"href",t[5]),3&o&&i!==(i=1===Number(t[0])||1===Number(t[1]))&&x(e,"disabled",i)},d(t){t&&h(e)}}}function j(t){let e,o,i,n,m,l={length:t[1]},a=[];for(let e=0;e<l.length;e+=1)a[e]=S(E(t,l,e));return{c(){e=c("div"),o=c("select");for(let t=0;t<a.length;t+=1)a[t].c();x(o,"class","mc-select mc-pagination__select"),o.disabled=i=1===Number(t[1]),void 0===t[0]&&w((()=>t[11].call(o))),x(e,"class","mc-pagination__field")},m(i,c){r(i,e,c),d(e,o);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(o,null);_(o,t[0],!0),n||(m=[v(o,"change",t[11]),v(o,"change",t[9])],n=!0)},p(t,e){if(27&e){let r;for(l={length:t[1]},r=0;r<l.length;r+=1){const i=E(t,l,r);a[r]?a[r].p(i,e):(a[r]=S(i),a[r].c(),a[r].m(o,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=l.length}2&e&&i!==(i=1===Number(t[1]))&&(o.disabled=i),1&e&&_(o,t[0])},d(t){t&&h(e),k(a,t),n=!1,y(m)}}}function S(t){let e,o,i,n,m,a,b,s,u,g,f=t[16]+1+"";return{c(){e=c("option"),o=M(t[4]),i=l(),n=M(f),m=l(),a=M(t[3]),b=l(),s=M(t[1]),x(e,"name",u=String(t[0])),e.selected=g=t[16]+1==t[0],e.__value=t[16]+1,e.value=e.__value},m(t,c){r(t,e,c),d(e,o),d(e,i),d(e,n),d(e,m),d(e,a),d(e,b),d(e,s)},p(t,r){16&r&&z(o,t[4]),8&r&&z(a,t[3]),2&r&&z(s,t[1]),1&r&&u!==(u=String(t[0]))&&x(e,"name",u),1&r&&g!==(g=t[16]+1==t[0])&&(e.selected=g)},d(t){t&&h(e)}}}function P(t){let e,o,i,n,m;return{c(){e=c("button"),o=c("navigation-arrow-arrow--right-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"aria-label","Previous page"),e.disabled=i=Number(t[0])===Number(t[1])||1===Number(t[1])},m(i,c){r(i,e,c),d(e,o),n||(m=v(e,"click",N(t[8])),n=!0)},p(t,o){3&o&&i!==(i=Number(t[0])===Number(t[1])||1===Number(t[1]))&&(e.disabled=i)},d(t){t&&h(e),n=!1,m()}}}function T(t){let e,o,i;return{c(){e=c("a"),o=c("navigation-arrow-arrow--right-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"href",t[6]),x(e,"aria-label","Next Page"),x(e,"disabled",i=Number(t[0])===Number(t[1])||1===Number(t[1]))},m(t,i){r(t,e,i),d(e,o)},p(t,o){64&o&&x(e,"href",t[6]),3&o&&i!==(i=Number(t[0])===Number(t[1])||1===Number(t[1]))&&x(e,"disabled",i)},d(t){t&&h(e)}}}function L(t){let e,o,i,n;function u(t,e){return t[5]?$:C}let g=u(t),f=g(t),p=!t[2]&&j(t);function x(t,e){return t[6]?T:P}let w=x(t),_=w(t),v=[{class:n="mc-pagination "+(t[2]?"mc-pagination--light":"")},{role:"navigation"},{"aria-label":"pagination"},t[10]],k={};for(let t=0;t<v.length;t+=1)k=m(k,v[t]);return{c(){e=c("nav"),f.c(),o=l(),p&&p.c(),i=l(),_.c(),this.c=a,b(e,k)},m(t,n){r(t,e,n),f.m(e,null),d(e,o),p&&p.m(e,null),d(e,i),_.m(e,null)},p(t,[r]){g===(g=u(t))&&f?f.p(t,r):(f.d(1),f=g(t),f&&(f.c(),f.m(e,o))),t[2]?p&&(p.d(1),p=null):p?p.p(t,r):(p=j(t),p.c(),p.m(e,i)),w===(w=x(t))&&_?_.p(t,r):(_.d(1),_=w(t),_&&(_.c(),_.m(e,null))),b(e,k=s(v,[4&r&&n!==(n="mc-pagination "+(t[2]?"mc-pagination--light":""))&&{class:n},{role:"navigation"},{"aria-label":"pagination"},1024&r&&t[10]]))},i:a,o:a,d(t){t&&h(e),f.d(),p&&p.d(),_.d()}}}function B(t,e,o){const r=["total","value","light","pagelabel","prefixlabel","hrefprev","hrefnext"];let i=u(e,r),{total:n=1}=e,{value:c=1}=e,{light:l=!1}=e,{pagelabel:a}=e,{prefixlabel:b="Page"}=e,{hrefprev:d=""}=e,{hrefnext:s=""}=e,h=new D;const x=g();return f((()=>{const t=x.shadowRoot.querySelector(".mc-select").options.namedItem(c);t&&(t.selected=!0)})),t.$$set=t=>{e=m(m({},e),p(t)),o(10,i=u(e,r)),"total"in t&&o(1,n=t.total),"value"in t&&o(0,c=t.value),"light"in t&&o(2,l=t.light),"pagelabel"in t&&o(3,a=t.pagelabel),"prefixlabel"in t&&o(4,b=t.prefixlabel),"hrefprev"in t&&o(5,d=t.hrefprev),"hrefnext"in t&&o(6,s=t.hrefnext)},[c,n,l,a,b,d,s,function(){o(0,c--,c),h.dispatch("on-previous-page",c)},function(){o(0,c++,c),h.dispatch("on-next-page",c)},function(){h.dispatch("on-update-page",c)},i,function(){c=I(this),o(0,c)}]}class G extends t{constructor(t){super();const m=document.createElement("style");m.textContent=".mc-button{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;color:#ffffff;background-color:#007f8c;font-family:\"Roboto\", sans-serif;font-weight:700;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;fill:currentColor}.mc-button.is-hover,.mc-button:hover{background-color:#006974;color:#ffffff}.mc-button.is-active,.mc-button:active{background-color:#006974}.mc-button:disabled,.mc-button.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button .mc-button__icon:first-child,.mc-button .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button.is-focus,.mc-button:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-button--s{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s .mc-button__icon:first-child,.mc-button--s .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m .mc-button__icon:first-child,.mc-button--m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l .mc-button__icon{width:2rem;height:2rem}.mc-button--l .mc-button__icon:first-child,.mc-button--l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:0;padding:0}.mc-button__icon{-ms-flex-negative:0;flex-shrink:0}.mc-button__icon:last-child{margin-left:0.5rem;margin-right:-0.25rem}.mc-button__icon:first-child{margin-right:0.5rem;margin-left:-0.25rem}.mc-button__icon:only-child{margin:0}.mc-button__label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;pointer-events:none}a.mc-button:disabled{pointer-events:none}.mc-button--solid-primary-02{background-color:#6a7081}.mc-button--solid-primary-02.is-hover,.mc-button--solid-primary-02:hover{background-color:#242938}.mc-button--solid-primary-02.is-active,.mc-button--solid-primary-02:active{background-color:#171b26}.mc-button--solid-primary-02:disabled,.mc-button--solid-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-neutral{background-color:#333333}.mc-button--solid-neutral.is-hover,.mc-button--solid-neutral:hover{background-color:#191919}.mc-button--solid-neutral.is-active,.mc-button--solid-neutral:active{background-color:#333333}.mc-button--solid-neutral:disabled,.mc-button--solid-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-danger{background-color:#c61112}.mc-button--solid-danger.is-hover,.mc-button--solid-danger:hover{background-color:#8c0003}.mc-button--solid-danger.is-active,.mc-button--solid-danger:active{background-color:#8c0003}.mc-button--solid-danger:disabled,.mc-button--solid-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered{color:#007f8c;border-color:#007f8c;background-color:#ffffff}.mc-button--bordered.is-hover,.mc-button--bordered:hover{background-color:#d9f0f3;color:#006974}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#91d5db;color:#004e57}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#91d5db;color:#004e57}.mc-button--bordered:disabled,.mc-button--bordered.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-primary-02{color:#6a7081;border-color:#6a7081;background-color:#ffffff}.mc-button--bordered-primary-02.is-hover,.mc-button--bordered-primary-02:hover{background-color:#eeeff1;color:#6a7081}.mc-button--bordered-primary-02.is-active,.mc-button--bordered-primary-02:active{background-color:#cfd2d8}.mc-button--bordered-primary-02:disabled,.mc-button--bordered-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-neutral{color:#333333;border-color:#333333;background-color:#ffffff}.mc-button--bordered-neutral.is-hover,.mc-button--bordered-neutral:hover{background-color:#e6e6e6;color:#333333}.mc-button--bordered-neutral.is-active,.mc-button--bordered-neutral:active{background-color:#cccccc}.mc-button--bordered-neutral:disabled,.mc-button--bordered-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-danger{color:#c61112;border-color:#c61112;background-color:#ffffff}.mc-button--bordered-danger.is-hover,.mc-button--bordered-danger:hover{background-color:#fdeaea;color:#8c0003}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger:disabled,.mc-button--bordered-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}@media screen and (min-width: 680px){.mc-button--s\\@from-m{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-m .mc-button__icon:first-child,.mc-button--s\\@from-m .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-m .mc-button__icon:first-child,.mc-button--m\\@from-m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-m{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-m .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-m .mc-button__icon:first-child,.mc-button--l\\@from-m .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-m{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-m{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-m{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1024px){.mc-button--s\\@from-l{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-l .mc-button__icon:first-child,.mc-button--s\\@from-l .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-l{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-l .mc-button__icon:first-child,.mc-button--m\\@from-l .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-l .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-l .mc-button__icon:first-child,.mc-button--l\\@from-l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-l{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-l{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-l{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{padding:0}}@media screen and (min-width: 1280px){.mc-button--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xl .mc-button__icon:first-child,.mc-button--s\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl .mc-button__icon:first-child,.mc-button--m\\@from-xl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xl .mc-button__icon:first-child,.mc-button--l\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1920px){.mc-button--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xxl .mc-button__icon:first-child,.mc-button--s\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl .mc-button__icon:first-child,.mc-button--m\\@from-xxl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xxl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xxl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xxl .mc-button__icon:first-child,.mc-button--l\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xxl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xxl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xxl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}.mc-select{font-family:\"Roboto\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px);background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\");background-color:#ffffff;background-repeat:no-repeat;background-size:1rem 1rem, 1.5rem 1.5rem;border:1px solid #666666;border-radius:4px;color:#191919;-webkit-transition:border-color 200ms ease, -webkit-box-shadow 200ms ease;transition:border-color 200ms ease, -webkit-box-shadow 200ms ease;-o-transition:border-color 200ms ease, box-shadow 200ms ease;transition:border-color 200ms ease, box-shadow 200ms ease;transition:border-color 200ms ease, box-shadow 200ms ease, -webkit-box-shadow 200ms ease;width:100%}.mc-select[type=number]::-webkit-inner-spin-button,.mc-select[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-select[type=number]{-moz-appearance:textfield}.mc-select[type=search]::-webkit-search-decoration:hover,.mc-select[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-select::-ms-expand{display:none}.mc-select.is-hover,.mc-select:hover{border-color:#191919}.mc-select.is-focus,.mc-select:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-select:disabled{background-color:#e6e6e6;border-color:#e6e6e6;color:#666666;cursor:not-allowed;opacity:1}.mc-select.is-invalid{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\"), url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNjNjExMTIiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PHBhdGggZD0iTTEyIDdhMSAxIDAgMDAtMSAxdjQuMzhhMSAxIDAgMDAyIDBWOGExIDEgMCAwMC0xLTF6Ii8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxNiIgcj0iMSIvPjwvc3ZnPg==\");border-color:#c61112}.mc-select.is-valid{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\"), url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNDZhNjEwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDExLTggOCA4IDggMCAwMTgtOG0wLTJhMTAgMTAgMCAxMDEwIDEwQTEwIDEwIDAgMDAxMiAyeiIvPjxwYXRoIGQ9Ik0xMC43MyAxNS43NWExIDEgMCAwMS0uNjgtLjI2bC0zLTIuNzRhMSAxIDAgMDExLjM2LTEuNDdsMi4yNSAyLjA4IDQuMzYtNC40MmExIDEgMCAxMTEuNDIgMS40MWwtNSA1LjFhMSAxIDAgMDEtLjcxLjN6Ii8+PC9zdmc+\");border-color:#46a610}.mc-select--s{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}@media screen and (min-width: 680px){.mc-select--s\\@from-m{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-m{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1024px){.mc-select--s\\@from-l{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-l{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1280px){.mc-select--s\\@from-xl{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-xl{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1920px){.mc-select--s\\@from-xxl{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-xxl{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}.mc-pagination{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;gap:1rem}.mc-pagination__select{font-size:1rem;line-height:1.125;padding:0.875rem 3rem 0.875rem calc(0.75rem - 1px)}@media screen and (min-width: 1024px){.mc-pagination__select{font-size:0.875rem;line-height:1.1428571429;padding:calc(0.5rem - 1px) 2.25rem calc(0.5rem - 1px) calc(0.5rem - 1px)}}",this.shadowRoot.appendChild(m),e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},B,L,n,{total:1,value:0,light:2,pagelabel:3,prefixlabel:4,hrefprev:5,hrefnext:6},null),t&&(t.target&&r(t.target,this,t.anchor),t.props&&(this.$set(t.props),i()))}static get observedAttributes(){return["total","value","light","pagelabel","prefixlabel","hrefprev","hrefnext"]}get total(){return this.$$.ctx[1]}set total(t){this.$$set({total:t}),i()}get value(){return this.$$.ctx[0]}set value(t){this.$$set({value:t}),i()}get light(){return this.$$.ctx[2]}set light(t){this.$$set({light:t}),i()}get pagelabel(){return this.$$.ctx[3]}set pagelabel(t){this.$$set({pagelabel:t}),i()}get prefixlabel(){return this.$$.ctx[4]}set prefixlabel(t){this.$$set({prefixlabel:t}),i()}get hrefprev(){return this.$$.ctx[5]}set hrefprev(t){this.$$set({hrefprev:t}),i()}get hrefnext(){return this.$$.ctx[6]}set hrefnext(t){this.$$set({hrefnext:t}),i()}}export{G as default};
|
|
1
|
+
import{S as t,i as e,a as o,b as r,f as i,s as n,c as m,e as c,d as l,n as a,h as b,j as d,m as s,o as h,p as u,r as g,a1 as f,q as p,g as x,a6 as w,a8 as _,l as v,J as k,H as y,t as M,k as z,a9 as I,L as A,Y as N}from"../../index-c33b3772.js";import{E as D}from"../../EventHandler-02058705.js";function E(t,e,o){const r=t.slice();r[14]=e[o],r[17]=o;const i=r[17]+1;return r[15]=i,r}function C(t){let e,o,i,n,m;return{c(){e=c("button"),o=c("navigation-arrow-arrow--left-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"aria-label","Previous page"),e.disabled=i=1===Number(t[0])||1===Number(t[1])},m(i,c){r(i,e,c),d(e,o),n||(m=v(e,"click",N(t[7])),n=!0)},p(t,o){3&o&&i!==(i=1===Number(t[0])||1===Number(t[1]))&&(e.disabled=i)},d(t){t&&h(e),n=!1,m()}}}function $(t){let e,o,i;return{c(){e=c("a"),o=c("navigation-arrow-arrow--left-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"href",t[5]),x(e,"aria-label","Previous page"),x(e,"disabled",i=1===Number(t[0])||1===Number(t[1]))},m(t,i){r(t,e,i),d(e,o)},p(t,o){32&o&&x(e,"href",t[5]),3&o&&i!==(i=1===Number(t[0])||1===Number(t[1]))&&x(e,"disabled",i)},d(t){t&&h(e)}}}function j(t){let e,o,i,n,m,l={length:t[1]},a=[];for(let e=0;e<l.length;e+=1)a[e]=S(E(t,l,e));return{c(){e=c("div"),o=c("select");for(let t=0;t<a.length;t+=1)a[t].c();x(o,"class","mc-select mc-pagination__select"),o.disabled=i=1===Number(t[1]),void 0===t[0]&&w((()=>t[11].call(o))),x(e,"class","mc-pagination__field")},m(i,c){r(i,e,c),d(e,o);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(o,null);_(o,t[0],!0),n||(m=[v(o,"change",t[11]),v(o,"change",t[9])],n=!0)},p(t,e){if(27&e){let r;for(l={length:t[1]},r=0;r<l.length;r+=1){const i=E(t,l,r);a[r]?a[r].p(i,e):(a[r]=S(i),a[r].c(),a[r].m(o,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=l.length}2&e&&i!==(i=1===Number(t[1]))&&(o.disabled=i),1&e&&_(o,t[0])},d(t){t&&h(e),k(a,t),n=!1,y(m)}}}function S(t){let e,o,i,n,m,a,b,s,u;return{c(){e=c("option"),o=M(t[4]),i=l(),n=M(t[15]),m=l(),a=M(t[3]),b=l(),s=M(t[1]),x(e,"name",String(t[15])),e.selected=u=t[15]==t[0],e.__value=t[15],e.value=e.__value},m(t,c){r(t,e,c),d(e,o),d(e,i),d(e,n),d(e,m),d(e,a),d(e,b),d(e,s)},p(t,r){16&r&&z(o,t[4]),8&r&&z(a,t[3]),2&r&&z(s,t[1]),1&r&&u!==(u=t[15]==t[0])&&(e.selected=u)},d(t){t&&h(e)}}}function P(t){let e,o,i,n,m;return{c(){e=c("button"),o=c("navigation-arrow-arrow--right-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"aria-label","Previous page"),e.disabled=i=Number(t[0])===Number(t[1])||1===Number(t[1])},m(i,c){r(i,e,c),d(e,o),n||(m=v(e,"click",N(t[8])),n=!0)},p(t,o){3&o&&i!==(i=Number(t[0])===Number(t[1])||1===Number(t[1]))&&(e.disabled=i)},d(t){t&&h(e),n=!1,m()}}}function T(t){let e,o,i;return{c(){e=c("a"),o=c("navigation-arrow-arrow--right-24px"),A(o,"size","100%"),A(o,"class","mc-pagination__button-icon mc-button__icon"),x(e,"class","mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l"),x(e,"href",t[6]),x(e,"aria-label","Next Page"),x(e,"disabled",i=Number(t[0])===Number(t[1])||1===Number(t[1]))},m(t,i){r(t,e,i),d(e,o)},p(t,o){64&o&&x(e,"href",t[6]),3&o&&i!==(i=Number(t[0])===Number(t[1])||1===Number(t[1]))&&x(e,"disabled",i)},d(t){t&&h(e)}}}function L(t){let e,o,i,n;function u(t,e){return t[5]?$:C}let g=u(t),f=g(t),p=!t[2]&&j(t);function x(t,e){return t[6]?T:P}let w=x(t),_=w(t),v=[{class:n="mc-pagination "+(t[2]?"mc-pagination--light":"")},{role:"navigation"},{"aria-label":"pagination"},t[10]],k={};for(let t=0;t<v.length;t+=1)k=m(k,v[t]);return{c(){e=c("nav"),f.c(),o=l(),p&&p.c(),i=l(),_.c(),this.c=a,b(e,k)},m(t,n){r(t,e,n),f.m(e,null),d(e,o),p&&p.m(e,null),d(e,i),_.m(e,null)},p(t,[r]){g===(g=u(t))&&f?f.p(t,r):(f.d(1),f=g(t),f&&(f.c(),f.m(e,o))),t[2]?p&&(p.d(1),p=null):p?p.p(t,r):(p=j(t),p.c(),p.m(e,i)),w===(w=x(t))&&_?_.p(t,r):(_.d(1),_=w(t),_&&(_.c(),_.m(e,null))),b(e,k=s(v,[4&r&&n!==(n="mc-pagination "+(t[2]?"mc-pagination--light":""))&&{class:n},{role:"navigation"},{"aria-label":"pagination"},1024&r&&t[10]]))},i:a,o:a,d(t){t&&h(e),f.d(),p&&p.d(),_.d()}}}function B(t,e,o){const r=["total","value","light","pagelabel","prefixlabel","hrefprev","hrefnext"];let i=u(e,r),{total:n=1}=e,{value:c=1}=e,{light:l=!1}=e,{pagelabel:a}=e,{prefixlabel:b="Page"}=e,{hrefprev:d=""}=e,{hrefnext:s=""}=e,h=new D;const x=g();return f((()=>{const t=x.shadowRoot.querySelector(".mc-select").options.namedItem(c);t&&(t.selected=!0)})),t.$$set=t=>{e=m(m({},e),p(t)),o(10,i=u(e,r)),"total"in t&&o(1,n=t.total),"value"in t&&o(0,c=t.value),"light"in t&&o(2,l=t.light),"pagelabel"in t&&o(3,a=t.pagelabel),"prefixlabel"in t&&o(4,b=t.prefixlabel),"hrefprev"in t&&o(5,d=t.hrefprev),"hrefnext"in t&&o(6,s=t.hrefnext)},[c,n,l,a,b,d,s,function(){o(0,c--,c),h.dispatch("on-previous-page",c)},function(){o(0,c++,c),h.dispatch("on-next-page",c)},function(){h.dispatch("on-update-page",c)},i,function(){c=I(this),o(0,c)}]}class G extends t{constructor(t){super();const m=document.createElement("style");m.textContent=".mc-button{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;color:#ffffff;background-color:#007f8c;font-family:\"Roboto\", sans-serif;font-weight:700;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;fill:currentColor}.mc-button.is-hover,.mc-button:hover{background-color:#006974;color:#ffffff}.mc-button.is-active,.mc-button:active{background-color:#006974}.mc-button:disabled,.mc-button.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button .mc-button__icon:first-child,.mc-button .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button.is-focus,.mc-button:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-button--s{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s .mc-button__icon:first-child,.mc-button--s .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m .mc-button__icon:first-child,.mc-button--m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l .mc-button__icon{width:2rem;height:2rem}.mc-button--l .mc-button__icon:first-child,.mc-button--l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:0;padding:0}.mc-button__icon{-ms-flex-negative:0;flex-shrink:0}.mc-button__icon:last-child{margin-left:0.5rem;margin-right:-0.25rem}.mc-button__icon:first-child{margin-right:0.5rem;margin-left:-0.25rem}.mc-button__icon:only-child{margin:0}.mc-button__label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;pointer-events:none}a.mc-button:disabled{pointer-events:none}.mc-button--solid-primary-02{background-color:#6a7081}.mc-button--solid-primary-02.is-hover,.mc-button--solid-primary-02:hover{background-color:#242938}.mc-button--solid-primary-02.is-active,.mc-button--solid-primary-02:active{background-color:#171b26}.mc-button--solid-primary-02:disabled,.mc-button--solid-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-neutral{background-color:#333333}.mc-button--solid-neutral.is-hover,.mc-button--solid-neutral:hover{background-color:#191919}.mc-button--solid-neutral.is-active,.mc-button--solid-neutral:active{background-color:#333333}.mc-button--solid-neutral:disabled,.mc-button--solid-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-danger{background-color:#c61112}.mc-button--solid-danger.is-hover,.mc-button--solid-danger:hover{background-color:#8c0003}.mc-button--solid-danger.is-active,.mc-button--solid-danger:active{background-color:#8c0003}.mc-button--solid-danger:disabled,.mc-button--solid-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered{color:#007f8c;border-color:#007f8c;background-color:#ffffff}.mc-button--bordered.is-hover,.mc-button--bordered:hover{background-color:#d9f0f3;color:#006974}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#91d5db;color:#004e57}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#91d5db;color:#004e57}.mc-button--bordered:disabled,.mc-button--bordered.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-primary-02{color:#6a7081;border-color:#6a7081;background-color:#ffffff}.mc-button--bordered-primary-02.is-hover,.mc-button--bordered-primary-02:hover{background-color:#eeeff1;color:#6a7081}.mc-button--bordered-primary-02.is-active,.mc-button--bordered-primary-02:active{background-color:#cfd2d8}.mc-button--bordered-primary-02:disabled,.mc-button--bordered-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-neutral{color:#333333;border-color:#333333;background-color:#ffffff}.mc-button--bordered-neutral.is-hover,.mc-button--bordered-neutral:hover{background-color:#e6e6e6;color:#333333}.mc-button--bordered-neutral.is-active,.mc-button--bordered-neutral:active{background-color:#cccccc}.mc-button--bordered-neutral:disabled,.mc-button--bordered-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-danger{color:#c61112;border-color:#c61112;background-color:#ffffff}.mc-button--bordered-danger.is-hover,.mc-button--bordered-danger:hover{background-color:#fdeaea;color:#8c0003}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger:disabled,.mc-button--bordered-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}@media screen and (min-width: 680px){.mc-button--s\\@from-m{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-m .mc-button__icon:first-child,.mc-button--s\\@from-m .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-m .mc-button__icon:first-child,.mc-button--m\\@from-m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-m{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-m .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-m .mc-button__icon:first-child,.mc-button--l\\@from-m .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-m{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-m{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-m{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1024px){.mc-button--s\\@from-l{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-l .mc-button__icon:first-child,.mc-button--s\\@from-l .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-l{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-l .mc-button__icon:first-child,.mc-button--m\\@from-l .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-l .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-l .mc-button__icon:first-child,.mc-button--l\\@from-l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-l{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-l{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-l{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{padding:0}}@media screen and (min-width: 1280px){.mc-button--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xl .mc-button__icon:first-child,.mc-button--s\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl .mc-button__icon:first-child,.mc-button--m\\@from-xl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xl .mc-button__icon:first-child,.mc-button--l\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1920px){.mc-button--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xxl .mc-button__icon:first-child,.mc-button--s\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl .mc-button__icon:first-child,.mc-button--m\\@from-xxl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xxl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xxl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xxl .mc-button__icon:first-child,.mc-button--l\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xxl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xxl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xxl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}.mc-select{font-family:\"Roboto\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px);background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\");background-color:#ffffff;background-repeat:no-repeat;background-size:1rem 1rem, 1.5rem 1.5rem;border:1px solid #666666;border-radius:4px;color:#191919;-webkit-transition:border-color 200ms ease, -webkit-box-shadow 200ms ease;transition:border-color 200ms ease, -webkit-box-shadow 200ms ease;-o-transition:border-color 200ms ease, box-shadow 200ms ease;transition:border-color 200ms ease, box-shadow 200ms ease;transition:border-color 200ms ease, box-shadow 200ms ease, -webkit-box-shadow 200ms ease;width:100%}.mc-select[type=number]::-webkit-inner-spin-button,.mc-select[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-select[type=number]{-moz-appearance:textfield}.mc-select[type=search]::-webkit-search-decoration:hover,.mc-select[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-select::-ms-expand{display:none}.mc-select.is-hover,.mc-select:hover{border-color:#191919}.mc-select.is-focus,.mc-select:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-select:disabled{background-color:#e6e6e6;border-color:#e6e6e6;color:#666666;cursor:not-allowed;opacity:1}.mc-select.is-invalid{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\"), url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNjNjExMTIiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PHBhdGggZD0iTTEyIDdhMSAxIDAgMDAtMSAxdjQuMzhhMSAxIDAgMDAyIDBWOGExIDEgMCAwMC0xLTF6Ii8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxNiIgcj0iMSIvPjwvc3ZnPg==\");border-color:#c61112}.mc-select.is-valid{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23191919' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E\"), url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNDZhNjEwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDExLTggOCA4IDggMCAwMTgtOG0wLTJhMTAgMTAgMCAxMDEwIDEwQTEwIDEwIDAgMDAxMiAyeiIvPjxwYXRoIGQ9Ik0xMC43MyAxNS43NWExIDEgMCAwMS0uNjgtLjI2bC0zLTIuNzRhMSAxIDAgMDExLjM2LTEuNDdsMi4yNSAyLjA4IDQuMzYtNC40MmExIDEgMCAxMTEuNDIgMS40MWwtNSA1LjFhMSAxIDAgMDEtLjcxLjN6Ii8+PC9zdmc+\");border-color:#46a610}.mc-select--s{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}@media screen and (min-width: 680px){.mc-select--s\\@from-m{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-m{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1024px){.mc-select--s\\@from-l{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-l{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1280px){.mc-select--s\\@from-xl{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-xl{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}@media screen and (min-width: 1920px){.mc-select--s\\@from-xxl{font-size:0.875rem;line-height:1.1428571429;background-position:right 0.5rem center, right 2rem center;padding:calc(0.5rem - 1px) 2rem calc(0.5rem - 1px) calc(0.5rem - 1px)}.mc-select--m\\@from-xxl{font-size:1rem;line-height:1.125;background-position:right 1rem center, right 2.5rem center;padding:calc(0.9375rem - 1px) 3rem calc(0.9375rem - 1px) calc(0.75rem - 1px)}}.mc-pagination{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;gap:1rem}.mc-pagination__select{font-size:1rem;line-height:1.125;padding:0.875rem 3rem 0.875rem calc(0.75rem - 1px)}@media screen and (min-width: 1024px){.mc-pagination__select{font-size:0.875rem;line-height:1.1428571429;padding:calc(0.5rem - 1px) 2.25rem calc(0.5rem - 1px) calc(0.5rem - 1px)}}",this.shadowRoot.appendChild(m),e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},B,L,n,{total:1,value:0,light:2,pagelabel:3,prefixlabel:4,hrefprev:5,hrefnext:6},null),t&&(t.target&&r(t.target,this,t.anchor),t.props&&(this.$set(t.props),i()))}static get observedAttributes(){return["total","value","light","pagelabel","prefixlabel","hrefprev","hrefnext"]}get total(){return this.$$.ctx[1]}set total(t){this.$$set({total:t}),i()}get value(){return this.$$.ctx[0]}set value(t){this.$$set({value:t}),i()}get light(){return this.$$.ctx[2]}set light(t){this.$$set({light:t}),i()}get pagelabel(){return this.$$.ctx[3]}set pagelabel(t){this.$$set({pagelabel:t}),i()}get prefixlabel(){return this.$$.ctx[4]}set prefixlabel(t){this.$$set({prefixlabel:t}),i()}get hrefprev(){return this.$$.ctx[5]}set hrefprev(t){this.$$set({hrefprev:t}),i()}get hrefnext(){return this.$$.ctx[6]}set hrefnext(t){this.$$set({hrefnext:t}),i()}}export{G as default};
|
|
2
2
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../../src/components/pagination/Pagination.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { onMount, get_current_component } from 'svelte/internal';\n\n import { EventHandler } from '../../utilities/EventHandler';\n export let total = 1;\n export let value = 1;\n export let light = false;\n export let pagelabel: string;\n export let prefixlabel = 'Page';\n export let hrefprev = '';\n export let hrefnext = '';\n\n let eventHandler = new EventHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const component: any = get_current_component();\n onMount(() => {\n /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment */\n const select = component.shadowRoot.querySelector('.mc-select');\n const options = select.options;\n const selectedOption = options.namedItem(value);\n if (selectedOption) {\n selectedOption.selected = true;\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment */\n });\n\n function dispatchPreviousPageEvent(): void {\n value--;\n eventHandler.dispatch('on-previous-page', value);\n }\n\n function dispatchNextPageEvent(): void {\n value++;\n eventHandler.dispatch('on-next-page', value);\n }\n\n function dispatchChangePageEvent(): void {\n eventHandler.dispatch('on-update-page', value);\n }\n</script>\n\n<nav\n class=\"mc-pagination {light ? 'mc-pagination--light' : ''}\"\n role=\"navigation\"\n aria-label=\"pagination\"\n {...$$restProps}\n>\n {#if hrefprev}\n <a\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n href={hrefprev}\n aria-label=\"Previous page\"\n disabled={Number(value) === 1 || Number(total) === 1}\n >\n <navigation-arrow-arrow--left-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </a>\n {:else}\n <button\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n aria-label=\"Previous page\"\n disabled={Number(value) === 1 || Number(total) === 1}\n on:click|preventDefault={dispatchPreviousPageEvent}\n >\n <navigation-arrow-arrow--left-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </button>\n {/if}\n {#if !light}\n <div class=\"mc-pagination__field\">\n <select\n class=\"mc-select mc-pagination__select\"\n disabled={Number(total) === 1}\n bind:value\n on:change={dispatchChangePageEvent}\n >\n {#each { length: total } as _, number}\n <option\n name={String(
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../src/components/pagination/Pagination.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { onMount, get_current_component } from 'svelte/internal';\n\n import { EventHandler } from '../../utilities/EventHandler';\n export let total = 1;\n export let value = 1;\n export let light = false;\n export let pagelabel: string;\n export let prefixlabel = 'Page';\n export let hrefprev = '';\n export let hrefnext = '';\n\n let eventHandler = new EventHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const component: any = get_current_component();\n onMount(() => {\n /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment */\n const select = component.shadowRoot.querySelector('.mc-select');\n const options = select.options;\n const selectedOption = options.namedItem(value);\n if (selectedOption) {\n selectedOption.selected = true;\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment */\n });\n\n function dispatchPreviousPageEvent(): void {\n value--;\n eventHandler.dispatch('on-previous-page', value);\n }\n\n function dispatchNextPageEvent(): void {\n value++;\n eventHandler.dispatch('on-next-page', value);\n }\n\n function dispatchChangePageEvent(): void {\n eventHandler.dispatch('on-update-page', value);\n }\n</script>\n\n<nav\n class=\"mc-pagination {light ? 'mc-pagination--light' : ''}\"\n role=\"navigation\"\n aria-label=\"pagination\"\n {...$$restProps}\n>\n {#if hrefprev}\n <a\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n href={hrefprev}\n aria-label=\"Previous page\"\n disabled={Number(value) === 1 || Number(total) === 1}\n >\n <navigation-arrow-arrow--left-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </a>\n {:else}\n <button\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n aria-label=\"Previous page\"\n disabled={Number(value) === 1 || Number(total) === 1}\n on:click|preventDefault={dispatchPreviousPageEvent}\n >\n <navigation-arrow-arrow--left-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </button>\n {/if}\n {#if !light}\n <div class=\"mc-pagination__field\">\n <select\n class=\"mc-select mc-pagination__select\"\n disabled={Number(total) === 1}\n bind:value\n on:change={dispatchChangePageEvent}\n >\n {#each { length: total } as _, number}\n {@const optionValue = number + 1}\n <option\n name={String(optionValue)}\n selected={optionValue == value}\n value={optionValue}\n >{prefixlabel} {optionValue} {pagelabel} {total}</option\n >\n {/each}\n </select>\n </div>\n {/if}\n {#if hrefnext}\n <a\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n href={hrefnext}\n aria-label=\"Next Page\"\n disabled={Number(value) === Number(total) || Number(total) === 1}\n >\n <navigation-arrow-arrow--right-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </a>\n {:else}\n <button\n class=\"mc-pagination__button mc-button mc-button--solid-neutral mc-button--square mc-button--s@from-l\"\n aria-label=\"Previous page\"\n disabled={Number(value) === Number(total) || Number(total) === 1}\n on:click|preventDefault={dispatchNextPageEvent}\n >\n <navigation-arrow-arrow--right-24px\n size=\"100%\"\n class=\"mc-pagination__button-icon mc-button__icon\"\n />\n </button>\n {/if}\n</nav>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.button';\n @import '@mozaic-ds/styles/components/c.select';\n @import '@mozaic-ds/styles/components/c.pagination';\n</style>\n"],"names":["constants_0","child_ctx","Number","ctx","insert","target","button","anchor","append","navigation_arrow_arrow__left_24px","a","each_value","length","i","div","select","attr","option","String","selected","option_selected_value","dirty","navigation_arrow_arrow__right_24px","create_if_block_2","create_if_block_1","create_if_block","nav","class","nav_class_value","total","$$props","value","light","pagelabel","prefixlabel","hrefprev","hrefnext","eventHandler","EventHandler","component","get_current_component","onMount","selectedOption","shadowRoot","querySelector","options","namedItem","dispatch"],"mappings":"8VAoFgC,MAAAA,EAAAC,MAAS,2VAlBP,IAAlBC,OAAOC,EAAW,KAAuB,IAAlBD,OAAOC,EAAK,YAH/CC,EAUQC,EAAAC,EAAAC,GAJNC,EAGCF,EAAAG,uBALwBN,EAAyB,+BADtB,IAAlBD,OAAOC,EAAW,KAAuB,IAAlBD,OAAOC,EAAK,yUAbvCA,EAAQ,uDAEc,IAAlBD,OAAOC,EAAW,KAAuB,IAAlBD,OAAOC,EAAK,aAJ/CC,EAUGC,EAAAK,EAAAH,GAJDC,EAGCE,EAAAD,4BAPKN,EAAQ,gBAEc,IAAlBD,OAAOC,EAAW,KAAuB,IAAlBD,OAAOC,EAAK,oEA4BlCQ,EAAA,CAAAC,OAAQT,EAAK,yBAApBS,OAAIC,GAAA,wJAJsB,IAAlBX,OAAOC,EAAK,sFAH1BC,EAiBKC,EAAAS,EAAAP,GAhBHC,EAeQM,EAAAC,yGAXKZ,EAAuB,sCAEzBQ,EAAA,CAAAC,OAAQT,EAAK,YAApBS,OAAIC,GAAA,EAAA,iHAAJD,mBAJ0B,IAAlBV,OAAOC,EAAK,sIAUhBA,EAAW,cAAGA,EAAW,eAAGA,EAAS,cAAGA,EAAK,IAHzCa,EAAAC,EAAA,OAAAC,OAAOf,EAAW,MACdc,EAAAE,SAAAC,EAAAjB,OAAeA,EAAK,aACvBA,EAAW,8BAHpBC,EAKAC,EAAAY,EAAAV,sEADIJ,EAAW,aAAiBA,EAAS,aAAGA,EAAK,IAFrC,EAAAkB,GAAAD,KAAAA,EAAAjB,OAAeA,EAAK,6WAwB1BD,OAAOC,EAAK,MAAMD,OAAOC,EAAK,KAAuB,IAAlBD,OAAOC,EAAK,YAH3DC,EAUQC,EAAAC,EAAAC,GAJNC,EAGCF,EAAAgB,uBALwBnB,EAAqB,+BADpCD,OAAOC,EAAK,MAAMD,OAAOC,EAAK,KAAuB,IAAlBD,OAAOC,EAAK,0UAbnDA,EAAQ,mDAEJD,OAAOC,EAAK,MAAMD,OAAOC,EAAK,KAAuB,IAAlBD,OAAOC,EAAK,aAJ3DC,EAUGC,EAAAK,EAAAH,GAJDC,EAGCE,EAAAY,4BAPKnB,EAAQ,gBAEJD,OAAOC,EAAK,MAAMD,OAAOC,EAAK,KAAuB,IAAlBD,OAAOC,EAAK,yFAlDxDA,EAAQ,GAAAoB,yBAyBPpB,EAAK,IAAAqB,EAAArB,0BAoBNA,EAAQ,GAAAsB,oDAlDStB,EAAK,GAAG,uBAAyB,qDAGnDA,EAAW,iIAJjBC,EA4EKC,EAAAqB,EAAAnB,+HA7CGJ,EAAK,kKA9BWA,EAAK,GAAG,uBAAyB,MAAE,CAAAwB,MAAAC,2DAGrDzB,EAAW,sKA1CJ0B,MAAAA,EAAQ,GAACC,GACTC,MAAAA,EAAQ,GAACD,GACTE,MAAAA,GAAQ,GAAKF,aACbG,GAAiBH,GACjBI,YAAAA,EAAc,QAAMJ,GACpBK,SAAAA,EAAW,IAAEL,GACbM,SAAAA,EAAW,IAAEN,EAEpBO,MAAmBC,EAGjB,MAAAC,EAAiBC,WACvBC,GAAO,KAEC,MAEAC,EAFSH,EAAUI,WAAWC,cAAc,cAC3BC,QACQC,UAAUf,GACrCW,IACFA,EAAevB,UAAW,sTAM5BY,IAAKA,GACLM,EAAaU,SAAS,mBAAoBhB,mBAI1CA,IAAKA,GACLM,EAAaU,SAAS,eAAgBhB,eAItCM,EAAaU,SAAS,iBAAkBhB"}
|
|
@@ -82,11 +82,12 @@
|
|
|
82
82
|
on:change={dispatchChangePageEvent}
|
|
83
83
|
>
|
|
84
84
|
{#each { length: total } as _, number}
|
|
85
|
+
{@const optionValue = number + 1}
|
|
85
86
|
<option
|
|
86
|
-
name={String(
|
|
87
|
-
selected={
|
|
88
|
-
value={
|
|
89
|
-
>{prefixlabel} {
|
|
87
|
+
name={String(optionValue)}
|
|
88
|
+
selected={optionValue == value}
|
|
89
|
+
value={optionValue}
|
|
90
|
+
>{prefixlabel} {optionValue} {pagelabel} {total}</option
|
|
90
91
|
>
|
|
91
92
|
{/each}
|
|
92
93
|
</select>
|
|
@@ -1,2 +1,2 @@
|
|
|
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 _,k as b}from"../../index-c33b3772.js";function x(e,a,t){const l=e.slice();return l[5]=a[t],l[7]=t,l}function f(e){let a,t,s,i,r,o,d,c,p,w=e[3][e[7]]+"";return{c(){a=m("input"),s=n(),i=m("label"),r=m("span"),o=_(w),d=n(),g(a,"id",t=k(e[1],e[7])),g(a,"type","radio"),g(a,"name",e[1]),a.value=e[7]+1,g(a,"class","mc-stars-input__radio"),g(r,"class","mc-stars-input__text"),g(i,"for",c=k(e[1],e[7])),g(i,"title",p=e[3][e[7]]),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)},p(e,l){2&l&&t!==(t=k(e[1],e[7]))&&g(a,"id",t),2&l&&g(a,"name",e[1]),8&l&&w!==(w=e[3][e[7]]+"")&&b(o,w),2&l&&c!==(c=k(e[1],e[7]))&&g(i,"for",c),8&l&&p!==(p=e[3][e[7]])&&g(i,"title",p)},d(e){e&&h(a),e&&h(s),e&&h(i)}}}function E(e){let a,t,s,i,w=Array(C),v=[];for(let a=0;a<w.length;a+=1)v[a]=f(x(e,w,a));let _=[{class:i=L(e[2])},e[4]],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]),10&l){let t;for(w=Array(C),t=0;t<w.length;t+=1){const s=x(e,w,t);v[t]?v[t].p(s,l):(v[t]=f(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=L(e[2]))&&{class:i},16&l&&e[4]]))},i:o,o:o,d(e){e&&h(a),p(v,e)}}}const C=5;function L(e){const a="mc-stars-input";return e?`${a} ${a}--${e}`:a}function k(e,a){return`${e}${a+1}`}function z(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;return e.$$set=e=>{a=r(r({},a),v(e)),t(4,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,s]}class B 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 #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.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},z,E,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()}}customElements.define("m-stars-input",B);export{B 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 #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.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};
|
|
2
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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as e,i as t,a as n,b as o,f as s,s as i,e as r,n as c,g as l,z as a,o as m,J as d,d as b,t as g,j as f,l as x,k as p}from"../../index-c33b3772.js";import{E as h}from"../../EventHandler-02058705.js";function _(e,t,n){const o=e.slice();return o[8]=t[n],o[10]=n,o}function u(e){let t;return{c(){t=r("div"),t.innerHTML='<navigation-notification-available-16px name="NotificationAvailable16" size="100%"></navigation-notification-available-16px>',l(t,"class","mc-segmented-control__icon")},m(e,n){o(e,t,n)},d(e){e&&m(t)}}}function w(e){let t,n,s,i,c,d,h,_,w=e[8].label+"",k=e[10]===e[1]&&u();function v(){return e[6](e[10],e[8])}return{c(){t=r("button"),n=r("span"),k&&k.c(),s=b(),i=r("span"),c=g(w),d=b(),l(i,"class","mc-segmented-control__label"),l(n,"class","mc-segmented-control__content"),l(t,"type","button"),l(t,"class","mc-segmented-control__segment"),a(t,"is-active",e[1]===e[10]),a(t,"is-disabled",e[8].disabled)},m(e,r){o(e,t,r),f(t,n),k&&k.m(n,null),f(n,s),f(n,i),f(i,c),f(t,d),h||(_=x(t,"click",v),h=!0)},p(o,i){(e=o)[10]===e[1]?k||(k=u(),k.c(),k.m(n,s)):k&&(k.d(1),k=null),4&i&&w!==(w=e[8].label+"")&&p(c,w),2&i&&a(t,"is-active",e[1]===e[10]),4&i&&a(t,"is-disabled",e[8].disabled)},d(e){e&&m(t),k&&k.d(),h=!1,_()}}}function k(e){let t,n=e[2],s=[];for(let t=0;t<n.length;t+=1)s[t]=w(_(e,n,t));return{c(){t=r("div");for(let e=0;e<s.length;e+=1)s[e].c();this.c=c,l(t,"class","mc-segmented-control"),a(t,"mc-segmented-control--m","m"===e[0])},m(e,n){o(e,t,n);for(let e=0;e<s.length;e+=1)s[e]&&s[e].m(t,null)},p(e,[o]){if(14&o){let i;for(n=e[2],i=0;i<n.length;i+=1){const r=_(e,n,i);s[i]?s[i].p(r,o):(s[i]=w(r),s[i].c(),s[i].m(t,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=n.length}1&o&&a(t,"mc-segmented-control--m","m"===e[0])},i:c,o:c,d(e){e&&m(t),d(s,e)}}}function v(e,t,n){let o,s,{items:i}=t,{selected:r}=t,{size:c}=t,l=new h;function a(e,t){n(1,s=e),l.dispatch("segment-selected",{index:e,segment:t})}return e.$$set=e=>{"items"in e&&n(4,i=e.items),"selected"in e&&n(5,r=e.selected),"size"in e&&n(0,c=e.size)},e.$$.update=()=>{16&e.$$.dirty&&n(2,o=i?JSON.parse(i):[]),32&e.$$.dirty&&n(1,s=r?Number(r):"")},[c,s,o,a,i,r,(e,t)=>a(e,t)]}class y extends e{constructor(e){super();const r=document.createElement("style");r.textContent='.mc-segmented-control__content{-webkit-box-sizing:border-box;box-sizing:border-box}.mc-segmented-control{display:-webkit-box;display:-ms-flexbox;display:flex;background-color:#ffffff;border-radius:4px;border:1px solid #b3b3b3;width:19.6875rem}.mc-segmented-control__segment{display:-webkit-box;display:-ms-flexbox;display:flex;background-color:#ffffff;border:none;border-radius:4px;color:#000000;cursor:pointer;-webkit-box-flex:1;-ms-flex:1 1 0px;flex:1 1 0;font-family:inherit;padding:0.1875rem;text-align:left;position:relative;position:relative}.mc-segmented-control__segment:not(:last-child)::after{background:#b3b3b3;content:"";display:block;width:1px;height:16px;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:0}.mc-segmented-control__segment:not(:last-child).is-active::after{display:none}.mc-segmented-control__segment::before{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-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;bottom:-0.125rem;top:-0.125rem}.mc-segmented-control__segment:hover .mc-segmented-control__content{background-color:#eeedea}.mc-segmented-control__segment:focus{z-index:2}.mc-segmented-control__segment:focus::before{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;-webkit-box-shadow:0 0 0 0.125rem #758992;box-shadow:0 0 0 0.125rem #758992}.mc-segmented-control__segment:active .mc-segmented-control__content{background-color:#dddcd5}.mc-segmented-control__segment.is-active{color:#ffffff}.mc-segmented-control__segment.is-active .mc-segmented-control__content{background-color:#007f8c}.mc-segmented-control__segment.is-active .mc-segmented-control__label{font-family:"Roboto", sans-serif;font-weight:700}.mc-segmented-control__segment.is-active .mc-segmented-control__icon::before{width:1rem;height:1rem;background-image:url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' height=\'1rem\' width=\'1rem\' fill=\'%23ffffff\' viewBox=\'0 0 16 16\'%3E%3Cpath d=\'M7.63 11.21a1 1 0 01-1.38 0l-2.92-2.6a1 1 0 111.34-1.48l2.22 2 4.41-4.34a1 1 0 111.4 1.42z\'/%3E%3C/svg%3E")}.mc-segmented-control__segment.is-disabled{cursor:not-allowed;background-color:#cccccc}.mc-segmented-control__content{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;gap:0.25rem;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:0.1875rem 1rem;-ms-flex-negative:0;flex-shrink:0;width:100%}.mc-segmented-control__icon{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}.mc-segmented-control__icon::before{content:""}.mc-segmented-control__label{font-size:0.875rem;line-height:1.2857142857;font-family:"Roboto", sans-serif;font-weight:400}.mc-segmented-control--m .mc-segmented-control__segment:not(:last-child)::after{background:#b3b3b3;content:"";display:block;width:1px;height:24px;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:0}.mc-segmented-control--m .mc-segmented-control__segment:not(:last-child).is-active::after{display:none}.mc-segmented-control--m .mc-segmented-control__content{padding:0.6875rem 1.5rem}',this.shadowRoot.appendChild(r),t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},v,k,i,{items:4,selected:5,size:0},null),e&&(e.target&&o(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["items","selected","size"]}get items(){return this.$$.ctx[4]}set items(e){this.$$set({items:e}),s()}get selected(){return this.$$.ctx[5]}set selected(e){this.$$set({selected:e}),s()}get size(){return this.$$.ctx[0]}set size(e){this.$$set({size:e}),s()}}export{y as default};
|
|
2
|
+
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sources":["../../../../src/components/segmentedcontrol/SegmentedControl.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import type { itemsType } from './segmentedControl.types';\n import { EventHandler } from '../../utilities/EventHandler';\n export let items: string;\n export let selected: string;\n export let size: string;\n $: segments = items ? (JSON.parse(items) as itemsType[]) : [];\n $: segmentSelected = selected ? Number(selected) : '';\n\n let eventHandler = new EventHandler();\n\n function manageSegment(index: any, segment: any) {\n segmentSelected = index;\n eventHandler.dispatch('segment-selected', { index, segment });\n }\n</script>\n\n<div class=\"mc-segmented-control\" class:mc-segmented-control--m={size === 'm'}>\n {#each segments as segment, index}\n <button\n type=\"button\"\n class=\"mc-segmented-control__segment\"\n class:is-active={segmentSelected === index}\n class:is-disabled={segment.disabled}\n on:click={() => manageSegment(index, segment)}\n >\n <span class=\"mc-segmented-control__content\">\n {#if index === segmentSelected}\n <div class=\"mc-segmented-control__icon\">\n <navigation-notification-available-16px\n name=\"NotificationAvailable16\"\n size=\"100%\"\n />\n </div>\n {/if}\n <span class=\"mc-segmented-control__label\">\n {segment.label}\n </span>\n </span>\n </button>\n {/each}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n .mc-segmented-control__content {\n box-sizing: border-box;\n }\n @import '@mozaic-ds/styles/components/c.segmented-control';\n</style>\n"],"names":["insert","target","div","anchor","t1_value","ctx","label","if_block","create_if_block","toggle_class","button","disabled","append","span1","span0","dirty","set_data","t1","length","i","items","$$props","selected","size","eventHandler","EventHandler","manageSegment","index","segment","$$invalidate","segmentSelected","dispatch","segments","JSON","parse","Number"],"mappings":"qfA8BUA,EAKKC,EAAAC,EAAAC,qDAGJC,EAAAC,KAAQC,MAAK,GATXC,EAAAF,QAAUA,EAAe,IAAAG,gRALfC,EAAAC,EAAA,YAAAL,OAAoBA,EAAK,KACvBI,EAAAC,EAAA,cAAAL,KAAQM,kBAJ7BX,EAoBQC,EAAAS,EAAAP,GAbNS,EAYMF,EAAAG,yBAHJD,EAEMC,EAAAC,gEAVST,EAAe,gDAS3B,EAAAU,GAAAX,KAAAA,EAAAC,KAAQC,MAAK,KAAAU,EAAAC,EAAAb,QAdDK,EAAAC,EAAA,YAAAL,OAAoBA,EAAK,UACvBI,EAAAC,EAAA,cAAAL,KAAQM,kEALxBN,EAAQ,wBAAba,OAAIC,GAAA,2HADyDV,EAAAP,EAAA,0BAAS,MAATG,cAAjEL,EAwBKC,EAAAC,EAAAC,mFAvBIE,EAAQ,WAAba,OAAIC,GAAA,EAAA,iHAAJD,YAD6DT,EAAAP,EAAA,0BAAS,MAATG,sEAdpDe,GAAaC,YACbC,GAAgBD,QAChBE,GAAYF,EAInBG,MAAmBC,WAEdC,EAAcC,EAAYC,GACjCC,EAAA,EAAAC,EAAkBH,GAClBH,EAAaO,SAAS,mBAAsB,CAAAJ,QAAOC,wJAPpDC,EAAA,EAAEG,EAAWZ,EAASa,KAAKC,MAAMd,GAAK,mBACtCS,EAAA,EAAEC,EAAkBR,EAAWa,OAAOb,GAAY,yBAiB/BI,EAAcC,EAAOC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import type { itemsType } from './segmentedControl.types';
|
|
5
|
+
import { EventHandler } from '../../utilities/EventHandler';
|
|
6
|
+
export let items: string;
|
|
7
|
+
export let selected: string;
|
|
8
|
+
export let size: string;
|
|
9
|
+
$: segments = items ? (JSON.parse(items) as itemsType[]) : [];
|
|
10
|
+
$: segmentSelected = selected ? Number(selected) : '';
|
|
11
|
+
|
|
12
|
+
let eventHandler = new EventHandler();
|
|
13
|
+
|
|
14
|
+
function manageSegment(index: any, segment: any) {
|
|
15
|
+
segmentSelected = index;
|
|
16
|
+
eventHandler.dispatch('segment-selected', { index, segment });
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="mc-segmented-control" class:mc-segmented-control--m={size === 'm'}>
|
|
21
|
+
{#each segments as segment, index}
|
|
22
|
+
<button
|
|
23
|
+
type="button"
|
|
24
|
+
class="mc-segmented-control__segment"
|
|
25
|
+
class:is-active={segmentSelected === index}
|
|
26
|
+
class:is-disabled={segment.disabled}
|
|
27
|
+
on:click={() => manageSegment(index, segment)}
|
|
28
|
+
>
|
|
29
|
+
<span class="mc-segmented-control__content">
|
|
30
|
+
{#if index === segmentSelected}
|
|
31
|
+
<div class="mc-segmented-control__icon">
|
|
32
|
+
<navigation-notification-available-16px
|
|
33
|
+
name="NotificationAvailable16"
|
|
34
|
+
size="100%"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
{/if}
|
|
38
|
+
<span class="mc-segmented-control__label">
|
|
39
|
+
{segment.label}
|
|
40
|
+
</span>
|
|
41
|
+
</span>
|
|
42
|
+
</button>
|
|
43
|
+
{/each}
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
@import '@mozaic-ds/styles/settings-tools/all-settings';
|
|
48
|
+
.mc-segmented-control__content {
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
}
|
|
51
|
+
@import '@mozaic-ds/styles/components/c.segmented-control';
|
|
52
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentedControl.types.d.ts","sourceRoot":"","sources":["../../../../src/components/segmentedcontrol/segmentedControl.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC"}
|