@nubisco/ui 5.54.0 → 5.55.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/dist/{AccordionItem--XeLRz2P.js → AccordionItem-BY-p8UkV.js} +1 -1
- package/dist/{AccordionItem-BYSH6dZK.cjs → AccordionItem-p0mYXIj8.cjs} +1 -1
- package/dist/{ActionGroup-Cn22xj1t.js → ActionGroup-CjRSKyOa.js} +1 -1
- package/dist/{ActionGroup-0rG92kFk.cjs → ActionGroup-DIMZhC7N.cjs} +1 -1
- package/dist/AiLabel-BDccQ2iQ.js +242 -0
- package/dist/AiLabel-jRrBTu6c.cjs +1 -0
- package/dist/{AiProvider-CLtCD_UR.cjs → AiProvider-CGB9EiSf.cjs} +1 -1
- package/dist/{AiProvider-gprbR5ts.js → AiProvider-CMbPWtU-.js} +2 -2
- package/dist/{BatchActions-Ckx8kyZt.js → BatchActions-Kr2S6CJI.js} +1 -1
- package/dist/{BatchActions-6IO5GRFm.cjs → BatchActions-jfvfpZeT.cjs} +1 -1
- package/dist/{Board-BdqGOVNF.js → Board-C3_cXRl6.js} +177 -176
- package/dist/Board-D6A-irdx.cjs +1 -0
- package/dist/{Breadcrumbs-BzyDVvEk.cjs → Breadcrumbs-0rRFiO31.cjs} +1 -1
- package/dist/{Breadcrumbs-Bc-acmPE.js → Breadcrumbs-DqagVknq.js} +1 -1
- package/dist/{Briefing-DwKWCOGm.cjs → Briefing-B-O-9bhN.cjs} +1 -1
- package/dist/{Briefing-BiEICh1u.js → Briefing-DNH-707q.js} +1 -1
- package/dist/{ChatMessage-1L_xCXZF.cjs → ChatMessage-B45Xhl8x.cjs} +1 -1
- package/dist/{ChatMessage-C2Ecm175.js → ChatMessage-BDOdvI4h.js} +1 -1
- package/dist/{ChatThread-B_F3xTdE.cjs → ChatThread-B7F1r4t4.cjs} +1 -1
- package/dist/{ChatThread-COdOb1rH.js → ChatThread-DqvsnVOr.js} +1 -1
- package/dist/CommandPalette-BaRqoURY.cjs +1 -0
- package/dist/CommandPalette-DWv1UV8r.js +294 -0
- package/dist/{Confirm-Baz2WG7b.cjs → Confirm-B5vMzPbN.cjs} +1 -1
- package/dist/{Confirm-CvMuXK9Q.js → Confirm-C4lT-6HD.js} +1 -1
- package/dist/{DataTable-B8THDBLS.js → DataTable-CcwD0PSJ.js} +2 -2
- package/dist/{DataTable-DeFzOlcP.cjs → DataTable-xEw-NvHM.cjs} +1 -1
- package/dist/{DatePicker-BrUXcNUj.js → DatePicker-3pCNky8d.js} +234 -230
- package/dist/DatePicker-BrMicYUx.cjs +1 -0
- package/dist/FloatingToolbar-BV-iGNxe.js +120 -0
- package/dist/FloatingToolbar-C8xB4BzH.cjs +1 -0
- package/dist/{ImagePicker-vhg7b-UL.cjs → ImagePicker-5qPI77Jo.cjs} +1 -1
- package/dist/{ImagePicker-LhpR7jjR.js → ImagePicker-BnHg403Q.js} +1 -1
- package/dist/InfoHint-CdluaJqE.cjs +1 -0
- package/dist/InfoHint-zMuSw_99.js +182 -0
- package/dist/{InlineLoading-CA0_IT29.cjs → InlineLoading-CqGrNWHf.cjs} +1 -1
- package/dist/{InlineLoading-Cknqq0vv.js → InlineLoading-_j2KKhNQ.js} +1 -1
- package/dist/Menu-CWxBEMC4.js +193 -0
- package/dist/Menu-D0TerdRm.cjs +1 -0
- package/dist/{MenuBarItem-yr5aizl3.js → MenuBarItem-BYh4YWR4.js} +1 -1
- package/dist/{MenuBarItem-DlnIAhRw.cjs → MenuBarItem-DTOqacvg.cjs} +1 -1
- package/dist/Modal-CmGFLEo4.cjs +1 -0
- package/dist/{Modal-CESCi2dE.js → Modal-DwL90AoV.js} +73 -69
- package/dist/NotificationCenter-EMlV-oPh.cjs +1 -0
- package/dist/{NotificationCenter-DkGc0ETD.js → NotificationCenter-YZnPMH7c.js} +217 -213
- package/dist/{OverflowMenu-BWZ7c8oI.js → OverflowMenu-DliuDrTK.js} +1 -1
- package/dist/{OverflowMenu-C8q28FrD.cjs → OverflowMenu-DuRgj1DU.cjs} +1 -1
- package/dist/{PageHeader-DElq_kdh.cjs → PageHeader-BoEdR_T5.cjs} +1 -1
- package/dist/{PageHeader-DOYN9sto.js → PageHeader-c6117xYf.js} +1 -1
- package/dist/{Pagination-9mPN8ych.cjs → Pagination-B3lmxggo.cjs} +1 -1
- package/dist/{Pagination-CxBHFwy0.js → Pagination-DwAc-4d9.js} +1 -1
- package/dist/Select-CDs-7QtW.js +619 -0
- package/dist/Select-CJqwMI69.cjs +1 -0
- package/dist/{SidebarCollapseToggle-DraqbhwM.js → SidebarCollapseToggle-C38R19gG.js} +1 -1
- package/dist/{SidebarCollapseToggle-CABmF-PC.cjs → SidebarCollapseToggle-DOck3Txy.cjs} +1 -1
- package/dist/SidebarMenuItem-DzJ_R2__.cjs +1 -0
- package/dist/SidebarMenuItem-E410HTei.js +302 -0
- package/dist/Spinner-BlzVODzE.js +161 -0
- package/dist/Spinner-Bpfgl-mN.cjs +1 -0
- package/dist/{Stat-BCvXYr-z.cjs → Stat-BByeMKkT.cjs} +1 -1
- package/dist/{Stat-No3RhGB3.js → Stat-DWliDbWE.js} +1 -1
- package/dist/Submenu-BkHGYo7X.js +168 -0
- package/dist/Submenu-CCQnBpln.cjs +1 -0
- package/dist/{SuggestionList-Cxy4jjjd.cjs → SuggestionList-C61Dj6en.cjs} +1 -1
- package/dist/{SuggestionList-Dv4yQAi-.js → SuggestionList-D48Ojcf3.js} +1 -1
- package/dist/Toaster-Dwjm0bsR.js +285 -0
- package/dist/Toaster-aJJvxlEr.cjs +1 -0
- package/dist/{UserMenu-CjmhyTwN.js → UserMenu-BTihjCKC.js} +94 -90
- package/dist/UserMenu-CHkbByFS.cjs +1 -0
- package/dist/{Walkthrough-DYYqtpwJ.js → Walkthrough-BqGB1yaX.js} +63 -59
- package/dist/Walkthrough-sGAypY5d.cjs +1 -0
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +284 -283
- package/dist/components/AccordionItem.cjs +1 -1
- package/dist/components/AccordionItem.mjs +1 -1
- package/dist/components/ActionGroup.cjs +1 -1
- package/dist/components/ActionGroup.mjs +1 -1
- package/dist/components/AiLabel.cjs +1 -1
- package/dist/components/AiLabel.mjs +1 -1
- package/dist/components/AiLabel.vue.d.ts.map +1 -1
- package/dist/components/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/BatchActions.cjs +1 -1
- package/dist/components/BatchActions.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.mjs +1 -1
- package/dist/components/Board.vue.d.ts.map +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Briefing.cjs +1 -1
- package/dist/components/Briefing.mjs +1 -1
- package/dist/components/ChatMessage.cjs +1 -1
- package/dist/components/ChatMessage.mjs +1 -1
- package/dist/components/ChatThread.cjs +1 -1
- package/dist/components/ChatThread.mjs +1 -1
- package/dist/components/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette.mjs +1 -1
- package/dist/components/CommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/FloatingToolbar.cjs +1 -1
- package/dist/components/FloatingToolbar.mjs +1 -1
- package/dist/components/FloatingToolbar.vue.d.ts.map +1 -1
- package/dist/components/ImagePicker.cjs +1 -1
- package/dist/components/ImagePicker.mjs +1 -1
- package/dist/components/InfoHint.cjs +1 -1
- package/dist/components/InfoHint.mjs +1 -1
- package/dist/components/InfoHint.vue.d.ts.map +1 -1
- package/dist/components/InlineLoading.cjs +1 -1
- package/dist/components/InlineLoading.mjs +1 -1
- package/dist/components/Menu.cjs +1 -1
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/Menu.vue.d.ts.map +1 -1
- package/dist/components/MenuBarItem.cjs +1 -1
- package/dist/components/MenuBarItem.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenter.vue.d.ts.map +1 -1
- package/dist/components/OverflowMenu.cjs +1 -1
- package/dist/components/OverflowMenu.mjs +1 -1
- package/dist/components/PageHeader.cjs +1 -1
- package/dist/components/PageHeader.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/SidebarCollapseToggle.cjs +1 -1
- package/dist/components/SidebarCollapseToggle.mjs +1 -1
- package/dist/components/SidebarMenuItem.cjs +1 -1
- package/dist/components/SidebarMenuItem.mjs +1 -1
- package/dist/components/SidebarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/Spinner.cjs +1 -1
- package/dist/components/Spinner.mjs +1 -1
- package/dist/components/Spinner.vue.d.ts.map +1 -1
- package/dist/components/Stat.cjs +1 -1
- package/dist/components/Stat.mjs +1 -1
- package/dist/components/Submenu.cjs +1 -1
- package/dist/components/Submenu.mjs +1 -1
- package/dist/components/Submenu.vue.d.ts.map +1 -1
- package/dist/components/SuggestionList.cjs +1 -1
- package/dist/components/SuggestionList.mjs +1 -1
- package/dist/components/Toaster.cjs +1 -1
- package/dist/components/Toaster.mjs +1 -1
- package/dist/components/Toaster.vue.d.ts.map +1 -1
- package/dist/components/UserMenu.cjs +1 -1
- package/dist/components/UserMenu.mjs +1 -1
- package/dist/components/UserMenu.vue.d.ts.map +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/components/Walkthrough.vue.d.ts.map +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -2
- package/dist/composables/useTeleportReady.composable.cjs +1 -0
- package/dist/composables/useTeleportReady.composable.d.ts +30 -0
- package/dist/composables/useTeleportReady.composable.d.ts.map +1 -0
- package/dist/composables/useTeleportReady.composable.mjs +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +152 -151
- package/dist/main-BMIeIxGV.cjs +4 -0
- package/dist/{main-D6qY7QeE.js → main-BXz7vG2i.js} +167 -157
- package/dist/main.d.ts +10 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/AiLabel.css +1 -1
- package/dist/styles/FloatingToolbar.css +1 -1
- package/dist/styles/InfoHint.css +1 -1
- package/dist/styles/Modal.css +1 -1
- package/dist/styles/SidebarMenuItem.css +1 -1
- package/dist/styles/Spinner.css +1 -1
- package/dist/styles/Toaster.css +1 -1
- package/dist/styles/Walkthrough.css +1 -1
- package/dist/ui.css +8 -8
- package/package.json +1 -1
- package/dist/AiLabel-AGSSBanb.cjs +0 -1
- package/dist/AiLabel-D32aNf1F.js +0 -240
- package/dist/Board-DtOWyvKh.cjs +0 -1
- package/dist/CommandPalette-CC_Aj4Uh.cjs +0 -1
- package/dist/CommandPalette-zqTMjpm8.js +0 -290
- package/dist/DatePicker-B5YRb64p.cjs +0 -1
- package/dist/FloatingToolbar-BikX_AsP.js +0 -116
- package/dist/FloatingToolbar-DWVY8Fxo.cjs +0 -1
- package/dist/InfoHint-BEzkNQTM.cjs +0 -1
- package/dist/InfoHint-BlHxrTw6.js +0 -178
- package/dist/Menu-7EgnchVu.js +0 -189
- package/dist/Menu-Bs2Co1sl.cjs +0 -1
- package/dist/Modal-C_EWDvmH.cjs +0 -1
- package/dist/NotificationCenter-DxZgHQyt.cjs +0 -1
- package/dist/Select-7gJ3_fWh.js +0 -615
- package/dist/Select-Dg4HSHOu.cjs +0 -1
- package/dist/SidebarMenuItem-DQRQtqrp.js +0 -300
- package/dist/SidebarMenuItem-Dwk7vKN5.cjs +0 -1
- package/dist/Spinner-DYFhiTB1.js +0 -160
- package/dist/Spinner-j13gRoUF.cjs +0 -1
- package/dist/Submenu-BDs-yAqv.js +0 -164
- package/dist/Submenu-BLjx2kWl.cjs +0 -1
- package/dist/Toaster-ByObLDkk.js +0 -284
- package/dist/Toaster-CJAbZ9pv.cjs +0 -1
- package/dist/UserMenu-BjSO_Uml.cjs +0 -1
- package/dist/Walkthrough-DxAIdo3M.cjs +0 -1
- package/dist/main-Cs0FFBfV.cjs +0 -4
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
|
+
import { useTeleportReady as t } from "./composables/useTeleportReady.composable.mjs";
|
|
3
|
+
import { t as n } from "./Icon-B2tiGiqZ.js";
|
|
4
|
+
import { useNbStrings as r } from "./composables/useNbStrings.composable.mjs";
|
|
5
|
+
import { t as i } from "./Grid-BVIhOyQ1.js";
|
|
6
|
+
import { t as ee } from "./Label-xwHw_UbN.js";
|
|
7
|
+
import { t as a } from "./Message-Bi70NgGd.js";
|
|
8
|
+
import { n as te } from "./InputGroup.context-Dd4e6fGT.js";
|
|
9
|
+
import { joinDescribedBy as ne, useFieldMessage as re } from "./composables/useFieldMessage.composable.mjs";
|
|
10
|
+
import { useMenuSurface as ie } from "./composables/useMenuSurface.composable.mjs";
|
|
11
|
+
import { Fragment as o, Teleport as ae, Transition as oe, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, h as se, mergeProps as ce, nextTick as le, normalizeClass as h, normalizeProps as ue, normalizeStyle as de, onBeforeUnmount as fe, openBlock as g, ref as _, renderList as pe, renderSlot as v, toDisplayString as y, unref as b, useId as me, useSlots as he, vModelText as ge, watch as _e, withCtx as x, withDirectives as ve, withKeys as S, withModifiers as C } from "vue";
|
|
12
|
+
import { regular as ye } from "@nubisco/ui/icons/caret-down";
|
|
13
|
+
import { regular as be } from "@nubisco/ui/icons/x";
|
|
14
|
+
import { regular as xe } from "@nubisco/ui/icons/caret-up";
|
|
15
|
+
//#region src/components/Select.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
+
var Se = [
|
|
17
|
+
"id",
|
|
18
|
+
"aria-expanded",
|
|
19
|
+
"aria-controls",
|
|
20
|
+
"aria-activedescendant",
|
|
21
|
+
"aria-disabled",
|
|
22
|
+
"aria-required",
|
|
23
|
+
"aria-invalid",
|
|
24
|
+
"aria-describedby",
|
|
25
|
+
"disabled"
|
|
26
|
+
], Ce = {
|
|
27
|
+
key: 2,
|
|
28
|
+
class: "nb-select__clear-space",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}, we = [
|
|
31
|
+
"id",
|
|
32
|
+
"aria-expanded",
|
|
33
|
+
"aria-controls",
|
|
34
|
+
"aria-activedescendant",
|
|
35
|
+
"aria-disabled",
|
|
36
|
+
"aria-required",
|
|
37
|
+
"aria-invalid",
|
|
38
|
+
"aria-describedby",
|
|
39
|
+
"disabled"
|
|
40
|
+
], Te = {
|
|
41
|
+
key: 1,
|
|
42
|
+
class: "nb-select__inner-label"
|
|
43
|
+
}, Ee = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "nb-select__asterisk",
|
|
46
|
+
"aria-hidden": "true"
|
|
47
|
+
}, De = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "nb-select__clear-space",
|
|
50
|
+
"aria-hidden": "true"
|
|
51
|
+
}, Oe = ["id", "aria-multiselectable"], ke = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "nb-select__search"
|
|
54
|
+
}, Ae = [
|
|
55
|
+
"placeholder",
|
|
56
|
+
"aria-label",
|
|
57
|
+
"aria-controls",
|
|
58
|
+
"aria-activedescendant"
|
|
59
|
+
], je = ["aria-labelledby"], Me = ["id"], Ne = [
|
|
60
|
+
"id",
|
|
61
|
+
"data-index",
|
|
62
|
+
"aria-selected",
|
|
63
|
+
"aria-disabled",
|
|
64
|
+
"onMouseenter",
|
|
65
|
+
"onClick"
|
|
66
|
+
], Pe = {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: "nb-select__option-check",
|
|
69
|
+
"aria-hidden": "true"
|
|
70
|
+
}, Fe = {
|
|
71
|
+
key: 0,
|
|
72
|
+
viewBox: "0 0 10 8",
|
|
73
|
+
fill: "none",
|
|
74
|
+
width: "10",
|
|
75
|
+
height: "8"
|
|
76
|
+
}, Ie = { class: "nb-select__option-label" }, Le = {
|
|
77
|
+
key: 1,
|
|
78
|
+
class: "nb-select__empty"
|
|
79
|
+
}, Re = {
|
|
80
|
+
key: 2,
|
|
81
|
+
class: "nb-select__empty"
|
|
82
|
+
}, ze = ["placeholder", "onKeydown"], Be = /* @__PURE__ */ m({
|
|
83
|
+
inheritAttrs: !1,
|
|
84
|
+
__name: "Select",
|
|
85
|
+
props: {
|
|
86
|
+
modelValue: { default: null },
|
|
87
|
+
options: { default: () => [] },
|
|
88
|
+
multiple: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !1
|
|
91
|
+
},
|
|
92
|
+
creatable: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: !1
|
|
95
|
+
},
|
|
96
|
+
createPlaceholder: { default: "" },
|
|
97
|
+
clearable: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: !1
|
|
100
|
+
},
|
|
101
|
+
clearLabel: { default: void 0 },
|
|
102
|
+
searchable: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !1
|
|
105
|
+
},
|
|
106
|
+
searchPlaceholder: { default: "Search" },
|
|
107
|
+
noResultsLabel: { default: "No results" },
|
|
108
|
+
anchor: {
|
|
109
|
+
type: [Function, null],
|
|
110
|
+
default: null
|
|
111
|
+
},
|
|
112
|
+
selectedMark: { default: "fill" },
|
|
113
|
+
placeholder: { default: "Select…" },
|
|
114
|
+
name: { default: "" },
|
|
115
|
+
disabled: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: !1
|
|
118
|
+
},
|
|
119
|
+
required: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
id: { default: void 0 },
|
|
124
|
+
label: { default: "" },
|
|
125
|
+
error: { default: "" },
|
|
126
|
+
warning: { default: "" },
|
|
127
|
+
helper: { default: "" },
|
|
128
|
+
variant: { default: "default" },
|
|
129
|
+
size: { default: "md" }
|
|
130
|
+
},
|
|
131
|
+
emits: [
|
|
132
|
+
"update:modelValue",
|
|
133
|
+
"change",
|
|
134
|
+
"create"
|
|
135
|
+
],
|
|
136
|
+
setup(m, { expose: Be, emit: Ve }) {
|
|
137
|
+
let He = t(), w = m, T = Ve, E = (e, { slots: t }) => e.wrap ? se("div", { class: "nb-select__control" }, t.default?.()) : t.default?.();
|
|
138
|
+
E.props = ["wrap"];
|
|
139
|
+
let D = _(""), O = _(""), Ue = _(null);
|
|
140
|
+
function We() {
|
|
141
|
+
let e = D.value.trim();
|
|
142
|
+
e && (T("create", e), D.value = "");
|
|
143
|
+
}
|
|
144
|
+
let k = _(!1), A = _(!1), j = _(-1), M = _(null), N = _(null), P = he(), Ge = () => (typeof w.anchor == "function" ? w.anchor() : w.anchor) ?? N.value ?? M.value;
|
|
145
|
+
function Ke() {
|
|
146
|
+
(N.value ?? M.value?.querySelector("button, [tabindex]"))?.focus();
|
|
147
|
+
}
|
|
148
|
+
let F = _(null);
|
|
149
|
+
ie(F);
|
|
150
|
+
let qe = _({
|
|
151
|
+
position: "fixed",
|
|
152
|
+
top: "0px",
|
|
153
|
+
left: "0px",
|
|
154
|
+
width: "0px",
|
|
155
|
+
zIndex: "9999"
|
|
156
|
+
}), I = te(w, `nb-select-${me()}`), L = I.id, R = I.disabled, z = I.grouped, { ids: B, messageId: Je, invalid: Ye, live: V, key: H } = re(w, L), Xe = s(() => ne(z ? void 0 : Je.value, I.describedBy.value)), Ze = s(() => Ye.value ?? (I.status.value === "error" ? "true" : void 0)), Qe = s(() => !z && !!w.error || I.status.value === "error"), U = s(() => `${L.value}-listbox`), $e = (e) => `${L.value}-option-${e}`, et = s(() => k.value && !w.searchable && j.value >= 0 ? $e(j.value) : void 0), W = s(() => w.modelValue == null ? [] : Array.isArray(w.modelValue) ? w.modelValue : [w.modelValue]), G = s(() => {
|
|
157
|
+
if (!(w.multiple || W.value.length !== 1)) return (w.options ?? []).find((e) => e.value === W.value[0])?.icon;
|
|
158
|
+
}), K = s(() => {
|
|
159
|
+
if (W.value.length === 0) return "";
|
|
160
|
+
let e = w.options ?? [];
|
|
161
|
+
return w.multiple ? W.value.length === 1 ? e.find((e) => e.value === W.value[0])?.label ?? String(W.value[0]) : W.value.length === 2 ? W.value.map((t) => e.find((e) => e.value === t)?.label ?? String(t)).join(", ") : `${W.value.length} selected` : e.find((e) => e.value === W.value[0])?.label ?? String(W.value[0]);
|
|
162
|
+
});
|
|
163
|
+
function tt(e) {
|
|
164
|
+
return W.value.includes(e);
|
|
165
|
+
}
|
|
166
|
+
let nt = (e) => e.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase(), rt = s(() => {
|
|
167
|
+
let e = w.options ?? [], t = w.searchable ? nt(O.value.trim()) : "", n = /* @__PURE__ */ new Set();
|
|
168
|
+
return e.forEach((e, r) => {
|
|
169
|
+
(!t || nt(e.label).includes(t)) && n.add(r);
|
|
170
|
+
}), n;
|
|
171
|
+
}), it = s(() => {
|
|
172
|
+
let e = [];
|
|
173
|
+
return (w.options ?? []).forEach((t, n) => {
|
|
174
|
+
if (!rt.value.has(n)) return;
|
|
175
|
+
let r = e[e.length - 1];
|
|
176
|
+
(!r || r.name !== t.group) && e.push({
|
|
177
|
+
key: `${e.length}:${t.group ?? ""}`,
|
|
178
|
+
name: t.group,
|
|
179
|
+
labelId: `${L.value}-group-${e.length}`,
|
|
180
|
+
entries: []
|
|
181
|
+
}), e[e.length - 1].entries.push({
|
|
182
|
+
option: t,
|
|
183
|
+
index: n
|
|
184
|
+
});
|
|
185
|
+
}), e;
|
|
186
|
+
});
|
|
187
|
+
function at(e, t) {
|
|
188
|
+
let n = w.options ?? [];
|
|
189
|
+
for (let r = e + t; r >= 0 && r < n.length; r += t) if (!n[r].disabled && rt.value.has(r)) return r;
|
|
190
|
+
return e;
|
|
191
|
+
}
|
|
192
|
+
function ot(e) {
|
|
193
|
+
if (e.disabled) return;
|
|
194
|
+
let t;
|
|
195
|
+
if (w.multiple) {
|
|
196
|
+
let n = [...W.value], r = n.indexOf(e.value);
|
|
197
|
+
r >= 0 ? n.splice(r, 1) : n.push(e.value), t = n;
|
|
198
|
+
} else t = e.value, J();
|
|
199
|
+
T("update:modelValue", t), T("change", t);
|
|
200
|
+
}
|
|
201
|
+
function st() {
|
|
202
|
+
let e = Ge();
|
|
203
|
+
if (!e) return;
|
|
204
|
+
let t = e.getBoundingClientRect(), n = F.value?.offsetHeight ?? 0, r = window.innerHeight - t.bottom, i = t.top, ee = n > 0 && r < n && i > r, a = P.trigger ? Math.max(t.width, 240) : t.width, te = P.trigger ? Math.max(8, Math.min(t.left, window.innerWidth - a - 8)) : t.left;
|
|
205
|
+
qe.value = {
|
|
206
|
+
position: "fixed",
|
|
207
|
+
top: ee ? `${t.top - n}px` : `${t.bottom}px`,
|
|
208
|
+
left: `${te}px`,
|
|
209
|
+
width: `${a}px`,
|
|
210
|
+
zIndex: "9999"
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function q() {
|
|
214
|
+
if (R.value) return;
|
|
215
|
+
k.value = !0, st();
|
|
216
|
+
let e = w.options ?? [];
|
|
217
|
+
j.value = W.value.length > 0 ? Math.max(0, e.findIndex((e) => e.value === W.value[0])) : -1, le(() => {
|
|
218
|
+
st(), Q(), Ue.value?.focus({ preventScroll: !0 });
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function J() {
|
|
222
|
+
let e = !!F.value?.contains(document.activeElement);
|
|
223
|
+
k.value = !1, j.value = -1, O.value = "", e && Ke();
|
|
224
|
+
}
|
|
225
|
+
function Y() {
|
|
226
|
+
k.value ? J() : q();
|
|
227
|
+
}
|
|
228
|
+
function X(e) {
|
|
229
|
+
let t = e.target, n = M.value?.contains(t) ?? !1, r = F.value?.contains(t) ?? !1;
|
|
230
|
+
!n && !r && J();
|
|
231
|
+
}
|
|
232
|
+
function Z() {
|
|
233
|
+
k.value && st();
|
|
234
|
+
}
|
|
235
|
+
_e(k, (e) => {
|
|
236
|
+
e ? (document.addEventListener("mousedown", X), window.addEventListener("scroll", Z, !0), window.addEventListener("resize", Z)) : (document.removeEventListener("mousedown", X), window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z));
|
|
237
|
+
}), fe(() => {
|
|
238
|
+
document.removeEventListener("mousedown", X), window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z);
|
|
239
|
+
});
|
|
240
|
+
function ct(e) {
|
|
241
|
+
let t = w.options ?? [];
|
|
242
|
+
if (!k.value) {
|
|
243
|
+
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), q());
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
e.key === "Escape" ? (J(), e.preventDefault()) : e.key === "Tab" ? J() : e.key === "ArrowDown" ? (e.preventDefault(), j.value = at(j.value, 1), Q()) : e.key === "ArrowUp" ? (e.preventDefault(), j.value > 0 && (j.value = at(j.value, -1)), Q()) : (e.key === "Enter" || e.key === " ") && j.value >= 0 && (e.preventDefault(), ot(t[j.value]));
|
|
247
|
+
}
|
|
248
|
+
function Q() {
|
|
249
|
+
le(() => {
|
|
250
|
+
!F.value || j.value < 0 || F.value.querySelector(`[data-index="${j.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
_e(O, () => {
|
|
254
|
+
if (!k.value) return;
|
|
255
|
+
let e = at(-1, 1);
|
|
256
|
+
j.value = e === -1 ? -1 : e, Q();
|
|
257
|
+
});
|
|
258
|
+
function lt(e) {
|
|
259
|
+
if (e.key === " ") {
|
|
260
|
+
e.stopPropagation();
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (e.key === "Home" || e.key === "End") {
|
|
264
|
+
e.stopPropagation();
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
ct(e);
|
|
268
|
+
}
|
|
269
|
+
let ut = s(() => ({
|
|
270
|
+
isOpen: k.value,
|
|
271
|
+
toggle: Y,
|
|
272
|
+
open: q,
|
|
273
|
+
close: J,
|
|
274
|
+
attrs: {
|
|
275
|
+
"aria-expanded": k.value,
|
|
276
|
+
"aria-haspopup": "listbox",
|
|
277
|
+
"aria-controls": k.value ? U.value : void 0,
|
|
278
|
+
"aria-activedescendant": et.value,
|
|
279
|
+
"aria-invalid": Ye.value,
|
|
280
|
+
onClick: Y
|
|
281
|
+
}
|
|
282
|
+
})), dt = r(), ft = s(() => w.clearLabel ?? dt.value.selectClear), $ = s(() => w.clearable && !R.value && W.value.length > 0);
|
|
283
|
+
function pt() {
|
|
284
|
+
let e = w.multiple ? [] : null;
|
|
285
|
+
J(), T("update:modelValue", e), T("change", e), Ke();
|
|
286
|
+
}
|
|
287
|
+
let mt = s(() => [
|
|
288
|
+
"nb-select",
|
|
289
|
+
`nb-select--${w.variant}`,
|
|
290
|
+
`nb-select--${I.size.value}`,
|
|
291
|
+
{
|
|
292
|
+
"nb-select--open": k.value,
|
|
293
|
+
"nb-select--focused": A.value && !k.value,
|
|
294
|
+
"nb-select--error": Qe.value,
|
|
295
|
+
"nb-select--warning": !Qe.value && (!z && !!w.warning || I.status.value === "warning"),
|
|
296
|
+
"nb-select--multiple": w.multiple,
|
|
297
|
+
"nb-select--bare": !!P.trigger
|
|
298
|
+
}
|
|
299
|
+
]);
|
|
300
|
+
return Be({
|
|
301
|
+
open: q,
|
|
302
|
+
close: J
|
|
303
|
+
}), (t, r) => (g(), u(o, null, [d("div", ce({
|
|
304
|
+
ref_key: "rootRef",
|
|
305
|
+
ref: M
|
|
306
|
+
}, t.$attrs, {
|
|
307
|
+
class: mt.value,
|
|
308
|
+
onKeydown: ct
|
|
309
|
+
}), [t.$slots.trigger ? v(t.$slots, "trigger", ue(ce({ key: 0 }, ut.value))) : m.variant === "default" ? (g(), u(o, { key: 1 }, [
|
|
310
|
+
t.$slots.label && !b(z) ? v(t.$slots, "label", { key: 0 }) : m.label && !b(z) ? (g(), c(ee, {
|
|
311
|
+
key: 1,
|
|
312
|
+
for: b(L),
|
|
313
|
+
required: m.required,
|
|
314
|
+
disabled: b(R)
|
|
315
|
+
}, {
|
|
316
|
+
default: x(() => [f(y(m.label), 1)]),
|
|
317
|
+
_: 1
|
|
318
|
+
}, 8, [
|
|
319
|
+
"for",
|
|
320
|
+
"required",
|
|
321
|
+
"disabled"
|
|
322
|
+
])) : l("", !0),
|
|
323
|
+
p(E, { wrap: m.clearable }, {
|
|
324
|
+
default: x(() => [d("button", {
|
|
325
|
+
id: b(L),
|
|
326
|
+
ref_key: "triggerRef",
|
|
327
|
+
ref: N,
|
|
328
|
+
type: "button",
|
|
329
|
+
class: "nb-select__trigger",
|
|
330
|
+
role: "combobox",
|
|
331
|
+
"aria-expanded": k.value,
|
|
332
|
+
"aria-haspopup": "listbox",
|
|
333
|
+
"aria-controls": k.value ? U.value : void 0,
|
|
334
|
+
"aria-activedescendant": et.value,
|
|
335
|
+
"aria-disabled": b(R) || void 0,
|
|
336
|
+
"aria-required": m.required || void 0,
|
|
337
|
+
"aria-invalid": Ze.value,
|
|
338
|
+
"aria-describedby": Xe.value,
|
|
339
|
+
disabled: b(R) || void 0,
|
|
340
|
+
onClick: Y,
|
|
341
|
+
onFocus: r[0] ||= (e) => A.value = !0,
|
|
342
|
+
onBlur: r[1] ||= (e) => A.value = !1
|
|
343
|
+
}, [
|
|
344
|
+
d("span", { class: h(["nb-select__value", {
|
|
345
|
+
"nb-select__value--placeholder": !K.value,
|
|
346
|
+
"nb-select__value--with-icon": !!G.value
|
|
347
|
+
}]) }, [G.value ? (g(), c(n, {
|
|
348
|
+
key: 0,
|
|
349
|
+
class: "nb-select__value-icon",
|
|
350
|
+
name: G.value,
|
|
351
|
+
size: 16
|
|
352
|
+
}, null, 8, ["name"])) : l("", !0), K.value ? v(t.$slots, "value", {
|
|
353
|
+
key: 1,
|
|
354
|
+
values: W.value
|
|
355
|
+
}, () => [f(y(K.value), 1)]) : (g(), u(o, { key: 2 }, [f(y(m.placeholder), 1)], 64))], 2),
|
|
356
|
+
m.error && !b(z) ? (g(), c(a, {
|
|
357
|
+
key: 0,
|
|
358
|
+
variant: "error",
|
|
359
|
+
"icon-only": !0,
|
|
360
|
+
live: "off",
|
|
361
|
+
"aria-hidden": "true",
|
|
362
|
+
class: "nb-select__status-icon"
|
|
363
|
+
}, {
|
|
364
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
365
|
+
_: 1
|
|
366
|
+
})) : m.warning && !b(z) ? (g(), c(a, {
|
|
367
|
+
key: 1,
|
|
368
|
+
variant: "warning",
|
|
369
|
+
"icon-only": !0,
|
|
370
|
+
live: "off",
|
|
371
|
+
"aria-hidden": "true",
|
|
372
|
+
class: "nb-select__status-icon"
|
|
373
|
+
}, {
|
|
374
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
375
|
+
_: 1
|
|
376
|
+
})) : l("", !0),
|
|
377
|
+
$.value ? (g(), u("span", Ce)) : l("", !0),
|
|
378
|
+
p(i, {
|
|
379
|
+
align: "center",
|
|
380
|
+
justify: "center",
|
|
381
|
+
class: "nb-select__caret"
|
|
382
|
+
}, {
|
|
383
|
+
default: x(() => [p(n, {
|
|
384
|
+
name: k.value ? b(xe) : b(ye),
|
|
385
|
+
size: 16
|
|
386
|
+
}, null, 8, ["name"])]),
|
|
387
|
+
_: 1
|
|
388
|
+
})
|
|
389
|
+
], 40, Se), $.value ? (g(), c(e, {
|
|
390
|
+
key: 0,
|
|
391
|
+
variant: "ghost",
|
|
392
|
+
icon: b(be),
|
|
393
|
+
size: "xs",
|
|
394
|
+
label: ft.value,
|
|
395
|
+
class: "nb-select__clear",
|
|
396
|
+
onClick: pt,
|
|
397
|
+
onKeydown: [r[2] ||= S(C(() => {}, ["stop"]), ["enter"]), r[3] ||= S(C(() => {}, ["stop"]), ["space"])]
|
|
398
|
+
}, null, 8, ["icon", "label"])) : l("", !0)]),
|
|
399
|
+
_: 3
|
|
400
|
+
}, 8, ["wrap"]),
|
|
401
|
+
m.error && !b(z) ? (g(), c(a, {
|
|
402
|
+
id: b(B).error,
|
|
403
|
+
key: b(H),
|
|
404
|
+
variant: "error",
|
|
405
|
+
live: b(V),
|
|
406
|
+
class: "nb-select__message"
|
|
407
|
+
}, {
|
|
408
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
409
|
+
_: 1
|
|
410
|
+
}, 8, ["id", "live"])) : m.warning && !b(z) ? (g(), c(a, {
|
|
411
|
+
id: b(B).warning,
|
|
412
|
+
key: b(H),
|
|
413
|
+
variant: "warning",
|
|
414
|
+
live: b(V),
|
|
415
|
+
class: "nb-select__message"
|
|
416
|
+
}, {
|
|
417
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
418
|
+
_: 1
|
|
419
|
+
}, 8, ["id", "live"])) : m.helper && !b(z) ? (g(), c(a, {
|
|
420
|
+
id: b(B).helper,
|
|
421
|
+
key: b(H),
|
|
422
|
+
variant: "helper",
|
|
423
|
+
live: b(V),
|
|
424
|
+
class: "nb-select__message"
|
|
425
|
+
}, {
|
|
426
|
+
default: x(() => [f(y(m.helper), 1)]),
|
|
427
|
+
_: 1
|
|
428
|
+
}, 8, ["id", "live"])) : l("", !0)
|
|
429
|
+
], 64)) : m.variant === "fluid" ? (g(), u(o, { key: 2 }, [p(E, { wrap: m.clearable }, {
|
|
430
|
+
default: x(() => [d("button", {
|
|
431
|
+
id: b(L),
|
|
432
|
+
ref_key: "triggerRef",
|
|
433
|
+
ref: N,
|
|
434
|
+
type: "button",
|
|
435
|
+
class: "nb-select__trigger",
|
|
436
|
+
role: "combobox",
|
|
437
|
+
"aria-expanded": k.value,
|
|
438
|
+
"aria-haspopup": "listbox",
|
|
439
|
+
"aria-controls": k.value ? U.value : void 0,
|
|
440
|
+
"aria-activedescendant": et.value,
|
|
441
|
+
"aria-disabled": b(R) || void 0,
|
|
442
|
+
"aria-required": m.required || void 0,
|
|
443
|
+
"aria-invalid": Ze.value,
|
|
444
|
+
"aria-describedby": Xe.value,
|
|
445
|
+
disabled: b(R) || void 0,
|
|
446
|
+
onClick: Y,
|
|
447
|
+
onFocus: r[4] ||= (e) => A.value = !0,
|
|
448
|
+
onBlur: r[5] ||= (e) => A.value = !1
|
|
449
|
+
}, [(m.label || t.$slots.label) && !b(z) ? (g(), c(i, {
|
|
450
|
+
key: 0,
|
|
451
|
+
dir: "row",
|
|
452
|
+
align: "center",
|
|
453
|
+
gap: "xs",
|
|
454
|
+
class: "nb-select__inner-header"
|
|
455
|
+
}, {
|
|
456
|
+
default: x(() => [t.$slots.label ? v(t.$slots, "label", { key: 0 }) : (g(), u("label", Te, [f(y(m.label) + " ", 1), m.required ? (g(), u("span", Ee, "*")) : l("", !0)])), m.helper && !m.error && !m.warning ? (g(), c(a, {
|
|
457
|
+
key: 2,
|
|
458
|
+
id: b(B).helper,
|
|
459
|
+
variant: "helper",
|
|
460
|
+
"icon-only": !0,
|
|
461
|
+
live: "off",
|
|
462
|
+
"aria-hidden": "true",
|
|
463
|
+
class: "nb-select__inner-message"
|
|
464
|
+
}, {
|
|
465
|
+
default: x(() => [f(y(m.helper), 1)]),
|
|
466
|
+
_: 1
|
|
467
|
+
}, 8, ["id"])) : l("", !0)]),
|
|
468
|
+
_: 3
|
|
469
|
+
})) : l("", !0), p(i, {
|
|
470
|
+
dir: "row",
|
|
471
|
+
align: "end",
|
|
472
|
+
flex: "",
|
|
473
|
+
class: "nb-select__value-row"
|
|
474
|
+
}, {
|
|
475
|
+
default: x(() => [
|
|
476
|
+
d("span", { class: h(["nb-select__value", {
|
|
477
|
+
"nb-select__value--placeholder": !K.value,
|
|
478
|
+
"nb-select__value--with-icon": !!G.value
|
|
479
|
+
}]) }, [G.value ? (g(), c(n, {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: "nb-select__value-icon",
|
|
482
|
+
name: G.value,
|
|
483
|
+
size: 16
|
|
484
|
+
}, null, 8, ["name"])) : l("", !0), K.value ? v(t.$slots, "value", {
|
|
485
|
+
key: 1,
|
|
486
|
+
values: W.value
|
|
487
|
+
}, () => [f(y(K.value), 1)]) : (g(), u(o, { key: 2 }, [f(y(m.placeholder), 1)], 64))], 2),
|
|
488
|
+
$.value ? (g(), u("span", De)) : l("", !0),
|
|
489
|
+
p(i, {
|
|
490
|
+
align: "center",
|
|
491
|
+
justify: "center",
|
|
492
|
+
class: "nb-select__caret"
|
|
493
|
+
}, {
|
|
494
|
+
default: x(() => [p(n, {
|
|
495
|
+
name: k.value ? b(xe) : b(ye),
|
|
496
|
+
size: 16
|
|
497
|
+
}, null, 8, ["name"])]),
|
|
498
|
+
_: 1
|
|
499
|
+
})
|
|
500
|
+
]),
|
|
501
|
+
_: 3
|
|
502
|
+
})], 40, we), $.value ? (g(), c(e, {
|
|
503
|
+
key: 0,
|
|
504
|
+
variant: "ghost",
|
|
505
|
+
icon: b(be),
|
|
506
|
+
size: "xs",
|
|
507
|
+
label: ft.value,
|
|
508
|
+
class: "nb-select__clear",
|
|
509
|
+
onClick: pt,
|
|
510
|
+
onKeydown: [r[6] ||= S(C(() => {}, ["stop"]), ["enter"]), r[7] ||= S(C(() => {}, ["stop"]), ["space"])]
|
|
511
|
+
}, null, 8, ["icon", "label"])) : l("", !0)]),
|
|
512
|
+
_: 3
|
|
513
|
+
}, 8, ["wrap"]), m.error && !b(z) ? (g(), c(a, {
|
|
514
|
+
id: b(B).error,
|
|
515
|
+
key: b(H),
|
|
516
|
+
variant: "error",
|
|
517
|
+
live: b(V),
|
|
518
|
+
class: "nb-select__fluid-message"
|
|
519
|
+
}, {
|
|
520
|
+
default: x(() => [f(y(m.error), 1)]),
|
|
521
|
+
_: 1
|
|
522
|
+
}, 8, ["id", "live"])) : m.warning && !b(z) ? (g(), c(a, {
|
|
523
|
+
id: b(B).warning,
|
|
524
|
+
key: b(H),
|
|
525
|
+
variant: "warning",
|
|
526
|
+
live: b(V),
|
|
527
|
+
class: "nb-select__fluid-message"
|
|
528
|
+
}, {
|
|
529
|
+
default: x(() => [f(y(m.warning), 1)]),
|
|
530
|
+
_: 1
|
|
531
|
+
}, 8, ["id", "live"])) : l("", !0)], 64)) : l("", !0)], 16), (g(), c(ae, {
|
|
532
|
+
to: "body",
|
|
533
|
+
disabled: !b(He)
|
|
534
|
+
}, [p(oe, { name: "nb-select-pop" }, {
|
|
535
|
+
default: x(() => [k.value ? (g(), u("div", {
|
|
536
|
+
key: 0,
|
|
537
|
+
id: U.value,
|
|
538
|
+
ref_key: "dropdownRef",
|
|
539
|
+
ref: F,
|
|
540
|
+
class: h(["nb-select__dropdown", {
|
|
541
|
+
"nb-select__dropdown--check": m.selectedMark === "check",
|
|
542
|
+
"nb-select__dropdown--anchored": !!t.$slots.trigger
|
|
543
|
+
}]),
|
|
544
|
+
style: de(qe.value),
|
|
545
|
+
role: "listbox",
|
|
546
|
+
"aria-multiselectable": m.multiple || void 0
|
|
547
|
+
}, [
|
|
548
|
+
m.searchable ? (g(), u("div", ke, [ve(d("input", {
|
|
549
|
+
ref_key: "searchRef",
|
|
550
|
+
ref: Ue,
|
|
551
|
+
"onUpdate:modelValue": r[8] ||= (e) => O.value = e,
|
|
552
|
+
type: "search",
|
|
553
|
+
class: "nb-select__search-input",
|
|
554
|
+
autocomplete: "off",
|
|
555
|
+
spellcheck: "false",
|
|
556
|
+
placeholder: m.searchPlaceholder,
|
|
557
|
+
"aria-label": m.searchPlaceholder,
|
|
558
|
+
"aria-controls": U.value,
|
|
559
|
+
"aria-activedescendant": j.value >= 0 ? $e(j.value) : void 0,
|
|
560
|
+
onKeydown: lt
|
|
561
|
+
}, null, 40, Ae), [[ge, O.value]])])) : l("", !0),
|
|
562
|
+
(g(!0), u(o, null, pe(it.value, (e) => (g(), u("div", {
|
|
563
|
+
key: e.key,
|
|
564
|
+
class: "nb-select__group",
|
|
565
|
+
role: "group",
|
|
566
|
+
"aria-labelledby": e.name ? e.labelId : void 0
|
|
567
|
+
}, [e.name ? (g(), u("div", {
|
|
568
|
+
key: 0,
|
|
569
|
+
id: e.labelId,
|
|
570
|
+
class: "nb-select__group-label"
|
|
571
|
+
}, y(e.name), 9, Me)) : l("", !0), (g(!0), u(o, null, pe(e.entries, (e) => (g(), u("div", {
|
|
572
|
+
id: $e(e.index),
|
|
573
|
+
key: e.option.value,
|
|
574
|
+
"data-index": e.index,
|
|
575
|
+
class: h(["nb-select__option", {
|
|
576
|
+
"nb-select__option--selected": tt(e.option.value),
|
|
577
|
+
"nb-select__option--highlighted": j.value === e.index,
|
|
578
|
+
"nb-select__option--disabled": e.option.disabled
|
|
579
|
+
}]),
|
|
580
|
+
role: "option",
|
|
581
|
+
"aria-selected": tt(e.option.value),
|
|
582
|
+
"aria-disabled": e.option.disabled || void 0,
|
|
583
|
+
onMouseenter: (t) => j.value = e.index,
|
|
584
|
+
onClick: (t) => ot(e.option)
|
|
585
|
+
}, [
|
|
586
|
+
m.multiple || m.selectedMark === "check" ? (g(), u("span", Pe, [tt(e.option.value) ? (g(), u("svg", Fe, [...r[12] ||= [d("path", {
|
|
587
|
+
d: "M1 4l3 3 5-6",
|
|
588
|
+
stroke: "currentColor",
|
|
589
|
+
"stroke-width": "1.5",
|
|
590
|
+
"stroke-linecap": "round",
|
|
591
|
+
"stroke-linejoin": "round"
|
|
592
|
+
}, null, -1)]])) : l("", !0)])) : l("", !0),
|
|
593
|
+
e.option.icon ? (g(), c(n, {
|
|
594
|
+
key: 1,
|
|
595
|
+
class: "nb-select__option-icon",
|
|
596
|
+
name: e.option.icon,
|
|
597
|
+
size: 16
|
|
598
|
+
}, null, 8, ["name"])) : l("", !0),
|
|
599
|
+
d("span", Ie, [v(t.$slots, "option", { option: e.option }, () => [f(y(e.option.label), 1)])])
|
|
600
|
+
], 42, Ne))), 128))], 8, je))), 128)),
|
|
601
|
+
!m.options || m.options.length === 0 ? (g(), u("div", Le, " No options ")) : m.searchable && rt.value.size === 0 ? (g(), u("div", Re, y(m.noResultsLabel), 1)) : l("", !0),
|
|
602
|
+
m.creatable ? (g(), u("div", {
|
|
603
|
+
key: 3,
|
|
604
|
+
class: "nb-select__create",
|
|
605
|
+
onMousedown: r[11] ||= C(() => {}, ["prevent"])
|
|
606
|
+
}, [ve(d("input", {
|
|
607
|
+
"onUpdate:modelValue": r[9] ||= (e) => D.value = e,
|
|
608
|
+
type: "text",
|
|
609
|
+
class: "nb-select__create-input",
|
|
610
|
+
placeholder: m.createPlaceholder || "Add new…",
|
|
611
|
+
onKeydown: [S(C(We, ["prevent"]), ["enter"]), r[10] ||= C(() => {}, ["stop"])]
|
|
612
|
+
}, null, 40, ze), [[ge, D.value]])], 32)) : l("", !0)
|
|
613
|
+
], 14, Oe)) : l("", !0)]),
|
|
614
|
+
_: 3
|
|
615
|
+
})], 8, ["disabled"]))], 64));
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
//#endregion
|
|
619
|
+
export { Be as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./composables/useTeleportReady.composable.cjs`),n=require(`./Icon-CssV4E2-.cjs`),r=require(`./composables/useNbStrings.composable.cjs`),i=require(`./Grid-tn5_R2fP.cjs`),a=require(`./Label-CjxnZgNy.cjs`),o=require(`./Message-B1CQ0Bcf.cjs`),s=require(`./InputGroup.context-BHj-IvcT.cjs`),c=require(`./composables/useFieldMessage.composable.cjs`),ee=require(`./composables/useMenuSurface.composable.cjs`);let l=require(`vue`),te=require(`@nubisco/ui/icons/caret-down`),u=require(`@nubisco/ui/icons/x`),d=require(`@nubisco/ui/icons/caret-up`);var ne=[`id`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`aria-disabled`,`aria-required`,`aria-invalid`,`aria-describedby`,`disabled`],re={key:2,class:`nb-select__clear-space`,"aria-hidden":`true`},ie=[`id`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`aria-disabled`,`aria-required`,`aria-invalid`,`aria-describedby`,`disabled`],ae={key:1,class:`nb-select__inner-label`},oe={key:0,class:`nb-select__asterisk`,"aria-hidden":`true`},se={key:0,class:`nb-select__clear-space`,"aria-hidden":`true`},ce=[`id`,`aria-multiselectable`],le={key:0,class:`nb-select__search`},ue=[`placeholder`,`aria-label`,`aria-controls`,`aria-activedescendant`],de=[`aria-labelledby`],fe=[`id`],pe=[`id`,`data-index`,`aria-selected`,`aria-disabled`,`onMouseenter`,`onClick`],me={key:0,class:`nb-select__option-check`,"aria-hidden":`true`},he={key:0,viewBox:`0 0 10 8`,fill:`none`,width:`10`,height:`8`},ge={class:`nb-select__option-label`},_e={key:1,class:`nb-select__empty`},ve={key:2,class:`nb-select__empty`},ye=[`placeholder`,`onKeydown`],f=(0,l.defineComponent)({inheritAttrs:!1,__name:`Select`,props:{modelValue:{default:null},options:{default:()=>[]},multiple:{type:Boolean,default:!1},creatable:{type:Boolean,default:!1},createPlaceholder:{default:``},clearable:{type:Boolean,default:!1},clearLabel:{default:void 0},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`Search`},noResultsLabel:{default:`No results`},anchor:{type:[Function,null],default:null},selectedMark:{default:`fill`},placeholder:{default:`Select…`},name:{default:``},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{default:void 0},label:{default:``},error:{default:``},warning:{default:``},helper:{default:``},variant:{default:`default`},size:{default:`md`}},emits:[`update:modelValue`,`change`,`create`],setup(f,{expose:be,emit:xe}){let Se=t.useTeleportReady(),p=f,m=xe,h=(e,{slots:t})=>e.wrap?(0,l.h)(`div`,{class:`nb-select__control`},t.default?.()):t.default?.();h.props=[`wrap`];let g=(0,l.ref)(``),_=(0,l.ref)(``),Ce=(0,l.ref)(null);function we(){let e=g.value.trim();e&&(m(`create`,e),g.value=``)}let v=(0,l.ref)(!1),y=(0,l.ref)(!1),b=(0,l.ref)(-1),x=(0,l.ref)(null),S=(0,l.ref)(null),C=(0,l.useSlots)(),Te=()=>(typeof p.anchor==`function`?p.anchor():p.anchor)??S.value??x.value;function Ee(){(S.value??x.value?.querySelector(`button, [tabindex]`))?.focus()}let w=(0,l.ref)(null);ee.useMenuSurface(w);let T=(0,l.ref)({position:`fixed`,top:`0px`,left:`0px`,width:`0px`,zIndex:`9999`}),E=s.n(p,`nb-select-${(0,l.useId)()}`),D=E.id,O=E.disabled,k=E.grouped,{ids:A,messageId:De,invalid:j,live:M,key:N}=c.useFieldMessage(p,D),P=(0,l.computed)(()=>c.joinDescribedBy(k?void 0:De.value,E.describedBy.value)),F=(0,l.computed)(()=>j.value??(E.status.value===`error`?`true`:void 0)),I=(0,l.computed)(()=>!k&&!!p.error||E.status.value===`error`),L=(0,l.computed)(()=>`${D.value}-listbox`),R=e=>`${D.value}-option-${e}`,z=(0,l.computed)(()=>v.value&&!p.searchable&&b.value>=0?R(b.value):void 0),B=(0,l.computed)(()=>p.modelValue==null?[]:Array.isArray(p.modelValue)?p.modelValue:[p.modelValue]),V=(0,l.computed)(()=>{if(!(p.multiple||B.value.length!==1))return(p.options??[]).find(e=>e.value===B.value[0])?.icon}),H=(0,l.computed)(()=>{if(B.value.length===0)return``;let e=p.options??[];return p.multiple?B.value.length===1?e.find(e=>e.value===B.value[0])?.label??String(B.value[0]):B.value.length===2?B.value.map(t=>e.find(e=>e.value===t)?.label??String(t)).join(`, `):`${B.value.length} selected`:e.find(e=>e.value===B.value[0])?.label??String(B.value[0])});function U(e){return B.value.includes(e)}let Oe=e=>e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase(),W=(0,l.computed)(()=>{let e=p.options??[],t=p.searchable?Oe(_.value.trim()):``,n=new Set;return e.forEach((e,r)=>{(!t||Oe(e.label).includes(t))&&n.add(r)}),n}),ke=(0,l.computed)(()=>{let e=[];return(p.options??[]).forEach((t,n)=>{if(!W.value.has(n))return;let r=e[e.length-1];(!r||r.name!==t.group)&&e.push({key:`${e.length}:${t.group??``}`,name:t.group,labelId:`${D.value}-group-${e.length}`,entries:[]}),e[e.length-1].entries.push({option:t,index:n})}),e});function G(e,t){let n=p.options??[];for(let r=e+t;r>=0&&r<n.length;r+=t)if(!n[r].disabled&&W.value.has(r))return r;return e}function Ae(e){if(e.disabled)return;let t;if(p.multiple){let n=[...B.value],r=n.indexOf(e.value);r>=0?n.splice(r,1):n.push(e.value),t=n}else t=e.value,J();m(`update:modelValue`,t),m(`change`,t)}function K(){let e=Te();if(!e)return;let t=e.getBoundingClientRect(),n=w.value?.offsetHeight??0,r=window.innerHeight-t.bottom,i=t.top,a=n>0&&r<n&&i>r,o=C.trigger?Math.max(t.width,240):t.width,s=C.trigger?Math.max(8,Math.min(t.left,window.innerWidth-o-8)):t.left;T.value={position:`fixed`,top:a?`${t.top-n}px`:`${t.bottom}px`,left:`${s}px`,width:`${o}px`,zIndex:`9999`}}function q(){if(O.value)return;v.value=!0,K();let e=p.options??[];b.value=B.value.length>0?Math.max(0,e.findIndex(e=>e.value===B.value[0])):-1,(0,l.nextTick)(()=>{K(),Q(),Ce.value?.focus({preventScroll:!0})})}function J(){let e=!!w.value?.contains(document.activeElement);v.value=!1,b.value=-1,_.value=``,e&&Ee()}function Y(){v.value?J():q()}function X(e){let t=e.target,n=x.value?.contains(t)??!1,r=w.value?.contains(t)??!1;!n&&!r&&J()}function Z(){v.value&&K()}(0,l.watch)(v,e=>{e?(document.addEventListener(`mousedown`,X),window.addEventListener(`scroll`,Z,!0),window.addEventListener(`resize`,Z)):(document.removeEventListener(`mousedown`,X),window.removeEventListener(`scroll`,Z,!0),window.removeEventListener(`resize`,Z))}),(0,l.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,X),window.removeEventListener(`scroll`,Z,!0),window.removeEventListener(`resize`,Z)});function je(e){let t=p.options??[];if(!v.value){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),q());return}e.key===`Escape`?(J(),e.preventDefault()):e.key===`Tab`?J():e.key===`ArrowDown`?(e.preventDefault(),b.value=G(b.value,1),Q()):e.key===`ArrowUp`?(e.preventDefault(),b.value>0&&(b.value=G(b.value,-1)),Q()):(e.key===`Enter`||e.key===` `)&&b.value>=0&&(e.preventDefault(),Ae(t[b.value]))}function Q(){(0,l.nextTick)(()=>{!w.value||b.value<0||w.value.querySelector(`[data-index="${b.value}"]`)?.scrollIntoView({block:`nearest`})})}(0,l.watch)(_,()=>{if(!v.value)return;let e=G(-1,1);b.value=e===-1?-1:e,Q()});function Me(e){if(e.key===` `){e.stopPropagation();return}if(e.key===`Home`||e.key===`End`){e.stopPropagation();return}je(e)}let Ne=(0,l.computed)(()=>({isOpen:v.value,toggle:Y,open:q,close:J,attrs:{"aria-expanded":v.value,"aria-haspopup":`listbox`,"aria-controls":v.value?L.value:void 0,"aria-activedescendant":z.value,"aria-invalid":j.value,onClick:Y}})),Pe=r.useNbStrings(),Fe=(0,l.computed)(()=>p.clearLabel??Pe.value.selectClear),$=(0,l.computed)(()=>p.clearable&&!O.value&&B.value.length>0);function Ie(){let e=p.multiple?[]:null;J(),m(`update:modelValue`,e),m(`change`,e),Ee()}let Le=(0,l.computed)(()=>[`nb-select`,`nb-select--${p.variant}`,`nb-select--${E.size.value}`,{"nb-select--open":v.value,"nb-select--focused":y.value&&!v.value,"nb-select--error":I.value,"nb-select--warning":!I.value&&(!k&&!!p.warning||E.status.value===`warning`),"nb-select--multiple":p.multiple,"nb-select--bare":!!C.trigger}]);return be({open:q,close:J}),(t,r)=>((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,null,[(0,l.createElementVNode)(`div`,(0,l.mergeProps)({ref_key:`rootRef`,ref:x},t.$attrs,{class:Le.value,onKeydown:je}),[t.$slots.trigger?(0,l.renderSlot)(t.$slots,`trigger`,(0,l.normalizeProps)((0,l.mergeProps)({key:0},Ne.value))):f.variant===`default`?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:1},[t.$slots.label&&!(0,l.unref)(k)?(0,l.renderSlot)(t.$slots,`label`,{key:0}):f.label&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(a.t,{key:1,for:(0,l.unref)(D),required:f.required,disabled:(0,l.unref)(O)},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.label),1)]),_:1},8,[`for`,`required`,`disabled`])):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(h,{wrap:f.clearable},{default:(0,l.withCtx)(()=>[(0,l.createElementVNode)(`button`,{id:(0,l.unref)(D),ref_key:`triggerRef`,ref:S,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":v.value,"aria-haspopup":`listbox`,"aria-controls":v.value?L.value:void 0,"aria-activedescendant":z.value,"aria-disabled":(0,l.unref)(O)||void 0,"aria-required":f.required||void 0,"aria-invalid":F.value,"aria-describedby":P.value,disabled:(0,l.unref)(O)||void 0,onClick:Y,onFocus:r[0]||=e=>y.value=!0,onBlur:r[1]||=e=>y.value=!1},[(0,l.createElementVNode)(`span`,{class:(0,l.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!H.value,"nb-select__value--with-icon":!!V.value}])},[V.value?((0,l.openBlock)(),(0,l.createBlock)(n.t,{key:0,class:`nb-select__value-icon`,name:V.value,size:16},null,8,[`name`])):(0,l.createCommentVNode)(``,!0),H.value?(0,l.renderSlot)(t.$slots,`value`,{key:1,values:B.value},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(H.value),1)]):((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:2},[(0,l.createTextVNode)((0,l.toDisplayString)(f.placeholder),1)],64))],2),f.error&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{key:0,variant:`error`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__status-icon`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.error),1)]),_:1})):f.warning&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{key:1,variant:`warning`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__status-icon`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.warning),1)]),_:1})):(0,l.createCommentVNode)(``,!0),$.value?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,re)):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(i.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,l.withCtx)(()=>[(0,l.createVNode)(n.t,{name:v.value?(0,l.unref)(d.regular):(0,l.unref)(te.regular),size:16},null,8,[`name`])]),_:1})],40,ne),$.value?((0,l.openBlock)(),(0,l.createBlock)(e.t,{key:0,variant:`ghost`,icon:(0,l.unref)(u.regular),size:`xs`,label:Fe.value,class:`nb-select__clear`,onClick:Ie,onKeydown:[r[2]||=(0,l.withKeys)((0,l.withModifiers)(()=>{},[`stop`]),[`enter`]),r[3]||=(0,l.withKeys)((0,l.withModifiers)(()=>{},[`stop`]),[`space`])]},null,8,[`icon`,`label`])):(0,l.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),f.error&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{id:(0,l.unref)(A).error,key:(0,l.unref)(N),variant:`error`,live:(0,l.unref)(M),class:`nb-select__message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.error),1)]),_:1},8,[`id`,`live`])):f.warning&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{id:(0,l.unref)(A).warning,key:(0,l.unref)(N),variant:`warning`,live:(0,l.unref)(M),class:`nb-select__message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.warning),1)]),_:1},8,[`id`,`live`])):f.helper&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{id:(0,l.unref)(A).helper,key:(0,l.unref)(N),variant:`helper`,live:(0,l.unref)(M),class:`nb-select__message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.helper),1)]),_:1},8,[`id`,`live`])):(0,l.createCommentVNode)(``,!0)],64)):f.variant===`fluid`?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:2},[(0,l.createVNode)(h,{wrap:f.clearable},{default:(0,l.withCtx)(()=>[(0,l.createElementVNode)(`button`,{id:(0,l.unref)(D),ref_key:`triggerRef`,ref:S,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":v.value,"aria-haspopup":`listbox`,"aria-controls":v.value?L.value:void 0,"aria-activedescendant":z.value,"aria-disabled":(0,l.unref)(O)||void 0,"aria-required":f.required||void 0,"aria-invalid":F.value,"aria-describedby":P.value,disabled:(0,l.unref)(O)||void 0,onClick:Y,onFocus:r[4]||=e=>y.value=!0,onBlur:r[5]||=e=>y.value=!1},[(f.label||t.$slots.label)&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(i.t,{key:0,dir:`row`,align:`center`,gap:`xs`,class:`nb-select__inner-header`},{default:(0,l.withCtx)(()=>[t.$slots.label?(0,l.renderSlot)(t.$slots,`label`,{key:0}):((0,l.openBlock)(),(0,l.createElementBlock)(`label`,ae,[(0,l.createTextVNode)((0,l.toDisplayString)(f.label)+` `,1),f.required?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,oe,`*`)):(0,l.createCommentVNode)(``,!0)])),f.helper&&!f.error&&!f.warning?((0,l.openBlock)(),(0,l.createBlock)(o.t,{key:2,id:(0,l.unref)(A).helper,variant:`helper`,"icon-only":!0,live:`off`,"aria-hidden":`true`,class:`nb-select__inner-message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.helper),1)]),_:1},8,[`id`])):(0,l.createCommentVNode)(``,!0)]),_:3})):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(i.t,{dir:`row`,align:`end`,flex:``,class:`nb-select__value-row`},{default:(0,l.withCtx)(()=>[(0,l.createElementVNode)(`span`,{class:(0,l.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!H.value,"nb-select__value--with-icon":!!V.value}])},[V.value?((0,l.openBlock)(),(0,l.createBlock)(n.t,{key:0,class:`nb-select__value-icon`,name:V.value,size:16},null,8,[`name`])):(0,l.createCommentVNode)(``,!0),H.value?(0,l.renderSlot)(t.$slots,`value`,{key:1,values:B.value},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(H.value),1)]):((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:2},[(0,l.createTextVNode)((0,l.toDisplayString)(f.placeholder),1)],64))],2),$.value?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,se)):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(i.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,l.withCtx)(()=>[(0,l.createVNode)(n.t,{name:v.value?(0,l.unref)(d.regular):(0,l.unref)(te.regular),size:16},null,8,[`name`])]),_:1})]),_:3})],40,ie),$.value?((0,l.openBlock)(),(0,l.createBlock)(e.t,{key:0,variant:`ghost`,icon:(0,l.unref)(u.regular),size:`xs`,label:Fe.value,class:`nb-select__clear`,onClick:Ie,onKeydown:[r[6]||=(0,l.withKeys)((0,l.withModifiers)(()=>{},[`stop`]),[`enter`]),r[7]||=(0,l.withKeys)((0,l.withModifiers)(()=>{},[`stop`]),[`space`])]},null,8,[`icon`,`label`])):(0,l.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),f.error&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{id:(0,l.unref)(A).error,key:(0,l.unref)(N),variant:`error`,live:(0,l.unref)(M),class:`nb-select__fluid-message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.error),1)]),_:1},8,[`id`,`live`])):f.warning&&!(0,l.unref)(k)?((0,l.openBlock)(),(0,l.createBlock)(o.t,{id:(0,l.unref)(A).warning,key:(0,l.unref)(N),variant:`warning`,live:(0,l.unref)(M),class:`nb-select__fluid-message`},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(f.warning),1)]),_:1},8,[`id`,`live`])):(0,l.createCommentVNode)(``,!0)],64)):(0,l.createCommentVNode)(``,!0)],16),((0,l.openBlock)(),(0,l.createBlock)(l.Teleport,{to:`body`,disabled:!(0,l.unref)(Se)},[(0,l.createVNode)(l.Transition,{name:`nb-select-pop`},{default:(0,l.withCtx)(()=>[v.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,id:L.value,ref_key:`dropdownRef`,ref:w,class:(0,l.normalizeClass)([`nb-select__dropdown`,{"nb-select__dropdown--check":f.selectedMark===`check`,"nb-select__dropdown--anchored":!!t.$slots.trigger}]),style:(0,l.normalizeStyle)(T.value),role:`listbox`,"aria-multiselectable":f.multiple||void 0},[f.searchable?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,le,[(0,l.withDirectives)((0,l.createElementVNode)(`input`,{ref_key:`searchRef`,ref:Ce,"onUpdate:modelValue":r[8]||=e=>_.value=e,type:`search`,class:`nb-select__search-input`,autocomplete:`off`,spellcheck:`false`,placeholder:f.searchPlaceholder,"aria-label":f.searchPlaceholder,"aria-controls":L.value,"aria-activedescendant":b.value>=0?R(b.value):void 0,onKeydown:Me},null,40,ue),[[l.vModelText,_.value]])])):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(ke.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:e.key,class:`nb-select__group`,role:`group`,"aria-labelledby":e.name?e.labelId:void 0},[e.name?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,id:e.labelId,class:`nb-select__group-label`},(0,l.toDisplayString)(e.name),9,fe)):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(e.entries,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{id:R(e.index),key:e.option.value,"data-index":e.index,class:(0,l.normalizeClass)([`nb-select__option`,{"nb-select__option--selected":U(e.option.value),"nb-select__option--highlighted":b.value===e.index,"nb-select__option--disabled":e.option.disabled}]),role:`option`,"aria-selected":U(e.option.value),"aria-disabled":e.option.disabled||void 0,onMouseenter:t=>b.value=e.index,onClick:t=>Ae(e.option)},[f.multiple||f.selectedMark===`check`?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,me,[U(e.option.value)?((0,l.openBlock)(),(0,l.createElementBlock)(`svg`,he,[...r[12]||=[(0,l.createElementVNode)(`path`,{d:`M1 4l3 3 5-6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(0,l.createCommentVNode)(``,!0)])):(0,l.createCommentVNode)(``,!0),e.option.icon?((0,l.openBlock)(),(0,l.createBlock)(n.t,{key:1,class:`nb-select__option-icon`,name:e.option.icon,size:16},null,8,[`name`])):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`span`,ge,[(0,l.renderSlot)(t.$slots,`option`,{option:e.option},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.option.label),1)])])],42,pe))),128))],8,de))),128)),!f.options||f.options.length===0?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,_e,` No options `)):f.searchable&&W.value.size===0?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,ve,(0,l.toDisplayString)(f.noResultsLabel),1)):(0,l.createCommentVNode)(``,!0),f.creatable?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:3,class:`nb-select__create`,onMousedown:r[11]||=(0,l.withModifiers)(()=>{},[`prevent`])},[(0,l.withDirectives)((0,l.createElementVNode)(`input`,{"onUpdate:modelValue":r[9]||=e=>g.value=e,type:`text`,class:`nb-select__create-input`,placeholder:f.createPlaceholder||`Add new…`,onKeydown:[(0,l.withKeys)((0,l.withModifiers)(we,[`prevent`]),[`enter`]),r[10]||=(0,l.withModifiers)(()=>{},[`stop`])]},null,40,ye),[[l.vModelText,g.value]])],32)):(0,l.createCommentVNode)(``,!0)],14,ce)):(0,l.createCommentVNode)(``,!0)]),_:3})],8,[`disabled`]))],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./vue-i18n-DgCNp5tk.js";
|
|
2
|
-
import { t } from "./SidebarMenuItem-
|
|
2
|
+
import { t } from "./SidebarMenuItem-E410HTei.js";
|
|
3
3
|
import { computed as n, createBlock as r, defineComponent as i, inject as a, openBlock as o, ref as s } from "vue";
|
|
4
4
|
import * as c from "@nubisco/ui/icons/caret-line-left";
|
|
5
5
|
import * as l from "@nubisco/ui/icons/caret-line-right";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./vue-i18n-BaeznwnA.cjs`),n=require(`./SidebarMenuItem-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./vue-i18n-BaeznwnA.cjs`),n=require(`./SidebarMenuItem-DzJ_R2__.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/caret-line-left`);i=e.n(i);let a=require(`@nubisco/ui/icons/caret-line-right`);a=e.n(a);var o=(0,r.defineComponent)({__name:`SidebarCollapseToggle`,props:{collapseLabel:{default:void 0},expandLabel:{default:void 0}},emits:[`toggle`],setup(e,{emit:o}){let s=e,c=o,l=(0,r.inject)(`nb-shell-sidebar-variant`,(0,r.ref)(`verbose`)),u=(0,r.computed)(()=>l.value===`compact`),d={en:{COLLAPSE:`Collapse sidebar`,EXPAND:`Expand sidebar`},pt:{COLLAPSE:`Recolher barra lateral`,EXPAND:`Expandir barra lateral`}};function f(){try{return t.t({useScope:`global`})}catch{return null}}let p=f();function m(e){let t=`sidebarCollapseToggle.${e}`;return p?.te(t)?p.t(t):d[String(p?.locale.value??`en`).toLowerCase().split(`-`)[0]]?.[e]??d.en[e]}let h=(0,r.computed)(()=>u.value?s.expandLabel??m(`EXPAND`):s.collapseLabel??m(`COLLAPSE`));return(e,t)=>((0,r.openBlock)(),(0,r.createBlock)(n.t,{class:`nb-sidebar-collapse-toggle`,label:h.value,icon:u.value?a:i,onClick:t[0]||=e=>c(`toggle`)},null,8,[`label`,`icon`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|