How to use the san.inherits 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 / collapse / panel.js View on Github external
const prefixCls = classCreator('collapse')();

const CollapsePanel = san.defineComponent({
    inited() {
        const showArrow = this.data.get('showArrow');
        const className = this.data.get('className');
        let classArr = [];

        className && classArr.push(className);
        !showArrow && classArr.push(`${prefixCls}-no-arrow`);
        this.data.set('className', classArr.join(' '));
    }
});

san.inherits(CollapsePanel, Collapse.Panel);
export default CollapsePanel;
github ecomfe / santd / santd / tabs / index.js View on Github external
},
                    computed: {
                        ...scrollableInkTabBar.prototype.computed,
                        className() {
                            const tabPosition = this.data.get('tabBarPosition');
                            const size = this.data.get('size');
                            const type = this.data.get('type');
                            let classArr = [`${prefixCls}-${tabPosition}-bar`];
                            !!size && classArr.push(`${prefixCls}-${size}-bar`);
                            type && type.indexOf('card') >= 0 && classArr.push(`${prefixCls}-card-bar`);
                            return classArr.join(' ');
                        }
                    }
                });

                san.inherits(tabBar, scrollableInkTabBar);
                return tabBar;
            },
            defaultRenderTabContent() {
github ecomfe / santd / santd / tabs / index.js View on Github external
hasTabPaneAnimated: hasTabPaneAnimated,
                            animatedWithMargin: true
                        };
                    },
                    computed: {
                        ...TabContent.prototype.computed,
                        className() {
                            const tabPosition = this.data.get('tabBarPosition');
                            const type = this.data.get('type') || '';
                            let classArr = [`${prefixCls}-${tabPosition}-content`];
                            type.indexOf('card') >= 0 && classArr.push(prefixCls + '-card-content');
                            return classArr.join(' ');
                        }
                    }
                });
                san.inherits(newTabContent, TabContent);
                return newTabContent;
            },
            injectComponent(tab) {
github ecomfe / santd / santd / collapse / collapse.js View on Github external
}
    },
    initData() {
        return {
            prefixCls,
            bordered: true,
            accordion: false,
            destroyInactivePanel: false,
            children: [],
            expandIcon: expandIcon
        };
    }
});


san.inherits(Collapse, BaseCollapse);

export default Collapse;
github ecomfe / santd / santd / radio / radioButton.js View on Github external
import './style/index.less';
import san from 'san';
import {classCreator} from '../core/util';
import Radio from './radio';
const prefixCls = classCreator('radio-button')();

const radioButton = san.defineComponent({
    initData() {
        return {
            prefixCls
        };
    }
});

san.inherits(radioButton, Radio);
export default radioButton;