mazey 1.4.35 → 1.4.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,89 +1,89 @@
1
- // 集合
2
- export default function MSet () {
3
- this.dataStore = [];
4
- this.add = add;
5
- this.remove = remove;
6
- this.size = size;
7
- this.show = show;
8
- this.contains = contains;
9
- this.union = union;
10
- this.intersect = intersect;
11
- this.subset = subset;
12
- this.difference = difference;
13
- }
14
- function add (data) {
15
- if (this.dataStore.indexOf(data) < 0) {
16
- this.dataStore.push(data);
17
- return true;
18
- } else {
19
- return false;
20
- }
21
- }
22
- function remove (data) {
23
- let pos = this.dataStore.indexOf(data);
24
- if (pos > -1) {
25
- this.dataStore.splice(pos, 1);
26
- return true;
27
- } else {
28
- return false;
29
- }
30
- }
31
- function size () {
32
- return this.dataStore.length;
33
- }
34
- function show () {
35
- return this.dataStore;
36
- }
37
- function contains (data) {
38
- if (this.dataStore.indexOf(data) > -1) {
39
- return true;
40
- } else {
41
- return false;
42
- }
43
- }
44
- // 并集
45
- function union (set) {
46
- let tempSet = new MSet();
47
- for (let i = 0; i < this.dataStore.length; ++i) {
48
- tempSet.add(this.dataStore[i]);
49
- }
50
- for (let i = 0; i < set.dataStore.length; ++i) {
51
- if (!tempSet.contains(set.dataStore[i])) {
52
- tempSet.dataStore.push(set.dataStore[i]);
53
- }
54
- }
55
- return tempSet;
56
- }
57
- // 交集
58
- function intersect (set) {
59
- let tempSet = new MSet();
60
- for (let i = 0; i < this.dataStore.length; ++i) {
61
- if (set.contains(this.dataStore[i])) {
62
- tempSet.add(this.dataStore[i]);
63
- }
64
- }
65
- return tempSet;
66
- }
67
- // 子集
68
- function subset (set) {
69
- if (this.size() > set.size()) {
70
- return false;
71
- } else {
72
- for (let i = 0; i < this.dataStore.length; ++i) {
73
- if (!set.contains(this.dataStore[i])) {
74
- return false;
75
- }
76
- }
77
- }
78
- return true;
79
- }
80
- // 差集
81
- function difference (set) {
82
- let tempSet = new MSet();
83
- for (let i = 0; i < this.dataStore.length; ++i) {
84
- if (!set.contains(this.dataStore[i])) {
85
- tempSet.add(this.dataStore[i]);
86
- }
87
- }
88
- return tempSet;
89
- }
1
+ // 集合
2
+ export default function MSet () {
3
+ this.dataStore = [];
4
+ this.add = add;
5
+ this.remove = remove;
6
+ this.size = size;
7
+ this.show = show;
8
+ this.contains = contains;
9
+ this.union = union;
10
+ this.intersect = intersect;
11
+ this.subset = subset;
12
+ this.difference = difference;
13
+ }
14
+ function add (data) {
15
+ if (this.dataStore.indexOf(data) < 0) {
16
+ this.dataStore.push(data);
17
+ return true;
18
+ } else {
19
+ return false;
20
+ }
21
+ }
22
+ function remove (data) {
23
+ let pos = this.dataStore.indexOf(data);
24
+ if (pos > -1) {
25
+ this.dataStore.splice(pos, 1);
26
+ return true;
27
+ } else {
28
+ return false;
29
+ }
30
+ }
31
+ function size () {
32
+ return this.dataStore.length;
33
+ }
34
+ function show () {
35
+ return this.dataStore;
36
+ }
37
+ function contains (data) {
38
+ if (this.dataStore.indexOf(data) > -1) {
39
+ return true;
40
+ } else {
41
+ return false;
42
+ }
43
+ }
44
+ // 并集
45
+ function union (set) {
46
+ let tempSet = new MSet();
47
+ for (let i = 0; i < this.dataStore.length; ++i) {
48
+ tempSet.add(this.dataStore[i]);
49
+ }
50
+ for (let i = 0; i < set.dataStore.length; ++i) {
51
+ if (!tempSet.contains(set.dataStore[i])) {
52
+ tempSet.dataStore.push(set.dataStore[i]);
53
+ }
54
+ }
55
+ return tempSet;
56
+ }
57
+ // 交集
58
+ function intersect (set) {
59
+ let tempSet = new MSet();
60
+ for (let i = 0; i < this.dataStore.length; ++i) {
61
+ if (set.contains(this.dataStore[i])) {
62
+ tempSet.add(this.dataStore[i]);
63
+ }
64
+ }
65
+ return tempSet;
66
+ }
67
+ // 子集
68
+ function subset (set) {
69
+ if (this.size() > set.size()) {
70
+ return false;
71
+ } else {
72
+ for (let i = 0; i < this.dataStore.length; ++i) {
73
+ if (!set.contains(this.dataStore[i])) {
74
+ return false;
75
+ }
76
+ }
77
+ }
78
+ return true;
79
+ }
80
+ // 差集
81
+ function difference (set) {
82
+ let tempSet = new MSet();
83
+ for (let i = 0; i < this.dataStore.length; ++i) {
84
+ if (!set.contains(this.dataStore[i])) {
85
+ tempSet.add(this.dataStore[i]);
86
+ }
87
+ }
88
+ return tempSet;
89
+ }
@@ -1,63 +1,63 @@
1
- // Production steps of ECMA-262, Edition 5, 15.4.4.21
2
- // Reference: http://es5.github.io/#x15.4.4.21
3
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
4
- if (!Array.prototype.reduce) {
5
- Object.defineProperty(Array.prototype, 'reduce', {
6
- value: function(callback /*, initialValue*/) {
7
- if (this === null) {
8
- throw new TypeError( 'Array.prototype.reduce ' +
9
- 'called on null or undefined' );
10
- }
11
- if (typeof callback !== 'function') {
12
- throw new TypeError( callback +
13
- ' is not a function');
14
- }
15
-
16
- // 1. Let O be ? ToObject(this value).
17
- var o = Object(this);
18
-
19
- // 2. Let len be ? ToLength(? Get(O, "length")).
20
- var len = o.length >>> 0;
21
-
22
- // Steps 3, 4, 5, 6, 7
23
- var k = 0;
24
- var value;
25
-
26
- if (arguments.length >= 2) {
27
- value = arguments[1];
28
- } else {
29
- while (k < len && !(k in o)) {
30
- k++;
31
- }
32
-
33
- // 3. If len is 0 and initialValue is not present,
34
- // throw a TypeError exception.
35
- if (k >= len) {
36
- throw new TypeError( 'Reduce of empty array ' +
37
- 'with no initial value' );
38
- }
39
- value = o[k++];
40
- }
41
-
42
- // 8. Repeat, while k < len
43
- while (k < len) {
44
- // a. Let Pk be ! ToString(k).
45
- // b. Let kPresent be ? HasProperty(O, Pk).
46
- // c. If kPresent is true, then
47
- // i. Let kValue be ? Get(O, Pk).
48
- // ii. Let accumulator be ? Call(
49
- // callbackfn, undefined,
50
- // « accumulator, kValue, k, O »).
51
- if (k in o) {
52
- value = callback(value, o[k], k, o);
53
- }
54
-
55
- // d. Increase k by 1.
56
- k++;
57
- }
58
-
59
- // 9. Return accumulator.
60
- return value;
61
- }
62
- });
63
- }
1
+ // Production steps of ECMA-262, Edition 5, 15.4.4.21
2
+ // Reference: http://es5.github.io/#x15.4.4.21
3
+ // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
4
+ if (!Array.prototype.reduce) {
5
+ Object.defineProperty(Array.prototype, 'reduce', {
6
+ value: function(callback /*, initialValue*/) {
7
+ if (this === null) {
8
+ throw new TypeError( 'Array.prototype.reduce ' +
9
+ 'called on null or undefined' );
10
+ }
11
+ if (typeof callback !== 'function') {
12
+ throw new TypeError( callback +
13
+ ' is not a function');
14
+ }
15
+
16
+ // 1. Let O be ? ToObject(this value).
17
+ var o = Object(this);
18
+
19
+ // 2. Let len be ? ToLength(? Get(O, "length")).
20
+ var len = o.length >>> 0;
21
+
22
+ // Steps 3, 4, 5, 6, 7
23
+ var k = 0;
24
+ var value;
25
+
26
+ if (arguments.length >= 2) {
27
+ value = arguments[1];
28
+ } else {
29
+ while (k < len && !(k in o)) {
30
+ k++;
31
+ }
32
+
33
+ // 3. If len is 0 and initialValue is not present,
34
+ // throw a TypeError exception.
35
+ if (k >= len) {
36
+ throw new TypeError( 'Reduce of empty array ' +
37
+ 'with no initial value' );
38
+ }
39
+ value = o[k++];
40
+ }
41
+
42
+ // 8. Repeat, while k < len
43
+ while (k < len) {
44
+ // a. Let Pk be ! ToString(k).
45
+ // b. Let kPresent be ? HasProperty(O, Pk).
46
+ // c. If kPresent is true, then
47
+ // i. Let kValue be ? Get(O, Pk).
48
+ // ii. Let accumulator be ? Call(
49
+ // callbackfn, undefined,
50
+ // « accumulator, kValue, k, O »).
51
+ if (k in o) {
52
+ value = callback(value, o[k], k, o);
53
+ }
54
+
55
+ // d. Increase k by 1.
56
+ k++;
57
+ }
58
+
59
+ // 9. Return accumulator.
60
+ return value;
61
+ }
62
+ });
63
+ }
@@ -1,4 +1,4 @@
1
- // 时间戳
2
- export const mNow = Date.now || function () {
3
- return new Date().getTime();
4
- };
1
+ // 时间戳
2
+ export const mNow = Date.now || function () {
3
+ return new Date().getTime();
4
+ };
@@ -1,149 +1,149 @@
1
- %m-pointer {
2
- cursor: pointer;
3
- }
4
-
5
- %m-show{
6
- display: block;
7
- }
8
-
9
- %m-hide{
10
- display: none;
11
- }
12
-
13
- %m-flex-middle {
14
- display: flex;
15
- align-items: center;
16
- }
17
-
18
- %m-flex-center {
19
- display: flex;
20
- justify-content: center;
21
- }
22
-
23
- %m-flex-centre {
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- }
28
-
29
- %m-ellipsis{
30
- overflow: hidden;
31
- text-overflow: ellipsis;
32
- white-space: nowrap;
33
- }
34
-
35
- %m-wrap{
36
- word-break: break-all;
37
- word-wrap: break-word;
38
- }
39
-
40
- %m-table{
41
- width: 100%;
42
- //border: 1px solid #E4EBEE;
43
- background: 0 0;
44
- font-size: 12px;
45
- border-collapse: collapse;
46
- %unity{
47
- text-align: left;
48
- padding: 10px 15px;
49
- }
50
- >thead{
51
- >tr{
52
- >th{
53
- @extend %unity;
54
- color: #242a30;
55
- font-weight: 600;
56
- border-bottom: 1px solid #b6c2c9 !important;
57
- }
58
- }
59
- }
60
- >tbody{
61
- >tr{
62
- >td{
63
- @extend %unity;
64
- color: #707478;
65
- border-top: 1px solid #dee2e6;
66
- }
67
- }
68
- }
69
- // 斑马线
70
- &.table-striped tbody tr{
71
- &:nth-of-type(odd) {
72
- background-color: rgba(0,0,0,.05);
73
- }
74
- >td{
75
- border-top-width: 0;
76
- }
77
- }
78
- // 悬浮变色
79
- &.table-hover tbody tr{
80
- &:hover{
81
- background-color: rgba(0,0,0,.05);
82
- }
83
- }
84
- // 有框
85
- &.table-bordered{
86
- th,
87
- td{
88
- border: 1px solid #dee2e6;
89
- }
90
- }
91
- // 排序
92
- .m-table-is-sort{
93
- @extend %m-pointer;
94
- .m-table-sort{
95
- display: inline-flex;
96
- flex-direction: column;
97
- align-items: center;
98
- height: 34px;
99
- width: 24px;
100
- vertical-align: middle;
101
- cursor: pointer;
102
- overflow: initial;
103
- position: relative;
104
- >i{
105
- width: 0;
106
- height: 0;
107
- border: 5px solid transparent;
108
- position: absolute;
109
- left: 7px;
110
- &.sort-ascend{
111
- border-bottom-color: #c0c4cc;
112
- top: 5px;
113
- &.active{
114
- border-bottom-color: #409EFF;
115
- }
116
- }
117
- &.sort-descend{
118
- border-top-color: #c0c4cc;
119
- bottom: 7px;
120
- &.active{
121
- border-top-color: #409EFF;
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- %m-scroll-bar{
130
- overflow-y: auto;
131
- /*滚动条的宽度*/
132
- &::-webkit-scrollbar{
133
- width: 6px;
134
- }
135
- /* 滚动条的滑轨背景颜色 */
136
- &::-webkit-scrollbar-track {
137
- background-color: transparent; // red;
138
- -webkit-border-radius: 2em;
139
- -moz-border-radius: 2em;
140
- border-radius:2em;
141
- }
142
- /* 滑块颜色 */
143
- &::-webkit-scrollbar-thumb {
144
- background-color:darken(#EEEEEE, 10%); // green;
145
- -webkit-border-radius: 2em;
146
- -moz-border-radius: 2em;
147
- border-radius:2em;
148
- }
1
+ %m-pointer {
2
+ cursor: pointer;
3
+ }
4
+
5
+ %m-show{
6
+ display: block;
7
+ }
8
+
9
+ %m-hide{
10
+ display: none;
11
+ }
12
+
13
+ %m-flex-middle {
14
+ display: flex;
15
+ align-items: center;
16
+ }
17
+
18
+ %m-flex-center {
19
+ display: flex;
20
+ justify-content: center;
21
+ }
22
+
23
+ %m-flex-centre {
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ }
28
+
29
+ %m-ellipsis{
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ white-space: nowrap;
33
+ }
34
+
35
+ %m-wrap{
36
+ word-break: break-all;
37
+ word-wrap: break-word;
38
+ }
39
+
40
+ %m-table{
41
+ width: 100%;
42
+ //border: 1px solid #E4EBEE;
43
+ background: 0 0;
44
+ font-size: 12px;
45
+ border-collapse: collapse;
46
+ %unity{
47
+ text-align: left;
48
+ padding: 10px 15px;
49
+ }
50
+ >thead{
51
+ >tr{
52
+ >th{
53
+ @extend %unity;
54
+ color: #242a30;
55
+ font-weight: 600;
56
+ border-bottom: 1px solid #b6c2c9 !important;
57
+ }
58
+ }
59
+ }
60
+ >tbody{
61
+ >tr{
62
+ >td{
63
+ @extend %unity;
64
+ color: #707478;
65
+ border-top: 1px solid #dee2e6;
66
+ }
67
+ }
68
+ }
69
+ // 斑马线
70
+ &.table-striped tbody tr{
71
+ &:nth-of-type(odd) {
72
+ background-color: rgba(0,0,0,.05);
73
+ }
74
+ >td{
75
+ border-top-width: 0;
76
+ }
77
+ }
78
+ // 悬浮变色
79
+ &.table-hover tbody tr{
80
+ &:hover{
81
+ background-color: rgba(0,0,0,.05);
82
+ }
83
+ }
84
+ // 有框
85
+ &.table-bordered{
86
+ th,
87
+ td{
88
+ border: 1px solid #dee2e6;
89
+ }
90
+ }
91
+ // 排序
92
+ .m-table-is-sort{
93
+ @extend %m-pointer;
94
+ .m-table-sort{
95
+ display: inline-flex;
96
+ flex-direction: column;
97
+ align-items: center;
98
+ height: 34px;
99
+ width: 24px;
100
+ vertical-align: middle;
101
+ cursor: pointer;
102
+ overflow: initial;
103
+ position: relative;
104
+ >i{
105
+ width: 0;
106
+ height: 0;
107
+ border: 5px solid transparent;
108
+ position: absolute;
109
+ left: 7px;
110
+ &.sort-ascend{
111
+ border-bottom-color: #c0c4cc;
112
+ top: 5px;
113
+ &.active{
114
+ border-bottom-color: #409EFF;
115
+ }
116
+ }
117
+ &.sort-descend{
118
+ border-top-color: #c0c4cc;
119
+ bottom: 7px;
120
+ &.active{
121
+ border-top-color: #409EFF;
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ %m-scroll-bar{
130
+ overflow-y: auto;
131
+ /*滚动条的宽度*/
132
+ &::-webkit-scrollbar{
133
+ width: 6px;
134
+ }
135
+ /* 滚动条的滑轨背景颜色 */
136
+ &::-webkit-scrollbar-track {
137
+ background-color: transparent; // red;
138
+ -webkit-border-radius: 2em;
139
+ -moz-border-radius: 2em;
140
+ border-radius:2em;
141
+ }
142
+ /* 滑块颜色 */
143
+ &::-webkit-scrollbar-thumb {
144
+ background-color:darken(#EEEEEE, 10%); // green;
145
+ -webkit-border-radius: 2em;
146
+ -moz-border-radius: 2em;
147
+ border-radius:2em;
148
+ }
149
149
  }
@@ -1,5 +1,5 @@
1
- @charset "utf-8";
2
- @import "variate/index";
3
- @import "extend/index";
4
- @import "mixin/index";
1
+ @charset "utf-8";
2
+ @import "variate/index";
3
+ @import "extend/index";
4
+ @import "mixin/index";
5
5
  // @import "font/iconfont";