@nutui/nutui 3.1.21 → 3.1.22-beta.5
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/dist/nutui.es.js +4203 -19263
- package/dist/nutui.umd.js +4208 -19368
- package/dist/packages/_es/ActionSheet.js +17 -167
- package/dist/packages/_es/Address.js +110 -552
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Animate.js +22 -0
- package/dist/packages/_es/Audio.js +53 -274
- package/dist/packages/_es/AudioOperate.js +13 -121
- package/dist/packages/_es/Avatar.js +38 -177
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +30 -237
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +147 -523
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +32 -84
- package/dist/packages/_es/CollapseItem.js +59 -272
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/ConfigProvider.js +13 -0
- package/dist/packages/_es/CountDown.js +56 -256
- package/dist/packages/_es/CountUp.js +140 -556
- package/dist/packages/_es/DatePicker.js +98 -332
- package/dist/packages/_es/Dialog.js +60 -271
- package/dist/packages/_es/Divider.js +13 -82
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +58 -212
- package/dist/packages/_es/Ellipsis.js +64 -0
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/Image.js +31 -0
- package/dist/packages/_es/ImagePreview.js +77 -309
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +57 -268
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +18 -124
- package/dist/packages/_es/Menu.js +45 -118
- package/dist/packages/_es/MenuItem.js +37 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +74 -397
- package/dist/packages/_es/Notify.js +72 -246
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +131 -474
- package/dist/packages/_es/OverLay.js +24 -113
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +129 -469
- package/dist/packages/_es/Popover.js +318 -975
- package/dist/packages/_es/Popup.js +55 -313
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +84 -354
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +83 -427
- package/dist/packages/_es/Rate.js +35 -137
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +37 -257
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +24 -99
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +41 -179
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +84 -509
- package/dist/packages/_es/Step.js +20 -133
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +17 -100
- package/dist/packages/_es/Swipe.js +41 -197
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +18 -196
- package/dist/packages/_es/Tabs.js +43 -217
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +18 -98
- package/dist/packages/_es/TimePannel.js +14 -66
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +71 -329
- package/dist/packages/_es/Uploader.js +104 -468
- package/dist/packages/_es/Video.js +74 -350
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +164 -682
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +18 -1
- package/dist/packages/checkbox/index.scss +16 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +21 -2
- package/dist/packages/input/index.scss +26 -1
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +19 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +4 -3
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +6 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +192 -12
- package/dist/smartips/tags.json +70 -10
- package/dist/smartips/web-types.json +6945 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +19 -1
- package/dist/styles/variables-jdt.scss +19 -1
- package/dist/styles/variables.scss +22 -1
- package/dist/types/__VUE/address/index.vue.d.ts +2 -2
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
- package/dist/types/__VUE/datepicker/type.d.ts +6 -0
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/common.d.ts +3 -3
- package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
- package/dist/types/__VUE/menuitem/type.d.ts +8 -0
- package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/skeleton/common.d.ts +2 -4
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabs/common.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
- package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
- package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
- package/dist/types/__VUE/uploader/type.d.ts +2 -1
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +7 -3
|
@@ -1,546 +1,170 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __restKey = (key) => typeof key === "symbol" ? key : key + "";
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
1
|
/*!
|
|
34
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
|
|
35
3
|
* (c) 2022 @jdf2e.
|
|
36
4
|
* Released under the MIT License.
|
|
37
5
|
*/
|
|
38
|
-
import { computed, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
39
|
-
import { popupProps } from "./Popup.js";
|
|
40
|
-
import { c as
|
|
41
|
-
import { _ as
|
|
6
|
+
import { computed as e, ref as l, watch as a, resolveComponent as t, openBlock as n, createBlock as o, withCtx as i, createElementBlock as s, Fragment as r, renderList as u, createElementVNode as d, normalizeClass as c, toDisplayString as v, createCommentVNode as h, createVNode as p } from "vue";
|
|
7
|
+
import { popupProps as y } from "./Popup.js";
|
|
8
|
+
import { c as g } from "./component.js";
|
|
9
|
+
import { _ as f } from "./plugin-vue_export-helper.js";
|
|
42
10
|
import "./OverLay.js";
|
|
43
11
|
import "../locale/lang";
|
|
44
12
|
import "./Icon.js";
|
|
45
13
|
import "./pxCheck.js";
|
|
46
|
-
const
|
|
47
|
-
const { value:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
if (newNode.children && newNode.children.length) {
|
|
59
|
-
newNode.children = formatTree(newNode.children, newNode, config);
|
|
60
|
-
}
|
|
61
|
-
return newNode;
|
|
62
|
-
});
|
|
63
|
-
const eachTree = (tree, cb) => {
|
|
64
|
-
let i = 0;
|
|
65
|
-
let node;
|
|
66
|
-
while (node = tree[i++]) {
|
|
67
|
-
if (cb(node) === true) {
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
if (node.children && node.children.length) {
|
|
71
|
-
eachTree(node.children, cb);
|
|
72
|
-
}
|
|
14
|
+
const m = (e2, l2, a2) => e2.map((e3) => {
|
|
15
|
+
const { value: t2 = "value", text: n2 = "text", children: o2 = "children" } = a2, { [t2]: i2, [n2]: s2, [o2]: r2, ...u2 } = e3, d2 = { loading: false, ...u2, level: l2 ? (l2 && l2.level || 0) + 1 : 0, value: i2, text: s2, children: r2, _parent: l2 };
|
|
16
|
+
return d2.children && d2.children.length && (d2.children = m(d2.children, d2, a2)), d2;
|
|
17
|
+
}), b = (e2, l2) => {
|
|
18
|
+
let a2, t2 = 0;
|
|
19
|
+
for (; (a2 = e2[t2++]) && l2(a2) !== true; )
|
|
20
|
+
a2.children && a2.children.length && b(a2.children, l2);
|
|
21
|
+
}, C = { topId: null, idKey: "id", pidKey: "pid", sortKey: "" };
|
|
22
|
+
class k {
|
|
23
|
+
constructor(e2, l2) {
|
|
24
|
+
this.config = { value: "value", text: "text", children: "children", ...l2 || {} }, this.nodes = m(e2, null, this.config);
|
|
73
25
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
topId: null,
|
|
77
|
-
idKey: "id",
|
|
78
|
-
pidKey: "pid",
|
|
79
|
-
sortKey: ""
|
|
80
|
-
};
|
|
81
|
-
const convertListToOptions = (list, options) => {
|
|
82
|
-
const mergedOptions = __spreadValues(__spreadValues({}, defaultConvertConfig), options || {});
|
|
83
|
-
const { topId, idKey, pidKey, sortKey } = mergedOptions;
|
|
84
|
-
let result = [];
|
|
85
|
-
let map = {};
|
|
86
|
-
list.forEach((node) => {
|
|
87
|
-
node = __spreadValues({}, node);
|
|
88
|
-
const { [idKey]: id, [pidKey]: pid } = node;
|
|
89
|
-
const children = map[pid] = map[pid] || [];
|
|
90
|
-
if (!result.length && pid === topId) {
|
|
91
|
-
result = children;
|
|
92
|
-
}
|
|
93
|
-
children.push(node);
|
|
94
|
-
node.children = map[id] || (map[id] = []);
|
|
95
|
-
});
|
|
96
|
-
if (sortKey) {
|
|
97
|
-
Object.keys(map).forEach((i) => {
|
|
98
|
-
if (map[i].length > 1) {
|
|
99
|
-
map[i].sort((a, b) => a[sortKey] - b[sortKey]);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
map = null;
|
|
104
|
-
return result;
|
|
105
|
-
};
|
|
106
|
-
class Tree {
|
|
107
|
-
constructor(nodes, config) {
|
|
108
|
-
this.config = __spreadValues({
|
|
109
|
-
value: "value",
|
|
110
|
-
text: "text",
|
|
111
|
-
children: "children"
|
|
112
|
-
}, config || {});
|
|
113
|
-
this.nodes = formatTree(nodes, null, this.config);
|
|
114
|
-
}
|
|
115
|
-
updateChildren(nodes, parent) {
|
|
116
|
-
if (!parent) {
|
|
117
|
-
this.nodes = formatTree(nodes, null, this.config);
|
|
118
|
-
} else {
|
|
119
|
-
parent.children = formatTree(nodes, parent, this.config);
|
|
120
|
-
}
|
|
26
|
+
updateChildren(e2, l2) {
|
|
27
|
+
l2 ? l2.children = m(e2, l2, this.config) : this.nodes = m(e2, null, this.config);
|
|
121
28
|
}
|
|
122
|
-
getNodeByValue(
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
return foundNode;
|
|
29
|
+
getNodeByValue(e2) {
|
|
30
|
+
let l2;
|
|
31
|
+
return b(this.nodes, (a2) => {
|
|
32
|
+
if (a2.value === e2)
|
|
33
|
+
return l2 = a2, true;
|
|
34
|
+
}), l2;
|
|
131
35
|
}
|
|
132
|
-
getPathNodesByValue(
|
|
133
|
-
if (!
|
|
36
|
+
getPathNodesByValue(e2) {
|
|
37
|
+
if (!e2.length)
|
|
134
38
|
return [];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (!foundNode) {
|
|
39
|
+
const l2 = [];
|
|
40
|
+
let a2 = this.nodes;
|
|
41
|
+
for (; a2 && a2.length; ) {
|
|
42
|
+
const t2 = a2.find((l3) => l3.value === e2[l3.level]);
|
|
43
|
+
if (!t2)
|
|
141
44
|
break;
|
|
142
|
-
|
|
143
|
-
pathNodes.push(foundNode);
|
|
144
|
-
currentNodes = foundNode.children;
|
|
45
|
+
l2.push(t2), a2 = t2.children;
|
|
145
46
|
}
|
|
146
|
-
return
|
|
47
|
+
return l2;
|
|
147
48
|
}
|
|
148
|
-
isLeaf(
|
|
149
|
-
const { leaf, children } =
|
|
150
|
-
|
|
151
|
-
return leaf || !hasChildren && !lazy;
|
|
49
|
+
isLeaf(e2, l2) {
|
|
50
|
+
const { leaf: a2, children: t2 } = e2, n2 = Array.isArray(t2) && Boolean(t2.length);
|
|
51
|
+
return a2 || !n2 && !l2;
|
|
152
52
|
}
|
|
153
|
-
hasChildren(
|
|
154
|
-
|
|
155
|
-
if (isLeaf) {
|
|
53
|
+
hasChildren(e2, l2) {
|
|
54
|
+
if (this.isLeaf(e2, l2))
|
|
156
55
|
return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return Array.isArray(children) && Boolean(children.length);
|
|
56
|
+
const { children: a2 } = e2;
|
|
57
|
+
return Array.isArray(a2) && Boolean(a2.length);
|
|
160
58
|
}
|
|
161
59
|
}
|
|
162
|
-
const { create:
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
options:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const initLoading = ref(false);
|
|
200
|
-
const innerValue = ref(props.modelValue);
|
|
201
|
-
const tree = ref(new Tree([], {}));
|
|
202
|
-
const panes = ref([]);
|
|
203
|
-
const isLazy = computed(() => configs.value.lazy && Boolean(configs.value.lazyLoad));
|
|
204
|
-
const lazyLoadMap = /* @__PURE__ */ new Map();
|
|
205
|
-
let currentProcessNode;
|
|
206
|
-
const init = async () => {
|
|
207
|
-
lazyLoadMap.clear();
|
|
208
|
-
panes.value = [];
|
|
209
|
-
tabsCursor.value = 0;
|
|
210
|
-
initLoading.value = false;
|
|
211
|
-
currentProcessNode = null;
|
|
212
|
-
let { options } = props;
|
|
213
|
-
if (configs.value.convertConfig) {
|
|
214
|
-
options = convertListToOptions(options, configs.value.convertConfig);
|
|
60
|
+
const { create: K, translate: V } = g("cascader-item"), x = K({ props: { visible: Boolean, modelValue: Array, options: { type: Array, default: () => [] }, lazy: Boolean, lazyLoad: Function, valueKey: { type: String, default: "value" }, textKey: { type: String, default: "text" }, childrenKey: { type: String, default: "children" }, convertConfig: Object }, components: {}, emits: ["update:modelValue", "change", "pathChange"], setup(t2, { emit: n2 }) {
|
|
61
|
+
const o2 = e(() => ({ lazy: t2.lazy, lazyLoad: t2.lazyLoad, valueKey: t2.valueKey, textKey: t2.textKey, childrenKey: t2.childrenKey, convertConfig: t2.convertConfig })), i2 = l(0), s2 = l(false), r2 = l(t2.modelValue), u2 = l(new k([], {})), d2 = l([]), c2 = e(() => o2.value.lazy && Boolean(o2.value.lazyLoad)), v2 = /* @__PURE__ */ new Map();
|
|
62
|
+
let h2;
|
|
63
|
+
const p2 = async () => {
|
|
64
|
+
v2.clear(), d2.value = [], i2.value = 0, s2.value = false, h2 = null;
|
|
65
|
+
let { options: e2 } = t2;
|
|
66
|
+
o2.value.convertConfig && (e2 = ((e3, l2) => {
|
|
67
|
+
const a2 = { ...C, ...l2 || {} }, { topId: t3, idKey: n3, pidKey: o3, sortKey: i3 } = a2;
|
|
68
|
+
let s3 = [], r3 = {};
|
|
69
|
+
return e3.forEach((e4) => {
|
|
70
|
+
e4 = { ...e4 };
|
|
71
|
+
const { [n3]: l3, [o3]: a3 } = e4, i4 = r3[a3] = r3[a3] || [];
|
|
72
|
+
s3.length || a3 !== t3 || (s3 = i4), i4.push(e4), e4.children = r3[l3] || (r3[l3] = []);
|
|
73
|
+
}), i3 && Object.keys(r3).forEach((e4) => {
|
|
74
|
+
r3[e4].length > 1 && r3[e4].sort((e5, l3) => e5[i3] - l3[i3]);
|
|
75
|
+
}), r3 = null, s3;
|
|
76
|
+
})(e2, o2.value.convertConfig)), u2.value = new k(e2, { value: o2.value.valueKey, text: o2.value.textKey, children: o2.value.childrenKey }), c2.value && !u2.value.nodes.length && await g2({ root: true, loading: true, text: "", value: "" }), d2.value = [{ nodes: u2.value.nodes, selectedNode: null }], y2();
|
|
77
|
+
}, y2 = async () => {
|
|
78
|
+
const e2 = r2.value;
|
|
79
|
+
if (e2 === void 0 || !u2.value.nodes.length)
|
|
80
|
+
return;
|
|
81
|
+
if (e2.length === 0)
|
|
82
|
+
return i2.value = 0, void (d2.value = [{ nodes: u2.value.nodes, selectedNode: null }]);
|
|
83
|
+
let l2 = e2;
|
|
84
|
+
if (c2.value && Array.isArray(e2) && e2.length) {
|
|
85
|
+
l2 = [];
|
|
86
|
+
let a2 = u2.value.nodes.find((l3) => l3.value === e2[0]);
|
|
87
|
+
if (a2) {
|
|
88
|
+
l2 = [a2.value], s2.value = true;
|
|
89
|
+
const t3 = await e2.slice(1).reduce(async (e3, a3) => {
|
|
90
|
+
var _a;
|
|
91
|
+
const t4 = await e3;
|
|
92
|
+
await g2(t4);
|
|
93
|
+
const n3 = (_a = t4 == null ? void 0 : t4.children) == null ? void 0 : _a.find((e4) => e4.value === a3);
|
|
94
|
+
return n3 && l2.push(a3), Promise.resolve(n3);
|
|
95
|
+
}, Promise.resolve(a2));
|
|
96
|
+
await g2(t3), s2.value = false;
|
|
215
97
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
98
|
+
}
|
|
99
|
+
if (l2.length && e2 === t2.modelValue) {
|
|
100
|
+
u2.value.getPathNodesByValue(l2).map((e3, l3) => {
|
|
101
|
+
i2.value = l3, f2.handleNode(e3, true);
|
|
220
102
|
});
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
initLoading.value = true;
|
|
249
|
-
const last = await currentValue.slice(1).reduce(async (p, value) => {
|
|
250
|
-
var _a;
|
|
251
|
-
const parent2 = await p;
|
|
252
|
-
await invokeLazyLoad(parent2);
|
|
253
|
-
const node = (_a = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a.find((item) => item.value === value);
|
|
254
|
-
if (node) {
|
|
255
|
-
needToSync.push(value);
|
|
256
|
-
}
|
|
257
|
-
return Promise.resolve(node);
|
|
258
|
-
}, Promise.resolve(parent));
|
|
259
|
-
await invokeLazyLoad(last);
|
|
260
|
-
initLoading.value = false;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
if (needToSync.length && currentValue === props.modelValue) {
|
|
264
|
-
const pathNodes = tree.value.getPathNodesByValue(needToSync);
|
|
265
|
-
pathNodes.map((node, index2) => {
|
|
266
|
-
tabsCursor.value = index2;
|
|
267
|
-
methods.handleNode(node, true);
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
const invokeLazyLoad = async (node) => {
|
|
272
|
-
if (!node) {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
if (!configs.value.lazyLoad) {
|
|
276
|
-
node.leaf = true;
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (tree.value.isLeaf(node, isLazy.value) || tree.value.hasChildren(node, isLazy.value)) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
node.loading = true;
|
|
283
|
-
const parent = node.root ? null : node;
|
|
284
|
-
let lazyLoadPromise = lazyLoadMap.get(node);
|
|
285
|
-
if (!lazyLoadPromise) {
|
|
286
|
-
lazyLoadPromise = new Promise((resolve) => {
|
|
287
|
-
var _a, _b;
|
|
288
|
-
(_b = (_a = configs.value).lazyLoad) == null ? void 0 : _b.call(_a, node, resolve);
|
|
289
|
-
});
|
|
290
|
-
lazyLoadMap.set(node, lazyLoadPromise);
|
|
291
|
-
}
|
|
292
|
-
const nodes = await lazyLoadPromise;
|
|
293
|
-
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
294
|
-
tree.value.updateChildren(nodes, parent);
|
|
295
|
-
} else {
|
|
296
|
-
node.leaf = true;
|
|
297
|
-
}
|
|
298
|
-
node.loading = false;
|
|
299
|
-
lazyLoadMap.delete(node);
|
|
300
|
-
};
|
|
301
|
-
const emitChange = (pathNodes) => {
|
|
302
|
-
const emitValue = pathNodes.map((node) => node.value);
|
|
303
|
-
innerValue.value = emitValue;
|
|
304
|
-
emit("change", emitValue, pathNodes);
|
|
305
|
-
emit("update:modelValue", emitValue, pathNodes);
|
|
306
|
-
};
|
|
307
|
-
const methods = {
|
|
308
|
-
async handleNode(node, silent) {
|
|
309
|
-
const { disabled, loading } = node;
|
|
310
|
-
if (!silent && disabled || !panes.value[tabsCursor.value]) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
if (tree.value.isLeaf(node, isLazy.value)) {
|
|
314
|
-
node.leaf = true;
|
|
315
|
-
panes.value[tabsCursor.value].selectedNode = node;
|
|
316
|
-
panes.value = panes.value.slice(0, node.level + 1);
|
|
317
|
-
if (!silent) {
|
|
318
|
-
const pathNodes = panes.value.map((pane) => pane.selectedNode);
|
|
319
|
-
emitChange(pathNodes);
|
|
320
|
-
emit("pathChange", pathNodes);
|
|
321
|
-
}
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (tree.value.hasChildren(node, isLazy.value)) {
|
|
325
|
-
const level = node.level + 1;
|
|
326
|
-
panes.value[tabsCursor.value].selectedNode = node;
|
|
327
|
-
panes.value = panes.value.slice(0, level);
|
|
328
|
-
panes.value.push({
|
|
329
|
-
nodes: node.children || [],
|
|
330
|
-
selectedNode: null
|
|
331
|
-
});
|
|
332
|
-
tabsCursor.value = level;
|
|
333
|
-
if (!silent) {
|
|
334
|
-
const pathNodes = panes.value.map((pane) => pane.selectedNode);
|
|
335
|
-
emit("pathChange", pathNodes);
|
|
336
|
-
}
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
currentProcessNode = node;
|
|
340
|
-
if (loading) {
|
|
341
|
-
return;
|
|
103
|
+
}
|
|
104
|
+
}, g2 = async (e2) => {
|
|
105
|
+
if (!e2)
|
|
106
|
+
return;
|
|
107
|
+
if (!o2.value.lazyLoad)
|
|
108
|
+
return void (e2.leaf = true);
|
|
109
|
+
if (u2.value.isLeaf(e2, c2.value) || u2.value.hasChildren(e2, c2.value))
|
|
110
|
+
return;
|
|
111
|
+
e2.loading = true;
|
|
112
|
+
const l2 = e2.root ? null : e2;
|
|
113
|
+
let a2 = v2.get(e2);
|
|
114
|
+
a2 || (a2 = new Promise((l3) => {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
(_b = (_a = o2.value).lazyLoad) == null ? void 0 : _b.call(_a, e2, l3);
|
|
117
|
+
}), v2.set(e2, a2));
|
|
118
|
+
const t3 = await a2;
|
|
119
|
+
Array.isArray(t3) && t3.length > 0 ? u2.value.updateChildren(t3, l2) : e2.leaf = true, e2.loading = false, v2.delete(e2);
|
|
120
|
+
}, f2 = { async handleNode(e2, l2) {
|
|
121
|
+
const { disabled: a2, loading: t3 } = e2;
|
|
122
|
+
if ((l2 || !a2) && d2.value[i2.value])
|
|
123
|
+
if (u2.value.isLeaf(e2, c2.value)) {
|
|
124
|
+
if (e2.leaf = true, d2.value[i2.value].selectedNode = e2, d2.value = d2.value.slice(0, e2.level + 1), !l2) {
|
|
125
|
+
const e3 = d2.value.map((e4) => e4.selectedNode);
|
|
126
|
+
((e4) => {
|
|
127
|
+
const l3 = e4.map((e5) => e5.value);
|
|
128
|
+
r2.value = l3, n2("change", l3, e4), n2("update:modelValue", l3, e4);
|
|
129
|
+
})(e3), n2("pathChange", e3);
|
|
342
130
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
131
|
+
} else if (u2.value.hasChildren(e2, c2.value)) {
|
|
132
|
+
const a3 = e2.level + 1;
|
|
133
|
+
if (d2.value[i2.value].selectedNode = e2, d2.value = d2.value.slice(0, a3), d2.value.push({ nodes: e2.children || [], selectedNode: null }), i2.value = a3, !l2) {
|
|
134
|
+
const e3 = d2.value.map((e4) => e4.selectedNode);
|
|
135
|
+
n2("pathChange", e3);
|
|
347
136
|
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
class: "nut-cascader-pane"
|
|
383
|
-
};
|
|
384
|
-
const _hoisted_2 = ["aria-checked", "aria-disabled", "onClick"];
|
|
385
|
-
const _hoisted_3 = { class: "nut-cascader-item__title" };
|
|
386
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-cascader-pane" }, null, -1);
|
|
387
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
388
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
389
|
-
const _component_nut_tabpane = resolveComponent("nut-tabpane");
|
|
390
|
-
const _component_nut_tabs = resolveComponent("nut-tabs");
|
|
391
|
-
return openBlock(), createBlock(_component_nut_tabs, {
|
|
392
|
-
class: "nut-cascader",
|
|
393
|
-
modelValue: _ctx.tabsCursor,
|
|
394
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.tabsCursor = $event),
|
|
395
|
-
onClick: _ctx.handleTabClick,
|
|
396
|
-
"title-scroll": ""
|
|
397
|
-
}, {
|
|
398
|
-
default: withCtx(() => [
|
|
399
|
-
!_ctx.initLoading && _ctx.panes.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.panes, (pane, index2) => {
|
|
400
|
-
return openBlock(), createBlock(_component_nut_tabpane, {
|
|
401
|
-
title: _ctx.formatTabTitle(pane),
|
|
402
|
-
key: index2
|
|
403
|
-
}, {
|
|
404
|
-
default: withCtx(() => [
|
|
405
|
-
createElementVNode("view", _hoisted_1$1, [
|
|
406
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(pane.nodes, (node) => {
|
|
407
|
-
return openBlock(), createElementBlock("view", {
|
|
408
|
-
key: node.value,
|
|
409
|
-
class: normalizeClass(["nut-cascader-item", { active: _ctx.isSelected(pane, node), disabled: node.disabled }]),
|
|
410
|
-
"aria-checked": _ctx.isSelected(pane, node),
|
|
411
|
-
"aria-disabled": node.disabled || void 0,
|
|
412
|
-
role: "menuitemradio",
|
|
413
|
-
onClick: ($event) => _ctx.handleNode(node, false)
|
|
414
|
-
}, [
|
|
415
|
-
createElementVNode("view", _hoisted_3, toDisplayString(node.text), 1),
|
|
416
|
-
node.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
417
|
-
key: 0,
|
|
418
|
-
class: "nut-cascader-item__icon-loading",
|
|
419
|
-
name: "loading"
|
|
420
|
-
})) : (openBlock(), createBlock(_component_nut_icon, {
|
|
421
|
-
key: 1,
|
|
422
|
-
class: "nut-cascader-item__icon-check",
|
|
423
|
-
name: "checklist"
|
|
424
|
-
}))
|
|
425
|
-
], 10, _hoisted_2);
|
|
426
|
-
}), 128))
|
|
427
|
-
])
|
|
428
|
-
]),
|
|
429
|
-
_: 2
|
|
430
|
-
}, 1032, ["title"]);
|
|
431
|
-
}), 128)) : (openBlock(), createBlock(_component_nut_tabpane, {
|
|
432
|
-
key: 1,
|
|
433
|
-
title: "Loading..."
|
|
434
|
-
}, {
|
|
435
|
-
default: withCtx(() => [
|
|
436
|
-
_hoisted_4
|
|
437
|
-
]),
|
|
438
|
-
_: 1
|
|
439
|
-
}))
|
|
440
|
-
]),
|
|
441
|
-
_: 1
|
|
442
|
-
}, 8, ["modelValue", "onClick"]);
|
|
443
|
-
}
|
|
444
|
-
var CascaderItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
445
|
-
const { create } = createComponent("cascader");
|
|
446
|
-
const _sfc_main = create({
|
|
447
|
-
components: {
|
|
448
|
-
[CascaderItem.name]: CascaderItem
|
|
449
|
-
},
|
|
450
|
-
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
451
|
-
modelValue: Array,
|
|
452
|
-
visible: Boolean,
|
|
453
|
-
title: String,
|
|
454
|
-
options: {
|
|
455
|
-
type: Array,
|
|
456
|
-
default: () => []
|
|
457
|
-
},
|
|
458
|
-
lazy: Boolean,
|
|
459
|
-
lazyLoad: Function,
|
|
460
|
-
valueKey: {
|
|
461
|
-
type: String,
|
|
462
|
-
default: "value"
|
|
463
|
-
},
|
|
464
|
-
textKey: {
|
|
465
|
-
type: String,
|
|
466
|
-
default: "text"
|
|
467
|
-
},
|
|
468
|
-
childrenKey: {
|
|
469
|
-
type: String,
|
|
470
|
-
default: "children"
|
|
471
|
-
},
|
|
472
|
-
convertConfig: Object
|
|
473
|
-
}),
|
|
474
|
-
emits: ["update:modelValue", "change", "pathChange", "update:visible"],
|
|
475
|
-
setup(props, { emit }) {
|
|
476
|
-
const innerValue = ref(props.modelValue);
|
|
477
|
-
const innerVisible = computed({
|
|
478
|
-
get() {
|
|
479
|
-
return props.visible;
|
|
480
|
-
},
|
|
481
|
-
set(value) {
|
|
482
|
-
emit("update:visible", value);
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
const onChange = (value, pathNodes) => {
|
|
486
|
-
innerValue.value = value;
|
|
487
|
-
innerVisible.value = false;
|
|
488
|
-
emit("change", value, pathNodes);
|
|
489
|
-
emit("update:modelValue", value);
|
|
490
|
-
};
|
|
491
|
-
const onPathChange = (pathNodes) => {
|
|
492
|
-
emit("pathChange", pathNodes);
|
|
493
|
-
};
|
|
494
|
-
watch(() => props.modelValue, (value) => {
|
|
495
|
-
if (value !== innerValue.value) {
|
|
496
|
-
innerValue.value = value;
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
return {
|
|
500
|
-
onChange,
|
|
501
|
-
onPathChange,
|
|
502
|
-
innerValue,
|
|
503
|
-
innerVisible
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
const _hoisted_1 = ["innerHTML"];
|
|
508
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
509
|
-
const _component_nut_cascader_item = resolveComponent("nut-cascader-item");
|
|
510
|
-
const _component_nut_popup = resolveComponent("nut-popup");
|
|
511
|
-
return openBlock(), createBlock(_component_nut_popup, {
|
|
512
|
-
visible: _ctx.innerVisible,
|
|
513
|
-
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.innerVisible = $event),
|
|
514
|
-
position: "bottom",
|
|
515
|
-
"pop-class": "nut-cascader__popup",
|
|
516
|
-
round: "",
|
|
517
|
-
closeable: !_ctx.closeable,
|
|
518
|
-
"close-icon": _ctx.closeIcon,
|
|
519
|
-
"destroy-on-close": false,
|
|
520
|
-
"close-icon-position": _ctx.closeIconPosition
|
|
521
|
-
}, {
|
|
522
|
-
default: withCtx(() => [
|
|
523
|
-
_ctx.title ? (openBlock(), createElementBlock("view", {
|
|
524
|
-
key: 0,
|
|
525
|
-
class: "nut-cascader__bar",
|
|
526
|
-
innerHTML: _ctx.title
|
|
527
|
-
}, null, 8, _hoisted_1)) : createCommentVNode("", true),
|
|
528
|
-
createVNode(_component_nut_cascader_item, {
|
|
529
|
-
onChange: _ctx.onChange,
|
|
530
|
-
onPathChange: _ctx.onPathChange,
|
|
531
|
-
modelValue: _ctx.innerValue,
|
|
532
|
-
options: _ctx.options,
|
|
533
|
-
lazy: _ctx.lazy,
|
|
534
|
-
"lazy-load": _ctx.lazyLoad,
|
|
535
|
-
"value-key": _ctx.valueKey,
|
|
536
|
-
"text-key": _ctx.textKey,
|
|
537
|
-
"children-key": _ctx.childrenKey,
|
|
538
|
-
"convert-config": _ctx.convertConfig,
|
|
539
|
-
visible: _ctx.innerVisible
|
|
540
|
-
}, null, 8, ["onChange", "onPathChange", "modelValue", "options", "lazy", "lazy-load", "value-key", "text-key", "children-key", "convert-config", "visible"])
|
|
541
|
-
]),
|
|
542
|
-
_: 1
|
|
543
|
-
}, 8, ["visible", "closeable", "close-icon", "close-icon-position"]);
|
|
544
|
-
}
|
|
545
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
546
|
-
export { index as default };
|
|
137
|
+
} else
|
|
138
|
+
h2 = e2, t3 || (await g2(e2), h2 === e2 && (d2.value[i2.value].selectedNode = e2, f2.handleNode(e2, l2)));
|
|
139
|
+
}, handleTabClick(e2) {
|
|
140
|
+
h2 = null, i2.value = e2.paneKey;
|
|
141
|
+
}, formatTabTitle: (e2) => e2.selectedNode ? e2.selectedNode.text : V("select"), isSelected: (e2, l2) => e2.selectedNode && e2.selectedNode.value === l2.value };
|
|
142
|
+
return a([o2, () => t2.options], () => {
|
|
143
|
+
p2();
|
|
144
|
+
}, { deep: true, immediate: true }), a(() => t2.modelValue, (e2) => {
|
|
145
|
+
e2 !== r2.value && (r2.value = e2, y2());
|
|
146
|
+
}), a(() => t2.visible, (e2) => {
|
|
147
|
+
e2 && Array.isArray(r2.value) && r2.value.length > 0 && y2();
|
|
148
|
+
}), { panes: d2, initLoading: s2, tabsCursor: i2, ...f2 };
|
|
149
|
+
} }), N = { role: "menu", class: "nut-cascader-pane" }, z = ["aria-checked", "aria-disabled", "onClick"], L = { class: "nut-cascader-item__title" }, _ = d("view", { class: "nut-cascader-pane" }, null, -1);
|
|
150
|
+
var w = f(x, [["render", function(e2, l2, a2, h2, p2, y2) {
|
|
151
|
+
const g2 = t("nut-icon"), f2 = t("nut-tabpane"), m2 = t("nut-tabs");
|
|
152
|
+
return n(), o(m2, { class: "nut-cascader", modelValue: e2.tabsCursor, "onUpdate:modelValue": l2[0] || (l2[0] = (l3) => e2.tabsCursor = l3), onClick: e2.handleTabClick, "title-scroll": "" }, { default: i(() => [!e2.initLoading && e2.panes.length ? (n(true), s(r, { key: 0 }, u(e2.panes, (l3, a3) => (n(), o(f2, { title: e2.formatTabTitle(l3), key: a3 }, { default: i(() => [d("view", N, [(n(true), s(r, null, u(l3.nodes, (a4) => (n(), s("view", { key: a4.value, class: c(["nut-cascader-item", { active: e2.isSelected(l3, a4), disabled: a4.disabled }]), "aria-checked": e2.isSelected(l3, a4), "aria-disabled": a4.disabled || void 0, role: "menuitemradio", onClick: (l4) => e2.handleNode(a4, false) }, [d("view", L, v(a4.text), 1), a4.loading ? (n(), o(g2, { key: 0, class: "nut-cascader-item__icon-loading", name: "loading" })) : (n(), o(g2, { key: 1, class: "nut-cascader-item__icon-check", name: "checklist" }))], 10, z))), 128))])]), _: 2 }, 1032, ["title"]))), 128)) : (n(), o(f2, { key: 1, title: "Loading..." }, { default: i(() => [_]), _: 1 }))]), _: 1 }, 8, ["modelValue", "onClick"]);
|
|
153
|
+
}]]);
|
|
154
|
+
const { create: A } = g("cascader"), P = A({ components: { [w.name]: w }, props: { ...y, modelValue: Array, visible: Boolean, title: String, options: { type: Array, default: () => [] }, lazy: Boolean, lazyLoad: Function, valueKey: { type: String, default: "value" }, textKey: { type: String, default: "text" }, childrenKey: { type: String, default: "children" }, convertConfig: Object }, emits: ["update:modelValue", "change", "pathChange", "update:visible"], setup(t2, { emit: n2 }) {
|
|
155
|
+
const o2 = l(t2.modelValue), i2 = e({ get: () => t2.visible, set(e2) {
|
|
156
|
+
n2("update:visible", e2);
|
|
157
|
+
} });
|
|
158
|
+
return a(() => t2.modelValue, (e2) => {
|
|
159
|
+
e2 !== o2.value && (o2.value = e2);
|
|
160
|
+
}), { onChange: (e2, l2) => {
|
|
161
|
+
o2.value = e2, i2.value = false, n2("change", e2, l2), n2("update:modelValue", e2);
|
|
162
|
+
}, onPathChange: (e2) => {
|
|
163
|
+
n2("pathChange", e2);
|
|
164
|
+
}, innerValue: o2, innerVisible: i2 };
|
|
165
|
+
} }), B = ["innerHTML"];
|
|
166
|
+
var S = f(P, [["render", function(e2, l2, a2, r2, u2, d2) {
|
|
167
|
+
const c2 = t("nut-cascader-item"), v2 = t("nut-popup");
|
|
168
|
+
return n(), o(v2, { visible: e2.innerVisible, "onUpdate:visible": l2[0] || (l2[0] = (l3) => e2.innerVisible = l3), position: "bottom", "pop-class": "nut-cascader__popup", round: "", closeable: !e2.closeable, "close-icon": e2.closeIcon, "destroy-on-close": false, "close-icon-position": e2.closeIconPosition }, { default: i(() => [e2.title ? (n(), s("view", { key: 0, class: "nut-cascader__bar", innerHTML: e2.title }, null, 8, B)) : h("", true), p(c2, { onChange: e2.onChange, onPathChange: e2.onPathChange, modelValue: e2.innerValue, options: e2.options, lazy: e2.lazy, "lazy-load": e2.lazyLoad, "value-key": e2.valueKey, "text-key": e2.textKey, "children-key": e2.childrenKey, "convert-config": e2.convertConfig, visible: e2.innerVisible }, null, 8, ["onChange", "onPathChange", "modelValue", "options", "lazy", "lazy-load", "value-key", "text-key", "children-key", "convert-config", "visible"])]), _: 1 }, 8, ["visible", "closeable", "close-icon", "close-icon-position"]);
|
|
169
|
+
}]]);
|
|
170
|
+
export { S as default };
|