@itguy614/clean-ui 0.9.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/clean-ui.css +1 -1
- package/dist/components/CuiAccordion.vue.js +7 -0
- package/dist/components/CuiAccordion.vue2.js +55 -0
- package/dist/components/CuiAccordionItem.vue.js +7 -0
- package/dist/components/CuiAccordionItem.vue2.js +91 -0
- package/dist/components/CuiAlert.vue.d.ts.map +1 -1
- package/dist/components/CuiAlert.vue.js +7 -0
- package/dist/components/CuiAlert.vue2.js +113 -0
- package/dist/components/CuiAvatar.vue.js +99 -0
- package/dist/components/CuiAvatar.vue3.js +5 -0
- package/dist/components/CuiAvatarGroup.vue.js +22 -0
- package/dist/components/CuiAvatarGroup.vue3.js +5 -0
- package/dist/components/CuiBackdrop.vue.js +7 -0
- package/dist/components/CuiBackdrop.vue2.js +49 -0
- package/dist/components/CuiBadge.vue.d.ts.map +1 -1
- package/dist/components/CuiBadge.vue.js +7 -0
- package/dist/components/CuiBadge.vue2.js +82 -0
- package/dist/components/CuiBanner.vue.js +81 -0
- package/dist/components/CuiBanner.vue2.js +4 -0
- package/dist/components/CuiBreadcrumb.vue.js +7 -0
- package/dist/components/CuiBreadcrumb.vue2.js +29 -0
- package/dist/components/CuiBreadcrumbItem.vue.js +7 -0
- package/dist/components/CuiBreadcrumbItem.vue2.js +46 -0
- package/dist/components/CuiButton.vue.d.ts.map +1 -1
- package/dist/components/CuiButton.vue.js +7 -0
- package/dist/components/CuiButton.vue2.js +136 -0
- package/dist/components/CuiButtonGroup.vue.js +7 -0
- package/dist/components/CuiButtonGroup.vue2.js +21 -0
- package/dist/components/CuiCard.vue.js +35 -0
- package/dist/components/CuiCard.vue2.js +4 -0
- package/dist/components/CuiCardBody.vue.js +20 -0
- package/dist/components/CuiCardBody.vue2.js +4 -0
- package/dist/components/CuiCardFooter.vue.js +32 -0
- package/dist/components/CuiCardFooter.vue2.js +4 -0
- package/dist/components/CuiCardHeader.vue.js +51 -0
- package/dist/components/CuiCardHeader.vue2.js +4 -0
- package/dist/components/CuiCardMedia.vue.js +7 -0
- package/dist/components/CuiCardMedia.vue2.js +38 -0
- package/dist/components/CuiCheckbox.vue.js +7 -0
- package/dist/components/CuiCheckbox.vue2.js +105 -0
- package/dist/components/CuiCheckboxGroup.vue.js +7 -0
- package/dist/components/CuiCheckboxGroup.vue2.js +59 -0
- package/dist/components/CuiCodeBlock.vue.js +129 -0
- package/dist/components/CuiCodeBlock.vue2.js +4 -0
- package/dist/components/CuiColorPicker.vue.js +348 -0
- package/dist/components/CuiColorPicker.vue2.js +4 -0
- package/dist/components/CuiCombobox.vue.js +332 -0
- package/dist/components/CuiCombobox.vue2.js +4 -0
- package/dist/components/CuiConfigProvider.vue.js +18 -0
- package/dist/components/CuiConfigProvider.vue2.js +4 -0
- package/dist/components/CuiConfirmDialog.vue.js +208 -0
- package/dist/components/CuiConfirmDialog.vue2.js +4 -0
- package/dist/components/CuiContainer.vue.js +35 -0
- package/dist/components/CuiContainer.vue2.js +4 -0
- package/dist/components/CuiContextMenu.vue.js +7 -0
- package/dist/components/CuiContextMenu.vue2.js +136 -0
- package/dist/components/CuiCopyButton.vue.js +63 -0
- package/dist/components/CuiCopyButton.vue2.js +4 -0
- package/dist/components/CuiDataGrid.vue.d.ts +53 -79
- package/dist/components/CuiDataGrid.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGrid.vue.js +178 -0
- package/dist/components/CuiDataGrid.vue3.js +5 -0
- package/dist/components/CuiDataGridActiveFilters.vue.js +47 -0
- package/dist/components/CuiDataGridActiveFilters.vue3.js +5 -0
- package/dist/components/CuiDataGridBulkBar.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridBulkBar.vue.js +70 -0
- package/dist/components/CuiDataGridBulkBar.vue3.js +5 -0
- package/dist/components/CuiDataGridCardView.vue.js +31 -0
- package/dist/components/CuiDataGridCardView.vue2.js +4 -0
- package/dist/components/CuiDataGridColumnManager.vue.js +86 -0
- package/dist/components/CuiDataGridColumnManager.vue2.js +4 -0
- package/dist/components/CuiDataGridFilterPanel.vue.js +181 -0
- package/dist/components/CuiDataGridFilterPanel.vue3.js +5 -0
- package/dist/components/CuiDataGridPagination.vue.js +28 -0
- package/dist/components/CuiDataGridPagination.vue2.js +4 -0
- package/dist/components/CuiDataGridSearch.vue.js +69 -0
- package/dist/components/CuiDataGridSearch.vue2.js +4 -0
- package/dist/components/CuiDataGridTable.vue.js +336 -0
- package/dist/components/CuiDataGridTable.vue2.js +4 -0
- package/dist/components/CuiDataGridToolbar.vue.js +73 -0
- package/dist/components/CuiDataGridToolbar.vue3.js +5 -0
- package/dist/components/CuiDataGridViewManager.vue.js +209 -0
- package/dist/components/CuiDataGridViewManager.vue2.js +4 -0
- package/dist/components/CuiDataGridViewToggle.vue.js +43 -0
- package/dist/components/CuiDataGridViewToggle.vue3.js +5 -0
- package/dist/components/CuiDatePicker.vue.js +382 -0
- package/dist/components/CuiDatePicker.vue2.js +4 -0
- package/dist/components/CuiDateRangePicker.vue.js +376 -0
- package/dist/components/CuiDateRangePicker.vue2.js +4 -0
- package/dist/components/CuiDivider.vue.js +124 -0
- package/dist/components/CuiDivider.vue2.js +4 -0
- package/dist/components/CuiDropdown.vue.js +7 -0
- package/dist/components/CuiDropdown.vue2.js +110 -0
- package/dist/components/CuiDropdownCheckItem.vue.js +7 -0
- package/dist/components/CuiDropdownCheckItem.vue2.js +45 -0
- package/dist/components/CuiDropdownDivider.vue.js +14 -0
- package/dist/components/CuiDropdownHeader.vue.js +16 -0
- package/dist/components/CuiDropdownItem.vue.js +7 -0
- package/dist/components/CuiDropdownItem.vue2.js +55 -0
- package/dist/components/CuiDropdownMenu.vue.js +7 -0
- package/dist/components/CuiDropdownMenu.vue2.js +79 -0
- package/dist/components/CuiDropdownRadioGroup.vue.js +23 -0
- package/dist/components/CuiDropdownRadioGroup.vue2.js +4 -0
- package/dist/components/CuiDropdownRadioItem.vue.js +7 -0
- package/dist/components/CuiDropdownRadioItem.vue2.js +43 -0
- package/dist/components/CuiDropdownSub.vue.js +7 -0
- package/dist/components/CuiDropdownSub.vue2.js +91 -0
- package/dist/components/CuiDropdownTrigger.vue.js +7 -0
- package/dist/components/CuiDropdownTrigger.vue2.js +25 -0
- package/dist/components/CuiEmptyState.vue.js +7 -0
- package/dist/components/CuiEmptyState.vue2.js +70 -0
- package/dist/components/CuiFieldset.vue.js +7 -0
- package/dist/components/CuiFieldset.vue2.js +79 -0
- package/dist/components/CuiFileUpload.vue.js +254 -0
- package/dist/components/CuiFileUpload.vue2.js +4 -0
- package/dist/components/CuiFlex.vue.js +7 -0
- package/dist/components/CuiFlex.vue2.js +72 -0
- package/dist/components/CuiFlexItem.vue.js +35 -0
- package/dist/components/CuiFlexItem.vue2.js +4 -0
- package/dist/components/CuiForm.vue.js +116 -0
- package/dist/components/CuiForm.vue2.js +4 -0
- package/dist/components/CuiFormField.vue.js +7 -0
- package/dist/components/CuiFormField.vue2.js +73 -0
- package/dist/components/CuiGrid.vue.js +7 -0
- package/dist/components/CuiGrid.vue2.js +51 -0
- package/dist/components/CuiGridItem.vue.js +30 -0
- package/dist/components/CuiGridItem.vue2.js +4 -0
- package/dist/components/CuiIcon.vue.js +7 -0
- package/dist/components/CuiIcon.vue2.js +72 -0
- package/dist/components/CuiInput.vue.d.ts +6 -6
- package/dist/components/CuiInput.vue.d.ts.map +1 -1
- package/dist/components/CuiInput.vue.js +7 -0
- package/dist/components/CuiInput.vue2.js +150 -0
- package/dist/components/CuiInputStepper.vue.js +189 -0
- package/dist/components/CuiInputStepper.vue2.js +4 -0
- package/dist/components/CuiKbd.vue.js +44 -0
- package/dist/components/CuiKbd.vue2.js +4 -0
- package/dist/components/CuiMaskedInput.vue.d.ts +8 -8
- package/dist/components/CuiMaskedInput.vue.js +256 -0
- package/dist/components/CuiMaskedInput.vue2.js +4 -0
- package/dist/components/CuiModal.vue.js +7 -0
- package/dist/components/CuiModal.vue2.js +98 -0
- package/dist/components/CuiModalBody.vue.js +50 -0
- package/dist/components/CuiModalBody.vue2.js +4 -0
- package/dist/components/CuiModalFooter.vue.js +36 -0
- package/dist/components/CuiModalFooter.vue2.js +4 -0
- package/dist/components/CuiModalHeader.vue.js +85 -0
- package/dist/components/CuiModalHeader.vue2.js +4 -0
- package/dist/components/CuiPagination.vue.js +7 -0
- package/dist/components/CuiPagination.vue2.js +136 -0
- package/dist/components/CuiPopover.vue.js +227 -0
- package/dist/components/CuiPopover.vue2.js +4 -0
- package/dist/components/CuiProgress.vue.js +7 -0
- package/dist/components/CuiProgress.vue2.js +132 -0
- package/dist/components/CuiRadio.vue.d.ts.map +1 -1
- package/dist/components/CuiRadio.vue.js +7 -0
- package/dist/components/CuiRadio.vue2.js +139 -0
- package/dist/components/CuiRadioGroup.vue.js +7 -0
- package/dist/components/CuiRadioGroup.vue2.js +78 -0
- package/dist/components/CuiRating.vue.js +129 -0
- package/dist/components/CuiRating.vue2.js +4 -0
- package/dist/components/CuiResizablePanels.vue.js +147 -0
- package/dist/components/CuiResizablePanels.vue2.js +4 -0
- package/dist/components/CuiSelect.vue.d.ts.map +1 -1
- package/dist/components/CuiSelect.vue.js +7 -0
- package/dist/components/CuiSelect.vue2.js +359 -0
- package/dist/components/CuiSkeleton.vue.js +7 -0
- package/dist/components/CuiSkeleton.vue2.js +80 -0
- package/dist/components/CuiSlideover.vue.js +109 -0
- package/dist/components/CuiSlideover.vue2.js +4 -0
- package/dist/components/CuiSlider.vue.js +156 -0
- package/dist/components/CuiSlider.vue2.js +4 -0
- package/dist/components/CuiSpacer.vue.js +32 -0
- package/dist/components/CuiSpacer.vue2.js +4 -0
- package/dist/components/CuiSpinner.vue.js +99 -0
- package/dist/components/CuiSpinner.vue3.js +5 -0
- package/dist/components/CuiStack.vue.js +30 -0
- package/dist/components/CuiStack.vue2.js +4 -0
- package/dist/components/CuiStepper.vue.js +153 -0
- package/dist/components/CuiStepper.vue2.js +4 -0
- package/dist/components/CuiTab.vue.js +7 -0
- package/dist/components/CuiTab.vue2.js +73 -0
- package/dist/components/CuiTable.vue.d.ts.map +1 -1
- package/dist/components/CuiTable.vue.js +90 -0
- package/dist/components/CuiTable.vue3.js +5 -0
- package/dist/components/CuiTableBody.vue.js +18 -0
- package/dist/components/CuiTableBody.vue2.js +4 -0
- package/dist/components/CuiTableCell.vue.js +36 -0
- package/dist/components/CuiTableCell.vue2.js +4 -0
- package/dist/components/CuiTableFoot.vue.js +18 -0
- package/dist/components/CuiTableFoot.vue2.js +4 -0
- package/dist/components/CuiTableHead.vue.js +18 -0
- package/dist/components/CuiTableHead.vue2.js +4 -0
- package/dist/components/CuiTableRow.vue.js +23 -0
- package/dist/components/CuiTableRow.vue2.js +4 -0
- package/dist/components/CuiTabs.vue.js +7 -0
- package/dist/components/CuiTabs.vue2.js +124 -0
- package/dist/components/CuiTagInput.vue.js +296 -0
- package/dist/components/CuiTagInput.vue2.js +4 -0
- package/dist/components/CuiTextarea.vue.js +7 -0
- package/dist/components/CuiTextarea.vue2.js +112 -0
- package/dist/components/CuiTimePicker.vue.js +193 -0
- package/dist/components/CuiTimePicker.vue2.js +4 -0
- package/dist/components/CuiTimeline.vue.js +25 -0
- package/dist/components/CuiTimeline.vue2.js +4 -0
- package/dist/components/CuiTimelineItem.vue.js +113 -0
- package/dist/components/CuiTimelineItem.vue2.js +4 -0
- package/dist/components/CuiToast.vue.js +7 -0
- package/dist/components/CuiToast.vue2.js +129 -0
- package/dist/components/CuiToastProvider.vue.js +7 -0
- package/dist/components/CuiToastProvider.vue2.js +87 -0
- package/dist/components/CuiToggle.vue.d.ts.map +1 -1
- package/dist/components/CuiToggle.vue.js +7 -0
- package/dist/components/CuiToggle.vue2.js +116 -0
- package/dist/components/CuiToggleGroup.vue.js +7 -0
- package/dist/components/CuiToggleGroup.vue2.js +59 -0
- package/dist/components/CuiTooltip.vue.js +7 -0
- package/dist/components/CuiTooltip.vue2.js +128 -0
- package/dist/components/CuiTransferList.vue.js +442 -0
- package/dist/components/CuiTransferList.vue2.js +4 -0
- package/dist/components/CuiTreeNode.vue.js +180 -0
- package/dist/components/CuiTreeNode.vue2.js +4 -0
- package/dist/components/CuiTreeView.vue.js +73 -0
- package/dist/components/CuiTreeView.vue2.js +4 -0
- package/dist/components/accordion-context.js +4 -0
- package/dist/components/breadcrumb-context.js +4 -0
- package/dist/components/config-context.js +4 -0
- package/dist/components/data-grid-context.js +4 -0
- package/dist/components/dropdown-context.js +30 -0
- package/dist/components/form-context.js +4 -0
- package/dist/components/multi-select-group-context.js +5 -0
- package/dist/components/radio-context.js +4 -0
- package/dist/components/table-context.js +5 -0
- package/dist/components/tabs-context.js +4 -0
- package/dist/components/toast-context.js +45 -0
- package/dist/composables/useBreakpoint.js +34 -0
- package/dist/composables/useClickOutside.js +14 -0
- package/dist/composables/useCopyToClipboard.js +25 -0
- package/dist/composables/useDataGrid.js +269 -0
- package/dist/composables/useDataGridInertia.js +35 -0
- package/dist/composables/useDataGridViews.js +67 -0
- package/dist/composables/useDensity.js +42 -0
- package/dist/composables/useLayoutContext.js +21 -0
- package/dist/composables/useMessages.js +10 -0
- package/dist/composables/useOverlay.d.ts.map +1 -1
- package/dist/composables/useOverlay.js +59 -0
- package/dist/composables/usePopover.js +53 -0
- package/dist/composables/useScrollShadows.js +56 -0
- package/dist/composables/useTheme.js +57 -0
- package/dist/composables/useToast.js +23 -0
- package/dist/composables/useVirtualScroll.js +69 -0
- package/dist/index.js +290 -0
- package/dist/messages.js +57 -0
- package/dist/ssr-theme-init.js +13 -0
- package/dist/utils/color.js +195 -0
- package/dist/utils/colorIconMap.js +11 -0
- package/dist/utils/date.js +114 -0
- package/dist/utils/devWarn.d.ts +15 -0
- package/dist/utils/devWarn.d.ts.map +1 -0
- package/dist/utils/devWarn.js +20 -0
- package/dist/utils/liveRegion.js +12 -0
- package/dist/utils/resolvers.js +28 -0
- package/dist/utils/responsive.js +68 -0
- package/dist/utils/sizing.js +39 -0
- package/package.json +8 -7
- package/dist/clean-ui.js +0 -11937
- package/dist/clean-ui.umd.cjs +0 -11
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent as W, ref as f, onMounted as q, onUnmounted as z, provide as K, withDirectives as O, openBlock as y, createElementBlock as $, renderSlot as D, createBlock as I, Teleport as U, normalizeStyle as j, normalizeClass as N, createCommentVNode as P, vShow as V, nextTick as X } from "vue";
|
|
2
|
+
import { DropdownContextKey as Y } from "./dropdown-context.js";
|
|
3
|
+
const J = /* @__PURE__ */ W({
|
|
4
|
+
__name: "CuiContextMenu",
|
|
5
|
+
props: {
|
|
6
|
+
minWidth: { default: "12rem" },
|
|
7
|
+
hidden: { type: Boolean, default: !1 },
|
|
8
|
+
disabled: { type: Boolean, default: !1 }
|
|
9
|
+
},
|
|
10
|
+
setup(p, { expose: E }) {
|
|
11
|
+
const b = p, n = f(!1), s = f(!1), x = f(null), m = f(null), h = f({});
|
|
12
|
+
let i = null;
|
|
13
|
+
const k = `cui-ctx-${Math.random().toString(36).slice(2, 8)}`;
|
|
14
|
+
function v() {
|
|
15
|
+
b.disabled || (i && (clearTimeout(i), i = null), s.value = !1, n.value = !0);
|
|
16
|
+
}
|
|
17
|
+
function c() {
|
|
18
|
+
n.value && (s.value = !0, i = setTimeout(() => {
|
|
19
|
+
n.value = !1, s.value = !1;
|
|
20
|
+
}, 150));
|
|
21
|
+
}
|
|
22
|
+
function T() {
|
|
23
|
+
c();
|
|
24
|
+
}
|
|
25
|
+
function A(e, t) {
|
|
26
|
+
const o = window.innerWidth, u = window.innerHeight, l = 16, r = {
|
|
27
|
+
position: "fixed",
|
|
28
|
+
zIndex: "9990"
|
|
29
|
+
};
|
|
30
|
+
r.left = `${e}px`, r.top = `${t}px`, r.maxHeight = `${Math.min(u - t - l, 400)}px`, h.value = r, X(() => {
|
|
31
|
+
var M;
|
|
32
|
+
if (!m.value) return;
|
|
33
|
+
const d = m.value.getBoundingClientRect(), a = { ...r };
|
|
34
|
+
if (d.right > o - l && (a.left = `${Math.max(l, e - d.width)}px`), d.bottom > u - l) {
|
|
35
|
+
const L = Math.max(l, t - d.height);
|
|
36
|
+
a.top = `${L}px`, a.maxHeight = `${Math.min(t - l, 400)}px`;
|
|
37
|
+
}
|
|
38
|
+
h.value = a;
|
|
39
|
+
const w = (M = m.value) == null ? void 0 : M.querySelector(
|
|
40
|
+
'[role="menuitem"]:not([aria-disabled="true"])'
|
|
41
|
+
);
|
|
42
|
+
w == null || w.focus();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function B(e) {
|
|
46
|
+
b.disabled || (e.preventDefault(), n.value && (n.value = !1, s.value = !1, i && (clearTimeout(i), i = null)), A(e.clientX, e.clientY), v());
|
|
47
|
+
}
|
|
48
|
+
function _(e) {
|
|
49
|
+
var u, l, r, d;
|
|
50
|
+
if (!m.value) return;
|
|
51
|
+
if (e.key === "Escape") {
|
|
52
|
+
e.preventDefault(), e.stopPropagation(), c();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const t = Array.from(m.value.querySelectorAll(
|
|
56
|
+
'[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"])'
|
|
57
|
+
)), o = t.indexOf(document.activeElement);
|
|
58
|
+
if (e.key === "ArrowDown") {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
const a = o < t.length - 1 ? o + 1 : 0;
|
|
61
|
+
(u = t[a]) == null || u.focus();
|
|
62
|
+
} else if (e.key === "ArrowUp") {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
const a = o > 0 ? o - 1 : t.length - 1;
|
|
65
|
+
(l = t[a]) == null || l.focus();
|
|
66
|
+
} else e.key === "Home" ? (e.preventDefault(), (r = t[0]) == null || r.focus()) : e.key === "End" && (e.preventDefault(), (d = t[t.length - 1]) == null || d.focus());
|
|
67
|
+
}
|
|
68
|
+
function C(e) {
|
|
69
|
+
var u;
|
|
70
|
+
if (!n.value) return;
|
|
71
|
+
const t = e.target;
|
|
72
|
+
if ((u = x.value) != null && u.contains(t)) return;
|
|
73
|
+
const o = document.querySelector(`[data-cui-context-menu-id="${k}"]`);
|
|
74
|
+
o != null && o.contains(t) || c();
|
|
75
|
+
}
|
|
76
|
+
function S() {
|
|
77
|
+
n.value && c();
|
|
78
|
+
}
|
|
79
|
+
q(() => {
|
|
80
|
+
document.addEventListener("mousedown", C), window.addEventListener("scroll", S, !0);
|
|
81
|
+
}), z(() => {
|
|
82
|
+
document.removeEventListener("mousedown", C), window.removeEventListener("scroll", S, !0), i && clearTimeout(i);
|
|
83
|
+
});
|
|
84
|
+
const g = /* @__PURE__ */ new Set();
|
|
85
|
+
function R(e) {
|
|
86
|
+
return g.add(e), () => g.delete(e);
|
|
87
|
+
}
|
|
88
|
+
function H(e) {
|
|
89
|
+
for (const t of g)
|
|
90
|
+
t !== e && t();
|
|
91
|
+
}
|
|
92
|
+
return K(Y, {
|
|
93
|
+
isOpen: n,
|
|
94
|
+
isClosing: s,
|
|
95
|
+
trigger: f("click"),
|
|
96
|
+
triggerEl: x,
|
|
97
|
+
placement: f("bottom"),
|
|
98
|
+
open: v,
|
|
99
|
+
close: c,
|
|
100
|
+
toggle: () => {
|
|
101
|
+
n.value ? c() : v();
|
|
102
|
+
},
|
|
103
|
+
closeAll: T,
|
|
104
|
+
registerSubMenu: R,
|
|
105
|
+
closeSiblingSubMenus: H,
|
|
106
|
+
reposition: () => {
|
|
107
|
+
}
|
|
108
|
+
}), E({ open: v, close: c, isOpen: n }), (e, t) => O((y(), $("div", {
|
|
109
|
+
ref_key: "wrapperRef",
|
|
110
|
+
ref: x,
|
|
111
|
+
class: "cui-context-menu",
|
|
112
|
+
onContextmenu: B
|
|
113
|
+
}, [
|
|
114
|
+
D(e.$slots, "default", {}, void 0, !0),
|
|
115
|
+
(y(), I(U, { to: "body" }, [
|
|
116
|
+
n.value || s.value ? (y(), $("div", {
|
|
117
|
+
key: 0,
|
|
118
|
+
ref_key: "menuRef",
|
|
119
|
+
ref: m,
|
|
120
|
+
class: N(["cui-context-menu__panel", { "cui-context-menu__panel--closing": s.value }]),
|
|
121
|
+
"data-cui-context-menu-id": k,
|
|
122
|
+
style: j({ ...h.value, minWidth: p.minWidth }),
|
|
123
|
+
role: "menu",
|
|
124
|
+
onKeydown: _
|
|
125
|
+
}, [
|
|
126
|
+
D(e.$slots, "menu", {}, void 0, !0)
|
|
127
|
+
], 38)) : P("", !0)
|
|
128
|
+
]))
|
|
129
|
+
], 544)), [
|
|
130
|
+
[V, !p.hidden]
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export {
|
|
135
|
+
J as default
|
|
136
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as u, computed as p, withDirectives as f, openBlock as l, createBlock as y, unref as o, withCtx as i, createVNode as n, createElementBlock as C, toDisplayString as h, createCommentVNode as z, normalizeStyle as v, vShow as S } from "vue";
|
|
2
|
+
import { clampSize as x } from "../utils/sizing.js";
|
|
3
|
+
import B from "./CuiButton.vue.js";
|
|
4
|
+
import k from "./CuiIcon.vue.js";
|
|
5
|
+
import w from "./CuiTooltip.vue.js";
|
|
6
|
+
import { useCopyToClipboard as D } from "../composables/useCopyToClipboard.js";
|
|
7
|
+
const T = { key: 0 }, O = /* @__PURE__ */ u({
|
|
8
|
+
__name: "CuiCopyButton",
|
|
9
|
+
props: {
|
|
10
|
+
value: {},
|
|
11
|
+
variant: { default: "ghost" },
|
|
12
|
+
tooltip: { default: "Copy" },
|
|
13
|
+
copiedTooltip: { default: "Copied!" },
|
|
14
|
+
resetDelay: { default: 2e3 },
|
|
15
|
+
showLabel: { type: Boolean, default: !1 },
|
|
16
|
+
hidden: { type: Boolean, default: !1 },
|
|
17
|
+
color: { default: "primary" },
|
|
18
|
+
size: { default: "sm" }
|
|
19
|
+
},
|
|
20
|
+
setup(e) {
|
|
21
|
+
const r = ["xs", "sm", "md"], a = e, { copied: t, copy: c } = D(a.resetDelay);
|
|
22
|
+
function s() {
|
|
23
|
+
c(a.value);
|
|
24
|
+
}
|
|
25
|
+
const m = {
|
|
26
|
+
xs: "0.75rem",
|
|
27
|
+
sm: "0.875rem",
|
|
28
|
+
md: "1rem"
|
|
29
|
+
}, d = p(() => x(a.size, r));
|
|
30
|
+
return (b, E) => f((l(), y(w, {
|
|
31
|
+
text: o(t) ? e.copiedTooltip : e.tooltip,
|
|
32
|
+
placement: "top",
|
|
33
|
+
"show-delay": 300
|
|
34
|
+
}, {
|
|
35
|
+
default: i(() => [
|
|
36
|
+
n(B, {
|
|
37
|
+
size: e.size,
|
|
38
|
+
variant: e.variant,
|
|
39
|
+
color: o(t) ? "success" : e.color,
|
|
40
|
+
onClick: s
|
|
41
|
+
}, {
|
|
42
|
+
prefix: i(() => [
|
|
43
|
+
n(k, {
|
|
44
|
+
name: o(t) ? "check" : "copy",
|
|
45
|
+
size: m[d.value],
|
|
46
|
+
style: v({ transition: "transform 0.15s ease", transform: o(t) ? "scale(1.1)" : "scale(1)" })
|
|
47
|
+
}, null, 8, ["name", "size", "style"])
|
|
48
|
+
]),
|
|
49
|
+
default: i(() => [
|
|
50
|
+
e.showLabel ? (l(), C("span", T, h(o(t) ? "Copied" : "Copy"), 1)) : z("", !0)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["size", "variant", "color"])
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["text"])), [
|
|
57
|
+
[S, !e.hidden]
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
O as default
|
|
63
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DataGridColumn, DataGridRow, DataGridBulkAction, DataGridRowAction, DataGridQueryParams, DataGridViewConfig, DataGridViewAdapter, PaginatedData } from "../types/data-grid";
|
|
2
2
|
import type { TableSize } from "./table-context";
|
|
3
3
|
import type { HideableProps } from "../types/common";
|
|
4
|
-
export interface CuiDataGridProps extends HideableProps {
|
|
4
|
+
export interface CuiDataGridProps<T extends object = DataGridRow> extends HideableProps {
|
|
5
5
|
/** Column definitions */
|
|
6
6
|
columns: DataGridColumn[];
|
|
7
|
-
/** Data source — array for client-side, PaginatedData for server-side */
|
|
8
|
-
data:
|
|
7
|
+
/** Data source — array for client-side, PaginatedData for server-side. Generic over the row type so cell slots, emits, and data are typed. */
|
|
8
|
+
data: T[] | PaginatedData<T>;
|
|
9
9
|
/** Server-side mode — emits navigate events instead of processing locally */
|
|
10
10
|
serverSide?: boolean;
|
|
11
11
|
/** Row identifier key */
|
|
@@ -62,83 +62,57 @@ export interface CuiDataGridProps extends HideableProps {
|
|
|
62
62
|
*/
|
|
63
63
|
virtualRowHeight?: number;
|
|
64
64
|
}
|
|
65
|
-
declare
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
}) => any) | undefined;
|
|
106
|
-
"onRow-action"?: ((payload: {
|
|
65
|
+
declare const _default: <T extends object = DataGridRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
66
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
67
|
+
readonly "onRow-click"?: ((payload: {
|
|
68
|
+
row: T;
|
|
69
|
+
}) => any) | undefined;
|
|
70
|
+
readonly "onRow-action"?: ((payload: {
|
|
71
|
+
action: DataGridRowAction;
|
|
72
|
+
row: T;
|
|
73
|
+
}) => any) | undefined;
|
|
74
|
+
readonly onNavigate?: ((params: DataGridQueryParams) => any) | undefined;
|
|
75
|
+
readonly "onBulk-action"?: ((payload: {
|
|
76
|
+
action: DataGridBulkAction;
|
|
77
|
+
rows: T[];
|
|
78
|
+
}) => any) | undefined;
|
|
79
|
+
readonly "onSelection-change"?: ((selectedIds: string[]) => any) | undefined;
|
|
80
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRow-click" | "onRow-action" | "onNavigate" | "onBulk-action" | "onSelection-change"> & CuiDataGridProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
81
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
82
|
+
clearSelection: () => void;
|
|
83
|
+
getQueryParams: () => DataGridQueryParams;
|
|
84
|
+
getConfig: () => DataGridViewConfig;
|
|
85
|
+
loadConfig: (config: DataGridViewConfig) => void;
|
|
86
|
+
resetToDefaults: () => void;
|
|
87
|
+
}>): void;
|
|
88
|
+
attrs: any;
|
|
89
|
+
slots: {
|
|
90
|
+
"toolbar-start"?: () => unknown;
|
|
91
|
+
"toolbar-end"?: () => unknown;
|
|
92
|
+
empty?: () => unknown;
|
|
93
|
+
card?: (props: {
|
|
94
|
+
row: T;
|
|
95
|
+
}) => unknown;
|
|
96
|
+
} & {
|
|
97
|
+
[x: `cell-${string}`]: ((props: {
|
|
98
|
+
value: unknown;
|
|
99
|
+
row: T;
|
|
100
|
+
}) => unknown) | undefined;
|
|
101
|
+
};
|
|
102
|
+
emit: ((evt: "row-click", payload: {
|
|
103
|
+
row: T;
|
|
104
|
+
}) => void) & ((evt: "row-action", payload: {
|
|
107
105
|
action: DataGridRowAction;
|
|
108
|
-
row:
|
|
109
|
-
}) =>
|
|
110
|
-
onNavigate?: ((params: DataGridQueryParams) => any) | undefined;
|
|
111
|
-
"onBulk-action"?: ((payload: {
|
|
106
|
+
row: T;
|
|
107
|
+
}) => void) & ((evt: "navigate", params: DataGridQueryParams) => void) & ((evt: "bulk-action", payload: {
|
|
112
108
|
action: DataGridBulkAction;
|
|
113
|
-
rows:
|
|
114
|
-
}) =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
hidden: boolean;
|
|
118
|
-
size: TableSize;
|
|
119
|
-
loading: boolean;
|
|
120
|
-
perPageOptions: number[];
|
|
121
|
-
striped: boolean;
|
|
122
|
-
hoverable: boolean;
|
|
123
|
-
bordered: boolean;
|
|
124
|
-
stickyHeader: boolean;
|
|
125
|
-
serverSide: boolean;
|
|
126
|
-
rowKey: string;
|
|
127
|
-
hideSearch: boolean;
|
|
128
|
-
hideColumnManager: boolean;
|
|
129
|
-
showSelectAll: boolean;
|
|
130
|
-
virtualize: boolean;
|
|
131
|
-
hideToolbar: boolean;
|
|
132
|
-
hidePagination: boolean;
|
|
133
|
-
hideFilterPanel: boolean;
|
|
134
|
-
filterPanelSide: "left" | "right";
|
|
135
|
-
hydrateUrl: boolean;
|
|
136
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
137
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
138
|
-
export default _default;
|
|
139
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
140
|
-
new (): {
|
|
141
|
-
$slots: S;
|
|
142
|
-
};
|
|
109
|
+
rows: T[];
|
|
110
|
+
}) => void) & ((evt: "selection-change", selectedIds: string[]) => void);
|
|
111
|
+
}>) => import("vue").VNode & {
|
|
112
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
143
113
|
};
|
|
114
|
+
export default _default;
|
|
115
|
+
type __VLS_PrettifyLocal<T> = {
|
|
116
|
+
[K in keyof T]: T[K];
|
|
117
|
+
} & {};
|
|
144
118
|
//# sourceMappingURL=CuiDataGrid.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiDataGrid.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGrid.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiDataGrid.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGrid.vue"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { defineComponent as p, useSlots as z, toRef as A, watch as b, withDirectives as D, openBlock as i, createElementBlock as c, createBlock as s, withCtx as f, renderSlot as u, createCommentVNode as h, createVNode as m, unref as n, normalizeStyle as R, createElementVNode as V, normalizeProps as S, guardReactiveProps as B, createSlots as x, renderList as H, createTextVNode as T, toDisplayString as G, vShow as K } from "vue";
|
|
2
|
+
import { useDataGrid as N, provideDataGrid as M } from "../composables/useDataGrid.js";
|
|
3
|
+
import Q from "./CuiDataGridToolbar.vue.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import E from "./CuiDataGridTable.vue.js";
|
|
6
|
+
import F from "./CuiDataGridCardView.vue.js";
|
|
7
|
+
import U from "./CuiDataGridPagination.vue.js";
|
|
8
|
+
import I from "./CuiDataGridBulkBar.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import O from "./CuiDataGridFilterPanel.vue.js";
|
|
11
|
+
/* empty css */
|
|
12
|
+
import L from "./CuiDataGridActiveFilters.vue.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import j from "./CuiEmptyState.vue.js";
|
|
15
|
+
import q from "./CuiSkeleton.vue.js";
|
|
16
|
+
import { useMessages as J } from "../composables/useMessages.js";
|
|
17
|
+
const W = { class: "cui-data-grid" }, X = {
|
|
18
|
+
key: 1,
|
|
19
|
+
style: { padding: "calc(1rem * var(--cui-density-scale, 1))" }
|
|
20
|
+
}, Y = { key: 2 }, Z = { style: { flex: "1", "min-width": "0" } }, ge = /* @__PURE__ */ p({
|
|
21
|
+
__name: "CuiDataGrid",
|
|
22
|
+
props: {
|
|
23
|
+
columns: {},
|
|
24
|
+
data: {},
|
|
25
|
+
serverSide: { type: Boolean, default: !1 },
|
|
26
|
+
rowKey: { default: "id" },
|
|
27
|
+
bulkActions: {},
|
|
28
|
+
showSelectAll: { type: Boolean, default: !0 },
|
|
29
|
+
stickyHeader: { type: Boolean, default: !0 },
|
|
30
|
+
maxHeight: {},
|
|
31
|
+
striped: { type: Boolean, default: !1 },
|
|
32
|
+
hoverable: { type: Boolean, default: !0 },
|
|
33
|
+
bordered: { type: Boolean, default: !1 },
|
|
34
|
+
size: { default: "md" },
|
|
35
|
+
loading: { type: Boolean, default: !1 },
|
|
36
|
+
perPageOptions: { default: () => [15, 25, 50, 100] },
|
|
37
|
+
hideToolbar: { type: Boolean, default: !1 },
|
|
38
|
+
hidePagination: { type: Boolean, default: !1 },
|
|
39
|
+
hideSearch: { type: Boolean, default: !1 },
|
|
40
|
+
hideColumnManager: { type: Boolean, default: !1 },
|
|
41
|
+
hideFilterPanel: { type: Boolean, default: !1 },
|
|
42
|
+
filterPanelSide: { default: "right" },
|
|
43
|
+
gridId: {},
|
|
44
|
+
viewAdapter: {},
|
|
45
|
+
initialView: {},
|
|
46
|
+
hydrateUrl: { type: Boolean, default: !1 },
|
|
47
|
+
virtualize: { type: Boolean, default: !1 },
|
|
48
|
+
virtualRowHeight: {},
|
|
49
|
+
hidden: { type: Boolean, default: !1 }
|
|
50
|
+
},
|
|
51
|
+
emits: ["navigate", "row-click", "row-action", "bulk-action", "selection-change"],
|
|
52
|
+
setup(e, { expose: C, emit: P }) {
|
|
53
|
+
var w;
|
|
54
|
+
const l = e, d = P, $ = z(), t = N({
|
|
55
|
+
columns: l.columns,
|
|
56
|
+
// The grid internals operate on the loose DataGridRow shape; T is a public-API
|
|
57
|
+
// refinement, so cast once here at the boundary.
|
|
58
|
+
data: A(l, "data"),
|
|
59
|
+
serverSide: l.serverSide,
|
|
60
|
+
rowKey: l.rowKey,
|
|
61
|
+
defaultPerPage: ((w = l.perPageOptions) == null ? void 0 : w[0]) ?? 15,
|
|
62
|
+
initialView: l.initialView,
|
|
63
|
+
hydrateFromUrl: l.hydrateUrl
|
|
64
|
+
});
|
|
65
|
+
M(t), b(
|
|
66
|
+
() => t.selectedRows.value,
|
|
67
|
+
(o) => {
|
|
68
|
+
d("selection-change", [...o]);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
function g() {
|
|
72
|
+
l.serverSide && d("navigate", t.getQueryParams());
|
|
73
|
+
}
|
|
74
|
+
b(
|
|
75
|
+
[() => t.sort.value, () => t.filters.value, () => t.searchQuery.value, () => t.page.value, () => t.perPage.value],
|
|
76
|
+
() => {
|
|
77
|
+
g();
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const y = !!$.card;
|
|
81
|
+
C({
|
|
82
|
+
clearSelection: t.clearSelection,
|
|
83
|
+
getQueryParams: t.getQueryParams,
|
|
84
|
+
getConfig: t.getConfig,
|
|
85
|
+
loadConfig: t.loadConfig,
|
|
86
|
+
resetToDefaults: t.resetToDefaults
|
|
87
|
+
});
|
|
88
|
+
const v = J();
|
|
89
|
+
return (o, r) => D((i(), c("div", W, [
|
|
90
|
+
e.hideToolbar ? h("", !0) : (i(), s(Q, {
|
|
91
|
+
key: 0,
|
|
92
|
+
"hide-search": e.hideSearch,
|
|
93
|
+
"hide-column-manager": e.hideColumnManager,
|
|
94
|
+
"hide-filter-toggle": e.hideFilterPanel,
|
|
95
|
+
"has-card-slot": y,
|
|
96
|
+
"grid-id": e.gridId,
|
|
97
|
+
"view-adapter": e.viewAdapter
|
|
98
|
+
}, {
|
|
99
|
+
"toolbar-start": f(() => [
|
|
100
|
+
u(o.$slots, "toolbar-start")
|
|
101
|
+
]),
|
|
102
|
+
"toolbar-end": f(() => [
|
|
103
|
+
u(o.$slots, "toolbar-end")
|
|
104
|
+
]),
|
|
105
|
+
_: 3
|
|
106
|
+
}, 8, ["hide-search", "hide-column-manager", "hide-filter-toggle", "grid-id", "view-adapter"])),
|
|
107
|
+
m(L),
|
|
108
|
+
e.loading ? (i(), c("div", X, [
|
|
109
|
+
m(q, { lines: 8 })
|
|
110
|
+
])) : n(t).displayData.value.length === 0 ? (i(), c("div", Y, [
|
|
111
|
+
u(o.$slots, "empty", {}, () => [
|
|
112
|
+
m(j, {
|
|
113
|
+
icon: "magnifying-glass",
|
|
114
|
+
title: n(v).dataGrid.noResultsTitle,
|
|
115
|
+
description: n(v).dataGrid.noResultsDescription,
|
|
116
|
+
size: "md",
|
|
117
|
+
color: "secondary"
|
|
118
|
+
}, null, 8, ["title", "description"])
|
|
119
|
+
])
|
|
120
|
+
])) : (i(), c("div", {
|
|
121
|
+
key: 3,
|
|
122
|
+
class: "cui-data-grid__content",
|
|
123
|
+
style: R({ flexDirection: e.filterPanelSide === "left" ? "row-reverse" : "row" })
|
|
124
|
+
}, [
|
|
125
|
+
V("div", Z, [
|
|
126
|
+
n(t).viewMode.value === "card" && y ? (i(), s(F, {
|
|
127
|
+
key: 0,
|
|
128
|
+
"row-key": e.rowKey
|
|
129
|
+
}, {
|
|
130
|
+
card: f((a) => [
|
|
131
|
+
u(o.$slots, "card", S(B(a)))
|
|
132
|
+
]),
|
|
133
|
+
_: 3
|
|
134
|
+
}, 8, ["row-key"])) : (i(), s(E, {
|
|
135
|
+
key: 1,
|
|
136
|
+
"row-key": e.rowKey,
|
|
137
|
+
"bulk-actions": e.bulkActions,
|
|
138
|
+
"show-select-all": e.showSelectAll,
|
|
139
|
+
"sticky-header": e.stickyHeader,
|
|
140
|
+
"max-height": e.maxHeight,
|
|
141
|
+
striped: e.striped,
|
|
142
|
+
hoverable: e.hoverable,
|
|
143
|
+
bordered: e.bordered,
|
|
144
|
+
size: e.size,
|
|
145
|
+
virtualize: e.virtualize,
|
|
146
|
+
"virtual-row-height": e.virtualRowHeight,
|
|
147
|
+
onRowClick: r[0] || (r[0] = (a) => d("row-click", a)),
|
|
148
|
+
onRowAction: r[1] || (r[1] = (a) => d("row-action", a))
|
|
149
|
+
}, x({ _: 2 }, [
|
|
150
|
+
H(n(t).visibleColumns.value, (a) => ({
|
|
151
|
+
name: `cell-${a.key}`,
|
|
152
|
+
fn: f((k) => [
|
|
153
|
+
u(o.$slots, `cell-${a.key}`, S(B(k)), () => [
|
|
154
|
+
T(G(k.value), 1)
|
|
155
|
+
])
|
|
156
|
+
])
|
|
157
|
+
}))
|
|
158
|
+
]), 1032, ["row-key", "bulk-actions", "show-select-all", "sticky-header", "max-height", "striped", "hoverable", "bordered", "size", "virtualize", "virtual-row-height"]))
|
|
159
|
+
]),
|
|
160
|
+
m(O)
|
|
161
|
+
], 4)),
|
|
162
|
+
!e.hidePagination && !e.loading && n(t).displayData.value.length > 0 ? (i(), s(U, {
|
|
163
|
+
key: 4,
|
|
164
|
+
onNavigate: g
|
|
165
|
+
})) : h("", !0),
|
|
166
|
+
e.bulkActions && e.bulkActions.length > 0 ? (i(), s(I, {
|
|
167
|
+
key: 5,
|
|
168
|
+
actions: e.bulkActions,
|
|
169
|
+
onBulkAction: r[2] || (r[2] = (a) => d("bulk-action", a))
|
|
170
|
+
}, null, 8, ["actions"])) : h("", !0)
|
|
171
|
+
], 512)), [
|
|
172
|
+
[K, !e.hidden]
|
|
173
|
+
]);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
export {
|
|
177
|
+
ge as default
|
|
178
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as p, computed as k, openBlock as l, createElementBlock as s, Fragment as g, renderList as C, createBlock as u, unref as m, withCtx as d, createTextVNode as v, toDisplayString as c, createCommentVNode as y } from "vue";
|
|
2
|
+
import { useDataGridState as _ } from "../composables/useDataGrid.js";
|
|
3
|
+
import f from "./CuiBadge.vue.js";
|
|
4
|
+
import b from "./CuiButton.vue.js";
|
|
5
|
+
const x = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "cui-data-grid-active-filters"
|
|
8
|
+
}, h = /* @__PURE__ */ p({
|
|
9
|
+
__name: "CuiDataGridActiveFilters",
|
|
10
|
+
setup(B) {
|
|
11
|
+
const a = _(), o = k(
|
|
12
|
+
() => a.filters.value.map((t) => {
|
|
13
|
+
const e = a.columns.find((n) => (n.filterKey ?? n.key) === t.key), r = (e == null ? void 0 : e.label) ?? t.key, i = Array.isArray(t.value) ? t.value.join(", ") : t.value;
|
|
14
|
+
return { key: t.key, label: r, displayValue: i };
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
return (t, e) => o.value.length > 0 ? (l(), s("div", x, [
|
|
18
|
+
(l(!0), s(g, null, C(o.value, (r) => (l(), u(f, {
|
|
19
|
+
key: r.key,
|
|
20
|
+
variant: "subtle",
|
|
21
|
+
color: "primary",
|
|
22
|
+
size: "sm",
|
|
23
|
+
removable: "",
|
|
24
|
+
onRemove: (i) => m(a).removeFilter(r.key)
|
|
25
|
+
}, {
|
|
26
|
+
default: d(() => [
|
|
27
|
+
v(c(r.label) + ": " + c(r.displayValue), 1)
|
|
28
|
+
]),
|
|
29
|
+
_: 2
|
|
30
|
+
}, 1032, ["onRemove"]))), 128)),
|
|
31
|
+
o.value.length > 1 ? (l(), u(b, {
|
|
32
|
+
key: 0,
|
|
33
|
+
variant: "ghost",
|
|
34
|
+
size: "xs",
|
|
35
|
+
onClick: e[0] || (e[0] = (r) => m(a).clearFilters())
|
|
36
|
+
}, {
|
|
37
|
+
default: d(() => [...e[1] || (e[1] = [
|
|
38
|
+
v(" Clear all ", -1)
|
|
39
|
+
])]),
|
|
40
|
+
_: 1
|
|
41
|
+
})) : y("", !0)
|
|
42
|
+
])) : y("", !0);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
h as default
|
|
47
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiDataGridBulkBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGridBulkBar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiDataGridBulkBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGridBulkBar.vue"],"names":[],"mappings":"AAyHA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAO1E,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;;;gBAImC,kBAAkB;cAAQ,WAAW,EAAE;;;;gBAAvC,kBAAkB;cAAQ,WAAW,EAAE;;;AAyJ5E,wBAOG"}
|