@codeperate/app-asset
Version:
Codeperate App Asset
46 lines (45 loc) • 1.48 kB
JavaScript
import { Component, Element, forceUpdate, h, Host, Prop } from '@stencil/core';
import { state } from '../../../stencil-store/cdp-menu.store';
export class CdpMenuStore {
constructor() {
this.proxyHandler = {
set: (_target, prop, value, _receiver) => {
state[prop] = value;
forceUpdate(this.rootEl);
return true;
},
};
}
render() {
return (h(Host, { class: "h-full block w-full" },
h("cdp-menu", { config: Object.assign(Object.assign({}, this.config.menuConfig), { proxyHandler: this.proxyHandler }), props: { display: state.display } },
h("slot", null))));
}
static get is() { return "cdp-menu-store"; }
static get properties() { return {
"config": {
"type": "unknown",
"mutable": false,
"complexType": {
"original": "{\r\n menuConfig?: Omit<CdpMenuConfig, 'proxyHandler'>;\r\n }",
"resolved": "{ menuConfig?: Omit<CdpMenuConfig, \"proxyHandler\">; }",
"references": {
"Omit": {
"location": "global"
},
"CdpMenuConfig": {
"location": "import",
"path": "@codeperate/cdp-ui-library/dist/types/components/cdp/cdp-menu/cdp-menu.interface"
}
}
},
"required": true,
"optional": false,
"docs": {
"tags": [],
"text": ""
}
}
}; }
static get elementRef() { return "rootEl"; }
}