How to use eoo - 10 common examples

To help you get started, we’ve selected a few eoo 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 / esui-family / dep / ub-ria-ui / 1.0.0-beta.2 / src / selectors / SelectorTreeStrategy.js View on Github external
function (require) {
        var TreeStrategy = require('esui/TreeStrategy');
        var eoo = require('eoo');
        var u = require('underscore');

        /**
         * 树的数据交互策略
         *
         * @class ui.SelectorTreeStrategy
         */
        var SelectorTreeStrategy = eoo.create(
            TreeStrategy,
            {

                /**
                 * @constructs ui.SelectorTreeStrategy
                 * @override
                 * @param {Object=} options 初始化参数
                 * @param {boolean=} options.defaultExpand 节点是否展开,默认为`false`
                 */
                constructor: function (options) {
                    var defaults = {
                        defaultExpand: true,
                        // 需要一种定向展开的策略,
                        // 也就是允许某些符合条件的节点展开,某些不展开
                        orientExpand: false
                    };
github ecomfe / esui-family / dep / ub-ria-ui / 1.0.0-beta / src / selectors / TableRichSelectorWithFilter.js View on Github external
}
            // 相当于执行清空操作
            else {
                this.clearQuery();
            }
        };

        /**
         * 获取筛选区Panel
         * @return {esui.Panel}
         */
        exports.getFilter = function () {
            return this.getChild('body').getChild('filter');
        };

        var TableRichSelectorWithFilter = require('eoo').create(TableRichSelector, exports);

        require('esui').register(TableRichSelectorWithFilter);

        return TableRichSelectorWithFilter;
    }
);
github ecomfe / esui / src / behavior / Mouse.js View on Github external
}
        );

        /**
         * 抽象鼠标行为,包括鼠标事件的捕获、开始、移动、结束等,
         *     $(element).mouse(
         *         {
         *             distance: 2,
         *             delay: 10,
         *             onMousestart: function () {},
         *             onMousedrag: function () {},
         *             onMousestop: function () {}
         *         }
         *     );
         */
        var Mouse = eoo.create(
            Base,
            {
                type: type,

                /**
                 * 构造函数
                 * @param {Object} options 配置
                 * @param {DOMElement} element DOM元素
                 * options属性参考defaultProperties
                 */
                constructor: function (options, element) {
                    options = u.extend(
                        {
                            // 不触发元素
                            cancel: 'input, textarea, button, select, option',
                            // 鼠标移动距离阈值,大于该值才触发
github ecomfe / esui-family / dep / esui / 3.2.0-beta.6 / src / extension / AutoSort.js View on Github external
var eoo = require('eoo');
        var esui = require('esui');

        /**
         * 表格自动排序扩展
         *
         * 当表格加上此扩展后,其排序功能将由扩展自动提供
         *
         * 扩展默认使用简单的两值相减(字符串用`localeCompare`)的方法判断大小,
         * 也可以在表格具体列的配置中给出`comparer`属性来提供自定义的排序算法
         *
         * @class extension.AutoSort
         * @extends Extension
         * @constructor
         */
        var AutoSort = eoo.create(
            Extension,
            {

                /**
                 * 指定扩展类型,始终为`"AutoSort"`
                 *
                 * @type {string}
                 */
                type: 'AutoSort',

                /**
                 * 激活扩展
                 *
                 * @override
                 */
                activate: function () {
github ecomfe / esui-family / dep / esui / 3.2.0-beta.6 / src / extension / AutoTipLayer.js View on Github external
* panel.on('tipbeforeshow', function (e) {
         *     if (e.title === 'submit') {
         *         this.setTitle('确认');
         *         this.setContent('确认后才可以点击!');
         *     }
         *     else {
         *         this.setContent('取消的提示!');
         *     }
         *     e.preventDefault();
         * });
         *
         * @class extension.AutoTipLayer
         * @extends Extension
         * @constructor
         */
        var AutoTipLayer = eoo.create(
            Extension,
            {

                /**
                 * 指定扩展类型,始终为`"AutoTipLayer"`
                 *
                 * @type {string}
                 */
                type: 'AutoTipLayer',

                /**
                 * 激活扩展
                 *
                 * @override
                 */
                activate: function () {
github ecomfe / esui-family / dep / ub-ria-ui / 1.0.0-beta.2 / src / MultiCalendar.js View on Github external
var InputControl = require('esui/InputControl');
        var Layer = require('esui/Layer');
        var ui = require('esui/main');
        var moment = require('moment');
        var u = require('underscore');
        var $ = require('jquery');
        var painters = require('esui/painters');

        /**
         * 双日历浮层
         *
         * @extends Layer
         * @ignore
         * @constructor
         */
        var MultiCalendarLayer = eoo.create(
            Layer,
            {
                create: function () {
                    var ele = this.$super(arguments);
                    $(this.control.main).after(ele);
                    $(ele).addClass(this.control.helper.getPrefixClass('multicalendar-layer'));
                    return ele;
                },

                /**
                 * 渲染双日历浮层
                 *
                 * @param  {HTMLElement} element 浮层根元素
                 * @inner
                 */
                render: function (element) {
github ecomfe / esui / src / extension / AutoTipLayer.js View on Github external
* panel.on('tipbeforeshow', function (e) {
         *     if (e.title === 'submit') {
         *         this.setTitle('确认');
         *         this.setContent('确认后才可以点击!');
         *     }
         *     else {
         *         this.setContent('取消的提示!');
         *     }
         *     e.preventDefault();
         * });
         *
         * @class extension.AutoTipLayer
         * @extends Extension
         * @constructor
         */
        var AutoTipLayer = eoo.create(
            Extension,
            {

                /**
                 * 指定扩展类型,始终为`"AutoTipLayer"`
                 *
                 * @type {string}
                 */
                type: 'AutoTipLayer',

                /**
                 * 激活扩展
                 *
                 * @override
                 */
                activate: function () {
github ecomfe / esui-family / dep / esui / 3.2.0-beta.6 / src / Validity.js View on Github external
function (require) {
        var u = require('underscore');
        var eoo = require('eoo');
        var esui = require('./main');
        var Control = require('./Control');
        var Helper = require('./Helper');
        var painters = require('./painters');
        var $ = require('jquery');

        /**
         * 验证信息显示控件
         *
         * @extends Control
         * @constructor
         */
        var Validity = eoo.create(
            Control,
            {

                type: 'Validity',

                /**
                 * 创建主元素,默认使用`<label>`元素
                 *
                 * @return {HTMLElement}
                 * @protected
                 * @override
                 */
                createMain: function () {
                    return document.createElement('label');
                },
</label>
github ecomfe / esui-family / dep / esui / 3.2.0-beta.2 / src / Sidebar.js View on Github external
function (require) {
        var eoo = require('eoo');
        var lib = require('./lib');
        var Control = require('./Control');
        var esui = require('./main');
        var Panel = require('./Panel');
        var $ = require('jquery');
        var u = require('underscore');

        /**
         * Sidebar控件
         *
         * @param {Object=} options 初始化参数
         * @constructor
         */
        var Sidebar = eoo.create(
            Control,
            {

                type: 'Sidebar',

                /**
                 * 创建控件主元素
                 *
                 * @return {HTMLElement}
                 * @override
                 * @protected
                 */
                createMain: function (options) {
                    if (!options.tagName) {
                        return this.$super([options]);
                    }
github ecomfe / esui-family / dep / esui / 3.2.0-beta.2 / src / BoxGroup.js View on Github external
function (require) {
        var u = require('underscore');
        var lib = require('./lib');
        var InputControl = require('./InputControl');
        var $ = require('jquery');
        var painters = require('./painters');
        var esui = require('./main');

        /**
         * 单选或复选框组控件
         *
         * @extends InputControl
         * @constructor
         */
        var BoxGroup = require('eoo').create(
            InputControl,
            {
                /**
                 * 控件类型,始终为`"BoxGroup"`
                 *
                 * @type {string}
                 * @readonly
                 * @override
                 */
                type: 'BoxGroup',

                /**
                 * 初始化参数
                 *
                 * @param {Object} [options] 构造函数传入的参数
                 * @protected

eoo

A powerful Javascript Class Factory (Object oriented)

MIT
Latest version published 8 years ago

Package Health Score

42 / 100
Full package analysis

Popular eoo functions