x-next 1.14.0 → 1.16.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.
- package/AI_USAGE/catalog.md +4 -2
- package/AI_USAGE/components/alert-api.md +1 -1
- package/AI_USAGE/components/alert.md +1 -1
- package/AI_USAGE/components/bar-chart-api.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/boxicons.md +1 -1
- package/AI_USAGE/components/button-api.md +1 -1
- package/AI_USAGE/components/button.md +1 -1
- package/AI_USAGE/components/charts.md +1 -1
- package/AI_USAGE/components/checkbox-api.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker-api.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider-api.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker-api.md +1 -1
- package/AI_USAGE/components/date-picker.md +1 -1
- package/AI_USAGE/components/dialog-api.md +1 -1
- package/AI_USAGE/components/dialog.md +1 -1
- package/AI_USAGE/components/draggable-api.md +1 -1
- package/AI_USAGE/components/draggable.md +1 -1
- package/AI_USAGE/components/drawer-api.md +1 -1
- package/AI_USAGE/components/drawer.md +30 -1
- package/AI_USAGE/components/dropdown-api.md +1 -1
- package/AI_USAGE/components/dropdown.md +1 -1
- package/AI_USAGE/components/empty-api.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/finicon.md +1 -1
- package/AI_USAGE/components/form-api.md +1 -1
- package/AI_USAGE/components/form.md +1 -1
- package/AI_USAGE/components/grid-api.md +1 -1
- package/AI_USAGE/components/grid.md +1 -1
- package/AI_USAGE/components/heatmap-api.md +1 -1
- package/AI_USAGE/components/heatmap.md +1 -1
- package/AI_USAGE/components/icon-api.md +1 -1
- package/AI_USAGE/components/icon.md +1 -1
- package/AI_USAGE/components/image-api.md +1 -1
- package/AI_USAGE/components/image.md +1 -1
- package/AI_USAGE/components/input-api.md +1 -1
- package/AI_USAGE/components/input-number-api.md +1 -1
- package/AI_USAGE/components/input-number.md +1 -1
- package/AI_USAGE/components/input-tag-api.md +1 -1
- package/AI_USAGE/components/input-tag.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/layout-api.md +1 -1
- package/AI_USAGE/components/layout.md +1 -1
- package/AI_USAGE/components/line-chart-api.md +3 -3
- package/AI_USAGE/components/line-chart.md +28 -1
- package/AI_USAGE/components/link-api.md +1 -1
- package/AI_USAGE/components/link.md +1 -1
- package/AI_USAGE/components/menu-api.md +1 -1
- package/AI_USAGE/components/menu.md +1 -1
- package/AI_USAGE/components/message-api.md +1 -1
- package/AI_USAGE/components/message-box-api.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/network-api.md +1 -1
- package/AI_USAGE/components/network.md +1 -1
- package/AI_USAGE/components/notification-api.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination-api.md +1 -1
- package/AI_USAGE/components/pagination.md +1 -1
- package/AI_USAGE/components/pie-chart-api.md +1 -1
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm-api.md +1 -1
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover-api.md +1 -1
- package/AI_USAGE/components/popover.md +1 -1
- package/AI_USAGE/components/popup-api.md +1 -1
- package/AI_USAGE/components/popup.md +1 -1
- package/AI_USAGE/components/progress-api.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio-api.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate-api.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/resize-box-api.md +1 -1
- package/AI_USAGE/components/resize-box.md +1 -1
- package/AI_USAGE/components/scrollbar-api.md +1 -1
- package/AI_USAGE/components/scrollbar.md +1 -1
- package/AI_USAGE/components/select-api.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/skeleton-api.md +1 -1
- package/AI_USAGE/components/skeleton.md +1 -1
- package/AI_USAGE/components/slider-api.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/space-api.md +1 -1
- package/AI_USAGE/components/space.md +1 -1
- package/AI_USAGE/components/spin-api.md +1 -1
- package/AI_USAGE/components/spin.md +1 -1
- package/AI_USAGE/components/steps-api.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch-api.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/table-api.md +1 -1
- package/AI_USAGE/components/table.md +44 -1
- package/AI_USAGE/components/tabs-api.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/tag-api.md +1 -1
- package/AI_USAGE/components/tag.md +1 -1
- package/AI_USAGE/components/textarea-api.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker-api.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/time-range-selector-api.md +1 -1
- package/AI_USAGE/components/time-range-selector.md +1 -1
- package/AI_USAGE/components/timeline-api.md +1 -1
- package/AI_USAGE/components/timeline.md +1 -1
- package/AI_USAGE/components/tooltip-api.md +1 -1
- package/AI_USAGE/components/tooltip.md +1 -1
- package/AI_USAGE/components/tree-select-api.md +498 -0
- package/AI_USAGE/components/tree-select.md +744 -0
- package/AI_USAGE/components/trend-chart-api.md +1 -1
- package/AI_USAGE/components/trend-chart.md +1 -1
- package/AI_USAGE/components/trigger-api.md +1 -1
- package/AI_USAGE/components/trigger.md +1 -1
- package/AI_USAGE/components/upload-api.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/components/watermark-api.md +1 -1
- package/AI_USAGE/components/watermark.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +3 -2
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +1326 -5
- package/CHANGELOG.md +32 -0
- package/dist/_props/css.d.ts +2 -1
- package/dist/components/_components/input-label/input-label.d.ts +3 -0
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/line-chart/LineChart.d.ts +1 -1
- package/dist/components/line-chart/index.d.ts +3 -3
- package/dist/components/line-chart/interface.d.ts +2 -2
- package/dist/components/tree-select/TreeNode.vue.d.ts +478 -0
- package/dist/components/tree-select/TreeSelect.d.ts +1549 -0
- package/dist/components/tree-select/TreeSelectDropdown.vue.d.ts +569 -0
- package/dist/components/tree-select/hooks/use-tree-select.d.ts +92 -0
- package/dist/components/tree-select/index.d.ts +3321 -0
- package/dist/components/tree-select/interface.d.ts +203 -0
- package/dist/components/tree-select/utils.d.ts +64 -0
- package/dist/es/_styles/palette-aliases.js +3 -0
- package/dist/es/components/_components/feedback-icon/index.vue2.js +10 -10
- package/dist/es/components/_components/input-label/input-label.js +69 -65
- package/dist/es/components/_components/select-view/select-view.js +1 -0
- package/dist/es/components/button/Button.js +9 -9
- package/dist/es/components/drawer/src/Drawer.vue.js +26 -26
- package/dist/es/components/form-switch/Switch.vue2.js +18 -18
- package/dist/es/components/image/Image.vue2.js +13 -13
- package/dist/es/components/image/ImagePreview.vue2.js +33 -33
- package/dist/es/components/index.js +55 -52
- package/dist/es/components/link/Link.vue2.js +12 -12
- package/dist/es/components/message/message.vue2.js +13 -13
- package/dist/es/components/spin/Spin.js +28 -28
- package/dist/es/components/tag/Tag.vue2.js +22 -22
- package/dist/es/components/timeline/src/Timeline.js +7 -7
- package/dist/es/components/tree-select/TreeNode.vue.js +91 -0
- package/dist/es/components/tree-select/TreeNode.vue2.js +162 -0
- package/dist/es/components/tree-select/TreeSelect.js +865 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue.js +57 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue2.js +79 -0
- package/dist/es/components/tree-select/hooks/use-tree-select.js +376 -0
- package/dist/es/components/tree-select/index.js +13 -0
- package/dist/es/components/tree-select/utils.js +181 -0
- package/dist/es/icons/animation/animation-loading.js +2 -2
- package/dist/es/index.js +71 -68
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/base.css +1 -1
- package/dist/style/dependencies.json +10 -0
- package/dist/style/drawer.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/tree-select.css +1 -0
- package/dist/style/tree-select.js +8 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +2 -1
- package/volar.d.ts +2 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import C from "./TreeNode.vue2.js";
|
|
2
|
+
import { resolveComponent as d, openBlock as a, createElementBlock as o, normalizeStyle as b, normalizeClass as l, createElementVNode as m, withModifiers as v, renderSlot as r, createBlock as i, createCommentVNode as h, resolveDynamicComponent as y, normalizeProps as f, guardReactiveProps as N, Fragment as t, renderList as w, toDisplayString as p, createTextVNode as z } from "vue";
|
|
3
|
+
import M from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const $ = ["id", "aria-level", "aria-setsize", "aria-posinset", "aria-selected", "aria-checked", "aria-disabled", "aria-expanded"];
|
|
5
|
+
function E(e, s, S, D, I, T) {
|
|
6
|
+
const c = d("icon-loading"), k = d("icon-right"), u = d("checkbox");
|
|
7
|
+
return a(), o("li", {
|
|
8
|
+
id: e.nodeId,
|
|
9
|
+
role: "treeitem",
|
|
10
|
+
"aria-level": e.node.level + 1,
|
|
11
|
+
"aria-setsize": e.siblingCount,
|
|
12
|
+
"aria-posinset": e.siblingIndex + 1,
|
|
13
|
+
"aria-selected": e.selected || void 0,
|
|
14
|
+
"aria-checked": e.checkable ? e.halfChecked ? "mixed" : e.checked : void 0,
|
|
15
|
+
"aria-disabled": e.mergedDisabled || void 0,
|
|
16
|
+
"aria-expanded": e.hasChildren ? e.expanded : void 0,
|
|
17
|
+
class: l(e.cls),
|
|
18
|
+
style: b(e.indentStyle),
|
|
19
|
+
onClick: s[1] || (s[1] = (...n) => e.handleClick && e.handleClick(...n)),
|
|
20
|
+
onMouseenter: s[2] || (s[2] = (...n) => e.handleMouseEnter && e.handleMouseEnter(...n)),
|
|
21
|
+
onMouseleave: s[3] || (s[3] = (...n) => e.handleMouseLeave && e.handleMouseLeave(...n))
|
|
22
|
+
}, [
|
|
23
|
+
m("div", {
|
|
24
|
+
class: l(e.contentCls)
|
|
25
|
+
}, [
|
|
26
|
+
e.showSwitcher ? (a(), o("span", {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: l(e.className.element("switcher")),
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
onClick: s[0] || (s[0] = v((...n) => e.handleToggleExpand && e.handleToggleExpand(...n), ["stop"]))
|
|
31
|
+
}, [
|
|
32
|
+
r(e.$slots, "switcher-icon", {
|
|
33
|
+
node: e.node.raw,
|
|
34
|
+
expanded: e.expanded,
|
|
35
|
+
loading: e.loading
|
|
36
|
+
}, () => [
|
|
37
|
+
e.loading ? (a(), i(c, {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: l(e.className.element("switcher-loading"))
|
|
40
|
+
}, null, 8, ["class"])) : (a(), i(k, {
|
|
41
|
+
key: 1,
|
|
42
|
+
class: l(e.className.element("switcher-icon"))
|
|
43
|
+
}, null, 8, ["class"]))
|
|
44
|
+
])
|
|
45
|
+
], 2)) : (a(), o("span", {
|
|
46
|
+
key: 1,
|
|
47
|
+
class: l(e.className.element("switcher-placeholder")),
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}, null, 2)),
|
|
50
|
+
e.showCheckbox ? (a(), i(u, {
|
|
51
|
+
key: 2,
|
|
52
|
+
class: l(e.className.element("checkbox")),
|
|
53
|
+
"model-value": e.checked,
|
|
54
|
+
indeterminate: e.halfChecked,
|
|
55
|
+
disabled: e.checkboxDisabled,
|
|
56
|
+
size: e.size,
|
|
57
|
+
tabindex: -1,
|
|
58
|
+
"uninject-group-context": "",
|
|
59
|
+
onChange: e.handleCheckboxChange
|
|
60
|
+
}, null, 8, ["class", "model-value", "indeterminate", "disabled", "size", "onChange"])) : h("", !0),
|
|
61
|
+
e.nodeIcon ? (a(), o("span", {
|
|
62
|
+
key: 3,
|
|
63
|
+
class: l(e.className.element("icon"))
|
|
64
|
+
}, [
|
|
65
|
+
r(e.$slots, "node-icon", {
|
|
66
|
+
node: e.node.raw
|
|
67
|
+
}, () => [
|
|
68
|
+
(a(), i(y(e.nodeIcon)))
|
|
69
|
+
])
|
|
70
|
+
], 2)) : h("", !0),
|
|
71
|
+
m("span", {
|
|
72
|
+
class: l(e.className.element("title"))
|
|
73
|
+
}, [
|
|
74
|
+
r(e.$slots, "default", f(N(e.slotProps)), () => [
|
|
75
|
+
(a(!0), o(t, null, w(e.titleSegments, (n, g) => (a(), o(t, { key: g }, [
|
|
76
|
+
n.match ? (a(), o("mark", {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: l(e.className.element("highlight"))
|
|
79
|
+
}, p(n.text), 3)) : (a(), o(t, { key: 1 }, [
|
|
80
|
+
z(p(n.text), 1)
|
|
81
|
+
], 64))
|
|
82
|
+
], 64))), 128))
|
|
83
|
+
])
|
|
84
|
+
], 2)
|
|
85
|
+
], 2)
|
|
86
|
+
], 46, $);
|
|
87
|
+
}
|
|
88
|
+
const V = /* @__PURE__ */ M(C, [["render", E]]);
|
|
89
|
+
export {
|
|
90
|
+
V as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { defineComponent as v, provide as C, computed as n } from "vue";
|
|
2
|
+
import { getClassNameMixin as y } from "../../_utils/config.js";
|
|
3
|
+
import B from "../form-checkbox/Checkbox.js";
|
|
4
|
+
import I from "../../icons/default/right.js";
|
|
5
|
+
import L from "../../icons/animation/animation-loading.js";
|
|
6
|
+
import { formItemInjectionKey as w } from "../form/context.js";
|
|
7
|
+
import { splitHighlightText as N } from "./utils.js";
|
|
8
|
+
const a = 24, S = 8, O = v({
|
|
9
|
+
name: "TreeNode",
|
|
10
|
+
components: {
|
|
11
|
+
Checkbox: B,
|
|
12
|
+
IconRight: I,
|
|
13
|
+
IconLoading: L
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
node: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
nodeId: String,
|
|
21
|
+
selected: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
checked: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
halfChecked: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
expanded: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
active: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
loading: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
checkable: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
multiple: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
showLine: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
blockNode: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "medium"
|
|
68
|
+
},
|
|
69
|
+
highlight: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ""
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
emits: {
|
|
75
|
+
select: () => !0,
|
|
76
|
+
check: () => !0,
|
|
77
|
+
"toggle-expand": (e) => !0,
|
|
78
|
+
hover: () => !0,
|
|
79
|
+
leave: () => !0
|
|
80
|
+
},
|
|
81
|
+
setup(e, { emit: d, slots: E }) {
|
|
82
|
+
const l = y("tree-select--node");
|
|
83
|
+
C(w, {});
|
|
84
|
+
const i = n(() => e.checkable || e.multiple), c = n(
|
|
85
|
+
() => !e.node.isLeaf || e.loading
|
|
86
|
+
), s = n(() => !e.node.isLeaf), t = n(() => e.disabled || e.node.disabled), f = n(
|
|
87
|
+
() => t.value || e.node.disableCheckbox
|
|
88
|
+
), h = n(() => ({
|
|
89
|
+
paddingLeft: `${e.node.level * a}px`,
|
|
90
|
+
// 连接线对齐父级展开图标的水平中心
|
|
91
|
+
"--x-tree-select-node-line-left": `${(e.node.level - 1) * a + S}px`
|
|
92
|
+
})), u = n(() => e.node.siblingCount), m = n(() => e.node.siblingIndex), g = n(() => {
|
|
93
|
+
var o;
|
|
94
|
+
return (o = e.node.raw) == null ? void 0 : o.icon;
|
|
95
|
+
}), b = n(
|
|
96
|
+
() => N(e.node.title, e.highlight)
|
|
97
|
+
), x = n(() => ({
|
|
98
|
+
node: e.node.raw,
|
|
99
|
+
value: e.node.value,
|
|
100
|
+
title: e.node.title,
|
|
101
|
+
level: e.node.level,
|
|
102
|
+
checked: e.checked,
|
|
103
|
+
halfChecked: e.halfChecked,
|
|
104
|
+
selected: e.selected,
|
|
105
|
+
expanded: e.expanded,
|
|
106
|
+
disabled: t.value,
|
|
107
|
+
isLeaf: e.node.isLeaf
|
|
108
|
+
})), k = n(() => [
|
|
109
|
+
l.block,
|
|
110
|
+
l.modifier(`size-${e.size}`),
|
|
111
|
+
{
|
|
112
|
+
[l.modifier("last")]: e.node.lastChild,
|
|
113
|
+
[l.modifier("root")]: e.node.level === 0,
|
|
114
|
+
[l.modifier("is-expanded")]: e.expanded,
|
|
115
|
+
[l.modifier("active")]: e.active,
|
|
116
|
+
[l.modifier("selected")]: e.selected,
|
|
117
|
+
[l.modifier("disabled")]: t.value,
|
|
118
|
+
[l.modifier("with-line")]: e.showLine,
|
|
119
|
+
[l.modifier("block")]: e.blockNode
|
|
120
|
+
}
|
|
121
|
+
]), r = n(() => [
|
|
122
|
+
l.element("content"),
|
|
123
|
+
{
|
|
124
|
+
[l.element("content-block")]: e.blockNode
|
|
125
|
+
}
|
|
126
|
+
]);
|
|
127
|
+
return {
|
|
128
|
+
className: l,
|
|
129
|
+
cls: k,
|
|
130
|
+
contentCls: r,
|
|
131
|
+
indentStyle: h,
|
|
132
|
+
showCheckbox: i,
|
|
133
|
+
showSwitcher: c,
|
|
134
|
+
hasChildren: s,
|
|
135
|
+
mergedDisabled: t,
|
|
136
|
+
checkboxDisabled: f,
|
|
137
|
+
siblingCount: u,
|
|
138
|
+
siblingIndex: m,
|
|
139
|
+
nodeIcon: g,
|
|
140
|
+
titleSegments: b,
|
|
141
|
+
slotProps: x,
|
|
142
|
+
handleClick: () => {
|
|
143
|
+
t.value || d("select");
|
|
144
|
+
},
|
|
145
|
+
handleCheckboxChange: () => {
|
|
146
|
+
t.value || e.node.disableCheckbox || d("check");
|
|
147
|
+
},
|
|
148
|
+
handleToggleExpand: () => {
|
|
149
|
+
e.loading || d("toggle-expand", !e.expanded);
|
|
150
|
+
},
|
|
151
|
+
handleMouseEnter: () => {
|
|
152
|
+
d("hover");
|
|
153
|
+
},
|
|
154
|
+
handleMouseLeave: () => {
|
|
155
|
+
d("leave");
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
O as default
|
|
162
|
+
};
|