import * as i0 from '@angular/core';
import { Directive, Inject, Optional, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PROP_STRING, PROP_NUMBER, register, StylableComponent, APPLY_STYLES_TYPE, styler, provideAsWidgetRef, WmComponentsModule } from '@wm/components/base';
import { switchClass } from '@wm/core';

const registerProps = () => {
    register('wm-right-panel', new Map([
        ['class', PROP_STRING],
        ['columnwidth', PROP_NUMBER],
        ['content', PROP_STRING],
        ['name', PROP_STRING],
        ['hint', PROP_STRING],
        ['arialabel', PROP_STRING]
    ]));
};

const DEFAULT_CLS = 'app-right-panel';
const WIDGET_CONFIG = {
    widgetType: 'wm-right-panel',
    hostClass: DEFAULT_CLS
};
class RightPanelDirective extends StylableComponent {
    static { this.initializeProps = registerProps(); }
    constructor(inj, explicitContext) {
        super(inj, WIDGET_CONFIG, explicitContext);
        styler(this.nativeElement, this, APPLY_STYLES_TYPE.CONTAINER);
    }
    onPropertyChange(key, nv, ov) {
        if (key === 'columnwidth') {
            switchClass(this.nativeElement, `col-sm-${nv}`, ov ? ` col-sm-${ov}` : '');
        }
        else {
            super.onPropertyChange(key, nv, ov);
        }
    }
    static { this.ɵfac = function RightPanelDirective_Factory(t) { return new (t || RightPanelDirective)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
    static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: RightPanelDirective, selectors: [["", "wmRightPanel", ""]], exportAs: ["wmRightPanel"], features: [i0.ɵɵProvidersFeature([
                provideAsWidgetRef(RightPanelDirective)
            ]), i0.ɵɵInheritDefinitionFeature] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RightPanelDirective, [{
        type: Directive,
        args: [{
                selector: '[wmRightPanel]',
                providers: [
                    provideAsWidgetRef(RightPanelDirective)
                ],
                exportAs: 'wmRightPanel'
            }]
    }], () => [{ type: i0.Injector }, { type: undefined, decorators: [{
                type: Inject,
                args: ['EXPLICIT_CONTEXT']
            }, {
                type: Optional
            }] }], null); })();

const components = [
    RightPanelDirective
];
class RightPanelModule {
    static { this.ɵfac = function RightPanelModule_Factory(t) { return new (t || RightPanelModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: RightPanelModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
            WmComponentsModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RightPanelModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                    WmComponentsModule
                ],
                declarations: [...components],
                exports: [...components]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(RightPanelModule, { declarations: [RightPanelDirective], imports: [CommonModule,
        WmComponentsModule], exports: [RightPanelDirective] }); })();

/**
 * Generated bundle index. Do not edit.
 */

export { RightPanelDirective, RightPanelModule };
//# sourceMappingURL=index.mjs.map
