How to use the san.DataTypes.arrayOf 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 / san-mui / src / Pagination / Pagination.js View on Github external
`;
    /* eslint-enable max-len */
    static computed = {
        computedClassName() {
            return cx(this).build();
        },
        [totalPageKey]() {
            return Math.ceil(this.data.get(totalKey) / this.data.get(pageSizeKey)) || 0;
        }
    };

    static dataTypes = {
        total: DataTypes.number.isRequired,
        pageSize: DataTypes.number.isRequired,
        showSizeChanger: DataTypes.bool,
        pageSizeOptions: DataTypes.arrayOf(DataTypes.number).isRequired,
        nextPageText: DataTypes.string,
        lastPageText: DataTypes.string
    };

    initData() {
        // default data
        return {
            [pageSizeKey]: defaultPageSize,
            [currentKey]: defaultCurrent,
            [showSizeChangerKey]: true,
            [pageSizeOptionsKey]: defaultPageSizeOption,
            // 除去页首和页尾以多少个为一组,五个为一组则最多展示五个页码
            pageGroupLen
        };
    }
github ecomfe / santd / src / select / Select.js View on Github external
adjustX: 0,
            adjustY: 1
        }
    },
    topLeft: {
        points: ['bl', 'tl'],
        offset: [0, -4],
        overflow: {
            adjustX: 0,
            adjustY: 1
        }
    }
};
const valueType = DataTypes.oneOfType([
    DataTypes.string,
    DataTypes.arrayOf(DataTypes.string),
    DataTypes.number,
    DataTypes.arrayOf(DataTypes.number)
]);

export default san.defineComponent({
    template: `
        <div class="{{wrapClass}}">
            </div>
github ecomfe / santd / src / select / Select.js View on Github external
}
    },
    topLeft: {
        points: ['bl', 'tl'],
        offset: [0, -4],
        overflow: {
            adjustX: 0,
            adjustY: 1
        }
    }
};
const valueType = DataTypes.oneOfType([
    DataTypes.string,
    DataTypes.arrayOf(DataTypes.string),
    DataTypes.number,
    DataTypes.arrayOf(DataTypes.number)
]);

export default san.defineComponent({
    template: `
        <div class="{{wrapClass}}">
            </div>
github ecomfe / santd / src / calendar / src / date / dateInput.js View on Github external
/**
 * @file Santd calendar date input file
 * @author mayihui@baidu.com
 **/

import san, {DataTypes} from 'san';
import moment from 'moment';
import {formatDate} from '../util/index';
import KeyCode from '../../../core/util/keyCode';

export default san.defineComponent({
    dataTypes: {
        prefixCls: DataTypes.string,
        value: DataTypes.object,
        disabledTime: DataTypes.func,
        format: DataTypes.oneOfType([DataTypes.string, DataTypes.arrayOf(DataTypes.string)]),
        locale: DataTypes.object,
        disabledDate: DataTypes.func,
        placeholder: DataTypes.string,
        selectedValue: DataTypes.object,
        inputMode: DataTypes.string
    },

    initData() {
        return {
            showDate: '',
            invalid: false,
            hasFocus: true
        };
    },

    inited() {
github ecomfe / santd / santd / skeleton / Paragraph.js View on Github external
* @file 组件 skeleton/Paragraph
 * @author baozhixin 
 * @borrows https://ant.design/components/skeleton-cn/
 */

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

const prefixCls = classCreator('skeleton')('paragraph');
const widthUnit = DataTypes.oneOfType([DataTypes.number, DataTypes.string]);

export const SkeletonParagraphProps = DataTypes.oneOfType([
    DataTypes.bool,
    DataTypes.shape({
        rows: DataTypes.number,
        width: DataTypes.oneOfType([widthUnit, DataTypes.arrayOf(widthUnit)])
    })
]);

export default san.defineComponent({
    template: `
        <ul class="${prefixCls}">
            <li style="{{index | getWidth(props)}}">
        </li></ul>
    `,
    dataTypes: {
        props: SkeletonParagraphProps
    },
    computed: {
        rowList() {
            const rows = this.data.get('props.rows') || 0;
            return new Array(rows);
github ecomfe / santd / src / select / Select.js View on Github external
'tags',
            'combobox',
            SECRET_COMBOBOX_MODE_DO_NOT_USE
        ]),
        notFoundContent: DataTypes.string,
        optionFilterProp: DataTypes.string,
        optionLabelProp: DataTypes.string,
        placeholder: DataTypes.string,
        showArrow: DataTypes.bool,
        showSearch: DataTypes.bool,
        size: DataTypes.oneOf([
            'default',
            'large',
            'small'
        ]),
        tokenSeparators: DataTypes.arrayOf(DataTypes.string),
        value: valueType,
        defaultOpen: DataTypes.bool,
        open: DataTypes.bool,
        loading: DataTypes.bool
    },

    computed: {
        modeConfig() {
            const mode = this.data.get('mode');
            const multiple = mode === 'multiple';
            const tags = mode === 'tags';
            const combobox = mode === 'combobox' || mode === SECRET_COMBOBOX_MODE_DO_NOT_USE;

            return {
                multiple,
                tags,
github baidu / san-devtool / src / panel / components / TreeView / TreeView.js View on Github external
&gt;
                
            
        
    `,

    dataTypes: {
        compact: DataTypes.bool,
        wholeLineSelected: DataTypes.bool,
        keepingSelected: DataTypes.bool,
        defaultSelectedIdentity: DataTypes.string,
        filterBar: DataTypes.bool,
        filterBarHintText: DataTypes.string,
        dataSource: DataTypes.oneOf(['ATTRIBUTE', 'JSON']),
        highlighted: DataTypes.bool,
        treeData: DataTypes.arrayOf(DataTypes.object),
        loading: DataTypes.bool,
        loadingToast: DataTypes.string,
        loadingAsync: DataTypes.bool,
        progress: DataTypes.number
    },

    components: {
        'san-icon': Icon,
        'san-text-field': TextField,
        'san-tree-view-item': TreeViewItem,
    },

    inited() {
    },

    initData() {