@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
@@ -4,6 +4,8 @@ export interface Props {
4
4
  label?: string;
5
5
  /** Native `name` attribute. */
6
6
  name?: string;
7
+ /** Example value shown inside the empty field. */
8
+ placeholder?: string;
7
9
  /** Visible height in lines. Unset, the field is 160px tall (about 6 lines). With `autoResize` it's the starting (minimum) height. */
8
10
  rows?: number;
9
11
  /** Grows the field with its content instead of showing a scrollbar. */
@@ -22,14 +24,28 @@ export interface Props {
22
24
  disabled?: boolean;
23
25
  /** Read-only field: a muted fill, and "(read only)" after the label. */
24
26
  readonly?: boolean;
27
+ /** Text after the label of a read-only field, e.g. "(Read Only)". */
28
+ readonlyText?: string;
29
+ /** Cloud-ui v1 error look: no field fill while it shows an error, and the message in the base `text-danger` red instead of the AA `-strong` shade. */
30
+ plainError?: boolean;
31
+ /** No gap around `#label-icon` and `#label-extra`, for slot content that brings its own margin. */
32
+ flushLabelSlots?: boolean;
25
33
  /** Error text under the field. Turns the border and label red and sets `aria-invalid`. */
26
34
  errorMsg?: string;
27
35
  /** Turns the border red and sets `aria-invalid` without a message, for forms that print their own. */
28
36
  invalid?: boolean;
29
37
  /** Help text between the label and the field. */
30
38
  hint?: string;
31
- /** Inner spacing: `xsmall` 12px × 6px, `small` 16px × 8px or `normal` 20px × 10px. Set the height with `rows` or `input-class`. */
32
- size?: "xsmall" | "small" | "normal";
39
+ /** Error shown under the field when the viewer clears it or leaves it empty, e.g. "Please enter a description". `error-msg` shows when this one doesn't. */
40
+ requiredMessage?: string;
41
+ /** With `required-message`, an empty field emits no `input` or `focusout`, as cloud-ui's v1 AcInput did. */
42
+ silentWhenEmpty?: boolean;
43
+ /** Inner spacing: `xs` 8px × 4px with 12px text, `xsmall` 12px × 6px, `small` 16px × 8px, `medium` 16px × 8px, `normal` 20px × 10px or `large` 24px × 12px with 16px text. Without `rows` or a height in `input-class`, `xs` is 60px tall, `medium` 120px, `large` 240px and the rest at least 160px. */
44
+ size?: "xs" | "xsmall" | "small" | "medium" | "normal" | "large";
45
+ /** Field look: `outline` (border on the page fill), `soft` (grey fill, no border), `ghost` (no fill or border until focus) or `none` (bare text, no border or focus style). */
46
+ variant?: "outline" | "soft" | "ghost" | "none";
47
+ /** Draws a 2px primary halo around the field to point the viewer at it. */
48
+ highlight?: boolean;
33
49
  /** Classes for the `<textarea>` element itself, e.g. `h-30` for a fixed 120px height; they replace the 160px default height. `class` goes on the wrapper. */
34
50
  inputClass?: HTMLAttributes["class"];
35
51
  }
@@ -48,23 +64,41 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
48
64
  /** Moves focus to the textarea. */
49
65
  focus: () => void | undefined;
50
66
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
67
+ input: (event: Event) => any;
51
68
  "update:modelValue": (value: string) => any;
69
+ blur: (event: FocusEvent) => any;
70
+ change: (event: Event) => any;
71
+ focus: (event: FocusEvent) => any;
72
+ focusout: (event: FocusEvent) => any;
52
73
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
74
+ onInput?: ((event: Event) => any) | undefined;
53
75
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
76
+ onBlur?: ((event: FocusEvent) => any) | undefined;
77
+ onChange?: ((event: Event) => any) | undefined;
78
+ onFocus?: ((event: FocusEvent) => any) | undefined;
79
+ onFocusout?: ((event: FocusEvent) => any) | undefined;
54
80
  }>, {
81
+ variant: "outline" | "soft" | "ghost" | "none";
55
82
  required: boolean;
56
83
  label: string;
57
84
  disabled: boolean;
58
85
  name: string;
59
- size: "xsmall" | "small" | "normal";
60
- hint: string;
86
+ size: "xs" | "xsmall" | "small" | "medium" | "normal" | "large";
61
87
  invalid: boolean;
88
+ hint: string;
62
89
  rows: number;
63
90
  readonly: boolean;
91
+ placeholder: string;
64
92
  errorMsg: string;
93
+ highlight: boolean;
65
94
  mono: boolean;
66
95
  maxlength: number;
67
96
  requiredMark: boolean;
97
+ requiredMessage: string;
98
+ silentWhenEmpty: boolean;
99
+ readonlyText: string;
100
+ plainError: boolean;
101
+ flushLabelSlots: boolean;
68
102
  inputClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
69
103
  autoResize: boolean;
70
104
  maxRows: number;
@@ -1,15 +1,9 @@
1
1
  import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, nextTick as c, normalizeClass as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, useSlots as y, vModelText as b, watch as x, withDirectives as S } from "vue";
2
2
  //#region src/lib/components/AcTextarea.vue?vue&type=script&setup=true&lang.ts
3
- var C = ["for"], w = { key: 0 }, T = {
4
- key: 1,
5
- class: "text-muted"
6
- }, E = {
7
- key: 2,
8
- class: "text-danger",
9
- "aria-hidden": "true"
10
- }, D = ["id"], O = [
3
+ var ee = ["for"], C = { key: 0 }, w = ["id"], T = [
11
4
  "id",
12
5
  "name",
6
+ "placeholder",
13
7
  "rows",
14
8
  "maxlength",
15
9
  "disabled",
@@ -18,18 +12,19 @@ var C = ["for"], w = { key: 0 }, T = {
18
12
  "aria-label",
19
13
  "aria-invalid",
20
14
  "aria-describedby"
21
- ], k = {
15
+ ], E = {
22
16
  key: 2,
23
17
  class: "mt-1 flex items-start gap-3"
24
- }, A = ["id"], j = {
18
+ }, te = ["id"], ne = {
25
19
  key: 1,
26
20
  class: "flex-1"
27
- }, M = ["id"], N = /*@__PURE__*/ a({
21
+ }, D = ["id"], O = "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]", k = "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-primary)_20%,transparent)]", A = /*@__PURE__*/ a({
28
22
  inheritAttrs: !1,
29
23
  __name: "AcTextarea",
30
24
  props: /*@__PURE__*/ o({
31
25
  label: { default: "" },
32
26
  name: { default: "" },
27
+ placeholder: { default: void 0 },
33
28
  rows: { default: void 0 },
34
29
  autoResize: {
35
30
  type: Boolean,
@@ -57,13 +52,32 @@ var C = ["for"], w = { key: 0 }, T = {
57
52
  type: Boolean,
58
53
  default: !1
59
54
  },
55
+ readonlyText: { default: "(read only)" },
56
+ plainError: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ flushLabelSlots: {
61
+ type: Boolean,
62
+ default: !1
63
+ },
60
64
  errorMsg: { default: "" },
61
65
  invalid: {
62
66
  type: Boolean,
63
67
  default: !1
64
68
  },
65
69
  hint: { default: "" },
70
+ requiredMessage: { default: "" },
71
+ silentWhenEmpty: {
72
+ type: Boolean,
73
+ default: !1
74
+ },
66
75
  size: { default: "normal" },
76
+ variant: { default: "outline" },
77
+ highlight: {
78
+ type: Boolean,
79
+ default: !1
80
+ },
67
81
  inputClass: {
68
82
  type: [
69
83
  Boolean,
@@ -78,39 +92,71 @@ var C = ["for"], w = { key: 0 }, T = {
78
92
  modelValue: { default: "" },
79
93
  modelModifiers: {}
80
94
  }),
81
- emits: ["update:modelValue"],
82
- setup(a, { expose: o }) {
83
- let N = a, P = v(a, "modelValue"), F = {
84
- xsmall: "px-3 py-1.5",
85
- small: "px-4 py-2",
86
- normal: "px-5 py-2.5"
95
+ emits: /*@__PURE__*/ o([
96
+ "focus",
97
+ "blur",
98
+ "focusout",
99
+ "input",
100
+ "change"
101
+ ], ["update:modelValue"]),
102
+ setup(a, { expose: o, emit: A }) {
103
+ let j = a, M = v(a, "modelValue"), N = A, P = {
104
+ xs: "px-2 py-1 text-xs",
105
+ xsmall: "px-3 py-1.5 text-base",
106
+ small: "px-4 py-2 text-base",
107
+ medium: "px-4 py-2 text-base",
108
+ normal: "px-5 py-2.5 text-base",
109
+ large: "px-6 py-3 text-lg"
110
+ }, F = {
111
+ xs: "h-15",
112
+ xsmall: "min-h-40",
113
+ small: "min-h-40",
114
+ medium: "h-30",
115
+ normal: "min-h-40",
116
+ large: "h-60"
87
117
  }, I = _(), L = g(), R = y(), z = e(() => ({
88
118
  class: L.class,
89
119
  style: L.style
90
120
  })), B = e(() => {
91
121
  let { class: e, style: t, ...n } = L;
92
122
  return n;
93
- }), V = f(null), H = f(!1), U = e(() => !!N.label || !!R["label-icon"] || !!R["label-extra"]), W = e(() => U.value ? void 0 : L["aria-label"] ?? L.placeholder), G = e(() => !!N.errorMsg || N.invalid), K = e(() => N.rows ?? 4), q = e(() => (P.value ?? "").length), J = e(() => N.maxlength !== void 0 && q.value >= N.maxlength), Y = e(() => [
123
+ }), V = f(null), H = f(!1), U = e(() => !!j.label || !!R["label-icon"] || !!R["label-extra"]), W = e(() => U.value ? void 0 : L["aria-label"] ?? j.placeholder), G = f(""), K = e(() => G.value || j.errorMsg), q = e(() => !!K.value || j.invalid), J = e(() => j.size in P ? j.size : "normal"), Y = e(() => {
124
+ let e = !j.disabled;
125
+ return j.variant === "soft" ? q.value ? `border-transparent bg-danger/5 focus:bg-danger/10 ${O}` : [
126
+ "border-transparent bg-accent focus:bg-accent-hover",
127
+ k,
128
+ e && "hover:bg-accent-hover"
129
+ ] : j.variant === "ghost" ? q.value ? `border-transparent bg-transparent focus:bg-danger/5 ${O}` : `border-transparent bg-transparent focus:bg-accent-hover ${k}` : j.variant === "none" ? ["border-transparent bg-transparent", q.value && "text-danger-strong"] : [q.value && j.plainError ? "bg-transparent" : j.readonly ? "bg-surface-muted" : "bg-background", q.value ? `border-danger/50 focus:border-danger ${O}` : ["border-border focus:focus-ring", e && "hover:border-accent-active"]];
130
+ }), X = e(() => j.rows ?? 4), Z = e(() => (M.value ?? "").length), re = e(() => j.maxlength !== void 0 && Z.value >= j.maxlength), ie = e(() => [
94
131
  L["aria-describedby"],
95
- N.hint && `${I}-hint`,
96
- N.errorMsg && `${I}-msg`,
97
- N.maxlength !== void 0 && `${I}-count`
132
+ j.hint && `${I}-hint`,
133
+ K.value && `${I}-msg`,
134
+ j.maxlength !== void 0 && `${I}-count`
98
135
  ].filter(Boolean).join(" ") || void 0);
99
- function X() {
136
+ function Q(e) {
137
+ j.requiredMessage && (G.value = e.target.value === "" ? j.requiredMessage : "");
138
+ }
139
+ function ae(e) {
140
+ Q(e), j.silentWhenEmpty && G.value || N("input", e);
141
+ }
142
+ function oe(e) {
143
+ Q(e), j.silentWhenEmpty && G.value || N("focusout", e);
144
+ }
145
+ function $() {
100
146
  let e = V.value;
101
- if (!e || !N.autoResize) return;
102
- let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = K.value * n + r, a = N.maxRows > 0 ? N.maxRows * n + r : Infinity;
147
+ if (!e || !j.autoResize) return;
148
+ let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = X.value * n + r, a = j.maxRows > 0 ? j.maxRows * n + r : Infinity;
103
149
  e.style.height = "auto";
104
150
  let o = e.scrollHeight + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth);
105
151
  e.style.height = `${Math.min(Math.max(o, i), a)}px`, H.value = o > a;
106
152
  }
107
- return x(P, () => c(X)), x(() => [
108
- N.autoResize,
109
- N.rows,
110
- N.maxRows
153
+ return x(M, () => c($)), x(() => [
154
+ j.autoResize,
155
+ j.rows,
156
+ j.maxRows
111
157
  ], () => {
112
- !N.autoResize && V.value && (V.value.style.height = ""), c(X);
113
- }), u(X), o({ focus: () => V.value?.focus() }), (e, o) => (d(), n("div", s(z.value, {
158
+ !j.autoResize && V.value && (V.value.style.height = ""), c($);
159
+ }), u($), o({ focus: () => V.value?.focus() }), (e, o) => (d(), n("div", s(z.value, {
114
160
  class: ["w-full", a.disabled && "opacity-50"],
115
161
  "data-ac-ds": "",
116
162
  "data-testid": "ac-textarea"
@@ -118,56 +164,70 @@ var C = ["for"], w = { key: 0 }, T = {
118
164
  U.value ? (d(), n("label", {
119
165
  key: 0,
120
166
  for: h(I),
121
- class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
167
+ class: l(["mb-2 flex items-center text-base font-medium text-heading", !a.flushLabelSlots && "gap-1"])
122
168
  }, [
123
169
  p(e.$slots, "label-icon"),
124
- a.label ? (d(), n("span", w, m(a.label), 1)) : t("", !0),
125
- a.readonly ? (d(), n("span", T, "(read only)")) : t("", !0),
170
+ a.label ? (d(), n("span", C, m(a.label), 1)) : t("", !0),
171
+ a.readonly ? (d(), n("span", {
172
+ key: 1,
173
+ class: l(["text-muted", a.flushLabelSlots && "ml-1"])
174
+ }, m(a.readonlyText), 3)) : t("", !0),
126
175
  p(e.$slots, "label-extra"),
127
- a.required || a.requiredMark ? (d(), n("span", E, "*")) : t("", !0)
128
- ], 8, C)) : t("", !0),
176
+ a.required || a.requiredMark ? (d(), n("span", {
177
+ key: 2,
178
+ class: l(["text-danger", a.flushLabelSlots && "ml-1"]),
179
+ "aria-hidden": "true"
180
+ }, "*", 2)) : t("", !0)
181
+ ], 10, ee)) : t("", !0),
129
182
  a.hint ? (d(), n("p", {
130
183
  key: 1,
131
184
  id: `${h(I)}-hint`,
132
185
  class: "mb-2 text-base text-muted"
133
- }, m(a.hint), 9, D)) : t("", !0),
186
+ }, m(a.hint), 9, w)) : t("", !0),
134
187
  S(r("textarea", s({
135
188
  id: h(I),
136
189
  ref_key: "field",
137
190
  ref: V
138
191
  }, B.value, {
139
- "onUpdate:modelValue": o[0] ||= (e) => P.value = e,
192
+ "onUpdate:modelValue": o[0] ||= (e) => M.value = e,
140
193
  name: a.name,
141
- rows: K.value,
194
+ placeholder: a.placeholder,
195
+ rows: X.value,
142
196
  maxlength: a.maxlength,
143
197
  disabled: a.disabled,
144
198
  readonly: a.readonly,
145
199
  required: a.required,
146
200
  "aria-label": W.value,
147
- "aria-invalid": G.value || void 0,
148
- "aria-describedby": Y.value,
149
- class: ["block w-full rounded-10 border text-base text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
150
- F[a.size] ?? F.normal,
151
- a.readonly ? "bg-surface-muted" : "bg-background",
152
- a.rows === void 0 && !a.inputClass && "min-h-40",
201
+ "aria-invalid": q.value || void 0,
202
+ "aria-describedby": ie.value,
203
+ class: ["block w-full rounded-10 border text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
204
+ P[J.value],
205
+ a.rows === void 0 && !a.inputClass && !a.autoResize && F[J.value],
206
+ a.rows === void 0 && !a.inputClass && a.autoResize && "min-h-40",
153
207
  a.mono ? "font-mono text-xs leading-5 font-normal" : "font-medium",
154
208
  a.autoResize ? H.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
155
- G.value ? "border-danger/50 focus:border-danger focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus:focus-ring", !a.disabled && "hover:border-accent-active"],
209
+ Y.value,
210
+ a.highlight && "ring-2 ring-primary/20 ring-offset-2 ring-offset-surface",
156
211
  a.inputClass
157
- ]]
158
- }), null, 16, O), [[b, P.value]]),
159
- a.errorMsg || a.maxlength !== void 0 ? (d(), n("div", k, [a.errorMsg ? (d(), n("p", {
212
+ ]],
213
+ onInput: ae,
214
+ onFocusout: oe,
215
+ onFocus: o[1] ||= (e) => N("focus", e),
216
+ onBlur: o[2] ||= (e) => N("blur", e),
217
+ onChange: o[3] ||= (e) => N("change", e)
218
+ }), null, 16, T), [[b, M.value]]),
219
+ K.value || a.maxlength !== void 0 ? (d(), n("div", E, [K.value ? (d(), n("p", {
160
220
  key: 0,
161
221
  id: `${h(I)}-msg`,
162
- class: "min-w-0 flex-1 text-base text-danger-strong",
222
+ class: l(["min-w-0 flex-1 text-base", a.plainError ? "text-danger" : "text-danger-strong"]),
163
223
  role: "alert"
164
- }, m(a.errorMsg), 9, A)) : (d(), n("span", j)), a.maxlength === void 0 ? t("", !0) : (d(), n("p", {
224
+ }, m(K.value), 11, te)) : (d(), n("span", ne)), a.maxlength === void 0 ? t("", !0) : (d(), n("p", {
165
225
  key: 2,
166
226
  id: `${h(I)}-count`,
167
- class: l(["shrink-0 text-xs tabular-nums", J.value ? "font-medium text-danger-strong" : "text-muted"])
168
- }, [o[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(m(q.value) + " / " + m(a.maxlength), 1)], 10, M))])) : t("", !0)
227
+ class: l(["shrink-0 text-xs tabular-nums", re.value ? "font-medium text-danger-strong" : "text-muted"])
228
+ }, [o[4] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(m(Z.value) + " / " + m(a.maxlength), 1)], 10, D))])) : t("", !0)
169
229
  ], 16));
170
230
  }
171
231
  });
172
232
  //#endregion
173
- export { N as default };
233
+ export { A as default };
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  export interface Props {
2
3
  /** Label above the field. Doubles as the accessible name of the trigger and the popover. */
3
4
  label?: string;
@@ -23,12 +24,16 @@ export interface Props {
23
24
  errorMsg?: string;
24
25
  /** Help text between the label and the field. */
25
26
  hint?: string;
26
- /** `small` 36px or `normal` 42px tall, the same as `AcInput`. */
27
- size?: "small" | "normal";
27
+ /** `small` 36px or `normal` 42px tall, the same as `AcInput`; `large` is cloud-ui's 50px date field with 16px medium text. */
28
+ size?: "small" | "normal" | "large";
28
29
  /** Adds a hidden input with this name so plain form posts include the value. */
29
30
  name?: string;
30
31
  /** Draws the hour and minute columns in place, with no field, popover or border. Each click updates `v-model` at once. */
31
32
  inline?: boolean;
33
+ /** `string` keeps `"HH:mm"`; `date` keeps a `Date` and changes only its hours and minutes, starting from today when empty. */
34
+ valueType?: "string" | "date";
35
+ /** Classes for the field box under the label, e.g. `max-w-md` to keep it narrower than the hint. */
36
+ fieldClass?: HTMLAttributes["class"];
32
37
  }
33
38
  type __VLS_Props = Props;
34
39
  type __VLS_Slots = {
@@ -39,8 +44,8 @@ type __VLS_Slots = {
39
44
  };
40
45
  declare function scrollToSelected(): Promise<void>;
41
46
  type __VLS_ModelProps = {
42
- /** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour. `null` when empty. */
43
- modelValue?: string | null;
47
+ /** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour; a `Date` with `value-type="date"`. `null` when empty. */
48
+ modelValue?: string | Date | null;
44
49
  /** Whether the popover is open. */
45
50
  "open"?: boolean;
46
51
  };
@@ -51,10 +56,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
51
56
  /** Scrolls each column to its selected value. Call it when an `inline` picker becomes visible, e.g. on a tab switch. */
52
57
  scrollToSelected: typeof scrollToSelected;
53
58
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
- "update:modelValue": (value: string | null) => any;
59
+ "update:modelValue": (value: string | Date | null) => any;
55
60
  "update:open": (value: boolean) => any;
56
61
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
57
- "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
62
+ "onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
58
63
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
59
64
  }>, {
60
65
  required: boolean;
@@ -63,14 +68,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
63
68
  max: string;
64
69
  min: string;
65
70
  name: string;
66
- size: "small" | "normal";
71
+ size: "small" | "normal" | "large";
67
72
  hint: string;
68
73
  inline: boolean;
69
74
  placeholder: string;
70
- clearable: boolean;
71
75
  errorMsg: string;
76
+ clearable: boolean;
72
77
  showSeconds: boolean;
73
78
  hourCycle: 12 | 24;
79
+ valueType: "string" | "date";
80
+ fieldClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
74
81
  minuteStep: number;
75
82
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
76
83
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;