@nubisco/ui 5.53.0 → 5.54.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/{ActionGroup-McCtSDV8.cjs → ActionGroup-0rG92kFk.cjs} +1 -1
- package/dist/{ActionGroup-CkwZEnUN.js → ActionGroup-Cn22xj1t.js} +2 -2
- package/dist/{AiLabel-BwGuSf92.cjs → AiLabel-AGSSBanb.cjs} +1 -1
- package/dist/{AiLabel-CT7tpXv4.js → AiLabel-D32aNf1F.js} +1 -1
- package/dist/{AiProvider-DN3DecBN.cjs → AiProvider-CLtCD_UR.cjs} +1 -1
- package/dist/{AiProvider-lGUifyvk.js → AiProvider-gprbR5ts.js} +4 -4
- package/dist/{BackToTop-BWj2PURK.js → BackToTop-BDFb1y3c.js} +1 -1
- package/dist/{BackToTop-CbGWaDiv.cjs → BackToTop-R6yiw3lt.cjs} +1 -1
- package/dist/{Banner-DksCkGVd.js → Banner-BjnbX4C3.js} +1 -1
- package/dist/{Banner-DsiuPzPh.cjs → Banner-C-mikJ5n.cjs} +1 -1
- package/dist/{BatchActions-xnTXMU6B.cjs → BatchActions-6IO5GRFm.cjs} +1 -1
- package/dist/{BatchActions-iHu14Sfz.js → BatchActions-Ckx8kyZt.js} +2 -2
- package/dist/{BlueprintControls-COcm1KWW.js → BlueprintControls-Bt4KoDp5.js} +1 -1
- package/dist/{BlueprintControls-3Lc3BcAk.cjs → BlueprintControls-zX5yxOB1.cjs} +1 -1
- package/dist/{Board-B2v-oPUr.js → Board-BdqGOVNF.js} +1 -1
- package/dist/{Board-C43JjSsH.cjs → Board-DtOWyvKh.cjs} +1 -1
- package/dist/{BottomPanel-cNzWs1-8.cjs → BottomPanel-C_u39INJ.cjs} +1 -1
- package/dist/{BottomPanel-C6r_9aLy.js → BottomPanel-CkEc9gvb.js} +1 -1
- package/dist/{Breadcrumbs-B2SMDfCA.js → Breadcrumbs-Bc-acmPE.js} +2 -2
- package/dist/{Breadcrumbs-D1pYElI6.cjs → Breadcrumbs-BzyDVvEk.cjs} +1 -1
- package/dist/{Briefing-W7gtZwdT.js → Briefing-BiEICh1u.js} +1 -1
- package/dist/{Briefing-Cqw3zBQO.cjs → Briefing-DwKWCOGm.cjs} +1 -1
- package/dist/{BriefingDestination-CeClIu61.js → BriefingDestination-BjNteNgh.js} +1 -1
- package/dist/{BriefingDestination-CtsWFs9U.cjs → BriefingDestination-Cs1y3z_5.cjs} +1 -1
- package/dist/Button-CGIbF1e-.cjs +1 -0
- package/dist/{Button-CxJMKPpw.js → Button-DmJ_J3UO.js} +55 -53
- package/dist/{ButtonSet-D7ieqb8C.js → ButtonSet-Cg1ixzOK.js} +1 -1
- package/dist/{ButtonSet-C2Z5sYSv.cjs → ButtonSet-SziuuT6_.cjs} +1 -1
- package/dist/{Calendar-BmC3wBlS.js → Calendar-fVDg_EgD.js} +1 -1
- package/dist/{Calendar-EO2vU4ls.cjs → Calendar-fsZN4OIr.cjs} +1 -1
- package/dist/{ChatMessage-DYv7Vniv.cjs → ChatMessage-1L_xCXZF.cjs} +1 -1
- package/dist/{ChatMessage-DSeGKAOq.js → ChatMessage-C2Ecm175.js} +1 -1
- package/dist/{ChatThread-CCtckadF.cjs → ChatThread-B_F3xTdE.cjs} +1 -1
- package/dist/{ChatThread-D70zpB0f.js → ChatThread-COdOb1rH.js} +2 -2
- package/dist/{CloseButton-F7W1E8oX.cjs → CloseButton-Bdk7rJ8E.cjs} +1 -1
- package/dist/{CloseButton-BMJBwHvG.js → CloseButton-CAPfd6yf.js} +1 -1
- package/dist/{CommandPalette-DSE40a5L.cjs → CommandPalette-CC_Aj4Uh.cjs} +1 -1
- package/dist/{CommandPalette-DjkNy4l7.js → CommandPalette-zqTMjpm8.js} +1 -1
- package/dist/{Confirm-Sl4LWoSK.cjs → Confirm-Baz2WG7b.cjs} +1 -1
- package/dist/{Confirm-BLXSK-OZ.js → Confirm-CvMuXK9Q.js} +3 -3
- package/dist/{ContentSwitcher-CQvxg6RC.cjs → ContentSwitcher-DYxJZdcm.cjs} +1 -1
- package/dist/{ContentSwitcher-DuHRX4Y6.js → ContentSwitcher-NpFxiGbz.js} +1 -1
- package/dist/{CopyButton-DMuuBwJc.cjs → CopyButton-D-cnpfOJ.cjs} +1 -1
- package/dist/{CopyButton-CfEOWedU.js → CopyButton-MOJj3pS0.js} +1 -1
- package/dist/{DataTable-7GkgyPz9.js → DataTable-B8THDBLS.js} +3 -3
- package/dist/{DataTable-D8y7LUof.cjs → DataTable-DeFzOlcP.cjs} +1 -1
- package/dist/{DatePicker-CeDO01NZ.cjs → DatePicker-B5YRb64p.cjs} +1 -1
- package/dist/{DatePicker-BkHd2fJW.js → DatePicker-BrUXcNUj.js} +1 -1
- package/dist/{FileUploader-VBJtI2xh.js → FileUploader-CcGdRBxp.js} +1 -1
- package/dist/{FileUploader-CPTj5s_M.cjs → FileUploader-CcieVEGZ.cjs} +1 -1
- package/dist/{ImagePicker-BkZVENEg.js → ImagePicker-LhpR7jjR.js} +1 -1
- package/dist/{ImagePicker-D8qyyjVv.cjs → ImagePicker-vhg7b-UL.cjs} +1 -1
- package/dist/{LogView-u_QhvV__.js → LogView-BLa9W5S7.js} +2 -2
- package/dist/{LogView-JjJVH_NA.cjs → LogView-BNztzJri.cjs} +1 -1
- package/dist/{Modal-DaXgWyZN.js → Modal-CESCi2dE.js} +3 -3
- package/dist/{Modal-CRbvPpfy.cjs → Modal-C_EWDvmH.cjs} +1 -1
- package/dist/{NotificationCenter-D0PKt3fk.js → NotificationCenter-DkGc0ETD.js} +2 -2
- package/dist/{NotificationCenter-fmSEnZDX.cjs → NotificationCenter-DxZgHQyt.cjs} +1 -1
- package/dist/{NumberInput-B7_EP2yg.js → NumberInput-B91ahziS.js} +1 -1
- package/dist/{NumberInput-CHWFFpDv.cjs → NumberInput-DLPSNgsr.cjs} +1 -1
- package/dist/{OverflowMenu-DXJ8waZo.js → OverflowMenu-BWZ7c8oI.js} +1 -1
- package/dist/{OverflowMenu-CWgdicDN.cjs → OverflowMenu-C8q28FrD.cjs} +1 -1
- package/dist/{PageHeader-KKxiyfqh.cjs → PageHeader-DElq_kdh.cjs} +1 -1
- package/dist/{PageHeader-Bypc30sW.js → PageHeader-DOYN9sto.js} +1 -1
- package/dist/{Pagination-DTsfPCOs.cjs → Pagination-9mPN8ych.cjs} +1 -1
- package/dist/{Pagination-CjOtISav.js → Pagination-CxBHFwy0.js} +2 -2
- package/dist/{Search-xsC4Tm0d.js → Search-Bwdxxe29.js} +2 -2
- package/dist/{Search-CKXtAyrU.cjs → Search-DIZ1Ea45.cjs} +1 -1
- package/dist/{Select-CqLa55kO.js → Select-7gJ3_fWh.js} +1 -1
- package/dist/{Select-CPztC5IV.cjs → Select-Dg4HSHOu.cjs} +1 -1
- package/dist/{Shell-BWLjIdD0.cjs → Shell-BZslT2aj.cjs} +1 -1
- package/dist/{Shell-DZfaTUo3.js → Shell-CRmhoU2H.js} +2 -2
- package/dist/{ShellPanel-K4vyQYQM.js → ShellPanel-C4vQJmRI.js} +1 -1
- package/dist/{ShellPanel-ColJQNUK.cjs → ShellPanel-DUBq5BL6.cjs} +1 -1
- package/dist/{Slider-BLkYlDHi.js → Slider-B6QXQMqb.js} +1 -1
- package/dist/{Slider-DGTE-3wW.cjs → Slider-B7m_luyq.cjs} +1 -1
- package/dist/{TableOfContents-WDCjtpK6.js → TableOfContents-CeZX4dH0.js} +1 -1
- package/dist/{TableOfContents-BzG-BsKk.cjs → TableOfContents-D9FCu6gN.cjs} +1 -1
- package/dist/{TextInput-HEjIGR6p.js → TextInput-BeqDf1R7.js} +1 -1
- package/dist/{TextInput-CKSRFb0q.cjs → TextInput-SJ34hD2Y.cjs} +1 -1
- package/dist/{Toast-DHjc9WQU.cjs → Toast-CN5Jzkr5.cjs} +1 -1
- package/dist/{Toast-DxZ2xjeq.js → Toast-DIf2XRCa.js} +2 -2
- package/dist/{Toaster-C227oHXu.js → Toaster-ByObLDkk.js} +1 -1
- package/dist/{Toaster-IS3DUaZt.cjs → Toaster-CJAbZ9pv.cjs} +1 -1
- package/dist/{UserMenu-BnGiKwDE.cjs → UserMenu-BjSO_Uml.cjs} +1 -1
- package/dist/{UserMenu-C54sf0xb.js → UserMenu-CjmhyTwN.js} +1 -1
- package/dist/{Video-BFik9HZq.js → Video-Agby8uRA.js} +1 -1
- package/dist/{Video-Cnqsjo4n.cjs → Video-B93sRbBU.cjs} +1 -1
- package/dist/{Walkthrough-JqWDEe00.js → Walkthrough-DYYqtpwJ.js} +2 -2
- package/dist/{Walkthrough-DHgb972k.cjs → Walkthrough-DxAIdo3M.cjs} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +267 -267
- 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/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/BackToTop.cjs +1 -1
- package/dist/components/BackToTop.mjs +1 -1
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Banner.mjs +1 -1
- package/dist/components/BatchActions.cjs +1 -1
- package/dist/components/BatchActions.mjs +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.mjs +1 -1
- package/dist/components/BottomPanel.cjs +1 -1
- package/dist/components/BottomPanel.mjs +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/BriefingDestination.cjs +1 -1
- package/dist/components/BriefingDestination.mjs +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.context.d.ts +21 -0
- package/dist/components/Button.context.d.ts.map +1 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.vue.d.ts +1 -0
- package/dist/components/Button.vue.d.ts.map +1 -1
- package/dist/components/ButtonSet.cjs +1 -1
- package/dist/components/ButtonSet.mjs +1 -1
- package/dist/components/Calendar.cjs +1 -1
- package/dist/components/Calendar.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/CloseButton.cjs +1 -1
- package/dist/components/CloseButton.mjs +1 -1
- package/dist/components/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette.mjs +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/ContentSwitcher.cjs +1 -1
- package/dist/components/ContentSwitcher.mjs +1 -1
- package/dist/components/CopyButton.cjs +1 -1
- package/dist/components/CopyButton.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/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/ImagePicker.cjs +1 -1
- package/dist/components/ImagePicker.mjs +1 -1
- package/dist/components/LogView.cjs +1 -1
- package/dist/components/LogView.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NumberInput.cjs +1 -1
- package/dist/components/NumberInput.mjs +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/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/Shell.cjs +1 -1
- package/dist/components/Shell.mjs +1 -1
- package/dist/components/ShellPanel.cjs +1 -1
- package/dist/components/ShellPanel.mjs +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.mjs +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/components/Toaster.cjs +1 -1
- package/dist/components/Toaster.mjs +1 -1
- package/dist/components/UserMenu.cjs +1 -1
- package/dist/components/UserMenu.mjs +1 -1
- package/dist/components/Video.cjs +1 -1
- package/dist/components/Video.mjs +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +155 -155
- package/dist/{main-Dr-OZ97R.cjs → main-Cs0FFBfV.cjs} +2 -2
- package/dist/{main-hHSQ2Z9E.js → main-D6qY7QeE.js} +76 -76
- package/dist/main.d.ts +9 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/Button-5ClGtoaz.cjs +0 -1
|
@@ -34,17 +34,17 @@ var g = Object.defineProperty, _ = (e, t) => {
|
|
|
34
34
|
"ul",
|
|
35
35
|
"ol",
|
|
36
36
|
"li"
|
|
37
|
-
]),
|
|
37
|
+
]), b = new Set(["br"]), x = new Set([
|
|
38
38
|
"class",
|
|
39
39
|
"style",
|
|
40
40
|
"dir",
|
|
41
41
|
"lang"
|
|
42
|
-
]),
|
|
42
|
+
]), ue = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), S = new Set(/* @__PURE__ */ "color.background-color.font-family.font-size.font-style.font-variant.font-weight.letter-spacing.line-height.text-align.text-decoration.text-transform.white-space.word-break.overflow-wrap.opacity.display.flex-direction.align-items.justify-content.gap.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.max-width.min-width.border-radius".split(".")), C = /url\(|image-set\(|expression\(|javascript:|@import|\\/i, de = /^[A-Za-z_-][A-Za-z0-9_-]*$/, fe = (e) => e.split(";").map((e) => {
|
|
43
43
|
let t = e.indexOf(":");
|
|
44
44
|
if (t < 0) return "";
|
|
45
45
|
let n = e.slice(0, t).trim().toLowerCase(), r = e.slice(t + 1).trim();
|
|
46
|
-
return !n || !r ? "" :
|
|
47
|
-
}).filter(Boolean).join("; "),
|
|
46
|
+
return !n || !r ? "" : S.has(n) ? C.test(r) ? (k(`style-value:${n}`, `The value of "${n}" was dropped: tooltip content may not load a resource or call a CSS function that does.`), "") : `${n}: ${r}` : (k(`style:${n}`, `"${n}" is not an allowed tooltip content style property and was dropped.`), "");
|
|
47
|
+
}).filter(Boolean).join("; "), w = (e) => e.split(/\s+/).filter((e) => e ? de.test(e) ? !0 : (k(`class:${e}`, `"${e}" is not a valid class token for tooltip content and was dropped.`), !1) : !1).join(" "), T = (e, t) => e === "style" ? fe(t) : e === "class" ? w(t) : t, pe = new Set([
|
|
48
48
|
"b",
|
|
49
49
|
"strong",
|
|
50
50
|
"em",
|
|
@@ -56,15 +56,15 @@ var g = Object.defineProperty, _ = (e, t) => {
|
|
|
56
56
|
"kbd",
|
|
57
57
|
"br",
|
|
58
58
|
"p"
|
|
59
|
-
]),
|
|
59
|
+
]), me = {
|
|
60
60
|
"<": "<",
|
|
61
61
|
">": ">",
|
|
62
62
|
"\"": """,
|
|
63
63
|
"'": "'"
|
|
64
|
-
}, E = (e) => e.replace(/&(?!(?:[a-zA-Z][a-zA-Z0-9]{1,10}|#\d{1,7}|#[xX][0-9a-fA-F]{1,6});)/g, "&").replace(/[<>"']/g, (e) =>
|
|
64
|
+
}, E = (e) => e.replace(/&(?!(?:[a-zA-Z][a-zA-Z0-9]{1,10}|#\d{1,7}|#[xX][0-9a-fA-F]{1,6});)/g, "&").replace(/[<>"']/g, (e) => me[e]), D = (e) => e.split(/(<[^<>]*>)/g).map((e) => {
|
|
65
65
|
if (e.startsWith("<") && e.endsWith(">")) {
|
|
66
66
|
let t = /^<\s*(\/?)\s*([a-zA-Z][a-zA-Z0-9]*)\s*\/?\s*>$/.exec(e), n = t?.[2]?.toLowerCase();
|
|
67
|
-
return n &&
|
|
67
|
+
return n && pe.has(n) ? `<${t[1]}${n}>` : (n && k(`string-tag:${n}`, `<${n}> is not allowed in a tooltip string and was shown as text. Use the structured content form for anything richer.`), E(e));
|
|
68
68
|
}
|
|
69
69
|
return E(e).replace(/\n/g, "<br>");
|
|
70
70
|
}).join(""), O = /* @__PURE__ */ new Set(), k = (e, t) => {
|
|
@@ -74,8 +74,8 @@ var g = Object.defineProperty, _ = (e, t) => {
|
|
|
74
74
|
if (!e || typeof e != "object" || !e.component) return "";
|
|
75
75
|
let { component: t, props: n = {}, children: r, content: i } = e, a = r === void 0 ? i : r, o = Array.isArray(a) ? A(a) : a === void 0 ? "" : D(String(a)), s = String(t).toLowerCase();
|
|
76
76
|
if (!y.has(s)) return k(`tag:${s}`, `<${s}> is not allowed in tooltip content and was dropped. Allowed tags: ${[...y].join(", ")}.`), o;
|
|
77
|
-
let c = Object.entries(n).filter(([e]) =>
|
|
78
|
-
return
|
|
77
|
+
let c = Object.entries(n).filter(([e]) => x.has(e) ? !0 : (k(`prop:${e}`, `"${e}" is not an allowed tooltip content prop and was dropped. Allowed props: ${[...x].join(", ")}.`), !1)).map(([e, t]) => [e, T(e, String(t))]).filter(([, e]) => e !== "").map(([e, t]) => `${e}="${ue(t)}"`).join(" "), l = `<${s}${c ? ` ${c}` : ""}>`;
|
|
78
|
+
return b.has(s) ? l : `${l}${o}</${s}>`;
|
|
79
79
|
}, j = (e) => e ? typeof e == "string" ? D(e) : Array.isArray(e) ? A(e) : "" : "", M = Object.freeze({
|
|
80
80
|
micro: 70,
|
|
81
81
|
quick: 110,
|
|
@@ -531,21 +531,21 @@ function St() {
|
|
|
531
531
|
document.querySelectorAll("span.nb-tooltip").forEach((e) => e.remove());
|
|
532
532
|
}
|
|
533
533
|
//#endregion
|
|
534
|
-
//#region src/components/Button.
|
|
535
|
-
var Ct = /* @__PURE__ */ function(e) {
|
|
534
|
+
//#region src/components/Button.context.ts
|
|
535
|
+
var Ct = Symbol.for("@nubisco/ui:button-defaults"), wt = /* @__PURE__ */ function(e) {
|
|
536
536
|
return e.Button = "button", e.Submit = "submit", e.Reset = "reset", e;
|
|
537
|
-
}(
|
|
537
|
+
}(wt || {}), Tt = {
|
|
538
538
|
key: 0,
|
|
539
539
|
class: "nb-button__label"
|
|
540
|
-
},
|
|
540
|
+
}, Et = {
|
|
541
541
|
key: 1,
|
|
542
542
|
class: "nb-button__decorations"
|
|
543
|
-
},
|
|
543
|
+
}, Dt = {
|
|
544
544
|
key: 0,
|
|
545
545
|
class: "nb-button__spinner",
|
|
546
546
|
"aria-hidden": "true"
|
|
547
|
-
},
|
|
548
|
-
function
|
|
547
|
+
}, Ot = /* @__PURE__ */ new Set();
|
|
548
|
+
function kt(e) {
|
|
549
549
|
if (typeof e == "string") return e;
|
|
550
550
|
if (e && (typeof e == "object" || typeof e == "function")) {
|
|
551
551
|
let t = e;
|
|
@@ -555,7 +555,7 @@ function Ot(e) {
|
|
|
555
555
|
}
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region src/components/Button.vue
|
|
558
|
-
var
|
|
558
|
+
var At = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
559
559
|
__name: "Button",
|
|
560
560
|
props: {
|
|
561
561
|
variant: { default: void 0 },
|
|
@@ -563,6 +563,7 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
563
563
|
type: Boolean,
|
|
564
564
|
default: !1
|
|
565
565
|
},
|
|
566
|
+
align: { default: void 0 },
|
|
566
567
|
size: { default: void 0 },
|
|
567
568
|
disabled: {
|
|
568
569
|
type: Boolean,
|
|
@@ -581,7 +582,7 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
581
582
|
type: Boolean,
|
|
582
583
|
default: void 0
|
|
583
584
|
},
|
|
584
|
-
type: { default:
|
|
585
|
+
type: { default: wt.Button },
|
|
585
586
|
href: { default: void 0 },
|
|
586
587
|
target: { default: void 0 },
|
|
587
588
|
rel: { default: void 0 },
|
|
@@ -589,40 +590,40 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
589
590
|
},
|
|
590
591
|
emits: ["click"],
|
|
591
592
|
setup(e, { emit: t }) {
|
|
592
|
-
let d = e, g = t, _ = s(() => d.variant === "tertiary" ? "primary" : d.variant === "danger-tertiary" ? "danger" : d.variant), v = s(() => d.outlined || d.variant === "tertiary" || d.variant === "danger-tertiary"), y = p(o, null),
|
|
593
|
+
let d = e, g = t, _ = s(() => d.variant === "tertiary" ? "primary" : d.variant === "danger-tertiary" ? "danger" : d.variant), v = s(() => d.outlined || d.variant === "tertiary" || d.variant === "danger-tertiary"), y = p(o, null), b = s(() => d.size ?? y?.size.value ?? r.Medium), x = p(Ct, {}), ue = s(() => d.align ?? x.align ?? "start"), S = p(a, null), C = null;
|
|
593
594
|
ne(() => {
|
|
594
|
-
|
|
595
|
-
}), te(() =>
|
|
596
|
-
let de = se(), fe = oe(),
|
|
597
|
-
if (!(!
|
|
595
|
+
S && _.value === "primary" && !v.value && (C = S.register());
|
|
596
|
+
}), te(() => C?.());
|
|
597
|
+
let de = se(), fe = oe(), w = s(() => !de.default && !!(d.icon || d.loading)), T = s(() => !!(d.loading || d.icon)), pe = s(() => {
|
|
598
|
+
if (!(!w.value || !d.label)) return fe["aria-label"] ?? d.label;
|
|
598
599
|
}), me = s(() => {
|
|
599
600
|
let e = d.tooltipPosition;
|
|
600
|
-
return
|
|
601
|
-
header:
|
|
601
|
+
return O.value ? {
|
|
602
|
+
header: w.value ? d.label : void 0,
|
|
602
603
|
body: d.disabledReason,
|
|
603
604
|
aria: "description",
|
|
604
605
|
position: e
|
|
605
|
-
} :
|
|
606
|
+
} : w.value && d.label ? {
|
|
606
607
|
body: d.label,
|
|
607
608
|
aria: "none",
|
|
608
609
|
position: e
|
|
609
610
|
} : void 0;
|
|
610
|
-
}),
|
|
611
|
+
}), E = i(), D = s(() => d.disabled || d.loading), O = s(() => d.disabled && !!d.disabledReason), k = s(() => M.value === "button" && D.value && !O.value ? !0 : void 0), A = s(() => d.to != null && !!E.value && !D.value), j = s(() => {
|
|
611
612
|
if (typeof d.to == "string") return d.to;
|
|
612
613
|
if (d.href) return d.href;
|
|
613
|
-
}),
|
|
614
|
-
href:
|
|
614
|
+
}), M = s(() => A.value ? E.value : j.value || d.to != null && E.value ? "a" : "button"), he = s(() => M.value === "a" ? D.value ? { role: "link" } : {
|
|
615
|
+
href: j.value,
|
|
615
616
|
target: d.target,
|
|
616
617
|
rel: d.rel
|
|
617
618
|
} : {});
|
|
618
|
-
function
|
|
619
|
-
if (
|
|
619
|
+
function ge(e) {
|
|
620
|
+
if (D.value) {
|
|
620
621
|
e.preventDefault();
|
|
621
622
|
return;
|
|
622
623
|
}
|
|
623
624
|
g("click", e);
|
|
624
625
|
}
|
|
625
|
-
let
|
|
626
|
+
let N = {
|
|
626
627
|
xxs: 16,
|
|
627
628
|
xs: 16,
|
|
628
629
|
sm: 16,
|
|
@@ -630,7 +631,7 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
630
631
|
lg: 16,
|
|
631
632
|
xl: 16,
|
|
632
633
|
xxl: 16
|
|
633
|
-
},
|
|
634
|
+
}, P = {
|
|
634
635
|
xxs: 16,
|
|
635
636
|
xs: 16,
|
|
636
637
|
sm: 16,
|
|
@@ -638,44 +639,45 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
638
639
|
lg: 20,
|
|
639
640
|
xl: 24,
|
|
640
641
|
xxl: 32
|
|
641
|
-
},
|
|
642
|
+
}, F = s(() => (w.value ? P : N)[b.value] ?? (w.value ? 20 : 16)), _e = f();
|
|
642
643
|
return ne(() => {
|
|
643
|
-
typeof process < "u" && process.env.NODE_ENV === "production" ||
|
|
644
|
-
let e =
|
|
644
|
+
typeof process < "u" && process.env.NODE_ENV === "production" || w.value && ee(() => {
|
|
645
|
+
let e = _e?.proxy?.$el;
|
|
645
646
|
if (!e || typeof e.getAttribute != "function" || [
|
|
646
647
|
"aria-label",
|
|
647
648
|
"aria-labelledby",
|
|
648
649
|
"title"
|
|
649
650
|
].some((t) => (e.getAttribute(t) ?? "").trim().length > 0) || (e.textContent ?? "").trim().length > 0) return;
|
|
650
|
-
let t =
|
|
651
|
-
|
|
651
|
+
let t = kt(d.icon);
|
|
652
|
+
Ot.has(t) || (Ot.add(t), console.warn(`[NbButton] An icon-only button${t ? ` (icon "${t}")` : ""} has no accessible name, so a screen reader announces it as "button". Give it a \`label\`, which names it and shows the same words as its tooltip.`, e));
|
|
652
653
|
});
|
|
653
|
-
}), (t, r) => le((h(), c(ie(
|
|
654
|
+
}), (t, r) => le((h(), c(ie(M.value), m({
|
|
654
655
|
class: [
|
|
655
656
|
"nb-button",
|
|
656
657
|
_.value ? `nb-button--${_.value}` : null,
|
|
657
|
-
`nb-button--${
|
|
658
|
+
`nb-button--${b.value}`,
|
|
658
659
|
{ "nb-button--outlined": v.value },
|
|
659
660
|
{ "nb-button--loading": e.loading },
|
|
660
|
-
{ "nb-button--icon-only":
|
|
661
|
-
{ "nb-button--with-icon":
|
|
661
|
+
{ "nb-button--icon-only": w.value },
|
|
662
|
+
{ "nb-button--with-icon": T.value && !w.value },
|
|
662
663
|
{ "nb-button--pressed": e.pressed },
|
|
663
664
|
{ "nb-button--flush": ae(y)?.flush.value },
|
|
664
|
-
{ "nb-button--explained":
|
|
665
|
+
{ "nb-button--explained": O.value },
|
|
666
|
+
{ "nb-button--centered": ue.value === "center" }
|
|
665
667
|
],
|
|
666
|
-
to:
|
|
667
|
-
},
|
|
668
|
-
disabled:
|
|
669
|
-
"aria-disabled":
|
|
668
|
+
to: A.value ? e.to : void 0
|
|
669
|
+
}, he.value, {
|
|
670
|
+
disabled: k.value,
|
|
671
|
+
"aria-disabled": D.value && !k.value ? !0 : void 0,
|
|
670
672
|
"aria-label": pe.value,
|
|
671
673
|
"aria-pressed": e.pressed === void 0 ? void 0 : e.pressed,
|
|
672
|
-
type:
|
|
673
|
-
onClick:
|
|
674
|
+
type: M.value === "button" ? e.type : void 0,
|
|
675
|
+
onClick: ge
|
|
674
676
|
}), {
|
|
675
|
-
default: ce(() => [
|
|
677
|
+
default: ce(() => [w.value ? l("", !0) : (h(), u("span", Tt, [re(t.$slots, "default", {}, void 0, !0)])), T.value ? (h(), u("span", Et, [e.loading ? (h(), u("span", Dt)) : e.icon ? (h(), c(n, {
|
|
676
678
|
key: 1,
|
|
677
679
|
name: e.icon,
|
|
678
|
-
size:
|
|
680
|
+
size: F.value,
|
|
679
681
|
weight: e.iconWeight,
|
|
680
682
|
class: "nb-button__icon"
|
|
681
683
|
}, null, 8, [
|
|
@@ -694,6 +696,6 @@ var kt = /* @__PURE__ */ t(/* @__PURE__ */ d({
|
|
|
694
696
|
"type"
|
|
695
697
|
])), [[ae(Y), me.value]]);
|
|
696
698
|
}
|
|
697
|
-
}), [["__scopeId", "data-v-
|
|
699
|
+
}), [["__scopeId", "data-v-e2614a7f"]]);
|
|
698
700
|
//#endregion
|
|
699
|
-
export {
|
|
701
|
+
export { St as a, M as c, ge as i, v as l, wt as n, ft as o, Ct as r, he as s, At as t, _ as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
3
3
|
import { usePhoneLayout as n } from "./composables/usePhoneLayout.composable.mjs";
|
|
4
4
|
import { Comment as r, Fragment as i, Text as a, cloneVNode as o, computed as s, createBlock as c, createElementBlock as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, resolveDynamicComponent as m, useSlots as h } from "vue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),n=require(`./composables/usePhoneLayout.composable.cjs`);let r=require(`vue`);var i=3,a=(0,r.defineComponent)({__name:`ButtonSet`,props:{fluid:{type:Boolean,default:!1},stack:{default:`never`},align:{default:`start`},size:{default:void 0},focusOrder:{default:`reading`}},setup(t){let a=t,{phone:o}=n.usePhoneLayout(),s=(0,r.computed)(()=>a.stack===`always`||a.stack===`phone`&&o.value),c=(0,r.useSlots)(),l=!1;function u(e,t=[]){for(let n of e){if(n.type===r.Fragment&&Array.isArray(n.children)){u(n.children,t);continue}n.type!==r.Comment&&(n.type===r.Text&&String(n.children??``).trim()===``||t.push({node:n,index:t.length}))}return t}function d(e){let t=e.props??{};return t.variant!==`primary`&&t.variant!==`danger`?!1:!(`outlined`in t)||t.outlined===!1}function f(t){let n=u(t),i=-1;for(let e=n.length-1;e>=0;e--)if(d(n[e].node)){i=e;break}let o=n.filter((e,t)=>t!==i),c=i>=0?[n[i]]:[],l;return l=a.focusOrder===`rank`?[...c,...o.reverse()]:s.value?[...c,...o]:[...o,...c],l.map(({node:t,index:n})=>(0,r.cloneVNode)(t,{key:t.key??`nb-button-set-${n}`,...a.size&&t.type===e.t?{size:a.size}:{}}))}function p(e){l||e<=i||typeof process<`u`&&process.env.NODE_ENV===`production`||(l=!0,console.warn(`[NbButtonSet] ${e} buttons in one set. A set holds at most ${i}: one primary and two others. Move the rest into an overflow menu or onto the page.`))}function m(){let e=f(c.default?.()??[]);return p(e.length),e}return(e,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`nb-button-set`,`nb-button-set--stack-${t.stack}`,`nb-button-set--align-${t.align}`,`nb-button-set--${t.focusOrder}`,{"nb-button-set--fluid":t.fluid},{"nb-button-set--stacked":s.value}])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(m(),e=>((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(e),{key:e.key}))),128))],2))}}),o=t.t(a,[[`__scopeId`,`data-v-7dc6c4e4`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useSurfaceLayer as t } from "./composables/useSurfaceLayer.composable.mjs";
|
|
3
3
|
import { useNbStrings as n } from "./composables/useNbStrings.composable.mjs";
|
|
4
4
|
import { Fragment as r, computed as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b, withModifiers as x } from "vue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./composables/useSurfaceLayer.composable.cjs`),r=require(`./composables/useNbStrings.composable.cjs`);let i=require(`vue`),a=require(`@nubisco/ui/icons/caret-right`);a=e.n(a);let o=require(`@nubisco/ui/icons/caret-left`);o=e.n(o);var s={class:`nb-calendar__header`},c={class:`nb-calendar__title`,"aria-live":`polite`},l={class:`nb-calendar__weekdays`},u={class:`nb-calendar__grid`},d=[`onClick`],f={class:`nb-calendar__day-num`},p={class:`nb-calendar__events`},m=[`title`,`onClick`],h={class:`nb-calendar__event-label`},g=(0,i.defineComponent)({__name:`Calendar`,props:{events:{default:()=>[]},month:{default:void 0},weekStart:{default:1},locale:{default:void 0}},emits:[`day-click`,`event-click`],setup(e){let g=r.useNbStrings(),_=e,{layerProps:v}=n.useSurfaceLayer();function y(e){return typeof e==`string`?e.slice(0,10):e.toISOString().slice(0,10)}let b=(0,i.ref)(new Date().getFullYear()),x=(0,i.ref)(new Date().getMonth());(0,i.watch)(()=>_.month,e=>{if(!e)return;let t=typeof e==`string`?new Date(e+`-01`):e;b.value=t.getFullYear(),x.value=t.getMonth()},{immediate:!0});function S(){x.value===0?(x.value=11,b.value--):x.value--}function C(){x.value===11?(x.value=0,b.value++):x.value++}function w(){let e=new Date;b.value=e.getFullYear(),x.value=e.getMonth()}let T=(0,i.computed)(()=>_.locale||(typeof navigator<`u`?navigator.language:``)||`en`),E=(0,i.computed)(()=>{let e=new Date(b.value,x.value,1).toLocaleDateString(T.value,{month:`long`,year:`numeric`});return e.charAt(0).toUpperCase()+e.slice(1)}),D=(0,i.computed)(()=>{let e=[],t=new Date(2024,0,_.weekStart===0?7:1);for(let n=0;n<7;n++){let r=new Date(t);r.setDate(t.getDate()+n);let i=r.toLocaleDateString(T.value,{weekday:`short`});e.push(i.charAt(0).toUpperCase()+i.slice(1))}return e}),O=(0,i.computed)(()=>y(new Date)),k=(0,i.computed)(()=>{let e=b.value,t=x.value,n=new Date(e,t,1),r=new Date(e,t+1,0),i=n.getDay();_.weekStart===1&&(i=i===0?6:i-1);let a=[];for(let n=i-1;n>=0;n--){let r=new Date(e,t,-n),i=y(r);a.push({key:i,date:i,day:r.getDate(),inMonth:!1,isToday:i===O.value,events:A(i)})}for(let n=1;n<=r.getDate();n++){let r=`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`;a.push({key:r,date:r,day:n,inMonth:!0,isToday:r===O.value,events:A(r)})}let o=7-a.length%7;if(o<7)for(let n=1;n<=o;n++){let r=new Date(e,t+1,n),i=y(r);a.push({key:i,date:i,day:r.getDate(),inMonth:!1,isToday:i===O.value,events:A(i)})}return a});function A(e){return(_.events??[]).filter(t=>{let n=y(t.start),r=t.end?y(t.end):n;return e>=n&&e<=r})}return(e,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,(0,i.mergeProps)({class:`nb-calendar`},(0,i.unref)(v)),[(0,i.createElementVNode)(`div`,s,[(0,i.createVNode)(t.t,{class:`nb-calendar__today-btn`,variant:`ghost`,size:`sm`,onClick:w},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(g).calendarToday),1)]),_:1}),(0,i.createVNode)(t.t,{class:`nb-calendar__nav`,variant:`ghost`,size:`sm`,icon:o,label:(0,i.unref)(g).calendarPreviousMonth,onClick:S},null,8,[`label`]),(0,i.createVNode)(t.t,{class:`nb-calendar__nav`,variant:`ghost`,size:`sm`,icon:a,label:(0,i.unref)(g).calendarNextMonth,onClick:C},null,8,[`label`]),(0,i.createElementVNode)(`span`,c,(0,i.toDisplayString)(E.value),1)]),(0,i.createElementVNode)(`div`,l,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(D.value,e=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:e,class:`nb-calendar__weekday`},(0,i.toDisplayString)(e),1))),128))]),(0,i.createElementVNode)(`div`,u,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(k.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:t.key,class:(0,i.normalizeClass)([`nb-calendar__cell`,{"nb-calendar__cell--outside":!t.inMonth,"nb-calendar__cell--today":t.isToday}]),onClick:n=>e.$emit(`day-click`,t.date)},[(0,i.createElementVNode)(`span`,f,(0,i.toDisplayString)(t.day),1),(0,i.createElementVNode)(`div`,p,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(t.events,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:t.id,class:`nb-calendar__event`,style:(0,i.normalizeStyle)({background:t.color||`var(--nb-c-primary)`}),title:t.label,onClick:(0,i.withModifiers)(n=>e.$emit(`event-click`,t),[`stop`])},[(0,i.renderSlot)(e.$slots,`event`,{event:t},()=>[(0,i.createElementVNode)(`span`,h,(0,i.toDisplayString)(t.label),1)])],12,m))),128))])],10,d))),128))])],16))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),t=require(`./Avatar-UO0ySqkY.cjs`),n=require(`./AiLabel-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),t=require(`./Avatar-UO0ySqkY.cjs`),n=require(`./AiLabel-AGSSBanb.cjs`);let r=require(`vue`);var i={class:`nb-chat-message__main`},a={class:`nb-chat-message__head`},o={class:`nb-chat-message__author`},s=[`datetime`,`title`],c={class:`nb-chat-message__body`},l=(0,r.defineComponent)({__name:`ChatMessage`,props:{author:{},picture:{default:void 0},own:{type:Boolean,default:!1},text:{default:``},time:{default:void 0},timeLabel:{default:void 0},locale:{default:void 0},ai:{type:Boolean,default:!1},aiExplain:{default:void 0}},setup(e){let l=e,u=(0,r.computed)(()=>{if(l.time===void 0||l.time===null)return null;let e=l.time instanceof Date?l.time:new Date(l.time);return Number.isNaN(e.getTime())?null:e}),d=(0,r.computed)(()=>u.value?.toISOString()),f=(0,r.computed)(()=>l.timeLabel?l.timeLabel:u.value?new Intl.DateTimeFormat(l.locale,{timeStyle:`short`}).format(u.value):``),p=(0,r.computed)(()=>u.value?new Intl.DateTimeFormat(l.locale,{dateStyle:`medium`,timeStyle:`short`}).format(u.value):void 0);return(l,u)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`nb-chat-message`,{"nb-chat-message--own":e.own,"nb-chat-message--with-avatar":e.picture!==void 0}])},[e.picture===void 0?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)(t.t,{key:0,class:`nb-chat-message__avatar`,name:e.author,picture:e.picture,size:`md`,decorative:``},null,8,[`name`,`picture`])),(0,r.createElementVNode)(`div`,i,[(0,r.createElementVNode)(`div`,a,[(0,r.createElementVNode)(`span`,o,(0,r.toDisplayString)(e.author),1),e.ai||l.$slots[`ai-label`]?(0,r.renderSlot)(l.$slots,`ai-label`,{key:0},()=>[(0,r.createVNode)(n.t,{class:`nb-chat-message__ai`,variant:`inline`,size:`sm`,explain:e.aiExplain},(0,r.createSlots)({_:2},[l.$slots[`ai-explain`]?{name:`explain`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(l.$slots,`ai-explain`)]),key:`0`}:void 0]),1032,[`explain`])]):(0,r.createCommentVNode)(``,!0),f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`time`,{key:1,class:`nb-chat-message__time`,datetime:d.value,title:p.value},(0,r.toDisplayString)(f.value),9,s)):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,c,[(0,r.renderSlot)(l.$slots,`default`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.text),1)])])])],2))}}),u=e.t(l,[[`__scopeId`,`data-v-09a08366`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
2
2
|
import { t } from "./Avatar-ZG-WROXx.js";
|
|
3
|
-
import { t as n } from "./AiLabel-
|
|
3
|
+
import { t as n } from "./AiLabel-D32aNf1F.js";
|
|
4
4
|
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, renderSlot as m, toDisplayString as h, withCtx as g } from "vue";
|
|
5
5
|
//#region src/components/ChatMessage.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _ = { class: "nb-chat-message__main" }, v = { class: "nb-chat-message__head" }, y = { class: "nb-chat-message__author" }, b = ["datetime", "title"], x = { class: "nb-chat-message__body" }, S = /* @__PURE__ */ e(/* @__PURE__ */ d({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./_plugin-vue_export-helper-D0Q0f7-M.cjs`),r=require(`./composables/usePhoneLayout.composable.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./utils/slotContent.helper.cjs`),o=require(`./InlineLoading-CA0_IT29.cjs`),s=require(`./TextInput-SJ34hD2Y.cjs`),c=require(`./composables/useFollowNewest.composable.cjs`);let l=require(`vue`),u=require(`@nubisco/ui/icons/arrow-down`);u=e.n(u);let d=require(`@nubisco/ui/icons/paper-plane-right`);d=e.n(d);let f=require(`@nubisco/ui/icons/stop`);f=e.n(f);var p={class:`nb-chat-thread__viewport`},m=[`aria-label`,`aria-busy`],h={key:1,class:`nb-chat-thread__empty`},g={key:2,class:`nb-chat-thread__working`},_={key:0,class:`nb-chat-thread__jump`},v={class:`nb-chat-thread__row`},y={class:`nb-chat-thread__actions`},b={key:0,class:`nb-chat-thread__reason`},x=(0,l.defineComponent)({__name:`ChatThread`,props:(0,l.mergeModels)({label:{default:void 0},working:{type:Boolean,default:!1},workingLabel:{default:void 0},composer:{type:Boolean,default:!1},composerLabel:{default:void 0},placeholder:{default:void 0},disabled:{type:Boolean,default:!1},disabledReason:{default:void 0},stoppable:{type:Boolean,default:!1},sendLabel:{default:void 0},stopLabel:{default:void 0},maxRows:{default:6}},{draft:{default:``},draftModifiers:{}}),emits:(0,l.mergeModels)([`send`,`stop`],[`update:draft`]),setup(e,{expose:n,emit:x}){let S=e,C=x,w=(0,l.useModel)(e,`draft`),T=i.useNbStrings(),{phone:E}=r.usePhoneLayout(),D=(0,l.useSlots)(),O=(0,l.computed)(()=>S.label??T.value.chatThreadLabel),k=(0,l.computed)(()=>S.workingLabel??T.value.chatThreadWorking),A=(0,l.computed)(()=>S.composerLabel??T.value.chatThreadMessage),j=(0,l.computed)(()=>S.placeholder??T.value.chatThreadPlaceholder),M=(0,l.computed)(()=>S.sendLabel??T.value.chatThreadSend),N=(0,l.computed)(()=>S.stopLabel??T.value.chatThreadStop),P=(0,l.computed)(()=>{let e=D.default?.();return e?a.hasRenderableContent(e):!1}),F=(0,l.ref)(null),I=(0,l.ref)(null),L=c.useFollowNewest(F);function R(){L.scrollToEnd(!0)}function z(){if(S.disabled)return;let e=w.value.trim();e&&(C(`send`,e),w.value=``,(0,l.nextTick)(()=>L.scrollToEnd()))}function B(e){e.key===`Enter`&&(e.isComposing||e.keyCode===229||e.shiftKey||e.altKey||E.value&&!e.metaKey&&!e.ctrlKey||(e.preventDefault(),z()))}return n({scrollToNewest:()=>L.scrollToEnd(),focus:()=>I.value?.focus()}),(n,r)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{class:(0,l.normalizeClass)([`nb-chat-thread`,{"nb-chat-thread--with-composer":e.composer}])},[(0,l.createElementVNode)(`div`,p,[(0,l.createElementVNode)(`div`,{ref_key:`logRef`,ref:F,class:`nb-chat-thread__log`,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,"aria-label":O.value,"aria-busy":e.working||void 0,tabindex:`0`,onScrollPassive:r[0]||=(...e)=>(0,l.unref)(L).onScroll&&(0,l.unref)(L).onScroll(...e)},[P.value?(0,l.renderSlot)(n.$slots,`default`,{key:0},void 0,!0):n.$slots.empty?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,h,[(0,l.renderSlot)(n.$slots,`empty`,{},void 0,!0)])):(0,l.createCommentVNode)(``,!0),e.working?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,g,[(0,l.createVNode)(o.t,{status:`active`,label:k.value,"reserve-space":!1},null,8,[`label`])])):(0,l.createCommentVNode)(``,!0)],40,m),(0,l.createVNode)(l.Transition,{name:`nb-chat-thread-jump`},{default:(0,l.withCtx)(()=>[(0,l.unref)(L).unseen.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,_,[(0,l.createVNode)(t.t,{variant:`secondary`,size:`sm`,icon:u,class:`nb-chat-thread__jump-button`,onClick:R},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)((0,l.unref)(T).jumpToNewest),1)]),_:1})])):(0,l.createCommentVNode)(``,!0)]),_:1})]),e.composer?((0,l.openBlock)(),(0,l.createElementBlock)(`form`,{key:0,class:`nb-chat-thread__composer`,onSubmit:(0,l.withModifiers)(z,[`prevent`])},[(0,l.createElementVNode)(`div`,v,[(0,l.createElementVNode)(`div`,{class:`nb-chat-thread__field`,style:(0,l.normalizeStyle)({"--nb-chat-thread-max-rows":String(e.maxRows)})},[(0,l.createVNode)(s.t,{ref_key:`fieldRef`,ref:I,modelValue:w.value,"onUpdate:modelValue":r[1]||=e=>w.value=e,multiline:``,rows:1,"aria-label":A.value,placeholder:j.value,disabled:e.disabled,enterkeyhint:(0,l.unref)(E)?`enter`:`send`,onKeydown:B},null,8,[`modelValue`,`aria-label`,`placeholder`,`disabled`,`enterkeyhint`])],4),(0,l.createElementVNode)(`div`,y,[e.working&&e.stoppable?((0,l.openBlock)(),(0,l.createBlock)(t.t,{key:0,variant:`secondary`,icon:f,label:N.value,"tooltip-position":`top`,class:`nb-chat-thread__stop`,onClick:r[2]||=e=>C(`stop`)},null,8,[`label`])):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(t.t,{type:`submit`,variant:`primary`,icon:d,label:M.value,"tooltip-position":`top`,disabled:e.disabled,"disabled-reason":e.disabled?e.disabledReason:void 0,class:`nb-chat-thread__send`},null,8,[`label`,`disabled`,`disabled-reason`])])]),e.disabled&&e.disabledReason?((0,l.openBlock)(),(0,l.createElementBlock)(`p`,b,(0,l.toDisplayString)(e.disabledReason),1)):(0,l.createCommentVNode)(``,!0)],32)):(0,l.createCommentVNode)(``,!0)],2))}}),S=n.t(x,[[`__scopeId`,`data-v-f5c7cfed`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
3
3
|
import { usePhoneLayout as n } from "./composables/usePhoneLayout.composable.mjs";
|
|
4
4
|
import { useNbStrings as r } from "./composables/useNbStrings.composable.mjs";
|
|
5
5
|
import { hasRenderableContent as i } from "./utils/slotContent.helper.mjs";
|
|
6
6
|
import { t as ee } from "./InlineLoading-Cknqq0vv.js";
|
|
7
|
-
import { t as a } from "./TextInput-
|
|
7
|
+
import { t as a } from "./TextInput-BeqDf1R7.js";
|
|
8
8
|
import { useFollowNewest as o } from "./composables/useFollowNewest.composable.mjs";
|
|
9
9
|
import { Transition as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as te, createVNode as p, defineComponent as m, mergeModels as h, nextTick as g, normalizeClass as _, normalizeStyle as v, openBlock as y, ref as b, renderSlot as x, toDisplayString as S, unref as C, useModel as ne, useSlots as re, withCtx as w, withModifiers as T } from "vue";
|
|
10
10
|
import * as E from "@nubisco/ui/icons/arrow-down";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./composables/useNbStrings.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/x`);i=e.n(i);var a=(0,r.defineComponent)({__name:`CloseButton`,props:{label:{default:void 0},size:{default:`sm`},disabled:{type:Boolean,default:!1},tooltipPosition:{default:`bottom`}},emits:[`click`],setup(e,{expose:a,emit:o}){let s=e,c=o,l=n.useNbStrings(),u=(0,r.computed)(()=>s.label??l.value.close),d=(0,r.ref)(null);function f(){let e=d.value?.$el;return e instanceof HTMLElement?e:null}return a({focus:()=>f()?.focus(),el:f}),(n,a)=>((0,r.openBlock)(),(0,r.createBlock)(t.t,{ref_key:`buttonRef`,ref:d,class:`nb-close-button`,variant:`ghost`,size:e.size,icon:i,label:u.value,"tooltip-position":e.tooltipPosition,disabled:e.disabled,onClick:a[0]||=e=>c(`click`,e)},null,8,[`size`,`label`,`tooltip-position`,`disabled`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useNbStrings as t } from "./composables/useNbStrings.composable.mjs";
|
|
3
3
|
import { computed as n, createBlock as r, defineComponent as i, openBlock as a, ref as o } from "vue";
|
|
4
4
|
import * as s from "@nubisco/ui/icons/x";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`),t=require(`./composables/useCommandPalette.composable.cjs`),n=require(`./Icon-CssV4E2-.cjs`),r=require(`./composables/usePhoneLayout.composable.cjs`),i=require(`./composables/useNbStrings.composable.cjs`),a=require(`./composables/useFocusTrap.composable.cjs`),o=require(`./composables/useScrollLock.composable.cjs`);let s=require(`vue`),c=require(`@nubisco/ui/icons/x`),l=require(`@nubisco/ui/icons/magnifying-glass`);var u=[`aria-label`],d={class:`nb-command-palette__input-row`},f=[`aria-label`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`placeholder`],p=[`aria-label`],m=[`role`,`aria-labelledby`],h=[`id`],g=[`id`,`aria-selected`,`onClick`,`onMouseenter`],_=[`title`],v={key:1,class:`nb-command-palette__item-shortcut`},y={key:1,class:`nb-command-palette__empty`,role:`status`},b={key:2,class:`nb-command-palette__empty`,role:`status`},x={key:3,class:`nb-command-palette__empty`},S=(0,s.defineComponent)({__name:`CommandPalette`,props:{openShortcut:{default:`Meta+k`},placeholder:{default:void 0},maxResults:{default:50},suggest:{type:Function,default:void 0},suggestDebounce:{default:150},label:{default:void 0}},setup(S){let{lock:C,unlock:w}=o.useScrollLock(),T=S,E=i.useNbStrings(),D=(0,s.computed)(()=>T.label??E.value.commandPaletteLabel),{phone:O}=r.usePhoneLayout(),k=(0,s.inject)(t.NB_COMMAND_PALETTE_KEY),A=(0,s.ref)(null),j=(0,s.ref)(null),M=`nb-command-palette-${(0,s.useId)()}`,N=new Map;function P(e){let t=N.get(e);return t||(t=`${M}-option-${N.size}`,N.set(e,t)),t}a.useFocusTrap({container:()=>j.value,active:()=>k.isOpen,initialFocus:()=>A.value});let F=(0,s.ref)(``),I=(0,s.ref)(null),L=(0,s.ref)([]),R=(0,s.ref)(!1),z=null,B=0;function V(){z!==null&&(clearTimeout(z),z=null)}function H(){V(),B++,L.value=[],R.value=!1}async function U(e){let t=T.suggest;if(!t)return;let n=++B;R.value=!0;try{let r=await t(e);if(n!==B)return;L.value=r}catch{n===B&&(L.value=[])}finally{n===B&&(R.value=!1)}}(0,s.watch)(F,e=>{if(!T.suggest)return;V();let t=e.trim();if(!t){H();return}R.value=!0,z=setTimeout(()=>void U(t),T.suggestDebounce)});function W(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n.startsWith(r))return 1e3+r.length/n.length*100;if(n.split(/[\s\-_./]+/).some(e=>e.startsWith(r)))return 500;let i=n.indexOf(r);if(i>=0)return 300-i;let a=0,o=0;for(let e=0;e<n.length&&a<r.length;e++)n[e]===r[a]&&(o+=10,e>0&&n[e-1]===(a>0?r[a-1]:``)&&(o+=5),a++);return a===r.length?o:-1}function G(e,t){let n=W(e.label,t);if(e.namespace&&(n=Math.max(n,W(e.namespace,t)*.8)),e.keywords)for(let r of e.keywords)n=Math.max(n,W(r,t)*.7);return n}let K=(0,s.computed)(()=>{let e=Array.from(k.commands.values()).filter(e=>!e.context||e.context===k.activeContext);return F.value?e.map(e=>({cmd:e,score:G(e,F.value)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,T.maxResults).map(e=>e.cmd):e.slice(0,T.maxResults)}),q=(0,s.computed)(()=>{let e=new Map;for(let t of K.value){let n=t.namespace??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}let t=Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({namespace:e,commands:t.sort((e,t)=>e.label.localeCompare(t.label))}));if(L.value.length===0)return t;let n=new Map;for(let e of L.value.slice(0,T.maxResults)){let t=e.namespace??``;n.has(t)||n.set(t,[]),n.get(t).push(e)}return[...Array.from(n.entries()).map(([e,t])=>({namespace:e,commands:t})),...t]}),J=(0,s.computed)(()=>q.value.flatMap(e=>e.commands));function Y(e){k.close(),F.value=``,H(),e.handler()}function X(e){if(e.key===`Escape`){e.preventDefault(),k.close(),F.value=``,H();return}let t=J.value;if(!t.length)return;let n=t.findIndex(e=>e.id===I.value);if(e.key===`ArrowDown`)e.preventDefault(),I.value=t[n<t.length-1?n+1:0].id,Z();else if(e.key===`ArrowUp`)e.preventDefault(),I.value=t[n>0?n-1:t.length-1].id,Z();else if(e.key===`Enter`&&I.value){e.preventDefault();let n=t.find(e=>e.id===I.value);n&&Y(n)}}function Z(){(0,s.nextTick)(()=>{document.querySelector(`.nb-command-palette__item--highlighted`)?.scrollIntoView({block:`nearest`})})}(0,s.watch)(()=>k.isOpen,e=>{e?(F.value=k.searchFilter??``,I.value=null,(0,s.nextTick)(()=>{(0,s.nextTick)(()=>{J.value.length>0&&(I.value=J.value[0].id)})}),C()):(F.value=``,H(),w())}),(0,s.watch)(J,e=>{e.length>0&&!e.find(e=>e.id===I.value)?I.value=e[0].id:e.length===0&&(I.value=null)});let Q={cmd:`⌘`,meta:`⌘`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`,control:`⌃`};function ee(e){return e.split(`+`).map(e=>Q[e.trim().toLowerCase()]||e.trim())}function te(e){let t=e.toLowerCase().split(`+`);return{key:t[t.length-1],meta:t.includes(`meta`)||t.includes(`cmd`),ctrl:t.includes(`ctrl`)||t.includes(`control`),shift:t.includes(`shift`),alt:t.includes(`alt`)}}function $(e){if(e.key===`Escape`&&k.isOpen){e.preventDefault(),k.close(),F.value=``;return}let t=te(T.openShortcut),n=e.key.toLowerCase()===t.key,r=t.meta?e.metaKey:!e.metaKey,i=t.ctrl?e.ctrlKey:!e.ctrlKey,a=t.shift?e.shiftKey:!e.shiftKey,o=t.alt?e.altKey:!e.altKey;n&&r&&i&&a&&o&&(e.preventDefault(),k.isOpen?k.close():k.open())}return(0,s.onMounted)(()=>{document.addEventListener(`keydown`,$)}),(0,s.onBeforeUnmount)(()=>{document.removeEventListener(`keydown`,$),V(),w()}),(t,r)=>((0,s.openBlock)(),(0,s.createBlock)(s.Teleport,{to:`body`},[(0,s.createVNode)(s.Transition,{name:`nb-command-palette`},{default:(0,s.withCtx)(()=>[(0,s.unref)(k).isOpen?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,class:`nb-command-palette__overlay`,onClick:r[2]||=(0,s.withModifiers)(e=>(0,s.unref)(k).close(),[`self`])},[(0,s.createElementVNode)(`div`,{ref_key:`paletteRef`,ref:j,class:`nb-command-palette`,role:`dialog`,"aria-modal":`true`,"aria-label":D.value,tabindex:`-1`,onKeydown:X},[(0,s.createElementVNode)(`div`,d,[(0,s.createVNode)(n.t,{name:(0,s.unref)(l.regular),size:20,class:`nb-command-palette__search-icon`},null,8,[`name`]),(0,s.withDirectives)((0,s.createElementVNode)(`input`,{ref_key:`inputRef`,ref:A,"onUpdate:modelValue":r[0]||=e=>F.value=e,type:`text`,class:`nb-command-palette__input`,role:`combobox`,"aria-autocomplete":`list`,"aria-label":D.value,"aria-expanded":J.value.length>0,"aria-controls":J.value.length>0?M:void 0,"aria-activedescendant":I.value===null?void 0:P(I.value),placeholder:S.placeholder??(0,s.unref)(E).commandPalettePlaceholder,autocomplete:`off`,spellcheck:`false`},null,8,f),[[s.vModelText,F.value]]),(0,s.unref)(O)?((0,s.openBlock)(),(0,s.createBlock)(e.t,{key:0,class:`nb-command-palette__close`,variant:`ghost`,icon:(0,s.unref)(c.regular),label:(0,s.unref)(E).commandPaletteClose,onClick:r[1]||=e=>(0,s.unref)(k).close()},null,8,[`icon`,`label`])):(0,s.createCommentVNode)(``,!0)]),q.value.length>0?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:M,class:`nb-command-palette__results`,role:`listbox`,"aria-label":D.value},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(q.value,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:e.namespace,role:e.namespace?`group`:`presentation`,"aria-labelledby":e.namespace?`${M}-group-${t}`:void 0},[e.namespace?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:0,id:`${M}-group-${t}`,class:`nb-command-palette__group-header`,role:`presentation`},(0,s.toDisplayString)(e.namespace),9,h)):(0,s.createCommentVNode)(``,!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.commands,e=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{id:P(e.id),key:e.id,role:`option`,"aria-selected":e.id===I.value,class:(0,s.normalizeClass)([`nb-command-palette__item`,{"nb-command-palette__item--highlighted":e.id===I.value}]),onClick:t=>Y(e),onMouseenter:t=>I.value=e.id},[e.icon?((0,s.openBlock)(),(0,s.createBlock)(n.t,{key:0,name:e.icon,size:16,class:`nb-command-palette__item-icon`},null,8,[`name`])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`span`,{class:`nb-command-palette__item-label`,title:e.label},(0,s.toDisplayString)(e.label),9,_),e.shortcut?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,v,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(ee(e.shortcut),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`kbd`,{key:t,class:`nb-command-palette__key`},(0,s.toDisplayString)(e),1))),128))])):(0,s.createCommentVNode)(``,!0)],42,g))),128))],8,m))),128))],8,p)):R.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,y,(0,s.toDisplayString)((0,s.unref)(E).commandPaletteSearching),1)):F.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,b,(0,s.toDisplayString)((0,s.unref)(E).commandPaletteNoMatches),1)):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,x,(0,s.toDisplayString)((0,s.unref)(E).commandPaletteHint),1))],40,u)])):(0,s.createCommentVNode)(``,!0)]),_:1})]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { NB_COMMAND_PALETTE_KEY as t } from "./composables/useCommandPalette.composable.mjs";
|
|
3
3
|
import { t as n } from "./Icon-B2tiGiqZ.js";
|
|
4
4
|
import { usePhoneLayout as r } from "./composables/usePhoneLayout.composable.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.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-B1CQ0Bcf.cjs`),ee=require(`./TextInput-SJ34hD2Y.cjs`),o=require(`./Modal-C_EWDvmH.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}});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useReducedMotion as t } from "./composables/useReducedMotion.composable.mjs";
|
|
3
3
|
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-Bi70NgGd.js";
|
|
7
|
-
import { t as ee } from "./TextInput-
|
|
8
|
-
import { i as te, r as ne, t as re } from "./Modal-
|
|
7
|
+
import { t as ee } from "./TextInput-BeqDf1R7.js";
|
|
8
|
+
import { i as te, r as ne, t as re } from "./Modal-CESCi2dE.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";
|
|
11
11
|
import { regular as fe } from "@nubisco/ui/icons/warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Button-CGIbF1e-.cjs`);let t=require(`vue`);var n=[`aria-label`],r=(0,t.defineComponent)({__name:`ContentSwitcher`,props:{modelValue:{default:void 0},items:{},label:{},iconOnly:{type:Boolean,default:!1},size:{default:`md`}},emits:[`update:modelValue`],setup(r,{emit:i}){let a=r,o=i,s=(0,t.ref)(null),c=(0,t.computed)(()=>a.items.filter(e=>!e.disabled)),l=(0,t.computed)(()=>(c.value.find(e=>e.id===a.modelValue)??c.value[0])?.id);function u(e){return[`nb-content-switcher__item`,{"nb-content-switcher__item--selected":e.id===a.modelValue}]}function d(e){e.disabled||e.id===a.modelValue||o(`update:modelValue`,e.id)}function f(e){(0,t.nextTick)(()=>{let t=s.value?.querySelectorAll(`[data-id]`);Array.from(t??[]).find(t=>t.dataset.id===e)?.focus()})}function p(e){let t=c.value;if(!t.length)return;let n=t.findIndex(e=>e.id===l.value),r=-1;e.key===`ArrowRight`||e.key===`ArrowDown`?r=(n+1)%t.length:e.key===`ArrowLeft`||e.key===`ArrowUp`?r=(n-1+t.length)%t.length:e.key===`Home`?r=0:e.key===`End`&&(r=t.length-1),!(r<0)&&(e.preventDefault(),d(t[r]),f(t[r].id))}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`rootRef`,ref:s,class:(0,t.normalizeClass)([`nb-content-switcher`,`nb-content-switcher--${r.size}`,{"nb-content-switcher--icon-only":r.iconOnly}]),role:`radiogroup`,"aria-label":r.label,onKeydown:p},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[r.iconOnly&&n.icon?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:0,class:(0,t.normalizeClass)(u(n)),variant:`ghost`,size:r.size,icon:n.icon,label:n.label,disabled:n.disabled,role:`radio`,"aria-checked":n.id===r.modelValue,tabindex:l.value===n.id?0:-1,"data-id":n.id,onClick:e=>d(n)},null,8,[`class`,`size`,`icon`,`label`,`disabled`,`aria-checked`,`tabindex`,`data-id`,`onClick`])):((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,class:(0,t.normalizeClass)(u(n)),variant:`ghost`,size:r.size,icon:n.icon,disabled:n.disabled,role:`radio`,"aria-checked":n.id===r.modelValue,tabindex:l.value===n.id?0:-1,"data-id":n.id,onClick:e=>d(n)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.label),1)]),_:2},1032,[`class`,`size`,`icon`,`disabled`,`aria-checked`,`tabindex`,`data-id`,`onClick`]))],64))),128))],42,n))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { Fragment as t, computed as n, createBlock as r, createElementBlock as i, createTextVNode as a, defineComponent as o, nextTick as s, normalizeClass as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, withCtx as p } from "vue";
|
|
3
3
|
//#region src/components/ContentSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var m = ["aria-label"], h = /* @__PURE__ */ o({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./Button-CGIbF1e-.cjs`),n=require(`./composables/useNbStrings.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/check`);i=e.n(i);let a=require(`@nubisco/ui/icons/copy`);a=e.n(a);var o={class:`nb-copy-button`},s={class:`nb-copy-button__status`,role:`status`},c=(0,r.defineComponent)({__name:`CopyButton`,props:{text:{},label:{default:void 0},copiedLabel:{default:void 0},size:{default:`xs`},duration:{default:1500}},emits:[`copied`,`error`],setup(e,{emit:c}){let l=e,u=n.useNbStrings(),d=(0,r.computed)(()=>l.label??u.value.copyButtonCopy),f=(0,r.computed)(()=>l.copiedLabel??u.value.copyButtonCopied),p=c,m=(0,r.ref)(!1),h;async function g(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand?.(`copy`)??!1;if(t.remove(),!n)throw Error(`The browser did not allow copying.`)}async function _(){try{await g(l.text)}catch(e){p(`error`,e);return}m.value=!0,p(`copied`,l.text),clearTimeout(h),h=setTimeout(()=>m.value=!1,l.duration)}return(0,r.onBeforeUnmount)(()=>clearTimeout(h)),(n,c)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,o,[(0,r.createVNode)(t.t,{label:m.value?f.value:d.value,class:(0,r.normalizeClass)([`nb-copy-button__button`,{"nb-copy-button__button--copied":m.value}]),variant:`ghost`,size:e.size,icon:m.value?i:a,onClick:(0,r.withModifiers)(_,[`stop`,`prevent`]),onPointerdown:c[0]||=(0,r.withModifiers)(()=>{},[`stop`]),onMousedown:c[1]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:c[2]||=(0,r.withModifiers)(()=>{},[`stop`])},null,8,[`label`,`class`,`size`,`icon`]),(0,r.createElementVNode)(`span`,s,(0,r.toDisplayString)(m.value?f.value:``),1)]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { useNbStrings as t } from "./composables/useNbStrings.composable.mjs";
|
|
3
3
|
import { computed as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, onBeforeUnmount as c, openBlock as l, ref as u, toDisplayString as d, withModifiers as f } from "vue";
|
|
4
4
|
import * as p from "@nubisco/ui/icons/check";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as e } from "./Button-
|
|
1
|
+
import { t as e } from "./Button-DmJ_J3UO.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
3
3
|
import { t as n } from "./Icon-B2tiGiqZ.js";
|
|
4
4
|
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
5
|
import { usePhoneLayout as i } from "./composables/usePhoneLayout.composable.mjs";
|
|
6
6
|
import { useNbStrings as a } from "./composables/useNbStrings.composable.mjs";
|
|
7
|
-
import { t as o } from "./OverflowMenu-
|
|
7
|
+
import { t as o } from "./OverflowMenu-BWZ7c8oI.js";
|
|
8
8
|
import { t as s } from "./Grid-BVIhOyQ1.js";
|
|
9
|
-
import { t as ee } from "./BatchActions-
|
|
9
|
+
import { t as ee } from "./BatchActions-Ckx8kyZt.js";
|
|
10
10
|
import { t as c } from "./Checkbox-U1tS47Qx.js";
|
|
11
11
|
import { t as te } from "./Toolbar-DX2l8FUL.js";
|
|
12
12
|
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as ne, createTextVNode as h, createVNode as g, defineComponent as re, getCurrentInstance as ie, mergeProps as ae, normalizeClass as _, normalizeStyle as oe, openBlock as v, ref as se, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useId as ce, useSlots as le, watch as ue, withCtx as C, withModifiers as w } from "vue";
|