zartui 2.1.13 → 2.1.14
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.
- package/es/hierarchy-select/index.js +65 -0
- package/es/index.js +1 -1
- package/es/tabs/Title.js +5 -1
- package/lib/hierarchy-select/index.js +65 -0
- package/lib/index.js +1 -1
- package/lib/tabs/Title.js +5 -1
- package/lib/zart.js +71 -2
- package/lib/zart.min.js +2 -2
- package/package.json +1 -1
|
@@ -113,6 +113,71 @@ export default createComponent({
|
|
|
113
113
|
},
|
|
114
114
|
change: function change(item) {
|
|
115
115
|
this.$emit("change", item);
|
|
116
|
+
},
|
|
117
|
+
findNodeLayers: function findNodeLayers(root, id, path, result) {
|
|
118
|
+
for (var index = 0; index < root.length; index++) {
|
|
119
|
+
var _item$children;
|
|
120
|
+
var item = root[index];
|
|
121
|
+
path.push(item);
|
|
122
|
+
if (item.id === id) {
|
|
123
|
+
result.push.apply(result, path);
|
|
124
|
+
path.pop();
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
if ((_item$children = item.children) != null && _item$children.length) {
|
|
128
|
+
if (this.findNodeLayers(item.children, id, path, result)) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
path.pop();
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
},
|
|
136
|
+
scrollBreadcrumbToLast: function scrollBreadcrumbToLast() {
|
|
137
|
+
this.$nextTick(function () {
|
|
138
|
+
var _document$querySelect;
|
|
139
|
+
(_document$querySelect = document.querySelector('.zt2-hierarchy-select-breadcrumb__item:last-child')) == null || _document$querySelect.scrollIntoViewIfNeeded();
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* 通过节点id,跳到节点所属层进行展示。只从当前已存在的数据中进行查询
|
|
144
|
+
* @param id 要跳到的层级里面的元素id
|
|
145
|
+
* @param force 是否不管其父节点是否选中,直接跳到这一层
|
|
146
|
+
* @returns
|
|
147
|
+
*/
|
|
148
|
+
toNodeLevel: function toNodeLevel(id, force) {
|
|
149
|
+
var _this2 = this;
|
|
150
|
+
var rootLevelData = this.dataList;
|
|
151
|
+
if (this.historyLayers.length) {
|
|
152
|
+
rootLevelData = this.historyLayers[0];
|
|
153
|
+
}
|
|
154
|
+
var nodeLayers = [];
|
|
155
|
+
this.findNodeLayers(rootLevelData, id, [], nodeLayers);
|
|
156
|
+
if (nodeLayers.length) {
|
|
157
|
+
if (!force && nodeLayers.slice(0, nodeLayers.length - 1).some(function (item) {
|
|
158
|
+
var _this2$$refs;
|
|
159
|
+
return (_this2$$refs = _this2.$refs) == null || (_this2$$refs = _this2$$refs.markList) == null ? void 0 : _this2$$refs.getChecked(item);
|
|
160
|
+
})) {
|
|
161
|
+
console.warn('当前指定节点存在上级节点被选中,无法展开到此层级');
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 先进行初始化操作
|
|
166
|
+
this.breadcrumbData.splice(0);
|
|
167
|
+
this.historyLayers.splice(0, 1, rootLevelData);
|
|
168
|
+
nodeLayers.slice(0, nodeLayers.length - 1).forEach(function (item) {
|
|
169
|
+
_this2.breadcrumbData.push(item);
|
|
170
|
+
_this2.historyLayers.push(item.children);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// 取出最后一层的数据进行展示
|
|
174
|
+
this.dataList = this.historyLayers.splice(this.historyLayers.length - 1)[0];
|
|
175
|
+
this.scrollBreadcrumbToLast();
|
|
176
|
+
// this.$refs.markList.choosedValue = id;
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
console.warn('未找到当前id指定的节点');
|
|
180
|
+
return false;
|
|
116
181
|
}
|
|
117
182
|
},
|
|
118
183
|
render: function render(h) {
|
package/es/index.js
CHANGED
|
@@ -76,7 +76,7 @@ import TextEllipsis from './text-ellipsis';
|
|
|
76
76
|
import Timeline from './timeline';
|
|
77
77
|
import Toast from './toast';
|
|
78
78
|
import Uploader from './uploader';
|
|
79
|
-
var version = '2.1.
|
|
79
|
+
var version = '2.1.14';
|
|
80
80
|
function install(Vue) {
|
|
81
81
|
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, SpeechRecognizer, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, TextEllipsis, Timeline, Toast, Uploader];
|
|
82
82
|
components.forEach(function (item) {
|
package/es/tabs/Title.js
CHANGED
|
@@ -103,7 +103,11 @@ export default createComponent({
|
|
|
103
103
|
});
|
|
104
104
|
},
|
|
105
105
|
beforeDestroy: function beforeDestroy() {
|
|
106
|
-
|
|
106
|
+
if (this.mutationObserver) {
|
|
107
|
+
var _this$mutationObserve;
|
|
108
|
+
(_this$mutationObserve = this.mutationObserver) == null || _this$mutationObserve.disconnect();
|
|
109
|
+
this.mutationObserver = null; // 防止内存泄漏
|
|
110
|
+
}
|
|
107
111
|
},
|
|
108
112
|
render: function render() {
|
|
109
113
|
var h = arguments[0];
|
|
@@ -119,6 +119,71 @@ var _default2 = exports.default = createComponent({
|
|
|
119
119
|
},
|
|
120
120
|
change: function change(item) {
|
|
121
121
|
this.$emit("change", item);
|
|
122
|
+
},
|
|
123
|
+
findNodeLayers: function findNodeLayers(root, id, path, result) {
|
|
124
|
+
for (var index = 0; index < root.length; index++) {
|
|
125
|
+
var _item$children;
|
|
126
|
+
var item = root[index];
|
|
127
|
+
path.push(item);
|
|
128
|
+
if (item.id === id) {
|
|
129
|
+
result.push.apply(result, path);
|
|
130
|
+
path.pop();
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if ((_item$children = item.children) != null && _item$children.length) {
|
|
134
|
+
if (this.findNodeLayers(item.children, id, path, result)) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
path.pop();
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
},
|
|
142
|
+
scrollBreadcrumbToLast: function scrollBreadcrumbToLast() {
|
|
143
|
+
this.$nextTick(function () {
|
|
144
|
+
var _document$querySelect;
|
|
145
|
+
(_document$querySelect = document.querySelector('.zt2-hierarchy-select-breadcrumb__item:last-child')) == null || _document$querySelect.scrollIntoViewIfNeeded();
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
/**
|
|
149
|
+
* 通过节点id,跳到节点所属层进行展示。只从当前已存在的数据中进行查询
|
|
150
|
+
* @param id 要跳到的层级里面的元素id
|
|
151
|
+
* @param force 是否不管其父节点是否选中,直接跳到这一层
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
154
|
+
toNodeLevel: function toNodeLevel(id, force) {
|
|
155
|
+
var _this2 = this;
|
|
156
|
+
var rootLevelData = this.dataList;
|
|
157
|
+
if (this.historyLayers.length) {
|
|
158
|
+
rootLevelData = this.historyLayers[0];
|
|
159
|
+
}
|
|
160
|
+
var nodeLayers = [];
|
|
161
|
+
this.findNodeLayers(rootLevelData, id, [], nodeLayers);
|
|
162
|
+
if (nodeLayers.length) {
|
|
163
|
+
if (!force && nodeLayers.slice(0, nodeLayers.length - 1).some(function (item) {
|
|
164
|
+
var _this2$$refs;
|
|
165
|
+
return (_this2$$refs = _this2.$refs) == null || (_this2$$refs = _this2$$refs.markList) == null ? void 0 : _this2$$refs.getChecked(item);
|
|
166
|
+
})) {
|
|
167
|
+
console.warn('当前指定节点存在上级节点被选中,无法展开到此层级');
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// 先进行初始化操作
|
|
172
|
+
this.breadcrumbData.splice(0);
|
|
173
|
+
this.historyLayers.splice(0, 1, rootLevelData);
|
|
174
|
+
nodeLayers.slice(0, nodeLayers.length - 1).forEach(function (item) {
|
|
175
|
+
_this2.breadcrumbData.push(item);
|
|
176
|
+
_this2.historyLayers.push(item.children);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// 取出最后一层的数据进行展示
|
|
180
|
+
this.dataList = this.historyLayers.splice(this.historyLayers.length - 1)[0];
|
|
181
|
+
this.scrollBreadcrumbToLast();
|
|
182
|
+
// this.$refs.markList.choosedValue = id;
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
console.warn('未找到当前id指定的节点');
|
|
186
|
+
return false;
|
|
122
187
|
}
|
|
123
188
|
},
|
|
124
189
|
render: function render(h) {
|
package/lib/index.js
CHANGED
|
@@ -161,7 +161,7 @@ var _toast = _interopRequireDefault(require("./toast"));
|
|
|
161
161
|
exports.Toast = _toast.default;
|
|
162
162
|
var _uploader = _interopRequireDefault(require("./uploader"));
|
|
163
163
|
exports.Uploader = _uploader.default;
|
|
164
|
-
var version = exports.version = '2.1.
|
|
164
|
+
var version = exports.version = '2.1.14';
|
|
165
165
|
function install(Vue) {
|
|
166
166
|
var components = [_actionSheet.default, _area.default, _avatar.default, _backTop.default, _badge.default, _button.default, _calendar.default, _cascader.default, _cell.default, _cellGroup.default, _checkbox.default, _checkboxGroup.default, _col.default, _collapse.default, _collapseItem.default, _countDown.default, _datetimePicker.default, _dialog.default, _divider.default, _dropdownItem.default, _dropdownMenu.default, _empty.default, _field.default, _foldDialog.default, _form.default, _grid.default, _gridItem.default, _hierarchySelect.default, _icon.default, _image.default, _imagePreview.default, _indexAnchor.default, _indexBar.default, _info.default, _lazyload.default, _list.default, _loading.default, _locale.default, _mediaPicker.default, _mediaPlayer.default, _multiplePicker.default, _navBar.default, _noticeBar.default, _numberKeyboard.default, _overlay.default, _passwordInput.default, _picker.default, _popover.default, _popup.default, _pullRefresh.default, _radio.default, _radioGroup.default, _rate.default, _row.default, _search.default, _signature.default, _skeleton.default, _slider.default, _speechRecognizer.default, _step.default, _stepper.default, _steps.default, _sticky.default, _swipe.default, _swipeCell.default, _swipeItem.default, _switch.default, _switchCell.default, _tab.default, _tabbar.default, _tabbarItem.default, _table.default, _tabs.default, _tag.default, _textEllipsis.default, _timeline.default, _toast.default, _uploader.default];
|
|
167
167
|
components.forEach(function (item) {
|
package/lib/tabs/Title.js
CHANGED
|
@@ -108,7 +108,11 @@ var _default = exports.default = createComponent({
|
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
110
|
beforeDestroy: function beforeDestroy() {
|
|
111
|
-
|
|
111
|
+
if (this.mutationObserver) {
|
|
112
|
+
var _this$mutationObserve;
|
|
113
|
+
(_this$mutationObserve = this.mutationObserver) == null || _this$mutationObserve.disconnect();
|
|
114
|
+
this.mutationObserver = null; // 防止内存泄漏
|
|
115
|
+
}
|
|
112
116
|
},
|
|
113
117
|
render: function render() {
|
|
114
118
|
var h = arguments[0];
|
package/lib/zart.js
CHANGED
|
@@ -6526,7 +6526,11 @@ var Title_createNamespace = Object(utils["b" /* createNamespace */])('tab'),
|
|
|
6526
6526
|
});
|
|
6527
6527
|
},
|
|
6528
6528
|
beforeDestroy: function beforeDestroy() {
|
|
6529
|
-
|
|
6529
|
+
if (this.mutationObserver) {
|
|
6530
|
+
var _this$mutationObserve;
|
|
6531
|
+
(_this$mutationObserve = this.mutationObserver) == null || _this$mutationObserve.disconnect();
|
|
6532
|
+
this.mutationObserver = null; // 防止内存泄漏
|
|
6533
|
+
}
|
|
6530
6534
|
},
|
|
6531
6535
|
render: function render() {
|
|
6532
6536
|
var h = arguments[0];
|
|
@@ -14585,6 +14589,71 @@ function hierarchy_select_pickSlots(instance, keys) {
|
|
|
14585
14589
|
},
|
|
14586
14590
|
change: function change(item) {
|
|
14587
14591
|
this.$emit("change", item);
|
|
14592
|
+
},
|
|
14593
|
+
findNodeLayers: function findNodeLayers(root, id, path, result) {
|
|
14594
|
+
for (var index = 0; index < root.length; index++) {
|
|
14595
|
+
var _item$children;
|
|
14596
|
+
var item = root[index];
|
|
14597
|
+
path.push(item);
|
|
14598
|
+
if (item.id === id) {
|
|
14599
|
+
result.push.apply(result, path);
|
|
14600
|
+
path.pop();
|
|
14601
|
+
return true;
|
|
14602
|
+
}
|
|
14603
|
+
if ((_item$children = item.children) != null && _item$children.length) {
|
|
14604
|
+
if (this.findNodeLayers(item.children, id, path, result)) {
|
|
14605
|
+
return true;
|
|
14606
|
+
}
|
|
14607
|
+
}
|
|
14608
|
+
path.pop();
|
|
14609
|
+
}
|
|
14610
|
+
return false;
|
|
14611
|
+
},
|
|
14612
|
+
scrollBreadcrumbToLast: function scrollBreadcrumbToLast() {
|
|
14613
|
+
this.$nextTick(function () {
|
|
14614
|
+
var _document$querySelect;
|
|
14615
|
+
(_document$querySelect = document.querySelector('.zt2-hierarchy-select-breadcrumb__item:last-child')) == null || _document$querySelect.scrollIntoViewIfNeeded();
|
|
14616
|
+
});
|
|
14617
|
+
},
|
|
14618
|
+
/**
|
|
14619
|
+
* 通过节点id,跳到节点所属层进行展示。只从当前已存在的数据中进行查询
|
|
14620
|
+
* @param id 要跳到的层级里面的元素id
|
|
14621
|
+
* @param force 是否不管其父节点是否选中,直接跳到这一层
|
|
14622
|
+
* @returns
|
|
14623
|
+
*/
|
|
14624
|
+
toNodeLevel: function toNodeLevel(id, force) {
|
|
14625
|
+
var _this2 = this;
|
|
14626
|
+
var rootLevelData = this.dataList;
|
|
14627
|
+
if (this.historyLayers.length) {
|
|
14628
|
+
rootLevelData = this.historyLayers[0];
|
|
14629
|
+
}
|
|
14630
|
+
var nodeLayers = [];
|
|
14631
|
+
this.findNodeLayers(rootLevelData, id, [], nodeLayers);
|
|
14632
|
+
if (nodeLayers.length) {
|
|
14633
|
+
if (!force && nodeLayers.slice(0, nodeLayers.length - 1).some(function (item) {
|
|
14634
|
+
var _this2$$refs;
|
|
14635
|
+
return (_this2$$refs = _this2.$refs) == null || (_this2$$refs = _this2$$refs.markList) == null ? void 0 : _this2$$refs.getChecked(item);
|
|
14636
|
+
})) {
|
|
14637
|
+
console.warn('当前指定节点存在上级节点被选中,无法展开到此层级');
|
|
14638
|
+
return false;
|
|
14639
|
+
}
|
|
14640
|
+
|
|
14641
|
+
// 先进行初始化操作
|
|
14642
|
+
this.breadcrumbData.splice(0);
|
|
14643
|
+
this.historyLayers.splice(0, 1, rootLevelData);
|
|
14644
|
+
nodeLayers.slice(0, nodeLayers.length - 1).forEach(function (item) {
|
|
14645
|
+
_this2.breadcrumbData.push(item);
|
|
14646
|
+
_this2.historyLayers.push(item.children);
|
|
14647
|
+
});
|
|
14648
|
+
|
|
14649
|
+
// 取出最后一层的数据进行展示
|
|
14650
|
+
this.dataList = this.historyLayers.splice(this.historyLayers.length - 1)[0];
|
|
14651
|
+
this.scrollBreadcrumbToLast();
|
|
14652
|
+
// this.$refs.markList.choosedValue = id;
|
|
14653
|
+
return true;
|
|
14654
|
+
}
|
|
14655
|
+
console.warn('未找到当前id指定的节点');
|
|
14656
|
+
return false;
|
|
14588
14657
|
}
|
|
14589
14658
|
},
|
|
14590
14659
|
render: function render(h) {
|
|
@@ -31485,7 +31554,7 @@ var uploader_createNamespace = Object(utils["b" /* createNamespace */])('uploade
|
|
|
31485
31554
|
|
|
31486
31555
|
|
|
31487
31556
|
|
|
31488
|
-
var version = '2.1.
|
|
31557
|
+
var version = '2.1.14';
|
|
31489
31558
|
function install(Vue) {
|
|
31490
31559
|
var components = [action_sheet, es_area, avatar, back_top, badge, es_button, calendar, cascader, cell, cell_group, es_checkbox, checkbox_group, col, collapse, collapse_item, count_down, datetime_picker, dialog, divider, dropdown_item, dropdown_menu, empty, es_field, fold_dialog, es_form, grid, grid_item, hierarchy_select, es_icon, es_image, image_preview, index_anchor, index_bar, es_info, lazyload, es_list, es_loading, locale["a" /* default */], media_picker, media_player, multiple_picker, nav_bar, notice_bar, number_keyboard, es_overlay, password_input, es_picker, popover, popup, pull_refresh, es_radio, radio_group, rate, row, search, signature, skeleton, slider, speech_recognizer, es_step, stepper, steps, es_sticky, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, table, tabs, es_tag, text_ellipsis, timeline, es_toast, uploader];
|
|
31491
31560
|
components.forEach(function (item) {
|