'a'
mh-two-thousand-and-two
2024-04-12 44d2c92345cd156a59fc327b3060292a282d2893
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
var Select = require('./Select');
var $offset = require('./$offset');
var $show = require('./$show');
var $css = require('./$css');
var $attr = require('./$attr');
var $property = require('./$property');
var last = require('./last');
var $remove = require('./$remove');
var $data = require('./$data');
var $event = require('./$event');
var $class = require('./$class');
var $insert = require('./$insert');
var isUndef = require('./isUndef');
var isStr = require('./isStr');
exports = function(selector) {
    return new Select(selector);
};
Select.methods({
    offset: function() {
        return $offset(this);
    },
    hide: function() {
        return this.css('display', 'none');
    },
    show: function() {
        $show(this);
        return this;
    },
    first: function() {
        return exports(this[0]);
    },
    last: function() {
        return exports(last(this));
    },
    get: function(idx) {
        return this[idx];
    },
    eq: function(idx) {
        return exports(this[idx]);
    },
    on: function(event, selector, handler) {
        $event.on(this, event, selector, handler);
        return this;
    },
    off: function(event, selector, handler) {
        $event.off(this, event, selector, handler);
        return this;
    },
    html: function(val) {
        var result = $property.html(this, val);
        if (isUndef(val)) return result;
        return this;
    },
    text: function(val) {
        var result = $property.text(this, val);
        if (isUndef(val)) return result;
        return this;
    },
    val: function(val) {
        var result = $property.val(this, val);
        if (isUndef(val)) return result;
        return this;
    },
    css: function(name, val) {
        var result = $css(this, name, val);
        if (isGetter(name, val)) return result;
        return this;
    },
    attr: function(name, val) {
        var result = $attr(this, name, val);
        if (isGetter(name, val)) return result;
        return this;
    },
    data: function(name, val) {
        var result = $data(this, name, val);
        if (isGetter(name, val)) return result;
        return this;
    },
    rmAttr: function(name) {
        $attr.remove(this, name);
        return this;
    },
    remove: function() {
        $remove(this);
        return this;
    },
    addClass: function(name) {
        $class.add(this, name);
        return this;
    },
    rmClass: function(name) {
        $class.remove(this, name);
        return this;
    },
    toggleClass: function(name) {
        $class.toggle(this, name);
        return this;
    },
    hasClass: function(name) {
        return $class.has(this, name);
    },
    parent: function() {
        return exports(this[0].parentNode);
    },
    append: function(val) {
        $insert.append(this, val);
        return this;
    },
    prepend: function(val) {
        $insert.prepend(this, val);
        return this;
    },
    before: function(val) {
        $insert.before(this, val);
        return this;
    },
    after: function(val) {
        $insert.after(this, val);
        return this;
    }
});
var isGetter = function(name, val) {
    return isUndef(val) && isStr(name);
};
 
module.exports = exports;