@itguy614/clean-ui 1.2.2 → 1.3.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 +12 -0
- package/dist/clean-ui.css +1 -1
- package/dist/components/CuiAccordion.vue.js +2 -2
- package/dist/components/CuiAlert.vue.d.ts +3 -5
- package/dist/components/CuiAlert.vue.d.ts.map +1 -1
- package/dist/components/CuiAlert.vue.js +1 -1
- package/dist/components/CuiAlert.vue2.js +54 -50
- package/dist/components/CuiBadge.vue.js +3 -3
- package/dist/components/CuiBadge.vue2.js +23 -23
- package/dist/components/CuiBanner.vue.d.ts +15 -10
- package/dist/components/CuiBanner.vue.d.ts.map +1 -1
- package/dist/components/CuiBanner.vue.js +5 -80
- package/dist/components/CuiBanner.vue2.js +90 -2
- package/dist/components/CuiButton.vue.d.ts +9 -0
- package/dist/components/CuiButton.vue.d.ts.map +1 -1
- package/dist/components/CuiButton.vue.js +1 -1
- package/dist/components/CuiButton.vue2.js +77 -83
- package/dist/components/CuiButtonGroup.vue.d.ts +4 -2
- package/dist/components/CuiButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiButtonGroup.vue.js +1 -1
- package/dist/components/CuiButtonGroup.vue2.js +18 -9
- package/dist/components/CuiCard.vue.d.ts.map +1 -1
- package/dist/components/CuiCard.vue.js +5 -33
- package/dist/components/CuiCard.vue2.js +32 -2
- package/dist/components/CuiCardBody.vue.d.ts.map +1 -1
- package/dist/components/CuiCardBody.vue.js +5 -18
- package/dist/components/CuiCardBody.vue2.js +18 -2
- package/dist/components/CuiCardFooter.vue.d.ts.map +1 -1
- package/dist/components/CuiCardFooter.vue.js +5 -30
- package/dist/components/CuiCardFooter.vue2.js +25 -2
- package/dist/components/CuiCardHeader.vue.d.ts +5 -4
- package/dist/components/CuiCardHeader.vue.d.ts.map +1 -1
- package/dist/components/CuiCardHeader.vue.js +5 -49
- package/dist/components/CuiCardHeader.vue2.js +40 -2
- package/dist/components/CuiCardMedia.vue.d.ts.map +1 -1
- package/dist/components/CuiCardMedia.vue.js +3 -3
- package/dist/components/CuiCardMedia.vue2.js +6 -6
- package/dist/components/CuiCheckbox.vue.d.ts +2 -2
- package/dist/components/CuiCheckbox.vue.d.ts.map +1 -1
- package/dist/components/CuiCheckbox.vue.js +1 -1
- package/dist/components/CuiCheckbox.vue2.js +46 -34
- package/dist/components/CuiCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/CuiCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiCheckboxGroup.vue.js +2 -2
- package/dist/components/CuiCheckboxGroup.vue2.js +45 -35
- package/dist/components/CuiCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/CuiCodeBlock.vue.js +14 -11
- package/dist/components/CuiColorPicker.vue.d.ts +2 -2
- package/dist/components/CuiColorPicker.vue.d.ts.map +1 -1
- package/dist/components/CuiColorPicker.vue.js +117 -104
- package/dist/components/CuiCombobox.vue.d.ts +2 -2
- package/dist/components/CuiCombobox.vue.d.ts.map +1 -1
- package/dist/components/CuiCombobox.vue.js +5 -330
- package/dist/components/CuiCombobox.vue2.js +331 -2
- package/dist/components/CuiConfirmDialog.vue.d.ts +5 -4
- package/dist/components/CuiConfirmDialog.vue.d.ts.map +1 -1
- package/dist/components/CuiConfirmDialog.vue.js +84 -73
- package/dist/components/CuiContextMenu.vue.d.ts +40 -1
- package/dist/components/CuiContextMenu.vue.d.ts.map +1 -1
- package/dist/components/CuiContextMenu.vue.js +1 -1
- package/dist/components/CuiContextMenu.vue2.js +149 -91
- package/dist/components/CuiCopyButton.vue.d.ts.map +1 -1
- package/dist/components/CuiCopyButton.vue.js +5 -61
- package/dist/components/CuiCopyButton.vue2.js +68 -2
- package/dist/components/CuiDataGridCardView.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridCardView.vue.js +10 -9
- package/dist/components/CuiDataGridColumnManager.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridColumnManager.vue.js +12 -11
- package/dist/components/CuiDataGridPagination.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridPagination.vue.js +9 -8
- package/dist/components/CuiDataGridSearch.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridSearch.vue.js +12 -9
- package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridTable.vue.js +1 -0
- package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridViewManager.vue.js +17 -17
- package/dist/components/CuiDatePicker.vue.d.ts +2 -2
- package/dist/components/CuiDatePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiDatePicker.vue.js +257 -173
- package/dist/components/CuiDateRangePicker.vue.d.ts +2 -2
- package/dist/components/CuiDateRangePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiDateRangePicker.vue.js +262 -179
- package/dist/components/CuiDivider.vue.d.ts.map +1 -1
- package/dist/components/CuiDivider.vue.js +17 -13
- package/dist/components/CuiDropdownMenu.vue.js +2 -2
- package/dist/components/CuiDropdownRadioGroup.vue.d.ts +4 -1
- package/dist/components/CuiDropdownRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiDropdownRadioGroup.vue.js +27 -14
- package/dist/components/CuiDropdownSub.vue.js +2 -2
- package/dist/components/CuiEmptyState.vue.d.ts +5 -4
- package/dist/components/CuiEmptyState.vue.d.ts.map +1 -1
- package/dist/components/CuiEmptyState.vue.js +1 -1
- package/dist/components/CuiEmptyState.vue2.js +30 -24
- package/dist/components/CuiFieldset.vue.d.ts.map +1 -1
- package/dist/components/CuiFieldset.vue.js +1 -1
- package/dist/components/CuiFieldset.vue2.js +21 -21
- package/dist/components/CuiFileUpload.vue.d.ts +2 -2
- package/dist/components/CuiFileUpload.vue.d.ts.map +1 -1
- package/dist/components/CuiFileUpload.vue.js +70 -57
- package/dist/components/CuiFormField.vue.d.ts.map +1 -1
- package/dist/components/CuiFormField.vue.js +2 -2
- package/dist/components/CuiFormField.vue2.js +48 -42
- package/dist/components/CuiInput.vue.d.ts +2 -2
- package/dist/components/CuiInput.vue.d.ts.map +1 -1
- package/dist/components/CuiInput.vue.js +1 -1
- package/dist/components/CuiInput.vue2.js +97 -85
- package/dist/components/CuiInputStepper.vue.d.ts +2 -2
- package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
- package/dist/components/CuiInputStepper.vue.js +5 -187
- package/dist/components/CuiInputStepper.vue2.js +237 -2
- package/dist/components/CuiKbd.vue.d.ts.map +1 -1
- package/dist/components/CuiKbd.vue.js +6 -5
- package/dist/components/CuiMaskedInput.vue.d.ts +9 -3
- package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
- package/dist/components/CuiMaskedInput.vue.js +132 -117
- package/dist/components/CuiModal.vue.d.ts +10 -2
- package/dist/components/CuiModal.vue.d.ts.map +1 -1
- package/dist/components/CuiModal.vue.js +2 -2
- package/dist/components/CuiModal.vue2.js +48 -44
- package/dist/components/CuiModalBody.vue.d.ts.map +1 -1
- package/dist/components/CuiModalBody.vue.js +16 -13
- package/dist/components/CuiModalFooter.vue.d.ts.map +1 -1
- package/dist/components/CuiModalFooter.vue.js +3 -2
- package/dist/components/CuiModalHeader.vue.d.ts +13 -4
- package/dist/components/CuiModalHeader.vue.d.ts.map +1 -1
- package/dist/components/CuiModalHeader.vue.js +54 -42
- package/dist/components/CuiPagination.vue.js +2 -2
- package/dist/components/CuiPopover.vue.d.ts.map +1 -1
- package/dist/components/CuiPopover.vue.js +70 -65
- package/dist/components/CuiRadio.vue.d.ts +2 -4
- package/dist/components/CuiRadio.vue.d.ts.map +1 -1
- package/dist/components/CuiRadio.vue.js +2 -2
- package/dist/components/CuiRadio.vue2.js +88 -74
- package/dist/components/CuiRadioGroup.vue.d.ts +2 -2
- package/dist/components/CuiRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiRadioGroup.vue.js +3 -3
- package/dist/components/CuiRadioGroup.vue2.js +47 -37
- package/dist/components/CuiRating.vue.d.ts.map +1 -1
- package/dist/components/CuiRating.vue.js +15 -14
- package/dist/components/CuiResizablePanels.vue.d.ts.map +1 -1
- package/dist/components/CuiResizablePanels.vue.js +10 -9
- package/dist/components/CuiSelect.vue.d.ts +2 -2
- package/dist/components/CuiSelect.vue.d.ts.map +1 -1
- package/dist/components/CuiSelect.vue.js +2 -2
- package/dist/components/CuiSelect.vue2.js +161 -151
- package/dist/components/CuiSkeleton.vue.js +2 -2
- package/dist/components/CuiSkeleton.vue2.js +10 -10
- package/dist/components/CuiSlideover.vue.d.ts +2 -2
- package/dist/components/CuiSlideover.vue.d.ts.map +1 -1
- package/dist/components/CuiSlideover.vue.js +34 -30
- package/dist/components/CuiSlider.vue.d.ts +2 -2
- package/dist/components/CuiSlider.vue.d.ts.map +1 -1
- package/dist/components/CuiSlider.vue.js +67 -54
- package/dist/components/CuiSpinner.vue.d.ts.map +1 -1
- package/dist/components/CuiSpinner.vue.js +5 -4
- package/dist/components/CuiTable.vue.d.ts.map +1 -1
- package/dist/components/CuiTable.vue.js +4 -1
- package/dist/components/CuiTableBody.vue.d.ts.map +1 -1
- package/dist/components/CuiTableBody.vue.js +6 -6
- package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
- package/dist/components/CuiTableCell.vue.js +11 -10
- package/dist/components/CuiTableFoot.vue.d.ts.map +1 -1
- package/dist/components/CuiTableFoot.vue.js +7 -7
- package/dist/components/CuiTableHead.vue.d.ts.map +1 -1
- package/dist/components/CuiTableHead.vue.js +7 -7
- package/dist/components/CuiTabs.vue.d.ts.map +1 -1
- package/dist/components/CuiTabs.vue.js +1 -1
- package/dist/components/CuiTabs.vue2.js +1 -0
- package/dist/components/CuiTagInput.vue.d.ts +2 -2
- package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
- package/dist/components/CuiTagInput.vue.js +5 -294
- package/dist/components/CuiTagInput.vue2.js +277 -2
- package/dist/components/CuiTextarea.vue.d.ts +2 -2
- package/dist/components/CuiTextarea.vue.d.ts.map +1 -1
- package/dist/components/CuiTextarea.vue.js +4 -4
- package/dist/components/CuiTextarea.vue2.js +73 -59
- package/dist/components/CuiTimePicker.vue.d.ts +2 -2
- package/dist/components/CuiTimePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiTimePicker.vue.js +172 -97
- package/dist/components/CuiTimeline.vue.d.ts.map +1 -1
- package/dist/components/CuiTimeline.vue.js +6 -5
- package/dist/components/CuiTimelineItem.vue.d.ts.map +1 -1
- package/dist/components/CuiTimelineItem.vue.js +11 -10
- package/dist/components/CuiToast.vue.d.ts +8 -10
- package/dist/components/CuiToast.vue.d.ts.map +1 -1
- package/dist/components/CuiToast.vue.js +2 -2
- package/dist/components/CuiToast.vue2.js +69 -67
- package/dist/components/CuiToggle.vue.d.ts +2 -2
- package/dist/components/CuiToggle.vue.d.ts.map +1 -1
- package/dist/components/CuiToggle.vue.js +2 -2
- package/dist/components/CuiToggle.vue2.js +71 -59
- package/dist/components/CuiToggleGroup.vue.d.ts +2 -2
- package/dist/components/CuiToggleGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiToggleGroup.vue.js +2 -2
- package/dist/components/CuiToggleGroup.vue2.js +45 -35
- package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
- package/dist/components/CuiTooltip.vue.js +2 -2
- package/dist/components/CuiTooltip.vue2.js +47 -44
- package/dist/components/CuiTransferList.vue.d.ts.map +1 -1
- package/dist/components/CuiTransferList.vue.js +31 -30
- package/dist/components/CuiTreeNode.vue.d.ts +9 -2
- package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeNode.vue.js +5 -179
- package/dist/components/CuiTreeNode.vue2.js +198 -2
- package/dist/components/CuiTreeView.vue.d.ts +33 -5
- package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeView.vue.js +187 -44
- package/dist/composables/useCalendarKeyboard.d.ts +48 -0
- package/dist/composables/useCalendarKeyboard.d.ts.map +1 -0
- package/dist/composables/useCalendarKeyboard.js +91 -0
- package/dist/composables/useFieldDescribedBy.d.ts +30 -0
- package/dist/composables/useFieldDescribedBy.d.ts.map +1 -0
- package/dist/composables/useFieldDescribedBy.js +11 -0
- package/dist/composables/useMessages.d.ts.map +1 -1
- package/dist/composables/useMessages.js +6 -6
- package/dist/composables/usePopover.d.ts.map +1 -1
- package/dist/composables/usePopover.js +10 -0
- package/dist/composables/useScrollShadows.d.ts +3 -0
- package/dist/composables/useScrollShadows.d.ts.map +1 -1
- package/dist/composables/useScrollShadows.js +15 -12
- package/dist/icons/builtin.d.ts.map +1 -1
- package/dist/icons/builtin.js +38 -37
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +185 -182
- package/dist/messages.d.ts +39 -4
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +8 -7
- package/dist/types/common.d.ts +90 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/utils/colorIconMap.d.ts +47 -3
- package/dist/utils/colorIconMap.d.ts.map +1 -1
- package/dist/utils/colorIconMap.js +20 -5
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +46 -40
- package/dist/utils/sizing.d.ts +26 -1
- package/dist/utils/sizing.d.ts.map +1 -1
- package/dist/utils/sizing.js +22 -21
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { scaleDensity as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as U, useTemplateRef as W, ref as L, computed as m, watch as $, withDirectives as j, openBlock as D, createElementBlock as N, Fragment as G, renderList as J, createBlock as O, withCtx as Q, renderSlot as Z, mergeProps as _, vShow as ee, nextTick as te } from "vue";
|
|
2
|
+
import ne from "./CuiTreeNode.vue.js";
|
|
3
|
+
import { scaleDensity as u, scaleControlHeight as C } from "../utils/sizing.js";
|
|
4
|
+
const le = ["aria-multiselectable"], oe = /* @__PURE__ */ U({
|
|
5
5
|
__name: "CuiTreeView",
|
|
6
6
|
props: {
|
|
7
7
|
nodes: {},
|
|
8
8
|
modelValue: {},
|
|
9
9
|
multiple: { type: Boolean, default: !1 },
|
|
10
|
+
expanded: {},
|
|
10
11
|
defaultExpanded: {},
|
|
11
12
|
expandAll: { type: Boolean, default: !1 },
|
|
12
13
|
showLines: { type: Boolean, default: !0 },
|
|
@@ -15,59 +16,201 @@ const X = { role: "tree" }, T = /* @__PURE__ */ z({
|
|
|
15
16
|
size: { default: "md" },
|
|
16
17
|
hidden: { type: Boolean, default: !1 }
|
|
17
18
|
},
|
|
18
|
-
emits: ["update:modelValue", "node-click", "node-expand"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
emits: ["update:modelValue", "update:expanded", "node-click", "node-expand"],
|
|
20
|
+
setup(r, { expose: K, emit: F }) {
|
|
21
|
+
const a = r, p = F, b = W("el");
|
|
22
|
+
function y(e) {
|
|
23
|
+
return e.flatMap(
|
|
24
|
+
(t) => t.children && t.children.length > 0 ? [t.id, ...y(t.children)] : []
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function T(e, t) {
|
|
28
|
+
for (const n of e) {
|
|
29
|
+
if (n.id === t) return n;
|
|
30
|
+
const l = n.children && T(n.children, t);
|
|
31
|
+
if (l) return l;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const E = L(
|
|
35
|
+
new Set(a.expandAll ? y(a.nodes) : a.defaultExpanded ?? [])
|
|
36
|
+
), o = m(
|
|
37
|
+
() => a.expanded !== void 0 ? new Set(a.expanded) : E.value
|
|
38
|
+
);
|
|
39
|
+
function v(e) {
|
|
40
|
+
a.expanded === void 0 && (E.value = e), p("update:expanded", [...e]);
|
|
27
41
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
function f(e, t) {
|
|
43
|
+
const n = new Set(o.value);
|
|
44
|
+
if (n.has(e) === t) return;
|
|
45
|
+
t ? n.add(e) : n.delete(e), v(n);
|
|
46
|
+
const l = T(a.nodes, e);
|
|
47
|
+
l && p("node-expand", l, t);
|
|
32
48
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
function B(e) {
|
|
50
|
+
f(e.id, !o.value.has(e.id));
|
|
51
|
+
}
|
|
52
|
+
const k = m(() => a.modelValue == null ? /* @__PURE__ */ new Set() : Array.isArray(a.modelValue) ? new Set(a.modelValue) : /* @__PURE__ */ new Set([a.modelValue]));
|
|
53
|
+
function V(e) {
|
|
54
|
+
if (!(!a.selectable || e.disabled))
|
|
55
|
+
if (p("node-click", e), a.multiple) {
|
|
56
|
+
const t = new Set(k.value);
|
|
57
|
+
t.has(e.id) ? t.delete(e.id) : t.add(e.id), p("update:modelValue", [...t]);
|
|
38
58
|
} else
|
|
39
|
-
|
|
59
|
+
p("update:modelValue", k.value.has(e.id) ? null : e.id);
|
|
60
|
+
}
|
|
61
|
+
const g = m(() => {
|
|
62
|
+
const e = [], t = (n, l, i) => {
|
|
63
|
+
for (const d of n) {
|
|
64
|
+
const x = !!d.children && d.children.length > 0;
|
|
65
|
+
e.push({ node: d, depth: l, parentId: i, hasChildren: x }), x && o.value.has(d.id) && t(d.children, l + 1, d.id);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return t(a.nodes, 0, null), e;
|
|
69
|
+
}), s = m(() => g.value.filter((e) => !e.node.disabled)), c = L(null), h = m(() => {
|
|
70
|
+
const e = s.value;
|
|
71
|
+
return e.length === 0 ? null : c.value == null || !e.some((t) => t.node.id === c.value) ? e[0].node.id : c.value;
|
|
72
|
+
});
|
|
73
|
+
function M(e) {
|
|
74
|
+
var n;
|
|
75
|
+
const t = (n = b.value) == null ? void 0 : n.querySelectorAll('[role="treeitem"]');
|
|
76
|
+
for (const l of t ?? [])
|
|
77
|
+
if (l.dataset.cuiTreeId === String(e)) return l;
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
function w(e) {
|
|
81
|
+
e != null && (c.value = e, te(() => {
|
|
82
|
+
var t;
|
|
83
|
+
return (t = M(e)) == null ? void 0 : t.focus();
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
function z(e) {
|
|
87
|
+
const t = s.value;
|
|
88
|
+
if (t.length === 0) return;
|
|
89
|
+
const n = t.findIndex((i) => i.node.id === h.value), l = Math.min(t.length - 1, Math.max(0, (n === -1 ? 0 : n) + e));
|
|
90
|
+
w(t[l].node.id);
|
|
91
|
+
}
|
|
92
|
+
function X() {
|
|
93
|
+
return g.value.find((e) => e.node.id === h.value);
|
|
94
|
+
}
|
|
95
|
+
let A = "", I = null;
|
|
96
|
+
function Y(e) {
|
|
97
|
+
I && clearTimeout(I), A += e.toLowerCase(), I = setTimeout(() => {
|
|
98
|
+
A = "";
|
|
99
|
+
}, 600);
|
|
100
|
+
const t = s.value, n = t.findIndex((l) => l.node.id === h.value);
|
|
101
|
+
for (let l = 1; l <= t.length; l++) {
|
|
102
|
+
const i = t[(n + l) % t.length];
|
|
103
|
+
if (i.node.label.toLowerCase().startsWith(A)) {
|
|
104
|
+
w(i.node.id);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function H(e) {
|
|
110
|
+
const t = X();
|
|
111
|
+
if (!t) return;
|
|
112
|
+
const { node: n, hasChildren: l, parentId: i } = t, d = o.value.has(n.id);
|
|
113
|
+
switch (e.key) {
|
|
114
|
+
case "ArrowDown":
|
|
115
|
+
e.preventDefault(), z(1);
|
|
116
|
+
break;
|
|
117
|
+
case "ArrowUp":
|
|
118
|
+
e.preventDefault(), z(-1);
|
|
119
|
+
break;
|
|
120
|
+
case "ArrowRight":
|
|
121
|
+
e.preventDefault(), l && !d ? f(n.id, !0) : l && d && z(1);
|
|
122
|
+
break;
|
|
123
|
+
case "ArrowLeft":
|
|
124
|
+
e.preventDefault(), l && d ? f(n.id, !1) : i != null && w(i);
|
|
125
|
+
break;
|
|
126
|
+
case "Home":
|
|
127
|
+
e.preventDefault(), s.value.length && w(s.value[0].node.id);
|
|
128
|
+
break;
|
|
129
|
+
case "End":
|
|
130
|
+
e.preventDefault(), s.value.length && w(s.value[s.value.length - 1].node.id);
|
|
131
|
+
break;
|
|
132
|
+
case "Enter":
|
|
133
|
+
case " ":
|
|
134
|
+
e.preventDefault(), l && !a.selectable ? B(n) : V(n);
|
|
135
|
+
break;
|
|
136
|
+
case "*": {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
const x = g.value.filter((S) => S.parentId === i && S.hasChildren);
|
|
139
|
+
x.length && v(/* @__PURE__ */ new Set([...o.value, ...x.map((S) => S.node.id)]));
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
default:
|
|
143
|
+
e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), Y(e.key));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function R(e) {
|
|
147
|
+
c.value = e;
|
|
40
148
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
149
|
+
$(g, () => {
|
|
150
|
+
c.value != null && (s.value.some((e) => e.node.id === c.value) || (c.value = h.value));
|
|
151
|
+
});
|
|
152
|
+
const q = {
|
|
153
|
+
sm: { fontSize: "0.8125rem", iconSize: "0.75rem", hitSize: C("0.75rem"), indent: u("1rem"), padY: u("0.1875rem"), padX: u("0.375rem") },
|
|
154
|
+
md: { fontSize: "0.875rem", iconSize: "0.875rem", hitSize: C("0.875rem"), indent: u("1.25rem"), padY: u("0.25rem"), padX: u("0.5rem") },
|
|
155
|
+
lg: { fontSize: "0.9375rem", iconSize: "1rem", hitSize: C("1rem"), indent: u("1.5rem"), padY: u("0.375rem"), padX: u("0.625rem") }
|
|
156
|
+
}, P = m(() => q[a.size]);
|
|
157
|
+
return K({
|
|
158
|
+
el: b,
|
|
159
|
+
/** Expand one node by id. No-op if it is already expanded. */
|
|
160
|
+
expand: (e) => f(e, !0),
|
|
161
|
+
/** Collapse one node by id. No-op if it is already collapsed. */
|
|
162
|
+
collapse: (e) => f(e, !1),
|
|
163
|
+
/** Flip one node's expanded state. */
|
|
164
|
+
toggleExpand: (e) => f(e, !o.value.has(e)),
|
|
165
|
+
/** Expand every node that has children, at any depth. */
|
|
166
|
+
expandAll: () => v(new Set(y(a.nodes))),
|
|
167
|
+
/** Collapse everything. */
|
|
168
|
+
collapseAll: () => v(/* @__PURE__ */ new Set()),
|
|
169
|
+
/** Expand a node and all of its ancestors, so a deep node is revealed. */
|
|
170
|
+
reveal: (e) => {
|
|
171
|
+
const t = [], n = (l, i) => l.some((d) => d.id === e ? (t.push(...i), !0) : d.children ? n(d.children, [...i, d.id]) : !1);
|
|
172
|
+
n(a.nodes, []) && v(/* @__PURE__ */ new Set([...o.value, ...t]));
|
|
173
|
+
},
|
|
174
|
+
/** Whether a node id is currently expanded. */
|
|
175
|
+
isExpanded: (e) => o.value.has(e),
|
|
176
|
+
/** The ids currently expanded, in insertion order. */
|
|
177
|
+
expandedIds: () => [...o.value]
|
|
178
|
+
}), (e, t) => j((D(), N("div", {
|
|
179
|
+
ref_key: "el",
|
|
180
|
+
ref: b,
|
|
181
|
+
class: "cui-tree-view",
|
|
182
|
+
role: "tree",
|
|
183
|
+
"aria-multiselectable": r.multiple || void 0,
|
|
184
|
+
onKeydown: H
|
|
185
|
+
}, [
|
|
186
|
+
(D(!0), N(G, null, J(r.nodes, (n, l) => (D(), O(ne, {
|
|
48
187
|
key: String(n.id),
|
|
49
188
|
node: n,
|
|
50
189
|
depth: 0,
|
|
51
|
-
"is-last":
|
|
190
|
+
"is-last": l === r.nodes.length - 1,
|
|
52
191
|
expanded: o.value,
|
|
53
|
-
"selected-set":
|
|
54
|
-
selectable:
|
|
55
|
-
"show-lines":
|
|
56
|
-
animated:
|
|
57
|
-
cfg:
|
|
58
|
-
|
|
59
|
-
|
|
192
|
+
"selected-set": k.value,
|
|
193
|
+
selectable: r.selectable,
|
|
194
|
+
"show-lines": r.showLines,
|
|
195
|
+
animated: r.animated,
|
|
196
|
+
cfg: P.value,
|
|
197
|
+
"active-id": h.value,
|
|
198
|
+
"size-of-set": r.nodes.length,
|
|
199
|
+
"position-in-set": l + 1,
|
|
200
|
+
onToggleExpand: B,
|
|
201
|
+
onSelectNode: V,
|
|
202
|
+
onNodeFocused: R
|
|
60
203
|
}, {
|
|
61
|
-
node:
|
|
62
|
-
|
|
204
|
+
node: Q((i) => [
|
|
205
|
+
Z(e.$slots, "node", _({ ref_for: !0 }, i))
|
|
63
206
|
]),
|
|
64
207
|
_: 3
|
|
65
|
-
}, 8, ["node", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg"]))), 128))
|
|
66
|
-
],
|
|
67
|
-
[
|
|
208
|
+
}, 8, ["node", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg", "active-id", "size-of-set", "position-in-set"]))), 128))
|
|
209
|
+
], 40, le)), [
|
|
210
|
+
[ee, !r.hidden]
|
|
68
211
|
]);
|
|
69
212
|
}
|
|
70
213
|
});
|
|
71
214
|
export {
|
|
72
|
-
|
|
215
|
+
oe as default
|
|
73
216
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
export type CalendarViewMode = "days" | "months" | "years";
|
|
3
|
+
export interface UseCalendarKeyboardOptions {
|
|
4
|
+
/** Which grid is showing — the same ref the component switches on. */
|
|
5
|
+
viewMode: Ref<CalendarViewMode>;
|
|
6
|
+
viewYear: Ref<number>;
|
|
7
|
+
viewMonth: Ref<number>;
|
|
8
|
+
/** How many years one page of the years grid shows. */
|
|
9
|
+
yearsPerPage?: number;
|
|
10
|
+
selectDay: (date: Date) => void;
|
|
11
|
+
selectMonth: (month: number) => void;
|
|
12
|
+
selectYear: (year: number) => void;
|
|
13
|
+
/** Open the panel. */
|
|
14
|
+
open: () => void;
|
|
15
|
+
/** Close the panel and hand focus back to the trigger. */
|
|
16
|
+
close: () => void;
|
|
17
|
+
/** Whether the control is currently disabled. */
|
|
18
|
+
isDisabled?: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Stable key for a cell, so focus can be restored to it after a re-render. */
|
|
21
|
+
export declare function calendarCellKey(mode: CalendarViewMode, value: Date | number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Keyboard navigation for the day/month/year grids shared by CuiDatePicker and
|
|
24
|
+
* CuiDateRangePicker (#74). Both built their calendar out of unfocusable
|
|
25
|
+
* `<div>`s with a click handler, so a date could only be picked with a pointer.
|
|
26
|
+
*
|
|
27
|
+
* One piece of state drives all three grids: `focusedDate`. The months grid
|
|
28
|
+
* focuses its month, the years grid its year, so switching views keeps the
|
|
29
|
+
* user where they were instead of resetting to today. Movement also pulls
|
|
30
|
+
* `viewMonth`/`viewYear` along, so stepping off the edge of a month pages the
|
|
31
|
+
* calendar rather than focusing a cell nobody can see.
|
|
32
|
+
*
|
|
33
|
+
* Movement deliberately does NOT skip disabled dates — unlike a menu, a
|
|
34
|
+
* calendar is a grid whose shape carries meaning, and holes in it make it
|
|
35
|
+
* impossible to navigate predictably. Disabled cells are reachable and
|
|
36
|
+
* announced via `aria-disabled`; it is *selection* that refuses.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useCalendarKeyboard(options: UseCalendarKeyboardOptions): {
|
|
39
|
+
gridRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
40
|
+
focusedDate: Ref<Date, Date>;
|
|
41
|
+
focusedKey: import("vue").ComputedRef<string>;
|
|
42
|
+
cellTabIndex: (key: string) => 0 | -1;
|
|
43
|
+
onGridKeydown: (e: KeyboardEvent) => void;
|
|
44
|
+
onFieldKeydown: (e: KeyboardEvent) => void;
|
|
45
|
+
resetFocus: (date?: Date) => void;
|
|
46
|
+
focusCell: () => void;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useCalendarKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalendarKeyboard.d.ts","sourceRoot":"","sources":["../../src/composables/useCalendarKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAGxD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,0BAA0B;IACzC,sEAAsE;IACtE,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sBAAsB;IACtB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;CAC5B;AAKD,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAMpF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;;;;wBA+B1C,MAAM;uBA6BP,aAAa;wBAuEZ,aAAa;wBAzEd,IAAI;;EA2F/B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ref as w, computed as R, nextTick as T } from "vue";
|
|
2
|
+
import { YEARS_PER_PAGE as x, addYears as u, addMonths as y, addDays as m, yearPageStart as U } from "../utils/date.js";
|
|
3
|
+
const G = { days: 7, months: 3, years: 3 };
|
|
4
|
+
function v(o, r) {
|
|
5
|
+
if (o === "days") {
|
|
6
|
+
const l = r;
|
|
7
|
+
return `d:${l.getFullYear()}-${l.getMonth()}-${l.getDate()}`;
|
|
8
|
+
}
|
|
9
|
+
return `${o === "months" ? "m" : "y"}:${r}`;
|
|
10
|
+
}
|
|
11
|
+
function q(o) {
|
|
12
|
+
const { viewMode: r, viewYear: l, viewMonth: k, selectDay: b, selectMonth: M, selectYear: P, open: Y, close: F } = o, f = o.yearsPerPage ?? x, E = o.isDisabled ?? (() => !1), D = w(null), c = w(/* @__PURE__ */ new Date());
|
|
13
|
+
function A() {
|
|
14
|
+
const e = c.value;
|
|
15
|
+
(r.value === "days" || r.value === "months") && (k.value = e.getMonth()), l.value = e.getFullYear();
|
|
16
|
+
}
|
|
17
|
+
const i = R(() => {
|
|
18
|
+
const e = c.value;
|
|
19
|
+
return r.value === "days" ? v("days", e) : r.value === "months" ? v("months", e.getMonth()) : v("years", e.getFullYear());
|
|
20
|
+
}), K = (e) => e === i.value ? 0 : -1;
|
|
21
|
+
function g() {
|
|
22
|
+
const e = i.value;
|
|
23
|
+
T(() => {
|
|
24
|
+
var a, t;
|
|
25
|
+
(t = (a = D.value) == null ? void 0 : a.querySelector(`[data-cui-cell="${e}"]`)) == null || t.focus({ preventScroll: !0 });
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function n(e) {
|
|
29
|
+
c.value = e, A(), g();
|
|
30
|
+
}
|
|
31
|
+
const S = (e = /* @__PURE__ */ new Date()) => n(e);
|
|
32
|
+
function $(e) {
|
|
33
|
+
const a = r.value, t = c.value, p = G[a], d = (s) => a === "days" ? m(t, s) : a === "months" ? y(t, s) : u(t, s);
|
|
34
|
+
switch (e.key) {
|
|
35
|
+
case "ArrowLeft":
|
|
36
|
+
e.preventDefault(), n(d(-1));
|
|
37
|
+
break;
|
|
38
|
+
case "ArrowRight":
|
|
39
|
+
e.preventDefault(), n(d(1));
|
|
40
|
+
break;
|
|
41
|
+
case "ArrowUp":
|
|
42
|
+
e.preventDefault(), n(d(-p));
|
|
43
|
+
break;
|
|
44
|
+
case "ArrowDown":
|
|
45
|
+
e.preventDefault(), n(d(p));
|
|
46
|
+
break;
|
|
47
|
+
case "Home":
|
|
48
|
+
case "End": {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
const s = e.key === "End";
|
|
51
|
+
if (a === "days") n(m(t, s ? 6 - t.getDay() : -t.getDay()));
|
|
52
|
+
else if (a === "months") n(new Date(t.getFullYear(), s ? 11 : 0, 1));
|
|
53
|
+
else {
|
|
54
|
+
const h = U(t.getFullYear(), f);
|
|
55
|
+
n(new Date(s ? h + f - 1 : h, t.getMonth(), 1));
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "PageUp":
|
|
60
|
+
e.preventDefault(), n(a === "years" ? u(t, -f) : e.shiftKey ? u(t, -1) : y(t, -1));
|
|
61
|
+
break;
|
|
62
|
+
case "PageDown":
|
|
63
|
+
e.preventDefault(), n(a === "years" ? u(t, f) : e.shiftKey ? u(t, 1) : y(t, 1));
|
|
64
|
+
break;
|
|
65
|
+
case "Enter":
|
|
66
|
+
case " ":
|
|
67
|
+
e.preventDefault(), a === "days" ? b(new Date(t)) : a === "months" ? M(t.getMonth()) : P(t.getFullYear());
|
|
68
|
+
break;
|
|
69
|
+
case "Escape":
|
|
70
|
+
e.preventDefault(), e.stopPropagation(), F();
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function C(e) {
|
|
75
|
+
E() || e.key === "ArrowDown" && (e.preventDefault(), Y());
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
gridRef: D,
|
|
79
|
+
focusedDate: c,
|
|
80
|
+
focusedKey: i,
|
|
81
|
+
cellTabIndex: K,
|
|
82
|
+
onGridKeydown: $,
|
|
83
|
+
onFieldKeydown: C,
|
|
84
|
+
resetFocus: S,
|
|
85
|
+
focusCell: g
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
v as calendarCellKey,
|
|
90
|
+
q as useCalendarKeyboard
|
|
91
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
/** The props any control needs for this: its own id, a caller's descriptions, and an error. */
|
|
3
|
+
interface DescribableProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
ariaDescribedby?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Wire a control's own error message into `aria-describedby`.
|
|
11
|
+
*
|
|
12
|
+
* A control that sets `aria-invalid` and renders an unreferenced error message tells a
|
|
13
|
+
* screen-reader user that something is wrong and never what (#175). Put `errorId` on the
|
|
14
|
+
* message element and `describedBy` on the control.
|
|
15
|
+
*
|
|
16
|
+
* Caller-supplied ids come first, then ours: `aria-describedby` is read in the order given,
|
|
17
|
+
* and a caller's own help text is the more general description.
|
|
18
|
+
*
|
|
19
|
+
* The id falls back to Vue's `useId()` rather than `Math.random()`, which is what the rest
|
|
20
|
+
* of the library still uses: `useId()` is stable across re-renders *and* identical between
|
|
21
|
+
* a server render and its hydration, so it does not produce an attribute mismatch. Eight
|
|
22
|
+
* components render an error message this way; extracting it means the next six do not each
|
|
23
|
+
* re-derive the id-list rule.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useFieldDescribedBy(props: DescribableProps): {
|
|
26
|
+
errorId: ComputedRef<string>;
|
|
27
|
+
describedBy: ComputedRef<string | undefined>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=useFieldDescribedBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldDescribedBy.d.ts","sourceRoot":"","sources":["../../src/composables/useFieldDescribedBy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAExD,+FAA+F;AAC/F,UAAU,gBAAgB;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG;IAC5D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C,CASA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useId as n, computed as d } from "vue";
|
|
2
|
+
function u(e) {
|
|
3
|
+
const c = n(), i = d(() => `${e.id ?? c}-error`), t = d(() => {
|
|
4
|
+
const r = e.error && e.errorMessage ? i.value : void 0;
|
|
5
|
+
return e.ariaDescribedby && r ? `${e.ariaDescribedby} ${r}` : e.ariaDescribedby ?? r;
|
|
6
|
+
});
|
|
7
|
+
return { errorId: i, describedBy: t };
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
u as useFieldDescribedBy
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessages.d.ts","sourceRoot":"","sources":["../../src/composables/useMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"useMessages.d.ts","sourceRoot":"","sources":["../../src/composables/useMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/E;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAAC,WAAW,CAAC,CAEtD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { inject as e, computed as o } from "vue";
|
|
2
|
-
import { CuiConfigKey as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return e(
|
|
2
|
+
import { CuiConfigKey as s } from "../components/config-context.js";
|
|
3
|
+
import { mergeMessages as r, defaultMessages as t } from "../messages.js";
|
|
4
|
+
const m = o(() => r(t));
|
|
5
|
+
function u() {
|
|
6
|
+
return e(s, m);
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
u as useMessages
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../src/composables/usePopover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAC;AACrF,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC/C,8CAA8C;IAC9C,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../src/composables/usePopover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAC;AACrF,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC/C,8CAA8C;IAC9C,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFzD"}
|
|
@@ -19,6 +19,16 @@ function F(e = {}) {
|
|
|
19
19
|
placement: d,
|
|
20
20
|
middleware: m,
|
|
21
21
|
strategy: e.strategy ?? "absolute",
|
|
22
|
+
// `left`/`top` rather than Floating UI's default `transform: translate()`.
|
|
23
|
+
// A panel that animates in owns its own `transform`, and a CSS animation
|
|
24
|
+
// on that property REPLACES the element's transform for the animation's
|
|
25
|
+
// whole duration — so the positioning translate was dropped and the panel
|
|
26
|
+
// rendered at the top-left corner of the screen for 0.15s before snapping
|
|
27
|
+
// into place. Visible on every CuiPopover consumer (date/time pickers,
|
|
28
|
+
// the data grid's column manager) and on CuiTooltip, where the show delay
|
|
29
|
+
// usually hid it. Positioning through `left`/`top` leaves `transform`
|
|
30
|
+
// free for the animation.
|
|
31
|
+
transform: !1,
|
|
22
32
|
whileElementsMounted: k
|
|
23
33
|
}
|
|
24
34
|
), x = o(() => {
|
|
@@ -14,6 +14,7 @@ export declare function useScrollShadows(): {
|
|
|
14
14
|
/** Inline style for a top edge fade */
|
|
15
15
|
export declare const scrollShadowTopStyle: {
|
|
16
16
|
position: "absolute";
|
|
17
|
+
borderRadius: string;
|
|
17
18
|
top: string;
|
|
18
19
|
left: string;
|
|
19
20
|
right: string;
|
|
@@ -25,6 +26,7 @@ export declare const scrollShadowTopStyle: {
|
|
|
25
26
|
/** Inline style for a bottom edge fade */
|
|
26
27
|
export declare const scrollShadowBottomStyle: {
|
|
27
28
|
position: "absolute";
|
|
29
|
+
borderRadius: string;
|
|
28
30
|
bottom: string;
|
|
29
31
|
left: string;
|
|
30
32
|
right: string;
|
|
@@ -36,6 +38,7 @@ export declare const scrollShadowBottomStyle: {
|
|
|
36
38
|
/** Inline style for a right edge fade */
|
|
37
39
|
export declare const scrollShadowRightStyle: {
|
|
38
40
|
position: "absolute";
|
|
41
|
+
borderRadius: string;
|
|
39
42
|
right: string;
|
|
40
43
|
top: string;
|
|
41
44
|
bottom: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollShadows.d.ts","sourceRoot":"","sources":["../../src/composables/useScrollShadows.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB;;;;;kBAcT,KAAK;kBAIL,OAAO;iBAZR,WAAW;EA0BhC;
|
|
1
|
+
{"version":3,"file":"useScrollShadows.d.ts","sourceRoot":"","sources":["../../src/composables/useScrollShadows.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB;;;;;kBAcT,KAAK;kBAIL,OAAO;iBAZR,WAAW;EA0BhC;AAYD,uCAAuC;AACvC,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUhC,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,uBAAuB;;;;;;;;;;CAUnC,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,sBAAsB;;;;;;;;;;CAUlC,CAAC"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { ref as o } from "vue";
|
|
2
|
-
function
|
|
3
|
-
const r = o(!1), l = o(!1),
|
|
2
|
+
function u() {
|
|
3
|
+
const r = o(!1), l = o(!1), i = o(!1), s = o(!1);
|
|
4
4
|
function n(t) {
|
|
5
|
-
r.value = t.scrollTop > 4, l.value = t.scrollHeight - t.scrollTop - t.clientHeight > 4,
|
|
5
|
+
r.value = t.scrollTop > 4, l.value = t.scrollHeight - t.scrollTop - t.clientHeight > 4, i.value = t.scrollLeft > 4, s.value = t.scrollWidth - t.scrollLeft - t.clientWidth > 4;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function a(t) {
|
|
8
8
|
n(t.target);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function c(t) {
|
|
11
11
|
t && requestAnimationFrame(() => n(t));
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
14
|
canScrollUp: r,
|
|
15
15
|
canScrollDown: l,
|
|
16
|
-
canScrollLeft:
|
|
17
|
-
canScrollRight:
|
|
18
|
-
onScroll:
|
|
19
|
-
onMount:
|
|
16
|
+
canScrollLeft: i,
|
|
17
|
+
canScrollRight: s,
|
|
18
|
+
onScroll: a,
|
|
19
|
+
onMount: c,
|
|
20
20
|
update: n
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const e = "var(--cui-surface-base, white)",
|
|
23
|
+
const e = "var(--cui-surface-base, white)", p = {
|
|
24
24
|
position: "absolute",
|
|
25
|
+
borderRadius: "inherit",
|
|
25
26
|
top: "0",
|
|
26
27
|
left: "0",
|
|
27
28
|
right: "0",
|
|
@@ -31,6 +32,7 @@ const e = "var(--cui-surface-base, white)", u = {
|
|
|
31
32
|
background: `linear-gradient(to bottom, ${e}, transparent)`
|
|
32
33
|
}, f = {
|
|
33
34
|
position: "absolute",
|
|
35
|
+
borderRadius: "inherit",
|
|
34
36
|
bottom: "0",
|
|
35
37
|
left: "0",
|
|
36
38
|
right: "0",
|
|
@@ -40,6 +42,7 @@ const e = "var(--cui-surface-base, white)", u = {
|
|
|
40
42
|
background: `linear-gradient(to top, ${e}, transparent)`
|
|
41
43
|
}, g = {
|
|
42
44
|
position: "absolute",
|
|
45
|
+
borderRadius: "inherit",
|
|
43
46
|
right: "0",
|
|
44
47
|
top: "0",
|
|
45
48
|
bottom: "0",
|
|
@@ -51,6 +54,6 @@ const e = "var(--cui-surface-base, white)", u = {
|
|
|
51
54
|
export {
|
|
52
55
|
f as scrollShadowBottomStyle,
|
|
53
56
|
g as scrollShadowRightStyle,
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
p as scrollShadowTopStyle,
|
|
58
|
+
u as useScrollShadows
|
|
56
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../../src/icons/builtin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../../src/icons/builtin.ts"],"names":[],"mappings":"AAyEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,iDAAiD;AACjD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAmEnD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAa,CAAC"}
|