@infotrust/ui 0.0.0-stage → 0.30.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/LICENSE +24 -0
- package/NOTICE.md +37 -0
- package/README.md +53 -2
- package/dist/assistant-session-DP4_70Xk.js +1381 -0
- package/dist/command-Bjncx7YR.js +1279 -0
- package/dist/components/actions/ItActionMenu.vue.d.ts +24 -0
- package/dist/components/actions/ItDecisionToggle.vue.d.ts +22 -0
- package/dist/components/actions/ItIconButton.vue.d.ts +24 -0
- package/dist/components/actions/ItLinkButton.vue.d.ts +17 -0
- package/dist/components/actions/action-menu.d.ts +19 -0
- package/dist/components/charts/ItBarChart.vue.d.ts +121 -0
- package/dist/components/charts/ItCalendarChart.vue.d.ts +80 -0
- package/dist/components/charts/ItChartLegend.vue.d.ts +47 -0
- package/dist/components/charts/ItChartTable.vue.d.ts +16 -0
- package/dist/components/charts/ItChartTooltip.vue.d.ts +52 -0
- package/dist/components/charts/ItDonutChart.vue.d.ts +79 -0
- package/dist/components/charts/ItProportionBar.vue.d.ts +42 -0
- package/dist/components/charts/ItSparkline.vue.d.ts +42 -0
- package/dist/components/charts/ItTrendChart.vue.d.ts +80 -0
- package/dist/components/charts/chart.d.ts +84 -0
- package/dist/components/charts/selection.d.ts +14 -0
- package/dist/components/charts/skeleton.d.ts +16 -0
- package/dist/components/command/ItAssistantPanel.vue.d.ts +56 -0
- package/dist/components/command/ItAssistantThread.vue.d.ts +73 -0
- package/dist/components/command/ItCommandPalette.vue.d.ts +102 -0
- package/dist/components/command/ItMarkdown.vue.d.ts +12 -0
- package/dist/components/command/assistant-session.d.ts +26 -0
- package/dist/components/command/command.d.ts +127 -0
- package/dist/components/command/markdown.d.ts +55 -0
- package/dist/components/content/ItDocsArticle.vue.d.ts +18 -0
- package/dist/components/content/ItDocsLayout.vue.d.ts +29 -0
- package/dist/components/content/ItDocsPager.vue.d.ts +12 -0
- package/dist/components/content/ItProse.vue.d.ts +18 -0
- package/dist/components/content/docs.d.ts +23 -0
- package/dist/components/dag/ItDagCanvas.vue.d.ts +143 -0
- package/dist/components/dag/ItDagControls.vue.d.ts +2 -0
- package/dist/components/dag/ItDagEdge.vue.d.ts +21 -0
- package/dist/components/dag/ItDagLibrary.vue.d.ts +19 -0
- package/dist/components/dag/ItDagNode.vue.d.ts +20 -0
- package/dist/components/dag/dag.d.ts +182 -0
- package/dist/components/dag/history.d.ts +51 -0
- package/dist/components/dag/layout.d.ts +54 -0
- package/dist/components/dag/route.d.ts +24 -0
- package/dist/components/data/DataError.vue.d.ts +12 -0
- package/dist/components/data/ItChangeList.vue.d.ts +48 -0
- package/dist/components/data/ItCodeBlock.vue.d.ts +23 -0
- package/dist/components/data/ItDataTable.vue.d.ts +135 -0
- package/dist/components/data/ItDataToolbar.vue.d.ts +57 -0
- package/dist/components/data/ItDescriptionList.vue.d.ts +30 -0
- package/dist/components/data/ItEmptyState.vue.d.ts +22 -0
- package/dist/components/data/ItKpiCard.vue.d.ts +89 -0
- package/dist/components/data/ItKpiDetail.vue.d.ts +40 -0
- package/dist/components/data/ItKpiGrid.vue.d.ts +19 -0
- package/dist/components/data/ItObjectName.vue.d.ts +64 -0
- package/dist/components/data/ItPaginator.vue.d.ts +46 -0
- package/dist/components/data/ItResourceList.vue.d.ts +39 -0
- package/dist/components/data/ItResourceListItem.vue.d.ts +40 -0
- package/dist/components/data/ItSkeleton.vue.d.ts +14 -0
- package/dist/components/data/ItTablePaginator.vue.d.ts +34 -0
- package/dist/components/data/ItTime.vue.d.ts +13 -0
- package/dist/components/data/ItTreeTable.vue.d.ts +109 -0
- package/dist/components/data/TableChevron.vue.d.ts +8 -0
- package/dist/components/data/TableExpansion.vue.d.ts +22 -0
- package/dist/components/data/column-sizing.d.ts +31 -0
- package/dist/components/data/data-table.d.ts +15 -0
- package/dist/components/data/highlight-worker.d.ts +1 -0
- package/dist/components/data/highlight.d.ts +3 -0
- package/dist/components/data/kpi-placement.d.ts +40 -0
- package/dist/components/data/kpi.d.ts +16 -0
- package/dist/components/data/sticky-header.d.ts +9 -0
- package/dist/components/data/table-skeleton.d.ts +11 -0
- package/dist/components/data/table-source.d.ts +77 -0
- package/dist/components/data/tree-table-public.d.ts +17 -0
- package/dist/components/data/tree-table.d.ts +30 -0
- package/dist/components/feedback/ItCallout.vue.d.ts +25 -0
- package/dist/components/feedback/ItConfirmHost.vue.d.ts +2 -0
- package/dist/components/feedback/ItOverlayHost.vue.d.ts +2 -0
- package/dist/components/feedback/ItProgressBar.vue.d.ts +19 -0
- package/dist/components/feedback/ItToastHost.vue.d.ts +2 -0
- package/dist/components/forms/FieldClearButton.vue.d.ts +11 -0
- package/dist/components/forms/ItAutoComplete.vue.d.ts +69 -0
- package/dist/components/forms/ItCheckboxGroup.vue.d.ts +27 -0
- package/dist/components/forms/ItChipInput.vue.d.ts +32 -0
- package/dist/components/forms/ItCodeEditor.vue.d.ts +64 -0
- package/dist/components/forms/ItDatePicker.vue.d.ts +35 -0
- package/dist/components/forms/ItFileDrop.vue.d.ts +47 -0
- package/dist/components/forms/ItFilterChip.vue.d.ts +13 -0
- package/dist/components/forms/ItFilterMenu.vue.d.ts +37 -0
- package/dist/components/forms/ItFilterPopover.vue.d.ts +44 -0
- package/dist/components/forms/ItFormActions.vue.d.ts +14 -0
- package/dist/components/forms/ItFormField.vue.d.ts +44 -0
- package/dist/components/forms/ItFormRows.vue.d.ts +50 -0
- package/dist/components/forms/ItFormSection.vue.d.ts +28 -0
- package/dist/components/forms/ItLabelCell.vue.d.ts +42 -0
- package/dist/components/forms/ItLabelPicker.vue.d.ts +34 -0
- package/dist/components/forms/ItMultiSelect.vue.d.ts +53 -0
- package/dist/components/forms/ItOptionCardGroup.vue.d.ts +35 -0
- package/dist/components/forms/ItRadioGroup.vue.d.ts +29 -0
- package/dist/components/forms/ItSearchInput.vue.d.ts +25 -0
- package/dist/components/forms/ItSegmentedControl.vue.d.ts +25 -0
- package/dist/components/forms/ItSelect.vue.d.ts +50 -0
- package/dist/components/forms/ItSwitch.vue.d.ts +31 -0
- package/dist/components/forms/ItTabs.vue.d.ts +27 -0
- package/dist/components/forms/OptionSourceSlot.vue.d.ts +13 -0
- package/dist/components/forms/choice.d.ts +24 -0
- package/dist/components/forms/code-editor.d.ts +17 -0
- package/dist/components/forms/field-context.d.ts +39 -0
- package/dist/components/forms/file-drop.d.ts +19 -0
- package/dist/components/forms/form-errors.d.ts +7 -0
- package/dist/components/forms/form-rows.d.ts +8 -0
- package/dist/components/forms/option-source.d.ts +39 -0
- package/dist/components/forms/virtual-options.d.ts +12 -0
- package/dist/components/layout/ItBreadcrumb.vue.d.ts +12 -0
- package/dist/components/layout/ItDetailSection.vue.d.ts +21 -0
- package/dist/components/layout/ItPage.vue.d.ts +44 -0
- package/dist/components/layout/ItPanel.vue.d.ts +47 -0
- package/dist/components/layout/ItSectionNav.vue.d.ts +43 -0
- package/dist/components/layout/ItWizard.vue.d.ts +57 -0
- package/dist/components/layout/ItWizardSteps.vue.d.ts +15 -0
- package/dist/components/layout/SectionNavLinks.vue.d.ts +15 -0
- package/dist/components/layout/panel.d.ts +18 -0
- package/dist/components/layout/section-nav.d.ts +17 -0
- package/dist/components/layout/wizard.d.ts +13 -0
- package/dist/components/logic/ItFieldPicker.vue.d.ts +40 -0
- package/dist/components/logic/ItLogicBuilder.vue.d.ts +58 -0
- package/dist/components/logic/ItLogicCondition.vue.d.ts +9 -0
- package/dist/components/logic/ItLogicGroup.vue.d.ts +9 -0
- package/dist/components/logic/ItOperatorSelect.vue.d.ts +25 -0
- package/dist/components/logic/ItValueInput.vue.d.ts +29 -0
- package/dist/components/logic/logic.d.ts +263 -0
- package/dist/components/logic/region.d.ts +44 -0
- package/dist/components/overlays/ItDrawer.vue.d.ts +48 -0
- package/dist/components/overlays/ItModal.vue.d.ts +53 -0
- package/dist/components/overlays/escape-stack.d.ts +7 -0
- package/dist/components/overlays/modal.d.ts +23 -0
- package/dist/components/shell/ItAppShell.vue.d.ts +68 -0
- package/dist/components/shell/ItCommandTrigger.vue.d.ts +17 -0
- package/dist/components/shell/ItOrgSwitcher.vue.d.ts +26 -0
- package/dist/components/shell/ItShellMenuItem.vue.d.ts +18 -0
- package/dist/components/shell/ItShellNavBranch.vue.d.ts +15 -0
- package/dist/components/shell/ItShellNavLink.vue.d.ts +18 -0
- package/dist/components/shell/ItShellSidebarButton.vue.d.ts +15 -0
- package/dist/components/shell/ItThemeControl.vue.d.ts +13 -0
- package/dist/components/shell/org.d.ts +36 -0
- package/dist/components/shell/types.d.ts +67 -0
- package/dist/components/status/ItBadge.vue.d.ts +12 -0
- package/dist/components/status/ItEntityTypeChip.vue.d.ts +14 -0
- package/dist/components/status/ItLabelChip.vue.d.ts +21 -0
- package/dist/components/status/ItLabelChipList.vue.d.ts +27 -0
- package/dist/components/status/ItPlatformChip.vue.d.ts +20 -0
- package/dist/components/status/ItPlatformLogo.vue.d.ts +17 -0
- package/dist/components/status/ItSeverityBadge.vue.d.ts +9 -0
- package/dist/components/status/ItStatus.vue.d.ts +12 -0
- package/dist/components.css +1 -0
- package/dist/composables/iconMotion.d.ts +12 -0
- package/dist/composables/ripple.d.ts +3 -0
- package/dist/composables/useItConfirm.d.ts +16 -0
- package/dist/composables/useItCopy.d.ts +4 -0
- package/dist/composables/useItCursorPager.d.ts +50 -0
- package/dist/composables/useItTheme.d.ts +26 -0
- package/dist/composables/useItToast.d.ts +24 -0
- package/dist/dag.d.ts +5 -0
- package/dist/dag.js +1754 -0
- package/dist/dev-D7A7MIn_.js +1264 -0
- package/dist/directives/truncate.d.ts +29 -0
- package/dist/elk-worker.min-O2A22ecl.js +6321 -0
- package/dist/format/index.d.ts +53 -0
- package/dist/highlight-worker-DIrLC7a2.js +25 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +11989 -0
- package/dist/licenses/@vue-flow__core.LICENSE +20 -0
- package/dist/licenses/elkjs.LICENSE.md +263 -0
- package/dist/licenses/highlight.js.LICENSE +29 -0
- package/dist/licenses/vue-sonner.LICENSE +21 -0
- package/dist/platform-art-Bt1CnaKE.js +86 -0
- package/dist/plugin.d.ts +69 -0
- package/dist/registries/entity-type.d.ts +18 -0
- package/dist/registries/platform-art.d.ts +2 -0
- package/dist/registries/platform-marks.d.ts +12 -0
- package/dist/registries/platform.d.ts +22 -0
- package/dist/registries/severity.d.ts +23 -0
- package/dist/registries/status.d.ts +13 -0
- package/dist/styles.css +26 -0
- package/dist/text-nGkJYA88.js +470 -0
- package/dist/utils/chip-truncation.d.ts +8 -0
- package/dist/utils/chunk-recovery.d.ts +24 -0
- package/dist/utils/dev.d.ts +2 -0
- package/dist/utils/listeners.d.ts +10 -0
- package/dist/utils/router.d.ts +9 -0
- package/dist/utils/scroll.d.ts +8 -0
- package/dist/utils/select.d.ts +21 -0
- package/dist/utils/text.d.ts +6 -0
- package/package.json +92 -3
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
import { defineComponent as _, openBlock as c, createElementBlock as d, createElementVNode as w, normalizeClass as C, Fragment as ve, renderList as Be, toDisplayString as g, renderSlot as k, createTextVNode as T, unref as v, createBlock as q, resolveDynamicComponent as ie, createCommentVNode as $, inject as le, h as Fe, Comment as Le, Text as xe, useSlots as ge, useId as Q, withCtx as Y, normalizeStyle as Me, getCurrentInstance as Oe, computed as y, withDirectives as R, ref as B, onBeforeUpdate as Re, provide as $e, createVNode as H, watch as ke, useAttrs as je, mergeProps as qe, createSlots as ze, withModifiers as de, onBeforeUnmount as Ve, withKeys as Ue } from "vue";
|
|
2
|
+
import { Inbox as Pe, CircleAlert as Ge, X as Ye, Search as He } from "lucide-vue-next";
|
|
3
|
+
import { v as P, f as We, u as Ke, b as Qe, i as Xe } from "./text-nGkJYA88.js";
|
|
4
|
+
import Je from "primevue/dialog";
|
|
5
|
+
import { useConfirm as Ze } from "primevue/useconfirm";
|
|
6
|
+
import et from "primevue/inputtext";
|
|
7
|
+
const I = "—";
|
|
8
|
+
let X = "en-US";
|
|
9
|
+
const ne = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
|
|
10
|
+
function J(e, t) {
|
|
11
|
+
let n = ne.get(e);
|
|
12
|
+
return n || ne.set(e, n = new Intl.NumberFormat(X, t)), n;
|
|
13
|
+
}
|
|
14
|
+
function z(e, t) {
|
|
15
|
+
let n = ae.get(e);
|
|
16
|
+
return n || ae.set(e, n = new Intl.DateTimeFormat(X, t)), n;
|
|
17
|
+
}
|
|
18
|
+
function vn(e, t, n) {
|
|
19
|
+
return z(`with:${e}`, t).format(n);
|
|
20
|
+
}
|
|
21
|
+
function gn() {
|
|
22
|
+
return X;
|
|
23
|
+
}
|
|
24
|
+
function $n(e) {
|
|
25
|
+
X = e, ne.clear(), ae.clear();
|
|
26
|
+
}
|
|
27
|
+
const tt = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
28
|
+
function F(e) {
|
|
29
|
+
if (e == null || e === "") return null;
|
|
30
|
+
const t = typeof e == "string" ? tt.exec(e) : null, n = t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3])) : e instanceof Date ? e : new Date(e);
|
|
31
|
+
return Number.isNaN(n.getTime()) ? null : n;
|
|
32
|
+
}
|
|
33
|
+
function V(e) {
|
|
34
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
35
|
+
}
|
|
36
|
+
function we(e) {
|
|
37
|
+
return V(e) ? J("count").format(e) : I;
|
|
38
|
+
}
|
|
39
|
+
function kn(e, t, n = `${t}s`) {
|
|
40
|
+
return V(e) ? `${we(e)} ${e === 1 ? t : n}` : I;
|
|
41
|
+
}
|
|
42
|
+
function wn(e) {
|
|
43
|
+
return V(e) ? Math.abs(e) < 1e4 ? we(e) : J("compact", { notation: "compact", maximumFractionDigits: 1 }).format(e).toLowerCase() : I;
|
|
44
|
+
}
|
|
45
|
+
const te = ["B", "KB", "MB", "GB", "TB"];
|
|
46
|
+
function In(e) {
|
|
47
|
+
if (!V(e) || e < 0) return I;
|
|
48
|
+
let t = e, n = 0;
|
|
49
|
+
for (; t >= 1024 && n < te.length - 1; )
|
|
50
|
+
t /= 1024, n += 1;
|
|
51
|
+
n < te.length - 1 && Math.round(t) >= 1024 && (t /= 1024, n += 1);
|
|
52
|
+
const a = n === 0 || t >= 100 ? 0 : 1;
|
|
53
|
+
return `${J(`bytes:${a}`, { maximumFractionDigits: a }).format(t)} ${te[n]}`;
|
|
54
|
+
}
|
|
55
|
+
function Cn(e, t = 1) {
|
|
56
|
+
return V(e) ? J(`percent:${t}`, { style: "percent", maximumFractionDigits: t }).format(e) : I;
|
|
57
|
+
}
|
|
58
|
+
function nt(e, t = /* @__PURE__ */ new Date()) {
|
|
59
|
+
const n = F(e);
|
|
60
|
+
if (!n) return I;
|
|
61
|
+
const a = n.getFullYear() === t.getFullYear();
|
|
62
|
+
return z(`date:${a}`, { month: "short", day: "numeric", ...a ? {} : { year: "numeric" } }).format(n);
|
|
63
|
+
}
|
|
64
|
+
function _n(e, t = /* @__PURE__ */ new Date()) {
|
|
65
|
+
const n = F(e);
|
|
66
|
+
if (!n) return I;
|
|
67
|
+
const a = n.getFullYear() === t.getFullYear();
|
|
68
|
+
return z(`day:${a}`, { weekday: "short", month: "short", day: "numeric", ...a ? {} : { year: "numeric" } }).format(n);
|
|
69
|
+
}
|
|
70
|
+
function at(e, t = /* @__PURE__ */ new Date()) {
|
|
71
|
+
const n = F(e);
|
|
72
|
+
if (!n) return I;
|
|
73
|
+
const a = n.getFullYear() === t.getFullYear();
|
|
74
|
+
return z(`datetime:${a}`, {
|
|
75
|
+
month: "short",
|
|
76
|
+
day: "numeric",
|
|
77
|
+
...a ? {} : { year: "numeric" },
|
|
78
|
+
hour: "numeric",
|
|
79
|
+
minute: "2-digit"
|
|
80
|
+
}).format(n);
|
|
81
|
+
}
|
|
82
|
+
function Sn(e) {
|
|
83
|
+
const t = F(e);
|
|
84
|
+
return t ? z("datetime:full", { dateStyle: "long", timeStyle: "medium" }).format(t) : I;
|
|
85
|
+
}
|
|
86
|
+
const st = [
|
|
87
|
+
["second", 60],
|
|
88
|
+
["minute", 60],
|
|
89
|
+
["hour", 24],
|
|
90
|
+
["day", 7],
|
|
91
|
+
["week", 4.345],
|
|
92
|
+
["month", 12],
|
|
93
|
+
["year", Number.POSITIVE_INFINITY]
|
|
94
|
+
], rt = {
|
|
95
|
+
second: "s",
|
|
96
|
+
minute: "m",
|
|
97
|
+
hour: "h",
|
|
98
|
+
day: "d",
|
|
99
|
+
week: "w",
|
|
100
|
+
month: "mo",
|
|
101
|
+
year: "y"
|
|
102
|
+
};
|
|
103
|
+
function it(e, t = /* @__PURE__ */ new Date()) {
|
|
104
|
+
const n = F(e);
|
|
105
|
+
if (!n) return I;
|
|
106
|
+
let a = (n.getTime() - t.getTime()) / 1e3;
|
|
107
|
+
if (Math.abs(a) < 45) return "just now";
|
|
108
|
+
for (const [s, i] of st) {
|
|
109
|
+
if (Math.abs(a) < i) {
|
|
110
|
+
const r = Math.round(a), l = rt[s] ?? s;
|
|
111
|
+
return r < 0 ? `${Math.abs(r)}${l} ago` : `in ${r}${l}`;
|
|
112
|
+
}
|
|
113
|
+
a /= i;
|
|
114
|
+
}
|
|
115
|
+
return I;
|
|
116
|
+
}
|
|
117
|
+
function Tn(e) {
|
|
118
|
+
if (e == null || !Number.isFinite(e)) return I;
|
|
119
|
+
const t = Math.max(0, e);
|
|
120
|
+
if (t < 1e3) return `${Math.round(t)}ms`;
|
|
121
|
+
if (t < 1e4) return `${(Math.floor(t / 100) / 10).toFixed(1)}s`;
|
|
122
|
+
const n = Math.floor(t / 1e3);
|
|
123
|
+
if (n < 60) return `${n}s`;
|
|
124
|
+
const a = Math.floor(n / 60);
|
|
125
|
+
if (a < 60) return `${a}m`;
|
|
126
|
+
const s = Math.floor(a / 60);
|
|
127
|
+
if (s < 24) return a % 60 ? `${s}h ${a % 60}m` : `${s}h`;
|
|
128
|
+
const i = Math.floor(s / 24);
|
|
129
|
+
return s % 24 ? `${i}d ${s % 24}h` : `${i}d`;
|
|
130
|
+
}
|
|
131
|
+
function An(e, t = /* @__PURE__ */ new Date()) {
|
|
132
|
+
const n = F(e);
|
|
133
|
+
return n ? `${at(n, t)} · ${it(n, t)}` : I;
|
|
134
|
+
}
|
|
135
|
+
const lt = { class: "it-dl-frame" }, ot = { class: "it-dl__label" }, Dn = /* @__PURE__ */ _({
|
|
136
|
+
__name: "ItDescriptionList",
|
|
137
|
+
props: {
|
|
138
|
+
items: {},
|
|
139
|
+
layout: { default: "inline" },
|
|
140
|
+
columns: { default: 1 }
|
|
141
|
+
},
|
|
142
|
+
setup(e) {
|
|
143
|
+
return (t, n) => (c(), d("div", lt, [
|
|
144
|
+
w("dl", {
|
|
145
|
+
class: C(["it-dl", [`it-dl--${e.layout}`, `it-dl--cols-${e.columns}`]])
|
|
146
|
+
}, [
|
|
147
|
+
(c(!0), d(ve, null, Be(e.items, (a) => (c(), d("div", {
|
|
148
|
+
key: a.key,
|
|
149
|
+
class: "it-dl__item"
|
|
150
|
+
}, [
|
|
151
|
+
w("dt", ot, g(a.label), 1),
|
|
152
|
+
w("dd", {
|
|
153
|
+
class: C(["it-dl__value", { "it-dl__value--mono": a.mono, "it-dl__value--empty": a.value == null || a.value === "" }])
|
|
154
|
+
}, [
|
|
155
|
+
k(t.$slots, a.key, { item: a }, () => [
|
|
156
|
+
T(g(a.value == null || a.value === "" ? v(I) : a.value), 1)
|
|
157
|
+
])
|
|
158
|
+
], 2)
|
|
159
|
+
]))), 128))
|
|
160
|
+
], 2)
|
|
161
|
+
]));
|
|
162
|
+
}
|
|
163
|
+
}), ut = { class: "it-empty__title" }, ct = {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: "it-empty__description"
|
|
166
|
+
}, dt = {
|
|
167
|
+
key: 1,
|
|
168
|
+
class: "it-empty__actions"
|
|
169
|
+
}, En = /* @__PURE__ */ _({
|
|
170
|
+
__name: "ItEmptyState",
|
|
171
|
+
props: {
|
|
172
|
+
title: {},
|
|
173
|
+
description: {},
|
|
174
|
+
icon: {},
|
|
175
|
+
size: { default: "sm" }
|
|
176
|
+
},
|
|
177
|
+
setup(e) {
|
|
178
|
+
return (t, n) => (c(), d("div", {
|
|
179
|
+
class: C(["it-empty", `it-empty--${e.size}`]),
|
|
180
|
+
role: "status"
|
|
181
|
+
}, [
|
|
182
|
+
(c(), q(ie(e.icon ?? v(Pe)), {
|
|
183
|
+
class: "it-empty__icon",
|
|
184
|
+
"stroke-width": 1.25,
|
|
185
|
+
"aria-hidden": "true"
|
|
186
|
+
})),
|
|
187
|
+
w("p", ut, g(e.title), 1),
|
|
188
|
+
e.description || t.$slots.default ? (c(), d("p", ct, [
|
|
189
|
+
k(t.$slots, "default", {}, () => [
|
|
190
|
+
T(g(e.description), 1)
|
|
191
|
+
])
|
|
192
|
+
])) : $("", !0),
|
|
193
|
+
t.$slots.actions ? (c(), d("div", dt, [
|
|
194
|
+
k(t.$slots, "actions")
|
|
195
|
+
])) : $("", !0)
|
|
196
|
+
], 2));
|
|
197
|
+
}
|
|
198
|
+
}), M = ["string"], O = ["number"], G = ["date"], E = [
|
|
199
|
+
{ key: "eq", label: "is", types: ["string", "number", "enum", "boolean"], value: "scalar" },
|
|
200
|
+
{ key: "neq", label: "is not", types: ["string", "number", "enum"], value: "scalar" },
|
|
201
|
+
{ key: "contains", label: "contains", types: M, value: "text" },
|
|
202
|
+
{ key: "not-contains", label: "does not contain", types: M, value: "text" },
|
|
203
|
+
{ key: "starts-with", label: "starts with", types: M, value: "text" },
|
|
204
|
+
{ key: "ends-with", label: "ends with", types: M, value: "text" },
|
|
205
|
+
{ key: "matches", label: "matches pattern", types: M, value: "pattern" },
|
|
206
|
+
{ key: "in", label: "is one of", types: ["string", "number", "enum"], value: "list" },
|
|
207
|
+
{ key: "not-in", label: "is not one of", types: ["string", "number", "enum"], value: "list" },
|
|
208
|
+
{ key: "gt", label: "is greater than", types: O, value: "number" },
|
|
209
|
+
{ key: "gte", label: "is at least", types: O, value: "number" },
|
|
210
|
+
{ key: "lt", label: "is less than", types: O, value: "number" },
|
|
211
|
+
{ key: "lte", label: "is at most", types: O, value: "number" },
|
|
212
|
+
{ key: "between", label: "is between", types: O, value: "number-range" },
|
|
213
|
+
{ key: "before", label: "is before", types: G, value: "date" },
|
|
214
|
+
{ key: "after", label: "is after", types: G, value: "date" },
|
|
215
|
+
{ key: "in-last", label: "is in the last", types: G, value: "duration" },
|
|
216
|
+
{ key: "older-than", label: "is more than", types: G, value: "duration-ago" },
|
|
217
|
+
{ key: "set", label: "is set", types: "*", value: "none" },
|
|
218
|
+
{ key: "not-set", label: "is not set", types: "*", value: "none" }
|
|
219
|
+
];
|
|
220
|
+
function Nn(e = []) {
|
|
221
|
+
const t = new Map(e.map((a) => [a.key, a])), n = E.map((a) => t.get(a.key) ?? a);
|
|
222
|
+
for (const a of e) E.some((s) => s.key === a.key) || n.push(a);
|
|
223
|
+
return n;
|
|
224
|
+
}
|
|
225
|
+
function oe(e, t = E) {
|
|
226
|
+
return e ? t.filter((n) => (n.types === "*" || n.types.includes(e.type)) && (!e.operators || e.operators.includes(n.key))) : [];
|
|
227
|
+
}
|
|
228
|
+
function D(e, t) {
|
|
229
|
+
return !e || !t ? "none" : e.value === "scalar" ? { string: "text", number: "number", date: "date", boolean: "boolean", enum: "option" }[t.type] : e.value === "list" ? t.type === "enum" ? "options" : "list" : e.value;
|
|
230
|
+
}
|
|
231
|
+
function se(e, t) {
|
|
232
|
+
switch (e) {
|
|
233
|
+
case "none":
|
|
234
|
+
return;
|
|
235
|
+
case "text":
|
|
236
|
+
case "pattern":
|
|
237
|
+
return "";
|
|
238
|
+
case "number":
|
|
239
|
+
case "date":
|
|
240
|
+
case "boolean":
|
|
241
|
+
case "option":
|
|
242
|
+
return null;
|
|
243
|
+
case "number-range":
|
|
244
|
+
return [null, null];
|
|
245
|
+
case "field":
|
|
246
|
+
return { field: null };
|
|
247
|
+
case "duration":
|
|
248
|
+
case "duration-ago":
|
|
249
|
+
return { amount: null, unit: "days" };
|
|
250
|
+
case "list":
|
|
251
|
+
case "options":
|
|
252
|
+
return [];
|
|
253
|
+
default:
|
|
254
|
+
return t != null && t.defaultValue ? t.defaultValue() : null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function Bn(e) {
|
|
258
|
+
const t = { string: "Text", number: "Number", date: "Date", boolean: "True or false", enum: "Choice" };
|
|
259
|
+
return e.multiple ? `${t[e.type]} list` : t[e.type];
|
|
260
|
+
}
|
|
261
|
+
let fe = 0;
|
|
262
|
+
function W(e = "n") {
|
|
263
|
+
return fe += 1, `${e}${fe.toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
264
|
+
}
|
|
265
|
+
function Fn(e = {}) {
|
|
266
|
+
return { id: e.id ?? W("c"), field: e.field ?? null, operator: e.operator ?? null, value: e.value, ...e.quantifier ? { quantifier: e.quantifier } : {}, ...e.meta ? { meta: e.meta } : {} };
|
|
267
|
+
}
|
|
268
|
+
function ft(e = {}) {
|
|
269
|
+
return { id: e.id ?? W("g"), join: e.join ?? "all", ...e.negate ? { negate: !0 } : {}, children: e.children ?? [], ...e.meta ? { meta: e.meta } : {} };
|
|
270
|
+
}
|
|
271
|
+
function A(e) {
|
|
272
|
+
return !!e && Array.isArray(e.children);
|
|
273
|
+
}
|
|
274
|
+
function mt(e) {
|
|
275
|
+
return e.negate ? e.join === "any" ? "none" : "not-all" : e.join;
|
|
276
|
+
}
|
|
277
|
+
function Ln(e, t) {
|
|
278
|
+
const n = t === "all" || t === "not-all" ? "all" : "any", a = t === "none" || t === "not-all", { negate: s, ...i } = e;
|
|
279
|
+
return a ? { ...i, join: n, negate: !0 } : { ...i, join: n };
|
|
280
|
+
}
|
|
281
|
+
function Z(e, t) {
|
|
282
|
+
if (e.id === t) return { node: e, parent: null, index: 0, depth: 0 };
|
|
283
|
+
const n = (a, s) => {
|
|
284
|
+
for (let i = 0; i < a.children.length; i++) {
|
|
285
|
+
const r = a.children[i];
|
|
286
|
+
if (r.id === t) return { node: r, parent: a, index: i, depth: s + 1 };
|
|
287
|
+
if (A(r)) {
|
|
288
|
+
const l = n(r, s + 1);
|
|
289
|
+
if (l) return l;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
};
|
|
294
|
+
return n(e, 0);
|
|
295
|
+
}
|
|
296
|
+
function ue(e) {
|
|
297
|
+
return e.children.flatMap((t) => A(t) ? ue(t) : [t]);
|
|
298
|
+
}
|
|
299
|
+
function xn(e) {
|
|
300
|
+
return ue(e).length === 0;
|
|
301
|
+
}
|
|
302
|
+
function bt(e) {
|
|
303
|
+
const t = e.children.filter(A);
|
|
304
|
+
return t.length ? 1 + Math.max(...t.map(bt)) : 0;
|
|
305
|
+
}
|
|
306
|
+
function L(e, t, n) {
|
|
307
|
+
if (e.id === t) {
|
|
308
|
+
const i = n(e);
|
|
309
|
+
return A(i) ? i : e;
|
|
310
|
+
}
|
|
311
|
+
let a = !1;
|
|
312
|
+
const s = e.children.map((i) => {
|
|
313
|
+
if (i.id === t)
|
|
314
|
+
return a = !0, n(i);
|
|
315
|
+
if (A(i)) {
|
|
316
|
+
const r = L(i, t, n);
|
|
317
|
+
return r !== i && (a = !0), r;
|
|
318
|
+
}
|
|
319
|
+
return i;
|
|
320
|
+
});
|
|
321
|
+
return a ? { ...e, children: s } : e;
|
|
322
|
+
}
|
|
323
|
+
function Mn(e, t) {
|
|
324
|
+
const n = Z(e, t);
|
|
325
|
+
return n != null && n.parent ? L(e, n.parent.id, (a) => ({ ...a, children: a.children.filter((s) => s.id !== t) })) : e;
|
|
326
|
+
}
|
|
327
|
+
function yt(e, t, n, a) {
|
|
328
|
+
return L(e, t, (s) => {
|
|
329
|
+
if (!A(s)) return s;
|
|
330
|
+
const i = [...s.children];
|
|
331
|
+
return i.splice(a ?? i.length, 0, n), { ...s, children: i };
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function On(e, t, n) {
|
|
335
|
+
const a = Z(e, t);
|
|
336
|
+
if (!(a != null && a.parent)) return e;
|
|
337
|
+
const s = a.index + n;
|
|
338
|
+
return s < 0 || s >= a.parent.children.length ? e : L(e, a.parent.id, (i) => {
|
|
339
|
+
const r = [...i.children], [l] = r.splice(a.index, 1);
|
|
340
|
+
return r.splice(s, 0, l), { ...i, children: r };
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function Ie(e) {
|
|
344
|
+
return A(e) ? { ...e, id: W("g"), children: e.children.map(Ie) } : { ...e, id: W("c") };
|
|
345
|
+
}
|
|
346
|
+
function Rn(e, t) {
|
|
347
|
+
const n = Z(e, t);
|
|
348
|
+
return n != null && n.parent ? yt(e, n.parent.id, Ie(n.node), n.index + 1) : e;
|
|
349
|
+
}
|
|
350
|
+
function jn(e, t, n = "any") {
|
|
351
|
+
const a = Z(e, t);
|
|
352
|
+
return a != null && a.parent ? L(e, t, (s) => ft({ join: n, children: [s] })) : e;
|
|
353
|
+
}
|
|
354
|
+
function qn(e, t, n) {
|
|
355
|
+
var f;
|
|
356
|
+
const a = n.operators ?? E, { quantifier: s, ...i } = e;
|
|
357
|
+
if (!t) return { ...i, field: null, operator: null, value: void 0 };
|
|
358
|
+
const r = t.multiple ? { quantifier: e.quantifier ?? "every" } : {}, l = oe(t, a), u = l.find((h) => h.key === e.operator);
|
|
359
|
+
if (u) {
|
|
360
|
+
const h = n.fields.find((ee) => ee.key === e.field), b = D(u, t), m = h !== void 0 && D(u, h) === b, S = (ee) => {
|
|
361
|
+
var ce;
|
|
362
|
+
return ((ce = t.options) == null ? void 0 : ce.some((Ne) => Ne.value === ee)) ?? !1;
|
|
363
|
+
}, x = b === "option" ? e.value == null || S(e.value) : b === "options" ? Array.isArray(e.value) && e.value.every(S) : !0, U = b !== "field" || ((f = e.value) == null ? void 0 : f.field) !== t.key;
|
|
364
|
+
return { ...i, ...r, field: t.key, value: m && x && U ? e.value : se(b, u) };
|
|
365
|
+
}
|
|
366
|
+
const o = l[0];
|
|
367
|
+
return { ...i, ...r, field: t.key, operator: (o == null ? void 0 : o.key) ?? null, value: se(D(o, t), o) };
|
|
368
|
+
}
|
|
369
|
+
function zn(e, t, n, a = E) {
|
|
370
|
+
const s = D(a.find((u) => u.key === e.operator), n), i = a.find((u) => u.key === t), r = D(i, n);
|
|
371
|
+
let l;
|
|
372
|
+
return s === r ? l = e.value : (r === "list" || r === "options") && p(e.value) && !Array.isArray(e.value) && typeof e.value != "object" ? l = [e.value] : (s === "list" || s === "options") && Array.isArray(e.value) && e.value.length === 1 && ["text", "number", "option"].includes(r) ? l = e.value[0] : s === "text" && r === "pattern" || s === "pattern" && r === "text" ? l = e.value : l = se(r, i), { ...e, operator: t, value: l };
|
|
373
|
+
}
|
|
374
|
+
function Vn(e, t, n) {
|
|
375
|
+
return L(e, t, (a) => ({ ...a, meta: { ...a.meta ?? {}, ...n } }));
|
|
376
|
+
}
|
|
377
|
+
function p(e) {
|
|
378
|
+
return e == null ? !1 : typeof e == "string" ? e.trim() !== "" : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.length > 0 : !0;
|
|
379
|
+
}
|
|
380
|
+
function ht(e, t, n, a) {
|
|
381
|
+
const s = (r) => ({ kind: "value", message: r }), i = (r) => ({ kind: "invalid", message: r });
|
|
382
|
+
switch (e) {
|
|
383
|
+
case "none":
|
|
384
|
+
return null;
|
|
385
|
+
case "text":
|
|
386
|
+
return p(t) ? null : s("Enter a value.");
|
|
387
|
+
case "pattern": {
|
|
388
|
+
if (!p(t)) return s("Enter a pattern.");
|
|
389
|
+
try {
|
|
390
|
+
return new RegExp(String(t)), null;
|
|
391
|
+
} catch {
|
|
392
|
+
return i("This pattern is not valid. Check brackets and escapes.");
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
case "number":
|
|
396
|
+
return p(t) ? null : s("Enter a number.");
|
|
397
|
+
case "number-range": {
|
|
398
|
+
const [r, l] = Array.isArray(t) ? t : [];
|
|
399
|
+
return !p(r) || !p(l) ? s("Enter both numbers.") : r > l ? i("The first number must be smaller than the second.") : null;
|
|
400
|
+
}
|
|
401
|
+
case "date":
|
|
402
|
+
return p(t) ? null : s("Choose a date.");
|
|
403
|
+
case "duration":
|
|
404
|
+
case "duration-ago": {
|
|
405
|
+
const r = t == null ? void 0 : t.amount;
|
|
406
|
+
return p(r) ? r > 0 ? null : i("Enter a number above 0.") : s("Enter a number.");
|
|
407
|
+
}
|
|
408
|
+
case "boolean":
|
|
409
|
+
return typeof t == "boolean" ? null : s("Choose true or false.");
|
|
410
|
+
case "option":
|
|
411
|
+
return p(t) ? null : s("Choose a value.");
|
|
412
|
+
case "list":
|
|
413
|
+
case "options":
|
|
414
|
+
return p(t) ? null : s("Add at least one value.");
|
|
415
|
+
default: {
|
|
416
|
+
const r = n.validate ? n.validate(t, a) : p(t) ? null : "Choose a value.";
|
|
417
|
+
return r ? s(r) : null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function pt(e, t) {
|
|
422
|
+
var u;
|
|
423
|
+
const n = t.operators ?? E, a = e.id;
|
|
424
|
+
if (!e.field) return [{ id: a, kind: "field", message: "Choose a field." }];
|
|
425
|
+
const s = t.fields.find((o) => o.key === e.field);
|
|
426
|
+
if (!s) return [{ id: a, kind: "field", message: "This field is no longer available. Choose another." }];
|
|
427
|
+
const i = oe(s, n).find((o) => o.key === e.operator);
|
|
428
|
+
if (!i) return [{ id: a, kind: "operator", message: "Choose a comparison." }];
|
|
429
|
+
const r = D(i, s);
|
|
430
|
+
if (r === "field") {
|
|
431
|
+
const o = (u = e.value) == null ? void 0 : u.field;
|
|
432
|
+
return o ? o === s.key || !t.fields.some((f) => f.key === o) ? [{ id: a, kind: "invalid", message: "Choose another available field." }] : [] : [{ id: a, kind: "value", message: "Choose another field." }];
|
|
433
|
+
}
|
|
434
|
+
const l = ht(r, e.value, i, s);
|
|
435
|
+
return l ? [{ id: a, ...l }] : [];
|
|
436
|
+
}
|
|
437
|
+
function Un(e, t) {
|
|
438
|
+
const n = [], a = (i) => {
|
|
439
|
+
i.children.length || n.push(i === e ? { id: i.id, kind: "empty", message: "Add at least one condition." } : { id: i.id, kind: "group", message: "Add a condition to this group, or remove it." });
|
|
440
|
+
for (const r of i.children)
|
|
441
|
+
A(r) ? a(r) : n.push(...pt(r, t));
|
|
442
|
+
};
|
|
443
|
+
a(e);
|
|
444
|
+
const s = new Set(ue(e).map((i) => i.field));
|
|
445
|
+
for (const i of t.fields)
|
|
446
|
+
i.required && !s.has(i.key) && n.push({ id: e.id, kind: "required", message: `Add a condition on ${i.label}.` });
|
|
447
|
+
return n;
|
|
448
|
+
}
|
|
449
|
+
function Pn(e) {
|
|
450
|
+
if (!e.length) return "";
|
|
451
|
+
const t = (b) => e.filter((m) => m.kind === b).length, n = [], a = (b, m, S) => `${b} ${b === 1 ? m : S}`, s = t("field"), i = t("operator"), r = t("value"), l = t("invalid"), u = t("group");
|
|
452
|
+
s && n.push(a(s, "condition needs a field", "conditions need a field")), i && n.push(a(i, "condition needs a comparison", "conditions need a comparison")), r && n.push(a(r, "condition needs a value", "conditions need a value")), l && n.push(a(l, "value is not valid", "values are not valid")), u && n.push(a(u, "group is empty", "groups are empty"));
|
|
453
|
+
const o = e.filter((b) => b.kind === "required" || b.kind === "empty").map((b) => b.message.replace(/\.$/, "")), f = [...n, ...o.map((b) => b.charAt(0).toLowerCase() + b.slice(1))], h = f.length > 1 ? `${f.slice(0, -1).join(", ")} and ${f[f.length - 1]}` : f[0];
|
|
454
|
+
return `${h.charAt(0).toUpperCase()}${h.slice(1)}.`;
|
|
455
|
+
}
|
|
456
|
+
const vt = "(choose a field)", gt = "(choose a comparison)", $t = "(choose a value)";
|
|
457
|
+
function kt(e) {
|
|
458
|
+
return e.length > 1 && e[1] === e[1].toUpperCase() && /[A-Z0-9]/.test(e[1]) ? e : e.charAt(0).toLowerCase() + e.slice(1);
|
|
459
|
+
}
|
|
460
|
+
function me(e) {
|
|
461
|
+
return `“${e}”`;
|
|
462
|
+
}
|
|
463
|
+
function be(e, t = "or") {
|
|
464
|
+
return e.length <= 1 ? e[0] ?? "" : e.length === 2 ? `${e[0]} ${t} ${e[1]}` : `${e.slice(0, -1).join(", ")}, ${t} ${e[e.length - 1]}`;
|
|
465
|
+
}
|
|
466
|
+
function j(e) {
|
|
467
|
+
return typeof e == "number" && Number.isFinite(e) ? e.toLocaleString("en-US") : "";
|
|
468
|
+
}
|
|
469
|
+
function wt(e) {
|
|
470
|
+
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e)) return "";
|
|
471
|
+
const [t, n, a] = e.slice(0, 10).split("-").map(Number);
|
|
472
|
+
return nt(new Date(t, n - 1, a));
|
|
473
|
+
}
|
|
474
|
+
function ye(e, t) {
|
|
475
|
+
const n = e;
|
|
476
|
+
if (!n || !p(n.amount)) return "";
|
|
477
|
+
const a = n.amount === 1 ? n.unit.replace(/s$/, "") : n.unit;
|
|
478
|
+
return `${j(n.amount)} ${a}${t ? " ago" : ""}`;
|
|
479
|
+
}
|
|
480
|
+
function he(e, t) {
|
|
481
|
+
var n, a;
|
|
482
|
+
return ((a = (n = e.options) == null ? void 0 : n.find((s) => s.value === t)) == null ? void 0 : a.label) ?? String(t);
|
|
483
|
+
}
|
|
484
|
+
function It(e, t, n, a, s = []) {
|
|
485
|
+
var i;
|
|
486
|
+
switch (e) {
|
|
487
|
+
case "field": {
|
|
488
|
+
const r = t == null ? void 0 : t.field;
|
|
489
|
+
return r === n.key ? "" : ((i = s.find((l) => l.key === r)) == null ? void 0 : i.label) ?? "";
|
|
490
|
+
}
|
|
491
|
+
case "none":
|
|
492
|
+
return "";
|
|
493
|
+
case "text":
|
|
494
|
+
case "pattern":
|
|
495
|
+
return p(t) ? me(String(t)) : "";
|
|
496
|
+
case "number":
|
|
497
|
+
return j(t);
|
|
498
|
+
case "number-range": {
|
|
499
|
+
const [r, l] = Array.isArray(t) ? t : [];
|
|
500
|
+
return p(r) && p(l) ? `${j(r)} and ${j(l)}` : "";
|
|
501
|
+
}
|
|
502
|
+
case "date":
|
|
503
|
+
return wt(t);
|
|
504
|
+
case "duration":
|
|
505
|
+
return ye(t, !1);
|
|
506
|
+
case "duration-ago":
|
|
507
|
+
return ye(t, !0);
|
|
508
|
+
case "boolean":
|
|
509
|
+
return typeof t == "boolean" ? String(t) : "";
|
|
510
|
+
case "option":
|
|
511
|
+
return p(t) ? he(n, t) : "";
|
|
512
|
+
case "options":
|
|
513
|
+
return Array.isArray(t) ? be(t.map((r) => he(n, r))) : "";
|
|
514
|
+
case "list":
|
|
515
|
+
return Array.isArray(t) ? be(t.map((r) => n.type === "number" ? j(Number(r)) : me(String(r)))) : "";
|
|
516
|
+
default:
|
|
517
|
+
return a != null && a.describe ? a.describe(t, n) : p(t) ? String(t) : "";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const Ct = { every: "every", any: "any", none: "no" };
|
|
521
|
+
function Ce(e, t) {
|
|
522
|
+
const n = t.operators ?? E, a = t.fields.find((o) => o.key === e.field);
|
|
523
|
+
if (!a) return [{ kind: "missing", text: vt }];
|
|
524
|
+
const s = [], i = kt(a.label);
|
|
525
|
+
s.push({ kind: "field", text: a.multiple ? `${Ct[e.quantifier ?? "every"]} ${i}` : i });
|
|
526
|
+
const r = oe(a, n).find((o) => o.key === e.operator);
|
|
527
|
+
if (!r) return [...s, { kind: "missing", text: gt }];
|
|
528
|
+
s.push({ kind: "operator", text: r.label });
|
|
529
|
+
const l = D(r, a);
|
|
530
|
+
if (l === "none") return s;
|
|
531
|
+
const u = It(l, e.value, a, r, t.fields);
|
|
532
|
+
return s.push(u ? { kind: "value", text: u } : { kind: "missing", text: $t }), s;
|
|
533
|
+
}
|
|
534
|
+
function _t(e) {
|
|
535
|
+
return e.join === "all" ? "and" : "or";
|
|
536
|
+
}
|
|
537
|
+
function St(e, t, n = {}) {
|
|
538
|
+
if (A(e)) return _e(e, t, n, !0);
|
|
539
|
+
const a = Ce(e, t);
|
|
540
|
+
return n.condition ? n.condition(e, a) : a;
|
|
541
|
+
}
|
|
542
|
+
function _e(e, t, n = {}, a = !1) {
|
|
543
|
+
const s = e.children.map((l) => St(l, t, n));
|
|
544
|
+
if (!s.length) return [{ kind: "missing", text: "(no conditions)" }];
|
|
545
|
+
const i = [], r = e.negate || a && s.length > 1;
|
|
546
|
+
return e.negate && i.push({ kind: "join", text: s.length === 1 ? "not" : e.join === "any" ? "none of" : "not all of" }), r && i.push({ kind: "open", text: "(" }), s.forEach((l, u) => {
|
|
547
|
+
u > 0 && i.push({ kind: "join", text: e.negate ? "," : _t(e) }), i.push(...l);
|
|
548
|
+
}), r && i.push({ kind: "close", text: ")" }), i;
|
|
549
|
+
}
|
|
550
|
+
function Se(e) {
|
|
551
|
+
let t = "";
|
|
552
|
+
for (const n of e) {
|
|
553
|
+
const a = n.kind === "close" || n.text === "," || t.endsWith("(") || t === "";
|
|
554
|
+
t += a ? n.text : ` ${n.text}`;
|
|
555
|
+
}
|
|
556
|
+
return t;
|
|
557
|
+
}
|
|
558
|
+
function Gn(e, t, n = {}) {
|
|
559
|
+
const a = Se(_e(e, t, n)), s = n.lead ? `${n.lead} ${a}` : a;
|
|
560
|
+
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
561
|
+
}
|
|
562
|
+
function Yn(e, t) {
|
|
563
|
+
const n = Se(Ce(e, t));
|
|
564
|
+
return `${n.charAt(0).toUpperCase()}${n.slice(1)}`;
|
|
565
|
+
}
|
|
566
|
+
function Hn(e, t = "Match") {
|
|
567
|
+
const n = mt(e);
|
|
568
|
+
return `${t} ${n === "not-all" ? "not all" : n} of the following`;
|
|
569
|
+
}
|
|
570
|
+
const Tt = Symbol("it-logic-builder");
|
|
571
|
+
function K(e) {
|
|
572
|
+
return e ? e.some((t) => t.type === Le ? !1 : t.type === xe ? String(t.children ?? "").trim() !== "" : t.type === ve ? K(t.children) : !0) : !1;
|
|
573
|
+
}
|
|
574
|
+
const Wn = _({
|
|
575
|
+
name: "ItLogicRegion",
|
|
576
|
+
props: {
|
|
577
|
+
name: { type: String, required: !0 },
|
|
578
|
+
scope: { type: Object, default: () => ({}) },
|
|
579
|
+
tag: { type: String, default: "div" },
|
|
580
|
+
regionClass: { type: String, default: "" }
|
|
581
|
+
},
|
|
582
|
+
setup(e, { slots: t }) {
|
|
583
|
+
const n = le(Tt, null);
|
|
584
|
+
return () => {
|
|
585
|
+
var i, r, l;
|
|
586
|
+
const a = (r = n == null ? void 0 : (i = n.slots)[e.name]) == null ? void 0 : r.call(i, e.scope), s = K(a) ? a : (l = t.default) == null ? void 0 : l.call(t);
|
|
587
|
+
return K(s) ? Fe(e.tag, { class: e.regionClass || void 0 }, s) : null;
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
}), At = ["aria-labelledby", "aria-label"], Dt = {
|
|
591
|
+
key: 0,
|
|
592
|
+
class: "it-resource-list__head"
|
|
593
|
+
}, Et = {
|
|
594
|
+
key: 1,
|
|
595
|
+
class: "it-resource-list__meta"
|
|
596
|
+
}, Nt = {
|
|
597
|
+
key: 2,
|
|
598
|
+
class: "it-resource-list__actions"
|
|
599
|
+
}, Bt = {
|
|
600
|
+
key: 1,
|
|
601
|
+
class: "it-resource-list__empty"
|
|
602
|
+
}, Kn = /* @__PURE__ */ _({
|
|
603
|
+
__name: "ItResourceList",
|
|
604
|
+
props: {
|
|
605
|
+
title: { default: void 0 },
|
|
606
|
+
meta: { default: void 0 },
|
|
607
|
+
label: { default: void 0 },
|
|
608
|
+
headingLevel: { default: 3 },
|
|
609
|
+
variant: { default: "boxed" },
|
|
610
|
+
reserveRows: { default: void 0 }
|
|
611
|
+
},
|
|
612
|
+
setup(e) {
|
|
613
|
+
const t = e, n = ge(), a = `it-resource-list-${Q()}`, s = () => !!(t.title || n.heading), i = () => {
|
|
614
|
+
var r;
|
|
615
|
+
return K((r = n.default) == null ? void 0 : r.call(n));
|
|
616
|
+
};
|
|
617
|
+
return (r, l) => (c(), d("section", {
|
|
618
|
+
class: C(["it-resource-list", `it-resource-list--${e.variant}`]),
|
|
619
|
+
"aria-labelledby": s() ? a : void 0,
|
|
620
|
+
"aria-label": s() ? void 0 : e.label
|
|
621
|
+
}, [
|
|
622
|
+
s() || e.meta || r.$slots.actions ? (c(), d("div", Dt, [
|
|
623
|
+
s() ? (c(), q(ie(`h${e.headingLevel}`), {
|
|
624
|
+
key: 0,
|
|
625
|
+
id: a,
|
|
626
|
+
class: "it-resource-list__title"
|
|
627
|
+
}, {
|
|
628
|
+
default: Y(() => [
|
|
629
|
+
k(r.$slots, "heading", {}, () => [
|
|
630
|
+
T(g(e.title), 1)
|
|
631
|
+
])
|
|
632
|
+
]),
|
|
633
|
+
_: 3
|
|
634
|
+
})) : $("", !0),
|
|
635
|
+
e.meta ? (c(), d("span", Et, g(e.meta), 1)) : $("", !0),
|
|
636
|
+
r.$slots.actions ? (c(), d("div", Nt, [
|
|
637
|
+
k(r.$slots, "actions")
|
|
638
|
+
])) : $("", !0)
|
|
639
|
+
])) : $("", !0),
|
|
640
|
+
w("ul", {
|
|
641
|
+
class: C(["it-resource-list__items", { "it-resource-list__items--reserve": e.reserveRows }]),
|
|
642
|
+
style: Me(e.reserveRows ? { "--it-resource-list-reserve": e.reserveRows } : void 0)
|
|
643
|
+
}, [
|
|
644
|
+
!r.$slots.empty || i() ? k(r.$slots, "default", {}, void 0, void 0, 0) : (c(), d("li", Bt, [
|
|
645
|
+
k(r.$slots, "empty")
|
|
646
|
+
]))
|
|
647
|
+
], 6)
|
|
648
|
+
], 10, At));
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
function Ft() {
|
|
652
|
+
const e = Oe();
|
|
653
|
+
return (e == null ? void 0 : e.appContext.components.RouterLink) ?? null;
|
|
654
|
+
}
|
|
655
|
+
function Lt(e, t) {
|
|
656
|
+
if (t) return t;
|
|
657
|
+
if (typeof e == "string") return e;
|
|
658
|
+
if (e && typeof e.path == "string") return e.path;
|
|
659
|
+
}
|
|
660
|
+
const xt = {
|
|
661
|
+
key: 0,
|
|
662
|
+
class: "it-resource-item__leading"
|
|
663
|
+
}, Mt = { class: "it-resource-item__text" }, Ot = ["href", "aria-describedby"], Rt = ["aria-describedby"], jt = {
|
|
664
|
+
key: 3,
|
|
665
|
+
class: "it-resource-item__title"
|
|
666
|
+
}, qt = { class: "it-resource-item__meta-text" }, zt = {
|
|
667
|
+
key: 1,
|
|
668
|
+
class: "it-resource-item__status"
|
|
669
|
+
}, Vt = {
|
|
670
|
+
key: 2,
|
|
671
|
+
class: "it-resource-item__actions"
|
|
672
|
+
}, Qn = /* @__PURE__ */ _({
|
|
673
|
+
__name: "ItResourceListItem",
|
|
674
|
+
props: {
|
|
675
|
+
title: {},
|
|
676
|
+
meta: { default: void 0 },
|
|
677
|
+
clickable: { type: Boolean, default: !1 },
|
|
678
|
+
to: { default: void 0 },
|
|
679
|
+
href: { default: void 0 }
|
|
680
|
+
},
|
|
681
|
+
emits: ["select"],
|
|
682
|
+
setup(e, { emit: t }) {
|
|
683
|
+
const n = e, a = Ft(), s = y(() => !!(n.to && a)), i = y(() => s.value ? void 0 : Lt(n.to, n.href)), r = t;
|
|
684
|
+
function l(o) {
|
|
685
|
+
r("select", o);
|
|
686
|
+
}
|
|
687
|
+
const u = `it-resource-item-${Q()}`;
|
|
688
|
+
return (o, f) => (c(), d("li", {
|
|
689
|
+
class: C(["it-resource-item", { "it-resource-item--interactive": e.clickable || e.to || e.href }])
|
|
690
|
+
}, [
|
|
691
|
+
o.$slots.leading ? (c(), d("div", xt, [
|
|
692
|
+
k(o.$slots, "leading")
|
|
693
|
+
])) : $("", !0),
|
|
694
|
+
w("div", Mt, [
|
|
695
|
+
s.value ? R((c(), q(ie(v(a)), {
|
|
696
|
+
key: 0,
|
|
697
|
+
class: "it-resource-item__title it-resource-item__target",
|
|
698
|
+
to: e.to,
|
|
699
|
+
"aria-describedby": e.meta || o.$slots.meta ? u : void 0,
|
|
700
|
+
onClick: l
|
|
701
|
+
}, {
|
|
702
|
+
default: Y(() => [
|
|
703
|
+
T(g(e.title), 1)
|
|
704
|
+
]),
|
|
705
|
+
_: 1
|
|
706
|
+
}, 8, ["to", "aria-describedby"])), [
|
|
707
|
+
[v(P)]
|
|
708
|
+
]) : i.value ? R((c(), d("a", {
|
|
709
|
+
key: 1,
|
|
710
|
+
class: "it-resource-item__title it-resource-item__target",
|
|
711
|
+
href: i.value,
|
|
712
|
+
"aria-describedby": e.meta || o.$slots.meta ? u : void 0,
|
|
713
|
+
onClick: l
|
|
714
|
+
}, [
|
|
715
|
+
T(g(e.title), 1)
|
|
716
|
+
], 8, Ot)), [
|
|
717
|
+
[v(P)]
|
|
718
|
+
]) : e.clickable || e.to || e.href ? R((c(), d("button", {
|
|
719
|
+
key: 2,
|
|
720
|
+
type: "button",
|
|
721
|
+
class: "it-resource-item__title it-resource-item__target",
|
|
722
|
+
"aria-describedby": e.meta || o.$slots.meta ? u : void 0,
|
|
723
|
+
onClick: l
|
|
724
|
+
}, [
|
|
725
|
+
T(g(e.title), 1)
|
|
726
|
+
], 8, Rt)), [
|
|
727
|
+
[v(P)]
|
|
728
|
+
]) : R((c(), d("span", jt, [
|
|
729
|
+
T(g(e.title), 1)
|
|
730
|
+
])), [
|
|
731
|
+
[v(P)]
|
|
732
|
+
]),
|
|
733
|
+
e.meta || o.$slots.meta ? (c(), d("div", {
|
|
734
|
+
key: 4,
|
|
735
|
+
id: u,
|
|
736
|
+
class: "it-resource-item__meta"
|
|
737
|
+
}, [
|
|
738
|
+
k(o.$slots, "meta", {}, () => [
|
|
739
|
+
w("span", qt, g(e.meta), 1)
|
|
740
|
+
])
|
|
741
|
+
])) : $("", !0)
|
|
742
|
+
]),
|
|
743
|
+
o.$slots.status ? (c(), d("div", zt, [
|
|
744
|
+
k(o.$slots, "status")
|
|
745
|
+
])) : $("", !0),
|
|
746
|
+
o.$slots.actions ? (c(), d("div", Vt, [
|
|
747
|
+
k(o.$slots, "actions")
|
|
748
|
+
])) : $("", !0)
|
|
749
|
+
], 2));
|
|
750
|
+
}
|
|
751
|
+
}), Te = Symbol("it-form-field"), Xn = 8;
|
|
752
|
+
function Ut(e, t = {}) {
|
|
753
|
+
const n = le(Te, null);
|
|
754
|
+
t.group && (n == null || n.registerGroup());
|
|
755
|
+
const a = Q(), s = y(() => e.id ?? (n == null ? void 0 : n.state.value.id) ?? `it-control-${a}`), i = y(() => n && s.value === n.state.value.id ? n.state.value.labelId : void 0), r = y(() => e.invalid ?? (n == null ? void 0 : n.state.value.invalid) ?? !1), l = y(() => e.describedBy ?? (n == null ? void 0 : n.state.value.describedBy));
|
|
756
|
+
return { id: s, labelId: i, invalid: r, describedBy: l };
|
|
757
|
+
}
|
|
758
|
+
function Pt(e, t) {
|
|
759
|
+
if (!t) return e;
|
|
760
|
+
const n = { ...e };
|
|
761
|
+
for (const [a, s] of Object.entries(t)) {
|
|
762
|
+
const i = n[a], r = (l) => !!l && typeof l == "object" && !Array.isArray(l);
|
|
763
|
+
n[a] = r(i) && r(s) ? { ...i, ...s } : s;
|
|
764
|
+
}
|
|
765
|
+
return n;
|
|
766
|
+
}
|
|
767
|
+
const Gt = ["id", "for"], Yt = {
|
|
768
|
+
key: 0,
|
|
769
|
+
class: "it-field__required",
|
|
770
|
+
"aria-hidden": "true"
|
|
771
|
+
}, Ht = {
|
|
772
|
+
key: 1,
|
|
773
|
+
class: "it-sr-only"
|
|
774
|
+
}, Wt = {
|
|
775
|
+
key: 2,
|
|
776
|
+
class: "it-field__optional"
|
|
777
|
+
}, Kt = ["id"], Qt = ["id"], Jn = /* @__PURE__ */ _({
|
|
778
|
+
__name: "ItFormField",
|
|
779
|
+
props: {
|
|
780
|
+
label: {},
|
|
781
|
+
help: {},
|
|
782
|
+
error: {},
|
|
783
|
+
required: { type: Boolean },
|
|
784
|
+
optional: { type: Boolean },
|
|
785
|
+
id: {},
|
|
786
|
+
hideLabel: { type: Boolean },
|
|
787
|
+
size: {}
|
|
788
|
+
},
|
|
789
|
+
setup(e) {
|
|
790
|
+
const t = e, n = ge(), a = Q(), s = y(() => t.id ?? `it-field-${a}`), i = y(() => `${s.value}-label`), r = y(() => `${s.value}-help`), l = y(() => `${s.value}-error`), u = y(() => !!t.error), o = B(!!n.help);
|
|
791
|
+
Re(() => o.value = !!n.help);
|
|
792
|
+
const f = y(() => !!t.help || o.value), h = y(() => {
|
|
793
|
+
const m = [t.error ? l.value : null, f.value ? r.value : null].filter(Boolean);
|
|
794
|
+
return m.length ? m.join(" ") : void 0;
|
|
795
|
+
}), b = B(!1);
|
|
796
|
+
return $e(Te, {
|
|
797
|
+
state: y(() => ({ id: s.value, labelId: i.value, invalid: u.value, describedBy: h.value })),
|
|
798
|
+
registerGroup: () => b.value = !0
|
|
799
|
+
}), (m, S) => (c(), d("div", {
|
|
800
|
+
class: C(["it-field", [{ "it-field--invalid": u.value }, e.size && e.size !== "full" ? ["it-field--sized", `it-field--${e.size}`] : void 0]])
|
|
801
|
+
}, [
|
|
802
|
+
w("div", {
|
|
803
|
+
class: C(["it-field__label-row", { "it-sr-only": e.hideLabel }])
|
|
804
|
+
}, [
|
|
805
|
+
w("label", {
|
|
806
|
+
id: i.value,
|
|
807
|
+
for: b.value ? void 0 : s.value,
|
|
808
|
+
class: "it-field__label"
|
|
809
|
+
}, [
|
|
810
|
+
T(g(e.label) + " ", 1),
|
|
811
|
+
e.required ? (c(), d("span", Yt, "*")) : $("", !0),
|
|
812
|
+
e.required ? (c(), d("span", Ht, "(required)")) : $("", !0),
|
|
813
|
+
e.optional && !e.required ? (c(), d("span", Wt, "(optional)")) : $("", !0)
|
|
814
|
+
], 8, Gt),
|
|
815
|
+
k(m.$slots, "labelExtra")
|
|
816
|
+
], 2),
|
|
817
|
+
k(m.$slots, "default", {
|
|
818
|
+
id: s.value,
|
|
819
|
+
invalid: u.value,
|
|
820
|
+
describedBy: h.value
|
|
821
|
+
}),
|
|
822
|
+
e.error ? (c(), d("p", {
|
|
823
|
+
key: 0,
|
|
824
|
+
id: l.value,
|
|
825
|
+
class: "it-field__error"
|
|
826
|
+
}, [
|
|
827
|
+
H(v(Ge), {
|
|
828
|
+
size: 12,
|
|
829
|
+
"aria-hidden": "true"
|
|
830
|
+
}),
|
|
831
|
+
w("span", null, g(e.error), 1)
|
|
832
|
+
], 8, Kt)) : $("", !0),
|
|
833
|
+
f.value ? (c(), d("p", {
|
|
834
|
+
key: 1,
|
|
835
|
+
id: r.value,
|
|
836
|
+
class: "it-field__help"
|
|
837
|
+
}, [
|
|
838
|
+
k(m.$slots, "help", {}, () => [
|
|
839
|
+
T(g(e.help), 1)
|
|
840
|
+
])
|
|
841
|
+
], 8, Qt)) : $("", !0)
|
|
842
|
+
], 2));
|
|
843
|
+
}
|
|
844
|
+
}), Xt = "it-confirm";
|
|
845
|
+
let N = null;
|
|
846
|
+
function Jt() {
|
|
847
|
+
const e = Ze();
|
|
848
|
+
function t(n, a) {
|
|
849
|
+
return new Promise((s) => {
|
|
850
|
+
N == null || N(!1);
|
|
851
|
+
let i = !1;
|
|
852
|
+
const r = We({}), l = (u) => {
|
|
853
|
+
i || (i = !0, N === l && (N = null), r(), s(u));
|
|
854
|
+
};
|
|
855
|
+
N = l, e.require({
|
|
856
|
+
group: Xt,
|
|
857
|
+
header: a.title,
|
|
858
|
+
message: a.message,
|
|
859
|
+
acceptLabel: a.acceptLabel,
|
|
860
|
+
rejectLabel: a.rejectLabel ?? "Cancel",
|
|
861
|
+
// Read back by ItConfirmHost to style the accept button.
|
|
862
|
+
acceptClass: n,
|
|
863
|
+
accept: () => l(!0),
|
|
864
|
+
reject: () => l(!1),
|
|
865
|
+
onHide: () => l(!1)
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return {
|
|
870
|
+
/** Delete, remove, revoke, discard — red accept button. */
|
|
871
|
+
destructive: (n) => t("destructive", n),
|
|
872
|
+
/** Non-destructive but consequential (publish, run on 200 assets). */
|
|
873
|
+
confirm: (n) => t("default", n)
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
const Ae = Symbol("it-modal-change"), Zt = () => {
|
|
877
|
+
};
|
|
878
|
+
function Zn() {
|
|
879
|
+
return le(Ae, Zt);
|
|
880
|
+
}
|
|
881
|
+
const en = "data-it-no-change", De = 'textarea, [contenteditable=""], [contenteditable="true"], input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], input[type="password"]';
|
|
882
|
+
function tn(e) {
|
|
883
|
+
const t = B(!1), n = y(() => e.dirty() ?? t.value);
|
|
884
|
+
ke(e.visible, (l) => {
|
|
885
|
+
l && (t.value = !1);
|
|
886
|
+
}), $e(Ae, () => {
|
|
887
|
+
t.value = !0;
|
|
888
|
+
});
|
|
889
|
+
function a(l) {
|
|
890
|
+
const u = l.target instanceof Element ? l.target : null;
|
|
891
|
+
!(u != null && u.matches(De)) || u.closest(`[${en}]`) || (t.value = !0);
|
|
892
|
+
}
|
|
893
|
+
const s = Jt();
|
|
894
|
+
let i = !1;
|
|
895
|
+
async function r() {
|
|
896
|
+
if (!(e.busy() || i)) {
|
|
897
|
+
if (n.value) {
|
|
898
|
+
i = !0;
|
|
899
|
+
const l = await s.destructive({
|
|
900
|
+
title: "Discard changes?",
|
|
901
|
+
message: "What you changed here is not saved. Closing throws it away.",
|
|
902
|
+
acceptLabel: "Discard",
|
|
903
|
+
rejectLabel: "Keep editing"
|
|
904
|
+
});
|
|
905
|
+
if (i = !1, !l) return;
|
|
906
|
+
}
|
|
907
|
+
e.close();
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return Ke(e.visible, () => void r()), { onType: a, requestClose: r, isDirty: n };
|
|
911
|
+
}
|
|
912
|
+
const nn = {
|
|
913
|
+
key: 0,
|
|
914
|
+
class: "it-modal__description"
|
|
915
|
+
}, an = { class: "it-modal__footer" }, sn = { class: "it-modal__footer-start" }, rn = { class: "it-modal__footer-end" }, ea = /* @__PURE__ */ _({
|
|
916
|
+
inheritAttrs: !1,
|
|
917
|
+
__name: "ItModal",
|
|
918
|
+
props: {
|
|
919
|
+
visible: { type: Boolean },
|
|
920
|
+
title: {},
|
|
921
|
+
description: { default: void 0 },
|
|
922
|
+
size: { default: "md" },
|
|
923
|
+
closable: { type: Boolean, default: !0 },
|
|
924
|
+
busy: { type: Boolean, default: !1 },
|
|
925
|
+
dirty: { type: Boolean, default: void 0 },
|
|
926
|
+
initialFocus: { default: "field" }
|
|
927
|
+
},
|
|
928
|
+
emits: ["update:visible", "hide"],
|
|
929
|
+
setup(e, { expose: t, emit: n }) {
|
|
930
|
+
const a = e, s = n, i = y(() => `min(var(--it-layout-modal-width-${a.size}), calc(100vw - 32px))`), { onType: r, requestClose: l } = tn({
|
|
931
|
+
visible: () => a.visible,
|
|
932
|
+
busy: () => a.busy,
|
|
933
|
+
dirty: () => a.dirty,
|
|
934
|
+
close: () => s("update:visible", !1)
|
|
935
|
+
}), u = je(), o = y(() => Pt({ content: { onInput: r } }, u.pt));
|
|
936
|
+
t({ requestClose: l });
|
|
937
|
+
function f(m) {
|
|
938
|
+
m ? s("update:visible", !0) : l();
|
|
939
|
+
}
|
|
940
|
+
const h = B(null);
|
|
941
|
+
function b() {
|
|
942
|
+
var x;
|
|
943
|
+
const m = (x = h.value) == null ? void 0 : x.parentElement;
|
|
944
|
+
if (!m || m.querySelector("[autofocus]")) return;
|
|
945
|
+
if (a.initialFocus === "start") {
|
|
946
|
+
h.value.setAttribute("autofocus", "");
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
([...m.querySelectorAll(De)].find((U) => !U.matches(":disabled, [readonly]") && U.getClientRects().length > 0) ?? h.value).setAttribute("autofocus", "");
|
|
950
|
+
}
|
|
951
|
+
return (m, S) => (c(), q(v(Je), qe(m.$attrs, {
|
|
952
|
+
visible: e.visible,
|
|
953
|
+
modal: "",
|
|
954
|
+
header: e.title,
|
|
955
|
+
draggable: !1,
|
|
956
|
+
closable: e.closable && !e.busy,
|
|
957
|
+
"close-on-escape": !1,
|
|
958
|
+
"dismissable-mask": !e.busy,
|
|
959
|
+
style: { width: i.value },
|
|
960
|
+
class: ["it-modal", `it-modal--${e.size}`],
|
|
961
|
+
pt: o.value,
|
|
962
|
+
"onUpdate:visible": f,
|
|
963
|
+
onShow: b,
|
|
964
|
+
onHide: S[0] || (S[0] = (x) => s("hide"))
|
|
965
|
+
}), ze({
|
|
966
|
+
default: Y(() => [
|
|
967
|
+
w("span", {
|
|
968
|
+
ref_key: "start",
|
|
969
|
+
ref: h,
|
|
970
|
+
class: "it-modal__start",
|
|
971
|
+
tabindex: "-1"
|
|
972
|
+
}, null, 512),
|
|
973
|
+
e.description ? (c(), d("p", nn, g(e.description), 1)) : $("", !0),
|
|
974
|
+
k(m.$slots, "default")
|
|
975
|
+
]),
|
|
976
|
+
_: 2
|
|
977
|
+
}, [
|
|
978
|
+
m.$slots.footer || m.$slots["footer-start"] ? {
|
|
979
|
+
name: "footer",
|
|
980
|
+
fn: Y(() => [
|
|
981
|
+
w("div", an, [
|
|
982
|
+
w("div", sn, [
|
|
983
|
+
k(m.$slots, "footer-start")
|
|
984
|
+
]),
|
|
985
|
+
w("div", rn, [
|
|
986
|
+
k(m.$slots, "footer")
|
|
987
|
+
])
|
|
988
|
+
])
|
|
989
|
+
]),
|
|
990
|
+
key: "0"
|
|
991
|
+
} : void 0
|
|
992
|
+
]), 1040, ["visible", "header", "closable", "dismissable-mask", "style", "class", "pt"]));
|
|
993
|
+
}
|
|
994
|
+
}), ta = /* @__PURE__ */ _({
|
|
995
|
+
__name: "ItBadge",
|
|
996
|
+
props: {
|
|
997
|
+
label: {},
|
|
998
|
+
tone: { default: "neutral" },
|
|
999
|
+
mono: { type: Boolean, default: !1 }
|
|
1000
|
+
},
|
|
1001
|
+
setup(e) {
|
|
1002
|
+
return (t, n) => (c(), d("span", {
|
|
1003
|
+
class: C(["it-badge", [`it-badge--${e.tone}`, { "it-badge--mono": e.mono }]])
|
|
1004
|
+
}, g(e.label), 3));
|
|
1005
|
+
}
|
|
1006
|
+
}), pe = {
|
|
1007
|
+
queued: { label: "Queued", tone: "neutral" },
|
|
1008
|
+
pending: { label: "Pending", tone: "neutral" },
|
|
1009
|
+
scheduled: { label: "Scheduled", tone: "neutral" },
|
|
1010
|
+
running: { label: "Running", tone: "info", live: !0 },
|
|
1011
|
+
in_progress: { label: "In progress", tone: "info", live: !0 },
|
|
1012
|
+
syncing: { label: "Syncing", tone: "info", live: !0 },
|
|
1013
|
+
succeeded: { label: "Succeeded", tone: "success" },
|
|
1014
|
+
success: { label: "Succeeded", tone: "success" },
|
|
1015
|
+
completed: { label: "Completed", tone: "success" },
|
|
1016
|
+
finished: { label: "Finished", tone: "success" },
|
|
1017
|
+
healthy: { label: "Healthy", tone: "success" },
|
|
1018
|
+
connected: { label: "Connected", tone: "success" },
|
|
1019
|
+
active: { label: "Active", tone: "success" },
|
|
1020
|
+
enabled: { label: "Enabled", tone: "success" },
|
|
1021
|
+
partial: { label: "Partial", tone: "warning" },
|
|
1022
|
+
warning: { label: "Warning", tone: "warning" },
|
|
1023
|
+
expiring: { label: "Expiring", tone: "warning" },
|
|
1024
|
+
needs_attention: { label: "Needs attention", tone: "warning" },
|
|
1025
|
+
// Set up never; "disconnected" is a connection that broke.
|
|
1026
|
+
not_connected: { label: "Not connected", tone: "warning" },
|
|
1027
|
+
// Held until a person approves (a write in a remediation run, a request).
|
|
1028
|
+
awaiting_approval: { label: "Awaiting approval", tone: "warning", waiting: !0 },
|
|
1029
|
+
failed: { label: "Failed", tone: "danger" },
|
|
1030
|
+
error: { label: "Error", tone: "danger" },
|
|
1031
|
+
expired: { label: "Expired", tone: "danger" },
|
|
1032
|
+
disconnected: { label: "Disconnected", tone: "danger" },
|
|
1033
|
+
revoked: { label: "Revoked", tone: "danger" },
|
|
1034
|
+
cancelled: { label: "Cancelled", tone: "neutral" },
|
|
1035
|
+
canceled: { label: "Cancelled", tone: "neutral" },
|
|
1036
|
+
paused: { label: "Paused", tone: "neutral" },
|
|
1037
|
+
disabled: { label: "Disabled", tone: "neutral" },
|
|
1038
|
+
draft: { label: "Draft", tone: "neutral" },
|
|
1039
|
+
not_run: { label: "Not run", tone: "neutral" },
|
|
1040
|
+
skipped: { label: "Skipped", tone: "neutral" },
|
|
1041
|
+
dismissed: { label: "Dismissed", tone: "neutral" },
|
|
1042
|
+
open: { label: "Open", tone: "info" },
|
|
1043
|
+
closed: { label: "Closed", tone: "neutral" }
|
|
1044
|
+
}, re = /* @__PURE__ */ new Map(), Ee = (e) => e.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
1045
|
+
function na(e, t) {
|
|
1046
|
+
const a = { ...re.get(e) ?? {} };
|
|
1047
|
+
for (const [s, i] of Object.entries(t)) a[Ee(s)] = i;
|
|
1048
|
+
re.set(e, a);
|
|
1049
|
+
}
|
|
1050
|
+
function ln(e, t) {
|
|
1051
|
+
if (!e) return { label: "Unknown", tone: "neutral" };
|
|
1052
|
+
const n = Ee(e), a = t ? re.get(t) : void 0;
|
|
1053
|
+
if (a && Object.hasOwn(a, n)) return a[n];
|
|
1054
|
+
if (Object.hasOwn(pe, n)) return pe[n];
|
|
1055
|
+
const s = n.replace(/_/g, " ");
|
|
1056
|
+
return { label: s.charAt(0).toUpperCase() + s.slice(1), tone: "neutral" };
|
|
1057
|
+
}
|
|
1058
|
+
const on = { class: "it-status__label" }, aa = /* @__PURE__ */ _({
|
|
1059
|
+
__name: "ItStatus",
|
|
1060
|
+
props: {
|
|
1061
|
+
status: {},
|
|
1062
|
+
domain: {},
|
|
1063
|
+
label: {},
|
|
1064
|
+
tone: {}
|
|
1065
|
+
},
|
|
1066
|
+
setup(e) {
|
|
1067
|
+
const t = e, n = y(() => ln(t.status, t.domain)), a = y(() => t.tone ?? n.value.tone);
|
|
1068
|
+
return (s, i) => (c(), d("span", {
|
|
1069
|
+
class: C(["it-status", [`it-status--${a.value}`, { "it-status--live": n.value.live }]])
|
|
1070
|
+
}, [
|
|
1071
|
+
i[0] || (i[0] = w("span", {
|
|
1072
|
+
class: "it-status__dot",
|
|
1073
|
+
"aria-hidden": "true"
|
|
1074
|
+
}, null, -1)),
|
|
1075
|
+
w("span", on, g(e.label ?? n.value.label), 1)
|
|
1076
|
+
], 2));
|
|
1077
|
+
}
|
|
1078
|
+
}), un = ["aria-label", "disabled"], cn = /* @__PURE__ */ _({
|
|
1079
|
+
__name: "FieldClearButton",
|
|
1080
|
+
props: {
|
|
1081
|
+
label: {},
|
|
1082
|
+
disabled: { type: Boolean },
|
|
1083
|
+
inFlow: { type: Boolean }
|
|
1084
|
+
},
|
|
1085
|
+
emits: ["clear"],
|
|
1086
|
+
setup(e) {
|
|
1087
|
+
const t = Qe;
|
|
1088
|
+
return (n, a) => R((c(), d("button", {
|
|
1089
|
+
type: "button",
|
|
1090
|
+
class: C(["it-field-clear-button", { "it-field-clear-button--flow": e.inFlow }]),
|
|
1091
|
+
"aria-label": e.label,
|
|
1092
|
+
disabled: e.disabled,
|
|
1093
|
+
onMousedown: a[0] || (a[0] = de(() => {
|
|
1094
|
+
}, ["prevent"])),
|
|
1095
|
+
onClick: a[1] || (a[1] = de((s) => n.$emit("clear", s), ["stop"]))
|
|
1096
|
+
}, [
|
|
1097
|
+
H(v(Ye), {
|
|
1098
|
+
size: 14,
|
|
1099
|
+
"aria-hidden": "true"
|
|
1100
|
+
})
|
|
1101
|
+
], 42, un)), [
|
|
1102
|
+
[
|
|
1103
|
+
v(t),
|
|
1104
|
+
e.label,
|
|
1105
|
+
void 0,
|
|
1106
|
+
{ top: !0 }
|
|
1107
|
+
]
|
|
1108
|
+
]);
|
|
1109
|
+
}
|
|
1110
|
+
}), sa = /* @__PURE__ */ _({
|
|
1111
|
+
__name: "ItSearchInput",
|
|
1112
|
+
props: {
|
|
1113
|
+
modelValue: { default: "" },
|
|
1114
|
+
label: {},
|
|
1115
|
+
placeholder: {},
|
|
1116
|
+
debounce: { default: 0 },
|
|
1117
|
+
clearable: { type: Boolean, default: !0 },
|
|
1118
|
+
disabled: { type: Boolean },
|
|
1119
|
+
size: { default: "md" },
|
|
1120
|
+
id: { default: void 0 },
|
|
1121
|
+
describedBy: { default: void 0 }
|
|
1122
|
+
},
|
|
1123
|
+
emits: ["update:modelValue"],
|
|
1124
|
+
setup(e, { emit: t }) {
|
|
1125
|
+
const n = e, a = t, s = Ut(n), i = B(null), r = B(n.modelValue);
|
|
1126
|
+
let l;
|
|
1127
|
+
ke(
|
|
1128
|
+
() => n.modelValue,
|
|
1129
|
+
(f) => {
|
|
1130
|
+
f !== r.value && (clearTimeout(l), r.value = f);
|
|
1131
|
+
}
|
|
1132
|
+
);
|
|
1133
|
+
function u(f) {
|
|
1134
|
+
r.value = f ?? "", clearTimeout(l), n.debounce > 0 ? l = setTimeout(() => a("update:modelValue", r.value), n.debounce) : a("update:modelValue", r.value);
|
|
1135
|
+
}
|
|
1136
|
+
function o() {
|
|
1137
|
+
var f;
|
|
1138
|
+
n.disabled || ((f = i.value) == null || f.$el.focus(), clearTimeout(l), r.value = "", a("update:modelValue", ""));
|
|
1139
|
+
}
|
|
1140
|
+
return Ve(() => clearTimeout(l)), (f, h) => (c(), d("div", {
|
|
1141
|
+
class: C(["it-search", `it-search--${e.size}`]),
|
|
1142
|
+
"data-it-no-change": ""
|
|
1143
|
+
}, [
|
|
1144
|
+
H(v(He), {
|
|
1145
|
+
class: "it-search__icon",
|
|
1146
|
+
size: 14,
|
|
1147
|
+
"aria-hidden": "true"
|
|
1148
|
+
}),
|
|
1149
|
+
H(v(et), {
|
|
1150
|
+
ref_key: "input",
|
|
1151
|
+
ref: i,
|
|
1152
|
+
disabled: e.disabled,
|
|
1153
|
+
"model-value": r.value,
|
|
1154
|
+
type: "search",
|
|
1155
|
+
class: C(["it-search__input", { "p-inputtext-sm": e.size === "sm" }]),
|
|
1156
|
+
id: v(s).id.value,
|
|
1157
|
+
placeholder: e.placeholder ?? e.label,
|
|
1158
|
+
"aria-label": v(s).labelId.value ? void 0 : e.label,
|
|
1159
|
+
"aria-describedby": v(s).describedBy.value,
|
|
1160
|
+
"onUpdate:modelValue": u,
|
|
1161
|
+
onKeydown: h[0] || (h[0] = Ue((b) => r.value && o(), ["esc"]))
|
|
1162
|
+
}, null, 8, ["disabled", "model-value", "class", "id", "placeholder", "aria-label", "aria-describedby"]),
|
|
1163
|
+
e.clearable && r.value ? (c(), q(cn, {
|
|
1164
|
+
key: 0,
|
|
1165
|
+
label: `Clear ${v(Xe)(e.label)}`,
|
|
1166
|
+
disabled: e.disabled,
|
|
1167
|
+
onClear: o
|
|
1168
|
+
}, null, 8, ["label", "disabled"])) : $("", !0)
|
|
1169
|
+
], 2));
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
function dn() {
|
|
1173
|
+
try {
|
|
1174
|
+
return process.env.NODE_ENV === "production";
|
|
1175
|
+
} catch {
|
|
1176
|
+
return !1;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
function ra(e) {
|
|
1180
|
+
dn() || console.warn(`[@infotrust/ui] ${e}`);
|
|
1181
|
+
}
|
|
1182
|
+
export {
|
|
1183
|
+
Te as $,
|
|
1184
|
+
Bn as A,
|
|
1185
|
+
oe as B,
|
|
1186
|
+
Nn as C,
|
|
1187
|
+
E as D,
|
|
1188
|
+
I as E,
|
|
1189
|
+
gn as F,
|
|
1190
|
+
D as G,
|
|
1191
|
+
Yn as H,
|
|
1192
|
+
Xn as I,
|
|
1193
|
+
Ce as J,
|
|
1194
|
+
Rn as K,
|
|
1195
|
+
Z as L,
|
|
1196
|
+
On as M,
|
|
1197
|
+
jn as N,
|
|
1198
|
+
Vn as O,
|
|
1199
|
+
Wn as P,
|
|
1200
|
+
qn as Q,
|
|
1201
|
+
zn as R,
|
|
1202
|
+
L as S,
|
|
1203
|
+
mt as T,
|
|
1204
|
+
Hn as U,
|
|
1205
|
+
A as V,
|
|
1206
|
+
Ln as W,
|
|
1207
|
+
Fn as X,
|
|
1208
|
+
yt as Y,
|
|
1209
|
+
ft as Z,
|
|
1210
|
+
aa as _,
|
|
1211
|
+
ta as a,
|
|
1212
|
+
Un as a0,
|
|
1213
|
+
Pn as a1,
|
|
1214
|
+
Mn as a2,
|
|
1215
|
+
Zn as a3,
|
|
1216
|
+
In as a4,
|
|
1217
|
+
tn as a5,
|
|
1218
|
+
Xt as a6,
|
|
1219
|
+
Cn as a7,
|
|
1220
|
+
Ae as a8,
|
|
1221
|
+
en as a9,
|
|
1222
|
+
Ie as aa,
|
|
1223
|
+
W as ab,
|
|
1224
|
+
se as ac,
|
|
1225
|
+
It as ad,
|
|
1226
|
+
_n as ae,
|
|
1227
|
+
Tn as af,
|
|
1228
|
+
An as ag,
|
|
1229
|
+
wt as ah,
|
|
1230
|
+
bt as ai,
|
|
1231
|
+
_e as aj,
|
|
1232
|
+
xn as ak,
|
|
1233
|
+
ue as al,
|
|
1234
|
+
St as am,
|
|
1235
|
+
na as an,
|
|
1236
|
+
Gn as ao,
|
|
1237
|
+
Se as ap,
|
|
1238
|
+
pt as aq,
|
|
1239
|
+
ea as b,
|
|
1240
|
+
sa as c,
|
|
1241
|
+
En as d,
|
|
1242
|
+
Jn as e,
|
|
1243
|
+
Dn as f,
|
|
1244
|
+
Kn as g,
|
|
1245
|
+
Qn as h,
|
|
1246
|
+
ra as i,
|
|
1247
|
+
$n as j,
|
|
1248
|
+
Lt as k,
|
|
1249
|
+
Jt as l,
|
|
1250
|
+
we as m,
|
|
1251
|
+
kn as n,
|
|
1252
|
+
nt as o,
|
|
1253
|
+
at as p,
|
|
1254
|
+
it as q,
|
|
1255
|
+
Sn as r,
|
|
1256
|
+
ln as s,
|
|
1257
|
+
wn as t,
|
|
1258
|
+
Ft as u,
|
|
1259
|
+
vn as v,
|
|
1260
|
+
Ut as w,
|
|
1261
|
+
Pt as x,
|
|
1262
|
+
cn as y,
|
|
1263
|
+
Tt as z
|
|
1264
|
+
};
|