Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function toggleArrayData(check, data = [], key) {
data = data.concat();
const index = data.indexOf(key);
check && index === -1 && data.push(key);
!check && index !== -1 && data.splice(index, 1);
return data;
}
export default san.defineComponent({
components: {
's-tree-node': treeNode
},
dataTypes: {
autoExpandParent: DataTypes.bool,
blockNode: DataTypes.bool,
checkable: DataTypes.bool,
checkedKeys: DataTypes.oneOfType([DataTypes.array, DataTypes.object]),
checkStrictly: DataTypes.bool,
defaultCheckedKeys: DataTypes.array,
defaultExpandAll: DataTypes.bool,
defaultExpandedKeys: DataTypes.array,
defaultSelectedKeys: DataTypes.array,
disabled: DataTypes.bool,
draggable: DataTypes.bool,
expandedKeys: DataTypes.array,
loadData: DataTypes.func,
loadedKeys: DataTypes.array,
multiple: DataTypes.bool,
selectedKeys: DataTypes.array,
showIcon: DataTypes.bool,
const defaultColumnMap = {
xxl: 3,
xl: 3,
lg: 3,
md: 3,
sm: 2,
xs: 1
};
const Item = san.defineComponent({
template: '<template></template>'
});
const Descriptions = san.defineComponent({
dataTypes: {
bordered: DataTypes.bool,
size: DataTypes.string,
title: DataTypes.string,
column: DataTypes.oneOfType([DataTypes.number, DataTypes.object]),
layout: DataTypes.string
},
initData() {
return {
size: 'default',
bordered: false,
layout: 'horizontal',
column: defaultColumnMap,
screens: {}
};
},
popupStyle: DataTypes.oneOfType([DataTypes.string, DataTypes.object]),
prefixCls: DataTypes.string,
popupClassName: DataTypes.string,
className: DataTypes.string,
popupPlacement: DataTypes.string,
builtinPlacements: DataTypes.object,
popupTransitionName: DataTypes.oneOfType([DataTypes.string, DataTypes.object]),
popupAnimation: DataTypes.object,
mouseEnterDelay: DataTypes.number,
mouseLeaveDelay: DataTypes.number,
zIndex: DataTypes.number,
focusDelay: DataTypes.number,
blurDelay: DataTypes.number,
getPopupContainer: DataTypes.func,
getDocument: DataTypes.func,
destroyPopupOnHide: DataTypes.bool,
mask: DataTypes.bool,
maskClosable: DataTypes.bool,
popupAlign: DataTypes.object,
popupVisible: DataTypes.bool,
defaultPopupVisible: DataTypes.bool,
maskTransitionName: DataTypes.oneOfType([DataTypes.string, DataTypes.object]),
maskAnimation: DataTypes.string,
stretch: DataTypes.string,
alignPoint: DataTypes.bool
},
initData() {
return {
prefixCls: 'trigger-popup',
getPopupClassNameFromAlign() {
return '';
},
}
},
bottomCenter: {
points: ['tc', 'bc'],
offset: [0, 4],
overflow: {
adjustX: 0,
adjustY: 1
}
}
};
export default san.defineComponent({
dataTypes: {
showArrow: DataTypes.bool,
loading: DataTypes.bool,
defaultActiveFirstOption: DataTypes.bool,
disabled: DataTypes.bool,
maxTagCount: DataTypes.number,
autoClearSearchValue: DataTypes.bool,
dropdownClassName: DataTypes.string,
maxTagPlaceholder: DataTypes.any,
mode: DataTypes.string,
notFoundContent: DataTypes.oneOfType([DataTypes.string, DataTypes.func]),
labelInValue: DataTypes.bool,
dropdownStyle: DataTypes.object,
disabled: DataTypes.bool,
defaultValue: DataTypes.any,
autoFocus: DataTypes.bool,
dropdownMatchSelectWidth: DataTypes.bool,
optionFilterProp: DataTypes.string,
placeholder: DataTypes.string,
import san, {DataTypes} from 'san';
import {classCreator} from '../core/util';
import './style/index.less';
import BaseInput from './base';
import Icon from '../icon';
const prefixCls = classCreator('input')();
export default san.defineComponent({
dataTypes: {
addonAfter: DataTypes.string,
addonBefore: DataTypes.string,
prefix: DataTypes.string,
suffix: DataTypes.string,
defaultValue: DataTypes.any,
placeholder: DataTypes.string,
disabled: DataTypes.bool,
inputType: DataTypes.oneOf(['inputGroup', 'inputFix']),
id: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
size: DataTypes.oneOf(['large', 'default', 'small']),
type: DataTypes.string,
value: DataTypes.any
},
components: {
's-icon': Icon
},
inited() {
this.data.set('value', this.data.get('value') || this.data.get('defaultValue') || '');
this.data.set('hasAddonBefore', this.data.get('addonBefore') || !!this.sourceSlots.named.addonBefore);
this.data.set('hasAddonAfter', this.data.get('addonAfter') || !!this.sourceSlots.named.addonAfter);
this.data.set('hasPrefix', this.data.get('prefix') || !!this.sourceSlots.named.prefix);
`
});
export default san.defineComponent({
dataTypes: {
isShow: DataTypes.bool,
computedStyle: DataTypes.object,
popupListener: DataTypes.object,
point: DataTypes.object,
className: DataTypes.string,
placemens: DataTypes.object,
overlayClassName: DataTypes.string,
overlayStyle: DataTypes.object
},
components: {
's-dropdown-menu': DropdownMenu
},
initData() {
return {
dropAnimate: null,
showDone: false,
prefixCls: prefixCls
return point;
}
function getElement(node) {
if (node.nodeType !== 1) {
return null;
}
return node;
}
export default san.defineComponent({
dataTypes: {
mouseEnterDelay: DataTypes.number,
placement: DataTypes.string,
isAlignPoint: DataTypes.bool,
disabled: DataTypes.bool,
overlayClassName: DataTypes.string,
overlayStyle: DataTypes.object,
placements: DataTypes.object,
trigger: DataTypes.string,
isShow: DataTypes.bool
},
components: {
's-popup': Popup
},
computed: {
},
initData() {
return {
mouseEnterDelay: 0.15,
mouseLeaveDelay: 0.1,
'green',
'blue',
'purple',
'geekblue',
'magenta',
'volcano',
'gold',
'lime'
];
const presetColorRegex = new RegExp(`^(${presetColorTypes.join('|')})(-inverse)?$`);
const Tag = san.defineComponent({
dataTypes: {
color: DataTypes.string,
closable: DataTypes.bool,
visible: DataTypes.bool
},
computed: {
classes() {
const visible = this.data.get('visible');
const color = this.data.get('color');
const isPresetColor = this.data.get('isPresetColor');
let classArr = [prefixCls];
isPresetColor && classArr.push(`${prefixCls}-${color}`);
color && !isPresetColor && classArr.push(`${prefixCls}-has-color`);
!visible && classArr.push(`${prefixCls}-hidden`);
return classArr;
},
isPresetColor() {
* @author mayihui@baidu.com
**/
import san, {DataTypes} from 'san';
import TabPane from './tabPane';
import KeyCode from '../core/util/keyCode';
import {classCreator} from '../core/util';
import ScrollableInkTabBar from './scrollableInkTabBar';
import './style/index';
const prefixCls = classCreator('tabs')();
const Tabs = san.defineComponent({
dataTypes: {
destroyInactiveTabPane: DataTypes.bool,
activeKey: DataTypes.string,
defaultActiveKey: DataTypes.string,
hideAdd: DataTypes.bool,
tabBarStyle: DataTypes.oneOfType([DataTypes.string, DataTypes.object]),
type: DataTypes.oneOf(['line', 'card', 'editable-card']),
tabPosition: DataTypes.oneOf(['top', 'right', 'bottom', 'left']),
size: DataTypes.oneOf(['large', 'default', 'small']),
animated: DataTypes.oneOfType([DataTypes.bool, DataTypes.object]),
tabBarGutter: DataTypes.number
},
initData() {
return {
destroyInactiveTabPane: false,
tabBarPosition: 'top',
type: 'line',
hideAdd: false,
import JSONTreeView from 'json-tree-view';
import 'json-tree-view/devtools.css';
export default class JsonTreeView extends Component {
static template = `
<div class="s-json-tree-view">
</div>
`;
static dataTypes = {
expand: DataTypes.bool,
rootName: DataTypes.string,
withRootName: DataTypes.bool,
alwaysShowRoot: DataTypes.bool,
readonlyWhenFiltering: DataTypes.bool,
filterText: DataTypes.string,
readonly: DataTypes.bool
};
initData() {
return {
data: {},
expand: true,
rootName: '',
withRootName: false,
alwaysShowRoot: false,
readonlyWhenFiltering: true,
filterText: '',
readonly: false