@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,336 @@
|
|
|
1
|
+
import { defineComponent as X, computed as c, ref as Y, openBlock as r, createBlock as s, unref as d, withCtx as n, createVNode as f, normalizeStyle as p, createCommentVNode as y, createElementBlock as k, Fragment as b, renderList as w, createElementVNode as _, createTextVNode as S, toDisplayString as z, withModifiers as T, renderSlot as Z } from "vue";
|
|
2
|
+
import { useDataGridState as ee } from "../composables/useDataGrid.js";
|
|
3
|
+
import { useVirtualScroll as te } from "../composables/useVirtualScroll.js";
|
|
4
|
+
import le from "./CuiTable.vue.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import ae from "./CuiTableHead.vue.js";
|
|
7
|
+
import ie from "./CuiTableBody.vue.js";
|
|
8
|
+
import M from "./CuiTableRow.vue.js";
|
|
9
|
+
import h from "./CuiTableCell.vue.js";
|
|
10
|
+
import N from "./CuiCheckbox.vue.js";
|
|
11
|
+
import W from "./CuiIcon.vue.js";
|
|
12
|
+
import re from "./CuiDropdown.vue.js";
|
|
13
|
+
import ne from "./CuiDropdownTrigger.vue.js";
|
|
14
|
+
import oe from "./CuiDropdownMenu.vue.js";
|
|
15
|
+
import E from "./CuiDropdownItem.vue.js";
|
|
16
|
+
import ue from "./CuiButton.vue.js";
|
|
17
|
+
import se from "./CuiContextMenu.vue.js";
|
|
18
|
+
const de = { style: { display: "inline-flex", "align-items": "center", gap: "calc(0.25rem * var(--cui-density-scale, 1))" } }, ce = ["colspan"], fe = ["colspan"], He = /* @__PURE__ */ X({
|
|
19
|
+
__name: "CuiDataGridTable",
|
|
20
|
+
props: {
|
|
21
|
+
rowKey: { default: "id" },
|
|
22
|
+
bulkActions: {},
|
|
23
|
+
showSelectAll: { type: Boolean, default: !0 },
|
|
24
|
+
stickyHeader: { type: Boolean, default: !0 },
|
|
25
|
+
maxHeight: {},
|
|
26
|
+
striped: { type: Boolean, default: !1 },
|
|
27
|
+
hoverable: { type: Boolean, default: !0 },
|
|
28
|
+
bordered: { type: Boolean, default: !1 },
|
|
29
|
+
size: { default: "md" },
|
|
30
|
+
virtualize: { type: Boolean, default: !1 },
|
|
31
|
+
virtualRowHeight: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["row-click", "row-action"],
|
|
34
|
+
setup(u, { emit: U }) {
|
|
35
|
+
const m = u, $ = U, i = ee(), g = c(() => {
|
|
36
|
+
var t;
|
|
37
|
+
return (((t = m.bulkActions) == null ? void 0 : t.length) ?? 0) > 0;
|
|
38
|
+
}), C = c(
|
|
39
|
+
() => i.displayData.value.some((t) => t._actions && t._actions.length > 0)
|
|
40
|
+
);
|
|
41
|
+
function B(t) {
|
|
42
|
+
return String(t[m.rowKey] ?? "");
|
|
43
|
+
}
|
|
44
|
+
function D(t) {
|
|
45
|
+
return i.selectedRows.value.has(B(t));
|
|
46
|
+
}
|
|
47
|
+
const H = c(() => {
|
|
48
|
+
const t = i.displayData.value;
|
|
49
|
+
if (t.length === 0) return !1;
|
|
50
|
+
const a = t.filter((e) => D(e)).length;
|
|
51
|
+
return a === 0 ? !1 : a === t.length ? !0 : "indeterminate";
|
|
52
|
+
});
|
|
53
|
+
function G(t) {
|
|
54
|
+
t ? i.selectAll(i.displayData.value) : i.clearSelection();
|
|
55
|
+
}
|
|
56
|
+
function x(t) {
|
|
57
|
+
return t._actions ?? [];
|
|
58
|
+
}
|
|
59
|
+
function O(t) {
|
|
60
|
+
var o;
|
|
61
|
+
const a = i.columns.find((l) => l.key === t), e = (a == null ? void 0 : a.sortKey) ?? t;
|
|
62
|
+
return ((o = i.sort.value) == null ? void 0 : o.key) === e ? i.sort.value.direction === "asc" ? "caret-up" : "caret-down" : "caret-up-down";
|
|
63
|
+
}
|
|
64
|
+
function F(t) {
|
|
65
|
+
var o;
|
|
66
|
+
const a = i.columns.find((l) => l.key === t), e = (a == null ? void 0 : a.sortKey) ?? t;
|
|
67
|
+
return ((o = i.sort.value) == null ? void 0 : o.key) === e ? "1" : "0.3";
|
|
68
|
+
}
|
|
69
|
+
const L = c(() => {
|
|
70
|
+
const t = i.visibleColumns.value;
|
|
71
|
+
if (!t.some((o) => o.width)) return;
|
|
72
|
+
let e = 0;
|
|
73
|
+
g.value && (e += 48);
|
|
74
|
+
for (const o of t)
|
|
75
|
+
e += parseInt(o.width ?? "150", 10) || 150;
|
|
76
|
+
return C.value && (e += 48), `${e}px`;
|
|
77
|
+
}), V = c(() => {
|
|
78
|
+
const t = /* @__PURE__ */ new Map();
|
|
79
|
+
let a = 0;
|
|
80
|
+
g.value && (a += 48);
|
|
81
|
+
for (const e of i.visibleColumns.value)
|
|
82
|
+
e.sticky && e.width ? (t.set(e.key, `${a}px`), a += parseInt(e.width, 10) || 0) : e.sticky && t.set(e.key, `${a}px`);
|
|
83
|
+
return t;
|
|
84
|
+
}), A = c(() => {
|
|
85
|
+
const t = i.visibleColumns.value;
|
|
86
|
+
for (let a = t.length - 1; a >= 0; a--)
|
|
87
|
+
if (t[a].sticky) return t[a].key;
|
|
88
|
+
return null;
|
|
89
|
+
});
|
|
90
|
+
function j(t) {
|
|
91
|
+
const a = V.value.get(t);
|
|
92
|
+
if (!a) return;
|
|
93
|
+
const e = {
|
|
94
|
+
position: "sticky",
|
|
95
|
+
left: a,
|
|
96
|
+
zIndex: 4,
|
|
97
|
+
background: "var(--cui-table-head-bg, var(--color-surface-50))"
|
|
98
|
+
};
|
|
99
|
+
return t === A.value && (e.boxShadow = "2px 0 4px -1px rgba(0,0,0,0.08)"), e;
|
|
100
|
+
}
|
|
101
|
+
function q(t) {
|
|
102
|
+
const a = V.value.get(t.key), e = !!a, o = m.stickyHeader, l = t.sortable ? { cursor: "pointer", userSelect: "none" } : {};
|
|
103
|
+
return (e || o) && (l.position = "sticky", l.background = "var(--cui-table-head-bg, var(--color-surface-50))", l.zIndex = e && o ? 11 : e ? 5 : 10), o && (l.top = 0), e && (l.left = a, t.key === A.value && (l.boxShadow = "2px 0 4px -1px rgba(0,0,0,0.08)")), l;
|
|
104
|
+
}
|
|
105
|
+
const I = c(
|
|
106
|
+
() => m.stickyHeader ? {
|
|
107
|
+
position: "sticky",
|
|
108
|
+
top: 0,
|
|
109
|
+
zIndex: 10,
|
|
110
|
+
background: "var(--cui-table-head-bg, var(--color-surface-50))"
|
|
111
|
+
} : {}
|
|
112
|
+
), R = Y(null);
|
|
113
|
+
function J(t) {
|
|
114
|
+
R.value = m.virtualize && m.maxHeight ? t : null;
|
|
115
|
+
}
|
|
116
|
+
const v = te(
|
|
117
|
+
c(() => i.displayData.value),
|
|
118
|
+
{
|
|
119
|
+
containerRef: R,
|
|
120
|
+
rowHeight: m.virtualRowHeight
|
|
121
|
+
}
|
|
122
|
+
), P = c(
|
|
123
|
+
() => m.virtualize ? v.visibleRows.value : i.displayData.value
|
|
124
|
+
), K = c(() => {
|
|
125
|
+
let t = i.visibleColumns.value.length;
|
|
126
|
+
return g.value && (t += 1), C.value && (t += 1), t;
|
|
127
|
+
});
|
|
128
|
+
return (t, a) => (r(), s(le, {
|
|
129
|
+
ref: (e) => J((e == null ? void 0 : e.scrollWrapper) ?? null),
|
|
130
|
+
size: u.size,
|
|
131
|
+
striped: u.striped,
|
|
132
|
+
hoverable: u.hoverable,
|
|
133
|
+
bordered: u.bordered,
|
|
134
|
+
"sticky-header": u.stickyHeader,
|
|
135
|
+
"max-height": u.maxHeight,
|
|
136
|
+
"min-width": L.value,
|
|
137
|
+
"aria-rowcount": u.virtualize ? d(i).displayData.value.length + 1 : void 0
|
|
138
|
+
}, {
|
|
139
|
+
default: n(() => [
|
|
140
|
+
f(ae, null, {
|
|
141
|
+
default: n(() => [
|
|
142
|
+
f(M, {
|
|
143
|
+
"aria-rowindex": u.virtualize ? 1 : void 0
|
|
144
|
+
}, {
|
|
145
|
+
default: n(() => [
|
|
146
|
+
g.value ? (r(), s(h, {
|
|
147
|
+
key: 0,
|
|
148
|
+
width: "3rem",
|
|
149
|
+
align: "center",
|
|
150
|
+
style: p(I.value)
|
|
151
|
+
}, {
|
|
152
|
+
default: n(() => [
|
|
153
|
+
u.showSelectAll ? (r(), s(N, {
|
|
154
|
+
key: 0,
|
|
155
|
+
"model-value": H.value === !0,
|
|
156
|
+
indeterminate: H.value === "indeterminate",
|
|
157
|
+
"onUpdate:modelValue": G
|
|
158
|
+
}, null, 8, ["model-value", "indeterminate"])) : y("", !0)
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 8, ["style"])) : y("", !0),
|
|
162
|
+
(r(!0), k(b, null, w(d(i).visibleColumns.value, (e) => (r(), s(h, {
|
|
163
|
+
key: e.key,
|
|
164
|
+
align: e.align,
|
|
165
|
+
width: e.width,
|
|
166
|
+
nowrap: e.nowrap,
|
|
167
|
+
style: p(q(e)),
|
|
168
|
+
onClick: (o) => e.sortable ? d(i).applySort(e.key) : void 0
|
|
169
|
+
}, {
|
|
170
|
+
default: n(() => [
|
|
171
|
+
_("span", de, [
|
|
172
|
+
S(z(e.label) + " ", 1),
|
|
173
|
+
e.sortable ? (r(), s(W, {
|
|
174
|
+
key: 0,
|
|
175
|
+
name: O(e.key),
|
|
176
|
+
size: "0.875rem",
|
|
177
|
+
style: p({ opacity: F(e.key) })
|
|
178
|
+
}, null, 8, ["name", "style"])) : y("", !0)
|
|
179
|
+
])
|
|
180
|
+
]),
|
|
181
|
+
_: 2
|
|
182
|
+
}, 1032, ["align", "width", "nowrap", "style", "onClick"]))), 128)),
|
|
183
|
+
C.value ? (r(), s(h, {
|
|
184
|
+
key: 1,
|
|
185
|
+
width: "3rem",
|
|
186
|
+
style: p(I.value)
|
|
187
|
+
}, null, 8, ["style"])) : y("", !0)
|
|
188
|
+
]),
|
|
189
|
+
_: 1
|
|
190
|
+
}, 8, ["aria-rowindex"])
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
}),
|
|
194
|
+
f(ie, null, {
|
|
195
|
+
default: n(() => [
|
|
196
|
+
u.virtualize && d(v).paddingTop.value > 0 ? (r(), k("tr", {
|
|
197
|
+
key: 0,
|
|
198
|
+
"aria-hidden": "true",
|
|
199
|
+
style: p({ height: `${d(v).paddingTop.value}px`, padding: 0, border: 0 })
|
|
200
|
+
}, [
|
|
201
|
+
_("td", {
|
|
202
|
+
colspan: K.value,
|
|
203
|
+
style: { padding: "0", border: "none" }
|
|
204
|
+
}, null, 8, ce)
|
|
205
|
+
], 4)) : y("", !0),
|
|
206
|
+
(r(!0), k(b, null, w(P.value, (e, o) => (r(), s(se, {
|
|
207
|
+
key: B(e),
|
|
208
|
+
disabled: x(e).length === 0
|
|
209
|
+
}, {
|
|
210
|
+
menu: n(() => [
|
|
211
|
+
(r(!0), k(b, null, w(x(e), (l) => (r(), s(E, {
|
|
212
|
+
key: l.key,
|
|
213
|
+
onSelect: (Q) => $("row-action", { action: l, row: e })
|
|
214
|
+
}, {
|
|
215
|
+
default: n(() => [
|
|
216
|
+
S(z(l.label), 1)
|
|
217
|
+
]),
|
|
218
|
+
_: 2
|
|
219
|
+
}, 1032, ["onSelect"]))), 128))
|
|
220
|
+
]),
|
|
221
|
+
default: n(() => [
|
|
222
|
+
f(M, {
|
|
223
|
+
ref_for: !0,
|
|
224
|
+
ref: (l) => {
|
|
225
|
+
u.virtualize && o === 0 && d(v).measureRow((l == null ? void 0 : l.rowEl) ?? null);
|
|
226
|
+
},
|
|
227
|
+
selected: D(e),
|
|
228
|
+
"aria-rowindex": u.virtualize ? d(v).firstVisibleIndex.value + o + 2 : void 0,
|
|
229
|
+
style: { cursor: "pointer" },
|
|
230
|
+
onClick: (l) => $("row-click", { row: e })
|
|
231
|
+
}, {
|
|
232
|
+
default: n(() => [
|
|
233
|
+
g.value ? (r(), s(h, {
|
|
234
|
+
key: 0,
|
|
235
|
+
align: "center",
|
|
236
|
+
onClick: a[0] || (a[0] = T(() => {
|
|
237
|
+
}, ["stop"]))
|
|
238
|
+
}, {
|
|
239
|
+
default: n(() => [
|
|
240
|
+
f(N, {
|
|
241
|
+
"model-value": D(e),
|
|
242
|
+
"onUpdate:modelValue": (l) => d(i).toggleSelection(B(e))
|
|
243
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
244
|
+
]),
|
|
245
|
+
_: 2
|
|
246
|
+
}, 1024)) : y("", !0),
|
|
247
|
+
(r(!0), k(b, null, w(d(i).visibleColumns.value, (l) => (r(), s(h, {
|
|
248
|
+
key: l.key,
|
|
249
|
+
align: l.align,
|
|
250
|
+
nowrap: l.nowrap,
|
|
251
|
+
style: p(j(l.key))
|
|
252
|
+
}, {
|
|
253
|
+
default: n(() => [
|
|
254
|
+
Z(t.$slots, `cell-${l.key}`, {
|
|
255
|
+
value: e[l.key],
|
|
256
|
+
row: e
|
|
257
|
+
}, () => [
|
|
258
|
+
S(z(e[l.key]), 1)
|
|
259
|
+
])
|
|
260
|
+
]),
|
|
261
|
+
_: 2
|
|
262
|
+
}, 1032, ["align", "nowrap", "style"]))), 128)),
|
|
263
|
+
C.value ? (r(), s(h, {
|
|
264
|
+
key: 1,
|
|
265
|
+
align: "right",
|
|
266
|
+
onClick: a[1] || (a[1] = T(() => {
|
|
267
|
+
}, ["stop"]))
|
|
268
|
+
}, {
|
|
269
|
+
default: n(() => [
|
|
270
|
+
x(e).length > 0 ? (r(), s(re, { key: 0 }, {
|
|
271
|
+
default: n(() => [
|
|
272
|
+
f(ne, null, {
|
|
273
|
+
default: n(() => [
|
|
274
|
+
f(ue, {
|
|
275
|
+
variant: "ghost",
|
|
276
|
+
size: "xs",
|
|
277
|
+
style: { opacity: "0.4" }
|
|
278
|
+
}, {
|
|
279
|
+
default: n(() => [
|
|
280
|
+
f(W, {
|
|
281
|
+
name: "dots-three",
|
|
282
|
+
size: "1rem"
|
|
283
|
+
})
|
|
284
|
+
]),
|
|
285
|
+
_: 1
|
|
286
|
+
})
|
|
287
|
+
]),
|
|
288
|
+
_: 1
|
|
289
|
+
}),
|
|
290
|
+
f(oe, null, {
|
|
291
|
+
default: n(() => [
|
|
292
|
+
(r(!0), k(b, null, w(x(e), (l) => (r(), s(E, {
|
|
293
|
+
key: l.key,
|
|
294
|
+
onSelect: (Q) => $("row-action", { action: l, row: e })
|
|
295
|
+
}, {
|
|
296
|
+
default: n(() => [
|
|
297
|
+
S(z(l.label), 1)
|
|
298
|
+
]),
|
|
299
|
+
_: 2
|
|
300
|
+
}, 1032, ["onSelect"]))), 128))
|
|
301
|
+
]),
|
|
302
|
+
_: 2
|
|
303
|
+
}, 1024)
|
|
304
|
+
]),
|
|
305
|
+
_: 2
|
|
306
|
+
}, 1024)) : y("", !0)
|
|
307
|
+
]),
|
|
308
|
+
_: 2
|
|
309
|
+
}, 1024)) : y("", !0)
|
|
310
|
+
]),
|
|
311
|
+
_: 2
|
|
312
|
+
}, 1032, ["selected", "aria-rowindex", "onClick"])
|
|
313
|
+
]),
|
|
314
|
+
_: 2
|
|
315
|
+
}, 1032, ["disabled"]))), 128)),
|
|
316
|
+
u.virtualize && d(v).paddingBottom.value > 0 ? (r(), k("tr", {
|
|
317
|
+
key: 1,
|
|
318
|
+
"aria-hidden": "true",
|
|
319
|
+
style: p({ height: `${d(v).paddingBottom.value}px`, padding: 0, border: 0 })
|
|
320
|
+
}, [
|
|
321
|
+
_("td", {
|
|
322
|
+
colspan: K.value,
|
|
323
|
+
style: { padding: "0", border: "none" }
|
|
324
|
+
}, null, 8, fe)
|
|
325
|
+
], 4)) : y("", !0)
|
|
326
|
+
]),
|
|
327
|
+
_: 3
|
|
328
|
+
})
|
|
329
|
+
]),
|
|
330
|
+
_: 3
|
|
331
|
+
}, 8, ["size", "striped", "hoverable", "bordered", "sticky-header", "max-height", "min-width", "aria-rowcount"]));
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
export {
|
|
335
|
+
He as default
|
|
336
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as g, computed as f, openBlock as t, createElementBlock as y, createElementVNode as s, renderSlot as u, createBlock as r, createCommentVNode as o, unref as l, normalizeStyle as p, withCtx as n, createTextVNode as c, toDisplayString as h, createVNode as v } from "vue";
|
|
2
|
+
import { useDataGridState as C } from "../composables/useDataGrid.js";
|
|
3
|
+
import k from "./CuiDataGridSearch.vue.js";
|
|
4
|
+
import B from "./CuiDataGridColumnManager.vue.js";
|
|
5
|
+
import b from "./CuiDataGridViewToggle.vue.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import S from "./CuiDataGridViewManager.vue.js";
|
|
8
|
+
import $ from "./CuiButton.vue.js";
|
|
9
|
+
import T from "./CuiIcon.vue.js";
|
|
10
|
+
import V from "./CuiBadge.vue.js";
|
|
11
|
+
const _ = { class: "cui-data-grid-toolbar" }, w = { class: "cui-data-grid-toolbar__start" }, F = { class: "cui-data-grid-toolbar__end" }, j = /* @__PURE__ */ g({
|
|
12
|
+
__name: "CuiDataGridToolbar",
|
|
13
|
+
props: {
|
|
14
|
+
hideSearch: { type: Boolean },
|
|
15
|
+
hideColumnManager: { type: Boolean },
|
|
16
|
+
hideFilterToggle: { type: Boolean },
|
|
17
|
+
hideViewToggle: { type: Boolean },
|
|
18
|
+
hasCardSlot: { type: Boolean },
|
|
19
|
+
gridId: {},
|
|
20
|
+
viewAdapter: {}
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const i = C(), d = f(() => i.filters.value.length);
|
|
24
|
+
return (m, a) => (t(), y("div", _, [
|
|
25
|
+
s("div", w, [
|
|
26
|
+
u(m.$slots, "toolbar-start"),
|
|
27
|
+
e.hideSearch ? o("", !0) : (t(), r(k, { key: 0 }))
|
|
28
|
+
]),
|
|
29
|
+
s("div", F, [
|
|
30
|
+
u(m.$slots, "toolbar-end"),
|
|
31
|
+
!e.hideFilterToggle && l(i).filterableColumns.value.length > 0 ? (t(), r($, {
|
|
32
|
+
key: 0,
|
|
33
|
+
variant: "outline",
|
|
34
|
+
size: "sm",
|
|
35
|
+
style: p({ background: l(i).filterPanelOpen.value ? "var(--cui-primary-bg)" : void 0 }),
|
|
36
|
+
onClick: a[0] || (a[0] = (z) => l(i).toggleFilterPanel())
|
|
37
|
+
}, {
|
|
38
|
+
prefix: n(() => [
|
|
39
|
+
v(T, {
|
|
40
|
+
name: "funnel",
|
|
41
|
+
size: "0.875rem"
|
|
42
|
+
})
|
|
43
|
+
]),
|
|
44
|
+
default: n(() => [
|
|
45
|
+
a[1] || (a[1] = c(" Filters ", -1)),
|
|
46
|
+
d.value > 0 ? (t(), r(V, {
|
|
47
|
+
key: 0,
|
|
48
|
+
color: "primary",
|
|
49
|
+
size: "sm",
|
|
50
|
+
style: { "margin-left": "0.25rem" }
|
|
51
|
+
}, {
|
|
52
|
+
default: n(() => [
|
|
53
|
+
c(h(d.value), 1)
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
})) : o("", !0)
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["style"])) : o("", !0),
|
|
60
|
+
e.hideColumnManager ? o("", !0) : (t(), r(B, { key: 1 })),
|
|
61
|
+
!e.hideViewToggle && e.hasCardSlot ? (t(), r(b, { key: 2 })) : o("", !0),
|
|
62
|
+
e.gridId ? (t(), r(S, {
|
|
63
|
+
key: 3,
|
|
64
|
+
"grid-id": e.gridId,
|
|
65
|
+
adapter: e.viewAdapter
|
|
66
|
+
}, null, 8, ["grid-id", "adapter"])) : o("", !0)
|
|
67
|
+
])
|
|
68
|
+
]));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
j as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { defineComponent as B, ref as w, onMounted as M, openBlock as n, createBlock as u, withCtx as a, createVNode as t, createTextVNode as l, unref as d, createCommentVNode as y, createElementBlock as k, Fragment as G, renderList as R, createElementVNode as g, toDisplayString as T, withModifiers as $, withKeys as A } from "vue";
|
|
2
|
+
import { useDataGridState as E } from "../composables/useDataGrid.js";
|
|
3
|
+
import { useDataGridViews as K } from "../composables/useDataGridViews.js";
|
|
4
|
+
import L from "./CuiDropdown.vue.js";
|
|
5
|
+
import j from "./CuiDropdownTrigger.vue.js";
|
|
6
|
+
import F from "./CuiDropdownMenu.vue.js";
|
|
7
|
+
import v from "./CuiDropdownItem.vue.js";
|
|
8
|
+
import x from "./CuiDropdownDivider.vue.js";
|
|
9
|
+
import H from "./CuiDropdownHeader.vue.js";
|
|
10
|
+
import D from "./CuiButton.vue.js";
|
|
11
|
+
import m from "./CuiIcon.vue.js";
|
|
12
|
+
import U from "./CuiInput.vue.js";
|
|
13
|
+
import q from "./CuiBadge.vue.js";
|
|
14
|
+
const J = { style: { display: "flex", "align-items": "center", "justify-content": "space-between", width: "100%" } }, O = { style: { display: "flex", "align-items": "center", gap: "calc(0.375rem * var(--cui-density-scale, 1))" } }, P = ["onClick"], Q = {
|
|
15
|
+
key: 3,
|
|
16
|
+
style: { padding: "calc(0.375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))", display: "flex", gap: "calc(0.375rem * var(--cui-density-scale, 1))" }
|
|
17
|
+
}, se = /* @__PURE__ */ B({
|
|
18
|
+
__name: "CuiDataGridViewManager",
|
|
19
|
+
props: {
|
|
20
|
+
gridId: {},
|
|
21
|
+
adapter: {}
|
|
22
|
+
},
|
|
23
|
+
setup(S) {
|
|
24
|
+
const V = S, r = E(), i = K({
|
|
25
|
+
gridId: V.gridId,
|
|
26
|
+
adapter: V.adapter
|
|
27
|
+
}), p = w(!1), s = w(""), c = w(!1);
|
|
28
|
+
M(() => {
|
|
29
|
+
i.fetchViews();
|
|
30
|
+
});
|
|
31
|
+
function z(f) {
|
|
32
|
+
const e = i.views.value.find((o) => o.id === f);
|
|
33
|
+
e && (r.loadConfig(e.config), i.selectView(f));
|
|
34
|
+
}
|
|
35
|
+
async function I() {
|
|
36
|
+
if (i.activeViewId.value) {
|
|
37
|
+
c.value = !0;
|
|
38
|
+
try {
|
|
39
|
+
await i.updateView(i.activeViewId.value, r.getConfig()), r.markClean();
|
|
40
|
+
} finally {
|
|
41
|
+
c.value = !1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function C() {
|
|
46
|
+
if (s.value.trim()) {
|
|
47
|
+
c.value = !0;
|
|
48
|
+
try {
|
|
49
|
+
await i.saveView(s.value.trim(), r.getConfig()), r.markClean(), s.value = "", p.value = !1;
|
|
50
|
+
} finally {
|
|
51
|
+
c.value = !1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function b(f) {
|
|
56
|
+
await i.removeView(f);
|
|
57
|
+
}
|
|
58
|
+
function _() {
|
|
59
|
+
r.resetToDefaults(), i.selectView("");
|
|
60
|
+
}
|
|
61
|
+
return (f, e) => (n(), u(L, null, {
|
|
62
|
+
default: a(() => [
|
|
63
|
+
t(j, null, {
|
|
64
|
+
default: a(() => [
|
|
65
|
+
t(D, {
|
|
66
|
+
variant: "outline",
|
|
67
|
+
size: "sm"
|
|
68
|
+
}, {
|
|
69
|
+
prefix: a(() => [
|
|
70
|
+
t(m, {
|
|
71
|
+
name: "bookmark-simple",
|
|
72
|
+
size: "0.875rem"
|
|
73
|
+
})
|
|
74
|
+
]),
|
|
75
|
+
default: a(() => [
|
|
76
|
+
e[2] || (e[2] = l(" Views ", -1)),
|
|
77
|
+
d(r).isDirty.value ? (n(), u(q, {
|
|
78
|
+
key: 0,
|
|
79
|
+
dot: "",
|
|
80
|
+
color: "warning",
|
|
81
|
+
animation: "pulse",
|
|
82
|
+
size: "sm",
|
|
83
|
+
style: { "margin-left": "0.25rem" }
|
|
84
|
+
})) : y("", !0)
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
})
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}),
|
|
91
|
+
t(F, { "min-width": "14rem" }, {
|
|
92
|
+
default: a(() => [
|
|
93
|
+
t(H, null, {
|
|
94
|
+
default: a(() => [...e[3] || (e[3] = [
|
|
95
|
+
l("Saved Views", -1)
|
|
96
|
+
])]),
|
|
97
|
+
_: 1
|
|
98
|
+
}),
|
|
99
|
+
d(i).views.value.length > 0 ? (n(!0), k(G, { key: 0 }, R(d(i).views.value, (o) => (n(), u(v, {
|
|
100
|
+
key: o.id,
|
|
101
|
+
"close-on-select": !0,
|
|
102
|
+
onSelect: (N) => z(o.id)
|
|
103
|
+
}, {
|
|
104
|
+
default: a(() => [
|
|
105
|
+
g("div", J, [
|
|
106
|
+
g("span", O, [
|
|
107
|
+
d(i).activeViewId.value === o.id ? (n(), u(m, {
|
|
108
|
+
key: 0,
|
|
109
|
+
name: "check",
|
|
110
|
+
size: "0.75rem",
|
|
111
|
+
style: { color: "var(--cui-primary)" }
|
|
112
|
+
})) : y("", !0),
|
|
113
|
+
l(" " + T(o.name), 1)
|
|
114
|
+
]),
|
|
115
|
+
g("button", {
|
|
116
|
+
style: { border: "none", background: "none", cursor: "pointer", padding: "calc(0.125rem * var(--cui-density-scale, 1))", color: "var(--cui-text-tertiary)", opacity: "0.6" },
|
|
117
|
+
onClick: $((N) => b(o.id), ["stop"])
|
|
118
|
+
}, [
|
|
119
|
+
t(m, {
|
|
120
|
+
name: "trash",
|
|
121
|
+
size: "0.75rem"
|
|
122
|
+
})
|
|
123
|
+
], 8, P)
|
|
124
|
+
])
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, 1032, ["onSelect"]))), 128)) : (n(), u(v, {
|
|
128
|
+
key: 1,
|
|
129
|
+
disabled: ""
|
|
130
|
+
}, {
|
|
131
|
+
default: a(() => [...e[4] || (e[4] = [
|
|
132
|
+
l("No saved views", -1)
|
|
133
|
+
])]),
|
|
134
|
+
_: 1
|
|
135
|
+
})),
|
|
136
|
+
t(x),
|
|
137
|
+
d(i).activeViewId.value && d(r).isDirty.value ? (n(), u(v, {
|
|
138
|
+
key: 2,
|
|
139
|
+
"close-on-select": !1,
|
|
140
|
+
onSelect: I
|
|
141
|
+
}, {
|
|
142
|
+
default: a(() => [
|
|
143
|
+
t(m, {
|
|
144
|
+
name: "floppy-disk",
|
|
145
|
+
size: "0.875rem",
|
|
146
|
+
style: { color: "var(--cui-text-secondary)" }
|
|
147
|
+
}),
|
|
148
|
+
e[5] || (e[5] = l(" Save current ", -1))
|
|
149
|
+
]),
|
|
150
|
+
_: 1
|
|
151
|
+
})) : y("", !0),
|
|
152
|
+
t(v, {
|
|
153
|
+
"close-on-select": !1,
|
|
154
|
+
onSelect: e[0] || (e[0] = (o) => p.value = !p.value)
|
|
155
|
+
}, {
|
|
156
|
+
default: a(() => [
|
|
157
|
+
t(m, {
|
|
158
|
+
name: "floppy-disk",
|
|
159
|
+
size: "0.875rem",
|
|
160
|
+
style: { color: "var(--cui-text-secondary)" }
|
|
161
|
+
}),
|
|
162
|
+
e[6] || (e[6] = l(" Save as... ", -1))
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}),
|
|
166
|
+
p.value ? (n(), k("div", Q, [
|
|
167
|
+
t(U, {
|
|
168
|
+
modelValue: s.value,
|
|
169
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => s.value = o),
|
|
170
|
+
placeholder: "View name",
|
|
171
|
+
size: "sm",
|
|
172
|
+
style: { flex: "1" },
|
|
173
|
+
onKeydown: A(C, ["enter"])
|
|
174
|
+
}, null, 8, ["modelValue"]),
|
|
175
|
+
t(D, {
|
|
176
|
+
size: "xs",
|
|
177
|
+
variant: "solid",
|
|
178
|
+
disabled: !s.value.trim() || c.value,
|
|
179
|
+
onClick: C
|
|
180
|
+
}, {
|
|
181
|
+
default: a(() => [...e[7] || (e[7] = [
|
|
182
|
+
l(" Save ", -1)
|
|
183
|
+
])]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, ["disabled"])
|
|
186
|
+
])) : y("", !0),
|
|
187
|
+
t(x),
|
|
188
|
+
t(v, { onSelect: _ }, {
|
|
189
|
+
default: a(() => [
|
|
190
|
+
t(m, {
|
|
191
|
+
name: "arrow-counter-clockwise",
|
|
192
|
+
size: "0.875rem",
|
|
193
|
+
style: { color: "var(--cui-text-secondary)" }
|
|
194
|
+
}),
|
|
195
|
+
e[8] || (e[8] = l(" Reset to defaults ", -1))
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})
|
|
199
|
+
]),
|
|
200
|
+
_: 1
|
|
201
|
+
})
|
|
202
|
+
]),
|
|
203
|
+
_: 1
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
export {
|
|
208
|
+
se as default
|
|
209
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as u, openBlock as l, createElementBlock as m, createVNode as i, unref as r, normalizeStyle as o, withCtx as a } from "vue";
|
|
2
|
+
import { useDataGridState as c } from "../composables/useDataGrid.js";
|
|
3
|
+
import s from "./CuiButton.vue.js";
|
|
4
|
+
import n from "./CuiIcon.vue.js";
|
|
5
|
+
const g = { class: "cui-data-grid-view-toggle" }, C = /* @__PURE__ */ u({
|
|
6
|
+
__name: "CuiDataGridViewToggle",
|
|
7
|
+
setup(v) {
|
|
8
|
+
const e = c();
|
|
9
|
+
return (p, t) => (l(), m("div", g, [
|
|
10
|
+
i(s, {
|
|
11
|
+
variant: "ghost",
|
|
12
|
+
size: "xs",
|
|
13
|
+
style: o({ background: r(e).viewMode.value === "grid" ? "var(--cui-primary-bg)" : void 0 }),
|
|
14
|
+
onClick: t[0] || (t[0] = (d) => r(e).setViewMode("grid"))
|
|
15
|
+
}, {
|
|
16
|
+
default: a(() => [
|
|
17
|
+
i(n, {
|
|
18
|
+
name: "table",
|
|
19
|
+
size: "0.875rem"
|
|
20
|
+
})
|
|
21
|
+
]),
|
|
22
|
+
_: 1
|
|
23
|
+
}, 8, ["style"]),
|
|
24
|
+
i(s, {
|
|
25
|
+
variant: "ghost",
|
|
26
|
+
size: "xs",
|
|
27
|
+
style: o({ background: r(e).viewMode.value === "card" ? "var(--cui-primary-bg)" : void 0 }),
|
|
28
|
+
onClick: t[1] || (t[1] = (d) => r(e).setViewMode("card"))
|
|
29
|
+
}, {
|
|
30
|
+
default: a(() => [
|
|
31
|
+
i(n, {
|
|
32
|
+
name: "squares-four",
|
|
33
|
+
size: "0.875rem"
|
|
34
|
+
})
|
|
35
|
+
]),
|
|
36
|
+
_: 1
|
|
37
|
+
}, 8, ["style"])
|
|
38
|
+
]));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
C as default
|
|
43
|
+
};
|