morya-ui 0.3.1 → 0.3.3
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 +62 -0
- package/dist/Button-gBiRj7wz.js +227 -0
- package/dist/{Card-Dsmnzong.js → Card-B1CB9Trm.js} +3 -5
- package/dist/Empty-C5tndBOm.js +147 -0
- package/dist/{FlyoutSubmenu-BrUPmJa1.js → FlyoutSubmenu-H_741alW.js} +2 -2
- package/dist/{Loading-BSsRs6v9.js → Loading-qS2Yv_gm.js} +1 -1
- package/dist/Pagination-Bvv2qvEK.js +166 -0
- package/dist/{Popover-BQ07q4VV.js → Popover-rnZG_ap0.js} +3 -3
- package/dist/Select-CiXd074W.js +572 -0
- package/dist/Skeleton-DCYdXAH2.js +59 -0
- package/dist/{Tooltip-D5DO0B3z.js → Tooltip-B02o9BOW.js} +3 -3
- package/dist/accordion/style.css +16 -71
- package/dist/auto-complete/index.js +120 -122
- package/dist/auto-complete/style.css +6 -82
- package/dist/avatar/style.css +6 -67
- package/dist/badge/style.css +6 -68
- package/dist/block-ui/index.js +1 -1
- package/dist/block-ui/style.css +6 -68
- package/dist/breadcrumb/style.css +6 -61
- package/dist/button/index.js +1 -1
- package/dist/button/style.css +345 -118
- package/dist/card/index.js +1 -1
- package/dist/card/style.css +26 -67
- package/dist/carousel/style.css +6 -73
- package/dist/cascade-select/index.js +3 -3
- package/dist/cascade-select/style.css +6 -75
- package/dist/checkbox/style.css +6 -61
- package/dist/chip/style.css +6 -67
- package/dist/command-menu/index.js +37 -39
- package/dist/command-menu/style.css +6 -75
- package/dist/components/Accordion/styles.css +10 -10
- package/dist/components/AutoComplete/AutoComplete.vue.d.ts.map +1 -1
- package/dist/components/AutoComplete/styles.css +0 -7
- package/dist/components/Badge/styles.css +0 -7
- package/dist/components/BlockUI/styles.css +0 -7
- package/dist/components/Button/Button.vue.d.ts +3 -0
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/styles.css +339 -51
- package/dist/components/Button/types.d.ts +11 -2
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/styles.css +20 -6
- package/dist/components/Card/types.d.ts +4 -2
- package/dist/components/Card/types.d.ts.map +1 -1
- package/dist/components/Carousel/styles.css +0 -6
- package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +2 -2
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -1
- package/dist/components/ContextMenu/styles.css +19 -14
- package/dist/components/Dialog/styles.css +3 -46
- package/dist/components/Dock/styles.css +0 -10
- package/dist/components/Drawer/styles.css +2 -51
- package/dist/components/Fieldset/styles.css +0 -7
- package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/FileUpload/fileUtils.d.ts +8 -0
- package/dist/components/FileUpload/fileUtils.d.ts.map +1 -0
- package/dist/components/Gallery/styles.css +0 -8
- package/dist/components/Icon/styles.css +0 -6
- package/dist/components/Knob/styles.css +0 -6
- package/dist/components/Layout/styles.css +0 -12
- package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
- package/dist/components/Loading/styles.css +0 -16
- package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
- package/dist/components/Menu/styles.css +4 -11
- package/dist/components/Message/styles.css +0 -13
- package/dist/components/Page/PageContent.vue.d.ts +2 -1
- package/dist/components/Page/PageContent.vue.d.ts.map +1 -1
- package/dist/components/Page/PageFilterChips.vue.d.ts +16 -0
- package/dist/components/Page/PageFilterChips.vue.d.ts.map +1 -0
- package/dist/components/Page/PageFilters.vue.d.ts +15 -3
- package/dist/components/Page/PageFilters.vue.d.ts.map +1 -1
- package/dist/components/Page/PageHeader.vue.d.ts +8 -4
- package/dist/components/Page/PageHeader.vue.d.ts.map +1 -1
- package/dist/components/Page/PagePlaceholder.vue.d.ts +6 -2
- package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -1
- package/dist/components/Page/PageSection.vue.d.ts +8 -2
- package/dist/components/Page/PageSection.vue.d.ts.map +1 -1
- package/dist/components/Page/PageStat.vue.d.ts +8 -3
- package/dist/components/Page/PageStat.vue.d.ts.map +1 -1
- package/dist/components/Page/index.d.ts +2 -1
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/styles.css +239 -44
- package/dist/components/Page/types.d.ts +40 -0
- package/dist/components/Page/types.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Pagination/styles.css +7 -10
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Panel/styles.css +0 -7
- package/dist/components/Popover/styles.css +21 -79
- package/dist/components/ProgressBar/styles.css +0 -9
- package/dist/components/ProgressSpinner/styles.css +0 -7
- package/dist/components/ScrollTop/styles.css +0 -7
- package/dist/components/Scrollbar/styles.css +0 -8
- package/dist/components/Select/Select.vue.d.ts +1 -3
- package/dist/components/Select/Select.vue.d.ts.map +1 -1
- package/dist/components/Select/selectOptions.d.ts +46 -0
- package/dist/components/Select/selectOptions.d.ts.map +1 -0
- package/dist/components/Select/styles.css +5 -7
- package/dist/components/Sidebar/styles.css +0 -6
- package/dist/components/Skeleton/styles.css +0 -6
- package/dist/components/Status/styles.css +0 -7
- package/dist/components/Switch/styles.css +0 -7
- package/dist/components/Table/hooks/useExpandableRow.d.ts.map +1 -1
- package/dist/components/Table/hooks/useTotalItems.d.ts.map +1 -1
- package/dist/components/Table/styles.css +7 -10
- package/dist/components/Table/tableQuery.d.ts +30 -0
- package/dist/components/Table/tableQuery.d.ts.map +1 -0
- package/dist/components/Tree/Tree.vue.d.ts.map +1 -1
- package/dist/components/Tree/treeQuery.d.ts +31 -0
- package/dist/components/Tree/treeQuery.d.ts.map +1 -0
- package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
- package/dist/config-provider/index.js +1 -1
- package/dist/config-provider/style.css +345 -112
- package/dist/confirm-dialog/index.js +2 -2
- package/dist/confirm-dialog/style.css +348 -164
- package/dist/confirm-popup/index.js +5 -5
- package/dist/confirm-popup/style.css +345 -118
- package/dist/context-menu/index.js +105 -96
- package/dist/context-menu/style.css +25 -89
- package/dist/data-view/index.js +2 -2
- package/dist/data-view/style.css +13 -87
- package/dist/date-picker/index.js +3 -3
- package/dist/date-picker/style.css +6 -67
- package/dist/dialog/index.js +2 -2
- package/dist/dialog/style.css +348 -164
- package/dist/divider/style.css +6 -61
- package/dist/dock/style.css +6 -77
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/style.css +8 -118
- package/dist/dropdown/index.js +4 -4
- package/dist/dropdown/style.css +6 -75
- package/dist/empty/index.js +5 -150
- package/dist/empty/style.css +6 -67
- package/dist/fieldset/style.css +6 -74
- package/dist/file-upload/index.js +147 -145
- package/dist/file-upload/style.css +6 -67
- package/dist/filterByQuery-Bczaxzih.js +17 -0
- package/dist/flex/style.css +6 -61
- package/dist/float-label/style.css +6 -61
- package/dist/fluid/style.css +6 -61
- package/dist/form/style.css +6 -61
- package/dist/gallery/style.css +6 -83
- package/dist/grid/style.css +6 -61
- package/dist/icon/style.css +6 -67
- package/dist/icon-field/style.css +6 -61
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9135 -8796
- package/dist/inplace/style.css +6 -61
- package/dist/input/style.css +6 -67
- package/dist/input-color/style.css +6 -61
- package/dist/input-group/style.css +6 -61
- package/dist/input-number/style.css +6 -67
- package/dist/input-otp/style.css +6 -61
- package/dist/input-password/style.css +6 -67
- package/dist/input-tags/style.css +6 -67
- package/dist/knob/style.css +6 -67
- package/dist/label/style.css +6 -61
- package/dist/layout/style.css +6 -87
- package/dist/listbox/index.js +30 -32
- package/dist/listbox/style.css +6 -69
- package/dist/loading/index.js +1 -1
- package/dist/loading/style.css +6 -77
- package/dist/mega-menu/index.js +3 -3
- package/dist/mega-menu/style.css +6 -67
- package/dist/menu/index.js +268 -258
- package/dist/menu/style.css +31 -165
- package/dist/menubar/index.js +3 -3
- package/dist/menubar/style.css +6 -75
- package/dist/message/index.js +1 -1
- package/dist/message/style.css +6 -80
- package/dist/meter-group/style.css +6 -61
- package/dist/order-list/style.css +6 -67
- package/dist/{overlayPlacement-Cd20JTD_.js → overlayPlacement-qwEJPVS4.js} +8 -8
- package/dist/page/index.js +228 -69
- package/dist/page/style.css +1605 -299
- package/dist/page/style.js +3 -0
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/style.css +206 -77
- package/dist/pagination/style.js +1 -0
- package/dist/panel/style.css +6 -74
- package/dist/pick-list/style.css +6 -67
- package/dist/popover/index.js +1 -1
- package/dist/popover/style.css +27 -140
- package/dist/progress-bar/style.css +6 -70
- package/dist/progress-spinner/style.css +6 -68
- package/dist/radio/style.css +6 -61
- package/dist/rating/style.css +6 -67
- package/dist/resolver-map.d.ts.map +1 -1
- package/dist/resolver.js +1 -0
- package/dist/result/style.css +6 -67
- package/dist/scroll-top/style.css +6 -82
- package/dist/scrollbar/style.css +6 -69
- package/dist/select/index.js +2 -545
- package/dist/select/style.css +11 -82
- package/dist/select-button/style.css +6 -61
- package/dist/shared/config.d.ts +2 -2
- package/dist/shared/filterByQuery.d.ts +14 -0
- package/dist/shared/filterByQuery.d.ts.map +1 -0
- package/dist/shared/menu/expand.d.ts +38 -0
- package/dist/shared/menu/expand.d.ts.map +1 -0
- package/dist/shared/menu/index.d.ts +2 -0
- package/dist/shared/menu/index.d.ts.map +1 -1
- package/dist/shared/overlayPlacement.d.ts.map +1 -1
- package/dist/sidebar/style.css +6 -73
- package/dist/skeleton/index.js +2 -59
- package/dist/skeleton/style.css +6 -67
- package/dist/slider/style.css +6 -61
- package/dist/space/style.css +6 -61
- package/dist/speed-dial/index.js +3 -3
- package/dist/speed-dial/style.css +6 -67
- package/dist/split-button/index.js +3 -3
- package/dist/split-button/style.css +345 -118
- package/dist/splitter/style.css +6 -61
- package/dist/status/style.css +6 -74
- package/dist/stepper/style.css +6 -67
- package/dist/styles/base.css +1 -50
- package/dist/styles.css +1 -1
- package/dist/switch/style.css +6 -68
- package/dist/table/index.js +343 -313
- package/dist/table/style.css +20 -111
- package/dist/tabs/style.css +6 -75
- package/dist/tag/style.css +6 -67
- package/dist/terminal/style.css +6 -61
- package/dist/textarea/style.css +6 -67
- package/dist/theme/motionPresets.d.ts.map +1 -1
- package/dist/theme/styles.css +5 -11
- package/dist/theme/useMotion.d.ts +5 -1
- package/dist/theme/useMotion.d.ts.map +1 -1
- package/dist/tiered-menu/index.js +4 -4
- package/dist/tiered-menu/style.css +6 -75
- package/dist/timeline/style.css +6 -75
- package/dist/toast/index.js +1 -1
- package/dist/toast/style.css +6 -67
- package/dist/toggle-button/style.css +6 -67
- package/dist/toolbar/style.css +6 -61
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/style.css +6 -61
- package/dist/tree/index.js +158 -172
- package/dist/tree/style.css +6 -67
- package/dist/tree-select/index.js +201 -215
- package/dist/tree-select/style.css +6 -75
- package/dist/tree-table/style.css +6 -67
- package/dist/treeQuery-CnHkyYOA.js +107 -0
- package/dist/{useFloatingViewportSync-DZdJ7W8n.js → useFloatingViewportSync-wLLKIGUA.js} +4 -1
- package/dist/{useMotionTransition-Bxnnb_9u.js → useMotionTransition-95Y79FoL.js} +1 -1
- package/dist/virtual-scroller/style.css +6 -69
- package/package.json +2 -1
- package/dist/Button-smoDleh0.js +0 -156
- package/dist/Pagination-DrXmzcEy.js +0 -158
- package/dist/checkStrategy-CZzuUKDI.js +0 -63
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
import { i as e } from "./useComponentAttrs-e-5QAjdw.js";
|
|
2
|
+
import { t } from "./Icon-od9Ob-Ay.js";
|
|
3
|
+
import { t as n } from "./useMotionTransition-95Y79FoL.js";
|
|
4
|
+
import { n as r, t as i } from "./overlay-oR-5MDuE.js";
|
|
5
|
+
import { t as a } from "./overlayPlacement-qwEJPVS4.js";
|
|
6
|
+
import { t as o } from "./useFloatingViewportSync-wLLKIGUA.js";
|
|
7
|
+
import { t as s } from "./useMId-BXFYayPP.js";
|
|
8
|
+
import { t as ee } from "./Scrollbar-DTeJ8P5b.js";
|
|
9
|
+
import { t as c } from "./VirtualScroller-CHoFCmpP.js";
|
|
10
|
+
import { c as te, i as ne, o as re } from "./config-CapALqt3.js";
|
|
11
|
+
import { n as ie, t as ae } from "./locale-Bzm2nbEp.js";
|
|
12
|
+
import { Fragment as l, Teleport as oe, Transition as se, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as ce, createVNode as h, defineComponent as g, mergeProps as le, nextTick as ue, normalizeClass as _, normalizeStyle as de, onBeforeUnmount as fe, openBlock as v, ref as y, renderList as pe, renderSlot as b, toDisplayString as x, unref as S, useAttrs as me, useSlots as he, vModelText as ge, watch as C, withCtx as _e, withDirectives as ve, withModifiers as ye } from "vue";
|
|
13
|
+
//#region src/components/Select/selectOptions.ts
|
|
14
|
+
function w(e) {
|
|
15
|
+
return Array.isArray(e.items);
|
|
16
|
+
}
|
|
17
|
+
function T(e) {
|
|
18
|
+
return e.flatMap((e) => w(e) ? e.items : [e]);
|
|
19
|
+
}
|
|
20
|
+
function be(e, t) {
|
|
21
|
+
return t ? Array.isArray(e) ? e : e == null ? [] : [e] : e == null || Array.isArray(e) ? [] : [e];
|
|
22
|
+
}
|
|
23
|
+
function xe(e, t, n) {
|
|
24
|
+
let r = T(e), i = new Set(r.map((e) => String(e.value))), a = [];
|
|
25
|
+
for (let e of t) i.has(String(e.value)) || (a.push(e), i.add(String(e.value)));
|
|
26
|
+
for (let e of n) i.has(String(e)) || (a.push({
|
|
27
|
+
label: String(e),
|
|
28
|
+
value: e
|
|
29
|
+
}), i.add(String(e)));
|
|
30
|
+
return [...r, ...a];
|
|
31
|
+
}
|
|
32
|
+
function Se(e, t, n) {
|
|
33
|
+
if (!n.tag || !n.filter) return !1;
|
|
34
|
+
let r = e.trim();
|
|
35
|
+
return r ? !t.some((e) => e.label.toLowerCase() === r.toLowerCase() || String(e.value) === r) : !1;
|
|
36
|
+
}
|
|
37
|
+
function Ce(e, t, n, r, i) {
|
|
38
|
+
if (i) return e;
|
|
39
|
+
let a = T(e), o = new Set(a.map((e) => String(e.value))), s = [];
|
|
40
|
+
for (let e of t) o.has(String(e.value)) || (s.push(e), o.add(String(e.value)));
|
|
41
|
+
for (let e of n) o.has(String(e)) || (s.push({
|
|
42
|
+
label: String(e),
|
|
43
|
+
value: e
|
|
44
|
+
}), o.add(String(e)));
|
|
45
|
+
let ee = [...e, ...s], c = r.trim().toLowerCase();
|
|
46
|
+
return c ? ee.flatMap((e) => {
|
|
47
|
+
if (w(e)) {
|
|
48
|
+
let t = e.items.filter((e) => e.label.toLowerCase().includes(c));
|
|
49
|
+
return t.length ? [{
|
|
50
|
+
...e,
|
|
51
|
+
items: t
|
|
52
|
+
}] : [];
|
|
53
|
+
}
|
|
54
|
+
return e.label.toLowerCase().includes(c) ? [e] : [];
|
|
55
|
+
}) : ee;
|
|
56
|
+
}
|
|
57
|
+
function we(e, t) {
|
|
58
|
+
let n = [], r = t?.trim();
|
|
59
|
+
return r && n.push({
|
|
60
|
+
type: "option",
|
|
61
|
+
option: {
|
|
62
|
+
label: r,
|
|
63
|
+
value: r,
|
|
64
|
+
created: !0
|
|
65
|
+
},
|
|
66
|
+
key: `__create:${r}`
|
|
67
|
+
}), e.forEach((e, t) => {
|
|
68
|
+
if (w(e)) {
|
|
69
|
+
n.push({
|
|
70
|
+
type: "group",
|
|
71
|
+
label: e.label,
|
|
72
|
+
key: `__group:${t}:${e.label}`
|
|
73
|
+
});
|
|
74
|
+
for (let t of e.items) n.push({
|
|
75
|
+
type: "option",
|
|
76
|
+
option: t,
|
|
77
|
+
key: String(t.value)
|
|
78
|
+
});
|
|
79
|
+
} else n.push({
|
|
80
|
+
type: "option",
|
|
81
|
+
option: e,
|
|
82
|
+
key: String(e.value)
|
|
83
|
+
});
|
|
84
|
+
}), n;
|
|
85
|
+
}
|
|
86
|
+
function Te(e, t) {
|
|
87
|
+
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
88
|
+
}
|
|
89
|
+
function Ee(e, t) {
|
|
90
|
+
return t == null || e.length <= t ? {
|
|
91
|
+
visible: e,
|
|
92
|
+
hiddenCount: 0
|
|
93
|
+
} : {
|
|
94
|
+
visible: e.slice(0, t),
|
|
95
|
+
hiddenCount: e.length - t
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/Select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
100
|
+
var De = ["for"], Oe = [
|
|
101
|
+
"id",
|
|
102
|
+
"tabindex",
|
|
103
|
+
"aria-expanded",
|
|
104
|
+
"aria-controls",
|
|
105
|
+
"aria-invalid",
|
|
106
|
+
"aria-describedby",
|
|
107
|
+
"aria-disabled",
|
|
108
|
+
"aria-busy",
|
|
109
|
+
"aria-multiselectable"
|
|
110
|
+
], ke = {
|
|
111
|
+
key: 0,
|
|
112
|
+
class: "m-select__tags"
|
|
113
|
+
}, Ae = { class: "m-select__tag-label" }, je = [
|
|
114
|
+
"aria-label",
|
|
115
|
+
"disabled",
|
|
116
|
+
"onClick"
|
|
117
|
+
], Me = ["aria-label"], Ne = {
|
|
118
|
+
key: 1,
|
|
119
|
+
class: "m-select__value"
|
|
120
|
+
}, Pe = {
|
|
121
|
+
key: 2,
|
|
122
|
+
class: "m-select__spinner",
|
|
123
|
+
"aria-hidden": "true"
|
|
124
|
+
}, Fe = { class: "m-select__suffix" }, Ie = ["aria-label"], Le = [
|
|
125
|
+
"id",
|
|
126
|
+
"aria-multiselectable",
|
|
127
|
+
"aria-label"
|
|
128
|
+
], Re = {
|
|
129
|
+
key: 0,
|
|
130
|
+
class: "m-select__header"
|
|
131
|
+
}, ze = ["placeholder", "aria-label"], Be = {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: "m-select__group-label",
|
|
134
|
+
role: "presentation"
|
|
135
|
+
}, Ve = [
|
|
136
|
+
"aria-selected",
|
|
137
|
+
"disabled",
|
|
138
|
+
"onMouseenter",
|
|
139
|
+
"onClick"
|
|
140
|
+
], He = {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "m-select__empty",
|
|
143
|
+
role: "status"
|
|
144
|
+
}, Ue = {
|
|
145
|
+
key: 0,
|
|
146
|
+
class: "m-select__group-label",
|
|
147
|
+
role: "presentation"
|
|
148
|
+
}, We = [
|
|
149
|
+
"aria-selected",
|
|
150
|
+
"disabled",
|
|
151
|
+
"onMouseenter",
|
|
152
|
+
"onClick"
|
|
153
|
+
], Ge = {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: "m-select__empty",
|
|
156
|
+
role: "status"
|
|
157
|
+
}, Ke = {
|
|
158
|
+
key: 4,
|
|
159
|
+
class: "m-select__empty",
|
|
160
|
+
role: "status"
|
|
161
|
+
}, qe = {
|
|
162
|
+
key: 5,
|
|
163
|
+
class: "m-select__empty",
|
|
164
|
+
role: "status"
|
|
165
|
+
}, Je = {
|
|
166
|
+
key: 6,
|
|
167
|
+
class: "m-select__footer"
|
|
168
|
+
}, Ye = [
|
|
169
|
+
"name",
|
|
170
|
+
"required",
|
|
171
|
+
"value"
|
|
172
|
+
], Xe = ["id", "role"], Ze = 80, E = /* @__PURE__ */ g({
|
|
173
|
+
inheritAttrs: !1,
|
|
174
|
+
__name: "Select",
|
|
175
|
+
props: {
|
|
176
|
+
modelValue: { default: void 0 },
|
|
177
|
+
options: {},
|
|
178
|
+
label: {},
|
|
179
|
+
helpText: {},
|
|
180
|
+
invalid: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: !1
|
|
183
|
+
},
|
|
184
|
+
errorMessage: {},
|
|
185
|
+
id: {},
|
|
186
|
+
disabled: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: !1
|
|
189
|
+
},
|
|
190
|
+
required: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: !1
|
|
193
|
+
},
|
|
194
|
+
size: {},
|
|
195
|
+
fluid: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: void 0
|
|
198
|
+
},
|
|
199
|
+
multiple: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: void 0
|
|
202
|
+
},
|
|
203
|
+
tag: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: void 0
|
|
206
|
+
},
|
|
207
|
+
remote: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
default: void 0
|
|
210
|
+
},
|
|
211
|
+
loading: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
default: void 0
|
|
214
|
+
},
|
|
215
|
+
maxTagCount: {},
|
|
216
|
+
showClear: {
|
|
217
|
+
type: Boolean,
|
|
218
|
+
default: void 0
|
|
219
|
+
},
|
|
220
|
+
clearable: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
default: void 0
|
|
223
|
+
},
|
|
224
|
+
emptyMessage: {},
|
|
225
|
+
filter: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
default: void 0
|
|
228
|
+
},
|
|
229
|
+
teleport: {
|
|
230
|
+
type: Boolean,
|
|
231
|
+
default: !0
|
|
232
|
+
},
|
|
233
|
+
appendTo: {},
|
|
234
|
+
placement: { default: "bottom-start" },
|
|
235
|
+
pt: {},
|
|
236
|
+
transition: {
|
|
237
|
+
type: [String, Boolean],
|
|
238
|
+
default: void 0
|
|
239
|
+
},
|
|
240
|
+
virtual: {
|
|
241
|
+
type: Boolean,
|
|
242
|
+
default: void 0
|
|
243
|
+
},
|
|
244
|
+
placeholder: {},
|
|
245
|
+
name: {}
|
|
246
|
+
},
|
|
247
|
+
emits: [
|
|
248
|
+
"update:modelValue",
|
|
249
|
+
"change",
|
|
250
|
+
"clear",
|
|
251
|
+
"show",
|
|
252
|
+
"hide",
|
|
253
|
+
"search",
|
|
254
|
+
"create"
|
|
255
|
+
],
|
|
256
|
+
setup(g, { emit: w }) {
|
|
257
|
+
let T = g, E = w, Qe = he(), $e = me(), { rootAttrs: et, controlAttrs: tt } = e($e, () => T.pt, { controlKey: "control" }), D = ne("Select"), nt = te(), { transitionName: rt, transitionCss: it } = n({
|
|
258
|
+
role: "popup",
|
|
259
|
+
local: () => T.transition,
|
|
260
|
+
componentName: "Select",
|
|
261
|
+
fallback: "scale-fade"
|
|
262
|
+
}), O = ie(), at = y(null), k = y(null), ot = y(null), st = y(null), A = y(!1), j = y(""), M = y(-1), ct = y({}), N = y([]), lt = s("m-select"), P = u(() => T.id ?? lt), ut = u(() => T.emptyMessage ?? O.value.emptyOptions), F = u(() => T.multiple ?? D.value.multiple ?? !1), dt = u(() => T.tag ?? D.value.tag ?? !1), ft = u(() => T.remote ?? D.value.remote ?? !1), I = u(() => T.loading ?? !1), pt = u(() => T.fluid ?? D.value.fluid ?? !1), mt = u(() => T.showClear ?? T.clearable ?? D.value.showClear ?? D.value.clearable ?? !1), L = u(() => T.filter ?? D.value.filter ?? !1), ht = re("Select", () => T.size), gt = u(() => r(T, nt.value.appendTo)), R = u(() => i(T, nt.value.appendTo)), z = u(() => T.invalid || !!T.errorMessage), B = u(() => T.errorMessage || T.helpText), _t = u(() => !!T.errorMessage || z.value && !!T.helpText), V = u(() => be(T.modelValue, F.value)), vt = u(() => xe(T.options, N.value, V.value));
|
|
263
|
+
function yt(e) {
|
|
264
|
+
return vt.value.find((t) => t.value === e);
|
|
265
|
+
}
|
|
266
|
+
let bt = u(() => V.value.map((e) => yt(e) ?? {
|
|
267
|
+
label: String(e),
|
|
268
|
+
value: e
|
|
269
|
+
})), xt = u(() => Ee(bt.value, T.maxTagCount)), St = u(() => xt.value.visible), H = u(() => xt.value.hiddenCount), Ct = u(() => F.value ? void 0 : bt.value[0]), wt = u(() => Ct.value?.label ?? T.placeholder ?? O.value.selectPlaceholder), U = u(() => V.value.length > 0), Tt = u(() => mt.value && U.value && !T.disabled), W = u(() => j.value.trim()), Et = u(() => Se(W.value, vt.value, {
|
|
270
|
+
tag: dt.value,
|
|
271
|
+
filter: L.value
|
|
272
|
+
})), Dt = u(() => Ce(T.options, N.value, V.value, W.value, ft.value)), G = u(() => we(Dt.value, Et.value ? W.value : void 0)), K = u(() => G.value.flatMap((e) => e.type === "option" ? [e.option] : [])), q = u(() => K.value.filter((e) => !e.disabled)), Ot = u(() => ae(O.value.createOption, { value: W.value })), kt = u(() => ae(O.value.moreTags, { count: H.value })), J = u(() => T.virtual === !1 ? !1 : T.virtual === !0 || G.value.length >= Ze), At = u(() => ht.value === "small" ? 28 : ht.value === "large" ? 40 : 34), jt = u(() => Math.min(240, Math.max(At.value * 4, G.value.length * At.value))), Mt = y(null);
|
|
273
|
+
function Nt(e) {
|
|
274
|
+
return e;
|
|
275
|
+
}
|
|
276
|
+
function Pt(e) {
|
|
277
|
+
return e.label;
|
|
278
|
+
}
|
|
279
|
+
function Y(e) {
|
|
280
|
+
return e.option;
|
|
281
|
+
}
|
|
282
|
+
function X(e) {
|
|
283
|
+
return V.value.some((t) => t === e);
|
|
284
|
+
}
|
|
285
|
+
function Z(e) {
|
|
286
|
+
E("update:modelValue", e), E("change", e);
|
|
287
|
+
}
|
|
288
|
+
function Ft() {
|
|
289
|
+
if (!R.value || !k.value) return;
|
|
290
|
+
let e = k.value.getBoundingClientRect();
|
|
291
|
+
ct.value = a(e, T.placement === "bottom-end" ? "bottom-end" : "bottom-start", { minWidth: `${e.width}px` });
|
|
292
|
+
}
|
|
293
|
+
function Q(e, t = "none") {
|
|
294
|
+
if (!(T.disabled || A.value === e)) {
|
|
295
|
+
if (A.value = e, e) {
|
|
296
|
+
if (j.value = "", t === "none") M.value = -1;
|
|
297
|
+
else if (t === "last") M.value = Math.max(0, q.value.length - 1);
|
|
298
|
+
else {
|
|
299
|
+
let e = q.value.findIndex((e) => !e.created && X(e.value));
|
|
300
|
+
M.value = e >= 0 ? e : q.value.length ? 0 : -1;
|
|
301
|
+
}
|
|
302
|
+
E("show"), ue(() => {
|
|
303
|
+
Ft(), L.value ? st.value?.focus({ preventScroll: !0 }) : ot.value?.focus({ preventScroll: !0 });
|
|
304
|
+
});
|
|
305
|
+
} else j.value = "", E("hide");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function $(e) {
|
|
309
|
+
if (!e.disabled) {
|
|
310
|
+
if (e.created) {
|
|
311
|
+
It();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (F.value) {
|
|
315
|
+
Z(Te(V.value, e.value));
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
Z(e.value), Q(!1), k.value?.focus({ preventScroll: !0 });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function It() {
|
|
322
|
+
let e = W.value;
|
|
323
|
+
if (!e || !Et.value) return;
|
|
324
|
+
let t = {
|
|
325
|
+
label: e,
|
|
326
|
+
value: e
|
|
327
|
+
};
|
|
328
|
+
N.value.some((e) => e.value === t.value) || (N.value = [...N.value, t]), E("create", t), $({ ...t }), j.value = "";
|
|
329
|
+
}
|
|
330
|
+
function Lt(e, t) {
|
|
331
|
+
t.stopPropagation(), t.preventDefault(), !(T.disabled || !F.value) && Z(V.value.filter((t) => t !== e));
|
|
332
|
+
}
|
|
333
|
+
function Rt(e) {
|
|
334
|
+
e?.stopPropagation(), e?.preventDefault(), !(T.disabled || !U.value) && (Z(F.value ? [] : void 0), E("clear"), k.value?.focus({ preventScroll: !0 }));
|
|
335
|
+
}
|
|
336
|
+
function zt(e) {
|
|
337
|
+
T.disabled || [
|
|
338
|
+
"Enter",
|
|
339
|
+
" ",
|
|
340
|
+
"ArrowDown",
|
|
341
|
+
"ArrowUp"
|
|
342
|
+
].includes(e.key) && (e.preventDefault(), A.value || Q(!0, e.key === "ArrowUp" ? "last" : "selected"));
|
|
343
|
+
}
|
|
344
|
+
function Bt(e) {
|
|
345
|
+
if (e.key === "Escape") {
|
|
346
|
+
e.preventDefault(), Q(!1), k.value?.focus({ preventScroll: !0 });
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
let t = q.value.length;
|
|
350
|
+
if (t && ((e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), M.value < 0 ? M.value = e.key === "ArrowDown" ? 0 : t - 1 : M.value = (M.value + (e.key === "ArrowDown" ? 1 : -1) + t) % t), e.key === "Home" && (e.preventDefault(), M.value = 0), e.key === "End" && (e.preventDefault(), M.value = t - 1), e.key === "Enter" || e.key === " " && e.target !== st.value)) {
|
|
351
|
+
let t = q.value[M.value];
|
|
352
|
+
t && (e.preventDefault(), $(t));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function Vt(e) {
|
|
356
|
+
A.value && !at.value?.contains(e.target) && !ot.value?.contains(e.target) && Q(!1);
|
|
357
|
+
}
|
|
358
|
+
function Ht() {
|
|
359
|
+
A.value && Ft();
|
|
360
|
+
}
|
|
361
|
+
return o(() => A.value && R.value, Ht), C(M, (e) => {
|
|
362
|
+
if (!J.value || e < 0) return;
|
|
363
|
+
let t = q.value[e];
|
|
364
|
+
if (!t) return;
|
|
365
|
+
let n = G.value.findIndex((e) => e.type === "option" && e.option.value === t.value && !!e.option.created == !!t.created);
|
|
366
|
+
n >= 0 && Mt.value?.scrollToIndex(n);
|
|
367
|
+
}), C(j, (e) => {
|
|
368
|
+
M.value = q.value.length ? 0 : -1, A.value && (L.value || ft.value) && E("search", e);
|
|
369
|
+
}), C(A, (e) => {
|
|
370
|
+
e && ft.value && E("search", j.value), e ? document.addEventListener("click", Vt) : document.removeEventListener("click", Vt);
|
|
371
|
+
}), fe(() => {
|
|
372
|
+
document.removeEventListener("click", Vt);
|
|
373
|
+
}), (e, n) => (v(), p("div", le({
|
|
374
|
+
ref_key: "root",
|
|
375
|
+
ref: at
|
|
376
|
+
}, S(et), { class: ["m-select-field", { "m-select-field--fluid": pt.value }] }), [
|
|
377
|
+
g.label ? (v(), p("label", {
|
|
378
|
+
key: 0,
|
|
379
|
+
class: "m-select-field__label",
|
|
380
|
+
for: P.value
|
|
381
|
+
}, x(g.label), 9, De)) : f("", !0),
|
|
382
|
+
m("div", { class: _(["m-select__control", {
|
|
383
|
+
"m-select__control--clearable": Tt.value,
|
|
384
|
+
"m-select__control--open": A.value
|
|
385
|
+
}]) }, [m("div", le(S(tt), {
|
|
386
|
+
id: P.value,
|
|
387
|
+
ref_key: "trigger",
|
|
388
|
+
ref: k,
|
|
389
|
+
class: ["m-select", [`m-select--${S(ht)}`, {
|
|
390
|
+
"m-select--invalid": z.value,
|
|
391
|
+
"m-select--open": A.value,
|
|
392
|
+
"m-select--placeholder": !U.value,
|
|
393
|
+
"m-select--fluid": pt.value,
|
|
394
|
+
"m-select--multiple": F.value,
|
|
395
|
+
"m-select--disabled": g.disabled,
|
|
396
|
+
"m-select--loading": I.value
|
|
397
|
+
}]],
|
|
398
|
+
role: "combobox",
|
|
399
|
+
tabindex: g.disabled ? -1 : 0,
|
|
400
|
+
"aria-expanded": A.value,
|
|
401
|
+
"aria-haspopup": "listbox",
|
|
402
|
+
"aria-controls": `${P.value}-listbox`,
|
|
403
|
+
"aria-invalid": z.value || void 0,
|
|
404
|
+
"aria-describedby": B.value ? `${P.value}-help` : void 0,
|
|
405
|
+
"aria-disabled": g.disabled || void 0,
|
|
406
|
+
"aria-busy": I.value || void 0,
|
|
407
|
+
"aria-multiselectable": F.value || void 0,
|
|
408
|
+
onClick: n[0] ||= (e) => Q(!A.value),
|
|
409
|
+
onKeydown: zt
|
|
410
|
+
}), [F.value && U.value ? (v(), p("div", ke, [(v(!0), p(l, null, pe(St.value, (e) => (v(), p("span", {
|
|
411
|
+
key: String(e.value),
|
|
412
|
+
class: "m-select__tag"
|
|
413
|
+
}, [m("span", Ae, x(e.label), 1), m("button", {
|
|
414
|
+
class: "m-select__tag-remove",
|
|
415
|
+
type: "button",
|
|
416
|
+
"aria-label": S(O).removeTag,
|
|
417
|
+
disabled: g.disabled,
|
|
418
|
+
onClick: (t) => Lt(e.value, t)
|
|
419
|
+
}, [h(t, {
|
|
420
|
+
name: "close",
|
|
421
|
+
size: "sm"
|
|
422
|
+
})], 8, je)]))), 128)), H.value ? (v(), p("span", {
|
|
423
|
+
key: 0,
|
|
424
|
+
class: "m-select__tag m-select__tag--more",
|
|
425
|
+
"aria-label": kt.value
|
|
426
|
+
}, " +" + x(H.value), 9, Me)) : f("", !0)])) : (v(), p("span", Ne, [S(Qe).value && U.value && Ct.value ? b(e.$slots, "value", { option: Ct.value }, void 0, void 0, 0) : (v(), p(l, { key: 1 }, [ce(x(wt.value), 1)], 64))])), I.value ? (v(), p("span", Pe)) : f("", !0)], 16, Oe), m("div", Fe, [Tt.value ? (v(), p("button", {
|
|
427
|
+
key: 0,
|
|
428
|
+
class: "m-select__clear",
|
|
429
|
+
type: "button",
|
|
430
|
+
"aria-label": S(O).clear,
|
|
431
|
+
onClick: Rt
|
|
432
|
+
}, [h(t, {
|
|
433
|
+
name: "close",
|
|
434
|
+
class: "m-control-affix-icon"
|
|
435
|
+
})], 8, Ie)) : f("", !0), m("span", {
|
|
436
|
+
class: _(["m-select__indicator", { "m-select__indicator--open": A.value }]),
|
|
437
|
+
"aria-hidden": "true"
|
|
438
|
+
}, [h(t, {
|
|
439
|
+
name: "chevron-down",
|
|
440
|
+
class: "m-control-affix-icon"
|
|
441
|
+
})], 2)])], 2),
|
|
442
|
+
(v(), d(oe, {
|
|
443
|
+
to: gt.value.to,
|
|
444
|
+
disabled: gt.value.disabled
|
|
445
|
+
}, [h(se, {
|
|
446
|
+
name: S(rt),
|
|
447
|
+
css: S(it)
|
|
448
|
+
}, {
|
|
449
|
+
default: _e(() => [A.value ? (v(), p("div", {
|
|
450
|
+
key: 0,
|
|
451
|
+
id: `${P.value}-listbox`,
|
|
452
|
+
ref_key: "menu",
|
|
453
|
+
ref: ot,
|
|
454
|
+
class: _(["m-select__menu", [`m-select__menu--${g.placement}`, { "m-select__menu--teleported": R.value }]]),
|
|
455
|
+
style: de(R.value ? ct.value : void 0),
|
|
456
|
+
role: "listbox",
|
|
457
|
+
tabindex: "-1",
|
|
458
|
+
"aria-multiselectable": F.value || void 0,
|
|
459
|
+
"aria-label": g.label ?? g.placeholder ?? S(O).selectOption,
|
|
460
|
+
onKeydown: Bt
|
|
461
|
+
}, [
|
|
462
|
+
e.$slots.header ? (v(), p("div", Re, [b(e.$slots, "header")])) : f("", !0),
|
|
463
|
+
L.value ? ve((v(), p("input", {
|
|
464
|
+
key: 1,
|
|
465
|
+
ref_key: "filterInput",
|
|
466
|
+
ref: st,
|
|
467
|
+
"onUpdate:modelValue": n[1] ||= (e) => j.value = e,
|
|
468
|
+
class: "m-select__filter",
|
|
469
|
+
type: "search",
|
|
470
|
+
size: "1",
|
|
471
|
+
placeholder: S(O).searchPlaceholder,
|
|
472
|
+
"aria-label": S(O).filterOptions,
|
|
473
|
+
onClick: n[2] ||= ye(() => {}, ["stop"]),
|
|
474
|
+
onKeydown: ye(Bt, ["stop"])
|
|
475
|
+
}, null, 40, ze)), [[ge, j.value]]) : f("", !0),
|
|
476
|
+
J.value && !I.value && K.value.length ? (v(), d(c, {
|
|
477
|
+
key: 2,
|
|
478
|
+
id: `${P.value}-listbox`,
|
|
479
|
+
ref_key: "virtualList",
|
|
480
|
+
ref: Mt,
|
|
481
|
+
class: "m-select__list m-select__list--virtual",
|
|
482
|
+
role: "listbox",
|
|
483
|
+
"aria-label": g.label ?? g.placeholder ?? S(O).selectOption,
|
|
484
|
+
items: G.value,
|
|
485
|
+
"item-size": At.value,
|
|
486
|
+
height: jt.value,
|
|
487
|
+
buffer: 4
|
|
488
|
+
}, {
|
|
489
|
+
item: _e(({ item: n }) => [Nt(n).type === "group" ? (v(), p("div", Be, x(Pt(n)), 1)) : (v(), p("button", {
|
|
490
|
+
key: 1,
|
|
491
|
+
class: _(["m-select__option", {
|
|
492
|
+
"m-select__option--selected": !Y(n).created && X(Y(n).value),
|
|
493
|
+
"m-select__option--highlighted": q.value[M.value]?.value === Y(n).value && !!q.value[M.value]?.created == !!Y(n).created,
|
|
494
|
+
"m-select__option--create": Y(n).created
|
|
495
|
+
}]),
|
|
496
|
+
type: "button",
|
|
497
|
+
role: "option",
|
|
498
|
+
"aria-selected": Y(n).created ? void 0 : X(Y(n).value),
|
|
499
|
+
disabled: Y(n).disabled,
|
|
500
|
+
onMouseenter: (e) => !Y(n).disabled && (M.value = q.value.findIndex((e) => e.value === Y(n).value && !!e.created == !!Y(n).created)),
|
|
501
|
+
onClick: (e) => $(Y(n))
|
|
502
|
+
}, [b(e.$slots, "option", { option: Y(n) }, () => [m("span", null, x(Y(n).created ? Ot.value : Y(n).label), 1)]), !Y(n).created && X(Y(n).value) ? (v(), d(t, {
|
|
503
|
+
key: 0,
|
|
504
|
+
class: "m-select__check",
|
|
505
|
+
name: "check",
|
|
506
|
+
size: "sm"
|
|
507
|
+
})) : f("", !0)], 42, Ve))]),
|
|
508
|
+
_: 3
|
|
509
|
+
}, 8, [
|
|
510
|
+
"id",
|
|
511
|
+
"aria-label",
|
|
512
|
+
"items",
|
|
513
|
+
"item-size",
|
|
514
|
+
"height"
|
|
515
|
+
])) : (v(), d(ee, {
|
|
516
|
+
key: 3,
|
|
517
|
+
id: `${P.value}-listbox`,
|
|
518
|
+
class: "m-select__list",
|
|
519
|
+
"fit-content": "",
|
|
520
|
+
"wrap-class": "m-select__list-wrap",
|
|
521
|
+
"view-class": "m-select__list-view"
|
|
522
|
+
}, {
|
|
523
|
+
default: _e(() => [
|
|
524
|
+
I.value ? (v(), p("div", He, x(S(O).loading), 1)) : f("", !0),
|
|
525
|
+
(v(!0), p(l, null, pe(G.value, (n) => (v(), p(l, { key: n.key }, [n.type === "group" ? (v(), p("div", Ue, x(n.label), 1)) : (v(), p("button", {
|
|
526
|
+
key: 1,
|
|
527
|
+
class: _(["m-select__option", {
|
|
528
|
+
"m-select__option--selected": !n.option.created && X(n.option.value),
|
|
529
|
+
"m-select__option--highlighted": q.value[M.value]?.value === n.option.value && !!q.value[M.value]?.created == !!n.option.created,
|
|
530
|
+
"m-select__option--create": n.option.created
|
|
531
|
+
}]),
|
|
532
|
+
type: "button",
|
|
533
|
+
role: "option",
|
|
534
|
+
"aria-selected": n.option.created ? void 0 : X(n.option.value),
|
|
535
|
+
disabled: n.option.disabled,
|
|
536
|
+
onMouseenter: (e) => !n.option.disabled && (M.value = q.value.findIndex((e) => e.value === n.option.value && !!e.created == !!n.option.created)),
|
|
537
|
+
onClick: (e) => $(n.option)
|
|
538
|
+
}, [b(e.$slots, "option", { option: n.option }, () => [m("span", null, x(n.option.created ? Ot.value : n.option.label), 1)]), !n.option.created && X(n.option.value) ? (v(), d(t, {
|
|
539
|
+
key: 0,
|
|
540
|
+
class: "m-select__check",
|
|
541
|
+
name: "check",
|
|
542
|
+
size: "sm"
|
|
543
|
+
})) : f("", !0)], 42, We))], 64))), 128)),
|
|
544
|
+
!K.value.length && !I.value ? (v(), p("div", Ge, x(ut.value), 1)) : f("", !0)
|
|
545
|
+
]),
|
|
546
|
+
_: 3
|
|
547
|
+
}, 8, ["id"])),
|
|
548
|
+
J.value && I.value ? (v(), p("div", Ke, x(S(O).loading), 1)) : J.value && !K.value.length && !I.value ? (v(), p("div", qe, x(ut.value), 1)) : f("", !0),
|
|
549
|
+
e.$slots.footer ? (v(), p("div", Je, [b(e.$slots, "footer")])) : f("", !0)
|
|
550
|
+
], 46, Le)) : f("", !0)]),
|
|
551
|
+
_: 3
|
|
552
|
+
}, 8, ["name", "css"])], 8, ["to", "disabled"])),
|
|
553
|
+
g.required ? (v(), p("input", {
|
|
554
|
+
key: 1,
|
|
555
|
+
class: "m-select__required-input",
|
|
556
|
+
tabindex: "-1",
|
|
557
|
+
"aria-hidden": "true",
|
|
558
|
+
name: g.name,
|
|
559
|
+
required: !U.value,
|
|
560
|
+
value: F.value ? V.value.join(",") : V.value[0]
|
|
561
|
+
}, null, 8, Ye)) : f("", !0),
|
|
562
|
+
B.value ? (v(), p("span", {
|
|
563
|
+
key: 2,
|
|
564
|
+
id: `${P.value}-help`,
|
|
565
|
+
class: _(["m-select-field__help", { "m-select-field__help--invalid": _t.value }]),
|
|
566
|
+
role: _t.value ? "alert" : void 0
|
|
567
|
+
}, x(B.value), 11, Xe)) : f("", !0)
|
|
568
|
+
], 16));
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
//#endregion
|
|
572
|
+
export { E as t };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as e } from "./useComponentAttrs-e-5QAjdw.js";
|
|
2
|
+
import { t } from "./usePauseOffscreen-BIikV_gj.js";
|
|
3
|
+
import { Fragment as n, computed as r, createElementBlock as i, defineComponent as a, mergeProps as o, normalizeClass as s, normalizeStyle as c, openBlock as l, ref as u, renderList as d, unref as f, useAttrs as p } from "vue";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/components/Skeleton/Skeleton.vue
|
|
6
|
+
var m = /* @__PURE__ */ a({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "Skeleton",
|
|
9
|
+
props: {
|
|
10
|
+
pt: {},
|
|
11
|
+
shape: { default: "rectangle" },
|
|
12
|
+
width: { default: "100%" },
|
|
13
|
+
height: {},
|
|
14
|
+
borderRadius: {},
|
|
15
|
+
animation: { default: "wave" },
|
|
16
|
+
text: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
20
|
+
repeat: { default: 1 }
|
|
21
|
+
},
|
|
22
|
+
setup(a) {
|
|
23
|
+
let m = a, h = p(), { rootAttrs: g } = e(h, () => m.pt), _ = u(null), { pauseAttrs: v } = t(_, () => m.animation === "wave"), y = r(() => Math.max(1, m.repeat ?? 1)), b = r(() => ["m-skeleton", {
|
|
24
|
+
"m-skeleton--circle": m.shape === "circle",
|
|
25
|
+
"m-skeleton--wave": m.animation === "wave",
|
|
26
|
+
"m-skeleton--text": m.text
|
|
27
|
+
}]), x = r(() => ({
|
|
28
|
+
width: m.width,
|
|
29
|
+
height: m.height ?? (m.text ? "0.85em" : void 0),
|
|
30
|
+
borderRadius: m.borderRadius
|
|
31
|
+
}));
|
|
32
|
+
return (e, t) => y.value > 1 ? (l(), i("div", o({
|
|
33
|
+
key: 0,
|
|
34
|
+
ref_key: "rootRef",
|
|
35
|
+
ref: _
|
|
36
|
+
}, {
|
|
37
|
+
...f(g),
|
|
38
|
+
...f(v)
|
|
39
|
+
}, { class: "m-skeleton-repeat" }), [(l(!0), i(n, null, d(y.value, (e) => (l(), i("div", {
|
|
40
|
+
key: e,
|
|
41
|
+
class: s(b.value),
|
|
42
|
+
style: c(x.value),
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
}, null, 6))), 128))], 16)) : (l(), i("div", o({
|
|
45
|
+
key: 1,
|
|
46
|
+
ref_key: "rootRef",
|
|
47
|
+
ref: _
|
|
48
|
+
}, {
|
|
49
|
+
...f(g),
|
|
50
|
+
...f(v)
|
|
51
|
+
}, {
|
|
52
|
+
class: b.value,
|
|
53
|
+
style: x.value,
|
|
54
|
+
"aria-hidden": "true"
|
|
55
|
+
}), null, 16));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//#endregion
|
|
59
|
+
export { m as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./useMotionTransition-
|
|
1
|
+
import { t as e } from "./useMotionTransition-95Y79FoL.js";
|
|
2
2
|
import { n as t, t as n } from "./overlay-oR-5MDuE.js";
|
|
3
|
-
import { n as r, t as i } from "./overlayPlacement-
|
|
4
|
-
import { t as a } from "./useFloatingViewportSync-
|
|
3
|
+
import { n as r, t as i } from "./overlayPlacement-qwEJPVS4.js";
|
|
4
|
+
import { t as a } from "./useFloatingViewportSync-wLLKIGUA.js";
|
|
5
5
|
import { t as o } from "./useMId-BXFYayPP.js";
|
|
6
6
|
import { c as s } from "./config-CapALqt3.js";
|
|
7
7
|
import { Teleport as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, defineComponent as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, openBlock as b, ref as x, renderSlot as S, toDisplayString as C, unref as w, withCtx as T } from "vue";
|