Containers are used for classes that will control multiple widgets. These classes should:
<xf-widget1 attr1="aaa"></xf-widget1> <xf-widget2 attr2="bbb"></xf-widget2>
connectedCallback() { const widget1 = this.shadowRoot.querySelector('xf-widget1'); widget1.addEventListener('widget1-clicked', (e) => { this.store_.dispatch(filesSpecificAction({data: e.detail.data})); }); }
onStateChanged(state: State) { const {customKey} = state; const widget1 = this.shadowRoot.querySelector('xf-widget1'); widget1.setAttribute('attr1', customKey); }
connectedCallback(state: State) { const widget1 = this.shadowRoot.querySelector('xf-widget1'); const widget2 = this.shadowRoot.querySelector('xf-widget2'); widget1.addEventListener('widget1-clicked', (e) => { widget2.setAttribute('attr2', e.detail.data); }); }
Code in this folder can depend on other folders such as ../widgets
, ../state/
, ../lib/
, etc.