import { LitElementWw } from '@webwriter/lit' import { CSSResult, TemplateResult, html } from 'lit' import { customElement } from 'lit/decorators.js' import { consume } from '@lit/context' import { globalStyles } from '@/global_styles' import type { Settings } from '@/types/settings' import { settingsContext } from '@/contexts/settings_context' import { SettingsUtils } from '@/utils/settings_utils' import { CCard } from '../reusables/c-card' import { CSetting } from '../reusables/c-setting' import SlIcon from '@shoelace-style/shoelace/dist/components/icon/icon.component.js' import SlButton from '@shoelace-style/shoelace/dist/components/button/button.component.js' import IconArrowCounterclockwise from 'bootstrap-icons/icons/arrow-counterclockwise.svg' import { msg } from '@lit/localize' export class SettingsCard extends LitElementWw { static scopedElements = { 'c-card': CCard, 'c-setting': CSetting, 'sl-button': SlButton, 'sl-icon': SlIcon, } @consume({ context: settingsContext, subscribe: true }) accessor settings: Settings // METHODS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - resetSettings() { this.dispatchEvent( new CustomEvent('set-settings', { detail: ( JSON.parse(JSON.stringify(SettingsUtils.defaultSettings)) ), composed: true, bubbles: true, }), ) } // STYLES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static styles: CSSResult = globalStyles // RENDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - render(): TemplateResult<1> { return html`
${msg('Settings')}

${msg( 'Configure which options the users of this widget are allowed to view and edit', )}

${msg('Set to default')}

Start

${msg('Network')}

${msg('Restrict layer types')} ${msg('Editing')}

${msg('Data set')}

${msg('Training')}

` } }