@ac-design/design-system 2.3.0 → 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 +211 -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 +7 -1
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
- 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 +3 -3
- 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 +14 -7
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
- 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/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/AcInput.vue.d.ts +75 -54
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
- 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/AcMapChart.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue.d.ts +1 -1
- 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.vue.d.ts +2 -2
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +35 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
- package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
- 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 +37 -4
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
- package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
- 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 +38 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
- package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
- package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/composables/useToast.d.ts +2 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +31 -30
- package/package.json +1 -1
|
@@ -1,17 +1,12 @@
|
|
|
1
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
|
|
3
|
-
import { Eye as
|
|
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";
|
|
4
4
|
//#region src/lib/components/AcInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
-
key: 1,
|
|
7
|
-
class: "text-muted"
|
|
8
|
-
}, D = {
|
|
9
|
-
key: 2,
|
|
10
|
-
class: "text-danger",
|
|
11
|
-
"aria-hidden": "true"
|
|
12
|
-
}, O = ["id"], ee = { class: "flex" }, k = [
|
|
5
|
+
var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
|
|
13
6
|
"id",
|
|
14
7
|
"name",
|
|
8
|
+
"placeholder",
|
|
9
|
+
"autocomplete",
|
|
15
10
|
"type",
|
|
16
11
|
"disabled",
|
|
17
12
|
"readonly",
|
|
@@ -19,21 +14,23 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
19
14
|
"aria-label",
|
|
20
15
|
"aria-invalid",
|
|
21
16
|
"aria-describedby"
|
|
22
|
-
],
|
|
17
|
+
], ie = [
|
|
23
18
|
"disabled",
|
|
24
19
|
"aria-label",
|
|
25
20
|
"aria-pressed",
|
|
26
21
|
"aria-busy"
|
|
27
|
-
],
|
|
22
|
+
], T = [
|
|
28
23
|
"disabled",
|
|
29
24
|
"aria-label",
|
|
30
25
|
"title"
|
|
31
|
-
],
|
|
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({
|
|
32
27
|
inheritAttrs: !1,
|
|
33
28
|
__name: "AcInput",
|
|
34
29
|
props: /*@__PURE__*/ s({
|
|
35
30
|
label: { default: "" },
|
|
36
31
|
name: { default: "" },
|
|
32
|
+
placeholder: { default: void 0 },
|
|
33
|
+
autocomplete: { default: void 0 },
|
|
37
34
|
type: { default: "text" },
|
|
38
35
|
required: {
|
|
39
36
|
type: Boolean,
|
|
@@ -43,6 +40,11 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
43
40
|
type: Boolean,
|
|
44
41
|
default: !1
|
|
45
42
|
},
|
|
43
|
+
requiredMessage: { default: "" },
|
|
44
|
+
silentWhenEmpty: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
46
48
|
disabled: {
|
|
47
49
|
type: Boolean,
|
|
48
50
|
default: !1
|
|
@@ -51,6 +53,27 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
51
53
|
type: Boolean,
|
|
52
54
|
default: !1
|
|
53
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
|
+
},
|
|
54
77
|
errorMsg: { default: "" },
|
|
55
78
|
invalid: {
|
|
56
79
|
type: Boolean,
|
|
@@ -58,6 +81,11 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
58
81
|
},
|
|
59
82
|
hint: { default: "" },
|
|
60
83
|
size: { default: "normal" },
|
|
84
|
+
variant: { default: "outline" },
|
|
85
|
+
highlight: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !1
|
|
88
|
+
},
|
|
61
89
|
inputClass: {
|
|
62
90
|
type: [
|
|
63
91
|
Boolean,
|
|
@@ -68,10 +96,18 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
68
96
|
],
|
|
69
97
|
default: void 0
|
|
70
98
|
},
|
|
99
|
+
numberAsString: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
71
103
|
revealing: {
|
|
72
104
|
type: Boolean,
|
|
73
105
|
default: !1
|
|
74
106
|
},
|
|
107
|
+
reveal: {
|
|
108
|
+
type: Function,
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
75
111
|
addonLabel: { default: "" },
|
|
76
112
|
addonIcon: { default: void 0 },
|
|
77
113
|
addonIconOnly: {
|
|
@@ -87,134 +123,262 @@ var w = ["for"], T = { key: 0 }, E = {
|
|
|
87
123
|
},
|
|
88
124
|
showValueModifiers: {}
|
|
89
125
|
}),
|
|
90
|
-
emits: /*@__PURE__*/ s([
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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;
|
|
97
142
|
return n;
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
].filter(Boolean).join(" ") || void 0),
|
|
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",
|
|
103
149
|
xsmall: "h-8.5",
|
|
104
150
|
small: "h-9",
|
|
105
|
-
|
|
106
|
-
|
|
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",
|
|
107
163
|
xsmall: "w-8.5",
|
|
108
164
|
small: "w-9",
|
|
109
|
-
|
|
110
|
-
|
|
165
|
+
medium: "w-9.5",
|
|
166
|
+
normal: "w-10.5",
|
|
167
|
+
large: "w-12.5"
|
|
168
|
+
}, ue = {
|
|
169
|
+
xs: "pl-2",
|
|
111
170
|
xsmall: "pl-3",
|
|
112
171
|
small: "pl-4",
|
|
113
|
-
|
|
114
|
-
|
|
172
|
+
medium: "pl-4",
|
|
173
|
+
normal: "pl-5",
|
|
174
|
+
large: "pl-6"
|
|
175
|
+
}, de = {
|
|
176
|
+
xs: "pr-2",
|
|
115
177
|
xsmall: "pr-3",
|
|
116
178
|
small: "pr-4",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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 : "");
|
|
242
|
+
}
|
|
243
|
+
function be(e) {
|
|
244
|
+
$(e), A.silentWhenEmpty && B.value || N("input", e);
|
|
121
245
|
}
|
|
122
|
-
|
|
123
|
-
|
|
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"],
|
|
124
264
|
"data-ac-ds": "",
|
|
125
265
|
"data-testid": "ac-input"
|
|
126
266
|
}), [
|
|
127
|
-
|
|
267
|
+
U.value ? (u(), i("label", {
|
|
128
268
|
key: 0,
|
|
129
|
-
for: h(
|
|
130
|
-
class: "mb-2 flex items-center
|
|
269
|
+
for: h(P),
|
|
270
|
+
class: l(["mb-2 flex items-center text-base font-medium text-heading", !o.flushLabelSlots && "gap-1"])
|
|
131
271
|
}, [
|
|
132
272
|
f(t.$slots, "label-icon"),
|
|
133
|
-
o.label ? (u(), i("span",
|
|
134
|
-
o.readonly ? (u(), i("span",
|
|
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),
|
|
135
278
|
f(t.$slots, "label-extra"),
|
|
136
|
-
o.required || o.requiredMark ? (u(), i("span",
|
|
137
|
-
|
|
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),
|
|
138
285
|
o.hint ? (u(), i("p", {
|
|
139
286
|
key: 1,
|
|
140
|
-
id: `${h(
|
|
287
|
+
id: `${h(P)}-hint`,
|
|
141
288
|
class: "mb-2 text-base text-muted"
|
|
142
|
-
}, m(o.hint), 9,
|
|
143
|
-
a("div",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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"
|
|
148
295
|
]]) }, [
|
|
149
|
-
t.$slots.prefix ? (u(), i("span", {
|
|
296
|
+
t.$slots.prefix && o.prefixOverlay ? (u(), i("span", {
|
|
150
297
|
key: 0,
|
|
151
|
-
class: l(["
|
|
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", {
|
|
300
|
+
key: 1,
|
|
301
|
+
class: l(["flex h-full shrink-0 items-center text-base whitespace-nowrap text-muted select-none [&_svg]:size-4", fe[Z.value]])
|
|
152
302
|
}, [f(t.$slots, "prefix")], 2)) : r("", !0),
|
|
153
|
-
|
|
154
|
-
id: h(
|
|
303
|
+
ne(a("input", c({
|
|
304
|
+
id: h(P),
|
|
155
305
|
ref_key: "input",
|
|
156
|
-
ref:
|
|
157
|
-
},
|
|
158
|
-
"onUpdate:modelValue": s[0] ||= (e) =>
|
|
306
|
+
ref: z
|
|
307
|
+
}, R.value, {
|
|
308
|
+
"onUpdate:modelValue": s[0] ||= (e) => Q.value = e,
|
|
159
309
|
name: o.name,
|
|
310
|
+
placeholder: o.placeholder,
|
|
311
|
+
autocomplete: o.autocomplete,
|
|
160
312
|
type: J.value,
|
|
161
313
|
disabled: o.disabled,
|
|
162
314
|
readonly: o.readonly,
|
|
163
315
|
required: o.required,
|
|
164
|
-
"aria-label":
|
|
165
|
-
"aria-invalid":
|
|
166
|
-
"aria-describedby":
|
|
167
|
-
class: ["block
|
|
168
|
-
|
|
169
|
-
|
|
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],
|
|
170
326
|
o.inputClass
|
|
171
|
-
]]
|
|
172
|
-
|
|
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]]),
|
|
173
336
|
t.$slots.suffix ? (u(), i("span", {
|
|
174
|
-
key:
|
|
175
|
-
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" :
|
|
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]])
|
|
176
339
|
}, [f(t.$slots, "suffix")], 2)) : r("", !0),
|
|
177
340
|
o.type === "password" ? (u(), i("button", {
|
|
178
|
-
key:
|
|
341
|
+
key: 3,
|
|
179
342
|
type: "button",
|
|
180
|
-
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",
|
|
181
|
-
disabled:
|
|
182
|
-
"aria-label":
|
|
183
|
-
"aria-pressed":
|
|
184
|
-
"aria-busy":
|
|
185
|
-
onClick:
|
|
186
|
-
}, [
|
|
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, {
|
|
187
350
|
key: 0,
|
|
188
|
-
size:
|
|
351
|
+
size: Z.value === "normal" || Z.value === "large" ? "normal" : "small",
|
|
189
352
|
label: ""
|
|
190
|
-
}, null, 8, ["size"])) : (u(), n(p(
|
|
353
|
+
}, null, 8, ["size"])) : (u(), n(p(M.value ? h(b) : h(y)), {
|
|
191
354
|
key: 1,
|
|
192
|
-
class: l(
|
|
355
|
+
class: l(he[Z.value]),
|
|
193
356
|
"aria-hidden": "true"
|
|
194
|
-
}, null, 8, ["class"]))], 10,
|
|
195
|
-
], 2),
|
|
357
|
+
}, null, 8, ["class"]))], 10, ie)) : r("", !0)
|
|
358
|
+
], 2), Y.value ? (u(), i("button", {
|
|
196
359
|
key: 0,
|
|
197
360
|
type: "button",
|
|
198
|
-
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", [
|
|
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"]]),
|
|
199
362
|
disabled: o.disabled,
|
|
200
363
|
"aria-label": o.addonIconOnly ? o.addonLabel : void 0,
|
|
201
364
|
title: o.addonIconOnly ? o.addonLabel : void 0,
|
|
202
365
|
"data-ac-ds": "",
|
|
203
366
|
"data-testid": "ac-input-addon",
|
|
204
|
-
onClick:
|
|
367
|
+
onClick: ye
|
|
205
368
|
}, [o.addonIcon ? (u(), n(p(o.addonIcon), {
|
|
206
369
|
key: 0,
|
|
207
370
|
class: "size-4 text-muted",
|
|
208
371
|
"aria-hidden": "true"
|
|
209
|
-
})) : r("", !0), o.addonIconOnly ? r("", !0) : (u(), i("span",
|
|
210
|
-
|
|
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", {
|
|
211
374
|
key: 2,
|
|
212
|
-
id: `${h(
|
|
213
|
-
class: "mt-1 text-base text-danger-strong",
|
|
375
|
+
id: `${h(P)}-msg`,
|
|
376
|
+
class: l(["mt-1 text-base", o.plainError ? "text-danger" : "text-danger-strong"]),
|
|
214
377
|
role: "alert"
|
|
215
|
-
}, m(
|
|
378
|
+
}, m(G.value), 11, E)) : r("", !0),
|
|
379
|
+
f(t.$slots, "message")
|
|
216
380
|
], 16));
|
|
217
381
|
}
|
|
218
382
|
});
|
|
219
383
|
//#endregion
|
|
220
|
-
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
|
-
hint: string;
|
|
91
|
-
readonly: boolean;
|
|
92
|
-
options: SelectOption<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
|
+
}) & {};
|