@nubisco/ui 5.39.0 → 5.40.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/{AiProvider-CzcMQh78.cjs → AiProvider-BaZBbtJz.cjs} +1 -1
- package/dist/{AiProvider-BUU8NJPa.js → AiProvider-_ZQ9C9k3.js} +1 -1
- package/dist/Breadcrumbs-B1dTOa2c.js +145 -0
- package/dist/Breadcrumbs-BQCRa6zF.cjs +1 -0
- package/dist/{Pagination-ZYbBPdqi.js → Pagination-Dk2C7ktz.js} +1 -1
- package/dist/{Pagination-DxpwnXrE.cjs → Pagination-XOtOT86P.cjs} +1 -1
- package/dist/Select-CnieTPOL.cjs +1 -0
- package/dist/Select-cEKAoY4x.js +573 -0
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +4 -4
- package/dist/component-styles.json +3 -0
- package/dist/components/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.d.ts +41 -0
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Breadcrumbs.vue.d.ts +5 -3
- package/dist/components/Breadcrumbs.vue.d.ts.map +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.d.ts +14 -0
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts +24 -8
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/UserMenu.vue.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/Breadcrumbs.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/ui.css +2 -2
- package/package.json +1 -1
- package/dist/Breadcrumbs-C5X5ZRsC.js +0 -90
- package/dist/Breadcrumbs-D6STDCnD.cjs +0 -1
- package/dist/Select-CNetl2JU.js +0 -548
- package/dist/Select-Dz5XXNrc.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-B-8ikYRN.cjs`),t=require(`./AiLabel-BK3oecvT.cjs`),n=require(`./Field-C7JxGz6g.cjs`),r=require(`./Panel-DKp-aPUn.cjs`),i=require(`./Select-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-B-8ikYRN.cjs`),t=require(`./AiLabel-BK3oecvT.cjs`),n=require(`./Field-C7JxGz6g.cjs`),r=require(`./Panel-DKp-aPUn.cjs`),i=require(`./Select-CnieTPOL.cjs`),a=require(`./TextInput-IAk1KYb5.cjs`);let o=require(`vue`);var s={class:`nb-ai-provider__header`},c={class:`nb-ai-provider__title`},l={key:0,class:`nb-ai-provider__description`},u={class:`nb-ai-provider__row`},d={class:`nb-ai-provider__actions`},f=(0,o.defineComponent)({__name:`AiProvider`,props:{title:{default:`AI briefings`},providers:{default:()=>[{label:`Anthropic (Claude)`,value:`anthropic`},{label:`OpenAI`,value:`openai`},{label:`Google Gemini`,value:`gemini`}]},provider:{default:`anthropic`},model:{default:``},apiKey:{default:``},defaultModels:{default:()=>({})},hasKey:{type:Boolean,default:!1},busy:{type:Boolean,default:!1}},emits:[`update:provider`,`update:model`,`update:apiKey`,`save`,`remove`],setup(f,{emit:p}){let m=p;return(p,h)=>((0,o.openBlock)(),(0,o.createBlock)(r.t,{class:`nb-ai-provider`},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`header`,s,[(0,o.createElementVNode)(`h2`,c,[(0,o.createTextVNode)((0,o.toDisplayString)(f.title)+` `,1),(0,o.createVNode)(t.t,{static:``,size:`sm`})]),p.$slots.default?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,l,[(0,o.renderSlot)(p.$slots,`default`)])):(0,o.createCommentVNode)(``,!0)]),(0,o.createElementVNode)(`div`,u,[(0,o.createVNode)(n.t,{label:`Provider`,orientation:`stack`},{default:(0,o.withCtx)(({id:e})=>[(0,o.createVNode)(i.t,{id:e,"model-value":f.provider,options:f.providers,disabled:f.busy,"onUpdate:modelValue":h[0]||=e=>m(`update:provider`,String(e))},null,8,[`id`,`model-value`,`options`,`disabled`])]),_:1}),(0,o.createVNode)(n.t,{label:`Model`,hint:`Empty uses the provider's default.`,orientation:`stack`},{default:(0,o.withCtx)(({id:e})=>[(0,o.createVNode)(a.t,{id:e,"model-value":f.model,placeholder:f.defaultModels[f.provider]??``,disabled:f.busy,"onUpdate:modelValue":h[1]||=e=>m(`update:model`,String(e??``))},null,8,[`id`,`model-value`,`placeholder`,`disabled`])]),_:1})]),(0,o.createVNode)(n.t,{label:`API key`,hint:`Encrypted at rest and never sent back to the browser, so this field is always empty when the page loads.`,orientation:`stack`},{default:(0,o.withCtx)(({id:e})=>[(0,o.createVNode)(a.t,{id:e,"model-value":f.apiKey,type:`password`,autocomplete:`off`,placeholder:f.hasKey?`Stored. Type a new key to replace it.`:`sk-...`,disabled:f.busy,"onUpdate:modelValue":h[2]||=e=>m(`update:apiKey`,String(e??``))},null,8,[`id`,`model-value`,`placeholder`,`disabled`])]),_:1}),(0,o.createElementVNode)(`div`,d,[(0,o.createVNode)(e.t,{variant:`primary`,loading:f.busy,onClick:h[3]||=e=>m(`save`)},{default:(0,o.withCtx)(()=>[...h[5]||=[(0,o.createTextVNode)(` Save AI settings `,-1)]]),_:1},8,[`loading`]),f.hasKey?((0,o.openBlock)(),(0,o.createBlock)(e.t,{key:0,variant:`ghost`,disabled:f.busy,onClick:h[4]||=e=>m(`remove`)},{default:(0,o.withCtx)(()=>[...h[6]||=[(0,o.createTextVNode)(` Remove key `,-1)]]),_:1},8,[`disabled`])):(0,o.createCommentVNode)(``,!0)])]),_:3}))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
@@ -2,7 +2,7 @@ import { t as e } from "./Button-D81Efqjg.js";
|
|
|
2
2
|
import { t } from "./AiLabel-CPINOrQd.js";
|
|
3
3
|
import { t as n } from "./Field-6haRtm1-.js";
|
|
4
4
|
import { t as r } from "./Panel-B3kJkm_w.js";
|
|
5
|
-
import { t as i } from "./Select-
|
|
5
|
+
import { t as i } from "./Select-cEKAoY4x.js";
|
|
6
6
|
import { t as a } from "./TextInput-D5vlfecS.js";
|
|
7
7
|
import { createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, openBlock as p, renderSlot as m, toDisplayString as h, withCtx as g } from "vue";
|
|
8
8
|
//#region src/components/AiProvider.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
+
import { t } from "./Icon-rREAqsu0.js";
|
|
3
|
+
import { usePhoneLayout as n } from "./composables/usePhoneLayout.composable.mjs";
|
|
4
|
+
import { t as r } from "./Button-D81Efqjg.js";
|
|
5
|
+
import { t as i } from "./Select-cEKAoY4x.js";
|
|
6
|
+
import { Comment as a, Fragment as o, Text as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, getCurrentInstance as g, mergeProps as _, normalizeClass as v, openBlock as y, renderList as b, renderSlot as x, toDisplayString as S, unref as C, useSlots as w, withCtx as T } from "vue";
|
|
7
|
+
import { regular as E } from "@nubisco/ui/icons/caret-right";
|
|
8
|
+
import * as D from "@nubisco/ui/icons/caret-up-down";
|
|
9
|
+
//#region src/components/Breadcrumbs.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var O = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "nb-breadcrumbs__brand"
|
|
13
|
+
}, k = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "nb-breadcrumbs__title"
|
|
16
|
+
}, A = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "nb-breadcrumbs__subtitle"
|
|
19
|
+
}, j = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "nb-breadcrumbs__crumbs"
|
|
22
|
+
}, M = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "nb-breadcrumbs__current",
|
|
25
|
+
"aria-current": "page"
|
|
26
|
+
}, N = {
|
|
27
|
+
key: 2,
|
|
28
|
+
class: "nb-breadcrumbs__parent"
|
|
29
|
+
}, P = ["aria-label"], F = /* @__PURE__ */ e(/* @__PURE__ */ h({
|
|
30
|
+
__name: "Breadcrumbs",
|
|
31
|
+
props: {
|
|
32
|
+
title: { default: void 0 },
|
|
33
|
+
subtitle: { default: void 0 },
|
|
34
|
+
collapse: { default: "none" },
|
|
35
|
+
items: { default: void 0 }
|
|
36
|
+
},
|
|
37
|
+
emits: ["select", "switch"],
|
|
38
|
+
setup(e, { emit: h }) {
|
|
39
|
+
let F = e, I = h, L = g(), R = c(() => !!L?.vnode.props?.onSelect), z = c(() => {
|
|
40
|
+
let e = F.items ?? [], t = e.findIndex((e) => e.current);
|
|
41
|
+
return t === -1 ? e.length - 1 : t;
|
|
42
|
+
});
|
|
43
|
+
function B(e) {
|
|
44
|
+
return e === z.value;
|
|
45
|
+
}
|
|
46
|
+
function V(e) {
|
|
47
|
+
return e.to != null || !!e.href || !!e.onClick || R.value;
|
|
48
|
+
}
|
|
49
|
+
function H(e, t, n) {
|
|
50
|
+
e.onClick?.(n), I("select", e, t, n);
|
|
51
|
+
}
|
|
52
|
+
let U = [], W = (e, t) => e.value ?? t;
|
|
53
|
+
function G(e) {
|
|
54
|
+
return (e.options ?? []).map((e, t) => ({
|
|
55
|
+
label: e.label,
|
|
56
|
+
value: W(e, t),
|
|
57
|
+
icon: e.icon
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
function K(e) {
|
|
61
|
+
if (e.value != null) return e.value;
|
|
62
|
+
let t = e.options ?? [], n = t.findIndex((t) => t.label === e.label);
|
|
63
|
+
return n === -1 ? null : W(t[n], n);
|
|
64
|
+
}
|
|
65
|
+
function q(e, t, n) {
|
|
66
|
+
let r = e.options ?? [], i = r.findIndex((e, t) => W(e, t) === n);
|
|
67
|
+
if (i === -1 || n === K(e)) return;
|
|
68
|
+
let a = r[i];
|
|
69
|
+
I("switch", e, a, t), J(a);
|
|
70
|
+
}
|
|
71
|
+
function J(e) {
|
|
72
|
+
let t = L?.appContext.config.globalProperties.$router;
|
|
73
|
+
e.to == null ? e.href && window.location.assign(e.href) : t ? t.push(e.to) : typeof e.to == "string" && window.location.assign(e.to);
|
|
74
|
+
}
|
|
75
|
+
let Y = w();
|
|
76
|
+
function X(e) {
|
|
77
|
+
return e.some((e) => e.type === a ? !1 : e.type === s ? String(e.children ?? "").trim() !== "" : e.type === o ? X(e.children ?? []) : !0);
|
|
78
|
+
}
|
|
79
|
+
let Z = c(() => X(Y.default?.() ?? [])), Q = c(() => !!F.items?.length || Z.value), { phone: $ } = n(), ee = c(() => F.collapse === "phone" && $.value && Q.value);
|
|
80
|
+
return (n, a) => (y(), d("nav", {
|
|
81
|
+
class: v(["nb-breadcrumbs", { "nb-breadcrumbs--collapsed": ee.value }]),
|
|
82
|
+
"aria-label": "breadcrumb"
|
|
83
|
+
}, [
|
|
84
|
+
e.title || e.subtitle ? (y(), d("span", O, [e.title ? (y(), d("span", k, S(e.title), 1)) : u("", !0), e.subtitle ? (y(), d("span", A, S(e.subtitle), 1)) : u("", !0)])) : u("", !0),
|
|
85
|
+
(e.title || e.subtitle) && Q.value ? (y(), l(t, {
|
|
86
|
+
key: 1,
|
|
87
|
+
name: C(E),
|
|
88
|
+
size: "sm",
|
|
89
|
+
class: "nb-breadcrumbs__sep"
|
|
90
|
+
}, null, 8, ["name"])) : u("", !0),
|
|
91
|
+
Q.value ? (y(), d("span", j, [e.items?.length ? (y(!0), d(o, { key: 0 }, b(e.items, (e, n) => (y(), d("span", {
|
|
92
|
+
key: n,
|
|
93
|
+
ref_for: !0,
|
|
94
|
+
ref: (e) => U[n] = e,
|
|
95
|
+
class: "nb-breadcrumbs__item"
|
|
96
|
+
}, [B(n) ? (y(), d("span", M, S(e.label), 1)) : V(e) ? (y(), l(r, {
|
|
97
|
+
key: 1,
|
|
98
|
+
class: "nb-breadcrumbs__link",
|
|
99
|
+
variant: "link",
|
|
100
|
+
to: e.to,
|
|
101
|
+
href: e.href,
|
|
102
|
+
target: e.target,
|
|
103
|
+
onClick: (t) => H(e, n, t)
|
|
104
|
+
}, {
|
|
105
|
+
default: T(() => [p(S(e.label), 1)]),
|
|
106
|
+
_: 2
|
|
107
|
+
}, 1032, [
|
|
108
|
+
"to",
|
|
109
|
+
"href",
|
|
110
|
+
"target",
|
|
111
|
+
"onClick"
|
|
112
|
+
])) : (y(), d("span", N, S(e.label), 1)), e.options?.length ? (y(), l(i, {
|
|
113
|
+
key: 3,
|
|
114
|
+
class: "nb-breadcrumbs__switcher",
|
|
115
|
+
searchable: "",
|
|
116
|
+
"selected-mark": "check",
|
|
117
|
+
anchor: () => U[n],
|
|
118
|
+
"model-value": K(e),
|
|
119
|
+
options: G(e),
|
|
120
|
+
"search-placeholder": e.searchPlaceholder ?? "Find",
|
|
121
|
+
"no-results-label": e.noResultsLabel ?? "No results",
|
|
122
|
+
onChange: (t) => q(e, n, t)
|
|
123
|
+
}, {
|
|
124
|
+
trigger: T(({ attrs: n }) => [f("button", _({
|
|
125
|
+
type: "button",
|
|
126
|
+
class: "nb-breadcrumbs__switch"
|
|
127
|
+
}, { ref_for: !0 }, n, { "aria-label": e.switchLabel ?? `Switch ${e.label}` }), [m(t, {
|
|
128
|
+
name: D,
|
|
129
|
+
size: 14,
|
|
130
|
+
"aria-hidden": "true"
|
|
131
|
+
})], 16, P)]),
|
|
132
|
+
_: 2
|
|
133
|
+
}, 1032, [
|
|
134
|
+
"anchor",
|
|
135
|
+
"model-value",
|
|
136
|
+
"options",
|
|
137
|
+
"search-placeholder",
|
|
138
|
+
"no-results-label",
|
|
139
|
+
"onChange"
|
|
140
|
+
])) : u("", !0)]))), 128)) : x(n.$slots, "default", { key: 1 }, void 0, !0)])) : u("", !0)
|
|
141
|
+
], 2));
|
|
142
|
+
}
|
|
143
|
+
}), [["__scopeId", "data-v-08deaee6"]]);
|
|
144
|
+
//#endregion
|
|
145
|
+
export { F as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/usePhoneLayout.composable.cjs`),i=require(`./Button-B-8ikYRN.cjs`),a=require(`./Select-CnieTPOL.cjs`);let o=require(`vue`),s=require(`@nubisco/ui/icons/caret-right`),c=require(`@nubisco/ui/icons/caret-up-down`);c=e.n(c);var l={key:0,class:`nb-breadcrumbs__brand`},u={key:0,class:`nb-breadcrumbs__title`},d={key:1,class:`nb-breadcrumbs__subtitle`},f={key:2,class:`nb-breadcrumbs__crumbs`},p={key:0,class:`nb-breadcrumbs__current`,"aria-current":`page`},m={key:2,class:`nb-breadcrumbs__parent`},h=[`aria-label`],g=(0,o.defineComponent)({__name:`Breadcrumbs`,props:{title:{default:void 0},subtitle:{default:void 0},collapse:{default:`none`},items:{default:void 0}},emits:[`select`,`switch`],setup(e,{emit:t}){let g=e,_=t,v=(0,o.getCurrentInstance)(),y=(0,o.computed)(()=>!!v?.vnode.props?.onSelect),b=(0,o.computed)(()=>{let e=g.items??[],t=e.findIndex(e=>e.current);return t===-1?e.length-1:t});function x(e){return e===b.value}function S(e){return e.to!=null||!!e.href||!!e.onClick||y.value}function C(e,t,n){e.onClick?.(n),_(`select`,e,t,n)}let w=[],T=(e,t)=>e.value??t;function E(e){return(e.options??[]).map((e,t)=>({label:e.label,value:T(e,t),icon:e.icon}))}function D(e){if(e.value!=null)return e.value;let t=e.options??[],n=t.findIndex(t=>t.label===e.label);return n===-1?null:T(t[n],n)}function O(e,t,n){let r=e.options??[],i=r.findIndex((e,t)=>T(e,t)===n);if(i===-1||n===D(e))return;let a=r[i];_(`switch`,e,a,t),k(a)}function k(e){let t=v?.appContext.config.globalProperties.$router;e.to==null?e.href&&window.location.assign(e.href):t?t.push(e.to):typeof e.to==`string`&&window.location.assign(e.to)}let A=(0,o.useSlots)();function j(e){return e.some(e=>e.type===o.Comment?!1:e.type===o.Text?String(e.children??``).trim()!==``:e.type===o.Fragment?j(e.children??[]):!0)}let M=(0,o.computed)(()=>j(A.default?.()??[])),N=(0,o.computed)(()=>!!g.items?.length||M.value),{phone:P}=r.usePhoneLayout(),F=(0,o.computed)(()=>g.collapse===`phone`&&P.value&&N.value);return(t,r)=>((0,o.openBlock)(),(0,o.createElementBlock)(`nav`,{class:(0,o.normalizeClass)([`nb-breadcrumbs`,{"nb-breadcrumbs--collapsed":F.value}]),"aria-label":`breadcrumb`},[e.title||e.subtitle?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,l,[e.title?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,u,(0,o.toDisplayString)(e.title),1)):(0,o.createCommentVNode)(``,!0),e.subtitle?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,d,(0,o.toDisplayString)(e.subtitle),1)):(0,o.createCommentVNode)(``,!0)])):(0,o.createCommentVNode)(``,!0),(e.title||e.subtitle)&&N.value?((0,o.openBlock)(),(0,o.createBlock)(n.t,{key:1,name:(0,o.unref)(s.regular),size:`sm`,class:`nb-breadcrumbs__sep`},null,8,[`name`])):(0,o.createCommentVNode)(``,!0),N.value?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,f,[e.items?.length?((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:0},(0,o.renderList)(e.items,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:t,ref_for:!0,ref:e=>w[t]=e,class:`nb-breadcrumbs__item`},[x(t)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,p,(0,o.toDisplayString)(e.label),1)):S(e)?((0,o.openBlock)(),(0,o.createBlock)(i.t,{key:1,class:`nb-breadcrumbs__link`,variant:`link`,to:e.to,href:e.href,target:e.target,onClick:n=>C(e,t,n)},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.label),1)]),_:2},1032,[`to`,`href`,`target`,`onClick`])):((0,o.openBlock)(),(0,o.createElementBlock)(`span`,m,(0,o.toDisplayString)(e.label),1)),e.options?.length?((0,o.openBlock)(),(0,o.createBlock)(a.t,{key:3,class:`nb-breadcrumbs__switcher`,searchable:``,"selected-mark":`check`,anchor:()=>w[t],"model-value":D(e),options:E(e),"search-placeholder":e.searchPlaceholder??`Find`,"no-results-label":e.noResultsLabel??`No results`,onChange:n=>O(e,t,n)},{trigger:(0,o.withCtx)(({attrs:t})=>[(0,o.createElementVNode)(`button`,(0,o.mergeProps)({type:`button`,class:`nb-breadcrumbs__switch`},{ref_for:!0},t,{"aria-label":e.switchLabel??`Switch ${e.label}`}),[(0,o.createVNode)(n.t,{name:c,size:14,"aria-hidden":`true`})],16,h)]),_:2},1032,[`anchor`,`model-value`,`options`,`search-placeholder`,`no-results-label`,`onChange`])):(0,o.createCommentVNode)(``,!0)]))),128)):(0,o.renderSlot)(t.$slots,`default`,{key:1},void 0,!0)])):(0,o.createCommentVNode)(``,!0)],2))}}),_=t.t(g,[[`__scopeId`,`data-v-08deaee6`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
2
|
import { r as t } from "./Size.d-Bah6vMl3.js";
|
|
3
3
|
import { t as n } from "./Button-D81Efqjg.js";
|
|
4
|
-
import { t as r } from "./Select-
|
|
4
|
+
import { t as r } from "./Select-cEKAoY4x.js";
|
|
5
5
|
import { computed as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, toDisplayString as d } from "vue";
|
|
6
6
|
import * as f from "@nubisco/ui/icons/caret-right";
|
|
7
7
|
import * as p from "@nubisco/ui/icons/caret-left";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Size.d-GBIblj2D.cjs`),r=require(`./Button-B-8ikYRN.cjs`),i=require(`./Select-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Size.d-GBIblj2D.cjs`),r=require(`./Button-B-8ikYRN.cjs`),i=require(`./Select-CnieTPOL.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/caret-right`);o=e.n(o);let s=require(`@nubisco/ui/icons/caret-left`);s=e.n(s);var c={class:`nb-pagination__left`},l={class:`nb-pagination__page-size`},u={class:`nb-pagination__label`},d={class:`nb-pagination__range`,"aria-live":`polite`},f={class:`nb-pagination__right`},p={class:`nb-pagination__page-of`},m=(0,a.defineComponent)({__name:`Pagination`,props:{page:{},pageSize:{},total:{},pageSizeOptions:{default:()=>[10,20,30,40,50]},size:{default:n.r.Medium},disabled:{type:Boolean,default:!1},pageSizeLabel:{default:`Items per page:`},itemLabel:{default:`items`}},emits:[`update:page`,`update:pageSize`],setup(e,{emit:t}){let n=e,m=t,h=(0,a.computed)(()=>n.size),g=(0,a.computed)(()=>n.pageSizeOptions.includes(n.pageSize)?n.pageSizeOptions:[...n.pageSizeOptions,n.pageSize].sort((e,t)=>e-t)),_=(0,a.computed)(()=>g.value.map(e=>({label:String(e),value:e}))),v=(0,a.computed)(()=>Math.max(1,Math.ceil(n.total/Math.max(1,n.pageSize)))),y=(0,a.computed)(()=>Math.min(Math.max(1,n.page),v.value)),b=(0,a.computed)(()=>n.total===0?0:(y.value-1)*n.pageSize+1),x=(0,a.computed)(()=>Math.min(y.value*n.pageSize,n.total));function S(e){let t=Math.min(Math.max(1,e),v.value);t!==n.page&&m(`update:page`,t)}function C(e){let t=Number(e);!Number.isFinite(t)||t===n.pageSize||(m(`update:pageSize`,t),n.page!==1&&m(`update:page`,1))}return(t,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`nav`,{class:(0,a.normalizeClass)([`nb-pagination`,`nb-pagination--${e.size}`]),"aria-label":`Pagination`},[(0,a.createElementVNode)(`div`,c,[(0,a.createElementVNode)(`label`,l,[(0,a.createElementVNode)(`span`,u,(0,a.toDisplayString)(e.pageSizeLabel),1),(0,a.createVNode)(i.t,{size:`xs`,"model-value":e.pageSize,options:_.value,disabled:e.disabled,"onUpdate:modelValue":C},null,8,[`model-value`,`options`,`disabled`])]),(0,a.createElementVNode)(`span`,d,(0,a.toDisplayString)(b.value)+`–`+(0,a.toDisplayString)(x.value)+` of `+(0,a.toDisplayString)(e.total)+` `+(0,a.toDisplayString)(e.itemLabel),1)]),(0,a.createElementVNode)(`div`,f,[(0,a.createElementVNode)(`span`,p,` Page `+(0,a.toDisplayString)(y.value)+` of `+(0,a.toDisplayString)(v.value),1),(0,a.createVNode)(r.t,{class:`nb-pagination__nav`,variant:`ghost`,size:h.value,icon:s,disabled:e.disabled||y.value<=1,"aria-label":`Previous page`,onClick:n[0]||=e=>S(y.value-1)},null,8,[`size`,`disabled`]),(0,a.createVNode)(r.t,{class:`nb-pagination__nav`,variant:`ghost`,size:h.value,icon:o,disabled:e.disabled||y.value>=v.value,"aria-label":`Next page`,onClick:n[1]||=e=>S(y.value+1)},null,8,[`size`,`disabled`])])],2))}}),h=t.t(m,[[`__scopeId`,`data-v-884e19f9`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Icon-C8R_r_In.cjs`),t=require(`./Grid-CXE0B85G.cjs`),n=require(`./Label-71QAuWf4.cjs`),r=require(`./Message-vFr_gB2V.cjs`),i=require(`./composables/useMenuSurface.composable.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/caret-down`),s=require(`@nubisco/ui/icons/caret-up`),c=require(`@nubisco/ui/icons/x`);var ee=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],te={key:2,class:`nb-select__clear-space`,"aria-hidden":`true`},ne=[`aria-label`],l=[`id`,`aria-expanded`,`aria-disabled`,`aria-required`,`disabled`],u={key:1,class:`nb-select__inner-label`},d={key:0,class:`nb-select__asterisk`,"aria-hidden":`true`},re={key:0,class:`nb-select__clear-space`,"aria-hidden":`true`},ie=[`aria-label`],ae=[`id`,`aria-multiselectable`],oe={key:0,class:`nb-select__search`},se=[`placeholder`,`aria-label`,`aria-controls`,`aria-activedescendant`],f=[`aria-labelledby`],ce=[`id`],le=[`id`,`data-index`,`aria-selected`,`aria-disabled`,`onMouseenter`,`onClick`],ue={key:0,class:`nb-select__option-check`,"aria-hidden":`true`},de={key:0,viewBox:`0 0 10 8`,fill:`none`,width:`10`,height:`8`},p={class:`nb-select__option-label`},m={key:1,class:`nb-select__empty`},fe={key:2,class:`nb-select__empty`},pe=[`placeholder`,`onKeydown`],h=(0,a.defineComponent)({__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:`Clear selection`},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(h,{expose:g,emit:me}){let _=h,v=me,y=(e,{slots:t})=>e.wrap?(0,a.h)(`div`,{class:`nb-select__control`},t.default?.()):t.default?.();y.props=[`wrap`];let b=(0,a.ref)(``),x=(0,a.ref)(``),S=(0,a.ref)(null);function he(){let e=b.value.trim();e&&(v(`create`,e),b.value=``)}let C=(0,a.ref)(!1),w=(0,a.ref)(!1),T=(0,a.ref)(-1),E=(0,a.ref)(null),D=(0,a.ref)(null),O=(0,a.useSlots)(),ge=()=>(typeof _.anchor==`function`?_.anchor():_.anchor)??D.value??E.value;function k(){(D.value??E.value?.querySelector(`button, [tabindex]`))?.focus()}let A=(0,a.ref)(null);i.useMenuSurface(A);let j=(0,a.ref)({position:`fixed`,top:`0px`,left:`0px`,width:`0px`,zIndex:`9999`}),M=`nb-select-${(0,a.useId)()}`,N=(0,a.computed)(()=>_.id??M),P=(0,a.computed)(()=>`${N.value}-listbox`),F=e=>`${N.value}-option-${e}`,I=(0,a.computed)(()=>_.modelValue==null?[]:Array.isArray(_.modelValue)?_.modelValue:[_.modelValue]),L=(0,a.computed)(()=>{if(!(_.multiple||I.value.length!==1))return(_.options??[]).find(e=>e.value===I.value[0])?.icon}),R=(0,a.computed)(()=>{if(I.value.length===0)return``;let e=_.options??[];return _.multiple?I.value.length===1?e.find(e=>e.value===I.value[0])?.label??String(I.value[0]):I.value.length===2?I.value.map(t=>e.find(e=>e.value===t)?.label??String(t)).join(`, `):`${I.value.length} selected`:e.find(e=>e.value===I.value[0])?.label??String(I.value[0])});function z(e){return I.value.includes(e)}let B=e=>e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase(),V=(0,a.computed)(()=>{let e=_.options??[],t=_.searchable?B(x.value.trim()):``,n=new Set;return e.forEach((e,r)=>{(!t||B(e.label).includes(t))&&n.add(r)}),n}),_e=(0,a.computed)(()=>{let e=[];return(_.options??[]).forEach((t,n)=>{if(!V.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:`${N.value}-group-${e.length}`,entries:[]}),e[e.length-1].entries.push({option:t,index:n})}),e});function H(e,t){let n=_.options??[];for(let r=e+t;r>=0&&r<n.length;r+=t)if(!n[r].disabled&&V.value.has(r))return r;return e}function U(e){if(e.disabled)return;let t;if(_.multiple){let n=[...I.value],r=n.indexOf(e.value);r>=0?n.splice(r,1):n.push(e.value),t=n}else t=e.value,K();v(`update:modelValue`,t),v(`change`,t)}function W(){let e=ge();if(!e)return;let t=e.getBoundingClientRect(),n=A.value?.offsetHeight??0,r=window.innerHeight-t.bottom,i=t.top,a=n>0&&r<n&&i>r,o=O.trigger?Math.max(t.width,240):t.width,s=O.trigger?Math.max(8,Math.min(t.left,window.innerWidth-o-8)):t.left;j.value={position:`fixed`,top:a?`${t.top-n}px`:`${t.bottom}px`,left:`${s}px`,width:`${o}px`,zIndex:`9999`}}function G(){if(_.disabled)return;C.value=!0,W();let e=_.options??[];T.value=I.value.length>0?Math.max(0,e.findIndex(e=>e.value===I.value[0])):-1,(0,a.nextTick)(()=>{W(),Z(),S.value?.focus({preventScroll:!0})})}function K(){let e=!!A.value?.contains(document.activeElement);C.value=!1,T.value=-1,x.value=``,e&&k()}function q(){C.value?K():G()}function J(e){let t=e.target,n=E.value?.contains(t)??!1,r=A.value?.contains(t)??!1;!n&&!r&&K()}function Y(){C.value&&W()}(0,a.watch)(C,e=>{e?(document.addEventListener(`mousedown`,J),window.addEventListener(`scroll`,Y,!0),window.addEventListener(`resize`,Y)):(document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y))}),(0,a.onBeforeUnmount)(()=>{document.removeEventListener(`mousedown`,J),window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y)});function X(e){let t=_.options??[];if(!C.value){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),G());return}e.key===`Escape`?(K(),e.preventDefault()):e.key===`Tab`?K():e.key===`ArrowDown`?(e.preventDefault(),T.value=H(T.value,1),Z()):e.key===`ArrowUp`?(e.preventDefault(),T.value>0&&(T.value=H(T.value,-1)),Z()):(e.key===`Enter`||e.key===` `)&&T.value>=0&&(e.preventDefault(),U(t[T.value]))}function Z(){(0,a.nextTick)(()=>{!A.value||T.value<0||A.value.querySelector(`[data-index="${T.value}"]`)?.scrollIntoView({block:`nearest`})})}(0,a.watch)(x,()=>{if(!C.value)return;let e=H(-1,1);T.value=e===-1?-1:e,Z()});function ve(e){if(e.key===` `){e.stopPropagation();return}if(e.key===`Home`||e.key===`End`){e.stopPropagation();return}X(e)}let ye=(0,a.computed)(()=>({isOpen:C.value,toggle:q,open:G,close:K,attrs:{"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-controls":C.value?P.value:void 0,onClick:q}})),Q=(0,a.computed)(()=>_.clearable&&!_.disabled&&I.value.length>0);function $(){let e=_.multiple?[]:null;K(),v(`update:modelValue`,e),v(`change`,e),k()}let be=(0,a.computed)(()=>[`nb-select`,`nb-select--${_.variant}`,`nb-select--${_.size}`,{"nb-select--open":C.value,"nb-select--focused":w.value&&!C.value,"nb-select--error":!!_.error,"nb-select--warning":!_.error&&!!_.warning,"nb-select--multiple":_.multiple,"nb-select--bare":!!O.trigger}]);return g({open:G,close:K}),(i,g)=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,null,[(0,a.createElementVNode)(`div`,{ref_key:`rootRef`,ref:E,class:(0,a.normalizeClass)(be.value),onKeydown:X},[i.$slots.trigger?(0,a.renderSlot)(i.$slots,`trigger`,(0,a.normalizeProps)((0,a.mergeProps)({key:0},ye.value))):h.variant===`default`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):h.label?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:1,for:N.value,required:h.required,disabled:h.disabled},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.label),1)]),_:1},8,[`for`,`required`,`disabled`])):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[0]||=e=>w.value=!0,onBlur:g[1]||=e=>w.value=!1},[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,"icon-only":!0,class:`nb-select__status-icon`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,te)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})],40,ee),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[2]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[3]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ne)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`error`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:3,variant:`warning`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):h.helper?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:4,variant:`helper`,class:`nb-select__message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):h.variant===`fluid`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createVNode)(y,{wrap:h.clearable},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`button`,{id:N.value,ref_key:`triggerRef`,ref:D,type:`button`,class:`nb-select__trigger`,role:`combobox`,"aria-expanded":C.value,"aria-haspopup":`listbox`,"aria-disabled":h.disabled||void 0,"aria-required":h.required||void 0,disabled:h.disabled||void 0,onClick:q,onFocus:g[4]||=e=>w.value=!0,onBlur:g[5]||=e=>w.value=!1},[h.label||i.$slots.label?((0,a.openBlock)(),(0,a.createBlock)(t.t,{key:0,dir:`row`,align:`center`,gap:`xs`,class:`nb-select__inner-header`},{default:(0,a.withCtx)(()=>[i.$slots.label?(0,a.renderSlot)(i.$slots,`label`,{key:0}):((0,a.openBlock)(),(0,a.createElementBlock)(`label`,u,[(0,a.createTextVNode)((0,a.toDisplayString)(h.label)+` `,1),h.required?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,d,`*`)):(0,a.createCommentVNode)(``,!0)])),h.helper&&!h.error&&!h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:2,variant:`helper`,"icon-only":!0,class:`nb-select__inner-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.helper),1)]),_:1})):(0,a.createCommentVNode)(``,!0)]),_:3})):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{dir:`row`,align:`end`,flex:``,class:`nb-select__value-row`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`nb-select__value`,{"nb-select__value--placeholder":!R.value,"nb-select__value--with-icon":!!L.value}])},[L.value?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:0,class:`nb-select__value-icon`,name:L.value,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),R.value?(0,a.renderSlot)(i.$slots,`value`,{key:1,values:I.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value),1)]):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createTextVNode)((0,a.toDisplayString)(h.placeholder),1)],64))],2),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,re)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(t.t,{align:`center`,justify:`center`,class:`nb-select__caret`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:C.value?(0,a.unref)(s.regular):(0,a.unref)(o.regular),size:16},null,8,[`name`])]),_:1})]),_:3})],40,l),Q.value?((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-select__clear`,"aria-label":h.clearLabel,onClick:$,onKeydown:[g[6]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`enter`]),g[7]||=(0,a.withKeys)((0,a.withModifiers)(()=>{},[`stop`]),[`space`])]},[(0,a.createVNode)(e.t,{name:(0,a.unref)(c.regular),size:16},null,8,[`name`])],40,ie)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`wrap`]),h.error?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:0,variant:`error`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.error),1)]),_:1})):h.warning?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,variant:`warning`,class:`nb-select__fluid-message`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(h.warning),1)]),_:1})):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0)],34),((0,a.openBlock)(),(0,a.createBlock)(a.Teleport,{to:`body`},[C.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:P.value,ref_key:`dropdownRef`,ref:A,class:(0,a.normalizeClass)([`nb-select__dropdown`,{"nb-select__dropdown--check":h.selectedMark===`check`,"nb-select__dropdown--anchored":!!i.$slots.trigger}]),style:(0,a.normalizeStyle)(j.value),role:`listbox`,"aria-multiselectable":h.multiple||void 0},[h.searchable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,oe,[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{ref_key:`searchRef`,ref:S,"onUpdate:modelValue":g[8]||=e=>x.value=e,type:`search`,class:`nb-select__search-input`,autocomplete:`off`,spellcheck:`false`,placeholder:h.searchPlaceholder,"aria-label":h.searchPlaceholder,"aria-controls":P.value,"aria-activedescendant":T.value>=0?F(T.value):void 0,onKeydown:ve},null,40,se),[[a.vModelText,x.value]])])):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(_e.value,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t.key,class:`nb-select__group`,role:`group`,"aria-labelledby":t.name?t.labelId:void 0},[t.name?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:t.labelId,class:`nb-select__group-label`},(0,a.toDisplayString)(t.name),9,ce)):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(t.entries,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{id:F(t.index),key:t.option.value,"data-index":t.index,class:(0,a.normalizeClass)([`nb-select__option`,{"nb-select__option--selected":z(t.option.value),"nb-select__option--highlighted":T.value===t.index,"nb-select__option--disabled":t.option.disabled}]),role:`option`,"aria-selected":z(t.option.value),"aria-disabled":t.option.disabled||void 0,onMouseenter:e=>T.value=t.index,onClick:e=>U(t.option)},[h.multiple||h.selectedMark===`check`?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,ue,[z(t.option.value)?((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,de,[...g[12]||=[(0,a.createElementVNode)(`path`,{d:`M1 4l3 3 5-6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(0,a.createCommentVNode)(``,!0)])):(0,a.createCommentVNode)(``,!0),t.option.icon?((0,a.openBlock)(),(0,a.createBlock)(e.t,{key:1,class:`nb-select__option-icon`,name:t.option.icon,size:16},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,p,[(0,a.renderSlot)(i.$slots,`option`,{option:t.option},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t.option.label),1)])])],42,le))),128))],8,f))),128)),!h.options||h.options.length===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,m,` No options `)):h.searchable&&V.value.size===0?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,fe,(0,a.toDisplayString)(h.noResultsLabel),1)):(0,a.createCommentVNode)(``,!0),h.creatable?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:3,class:`nb-select__create`,onMousedown:g[11]||=(0,a.withModifiers)(()=>{},[`prevent`])},[(0,a.withDirectives)((0,a.createElementVNode)(`input`,{"onUpdate:modelValue":g[9]||=e=>b.value=e,type:`text`,class:`nb-select__create-input`,placeholder:h.createPlaceholder||`Add new…`,onKeydown:[(0,a.withKeys)((0,a.withModifiers)(he,[`prevent`]),[`enter`]),g[10]||=(0,a.withModifiers)(()=>{},[`stop`])]},null,40,pe),[[a.vModelText,b.value]])],32)):(0,a.createCommentVNode)(``,!0)],14,ae)):(0,a.createCommentVNode)(``,!0)]))],64))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|