@ac-design/design-system 2.0.0 → 2.1.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/lib/charts/ChartFrame.vue.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +17 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -2,39 +2,36 @@ import { statusMeta as e } from "./status.js";
|
|
|
2
2
|
import t from "./AcBadge.js";
|
|
3
3
|
import n from "./AcModal.js";
|
|
4
4
|
import r from "./AcSkeleton.js";
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "
|
|
7
|
-
import {
|
|
8
|
-
import { Braces as le, Check as ue, Minus as de } from "@lucide/vue";
|
|
5
|
+
import i from "./AcTooltip.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as ee, defineAsyncComponent as te, defineComponent as f, getCurrentInstance as ne, h as re, mergeProps as p, nextTick as ie, normalizeClass as m, normalizeStyle as ae, onBeforeUnmount as oe, onMounted as se, openBlock as h, ref as g, renderList as ce, resolveDynamicComponent as _, toDisplayString as v, unref as y, watch as b, withCtx as x, withModifiers as S } from "vue";
|
|
7
|
+
import { Braces as le, Check as ue, LoaderCircle as de, Minus as fe, Tag as pe } from "@lucide/vue";
|
|
9
8
|
//#region src/lib/components/AcCellValue.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
9
|
+
var me = ["src"], he = {
|
|
11
10
|
key: 1,
|
|
12
11
|
class: "text-muted"
|
|
13
|
-
},
|
|
14
|
-
class: "relative flex size-1.5 shrink-0",
|
|
15
|
-
"aria-hidden": "true"
|
|
16
|
-
}, he = ["tabindex"], ge = {
|
|
17
|
-
class: "relative flex size-1.5 shrink-0",
|
|
18
|
-
"aria-hidden": "true"
|
|
19
|
-
}, _e = {
|
|
12
|
+
}, ge = ["tabindex"], _e = {
|
|
20
13
|
key: 4,
|
|
21
14
|
class: "inline-flex items-center gap-1"
|
|
22
|
-
}, ve = ["datetime"], ye = ["datetime", "tabindex"], be =
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
}, ve = ["datetime"], ye = ["datetime", "tabindex"], be = {
|
|
16
|
+
class: "inline-flex max-w-full items-center gap-1 rounded-4 bg-primary/10 px-1.5 py-1 text-xs leading-4 whitespace-nowrap text-primary-strong",
|
|
17
|
+
"data-ac-ds": "",
|
|
18
|
+
"data-testid": "ac-cell-value-chip"
|
|
19
|
+
}, xe = { class: "truncate" }, Se = ["aria-expanded", "aria-label"], Ce = ["tabindex"], we = ["aria-label"], C = g(Date.now()), w = 0, T;
|
|
20
|
+
function Te() {
|
|
21
|
+
w++ === 0 && (T = setInterval(() => C.value = Date.now(), 3e4));
|
|
25
22
|
}
|
|
26
|
-
function
|
|
27
|
-
--
|
|
23
|
+
function E() {
|
|
24
|
+
--w === 0 && clearInterval(T);
|
|
28
25
|
}
|
|
29
26
|
var D = /* @__PURE__ */ new WeakMap(), O;
|
|
30
|
-
function
|
|
27
|
+
function Ee(e, t) {
|
|
31
28
|
if (typeof ResizeObserver > "u") return t();
|
|
32
29
|
O ??= new ResizeObserver((e) => e.forEach((e) => D.get(e.target)?.())), D.set(e, t), O.observe(e);
|
|
33
30
|
}
|
|
34
31
|
function k(e) {
|
|
35
32
|
D.delete(e), O?.unobserve(e);
|
|
36
33
|
}
|
|
37
|
-
var A = /*@__PURE__*/
|
|
34
|
+
var A = /*@__PURE__*/ f({
|
|
38
35
|
__name: "AcCellValue",
|
|
39
36
|
props: {
|
|
40
37
|
value: { default: void 0 },
|
|
@@ -76,8 +73,8 @@ var A = /*@__PURE__*/ p({
|
|
|
76
73
|
default: !1
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
|
-
setup(
|
|
80
|
-
let
|
|
76
|
+
setup(f) {
|
|
77
|
+
let w = f, T = /* @__PURE__ */ new Set([
|
|
81
78
|
"",
|
|
82
79
|
"<none>",
|
|
83
80
|
"<unknown>",
|
|
@@ -110,82 +107,86 @@ var A = /*@__PURE__*/ p({
|
|
|
110
107
|
pending: ["bg-pending", "text-pending-strong"],
|
|
111
108
|
dark: ["bg-heading", "text-heading"],
|
|
112
109
|
default: ["bg-muted", "text-muted"]
|
|
113
|
-
}, A = /^-?[\d.]+\s?[a-zA-Z%]{0,3}$/,
|
|
110
|
+
}, A = /^-?[\d.]+\s?[a-zA-Z%]{0,3}$/, De = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/, Oe = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), ke = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }), Ae = new Intl.DateTimeFormat(void 0, {
|
|
114
111
|
dateStyle: "medium",
|
|
115
112
|
timeStyle: "long"
|
|
116
|
-
}),
|
|
113
|
+
}), je = te({
|
|
117
114
|
loader: () => import("../editor/index.js").then((e) => e.AcCodeEditor),
|
|
118
115
|
loadingComponent: () => re(r, {
|
|
119
116
|
shape: "editor",
|
|
120
117
|
height: "240px"
|
|
121
118
|
}),
|
|
122
119
|
delay: 150
|
|
123
|
-
}),
|
|
124
|
-
let e =
|
|
125
|
-
return e &&
|
|
126
|
-
}),
|
|
120
|
+
}), Me = ne()?.appContext.components.RouterLink, j = g(null), Ne = g(!1), M = g(!1), N = g(!1), P = g(!1), F = o(() => w.cell ? w.cell.data : w.value), I = o(() => w.title || w.column?.name || ""), L = o(() => w.tooltip || w.cell?.tooltip || ""), Pe = o(() => w.icon || w.cell?.icon || ""), Fe = o(() => w.bold || !!w.cell?.isBold || w.column?.format === "name"), R = o(() => w.align ?? w.column?.textAlign), z = o(() => {
|
|
121
|
+
let e = w.href || w.cell?.link || "";
|
|
122
|
+
return e && w.resolveLink ? w.resolveLink(e) : e;
|
|
123
|
+
}), Ie = o(() => /^https?:\/\//.test(z.value)), B = o(() => Me && z.value.startsWith("/") ? Me : "a"), V = o(() => z.value ? Ie.value ? {
|
|
127
124
|
href: z.value,
|
|
128
125
|
target: "_blank",
|
|
129
126
|
rel: "noopener noreferrer"
|
|
130
|
-
} : B.value === "a" ? { href: z.value } : { to: z.value } : null), H =
|
|
131
|
-
let
|
|
132
|
-
return
|
|
133
|
-
}), U =
|
|
127
|
+
} : B.value === "a" ? { href: z.value } : { to: z.value } : null), H = o(() => {
|
|
128
|
+
let e = (w.color || w.cell?.color || "").trim().split(/\s+/)[0].replace(/^is-/, "");
|
|
129
|
+
return e ? D[e] ?? "default" : void 0;
|
|
130
|
+
}), U = o(() => G.value === "status" ? e(String(F.value)) : null), W = o(() => !!U.value?.transient), Le = o(() => H.value ? H.value : U.value ? W.value ? "primary" : U.value.tone : null), Re = o(() => !H.value && !!U.value?.hollow), G = o(() => {
|
|
134
131
|
let e = F.value;
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
if (
|
|
138
|
-
let t = typeof e == "object" ? void 0 :
|
|
139
|
-
return t && t !== "auto" && t !== "object" ? t : typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : Array.isArray(e) ? "array" : typeof e == "object" ?
|
|
140
|
-
}),
|
|
132
|
+
if (Ke(e)) return "empty";
|
|
133
|
+
if (w.color || w.cell?.color) return "status";
|
|
134
|
+
if (w.type !== "auto") return w.type;
|
|
135
|
+
let t = typeof e == "object" ? void 0 : w.column?.type;
|
|
136
|
+
return t && t !== "auto" && t !== "object" ? t : typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : Array.isArray(e) ? "array" : typeof e == "object" ? qe(e) ? "labels" : "object" : typeof e == "string" && De.test(e) && !Number.isNaN(Date.parse(e)) ? "date" : "string";
|
|
137
|
+
}), K = o(() => G.value === "date" ? Je(F.value) : null), q = o(() => {
|
|
141
138
|
let e = F.value;
|
|
142
|
-
switch (
|
|
139
|
+
switch (G.value) {
|
|
143
140
|
case "number":
|
|
144
141
|
case "integer": {
|
|
145
142
|
let t = typeof e == "number" ? e : Number(e);
|
|
146
|
-
return Number.isNaN(t) ? `${String(e)}${
|
|
143
|
+
return Number.isNaN(t) ? `${String(e)}${w.unit}` : `${(G.value === "integer" ? ke : Oe).format(t)}${w.unit}`;
|
|
147
144
|
}
|
|
148
|
-
case "boolean": return
|
|
149
|
-
case "date": return
|
|
150
|
-
case "object": return
|
|
145
|
+
case "boolean": return $(e) ? "true" : "false";
|
|
146
|
+
case "date": return K.value ? w.relative ? Ye(K.value, C.value) : Ae.format(K.value) : String(e);
|
|
147
|
+
case "object": return Ze(e);
|
|
151
148
|
default: return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
152
149
|
}
|
|
153
|
-
}),
|
|
150
|
+
}), J = o(() => K.value ? L.value || (w.relative ? Ae.format(K.value) : Ye(K.value, C.value)) : L.value), ze = o(() => L.value || (Ne.value ? q.value : "")), Y = o(() => {
|
|
154
151
|
let e = F.value;
|
|
155
|
-
return
|
|
152
|
+
return G.value === "labels" ? Object.entries(e).map(([e, t]) => ({
|
|
156
153
|
key: e,
|
|
157
154
|
value: String(t ?? ""),
|
|
158
155
|
text: `${e}=${t ?? ""}`
|
|
159
|
-
})) :
|
|
160
|
-
let t =
|
|
156
|
+
})) : G.value === "array" ? e.map((e) => {
|
|
157
|
+
let t = Qe(e);
|
|
161
158
|
return {
|
|
162
159
|
key: "",
|
|
163
160
|
value: t,
|
|
164
161
|
text: t
|
|
165
162
|
};
|
|
166
163
|
}) : [];
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
}), Be = o(() => {
|
|
165
|
+
if (w.emptyText !== "—") return w.emptyText;
|
|
166
|
+
let e = F.value, t = typeof e == "object" && !!e && !Array.isArray(e) && !(e instanceof Date);
|
|
167
|
+
return w.type === "labels" || w.column?.type === "labels" || t && /^(labels?|tags?)$/i.test(I.value) ? "No labels" : w.emptyText;
|
|
168
|
+
}), Ve = o(() => M.value ? Y.value : Y.value.slice(0, w.maxItems)), X = o(() => Y.value.length - Math.min(Y.value.length, w.maxItems)), He = o(() => G.value === "object" || G.value === "array" && F.value.some((e) => typeof e == "object" && !!e)), Ue = o(() => N.value ? JSON.stringify(F.value, null, 2) : ""), Z = o(() => G.value === "number" || G.value === "integer" || G.value === "string" && A.test(q.value)), Q = o(() => O[Le.value ?? "default"]), We = o(() => w.plain ? "rounded-4" : w.column?.shape === "Rectangle" ? "rounded-6" : "rounded-full"), Ge = o(() => G.value === "labels" ? "labels" : "items");
|
|
169
|
+
function Ke(e) {
|
|
170
|
+
return e == null ? !0 : typeof e == "string" ? T.has(e.trim()) : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function qe(e) {
|
|
172
173
|
return Object.values(e).every((e) => e === null || [
|
|
173
174
|
"string",
|
|
174
175
|
"number",
|
|
175
176
|
"boolean"
|
|
176
177
|
].includes(typeof e));
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
+
function $(e) {
|
|
179
180
|
return e === !0 || String(e).toLowerCase() === "true";
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function Je(e) {
|
|
182
183
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
183
184
|
if (typeof e == "number") return new Date(e < 0xe8d4a51000 ? e * 1e3 : e);
|
|
184
|
-
if (typeof e == "string" && /^\d+$/.test(e)) return
|
|
185
|
+
if (typeof e == "string" && /^\d+$/.test(e)) return Je(Number(e));
|
|
185
186
|
let t = typeof e == "string" ? Date.parse(e) : NaN;
|
|
186
187
|
return Number.isNaN(t) ? null : new Date(t);
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
+
function Ye(e, t) {
|
|
189
190
|
let n = Math.round((t - e.getTime()) / 1e3), r = Math.abs(n);
|
|
190
191
|
if (r < 45) return "just now";
|
|
191
192
|
let i = [
|
|
@@ -199,212 +200,217 @@ var A = /*@__PURE__*/ p({
|
|
|
199
200
|
let o = Math.floor(r / a[0]);
|
|
200
201
|
return n >= 0 ? `${o}${a[1]} ago` : `in ${o}${a[1]}`;
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function Xe(e) {
|
|
203
204
|
return Array.isArray(e) ? `[${e.length}]` : typeof e == "object" && e ? "{…}" : typeof e == "string" ? e : String(e);
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
-
return Object.entries(e).map(([e, t]) => `${e}: ${
|
|
206
|
+
function Ze(e) {
|
|
207
|
+
return Object.entries(e).map(([e, t]) => `${e}: ${Xe(t)}`).join(", ");
|
|
207
208
|
}
|
|
208
|
-
function
|
|
209
|
+
function Qe(e) {
|
|
209
210
|
if (typeof e != "object" || !e) return String(e);
|
|
210
211
|
let t = e, n = t.name ?? t.Name ?? Object.values(t)[0];
|
|
211
212
|
return n === void 0 || typeof n == "object" ? "{…}" : String(n);
|
|
212
213
|
}
|
|
213
|
-
function
|
|
214
|
+
function $e(e) {
|
|
214
215
|
j.value = e && "$el" in e ? e.$el : e;
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
+
function et() {
|
|
217
218
|
let e = j.value;
|
|
218
|
-
|
|
219
|
+
Ne.value = !!e && e.scrollWidth > e.clientWidth + 1;
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
+
function tt() {
|
|
221
222
|
N.value = !0, P.value = !0;
|
|
222
223
|
}
|
|
223
|
-
return
|
|
224
|
-
t && k(t), e &&
|
|
225
|
-
}),
|
|
226
|
-
e && !t ?
|
|
224
|
+
return b(j, (e, t) => {
|
|
225
|
+
t && k(t), e && Ee(e, et);
|
|
226
|
+
}), b(q, () => ie(et)), b(() => G.value === "date", (e, t) => {
|
|
227
|
+
e && !t ? Te() : !e && t && E();
|
|
227
228
|
}), se(() => {
|
|
228
|
-
|
|
229
|
+
G.value === "date" && Te();
|
|
229
230
|
}), oe(() => {
|
|
230
|
-
|
|
231
|
-
}), (e,
|
|
232
|
-
class:
|
|
231
|
+
G.value === "date" && E(), j.value && k(j.value);
|
|
232
|
+
}), (e, o) => (h(), l("span", {
|
|
233
|
+
class: m(["max-w-full min-w-0 items-center gap-1.5 align-middle", [
|
|
233
234
|
R.value ? "flex w-full" : "inline-flex",
|
|
234
235
|
R.value === "center" && "justify-center",
|
|
235
236
|
R.value === "right" && "justify-end",
|
|
236
|
-
|
|
237
|
+
Fe.value && "font-semibold text-heading"
|
|
237
238
|
]]),
|
|
238
239
|
"data-ac-ds": "",
|
|
239
240
|
"data-testid": "ac-cell-value"
|
|
240
|
-
}, [
|
|
241
|
+
}, [f.loading ? (h(), s(r, {
|
|
241
242
|
key: 0,
|
|
242
243
|
width: "96px"
|
|
243
|
-
})) : (
|
|
244
|
-
|
|
244
|
+
})) : (h(), l(a, { key: 1 }, [
|
|
245
|
+
Pe.value ? (h(), l("img", {
|
|
245
246
|
key: 0,
|
|
246
|
-
src:
|
|
247
|
+
src: Pe.value,
|
|
247
248
|
alt: "",
|
|
248
249
|
class: "size-4 shrink-0 object-contain"
|
|
249
|
-
}, null, 8,
|
|
250
|
-
|
|
251
|
-
class: ["inline-flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", [
|
|
252
|
-
onClick:
|
|
250
|
+
}, null, 8, me)) : c("", !0),
|
|
251
|
+
G.value === "empty" ? (h(), l("span", he, v(Be.value), 1)) : G.value === "status" && V.value ? (h(), s(_(B.value), p({ key: 2 }, V.value, {
|
|
252
|
+
class: ["inline-flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", [We.value, f.plain && "underline-offset-2 hover:underline"]],
|
|
253
|
+
onClick: o[0] ||= S(() => {}, ["stop"])
|
|
253
254
|
}), {
|
|
254
|
-
default:
|
|
255
|
+
default: x(() => [f.plain ? (h(), l("span", {
|
|
255
256
|
key: 0,
|
|
256
|
-
class:
|
|
257
|
-
}, [
|
|
257
|
+
class: m(["inline-flex items-center gap-1.5 text-xs font-medium whitespace-nowrap", Q.value[1]])
|
|
258
|
+
}, [W.value ? (h(), s(y(de), {
|
|
258
259
|
key: 0,
|
|
259
|
-
class:
|
|
260
|
-
|
|
260
|
+
class: "size-3 shrink-0 motion-safe:animate-spin",
|
|
261
|
+
"aria-hidden": "true"
|
|
262
|
+
})) : (h(), l("span", {
|
|
261
263
|
key: 1,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(t, {
|
|
267
|
+
key: 1,
|
|
268
|
+
status: String(F.value),
|
|
269
|
+
label: q.value,
|
|
270
|
+
color: H.value,
|
|
264
271
|
variant: "light",
|
|
265
|
-
rounded:
|
|
266
|
-
dot: ""
|
|
267
|
-
pulse: U.value
|
|
272
|
+
rounded: f.column?.shape !== "Rectangle",
|
|
273
|
+
dot: ""
|
|
268
274
|
}, null, 8, [
|
|
275
|
+
"status",
|
|
269
276
|
"label",
|
|
270
277
|
"color",
|
|
271
|
-
"rounded"
|
|
272
|
-
"pulse"
|
|
278
|
+
"rounded"
|
|
273
279
|
]))]),
|
|
274
280
|
_: 1
|
|
275
|
-
}, 16, ["class"])) :
|
|
281
|
+
}, 16, ["class"])) : G.value === "status" ? (h(), s(i, {
|
|
276
282
|
key: 3,
|
|
277
283
|
content: L.value
|
|
278
284
|
}, {
|
|
279
|
-
default:
|
|
285
|
+
default: x(() => [u("span", {
|
|
280
286
|
tabindex: L.value ? 0 : void 0,
|
|
281
|
-
class:
|
|
282
|
-
}, [
|
|
287
|
+
class: m(["inline-flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", We.value])
|
|
288
|
+
}, [f.plain ? (h(), l("span", {
|
|
283
289
|
key: 0,
|
|
284
|
-
class:
|
|
285
|
-
}, [
|
|
290
|
+
class: m(["inline-flex items-center gap-1.5 text-xs font-medium whitespace-nowrap", Q.value[1]])
|
|
291
|
+
}, [W.value ? (h(), s(y(de), {
|
|
286
292
|
key: 0,
|
|
287
|
-
class:
|
|
288
|
-
|
|
293
|
+
class: "size-3 shrink-0 motion-safe:animate-spin",
|
|
294
|
+
"aria-hidden": "true"
|
|
295
|
+
})) : (h(), l("span", {
|
|
289
296
|
key: 1,
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
|
|
298
|
+
"aria-hidden": "true"
|
|
299
|
+
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(t, {
|
|
300
|
+
key: 1,
|
|
301
|
+
status: String(F.value),
|
|
302
|
+
label: q.value,
|
|
303
|
+
color: H.value,
|
|
292
304
|
variant: "light",
|
|
293
|
-
rounded:
|
|
294
|
-
dot: ""
|
|
295
|
-
pulse: U.value
|
|
305
|
+
rounded: f.column?.shape !== "Rectangle",
|
|
306
|
+
dot: ""
|
|
296
307
|
}, null, 8, [
|
|
308
|
+
"status",
|
|
297
309
|
"label",
|
|
298
310
|
"color",
|
|
299
|
-
"rounded"
|
|
300
|
-
|
|
301
|
-
]))], 10, he)]),
|
|
311
|
+
"rounded"
|
|
312
|
+
]))], 10, ge)]),
|
|
302
313
|
_: 1
|
|
303
|
-
}, 8, ["content"])) :
|
|
314
|
+
}, 8, ["content"])) : G.value === "boolean" ? (h(), l("span", _e, [$(F.value) ? (h(), s(y(ue), {
|
|
304
315
|
key: 0,
|
|
305
316
|
class: "size-3.5 text-success-strong",
|
|
306
317
|
"aria-hidden": "true"
|
|
307
|
-
})) : (
|
|
318
|
+
})) : (h(), s(y(fe), {
|
|
308
319
|
key: 1,
|
|
309
320
|
class: "size-3.5 text-muted",
|
|
310
321
|
"aria-hidden": "true"
|
|
311
|
-
})),
|
|
322
|
+
})), u("span", { class: m(!$(F.value) && "text-muted") }, v(q.value), 3)])) : G.value === "date" ? (h(), s(i, {
|
|
312
323
|
key: 5,
|
|
313
|
-
content:
|
|
324
|
+
content: J.value
|
|
314
325
|
}, {
|
|
315
|
-
default:
|
|
326
|
+
default: x(() => [V.value ? (h(), s(_(B.value), p({ key: 0 }, V.value, {
|
|
316
327
|
class: "font-medium whitespace-nowrap text-primary-strong tabular-nums underline-offset-2 hover:underline focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
317
|
-
onClick:
|
|
328
|
+
onClick: o[1] ||= S(() => {}, ["stop"])
|
|
318
329
|
}), {
|
|
319
|
-
default:
|
|
330
|
+
default: x(() => [u("time", { datetime: K.value?.toISOString() }, v(q.value), 9, ve)]),
|
|
320
331
|
_: 1
|
|
321
|
-
}, 16)) : (
|
|
332
|
+
}, 16)) : (h(), l("time", {
|
|
322
333
|
key: 1,
|
|
323
|
-
datetime:
|
|
324
|
-
tabindex:
|
|
325
|
-
class:
|
|
326
|
-
},
|
|
334
|
+
datetime: K.value?.toISOString(),
|
|
335
|
+
tabindex: J.value ? 0 : void 0,
|
|
336
|
+
class: m(["whitespace-nowrap tabular-nums focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", J.value && "cursor-default decoration-border-dark decoration-dotted underline-offset-4 hover:underline"])
|
|
337
|
+
}, v(q.value), 11, ye))]),
|
|
327
338
|
_: 1
|
|
328
|
-
}, 8, ["content"])) :
|
|
339
|
+
}, 8, ["content"])) : G.value === "labels" || G.value === "array" ? (h(), l("span", {
|
|
329
340
|
key: 6,
|
|
330
|
-
class:
|
|
331
|
-
style: ae({ maxWidth:
|
|
332
|
-
}, [(
|
|
341
|
+
class: m(["flex w-max min-w-0 items-center gap-2", M.value ? "flex-wrap" : "flex-nowrap"]),
|
|
342
|
+
style: ae({ maxWidth: f.maxWidth })
|
|
343
|
+
}, [(h(!0), l(a, null, ce(Ve.value, (e, t) => (h(), s(i, {
|
|
333
344
|
key: `${e.text}-${t}`,
|
|
334
345
|
content: e.text.length > 28 && !M.value ? e.text : "",
|
|
335
|
-
class:
|
|
346
|
+
class: m(!M.value && "max-w-48 min-w-0")
|
|
336
347
|
}, {
|
|
337
|
-
default:
|
|
348
|
+
default: x(() => [u("span", be, [G.value === "labels" ? (h(), s(y(pe), {
|
|
338
349
|
key: 0,
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
|
|
342
|
-
}, null, 8, ["key-label", "value-label"])) : (g(), c(i, {
|
|
343
|
-
key: 1,
|
|
344
|
-
label: e.value,
|
|
345
|
-
rounded: ""
|
|
346
|
-
}, null, 8, ["label"]))]),
|
|
350
|
+
class: "size-3 shrink-0",
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
})) : c("", !0), u("span", xe, v(e.text), 1)])]),
|
|
347
353
|
_: 2
|
|
348
|
-
}, 1032, ["content", "class"]))), 128)),
|
|
354
|
+
}, 1032, ["content", "class"]))), 128)), X.value > 0 ? (h(), l("button", {
|
|
349
355
|
key: 0,
|
|
350
356
|
type: "button",
|
|
351
|
-
class: "inline-flex
|
|
357
|
+
class: "inline-flex shrink-0 cursor-pointer items-center rounded-4 border border-dashed border-primary/40 px-1.5 py-1 text-xs leading-4 font-medium whitespace-nowrap text-primary-strong underline-offset-2 transition-colors duration-200 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
352
358
|
"aria-expanded": M.value,
|
|
353
|
-
"aria-label": M.value ? `Show fewer ${
|
|
354
|
-
onClick:
|
|
355
|
-
},
|
|
359
|
+
"aria-label": M.value ? `Show fewer ${Ge.value}` : `Show ${X.value} more ${Ge.value}`,
|
|
360
|
+
onClick: o[2] ||= S((e) => M.value = !M.value, ["stop"])
|
|
361
|
+
}, v(M.value ? "Show less" : `+${X.value} more`), 9, Se)) : c("", !0)], 6)) : (h(), s(i, {
|
|
356
362
|
key: 7,
|
|
357
|
-
content:
|
|
363
|
+
content: ze.value,
|
|
358
364
|
class: "min-w-0"
|
|
359
365
|
}, {
|
|
360
|
-
default:
|
|
366
|
+
default: x(() => [V.value ? (h(), s(_(B.value), p({
|
|
361
367
|
key: 0,
|
|
362
|
-
ref:
|
|
368
|
+
ref: $e
|
|
363
369
|
}, V.value, {
|
|
364
|
-
class: ["block truncate font-medium text-primary-strong underline-offset-2 hover:underline focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", [(
|
|
365
|
-
style: { maxWidth:
|
|
366
|
-
onClick:
|
|
370
|
+
class: ["block truncate font-medium text-primary-strong underline-offset-2 hover:underline focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", [(f.mono || G.value === "object") && "font-mono text-xs", Z.value && "tabular-nums"]],
|
|
371
|
+
style: { maxWidth: f.maxWidth },
|
|
372
|
+
onClick: o[3] ||= S(() => {}, ["stop"])
|
|
367
373
|
}), {
|
|
368
|
-
default:
|
|
374
|
+
default: x(() => [d(v(q.value), 1)]),
|
|
369
375
|
_: 1
|
|
370
|
-
}, 16, ["class", "style"])) : (
|
|
376
|
+
}, 16, ["class", "style"])) : (h(), l("span", {
|
|
371
377
|
key: 1,
|
|
372
|
-
ref:
|
|
373
|
-
tabindex:
|
|
374
|
-
class:
|
|
375
|
-
(
|
|
376
|
-
|
|
377
|
-
|
|
378
|
+
ref: $e,
|
|
379
|
+
tabindex: ze.value ? 0 : void 0,
|
|
380
|
+
class: m(["block truncate focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", [
|
|
381
|
+
(f.mono || G.value === "object") && "font-mono text-xs",
|
|
382
|
+
Z.value && "tabular-nums",
|
|
383
|
+
G.value === "object" && "text-muted"
|
|
378
384
|
]]),
|
|
379
|
-
style: ae({ maxWidth:
|
|
380
|
-
},
|
|
385
|
+
style: ae({ maxWidth: f.maxWidth })
|
|
386
|
+
}, v(q.value), 15, Ce))]),
|
|
381
387
|
_: 1
|
|
382
388
|
}, 8, ["content"])),
|
|
383
|
-
|
|
389
|
+
He.value ? (h(), s(i, {
|
|
384
390
|
key: 8,
|
|
385
391
|
content: "View as JSON"
|
|
386
392
|
}, {
|
|
387
|
-
default:
|
|
393
|
+
default: x(() => [u("button", {
|
|
388
394
|
type: "button",
|
|
389
395
|
class: "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
390
396
|
"aria-label": I.value ? `View ${I.value} as JSON` : "View as JSON",
|
|
391
397
|
"aria-haspopup": "dialog",
|
|
392
|
-
onClick:
|
|
393
|
-
}, [ee(
|
|
398
|
+
onClick: S(tt, ["stop"])
|
|
399
|
+
}, [ee(y(le), {
|
|
394
400
|
class: "size-3.5",
|
|
395
401
|
"aria-hidden": "true"
|
|
396
|
-
})], 8,
|
|
402
|
+
})], 8, we)]),
|
|
397
403
|
_: 1
|
|
398
|
-
})) :
|
|
399
|
-
N.value ? (
|
|
404
|
+
})) : c("", !0),
|
|
405
|
+
N.value ? (h(), s(n, {
|
|
400
406
|
key: 9,
|
|
401
407
|
open: P.value,
|
|
402
|
-
"onUpdate:open":
|
|
408
|
+
"onUpdate:open": o[4] ||= (e) => P.value = e,
|
|
403
409
|
title: I.value || "Value",
|
|
404
410
|
size: "medium"
|
|
405
411
|
}, {
|
|
406
|
-
default:
|
|
407
|
-
"model-value":
|
|
412
|
+
default: x(() => [ee(y(je), {
|
|
413
|
+
"model-value": Ue.value,
|
|
408
414
|
language: "json",
|
|
409
415
|
readonly: "",
|
|
410
416
|
copyable: "",
|
|
@@ -413,7 +419,7 @@ var A = /*@__PURE__*/ p({
|
|
|
413
419
|
label: `${I.value || "Value"} as JSON`
|
|
414
420
|
}, null, 8, ["model-value", "label"])]),
|
|
415
421
|
_: 1
|
|
416
|
-
}, 8, ["open", "title"])) :
|
|
422
|
+
}, 8, ["open", "title"])) : c("", !0)
|
|
417
423
|
], 64))], 2));
|
|
418
424
|
}
|
|
419
425
|
});
|
|
@@ -14,7 +14,7 @@ export interface Props<V> {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/** Single checkbox: shows a dash for "some, but not all" (a select-all box). Ignored while checked. */
|
|
16
16
|
indeterminate?: boolean;
|
|
17
|
-
/** `small` is
|
|
17
|
+
/** `small` is an 18px box for table cells and card headers; `normal` is a 24px box for forms. */
|
|
18
18
|
size?: "small" | "normal";
|
|
19
19
|
}
|
|
20
20
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|