@nubisco/ui 5.50.1 → 5.51.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-C5ezIeiH.cjs → AiProvider-C5PGq8_N.cjs} +1 -1
- package/dist/{AiProvider-DHXJJRrw.js → AiProvider-DkRd4Oee.js} +2 -2
- package/dist/{Breadcrumbs-BDsy1vNm.js → Breadcrumbs-8VM5XZTT.js} +1 -1
- package/dist/{Breadcrumbs-DMpa5j7m.cjs → Breadcrumbs-avQltgRZ.cjs} +1 -1
- package/dist/{Confirm-CZNS6FNr.js → Confirm-Bsf8R78g.js} +1 -1
- package/dist/{Confirm-DbrEaYlJ.cjs → Confirm-YFZK3eSw.cjs} +1 -1
- package/dist/{DatePicker-fS84mRE6.js → DatePicker-DPTMT52Y.js} +94 -90
- package/dist/DatePicker-DShl7pkk.cjs +1 -0
- package/dist/NumberInput-BNlXW5XD.cjs +1 -0
- package/dist/{NumberInput-B-TvTlXI.js → NumberInput-BgrIXtsT.js} +50 -50
- package/dist/{Pagination-Sm4rX7gH.cjs → Pagination-5qvBYkmf.cjs} +1 -1
- package/dist/{Pagination-CQJYl76w.js → Pagination-BTvOfCJG.js} +1 -1
- package/dist/{Search-CfH1Q9GB.cjs → Search-CQlcMCZ0.cjs} +1 -1
- package/dist/{Search-BnGuTcHp.js → Search-Cj9aSYg2.js} +1 -1
- package/dist/{Select-CuiJz35r.js → Select-DUAPhMYG.js} +5 -5
- package/dist/{Select-C4s5Eek6.cjs → Select-dAsXp4vb.cjs} +1 -1
- package/dist/{Slider-D3YgGPcY.cjs → Slider-CYYnC2N6.cjs} +1 -1
- package/dist/{Slider-BP-oEeJs.js → Slider-DjPICUZY.js} +1 -1
- package/dist/Submenu-BabY14Vm.cjs +1 -0
- package/dist/Submenu-DOzhF4BM.js +164 -0
- package/dist/{TextInput-BVTKUEey.cjs → TextInput-BTPC7DyL.cjs} +1 -1
- package/dist/{TextInput-DqaVhKud.js → TextInput-CYhPkNwH.js} +2 -2
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +11 -11
- 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.mjs +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.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/Menu.d.ts +7 -0
- package/dist/components/NumberInput.cjs +1 -1
- package/dist/components/NumberInput.mjs +1 -1
- package/dist/components/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Search.cjs +1 -1
- package/dist/components/Search.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Submenu.cjs +1 -1
- package/dist/components/Submenu.mjs +1 -1
- package/dist/components/Submenu.vue.d.ts +1 -0
- package/dist/components/Submenu.vue.d.ts.map +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/components/TextInput.vue.d.ts.map +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +1 -1
- package/dist/composables/useNbStrings.composable.cjs +1 -1
- package/dist/composables/useNbStrings.composable.d.ts +2 -0
- package/dist/composables/useNbStrings.composable.d.ts.map +1 -1
- package/dist/composables/useNbStrings.composable.mjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +11 -11
- package/dist/styles/NumberInput.css +1 -1
- package/dist/styles/TextInput.css +1 -1
- package/dist/ui.css +2 -2
- package/package.json +2 -2
- package/dist/DatePicker-Du21bjhe.cjs +0 -1
- package/dist/NumberInput-DaZI9hc3.cjs +0 -1
- package/dist/Submenu-DRkHiWsD.cjs +0 -1
- package/dist/Submenu-Dnj5MiFy.js +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-BHFtgOXA.cjs`),t=require(`./AiLabel-DSKUOcZs.cjs`),n=require(`./Field-COMPegVv.cjs`),r=require(`./Panel-NC6_ZogV.cjs`),i=require(`./Select-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-BHFtgOXA.cjs`),t=require(`./AiLabel-DSKUOcZs.cjs`),n=require(`./Field-COMPegVv.cjs`),r=require(`./Panel-NC6_ZogV.cjs`),i=require(`./Select-dAsXp4vb.cjs`),a=require(`./TextInput-BTPC7DyL.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,8 +2,8 @@ import { t as e } from "./Button-tpOmP8iV.js";
|
|
|
2
2
|
import { t } from "./AiLabel-CSSIkvKP.js";
|
|
3
3
|
import { t as n } from "./Field-D12Dja-u.js";
|
|
4
4
|
import { t as r } from "./Panel-zyzu638n.js";
|
|
5
|
-
import { t as i } from "./Select-
|
|
6
|
-
import { t as a } from "./TextInput-
|
|
5
|
+
import { t as i } from "./Select-DUAPhMYG.js";
|
|
6
|
+
import { t as a } from "./TextInput-CYhPkNwH.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
|
|
9
9
|
var _ = { class: "nb-ai-provider__header" }, v = { class: "nb-ai-provider__title" }, y = {
|
|
@@ -4,7 +4,7 @@ import { t as n } from "./Icon-B2tiGiqZ.js";
|
|
|
4
4
|
import { usePhoneLayout as r } from "./composables/usePhoneLayout.composable.mjs";
|
|
5
5
|
import { useNbStrings as i } from "./composables/useNbStrings.composable.mjs";
|
|
6
6
|
import { t as a } from "./Avatar-ZG-WROXx.js";
|
|
7
|
-
import { t as ee } from "./Select-
|
|
7
|
+
import { t as ee } from "./Select-DUAPhMYG.js";
|
|
8
8
|
import { Comment as o, Fragment as s, Text as te, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, getCurrentInstance as _, mergeProps as ne, normalizeClass as re, openBlock as v, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useSlots as C, withCtx as w } from "vue";
|
|
9
9
|
import { regular as ie } from "@nubisco/ui/icons/caret-right";
|
|
10
10
|
import * as T from "@nubisco/ui/icons/caret-up-down";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-BHFtgOXA.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/usePhoneLayout.composable.cjs`),a=require(`./composables/useNbStrings.composable.cjs`),o=require(`./Avatar-UO0ySqkY.cjs`),s=require(`./Select-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-BHFtgOXA.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/usePhoneLayout.composable.cjs`),a=require(`./composables/useNbStrings.composable.cjs`),o=require(`./Avatar-UO0ySqkY.cjs`),s=require(`./Select-dAsXp4vb.cjs`);let c=require(`vue`),l=require(`@nubisco/ui/icons/caret-right`),u=require(`@nubisco/ui/icons/caret-up-down`);u=e.n(u);var d={key:0,class:`nb-breadcrumbs__brand`},f={key:0,class:`nb-breadcrumbs__title`},p={key:1,class:`nb-breadcrumbs__subtitle`},m={key:2,class:`nb-breadcrumbs__crumbs`},h={key:1,class:`nb-breadcrumbs__current`,"aria-current":`page`},g={key:0,class:`nb-breadcrumbs__code`},_={key:0,class:`nb-breadcrumbs__code`},v={key:3,class:`nb-breadcrumbs__parent`},y={key:0,class:`nb-breadcrumbs__code`},b={class:`nb-breadcrumbs__option`},x={class:`nb-breadcrumbs__option-label`},S=[`aria-label`],C=(0,c.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:n}){let C=a.useNbStrings(),w=e,T=n,E=(0,c.getCurrentInstance)(),D=(0,c.computed)(()=>!!E?.vnode.props?.onSelect),O=(0,c.computed)(()=>{let e=w.items??[],t=e.findIndex(e=>e.current);return t===-1?e.length-1:t});function k(e){return e===O.value}function A(e){return e.to!=null||!!e.href||!!e.onClick||D.value}function j(e,t,n){e.onClick?.(n),T(`select`,e,t,n)}let M=[],N=(e,t)=>e.value??t;function P(e){return(e.options??[]).map((e,t)=>({label:e.label,value:N(e,t),icon:e.picture===void 0?e.icon:void 0}))}function F(e){return(e.options??[]).some(e=>e.picture!==void 0)}function I(e,t){let n=e.options??[],r=n.findIndex((e,n)=>N(e,n)===t);return r===-1?void 0:n[r].picture}function L(e){if(e.value!=null)return e.value;let t=e.options??[],n=t.findIndex(t=>t.label===e.label);return n===-1?null:N(t[n],n)}function R(e,t,n){let r=e.options??[],i=r.findIndex((e,t)=>N(e,t)===n);if(i===-1||n===L(e))return;let a=r[i];T(`switch`,e,a,t),z(a)}function z(e){let t=E?.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 B=(0,c.useSlots)();function V(e){return e.some(e=>e.type===c.Comment?!1:e.type===c.Text?String(e.children??``).trim()!==``:e.type===c.Fragment?V(e.children??[]):!0)}let H=(0,c.computed)(()=>V(B.default?.()??[])),U=(0,c.computed)(()=>!!w.items?.length||H.value),{phone:W}=i.usePhoneLayout(),G=(0,c.computed)(()=>w.collapse===`phone`&&W.value&&U.value);return(n,i)=>((0,c.openBlock)(),(0,c.createElementBlock)(`nav`,{class:(0,c.normalizeClass)([`nb-breadcrumbs`,{"nb-breadcrumbs--collapsed":G.value}]),"aria-label":`breadcrumb`},[e.title||e.subtitle?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,d,[e.title?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,f,(0,c.toDisplayString)(e.title),1)):(0,c.createCommentVNode)(``,!0),e.subtitle?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,p,(0,c.toDisplayString)(e.subtitle),1)):(0,c.createCommentVNode)(``,!0)])):(0,c.createCommentVNode)(``,!0),(e.title||e.subtitle)&&U.value?((0,c.openBlock)(),(0,c.createBlock)(r.t,{key:1,name:(0,c.unref)(l.regular),size:`sm`,class:`nb-breadcrumbs__sep`},null,8,[`name`])):(0,c.createCommentVNode)(``,!0),U.value?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,m,[e.items?.length?((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,{key:0},(0,c.renderList)(e.items,(e,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`span`,{key:n,ref_for:!0,ref:e=>M[n]=e,class:`nb-breadcrumbs__item`},[e.picture===void 0?(0,c.createCommentVNode)(``,!0):((0,c.openBlock)(),(0,c.createBlock)(o.t,{key:0,class:`nb-breadcrumbs__picture`,name:e.label,picture:e.picture,size:16,decorative:``},null,8,[`name`,`picture`])),k(n)?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,h,[e.code?((0,c.openBlock)(),(0,c.createElementBlock)(`code`,g,(0,c.toDisplayString)(e.label),1)):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)],64))])):A(e)?((0,c.openBlock)(),(0,c.createBlock)(t.t,{key:2,class:`nb-breadcrumbs__link`,variant:`link`,to:e.to,href:e.href,target:e.target,onClick:t=>j(e,n,t)},{default:(0,c.withCtx)(()=>[e.code?((0,c.openBlock)(),(0,c.createElementBlock)(`code`,_,(0,c.toDisplayString)(e.label),1)):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)],64))]),_:2},1032,[`to`,`href`,`target`,`onClick`])):((0,c.openBlock)(),(0,c.createElementBlock)(`span`,v,[e.code?((0,c.openBlock)(),(0,c.createElementBlock)(`code`,y,(0,c.toDisplayString)(e.label),1)):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)],64))])),e.options?.length?((0,c.openBlock)(),(0,c.createBlock)(s.t,{key:4,class:`nb-breadcrumbs__switcher`,searchable:``,"selected-mark":`check`,anchor:()=>M[n],"model-value":L(e),options:P(e),"search-placeholder":e.searchPlaceholder??(0,c.unref)(C).breadcrumbsFind,"no-results-label":e.noResultsLabel??(0,c.unref)(C).breadcrumbsNoResults,onChange:t=>R(e,n,t)},(0,c.createSlots)({trigger:(0,c.withCtx)(({attrs:t})=>[(0,c.createElementVNode)(`button`,(0,c.mergeProps)({type:`button`,class:`nb-breadcrumbs__switch`},{ref_for:!0},t,{"aria-label":e.switchLabel??(0,c.unref)(C).breadcrumbsSwitch(e.label)}),[(0,c.createVNode)(r.t,{name:u,size:`sm`,"aria-hidden":`true`})],16,S)]),_:2},[F(e)?{name:`option`,fn:(0,c.withCtx)(({option:t})=>[(0,c.createElementVNode)(`span`,b,[I(e,t.value)===void 0?(0,c.createCommentVNode)(``,!0):((0,c.openBlock)(),(0,c.createBlock)(o.t,{key:0,class:`nb-breadcrumbs__option-picture`,name:t.label,picture:I(e,t.value),size:16,decorative:``},null,8,[`name`,`picture`])),(0,c.createElementVNode)(`span`,x,(0,c.toDisplayString)(t.label),1)])]),key:`0`}:void 0]),1032,[`anchor`,`model-value`,`options`,`search-placeholder`,`no-results-label`,`onChange`])):(0,c.createCommentVNode)(``,!0)]))),128)):(0,c.renderSlot)(n.$slots,`default`,{key:1},void 0,!0)])):(0,c.createCommentVNode)(``,!0)],2))}}),w=n.t(C,[[`__scopeId`,`data-v-0b69a0cd`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
|
@@ -4,7 +4,7 @@ import { t as n } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
|
4
4
|
import { t as r } from "./Icon-B2tiGiqZ.js";
|
|
5
5
|
import { useNbStrings as i } from "./composables/useNbStrings.composable.mjs";
|
|
6
6
|
import { t as a } from "./Message-DCeg8qsC.js";
|
|
7
|
-
import { t as ee } from "./TextInput-
|
|
7
|
+
import { t as ee } from "./TextInput-CYhPkNwH.js";
|
|
8
8
|
import { i as te, r as ne, t as re } from "./Modal-BSGKOUi_.js";
|
|
9
9
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, normalizeClass as h, onMounted as ie, onUnmounted as ae, openBlock as g, ref as _, renderSlot as oe, toDisplayString as v, unref as y, useId as se, useSlots as ce, watch as b, withCtx as x, withKeys as le, withModifiers as ue } from "vue";
|
|
10
10
|
import { regular as de } from "@nubisco/ui/icons/check";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-BHFtgOXA.cjs`),t=require(`./composables/useReducedMotion.composable.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./Message-BJO4MjiQ.cjs`),ee=require(`./TextInput-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-BHFtgOXA.cjs`),t=require(`./composables/useReducedMotion.composable.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./Icon-CssV4E2-.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./Message-BJO4MjiQ.cjs`),ee=require(`./TextInput-BTPC7DyL.cjs`),o=require(`./Modal-D0hGHXic.cjs`);let s=require(`vue`),te=require(`@nubisco/ui/icons/check`),ne=require(`@nubisco/ui/icons/warning`);var c={key:0,class:`nb-confirm__message`},l={key:0,class:`nb-confirm__subject-kind`},u={class:`nb-confirm__subject-name`},re={key:1,class:`nb-confirm__gate`},ie={class:`nb-confirm__live`},d={key:0,class:`nb-confirm__status`,role:`status`},ae={key:1,class:`nb-confirm__status nb-confirm__status--success`,role:`status`},f=(0,s.defineComponent)({__name:`Confirm`,props:{open:{type:Boolean,default:!1},title:{},message:{default:void 0},subject:{default:void 0},subjectLabel:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},tone:{default:`danger`},typeToConfirm:{default:void 0},typeToConfirmLabel:{default:void 0},typeToConfirmHelper:{default:void 0},busy:{type:Boolean,default:!1},busyLabel:{default:void 0},succeeded:{type:Boolean,default:!1},successLabel:{default:void 0},error:{default:void 0},size:{default:`sm`},floatingSelectors:{default:()=>[]},contentClass:{default:void 0}},emits:[`confirm`,`cancel`],setup(n,{expose:f,emit:p}){let m=n,h=p,g=(0,s.useId)(),_=`nb-confirm-title-${g}`,v=`nb-confirm-body-${g}`,y=(0,s.useSlots)(),b=(0,s.ref)(null),x=(0,s.ref)(null),S=(0,s.ref)(null),C=(0,s.ref)(null),w=(0,s.ref)(``),T=t.useReducedMotion(),E=(0,s.computed)(()=>m.busy||m.succeeded);function D(){return!!m.message||!!m.subject||!!y.default}let oe=(0,s.computed)(()=>m.tone===`danger`?`danger`:`primary`),O=i.useNbStrings(),se=(0,s.computed)(()=>m.confirmLabel??O.value.confirmConfirm),ce=(0,s.computed)(()=>m.cancelLabel??O.value.confirmCancel),le=(0,s.computed)(()=>m.busyLabel??O.value.confirmBusy),ue=(0,s.computed)(()=>m.typeToConfirmLabel??O.value.confirmTypeToConfirm(m.typeToConfirm??``)),de=(0,s.computed)(()=>!m.typeToConfirm||w.value.trim()===m.typeToConfirm),k=(0,s.computed)(()=>de.value&&!E.value);function fe(){k.value&&h(`confirm`)}function A(){let e=S.value?.$el;return e instanceof HTMLElement?e:null}function pe(){let e=C.value?.$el;return e instanceof HTMLElement?e:null}function j(){return b.value?.querySelector(`[data-nb-confirm="gate"] input, input[data-nb-confirm="gate"]`)??null}function M(){if(m.tone===`danger`)return A();if(m.typeToConfirm)return j()??A();let e=pe();return e&&!e.disabled?e:A()}function N(){let e=M();e?e.focus():H()}function P(){return b.value?.closest(`[role="dialog"],[role="alertdialog"]`)??null}function F(){return typeof document>`u`?[]:Array.from(document.querySelectorAll(`[aria-modal="true"]`))}function I(){let e=P();if(!e)return!1;let t=F();return t.length===0||t[t.length-1]===e}let L=[`a[href]:not([tabindex="-1"])`,`area[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`summary:not([tabindex="-1"])`,`audio[controls]:not([tabindex="-1"])`,`video[controls]:not([tabindex="-1"])`,`iframe:not([tabindex="-1"])`,`[contenteditable]:not([contenteditable="false"]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].map(e=>`${e}:not([hidden]):not([aria-hidden="true"])`).join(`,`);function R(){return o.i(m.floatingSelectors)}function z(e){return e instanceof Element?!!e.closest(R()):!1}function B(e){let t=P();return!!t&&!!e&&t.contains(e)}function V(){let e=P();return e?Array.from(e.querySelectorAll(L)).filter(e=>e.getAttribute(`aria-disabled`)!==`true`):[]}function H(){let e=P();return e?(e.focus(),!0):!1}function U(){let e=V()[0];e?e.focus():H()}let W=null;function G(){let e=W;W=null,e?.isConnected&&e.focus()}function K(){o.r(P(),T.value)}(0,s.watch)(T,()=>{m.open&&K()}),(0,s.watch)(()=>[m.busy,m.error],async(e,t)=>{if(!m.open)return;let[n,r]=e,i=t?.[0]??!1;if(await(0,s.nextTick)(),n){V().length===0&&H();return}if(i&&r){let e=x.value;e?e.focus():U();return}let a=document.activeElement;!B(a)&&!z(a)&&U()}),(0,s.watch)(()=>m.open,async e=>{e?(W=document.activeElement instanceof HTMLElement?document.activeElement:null,w.value=``,await(0,s.nextTick)(),K(),N()):G()},{immediate:!0});function q(){E.value||h(`cancel`)}let J=!1,Y=!1;function X(e){let t=e.target;J=B(t)||z(t)}function Z(e){Y=B(e.target)}function me(){let e=J&&!Y;J=!1,!e&&q()}function Q(e){if(!m.open||z(document.activeElement))return;if(e.key===`Escape`){if(!I())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),q();return}if(e.key!==`Tab`||!I())return;let t=V();if(t.length===0){e.preventDefault(),B(document.activeElement)||H();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!B(i))?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r?(e.preventDefault(),n.focus()):B(i)||(e.preventDefault(),n.focus())}function $(e){if(!m.open)return;let t=e.relatedTarget;if(t instanceof Element){if(B(t)||z(t))return}else if(t!==null)return;requestAnimationFrame(()=>{if(!m.open)return;let e=document.activeElement;B(e)||z(e)||e&&e!==document.body&&!e.isConnected||I()&&U()})}return typeof document<`u`&&(document.addEventListener(`keydown`,Q,!0),document.addEventListener(`focusout`,$,!0),document.addEventListener(`mousedown`,X,!0),document.addEventListener(`touchstart`,X,!0),document.addEventListener(`click`,Z,!0)),(0,s.onMounted)(()=>{m.open&&(K(),N())}),(0,s.onUnmounted)(()=>{typeof document<`u`&&(document.removeEventListener(`keydown`,Q,!0),document.removeEventListener(`focusout`,$,!0),document.removeEventListener(`mousedown`,X,!0),document.removeEventListener(`touchstart`,X,!0),document.removeEventListener(`click`,Z,!0)),G()}),f({focusCancel:()=>A()?.focus(),restoreFocus:G,isTopmost:I}),(t,i)=>((0,s.openBlock)(),(0,s.createBlock)(o.t,{open:n.open,size:n.size,role:n.tone===`danger`?`alertdialog`:`dialog`,"labelled-by":_,"described-by":D()?v:void 0,busy:n.busy,"close-on-overlay":!E.value,"close-disabled":E.value,"close-on-escape":!1,"trap-focus":!1,onClose:me},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`span`,{id:_,class:(0,s.normalizeClass)([`nb-confirm__heading`,`nb-confirm__heading--${n.tone}`])},[n.tone===`danger`?((0,s.openBlock)(),(0,s.createBlock)(r.t,{key:0,name:(0,s.unref)(ne.regular),size:16,"aria-hidden":`true`},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(n.title),1)],2)]),footer:(0,s.withCtx)(()=>[(0,s.createVNode)(e.t,{ref_key:`cancelRef`,ref:S,class:`nb-confirm__action nb-confirm__action--cancel`,variant:`secondary`,disabled:E.value,"data-nb-confirm":`cancel`,onClick:q},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(ce.value),1)]),_:1},8,[`disabled`]),(0,s.createVNode)(e.t,{ref_key:`confirmRef`,ref:C,class:`nb-confirm__action nb-confirm__action--confirm`,variant:oe.value,disabled:!k.value,loading:n.busy,"data-nb-confirm":`confirm`,onClick:fe},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(se.value),1)]),_:1},8,[`variant`,`disabled`,`loading`])]),default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{ref_key:`rootRef`,ref:b,class:(0,s.normalizeClass)([`nb-confirm`,n.contentClass])},[D()?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:v,class:`nb-confirm__body`},[(0,s.renderSlot)(t.$slots,`default`,{},()=>[n.message?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,c,(0,s.toDisplayString)(n.message),1)):(0,s.createCommentVNode)(``,!0)],!0),n.subject?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,{key:0,class:(0,s.normalizeClass)([`nb-confirm__subject`,`nb-confirm__subject--${n.tone}`])},[n.subjectLabel?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,l,(0,s.toDisplayString)(n.subjectLabel),1)):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,u,(0,s.toDisplayString)(n.subject),1)],2)):(0,s.createCommentVNode)(``,!0)])):(0,s.createCommentVNode)(``,!0),n.typeToConfirm?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,re,[(0,s.createVNode)(ee.t,{modelValue:w.value,"onUpdate:modelValue":i[0]||=e=>w.value=e,class:`nb-confirm__gate-field`,label:ue.value,helper:n.typeToConfirmHelper,disabled:E.value,autocomplete:`off`,spellcheck:`false`,"data-nb-confirm":`gate`,onKeydown:i[1]||=(0,s.withKeys)((0,s.withModifiers)(()=>{},[`prevent`]),[`enter`])},null,8,[`modelValue`,`label`,`helper`,`disabled`])])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`div`,ie,[n.busy?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,d,(0,s.toDisplayString)(le.value),1)):(0,s.createCommentVNode)(``,!0),n.succeeded&&n.successLabel?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,ae,[(0,s.createVNode)(r.t,{name:(0,s.unref)(te.regular),size:`sm`,"aria-hidden":`true`},null,8,[`name`]),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)(n.successLabel),1)])):(0,s.createCommentVNode)(``,!0),n.error?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:2,ref_key:`errorRef`,ref:x,class:`nb-confirm__error`,tabindex:`-1`},[(0,s.createVNode)(a.t,{variant:`error`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(n.error),1)]),_:1})],512)):(0,s.createCommentVNode)(``,!0)])],2)]),_:3},8,[`open`,`size`,`role`,`described-by`,`busy`,`close-on-overlay`,`close-disabled`]))}}),p=n.t(f,[[`__scopeId`,`data-v-52687d15`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -31,6 +31,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
31
31
|
class: "nb-date-picker__col"
|
|
32
32
|
}, ve = [
|
|
33
33
|
"id",
|
|
34
|
+
"aria-label",
|
|
34
35
|
"value",
|
|
35
36
|
"placeholder",
|
|
36
37
|
"disabled",
|
|
@@ -64,6 +65,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
64
65
|
"aria-hidden": "true"
|
|
65
66
|
}, De = { class: "nb-date-picker__fluid-row" }, Oe = [
|
|
66
67
|
"id",
|
|
68
|
+
"aria-label",
|
|
67
69
|
"value",
|
|
68
70
|
"placeholder",
|
|
69
71
|
"disabled",
|
|
@@ -166,23 +168,23 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
166
168
|
function nt(e, t) {
|
|
167
169
|
if (!(D.variant !== "default" || A)) return e ? t : D.helper ? He.value : void 0;
|
|
168
170
|
}
|
|
169
|
-
let rt = oe(), it = d(() => s(rt["aria-describedby"], nt(H.value, Ue.value), k.describedBy.value)), at = d(() => s(nt(U.value, We.value), k.describedBy.value)), ot = d(() => k.status.value === "error"), st = d(() => k.status.value === "warning"), W = d(() => !!D.error || ot.value), ct = d(() => !W.value && (!!D.warning || st.value)), G = d(() => !!D.endError || ot.value), lt = d(() => !G.value && (!!D.endWarning || st.value)), ut = d(() => W.value ? !0 : void 0), dt = d(() => G.value ? !0 : void 0), ft = d(() => D.type === "range" && !!D.endLabel), pt = d(() => D.endLabel || D.endPlaceholder);
|
|
170
|
-
function
|
|
171
|
+
let rt = oe(), it = d(() => s(rt["aria-describedby"], nt(H.value, Ue.value), k.describedBy.value)), at = d(() => s(nt(U.value, We.value), k.describedBy.value)), ot = d(() => k.status.value === "error"), st = d(() => k.status.value === "warning"), W = d(() => !!D.error || ot.value), ct = d(() => !W.value && (!!D.warning || st.value)), G = d(() => !!D.endError || ot.value), lt = d(() => !G.value && (!!D.endWarning || st.value)), ut = d(() => W.value ? !0 : void 0), dt = d(() => G.value ? !0 : void 0), ft = d(() => D.type === "range" && !!D.endLabel), pt = d(() => D.endLabel || D.endPlaceholder), mt = d(() => A ? D.endLabel || D.endPlaceholder || E.value.datePickerEndDate : void 0);
|
|
172
|
+
function ht(e) {
|
|
171
173
|
return D.min != null && e < D.min || D.max != null && e > D.max ? !0 : D.disabledDates ? typeof D.disabledDates == "function" ? D.disabledDates(e) : D.disabledDates.includes(e) : !1;
|
|
172
174
|
}
|
|
173
|
-
let
|
|
174
|
-
function
|
|
175
|
+
let gt = d(() => new Intl.DateTimeFormat(B.value).formatToParts(new Date(2e3, 0, 15)).map((e) => e.type).filter((e) => e === "day" || e === "month" || e === "year"));
|
|
176
|
+
function _t(e, t, n) {
|
|
175
177
|
let r = new Date(e, t - 1, n);
|
|
176
178
|
return r.getMonth() !== t - 1 || r.getDate() !== n ? null : (r.setFullYear(e), Q(r));
|
|
177
179
|
}
|
|
178
|
-
function
|
|
180
|
+
function vt(e) {
|
|
179
181
|
let t = e.split(/[\s./-]+/).filter(Boolean);
|
|
180
182
|
if (t.length !== 3) return null;
|
|
181
183
|
let n = t[0].length === 4 ? [
|
|
182
184
|
"year",
|
|
183
185
|
"month",
|
|
184
186
|
"day"
|
|
185
|
-
] :
|
|
187
|
+
] : gt.value;
|
|
186
188
|
if (n.length !== 3) return null;
|
|
187
189
|
let r = {
|
|
188
190
|
day: 0,
|
|
@@ -194,34 +196,34 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
194
196
|
if (i === "year" ? a.length !== 4 : a.length > 2) return null;
|
|
195
197
|
r[i] = Number(a);
|
|
196
198
|
}
|
|
197
|
-
return
|
|
199
|
+
return _t(r.year, r.month, r.day);
|
|
198
200
|
}
|
|
199
|
-
function
|
|
201
|
+
function yt(e) {
|
|
200
202
|
let t = e.trim();
|
|
201
203
|
if (!t) return null;
|
|
202
204
|
if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
|
|
203
205
|
let e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
204
206
|
return isNaN(e.getTime()) ? null : t;
|
|
205
207
|
}
|
|
206
|
-
if (/^[\d\s./-]+$/.test(t)) return
|
|
208
|
+
if (/^[\d\s./-]+$/.test(t)) return vt(t);
|
|
207
209
|
let n = new Date(t);
|
|
208
210
|
return isNaN(n.getTime()) ? null : Q(n);
|
|
209
211
|
}
|
|
210
|
-
function yt(e) {
|
|
211
|
-
let t = e.target.value, n = vt(t);
|
|
212
|
-
n && mt(n) || (n || t === "") && (O("update:modelValue", n), O("change", n));
|
|
213
|
-
}
|
|
214
212
|
function bt(e) {
|
|
215
|
-
let t = e.target.value, n =
|
|
216
|
-
n &&
|
|
213
|
+
let t = e.target.value, n = yt(t);
|
|
214
|
+
n && ht(n) || (n || t === "") && (O("update:modelValue", n), O("change", n));
|
|
217
215
|
}
|
|
218
216
|
function xt(e) {
|
|
219
|
-
|
|
217
|
+
let t = e.target.value, n = yt(t);
|
|
218
|
+
n && ht(n) || (n || t === "") && O("update:endValue", n);
|
|
220
219
|
}
|
|
221
|
-
function St() {
|
|
220
|
+
function St(e) {
|
|
221
|
+
N.value = e.target === L.value ? "end" : "start", D.type !== "simple" && !D.readonly && (z.value = N.value, P.value ? Tt() : K());
|
|
222
|
+
}
|
|
223
|
+
function Ct() {
|
|
222
224
|
N.value = null;
|
|
223
225
|
}
|
|
224
|
-
function
|
|
226
|
+
function wt(e) {
|
|
225
227
|
if (!(D.type === "simple" || D.readonly)) switch (e.key) {
|
|
226
228
|
case "Escape":
|
|
227
229
|
P.value && (q(), e.preventDefault());
|
|
@@ -234,7 +236,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
234
236
|
break;
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
|
-
function
|
|
239
|
+
function Tt() {
|
|
238
240
|
let e = qe.value?.querySelectorAll(".nb-date-picker__input-wrapper");
|
|
239
241
|
if (!e?.length) return;
|
|
240
242
|
let t = (z.value === "end" && e.length > 1 ? e[1] : e[0]).getBoundingClientRect(), n = R.value?.offsetWidth ?? 0, r = R.value?.offsetHeight ?? 0, i = t.left, a = t.bottom + 4;
|
|
@@ -249,14 +251,14 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
249
251
|
if (M.value || D.readonly || D.type === "simple" || P.value) return;
|
|
250
252
|
P.value = !0;
|
|
251
253
|
let e = z.value === "end" && D.endValue ? D.endValue : D.modelValue, t = e ? /* @__PURE__ */ new Date(e + "T00:00:00") : /* @__PURE__ */ new Date();
|
|
252
|
-
X.value = t.getFullYear(), Z.value = t.getMonth(), F.value = e || Q(/* @__PURE__ */ new Date()),
|
|
254
|
+
X.value = t.getFullYear(), Z.value = t.getMonth(), F.value = e || Q(/* @__PURE__ */ new Date()), Tt(), y(Tt);
|
|
253
255
|
}
|
|
254
256
|
function q() {
|
|
255
257
|
P.value && (P.value = !1, y(() => {
|
|
256
258
|
z.value === "end" && L.value ? L.value.focus() : I.value?.focus();
|
|
257
259
|
}));
|
|
258
260
|
}
|
|
259
|
-
function
|
|
261
|
+
function Et() {
|
|
260
262
|
P.value ? q() : (z.value = "start", K(), y(J));
|
|
261
263
|
}
|
|
262
264
|
function J() {
|
|
@@ -264,39 +266,39 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
264
266
|
(R.value?.querySelector(`[data-date="${F.value}"]`))?.focus();
|
|
265
267
|
});
|
|
266
268
|
}
|
|
267
|
-
function Et(e) {
|
|
268
|
-
mt(e) || (D.type === "range" ? z.value === "start" ? (O("update:modelValue", e), O("change", e), z.value = "end", F.value = e, y(() => L.value?.focus())) : (D.modelValue && e < D.modelValue ? (O("update:endValue", D.modelValue), O("update:modelValue", e), O("change", e)) : O("update:endValue", e), q()) : (O("update:modelValue", e), O("change", e), q()));
|
|
269
|
-
}
|
|
270
269
|
function Dt(e) {
|
|
270
|
+
ht(e) || (D.type === "range" ? z.value === "start" ? (O("update:modelValue", e), O("change", e), z.value = "end", F.value = e, y(() => L.value?.focus())) : (D.modelValue && e < D.modelValue ? (O("update:endValue", D.modelValue), O("update:modelValue", e), O("change", e)) : O("update:endValue", e), q()) : (O("update:modelValue", e), O("change", e), q()));
|
|
271
|
+
}
|
|
272
|
+
function Ot(e) {
|
|
271
273
|
let t = /* @__PURE__ */ new Date(F.value + "T00:00:00"), n = !0;
|
|
272
274
|
switch (e.key) {
|
|
273
275
|
case "ArrowRight":
|
|
274
|
-
|
|
276
|
+
kt(t, 1);
|
|
275
277
|
break;
|
|
276
278
|
case "ArrowLeft":
|
|
277
|
-
|
|
279
|
+
kt(t, -1);
|
|
278
280
|
break;
|
|
279
281
|
case "ArrowDown":
|
|
280
|
-
|
|
282
|
+
kt(t, 7);
|
|
281
283
|
break;
|
|
282
284
|
case "ArrowUp":
|
|
283
|
-
|
|
285
|
+
kt(t, -7);
|
|
284
286
|
break;
|
|
285
287
|
case "Home":
|
|
286
|
-
|
|
288
|
+
At(t, "start");
|
|
287
289
|
break;
|
|
288
290
|
case "End":
|
|
289
|
-
|
|
291
|
+
At(t, "end");
|
|
290
292
|
break;
|
|
291
293
|
case "PageUp":
|
|
292
|
-
e.shiftKey ?
|
|
294
|
+
e.shiftKey ? jt(t, -12) : jt(t, -1);
|
|
293
295
|
break;
|
|
294
296
|
case "PageDown":
|
|
295
|
-
e.shiftKey ?
|
|
297
|
+
e.shiftKey ? jt(t, 12) : jt(t, 1);
|
|
296
298
|
break;
|
|
297
299
|
case "Enter":
|
|
298
300
|
case " ":
|
|
299
|
-
e.preventDefault(),
|
|
301
|
+
e.preventDefault(), Dt(F.value);
|
|
300
302
|
return;
|
|
301
303
|
case "Escape":
|
|
302
304
|
q();
|
|
@@ -308,50 +310,50 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
308
310
|
}
|
|
309
311
|
n && e.preventDefault();
|
|
310
312
|
}
|
|
311
|
-
function
|
|
313
|
+
function kt(e, t) {
|
|
312
314
|
let n = new Date(e);
|
|
313
|
-
n.setDate(n.getDate() + t),
|
|
315
|
+
n.setDate(n.getDate() + t), Mt(n);
|
|
314
316
|
}
|
|
315
|
-
function
|
|
317
|
+
function At(e, t) {
|
|
316
318
|
let n = e.getDay();
|
|
317
319
|
D.weekStart === 1 && (n = n === 0 ? 6 : n - 1);
|
|
318
320
|
let r = t === "start" ? -n : 6 - n, i = new Date(e);
|
|
319
|
-
i.setDate(i.getDate() + r),
|
|
321
|
+
i.setDate(i.getDate() + r), Mt(i);
|
|
320
322
|
}
|
|
321
|
-
function
|
|
323
|
+
function jt(e, t) {
|
|
322
324
|
let n = new Date(e);
|
|
323
|
-
n.setMonth(n.getMonth() + t), n.getDate() !== e.getDate() && n.setDate(0),
|
|
325
|
+
n.setMonth(n.getMonth() + t), n.getDate() !== e.getDate() && n.setDate(0), Mt(n);
|
|
324
326
|
}
|
|
325
|
-
function
|
|
327
|
+
function Mt(e) {
|
|
326
328
|
let t = Q(e);
|
|
327
329
|
D.min != null && t < D.min || D.max != null && t > D.max || (F.value = t, X.value = e.getFullYear(), Z.value = e.getMonth(), J());
|
|
328
330
|
}
|
|
329
|
-
function
|
|
331
|
+
function Nt(e) {
|
|
330
332
|
let t = e.target, n = qe.value?.contains(t) ?? !1, r = R.value?.contains(t) ?? !1, i = Ye.value?.contains(t) ?? !1;
|
|
331
333
|
!n && !r && !i && q();
|
|
332
334
|
}
|
|
333
335
|
function Y() {
|
|
334
|
-
P.value &&
|
|
336
|
+
P.value && Tt();
|
|
335
337
|
}
|
|
336
338
|
ce(P, (e) => {
|
|
337
|
-
e ? (document.addEventListener("mousedown",
|
|
339
|
+
e ? (document.addEventListener("mousedown", Nt), window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y)) : (document.removeEventListener("mousedown", Nt), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y));
|
|
338
340
|
}), re(() => {
|
|
339
|
-
document.removeEventListener("mousedown",
|
|
341
|
+
document.removeEventListener("mousedown", Nt), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y);
|
|
340
342
|
});
|
|
341
343
|
let X = S((/* @__PURE__ */ new Date()).getFullYear()), Z = S((/* @__PURE__ */ new Date()).getMonth());
|
|
342
|
-
function
|
|
344
|
+
function Pt(e) {
|
|
343
345
|
let t = X.value * 12 + Z.value + e;
|
|
344
346
|
X.value = Math.floor(t / 12), Z.value = (t % 12 + 12) % 12;
|
|
345
347
|
let n = (/* @__PURE__ */ new Date(F.value + "T00:00:00")).getDate(), r = new Date(X.value, Z.value + 1, 0).getDate();
|
|
346
348
|
F.value = Q(new Date(X.value, Z.value, Math.min(n, r))), J();
|
|
347
349
|
}
|
|
348
|
-
let
|
|
350
|
+
let Ft = () => Pt(-1), It = () => Pt(1), Lt = () => Pt(-12), Rt = () => Pt(12), zt = d(() => {
|
|
349
351
|
let e = new Date(X.value, Z.value, 1).toLocaleDateString(B.value, {
|
|
350
352
|
month: "long",
|
|
351
353
|
year: "numeric"
|
|
352
354
|
});
|
|
353
355
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
354
|
-
}),
|
|
356
|
+
}), Bt = d(() => {
|
|
355
357
|
let e = [], t = new Date(2024, 0, D.weekStart === 0 ? 7 : 1);
|
|
356
358
|
for (let n = 0; n < 7; n++) {
|
|
357
359
|
let r = new Date(t);
|
|
@@ -367,7 +369,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
367
369
|
function Q(e) {
|
|
368
370
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
369
371
|
}
|
|
370
|
-
let
|
|
372
|
+
let Vt = d(() => Q(/* @__PURE__ */ new Date())), Ht = d(() => {
|
|
371
373
|
let e = X.value, t = Z.value, n = new Date(e, t, 1), r = new Date(e, t + 1, 0), i = n.getDay();
|
|
372
374
|
D.weekStart === 1 && (i = i === 0 ? 6 : i - 1);
|
|
373
375
|
let a = [], o = D.modelValue ?? null, s = D.endValue ?? null, c = o && s ? o < s ? o : s : null, l = o && s ? o < s ? s : o : null;
|
|
@@ -378,12 +380,12 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
378
380
|
date: n,
|
|
379
381
|
day: e.getDate(),
|
|
380
382
|
inMonth: t,
|
|
381
|
-
isToday: n ===
|
|
383
|
+
isToday: n === Vt.value,
|
|
382
384
|
isSelected: n === o || n === s,
|
|
383
385
|
inRange: c != null && l != null && n > c && n < l,
|
|
384
386
|
isRangeStart: n === c && l != null,
|
|
385
387
|
isRangeEnd: n === l && c != null,
|
|
386
|
-
isDisabled:
|
|
388
|
+
isDisabled: ht(n)
|
|
387
389
|
};
|
|
388
390
|
}
|
|
389
391
|
for (let n = i - 1; n >= 0; n--) a.push(ee(new Date(e, t, -n), !1));
|
|
@@ -391,11 +393,11 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
391
393
|
let u = 7 - a.length % 7;
|
|
392
394
|
if (u < 7) for (let n = 1; n <= u; n++) a.push(ee(new Date(e, t + 1, n), !1));
|
|
393
395
|
return a;
|
|
394
|
-
}),
|
|
396
|
+
}), Ut = d(() => {
|
|
395
397
|
let e = [];
|
|
396
|
-
for (let t = 0; t <
|
|
398
|
+
for (let t = 0; t < Ht.value.length; t += 7) e.push(Ht.value.slice(t, t + 7));
|
|
397
399
|
return e;
|
|
398
|
-
}), $ = d(() => D.variant === "fluid" ? "sm" : Be.value),
|
|
400
|
+
}), $ = d(() => D.variant === "fluid" ? "sm" : Be.value), Wt = d(() => [
|
|
399
401
|
"nb-date-picker",
|
|
400
402
|
`nb-date-picker--${D.variant}`,
|
|
401
403
|
`nb-date-picker--${Be.value}`,
|
|
@@ -408,13 +410,13 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
408
410
|
"nb-date-picker--disabled": M.value,
|
|
409
411
|
"nb-date-picker--readonly": D.readonly
|
|
410
412
|
}
|
|
411
|
-
]),
|
|
413
|
+
]), Gt = d(() => ({
|
|
412
414
|
"nb-date-picker__input-wrapper--focused": N.value === "start",
|
|
413
415
|
"nb-date-picker__input-wrapper--error": W.value,
|
|
414
416
|
"nb-date-picker__input-wrapper--warning": ct.value,
|
|
415
417
|
"nb-date-picker__input-wrapper--disabled": M.value,
|
|
416
418
|
"nb-date-picker__input-wrapper--readonly": D.readonly
|
|
417
|
-
})),
|
|
419
|
+
})), Kt = d(() => ({
|
|
418
420
|
"nb-date-picker__input-wrapper--focused": N.value === "end",
|
|
419
421
|
"nb-date-picker__input-wrapper--error": G.value,
|
|
420
422
|
"nb-date-picker__input-wrapper--warning": lt.value,
|
|
@@ -428,7 +430,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
428
430
|
}), (t, n) => (x(), m(u, null, [h("div", {
|
|
429
431
|
ref_key: "rootRef",
|
|
430
432
|
ref: qe,
|
|
431
|
-
class: b(
|
|
433
|
+
class: b(Wt.value)
|
|
432
434
|
}, [v.variant === "default" ? (x(), m(u, { key: 0 }, [
|
|
433
435
|
t.$slots.label && !w(A) ? ae(t.$slots, "label", { key: 0 }) : v.label && !ft.value && !w(A) ? (x(), f(i, {
|
|
434
436
|
key: 1,
|
|
@@ -460,7 +462,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
460
462
|
"for",
|
|
461
463
|
"required",
|
|
462
464
|
"disabled"
|
|
463
|
-
])) : p("", !0), h("div", { class: b(["nb-date-picker__input-wrapper",
|
|
465
|
+
])) : p("", !0), h("div", { class: b(["nb-date-picker__input-wrapper", Gt.value]) }, [h("input", ne({
|
|
464
466
|
id: w(j),
|
|
465
467
|
ref_key: "inputRef",
|
|
466
468
|
ref: I
|
|
@@ -475,10 +477,10 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
475
477
|
name: v.name,
|
|
476
478
|
"aria-invalid": ut.value,
|
|
477
479
|
"aria-describedby": it.value,
|
|
478
|
-
onInput: n[0] ||= (e) =>
|
|
479
|
-
onFocus:
|
|
480
|
-
onBlur:
|
|
481
|
-
onKeydown:
|
|
480
|
+
onInput: n[0] ||= (e) => bt(e),
|
|
481
|
+
onFocus: St,
|
|
482
|
+
onBlur: Ct,
|
|
483
|
+
onKeydown: wt
|
|
482
484
|
}), null, 16, ge), v.type === "simple" ? p("", !0) : (x(), f(e, {
|
|
483
485
|
key: 0,
|
|
484
486
|
variant: "ghost",
|
|
@@ -488,7 +490,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
488
490
|
disabled: w(M) || v.readonly,
|
|
489
491
|
tabindex: "-1",
|
|
490
492
|
label: v.modelValue ? w(E).datePickerChangeDate(V(v.modelValue)) : w(E).datePickerChooseDate,
|
|
491
|
-
onClick:
|
|
493
|
+
onClick: Et
|
|
492
494
|
}, null, 8, [
|
|
493
495
|
"icon",
|
|
494
496
|
"size",
|
|
@@ -506,11 +508,12 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
506
508
|
"for",
|
|
507
509
|
"required",
|
|
508
510
|
"disabled"
|
|
509
|
-
])) : p("", !0), h("div", { class: b(["nb-date-picker__input-wrapper",
|
|
511
|
+
])) : p("", !0), h("div", { class: b(["nb-date-picker__input-wrapper", Kt.value]) }, [h("input", {
|
|
510
512
|
id: Ve.value,
|
|
511
513
|
ref_key: "endInputRef",
|
|
512
514
|
ref: L,
|
|
513
515
|
type: "text",
|
|
516
|
+
"aria-label": mt.value,
|
|
514
517
|
class: "nb-date-picker__field",
|
|
515
518
|
value: et.value,
|
|
516
519
|
placeholder: v.endPlaceholder || Ze.value,
|
|
@@ -519,10 +522,10 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
519
522
|
required: v.required,
|
|
520
523
|
"aria-invalid": dt.value,
|
|
521
524
|
"aria-describedby": at.value,
|
|
522
|
-
onInput: n[1] ||= (e) =>
|
|
523
|
-
onFocus:
|
|
524
|
-
onBlur:
|
|
525
|
-
onKeydown:
|
|
525
|
+
onInput: n[1] ||= (e) => xt(e),
|
|
526
|
+
onFocus: St,
|
|
527
|
+
onBlur: Ct,
|
|
528
|
+
onKeydown: wt
|
|
526
529
|
}, null, 40, ve), _(e, {
|
|
527
530
|
variant: "ghost",
|
|
528
531
|
icon: w(fe),
|
|
@@ -531,7 +534,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
531
534
|
disabled: w(M) || v.readonly,
|
|
532
535
|
tabindex: "-1",
|
|
533
536
|
label: v.endValue ? w(E).datePickerChangeEndDate(V(v.endValue)) : w(E).datePickerChooseEndDate,
|
|
534
|
-
onClick:
|
|
537
|
+
onClick: Et
|
|
535
538
|
}, null, 8, [
|
|
536
539
|
"icon",
|
|
537
540
|
"size",
|
|
@@ -573,7 +576,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
573
576
|
gap: v.type === "range" ? "sm" : void 0,
|
|
574
577
|
class: "nb-date-picker__fields"
|
|
575
578
|
}, {
|
|
576
|
-
default: T(() => [h("div", { class: b(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid",
|
|
579
|
+
default: T(() => [h("div", { class: b(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid", Gt.value]) }, [(v.label || t.$slots.label || tt.value) && !w(A) ? (x(), m("div", ye, [t.$slots.label ? ae(t.$slots, "label", { key: 0 }) : (x(), m("label", {
|
|
577
580
|
key: 1,
|
|
578
581
|
for: w(j),
|
|
579
582
|
class: "nb-date-picker__inner-label"
|
|
@@ -600,10 +603,10 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
600
603
|
name: v.name,
|
|
601
604
|
"aria-invalid": ut.value,
|
|
602
605
|
"aria-describedby": it.value,
|
|
603
|
-
onInput: n[2] ||= (e) =>
|
|
604
|
-
onFocus:
|
|
605
|
-
onBlur:
|
|
606
|
-
onKeydown:
|
|
606
|
+
onInput: n[2] ||= (e) => bt(e),
|
|
607
|
+
onFocus: St,
|
|
608
|
+
onBlur: Ct,
|
|
609
|
+
onKeydown: wt
|
|
607
610
|
}), null, 16, Ce), v.type === "simple" ? p("", !0) : (x(), f(e, {
|
|
608
611
|
key: 0,
|
|
609
612
|
variant: "ghost",
|
|
@@ -613,7 +616,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
613
616
|
disabled: w(M) || v.readonly,
|
|
614
617
|
tabindex: "-1",
|
|
615
618
|
label: v.modelValue ? w(E).datePickerChangeDate(V(v.modelValue)) : w(E).datePickerChooseDate,
|
|
616
|
-
onClick:
|
|
619
|
+
onClick: Et
|
|
617
620
|
}, null, 8, [
|
|
618
621
|
"icon",
|
|
619
622
|
"size",
|
|
@@ -621,8 +624,8 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
621
624
|
"label"
|
|
622
625
|
]))])], 2), v.type === "range" ? (x(), m("div", {
|
|
623
626
|
key: 0,
|
|
624
|
-
class: b(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid",
|
|
625
|
-
}, [pt.value || U.value ? (x(), m("div", we, [h("label", {
|
|
627
|
+
class: b(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid", Kt.value])
|
|
628
|
+
}, [(pt.value || U.value) && !w(A) ? (x(), m("div", we, [h("label", {
|
|
626
629
|
for: Ve.value,
|
|
627
630
|
class: "nb-date-picker__inner-label"
|
|
628
631
|
}, [g(C(pt.value) + " ", 1), v.required ? (x(), m("span", Ee, "*")) : p("", !0)], 8, Te), U.value ? (x(), f(a, {
|
|
@@ -638,6 +641,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
638
641
|
ref_key: "endInputRef",
|
|
639
642
|
ref: L,
|
|
640
643
|
type: "text",
|
|
644
|
+
"aria-label": mt.value,
|
|
641
645
|
class: "nb-date-picker__field",
|
|
642
646
|
value: et.value,
|
|
643
647
|
placeholder: v.endPlaceholder || Ze.value,
|
|
@@ -646,10 +650,10 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
646
650
|
required: v.required,
|
|
647
651
|
"aria-invalid": dt.value,
|
|
648
652
|
"aria-describedby": at.value,
|
|
649
|
-
onInput: n[3] ||= (e) =>
|
|
650
|
-
onFocus:
|
|
651
|
-
onBlur:
|
|
652
|
-
onKeydown:
|
|
653
|
+
onInput: n[3] ||= (e) => xt(e),
|
|
654
|
+
onFocus: St,
|
|
655
|
+
onBlur: Ct,
|
|
656
|
+
onKeydown: wt
|
|
653
657
|
}, null, 40, Oe), _(e, {
|
|
654
658
|
variant: "ghost",
|
|
655
659
|
icon: w(fe),
|
|
@@ -658,7 +662,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
658
662
|
disabled: w(M) || v.readonly,
|
|
659
663
|
tabindex: "-1",
|
|
660
664
|
label: v.endValue ? w(E).datePickerChangeEndDate(V(v.endValue)) : w(E).datePickerChooseEndDate,
|
|
661
|
-
onClick:
|
|
665
|
+
onClick: Et
|
|
662
666
|
}, null, 8, [
|
|
663
667
|
"icon",
|
|
664
668
|
"size",
|
|
@@ -683,7 +687,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
683
687
|
class: ["nb-date-picker__calendar", { "nb-date-picker__calendar--sheet": w(Je) }]
|
|
684
688
|
}, w(ze), {
|
|
685
689
|
style: w(Je) ? void 0 : Xe.value,
|
|
686
|
-
onKeydown:
|
|
690
|
+
onKeydown: Ot,
|
|
687
691
|
onMousedown: n[4] ||= le(() => {}, ["prevent"])
|
|
688
692
|
}), [h("div", Ae, [
|
|
689
693
|
_(e, {
|
|
@@ -692,7 +696,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
692
696
|
size: "sm",
|
|
693
697
|
class: "nb-date-picker__cal-nav",
|
|
694
698
|
label: w(E).datePickerPreviousYear,
|
|
695
|
-
onClick:
|
|
699
|
+
onClick: Lt
|
|
696
700
|
}, null, 8, ["icon", "label"]),
|
|
697
701
|
_(e, {
|
|
698
702
|
variant: "ghost",
|
|
@@ -700,20 +704,20 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
700
704
|
size: "sm",
|
|
701
705
|
class: "nb-date-picker__cal-nav",
|
|
702
706
|
label: w(E).datePickerPreviousMonth,
|
|
703
|
-
onClick:
|
|
707
|
+
onClick: Ft
|
|
704
708
|
}, null, 8, ["icon", "label"]),
|
|
705
709
|
h("span", {
|
|
706
710
|
id: Ge.value,
|
|
707
711
|
class: "nb-date-picker__cal-title",
|
|
708
712
|
"aria-live": "polite"
|
|
709
|
-
}, C(
|
|
713
|
+
}, C(zt.value), 9, je),
|
|
710
714
|
_(e, {
|
|
711
715
|
variant: "ghost",
|
|
712
716
|
icon: w(ue),
|
|
713
717
|
size: "sm",
|
|
714
718
|
class: "nb-date-picker__cal-nav",
|
|
715
719
|
label: w(E).datePickerNextMonth,
|
|
716
|
-
onClick:
|
|
720
|
+
onClick: It
|
|
717
721
|
}, null, 8, ["icon", "label"]),
|
|
718
722
|
_(e, {
|
|
719
723
|
variant: "ghost",
|
|
@@ -721,18 +725,18 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
721
725
|
size: "sm",
|
|
722
726
|
class: "nb-date-picker__cal-nav",
|
|
723
727
|
label: w(E).datePickerNextYear,
|
|
724
|
-
onClick:
|
|
728
|
+
onClick: Rt
|
|
725
729
|
}, null, 8, ["icon", "label"])
|
|
726
730
|
]), h("table", {
|
|
727
731
|
role: "grid",
|
|
728
732
|
"aria-labelledby": Ge.value,
|
|
729
733
|
class: "nb-date-picker__cal-table"
|
|
730
|
-
}, [h("thead", null, [h("tr", Ne, [(x(!0), m(u, null, ie(
|
|
734
|
+
}, [h("thead", null, [h("tr", Ne, [(x(!0), m(u, null, ie(Bt.value, (e) => (x(), m("th", {
|
|
731
735
|
key: e.narrow,
|
|
732
736
|
scope: "col",
|
|
733
737
|
class: "nb-date-picker__cal-weekday",
|
|
734
738
|
abbr: e.full
|
|
735
|
-
}, C(e.narrow), 9, Pe))), 128))])]), h("tbody", null, [(x(!0), m(u, null, ie(
|
|
739
|
+
}, C(e.narrow), 9, Pe))), 128))])]), h("tbody", null, [(x(!0), m(u, null, ie(Ut.value, (e, t) => (x(), m("tr", { key: t }, [(x(!0), m(u, null, ie(e, (e) => (x(), m("td", {
|
|
736
740
|
key: e.key,
|
|
737
741
|
role: "gridcell",
|
|
738
742
|
"aria-selected": e.isSelected || void 0,
|
|
@@ -753,7 +757,7 @@ var he = { class: "nb-date-picker__col" }, ge = [
|
|
|
753
757
|
disabled: e.isDisabled,
|
|
754
758
|
"aria-label": Qe(e.date),
|
|
755
759
|
"data-date": e.date,
|
|
756
|
-
onClick: (t) =>
|
|
760
|
+
onClick: (t) => Dt(e.date)
|
|
757
761
|
}, C(e.day), 11, Ie)], 8, Fe))), 128))]))), 128))])], 8, Me)], 16, ke)) : p("", !0)]))], 64));
|
|
758
762
|
}
|
|
759
763
|
});
|