How to use the san.DataTypes.func function in san

To help you get started, we’ve selected a few san examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecomfe / santd / src / select / select.js View on Github external
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,
        showSearch: DataTypes.bool,
        size: DataTypes.oneOf(['default', 'small', 'large']),
        clearIcon: DataTypes.func,
        suffixIcon: DataTypes.func,
        tokenSeparators: DataTypes.array,
        defaultOpen: DataTypes.bool,
        open: DataTypes.bool
    },
    components: {
        's-head': Header,
        's-icon': Icon,
        's-create-menu': CreateMenu,
        's-trigger': Trigger
    },
    computed: {
        classes() {
            const open = this.data.get('createdData._open');
            const disabled = this.data.get('disabled');
            const size = this.data.get('sizeMap')[this.data.get('size')];
            const dyClass = this.data.get('classNames');
github ecomfe / santd / santd / calendar / src / picker.js View on Github external
/**
 * @file Santd tooltip file
 * @author mayihui@baidu.com
 **/

import san, {DataTypes} from 'san';
import Trigger from '../../core/trigger/index';
import Placement from './placements';
import inherits from '../../core/util/inherits';

export default inherits(san.defineComponent({
    dataTypes: {
        animation: DataTypes.oneOfType([DataTypes.func, DataTypes.string]),
        disabled: DataTypes.bool,
        transitionName: DataTypes.string,
        getCalendarContainer: DataTypes.func,
        calendar: DataTypes.func,
        open: DataTypes.bool,
        defaultOpen: DataTypes.bool,
        prefixCls: DataTypes.string,
        placement: DataTypes.object,
        value: DataTypes.oneOfType([
            DataTypes.object,
            DataTypes.array
        ]),
        defaultValue: DataTypes.oneOfType([
            DataTypes.object,
            DataTypes.array
        ]),
        align: DataTypes.object
    },
    initData() {
github ecomfe / santd / santd / upload / src / ajaxUploader.js View on Github external
className: DataTypes.string,
        multiple: DataTypes.bool,
        directory: DataTypes.bool,
        disabled: DataTypes.bool,
        accept: DataTypes.string,
        data: DataTypes.oneOfType([
            DataTypes.object,
            DataTypes.func
        ]),
        action: DataTypes.oneOfType([
            DataTypes.string,
            DataTypes.func
        ]),
        headers: DataTypes.object,
        beforeUpload: DataTypes.func,
        customRequest: DataTypes.func,
        withCredentials: DataTypes.bool,
        openFileDialogOnClick: DataTypes.bool
    },
    computed: {
        classes() {
            const prefixCls = this.data.get('prefixCls');
            const className = this.data.get('className');
            const disabled = this.data.get('disabled');

            let classArr = [prefixCls, className];
            disabled && classArr.push(`${prefixCls}-disabled`);
            return classArr;
        }
    },
    initData() {
        return {
github ecomfe / santd / src / upload / uploadlist.js View on Github external
>
                <img alt="{{file.name}}" src="{{file.thumbUrl || file.url}}">
                
            
        
        
    `
});

export default san.defineComponent({
    dataTypes: {
        listType: DataTypes.string,
        progressAttr: DataTypes.object,
        showRemoveIcon: DataTypes.bool,
        showPreviewIcon: DataTypes.bool,
        previewFile: DataTypes.func
    },
    computed: {
        items() {
            const fileList = this.data.get('fileList');
            const locale = this.data.get('locale');

            return fileList.map(file =&gt; {
                file.message = file.response &amp;&amp; file.response === 'string'
                    ? file.response
                    : (file.error &amp;&amp; file.error.statusText) || locale.uploadError;
                return {
                    ...file
                };
            });
        }
    },
github ecomfe / santd / src / upload / src / ajaxUploader.js View on Github external
export default san.defineComponent({
    dataTypes: {
        id: DataTypes.string,
        component: DataTypes.string,
        prefixCls: DataTypes.string,
        multiple: DataTypes.bool,
        directory: DataTypes.bool,
        disabled: DataTypes.bool,
        accept: DataTypes.string,
        data: DataTypes.oneOfType([
            DataTypes.object,
            DataTypes.func
        ]),
        action: DataTypes.oneOfType([
            DataTypes.string,
            DataTypes.func
        ]),
        headers: DataTypes.object,
        beforeUpload: DataTypes.func,
        customRequest: DataTypes.func,
        withCredentials: DataTypes.bool,
        openFileDialogOnClick: DataTypes.bool
    },
    initData() {
        return {
            uid: getUid(),
            reqs: {}
        };
    },
    attached() {
        this._isMounted = true;
    },
github ecomfe / santd / src / upload / src / ajaxUploader.js View on Github external
import san, {DataTypes} from 'san';
import defaultRequest from './request';
import {getUid, attrAccept, traverseFileTree} from './util';

export default san.defineComponent({
    dataTypes: {
        id: DataTypes.string,
        component: DataTypes.string,
        prefixCls: DataTypes.string,
        multiple: DataTypes.bool,
        directory: DataTypes.bool,
        disabled: DataTypes.bool,
        accept: DataTypes.string,
        data: DataTypes.oneOfType([
            DataTypes.object,
            DataTypes.func
        ]),
        action: DataTypes.oneOfType([
            DataTypes.string,
            DataTypes.func
        ]),
        headers: DataTypes.object,
        beforeUpload: DataTypes.func,
        customRequest: DataTypes.func,
        withCredentials: DataTypes.bool,
        openFileDialogOnClick: DataTypes.bool
    },
    initData() {
        return {
            uid: getUid(),
            reqs: {}
        };
github ecomfe / santd / santd / timepicker / src / timepicker.js View on Github external
disabledHours: DataTypes.func,
        disabledMinutes: DataTypes.func,
        disabledSeconds: DataTypes.func,
        hideDisabledOptions: DataTypes.bool,
        addon: DataTypes.func,
        name: DataTypes.string,
        autoComplete: DataTypes.string,
        use12Hours: DataTypes.bool,
        hourStep: DataTypes.number,
        minuteStep: DataTypes.number,
        secondStep: DataTypes.number,
        focusOnOpen: DataTypes.bool,
        autoFocus: DataTypes.bool,
        id: DataTypes.string,
        inputIcon: DataTypes.func,
        clearIcon: DataTypes.func
    },
    initData() {
        return {
            clearText: 'clear',
            prefixCls: 'time-picker',
            defaultOpen: false,
            inputReadOnly: false,
            style: {},
            className: '',
            popupClassName: '',
            popupStyle: {},
            id: '',
            align: {},
            defaultOpenValue: moment(),
            allowClear: true,
            showHour: true,
github ecomfe / santd / src / timepicker / header.js View on Github external
**/

import san, {DataTypes} from 'san';
import moment from 'moment';

export default san.defineComponent({
    dataTypes: {
        format: DataTypes.string,
        prefixCls: DataTypes.string,
        placeholder: DataTypes.string,
        value: DataTypes.object,
        inputReadOnly: DataTypes.bool,
        hourOptions: DataTypes.array,
        minuteOptions: DataTypes.array,
        secondOptions: DataTypes.array,
        disabledHours: DataTypes.func,
        disabledMinutes: DataTypes.func,
        disabledSeconds: DataTypes.func,
        defaultOpenValue: DataTypes.object,
        focusOnOpen: DataTypes.bool
    },
    initData() {
        return {
            invalid: false,
            inputReadOnly: false
        };
    },
    computed: {
        showTime() {
            const value = this.data.get('value');
            const format = this.data.get('format');
github ecomfe / santd / santd / tabs / index.js View on Github external
const Tabs = san.defineComponent({
    dataTypes: {
        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']),
        style: DataTypes.oneOfType([DataTypes.string, DataTypes.object]),
        prefixCls: DataTypes.string,
        className: DataTypes.string,
        animated: DataTypes.oneOfType([DataTypes.bool, DataTypes.object]),
        tabBarGutter: DataTypes.number,
        renderTabBar: DataTypes.func,
        renderTabContent: DataTypes.func,
        tabBarExtraContent: DataTypes.func
    },
    initData() {
        return {
            type: 'line',
            hideAdd: false,
            tabPosition: 'top',
            prefixCls: prefixCls,
            defaultRenderTabBar() {
                const tabBar = san.defineComponent({
                    initData() {
                        return {
                            ...scrollableInkTabBar.prototype.initData(),
                            prevIcon,
                            nextIcon
github ecomfe / santd / src / timepicker / combobox.js View on Github external
disabled
    };
};

export default san.defineComponent({
    dataTypes: {
        format: DataTypes.string,
        prefixCls: DataTypes.string,
        placeholder: DataTypes.string,
        value: DataTypes.object,
        inputReadOnly: DataTypes.bool,
        hourOptions: DataTypes.array,
        minuteOptions: DataTypes.array,
        secondOptions: DataTypes.array,
        disabledHours: DataTypes.func,
        disabledMinutes: DataTypes.func,
        disabledSeconds: DataTypes.func,
        defaultOpenValue: DataTypes.object,
        use12Hours: DataTypes.bool,
        isAM: DataTypes.bool
    },
    initData() {
        return {
            invalid: false,
            inputReadOnly: false
        };
    },
    computed: {
        hourData() {
            const value = this.data.get('value') || this.data.get('defaultOpenValue');
            const hour = value.hour();
            const hourOptions = this.data.get('hourOptions');