@mozaic-ds/web-components 0.4.1-beta.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/ClickOutside-63071e7a.js +15 -1
- package/public/ClickOutside-63071e7a.js.map +1 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js +759 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
- package/public/DataTableUtilities-60220c78.js +370 -1
- package/public/DataTableUtilities-60220c78.js.map +1 -1
- package/public/EventForward-8492ff62.js +109 -1
- package/public/EventForward-8492ff62.js.map +1 -1
- package/public/EventHandler-02058705.js +15 -1
- package/public/EventHandler-02058705.js.map +1 -1
- package/public/array-5b770a93.js +13 -1
- package/public/array-5b770a93.js.map +1 -1
- package/public/axis-fbc0f7b5.js +174 -1
- package/public/axis-fbc0f7b5.js.map +1 -1
- package/public/band-d7a07d2c.js +186 -1
- package/public/band-d7a07d2c.js.map +1 -1
- package/public/components/accordion/Accordion.js +365 -1
- package/public/components/accordion/Accordion.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.js +1515 -1
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/badge/Badge.js +155 -1
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.nested.js +101 -1
- package/public/components/badge/Badge.nested.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.js +372 -1
- package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js +319 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
- package/public/components/button/Button.js +1138 -1
- package/public/components/button/Button.js.map +1 -1
- package/public/components/card/Card.js +369 -1
- package/public/components/card/Card.js.map +1 -1
- package/public/components/chart/BarChart.js +582 -1
- package/public/components/chart/BarChart.js.map +1 -1
- package/public/components/chart/Donut.js +1189 -1
- package/public/components/chart/Donut.js.map +1 -1
- package/public/components/chart/GroupedBarChart.js +750 -1
- package/public/components/chart/GroupedBarChart.js.map +1 -1
- package/public/components/chart/LineChart.js +1731 -1
- package/public/components/chart/LineChart.js.map +1 -1
- package/public/components/chart/Radar.js +729 -1
- package/public/components/chart/Radar.js.map +1 -1
- package/public/components/chart/StackedBarChart.js +745 -1
- package/public/components/chart/StackedBarChart.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +307 -1
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkboxgroup/checkboxGroup.js +404 -1
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/datatable/DataTable.js +3064 -1
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTableDefaultAction.nested.js +4 -1
- package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +164 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +380 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js +424 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +263 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +637 -1
- package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
- package/public/components/dropdown/Dropdown.js +1426 -1
- package/public/components/dropdown/Dropdown.js.map +1 -1
- package/public/components/field/Field.js +375 -1
- package/public/components/field/Field.js.map +1 -1
- package/public/components/fileuploader/FileUploader.js +555 -1
- package/public/components/fileuploader/FileUploader.js.map +1 -1
- package/public/components/fileuploader/ResultFile.nested.js +265 -1
- package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/components/flag/Flag.js +174 -1
- package/public/components/flag/Flag.js.map +1 -1
- package/public/components/header/Header.js +903 -1
- package/public/components/header/Header.js.map +1 -1
- package/public/components/hero/Hero.js +271 -1
- package/public/components/hero/Hero.js.map +1 -1
- package/public/components/layer/Layer.js +453 -1
- package/public/components/layer/Layer.js.map +1 -1
- package/public/components/link/Link.js +380 -1
- package/public/components/link/Link.js.map +1 -1
- package/public/components/listbox/Listbox.js +595 -1
- package/public/components/listbox/Listbox.js.map +1 -1
- package/public/components/listbox/Listbox.nested.js +629 -1
- package/public/components/listbox/Listbox.nested.js.map +1 -1
- package/public/components/loader/Loader.js +246 -1
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.nested.js +176 -1
- package/public/components/loader/Loader.nested.js.map +1 -1
- package/public/components/modal/Modal.js +395 -1
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/notification/Notification.js +458 -1
- package/public/components/notification/Notification.js.map +1 -1
- package/public/components/optionbutton/OptionButton.js +316 -1
- package/public/components/optionbutton/OptionButton.js.map +1 -1
- package/public/components/overlay/Overlay.js +104 -1
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/OverlayLoader.js +151 -1
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/pagination/Pagination.js +613 -1
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/passwordinput/PasswordInput.js +291 -1
- package/public/components/passwordinput/PasswordInput.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.js +6894 -1
- package/public/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/components/price/Price.js +768 -1
- package/public/components/price/Price.js.map +1 -1
- package/public/components/progressbar/ProgressBar.js +278 -1
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.js +333 -1
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/radio/Radio.js +273 -1
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.js +414 -1
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/ratings/StarsInput.js +292 -1
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/ratings/StarsResult.js +246 -1
- package/public/components/ratings/StarsResult.js.map +1 -1
- package/public/components/select/Select.js +451 -1
- package/public/components/select/Select.js.map +1 -1
- package/public/components/sidebar/Sidebar.js +784 -1
- package/public/components/sidebar/Sidebar.js.map +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js +594 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-feature.nested.js +402 -1
- package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-section.nested.js +394 -1
- package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +200 -1
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-separator.nested.js +49 -1
- package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js +312 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +733 -1
- package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/components/stepper/Stepper.js +371 -1
- package/public/components/stepper/Stepper.js.map +1 -1
- package/public/components/tabs/Tabs.js +615 -1
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +472 -1
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tag/Tag.js +665 -1
- package/public/components/tag/Tag.js.map +1 -1
- package/public/components/tag/Tag.nested.js +554 -1
- package/public/components/tag/Tag.nested.js.map +1 -1
- package/public/components/taglist/TagList.js +475 -1
- package/public/components/taglist/TagList.js.map +1 -1
- package/public/components/textarea/Textarea.js +303 -1
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +497 -1
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.nested.js +320 -1
- package/public/components/textinput/Textinput.nested.js.map +1 -1
- package/public/components/toggle/Toggle.js +278 -1
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/tooltip/Tooltip.js +173 -1
- package/public/components/tooltip/Tooltip.js.map +1 -1
- package/public/index-c33b3772.js +873 -1
- package/public/index-c33b3772.js.map +1 -1
- package/public/linear-f46d7e9e.js +700 -1
- package/public/linear-f46d7e9e.js.map +1 -1
- package/public/path-1b5da959.js +186 -1
- package/public/path-1b5da959.js.map +1 -1
- package/public/sidebar-service-275bf9ef.js +129 -1
- package/public/sidebar-service-275bf9ef.js.map +1 -1
- package/public/symbol-b05a6e2b.js +169 -1
- package/public/symbol-b05a6e2b.js.map +1 -1
- package/public/transform-15d69d5d.js +2743 -1
- package/public/transform-15d69d5d.js.map +1 -1
- package/public/utilities/stories/phonenumber/PhoneNumber.stories.d.ts.map +1 -1
|
@@ -1,2 +1,452 @@
|
|
|
1
|
-
import{S as e,i,a as t,b as r,f as s,s as a,c,e as l,K as n,n as o,h as d,a6 as m,j as g,a7 as x,a8 as h,B as p,l as u,m as M,o as b,J as I,H as v,p as A,r as D,q as w,t as f,k as j,d as E,g as C,a9 as z}from"../../index-c33b3772.js";import{E as k}from"../../EventHandler-02058705.js";import{c as y}from"../../EventForward-8492ff62.js";function $(e,i,t){const r=e.slice();return r[18]=i[t],r}function T(e){let i,t,s,a;return{c(){i=l("option"),t=f("-- "),s=f(e[1]),a=f(" --\n "),i.__value="",i.value=i.__value,i.disabled=!0,i.selected=!0},m(e,c){r(e,i,c),g(i,t),g(i,s),g(i,a)},p(e,i){2&i&&j(s,e[1])},d(e){e&&b(i)}}}function N(e){let i,t,s,a,c,n,o=e[18].text+"";return{c(){i=l("option"),t=f(o),s=E(),C(i,"name",a=e[18].value),i.disabled=c=e[18].disabled,i.__value=n=e[18].value,i.value=i.__value},m(e,a){r(e,i,a),g(i,t),g(i,s)},p(e,r){512&r&&o!==(o=e[18].text+"")&&j(t,o),512&r&&a!==(a=e[18].value)&&C(i,"name",a),512&r&&c!==(c=e[18].disabled)&&(i.disabled=c),512&r&&n!==(n=e[18].value)&&(i.__value=n,i.value=i.__value)},d(e){e&&b(i)}}}function L(e){let i,t,s,a,A,D=e[1]&&T(e),w=e[9],f=[];for(let i=0;i<w.length;i+=1)f[i]=N($(e,w,i));let j=[{id:e[0]},{class:s=S(e[3],e[4],e[2])+" "+e[8]},{disabled:e[5]},e[6]],E={};for(let e=0;e<j.length;e+=1)E=c(E,j[e]);return{c(){i=l("select"),D&&D.c(),t=n();for(let e=0;e<f.length;e+=1)f[e].c();this.c=o,d(i,E),void 0===e[7]&&m((()=>e[14].call(i)))},m(s,c){r(s,i,c),D&&D.m(i,null),g(i,t);for(let e=0;e<f.length;e+=1)f[e]&&f[e].m(i,null);"value"in E&&(E.multiple?x:h)(i,E.value),i.autofocus&&i.focus(),h(i,e[7],!0),a||(A=[p(e[11].call(null,i)),u(i,"change",e[14]),u(i,"change",e[15])],a=!0)},p(e,[r]){if(e[1]?D?D.p(e,r):(D=T(e),D.c(),D.m(i,t)):D&&(D.d(1),D=null),512&r){let t;for(w=e[9],t=0;t<w.length;t+=1){const s=$(e,w,t);f[t]?f[t].p(s,r):(f[t]=N(s),f[t].c(),f[t].m(i,null))}for(;t<f.length;t+=1)f[t].d(1);f.length=w.length}d(i,E=M(j,[1&r&&{id:e[0]},284&r&&s!==(s=S(e[3],e[4],e[2])+" "+e[8])&&{class:s},32&r&&{disabled:e[5]},64&r&&e[6]])),381&r&&"value"in E&&(E.multiple?x:h)(i,E.value),640&r&&h(i,e[7])},i:o,o:o,d(e){e&&b(i),D&&D.d(),I(f,e),a=!1,v(A)}}}function S(e,i,t){const r=["mc-select"];return e&&!i&&r.push("is-valid"),i&&r.push("is-invalid"),t&&r.push(`mc-select--${t}`),r.join(" ")}function G(e,i,t){let r,s,a;const l=["id","valueselected","placeholder","size","isvalid","isinvalid","disabled","options"];let n=A(i,l),{id:o}=i,{valueselected:d=""}=i,{placeholder:m}=i,{size:g="m"}=i,{isvalid:x=!1}=i,{isinvalid:h=!1}=i,{disabled:p=!1}=i,{options:u}=i,M=new k;const b=y(D());let I="";return e.$$set=e=>{t(17,i=c(c({},i),w(e))),t(16,n=A(i,l)),"id"in e&&t(0,o=e.id),"valueselected"in e&&t(12,d=e.valueselected),"placeholder"in e&&t(1,m=e.placeholder),"size"in e&&t(2,g=e.size),"isvalid"in e&&t(3,x=e.isvalid),"isinvalid"in e&&t(4,h=e.isinvalid),"disabled"in e&&t(5,p=e.disabled),"options"in e&&t(13,u=e.options)},e.$$.update=()=>{8192&e.$$.dirty&&t(9,r=u?JSON.parse(u):[]),4096&e.$$.dirty&&t(7,I=d),t(8,s=i.class),t(6,a=Object.assign({},n)),64&e.$$.dirty&&delete a.class},i=w(i),[o,m,g,x,h,p,a,I,s,r,M,b,d,u,function(){I=z(this),t(7,I),t(12,d),t(9,r),t(13,u)},()=>M.dispatch("change",I)]}class Z extends e{constructor(e){super();const c=document.createElement("style");c.textContent='.mc-select{font-family:"LeroyMerlin", 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;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg==");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 #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.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;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg=="), url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNjNjExMTIiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PHBhdGggZD0iTTEyIDdhMSAxIDAgMDAtMSAxdjQuMzhhMSAxIDAgMDAyIDBWOGExIDEgMCAwMC0xLTF6Ii8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxNiIgcj0iMSIvPjwvc3ZnPg==");border-color:#c61112}.mc-select.is-valid{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg=="), 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)}}',this.shadowRoot.appendChild(c),i(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},G,L,a,{id:0,valueselected:12,placeholder:1,size:2,isvalid:3,isinvalid:4,disabled:5,options:13},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["id","valueselected","placeholder","size","isvalid","isinvalid","disabled","options"]}get id(){return this.$$.ctx[0]}set id(e){this.$$set({id:e}),s()}get valueselected(){return this.$$.ctx[12]}set valueselected(e){this.$$set({valueselected:e}),s()}get placeholder(){return this.$$.ctx[1]}set placeholder(e){this.$$set({placeholder:e}),s()}get size(){return this.$$.ctx[2]}set size(e){this.$$set({size:e}),s()}get isvalid(){return this.$$.ctx[3]}set isvalid(e){this.$$set({isvalid:e}),s()}get isinvalid(){return this.$$.ctx[4]}set isinvalid(e){this.$$set({isinvalid:e}),s()}get disabled(){return this.$$.ctx[5]}set disabled(e){this.$$set({disabled:e}),s()}get options(){return this.$$.ctx[13]}set options(e){this.$$set({options:e}),s()}}export{Z as default};
|
|
1
|
+
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert, f as flush, s as safe_not_equal, c as assign, e as element, K as empty, n as noop, h as set_attributes, a6 as add_render_callback, j as append, a7 as select_options, a8 as select_option, B as action_destroyer, l as listen, m as get_spread_update, o as detach, J as destroy_each, H as run_all, p as compute_rest_props, r as get_current_component, q as exclude_internal_props, t as text, k as set_data, d as space, g as attr, a9 as select_value } from '../../index-c33b3772.js';
|
|
2
|
+
import { E as EventHandler } from '../../EventHandler-02058705.js';
|
|
3
|
+
import { c as createEventForwarder } from '../../EventForward-8492ff62.js';
|
|
4
|
+
|
|
5
|
+
/* src/components/select/Select.svelte generated by Svelte v3.58.0 */
|
|
6
|
+
|
|
7
|
+
function get_each_context(ctx, list, i) {
|
|
8
|
+
const child_ctx = ctx.slice();
|
|
9
|
+
child_ctx[18] = list[i];
|
|
10
|
+
return child_ctx;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// (47:2) {#if placeholder}
|
|
14
|
+
function create_if_block(ctx) {
|
|
15
|
+
let option;
|
|
16
|
+
let t0;
|
|
17
|
+
let t1;
|
|
18
|
+
let t2;
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
c() {
|
|
22
|
+
option = element("option");
|
|
23
|
+
t0 = text("-- ");
|
|
24
|
+
t1 = text(/*placeholder*/ ctx[1]);
|
|
25
|
+
t2 = text(" --\n ");
|
|
26
|
+
option.__value = "";
|
|
27
|
+
option.value = option.__value;
|
|
28
|
+
option.disabled = true;
|
|
29
|
+
option.selected = true;
|
|
30
|
+
},
|
|
31
|
+
m(target, anchor) {
|
|
32
|
+
insert(target, option, anchor);
|
|
33
|
+
append(option, t0);
|
|
34
|
+
append(option, t1);
|
|
35
|
+
append(option, t2);
|
|
36
|
+
},
|
|
37
|
+
p(ctx, dirty) {
|
|
38
|
+
if (dirty & /*placeholder*/ 2) set_data(t1, /*placeholder*/ ctx[1]);
|
|
39
|
+
},
|
|
40
|
+
d(detaching) {
|
|
41
|
+
if (detaching) detach(option);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// (53:2) {#each parsedOptions as opt}
|
|
47
|
+
function create_each_block(ctx) {
|
|
48
|
+
let option;
|
|
49
|
+
let t0_value = /*opt*/ ctx[18].text + "";
|
|
50
|
+
let t0;
|
|
51
|
+
let t1;
|
|
52
|
+
let option_name_value;
|
|
53
|
+
let option_disabled_value;
|
|
54
|
+
let option_value_value;
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
c() {
|
|
58
|
+
option = element("option");
|
|
59
|
+
t0 = text(t0_value);
|
|
60
|
+
t1 = space();
|
|
61
|
+
attr(option, "name", option_name_value = /*opt*/ ctx[18].value);
|
|
62
|
+
option.disabled = option_disabled_value = /*opt*/ ctx[18].disabled;
|
|
63
|
+
option.__value = option_value_value = /*opt*/ ctx[18].value;
|
|
64
|
+
option.value = option.__value;
|
|
65
|
+
},
|
|
66
|
+
m(target, anchor) {
|
|
67
|
+
insert(target, option, anchor);
|
|
68
|
+
append(option, t0);
|
|
69
|
+
append(option, t1);
|
|
70
|
+
},
|
|
71
|
+
p(ctx, dirty) {
|
|
72
|
+
if (dirty & /*parsedOptions*/ 512 && t0_value !== (t0_value = /*opt*/ ctx[18].text + "")) set_data(t0, t0_value);
|
|
73
|
+
|
|
74
|
+
if (dirty & /*parsedOptions*/ 512 && option_name_value !== (option_name_value = /*opt*/ ctx[18].value)) {
|
|
75
|
+
attr(option, "name", option_name_value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (dirty & /*parsedOptions*/ 512 && option_disabled_value !== (option_disabled_value = /*opt*/ ctx[18].disabled)) {
|
|
79
|
+
option.disabled = option_disabled_value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (dirty & /*parsedOptions*/ 512 && option_value_value !== (option_value_value = /*opt*/ ctx[18].value)) {
|
|
83
|
+
option.__value = option_value_value;
|
|
84
|
+
option.value = option.__value;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
d(detaching) {
|
|
88
|
+
if (detaching) detach(option);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function create_fragment(ctx) {
|
|
94
|
+
let select;
|
|
95
|
+
let if_block_anchor;
|
|
96
|
+
let select_class_value;
|
|
97
|
+
let mounted;
|
|
98
|
+
let dispose;
|
|
99
|
+
let if_block = /*placeholder*/ ctx[1] && create_if_block(ctx);
|
|
100
|
+
let each_value = /*parsedOptions*/ ctx[9];
|
|
101
|
+
let each_blocks = [];
|
|
102
|
+
|
|
103
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
104
|
+
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let select_levels = [
|
|
108
|
+
{ id: /*id*/ ctx[0] },
|
|
109
|
+
{
|
|
110
|
+
class: select_class_value = "" + (setClasses(/*isvalid*/ ctx[3], /*isinvalid*/ ctx[4], /*size*/ ctx[2]) + " " + /*userClass*/ ctx[8])
|
|
111
|
+
},
|
|
112
|
+
{ disabled: /*disabled*/ ctx[5] },
|
|
113
|
+
/*attributes*/ ctx[6]
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
let select_data = {};
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < select_levels.length; i += 1) {
|
|
119
|
+
select_data = assign(select_data, select_levels[i]);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
c() {
|
|
124
|
+
select = element("select");
|
|
125
|
+
if (if_block) if_block.c();
|
|
126
|
+
if_block_anchor = empty();
|
|
127
|
+
|
|
128
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
129
|
+
each_blocks[i].c();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
this.c = noop;
|
|
133
|
+
set_attributes(select, select_data);
|
|
134
|
+
if (/*valueSelected*/ ctx[7] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[14].call(select));
|
|
135
|
+
},
|
|
136
|
+
m(target, anchor) {
|
|
137
|
+
insert(target, select, anchor);
|
|
138
|
+
if (if_block) if_block.m(select, null);
|
|
139
|
+
append(select, if_block_anchor);
|
|
140
|
+
|
|
141
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
142
|
+
if (each_blocks[i]) {
|
|
143
|
+
each_blocks[i].m(select, null);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
'value' in select_data && (select_data.multiple ? select_options : select_option)(select, select_data.value);
|
|
148
|
+
if (select.autofocus) select.focus();
|
|
149
|
+
select_option(select, /*valueSelected*/ ctx[7], true);
|
|
150
|
+
|
|
151
|
+
if (!mounted) {
|
|
152
|
+
dispose = [
|
|
153
|
+
action_destroyer(/*forwardEvents*/ ctx[11].call(null, select)),
|
|
154
|
+
listen(select, "change", /*select_change_handler*/ ctx[14]),
|
|
155
|
+
listen(select, "change", /*change_handler*/ ctx[15])
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
mounted = true;
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
p(ctx, [dirty]) {
|
|
162
|
+
if (/*placeholder*/ ctx[1]) {
|
|
163
|
+
if (if_block) {
|
|
164
|
+
if_block.p(ctx, dirty);
|
|
165
|
+
} else {
|
|
166
|
+
if_block = create_if_block(ctx);
|
|
167
|
+
if_block.c();
|
|
168
|
+
if_block.m(select, if_block_anchor);
|
|
169
|
+
}
|
|
170
|
+
} else if (if_block) {
|
|
171
|
+
if_block.d(1);
|
|
172
|
+
if_block = null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (dirty & /*parsedOptions*/ 512) {
|
|
176
|
+
each_value = /*parsedOptions*/ ctx[9];
|
|
177
|
+
let i;
|
|
178
|
+
|
|
179
|
+
for (i = 0; i < each_value.length; i += 1) {
|
|
180
|
+
const child_ctx = get_each_context(ctx, each_value, i);
|
|
181
|
+
|
|
182
|
+
if (each_blocks[i]) {
|
|
183
|
+
each_blocks[i].p(child_ctx, dirty);
|
|
184
|
+
} else {
|
|
185
|
+
each_blocks[i] = create_each_block(child_ctx);
|
|
186
|
+
each_blocks[i].c();
|
|
187
|
+
each_blocks[i].m(select, null);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
for (; i < each_blocks.length; i += 1) {
|
|
192
|
+
each_blocks[i].d(1);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
each_blocks.length = each_value.length;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
set_attributes(select, select_data = get_spread_update(select_levels, [
|
|
199
|
+
dirty & /*id*/ 1 && { id: /*id*/ ctx[0] },
|
|
200
|
+
dirty & /*isvalid, isinvalid, size, userClass*/ 284 && select_class_value !== (select_class_value = "" + (setClasses(/*isvalid*/ ctx[3], /*isinvalid*/ ctx[4], /*size*/ ctx[2]) + " " + /*userClass*/ ctx[8])) && { class: select_class_value },
|
|
201
|
+
dirty & /*disabled*/ 32 && { disabled: /*disabled*/ ctx[5] },
|
|
202
|
+
dirty & /*attributes*/ 64 && /*attributes*/ ctx[6]
|
|
203
|
+
]));
|
|
204
|
+
|
|
205
|
+
if (dirty & /*id, setClasses, isvalid, isinvalid, size, userClass, disabled, attributes*/ 381 && 'value' in select_data) (select_data.multiple ? select_options : select_option)(select, select_data.value);
|
|
206
|
+
|
|
207
|
+
if (dirty & /*valueSelected, parsedOptions*/ 640) {
|
|
208
|
+
select_option(select, /*valueSelected*/ ctx[7]);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
i: noop,
|
|
212
|
+
o: noop,
|
|
213
|
+
d(detaching) {
|
|
214
|
+
if (detaching) detach(select);
|
|
215
|
+
if (if_block) if_block.d();
|
|
216
|
+
destroy_each(each_blocks, detaching);
|
|
217
|
+
mounted = false;
|
|
218
|
+
run_all(dispose);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function setClasses(isvalid, isinvalid, size) {
|
|
224
|
+
const classes = ['mc-select'];
|
|
225
|
+
|
|
226
|
+
if (isvalid && !isinvalid) {
|
|
227
|
+
classes.push('is-valid');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (isinvalid) {
|
|
231
|
+
classes.push('is-invalid');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (size) {
|
|
235
|
+
classes.push(`mc-select--${size}`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return classes.join(' ');
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function instance($$self, $$props, $$invalidate) {
|
|
242
|
+
let parsedOptions;
|
|
243
|
+
let userClass;
|
|
244
|
+
let attributes;
|
|
245
|
+
|
|
246
|
+
const omit_props_names = [
|
|
247
|
+
"id","valueselected","placeholder","size","isvalid","isinvalid","disabled","options"
|
|
248
|
+
];
|
|
249
|
+
|
|
250
|
+
let $$restProps = compute_rest_props($$props, omit_props_names);
|
|
251
|
+
let { id } = $$props;
|
|
252
|
+
let { valueselected = '' } = $$props;
|
|
253
|
+
let { placeholder } = $$props;
|
|
254
|
+
let { size = 'm' } = $$props;
|
|
255
|
+
let { isvalid = false } = $$props;
|
|
256
|
+
let { isinvalid = false } = $$props;
|
|
257
|
+
let { disabled = false } = $$props;
|
|
258
|
+
let { options } = $$props;
|
|
259
|
+
let eventHandler = new EventHandler();
|
|
260
|
+
const forwardEvents = createEventForwarder(get_current_component());
|
|
261
|
+
let valueSelected = '';
|
|
262
|
+
|
|
263
|
+
function select_change_handler() {
|
|
264
|
+
valueSelected = select_value(this);
|
|
265
|
+
($$invalidate(7, valueSelected), $$invalidate(12, valueselected));
|
|
266
|
+
($$invalidate(9, parsedOptions), $$invalidate(13, options));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const change_handler = () => eventHandler.dispatch('change', valueSelected);
|
|
270
|
+
|
|
271
|
+
$$self.$$set = $$new_props => {
|
|
272
|
+
$$invalidate(17, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
273
|
+
$$invalidate(16, $$restProps = compute_rest_props($$props, omit_props_names));
|
|
274
|
+
if ('id' in $$new_props) $$invalidate(0, id = $$new_props.id);
|
|
275
|
+
if ('valueselected' in $$new_props) $$invalidate(12, valueselected = $$new_props.valueselected);
|
|
276
|
+
if ('placeholder' in $$new_props) $$invalidate(1, placeholder = $$new_props.placeholder);
|
|
277
|
+
if ('size' in $$new_props) $$invalidate(2, size = $$new_props.size);
|
|
278
|
+
if ('isvalid' in $$new_props) $$invalidate(3, isvalid = $$new_props.isvalid);
|
|
279
|
+
if ('isinvalid' in $$new_props) $$invalidate(4, isinvalid = $$new_props.isinvalid);
|
|
280
|
+
if ('disabled' in $$new_props) $$invalidate(5, disabled = $$new_props.disabled);
|
|
281
|
+
if ('options' in $$new_props) $$invalidate(13, options = $$new_props.options);
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
$$self.$$.update = () => {
|
|
285
|
+
if ($$self.$$.dirty & /*options*/ 8192) {
|
|
286
|
+
$$invalidate(9, parsedOptions = options ? JSON.parse(options) : []);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if ($$self.$$.dirty & /*valueselected*/ 4096) {
|
|
290
|
+
$$invalidate(7, valueSelected = valueselected);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
$$invalidate(8, userClass = $$props.class);
|
|
294
|
+
$$invalidate(6, attributes = Object.assign({}, $$restProps));
|
|
295
|
+
|
|
296
|
+
if ($$self.$$.dirty & /*attributes*/ 64) {
|
|
297
|
+
delete attributes.class;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
$$props = exclude_internal_props($$props);
|
|
302
|
+
|
|
303
|
+
return [
|
|
304
|
+
id,
|
|
305
|
+
placeholder,
|
|
306
|
+
size,
|
|
307
|
+
isvalid,
|
|
308
|
+
isinvalid,
|
|
309
|
+
disabled,
|
|
310
|
+
attributes,
|
|
311
|
+
valueSelected,
|
|
312
|
+
userClass,
|
|
313
|
+
parsedOptions,
|
|
314
|
+
eventHandler,
|
|
315
|
+
forwardEvents,
|
|
316
|
+
valueselected,
|
|
317
|
+
options,
|
|
318
|
+
select_change_handler,
|
|
319
|
+
change_handler
|
|
320
|
+
];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
class Select extends SvelteElement {
|
|
324
|
+
constructor(options) {
|
|
325
|
+
super();
|
|
326
|
+
const style = document.createElement('style');
|
|
327
|
+
style.textContent = `.mc-select{font-family:"LeroyMerlin", 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;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg==");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 #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.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;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg=="), url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNjNjExMTIiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMTAxMCAxMEExMCAxMCAwIDAwMTIgMnptMCAxOGE4IDggMCAxMTgtOCA4IDggMCAwMS04IDh6Ii8+PHBhdGggZD0iTTEyIDdhMSAxIDAgMDAtMSAxdjQuMzhhMSAxIDAgMDAyIDBWOGExIDEgMCAwMC0xLTF6Ii8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxNiIgcj0iMSIvPjwvc3ZnPg==");border-color:#c61112}.mc-select.is-valid{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMXJlbSIgd2lkdGg9IjFyZW0iIGZpbGw9IiMxOTE5MTkiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTggMTEuNWExIDEgMCAwMS0uNzEtLjI5bC01LTVhMSAxIDAgMDExLjQyLTEuNDJMOCA5LjA5bDQuMjktNC4zYTEgMSAwIDExMS40MiAxLjQybC01IDVhMSAxIDAgMDEtLjcxLjI5eiIvPjwvc3ZnPg=="), 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)}}`;
|
|
328
|
+
this.shadowRoot.appendChild(style);
|
|
329
|
+
|
|
330
|
+
init(
|
|
331
|
+
this,
|
|
332
|
+
{
|
|
333
|
+
target: this.shadowRoot,
|
|
334
|
+
props: attribute_to_object(this.attributes),
|
|
335
|
+
customElement: true
|
|
336
|
+
},
|
|
337
|
+
instance,
|
|
338
|
+
create_fragment,
|
|
339
|
+
safe_not_equal,
|
|
340
|
+
{
|
|
341
|
+
id: 0,
|
|
342
|
+
valueselected: 12,
|
|
343
|
+
placeholder: 1,
|
|
344
|
+
size: 2,
|
|
345
|
+
isvalid: 3,
|
|
346
|
+
isinvalid: 4,
|
|
347
|
+
disabled: 5,
|
|
348
|
+
options: 13
|
|
349
|
+
},
|
|
350
|
+
null
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
if (options) {
|
|
354
|
+
if (options.target) {
|
|
355
|
+
insert(options.target, this, options.anchor);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (options.props) {
|
|
359
|
+
this.$set(options.props);
|
|
360
|
+
flush();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
static get observedAttributes() {
|
|
366
|
+
return [
|
|
367
|
+
"id",
|
|
368
|
+
"valueselected",
|
|
369
|
+
"placeholder",
|
|
370
|
+
"size",
|
|
371
|
+
"isvalid",
|
|
372
|
+
"isinvalid",
|
|
373
|
+
"disabled",
|
|
374
|
+
"options"
|
|
375
|
+
];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
get id() {
|
|
379
|
+
return this.$$.ctx[0];
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
set id(id) {
|
|
383
|
+
this.$$set({ id });
|
|
384
|
+
flush();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
get valueselected() {
|
|
388
|
+
return this.$$.ctx[12];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
set valueselected(valueselected) {
|
|
392
|
+
this.$$set({ valueselected });
|
|
393
|
+
flush();
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
get placeholder() {
|
|
397
|
+
return this.$$.ctx[1];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
set placeholder(placeholder) {
|
|
401
|
+
this.$$set({ placeholder });
|
|
402
|
+
flush();
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
get size() {
|
|
406
|
+
return this.$$.ctx[2];
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
set size(size) {
|
|
410
|
+
this.$$set({ size });
|
|
411
|
+
flush();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
get isvalid() {
|
|
415
|
+
return this.$$.ctx[3];
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
set isvalid(isvalid) {
|
|
419
|
+
this.$$set({ isvalid });
|
|
420
|
+
flush();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
get isinvalid() {
|
|
424
|
+
return this.$$.ctx[4];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
set isinvalid(isinvalid) {
|
|
428
|
+
this.$$set({ isinvalid });
|
|
429
|
+
flush();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
get disabled() {
|
|
433
|
+
return this.$$.ctx[5];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
set disabled(disabled) {
|
|
437
|
+
this.$$set({ disabled });
|
|
438
|
+
flush();
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
get options() {
|
|
442
|
+
return this.$$.ctx[13];
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
set options(options) {
|
|
446
|
+
this.$$set({ options });
|
|
447
|
+
flush();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export { Select as default };
|
|
2
452
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/select/Select.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n import { createEventForwarder } from '../../utilities/EventForward';\n\n import type { SelectOption, SelectSize } from './select.types';\n\n export let id: string;\n export let valueselected = '';\n export let placeholder: string;\n export let size: SelectSize = 'm';\n export let isvalid = false;\n export let isinvalid = false;\n export let disabled = false;\n export let options: string;\n let eventHandler = new EventHandler();\n const forwardEvents = createEventForwarder(get_current_component());\n let valueSelected = '';\n\n $: parsedOptions = options ? (JSON.parse(options) as SelectOption[]) : [];\n $: valueSelected = valueselected;\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n function setClasses(\n isvalid: boolean,\n isinvalid: boolean,\n size: SelectSize,\n ): string {\n const classes = ['mc-select'];\n\n if (isvalid && !isinvalid) {\n classes.push('is-valid');\n }\n\n if (isinvalid) {\n classes.push('is-invalid');\n }\n if (size) {\n classes.push(`mc-select--${size}`);\n }\n\n return classes.join(' ');\n }\n</script>\n\n<!-- svelte-ignore a11y-no-onchange -->\n<select\n use:forwardEvents\n {id}\n class=\"{setClasses(isvalid, isinvalid, size)} {userClass}\"\n {disabled}\n bind:value={valueSelected}\n on:change={() => eventHandler.dispatch('change', valueSelected)}\n {...attributes}\n>\n {#if placeholder}\n <option value=\"\" disabled selected>\n -- {placeholder} --\n </option>\n {/if}\n\n {#each parsedOptions as opt}\n <option name={opt.value} disabled={opt.disabled} value={opt.value}>\n {opt.text}\n </option>\n {/each}\n</select>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/_c.select';\n</style>\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/select/Select.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n import { createEventForwarder } from '../../utilities/EventForward';\n\n import type { SelectOption, SelectSize } from './select.types';\n\n export let id: string;\n export let valueselected = '';\n export let placeholder: string;\n export let size: SelectSize = 'm';\n export let isvalid = false;\n export let isinvalid = false;\n export let disabled = false;\n export let options: string;\n let eventHandler = new EventHandler();\n const forwardEvents = createEventForwarder(get_current_component());\n let valueSelected = '';\n\n $: parsedOptions = options ? (JSON.parse(options) as SelectOption[]) : [];\n $: valueSelected = valueselected;\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n function setClasses(\n isvalid: boolean,\n isinvalid: boolean,\n size: SelectSize,\n ): string {\n const classes = ['mc-select'];\n\n if (isvalid && !isinvalid) {\n classes.push('is-valid');\n }\n\n if (isinvalid) {\n classes.push('is-invalid');\n }\n if (size) {\n classes.push(`mc-select--${size}`);\n }\n\n return classes.join(' ');\n }\n</script>\n\n<!-- svelte-ignore a11y-no-onchange -->\n<select\n use:forwardEvents\n {id}\n class=\"{setClasses(isvalid, isinvalid, size)} {userClass}\"\n {disabled}\n bind:value={valueSelected}\n on:change={() => eventHandler.dispatch('change', valueSelected)}\n {...attributes}\n>\n {#if placeholder}\n <option value=\"\" disabled selected>\n -- {placeholder} --\n </option>\n {/if}\n\n {#each parsedOptions as opt}\n <option name={opt.value} disabled={opt.disabled} value={opt.value}>\n {opt.text}\n </option>\n {/each}\n</select>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/_c.select';\n</style>\n"],"names":[],"mappings":"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"}
|