@spw-ds/spw-stencil-library 1.3.3 → 1.3.4

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.
Files changed (96) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/spw-card-content.cjs.entry.js +1 -1
  3. package/dist/cjs/spw-card-excerpt.cjs.entry.js +1 -1
  4. package/dist/cjs/spw-card-image.cjs.entry.js +22 -4
  5. package/dist/cjs/spw-card-subtag-item.cjs.entry.js +1 -1
  6. package/dist/cjs/spw-card-subtags.cjs.entry.js +5 -2
  7. package/dist/cjs/spw-card-title.cjs.entry.js +1 -1
  8. package/dist/cjs/spw-card.cjs.entry.js +2 -2
  9. package/dist/cjs/spw-custom-select.cjs.entry.js +22 -3
  10. package/dist/cjs/spw-file-upload.cjs.entry.js +34 -9
  11. package/dist/cjs/spw-mosaic-item.cjs.entry.js +47 -6
  12. package/dist/cjs/spw-mosaic.cjs.entry.js +5 -2
  13. package/dist/cjs/spw-select.cjs.entry.js +16 -10
  14. package/dist/cjs/spw-stencil-library.cjs.js +1 -1
  15. package/dist/cjs/spw-tile.cjs.entry.js +1 -1
  16. package/dist/collection/components/spw-card/spw-card-content/spw-card-content.css +36 -2
  17. package/dist/collection/components/spw-card/spw-card-excerpt/spw-card-excerpt.css +3 -0
  18. package/dist/collection/components/spw-card/spw-card-image/spw-card-image.css +35 -14
  19. package/dist/collection/components/spw-card/spw-card-image/spw-card-image.js +79 -4
  20. package/dist/collection/components/spw-card/spw-card-subtag-item/spw-card-subtag-item.css +3 -0
  21. package/dist/collection/components/spw-card/spw-card-subtags/spw-card-subtags.css +3 -0
  22. package/dist/collection/components/spw-card/spw-card-subtags/spw-card-subtags.js +4 -1
  23. package/dist/collection/components/spw-card/spw-card-title/spw-card-title.css +10 -2
  24. package/dist/collection/components/spw-card/spw-card.js +4 -4
  25. package/dist/collection/components/spw-custom-select/spw-custom-select.js +61 -4
  26. package/dist/collection/components/spw-file-upload/spw-file-upload.js +55 -10
  27. package/dist/collection/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.js +111 -6
  28. package/dist/collection/components/spw-mosaic/spw-mosaic.js +9 -2
  29. package/dist/collection/components/spw-select/spw-select.js +55 -11
  30. package/dist/collection/components/spw-tile/spw-tile.css +17 -0
  31. package/dist/collection/stories/organisms/spw-card/spw-card.stories.js +22 -0
  32. package/dist/collection/stories/organisms/spw-grid/spw-grid.stories.js +14 -14
  33. package/dist/collection/stories/organisms/spw-mosaic/spw-mosaic.stories.js +131 -0
  34. package/dist/components/spw-card-content.js +1 -1
  35. package/dist/components/spw-card-excerpt.js +1 -1
  36. package/dist/components/spw-card-image.js +1 -1
  37. package/dist/components/spw-card-subtag-item.js +1 -1
  38. package/dist/components/spw-card-subtags.js +1 -1
  39. package/dist/components/spw-card-title.js +1 -1
  40. package/dist/components/spw-card.js +1 -1
  41. package/dist/components/spw-custom-select.js +1 -1
  42. package/dist/components/spw-file-upload.js +1 -1
  43. package/dist/components/spw-mosaic-item.js +1 -1
  44. package/dist/components/spw-mosaic.js +4 -4
  45. package/dist/components/spw-select.js +1 -1
  46. package/dist/components/spw-tile.js +1 -1
  47. package/dist/components_json.json +297 -9
  48. package/dist/components_vscode.json +3499 -0
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/esm/spw-card-content.entry.js +1 -1
  51. package/dist/esm/spw-card-excerpt.entry.js +1 -1
  52. package/dist/esm/spw-card-image.entry.js +22 -4
  53. package/dist/esm/spw-card-subtag-item.entry.js +1 -1
  54. package/dist/esm/spw-card-subtags.entry.js +5 -2
  55. package/dist/esm/spw-card-title.entry.js +1 -1
  56. package/dist/esm/spw-card.entry.js +2 -2
  57. package/dist/esm/spw-custom-select.entry.js +22 -3
  58. package/dist/esm/spw-file-upload.entry.js +34 -9
  59. package/dist/esm/spw-mosaic-item.entry.js +47 -6
  60. package/dist/esm/spw-mosaic.entry.js +5 -2
  61. package/dist/esm/spw-select.entry.js +16 -10
  62. package/dist/esm/spw-stencil-library.js +1 -1
  63. package/dist/esm/spw-tile.entry.js +1 -1
  64. package/dist/spw-stencil-library/p-1318262e.entry.js +1 -0
  65. package/dist/spw-stencil-library/p-1e806b7c.entry.js +1 -0
  66. package/dist/spw-stencil-library/{p-70424f67.entry.js → p-24de9d6f.entry.js} +1 -1
  67. package/dist/spw-stencil-library/{p-fdbda346.entry.js → p-25991392.entry.js} +1 -1
  68. package/dist/spw-stencil-library/p-36122fda.entry.js +1 -0
  69. package/dist/spw-stencil-library/{p-c833a6fb.entry.js → p-6a46c406.entry.js} +1 -1
  70. package/dist/spw-stencil-library/{p-6ccec3e1.entry.js → p-7368447c.entry.js} +1 -1
  71. package/dist/spw-stencil-library/p-7cb2f275.entry.js +1 -0
  72. package/dist/spw-stencil-library/p-94aa0e26.entry.js +1 -0
  73. package/dist/spw-stencil-library/{p-f0c7973a.entry.js → p-bc3ff922.entry.js} +1 -1
  74. package/dist/spw-stencil-library/p-e0f6f758.entry.js +1 -0
  75. package/dist/spw-stencil-library/{p-e8294025.entry.js → p-fa4bf37b.entry.js} +1 -1
  76. package/dist/spw-stencil-library/{p-d8e93516.entry.js → p-fbfb718d.entry.js} +1 -1
  77. package/dist/spw-stencil-library/spw-stencil-library.esm.js +1 -1
  78. package/dist/stats.json +618 -113
  79. package/dist/types/components/spw-card/spw-card-image/spw-card-image.d.ts +8 -1
  80. package/dist/types/components/spw-card/spw-card.d.ts +1 -1
  81. package/dist/types/components/spw-custom-select/spw-custom-select.d.ts +5 -0
  82. package/dist/types/components/spw-file-upload/spw-file-upload.d.ts +3 -1
  83. package/dist/types/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.d.ts +11 -0
  84. package/dist/types/components/spw-select/spw-select.d.ts +5 -1
  85. package/dist/types/components.d.ts +86 -6
  86. package/dist/types/stories/organisms/spw-card/spw-card.stories.d.ts +1 -0
  87. package/dist/types/stories/organisms/spw-mosaic/spw-mosaic.stories.d.ts +1 -0
  88. package/hydrate/index.js +174 -47
  89. package/hydrate/index.mjs +174 -47
  90. package/package.json +1 -1
  91. package/dist/spw-stencil-library/p-38bd2b93.entry.js +0 -1
  92. package/dist/spw-stencil-library/p-a5e811f0.entry.js +0 -1
  93. package/dist/spw-stencil-library/p-a92189cd.entry.js +0 -1
  94. package/dist/spw-stencil-library/p-aad1a377.entry.js +0 -1
  95. package/dist/spw-stencil-library/p-d7ed084c.entry.js +0 -1
  96. package/dist/spw-stencil-library/p-fb0c6681.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as i,t as o}from"./index.js";import{d as c}from"./p-CbTnWZks.js";import{d as n}from"./p-CIfmnXXp.js";import{d as r}from"./p-DikxciH1.js";import{d as a}from"./p-Dzw3OiMu.js";const l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChanged=t(this,"valueChanged",7),this.internals=this.attachInternals(),this.isOpen=!1,this.parsedOptions=[],this.focusedOptionIndex=null,this.searchText="",this.dropdownDirection="down",this.hasSelectedValue=!1,this.value=[],this.label="",this.placeholder="Sélectionnez une option",this.required=!1,this.size="medium",this.multiple=!1,this.isSearch=!1,this.error="",this.hint="",this.success="",this.warning="",this.showErrorIcon=!0,this.showHintIcon=!0,this.showSuccessIcon=!0,this.showWarningIcon=!0,this.handleOtherSelectOpened=e=>{e.detail.instance!==this.host&&this.isOpen&&this.closeDropdown()},this.handleClickOutside=e=>{var s,t;if(this.isOpen){const i=e.composedPath()[0],o=this.host.contains(i),c=null===(s=this.host.shadowRoot)||void 0===s?void 0:s.querySelector(".spw-custom-select__search-input"),n=null==c?void 0:c.contains(i);if(!o&&!n){if(this.multiple){const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".spw-custom-select__options");if(e&&e.contains(i))return}this.closeDropdown()}}}}componentWillLoad(){if(this.multiple)if("string"==typeof this.value)try{this.internalValue=JSON.parse(this.value)}catch(e){this.internalValue=[]}else this.internalValue=Array.isArray(this.value)?this.value:[];else this.internalValue=this.value;this.items&&this.parseOptions(this.items),this.updateSelectedOption()}async resetSelect(){this.multiple?(this.internalValue=[],this.value=[]):(this.internalValue="",this.value=""),this.searchText="",this.focusedOptionIndex=null,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue),this.updateSelectedOption()}formResetCallback(){this.resetSelect()}componentDidLoad(){document.addEventListener("click",this.handleClickOutside),document.addEventListener("spw-custom-select-opened",this.handleOtherSelectOpened),this.internals.setFormValue(this.getFormValue())}disconnectedCallback(){document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("spw-custom-select-opened",this.handleOtherSelectOpened)}parseOptions(e){try{this.parsedOptions=Array.isArray(e)?e.map((e=>({value:e.value,label:e.label,disabled:e.disabled||!1}))):"string"==typeof e?JSON.parse(e).map((e=>({value:e.value,label:e.label,disabled:e.disabled||!1}))):[],this.updateSelectedOption()}catch(e){this.parsedOptions=[]}}valueChangedHandler(e){this.internalValue=this.multiple?Array.isArray(e)?e:[e]:e,this.updateSelectedOption(),this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}updateSelectedOption(){this.internals.setFormValue(this.getFormValue()),this.multiple||void 0===this.internalValue?this.multiple&&Array.isArray(this.internalValue)&&(this.internalValue=this.internalValue.filter((e=>this.parsedOptions.some((s=>s.value+""==e+"")))).sort(((e,s)=>this.parsedOptions.findIndex((s=>s.value+""==e+""))-this.parsedOptions.findIndex((e=>e.value+""==s+""))))):this.focusedOptionIndex=this.parsedOptions.findIndex((e=>e.value+""==this.internalValue+""))}internalValueChanged(){this.hasSelectedValue=Array.isArray(this.internalValue)?this.internalValue.length>0:!!this.internalValue}getFormValue(){return this.multiple?Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>e+"")).join(","):null:this.internalValue?this.internalValue+"":null}toggleDropdown(e){if(!this.disabled){if(e){if(e.composedPath()[0].classList.contains("spw-custom-select__search-input"))return;e.stopPropagation()}this.determineDropdownDirection();const s=this.isOpen;this.isOpen=!this.isOpen,this.isOpen&&!s&&this.notifyOtherSelects(),this.isOpen||(this.focusedOptionIndex=null)}}notifyOtherSelects(){const e=new CustomEvent("spw-custom-select-opened",{detail:{instance:this.host},bubbles:!0,composed:!0});document.dispatchEvent(e)}determineDropdownDirection(){const e=this.selectContainer.getBoundingClientRect(),s=window.innerHeight;this.dropdownDirection=e.bottom+200>s&&e.top>200?"up":"down"}openDropdownWithKeyboard(){this.determineDropdownDirection(),this.isOpen=!0,this.focusedOptionIndex=0,this.notifyOtherSelects()}closeDropdown(){this.isOpen=!1,this.focusedOptionIndex=null,this.searchText=""}selectOption(e,s){s&&s.stopPropagation();const t=this.parsedOptions.find((s=>s.value+""==e+""));if(!(null==t?void 0:t.disabled)){if(this.multiple){const s=this.internalValue.findIndex((s=>s+""==e+""));this.internalValue=s>-1?[...this.internalValue.slice(0,s),...this.internalValue.slice(s+1)]:[...this.internalValue,e],this.internalValue=this.internalValue.sort(((e,s)=>this.parsedOptions.findIndex((s=>s.value+""==e+""))-this.parsedOptions.findIndex((e=>e.value+""==s+""))))}else this.internalValue=e,this.closeDropdown();this.value=this.internalValue,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue),this.updateSelectedOption()}}handleOptionKeyDown(e,s){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectOption(s))}handleKeyDown(e){var s,t;if(!e.target.classList.contains("spw-custom-select__search-input"))switch(e.key){case" ":e.preventDefault(),this.isOpen||this.openDropdownWithKeyboard();break;case"ArrowDown":if(e.preventDefault(),this.isOpen){let e=null===this.focusedOptionIndex?0:(this.focusedOptionIndex+1)%this.parsedOptions.length;for(;(null===(s=this.parsedOptions[e])||void 0===s?void 0:s.disabled)&&e!==this.focusedOptionIndex;)e=(e+1)%this.parsedOptions.length;this.focusedOptionIndex=e}else this.openDropdownWithKeyboard();break;case"ArrowUp":if(e.preventDefault(),this.isOpen){let e=null===this.focusedOptionIndex?this.parsedOptions.length-1:(this.focusedOptionIndex-1+this.parsedOptions.length)%this.parsedOptions.length;for(;(null===(t=this.parsedOptions[e])||void 0===t?void 0:t.disabled)&&e!==this.focusedOptionIndex;)e=(e-1+this.parsedOptions.length)%this.parsedOptions.length;this.focusedOptionIndex=e}break;case"Enter":e.preventDefault(),this.isOpen&&null!==this.focusedOptionIndex&&this.selectOption(this.parsedOptions[this.focusedOptionIndex].value);break;case"Escape":this.isOpen&&this.closeDropdown()}}renderErrorMessage(){if(this.error)return i("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}renderHintMessage(){if(this.hint)return i("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}renderWarningMessage(){if(this.warning)return i("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}renderSuccessMessage(){if(this.success)return i("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}get elementClass(){return{"spw-custom-select":!0,["spw-custom-select--"+this.size]:!0,"spw-custom-select--is-error":!!this.error,"spw-custom-select--disabled":this.disabled,"spw-custom-select--is-opened":this.isOpen,"spw-custom-select--has-value":this.hasSelectedValue,"spw-custom-select--no-value":!this.hasSelectedValue,"spw-custom-select--is-searchable":this.isSearch,"spw-custom-select--not-searchable":!this.isSearch}}normalizeString(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}getSelectedLabels(){if(this.multiple)return Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>{var s;return null===(s=this.parsedOptions.find((s=>s.value+""==e+"")))||void 0===s?void 0:s.label})).filter(Boolean).join(", "):null;{const e=this.parsedOptions.find((e=>e.value+""==this.internalValue+""));return e?e.label:null}}getFilteredOptions(){const e=this.normalizeString(this.searchText);return this.parsedOptions.filter((s=>this.normalizeString(s.label).includes(e)))}handleSearchInput(e){this.searchText=e.target.value,this.focusedOptionIndex=0,this.isOpen||(this.isOpen=!0,this.notifyOtherSelects())}isSearchVisible(){return!!this.isSearch&&(!this.hasSelectedValue&&!this.isOpen||!(!this.isSearch||!this.isOpen)||this.isOpen)}showPlaceholder(){return!this.isSearch&&!this.hasSelectedValue}render(){const e=this.getFilteredOptions(),s=this.showPlaceholder();return i("div",{key:"b14db7d2386d766368355779964b2aaf1d12883a",class:this.elementClass,ref:e=>this.host=e},this.label&&i("spw-field-label",{key:"23cc951518387d87fb2aac75fcb11d4e386c3a8a",label:this.label,name:this.name,required:this.required}),this.assistiveText&&i("spw-field-message",{key:"5e775c2e0d4f088aeac5936b60fae0d2a53984d5",class:"spw-custom-select__field-message",variant:"hint",showIcon:!1},this.assistiveText),i("div",{key:"09ee394fa2c01bc88fa1d425e21b5873615758b1",class:"spw-custom-select__wrapper"},i("div",{key:"bcfbcc4cbc27591eac8e865af022a60318d42094",class:"spw-custom-select__container",id:this.name,ref:e=>this.selectContainer=e,onClick:e=>this.toggleDropdown(e),onKeyDown:e=>this.handleKeyDown(e),tabindex:this.disabled?-1:0},i("div",{key:"a66d964cc6958f878054c80db72f5a8fec38cc53",class:"spw-custom-select__selected"},this.isSearchVisible()&&i("div",{key:"6c6db72cbd2bfba15d144be535449336196555be",class:"spw-custom-select__search"},i("input",{key:"369521168c90323039c48a41689bd9fb71147ea1",class:"spw-custom-select__search-input",placeholder:"Entrez votre recherche",onInput:e=>this.handleSearchInput(e),value:this.searchText})),s&&i("span",{key:"4840d3a851c1c3c2037f87ef2fd7f7d76d17345d"},this.placeholder),this.multiple&&this.internalValue.length>0&&i("div",{key:"83356082df969a094eeb6bd9688301585448b2d5",class:"spw-custom-select__selected-items"},this.internalValue.map((e=>{var s;return i("span",{class:"spw-custom-select__selected-item"},null===(s=this.parsedOptions.find((s=>s.value+""==e+"")))||void 0===s?void 0:s.label,i("spw-icon",{icon:"fa-times",class:"spw-custom-select__deselect-icon",onClick:s=>this.selectOption(e,s)}))}))),!this.multiple&&i("span",{key:"d3e7903216c507e2fc9fc94bec814a37576b4cc6"},this.getSelectedLabels()))),i("div",{key:"654ca8a8a8b8f57ea7bf9e0488cf1530a03dd646",class:"spw-custom-select__arrow"},i("spw-icon",{key:"c051c6bb9f71ef36e80edda3dd7c9aff4abb8831",icon:this.isOpen?"fa-chevron-up":"fa-chevron-down"})),this.isOpen&&i("div",{key:"ad29aae6e9a08f2e1f56bb570da6fa8cfd3c4ab7",class:"spw-custom-select__options spw-custom-select__options--"+this.dropdownDirection},!!e.length&&i("ul",{key:"33154a536873077036837e0807cc2cf178df3b3c"},e.map(((e,s)=>i("li",{class:{"spw-custom-select__option":!0,"spw-custom-select__option--selected":this.multiple?this.internalValue.some((s=>s+""==e.value+"")):e.value===this.internalValue,"spw-custom-select__option--focused":s===this.focusedOptionIndex,"spw-custom-select__option--disabled":e.disabled},onClick:()=>this.selectOption(e.value)},this.multiple&&i("spw-checkbox",{onKeyDown:s=>this.handleOptionKeyDown(s,e.value),class:"spw-custom-select__checkbox",checked:this.internalValue.some((s=>s+""==e.value+"")),disabled:e.disabled}),e.label)))),!e.length&&i("p",{key:"d715b43bee14b967de36fd7798540c82501ee9ff",class:"spw-custom-select__no-results"},"Pas de résultats pour cette recherche."))),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return!0}static get watchers(){return{items:[{parseOptions:0}],value:[{valueChangedHandler:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-custom-select{position:relative}.spw-custom-select__field-message{margin-bottom:8px;margin-top:-4px}.spw-custom-select__checkbox{margin-right:8px}.spw-custom-select__container{display:flex;justify-content:space-between;align-items:center;width:100%;height:40px;padding:0 12px;line-height:40px;border-radius:4px;border:1px solid var(--spw-color-themes-grey-grey-800);background-color:#fff}.spw-custom-select__container:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-custom-select__container:focus-within,.spw-custom-select__container:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.spw-custom-select--disabled .spw-custom-select__container{border-color:var(--spw-color-themes-grey-grey-400);background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-custom-select--disabled .spw-custom-select__container::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container:hover,.spw-custom-select--disabled .spw-custom-select__container:focus,.spw-custom-select--disabled .spw-custom-select__container:focus-visible{outline:none}.spw-custom-select--is-error .spw-custom-select__container{border-color:var(--spw-colors-states-error-error-300)}.spw-custom-select--large .spw-custom-select__container{height:60px;padding:0 24px;line-height:60px}.spw-custom-select--is-opened .spw-custom-select__container{height:auto;line-height:1;min-height:40px;border-radius:4px 4px 0 0;border-bottom-color:transparent}.spw-custom-select__selected{flex:1;padding-right:30px;max-width:100%}.spw-custom-select__selected-item{display:inline-flex;align-items:center;gap:6px;color:var(--spw-color-themes-grey-grey-900);border:1px solid var(--spw-color-themes-grey-grey-900);background:var(--spw-color-themes-grey-grey-200);line-height:24px;height:24px;padding:0 8px;margin:4px 6px 2px 0;border-radius:999px;font-size:14px;user-select:none}.spw-custom-select__selected-items{flex:1;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.spw-custom-select--is-opened .spw-custom-select__selected-items{padding-top:3px;padding-bottom:4px;overflow:visible;text-overflow:initial;text-wrap:initial}.spw-custom-select__arrow{position:absolute;right:12px;top:10px;font-size:16px;color:var(--spw-color-themes-grey-grey-600);pointer-events:none}.spw-custom-select__wrapper{position:relative}.spw-custom-select--is-opened .spw-custom-select__search{position:absolute;top:0;left:0;z-index:11;width:100%;margin-top:1px}.spw-custom-select--has-value.spw-custom-select--is-opened .spw-custom-select__search{top:auto;top:100%;margin-top:-3px}.spw-custom-select__search-input{padding:0;height:38px;line-height:40px;border:none;margin:0;width:calc(100% - 30px);text-overflow:ellipsis}.spw-custom-select__search-input:focus{outline:none}.spw-custom-select--is-opened .spw-custom-select__search-input{border-left:1px solid var(--spw-color-themes-grey-grey-800);padding:0 12px}.spw-custom-select--is-opened.spw-custom-select--has-value .spw-custom-select__search-input{border-right:1px solid var(--spw-color-themes-grey-grey-800);width:100%}.spw-custom-select__options{position:absolute;width:100%;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:0 0 4px 4px;max-height:200px;overflow-y:auto;z-index:12}.spw-custom-select__options--down{top:100%;transform:translateY(0)}.spw-custom-select__options--up{top:100%;transform:translateY(0)}.spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) .spw-custom-select__options{margin-top:35px}.spw-custom-select__no-results{padding:12px;cursor:not-allowed;color:var(--spw-color-themes-grey-grey-600)}.spw-custom-select__option{border-bottom:1px solid var(--spw-color-themes-grey-grey-900);padding:12px;cursor:pointer}.spw-custom-select__option:hover{background-color:var(--spw-color-themes-grey-grey-200)}.spw-custom-select__option:last-child{border-bottom:none}.spw-custom-select__option--selected{font-weight:700}.spw-custom-select__option--disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.spw-custom-select__option--disabled:hover{background-color:transparent}.spw-custom-select__error{display:block;font-size:12px;color:var(--spw-color-themes-grey-grey-600);margin-top:8px}.spw-custom-select__option--focused{background-color:var(--spw-color-themes-grey-grey-300)}'}},[65,"spw-custom-select",{value:[1544],label:[1],placeholder:[1],disabled:[4],name:[1],required:[4],items:[1],size:[1],multiple:[4],isSearch:[4,"is-search"],assistiveText:[1,"assistive-text"],error:[1],hint:[1],success:[1],warning:[1],showErrorIcon:[4,"show-error-icon"],showHintIcon:[4,"show-hint-icon"],showSuccessIcon:[4,"show-success-icon"],showWarningIcon:[4,"show-warning-icon"],internalValue:[32],isOpen:[32],parsedOptions:[32],focusedOptionIndex:[32],searchText:[32],dropdownDirection:[32],hasSelectedValue:[32],resetSelect:[64]},void 0,{items:[{parseOptions:0}],value:[{valueChangedHandler:0}],internalValue:[{internalValueChanged:0}]}]),h=l,p=function(){"undefined"!=typeof customElements&&["spw-custom-select","spw-checkbox","spw-field-label","spw-field-message","spw-icon"].forEach((e=>{switch(e){case"spw-custom-select":customElements.get(o(e))||customElements.define(o(e),l);break;case"spw-checkbox":customElements.get(o(e))||c();break;case"spw-field-label":customElements.get(o(e))||n();break;case"spw-field-message":customElements.get(o(e))||r();break;case"spw-icon":customElements.get(o(e))||a()}}))};export{h as SpwCustomSelect,p as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as i,t as o}from"./index.js";import{d as n}from"./p-CbTnWZks.js";import{d as c}from"./p-CIfmnXXp.js";import{d as r}from"./p-DikxciH1.js";import{d as a}from"./p-Dzw3OiMu.js";const l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChanged=t(this,"valueChanged",7),this.internals=this.attachInternals(),this.isOpen=!1,this.parsedOptions=[],this.focusedOptionIndex=null,this.searchText="",this.dropdownDirection="down",this.hasSelectedValue=!1,this.value=[],this.label="",this.placeholder="Sélectionnez une option",this.required=!1,this.size="medium",this.multiple=!1,this.isSearch=!1,this.error="",this.hint="",this.success="",this.warning="",this.showErrorIcon=!0,this.showHintIcon=!0,this.showSuccessIcon=!0,this.showWarningIcon=!0,this.handleOtherSelectOpened=e=>{e.detail.instance!==this.host&&this.isOpen&&this.closeDropdown()},this.handleClickOutside=e=>{var s,t;if(this.isOpen){const i=e.composedPath()[0],o=this.host.contains(i),n=null===(s=this.host.shadowRoot)||void 0===s?void 0:s.querySelector(".spw-custom-select__search-input"),c=null==n?void 0:n.contains(i);if(!o&&!c){if(this.multiple){const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".spw-custom-select__options");if(e&&e.contains(i))return}this.closeDropdown()}}}}componentWillLoad(){if(this.multiple)if("string"==typeof this.value)try{this.internalValue=JSON.parse(this.value)}catch(e){this.internalValue=[]}else this.internalValue=Array.isArray(this.value)?this.value:[];else this.internalValue=this.value;this.items&&this.parseOptions(this.items),this.updateSelectedOption()}async resetSelect(){this.multiple?(this.internalValue=[],this.value=[]):(this.internalValue="",this.value=""),this.searchText="",this.focusedOptionIndex=null,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue),this.updateSelectedOption()}async setValue(e){this.multiple?(this.internalValue=Array.isArray(e)?e:[e],this.value=this.internalValue):(this.internalValue=e,this.value=e),this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue),this.updateSelectedOption()}async getValue(){return this.internalValue}formResetCallback(){this.resetSelect()}componentDidLoad(){document.addEventListener("click",this.handleClickOutside),document.addEventListener("spw-custom-select-opened",this.handleOtherSelectOpened),this.internals.setFormValue(this.getFormValue())}disconnectedCallback(){document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("spw-custom-select-opened",this.handleOtherSelectOpened)}parseOptions(e){try{this.parsedOptions=Array.isArray(e)?e.map((e=>({value:e.value,label:e.label,disabled:e.disabled||!1}))):"string"==typeof e?JSON.parse(e).map((e=>({value:e.value,label:e.label,disabled:e.disabled||!1}))):[],this.updateSelectedOption()}catch(e){this.parsedOptions=[]}}valueChangedHandler(e){this.internalValue=this.multiple?Array.isArray(e)?e:[e]:e,this.updateSelectedOption(),this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}updateSelectedOption(){this.internals.setFormValue(this.getFormValue()),this.multiple||void 0===this.internalValue?this.multiple&&Array.isArray(this.internalValue)&&(this.internalValue=this.internalValue.filter((e=>this.parsedOptions.some((s=>s.value+""==e+"")))).sort(((e,s)=>this.parsedOptions.findIndex((s=>s.value+""==e+""))-this.parsedOptions.findIndex((e=>e.value+""==s+""))))):this.focusedOptionIndex=this.parsedOptions.findIndex((e=>e.value+""==this.internalValue+""))}internalValueChanged(){this.hasSelectedValue=Array.isArray(this.internalValue)?this.internalValue.length>0:!!this.internalValue}getFormValue(){return this.multiple?Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>e+"")).join(","):null:this.internalValue?this.internalValue+"":null}toggleDropdown(e){if(!this.disabled){if(e){if(e.composedPath()[0].classList.contains("spw-custom-select__search-input"))return;e.stopPropagation()}this.determineDropdownDirection();const s=this.isOpen;this.isOpen=!this.isOpen,this.isOpen&&!s&&this.notifyOtherSelects(),this.isOpen||(this.focusedOptionIndex=null)}}notifyOtherSelects(){const e=new CustomEvent("spw-custom-select-opened",{detail:{instance:this.host},bubbles:!0,composed:!0});document.dispatchEvent(e)}determineDropdownDirection(){const e=this.selectContainer.getBoundingClientRect(),s=window.innerHeight;this.dropdownDirection=e.bottom+200>s&&e.top>200?"up":"down"}openDropdownWithKeyboard(){this.determineDropdownDirection(),this.isOpen=!0,this.focusedOptionIndex=0,this.notifyOtherSelects()}closeDropdown(){this.isOpen=!1,this.focusedOptionIndex=null,this.searchText=""}selectOption(e,s){s&&s.stopPropagation();const t=this.parsedOptions.find((s=>s.value+""==e+""));if(!(null==t?void 0:t.disabled)){if(this.multiple){const s=this.internalValue.findIndex((s=>s+""==e+""));this.internalValue=s>-1?[...this.internalValue.slice(0,s),...this.internalValue.slice(s+1)]:[...this.internalValue,e],this.internalValue=this.internalValue.sort(((e,s)=>this.parsedOptions.findIndex((s=>s.value+""==e+""))-this.parsedOptions.findIndex((e=>e.value+""==s+""))))}else this.internalValue=e,this.closeDropdown();this.value=this.internalValue,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue),this.updateSelectedOption()}}handleOptionKeyDown(e,s){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectOption(s))}handleKeyDown(e){var s,t;if(!e.target.classList.contains("spw-custom-select__search-input"))switch(e.key){case" ":e.preventDefault(),this.isOpen||this.openDropdownWithKeyboard();break;case"ArrowDown":if(e.preventDefault(),this.isOpen){let e=null===this.focusedOptionIndex?0:(this.focusedOptionIndex+1)%this.parsedOptions.length;for(;(null===(s=this.parsedOptions[e])||void 0===s?void 0:s.disabled)&&e!==this.focusedOptionIndex;)e=(e+1)%this.parsedOptions.length;this.focusedOptionIndex=e}else this.openDropdownWithKeyboard();break;case"ArrowUp":if(e.preventDefault(),this.isOpen){let e=null===this.focusedOptionIndex?this.parsedOptions.length-1:(this.focusedOptionIndex-1+this.parsedOptions.length)%this.parsedOptions.length;for(;(null===(t=this.parsedOptions[e])||void 0===t?void 0:t.disabled)&&e!==this.focusedOptionIndex;)e=(e-1+this.parsedOptions.length)%this.parsedOptions.length;this.focusedOptionIndex=e}break;case"Enter":e.preventDefault(),this.isOpen&&null!==this.focusedOptionIndex&&this.selectOption(this.parsedOptions[this.focusedOptionIndex].value);break;case"Escape":this.isOpen&&this.closeDropdown()}}renderErrorMessage(){if(this.error)return i("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}renderHintMessage(){if(this.hint)return i("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}renderWarningMessage(){if(this.warning)return i("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}renderSuccessMessage(){if(this.success)return i("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}get elementClass(){return{"spw-custom-select":!0,["spw-custom-select--"+this.size]:!0,"spw-custom-select--is-error":!!this.error,"spw-custom-select--disabled":this.disabled,"spw-custom-select--is-opened":this.isOpen,"spw-custom-select--has-value":this.hasSelectedValue,"spw-custom-select--no-value":!this.hasSelectedValue,"spw-custom-select--is-searchable":this.isSearch,"spw-custom-select--not-searchable":!this.isSearch}}normalizeString(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}getSelectedLabels(){if(this.multiple)return Array.isArray(this.internalValue)&&this.internalValue.length>0?this.internalValue.map((e=>{var s;return null===(s=this.parsedOptions.find((s=>s.value+""==e+"")))||void 0===s?void 0:s.label})).filter(Boolean).join(", "):null;{const e=this.parsedOptions.find((e=>e.value+""==this.internalValue+""));return e?e.label:null}}getFilteredOptions(){const e=this.normalizeString(this.searchText);return this.parsedOptions.filter((s=>this.normalizeString(s.label).includes(e)))}handleSearchInput(e){this.searchText=e.target.value,this.focusedOptionIndex=0,this.isOpen||(this.isOpen=!0,this.notifyOtherSelects())}isSearchVisible(){return!!this.isSearch&&(!this.hasSelectedValue&&!this.isOpen||!(!this.isSearch||!this.isOpen)||this.isOpen)}showPlaceholder(){return!this.isSearch&&!this.hasSelectedValue}render(){const e=this.getFilteredOptions(),s=this.showPlaceholder();return i("div",{key:"5f7702579283fa011eba5c445de1fe29283a0239",class:this.elementClass,ref:e=>this.host=e},this.label&&i("spw-field-label",{key:"451743b7254038fe4257378ac4f7c2206a47c60d",label:this.label,name:this.name,required:this.required}),this.assistiveText&&i("spw-field-message",{key:"817a94b7d7d2a1abd93986f3e03d0f769a6567d0",class:"spw-custom-select__field-message",variant:"hint",showIcon:!1},this.assistiveText),i("div",{key:"cf9e2cd0bcaf1a5bd9143fdf54046a241bd1a527",class:"spw-custom-select__wrapper"},i("div",{key:"21a8fb2e0bb3dba93c582735db2072b150b157e4",class:"spw-custom-select__container",id:this.name,ref:e=>this.selectContainer=e,onClick:e=>this.toggleDropdown(e),onKeyDown:e=>this.handleKeyDown(e),tabindex:this.disabled?-1:0},i("div",{key:"7acaa25439202ea6f30dd3542a757005534b2804",class:"spw-custom-select__selected"},this.isSearchVisible()&&i("div",{key:"e97c879fa5c70402ba331785f73747262e8854e1",class:"spw-custom-select__search"},i("input",{key:"7047f755e5a4aaacf66a78ce80e1ad3520be1b85",class:"spw-custom-select__search-input",placeholder:"Entrez votre recherche",onInput:e=>this.handleSearchInput(e),value:this.searchText})),s&&i("span",{key:"772afa04f989241e8e96c0ed25d444b66f72b282"},this.placeholder),this.multiple&&this.internalValue.length>0&&i("div",{key:"5d101958ee7f28ba19938a9dfbd137067d0c5a45",class:"spw-custom-select__selected-items"},this.internalValue.map((e=>{var s;return i("span",{class:"spw-custom-select__selected-item"},null===(s=this.parsedOptions.find((s=>s.value+""==e+"")))||void 0===s?void 0:s.label,i("spw-icon",{icon:"fa-times",class:"spw-custom-select__deselect-icon",onClick:s=>this.selectOption(e,s)}))}))),!this.multiple&&i("span",{key:"d6e00ae63c72be4e2bd86c4a46f3966cb7681592"},this.getSelectedLabels()))),i("div",{key:"2dbf6b83c3c479e6251291ce13f77f43e1525841",class:"spw-custom-select__arrow"},i("spw-icon",{key:"42e9d62768469dd064ccfca75dcfb45b0e6caf7b",icon:this.isOpen?"fa-chevron-up":"fa-chevron-down"})),this.isOpen&&i("div",{key:"9b53310eda74ea2ee34888a64f43ca5cfb48bca1",class:"spw-custom-select__options spw-custom-select__options--"+this.dropdownDirection},!!e.length&&i("ul",{key:"f30eb6a1d7839f241b9905ee3591ab9eed32e7df"},e.map(((e,s)=>i("li",{class:{"spw-custom-select__option":!0,"spw-custom-select__option--selected":this.multiple?this.internalValue.some((s=>s+""==e.value+"")):e.value===this.internalValue,"spw-custom-select__option--focused":s===this.focusedOptionIndex,"spw-custom-select__option--disabled":e.disabled},onClick:()=>this.selectOption(e.value)},this.multiple&&i("spw-checkbox",{onKeyDown:s=>this.handleOptionKeyDown(s,e.value),class:"spw-custom-select__checkbox",checked:this.internalValue.some((s=>s+""==e.value+"")),disabled:e.disabled}),e.label)))),!e.length&&i("p",{key:"2b8efa73852cff382f97fa73e0f4bf0080b8dee9",class:"spw-custom-select__no-results"},"Pas de résultats pour cette recherche."))),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return!0}static get watchers(){return{items:[{parseOptions:0}],value:[{valueChangedHandler:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-custom-select{position:relative}.spw-custom-select__field-message{margin-bottom:8px;margin-top:-4px}.spw-custom-select__checkbox{margin-right:8px}.spw-custom-select__container{display:flex;justify-content:space-between;align-items:center;width:100%;height:40px;padding:0 12px;line-height:40px;border-radius:4px;border:1px solid var(--spw-color-themes-grey-grey-800);background-color:#fff}.spw-custom-select__container:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-custom-select__container:focus-within,.spw-custom-select__container:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.spw-custom-select--disabled .spw-custom-select__container{border-color:var(--spw-color-themes-grey-grey-400);background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-custom-select--disabled .spw-custom-select__container::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-custom-select--disabled .spw-custom-select__container:hover,.spw-custom-select--disabled .spw-custom-select__container:focus,.spw-custom-select--disabled .spw-custom-select__container:focus-visible{outline:none}.spw-custom-select--is-error .spw-custom-select__container{border-color:var(--spw-colors-states-error-error-300)}.spw-custom-select--large .spw-custom-select__container{height:60px;padding:0 24px;line-height:60px}.spw-custom-select--is-opened .spw-custom-select__container{height:auto;line-height:1;min-height:40px;border-radius:4px 4px 0 0;border-bottom-color:transparent}.spw-custom-select__selected{flex:1;padding-right:30px;max-width:100%}.spw-custom-select__selected-item{display:inline-flex;align-items:center;gap:6px;color:var(--spw-color-themes-grey-grey-900);border:1px solid var(--spw-color-themes-grey-grey-900);background:var(--spw-color-themes-grey-grey-200);line-height:24px;height:24px;padding:0 8px;margin:4px 6px 2px 0;border-radius:999px;font-size:14px;user-select:none}.spw-custom-select__selected-items{flex:1;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.spw-custom-select--is-opened .spw-custom-select__selected-items{padding-top:3px;padding-bottom:4px;overflow:visible;text-overflow:initial;text-wrap:initial}.spw-custom-select__arrow{position:absolute;right:12px;top:10px;font-size:16px;color:var(--spw-color-themes-grey-grey-600);pointer-events:none}.spw-custom-select__wrapper{position:relative}.spw-custom-select--is-opened .spw-custom-select__search{position:absolute;top:0;left:0;z-index:11;width:100%;margin-top:1px}.spw-custom-select--has-value.spw-custom-select--is-opened .spw-custom-select__search{top:auto;top:100%;margin-top:-3px}.spw-custom-select__search-input{padding:0;height:38px;line-height:40px;border:none;margin:0;width:calc(100% - 30px);text-overflow:ellipsis}.spw-custom-select__search-input:focus{outline:none}.spw-custom-select--is-opened .spw-custom-select__search-input{border-left:1px solid var(--spw-color-themes-grey-grey-800);padding:0 12px}.spw-custom-select--is-opened.spw-custom-select--has-value .spw-custom-select__search-input{border-right:1px solid var(--spw-color-themes-grey-grey-800);width:100%}.spw-custom-select__options{position:absolute;width:100%;background-color:#fff;border:1px solid var(--spw-color-themes-grey-grey-800);border-radius:0 0 4px 4px;max-height:200px;overflow-y:auto;z-index:12}.spw-custom-select__options--down{top:100%;transform:translateY(0)}.spw-custom-select__options--up{top:100%;transform:translateY(0)}.spw-custom-select--has-value.spw-custom-select--is-opened:not(.spw-custom-select--not-searchable) .spw-custom-select__options{margin-top:35px}.spw-custom-select__no-results{padding:12px;cursor:not-allowed;color:var(--spw-color-themes-grey-grey-600)}.spw-custom-select__option{border-bottom:1px solid var(--spw-color-themes-grey-grey-900);padding:12px;cursor:pointer}.spw-custom-select__option:hover{background-color:var(--spw-color-themes-grey-grey-200)}.spw-custom-select__option:last-child{border-bottom:none}.spw-custom-select__option--selected{font-weight:700}.spw-custom-select__option--disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.spw-custom-select__option--disabled:hover{background-color:transparent}.spw-custom-select__error{display:block;font-size:12px;color:var(--spw-color-themes-grey-grey-600);margin-top:8px}.spw-custom-select__option--focused{background-color:var(--spw-color-themes-grey-grey-300)}'}},[65,"spw-custom-select",{value:[1544],label:[1],placeholder:[1],disabled:[4],name:[1],required:[4],items:[1],size:[1],multiple:[4],isSearch:[4,"is-search"],assistiveText:[1,"assistive-text"],error:[1],hint:[1],success:[1],warning:[1],showErrorIcon:[4,"show-error-icon"],showHintIcon:[4,"show-hint-icon"],showSuccessIcon:[4,"show-success-icon"],showWarningIcon:[4,"show-warning-icon"],internalValue:[32],isOpen:[32],parsedOptions:[32],focusedOptionIndex:[32],searchText:[32],dropdownDirection:[32],hasSelectedValue:[32],resetSelect:[64],setValue:[64],getValue:[64]},void 0,{items:[{parseOptions:0}],value:[{valueChangedHandler:0}],internalValue:[{internalValueChanged:0}]}]),h=l,p=function(){"undefined"!=typeof customElements&&["spw-custom-select","spw-checkbox","spw-field-label","spw-field-message","spw-icon"].forEach((e=>{switch(e){case"spw-custom-select":customElements.get(o(e))||customElements.define(o(e),l);break;case"spw-checkbox":customElements.get(o(e))||n();break;case"spw-field-label":customElements.get(o(e))||c();break;case"spw-field-message":customElements.get(o(e))||r();break;case"spw-icon":customElements.get(o(e))||a()}}))};export{h as SpwCustomSelect,p as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as i,c as s,h as t,t as o}from"./index.js";import{a}from"./p-BBi01mKM.js";import{d as r}from"./p-CZVOV-PN.js";import{d as n}from"./p-Dzw3OiMu.js";import{d as l}from"./p-7EG4w8ub.js";const p=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.spwFileChange=s(this,"spwFileChange",7),this.internals=this.attachInternals(),this.disabled=!1,this.error=!1,this.enableDropZone=!1,this.multiple=!1,this.accept="",this.maxFileSize=100,this.maxFiles=1/0,this.selectedFiles=[],this.fileTypeErrors=[],this.fileLimitErrors=[],this.isDragging=!1,this.isMaxFilesReachedExact=!1}componentWillLoad(){this.internalValue=this.value,this.maxFileSize=1024*this.maxFileSize*1024}componentWillUpdate(){this.value!==this.internalValue&&(this.internalValue=this.value)}get isMaxFilesReached(){return this.selectedFiles.length>=this.maxFiles}handleFileChange(e){const i=e.target,s=i.files?Array.from(i.files):[];this.processFiles(s),i.value=""}processFiles(e){this.fileTypeErrors=[],this.fileLimitErrors=[],this.isMaxFilesReachedExact=!1,this.multiple||(this.selectedFiles=[],e=e.slice(0,1));const i=e.filter((e=>{const i=this.isFileAccepted(e),s=this.isFileSizeValid(e);return i||s?i?!!s||(this.fileTypeErrors.push(e.name+" n'a pas été pris en compte car il dépasse la taille maximale autorisée."),!1):(this.fileTypeErrors.push(e.name+" n'a pas été pris en compte car le format n'est pas autorisé."),!1):(this.fileTypeErrors.push(e.name+" n’a pas été pris en compte car le format n’est pas autorisé et la limite de poids est dépassée."),!1)}));if(this.selectedFiles.length+i.length>=this.maxFiles){const e=this.maxFiles-this.selectedFiles.length;this.selectedFiles.length+i.length===this.maxFiles?(this.isMaxFilesReachedExact=!0,this.fileLimitErrors.push("Vous avez atteint la limite autorisée de fichiers.")):(i.splice(e),this.fileLimitErrors.push(`Vous ne pouvez pas télécharger plus de ${this.maxFiles} ${this.maxFiles>1?"fichiers":"fichier"}.`))}this.selectedFiles=[...this.selectedFiles,...i],this.spwFileChange.emit({files:this.selectedFiles}),this.updateFormValue()}isFileAccepted(e){if(!this.accept)return!0;const i=this.accept.split(",").map((e=>e.trim()));return i.includes(e.type)||i.some((i=>e.name.endsWith(i)))}isFileSizeValid(e){return e.size<=this.maxFileSize}updateFormValue(){if(this.selectedFiles.length>0){const e=new FormData;this.selectedFiles.forEach(((i,s)=>{e.append(`${this.name}[${s}]`,i)})),this.internalValue=""+e,this.internals.setFormValue(e)}else this.internalValue="",this.internals.setFormValue(null)}async resetInput(){this.inputElement.value="",this.selectedFiles=[],this.fileLimitErrors=[],this.fileTypeErrors=[],this.updateFormValue()}formResetCallback(){this.resetInput()}handleDragOver(e){e.preventDefault(),this.disabled||!this.enableDropZone||this.isMaxFilesReached||(this.isDragging=!0)}handleDragLeave(){!this.disabled&&this.enableDropZone&&(this.isDragging=!1)}handleDrop(e){var i;if(e.preventDefault(),!this.disabled&&this.enableDropZone&&!this.isMaxFilesReached){this.isDragging=!1;const s=(null===(i=e.dataTransfer)||void 0===i?void 0:i.files)?Array.from(e.dataTransfer.files):[];this.processFiles(s)}}removeFile(e){this.selectedFiles=this.selectedFiles.filter(((i,s)=>s!==e)),this.fileLimitErrors=[],this.updateFormValue(),this.spwFileChange.emit({files:this.selectedFiles})}handleKeydown(e){" "!==e.key&&"Enter"!==e.key||this.isMaxFilesReached||(e.preventDefault(),!this.disabled&&this.inputElement.click())}get elementClass(){return{"spw-file-upload__wrapper":!0,"spw-file-upload__wrapper--disabled":this.disabled||this.isMaxFilesReached,"spw-file-upload__wrapper--error":this.error,"spw-file-upload--has-dropzone":this.enableDropZone,"spw-file-upload--is-dragging":this.isDragging}}get hintsMessages(){const e=this.accept?this.accept:"tous les formats",i=[];let s=`Taille maximale par fichier : ${this.maxFileSize/1048576} Mo`;return s+=this.multiple&&this.maxFiles!==1/0?` - ${this.maxFiles} ${this.maxFiles>1?"fichiers":"fichier"} maximum.`:".",i.push(s),i.push(`Formats autorisés : ${e}.`),i}render(){const e=this.multiple?"Choisir vos fichiers...":"Choisir votre fichier...",i=this.multiple?"Déposez vos fichiers ici":"Déposez votre fichier ici";return t("div",{key:"196c01c219629f7e3c0b916f3961ac26c4b6ff62",class:this.elementClass,onDragOver:this.handleDragOver.bind(this),onDragLeave:this.handleDragLeave.bind(this),onDrop:this.handleDrop.bind(this)},t("input",{key:"bef05fd986b41b0e113952726eec82aa09c18488",type:"file",ref:e=>this.inputElement=e,onChange:this.handleFileChange.bind(this),name:this.name,multiple:this.multiple,accept:this.accept,style:{display:"none"},disabled:this.isMaxFilesReached}),this.enableDropZone?t("div",{tabindex:this.disabled||this.isMaxFilesReached?-1:0,onKeyDown:this.handleKeydown.bind(this),onClick:()=>!this.disabled&&!this.isMaxFilesReached&&this.inputElement.click(),class:"spw-file-upload__dropzone"},i," ou ",t("span",{class:"spw-file-upload__dropzone-link"},"choisissez sur votre ordinateur...")):t("spw-button",{variant:"secondary",onClick:()=>!this.disabled&&!this.isMaxFilesReached&&this.inputElement.click(),disabled:this.disabled||this.isMaxFilesReached},e),t("div",{key:"f0247eae6e516ccf4e5d18e67274056427fe22b3",class:"spw-file-upload__hints"},this.hintsMessages.length>0&&t("ul",{key:"6616bb81473149b200e199f3db8a2e29b940dfec"},this.hintsMessages.map(((e,i)=>t("li",{key:i},e))))),t("div",{key:"1680d3f03ec73d312bf028069f44c7c8dd614bd3",class:"spw-file-upload__info"},this.selectedFiles.length>0?t("ul",{class:"spw-file-upload__info-list"},this.selectedFiles.map(((e,i)=>t("li",{key:i},t("span",{class:"spw-file-upload__info-list-name"},e.name),t("div",{class:"spw-file-upload__info-list-actions"},t("span",{class:"spw-file-upload__spacing"},a(e.size)),t("a",{class:"spw-file-upload__info-list-delete",href:"#",onClick:e=>{e.preventDefault(),this.removeFile(i)}},"Supprimer")))))):"",this.fileLimitErrors.length>0&&t("ul",{key:"07abd61c8d4fe0644b6ef4699828f718f3df74c7",class:"spw-file-upload__errors "+(this.isMaxFilesReachedExact?"spw-file-upload__errors--warning":"")},this.fileLimitErrors.map(((e,i)=>t("li",{key:i},t("spw-icon",{class:"spw-file-upload__spacing",icon:this.isMaxFilesReachedExact?"fa-circle-exclamation":"fa-warning"}),e)))),this.fileTypeErrors.length>0&&t("ul",{key:"63ad9f2f1894abe7e512d08bebc453001343200a",class:"spw-file-upload__errors"},this.fileTypeErrors.map(((e,i)=>t("li",{key:i},t("spw-icon",{class:"spw-file-upload__spacing",icon:"fa-warning"}),e))))))}static get formAssociated(){return!0}get el(){return this}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-file-upload{display:block;position:relative}.spw-file-upload__spacing{margin-right:8px}.spw-file-upload__wrapper--error{border-color:#ff4d4d;background-color:#ffe6e6}.spw-file-upload__wrapper--dragging{background-color:#e0f7fa;border-color:#00acc1}.spw-file-upload spw-button{display:inline-block;margin-bottom:8px}.spw-file-upload__errors{font-size:14px;color:var(--spw-colors-dark-themes-red-red-500);font-weight:600}.spw-file-upload__errors li{margin-top:16px}.spw-file-upload__errors--warning{color:var(--spw-color-themes-grey-grey-800);font-weight:400}.spw-file-upload__hints{font-size:14px;color:var(--spw-color-themes-grey-grey-600);margin-top:16px}.spw-file-upload__dropzone{cursor:pointer;color:#555;background:var(--spw-colors-dark-themes-blue-grey-blue-grey-50);padding:20px;border-radius:8px;border:1px dashed #333;font-weight:bold;text-align:center}.spw-file-upload__dropzone:not(.spw-file-upload--disabled):hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):focus-visible,.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):active,.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):focus-within{outline:2px solid var(--spw-ds-focus)}.spw-file-upload__dropzone-link{color:var(--spw-ds-primary);text-decoration:underline}.spw-file-upload__dropzone-link:hover{text-decoration:none}.spw-file-upload__wrapper--disabled .spw-file-upload__dropzone-link{color:inherit;text-decoration:none}.spw-file-upload__wrapper--disabled .spw-file-upload__dropzone{cursor:not-allowed;background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-400);border-color:var(--spw-color-themes-grey-grey-300);outline:none !important}.spw-file-upload--is-dragging .spw-file-upload__dropzone{background:var(--spw-colors-dark-themes-blue-grey-blue-grey-200)}.spw-file-upload__info-list{margin-top:16px;border-top:1px solid #eee}.spw-file-upload__info-list li{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;padding:16px 8px;border-bottom:1px solid #eee;color:var(--spw-color-themes-grey-grey-900);font-size:14px}@media (min-width: 768px){.spw-file-upload__info-list li{flex-wrap:nowrap;gap:16px}}.spw-file-upload__info-list-actions{display:flex;gap:8px}@media (min-width: 768px){.spw-file-upload__info-list-actions{gap:16px}}.spw-file-upload__info-list-delete{color:inherit}.spw-file-upload__info-list-delete:hover{text-decoration:none}'}},[65,"spw-file-upload",{disabled:[4],error:[4],name:[1],value:[1],enableDropZone:[4,"enable-drop-zone"],multiple:[4],accept:[1],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],internalValue:[32],selectedFiles:[32],fileTypeErrors:[32],fileLimitErrors:[32],isDragging:[32],isMaxFilesReachedExact:[32],resetInput:[64]}]),d=p,h=function(){"undefined"!=typeof customElements&&["spw-file-upload","spw-button","spw-icon","spw-loading"].forEach((e=>{switch(e){case"spw-file-upload":customElements.get(o(e))||customElements.define(o(e),p);break;case"spw-button":customElements.get(o(e))||r();break;case"spw-icon":customElements.get(o(e))||n();break;case"spw-loading":customElements.get(o(e))||l()}}))};export{d as SpwFileUpload,h as defineCustomElement}
1
+ import{p as e,H as i,c as s,h as t,t as o}from"./index.js";import{a}from"./p-BBi01mKM.js";import{d as r}from"./p-CZVOV-PN.js";import{d as n}from"./p-Dzw3OiMu.js";import{d as l}from"./p-7EG4w8ub.js";const p=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.spwFileChange=s(this,"spwFileChange",7),this.internals=this.attachInternals(),this.disabled=!1,this.error=!1,this.enableDropZone=!1,this.multiple=!1,this.accept="",this.refuse="",this.maxFileSize=100,this.maxFiles=1/0,this.selectedFiles=[],this.fileTypeErrors=[],this.fileLimitErrors=[],this.isDragging=!1,this.isMaxFilesReachedExact=!1}componentWillLoad(){this.internalValue=this.value,this.maxFileSize=1024*this.maxFileSize*1024,this.accept&&this.refuse&&console.warn('spw-file-upload: Vous ne pouvez pas utiliser "accept" et "refuse" en même temps. Seul "accept" sera pris en compte.')}componentWillUpdate(){this.value!==this.internalValue&&(this.internalValue=this.value)}get isMaxFilesReached(){return this.selectedFiles.length>=this.maxFiles}handleFileChange(e){const i=e.target,s=i.files?Array.from(i.files):[];this.processFiles(s),i.value=""}processFiles(e){this.fileTypeErrors=[],this.fileLimitErrors=[],this.isMaxFilesReachedExact=!1,this.multiple||(this.selectedFiles=[],e=e.slice(0,1));const i=e.filter((e=>{const i=this.isFileAccepted(e),s=this.isFileSizeValid(e);return i||s?i?!!s||(this.fileTypeErrors.push(e.name+" n'a pas été pris en compte car il dépasse la taille maximale autorisée."),!1):(this.fileTypeErrors.push(e.name+" n'a pas été pris en compte car le format n'est pas autorisé."),!1):(this.fileTypeErrors.push(e.name+" n’a pas été pris en compte car le format n’est pas autorisé et la limite de poids est dépassée."),!1)}));if(this.selectedFiles.length+i.length>=this.maxFiles){const e=this.maxFiles-this.selectedFiles.length;this.selectedFiles.length+i.length===this.maxFiles?(this.isMaxFilesReachedExact=!0,this.fileLimitErrors.push("Vous avez atteint la limite autorisée de fichiers.")):(i.splice(e),this.fileLimitErrors.push(`Vous ne pouvez pas télécharger plus de ${this.maxFiles} ${this.maxFiles>1?"fichiers":"fichier"}.`))}this.selectedFiles=[...this.selectedFiles,...i],this.spwFileChange.emit({files:this.selectedFiles}),this.updateFormValue()}isFileAccepted(e){if(this.accept&&this.refuse){const i=this.accept.split(",").map((e=>e.trim()));return i.includes(e.type)||i.some((i=>e.name.endsWith(i)))}if(this.accept){const i=this.accept.split(",").map((e=>e.trim()));return i.includes(e.type)||i.some((i=>e.name.endsWith(i)))}if(this.refuse){const i=this.refuse.split(",").map((e=>e.trim()));return!(i.includes(e.type)||i.some((i=>e.name.endsWith(i))))}return!0}isFileSizeValid(e){return e.size<=this.maxFileSize}updateFormValue(){if(this.selectedFiles.length>0){const e=new FormData;this.selectedFiles.forEach(((i,s)=>{e.append(`${this.name}[${s}]`,i)})),this.internalValue=""+e,this.internals.setFormValue(e)}else this.internalValue="",this.internals.setFormValue(null)}async resetInput(){this.inputElement.value="",this.selectedFiles=[],this.fileLimitErrors=[],this.fileTypeErrors=[],this.updateFormValue()}formResetCallback(){this.resetInput()}handleDragOver(e){e.preventDefault(),this.disabled||!this.enableDropZone||this.isMaxFilesReached||(this.isDragging=!0)}handleDragLeave(){!this.disabled&&this.enableDropZone&&(this.isDragging=!1)}handleDrop(e){var i;if(e.preventDefault(),!this.disabled&&this.enableDropZone&&!this.isMaxFilesReached){this.isDragging=!1;const s=(null===(i=e.dataTransfer)||void 0===i?void 0:i.files)?Array.from(e.dataTransfer.files):[];this.processFiles(s)}}removeFile(e){this.selectedFiles=this.selectedFiles.filter(((i,s)=>s!==e)),this.fileLimitErrors=[],this.updateFormValue(),this.spwFileChange.emit({files:this.selectedFiles})}handleKeydown(e){" "!==e.key&&"Enter"!==e.key||this.isMaxFilesReached||(e.preventDefault(),!this.disabled&&this.inputElement.click())}get elementClass(){return{"spw-file-upload__wrapper":!0,"spw-file-upload__wrapper--disabled":this.disabled||this.isMaxFilesReached,"spw-file-upload__wrapper--error":this.error,"spw-file-upload--has-dropzone":this.enableDropZone,"spw-file-upload--is-dragging":this.isDragging}}get hintsMessages(){const e=[];let i=`Taille maximale par fichier : ${this.maxFileSize/1048576} Mo`;return i+=this.multiple&&this.maxFiles!==1/0?` - ${this.maxFiles} ${this.maxFiles>1?"fichiers":"fichier"} maximum.`:".",e.push(i),e.push(this.accept&&this.refuse||this.accept?`Formats autorisés : ${this.accept}.`:this.refuse?`Formats refusés : ${this.refuse}.`:"Formats autorisés : tous les formats."),e}render(){const e=this.multiple?"Choisir vos fichiers...":"Choisir votre fichier...",i=this.multiple?"Déposez vos fichiers ici":"Déposez votre fichier ici";return t("div",{key:"501bc95288cc670462c4545d44db80758195ddda",class:this.elementClass,onDragOver:this.handleDragOver.bind(this),onDragLeave:this.handleDragLeave.bind(this),onDrop:this.handleDrop.bind(this)},t("input",{key:"6bf6586de3919a1f913ad7b371d83d322f6385a3",type:"file",ref:e=>this.inputElement=e,onChange:this.handleFileChange.bind(this),name:this.name,multiple:this.multiple,accept:this.accept,style:{display:"none"},disabled:this.isMaxFilesReached}),this.enableDropZone?t("div",{tabindex:this.disabled||this.isMaxFilesReached?-1:0,onKeyDown:this.handleKeydown.bind(this),onClick:()=>!this.disabled&&!this.isMaxFilesReached&&this.inputElement.click(),class:"spw-file-upload__dropzone"},i," ou ",t("span",{class:"spw-file-upload__dropzone-link"},"choisissez sur votre ordinateur...")):t("spw-button",{variant:"secondary",onClick:()=>!this.disabled&&!this.isMaxFilesReached&&this.inputElement.click(),disabled:this.disabled||this.isMaxFilesReached},e),t("div",{key:"082e5f3f10f27b6435dcf47b5688d03b42d034f5",class:"spw-file-upload__hints"},this.hintsMessages.length>0&&t("ul",{key:"62495fffa5ee797c7787535af7c349e18a3076b5"},this.hintsMessages.map(((e,i)=>t("li",{key:i},e))))),t("div",{key:"d21de5e0f796829746ae8d3dc981e3150219f72e",class:"spw-file-upload__info"},this.selectedFiles.length>0?t("ul",{class:"spw-file-upload__info-list"},this.selectedFiles.map(((e,i)=>t("li",{key:i},t("span",{class:"spw-file-upload__info-list-name"},e.name),t("div",{class:"spw-file-upload__info-list-actions"},t("span",{class:"spw-file-upload__spacing"},a(e.size)),t("a",{class:"spw-file-upload__info-list-delete",href:"#",onClick:e=>{e.preventDefault(),this.removeFile(i)}},"Supprimer")))))):"",this.fileLimitErrors.length>0&&t("ul",{key:"7b4415ba4316aec17e08d91a6057505877686c2e",class:"spw-file-upload__errors "+(this.isMaxFilesReachedExact?"spw-file-upload__errors--warning":"")},this.fileLimitErrors.map(((e,i)=>t("li",{key:i},t("spw-icon",{class:"spw-file-upload__spacing",icon:this.isMaxFilesReachedExact?"fa-circle-exclamation":"fa-warning"}),e)))),this.fileTypeErrors.length>0&&t("ul",{key:"0372034644a7a3158dc32933f8e431e487543d9a",class:"spw-file-upload__errors"},this.fileTypeErrors.map(((e,i)=>t("li",{key:i},t("spw-icon",{class:"spw-file-upload__spacing",icon:"fa-warning"}),e))))))}static get formAssociated(){return!0}get el(){return this}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-file-upload{display:block;position:relative}.spw-file-upload__spacing{margin-right:8px}.spw-file-upload__wrapper--error{border-color:#ff4d4d;background-color:#ffe6e6}.spw-file-upload__wrapper--dragging{background-color:#e0f7fa;border-color:#00acc1}.spw-file-upload spw-button{display:inline-block;margin-bottom:8px}.spw-file-upload__errors{font-size:14px;color:var(--spw-colors-dark-themes-red-red-500);font-weight:600}.spw-file-upload__errors li{margin-top:16px}.spw-file-upload__errors--warning{color:var(--spw-color-themes-grey-grey-800);font-weight:400}.spw-file-upload__hints{font-size:14px;color:var(--spw-color-themes-grey-grey-600);margin-top:16px}.spw-file-upload__dropzone{cursor:pointer;color:#555;background:var(--spw-colors-dark-themes-blue-grey-blue-grey-50);padding:20px;border-radius:8px;border:1px dashed #333;font-weight:bold;text-align:center}.spw-file-upload__dropzone:not(.spw-file-upload--disabled):hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):focus-visible,.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):active,.spw-file-upload__dropzone:not(.spw-file-upload__wrapper--disabled):focus-within{outline:2px solid var(--spw-ds-focus)}.spw-file-upload__dropzone-link{color:var(--spw-ds-primary);text-decoration:underline}.spw-file-upload__dropzone-link:hover{text-decoration:none}.spw-file-upload__wrapper--disabled .spw-file-upload__dropzone-link{color:inherit;text-decoration:none}.spw-file-upload__wrapper--disabled .spw-file-upload__dropzone{cursor:not-allowed;background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-400);border-color:var(--spw-color-themes-grey-grey-300);outline:none !important}.spw-file-upload--is-dragging .spw-file-upload__dropzone{background:var(--spw-colors-dark-themes-blue-grey-blue-grey-200)}.spw-file-upload__info-list{margin-top:16px;border-top:1px solid #eee}.spw-file-upload__info-list li{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;padding:16px 8px;border-bottom:1px solid #eee;color:var(--spw-color-themes-grey-grey-900);font-size:14px}@media (min-width: 768px){.spw-file-upload__info-list li{flex-wrap:nowrap;gap:16px}}.spw-file-upload__info-list-actions{display:flex;gap:8px}@media (min-width: 768px){.spw-file-upload__info-list-actions{gap:16px}}.spw-file-upload__info-list-delete{color:inherit}.spw-file-upload__info-list-delete:hover{text-decoration:none}'}},[65,"spw-file-upload",{disabled:[4],error:[4],name:[1],value:[1],enableDropZone:[4,"enable-drop-zone"],multiple:[4],accept:[1],refuse:[1],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],internalValue:[32],selectedFiles:[32],fileTypeErrors:[32],fileLimitErrors:[32],isDragging:[32],isMaxFilesReachedExact:[32],resetInput:[64]}]),d=p,h=function(){"undefined"!=typeof customElements&&["spw-file-upload","spw-button","spw-icon","spw-loading"].forEach((e=>{switch(e){case"spw-file-upload":customElements.get(o(e))||customElements.define(o(e),p);break;case"spw-button":customElements.get(o(e))||r();break;case"spw-icon":customElements.get(o(e))||n();break;case"spw-loading":customElements.get(o(e))||l()}}))};export{d as SpwFileUpload,h as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as i,h as e,a as s,t as o}from"./index.js";const a=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}componentDidLoad(){this.el.closest("spw-mosaic").addEventListener("mosaicConfigurationChanged",this.handleConfigurationChange.bind(this))}disconnectedCallback(){this.el.closest("spw-mosaic").removeEventListener("mosaicConfigurationChanged",this.handleConfigurationChange.bind(this))}handleConfigurationChange(t){const{colsMobile:i,colsTablet:e,colsDesktop:s}=t.detail;this.el.style.setProperty("--spw-mosaic-item-width-mobile",`calc(100% / ${i})`),this.el.style.setProperty("--spw-mosaic-item-width-tablet",`calc(100% / ${e})`),this.el.style.setProperty("--spw-mosaic-item-width-desktop",`calc(100% / ${s})`)}render(){return e(s,{key:"9d7ac5809bee8a8ecf58bdee19a341eaffd217ef"},e("slot",{key:"9adf812c99dc0ffcd918327672027395fc3db797"}))}get el(){return this}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{--spw-mosaic-item-width-mobile:100%;--spw-mosaic-item-width-tablet:100%;--spw-mosaic-item-width-desktop:100%;width:var(--spw-mosaic-item-width-mobile);padding:0 12px;margin-bottom:24px}@media (min-width: 768px){:host{width:var(--spw-mosaic-item-width-tablet)}}@media (min-width: 1024px){:host{width:var(--spw-mosaic-item-width-desktop)}}.spw-mobile-1{--spw-mosaic-item-width-mobile:calc(100% / 1)}.spw-tablet-1{--spw-mosaic-item-width-tablet:calc(100% / 1)}.spw-desktop-1{--spw-mosaic-item-width-desktop:calc(100% / 1)}.spw-mobile-2{--spw-mosaic-item-width-mobile:calc(100% / 2)}.spw-tablet-2{--spw-mosaic-item-width-tablet:calc(100% / 2)}.spw-desktop-2{--spw-mosaic-item-width-desktop:calc(100% / 2)}.spw-mobile-3{--spw-mosaic-item-width-mobile:calc(100% / 3)}.spw-tablet-3{--spw-mosaic-item-width-tablet:calc(100% / 3)}.spw-desktop-3{--spw-mosaic-item-width-desktop:calc(100% / 3)}.spw-mobile-4{--spw-mosaic-item-width-mobile:calc(100% / 4)}.spw-tablet-4{--spw-mosaic-item-width-tablet:calc(100% / 4)}.spw-desktop-4{--spw-mosaic-item-width-desktop:calc(100% / 4)}.spw-mobile-5{--spw-mosaic-item-width-mobile:calc(100% / 5)}.spw-tablet-5{--spw-mosaic-item-width-tablet:calc(100% / 5)}.spw-desktop-5{--spw-mosaic-item-width-desktop:calc(100% / 5)}.spw-mobile-6{--spw-mosaic-item-width-mobile:calc(100% / 6)}.spw-tablet-6{--spw-mosaic-item-width-tablet:calc(100% / 6)}.spw-desktop-6{--spw-mosaic-item-width-desktop:calc(100% / 6)}.spw-mobile-7{--spw-mosaic-item-width-mobile:calc(100% / 7)}.spw-tablet-7{--spw-mosaic-item-width-tablet:calc(100% / 7)}.spw-desktop-7{--spw-mosaic-item-width-desktop:calc(100% / 7)}.spw-mobile-8{--spw-mosaic-item-width-mobile:calc(100% / 8)}.spw-tablet-8{--spw-mosaic-item-width-tablet:calc(100% / 8)}.spw-desktop-8{--spw-mosaic-item-width-desktop:calc(100% / 8)}.spw-mobile-9{--spw-mosaic-item-width-mobile:calc(100% / 9)}.spw-tablet-9{--spw-mosaic-item-width-tablet:calc(100% / 9)}.spw-desktop-9{--spw-mosaic-item-width-desktop:calc(100% / 9)}.spw-mobile-10{--spw-mosaic-item-width-mobile:calc(100% / 10)}.spw-tablet-10{--spw-mosaic-item-width-tablet:calc(100% / 10)}.spw-desktop-10{--spw-mosaic-item-width-desktop:calc(100% / 10)}.spw-mobile-11{--spw-mosaic-item-width-mobile:calc(100% / 11)}.spw-tablet-11{--spw-mosaic-item-width-tablet:calc(100% / 11)}.spw-desktop-11{--spw-mosaic-item-width-desktop:calc(100% / 11)}.spw-mobile-12{--spw-mosaic-item-width-mobile:calc(100% / 12)}.spw-tablet-12{--spw-mosaic-item-width-tablet:calc(100% / 12)}.spw-desktop-12{--spw-mosaic-item-width-desktop:calc(100% / 12)}'}},[257,"spw-mosaic-item"]),m=a,p=function(){"undefined"!=typeof customElements&&["spw-mosaic-item"].forEach((t=>{"spw-mosaic-item"===t&&(customElements.get(o(t))||customElements.define(o(t),a))}))};export{m as SpwMosaicItem,p as defineCustomElement}
1
+ import{p as t,H as i,h as e,a as s,t as o}from"./index.js";const a=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.parentColsMobile=1,this.parentColsTablet=2,this.parentColsDesktop=3}componentDidLoad(){var t;null===(t=this.el.closest("spw-mosaic"))||void 0===t||t.addEventListener("mosaicConfigurationChanged",this.handleConfigurationChange.bind(this)),this.applyColSpans()}disconnectedCallback(){var t;null===(t=this.el.closest("spw-mosaic"))||void 0===t||t.removeEventListener("mosaicConfigurationChanged",this.handleConfigurationChange.bind(this))}colSpanChanged(){this.applyColSpans()}handleConfigurationChange(t){const{colsMobile:i,colsTablet:e,colsDesktop:s}=t.detail;this.parentColsMobile=i,this.parentColsTablet=e,this.parentColsDesktop=s,this.applyColSpans()}applyColSpans(){this.el.style.setProperty("--spw-mosaic-item-width-mobile",this.colSpanMobile?`calc(100% / ${this.parentColsMobile} * ${this.colSpanMobile})`:`calc(100% / ${this.parentColsMobile})`),this.el.style.setProperty("--spw-mosaic-item-width-tablet",this.colSpanTablet?`calc(100% / ${this.parentColsTablet} * ${this.colSpanTablet})`:`calc(100% / ${this.parentColsTablet})`),this.el.style.setProperty("--spw-mosaic-item-width-desktop",this.colSpanDesktop?`calc(100% / ${this.parentColsDesktop} * ${this.colSpanDesktop})`:`calc(100% / ${this.parentColsDesktop})`)}render(){return e(s,{key:"c63e3ce803e887c548341162f7a890bfd1a315c4"},e("slot",{key:"b57cee581ed137ca253db8790b40a8e2ba28a201"}))}get el(){return this}static get watchers(){return{colSpanMobile:[{colSpanChanged:0}],colSpanTablet:[{colSpanChanged:0}],colSpanDesktop:[{colSpanChanged:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{--spw-mosaic-item-width-mobile:100%;--spw-mosaic-item-width-tablet:100%;--spw-mosaic-item-width-desktop:100%;width:var(--spw-mosaic-item-width-mobile);padding:0 12px;margin-bottom:24px}@media (min-width: 768px){:host{width:var(--spw-mosaic-item-width-tablet)}}@media (min-width: 1024px){:host{width:var(--spw-mosaic-item-width-desktop)}}.spw-mobile-1{--spw-mosaic-item-width-mobile:calc(100% / 1)}.spw-tablet-1{--spw-mosaic-item-width-tablet:calc(100% / 1)}.spw-desktop-1{--spw-mosaic-item-width-desktop:calc(100% / 1)}.spw-mobile-2{--spw-mosaic-item-width-mobile:calc(100% / 2)}.spw-tablet-2{--spw-mosaic-item-width-tablet:calc(100% / 2)}.spw-desktop-2{--spw-mosaic-item-width-desktop:calc(100% / 2)}.spw-mobile-3{--spw-mosaic-item-width-mobile:calc(100% / 3)}.spw-tablet-3{--spw-mosaic-item-width-tablet:calc(100% / 3)}.spw-desktop-3{--spw-mosaic-item-width-desktop:calc(100% / 3)}.spw-mobile-4{--spw-mosaic-item-width-mobile:calc(100% / 4)}.spw-tablet-4{--spw-mosaic-item-width-tablet:calc(100% / 4)}.spw-desktop-4{--spw-mosaic-item-width-desktop:calc(100% / 4)}.spw-mobile-5{--spw-mosaic-item-width-mobile:calc(100% / 5)}.spw-tablet-5{--spw-mosaic-item-width-tablet:calc(100% / 5)}.spw-desktop-5{--spw-mosaic-item-width-desktop:calc(100% / 5)}.spw-mobile-6{--spw-mosaic-item-width-mobile:calc(100% / 6)}.spw-tablet-6{--spw-mosaic-item-width-tablet:calc(100% / 6)}.spw-desktop-6{--spw-mosaic-item-width-desktop:calc(100% / 6)}.spw-mobile-7{--spw-mosaic-item-width-mobile:calc(100% / 7)}.spw-tablet-7{--spw-mosaic-item-width-tablet:calc(100% / 7)}.spw-desktop-7{--spw-mosaic-item-width-desktop:calc(100% / 7)}.spw-mobile-8{--spw-mosaic-item-width-mobile:calc(100% / 8)}.spw-tablet-8{--spw-mosaic-item-width-tablet:calc(100% / 8)}.spw-desktop-8{--spw-mosaic-item-width-desktop:calc(100% / 8)}.spw-mobile-9{--spw-mosaic-item-width-mobile:calc(100% / 9)}.spw-tablet-9{--spw-mosaic-item-width-tablet:calc(100% / 9)}.spw-desktop-9{--spw-mosaic-item-width-desktop:calc(100% / 9)}.spw-mobile-10{--spw-mosaic-item-width-mobile:calc(100% / 10)}.spw-tablet-10{--spw-mosaic-item-width-tablet:calc(100% / 10)}.spw-desktop-10{--spw-mosaic-item-width-desktop:calc(100% / 10)}.spw-mobile-11{--spw-mosaic-item-width-mobile:calc(100% / 11)}.spw-tablet-11{--spw-mosaic-item-width-tablet:calc(100% / 11)}.spw-desktop-11{--spw-mosaic-item-width-desktop:calc(100% / 11)}.spw-mobile-12{--spw-mosaic-item-width-mobile:calc(100% / 12)}.spw-tablet-12{--spw-mosaic-item-width-tablet:calc(100% / 12)}.spw-desktop-12{--spw-mosaic-item-width-desktop:calc(100% / 12)}'}},[257,"spw-mosaic-item",{colSpanMobile:[2,"col-span-mobile"],colSpanTablet:[2,"col-span-tablet"],colSpanDesktop:[2,"col-span-desktop"]},void 0,{colSpanMobile:[{colSpanChanged:0}],colSpanTablet:[{colSpanChanged:0}],colSpanDesktop:[{colSpanChanged:0}]}]),p=a,c=function(){"undefined"!=typeof customElements&&["spw-mosaic-item"].forEach((t=>{"spw-mosaic-item"===t&&(customElements.get(o(t))||customElements.define(o(t),a))}))};export{p as SpwMosaicItem,c as defineCustomElement}
@@ -1,18 +1,18 @@
1
- import{p as t,H as i,h as n,a as s,t as o}from"./index.js";import{g as e}from"./p-B85MJLTf.js";var r,h={exports:{}},a={exports:{}},u={exports:{}},c=u.exports;function f(){return r||(r=1,function(t){!function(i,n){t.exports?t.exports=n():i.EvEmitter=n()}("undefined"!=typeof window?window:c,(function(){function t(){}var i=t.prototype;return i.on=function(t,i){if(t&&i){var n=this._events=this._events||{},s=n[t]=n[t]||[];return-1==s.indexOf(i)&&s.push(i),this}},i.once=function(t,i){if(t&&i){this.on(t,i);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[i]=!0,this}},i.off=function(t,i){var n=this._events&&this._events[t];if(n&&n.length){var s=n.indexOf(i);return-1!=s&&n.splice(s,1),this}},i.emitEvent=function(t,i){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),i=i||[];for(var s=this._onceEvents&&this._onceEvents[t],o=0;o<n.length;o++){var e=n[o];s&&s[e]&&(this.off(t,e),delete s[e]),e.apply(this,i)}return this}},i.allOff=function(){delete this._events,delete this._onceEvents},t}))}(u)),u.exports}var d,l={exports:{}};
1
+ import{p as t,H as i,h as n,a as s,t as o}from"./index.js";import{g as e}from"./p-B85MJLTf.js";var r,h={exports:{}},a={exports:{}},u={exports:{}},f=u.exports;function c(){return r||(r=1,function(t){!function(i,n){t.exports?t.exports=n():i.EvEmitter=n()}("undefined"!=typeof window?window:f,(function(){function t(){}var i=t.prototype;return i.on=function(t,i){if(t&&i){var n=this._events=this._events||{},s=n[t]=n[t]||[];return-1==s.indexOf(i)&&s.push(i),this}},i.once=function(t,i){if(t&&i){this.on(t,i);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[i]=!0,this}},i.off=function(t,i){var n=this._events&&this._events[t];if(n&&n.length){var s=n.indexOf(i);return-1!=s&&n.splice(s,1),this}},i.emitEvent=function(t,i){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),i=i||[];for(var s=this._onceEvents&&this._onceEvents[t],o=0;o<n.length;o++){var e=n[o];s&&s[e]&&(this.off(t,e),delete s[e]),e.apply(this,i)}return this}},i.allOff=function(){delete this._events,delete this._onceEvents},t}))}(u)),u.exports}var d,l={exports:{}};
2
2
  /*!
3
3
  * getSize v2.0.3
4
4
  * measure size of elements
5
5
  * MIT license
6
- */function p(){return d||(d=1,function(t){!function(i,n){t.exports?t.exports=n():i.getSize=n()}(window,(function(){function t(t){var i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}var i=void 0===console?function(){}:function(t){console.error(t)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],s=n.length;function o(t){var n=getComputedStyle(t);return n||i("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var e,r=!1;return function i(h){if(function(){if(!r){r=!0;var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style.boxSizing="border-box";var s=document.body||document.documentElement;s.appendChild(n);var h=o(n);e=200==Math.round(t(h.width)),i.isBoxSizeOuter=e,s.removeChild(n)}}(),"string"==typeof h&&(h=document.querySelector(h)),h&&"object"==typeof h&&h.nodeType){var a=o(h);if("none"==a.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i<s;i++)t[n[i]]=0;return t}();var u={};u.width=h.offsetWidth,u.height=h.offsetHeight;for(var c=u.isBorderBox="border-box"==a.boxSizing,f=0;f<s;f++){var d=n[f],l=parseFloat(a[d]);u[d]=isNaN(l)?0:l}var p=u.paddingLeft+u.paddingRight,m=u.paddingTop+u.paddingBottom,v=u.marginLeft+u.marginRight,g=u.marginTop+u.marginBottom,b=u.borderLeftWidth+u.borderRightWidth,y=u.borderTopWidth+u.borderBottomWidth,w=c&&e,x=t(a.width);!1!==x&&(u.width=x+(w?0:p+b));var z=t(a.height);return!1!==z&&(u.height=z+(w?0:m+y)),u.innerWidth=u.width-(p+b),u.innerHeight=u.height-(m+y),u.outerWidth=u.width+v,u.outerHeight=u.height+g,u}}}))}(l)),l.exports}var m,v,g={exports:{}},b={exports:{}};function y(){return m||(m=1,function(t){!function(i,n){t.exports?t.exports=n():i.matchesSelector=n()}(window,(function(){var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var i=["webkit","moz","ms","o"],n=0;n<4;n++){var s=i[n]+"MatchesSelector";if(t[s])return s}}();return function(i,n){return i[t](n)}}))}(b)),b.exports}function w(){return v||(v=1,function(t){!function(i,n){t.exports?t.exports=n(i,y()):i.fizzyUIUtils=n(i,i.matchesSelector)}(window,(function(t,i){var n={extend:function(t,i){for(var n in i)t[n]=i[n];return t},modulo:function(t,i){return(t%i+i)%i}},s=Array.prototype.slice;n.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?s.call(t):[t]},n.removeFrom=function(t,i){var n=t.indexOf(i);-1!=n&&t.splice(n,1)},n.getParent=function(t,n){for(;t.parentNode&&t!=document.body;)if(i(t=t.parentNode,n))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},n.filterFindElements=function(t,s){t=n.makeArray(t);var o=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(s){i(t,s)&&o.push(t);for(var n=t.querySelectorAll(s),e=0;e<n.length;e++)o.push(n[e])}else o.push(t)})),o},n.debounceMethod=function(t,i,n){n=n||100;var s=t.prototype[i],o=i+"Timeout";t.prototype[i]=function(){clearTimeout(this[o]);var t=arguments,i=this;this[o]=setTimeout((function(){s.apply(i,t),delete i[o]}),n)}},n.docReady=function(t){var i=document.readyState;"complete"==i||"interactive"==i?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},n.toDashed=function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,n){return i+"-"+n})).toLowerCase()};var o=t.console;return n.htmlInit=function(i,s){n.docReady((function(){var e=n.toDashed(s),r="data-"+e,h=document.querySelectorAll("["+r+"]"),a=document.querySelectorAll(".js-"+e),u=n.makeArray(h).concat(n.makeArray(a)),c=r+"-options",f=t.jQuery;u.forEach((function(t){var n,e=t.getAttribute(r)||t.getAttribute(c);try{n=e&&JSON.parse(e)}catch(i){return void(o&&o.error("Error parsing "+r+" on "+t.className+": "+i))}var h=new i(t,n);f&&f.data(t,s,h)}))}))},n}))}(g)),g.exports}var x,z,M,C={exports:{}};function k(){return x||(x=1,function(t){!function(i,n){t.exports?t.exports=n(f(),p()):(i.Outlayer={},i.Outlayer.Item=n(i.EvEmitter,i.getSize))}(window,(function(t,i){var n=document.documentElement.style,s="string"==typeof n.transition?"transition":"WebkitTransition",o="string"==typeof n.transform?"transform":"WebkitTransform",e={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],r={transform:o,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"};function h(t,i){t&&(this.element=t,this.layout=i,this.position={x:0,y:0},this._create())}var a=h.prototype=Object.create(t.prototype);a.constructor=h,a._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},a.getSize=function(){this.size=i(this.element)},a.css=function(t){var i=this.element.style;for(var n in t)i[r[n]||n]=t[n]},a.getPosition=function(){var t=getComputedStyle(this.element),i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),s=t[i?"left":"right"],o=t[n?"top":"bottom"],e=parseFloat(s),r=parseFloat(o),h=this.layout.size;-1!=s.indexOf("%")&&(e=e/100*h.width),-1!=o.indexOf("%")&&(r=r/100*h.height),e=isNaN(e)?0:e,r=isNaN(r)?0:r,r-=n?h.paddingTop:h.paddingBottom,this.position.x=e-=i?h.paddingLeft:h.paddingRight,this.position.y=r},a.layoutPosition=function(){var t=this.layout.size,i={},n=this.layout._getOption("originLeft"),s=this.layout._getOption("originTop"),o=n?"right":"left";i[n?"left":"right"]=this.getXValue(this.position.x+t[n?"paddingLeft":"paddingRight"]),i[o]="";var e=s?"bottom":"top";i[s?"top":"bottom"]=this.getYValue(this.position.y+t[s?"paddingTop":"paddingBottom"]),i[e]="",this.css(i),this.emitEvent("layout",[this])},a.getXValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!i?t/this.layout.size.width*100+"%":t+"px"},a.getYValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&i?t/this.layout.size.height*100+"%":t+"px"},a._transitionTo=function(t,i){this.getPosition();var n=this.position.x,s=this.position.y,o=t==this.position.x&&i==this.position.y;if(this.setPosition(t,i),!o||this.isTransitioning){var e={};e.transform=this.getTranslate(t-n,i-s),this.transition({to:e,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},a.getTranslate=function(t,i){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(i=this.layout._getOption("originTop")?i:-i)+"px, 0)"},a.goTo=function(t,i){this.setPosition(t,i),this.layoutPosition()},a.moveTo=a._transitionTo,a.setPosition=function(t,i){this.position.x=parseFloat(t),this.position.y=parseFloat(i)},a._nonTransition=function(t){for(var i in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[i].call(this)},a.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var i=this._transn;for(var n in t.onTransitionEnd)i.onEnd[n]=t.onTransitionEnd[n];for(n in t.to)i.ingProperties[n]=!0,t.isCleaning&&(i.clean[n]=!0);t.from&&this.css(t.from),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var u="opacity,"+function(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}(o);a.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;this.css({transitionProperty:u,transitionDuration:t="number"==typeof t?t+"ms":t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(e,this,!1)}},a.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};a.ontransitionend=function(t){if(t.target===this.element){var i=this._transn,n=c[t.propertyName]||t.propertyName;delete i.ingProperties[n],function(t){for(var i in t)return!1;return!0}(i.ingProperties)&&this.disableTransition(),n in i.clean&&(this.element.style[t.propertyName]="",delete i.clean[n]),n in i.onEnd&&(i.onEnd[n].call(this),delete i.onEnd[n]),this.emitEvent("transitionEnd",[this])}},a.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(e,this,!1),this.isTransitioning=!1},a._removeStyles=function(t){var i={};for(var n in t)i[n]="";this.css(i)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return a.removeTransitionStyles=function(){this.css(f)},a.stagger=function(t){this.staggerDelay=(t=isNaN(t)?0:t)+"ms"},a.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},a.remove=function(){s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},a.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:i})},a.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},a.getHideRevealTransitionEndProperty=function(t){var i=this.layout.options[t];if(i.opacity)return"opacity";for(var n in i)return n},a.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:i})},a.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},a.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}))}(C)),C.exports}
6
+ */function p(){return d||(d=1,function(t){!function(i,n){t.exports?t.exports=n():i.getSize=n()}(window,(function(){function t(t){var i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}var i=void 0===console?function(){}:function(t){console.error(t)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],s=n.length;function o(t){var n=getComputedStyle(t);return n||i("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var e,r=!1;return function i(h){if(function(){if(!r){r=!0;var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style.boxSizing="border-box";var s=document.body||document.documentElement;s.appendChild(n);var h=o(n);e=200==Math.round(t(h.width)),i.isBoxSizeOuter=e,s.removeChild(n)}}(),"string"==typeof h&&(h=document.querySelector(h)),h&&"object"==typeof h&&h.nodeType){var a=o(h);if("none"==a.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i<s;i++)t[n[i]]=0;return t}();var u={};u.width=h.offsetWidth,u.height=h.offsetHeight;for(var f=u.isBorderBox="border-box"==a.boxSizing,c=0;c<s;c++){var d=n[c],l=parseFloat(a[d]);u[d]=isNaN(l)?0:l}var p=u.paddingLeft+u.paddingRight,m=u.paddingTop+u.paddingBottom,v=u.marginLeft+u.marginRight,g=u.marginTop+u.marginBottom,b=u.borderLeftWidth+u.borderRightWidth,y=u.borderTopWidth+u.borderBottomWidth,w=f&&e,x=t(a.width);!1!==x&&(u.width=x+(w?0:p+b));var z=t(a.height);return!1!==z&&(u.height=z+(w?0:m+y)),u.innerWidth=u.width-(p+b),u.innerHeight=u.height-(m+y),u.outerWidth=u.width+v,u.outerHeight=u.height+g,u}}}))}(l)),l.exports}var m,v,g={exports:{}},b={exports:{}};function y(){return m||(m=1,function(t){!function(i,n){t.exports?t.exports=n():i.matchesSelector=n()}(window,(function(){var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var i=["webkit","moz","ms","o"],n=0;n<4;n++){var s=i[n]+"MatchesSelector";if(t[s])return s}}();return function(i,n){return i[t](n)}}))}(b)),b.exports}function w(){return v||(v=1,function(t){!function(i,n){t.exports?t.exports=n(i,y()):i.fizzyUIUtils=n(i,i.matchesSelector)}(window,(function(t,i){var n={extend:function(t,i){for(var n in i)t[n]=i[n];return t},modulo:function(t,i){return(t%i+i)%i}},s=Array.prototype.slice;n.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?s.call(t):[t]},n.removeFrom=function(t,i){var n=t.indexOf(i);-1!=n&&t.splice(n,1)},n.getParent=function(t,n){for(;t.parentNode&&t!=document.body;)if(i(t=t.parentNode,n))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},n.filterFindElements=function(t,s){t=n.makeArray(t);var o=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(s){i(t,s)&&o.push(t);for(var n=t.querySelectorAll(s),e=0;e<n.length;e++)o.push(n[e])}else o.push(t)})),o},n.debounceMethod=function(t,i,n){n=n||100;var s=t.prototype[i],o=i+"Timeout";t.prototype[i]=function(){clearTimeout(this[o]);var t=arguments,i=this;this[o]=setTimeout((function(){s.apply(i,t),delete i[o]}),n)}},n.docReady=function(t){var i=document.readyState;"complete"==i||"interactive"==i?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},n.toDashed=function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,n){return i+"-"+n})).toLowerCase()};var o=t.console;return n.htmlInit=function(i,s){n.docReady((function(){var e=n.toDashed(s),r="data-"+e,h=document.querySelectorAll("["+r+"]"),a=document.querySelectorAll(".js-"+e),u=n.makeArray(h).concat(n.makeArray(a)),f=r+"-options",c=t.jQuery;u.forEach((function(t){var n,e=t.getAttribute(r)||t.getAttribute(f);try{n=e&&JSON.parse(e)}catch(i){return void(o&&o.error("Error parsing "+r+" on "+t.className+": "+i))}var h=new i(t,n);c&&c.data(t,s,h)}))}))},n}))}(g)),g.exports}var x,z,M,k={exports:{}};function C(){return x||(x=1,function(t){!function(i,n){t.exports?t.exports=n(c(),p()):(i.Outlayer={},i.Outlayer.Item=n(i.EvEmitter,i.getSize))}(window,(function(t,i){var n=document.documentElement.style,s="string"==typeof n.transition?"transition":"WebkitTransition",o="string"==typeof n.transform?"transform":"WebkitTransform",e={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],r={transform:o,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"};function h(t,i){t&&(this.element=t,this.layout=i,this.position={x:0,y:0},this._create())}var a=h.prototype=Object.create(t.prototype);a.constructor=h,a._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},a.getSize=function(){this.size=i(this.element)},a.css=function(t){var i=this.element.style;for(var n in t)i[r[n]||n]=t[n]},a.getPosition=function(){var t=getComputedStyle(this.element),i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),s=t[i?"left":"right"],o=t[n?"top":"bottom"],e=parseFloat(s),r=parseFloat(o),h=this.layout.size;-1!=s.indexOf("%")&&(e=e/100*h.width),-1!=o.indexOf("%")&&(r=r/100*h.height),e=isNaN(e)?0:e,r=isNaN(r)?0:r,r-=n?h.paddingTop:h.paddingBottom,this.position.x=e-=i?h.paddingLeft:h.paddingRight,this.position.y=r},a.layoutPosition=function(){var t=this.layout.size,i={},n=this.layout._getOption("originLeft"),s=this.layout._getOption("originTop"),o=n?"right":"left";i[n?"left":"right"]=this.getXValue(this.position.x+t[n?"paddingLeft":"paddingRight"]),i[o]="";var e=s?"bottom":"top";i[s?"top":"bottom"]=this.getYValue(this.position.y+t[s?"paddingTop":"paddingBottom"]),i[e]="",this.css(i),this.emitEvent("layout",[this])},a.getXValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!i?t/this.layout.size.width*100+"%":t+"px"},a.getYValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&i?t/this.layout.size.height*100+"%":t+"px"},a._transitionTo=function(t,i){this.getPosition();var n=this.position.x,s=this.position.y,o=t==this.position.x&&i==this.position.y;if(this.setPosition(t,i),!o||this.isTransitioning){var e={};e.transform=this.getTranslate(t-n,i-s),this.transition({to:e,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},a.getTranslate=function(t,i){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(i=this.layout._getOption("originTop")?i:-i)+"px, 0)"},a.goTo=function(t,i){this.setPosition(t,i),this.layoutPosition()},a.moveTo=a._transitionTo,a.setPosition=function(t,i){this.position.x=parseFloat(t),this.position.y=parseFloat(i)},a._nonTransition=function(t){for(var i in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[i].call(this)},a.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var i=this._transn;for(var n in t.onTransitionEnd)i.onEnd[n]=t.onTransitionEnd[n];for(n in t.to)i.ingProperties[n]=!0,t.isCleaning&&(i.clean[n]=!0);t.from&&this.css(t.from),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var u="opacity,"+function(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}(o);a.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;this.css({transitionProperty:u,transitionDuration:t="number"==typeof t?t+"ms":t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(e,this,!1)}},a.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};a.ontransitionend=function(t){if(t.target===this.element){var i=this._transn,n=f[t.propertyName]||t.propertyName;delete i.ingProperties[n],function(t){for(var i in t)return!1;return!0}(i.ingProperties)&&this.disableTransition(),n in i.clean&&(this.element.style[t.propertyName]="",delete i.clean[n]),n in i.onEnd&&(i.onEnd[n].call(this),delete i.onEnd[n]),this.emitEvent("transitionEnd",[this])}},a.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(e,this,!1),this.isTransitioning=!1},a._removeStyles=function(t){var i={};for(var n in t)i[n]="";this.css(i)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return a.removeTransitionStyles=function(){this.css(c)},a.stagger=function(t){this.staggerDelay=(t=isNaN(t)?0:t)+"ms"},a.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},a.remove=function(){s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},a.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:i})},a.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},a.getHideRevealTransitionEndProperty=function(t){var i=this.layout.options[t];if(i.opacity)return"opacity";for(var n in i)return n},a.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:i})},a.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},a.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}))}(k)),k.exports}
7
7
  /*!
8
8
  * Outlayer v2.1.1
9
9
  * the brains and guts of a layout library
10
10
  * MIT license
11
- */function T(){return z||(z=1,function(t){!function(i,n){t.exports?t.exports=n(i,f(),p(),w(),k()):i.Outlayer=n(i,i.EvEmitter,i.getSize,i.fizzyUIUtils,i.Outlayer.Item)}(window,(function(t,i,n,s,o){var e=t.console,r=t.jQuery,h=function(){},a=0,u={};function c(t,i){var n=s.getQueryElement(t);if(n){this.element=n,r&&(this.$element=r(this.element)),this.options=s.extend({},this.constructor.defaults),this.option(i);var o=++a;this.element.outlayerGUID=o,u[o]=this,this._create(),this._getOption("initLayout")&&this.layout()}else e&&e.error("Bad element for "+this.constructor.namespace+": "+(n||t))}c.namespace="outlayer",c.Item=o,c.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=c.prototype;function d(t){function i(){t.apply(this,arguments)}return(i.prototype=Object.create(t.prototype)).constructor=i,i}s.extend(f,i.prototype),f.option=function(t){s.extend(this.options,t)},f._getOption=function(t){var i=this.constructor.compatOptions[t];return i&&void 0!==this.options[i]?this.options[i]:this.options[t]},c.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),s.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var i=this._filterFindItemElements(t),n=this.constructor.Item,s=[],o=0;o<i.length;o++){var e=new n(i[o],this);s.push(e)}return s},f._filterFindItemElements=function(t){return s.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map((function(t){return t.element}))},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant");this.layoutItems(this.items,void 0!==t?t:!this._isLayoutInited),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=n(this.element)},f._getMeasurement=function(t,i){var s,o=this.options[t];o?("string"==typeof o?s=this.element.querySelector(o):o instanceof HTMLElement&&(s=o),this[t]=s?n(s)[i]:o):this[t]=0},f.layoutItems=function(t,i){t=this._getItemsForLayout(t),this._layoutItems(t,i),this._postLayout()},f._getItemsForLayout=function(t){return t.filter((function(t){return!t.isIgnored}))},f._layoutItems=function(t,i){if(this._emitCompleteOnItems("layout",t),t&&t.length){var n=[];t.forEach((function(t){var s=this._getItemLayoutPosition(t);s.item=t,s.isInstant=i||t.isLayoutInstant,n.push(s)}),this),this._processLayoutQueue(n)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach((function(t,i){this._positionItem(t.item,t.x,t.y,t.isInstant,i)}),this)},f.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var i=t.match(/(^\d*\.?\d*)(\w*)/),n=i&&i[1],s=i&&i[2];return n.length?(n=parseFloat(n))*(l[s]||1):0}(t),this.stagger;this.stagger=0},f._positionItem=function(t,i,n,s,o){s?t.goTo(i,n):(t.stagger(o*this.stagger),t.moveTo(i,n))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},f._getContainerSize=h,f._setContainerMeasure=function(t,i){if(void 0!==t){var n=this.size;n.isBorderBox&&(t+=i?n.paddingLeft+n.paddingRight+n.borderLeftWidth+n.borderRightWidth:n.paddingBottom+n.paddingTop+n.borderTopWidth+n.borderBottomWidth),this.element.style[i?"width":"height"]=(t=Math.max(t,0))+"px"}},f._emitCompleteOnItems=function(t,i){var n=this;function s(){n.dispatchEvent(t+"Complete",null,[i])}var o=i.length;if(i&&o){var e=0;i.forEach((function(i){i.once(t,r)}))}else s();function r(){++e==o&&s()}},f.dispatchEvent=function(t,i,n){var s=i?[i].concat(n):n;if(this.emitEvent(t,s),r)if(this.$element=this.$element||r(this.element),i){var o=r.Event(i);o.type=t,this.$element.trigger(o,n)}else this.$element.trigger(t,n)},f.ignore=function(t){var i=this.getItem(t);i&&(i.isIgnored=!0)},f.unignore=function(t){var i=this.getItem(t);i&&delete i.isIgnored},f.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){(t=this._find(t))&&t.forEach((function(t){s.removeFrom(this.stamps,t),this.unignore(t)}),this)},f._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),s.makeArray(t)},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),i=this.size;this._boundingRect={left:t.left+i.paddingLeft+i.borderLeftWidth,top:t.top+i.paddingTop+i.borderTopWidth,right:t.right-(i.paddingRight+i.borderRightWidth),bottom:t.bottom-(i.paddingBottom+i.borderBottomWidth)}},f._manageStamp=h,f._getElementOffset=function(t){var i=t.getBoundingClientRect(),s=this._boundingRect,o=n(t);return{left:i.left-s.left-o.marginLeft,top:i.top-s.top-o.marginTop,right:s.right-i.right-o.marginRight,bottom:s.bottom-i.bottom-o.marginBottom}},f.handleEvent=s.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},s.debounceMethod(c,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=n(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var i=this._itemize(t);return i.length&&(this.items=this.items.concat(i)),i},f.appended=function(t){var i=this.addItems(t);i.length&&(this.layoutItems(i,!0),this.reveal(i))},f.prepended=function(t){var i=this._itemize(t);if(i.length){var n=this.items.slice(0);this.items=i.concat(n),this._resetLayout(),this._manageStamps(),this.layoutItems(i,!0),this.reveal(i),this.layoutItems(n)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var i=this.updateStagger();t.forEach((function(t,n){t.stagger(n*i),t.reveal()}))}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var i=this.updateStagger();t.forEach((function(t,n){t.stagger(n*i),t.hide()}))}},f.revealItemElements=function(t){var i=this.getItems(t);this.reveal(i)},f.hideItemElements=function(t){var i=this.getItems(t);this.hide(i)},f.getItem=function(t){for(var i=0;i<this.items.length;i++){var n=this.items[i];if(n.element==t)return n}},f.getItems=function(t){t=s.makeArray(t);var i=[];return t.forEach((function(t){var n=this.getItem(t);n&&i.push(n)}),this),i},f.remove=function(t){var i=this.getItems(t);this._emitCompleteOnItems("remove",i),i&&i.length&&i.forEach((function(t){t.remove(),s.removeFrom(this.items,t)}),this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach((function(t){t.destroy()})),this.unbindResize(),delete u[this.element.outlayerGUID],delete this.element.outlayerGUID,r&&r.removeData(this.element,this.constructor.namespace)},c.data=function(t){var i=(t=s.getQueryElement(t))&&t.outlayerGUID;return i&&u[i]},c.create=function(t,i){var n=d(c);return n.defaults=s.extend({},c.defaults),s.extend(n.defaults,i),n.compatOptions=s.extend({},c.compatOptions),n.namespace=t,n.data=c.data,n.Item=d(o),s.htmlInit(n,t),r&&r.bridget&&r.bridget(t,n),n};var l={ms:1,s:1e3};return c.Item=o,c}))}(a)),a.exports}
11
+ */function T(){return z||(z=1,function(t){!function(i,n){t.exports?t.exports=n(i,c(),p(),w(),C()):i.Outlayer=n(i,i.EvEmitter,i.getSize,i.fizzyUIUtils,i.Outlayer.Item)}(window,(function(t,i,n,s,o){var e=t.console,r=t.jQuery,h=function(){},a=0,u={};function f(t,i){var n=s.getQueryElement(t);if(n){this.element=n,r&&(this.$element=r(this.element)),this.options=s.extend({},this.constructor.defaults),this.option(i);var o=++a;this.element.outlayerGUID=o,u[o]=this,this._create(),this._getOption("initLayout")&&this.layout()}else e&&e.error("Bad element for "+this.constructor.namespace+": "+(n||t))}f.namespace="outlayer",f.Item=o,f.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=f.prototype;function d(t){function i(){t.apply(this,arguments)}return(i.prototype=Object.create(t.prototype)).constructor=i,i}s.extend(c,i.prototype),c.option=function(t){s.extend(this.options,t)},c._getOption=function(t){var i=this.constructor.compatOptions[t];return i&&void 0!==this.options[i]?this.options[i]:this.options[t]},f.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),s.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var i=this._filterFindItemElements(t),n=this.constructor.Item,s=[],o=0;o<i.length;o++){var e=new n(i[o],this);s.push(e)}return s},c._filterFindItemElements=function(t){return s.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map((function(t){return t.element}))},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant");this.layoutItems(this.items,void 0!==t?t:!this._isLayoutInited),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=n(this.element)},c._getMeasurement=function(t,i){var s,o=this.options[t];o?("string"==typeof o?s=this.element.querySelector(o):o instanceof HTMLElement&&(s=o),this[t]=s?n(s)[i]:o):this[t]=0},c.layoutItems=function(t,i){t=this._getItemsForLayout(t),this._layoutItems(t,i),this._postLayout()},c._getItemsForLayout=function(t){return t.filter((function(t){return!t.isIgnored}))},c._layoutItems=function(t,i){if(this._emitCompleteOnItems("layout",t),t&&t.length){var n=[];t.forEach((function(t){var s=this._getItemLayoutPosition(t);s.item=t,s.isInstant=i||t.isLayoutInstant,n.push(s)}),this),this._processLayoutQueue(n)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach((function(t,i){this._positionItem(t.item,t.x,t.y,t.isInstant,i)}),this)},c.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var i=t.match(/(^\d*\.?\d*)(\w*)/),n=i&&i[1],s=i&&i[2];return n.length?(n=parseFloat(n))*(l[s]||1):0}(t),this.stagger;this.stagger=0},c._positionItem=function(t,i,n,s,o){s?t.goTo(i,n):(t.stagger(o*this.stagger),t.moveTo(i,n))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},c._getContainerSize=h,c._setContainerMeasure=function(t,i){if(void 0!==t){var n=this.size;n.isBorderBox&&(t+=i?n.paddingLeft+n.paddingRight+n.borderLeftWidth+n.borderRightWidth:n.paddingBottom+n.paddingTop+n.borderTopWidth+n.borderBottomWidth),this.element.style[i?"width":"height"]=(t=Math.max(t,0))+"px"}},c._emitCompleteOnItems=function(t,i){var n=this;function s(){n.dispatchEvent(t+"Complete",null,[i])}var o=i.length;if(i&&o){var e=0;i.forEach((function(i){i.once(t,r)}))}else s();function r(){++e==o&&s()}},c.dispatchEvent=function(t,i,n){var s=i?[i].concat(n):n;if(this.emitEvent(t,s),r)if(this.$element=this.$element||r(this.element),i){var o=r.Event(i);o.type=t,this.$element.trigger(o,n)}else this.$element.trigger(t,n)},c.ignore=function(t){var i=this.getItem(t);i&&(i.isIgnored=!0)},c.unignore=function(t){var i=this.getItem(t);i&&delete i.isIgnored},c.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){(t=this._find(t))&&t.forEach((function(t){s.removeFrom(this.stamps,t),this.unignore(t)}),this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),s.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),i=this.size;this._boundingRect={left:t.left+i.paddingLeft+i.borderLeftWidth,top:t.top+i.paddingTop+i.borderTopWidth,right:t.right-(i.paddingRight+i.borderRightWidth),bottom:t.bottom-(i.paddingBottom+i.borderBottomWidth)}},c._manageStamp=h,c._getElementOffset=function(t){var i=t.getBoundingClientRect(),s=this._boundingRect,o=n(t);return{left:i.left-s.left-o.marginLeft,top:i.top-s.top-o.marginTop,right:s.right-i.right-o.marginRight,bottom:s.bottom-i.bottom-o.marginBottom}},c.handleEvent=s.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},s.debounceMethod(f,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=n(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var i=this._itemize(t);return i.length&&(this.items=this.items.concat(i)),i},c.appended=function(t){var i=this.addItems(t);i.length&&(this.layoutItems(i,!0),this.reveal(i))},c.prepended=function(t){var i=this._itemize(t);if(i.length){var n=this.items.slice(0);this.items=i.concat(n),this._resetLayout(),this._manageStamps(),this.layoutItems(i,!0),this.reveal(i),this.layoutItems(n)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var i=this.updateStagger();t.forEach((function(t,n){t.stagger(n*i),t.reveal()}))}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var i=this.updateStagger();t.forEach((function(t,n){t.stagger(n*i),t.hide()}))}},c.revealItemElements=function(t){var i=this.getItems(t);this.reveal(i)},c.hideItemElements=function(t){var i=this.getItems(t);this.hide(i)},c.getItem=function(t){for(var i=0;i<this.items.length;i++){var n=this.items[i];if(n.element==t)return n}},c.getItems=function(t){t=s.makeArray(t);var i=[];return t.forEach((function(t){var n=this.getItem(t);n&&i.push(n)}),this),i},c.remove=function(t){var i=this.getItems(t);this._emitCompleteOnItems("remove",i),i&&i.length&&i.forEach((function(t){t.remove(),s.removeFrom(this.items,t)}),this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach((function(t){t.destroy()})),this.unbindResize(),delete u[this.element.outlayerGUID],delete this.element.outlayerGUID,r&&r.removeData(this.element,this.constructor.namespace)},f.data=function(t){var i=(t=s.getQueryElement(t))&&t.outlayerGUID;return i&&u[i]},f.create=function(t,i){var n=d(f);return n.defaults=s.extend({},f.defaults),s.extend(n.defaults,i),n.compatOptions=s.extend({},f.compatOptions),n.namespace=t,n.data=f.data,n.Item=d(o),s.htmlInit(n,t),r&&r.bridget&&r.bridget(t,n),n};var l={ms:1,s:1e3};return f.Item=o,f}))}(a)),a.exports}
12
12
  /*!
13
13
  * Masonry v4.2.2
14
14
  * Cascading grid layout library
15
15
  * https://masonry.desandro.com
16
16
  * MIT License
17
17
  * by David DeSandro
18
- */var L=(M||(M=1,function(t){!function(i,n){t.exports?t.exports=n(T(),p()):i.Masonry=n(i.Outlayer,i.getSize)}(window,(function(t,i){var n=t.create("masonry");n.compatOptions.fitWidth="isFitWidth";var s=n.prototype;return s._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},s.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],n=t&&t.element;this.columnWidth=n&&i(n).outerWidth||this.containerWidth}var s=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,e=o/s,r=s-o%s;e=Math[r&&r<1?"round":"floor"](e),this.cols=Math.max(e,1)},s.getContainerWidth=function(){var t=this._getOption("fitWidth"),n=i(t?this.element.parentNode:this.element);this.containerWidth=n&&n.innerWidth},s._getItemLayoutPosition=function(t){t.getSize();for(var i=t.size.outerWidth%this.columnWidth,n=Math[i&&i<1?"round":"ceil"](t.size.outerWidth/this.columnWidth),s=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](n=Math.min(n,this.cols),t),o={x:this.columnWidth*s.col,y:s.y},e=s.y+t.size.outerHeight,r=n+s.col,h=s.col;h<r;h++)this.colYs[h]=e;return o},s._getTopColPosition=function(t){var i=this._getTopColGroup(t),n=Math.min.apply(Math,i);return{col:i.indexOf(n),y:n}},s._getTopColGroup=function(t){if(t<2)return this.colYs;for(var i=[],n=this.cols+1-t,s=0;s<n;s++)i[s]=this._getColGroupY(s,t);return i},s._getColGroupY=function(t,i){if(i<2)return this.colYs[t];var n=this.colYs.slice(t,t+i);return Math.max.apply(Math,n)},s._getHorizontalColPosition=function(t,i){var n=this.horizontalColIndex%this.cols;return n=t>1&&n+t>this.cols?0:n,this.horizontalColIndex=i.size.outerWidth&&i.size.outerHeight?n+t:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,t)}},s._manageStamp=function(t){var n=i(t),s=this._getElementOffset(t),o=this._getOption("originLeft")?s.left:s.right,e=o+n.outerWidth,r=Math.floor(o/this.columnWidth);r=Math.max(0,r);var h=Math.floor(e/this.columnWidth);h=Math.min(this.cols-1,h-=e%this.columnWidth?0:1);for(var a=(this._getOption("originTop")?s.top:s.bottom)+n.outerHeight,u=r;u<=h;u++)this.colYs[u]=Math.max(a,this.colYs[u])},s._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},s._getContainerFitWidth=function(){for(var t=0,i=this.cols;--i&&0===this.colYs[i];)t++;return(this.cols-t)*this.columnWidth-this.gutter},s.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},n}))}(h)),h.exports),D=e(L);const W=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isMasonry=!1,this.colsMobile=1,this.colsTablet=2,this.colsDesktop=3,this.initialized=!1}itemsChanged(t,i){t!==i&&this.isMasonry&&this.refreshMasonryLayout()}isMasonryChanged(t){t?this.initializeMasonry():this.destroyMasonry()}async waitForImages(){const t=this.el.shadowRoot.querySelectorAll("img"),i=Array.from(t).map((t=>new Promise((i=>{t.complete?i():t.addEventListener("load",(()=>i()),{once:!0})}))));await Promise.all(i)}emitConfigurationChanged(){const t=new CustomEvent("mosaicConfigurationChanged",{detail:{colsMobile:this.colsMobile,colsTablet:this.colsTablet,colsDesktop:this.colsDesktop},bubbles:!0,composed:!0});this.el.dispatchEvent(t)}configurationChanged(){this.emitConfigurationChanged()}async refreshMasonryLayout(){this.isMasonry&&(await this.waitForImages(),this.initializeMasonry())}componentDidLoad(){this.isMasonry&&this.initializeMasonry(),this.observeSlotChanges(),this.emitConfigurationChanged()}componentDidUpdate(){this.isMasonry&&this.refreshMasonryLayout()}disconnectedCallback(){this.destroyMasonry(),this.observer&&this.observer.disconnect()}async initializeMasonry(){this.isMasonry&&requestAnimationFrame((()=>{const t=this.el.shadowRoot.querySelector("slot").assignedElements({flatten:!0});t.length>0&&(this.masonry=new D(this.el,{itemSelector:"spw-mosaic-item",columnWidth:"spw-mosaic-item",percentPosition:!0}),this.initialized=!0,t.forEach((t=>{t.querySelectorAll("img").forEach((t=>{t.complete||t.addEventListener("load",this.updateMasonryLayout.bind(this),{once:!0})}))})))}))}updateMasonryLayout(){this.masonry&&this.initialized&&this.isMasonry&&this.masonry.layout()}destroyMasonry(){this.masonry&&(this.masonry.destroy(),this.masonry=null,this.initialized=!1)}observeSlotChanges(){const t=this.el.shadowRoot.querySelector("slot");this.observer=new MutationObserver((t=>{for(const i of t)"childList"===i.type&&this.initialized&&this.isMasonry&&this.initializeMasonry()})),this.observer.observe(t,{childList:!0})}get elementClass(){return{"spw-mosaic--no-masonry":!this.isMasonry}}render(){return n(s,{key:"315dbce69f6894a93dfea27c215ed6d74c43beb2"},n("div",{key:"7383f3c38c7d90c3995c621824d28d5d8c46d37c",class:this.elementClass},n("slot",{key:"2120301d6e1b24331a49c265c08e0f8f0aefb34c"})))}get el(){return this}static get watchers(){return{items:[{itemsChanged:0}],isMasonry:[{isMasonryChanged:0}],colsMobile:[{configurationChanged:0}],colsTablet:[{configurationChanged:0}],colsDesktop:[{configurationChanged:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block;margin:0 -12px}.spw-mosaic--no-masonry{display:flex;flex-wrap:wrap}'}},[257,"spw-mosaic",{items:[8],isMasonry:[4,"is-masonry"],colsMobile:[2,"cols-mobile"],colsTablet:[2,"cols-tablet"],colsDesktop:[2,"cols-desktop"],initialized:[32],waitForImages:[64],initializeMasonry:[64]},void 0,{items:[{itemsChanged:0}],isMasonry:[{isMasonryChanged:0}],colsMobile:[{configurationChanged:0}],colsTablet:[{configurationChanged:0}],colsDesktop:[{configurationChanged:0}]}]),S=W,E=function(){"undefined"!=typeof customElements&&["spw-mosaic"].forEach((t=>{"spw-mosaic"===t&&(customElements.get(o(t))||customElements.define(o(t),W))}))};export{S as SpwMosaic,E as defineCustomElement}
18
+ */var L=(M||(M=1,function(t){!function(i,n){t.exports?t.exports=n(T(),p()):i.Masonry=n(i.Outlayer,i.getSize)}(window,(function(t,i){var n=t.create("masonry");n.compatOptions.fitWidth="isFitWidth";var s=n.prototype;return s._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},s.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],n=t&&t.element;this.columnWidth=n&&i(n).outerWidth||this.containerWidth}var s=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,e=o/s,r=s-o%s;e=Math[r&&r<1?"round":"floor"](e),this.cols=Math.max(e,1)},s.getContainerWidth=function(){var t=this._getOption("fitWidth"),n=i(t?this.element.parentNode:this.element);this.containerWidth=n&&n.innerWidth},s._getItemLayoutPosition=function(t){t.getSize();for(var i=t.size.outerWidth%this.columnWidth,n=Math[i&&i<1?"round":"ceil"](t.size.outerWidth/this.columnWidth),s=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](n=Math.min(n,this.cols),t),o={x:this.columnWidth*s.col,y:s.y},e=s.y+t.size.outerHeight,r=n+s.col,h=s.col;h<r;h++)this.colYs[h]=e;return o},s._getTopColPosition=function(t){var i=this._getTopColGroup(t),n=Math.min.apply(Math,i);return{col:i.indexOf(n),y:n}},s._getTopColGroup=function(t){if(t<2)return this.colYs;for(var i=[],n=this.cols+1-t,s=0;s<n;s++)i[s]=this._getColGroupY(s,t);return i},s._getColGroupY=function(t,i){if(i<2)return this.colYs[t];var n=this.colYs.slice(t,t+i);return Math.max.apply(Math,n)},s._getHorizontalColPosition=function(t,i){var n=this.horizontalColIndex%this.cols;return n=t>1&&n+t>this.cols?0:n,this.horizontalColIndex=i.size.outerWidth&&i.size.outerHeight?n+t:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,t)}},s._manageStamp=function(t){var n=i(t),s=this._getElementOffset(t),o=this._getOption("originLeft")?s.left:s.right,e=o+n.outerWidth,r=Math.floor(o/this.columnWidth);r=Math.max(0,r);var h=Math.floor(e/this.columnWidth);h=Math.min(this.cols-1,h-=e%this.columnWidth?0:1);for(var a=(this._getOption("originTop")?s.top:s.bottom)+n.outerHeight,u=r;u<=h;u++)this.colYs[u]=Math.max(a,this.colYs[u])},s._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},s._getContainerFitWidth=function(){for(var t=0,i=this.cols;--i&&0===this.colYs[i];)t++;return(this.cols-t)*this.columnWidth-this.gutter},s.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},n}))}(h)),h.exports),D=e(L);const W=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isMasonry=!1,this.colsMobile=1,this.colsTablet=2,this.colsDesktop=3,this.initialized=!1}itemsChanged(t,i){t!==i&&this.isMasonry&&this.refreshMasonryLayout()}isMasonryChanged(t){t?this.initializeMasonry():this.destroyMasonry()}async waitForImages(){const t=this.el.shadowRoot.querySelectorAll("img"),i=Array.from(t).map((t=>new Promise((i=>{t.complete?i():t.addEventListener("load",(()=>i()),{once:!0})}))));await Promise.all(i)}emitConfigurationChanged(){const t=new CustomEvent("mosaicConfigurationChanged",{detail:{colsMobile:this.colsMobile,colsTablet:this.colsTablet,colsDesktop:this.colsDesktop},bubbles:!0,composed:!0});this.el.dispatchEvent(t)}configurationChanged(){this.emitConfigurationChanged()}async refreshMasonryLayout(){this.isMasonry&&(await this.waitForImages(),this.initializeMasonry())}componentDidLoad(){this.isMasonry&&this.initializeMasonry(),this.observeSlotChanges(),this.emitConfigurationChanged()}componentDidUpdate(){this.isMasonry&&this.refreshMasonryLayout()}disconnectedCallback(){this.destroyMasonry(),this.observer&&this.observer.disconnect()}async initializeMasonry(){this.isMasonry&&requestAnimationFrame((()=>{const t=this.el.shadowRoot.querySelector("slot").assignedElements({flatten:!0});if(t.length>0){const i=Array.from(t).find((t=>!t.hasAttribute("col-span-desktop")&&!t.hasAttribute("col-span-tablet")&&!t.hasAttribute("col-span-mobile")))||t[0];this.masonry=new D(this.el,{itemSelector:"spw-mosaic-item",columnWidth:i,percentPosition:!0,gutter:0}),this.initialized=!0,t.forEach((t=>{t.querySelectorAll("img").forEach((t=>{t.complete||t.addEventListener("load",this.updateMasonryLayout.bind(this),{once:!0})}))}))}}))}updateMasonryLayout(){this.masonry&&this.initialized&&this.isMasonry&&this.masonry.layout()}destroyMasonry(){this.masonry&&(this.masonry.destroy(),this.masonry=null,this.initialized=!1)}observeSlotChanges(){const t=this.el.shadowRoot.querySelector("slot");this.observer=new MutationObserver((t=>{for(const i of t)"childList"===i.type&&this.initialized&&this.isMasonry&&this.initializeMasonry()})),this.observer.observe(t,{childList:!0})}get elementClass(){return{"spw-mosaic--no-masonry":!this.isMasonry}}render(){return n(s,{key:"f61eb75efa6cc8fe663e50f45568c5cb7dd8f2f3"},n("div",{key:"1094aebb0e127ce6fa37c9884216cf0fa20ad781",class:this.elementClass},n("slot",{key:"0788e769762d7d137fe4df586b6add1da6e723f8"})))}get el(){return this}static get watchers(){return{items:[{itemsChanged:0}],isMasonry:[{isMasonryChanged:0}],colsMobile:[{configurationChanged:0}],colsTablet:[{configurationChanged:0}],colsDesktop:[{configurationChanged:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block;margin:0 -12px}.spw-mosaic--no-masonry{display:flex;flex-wrap:wrap}'}},[257,"spw-mosaic",{items:[8],isMasonry:[4,"is-masonry"],colsMobile:[2,"cols-mobile"],colsTablet:[2,"cols-tablet"],colsDesktop:[2,"cols-desktop"],initialized:[32],waitForImages:[64],initializeMasonry:[64]},void 0,{items:[{itemsChanged:0}],isMasonry:[{isMasonryChanged:0}],colsMobile:[{configurationChanged:0}],colsTablet:[{configurationChanged:0}],colsDesktop:[{configurationChanged:0}]}]),S=W,E=function(){"undefined"!=typeof customElements&&["spw-mosaic"].forEach((t=>{"spw-mosaic"===t&&(customElements.get(o(t))||customElements.define(o(t),W))}))};export{S as SpwMosaic,E as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as t,c as s,h as i,a as o,t as n}from"./index.js";import{d as r}from"./p-CIfmnXXp.js";import{d as a}from"./p-DikxciH1.js";import{d as l}from"./p-Dzw3OiMu.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChanged=s(this,"valueChanged",7),this.internals=this.attachInternals(),this.label="",this.placeholder="Sélectionner une option",this.required=!1,this.size="medium",this.error="",this.hint="",this.success="",this.warning="",this.showErrorIcon=!0,this.showHintIcon=!0,this.showSuccessIcon=!0,this.showWarningIcon=!0,this.defaultValue=null}handleItemsChange(){this.selectElement&&this.syncDynamicOptions()}async resetSelect(){this.internalValue="",this.value="",this.selectElement&&(this.selectElement.value=""),this.internals.setFormValue(""),this.valueChanged.emit("")}componentWillLoad(){var e;this.defaultValue=null!==(e=this.value)&&void 0!==e?e:this.getInitialSelectedValue(),this.internalValue=this.value||this.getInitialSelectedValue()}componentDidLoad(){this.internals.setFormValue(this.getFormValue()),this.items?this.syncDynamicOptions():this.moveOptionsToLightDom()}formResetCallback(){var e;this.setValue(null!==(e=this.defaultValue)&&void 0!==e?e:""),this.resetSelect()}setValue(e){this.internalValue=e,this.value=e,this.selectElement&&(this.selectElement.value=e+""),this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}getFormValue(){return this.internalValue?this.internalValue+"":null}getInitialSelectedValue(){if(this.items&&this.items.length>0)return null;const e=Array.from(this.el.querySelectorAll("option"));for(const t of e)if(t.hasAttribute("selected"))return t.getAttribute("value");return null}handleSelectChange(e){this.internalValue=e.target.value,this.value=this.internalValue,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}moveOptionsToLightDom(){const e=this.el.shadowRoot.querySelector("slot");e&&e.assignedNodes({flatten:!0}).forEach((e=>{"OPTION"!==e.nodeName&&"OPTGROUP"!==e.nodeName||this.selectElement.appendChild(e)}))}syncDynamicOptions(){for(;this.selectElement.options.length>1;)this.selectElement.remove(1);this.items&&this.items.length>0&&this.items.forEach((e=>{const t=document.createElement("option"),s=this.itemLabel?e[this.itemLabel]:e,i=e.disabled||!1;t.value=(this.itemValue?e[this.itemValue]:e)+"",t.textContent=s+"",t.disabled=i,this.selectElement.appendChild(t)})),this.selectElement.value!==(this.internalValue||"")+""&&(this.selectElement.value=(this.internalValue||"")+"")}renderErrorMessage(){if(this.error)return i("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}renderHintMessage(){if(this.hint)return i("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}renderSuccessMessage(){if(this.success)return i("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}renderWarningMessage(){if(this.warning)return i("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}get elementClass(){return{"spw-select":!0,["spw-select--"+this.size]:!0,"spw-select--disabled":this.disabled,"spw-select--is-error":!!this.error}}render(){return i(o,{key:"03a8d7f699a02091c1769f6ea6d01bc6adfc1a5d"},i("div",{key:"e4e8df7f871ce76fdb8f19ea1b10006a5ae50ec0",class:this.elementClass},this.label&&i("spw-field-label",{key:"e73bd6387bd7c647a11684300790f763bd1fea6e",label:this.label,name:this.name,required:this.required}),this.assistiveText&&i("spw-field-message",{key:"df5f4b589ae18374bf50802d4ed8dc923d06c34c",class:"spw-select__field-message",variant:"hint",showIcon:!1},this.assistiveText),i("div",{key:"3f1ee0d1e1e84919b387c14a1833ffe7f2058823",class:"spw-select__container"},i("select",{key:"e8a04cd43db7c56e23acd133a682c4f973194c41",id:this.name,name:this.name,"aria-label":this.accAriaLabel||this.label||this.name,class:"spw-select__trigger",onChange:e=>this.handleSelectChange(e),disabled:this.disabled,ref:e=>this.selectElement=e,tabindex:this.disabled?-1:0},i("option",{key:"bae3d205bc526e60ac00fb492770b2614049b4cf",value:"",disabled:!0,selected:!this.internalValue},this.placeholder)),i("spw-icon",{key:"035d35a7db87d124d3102ff34c694a69bbccf0b3",class:"spw-select__arrow",icon:"fa-chevron-down"})),!this.items&&i("slot",{key:"7efab927c453d175faf60d83eb120ee487427796"})),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{items:[{handleItemsChange:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-select{position:relative}.spw-select__container{position:relative}.spw-select__arrow{position:absolute;top:50%;transform:translateY(-50%);right:12px;pointer-events:none;color:var(--spw-color-themes-grey-grey-600);font-size:16px}.spw-select__field-message{margin-bottom:8px;margin-top:-4px}.spw-select__trigger{width:100%;height:40px;border-radius:4px;border:1px solid var(--spw-color-themes-grey-grey-800);background-color:#fff;font-size:16px;color:var(--spw-color-themes-grey-grey-800);position:relative;padding:0;margin:0;appearance:none;padding:0 12px;padding-right:40px}.spw-select__trigger:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-select__trigger:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.spw-select__trigger::after{content:"\\f078";font-family:var(--spw-ds-font-icons-solid);font-weight:900;font-size:14px;color:var(--spw-color-themes-grey-grey-800);position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.spw-select--is-error .spw-select__trigger{border-color:var(--spw-colors-states-error-error-300)}.spw-select--large .spw-select__trigger{height:60px;padding:0 24px;font-size:18px}.spw-select--disabled .spw-select__trigger{border-color:var(--spw-color-themes-grey-grey-400);background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-select--disabled .spw-select__trigger::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger:hover,.spw-select--disabled .spw-select__trigger:focus,.spw-select--disabled .spw-select__trigger:focus-visible{outline:none}'}},[321,"spw-select",{value:[1544],label:[1],placeholder:[1],disabled:[4],name:[1],required:[4],size:[1],assistiveText:[1,"assistive-text"],error:[1],hint:[1],success:[1],warning:[1],showErrorIcon:[4,"show-error-icon"],showHintIcon:[4,"show-hint-icon"],showSuccessIcon:[4,"show-success-icon"],showWarningIcon:[4,"show-warning-icon"],items:[16],itemLabel:[1,"item-label"],itemValue:[1,"item-value"],accAriaLabel:[1,"acc-aria-label"],internalValue:[32],resetSelect:[64]},void 0,{items:[{handleItemsChange:0}]}]),c=h,p=function(){"undefined"!=typeof customElements&&["spw-select","spw-field-label","spw-field-message","spw-icon"].forEach((e=>{switch(e){case"spw-select":customElements.get(n(e))||customElements.define(n(e),h);break;case"spw-field-label":customElements.get(n(e))||r();break;case"spw-field-message":customElements.get(n(e))||a();break;case"spw-icon":customElements.get(n(e))||l()}}))};export{c as SpwSelect,p as defineCustomElement}
1
+ import{p as e,H as t,c as s,h as i,a as o,t as n}from"./index.js";import{d as r}from"./p-CIfmnXXp.js";import{d as a}from"./p-DikxciH1.js";import{d as l}from"./p-Dzw3OiMu.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChanged=s(this,"valueChanged",7),this.internals=this.attachInternals(),this.label="",this.placeholder="Sélectionner une option",this.required=!1,this.size="medium",this.error="",this.hint="",this.success="",this.warning="",this.showErrorIcon=!0,this.showHintIcon=!0,this.showSuccessIcon=!0,this.showWarningIcon=!0,this.defaultValue=null}handleItemsChange(){this.selectElement&&this.syncDynamicOptions()}async resetSelect(){this.internalValue="",this.value="",this.selectElement&&(this.selectElement.value=""),this.internals.setFormValue(""),this.valueChanged.emit("")}async setValue(e){this.internalValue=e,this.value=e,this.selectElement&&(this.selectElement.value=e+""),this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}async getValue(){return this.internalValue}componentWillLoad(){var e;this.defaultValue=null!==(e=this.value)&&void 0!==e?e:this.getInitialSelectedValue(),this.internalValue=this.value||this.getInitialSelectedValue()}componentDidLoad(){this.internals.setFormValue(this.getFormValue()),this.items?this.syncDynamicOptions():this.moveOptionsToLightDom()}formResetCallback(){var e;this.setValue(null!==(e=this.defaultValue)&&void 0!==e?e:""),this.resetSelect()}getFormValue(){return this.internalValue?this.internalValue+"":null}getInitialSelectedValue(){if(this.items&&this.items.length>0)return null;const e=Array.from(this.el.querySelectorAll("option"));for(const t of e)if(t.hasAttribute("selected"))return t.getAttribute("value");return null}handleSelectChange(e){this.internalValue=e.target.value,this.value=this.internalValue,this.internals.setFormValue(this.getFormValue()),this.valueChanged.emit(this.internalValue)}moveOptionsToLightDom(){const e=this.el.shadowRoot.querySelector("slot");e&&e.assignedNodes({flatten:!0}).forEach((e=>{"OPTION"!==e.nodeName&&"OPTGROUP"!==e.nodeName||this.selectElement.appendChild(e)}))}syncDynamicOptions(){for(;this.selectElement.options.length>1;)this.selectElement.remove(1);this.items&&this.items.length>0&&this.items.forEach((e=>{const t=document.createElement("option"),s=this.itemLabel?e[this.itemLabel]:e,i=e.disabled||!1;t.value=(this.itemValue?e[this.itemValue]:e)+"",t.textContent=s+"",t.disabled=i,this.selectElement.appendChild(t)})),this.selectElement.value!==(this.internalValue||"")+""&&(this.selectElement.value=(this.internalValue||"")+"")}renderErrorMessage(){if(this.error)return i("spw-field-message",{variant:"error",showIcon:this.showErrorIcon},this.error)}renderHintMessage(){if(this.hint)return i("spw-field-message",{variant:"hint",showIcon:this.showHintIcon},this.hint)}renderSuccessMessage(){if(this.success)return i("spw-field-message",{variant:"success",showIcon:this.showSuccessIcon},this.success)}renderWarningMessage(){if(this.warning)return i("spw-field-message",{variant:"warning",showIcon:this.showWarningIcon},this.warning)}get elementClass(){return{"spw-select":!0,["spw-select--"+this.size]:!0,"spw-select--disabled":this.disabled,"spw-select--is-error":!!this.error}}render(){return i(o,{key:"c623e21b2b6e04d3a1f8b85dfc702cf3a2fb4c1e"},i("div",{key:"cc80bd65c5a6bd0612dc79c7a47fa8b15860211e",class:this.elementClass},this.label&&i("spw-field-label",{key:"98724278781185bc0060948baa65d79d9a263455",label:this.label,name:this.name,required:this.required}),this.assistiveText&&i("spw-field-message",{key:"9361a3d523b9ad611cb25ec10d3cab9664ce16f3",class:"spw-select__field-message",variant:"hint",showIcon:!1},this.assistiveText),i("div",{key:"b62735322558094dde5e4ee8efa8f6a2cd8f075e",class:"spw-select__container"},i("select",{key:"df5714c4a8ad2e469605f9ed000a8df325846304",id:this.name,name:this.name,"aria-label":this.accAriaLabel||this.label||this.name,class:"spw-select__trigger",onChange:e=>this.handleSelectChange(e),disabled:this.disabled,ref:e=>this.selectElement=e,tabindex:this.disabled?-1:0},i("option",{key:"d74dbffc296ed6c9c5861fe7de2a7e4d4704461e",value:"",disabled:!0,selected:!this.internalValue},this.placeholder)),i("spw-icon",{key:"95147be8fa99af30865d61b65b2e5814482281b7",class:"spw-select__arrow",icon:"fa-chevron-down"})),!this.items&&i("slot",{key:"68c022ef52e5df4b2fa5c5b9d443ac2005b25e4c"})),this.renderErrorMessage(),this.renderHintMessage(),this.renderSuccessMessage(),this.renderWarningMessage())}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{items:[{handleItemsChange:0}]}}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-select{position:relative}.spw-select__container{position:relative}.spw-select__arrow{position:absolute;top:50%;transform:translateY(-50%);right:12px;pointer-events:none;color:var(--spw-color-themes-grey-grey-600);font-size:16px}.spw-select__field-message{margin-bottom:8px;margin-top:-4px}.spw-select__trigger{width:100%;height:40px;border-radius:4px;border:1px solid var(--spw-color-themes-grey-grey-800);background-color:#fff;font-size:16px;color:var(--spw-color-themes-grey-grey-800);position:relative;padding:0;margin:0;appearance:none;padding:0 12px;padding-right:40px}.spw-select__trigger:hover{outline:4px solid var(--spw-color-themes-grey-grey-300)}.spw-select__trigger:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 6px black}.spw-select__trigger::after{content:"\\f078";font-family:var(--spw-ds-font-icons-solid);font-weight:900;font-size:14px;color:var(--spw-color-themes-grey-grey-800);position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.spw-select--is-error .spw-select__trigger{border-color:var(--spw-colors-states-error-error-300)}.spw-select--large .spw-select__trigger{height:60px;padding:0 24px;font-size:18px}.spw-select--disabled .spw-select__trigger{border-color:var(--spw-color-themes-grey-grey-400);background:var(--spw-color-themes-grey-grey-100);color:var(--spw-color-themes-grey-grey-500);cursor:not-allowed}.spw-select--disabled .spw-select__trigger::placeholder{color:var(--spw-color-themes-grey-grey-500)}.spw-select--disabled .spw-select__trigger:hover,.spw-select--disabled .spw-select__trigger:focus,.spw-select--disabled .spw-select__trigger:focus-visible{outline:none}'}},[321,"spw-select",{value:[1544],label:[1],placeholder:[1],disabled:[4],name:[1],required:[4],size:[1],assistiveText:[1,"assistive-text"],error:[1],hint:[1],success:[1],warning:[1],showErrorIcon:[4,"show-error-icon"],showHintIcon:[4,"show-hint-icon"],showSuccessIcon:[4,"show-success-icon"],showWarningIcon:[4,"show-warning-icon"],items:[16],itemLabel:[1,"item-label"],itemValue:[1,"item-value"],accAriaLabel:[1,"acc-aria-label"],internalValue:[32],resetSelect:[64],setValue:[64],getValue:[64]},void 0,{items:[{handleItemsChange:0}]}]),c=h,p=function(){"undefined"!=typeof customElements&&["spw-select","spw-field-label","spw-field-message","spw-icon"].forEach((e=>{switch(e){case"spw-select":customElements.get(n(e))||customElements.define(n(e),h);break;case"spw-field-label":customElements.get(n(e))||r();break;case"spw-field-message":customElements.get(n(e))||a();break;case"spw-icon":customElements.get(n(e))||l()}}))};export{c as SpwSelect,p as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as t,h as i,F as s,a as o,t as n}from"./index.js";import{d as a}from"./p-Dzw3OiMu.js";const p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.variant="light",this.height="landscape",this.target="_self",this.imageAlt="",this.overlayOpacity=100}componentWillLoad(){this.applyVariantToChildren()}slotChanged(){this.applyVariantToChildren()}applyVariantToChildren(){requestAnimationFrame((()=>{const e="--"+this.variant,t=this.el.querySelector("spw-tile-title"),i=this.el.querySelector("spw-tile-description");t&&t.classList.add(e),i&&i.classList.add(e)}))}get elementClass(){return{"spw-tile":!0,"spw-tile--hoverable":!!this.href,["spw-tile--"+this.variant]:!0,["spw-tile--height-"+this.height]:!0}}onMouseEnter(){this.setHovered(!0)}onMouseLeave(){this.setHovered(!1)}setHovered(e){const t=this.el.querySelector("spw-tile-title");t&&this.href&&t.classList.toggle("--hovered",e)}render(){const{href:e,target:t}=this,n=void 0===this.href?"div":"a";return i(o,{key:"43cf9368a56fe6a5304c56d191e3d7155f999056"},i(n,Object.assign({key:"7ec254973d2534b4d4ecb447fc61080ed4558cd8"},"div"===n?{}:{href:e,target:t},{class:this.elementClass}),this.imageSrc&&("big"===this.variant||"light"===this.variant)&&i(s,{key:"8176687737c1a89e1d4bcf566cde2aa41fe297f1"},i("div",{key:"142e807ebb7bdfb3cdf2b6eeaae2222159d39668",class:"spw-tile__overlay",style:{opacity:""+this.overlayOpacity/100}}),i("img",{key:"da61793fea7cf26920759fa36ecfaee8e127f86b",src:this.imageSrc,alt:this.imageAlt,class:"spw-tile__image"})),i("div",{key:"29b26d1105d13e9ffd4e05bbc9495103ab705b05",class:"spw-tile__content"},i("slot",{key:"ed01b17181f267301f1cb5d9d59a36bf0e103c51"}),this.href&&"big"===this.variant&&i("span",{key:"3e4cbc83343e579812afb0bd9d5f61311638c207",class:"spw-tile__button"},i("spw-icon",{key:"41620a821812d5a6fe61525abf43df7e3528ed84",icon:"fa-chevron-right"})))))}get el(){return this}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-tile{display:block;text-decoration:none;position:relative;transition:all 0.3s ease-in-out}.spw-tile--hoverable:hover{transform:translateY(-5px)}.spw-tile:focus-visible{outline:3px solid white;outline-offset:-1px;box-shadow:0 0 0 5px black;border-radius:5px}.spw-tile--icon{padding:16px 0}.spw-tile--big,.spw-tile--light{padding-top:calc(70% - 12px);border-radius:6px;overflow:hidden}@media (min-width: 1024px){.spw-tile--big,.spw-tile--light{padding-top:calc(60% - 12px)}.spw-tile--big.spw-tile--height-landscape,.spw-tile--light.spw-tile--height-landscape{padding-top:calc(60% - 12px)}.spw-tile--big.spw-tile--height-square,.spw-tile--light.spw-tile--height-square{padding-top:100%}.spw-tile--big.spw-tile--height-portrait,.spw-tile--light.spw-tile--height-portrait{padding-top:150%}}.spw-tile__overlay,.spw-tile__image{position:absolute;width:100%;height:100%;left:0;top:0}.spw-tile__overlay{z-index:2;background:linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 65%, rgba(0, 0, 0, 0.75) 100%)}.spw-tile__image{z-index:1;object-fit:cover}.spw-tile__button{background:white;width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;color:var(--spw-ds-primary);border-radius:50%;transition:all 0.2s ease-in;border:2px solid transparent;font-size:20px;margin-top:12px}.spw-tile:hover .spw-tile__button{border-color:white;color:white;background:transparent}.spw-tile--icon .spw-tile__content{display:flex;flex-direction:column;gap:12px;padding:0 12px;text-align:center}.spw-tile--icon .spw-tile__content ::slotted(spw-icon){font-size:32px;color:var(--spw-ds-primary)}.spw-tile--light .spw-tile__content,.spw-tile--big .spw-tile__content{position:absolute;z-index:3;display:flex;flex-direction:column;gap:6px;padding:24px;bottom:0;left:0;width:100%}.spw-tile--light .spw-tile__content{text-align:center;padding-bottom:24px}'}},[257,"spw-tile",{variant:[1],height:[1],href:[1],target:[1],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],overlayOpacity:[2,"overlay-opacity"]},[[0,"slotchange","slotChanged"],[1,"mouseenter","onMouseEnter"],[1,"mouseleave","onMouseLeave"]]]),l=p,r=function(){"undefined"!=typeof customElements&&["spw-tile","spw-icon"].forEach((e=>{switch(e){case"spw-tile":customElements.get(n(e))||customElements.define(n(e),p);break;case"spw-icon":customElements.get(n(e))||a()}}))};export{l as SpwTile,r as defineCustomElement}
1
+ import{p as e,H as t,h as i,F as s,a as o,t as n}from"./index.js";import{d as a}from"./p-Dzw3OiMu.js";const p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.variant="light",this.height="landscape",this.target="_self",this.imageAlt="",this.overlayOpacity=100}componentWillLoad(){this.applyVariantToChildren()}slotChanged(){this.applyVariantToChildren()}applyVariantToChildren(){requestAnimationFrame((()=>{const e="--"+this.variant,t=this.el.querySelector("spw-tile-title"),i=this.el.querySelector("spw-tile-description");t&&t.classList.add(e),i&&i.classList.add(e)}))}get elementClass(){return{"spw-tile":!0,"spw-tile--hoverable":!!this.href,["spw-tile--"+this.variant]:!0,["spw-tile--height-"+this.height]:!0}}onMouseEnter(){this.setHovered(!0)}onMouseLeave(){this.setHovered(!1)}setHovered(e){const t=this.el.querySelector("spw-tile-title");t&&this.href&&t.classList.toggle("--hovered",e)}render(){const{href:e,target:t}=this,n=void 0===this.href?"div":"a";return i(o,{key:"43cf9368a56fe6a5304c56d191e3d7155f999056"},i(n,Object.assign({key:"7ec254973d2534b4d4ecb447fc61080ed4558cd8"},"div"===n?{}:{href:e,target:t},{class:this.elementClass}),this.imageSrc&&("big"===this.variant||"light"===this.variant)&&i(s,{key:"8176687737c1a89e1d4bcf566cde2aa41fe297f1"},i("div",{key:"142e807ebb7bdfb3cdf2b6eeaae2222159d39668",class:"spw-tile__overlay",style:{opacity:""+this.overlayOpacity/100}}),i("img",{key:"da61793fea7cf26920759fa36ecfaee8e127f86b",src:this.imageSrc,alt:this.imageAlt,class:"spw-tile__image"})),i("div",{key:"29b26d1105d13e9ffd4e05bbc9495103ab705b05",class:"spw-tile__content"},i("slot",{key:"ed01b17181f267301f1cb5d9d59a36bf0e103c51"}),this.href&&"big"===this.variant&&i("span",{key:"3e4cbc83343e579812afb0bd9d5f61311638c207",class:"spw-tile__button"},i("spw-icon",{key:"41620a821812d5a6fe61525abf43df7e3528ed84",icon:"fa-chevron-right"})))))}get el(){return this}static get style(){return'html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:"Nunito Sans"}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:block}.spw-tile{display:block;text-decoration:none;position:relative;transition:all 0.3s ease-in-out}.spw-tile--hoverable:hover{transform:translateY(-5px)}.spw-tile:focus-visible{outline:3px solid white;outline-offset:-1px;box-shadow:0 0 0 5px black;border-radius:5px}.spw-tile--icon{padding:16px 0}.spw-tile--big,.spw-tile--light{position:relative;padding-top:calc(70% - 12px);border-radius:6px;overflow:hidden}@media (min-width: 1024px){.spw-tile--big,.spw-tile--light{padding-top:calc(60% - 12px)}.spw-tile--big.spw-tile--height-landscape,.spw-tile--light.spw-tile--height-landscape{padding-top:calc(60% - 12px)}.spw-tile--big.spw-tile--height-square,.spw-tile--light.spw-tile--height-square{padding-top:100%}.spw-tile--big.spw-tile--height-portrait,.spw-tile--light.spw-tile--height-portrait{padding-top:150%}}.spw-tile--big:before,.spw-tile--light:before{content:"";background:black;opacity:0;transition:all linear 0.2s;border-radius:5px;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2}.spw-tile--big:hover:before,.spw-tile--light:hover:before{opacity:0.3}.spw-tile__overlay,.spw-tile__image{position:absolute;width:100%;height:100%;left:0;top:0}.spw-tile__overlay{z-index:2;background:linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 65%, rgba(0, 0, 0, 0.75) 100%)}.spw-tile__image{z-index:1;object-fit:cover}.spw-tile__button{background:white;width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;color:var(--spw-ds-primary);border-radius:50%;transition:all 0.2s ease-in;border:2px solid transparent;font-size:20px;margin-top:12px}.spw-tile:hover .spw-tile__button{border-color:white;color:white;background:transparent}.spw-tile--icon .spw-tile__content{display:flex;flex-direction:column;gap:12px;padding:0 12px;text-align:center}.spw-tile--icon .spw-tile__content ::slotted(spw-icon){font-size:32px;color:var(--spw-ds-primary)}.spw-tile--light .spw-tile__content,.spw-tile--big .spw-tile__content{position:absolute;z-index:3;display:flex;flex-direction:column;gap:6px;padding:24px;bottom:0;left:0;width:100%}.spw-tile--light .spw-tile__content{text-align:center;padding-bottom:24px}'}},[257,"spw-tile",{variant:[1],height:[1],href:[1],target:[1],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],overlayOpacity:[2,"overlay-opacity"]},[[0,"slotchange","slotChanged"],[1,"mouseenter","onMouseEnter"],[1,"mouseleave","onMouseLeave"]]]),l=p,r=function(){"undefined"!=typeof customElements&&["spw-tile","spw-icon"].forEach((e=>{switch(e){case"spw-tile":customElements.get(n(e))||customElements.define(n(e),p);break;case"spw-icon":customElements.get(n(e))||a()}}))};export{l as SpwTile,r as defineCustomElement}