import { r as registerInstance, h, H as Host, a as getElement } from './index-Co4V4Zk-.js';

const spwGridCss = () => `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:var(--spw-ds-font-main)}body{margin: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-grid-gap-small:8px;--spw-grid-gap-medium:24px;--spw-grid-gap-large:48px}.spw-grid{display:grid;grid-template-columns:repeat(var(--spw-grid-cols-mobile, 1), 1fr)}.spw-grid--gap-none{gap:0}.spw-grid--gap-small{gap:var(--spw-grid-gap-small)}.spw-grid--gap-medium{gap:var(--spw-grid-gap-medium)}.spw-grid--gap-large{gap:var(--spw-grid-gap-large)}@media (min-width: 768px){.spw-grid{grid-template-columns:repeat(var(--spw-grid-cols-tablet, 2), 1fr)}}@media (min-width: 1024px){.spw-grid{grid-template-columns:repeat(var(--spw-grid-cols-desktop, 3), 1fr)}}`;

const SpwGrid = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        /** Nombre de colonnes à afficher en vue mobile */
        this.colsMobile = 1;
        /** Nombre de colonnes à afficher en vue tablette */
        this.colsTablet = 2;
        /** Nombre de colonnes à afficher en vue desktop */
        this.colsDesktop = 3;
        /** Espacement entre les éléments de grille */
        this.gap = 'medium';
    }
    emitConfigurationChanged() {
        const event = new CustomEvent('gridConfigurationChanged', {
            detail: {
                colsMobile: this.colsMobile,
                colsTablet: this.colsTablet,
                colsDesktop: this.colsDesktop,
            },
            bubbles: true,
            composed: true,
        });
        this.el.dispatchEvent(event);
    }
    configurationChanged() {
        this.emitConfigurationChanged();
    }
    componentDidLoad() {
        this.emitConfigurationChanged();
    }
    render() {
        return (h(Host, { key: 'e3b1f2084c0ee57485f9fa19f2a55c24d6be564e' }, h("div", { key: '351ab4d7a6fa6888ca7dc84387a9569f5764d4dd', class: { 'spw-grid': true, [`spw-grid--gap-${this.gap}`]: !!this.gap }, style: {
                '--spw-grid-cols-mobile': this.colsMobile.toString(),
                '--spw-grid-cols-tablet': this.colsTablet.toString(),
                '--spw-grid-cols-desktop': this.colsDesktop.toString(),
            } }, h("slot", { key: '1fcb8e4df8931825d68301b35ae5e9d53f216418' }))));
    }
    get el() { return getElement(this); }
    static get watchers() { return {
        "colsMobile": [{
                "configurationChanged": 0
            }],
        "colsTablet": [{
                "configurationChanged": 0
            }],
        "colsDesktop": [{
                "configurationChanged": 0
            }]
    }; }
};
SpwGrid.style = spwGridCss();

export { SpwGrid as spw_grid };
