@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.
- package/dist/lib/compat.css +421 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
- package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +25 -13
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
- package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
- package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
- package/dist/lib/components/AcColorInput.vue.d.ts +4 -4
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
- package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +41 -10
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
- package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +86 -44
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
- package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue.d.ts +1 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
- package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +46 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
- package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +2 -2
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcTable.vue.d.ts +50 -5
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
- package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
- package/dist/lib/components/AcTaintInput.js +5 -0
- package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
- package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +64 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +36 -11
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
- package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/composables/useToast.d.ts +2 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +51 -49
- package/package.json +1 -1
|
@@ -1,37 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import e from "./AcSpinner.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, normalizeClass as l, openBlock as u, ref as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, useSlots as ee, vModelDynamic as te, withDirectives as ne } from "vue";
|
|
3
|
+
import { Eye as y, EyeOff as b } from "@lucide/vue";
|
|
3
4
|
//#region src/lib/components/AcInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "text-muted"
|
|
7
|
-
}, T = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "text-danger",
|
|
10
|
-
"aria-hidden": "true"
|
|
11
|
-
}, E = ["id"], D = { class: "flex" }, O = [
|
|
5
|
+
var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
|
|
12
6
|
"id",
|
|
13
7
|
"name",
|
|
8
|
+
"placeholder",
|
|
9
|
+
"autocomplete",
|
|
14
10
|
"type",
|
|
15
11
|
"disabled",
|
|
16
12
|
"readonly",
|
|
17
13
|
"required",
|
|
14
|
+
"aria-label",
|
|
18
15
|
"aria-invalid",
|
|
19
16
|
"aria-describedby"
|
|
20
|
-
],
|
|
17
|
+
], ie = [
|
|
18
|
+
"disabled",
|
|
19
|
+
"aria-label",
|
|
20
|
+
"aria-pressed",
|
|
21
|
+
"aria-busy"
|
|
22
|
+
], T = [
|
|
21
23
|
"disabled",
|
|
22
24
|
"aria-label",
|
|
23
25
|
"title"
|
|
24
|
-
],
|
|
26
|
+
], ae = { key: 1 }, E = ["id"], D = "focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]", O = "focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-primary)_20%,transparent)]", k = /*@__PURE__*/ o({
|
|
25
27
|
inheritAttrs: !1,
|
|
26
28
|
__name: "AcInput",
|
|
27
|
-
props: /*@__PURE__*/
|
|
28
|
-
label: {},
|
|
29
|
+
props: /*@__PURE__*/ s({
|
|
30
|
+
label: { default: "" },
|
|
29
31
|
name: { default: "" },
|
|
32
|
+
placeholder: { default: void 0 },
|
|
33
|
+
autocomplete: { default: void 0 },
|
|
30
34
|
type: { default: "text" },
|
|
31
35
|
required: {
|
|
32
36
|
type: Boolean,
|
|
33
37
|
default: !1
|
|
34
38
|
},
|
|
39
|
+
requiredMark: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
requiredMessage: { default: "" },
|
|
44
|
+
silentWhenEmpty: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
35
48
|
disabled: {
|
|
36
49
|
type: Boolean,
|
|
37
50
|
default: !1
|
|
@@ -40,9 +53,61 @@ var C = ["for"], w = {
|
|
|
40
53
|
type: Boolean,
|
|
41
54
|
default: !1
|
|
42
55
|
},
|
|
56
|
+
readonlyText: { default: "(read only)" },
|
|
57
|
+
plainReadonly: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
plainDisabled: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
plainError: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
flushLabelSlots: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !1
|
|
72
|
+
},
|
|
73
|
+
prefixOverlay: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
43
77
|
errorMsg: { default: "" },
|
|
78
|
+
invalid: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: !1
|
|
81
|
+
},
|
|
44
82
|
hint: { default: "" },
|
|
45
83
|
size: { default: "normal" },
|
|
84
|
+
variant: { default: "outline" },
|
|
85
|
+
highlight: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !1
|
|
88
|
+
},
|
|
89
|
+
inputClass: {
|
|
90
|
+
type: [
|
|
91
|
+
Boolean,
|
|
92
|
+
null,
|
|
93
|
+
String,
|
|
94
|
+
Object,
|
|
95
|
+
Array
|
|
96
|
+
],
|
|
97
|
+
default: void 0
|
|
98
|
+
},
|
|
99
|
+
numberAsString: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
revealing: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !1
|
|
106
|
+
},
|
|
107
|
+
reveal: {
|
|
108
|
+
type: Function,
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
46
111
|
addonLabel: { default: "" },
|
|
47
112
|
addonIcon: { default: void 0 },
|
|
48
113
|
addonIconOnly: {
|
|
@@ -51,101 +116,269 @@ var C = ["for"], w = {
|
|
|
51
116
|
}
|
|
52
117
|
}, {
|
|
53
118
|
modelValue: { default: "" },
|
|
54
|
-
modelModifiers: {}
|
|
119
|
+
modelModifiers: {},
|
|
120
|
+
showValue: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !1
|
|
123
|
+
},
|
|
124
|
+
showValueModifiers: {}
|
|
55
125
|
}),
|
|
56
|
-
emits: /*@__PURE__*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
126
|
+
emits: /*@__PURE__*/ s([
|
|
127
|
+
"addon",
|
|
128
|
+
"focus",
|
|
129
|
+
"blur",
|
|
130
|
+
"focusout",
|
|
131
|
+
"input",
|
|
132
|
+
"change",
|
|
133
|
+
"keyup",
|
|
134
|
+
"keydown"
|
|
135
|
+
], ["update:modelValue", "update:showValue"]),
|
|
136
|
+
setup(o, { expose: s, emit: k }) {
|
|
137
|
+
let A = o, j = v(o, "modelValue"), M = v(o, "showValue"), N = k, P = _(), F = g(), I = ee(), L = t(() => ({
|
|
138
|
+
class: F.class,
|
|
139
|
+
style: F.style
|
|
140
|
+
})), R = t(() => {
|
|
141
|
+
let { class: e, style: t, ...n } = F;
|
|
63
142
|
return n;
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
143
|
+
}), z = d(null), B = d(""), V = d(!1), H = d(!1), U = t(() => !!A.label || !!I["label-icon"] || !!I["label-extra"]), W = t(() => U.value ? void 0 : F["aria-label"] ?? A.placeholder), G = t(() => B.value || A.errorMsg), K = t(() => !!G.value || A.invalid), q = t(() => A.revealing || V.value), J = t(() => A.type === "password" && M.value ? "text" : A.type), oe = t(() => [
|
|
144
|
+
F["aria-describedby"],
|
|
145
|
+
A.hint && `${P}-hint`,
|
|
146
|
+
G.value && `${P}-msg`
|
|
147
|
+
].filter(Boolean).join(" ") || void 0), Y = t(() => !!A.addonLabel || !!A.addonIcon), se = t(() => !!I.suffix || A.type === "password"), X = {
|
|
148
|
+
xs: "h-6.5",
|
|
149
|
+
xsmall: "h-8.5",
|
|
150
|
+
small: "h-9",
|
|
151
|
+
medium: "h-9.5",
|
|
152
|
+
normal: "h-10.5",
|
|
153
|
+
large: "h-12.5"
|
|
154
|
+
}, ce = {
|
|
155
|
+
xs: "h-6",
|
|
156
|
+
xsmall: "h-8",
|
|
157
|
+
small: "h-8.5",
|
|
158
|
+
medium: "h-9",
|
|
159
|
+
normal: "h-10",
|
|
160
|
+
large: "h-12"
|
|
161
|
+
}, le = {
|
|
162
|
+
xs: "w-6.5",
|
|
163
|
+
xsmall: "w-8.5",
|
|
164
|
+
small: "w-9",
|
|
165
|
+
medium: "w-9.5",
|
|
166
|
+
normal: "w-10.5",
|
|
167
|
+
large: "w-12.5"
|
|
168
|
+
}, ue = {
|
|
169
|
+
xs: "pl-2",
|
|
170
|
+
xsmall: "pl-3",
|
|
171
|
+
small: "pl-4",
|
|
172
|
+
medium: "pl-4",
|
|
173
|
+
normal: "pl-5",
|
|
174
|
+
large: "pl-6"
|
|
175
|
+
}, de = {
|
|
176
|
+
xs: "pr-2",
|
|
177
|
+
xsmall: "pr-3",
|
|
178
|
+
small: "pr-4",
|
|
179
|
+
medium: "pr-4",
|
|
180
|
+
normal: "pr-5",
|
|
181
|
+
large: "pr-6"
|
|
182
|
+
}, fe = {
|
|
183
|
+
xs: "pl-2",
|
|
184
|
+
xsmall: "pl-3",
|
|
185
|
+
small: "pl-3",
|
|
186
|
+
medium: "pl-3",
|
|
187
|
+
normal: "pl-4",
|
|
188
|
+
large: "pl-5"
|
|
189
|
+
}, pe = {
|
|
190
|
+
xs: "pr-2",
|
|
191
|
+
xsmall: "pr-3",
|
|
192
|
+
small: "pr-3",
|
|
193
|
+
medium: "pr-3",
|
|
194
|
+
normal: "pr-4",
|
|
195
|
+
large: "pr-5"
|
|
196
|
+
}, me = {
|
|
197
|
+
xs: "mr-2",
|
|
198
|
+
xsmall: "mr-3",
|
|
199
|
+
small: "mr-3",
|
|
200
|
+
medium: "mr-3",
|
|
201
|
+
normal: "mr-4",
|
|
202
|
+
large: "mr-5"
|
|
203
|
+
}, he = {
|
|
204
|
+
xs: "size-3",
|
|
205
|
+
xsmall: "size-4",
|
|
206
|
+
small: "size-4",
|
|
207
|
+
medium: "size-4",
|
|
208
|
+
normal: "size-5",
|
|
209
|
+
large: "size-6"
|
|
210
|
+
}, ge = {
|
|
211
|
+
xs: "text-xs",
|
|
212
|
+
xsmall: "text-base",
|
|
213
|
+
small: "text-base",
|
|
214
|
+
medium: "text-base",
|
|
215
|
+
normal: "text-base",
|
|
216
|
+
large: "text-lg"
|
|
217
|
+
}, _e = {
|
|
218
|
+
xs: "left-[7px] size-3",
|
|
219
|
+
xsmall: "left-[9px] size-3",
|
|
220
|
+
small: "left-[11px] size-4",
|
|
221
|
+
medium: "left-[11px] size-4",
|
|
222
|
+
normal: "left-[15px] size-5",
|
|
223
|
+
large: "left-[19px] size-6"
|
|
224
|
+
}, Z = t(() => A.size in X ? A.size : "normal"), ve = t(() => {
|
|
225
|
+
let e = A.variant, t = !A.disabled || A.plainDisabled;
|
|
226
|
+
return e === "soft" ? K.value ? `border-transparent bg-danger/5 focus-within:bg-danger/10 ${D}` : [
|
|
227
|
+
"border-transparent bg-accent focus-within:bg-accent-hover",
|
|
228
|
+
O,
|
|
229
|
+
t && "hover:bg-accent-hover"
|
|
230
|
+
] : e === "ghost" ? K.value ? `border-transparent bg-transparent focus-within:bg-danger/5 ${D}` : `border-transparent bg-transparent focus-within:bg-accent-hover ${O}` : e === "none" ? "border-0 bg-transparent" : [K.value && A.plainError ? "bg-transparent" : A.readonly && !A.plainReadonly ? "bg-surface-muted" : "bg-background", K.value ? `border-danger/50 focus-within:border-danger ${D}` : ["border-border focus-within:focus-ring", t && "hover:border-accent-active"]];
|
|
231
|
+
}), Q = t({
|
|
232
|
+
get: () => j.value,
|
|
233
|
+
set: (e) => {
|
|
234
|
+
j.value = A.numberAsString ? e == null ? "" : String(e) : e;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
function ye(e) {
|
|
238
|
+
A.disabled || N("addon", e);
|
|
239
|
+
}
|
|
240
|
+
function $(e) {
|
|
241
|
+
A.requiredMessage && (B.value = e.target.value === "" ? A.requiredMessage : "");
|
|
67
242
|
}
|
|
68
|
-
|
|
69
|
-
|
|
243
|
+
function be(e) {
|
|
244
|
+
$(e), A.silentWhenEmpty && B.value || N("input", e);
|
|
245
|
+
}
|
|
246
|
+
function xe(e) {
|
|
247
|
+
$(e), A.silentWhenEmpty && B.value || N("focusout", e);
|
|
248
|
+
}
|
|
249
|
+
async function Se() {
|
|
250
|
+
if (A.reveal && !M.value && !H.value && !j.value) {
|
|
251
|
+
if (V.value) return;
|
|
252
|
+
V.value = !0;
|
|
253
|
+
try {
|
|
254
|
+
j.value = await A.reveal(), H.value = !0, M.value = !0;
|
|
255
|
+
} catch {} finally {
|
|
256
|
+
V.value = !1;
|
|
257
|
+
}
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
M.value = !M.value;
|
|
261
|
+
}
|
|
262
|
+
return s({ focus: () => z.value?.focus() }), (t, s) => (u(), i("div", c(L.value, {
|
|
263
|
+
class: ["w-full", o.disabled && !o.plainDisabled && "opacity-50"],
|
|
70
264
|
"data-ac-ds": "",
|
|
71
265
|
"data-testid": "ac-input"
|
|
72
266
|
}), [
|
|
73
|
-
i("label", {
|
|
74
|
-
for: m(L),
|
|
75
|
-
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
76
|
-
}, [
|
|
77
|
-
i("span", null, p(a.label), 1),
|
|
78
|
-
a.readonly ? (l(), r("span", w, "(read only)")) : n("", !0),
|
|
79
|
-
a.required ? (l(), r("span", T, "*")) : n("", !0)
|
|
80
|
-
], 8, C),
|
|
81
|
-
a.hint ? (l(), r("p", {
|
|
267
|
+
U.value ? (u(), i("label", {
|
|
82
268
|
key: 0,
|
|
83
|
-
|
|
269
|
+
for: h(P),
|
|
270
|
+
class: l(["mb-2 flex items-center text-base font-medium text-heading", !o.flushLabelSlots && "gap-1"])
|
|
271
|
+
}, [
|
|
272
|
+
f(t.$slots, "label-icon"),
|
|
273
|
+
o.label ? (u(), i("span", S, m(o.label), 1)) : r("", !0),
|
|
274
|
+
o.readonly ? (u(), i("span", {
|
|
275
|
+
key: 1,
|
|
276
|
+
class: l(["text-muted", o.flushLabelSlots && "ml-1"])
|
|
277
|
+
}, m(o.readonlyText), 3)) : r("", !0),
|
|
278
|
+
f(t.$slots, "label-extra"),
|
|
279
|
+
o.required || o.requiredMark ? (u(), i("span", {
|
|
280
|
+
key: 2,
|
|
281
|
+
class: l(["text-danger", o.flushLabelSlots && "ml-1"]),
|
|
282
|
+
"aria-hidden": "true"
|
|
283
|
+
}, "*", 2)) : r("", !0)
|
|
284
|
+
], 10, x)) : r("", !0),
|
|
285
|
+
o.hint ? (u(), i("p", {
|
|
286
|
+
key: 1,
|
|
287
|
+
id: `${h(P)}-hint`,
|
|
84
288
|
class: "mb-2 text-base text-muted"
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
289
|
+
}, m(o.hint), 9, C)) : r("", !0),
|
|
290
|
+
a("div", w, [a("div", { class: l(["relative flex min-w-0 flex-1 items-center border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
291
|
+
o.variant === "none" ? ce[Z.value] : X[Z.value],
|
|
292
|
+
Y.value ? "rounded-l-10" : "rounded-10",
|
|
293
|
+
ve.value,
|
|
294
|
+
o.highlight && "ring-2 ring-primary/20 ring-offset-2 ring-offset-surface"
|
|
91
295
|
]]) }, [
|
|
92
|
-
|
|
296
|
+
t.$slots.prefix && o.prefixOverlay ? (u(), i("span", {
|
|
93
297
|
key: 0,
|
|
94
|
-
class:
|
|
95
|
-
}, [
|
|
96
|
-
b(i("input", s({
|
|
97
|
-
id: m(L),
|
|
98
|
-
ref_key: "input",
|
|
99
|
-
ref: H
|
|
100
|
-
}, V.value, {
|
|
101
|
-
"onUpdate:modelValue": o[0] ||= (e) => F.value = e,
|
|
102
|
-
name: a.name,
|
|
103
|
-
type: W.value,
|
|
104
|
-
disabled: a.disabled,
|
|
105
|
-
readonly: a.readonly,
|
|
106
|
-
required: a.required,
|
|
107
|
-
"aria-invalid": !!a.errorMsg || void 0,
|
|
108
|
-
"aria-describedby": G.value,
|
|
109
|
-
class: ["block h-full w-full min-w-0 flex-1 rounded-10 bg-transparent text-base font-normal text-heading outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [e.$slots.prefix ? "pl-2" : a.size === "small" ? "pl-4" : "pl-5", q.value ? "pr-2" : a.size === "small" ? "pr-4" : "pr-5"]]
|
|
110
|
-
}), null, 16, O), [[y, F.value]]),
|
|
111
|
-
e.$slots.suffix ? (l(), r("span", {
|
|
298
|
+
class: l(["absolute top-1/2 block -translate-y-1/2 whitespace-nowrap text-muted select-none", _e[Z.value]])
|
|
299
|
+
}, [f(t.$slots, "prefix")], 2)) : t.$slots.prefix ? (u(), i("span", {
|
|
112
300
|
key: 1,
|
|
113
|
-
class:
|
|
114
|
-
}, [
|
|
115
|
-
a
|
|
301
|
+
class: l(["flex h-full shrink-0 items-center text-base whitespace-nowrap text-muted select-none [&_svg]:size-4", fe[Z.value]])
|
|
302
|
+
}, [f(t.$slots, "prefix")], 2)) : r("", !0),
|
|
303
|
+
ne(a("input", c({
|
|
304
|
+
id: h(P),
|
|
305
|
+
ref_key: "input",
|
|
306
|
+
ref: z
|
|
307
|
+
}, R.value, {
|
|
308
|
+
"onUpdate:modelValue": s[0] ||= (e) => Q.value = e,
|
|
309
|
+
name: o.name,
|
|
310
|
+
placeholder: o.placeholder,
|
|
311
|
+
autocomplete: o.autocomplete,
|
|
312
|
+
type: J.value,
|
|
313
|
+
disabled: o.disabled,
|
|
314
|
+
readonly: o.readonly,
|
|
315
|
+
required: o.required,
|
|
316
|
+
"aria-label": W.value,
|
|
317
|
+
"aria-invalid": K.value || void 0,
|
|
318
|
+
"aria-describedby": oe.value,
|
|
319
|
+
class: ["block w-full min-w-0 flex-1 rounded-10 bg-transparent font-normal outline-none placeholder:text-muted/80", [
|
|
320
|
+
!o.plainDisabled && "disabled:cursor-not-allowed",
|
|
321
|
+
o.type === "file" ? "h-auto" : "h-full",
|
|
322
|
+
ge[Z.value],
|
|
323
|
+
o.variant === "none" && K.value ? "text-danger-strong" : "text-heading",
|
|
324
|
+
t.$slots.prefix ? o.prefixOverlay ? "pl-10" : "pl-2" : ue[Z.value],
|
|
325
|
+
se.value ? "pr-2" : de[Z.value],
|
|
326
|
+
o.inputClass
|
|
327
|
+
]],
|
|
328
|
+
onInput: be,
|
|
329
|
+
onFocusout: xe,
|
|
330
|
+
onFocus: s[1] ||= (e) => N("focus", e),
|
|
331
|
+
onBlur: s[2] ||= (e) => N("blur", e),
|
|
332
|
+
onChange: s[3] ||= (e) => N("change", e),
|
|
333
|
+
onKeyup: s[4] ||= (e) => N("keyup", e),
|
|
334
|
+
onKeydown: s[5] ||= (e) => N("keydown", e)
|
|
335
|
+
}), null, 16, re), [[te, Q.value]]),
|
|
336
|
+
t.$slots.suffix ? (u(), i("span", {
|
|
116
337
|
key: 2,
|
|
338
|
+
class: l(["relative flex h-full shrink-0 items-center text-base whitespace-nowrap text-muted select-none [&_svg]:size-4", o.type === "password" ? "pr-2" : pe[Z.value]])
|
|
339
|
+
}, [f(t.$slots, "suffix")], 2)) : r("", !0),
|
|
340
|
+
o.type === "password" ? (u(), i("button", {
|
|
341
|
+
key: 3,
|
|
117
342
|
type: "button",
|
|
118
|
-
class:
|
|
119
|
-
|
|
120
|
-
"aria-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
343
|
+
class: l(["relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition-colors hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-wait", me[Z.value]]),
|
|
344
|
+
disabled: q.value,
|
|
345
|
+
"aria-label": M.value ? "Hide value" : "Show value",
|
|
346
|
+
"aria-pressed": M.value,
|
|
347
|
+
"aria-busy": q.value || void 0,
|
|
348
|
+
onClick: Se
|
|
349
|
+
}, [q.value ? (u(), n(e, {
|
|
350
|
+
key: 0,
|
|
351
|
+
size: Z.value === "normal" || Z.value === "large" ? "normal" : "small",
|
|
352
|
+
label: ""
|
|
353
|
+
}, null, 8, ["size"])) : (u(), n(p(M.value ? h(b) : h(y)), {
|
|
354
|
+
key: 1,
|
|
355
|
+
class: l(he[Z.value]),
|
|
124
356
|
"aria-hidden": "true"
|
|
125
|
-
}, null, 8, ["class"]))], 10,
|
|
126
|
-
], 2),
|
|
357
|
+
}, null, 8, ["class"]))], 10, ie)) : r("", !0)
|
|
358
|
+
], 2), Y.value ? (u(), i("button", {
|
|
127
359
|
key: 0,
|
|
128
360
|
type: "button",
|
|
129
|
-
class:
|
|
130
|
-
disabled:
|
|
131
|
-
"aria-label":
|
|
132
|
-
title:
|
|
361
|
+
class: l(["relative -ml-px inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-r-10 border border-border bg-surface text-base font-medium whitespace-nowrap text-heading transition-colors duration-200 hover:bg-surface-sunken/70 focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:hover:bg-surface", [X[Z.value], o.addonIconOnly ? le[Z.value] : "px-4"]]),
|
|
362
|
+
disabled: o.disabled,
|
|
363
|
+
"aria-label": o.addonIconOnly ? o.addonLabel : void 0,
|
|
364
|
+
title: o.addonIconOnly ? o.addonLabel : void 0,
|
|
133
365
|
"data-ac-ds": "",
|
|
134
366
|
"data-testid": "ac-input-addon",
|
|
135
|
-
onClick:
|
|
136
|
-
}, [
|
|
367
|
+
onClick: ye
|
|
368
|
+
}, [o.addonIcon ? (u(), n(p(o.addonIcon), {
|
|
137
369
|
key: 0,
|
|
138
370
|
class: "size-4 text-muted",
|
|
139
371
|
"aria-hidden": "true"
|
|
140
|
-
})) :
|
|
141
|
-
|
|
142
|
-
key:
|
|
143
|
-
id: `${
|
|
144
|
-
class: "mt-1 text-base text-danger-strong",
|
|
372
|
+
})) : r("", !0), o.addonIconOnly ? r("", !0) : (u(), i("span", ae, m(o.addonLabel), 1))], 10, T)) : r("", !0)]),
|
|
373
|
+
G.value ? (u(), i("p", {
|
|
374
|
+
key: 2,
|
|
375
|
+
id: `${h(P)}-msg`,
|
|
376
|
+
class: l(["mt-1 text-base", o.plainError ? "text-danger" : "text-danger-strong"]),
|
|
145
377
|
role: "alert"
|
|
146
|
-
},
|
|
378
|
+
}, m(G.value), 11, E)) : r("", !0),
|
|
379
|
+
f(t.$slots, "message")
|
|
147
380
|
], 16));
|
|
148
381
|
}
|
|
149
382
|
});
|
|
150
383
|
//#endregion
|
|
151
|
-
export {
|
|
384
|
+
export { k as default };
|
|
@@ -54,61 +54,41 @@ export interface Props {
|
|
|
54
54
|
disabled?: boolean;
|
|
55
55
|
/** Shows the rows as read-only fields, without the Add and Remove buttons. */
|
|
56
56
|
readonly?: boolean;
|
|
57
|
+
/** Drops the column headers and the phone-width cards: rows stay side by side at every width, and each field's name is for screen readers only, as cloud-ui's key/value field. */
|
|
58
|
+
plain?: boolean;
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
declare const __VLS_export: <M extends KeyValueItem[] | Record<string, string> = KeyValueItem[]>(__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<{
|
|
61
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props & {
|
|
62
|
+
/** The rows, empty ones included, in order. Replaced with a new array on every change; drop rows with an empty key before saving. Bind a `Record<string, string>` instead to get a map of the rows that have a key; a repeated key keeps the last value. */
|
|
63
|
+
modelValue?: M;
|
|
64
|
+
}) & {
|
|
65
|
+
"onUpdate:modelValue"?: ((value: M) => any) | undefined;
|
|
66
|
+
onAdd?: ((index: number) => any) | undefined;
|
|
67
|
+
onRemove?: ((item: KeyValueItem, index: number) => any) | undefined;
|
|
68
|
+
}> & (typeof globalThis extends {
|
|
69
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
70
|
+
} ? P : {});
|
|
71
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
72
|
+
/** Adds an empty row and focuses its key. */
|
|
73
|
+
add: () => void;
|
|
74
|
+
/** Moves focus to the first key, or to the Add button when there are no rows. */
|
|
75
|
+
focus: () => void;
|
|
76
|
+
/** Whether any row shows an error (duplicate key, missing key, or a validator's message). Check it before saving. */
|
|
77
|
+
hasErrors: () => boolean;
|
|
78
|
+
}>) => void;
|
|
79
|
+
attrs: any;
|
|
80
|
+
slots: {
|
|
81
|
+
/** Content under the rows and above the Add button, e.g. a warning about `NoExecute` taints. */
|
|
82
|
+
footer?: () => unknown;
|
|
83
|
+
};
|
|
84
|
+
emit: (((evt: "add", index: number) => void) & ((evt: "remove", item: KeyValueItem, index: number) => void)) & ((event: "update:modelValue", value: M) => void);
|
|
85
|
+
}>) => import("vue").VNode & {
|
|
86
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
67
87
|
};
|
|
68
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
69
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
70
|
-
/** Adds an empty row and focuses its key. */
|
|
71
|
-
add: typeof add;
|
|
72
|
-
/** Moves focus to the first key, or to the Add button when there are no rows. */
|
|
73
|
-
focus: () => void;
|
|
74
|
-
/** Whether any row shows an error (duplicate key, missing key, or a validator's message). Check it before saving. */
|
|
75
|
-
hasErrors: () => boolean;
|
|
76
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
77
|
-
"update:modelValue": (value: KeyValueItem[]) => any;
|
|
78
|
-
add: (index: number) => any;
|
|
79
|
-
remove: (item: KeyValueItem, index: number) => any;
|
|
80
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
81
|
-
"onUpdate:modelValue"?: ((value: KeyValueItem[]) => any) | undefined;
|
|
82
|
-
onAdd?: ((index: number) => any) | undefined;
|
|
83
|
-
onRemove?: ((item: KeyValueItem, index: number) => any) | undefined;
|
|
84
|
-
}>, {
|
|
85
|
-
required: boolean;
|
|
86
|
-
label: string;
|
|
87
|
-
disabled: boolean;
|
|
88
|
-
max: number;
|
|
89
|
-
size: "small" | "normal";
|
|
90
|
-
readonly: boolean;
|
|
91
|
-
options: SelectOption<string>[];
|
|
92
|
-
hint: string;
|
|
93
|
-
errorMsg: string;
|
|
94
|
-
mono: boolean;
|
|
95
|
-
itemName: string;
|
|
96
|
-
addLabel: string;
|
|
97
|
-
keyLabel: string;
|
|
98
|
-
valueLabel: string;
|
|
99
|
-
keyPlaceholder: string;
|
|
100
|
-
valuePlaceholder: string;
|
|
101
|
-
optionLabel: string;
|
|
102
|
-
defaultOption: string;
|
|
103
|
-
validateKey: (key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
|
|
104
|
-
validateValue: (value: string, key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
|
|
105
|
-
allowDuplicateKeys: boolean;
|
|
106
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
107
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
108
88
|
declare const _default: typeof __VLS_export;
|
|
109
89
|
export default _default;
|
|
110
|
-
type
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
};
|
|
90
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
91
|
+
[K in keyof T]: T[K];
|
|
92
|
+
} : {
|
|
93
|
+
[K in keyof T as K]: T[K];
|
|
94
|
+
}) & {};
|