|
|
|
@ -1,16 +1,18 @@
|
|
|
|
|
import {WidgetType, Icon, BubbleCombo, TextBubblePopupBarView} from '@ui/index'; |
|
|
|
|
import {WidgetType, Icon, BubbleCombo, TextBubblePopupBarView, IconButton} from '@ui/index'; |
|
|
|
|
import Model from '../../link-set.model'; |
|
|
|
|
import {ACTION_DELETE} from '@private/constants'; |
|
|
|
|
|
|
|
|
|
const className = 'fr.component.linkSet.left.item.icon'; |
|
|
|
|
const Widget: WidgetType = { |
|
|
|
|
_store() { |
|
|
|
|
return BI.Models.getModel(Model); |
|
|
|
|
}, |
|
|
|
|
render() { |
|
|
|
|
const {cls, title, id} = this.options; |
|
|
|
|
const {cls, title, id, value} = this.options; |
|
|
|
|
const that = this; |
|
|
|
|
let iconContent: any = null; |
|
|
|
|
let combo: any = null; |
|
|
|
|
if (title === BI.i18nText('Dec-Dcm_Delete')) { |
|
|
|
|
if (value === ACTION_DELETE) { |
|
|
|
|
return { |
|
|
|
|
type: BubbleCombo, |
|
|
|
|
direction: 'bottom', |
|
|
|
@ -60,27 +62,20 @@ const Widget: WidgetType = {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: Icon, |
|
|
|
|
type: IconButton, |
|
|
|
|
cls, |
|
|
|
|
extraCls: 'action-icon', |
|
|
|
|
height: 24, |
|
|
|
|
width: 26, |
|
|
|
|
title, |
|
|
|
|
handler: () => { |
|
|
|
|
const {value, id, title} = this.options; |
|
|
|
|
if (value !== ACTION_DELETE) { |
|
|
|
|
this.store.onIconClick(title, id); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
const {title, id} = this.options; |
|
|
|
|
if (title !== BI.i18nText('Dec-Dcm_Delete')) { |
|
|
|
|
this.element.on('click', (event: any) => { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
this.store.onIconClick(title, id); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.element.on('click', (event: any) => { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
|
|
|
|
export default className; |
|
|
|
|