@ac-design/design-system 2.3.0 → 2.4.1

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 (63) hide show
  1. package/dist/lib/compat.css +211 -6
  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 +7 -1
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
  8. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  9. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  10. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  11. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  12. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  13. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  14. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  15. package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
  16. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  17. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  18. package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
  19. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
  20. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  21. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  22. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  24. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +27 -30
  25. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  27. package/dist/lib/components/AcInput.vue.d.ts +75 -54
  28. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
  29. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  30. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  31. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  32. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  33. package/dist/lib/components/AcModal.vue.d.ts +2 -2
  34. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +4 -4
  35. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  36. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  37. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  38. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  39. package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
  40. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
  41. package/dist/lib/components/AcSelect.vue.d.ts +35 -6
  42. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
  43. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  44. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +2 -2
  45. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  46. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  47. package/dist/lib/components/AcTable.vue.d.ts +37 -4
  48. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
  49. package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
  50. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  51. package/dist/lib/components/AcTaintInput.js +5 -0
  52. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  53. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  54. package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
  55. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
  56. package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
  57. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
  58. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  59. package/dist/lib/components/index.d.ts +1 -0
  60. package/dist/lib/composables/useToast.d.ts +2 -2
  61. package/dist/lib/index.d.ts +2 -1
  62. package/dist/lib/index.js +31 -30
  63. package/package.json +1 -1
@@ -42,10 +42,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
42
42
  title: string;
43
43
  description: string;
44
44
  size: "small" | "normal" | "large" | "full";
45
+ side: "right" | "left";
45
46
  closable: boolean;
46
47
  closeOnOutsideClick: boolean;
47
48
  hideFooter: boolean;
48
- side: "right" | "left";
49
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
50
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
51
51
  declare const _default: typeof __VLS_export;
@@ -61,8 +61,8 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
61
61
  let e = window.innerWidth - document.documentElement.clientWidth;
62
62
  t.style.overflow = "hidden";
63
63
  let n = getComputedStyle(document.documentElement).scrollbarGutter.includes("stable");
64
- e > 0 && !n && (t.style.paddingRight = `${e}px`);
65
- } else !e && n <= 0 && (t.style.overflow = "", t.style.paddingRight = "");
64
+ e > 0 && !n && (t.style.paddingRight = `${e}px`), n && t.getBoundingClientRect().height >= window.innerHeight && (document.documentElement.style.backgroundColor = `color-mix(in srgb, ${getComputedStyle(t).backgroundColor} 50%, black)`);
65
+ } else !e && n <= 0 && (t.style.overflow = "", t.style.paddingRight = "", document.documentElement.style.backgroundColor = "");
66
66
  }
67
67
  return y(F, async (e, t) => {
68
68
  if (e) {
@@ -58,11 +58,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
58
58
  disabled: boolean;
59
59
  max: number;
60
60
  min: number;
61
+ tooltip: "auto" | "always" | "never";
61
62
  hint: string;
62
63
  step: number;
63
- tooltip: "auto" | "always" | "never";
64
- range: boolean;
65
64
  errorMsg: string;
65
+ range: boolean;
66
66
  unit: string;
67
67
  marks: (number | SliderMark)[];
68
68
  formatValue: (value: number) => string;
@@ -1,17 +1,17 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as p, useId as m, useModel as h } from "vue";
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, useAttrs as f, useId as p, useModel as m } from "vue";
2
2
  //#region src/lib/components/AcSwitch.vue?vue&type=script&setup=true&lang.ts
3
- var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
3
+ var h = { class: "flex items-center gap-2" }, g = ["for"], _ = [
4
4
  "id",
5
5
  "name",
6
6
  "aria-checked",
7
7
  "aria-busy",
8
8
  "aria-disabled",
9
9
  "disabled"
10
- ], y = {
10
+ ], v = {
11
11
  key: 0,
12
12
  class: "mt-1 text-base text-danger-strong",
13
13
  role: "alert"
14
- }, b = /*@__PURE__*/ i({
14
+ }, y = /*@__PURE__*/ i({
15
15
  inheritAttrs: !1,
16
16
  __name: "AcSwitch",
17
17
  props: /*@__PURE__*/ a({
@@ -35,45 +35,45 @@ var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
35
35
  }),
36
36
  emits: ["update:modelValue"],
37
37
  setup(i, { expose: a }) {
38
- let b = i, x = h(i, "modelValue"), S = m(), C = p(), w = e(() => ({
39
- class: C.class,
40
- style: C.style
41
- })), T = e(() => {
42
- let { class: e, style: t, ...n } = C;
38
+ let y = i, b = m(i, "modelValue"), x = p(), S = f(), C = e(() => ({
39
+ class: S.class,
40
+ style: S.style
41
+ })), w = e(() => {
42
+ let { class: e, style: t, ...n } = S;
43
43
  return n;
44
- }), E = l(null);
44
+ }), T = l(null), E = e(() => S.id ?? x);
45
45
  function D() {
46
- b.disabled || b.loading || (x.value = !x.value);
46
+ y.disabled || y.loading || (b.value = !b.value);
47
47
  }
48
- return a({ focus: () => E.value?.focus() }), (e, a) => (c(), n("div", o(w.value, {
48
+ return a({ focus: () => T.value?.focus() }), (e, a) => (c(), n("div", o(C.value, {
49
49
  "data-ac-ds": "",
50
50
  "data-testid": "ac-switch"
51
- }), [r("div", g, [
51
+ }), [r("div", h, [
52
52
  u(e.$slots, "left"),
53
53
  i.label ? (c(), n("label", {
54
54
  key: 0,
55
- for: f(S),
55
+ for: E.value,
56
56
  class: s(["cursor-pointer text-base font-medium text-heading", i.disabled && "cursor-not-allowed opacity-50"])
57
- }, d(i.label), 11, _)) : t("", !0),
57
+ }, d(i.label), 11, g)) : t("", !0),
58
58
  u(e.$slots, "middle"),
59
59
  r("button", o({
60
- id: f(S),
60
+ id: E.value,
61
61
  ref_key: "button",
62
- ref: E
63
- }, T.value, {
62
+ ref: T
63
+ }, w.value, {
64
64
  type: "button",
65
65
  role: "switch",
66
66
  name: i.name,
67
- "aria-checked": x.value,
67
+ "aria-checked": b.value,
68
68
  "aria-busy": i.loading || void 0,
69
69
  "aria-disabled": i.loading && !i.disabled || void 0,
70
70
  disabled: i.disabled,
71
- class: ["relative h-6 w-11 shrink-0 rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none motion-reduce:transition-none", [x.value ? "bg-primary" : "bg-slate-80", i.disabled ? "cursor-not-allowed opacity-50" : i.loading ? "cursor-wait animate-pulse motion-reduce:animate-none" : "cursor-pointer"]],
71
+ class: ["relative h-6 w-11 shrink-0 rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none motion-reduce:transition-none", [b.value ? "bg-primary" : "bg-slate-80", i.disabled ? "cursor-not-allowed opacity-50" : i.loading ? "cursor-wait animate-pulse motion-reduce:animate-none" : "cursor-pointer"]],
72
72
  onClick: D
73
- }), [r("span", { class: s(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full border bg-white transition-transform duration-200 ease-out motion-reduce:transition-none", x.value ? "translate-x-5 border-white" : "translate-x-0 border-slate-70"]) }, null, 2)], 16, v),
73
+ }), [r("span", { class: s(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full border bg-white transition-transform duration-200 ease-out motion-reduce:transition-none", b.value ? "translate-x-5 border-white" : "translate-x-0 border-slate-70"]) }, null, 2)], 16, _),
74
74
  u(e.$slots, "right")
75
- ]), i.errorMsg ? (c(), n("p", y, d(i.errorMsg), 1)) : t("", !0)], 16));
75
+ ]), i.errorMsg ? (c(), n("p", v, d(i.errorMsg), 1)) : t("", !0)], 16));
76
76
  }
77
77
  });
78
78
  //#endregion
79
- export { b as default };
79
+ export { y as default };
@@ -15,6 +15,17 @@ export interface Column {
15
15
  wrap?: boolean;
16
16
  /** Pads the header and cells 8px a side instead of 24px, e.g. for a column of icon buttons. */
17
17
  compact?: boolean;
18
+ /** How the table compares values when it sorts this column: `string` (case-insensitive text, as cloud-ui's BasicTable), `number` or `date`. `null` and missing values go last either way. Leave it out for natural text order. */
19
+ sortType?: "string" | "number" | "date";
20
+ /** Row field holding the cell's link, e.g. `"link"`: the value shows as a primary link (a `RouterLink` when the app has vue-router). */
21
+ link?: string;
22
+ /** With `link`, the target used when the row's link field is empty, e.g. `"#"` to keep such names looking and acting as links. Without it they show as plain styled text. */
23
+ linkFallback?: string;
24
+ }
25
+ /** One client-side filter: rows stay when the `key` value contains `searchText`, ignoring case. */
26
+ export interface TableSearch {
27
+ key: string;
28
+ searchText: string;
18
29
  }
19
30
  export interface Props<R> {
20
31
  /** Column definitions: `{ key, label, sortable?, align?, width?, type?, descriptor?, class?, wrap?, compact? }`. `type` or `descriptor` shows values with AcCellValue. */
@@ -53,13 +64,27 @@ export interface Props<R> {
53
64
  expandedBare?: boolean;
54
65
  /** Turns a server cell's link template into a URL, e.g. to fill `${username}` and `${clustername}` from the current route. */
55
66
  resolveLink?: (link: string) => string;
67
+ /** Filters rows in the table: a row stays when every entry's `searchText` appears in its `key` value, ignoring case. Rows whose value is `null` or missing drop out, even for an empty `searchText`. */
68
+ search?: TableSearch[];
69
+ /** Splits rows into pages of this size, with a pager under the table once there's more than one page. Bind the page with `v-model:page`. Sorting and `search` work across every page. */
70
+ pageSize?: number;
71
+ /** Pads body cells 12px above and below and lets their text wrap, so rows holding buttons or badges stand 52px tall, as cloud-ui's BasicTable. */
72
+ relaxed?: boolean;
73
+ /** Cuts plain cell text longer than this many characters to that length plus "...", and shows the full value in a tooltip. */
74
+ truncate?: number;
75
+ /** Text for a plain cell whose value is `null` or `""`, e.g. `"-"`. A missing (`undefined`) value stays blank. */
76
+ placeholder?: string;
77
+ /** Which values get the `placeholder`: `empty` (`null` or `""`) or `falsy` (also `0` and `false`, as cloud-ui's BasicTable). A missing (`undefined`) value stays blank either way, and `link` columns never show it. */
78
+ placeholderFor?: "empty" | "falsy";
56
79
  }
57
- declare const __VLS_export: <Row extends Record<string, unknown>>(__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<{
80
+ declare const __VLS_export: <Row extends Record<string, unknown>, Key = unknown>(__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
81
  props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<Row> & {
59
82
  /** `rowKey` values of the chosen rows. Bind with `v-model:selected`. Rows that leave `rows` (another page, a search) stay chosen. */
60
- selected?: unknown[];
83
+ selected?: Key[];
61
84
  /** `rowKey` values of the rows that are open. Bind with `v-model:expanded`. */
62
85
  expanded?: unknown[];
86
+ /** The current page with `page-size`, starting at 1. Bind with `v-model:page`. A search or sort goes back to page 1. */
87
+ page?: number;
63
88
  /** The sorted column and direction, or `null`. Bind with `v-model:sortBy` to set it from outside, e.g. to keep it across pages or in the URL. */
64
89
  sortBy?: {
65
90
  key: string;
@@ -67,8 +92,9 @@ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: N
67
92
  } | null;
68
93
  }) & {
69
94
  onSort?: ((key: string, mode: "desc" | "asc") => any) | undefined;
95
+ "onUpdate:page"?: ((value: number) => any) | undefined;
70
96
  "onRow-click"?: ((row: Row) => any) | undefined;
71
- "onUpdate:selected"?: ((value: unknown[]) => any) | undefined;
97
+ "onUpdate:selected"?: ((value: Key[]) => any) | undefined;
72
98
  "onUpdate:expanded"?: ((value: unknown[]) => any) | undefined;
73
99
  "onUpdate:sortBy"?: ((value: {
74
100
  key: string;
@@ -87,14 +113,21 @@ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: N
87
113
  [key: `header-${string}`]: (props: {
88
114
  column: Column;
89
115
  }) => unknown;
116
+ [key: `before-${string}`]: (props: {
117
+ row: Row;
118
+ }) => unknown;
90
119
  /** Detail area under an open row, for tables with `expandable`: `#expanded="{ row }"`. */
91
120
  expanded?: (props: {
92
121
  row: Row;
93
122
  }) => unknown;
94
123
  /** Content shown when `rows` is empty. */
95
124
  empty?: () => unknown;
125
+ /** Row actions, e.g. edit and delete buttons: `#actions="{ row }"`. Adds a narrow last column, 80px wide (120px from 1024px). */
126
+ actions?: (props: {
127
+ row: Row;
128
+ }) => unknown;
96
129
  };
97
- emit: (((evt: "sort", key: string, mode: "desc" | "asc") => void) & ((evt: "row-click", row: Row) => void)) & (((event: "update:selected", value: unknown[]) => void) & ((event: "update:expanded", value: unknown[]) => void) & ((event: "update:sortBy", value: {
130
+ emit: (((evt: "sort", key: string, mode: "desc" | "asc") => void) & ((evt: "row-click", row: Row) => void)) & (((event: "update:page", value: number) => void) & ((event: "update:selected", value: Key[]) => void) & ((event: "update:expanded", value: unknown[]) => void) & ((event: "update:sortBy", value: {
98
131
  key: string;
99
132
  mode: "asc" | "desc";
100
133
  } | null) => void));