@ac-design/design-system 2.2.1 → 2.4.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.
Files changed (77) hide show
  1. package/dist/lib/compat.css +421 -0
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +25 -13
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
  8. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  9. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  10. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  11. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  12. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  13. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  14. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  15. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  16. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  17. package/dist/lib/components/AcColorInput.vue.d.ts +4 -4
  18. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  19. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  20. package/dist/lib/components/AcDatePicker.vue.d.ts +41 -10
  21. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
  22. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  24. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  25. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  27. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  28. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  29. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  30. package/dist/lib/components/AcInput.vue.d.ts +86 -44
  31. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
  32. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  33. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  34. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  35. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  36. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  37. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  38. package/dist/lib/components/AcModal.vue.d.ts +1 -1
  39. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  40. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  41. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  42. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  43. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  44. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  45. package/dist/lib/components/AcRadioCard.js +5 -0
  46. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  47. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  48. package/dist/lib/components/AcSelect.vue.d.ts +46 -6
  49. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
  50. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  51. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  52. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  53. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  54. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  55. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  56. package/dist/lib/components/AcTable.vue.d.ts +50 -5
  57. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
  58. package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
  59. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  60. package/dist/lib/components/AcTaintInput.js +5 -0
  61. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  62. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  63. package/dist/lib/components/AcTextarea.vue.d.ts +64 -4
  64. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
  65. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  66. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  67. package/dist/lib/components/AcTimePicker.vue.d.ts +36 -11
  68. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
  69. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  70. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  71. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  72. package/dist/lib/components/index.d.ts +2 -0
  73. package/dist/lib/components/types.d.ts +2 -0
  74. package/dist/lib/composables/useToast.d.ts +2 -2
  75. package/dist/lib/index.d.ts +2 -1
  76. package/dist/lib/index.js +51 -49
  77. package/package.json +1 -1
@@ -107,10 +107,10 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
107
107
  title: string;
108
108
  description: string;
109
109
  height: number;
110
- loading: boolean;
111
110
  animation: boolean;
112
- pulse: boolean | string[];
113
111
  tooltip: boolean;
112
+ loading: boolean;
113
+ pulse: boolean | string[];
114
114
  emptyText: string;
115
115
  labels: boolean;
116
116
  valueLabel: string;
@@ -49,11 +49,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
49
49
  title: string;
50
50
  description: string;
51
51
  size: "xsmall" | "small" | "normal" | "medium" | "large" | "xlarge" | "full";
52
+ maxWidth: "xsm" | "sm" | "md" | "lg" | "xl" | "xxl";
52
53
  bodyClass: string;
53
54
  closable: boolean;
54
55
  closeOnOutsideClick: boolean;
55
56
  hideFooter: boolean;
56
- maxWidth: "xsm" | "sm" | "md" | "lg" | "xl" | "xxl";
57
57
  showCloseButton: boolean;
58
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
59
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -19,6 +19,8 @@ type __VLS_Slots = {
19
19
  default?: () => unknown;
20
20
  /** A search field, placed by `search-position`. Hidden below 640px. */
21
21
  search?: () => unknown;
22
+ /** Left-hand content that fills the row up to `actions` and shrinks first when space runs out, e.g. cloud-ui's search field with its phone-only search button. Use it instead of a centred `search`. */
23
+ start?: () => unknown;
22
24
  /** Right side: icon actions, notifications, theme and `AcUserMenu` last. */
23
25
  actions?: () => unknown;
24
26
  };
@@ -1,22 +1,28 @@
1
- import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, createVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c, unref as l } from "vue";
2
- import { Menu as u } from "@lucide/vue";
1
+ import { createCommentVNode as e, createElementBlock as t, createVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s, unref as c } from "vue";
2
+ import { Menu as l } from "@lucide/vue";
3
3
  //#region src/lib/components/AcNavbar.vue?vue&type=script&setup=true&lang.ts
4
- var d = ["aria-label"], f = {
4
+ var u = ["aria-label"], d = {
5
5
  key: 1,
6
6
  class: "flex shrink-0 items-center gap-2"
7
- }, p = {
7
+ }, f = {
8
8
  key: 0,
9
9
  class: "inline-flex items-center rounded-6 border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-sm font-semibold tracking-wide text-primary-strong uppercase"
10
- }, m = ["aria-label"], h = {
10
+ }, p = ["aria-label"], m = {
11
11
  key: 3,
12
12
  class: "hidden min-w-0 shrink sm:block sm:w-48 md:w-60 lg:w-80 xl:w-96"
13
- }, g = { class: "flex min-w-0 flex-1 justify-center" }, _ = {
13
+ }, h = {
14
+ key: 4,
15
+ class: "flex min-w-0 flex-1 items-center"
16
+ }, g = {
17
+ key: 5,
18
+ class: "flex min-w-0 flex-1 justify-center"
19
+ }, _ = {
14
20
  key: 0,
15
21
  class: "hidden w-full max-w-md sm:block"
16
22
  }, v = {
17
- key: 4,
23
+ key: 6,
18
24
  class: "flex shrink-0 items-center gap-0.5 sm:gap-3"
19
- }, y = /*@__PURE__*/ i({
25
+ }, y = /*@__PURE__*/ r({
20
26
  __name: "AcNavbar",
21
27
  props: {
22
28
  menuButton: { default: "mobile" },
@@ -30,37 +36,37 @@ var d = ["aria-label"], f = {
30
36
  searchPosition: { default: "start" }
31
37
  },
32
38
  emits: ["menu"],
33
- setup(i, { emit: y }) {
39
+ setup(r, { emit: y }) {
34
40
  let b = y;
35
- return (y, x) => (o(), t("header", {
36
- class: a(["top-0 z-30 flex h-18 shrink-0 items-center gap-2 border-b border-border/80 bg-surface/90 px-4 backdrop-blur-sm sm:gap-4 sm:px-6", i.sticky && "sticky"]),
41
+ return (y, x) => (a(), t("header", {
42
+ class: i(["top-0 z-30 flex h-18 shrink-0 items-center gap-2 border-b border-border/80 bg-surface/90 px-4 backdrop-blur-sm sm:gap-4 sm:px-6", r.sticky && "sticky"]),
37
43
  "data-ac-ds": "",
38
44
  "data-testid": "ac-navbar"
39
45
  }, [
40
- i.menuButton === "never" ? e("", !0) : (o(), t("button", {
46
+ r.menuButton === "never" ? e("", !0) : (a(), t("button", {
41
47
  key: 0,
42
48
  type: "button",
43
- class: a(["inline-flex size-9.5 shrink-0 cursor-pointer items-center justify-center rounded-10 border border-transparent text-muted transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", {
44
- "md:hidden": i.menuButton === "mobile",
45
- "lg:hidden": i.menuButton === "tablet"
49
+ class: i(["inline-flex size-9.5 shrink-0 cursor-pointer items-center justify-center rounded-10 border border-transparent text-muted transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", {
50
+ "md:hidden": r.menuButton === "mobile",
51
+ "lg:hidden": r.menuButton === "tablet"
46
52
  }]),
47
- "aria-label": i.menuLabel,
53
+ "aria-label": r.menuLabel,
48
54
  "data-ac-ds": "",
49
55
  "data-testid": "ac-navbar-menu",
50
56
  onClick: x[0] ||= (e) => b("menu")
51
- }, [r(l(u), {
57
+ }, [n(c(l), {
52
58
  class: "size-5",
53
59
  "aria-hidden": "true"
54
- })], 10, d)),
55
- y.$slots.brand || i.productName ? (o(), t("div", f, [s(y.$slots, "brand"), i.productName ? (o(), t("span", p, c(i.productName), 1)) : e("", !0)])) : e("", !0),
56
- y.$slots.default ? (o(), t("nav", {
60
+ })], 10, u)),
61
+ y.$slots.brand || r.productName ? (a(), t("div", d, [o(y.$slots, "brand"), r.productName ? (a(), t("span", f, s(r.productName), 1)) : e("", !0)])) : e("", !0),
62
+ y.$slots.default ? (a(), t("nav", {
57
63
  key: 2,
58
- "aria-label": i.label,
64
+ "aria-label": r.label,
59
65
  class: "hidden items-center gap-1 md:flex"
60
- }, [s(y.$slots, "default")], 8, m)) : e("", !0),
61
- y.$slots.search && i.searchPosition === "start" ? (o(), t("div", h, [s(y.$slots, "search")])) : e("", !0),
62
- n("div", g, [y.$slots.search && i.searchPosition === "center" ? (o(), t("div", _, [s(y.$slots, "search")])) : e("", !0)]),
63
- y.$slots.actions ? (o(), t("div", v, [s(y.$slots, "actions")])) : e("", !0)
66
+ }, [o(y.$slots, "default")], 8, p)) : e("", !0),
67
+ y.$slots.search && r.searchPosition === "start" ? (a(), t("div", m, [o(y.$slots, "search")])) : e("", !0),
68
+ y.$slots.start ? (a(), t("div", h, [o(y.$slots, "start")])) : (a(), t("div", g, [y.$slots.search && r.searchPosition === "center" ? (a(), t("div", _, [o(y.$slots, "search")])) : e("", !0)])),
69
+ y.$slots.actions ? (a(), t("div", v, [o(y.$slots, "actions")])) : e("", !0)
64
70
  ], 2));
65
71
  }
66
72
  });
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
71
71
  onViewAll?: (() => any) | undefined;
72
72
  }>, {
73
73
  label: string;
74
- loading: boolean;
75
74
  align: "start" | "end";
75
+ loading: boolean;
76
76
  emptyText: string;
77
77
  notifications: NotificationItem[];
78
78
  unreadCount: number;
@@ -1,5 +1,5 @@
1
- import e from "./AcNavbarItem.js";
2
- import { fixedFrame as t } from "./fixedFrame.js";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcNavbarItem.js";
3
3
  import n from "./AcSkeleton.js";
4
4
  import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as ee, onBeforeUnmount as te, openBlock as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useId as ne, useModel as re, watch as E, withCtx as D } from "vue";
5
5
  import { ArrowRight as ie, Bell as ae, BellOff as oe } from "@lucide/vue";
@@ -146,9 +146,9 @@ var se = {
146
146
  t.length && t[(e + t.length) % t.length].focus();
147
147
  }
148
148
  function Y() {
149
- let e = K();
150
- if (!e || !L.value) return;
151
- let n = e.getBoundingClientRect(), r = t(), { offsetWidth: i, offsetHeight: a } = L.value, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = (O.align === "end" ? n.right - i : n.left) - r.left;
149
+ let t = K();
150
+ if (!t || !L.value) return;
151
+ let n = t.getBoundingClientRect(), r = e(), { offsetWidth: i, offsetHeight: a } = L.value, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = (O.align === "end" ? n.right - i : n.left) - r.left;
152
152
  z.value = !c, R.value = {
153
153
  [c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
154
154
  left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
@@ -194,7 +194,7 @@ var se = {
194
194
  B.value = Date.now(), await _(), Y();
195
195
  let t = q()[0];
196
196
  t ? t.focus() : L.value?.focus();
197
- }), E(() => [O.notifications.length, O.loading], () => k.value && _(Y)), te(() => $(!1)), (t, o) => (y(), l("div", se, [f(e, {
197
+ }), E(() => [O.notifications.length, O.loading], () => k.value && _(Y)), te(() => $(!1)), (e, o) => (y(), l("div", se, [f(t, {
198
198
  ref_key: "trigger",
199
199
  ref: I,
200
200
  label: p.label,
@@ -253,44 +253,44 @@ var se = {
253
253
  lines: 3,
254
254
  height: "10px",
255
255
  label: ""
256
- })), 64))])) : p.notifications.length ? (y(), l("ul", me, [(y(!0), l(r, null, x(p.notifications, (e) => (y(), l("li", { key: e.id }, [(y(), s(C(W(e.to, e.href)), g({ ref_for: !0 }, G(e.to, e.href), {
256
+ })), 64))])) : p.notifications.length ? (y(), l("ul", me, [(y(!0), l(r, null, x(p.notifications, (t) => (y(), l("li", { key: t.id }, [(y(), s(C(W(t.to, t.href)), g({ ref_for: !0 }, G(t.to, t.href), {
257
257
  "data-notification-item": "",
258
- class: ["relative block w-full cursor-pointer p-3 text-left no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !e.read && "bg-primary/8"],
258
+ class: ["relative block w-full cursor-pointer p-3 text-left no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !t.read && "bg-primary/8"],
259
259
  "data-ac-ds": "",
260
260
  "data-testid": "ac-notification-menu-item",
261
- onClick: (t) => Le(e)
261
+ onClick: (e) => Le(t)
262
262
  }), {
263
- default: D(() => [S(t.$slots, "item", { item: e }, () => [
263
+ default: D(() => [S(e.$slots, "item", { item: t }, () => [
264
264
  u("span", he, [
265
- e.icon ? (y(), s(C(e.icon), {
265
+ t.icon ? (y(), s(C(t.icon), {
266
266
  key: 0,
267
267
  class: "size-4 shrink-0 text-muted",
268
268
  "aria-hidden": "true"
269
269
  })) : c("", !0),
270
- u("span", ge, w(e.title || e.msg), 1),
271
- e.read ? c("", !0) : (y(), l("span", _e)),
272
- e.read ? c("", !0) : (y(), l("span", ve, "(unread)"))
270
+ u("span", ge, w(t.title || t.msg), 1),
271
+ t.read ? c("", !0) : (y(), l("span", _e)),
272
+ t.read ? c("", !0) : (y(), l("span", ve, "(unread)"))
273
273
  ]),
274
- e.title && e.msg ? (y(), l("span", ye, w(e.msg), 1)) : c("", !0),
274
+ t.title && t.msg ? (y(), l("span", ye, w(t.msg), 1)) : c("", !0),
275
275
  u("span", be, [
276
- e.status ? (y(), l("span", {
276
+ t.status ? (y(), l("span", {
277
277
  key: 0,
278
- class: v(["font-medium", De[Me(e)]])
279
- }, w(e.status), 3)) : c("", !0),
280
- e.status ? (y(), l("span", xe, "·")) : c("", !0),
278
+ class: v(["font-medium", De[Me(t)]])
279
+ }, w(t.status), 3)) : c("", !0),
280
+ t.status ? (y(), l("span", xe, "·")) : c("", !0),
281
281
  u("time", {
282
- datetime: Fe(e.time),
283
- title: Pe(e.time)
284
- }, w(Ne(e.time)), 9, Se)
282
+ datetime: Fe(t.time),
283
+ title: Pe(t.time)
284
+ }, w(Ne(t.time)), 9, Se)
285
285
  ])
286
286
  ])]),
287
287
  _: 2
288
- }, 1040, ["class", "onClick"]))]))), 128))])) : (y(), l("div", de, [S(t.$slots, "empty", {}, () => [
288
+ }, 1040, ["class", "onClick"]))]))), 128))])) : (y(), l("div", de, [S(e.$slots, "empty", {}, () => [
289
289
  u("span", fe, [f(T(oe), { class: "size-6" })]),
290
290
  u("p", pe, w(p.emptyText), 1),
291
291
  o[2] ||= u("p", { class: "max-w-64 text-base text-muted" }, "Backups, upgrades and alerts from your clusters show up here.", -1)
292
292
  ])])),
293
- t.$slots.footer || je.value ? (y(), l("div", Ce, [S(t.$slots, "footer", { close: X }, () => [(y(), s(C(W(p.viewAllTo, p.viewAllHref)), g(G(p.viewAllTo, p.viewAllHref), {
293
+ e.$slots.footer || je.value ? (y(), l("div", Ce, [S(e.$slots, "footer", { close: X }, () => [(y(), s(C(W(p.viewAllTo, p.viewAllHref)), g(G(p.viewAllTo, p.viewAllHref), {
294
294
  class: "group/link flex h-9 w-full cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-semibold text-primary-strong no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
295
295
  "data-ac-ds": "",
296
296
  "data-testid": "ac-notification-menu-view-all",
@@ -1,8 +1,10 @@
1
- export interface Props {
1
+ export interface Props<K extends "null" | "undefined" = "null"> {
2
2
  /** Label above the field. Without one, pass `aria-label` so the field still has a name. */
3
3
  label?: string;
4
4
  /** Native `name` attribute. */
5
5
  name?: string;
6
+ /** Text shown inside the empty field, e.g. "Enter number". */
7
+ placeholder?: string;
6
8
  /** Lowest allowed value. ↓, − and Home stop here, and typed values are clamped to it on blur. No limit by default. */
7
9
  min?: number;
8
10
  /** Highest allowed value. ↑, + and End stop here, and typed values are clamped to it on blur. No limit by default. */
@@ -21,6 +23,8 @@ export interface Props {
21
23
  holdIntervalDelay?: number;
22
24
  /** Marks the field required and adds a red asterisk. */
23
25
  required?: boolean;
26
+ /** Adds the red asterisk without native `required`, for forms that run their own validation on submit. Cloud `is-required`. */
27
+ requiredMark?: boolean;
24
28
  /** Disables the field and its buttons. */
25
29
  disabled?: boolean;
26
30
  /** Read-only field: a muted fill, "(read only)" after the label, and no stepping. */
@@ -29,51 +33,57 @@ export interface Props {
29
33
  errorMsg?: string;
30
34
  /** Help text between the label and the field. */
31
35
  hint?: string;
32
- /** `small` 36px or `normal` 42px tall, the same as `AcInput`; the step buttons match. */
33
- size?: "small" | "normal";
36
+ /** `small` 36px, `normal` 42px or `large` 46px tall (cloud-ui's default number field); the step buttons match. */
37
+ size?: "small" | "normal" | "large";
38
+ /** What an empty field puts in `v-model`: `"null"` (default) or `"undefined"`, as cloud-ui's v1 AcNumberInput did. */
39
+ emptyValue?: K;
40
+ /** Text after the label of a read-only field, e.g. "(Read Only)". */
41
+ readonlyText?: string;
42
+ /** Keeps the editable fill on a read-only field and shows no focus halo, as cloud-ui's v1 AcNumberInput did. */
43
+ plainReadonly?: boolean;
44
+ /** Cloud-ui v1 error look: the border stays grey and the message uses the base `text-danger` red instead of the AA `-strong` shade. */
45
+ plainError?: boolean;
46
+ /** No gap around `#label-icon` and `#label-extra`, for slot content that brings its own margin. */
47
+ flushLabelSlots?: boolean;
48
+ /** Replaces the built-in range message, e.g. "Value must be between {min} and {max}". It shows from a keystroke that leaves the range until a blur that commits a value, and wins over `error-msg`. */
49
+ rangeMessage?: string;
50
+ /** The value and placeholder take the page's font weight and default placeholder colour instead of the field's own. */
51
+ inheritFont?: boolean;
52
+ /** Puts the − and + buttons in the tab order and lets a click focus them, as cloud-ui's v1 AcNumberInput did. */
53
+ focusableStepButtons?: boolean;
54
+ /** Drops the root's `w-full`, so in a flex row the field sizes to its content, as cloud-ui's v1 AcNumberInput did. */
55
+ autoWidth?: boolean;
34
56
  }
35
- type __VLS_Props = Props;
36
- type __VLS_Slots = {
37
- /** Content inside the field after the value, before the buttons: an icon or richer unit text. */
38
- suffix?: () => unknown;
39
- };
40
- type __VLS_ModelProps = {
41
- /** The number, or `null` while the field is empty. */
42
- modelValue?: number | null;
57
+ declare const __VLS_export: <K extends "null" | "undefined" = "null">(__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<{
58
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<K> & {
59
+ modelValue?: number | (K extends "undefined" ? undefined : null);
60
+ }) & {
61
+ "onUpdate:modelValue"?: ((value: number | (K extends "undefined" ? undefined : null)) => any) | undefined;
62
+ onChange?: ((value: number | (K extends "undefined" ? undefined : null)) => any) | undefined;
63
+ }> & (typeof globalThis extends {
64
+ __VLS_PROPS_FALLBACK: infer P;
65
+ } ? P : {});
66
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
67
+ /** Moves focus to the input. */
68
+ focus: () => void | undefined;
69
+ }>) => void;
70
+ attrs: any;
71
+ slots: {
72
+ /** Content before the label text, such as a 14px icon. */
73
+ "label-icon"?: () => unknown;
74
+ /** Content after the label text, such as "(Optional)" or an info tooltip. */
75
+ "label-extra"?: () => unknown;
76
+ /** Content inside the field after the value, before the buttons: an icon or richer unit text. */
77
+ suffix?: () => unknown;
78
+ };
79
+ emit: ((evt: "change", value: number | (K extends "undefined" ? undefined : null)) => void) & ((event: "update:modelValue", value: number | (K extends "undefined" ? undefined : null)) => void);
80
+ }>) => import("vue").VNode & {
81
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
43
82
  };
44
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
45
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
46
- /** Moves focus to the input. */
47
- focus: () => void | undefined;
48
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
49
- "update:modelValue": (value: number | null) => any;
50
- change: (value: number | null) => any;
51
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
52
- "onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
53
- onChange?: ((value: number | null) => any) | undefined;
54
- }>, {
55
- required: boolean;
56
- label: string;
57
- disabled: boolean;
58
- max: number;
59
- min: number;
60
- name: string;
61
- size: "small" | "normal";
62
- step: number;
63
- readonly: boolean;
64
- hint: string;
65
- errorMsg: string;
66
- unit: string;
67
- precision: number;
68
- stepButtons: boolean;
69
- holdDelay: number;
70
- holdIntervalDelay: number;
71
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
72
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
73
83
  declare const _default: typeof __VLS_export;
74
84
  export default _default;
75
- type __VLS_WithSlots<T, S> = T & {
76
- new (): {
77
- $slots: S;
78
- };
79
- };
85
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
86
+ [K in keyof T]: T[K];
87
+ } : {
88
+ [K in keyof T as K]: T[K];
89
+ }) & {};