How to use the san.DataTypes.number 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 / santd / input-number / index.js View on Github external
* @author fuqiangqiang@baidu.com
*/

import san, {DataTypes} from 'san';
import {classCreator} from '../core/util';
import inputHandle from './inputHandler';
import './style/index.less';
const prefixCls = classCreator('input-number')();

export default san.defineComponent({
    dataTypes: {
        autoFocus: DataTypes.bool,
        defaultValue: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        disabled: DataTypes.bool,
        max: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        min: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        precision: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        size: DataTypes.oneOf(['default', 'small', 'large']),
        step: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        value: DataTypes.oneOfType([DataTypes.string, DataTypes.number])
    },
    components: {
        'input-handler': inputHandle
    },
    computed: {
        outClasses() {
            const focused = this.data.get('autoFocus');
            const disabled = this.data.get('disabled') || false;
            const size = this.data.get('size') || 'default';
            let classArr = [prefixCls];
            focused && classArr.push(`${prefixCls}-focused`);
            disabled && classArr.push(`${prefixCls}-disabled`);
github ecomfe / san-mui / src / Uploader / Uploader.js View on Github external
static computed = {
        className() {
            return cx(this).build();
        }
    };

    static dataTypes = {
        mode: DataTypes.oneOf(['xhr']).isRequired,
        headers: DataTypes.object,
        multiple: DataTypes.bool.isRequired,
        name: DataTypes.string.isRequired,
        withCredentials: DataTypes.bool.isRequired,
        disabled: DataTypes.bool.isRequired,
        withFileList: DataTypes.bool,
        accept: DataTypes.string,
        maxSize: DataTypes.number,
        validateFile: DataTypes.func,
        data: DataTypes.object,
        json: DataTypes.bool,
        upload: DataTypes.func,
        duplicate: DataTypes.bool
    };

    initData() {
        return {
            mode: 'xhr',
            headers: {},
            multiple: false,
            data: {},
            name: 'file',
            withCredentials: false,
            autoUpload: true,
github ecomfe / san-mui / src / Grid / Col.js View on Github external
* 响应式布局,md 尺寸下列占的栅格列数
             *
             * @property {number|Object} md
             */

            /**
             * 响应式布局,lg 尺寸下列占的栅格列数
             *
             * @property {number|Object} lg
             */
        };
    }

    static dataTypes = {
        span: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        order: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        offset: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        push: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        pull: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
        xs: DataTypes.oneOfType([DataTypes.number, DataTypes.object]),
        sm: DataTypes.oneOfType([DataTypes.number, DataTypes.object]),
        md: DataTypes.oneOfType([DataTypes.number, DataTypes.object]),
        lg: DataTypes.oneOfType([DataTypes.number, DataTypes.object])
    };

    attached() {
        this.data.set('colStyle', this.getColStyle());
    }

}
github ecomfe / santd / src / timepicker / select.js View on Github external
const perTick = (difference / duration) * 10;

    raf(() => {
        element.scrollTop += perTick;
        if (element.scrollTop === to) {
            return;
        }
        scrollTo(element, to, duration - 10);
    });
};

export default san.defineComponent({
    dataTypes: {
        prefixCls: DataTypes.string,
        options: DataTypes.array,
        selectedIndex: DataTypes.number,
        type: DataTypes.string
    },
    initData() {
        return {
            active: false
        };
    },
    computed: {
        renderOptions() {
            const options = this.data.get('options');
            const prefixCls = this.data.get('prefixCls');
            const selectedIndex = this.data.get('selectedIndex');

            return options.map((option, index) => {
                let classArr = [];
                selectedIndex === index && classArr.push(`${prefixCls}-select-option-selected`);
github ecomfe / san-xui / src / x / components / SMSCodeBox.js View on Github external
value: '',
            width: null,
            placeholder: '请输入验证码'
        };
    },
    dataTypes: {
        /**
         * 用户输入的手机号
         * @bindx
         */
        value: DataTypes.string,

        /**
         * 输入框的宽度
         */
        width: DataTypes.number,

        /**
         * 组件的禁用状态
         * @default false
         */
        disabled: DataTypes.bool,

        /**
         * 发送短信之后的冷冻时间
         * @default 60
         */
        freezeTime: DataTypes.number,

        /**
         * 按钮上面的文案
         * @default 获取验证码
github ecomfe / san-xui / src / x / components / Dragger.js View on Github external
*/
        min: DataTypes.number,

        /**
         * 可输入的最大值
         *
         * @default 100
         */
        max: DataTypes.number,

        /**
         * 步进值,可以设置小数
         *
         * @default 1
         */
        step: DataTypes.number,

        /**
         * 控件的禁用状态
         *
         * @default false
         */
        disabled: DataTypes.bool,

        /**
         * 控件的宽度
         *
         * @default 350
         */
        length: DataTypes.number,

        /**
github ecomfe / santd / src / slider / src / handle.js View on Github external
**/

import san, {DataTypes} from 'san';
import Tooltip from '../../tooltip';
import {classCreator} from '../../core/util';

const prefixCls = classCreator('slider-handle')();


export default san.defineComponent({
    dataTypes: {
        vertical: DataTypes.bool,
        offset: DataTypes.number,
        disabled: DataTypes.bool,
        max: DataTypes.number,
        min: DataTypes.number,
        value: DataTypes.number,
        tabIndex: DataTypes.number
    },

    components: {
        's-tooltip': Tooltip
    },

    computed: {
        isTipVisible() {
            const tooltipVisible = this.data.get('tooltipVisible');
            const tipFormatter = this.data.get('tipFormatter');
            const dragging = this.data.get('dragging');

            return tooltipVisible || tipFormatter && dragging;
        },
github ecomfe / santd / src / pagination / pagination.js View on Github external
>
        <button type="button">{{locale.jump_to_confirm}}</button>
        <span>{{showQuickJumper.goButton}}</span>
    

`;

export default san.defineComponent({
    DataTypes: {
        prefixCls: DataTypes.string,
        current: DataTypes.number,
        defaultCurrent: DataTypes.number,
        total: DataTypes.number,
        pageSize: DataTypes.number,
        defaultPageSize: DataTypes.number,
        hideOnSinglePage: DataTypes.bool,
        showSizeChanger: DataTypes.bool,
        showLessItems: DataTypes.bool,
        selectSizeChange: DataTypes.func,
        showPrevNextJumpers: DataTypes.bool,
        showQuiclJumper: DataTypes.oneOfType([
            DataTypes.bool,
            DataTypes.object
        ]),
        showTitle: DataTypes.bool,
        pageSizeOptions: DataTypes.array,
        showTotal: DataTypes.bool
github ecomfe / santd / santd / slider / src / common / baseSlider.js View on Github external
* @file Santd slider base file
 * @author mayihui@baidu.com
 **/

import san, {DataTypes} from 'san';
import Steps from './steps';
import Marks from './marks';
import Handle from '../handle';
import * as utils from '../utils';
import inherits from '../../../core/util/inherits';

export default san.defineComponent({
    dataTypes: {
        min: DataTypes.number,
        max: DataTypes.number,
        step: DataTypes.number,
        marks: DataTypes.object,
        included: DataTypes.bool,
        className: DataTypes.string,
        prefixCls: DataTypes.string,
        disabled: DataTypes.bool,
        handle: DataTypes.func,
        dots: DataTypes.bool,
        vertical: DataTypes.bool,
        style: DataTypes.object,
        handleStyle: DataTypes.oneOfType([DataTypes.object, DataTypes.array]),
        trackStyle: DataTypes.oneOfType([DataTypes.object, DataTypes.array]),
        railStyle: DataTypes.object,
        dotStyle: DataTypes.object,
        activeDotStyle: DataTypes.object,
        autoFocus: DataTypes.bool
    },
github ecomfe / santd / src / select / select.js View on Github external
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,
        showSearch: DataTypes.bool,
        size: DataTypes.oneOf(['default', 'small', 'large']),
        clearIcon: DataTypes.func,