morya-ui 0.2.3 → 0.2.4
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/CHANGELOG.md +22 -0
- package/dist/FlyoutSubmenu-BC_cl17_.js +49 -0
- package/dist/ScrollBody-CXFNhBvq.js +68 -0
- package/dist/accordion/style.css +625 -583
- package/dist/auto-complete/style.css +625 -583
- package/dist/avatar/style.css +625 -583
- package/dist/badge/style.css +625 -583
- package/dist/block-ui/style.css +625 -583
- package/dist/breadcrumb/style.css +625 -583
- package/dist/button/style.css +625 -583
- package/dist/card/style.css +625 -583
- package/dist/carousel/style.css +625 -583
- package/dist/cascade-select/style.css +625 -583
- package/dist/checkbox/style.css +625 -583
- package/dist/chip/style.css +625 -583
- package/dist/command-menu/style.css +625 -583
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenuNodes.vue.d.ts.map +1 -1
- package/dist/components/ContextMenu/styles.css +33 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts +2 -2
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/styles.css +11 -0
- package/dist/components/Gallery/Gallery.vue.d.ts +2 -2
- package/dist/components/Gallery/Gallery.vue.d.ts.map +1 -1
- package/dist/components/Gallery/styles.css +5 -1
- package/dist/components/Layout/Layout.vue.d.ts +3 -3
- package/dist/components/Layout/Layout.vue.d.ts.map +1 -1
- package/dist/components/Layout/LayoutContent.vue.d.ts +2 -2
- package/dist/components/Layout/LayoutContent.vue.d.ts.map +1 -1
- package/dist/components/Layout/LayoutScrollContext.vue.d.ts +20 -0
- package/dist/components/Layout/LayoutScrollContext.vue.d.ts.map +1 -0
- package/dist/components/Layout/LayoutScrollRegion.vue.d.ts +34 -0
- package/dist/components/Layout/LayoutScrollRegion.vue.d.ts.map +1 -0
- package/dist/components/Layout/LayoutSider.vue.d.ts +2 -2
- package/dist/components/Layout/LayoutSider.vue.d.ts.map +1 -1
- package/dist/components/Layout/composables/useLayoutScroll.d.ts +4 -1
- package/dist/components/Layout/composables/useLayoutScroll.d.ts.map +1 -1
- package/dist/components/Layout/styles.css +31 -13
- package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
- package/dist/components/Menu/styles.css +10 -0
- package/dist/components/Menubar/Menubar.vue.d.ts +2 -2
- package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
- package/dist/components/Menubar/styles.css +14 -0
- package/dist/components/OrderList/OrderList.vue.d.ts +4 -4
- package/dist/components/OrderList/OrderList.vue.d.ts.map +1 -1
- package/dist/components/PickList/PickList.vue.d.ts +7 -7
- package/dist/components/PickList/PickList.vue.d.ts.map +1 -1
- package/dist/components/ScrollTop/ScrollTop.vue.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.vue.d.ts +3 -3
- package/dist/components/Tabs/Tabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/styles.css +72 -77
- package/dist/components/Terminal/Terminal.vue.d.ts.map +1 -1
- package/dist/components/Terminal/styles.css +6 -2
- package/dist/components/TieredMenu/TieredMenu.vue.d.ts.map +1 -1
- package/dist/components/TieredMenu/styles.css +33 -4
- package/dist/components/Timeline/Timeline.vue.d.ts +35 -10
- package/dist/components/Timeline/Timeline.vue.d.ts.map +1 -1
- package/dist/components/Timeline/styles.css +159 -156
- package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
- package/dist/components/TreeSelect/styles.css +15 -0
- package/dist/components/TreeTable/TreeTable.vue.d.ts +2 -2
- package/dist/components/TreeTable/TreeTable.vue.d.ts.map +1 -1
- package/dist/components/TreeTable/styles.css +64 -61
- package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts +2 -2
- package/dist/components/VirtualScroller/VirtualScroller.vue.d.ts.map +1 -1
- package/dist/components/VirtualScroller/styles.css +20 -17
- package/dist/config-provider/style.css +625 -583
- package/dist/confirm-dialog/style.css +625 -583
- package/dist/confirm-popup/style.css +625 -583
- package/dist/context-menu/index.js +131 -89
- package/dist/context-menu/style.css +781 -587
- package/dist/context-menu/style.js +1 -0
- package/dist/data-view/style.css +625 -583
- package/dist/date-picker/style.css +625 -583
- package/dist/dialog/style.css +625 -583
- package/dist/divider/style.css +625 -583
- package/dist/dock/style.css +625 -583
- package/dist/drawer/style.css +625 -583
- package/dist/dropdown/index.js +162 -122
- package/dist/dropdown/style.css +759 -583
- package/dist/dropdown/style.js +1 -0
- package/dist/fieldset/style.css +625 -583
- package/dist/file-upload/style.css +625 -583
- package/dist/flex/style.css +625 -583
- package/dist/float-label/style.css +625 -583
- package/dist/fluid/style.css +625 -583
- package/dist/form/style.css +625 -583
- package/dist/gallery/index.js +76 -67
- package/dist/gallery/style.css +753 -584
- package/dist/gallery/style.js +1 -0
- package/dist/grid/style.css +625 -583
- package/dist/icon/style.css +625 -583
- package/dist/icon-field/style.css +625 -583
- package/dist/index.js +1925 -1474
- package/dist/inplace/style.css +625 -583
- package/dist/input/style.css +625 -583
- package/dist/input-color/style.css +625 -583
- package/dist/input-group/style.css +625 -583
- package/dist/input-number/style.css +625 -583
- package/dist/input-otp/style.css +625 -583
- package/dist/input-password/style.css +625 -583
- package/dist/input-tags/style.css +625 -583
- package/dist/knob/style.css +625 -583
- package/dist/label/style.css +625 -583
- package/dist/layout/index.js +230 -136
- package/dist/layout/style.css +779 -596
- package/dist/layout/style.js +1 -0
- package/dist/listbox/style.css +625 -583
- package/dist/mega-menu/style.css +625 -583
- package/dist/menu/index.js +233 -216
- package/dist/menu/style.css +758 -583
- package/dist/menu/style.js +1 -0
- package/dist/menubar/index.js +77 -68
- package/dist/menubar/style.css +762 -583
- package/dist/menubar/style.js +1 -0
- package/dist/message/style.css +625 -583
- package/dist/meter-group/style.css +625 -583
- package/dist/order-list/index.js +66 -58
- package/dist/order-list/style.css +625 -583
- package/dist/page/style.css +625 -583
- package/dist/pagination/style.css +625 -583
- package/dist/panel/style.css +625 -583
- package/dist/pick-list/index.js +97 -84
- package/dist/pick-list/style.css +625 -583
- package/dist/popover/style.css +625 -583
- package/dist/progress-bar/style.css +625 -583
- package/dist/progress-spinner/style.css +625 -583
- package/dist/radio/style.css +625 -583
- package/dist/rating/style.css +625 -583
- package/dist/scroll-top/index.js +23 -13
- package/dist/scroll-top/style.css +748 -583
- package/dist/scroll-top/style.js +1 -0
- package/dist/scrollbar/style.css +625 -583
- package/dist/select/style.css +625 -583
- package/dist/select-button/style.css +625 -583
- package/dist/shared/FlyoutSubmenu.vue.d.ts +32 -0
- package/dist/shared/FlyoutSubmenu.vue.d.ts.map +1 -0
- package/dist/shared/ScrollBody.vue.d.ts +39 -0
- package/dist/shared/ScrollBody.vue.d.ts.map +1 -0
- package/dist/sidebar/style.css +625 -583
- package/dist/skeleton/style.css +625 -583
- package/dist/slider/style.css +625 -583
- package/dist/space/style.css +625 -583
- package/dist/speed-dial/style.css +625 -583
- package/dist/split-button/style.css +625 -583
- package/dist/splitter/style.css +625 -583
- package/dist/stepper/style.css +625 -583
- package/dist/styles/base.css +625 -583
- package/dist/styles.css +1 -1
- package/dist/switch/style.css +625 -583
- package/dist/table/style.css +625 -583
- package/dist/tabs/index.js +92 -81
- package/dist/tabs/style.css +818 -658
- package/dist/tabs/style.js +1 -0
- package/dist/tag/style.css +625 -583
- package/dist/terminal/index.js +47 -40
- package/dist/terminal/style.css +631 -585
- package/dist/textarea/style.css +625 -583
- package/dist/tiered-menu/index.js +130 -84
- package/dist/tiered-menu/style.css +781 -587
- package/dist/tiered-menu/style.js +1 -0
- package/dist/timeline/index.js +82 -37
- package/dist/timeline/style.css +907 -739
- package/dist/timeline/style.js +1 -0
- package/dist/toast/style.css +625 -583
- package/dist/toggle-button/style.css +625 -583
- package/dist/toolbar/style.css +625 -583
- package/dist/tooltip/style.css +625 -583
- package/dist/tree/style.css +625 -583
- package/dist/tree-select/index.js +202 -193
- package/dist/tree-select/style.css +763 -583
- package/dist/tree-select/style.js +1 -0
- package/dist/tree-table/index.js +57 -50
- package/dist/tree-table/style.css +689 -644
- package/dist/virtual-scroller/index.js +38 -34
- package/dist/virtual-scroller/style.css +775 -607
- package/dist/virtual-scroller/style.js +1 -0
- package/package.json +1 -1
|
@@ -4,27 +4,28 @@ import { t as n } from "../useMId-BXFYayPP.js";
|
|
|
4
4
|
import { n as r, t as i } from "../overlay-oR-5MDuE.js";
|
|
5
5
|
import { t as ee } from "../overlayPlacement-Cd20JTD_.js";
|
|
6
6
|
import { t as te } from "../useMenuKeyboard-BedmYE4W.js";
|
|
7
|
+
import { t as ne } from "../Scrollbar-DoNZvgX2.js";
|
|
7
8
|
import { t as a } from "../Checkbox-BjtAYUUD.js";
|
|
8
|
-
import { t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { c as
|
|
11
|
-
import { n as
|
|
9
|
+
import { t as re } from "../useFieldFeedback-C5qIqYMK.js";
|
|
10
|
+
import { a as ie, i as ae, n as oe, o as se, r as o, s as ce } from "../checkStrategy-CZzuUKDI.js";
|
|
11
|
+
import { c as le, o as ue } from "../config-CI8_WBbE.js";
|
|
12
|
+
import { n as de } from "../locale-DYGhxekd.js";
|
|
12
13
|
import "./style.js";
|
|
13
|
-
import { Fragment as
|
|
14
|
+
import { Fragment as s, Teleport as fe, Transition as pe, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeProps as me, nextTick as he, normalizeClass as g, normalizeStyle as ge, onBeforeUnmount as _e, openBlock as _, ref as v, renderList as y, renderSlot as ve, resolveDynamicComponent as b, toDisplayString as x, unref as S, useAttrs as ye, useSlots as be, vModelText as xe, watch as Se, withCtx as Ce, withDirectives as we, withModifiers as C } from "vue";
|
|
14
15
|
//#region src/components/TreeSelect/TreeSelectNodeItem.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
-
var
|
|
16
|
+
var w = [
|
|
16
17
|
"aria-expanded",
|
|
17
18
|
"aria-level",
|
|
18
19
|
"aria-disabled",
|
|
19
20
|
"aria-selected",
|
|
20
21
|
"aria-checked"
|
|
21
|
-
], T = ["aria-label"],
|
|
22
|
+
], T = ["aria-label"], Te = {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "m-treeselect__toggler-spacer"
|
|
24
|
-
},
|
|
25
|
+
}, E = ["disabled", "tabindex"], D = {
|
|
25
26
|
key: 0,
|
|
26
27
|
role: "group"
|
|
27
|
-
},
|
|
28
|
+
}, O = /* @__PURE__ */ h({
|
|
28
29
|
__name: "TreeSelectNodeItem",
|
|
29
30
|
props: {
|
|
30
31
|
node: {},
|
|
@@ -42,47 +43,47 @@ var Ce = [
|
|
|
42
43
|
"check"
|
|
43
44
|
],
|
|
44
45
|
setup(e) {
|
|
45
|
-
let n =
|
|
46
|
-
return (r, i) => (
|
|
47
|
-
class:
|
|
46
|
+
let n = de();
|
|
47
|
+
return (r, i) => (_(), d("li", {
|
|
48
|
+
class: g(["m-treeselect__node", { "m-treeselect__node--active": e.node.key === e.activeKey }]),
|
|
48
49
|
role: "treeitem",
|
|
49
50
|
"aria-expanded": e.node.children?.length ? !!e.expanded[e.node.key] : void 0,
|
|
50
51
|
"aria-level": e.depth + 1,
|
|
51
52
|
"aria-disabled": e.node.disabled || void 0,
|
|
52
53
|
"aria-selected": e.showCheckbox ? void 0 : e.selectedKeys.includes(e.node.key),
|
|
53
54
|
"aria-checked": e.showCheckbox ? !!e.checkedKeys[e.node.key] : void 0
|
|
54
|
-
}, [
|
|
55
|
+
}, [f("div", {
|
|
55
56
|
class: "m-treeselect__row",
|
|
56
|
-
style:
|
|
57
|
+
style: ge({ paddingLeft: `${e.depth * .75}rem` })
|
|
57
58
|
}, [
|
|
58
|
-
e.node.children?.length ? (
|
|
59
|
+
e.node.children?.length ? (_(), d("button", {
|
|
59
60
|
key: 0,
|
|
60
61
|
type: "button",
|
|
61
62
|
class: "m-treeselect__toggler",
|
|
62
63
|
tabindex: "-1",
|
|
63
|
-
"aria-label": e.expanded[e.node.key] ?
|
|
64
|
-
onClick: i[0] ||=
|
|
65
|
-
}, [
|
|
64
|
+
"aria-label": e.expanded[e.node.key] ? S(n).collapse : S(n).expand,
|
|
65
|
+
onClick: i[0] ||= C((t) => r.$emit("toggle", e.node.key), ["stop"])
|
|
66
|
+
}, [m(t, {
|
|
66
67
|
name: e.expanded[e.node.key] ? "chevron-down" : "chevron-right",
|
|
67
68
|
size: "sm"
|
|
68
|
-
}, null, 8, ["name"])], 8, T)) : (
|
|
69
|
-
e.showCheckbox ? (
|
|
69
|
+
}, null, 8, ["name"])], 8, T)) : (_(), d("span", Te)),
|
|
70
|
+
e.showCheckbox ? (_(), l(a, {
|
|
70
71
|
key: 2,
|
|
71
72
|
class: "m-treeselect__checkbox",
|
|
72
73
|
tabindex: "-1",
|
|
73
74
|
"model-value": !!e.checkedKeys[e.node.key],
|
|
74
75
|
disabled: e.node.disabled,
|
|
75
76
|
"onUpdate:modelValue": i[1] ||= (t) => r.$emit("check", e.node),
|
|
76
|
-
onClick: i[2] ||=
|
|
77
|
-
}, null, 8, ["model-value", "disabled"])) :
|
|
78
|
-
|
|
77
|
+
onClick: i[2] ||= C(() => {}, ["stop"])
|
|
78
|
+
}, null, 8, ["model-value", "disabled"])) : u("", !0),
|
|
79
|
+
f("button", {
|
|
79
80
|
type: "button",
|
|
80
|
-
class:
|
|
81
|
+
class: g(["m-treeselect__option", { "m-treeselect__option--selected": e.selectedKeys.includes(e.node.key) }]),
|
|
81
82
|
disabled: e.node.disabled,
|
|
82
83
|
tabindex: e.node.key === e.activeKey ? 0 : -1,
|
|
83
84
|
onClick: i[3] ||= (t) => r.$emit("select", e.node)
|
|
84
|
-
}, [e.renderOption ? (
|
|
85
|
-
], 4), e.node.children?.length && e.expanded[e.node.key] ? (
|
|
85
|
+
}, [e.renderOption ? (_(), l(b(() => e.renderOption?.(e.node)), { key: 0 })) : (_(), d(s, { key: 1 }, [p(x(e.node.label), 1)], 64))], 10, E)
|
|
86
|
+
], 4), e.node.children?.length && e.expanded[e.node.key] ? (_(), d("ul", D, [(_(!0), d(s, null, y(e.node.children, (t) => (_(), l(O, {
|
|
86
87
|
key: t.key,
|
|
87
88
|
node: t,
|
|
88
89
|
depth: e.depth + 1,
|
|
@@ -104,9 +105,9 @@ var Ce = [
|
|
|
104
105
|
"show-checkbox",
|
|
105
106
|
"active-key",
|
|
106
107
|
"render-option"
|
|
107
|
-
]))), 128))])) :
|
|
108
|
+
]))), 128))])) : u("", !0)], 10, w));
|
|
108
109
|
}
|
|
109
|
-
}),
|
|
110
|
+
}), Ee = ["for"], De = [
|
|
110
111
|
"id",
|
|
111
112
|
"tabindex",
|
|
112
113
|
"aria-disabled",
|
|
@@ -114,20 +115,20 @@ var Ce = [
|
|
|
114
115
|
"aria-controls",
|
|
115
116
|
"aria-invalid",
|
|
116
117
|
"aria-describedby"
|
|
117
|
-
],
|
|
118
|
+
], Oe = {
|
|
118
119
|
key: 0,
|
|
119
120
|
class: "m-treeselect__tags"
|
|
120
|
-
},
|
|
121
|
+
}, ke = { class: "m-select__tag-label" }, Ae = [
|
|
121
122
|
"aria-label",
|
|
122
123
|
"disabled",
|
|
123
124
|
"onClick"
|
|
124
|
-
],
|
|
125
|
+
], je = {
|
|
125
126
|
key: 0,
|
|
126
127
|
class: "m-select__tag m-select__tag--more"
|
|
127
|
-
},
|
|
128
|
+
}, Me = { class: "m-select__suffix" }, Ne = ["aria-label"], Pe = ["id"], Fe = ["placeholder"], Ie = {
|
|
128
129
|
class: "m-treeselect__tree",
|
|
129
130
|
role: "tree"
|
|
130
|
-
},
|
|
131
|
+
}, Le = ["id", "role"], k = /* @__PURE__ */ h({
|
|
131
132
|
inheritAttrs: !1,
|
|
132
133
|
__name: "TreeSelect",
|
|
133
134
|
props: {
|
|
@@ -184,31 +185,31 @@ var Ce = [
|
|
|
184
185
|
name: {}
|
|
185
186
|
},
|
|
186
187
|
emits: ["update:modelValue", "clear"],
|
|
187
|
-
setup(a, { emit:
|
|
188
|
-
let
|
|
188
|
+
setup(a, { emit: p }) {
|
|
189
|
+
let h = a, b = p, w = ye(), { rootAttrs: T, controlAttrs: Te } = e(w, () => h.pt, { controlKey: "control" }), E = be(), D = le(), k = de(), Re = ue("TreeSelect", () => h.size), ze = n("m-treeselect"), A = c(() => h.id ?? ze), { isInvalid: j, feedbackText: M, feedbackIsError: Be } = re(h), N = v(!1), P = v(""), F = v(null), I = v(null), L = v(null), Ve = v({}), R = v({}), He = c(() => r(h, D.value.appendTo)), z = c(() => i(h, D.value.appendTo)), B = c(() => h.multiple || h.selectionMode === "multiple" || h.checkable), V = c(() => Array.isArray(h.modelValue) ? h.modelValue : typeof h.modelValue == "string" && h.modelValue ? [h.modelValue] : []), Ue = c(() => {
|
|
189
190
|
let e = {};
|
|
190
|
-
for (let t of
|
|
191
|
+
for (let t of V.value) e[t] = !0;
|
|
191
192
|
return e;
|
|
192
|
-
}),
|
|
193
|
-
let e =
|
|
194
|
-
if (!e ||
|
|
195
|
-
if (
|
|
196
|
-
let t =
|
|
197
|
-
return t.length ? t.join(
|
|
193
|
+
}), H = c(() => oe(h.options, Ue.value, h.checkStrategy, h.checkStrictly)), We = c(() => {
|
|
194
|
+
let e = V.value[0];
|
|
195
|
+
if (!e || B.value) return h.placeholder ?? k.value.selectPlaceholder;
|
|
196
|
+
if (h.showPath) {
|
|
197
|
+
let t = ae(h.options, e);
|
|
198
|
+
return t.length ? t.join(h.separator) : e;
|
|
198
199
|
}
|
|
199
|
-
return
|
|
200
|
-
}),
|
|
201
|
-
let e =
|
|
202
|
-
return e && !
|
|
203
|
-
}),
|
|
200
|
+
return o(h.options, e)?.label ?? h.placeholder ?? k.value.selectPlaceholder;
|
|
201
|
+
}), U = c(() => {
|
|
202
|
+
let e = V.value[0];
|
|
203
|
+
return e && !B.value ? o(h.options, e) : void 0;
|
|
204
|
+
}), Ge = c(() => E.option ? (e) => E.option?.({ option: e }) : void 0), W = c(() => V.value.map((e) => ({
|
|
204
205
|
key: e,
|
|
205
|
-
label:
|
|
206
|
-
}))),
|
|
207
|
-
let e =
|
|
206
|
+
label: h.showPath ? ae(h.options, e).join(h.separator) : o(h.options, e)?.label ?? e
|
|
207
|
+
}))), Ke = c(() => {
|
|
208
|
+
let e = h.maxTagCount;
|
|
208
209
|
return e == null || e < 0 || W.value.length <= e ? W.value : W.value.slice(0, e);
|
|
209
|
-
}), G =
|
|
210
|
-
let e =
|
|
211
|
-
if (!e) return
|
|
210
|
+
}), G = c(() => Math.max(0, W.value.length - Ke.value.length)), qe = c(() => h.clearable && V.value.length > 0 && !h.disabled), Je = c(() => {
|
|
211
|
+
let e = P.value.trim().toLowerCase();
|
|
212
|
+
if (!e) return h.options;
|
|
212
213
|
let t = (n) => {
|
|
213
214
|
let r = n.label.toLowerCase().includes(e), i = (n.children ?? []).map(t).filter((e) => e != null);
|
|
214
215
|
return r || i.length ? {
|
|
@@ -216,62 +217,62 @@ var Ce = [
|
|
|
216
217
|
children: i.length ? i : n.children
|
|
217
218
|
} : null;
|
|
218
219
|
};
|
|
219
|
-
return
|
|
220
|
-
}), K =
|
|
220
|
+
return h.options.map(t).filter((e) => e != null);
|
|
221
|
+
}), K = c(() => {
|
|
221
222
|
let e = [], t = (n, r) => {
|
|
222
223
|
for (let i of n) e.push({
|
|
223
224
|
node: i,
|
|
224
225
|
parentKey: r
|
|
225
|
-
}), i.children?.length &&
|
|
226
|
+
}), i.children?.length && R.value[i.key] && t(i.children, i.key);
|
|
226
227
|
};
|
|
227
|
-
return t(
|
|
228
|
-
}),
|
|
228
|
+
return t(Je.value, null), e;
|
|
229
|
+
}), Ye = n("m-treeselect-panel"), q = te({
|
|
229
230
|
itemCount: () => K.value.length,
|
|
230
231
|
isItemDisabled: (e) => !!K.value[e]?.node.disabled,
|
|
231
|
-
enabled:
|
|
232
|
+
enabled: N,
|
|
232
233
|
onActivate: (e) => {
|
|
233
234
|
let t = K.value[e];
|
|
234
|
-
t &&
|
|
235
|
+
t && rt(t.node);
|
|
235
236
|
},
|
|
236
237
|
onEscape: () => {
|
|
237
|
-
|
|
238
|
+
N.value = !1;
|
|
238
239
|
},
|
|
239
|
-
returnFocusTo:
|
|
240
|
-
}),
|
|
241
|
-
function
|
|
240
|
+
returnFocusTo: I
|
|
241
|
+
}), Xe = c(() => K.value[q.activeIndex.value]?.node.key ?? null);
|
|
242
|
+
function Ze() {
|
|
242
243
|
let e = q.activeIndex.value;
|
|
243
244
|
if (e < 0) return;
|
|
244
|
-
let t =
|
|
245
|
+
let t = L.value?.querySelectorAll(".m-treeselect__option")?.[e];
|
|
245
246
|
t && document.activeElement !== t && t.focus({ preventScroll: !0 }), t?.scrollIntoView({ block: "nearest" });
|
|
246
247
|
}
|
|
247
|
-
function Ze() {
|
|
248
|
-
if (!V.value || !R.value) return;
|
|
249
|
-
let e = R.value.getBoundingClientRect();
|
|
250
|
-
Re.value = ee(e, "bottom-start", { minWidth: `${e.width}px` });
|
|
251
|
-
}
|
|
252
248
|
function Qe() {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
e >= 0 ? q.setActive(e) : q.moveFirst(), g.filterable ? z.value?.querySelector(".m-treeselect__filter")?.focus() : Xe();
|
|
257
|
-
});
|
|
249
|
+
if (!z.value || !I.value) return;
|
|
250
|
+
let e = I.value.getBoundingClientRect();
|
|
251
|
+
Ve.value = ee(e, "bottom-start", { minWidth: `${e.width}px` });
|
|
258
252
|
}
|
|
259
253
|
function $e() {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
254
|
+
N.value = !0, he(() => {
|
|
255
|
+
Qe();
|
|
256
|
+
let e = K.value.findIndex((e) => V.value.includes(e.node.key));
|
|
257
|
+
e >= 0 ? q.setActive(e) : q.moveFirst(), h.filterable ? L.value?.querySelector(".m-treeselect__filter")?.focus() : Ze();
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function et() {
|
|
261
|
+
if (!h.disabled) {
|
|
262
|
+
if (N.value) {
|
|
263
|
+
N.value = !1;
|
|
263
264
|
return;
|
|
264
265
|
}
|
|
265
|
-
|
|
266
|
+
$e();
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
function J(e) {
|
|
269
|
-
if (!
|
|
270
|
+
if (!N.value) return;
|
|
270
271
|
let t = K.value, n = t[q.activeIndex.value];
|
|
271
272
|
if (e.key === "ArrowRight") {
|
|
272
273
|
if (e.preventDefault(), !n) return;
|
|
273
274
|
if (n.node.children?.length) {
|
|
274
|
-
if (!
|
|
275
|
+
if (!R.value[n.node.key]) Y(n.node.key);
|
|
275
276
|
else {
|
|
276
277
|
let e = t.findIndex((e) => e.parentKey === n.node.key);
|
|
277
278
|
e >= 0 && q.setActive(e);
|
|
@@ -281,7 +282,7 @@ var Ce = [
|
|
|
281
282
|
}
|
|
282
283
|
if (e.key === "ArrowLeft") {
|
|
283
284
|
if (e.preventDefault(), !n) return;
|
|
284
|
-
if (n.node.children?.length &&
|
|
285
|
+
if (n.node.children?.length && R.value[n.node.key]) Y(n.node.key);
|
|
285
286
|
else if (n.parentKey != null) {
|
|
286
287
|
let e = t.findIndex((e) => e.node.key === n.parentKey);
|
|
287
288
|
e >= 0 && q.setActive(e);
|
|
@@ -290,16 +291,16 @@ var Ce = [
|
|
|
290
291
|
}
|
|
291
292
|
q.onKeydown(e);
|
|
292
293
|
}
|
|
293
|
-
function
|
|
294
|
-
if (!
|
|
295
|
-
if (!
|
|
296
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
294
|
+
function tt(e) {
|
|
295
|
+
if (!h.disabled) {
|
|
296
|
+
if (!N.value) {
|
|
297
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), $e()) : e.key === "Enter" && (e.preventDefault(), et());
|
|
297
298
|
return;
|
|
298
299
|
}
|
|
299
300
|
J(e);
|
|
300
301
|
}
|
|
301
302
|
}
|
|
302
|
-
function
|
|
303
|
+
function nt(e) {
|
|
303
304
|
[
|
|
304
305
|
"ArrowUp",
|
|
305
306
|
"ArrowDown",
|
|
@@ -307,177 +308,185 @@ var Ce = [
|
|
|
307
308
|
"Escape"
|
|
308
309
|
].includes(e.key) && J(e);
|
|
309
310
|
}
|
|
310
|
-
|
|
311
|
-
if (
|
|
312
|
-
else if (
|
|
311
|
+
Se(q.activeIndex, () => {
|
|
312
|
+
if (N.value && !h.filterable) Ze();
|
|
313
|
+
else if (N.value) {
|
|
313
314
|
let e = q.activeIndex.value;
|
|
314
|
-
|
|
315
|
+
L.value?.querySelectorAll(".m-treeselect__option")[e]?.scrollIntoView({ block: "nearest" });
|
|
315
316
|
}
|
|
316
317
|
});
|
|
317
318
|
function Y(e) {
|
|
318
|
-
|
|
319
|
-
...
|
|
320
|
-
[e]: !
|
|
319
|
+
R.value = {
|
|
320
|
+
...R.value,
|
|
321
|
+
[e]: !R.value[e]
|
|
321
322
|
};
|
|
322
323
|
}
|
|
323
324
|
function X(e) {
|
|
324
|
-
|
|
325
|
+
B.value ? b("update:modelValue", e) : b("update:modelValue", e[0] ?? null);
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function rt(e) {
|
|
327
328
|
if (!e.disabled) {
|
|
328
|
-
if (
|
|
329
|
-
|
|
329
|
+
if (h.checkable) {
|
|
330
|
+
it(e);
|
|
330
331
|
return;
|
|
331
332
|
}
|
|
332
|
-
if (!
|
|
333
|
-
|
|
333
|
+
if (!B.value) {
|
|
334
|
+
b("update:modelValue", e.key === h.modelValue ? null : e.key), N.value = !1, I.value?.focus({ preventScroll: !0 });
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
336
|
-
X(
|
|
337
|
+
X(V.value.includes(e.key) ? V.value.filter((t) => t !== e.key) : [...V.value, e.key]);
|
|
337
338
|
}
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
+
function it(e) {
|
|
340
341
|
if (e.disabled) return;
|
|
341
|
-
let t = { ...
|
|
342
|
-
|
|
343
|
-
let r =
|
|
342
|
+
let t = { ...H.value }, n = !t[e.key];
|
|
343
|
+
h.checkStrictly ? n ? t[e.key] = !0 : delete t[e.key] : (se(e, n, t), ce(h.options, t));
|
|
344
|
+
let r = ie(h.options, t, h.checkStrategy, h.checkStrictly);
|
|
344
345
|
X(Object.keys(r).filter((e) => r[e]));
|
|
345
346
|
}
|
|
346
|
-
function it(e) {
|
|
347
|
-
X(U.value.filter((t) => t !== e));
|
|
348
|
-
}
|
|
349
347
|
function at(e) {
|
|
350
|
-
|
|
348
|
+
X(V.value.filter((t) => t !== e));
|
|
349
|
+
}
|
|
350
|
+
function ot(e) {
|
|
351
|
+
e.stopPropagation(), b("update:modelValue", B.value ? [] : null), b("clear");
|
|
351
352
|
}
|
|
352
353
|
function Z(e) {
|
|
353
354
|
let t = e.target;
|
|
354
|
-
|
|
355
|
+
F.value?.contains(t) || L.value?.contains(t) || (N.value = !1);
|
|
355
356
|
}
|
|
356
357
|
function Q(e) {
|
|
357
358
|
let t = e.target;
|
|
358
|
-
|
|
359
|
+
F.value?.contains(t) || L.value?.contains(t) || (N.value = !1);
|
|
359
360
|
}
|
|
360
361
|
function $() {
|
|
361
|
-
|
|
362
|
+
N.value && Qe();
|
|
362
363
|
}
|
|
363
|
-
return
|
|
364
|
-
e ? (document.addEventListener("click", Z), document.addEventListener("focusin", Q),
|
|
365
|
-
}),
|
|
364
|
+
return Se(N, (e) => {
|
|
365
|
+
e ? (document.addEventListener("click", Z), document.addEventListener("focusin", Q), z.value && (window.addEventListener("resize", $), window.addEventListener("scroll", $, !0))) : (P.value = "", q.reset(), document.removeEventListener("click", Z), document.removeEventListener("focusin", Q), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0));
|
|
366
|
+
}), _e(() => {
|
|
366
367
|
document.removeEventListener("click", Z), document.removeEventListener("focusin", Q), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0);
|
|
367
|
-
}), (e, n) => (
|
|
368
|
+
}), (e, n) => (_(), d("div", me({
|
|
368
369
|
ref_key: "root",
|
|
369
|
-
ref:
|
|
370
|
-
},
|
|
371
|
-
a.label ? (
|
|
370
|
+
ref: F
|
|
371
|
+
}, S(T), { class: "m-select-field" }), [
|
|
372
|
+
a.label ? (_(), d("label", {
|
|
372
373
|
key: 0,
|
|
373
374
|
class: "m-select-field__label",
|
|
374
|
-
for:
|
|
375
|
-
},
|
|
376
|
-
|
|
375
|
+
for: A.value
|
|
376
|
+
}, x(a.label), 9, Ee)) : u("", !0),
|
|
377
|
+
f("div", { class: g(["m-treeselect", [`m-treeselect--${S(Re)}`, {
|
|
377
378
|
"m-treeselect--disabled": a.disabled,
|
|
378
|
-
"m-treeselect--open":
|
|
379
|
-
"m-treeselect--multiple":
|
|
380
|
-
"m-treeselect--invalid":
|
|
381
|
-
}]]) }, [
|
|
382
|
-
"m-select__control--clearable":
|
|
383
|
-
"m-select__control--open":
|
|
384
|
-
}]) }, [
|
|
385
|
-
id:
|
|
379
|
+
"m-treeselect--open": N.value,
|
|
380
|
+
"m-treeselect--multiple": B.value,
|
|
381
|
+
"m-treeselect--invalid": S(j)
|
|
382
|
+
}]]) }, [f("div", { class: g(["m-treeselect__control m-select__control", {
|
|
383
|
+
"m-select__control--clearable": qe.value,
|
|
384
|
+
"m-select__control--open": N.value
|
|
385
|
+
}]) }, [f("div", me(S(Te), {
|
|
386
|
+
id: A.value,
|
|
386
387
|
ref_key: "trigger",
|
|
387
|
-
ref:
|
|
388
|
+
ref: I,
|
|
388
389
|
class: "m-treeselect__trigger",
|
|
389
390
|
role: "combobox",
|
|
390
391
|
tabindex: a.disabled ? -1 : 0,
|
|
391
392
|
"aria-disabled": a.disabled || void 0,
|
|
392
|
-
"aria-expanded":
|
|
393
|
-
"aria-controls":
|
|
394
|
-
"aria-invalid":
|
|
395
|
-
"aria-describedby":
|
|
393
|
+
"aria-expanded": N.value,
|
|
394
|
+
"aria-controls": N.value ? S(Ye) : void 0,
|
|
395
|
+
"aria-invalid": S(j) || void 0,
|
|
396
|
+
"aria-describedby": S(M) ? `${A.value}-help` : void 0,
|
|
396
397
|
"aria-haspopup": "tree",
|
|
397
|
-
onClick:
|
|
398
|
-
onKeydown:
|
|
399
|
-
}), [
|
|
398
|
+
onClick: et,
|
|
399
|
+
onKeydown: tt
|
|
400
|
+
}), [B.value && W.value.length ? (_(), d("div", Oe, [(_(!0), d(s, null, y(Ke.value, (e) => (_(), d("span", {
|
|
400
401
|
key: e.key,
|
|
401
402
|
class: "m-select__tag"
|
|
402
|
-
}, [
|
|
403
|
+
}, [f("span", ke, x(e.label), 1), f("button", {
|
|
403
404
|
type: "button",
|
|
404
405
|
class: "m-select__tag-remove",
|
|
405
|
-
"aria-label":
|
|
406
|
+
"aria-label": S(k).removeTag,
|
|
406
407
|
disabled: a.disabled,
|
|
407
|
-
onClick:
|
|
408
|
-
}, [
|
|
408
|
+
onClick: C((t) => at(e.key), ["stop"])
|
|
409
|
+
}, [m(t, {
|
|
409
410
|
name: "close",
|
|
410
411
|
size: "sm"
|
|
411
|
-
})], 8,
|
|
412
|
+
})], 8, Ae)]))), 128)), G.value ? (_(), d("span", je, x(G.value > 0 ? `+${G.value}` : ""), 1)) : u("", !0)])) : S(E).value && U.value ? ve(e.$slots, "value", { option: U.value }, void 0, void 0, 2) : (_(), d("span", {
|
|
412
413
|
key: 1,
|
|
413
|
-
class:
|
|
414
|
-
},
|
|
414
|
+
class: g(["m-treeselect__label", { "m-treeselect__label--placeholder": !V.value.length }])
|
|
415
|
+
}, x(We.value), 3))], 16, De), f("div", Me, [qe.value ? (_(), d("button", {
|
|
415
416
|
key: 0,
|
|
416
417
|
class: "m-select__clear",
|
|
417
418
|
type: "button",
|
|
418
|
-
"aria-label":
|
|
419
|
-
onClick:
|
|
420
|
-
}, [
|
|
419
|
+
"aria-label": S(k).clear,
|
|
420
|
+
onClick: ot
|
|
421
|
+
}, [m(t, {
|
|
421
422
|
name: "close",
|
|
422
423
|
class: "m-control-affix-icon"
|
|
423
|
-
})], 8,
|
|
424
|
-
class:
|
|
424
|
+
})], 8, Ne)) : u("", !0), f("span", {
|
|
425
|
+
class: g(["m-select__indicator", { "m-select__indicator--open": N.value }]),
|
|
425
426
|
"aria-hidden": "true"
|
|
426
|
-
}, [
|
|
427
|
+
}, [m(t, {
|
|
427
428
|
name: "chevron-down",
|
|
428
429
|
class: "m-control-affix-icon"
|
|
429
|
-
})], 2)])], 2), (
|
|
430
|
-
to:
|
|
431
|
-
disabled:
|
|
432
|
-
}, [
|
|
433
|
-
default:
|
|
430
|
+
})], 2)])], 2), (_(), l(fe, {
|
|
431
|
+
to: He.value.to,
|
|
432
|
+
disabled: He.value.disabled
|
|
433
|
+
}, [m(pe, { name: "m-scale-fade" }, {
|
|
434
|
+
default: Ce(() => [N.value ? (_(), d("div", {
|
|
434
435
|
key: 0,
|
|
435
|
-
id:
|
|
436
|
+
id: S(Ye),
|
|
436
437
|
ref_key: "panel",
|
|
437
|
-
ref:
|
|
438
|
-
class:
|
|
439
|
-
style:
|
|
438
|
+
ref: L,
|
|
439
|
+
class: g(["m-treeselect__panel", { "m-treeselect__panel--teleported": z.value }]),
|
|
440
|
+
style: ge(z.value ? Ve.value : void 0),
|
|
440
441
|
onKeydown: J
|
|
441
|
-
}, [a.filterable ?
|
|
442
|
+
}, [a.filterable ? we((_(), d("input", {
|
|
442
443
|
key: 0,
|
|
443
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
444
|
+
"onUpdate:modelValue": n[0] ||= (e) => P.value = e,
|
|
444
445
|
class: "m-treeselect__filter",
|
|
445
446
|
type: "search",
|
|
446
|
-
placeholder:
|
|
447
|
-
onClick: n[1] ||=
|
|
448
|
-
onKeydown:
|
|
449
|
-
}, null, 40,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
"
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
447
|
+
placeholder: S(k).searchPlaceholder,
|
|
448
|
+
onClick: n[1] ||= C(() => {}, ["stop"]),
|
|
449
|
+
onKeydown: nt
|
|
450
|
+
}, null, 40, Fe)), [[xe, P.value]]) : u("", !0), m(ne, {
|
|
451
|
+
class: "m-treeselect__tree-scroll",
|
|
452
|
+
"fit-content": "",
|
|
453
|
+
"wrap-class": "m-treeselect__tree-wrap",
|
|
454
|
+
"view-class": "m-treeselect__tree-view"
|
|
455
|
+
}, {
|
|
456
|
+
default: Ce(() => [f("ul", Ie, [(_(!0), d(s, null, y(Je.value, (e) => (_(), l(O, {
|
|
457
|
+
key: e.key,
|
|
458
|
+
node: e,
|
|
459
|
+
depth: 0,
|
|
460
|
+
"selected-keys": V.value,
|
|
461
|
+
"checked-keys": H.value,
|
|
462
|
+
expanded: R.value,
|
|
463
|
+
"show-checkbox": a.checkable,
|
|
464
|
+
"active-key": Xe.value,
|
|
465
|
+
"render-option": Ge.value,
|
|
466
|
+
onToggle: Y,
|
|
467
|
+
onSelect: rt,
|
|
468
|
+
onCheck: it
|
|
469
|
+
}, null, 8, [
|
|
470
|
+
"node",
|
|
471
|
+
"selected-keys",
|
|
472
|
+
"checked-keys",
|
|
473
|
+
"expanded",
|
|
474
|
+
"show-checkbox",
|
|
475
|
+
"active-key",
|
|
476
|
+
"render-option"
|
|
477
|
+
]))), 128))])]),
|
|
478
|
+
_: 1
|
|
479
|
+
})], 46, Pe)) : u("", !0)]),
|
|
471
480
|
_: 1
|
|
472
481
|
})], 8, ["to", "disabled"]))], 2),
|
|
473
|
-
|
|
482
|
+
S(M) ? (_(), d("span", {
|
|
474
483
|
key: 1,
|
|
475
|
-
id: `${
|
|
476
|
-
class:
|
|
477
|
-
role:
|
|
478
|
-
}, S(
|
|
484
|
+
id: `${A.value}-help`,
|
|
485
|
+
class: g(["m-select-field__help", { "m-select-field__help--invalid": S(Be) }]),
|
|
486
|
+
role: S(Be) ? "alert" : void 0
|
|
487
|
+
}, x(S(M)), 11, Le)) : u("", !0)
|
|
479
488
|
], 16));
|
|
480
489
|
}
|
|
481
490
|
});
|
|
482
491
|
//#endregion
|
|
483
|
-
export {
|
|
492
|
+
export { k as MTreeSelect };
|