@mdsfe/mds-ui 0.2.0

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.
Files changed (153) hide show
  1. package/CHANGELOG.md +778 -0
  2. package/LICENSE +21 -0
  3. package/README.md +106 -0
  4. package/dist/_locale/index.js +18 -0
  5. package/dist/_locale/zh-CN.js +123 -0
  6. package/dist/_mixin/emitter.js +35 -0
  7. package/dist/_mixin/focus.js +13 -0
  8. package/dist/_mixin/locale.js +17 -0
  9. package/dist/_mixin/popper.js +192 -0
  10. package/dist/_mixin/tooltip.js +218 -0
  11. package/dist/_util/__test__/switchcase.test.js +43 -0
  12. package/dist/_util/autoprefixer.js +249 -0
  13. package/dist/_util/clickoutside.js +79 -0
  14. package/dist/_util/date.js +368 -0
  15. package/dist/_util/dateUtil.js +311 -0
  16. package/dist/_util/dom.js +240 -0
  17. package/dist/_util/getRequestAnimationFrame.js +50 -0
  18. package/dist/_util/getScroll.js +21 -0
  19. package/dist/_util/loaders/loaders.css.js +52 -0
  20. package/dist/_util/loaders/loading.js +53 -0
  21. package/dist/_util/merge.js +18 -0
  22. package/dist/_util/popper.js +1261 -0
  23. package/dist/_util/popup/index.js +232 -0
  24. package/dist/_util/popup/popup-manager.js +205 -0
  25. package/dist/_util/proptype.js +12 -0
  26. package/dist/_util/repeatClick.js +30 -0
  27. package/dist/_util/resize.js +61 -0
  28. package/dist/_util/resizeEvent.js +59 -0
  29. package/dist/_util/scrollIntoView.js +38 -0
  30. package/dist/_util/scrollbar-width.js +37 -0
  31. package/dist/_util/soda.js +54 -0
  32. package/dist/_util/switchcase.js +22 -0
  33. package/dist/_util/throttleByAnimationFrame.js +70 -0
  34. package/dist/_util/tree/node.js +412 -0
  35. package/dist/_util/tree/tree.js +410 -0
  36. package/dist/_util/util.js +166 -0
  37. package/dist/_util/vue-popper.js +213 -0
  38. package/dist/affix.js +509 -0
  39. package/dist/anchor.js +522 -0
  40. package/dist/avatar.js +437 -0
  41. package/dist/backtop.js +469 -0
  42. package/dist/badge.js +439 -0
  43. package/dist/bordershadow.js +310 -0
  44. package/dist/breadcrumb.js +434 -0
  45. package/dist/button.js +579 -0
  46. package/dist/card.js +514 -0
  47. package/dist/carousel.js +1326 -0
  48. package/dist/cascaderpanel.js +2320 -0
  49. package/dist/checkbox.js +681 -0
  50. package/dist/col.js +546 -0
  51. package/dist/collapse.js +671 -0
  52. package/dist/color.js +306 -0
  53. package/dist/datepicker.js +8089 -0
  54. package/dist/divider.js +346 -0
  55. package/dist/drawer.js +652 -0
  56. package/dist/dropdown.js +687 -0
  57. package/dist/empty.js +416 -0
  58. package/dist/font.js +306 -0
  59. package/dist/form.js +878 -0
  60. package/dist/icon.js +401 -0
  61. package/dist/index.js +1 -0
  62. package/dist/input.js +1251 -0
  63. package/dist/inputnumber.js +689 -0
  64. package/dist/layout.js +786 -0
  65. package/dist/list.js +789 -0
  66. package/dist/loading.js +430 -0
  67. package/dist/mds-ui.min.css +7 -0
  68. package/dist/mds-ui.min.js +64911 -0
  69. package/dist/menu.js +1131 -0
  70. package/dist/message.js +1016 -0
  71. package/dist/modal.js +895 -0
  72. package/dist/notification.js +818 -0
  73. package/dist/pagination.js +1213 -0
  74. package/dist/popconfirm.js +336 -0
  75. package/dist/popover.js +206 -0
  76. package/dist/progress.js +1023 -0
  77. package/dist/radio.js +760 -0
  78. package/dist/rate.js +765 -0
  79. package/dist/row.js +546 -0
  80. package/dist/select.js +4950 -0
  81. package/dist/slider.js +1411 -0
  82. package/dist/slottable.js +1414 -0
  83. package/dist/steps.js +546 -0
  84. package/dist/style/affix.css +5524 -0
  85. package/dist/style/anchor.css +5572 -0
  86. package/dist/style/avatar.css +5587 -0
  87. package/dist/style/backtop.css +34 -0
  88. package/dist/style/badge.css +5655 -0
  89. package/dist/style/bordershadow.css +5601 -0
  90. package/dist/style/breadcrumb.css +5551 -0
  91. package/dist/style/button.css +7679 -0
  92. package/dist/style/card.css +5670 -0
  93. package/dist/style/carousel.css +5731 -0
  94. package/dist/style/cascaderpanel.css +125 -0
  95. package/dist/style/checkbox.css +5700 -0
  96. package/dist/style/col.css +8121 -0
  97. package/dist/style/collapse.css +5593 -0
  98. package/dist/style/color.css +6136 -0
  99. package/dist/style/datepicker.css +5977 -0
  100. package/dist/style/divider.css +5558 -0
  101. package/dist/style/drawer.css +7979 -0
  102. package/dist/style/dropdown.css +7950 -0
  103. package/dist/style/empty.css +5563 -0
  104. package/dist/style/font.css +5559 -0
  105. package/dist/style/form.css +5662 -0
  106. package/dist/style/icon.css +5538 -0
  107. package/dist/style/input.css +6256 -0
  108. package/dist/style/inputnumber.css +5828 -0
  109. package/dist/style/layout.css +5572 -0
  110. package/dist/style/list.css +5655 -0
  111. package/dist/style/loading.css +5540 -0
  112. package/dist/style/menu.css +6183 -0
  113. package/dist/style/message.css +194 -0
  114. package/dist/style/modal.css +5637 -0
  115. package/dist/style/notification.css +5706 -0
  116. package/dist/style/pagination.css +6683 -0
  117. package/dist/style/popconfirm.css +7951 -0
  118. package/dist/style/popover.css +5727 -0
  119. package/dist/style/progress.css +5714 -0
  120. package/dist/style/radio.css +5769 -0
  121. package/dist/style/rate.css +5616 -0
  122. package/dist/style/row.css +8121 -0
  123. package/dist/style/select.css +5729 -0
  124. package/dist/style/slider.css +5594 -0
  125. package/dist/style/slottable.css +5831 -0
  126. package/dist/style/steps.css +6100 -0
  127. package/dist/style/switch.css +5624 -0
  128. package/dist/style/table.css +8392 -0
  129. package/dist/style/tabs.css +6047 -0
  130. package/dist/style/tag.css +5935 -0
  131. package/dist/style/text.css +5636 -0
  132. package/dist/style/timeline.css +5602 -0
  133. package/dist/style/timepicker.css +5904 -0
  134. package/dist/style/tooltip.css +5686 -0
  135. package/dist/style/transfer.css +101 -0
  136. package/dist/style/transition.css +1417 -0
  137. package/dist/style/tree.css +5598 -0
  138. package/dist/style/typography.css +5640 -0
  139. package/dist/style/upload.css +5834 -0
  140. package/dist/switch.js +448 -0
  141. package/dist/table.js +3809 -0
  142. package/dist/tabs.js +1273 -0
  143. package/dist/tag.js +478 -0
  144. package/dist/text.js +1100 -0
  145. package/dist/timeline.js +495 -0
  146. package/dist/timepicker.js +1567 -0
  147. package/dist/tooltip.js +179 -0
  148. package/dist/transfer.js +981 -0
  149. package/dist/transition.js +246 -0
  150. package/dist/tree.js +1866 -0
  151. package/dist/typography.js +469 -0
  152. package/dist/upload.js +1990 -0
  153. package/package.json +144 -0
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
6
+
7
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
8
+
9
+ var _util = require('./util');
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
13
+ var Soda = function () {
14
+ function Soda(vm) {
15
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16
+ (0, _classCallCheck3.default)(this, Soda);
17
+
18
+ this.mutations = options.mutations;
19
+ (0, _util.assert)(typeof options.state === 'function', 'Soda state must be a function.');
20
+ this.state = options.state();
21
+ this.root = vm;
22
+ this.init(vm);
23
+ return this;
24
+ }
25
+
26
+ Soda.prototype.commit = function commit(type, payload) {
27
+ this.mutations[type].call(this, this.state, payload);
28
+ };
29
+
30
+ Soda.prototype.init = function init() {
31
+ var _this = this;
32
+
33
+ var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.root;
34
+
35
+ var map = function map(_vm) {
36
+ if (!_vm.$children.length) return;
37
+ _vm.$children.forEach(function (child) {
38
+ inject(child);
39
+ map(child);
40
+ });
41
+ };
42
+ var inject = function inject(_vm) {
43
+ if (typeof _vm.soda === 'undefined' || typeof _this.$soda !== 'undefined') return;
44
+ _vm.$soda = _this;
45
+ _vm.soda = _this.state;
46
+ };
47
+ root.soda = this.state;
48
+ map(root);
49
+ };
50
+
51
+ return Soda;
52
+ }();
53
+
54
+ exports.default = Soda;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ var executeIfFunction = function executeIfFunction(f) {
5
+ return typeof f === 'function' ? f() : f;
6
+ };
7
+
8
+ var switchcase = exports.switchcase = function switchcase(cases) {
9
+ return function (defaultCase) {
10
+ return function (key) {
11
+ return key in cases ? cases[key] : defaultCase;
12
+ };
13
+ };
14
+ };
15
+
16
+ var switchcaseF = exports.switchcaseF = function switchcaseF(cases) {
17
+ return function (defaultCase) {
18
+ return function (key) {
19
+ return executeIfFunction(switchcase(cases)(defaultCase)(key));
20
+ };
21
+ };
22
+ };
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _defineProperty = require('babel-runtime/core-js/object/define-property');
6
+
7
+ var _defineProperty2 = _interopRequireDefault(_defineProperty);
8
+
9
+ exports.default = throttleByAnimationFrame;
10
+ exports.throttleByAnimationFrameDecorator = throttleByAnimationFrameDecorator;
11
+
12
+ var _getRequestAnimationFrame = require('./getRequestAnimationFrame');
13
+
14
+ var _getRequestAnimationFrame2 = _interopRequireDefault(_getRequestAnimationFrame);
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var reqAnimFrame = (0, _getRequestAnimationFrame2.default)();
19
+
20
+ function throttleByAnimationFrame(fn) {
21
+ var requestId = void 0;
22
+
23
+ var later = function later(args) {
24
+ return function () {
25
+ requestId = null;
26
+ fn.apply(undefined, args);
27
+ };
28
+ };
29
+
30
+ var throttled = function throttled() {
31
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
32
+ args[_key] = arguments[_key];
33
+ }
34
+
35
+ if (requestId == null) {
36
+ requestId = reqAnimFrame(later(args));
37
+ }
38
+ };
39
+
40
+ throttled.cancel = function () {
41
+ return (0, _getRequestAnimationFrame.cancelRequestAnimationFrame)(requestId);
42
+ };
43
+
44
+ return throttled;
45
+ }
46
+
47
+ function throttleByAnimationFrameDecorator() {
48
+ return function (target, key, descriptor) {
49
+ var fn = descriptor.value;
50
+ var definingProperty = false;
51
+ return {
52
+ configurable: true,
53
+ get: function get() {
54
+ if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
55
+ return fn;
56
+ }
57
+
58
+ var boundFn = throttleByAnimationFrame(fn.bind(this));
59
+ definingProperty = true;
60
+ (0, _defineProperty2.default)(this, key, {
61
+ value: boundFn,
62
+ configurable: true,
63
+ writable: true
64
+ });
65
+ definingProperty = false;
66
+ return boundFn;
67
+ }
68
+ };
69
+ };
70
+ }
@@ -0,0 +1,412 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
6
+
7
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
8
+
9
+ var _createClass2 = require('babel-runtime/helpers/createClass');
10
+
11
+ var _createClass3 = _interopRequireDefault(_createClass2);
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ var defaultId = 0;
16
+
17
+ var Node = function () {
18
+ function Node(options) {
19
+ (0, _classCallCheck3.default)(this, Node);
20
+
21
+ this.id = defaultId++;
22
+ this.checked = false;
23
+ this.indeterminate = false;
24
+ this.data = null;
25
+ this.expanded = false;
26
+ this.parent = null;
27
+ this.isLeaf = false;
28
+
29
+ // 是否显示,用于搜索
30
+ this.visible = true;
31
+
32
+ for (var name in options) {
33
+ if (options.hasOwnProperty(name)) {
34
+ this[name] = options[name];
35
+ }
36
+ }
37
+
38
+ this.level = 0;
39
+ // 是否被选中
40
+ this.selected = false;
41
+ // 是否已经加载完毕,用于懒加载
42
+ this.loaded = false;
43
+ // 是否是加载中状态,用于懒加载
44
+ this.loading = false;
45
+ this.childNodes = [];
46
+ this.parent ? this.level = this.parent.level + 1 : this.level = 0;
47
+ this.update();
48
+ }
49
+
50
+ Node.prototype.update = function update() {
51
+ var _this = this;
52
+
53
+ if (!this.data) {
54
+ this.handleIsLeaf();
55
+ return;
56
+ }
57
+ var data = this.data;
58
+ var prop = this.tree.prop;
59
+
60
+ // 生成_nodeId
61
+ // this.markData(data)
62
+ // 非根节点添加到nodesMap中
63
+ this.fillNodesMap();
64
+ // 处理defaultExpandAll
65
+ if (!this.load && this.tree.defaultExpandAll) {
66
+ this.expanded = true;
67
+ }
68
+ // 处理defaultExpandedKeys
69
+ if (!this.load && this.tree.defaultExpandedKeys) {
70
+ this.tree.defaultExpandedKeys.forEach(function (item) {
71
+ if (_this.key === item) {
72
+ _this.expanded = true;
73
+ if (_this.tree.autoExpandParent) {
74
+ _this.getPath(true).forEach(function (node) {
75
+ node.expanded = true;
76
+ });
77
+ }
78
+ }
79
+ });
80
+ }
81
+
82
+ // 生成childNodes
83
+ var children = void 0;
84
+ // 根节点的情况把整个data作为children
85
+ if (Array.isArray(data) && this.level === 0) {
86
+ children = data;
87
+ this.id = 'root';
88
+ } else if (data.hasOwnProperty(prop.children)) {
89
+ children = data[prop.children];
90
+ } else {
91
+ if (!this.tree.load) this.isLeaf = true;
92
+ }
93
+
94
+ if (Array.isArray(children) && children.length > 0) {
95
+ children.forEach(function (data) {
96
+ _this.appendChild(data);
97
+ });
98
+ } else {
99
+ if (!this.tree.load) this.isLeaf = true;
100
+ }
101
+ this.handleIsLeaf();
102
+ };
103
+
104
+ Node.prototype.handleIsLeaf = function handleIsLeaf() {
105
+ // 懒加载且未加载的情况
106
+ if (this.tree.load && !this.loaded) {
107
+ this.isLeaf = this.getTrueData('isLeaf');
108
+ }
109
+ // 非懒加载或懒加载但已加载的情况
110
+ if (!this.tree.load || this.tree.load && this.loaded) {
111
+ var childNodes = this.childNodes;
112
+ this.isLeaf = !childNodes || childNodes.length === 0;
113
+ }
114
+ };
115
+
116
+ Node.prototype.fillNodesMap = function fillNodesMap() {
117
+ var key = this.key;
118
+ if (!key && this.level !== 0) {
119
+ throw new Error('必须指定节点的key');
120
+ }
121
+ if (key) {
122
+ // 处理初始选中的节点
123
+ this.handleSelectedKey(key);
124
+ if (this.tree.nodesMap.get(key)) {
125
+ throw new Error('节点的key不能重复');
126
+ }
127
+ this.tree.nodesMap.set(key, this);
128
+ }
129
+ };
130
+
131
+ Node.prototype.handleSelectedKey = function handleSelectedKey(key) {
132
+ this.selected = false;
133
+ if (this.tree.selectedKey === key) {
134
+ this.selected = true;
135
+ }
136
+ };
137
+
138
+ Node.prototype.appendChild = function appendChild(data, index) {
139
+ var child = new Node({
140
+ parent: this,
141
+ data: data,
142
+ tree: this.tree
143
+ });
144
+ if (index) {
145
+ this.childNodes.splice(index, 0, child);
146
+ } else {
147
+ this.childNodes.push(child);
148
+ }
149
+ };
150
+
151
+ Node.prototype.getTrueData = function getTrueData(prop) {
152
+ var props = this.tree.prop[prop];
153
+ var data = this.data;
154
+ if (!data) return;
155
+ if (data.hasOwnProperty(props)) {
156
+ return data[props];
157
+ } else if (data.hasOwnProperty(prop)) {
158
+ return data[prop];
159
+ } else {
160
+ return null;
161
+ }
162
+ };
163
+
164
+ Node.prototype.markData = function markData(data) {
165
+ Object.defineProperty(data, '_node', {
166
+ value: this,
167
+ enumerable: false,
168
+ configurable: false,
169
+ writable: false
170
+ });
171
+ if (!Array.isArray(data)) {
172
+ Object.defineProperty(data, '_nodeId', {
173
+ value: this.id,
174
+ enumerable: false,
175
+ configurable: false,
176
+ writable: false
177
+ });
178
+ } else if (this.level === 0) {
179
+ Object.defineProperty(data, '_nodeId', {
180
+ value: 'root',
181
+ enumerable: false,
182
+ configurable: false,
183
+ writable: false
184
+ });
185
+ }
186
+ };
187
+
188
+ Node.prototype.changeExpanded = function changeExpanded(value) {
189
+ if (this.tree.load && !this.loaded) {
190
+ this.loadNode();
191
+ }
192
+ if (!this.tree.load || this.loaded) {
193
+ this.expanded = value;
194
+ }
195
+ // 手风琴模式展开的时候所有兄弟节点收起
196
+ if (this.tree.accordion && value && !this.tree.searchNodeMethod) {
197
+ this.siblingsNodes.forEach(function (node) {
198
+ node.expanded = false;
199
+ });
200
+ }
201
+ };
202
+
203
+ Node.prototype.loadNode = function loadNode() {
204
+ var _this2 = this;
205
+
206
+ var node = this;
207
+ if (node.loaded || node.loading || node.childNodes.length > 0) {
208
+ return;
209
+ }
210
+ node.loading = true;
211
+ node.tree.load(node.data, function (data) {
212
+ if (!Array.isArray(data)) throw new Error('传入子元素必须是数组');
213
+ data.forEach(function (data) {
214
+ node.appendChild(data);
215
+ });
216
+ node.loading = false;
217
+ node.loaded = true;
218
+ node.check = false;
219
+ node.expanded = true;
220
+ _this2.handleIsLeaf();
221
+ });
222
+ };
223
+
224
+ Node.prototype.getPath = function getPath(nodeFlag) {
225
+ var arr = [];
226
+ var n = 0;
227
+ var node = this;
228
+ // if (Array.isArray(this.tree.root)) {
229
+ // n = 1
230
+ // }
231
+ while (node.level > n) {
232
+ arr.push(nodeFlag ? node : node.data);
233
+ node = node.parent;
234
+ }
235
+ return arr;
236
+ };
237
+
238
+ Node.prototype.handleCheckChange = function handleCheckChange() {
239
+ var checked = this.checked;
240
+ this.childNodes.forEach(function (node) {
241
+ node.check = checked;
242
+ });
243
+ if (this.parent) {
244
+ this.parent.handleChildCheckChange();
245
+ }
246
+ };
247
+
248
+ Node.prototype.handleChildCheckChange = function handleChildCheckChange() {
249
+ if (Array.isArray(this.data) || this.level === 0) {
250
+ return;
251
+ }
252
+ if (this.childNodes.length === this.checkedChildNodes.length && this.childNodes.length !== 0) {
253
+ this.checked = true;
254
+ this.indeterminate = false;
255
+ } else if (this.checkedChildNodes.length > 0) {
256
+ this.checked = false;
257
+ this.indeterminate = true;
258
+ } else {
259
+ this.checked = false;
260
+ this.indeterminate = false;
261
+ for (var i = 0; i < this.childNodes.length; i++) {
262
+ if (this.childNodes[i].indeterminate) {
263
+ this.indeterminate = true;
264
+ break;
265
+ }
266
+ }
267
+ }
268
+ this.parent.handleChildCheckChange();
269
+ };
270
+
271
+ Node.prototype.after = function after(node) {
272
+ var oldIndex = node.index;
273
+ node.parent.childNodes.splice(oldIndex, 1);
274
+ node.parent.handleChildCheckChange();
275
+ if (node.parent.childNodes.length === 0) {
276
+ node.parent.isLeaf = true;
277
+ }
278
+ node.parent = this.parent;
279
+ node.level = this.level;
280
+ this.parent.childNodes.splice(this.index + 1, 0, node);
281
+ this.handleChildCheckChange();
282
+ };
283
+
284
+ Node.prototype.first = function first(node) {
285
+ var oldIndex = node.index;
286
+ node.parent.childNodes.splice(oldIndex, 1);
287
+ node.parent.handleChildCheckChange();
288
+ if (node.parent.childNodes.length === 0) {
289
+ node.parent.isLeaf = true;
290
+ }
291
+ this.isLeaf = false;
292
+ node.parent = this;
293
+ node.level = this.level + 1;
294
+ this.childNodes.splice(0, 0, node);
295
+ this.handleChildCheckChange();
296
+ };
297
+
298
+ Node.prototype.append = function append(node) {
299
+ var oldIndex = node.index;
300
+ node.parent.childNodes.splice(oldIndex, 1);
301
+ node.parent.handleChildCheckChange();
302
+ if (node.parent.childNodes.length === 0) {
303
+ node.parent.isLeaf = true;
304
+ }
305
+ this.isLeaf = false;
306
+ node.parent = this;
307
+ node.level = this.level + 1;
308
+ this.childNodes.push(node);
309
+ this.handleChildCheckChange();
310
+ };
311
+
312
+ Node.prototype.moveNode = function moveNode(node, index) {
313
+ var oldIndex = node.index;
314
+ node.parent.childNodes.splice(oldIndex, 1);
315
+ node.parent.handleChildCheckChange();
316
+ if (node.parent.childNodes.length === 0) {
317
+ node.parent.isLeaf = true;
318
+ }
319
+ this.isLeaf = false;
320
+ node.parent = this;
321
+ node.level = this.level + 1;
322
+ if (index !== null) {
323
+ this.childNodes.splice(index, 0, node);
324
+ } else {
325
+ this.childNodes.push(node);
326
+ }
327
+ this.handleChildCheckChange();
328
+ };
329
+
330
+ Node.prototype.remove = function remove() {
331
+ var node = this;
332
+ var index = node.index;
333
+ node.parent.childNodes.splice(index, 1);
334
+ node.parent.handleChildCheckChange();
335
+ node.tree.nodesMap.delete(node.id);
336
+ node = null;
337
+ };
338
+
339
+ (0, _createClass3.default)(Node, [{
340
+ key: 'label',
341
+ get: function get() {
342
+ return this.getTrueData('label');
343
+ }
344
+ }, {
345
+ key: 'key',
346
+ get: function get() {
347
+ return this.getTrueData('key');
348
+ }
349
+ }, {
350
+ key: 'disabled',
351
+ get: function get() {
352
+ return this.getTrueData('disabled');
353
+ }
354
+ }, {
355
+ key: 'check',
356
+ get: function get() {
357
+ return this.checked;
358
+ },
359
+ set: function set(val) {
360
+ if (val !== this.checked) {
361
+ this.checked = val;
362
+ this.handleCheckChange();
363
+ }
364
+ }
365
+ }, {
366
+ key: 'siblingsNodes',
367
+ get: function get() {
368
+ var arr = [];
369
+ var currentNode = this;
370
+ this.parent.childNodes.forEach(function (node) {
371
+ if (node.id !== currentNode.id) {
372
+ arr.push(node);
373
+ }
374
+ });
375
+ return arr;
376
+ }
377
+ }, {
378
+ key: 'checkedChildNodes',
379
+ get: function get() {
380
+ var arr = [];
381
+ this.childNodes.forEach(function (node) {
382
+ if (node.checked) arr.push(node);
383
+ });
384
+ return arr;
385
+ }
386
+ }, {
387
+ key: 'indeterminateChildNodes',
388
+ get: function get() {
389
+ var arr = [];
390
+ this.childNodes.forEach(function (node) {
391
+ if (node.checked || node.indeterminate) arr.push(node);
392
+ });
393
+ return arr;
394
+ }
395
+ }, {
396
+ key: 'isExpanded',
397
+ get: function get() {
398
+ return this.expanded;
399
+ },
400
+ set: function set(value) {
401
+ this.changeExpanded(value);
402
+ }
403
+ }, {
404
+ key: 'index',
405
+ get: function get() {
406
+ return this.parent.childNodes.indexOf(this);
407
+ }
408
+ }]);
409
+ return Node;
410
+ }();
411
+
412
+ exports.default = Node;