mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 09:35:00 +02:00
Process minor fixes (#10704)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -13,36 +13,17 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Class, Doc, Ref } from '@hcengineering/core'
|
||||
import { Asset, IntlString } from '@hcengineering/platform'
|
||||
import { Button, ToggleWithLabel } from '@hcengineering/ui'
|
||||
import { BuildModelKey, Viewlet } from '@hcengineering/view'
|
||||
import { Viewlet } from '@hcengineering/view'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import view from '../plugin'
|
||||
import { AttributeConfig, Config, isAttribute } from '../viewOptions'
|
||||
|
||||
export let viewlet: Viewlet
|
||||
export let items: Array<Config | AttributeConfig> = []
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
interface Config {
|
||||
value: string | BuildModelKey | undefined
|
||||
type: 'divider' | 'attribute'
|
||||
}
|
||||
|
||||
interface AttributeConfig extends Config {
|
||||
type: 'attribute'
|
||||
enabled: boolean
|
||||
label: IntlString
|
||||
_class: Ref<Class<Doc>>
|
||||
icon: Asset | undefined
|
||||
order?: number
|
||||
}
|
||||
|
||||
function isAttribute (val: Config): val is AttributeConfig {
|
||||
return val.type === 'attribute'
|
||||
}
|
||||
|
||||
function dragEnd () {
|
||||
selected = undefined
|
||||
dispatch('save', items)
|
||||
|
||||
Reference in New Issue
Block a user