@ac-design/design-system 1.0.2 → 2.0.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/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +69 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/lib/charts/index.d.ts +7 -0
- package/dist/lib/charts/index.js +5 -0
- package/dist/lib/charts/shared.d.ts +60 -0
- package/dist/lib/charts/shared.js +114 -0
- package/dist/lib/charts/xy.d.ts +65 -0
- package/dist/lib/charts/xy.js +92 -0
- package/dist/lib/compat.css +1707 -1042
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcBadge.vue.d.ts +16 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +3 -3
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +10 -2
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
- package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
- package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcHeader.vue.d.ts +3 -3
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +3 -3
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +20 -3
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
- package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcProgress.vue.d.ts +2 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +4 -4
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
- package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
- package/dist/lib/components/index.d.ts +14 -2
- package/dist/lib/components/status.d.ts +26 -0
- package/dist/lib/components/status.js +110 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.js +95 -78
- package/dist/lib/theme.css +391 -272
- package/package.json +11 -4
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, nextTick as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, useAttrs as _, useId as ee, useModel as te, vModelText as ne, watch as re, withDirectives as ie, withModifiers as ae } from "vue";
|
|
2
|
+
import { CircleAlert as oe, Plus as se, X as v } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcTagInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var ce = ["for"], y = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-normal text-muted"
|
|
7
|
+
}, b = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "text-danger",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, x = ["aria-label"], S = ["title"], le = [
|
|
12
|
+
"aria-label",
|
|
13
|
+
"onClick",
|
|
14
|
+
"onKeydown"
|
|
15
|
+
], C = [
|
|
16
|
+
"id",
|
|
17
|
+
"name",
|
|
18
|
+
"placeholder",
|
|
19
|
+
"disabled",
|
|
20
|
+
"readonly",
|
|
21
|
+
"aria-invalid",
|
|
22
|
+
"aria-required",
|
|
23
|
+
"aria-describedby"
|
|
24
|
+
], ue = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "flex shrink-0 items-center gap-0.5 text-muted"
|
|
27
|
+
}, w = ["aria-label", "title"], T = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "mt-1.5 flex items-start gap-3"
|
|
30
|
+
}, E = {
|
|
31
|
+
class: "sr-only",
|
|
32
|
+
"aria-live": "polite"
|
|
33
|
+
}, D = /*@__PURE__*/ s({
|
|
34
|
+
inheritAttrs: !1,
|
|
35
|
+
__name: "AcTagInput",
|
|
36
|
+
props: /*@__PURE__*/ c({
|
|
37
|
+
label: {},
|
|
38
|
+
name: { default: "" },
|
|
39
|
+
placeholder: { default: "" },
|
|
40
|
+
hint: { default: "" },
|
|
41
|
+
errorMsg: { default: "" },
|
|
42
|
+
size: { default: "normal" },
|
|
43
|
+
maxItems: { default: void 0 },
|
|
44
|
+
allowDuplicates: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
validate: {
|
|
49
|
+
type: Function,
|
|
50
|
+
default: void 0
|
|
51
|
+
},
|
|
52
|
+
transform: {
|
|
53
|
+
type: Function,
|
|
54
|
+
default: (e) => e.trim()
|
|
55
|
+
},
|
|
56
|
+
showClear: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
addOnBlur: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
mono: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
required: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
disabled: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
readonly: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !1
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
modelValue: { default: () => [] },
|
|
82
|
+
modelModifiers: {}
|
|
83
|
+
}),
|
|
84
|
+
emits: /*@__PURE__*/ c([
|
|
85
|
+
"add",
|
|
86
|
+
"remove",
|
|
87
|
+
"clear"
|
|
88
|
+
], ["update:modelValue"]),
|
|
89
|
+
setup(s, { expose: c, emit: D }) {
|
|
90
|
+
let O = s, k = te(s, "modelValue"), A = D, j = /[\s,;]+/, de = /[,\n]+/, M = ee(), N = `${M}-hint`, P = `${M}-msg`, F = `${M}-count`, I = `${M}-help`, L = _(), R = t(() => ({
|
|
91
|
+
class: L.class,
|
|
92
|
+
style: L.style
|
|
93
|
+
})), z = t(() => {
|
|
94
|
+
let { class: e, style: t, ...n } = L;
|
|
95
|
+
return n;
|
|
96
|
+
}), B = p(null), V = p(null), H = p(""), U = p(""), W = p(!1), G = p(""), K = t(() => k.value ?? []), q = t(() => !O.disabled && !O.readonly), fe = t(() => O.maxItems !== void 0 && K.value.length >= O.maxItems), J = t(() => U.value || O.errorMsg), pe = t(() => [
|
|
97
|
+
O.hint && N,
|
|
98
|
+
J.value && P,
|
|
99
|
+
O.maxItems !== void 0 && F,
|
|
100
|
+
q.value && I
|
|
101
|
+
].filter(Boolean).join(" ") || void 0), me = t(() => K.value.length || !q.value ? "" : O.placeholder);
|
|
102
|
+
function Y(e) {
|
|
103
|
+
G.value = "", u(() => G.value = e);
|
|
104
|
+
}
|
|
105
|
+
function he(e, t) {
|
|
106
|
+
return O.maxItems !== void 0 && t.length >= O.maxItems ? `You can add up to ${O.maxItems} ${O.maxItems === 1 ? "value" : "values"}. Remove one first.` : !O.allowDuplicates && t.includes(e) ? `“${e}” is already added.` : O.validate?.(e, t) || "";
|
|
107
|
+
}
|
|
108
|
+
function X(e, t) {
|
|
109
|
+
let n = [...K.value], r = [], i = [], a = "";
|
|
110
|
+
for (let o of e.split(t)) {
|
|
111
|
+
let e = O.transform(o);
|
|
112
|
+
if (!e) continue;
|
|
113
|
+
let t = he(e, n);
|
|
114
|
+
if (t) {
|
|
115
|
+
i.push(o.trim()), a ||= t;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
n.push(e), r.push(e);
|
|
119
|
+
}
|
|
120
|
+
return r.length && (k.value = n, r.forEach((e) => A("add", e)), Y(r.length === 1 ? `Added ${r[0]}.` : `Added ${r.length} values.`)), H.value = i.join(", "), u(() => U.value = a), i.length > 0;
|
|
121
|
+
}
|
|
122
|
+
function Z() {
|
|
123
|
+
return !q.value || !H.value.trim() ? !1 : X(H.value, de);
|
|
124
|
+
}
|
|
125
|
+
function Q(e, t = !0) {
|
|
126
|
+
if (!q.value) return;
|
|
127
|
+
let n = K.value[e];
|
|
128
|
+
if (n === void 0) return;
|
|
129
|
+
let r = K.value.filter((t, n) => n !== e);
|
|
130
|
+
k.value = r, W.value = !1, U.value = "", A("remove", n, e), Y(`Removed ${n}.`), t && u(() => {
|
|
131
|
+
let t = $();
|
|
132
|
+
(t[Math.min(e, t.length - 1)] ?? B.value)?.focus();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function ge() {
|
|
136
|
+
q.value && K.value.length && (k.value = [], W.value = !1, A("clear"), Y("Removed every value."), B.value?.focus());
|
|
137
|
+
}
|
|
138
|
+
function $() {
|
|
139
|
+
return Array.from(V.value?.querySelectorAll("[data-remove]") ?? []);
|
|
140
|
+
}
|
|
141
|
+
function _e(e) {
|
|
142
|
+
if (!q.value || e.isComposing) return;
|
|
143
|
+
let t = e.target, n = t.selectionStart === 0 && t.selectionEnd === 0;
|
|
144
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Tab" && !e.shiftKey && H.value.trim() ? Z() : e.key === "Backspace" && !H.value && K.value.length ? (e.preventDefault(), W.value ? Q(K.value.length - 1, !1) : (W.value = !0, Y(`${K.value[K.value.length - 1]} selected. Press Backspace again to remove it.`))) : e.key === "ArrowLeft" && n && K.value.length ? (e.preventDefault(), W.value = !1, $().at(-1)?.focus()) : e.key === "Escape" && (H.value || U.value) ? (e.preventDefault(), H.value = "", U.value = "") : W.value = !1;
|
|
145
|
+
}
|
|
146
|
+
function ve(e, t) {
|
|
147
|
+
let n = $();
|
|
148
|
+
e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(), Q(t)) : e.key === "ArrowLeft" ? (e.preventDefault(), n[Math.max(t - 1, 0)]?.focus()) : e.key === "ArrowRight" ? (e.preventDefault(), (n[t + 1] ?? B.value)?.focus()) : e.key === "Home" ? (e.preventDefault(), n[0]?.focus()) : e.key === "End" && (e.preventDefault(), B.value?.focus());
|
|
149
|
+
}
|
|
150
|
+
function ye(e) {
|
|
151
|
+
if (!q.value) return;
|
|
152
|
+
let t = e.clipboardData?.getData("text") ?? "";
|
|
153
|
+
if (!j.test(t.trim())) return;
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
let n = B.value, r = n?.selectionStart ?? H.value.length, i = n?.selectionEnd ?? H.value.length;
|
|
156
|
+
X(H.value.slice(0, r) + t + H.value.slice(i), j);
|
|
157
|
+
}
|
|
158
|
+
function be() {
|
|
159
|
+
W.value = !1, O.addOnBlur && Z();
|
|
160
|
+
}
|
|
161
|
+
function xe(e) {
|
|
162
|
+
e.target.closest("button") || B.value?.focus();
|
|
163
|
+
}
|
|
164
|
+
return re(H, () => {
|
|
165
|
+
U.value = "", W.value = !1;
|
|
166
|
+
}), c({
|
|
167
|
+
focus: () => B.value?.focus(),
|
|
168
|
+
commit: () => !Z()
|
|
169
|
+
}), (t, c) => (f(), r("div", l(R.value, {
|
|
170
|
+
class: ["w-full", s.disabled && "opacity-50"],
|
|
171
|
+
"data-ac-ds": "",
|
|
172
|
+
"data-testid": "ac-tag-input"
|
|
173
|
+
}), [
|
|
174
|
+
i("label", {
|
|
175
|
+
for: g(M),
|
|
176
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
177
|
+
}, [
|
|
178
|
+
i("span", null, h(s.label), 1),
|
|
179
|
+
s.readonly ? (f(), r("span", y, "(read only)")) : n("", !0),
|
|
180
|
+
s.required ? (f(), r("span", b, "*")) : n("", !0)
|
|
181
|
+
], 8, ce),
|
|
182
|
+
s.hint ? (f(), r("p", {
|
|
183
|
+
key: 0,
|
|
184
|
+
id: N,
|
|
185
|
+
class: "mb-2 text-base text-muted"
|
|
186
|
+
}, h(s.hint), 1)) : n("", !0),
|
|
187
|
+
i("div", {
|
|
188
|
+
class: d(["flex w-full flex-wrap items-center gap-1.5 rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
189
|
+
s.size === "small" ? "min-h-9 py-[5px] pr-1.5 pl-3" : "min-h-10 py-[7px] pr-2 pl-4",
|
|
190
|
+
s.readonly ? "bg-surface-muted" : "bg-background",
|
|
191
|
+
s.disabled ? "cursor-not-allowed" : "cursor-text",
|
|
192
|
+
J.value ? "border-danger/60 focus-within:border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !s.disabled && "hover:border-accent-active"]
|
|
193
|
+
]]),
|
|
194
|
+
onClick: xe
|
|
195
|
+
}, [K.value.length ? (f(), r("ul", {
|
|
196
|
+
key: 0,
|
|
197
|
+
ref_key: "list",
|
|
198
|
+
ref: V,
|
|
199
|
+
role: "list",
|
|
200
|
+
"aria-label": s.label,
|
|
201
|
+
class: "contents"
|
|
202
|
+
}, [(f(!0), r(e, null, m(K.value, (e, t) => (f(), r("li", {
|
|
203
|
+
key: `${t}-${e}`,
|
|
204
|
+
class: d(["inline-flex h-6 max-w-full min-w-0 items-center gap-1 rounded-10 text-xs text-heading transition-colors duration-150", [
|
|
205
|
+
s.mono && "font-mono",
|
|
206
|
+
q.value ? "pr-0.5 pl-2.5" : "px-2.5",
|
|
207
|
+
W.value && t === K.value.length - 1 ? "bg-accent-active ring-2 ring-ring" : "bg-accent"
|
|
208
|
+
]]),
|
|
209
|
+
"data-testid": "ac-tag-input-chip"
|
|
210
|
+
}, [i("span", {
|
|
211
|
+
class: "truncate",
|
|
212
|
+
title: e
|
|
213
|
+
}, h(e), 9, S), q.value ? (f(), r("button", {
|
|
214
|
+
key: 0,
|
|
215
|
+
type: "button",
|
|
216
|
+
"data-remove": "",
|
|
217
|
+
class: "inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
218
|
+
"aria-label": `Remove ${e}`,
|
|
219
|
+
onClick: (e) => Q(t),
|
|
220
|
+
onKeydown: (e) => ve(e, t)
|
|
221
|
+
}, [o(g(v), {
|
|
222
|
+
class: "size-3.5",
|
|
223
|
+
"aria-hidden": "true"
|
|
224
|
+
})], 40, le)) : n("", !0)], 2))), 128))], 8, x)) : n("", !0), i("div", { class: d(s.readonly && K.value.length ? "contents" : "flex min-w-[64px] flex-1 items-center gap-1") }, [ie(i("input", l({
|
|
225
|
+
id: g(M),
|
|
226
|
+
ref_key: "input",
|
|
227
|
+
ref: B
|
|
228
|
+
}, z.value, {
|
|
229
|
+
"onUpdate:modelValue": c[0] ||= (e) => H.value = e,
|
|
230
|
+
type: "text",
|
|
231
|
+
name: s.name,
|
|
232
|
+
placeholder: me.value,
|
|
233
|
+
disabled: s.disabled,
|
|
234
|
+
readonly: s.readonly,
|
|
235
|
+
"aria-invalid": !!J.value || void 0,
|
|
236
|
+
"aria-required": s.required || void 0,
|
|
237
|
+
"aria-describedby": pe.value,
|
|
238
|
+
autocomplete: "off",
|
|
239
|
+
autocapitalize: "off",
|
|
240
|
+
spellcheck: "false",
|
|
241
|
+
class: ["h-6 min-w-0 flex-1 bg-transparent text-base font-normal text-heading outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [s.mono && "font-mono", s.readonly && K.value.length && "sr-only"]],
|
|
242
|
+
onKeydown: _e,
|
|
243
|
+
onPaste: ye,
|
|
244
|
+
onBlur: be
|
|
245
|
+
}), null, 16, C), [[ne, H.value]]), q.value && (H.value.trim() || s.showClear && K.value.length) ? (f(), r("span", ue, [H.value.trim() ? (f(), r("button", {
|
|
246
|
+
key: 0,
|
|
247
|
+
type: "button",
|
|
248
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
249
|
+
"aria-label": `Add ${H.value.trim()}`,
|
|
250
|
+
title: `Add “${H.value.trim()}”`,
|
|
251
|
+
tabindex: "-1",
|
|
252
|
+
onMousedown: c[1] ||= ae(() => {}, ["prevent"]),
|
|
253
|
+
onClick: Z
|
|
254
|
+
}, [o(g(se), {
|
|
255
|
+
class: "size-4",
|
|
256
|
+
"aria-hidden": "true"
|
|
257
|
+
})], 40, w)) : n("", !0), s.showClear && K.value.length ? (f(), r("button", {
|
|
258
|
+
key: 1,
|
|
259
|
+
type: "button",
|
|
260
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
261
|
+
"aria-label": "Clear all values",
|
|
262
|
+
title: "Clear all",
|
|
263
|
+
onClick: ge
|
|
264
|
+
}, [o(g(v), {
|
|
265
|
+
class: "size-4",
|
|
266
|
+
"aria-hidden": "true"
|
|
267
|
+
})])) : n("", !0)])) : n("", !0)], 2)], 2),
|
|
268
|
+
J.value || s.maxItems !== void 0 ? (f(), r("div", T, [J.value ? (f(), r("p", {
|
|
269
|
+
key: 0,
|
|
270
|
+
id: P,
|
|
271
|
+
class: "flex min-w-0 flex-1 items-center gap-1.5 text-base text-danger-strong",
|
|
272
|
+
role: "alert"
|
|
273
|
+
}, [o(g(oe), {
|
|
274
|
+
class: "size-4 shrink-0",
|
|
275
|
+
"aria-hidden": "true"
|
|
276
|
+
}), a(" " + h(J.value), 1)])) : n("", !0), s.maxItems === void 0 ? n("", !0) : (f(), r("p", {
|
|
277
|
+
key: 1,
|
|
278
|
+
id: F,
|
|
279
|
+
class: d(["ml-auto shrink-0 text-xs leading-5 tabular-nums", fe.value ? "font-medium text-heading" : "text-muted"])
|
|
280
|
+
}, h(K.value.length) + " of " + h(s.maxItems) + " added ", 3))])) : n("", !0),
|
|
281
|
+
q.value ? (f(), r("p", {
|
|
282
|
+
key: 2,
|
|
283
|
+
id: I,
|
|
284
|
+
class: "sr-only"
|
|
285
|
+
}, "Press Enter or comma to add a value. Backspace in the empty input removes the last one.")) : n("", !0),
|
|
286
|
+
i("p", E, h(G.value), 1)
|
|
287
|
+
], 16));
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
//#endregion
|
|
291
|
+
export { D as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/**
|
|
2
|
+
/** Label above the field. Pass `placeholder` for an example value inside it. */
|
|
3
3
|
label: string;
|
|
4
4
|
/** Native `name` attribute. */
|
|
5
5
|
name?: string;
|
|
@@ -17,11 +17,11 @@ export interface Props {
|
|
|
17
17
|
required?: boolean;
|
|
18
18
|
/** Disables the field. */
|
|
19
19
|
disabled?: boolean;
|
|
20
|
-
/** Read-only field
|
|
20
|
+
/** Read-only field: a muted fill, and "(read only)" after the label. */
|
|
21
21
|
readonly?: boolean;
|
|
22
22
|
/** Error text under the field. Turns the border and label red and sets `aria-invalid`. */
|
|
23
23
|
errorMsg?: string;
|
|
24
|
-
/**
|
|
24
|
+
/** Help text between the label and the field. */
|
|
25
25
|
hint?: string;
|
|
26
26
|
}
|
|
27
27
|
type __VLS_Props = Props;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s,
|
|
2
|
-
import { CircleAlert as
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, onMounted as d, openBlock as f, ref as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, vModelText as y, watch as b, withDirectives as x } from "vue";
|
|
2
|
+
import { CircleAlert as S } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var C = ["for"], w = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-normal text-muted"
|
|
7
|
+
}, T = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "text-danger",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, E = ["id"], D = [
|
|
5
12
|
"id",
|
|
6
13
|
"name",
|
|
7
14
|
"rows",
|
|
@@ -11,17 +18,14 @@ var x = { class: "relative" }, S = [
|
|
|
11
18
|
"required",
|
|
12
19
|
"aria-invalid",
|
|
13
20
|
"aria-describedby"
|
|
14
|
-
],
|
|
15
|
-
key:
|
|
16
|
-
class: "text-danger",
|
|
17
|
-
"aria-hidden": "true"
|
|
18
|
-
}, T = {
|
|
19
|
-
key: 0,
|
|
21
|
+
], O = {
|
|
22
|
+
key: 1,
|
|
20
23
|
class: "mt-1.5 flex items-start gap-3"
|
|
21
|
-
},
|
|
22
|
-
key:
|
|
24
|
+
}, k = ["id"], A = {
|
|
25
|
+
key: 1,
|
|
23
26
|
class: "flex-1"
|
|
24
|
-
},
|
|
27
|
+
}, j = ["id"], M = /*@__PURE__*/ o({
|
|
28
|
+
inheritAttrs: !1,
|
|
25
29
|
__name: "AcTextarea",
|
|
26
30
|
props: /*@__PURE__*/ s({
|
|
27
31
|
label: {},
|
|
@@ -57,64 +61,85 @@ var x = { class: "relative" }, S = [
|
|
|
57
61
|
}),
|
|
58
62
|
emits: ["update:modelValue"],
|
|
59
63
|
setup(o, { expose: s }) {
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
let
|
|
64
|
+
let M = o, N = v(o, "modelValue"), P = _(), F = g(), I = e(() => ({
|
|
65
|
+
class: F.class,
|
|
66
|
+
style: F.style
|
|
67
|
+
})), L = e(() => {
|
|
68
|
+
let { class: e, style: t, ...n } = F;
|
|
69
|
+
return n;
|
|
70
|
+
}), R = p(null), z = p(!1), B = e(() => (N.value ?? "").length), V = e(() => M.maxlength !== void 0 && B.value >= M.maxlength), H = e(() => [
|
|
71
|
+
M.hint && `${P}-hint`,
|
|
72
|
+
M.errorMsg && `${P}-msg`,
|
|
73
|
+
M.maxlength !== void 0 && `${P}-count`
|
|
74
|
+
].filter(Boolean).join(" ") || void 0);
|
|
75
|
+
function U() {
|
|
76
|
+
let e = R.value;
|
|
77
|
+
if (!e || !M.autoResize) return;
|
|
78
|
+
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = M.rows * n + r, a = M.maxRows > 0 ? M.maxRows * n + r : Infinity;
|
|
65
79
|
e.style.height = "auto";
|
|
66
80
|
let o = e.scrollHeight + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth);
|
|
67
|
-
e.style.height = `${Math.min(Math.max(o, i), a)}px`,
|
|
81
|
+
e.style.height = `${Math.min(Math.max(o, i), a)}px`, z.value = o > a;
|
|
68
82
|
}
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
return b(N, () => l(U)), b(() => [
|
|
84
|
+
M.autoResize,
|
|
85
|
+
M.rows,
|
|
86
|
+
M.maxRows
|
|
73
87
|
], () => {
|
|
74
|
-
!
|
|
75
|
-
}),
|
|
76
|
-
class:
|
|
88
|
+
!M.autoResize && R.value && (R.value.style.height = ""), l(U);
|
|
89
|
+
}), d(U), s({ focus: () => R.value?.focus() }), (e, s) => (f(), n("div", c(I.value, {
|
|
90
|
+
class: ["w-full", o.disabled && "opacity-50"],
|
|
77
91
|
"data-ac-ds": "",
|
|
78
92
|
"data-testid": "ac-textarea"
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
93
|
+
}), [
|
|
94
|
+
r("label", {
|
|
95
|
+
for: h(P),
|
|
96
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
97
|
+
}, [
|
|
98
|
+
r("span", null, m(o.label), 1),
|
|
99
|
+
o.readonly ? (f(), n("span", w, "(read only)")) : t("", !0),
|
|
100
|
+
o.required ? (f(), n("span", T, "*")) : t("", !0)
|
|
101
|
+
], 8, C),
|
|
102
|
+
o.hint ? (f(), n("p", {
|
|
103
|
+
key: 0,
|
|
104
|
+
id: `${h(P)}-hint`,
|
|
105
|
+
class: "mb-2 text-base text-muted"
|
|
106
|
+
}, m(o.hint), 9, E)) : t("", !0),
|
|
107
|
+
x(r("textarea", c({
|
|
108
|
+
id: h(P),
|
|
109
|
+
ref_key: "field",
|
|
110
|
+
ref: R
|
|
111
|
+
}, L.value, {
|
|
112
|
+
"onUpdate:modelValue": s[0] ||= (e) => N.value = e,
|
|
113
|
+
name: o.name,
|
|
114
|
+
rows: o.rows,
|
|
115
|
+
maxlength: o.maxlength,
|
|
116
|
+
disabled: o.disabled,
|
|
117
|
+
readonly: o.readonly,
|
|
118
|
+
required: o.required,
|
|
119
|
+
"aria-invalid": !!o.errorMsg || void 0,
|
|
120
|
+
"aria-describedby": H.value,
|
|
121
|
+
class: ["block w-full rounded-10 border px-4 py-2.5 text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
|
|
122
|
+
o.readonly ? "bg-surface-muted" : "bg-background",
|
|
123
|
+
o.mono && "font-mono text-xs leading-5",
|
|
124
|
+
o.autoResize ? z.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
|
|
125
|
+
o.errorMsg ? "border-danger/60 focus:border-danger focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus:focus-ring", !o.disabled && "hover:border-accent-active"]
|
|
126
|
+
]]
|
|
127
|
+
}), null, 16, D), [[y, N.value]]),
|
|
128
|
+
o.errorMsg || o.maxlength !== void 0 ? (f(), n("div", O, [o.errorMsg ? (f(), n("p", {
|
|
129
|
+
key: 0,
|
|
130
|
+
id: `${h(P)}-msg`,
|
|
131
|
+
class: "flex min-w-0 flex-1 items-center gap-1.5 text-base text-danger-strong",
|
|
132
|
+
role: "alert"
|
|
133
|
+
}, [a(h(S), {
|
|
134
|
+
class: "size-4 shrink-0",
|
|
135
|
+
"aria-hidden": "true"
|
|
136
|
+
}), i(" " + m(o.errorMsg), 1)], 8, k)) : (f(), n("span", A)), o.maxlength === void 0 ? t("", !0) : (f(), n("p", {
|
|
137
|
+
key: 2,
|
|
138
|
+
id: `${h(P)}-count`,
|
|
139
|
+
class: u(["shrink-0 text-xs tabular-nums", V.value ? "font-medium text-danger-strong" : "text-muted"])
|
|
140
|
+
}, [s[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(m(B.value) + " / " + m(o.maxlength), 1)], 10, j))])) : t("", !0)
|
|
141
|
+
], 16));
|
|
117
142
|
}
|
|
118
143
|
});
|
|
119
144
|
//#endregion
|
|
120
|
-
export {
|
|
145
|
+
export { M as default };
|
|
@@ -5,7 +5,7 @@ import { Monitor as p, Moon as m, Sun as h } from "@lucide/vue";
|
|
|
5
5
|
var g = {
|
|
6
6
|
role: "radiogroup",
|
|
7
7
|
"aria-label": "Theme",
|
|
8
|
-
class: "inline-flex items-center gap-
|
|
8
|
+
class: "inline-flex items-center gap-1 rounded-10 bg-surface-sunken p-1",
|
|
9
9
|
"data-ac-ds": "",
|
|
10
10
|
"data-testid": "ac-theme-mode"
|
|
11
11
|
}, _ = [
|
|
@@ -48,10 +48,10 @@ var g = {
|
|
|
48
48
|
"aria-checked": f(C) === e.value,
|
|
49
49
|
"aria-label": o.display === "icons" ? `${e.label} theme` : void 0,
|
|
50
50
|
title: o.display === "icons" ? `${e.label} theme` : void 0,
|
|
51
|
-
class: s(["inline-flex h-
|
|
51
|
+
class: s(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [o.display === "icons" ? "w-7" : "px-3", f(C) === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
|
|
52
52
|
onClick: (t) => E(e.value)
|
|
53
53
|
}, [(c(), n(u(e.icon), {
|
|
54
|
-
class: "size-
|
|
54
|
+
class: "size-4",
|
|
55
55
|
"aria-hidden": "true"
|
|
56
56
|
})), o.display === "labels" ? (c(), i("span", v, d(e.label), 1)) : r("", !0)], 10, _)), 64))]));
|
|
57
57
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Label above the field. Doubles as the accessible name of the trigger and the popover. */
|
|
3
|
+
label?: string;
|
|
4
|
+
/** Text shown in the field while there's no value. */
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
/** `24` shows 00–23; `12` shows 1–12 with an AM/PM column. `v-model` is always 24-hour. Cloud `hour12`. */
|
|
7
|
+
hourCycle?: 12 | 24;
|
|
8
|
+
/** Gap between the minutes on offer, e.g. `5` or `15`. */
|
|
9
|
+
minuteStep?: number;
|
|
10
|
+
/** Adds a seconds column; `v-model` becomes `HH:mm:ss`. */
|
|
11
|
+
showSeconds?: boolean;
|
|
12
|
+
/** Earliest choosable time, `HH:mm` or `HH:mm:ss`. Earlier hours and minutes are greyed out. */
|
|
13
|
+
min?: string;
|
|
14
|
+
/** Latest choosable time, `HH:mm` or `HH:mm:ss`. Must be after `min`; windows across midnight aren't supported. */
|
|
15
|
+
max?: string;
|
|
16
|
+
/** Shows a clear button when there is a value. */
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
/** Disables the field. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Marks the field required and adds a red asterisk. */
|
|
21
|
+
required?: boolean;
|
|
22
|
+
/** Error text under the field. Turns the border red and sets `aria-invalid`. */
|
|
23
|
+
errorMsg?: string;
|
|
24
|
+
/** Help text between the label and the field. */
|
|
25
|
+
hint?: string;
|
|
26
|
+
/** `small` 36px or `normal` 40px tall. */
|
|
27
|
+
size?: "small" | "normal";
|
|
28
|
+
/** Adds a hidden input with this name so plain form posts include the value. */
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
type __VLS_Props = Props;
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
/** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour. `null` when empty. */
|
|
34
|
+
modelValue?: string | null;
|
|
35
|
+
/** Whether the popover is open. */
|
|
36
|
+
"open"?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
40
|
+
/** Moves focus to the field. */
|
|
41
|
+
focus: () => void | undefined;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:modelValue": (value: string | null) => any;
|
|
44
|
+
"update:open": (value: boolean) => any;
|
|
45
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
46
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
47
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
required: boolean;
|
|
50
|
+
label: string;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
max: string;
|
|
53
|
+
min: string;
|
|
54
|
+
name: string;
|
|
55
|
+
size: "small" | "normal";
|
|
56
|
+
hint: string;
|
|
57
|
+
placeholder: string;
|
|
58
|
+
clearable: boolean;
|
|
59
|
+
errorMsg: string;
|
|
60
|
+
showSeconds: boolean;
|
|
61
|
+
hourCycle: 12 | 24;
|
|
62
|
+
minuteStep: number;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
declare const _default: typeof __VLS_export;
|
|
65
|
+
export default _default;
|