@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,73 @@
|
|
|
1
|
+
import { defineComponent as w, ref as v, computed as c, withDirectives as y, openBlock as s, createElementBlock as u, Fragment as z, renderList as B, createBlock as V, withCtx as b, renderSlot as k, mergeProps as E, vShow as A } from "vue";
|
|
2
|
+
import C from "./CuiTreeNode.vue.js";
|
|
3
|
+
import { scaleDensity as d } from "../utils/sizing.js";
|
|
4
|
+
const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
5
|
+
__name: "CuiTreeView",
|
|
6
|
+
props: {
|
|
7
|
+
nodes: {},
|
|
8
|
+
modelValue: {},
|
|
9
|
+
multiple: { type: Boolean, default: !1 },
|
|
10
|
+
defaultExpanded: {},
|
|
11
|
+
expandAll: { type: Boolean, default: !1 },
|
|
12
|
+
showLines: { type: Boolean, default: !0 },
|
|
13
|
+
selectable: { type: Boolean, default: !0 },
|
|
14
|
+
animated: { type: Boolean, default: !0 },
|
|
15
|
+
size: { default: "md" },
|
|
16
|
+
hidden: { type: Boolean, default: !1 }
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue", "node-click", "node-expand"],
|
|
19
|
+
setup(a, { emit: m }) {
|
|
20
|
+
const l = a, i = m, o = v(new Set(l.defaultExpanded ?? []));
|
|
21
|
+
if (l.expandAll) {
|
|
22
|
+
let e = function(t) {
|
|
23
|
+
for (const n of t)
|
|
24
|
+
n.children && n.children.length > 0 && (o.value.add(n.id), e(n.children));
|
|
25
|
+
};
|
|
26
|
+
e(l.nodes);
|
|
27
|
+
}
|
|
28
|
+
const r = c(() => l.modelValue == null ? /* @__PURE__ */ new Set() : Array.isArray(l.modelValue) ? new Set(l.modelValue) : /* @__PURE__ */ new Set([l.modelValue]));
|
|
29
|
+
function f(e) {
|
|
30
|
+
const t = new Set(o.value), n = t.has(e.id);
|
|
31
|
+
n ? t.delete(e.id) : t.add(e.id), o.value = t, i("node-expand", e, !n);
|
|
32
|
+
}
|
|
33
|
+
function p(e) {
|
|
34
|
+
if (!(!l.selectable || e.disabled))
|
|
35
|
+
if (i("node-click", e), l.multiple) {
|
|
36
|
+
const t = new Set(r.value);
|
|
37
|
+
t.has(e.id) ? t.delete(e.id) : t.add(e.id), i("update:modelValue", [...t]);
|
|
38
|
+
} else
|
|
39
|
+
i("update:modelValue", r.value.has(e.id) ? null : e.id);
|
|
40
|
+
}
|
|
41
|
+
const h = {
|
|
42
|
+
sm: { fontSize: "0.8125rem", iconSize: "0.75rem", indent: d("1rem"), padY: d("0.1875rem"), padX: d("0.375rem") },
|
|
43
|
+
md: { fontSize: "0.875rem", iconSize: "0.875rem", indent: d("1.25rem"), padY: d("0.25rem"), padX: d("0.5rem") },
|
|
44
|
+
lg: { fontSize: "0.9375rem", iconSize: "1rem", indent: d("1.5rem"), padY: d("0.375rem"), padX: d("0.625rem") }
|
|
45
|
+
}, S = c(() => h[l.size]);
|
|
46
|
+
return (e, t) => y((s(), u("div", L, [
|
|
47
|
+
(s(!0), u(z, null, B(a.nodes, (n, x) => (s(), V(C, {
|
|
48
|
+
key: String(n.id),
|
|
49
|
+
node: n,
|
|
50
|
+
depth: 0,
|
|
51
|
+
"is-last": x === a.nodes.length - 1,
|
|
52
|
+
expanded: o.value,
|
|
53
|
+
"selected-set": r.value,
|
|
54
|
+
selectable: a.selectable,
|
|
55
|
+
"show-lines": a.showLines,
|
|
56
|
+
animated: a.animated,
|
|
57
|
+
cfg: S.value,
|
|
58
|
+
onToggleExpand: f,
|
|
59
|
+
onSelectNode: p
|
|
60
|
+
}, {
|
|
61
|
+
node: b((g) => [
|
|
62
|
+
k(e.$slots, "node", E({ ref_for: !0 }, g))
|
|
63
|
+
]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 8, ["node", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg"]))), 128))
|
|
66
|
+
], 512)), [
|
|
67
|
+
[A, !a.hidden]
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
N as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const h = Symbol("dropdown-context"), a = Symbol("dropdown-radio");
|
|
2
|
+
function m(l, f = "bottom") {
|
|
3
|
+
const t = l.getBoundingClientRect(), i = typeof window < "u" ? window.innerHeight : 0, p = typeof window < "u" ? window.innerWidth : 0;
|
|
4
|
+
let e = f;
|
|
5
|
+
e === "bottom" && i - t.bottom < 200 && t.top > i - t.bottom ? e = "top" : e === "top" && t.top < 200 && i - t.bottom > t.top && (e = "bottom"), e === "right" && p - t.right < 200 && t.left > p - t.right ? e = "left" : e === "left" && t.left < 200 && p - t.right > t.left && (e = "right");
|
|
6
|
+
const n = 4, o = {
|
|
7
|
+
position: "fixed",
|
|
8
|
+
zIndex: "9990"
|
|
9
|
+
}, r = e === "bottom" || e === "top" ? t.left + 200 > p : !1;
|
|
10
|
+
switch (e) {
|
|
11
|
+
case "bottom":
|
|
12
|
+
o.top = `${t.bottom + n}px`, r ? o.right = `${p - t.right}px` : o.left = `${t.left}px`, o.maxHeight = `${Math.min(i - t.bottom - n - 16, 400)}px`;
|
|
13
|
+
break;
|
|
14
|
+
case "top":
|
|
15
|
+
o.bottom = `${i - t.top + n}px`, r ? o.right = `${p - t.right}px` : o.left = `${t.left}px`, o.maxHeight = `${Math.min(t.top - n - 16, 400)}px`;
|
|
16
|
+
break;
|
|
17
|
+
case "right":
|
|
18
|
+
o.top = `${t.top}px`, o.left = `${t.right + n}px`, o.maxHeight = `${Math.min(i - t.top - 16, 400)}px`;
|
|
19
|
+
break;
|
|
20
|
+
case "left":
|
|
21
|
+
o.top = `${t.top}px`, o.right = `${p - t.left + n}px`, o.maxHeight = `${Math.min(i - t.top - 16, 400)}px`;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
return { styles: o, actualPlacement: e };
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
h as DropdownContextKey,
|
|
28
|
+
a as DropdownRadioKey,
|
|
29
|
+
m as computeDropdownPosition
|
|
30
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ref as o } from "vue";
|
|
2
|
+
const v = Symbol("toast-context");
|
|
3
|
+
let d = 0;
|
|
4
|
+
function f(s, n, a) {
|
|
5
|
+
const t = o([]);
|
|
6
|
+
function r(e) {
|
|
7
|
+
const i = e.id ?? `cui-toast-${++d}`, u = {
|
|
8
|
+
id: i,
|
|
9
|
+
title: e.title,
|
|
10
|
+
description: e.description,
|
|
11
|
+
color: e.color ?? "primary",
|
|
12
|
+
variant: e.variant ?? "subtle",
|
|
13
|
+
dismissible: e.dismissible ?? !0,
|
|
14
|
+
autoDismiss: e.autoDismiss ?? 5e3,
|
|
15
|
+
showProgress: e.showProgress ?? !0,
|
|
16
|
+
animation: e.animation ?? "none",
|
|
17
|
+
icon: e.icon,
|
|
18
|
+
noIcon: e.noIcon ?? !1,
|
|
19
|
+
live: e.live,
|
|
20
|
+
createdAt: Date.now()
|
|
21
|
+
};
|
|
22
|
+
for (t.value.push(u); t.value.length > a.value; )
|
|
23
|
+
t.value.shift();
|
|
24
|
+
return i;
|
|
25
|
+
}
|
|
26
|
+
function l(e) {
|
|
27
|
+
t.value = t.value.filter((i) => i.id !== e);
|
|
28
|
+
}
|
|
29
|
+
function c() {
|
|
30
|
+
t.value = [];
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
toasts: t,
|
|
34
|
+
position: s,
|
|
35
|
+
stackMode: n,
|
|
36
|
+
maxToasts: a,
|
|
37
|
+
add: r,
|
|
38
|
+
dismiss: l,
|
|
39
|
+
dismissAll: c
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
v as ToastContextKey,
|
|
44
|
+
f as createToastState
|
|
45
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { readonly as f, ref as l } from "vue";
|
|
2
|
+
const r = {
|
|
3
|
+
sm: 640,
|
|
4
|
+
md: 768,
|
|
5
|
+
lg: 1024,
|
|
6
|
+
xl: 1280,
|
|
7
|
+
"2xl": 1536
|
|
8
|
+
}, e = ["sm", "md", "lg", "xl", "2xl"];
|
|
9
|
+
function o() {
|
|
10
|
+
if (typeof window > "u") return "base";
|
|
11
|
+
const i = window.innerWidth;
|
|
12
|
+
for (let n = e.length - 1; n >= 0; n--)
|
|
13
|
+
if (i >= r[e[n]])
|
|
14
|
+
return e[n];
|
|
15
|
+
return "base";
|
|
16
|
+
}
|
|
17
|
+
let t = null;
|
|
18
|
+
function a() {
|
|
19
|
+
if (t = l(o()), !(typeof window > "u"))
|
|
20
|
+
for (const i of e) {
|
|
21
|
+
const n = window.matchMedia(`(min-width: ${r[i]}px)`), d = () => {
|
|
22
|
+
t.value = o();
|
|
23
|
+
};
|
|
24
|
+
n.addEventListener("change", d);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function u() {
|
|
28
|
+
return t || a(), { breakpoint: f(t) };
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
r as BREAKPOINTS,
|
|
32
|
+
e as BREAKPOINT_ORDER,
|
|
33
|
+
u as useBreakpoint
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { onMounted as c, onUnmounted as d } from "vue";
|
|
2
|
+
function f(e, t) {
|
|
3
|
+
function o(i) {
|
|
4
|
+
(typeof e == "function" ? e() : e.map((n) => n.value)).some((n) => n == null ? void 0 : n.contains(i.target)) || t();
|
|
5
|
+
}
|
|
6
|
+
c(() => {
|
|
7
|
+
document.addEventListener("mousedown", o);
|
|
8
|
+
}), d(() => {
|
|
9
|
+
document.removeEventListener("mousedown", o);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
f as useClickOutside
|
|
14
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ref as c } from "vue";
|
|
2
|
+
function l(r = 2e3) {
|
|
3
|
+
const o = c(!1);
|
|
4
|
+
let e = null;
|
|
5
|
+
async function u(a) {
|
|
6
|
+
try {
|
|
7
|
+
return await navigator.clipboard.writeText(a), o.value = !0, e && clearTimeout(e), e = setTimeout(() => {
|
|
8
|
+
o.value = !1;
|
|
9
|
+
}, r), !0;
|
|
10
|
+
} catch {
|
|
11
|
+
try {
|
|
12
|
+
const t = document.createElement("textarea");
|
|
13
|
+
return t.value = a, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t), o.value = !0, e && clearTimeout(e), e = setTimeout(() => {
|
|
14
|
+
o.value = !1;
|
|
15
|
+
}, r), !0;
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return { copied: o, copy: u };
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
l as useCopyToClipboard
|
|
25
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { ref as v, computed as y, provide as ye, inject as pe } from "vue";
|
|
2
|
+
import { DataGridContextKey as I } from "../components/data-grid-context.js";
|
|
3
|
+
function he(d) {
|
|
4
|
+
const {
|
|
5
|
+
columns: p,
|
|
6
|
+
serverSide: F = !1,
|
|
7
|
+
rowKey: $ = "id",
|
|
8
|
+
defaultPerPage: L = 15,
|
|
9
|
+
initialView: l,
|
|
10
|
+
hydrateFromUrl: z = !1
|
|
11
|
+
} = d, G = p.map((e) => ({
|
|
12
|
+
key: e.key,
|
|
13
|
+
visible: e.visible !== !1
|
|
14
|
+
})), m = v(
|
|
15
|
+
(l == null ? void 0 : l.columns) ?? G.map((e) => ({ ...e }))
|
|
16
|
+
), H = y(
|
|
17
|
+
() => m.value.filter((e) => e.visible).map((e) => p.find((t) => t.key === e.key)).filter(Boolean)
|
|
18
|
+
), W = y(
|
|
19
|
+
() => p.filter((e) => e.filterable)
|
|
20
|
+
);
|
|
21
|
+
function X(e) {
|
|
22
|
+
const t = m.value.find((a) => a.key === e);
|
|
23
|
+
t && (t.visible = !t.visible);
|
|
24
|
+
}
|
|
25
|
+
function Y(e, t) {
|
|
26
|
+
const a = [...m.value], [r] = a.splice(e, 1);
|
|
27
|
+
a.splice(t, 0, r), m.value = a;
|
|
28
|
+
}
|
|
29
|
+
const i = v((l == null ? void 0 : l.sort) ?? null);
|
|
30
|
+
function Z(e) {
|
|
31
|
+
var r;
|
|
32
|
+
const t = p.find((n) => n.key === e);
|
|
33
|
+
if (!(t != null && t.sortable)) return;
|
|
34
|
+
const a = t.sortKey ?? e;
|
|
35
|
+
((r = i.value) == null ? void 0 : r.key) === a ? i.value.direction === "asc" ? i.value = { key: a, direction: "desc" } : i.value = null : i.value = { key: a, direction: "asc" }, o.value = 1;
|
|
36
|
+
}
|
|
37
|
+
const s = v(l != null && l.filters ? [...l.filters] : []);
|
|
38
|
+
function N(e) {
|
|
39
|
+
const t = s.value.findIndex((a) => a.key === e.key);
|
|
40
|
+
t >= 0 ? s.value[t] = e : s.value.push(e), s.value = [...s.value], o.value = 1;
|
|
41
|
+
}
|
|
42
|
+
function V(e) {
|
|
43
|
+
s.value = s.value.filter((t) => t.key !== e), o.value = 1;
|
|
44
|
+
}
|
|
45
|
+
function ee() {
|
|
46
|
+
s.value = [], o.value = 1;
|
|
47
|
+
}
|
|
48
|
+
const P = v(""), S = v(null);
|
|
49
|
+
function te(e, t) {
|
|
50
|
+
P.value = e, S.value = t ?? null, o.value = 1;
|
|
51
|
+
}
|
|
52
|
+
function O() {
|
|
53
|
+
P.value = "", S.value = null, o.value = 1;
|
|
54
|
+
}
|
|
55
|
+
const o = v(1), c = v((l == null ? void 0 : l.perPage) ?? L);
|
|
56
|
+
function ae(e) {
|
|
57
|
+
o.value = e;
|
|
58
|
+
}
|
|
59
|
+
function le(e) {
|
|
60
|
+
c.value = e, o.value = 1;
|
|
61
|
+
}
|
|
62
|
+
const k = v(/* @__PURE__ */ new Set());
|
|
63
|
+
function re(e) {
|
|
64
|
+
const t = new Set(k.value);
|
|
65
|
+
t.has(e) ? t.delete(e) : t.add(e), k.value = t;
|
|
66
|
+
}
|
|
67
|
+
function ne(e) {
|
|
68
|
+
const t = /* @__PURE__ */ new Set();
|
|
69
|
+
for (const a of e) {
|
|
70
|
+
const r = String(a[$] ?? "");
|
|
71
|
+
r && t.add(r);
|
|
72
|
+
}
|
|
73
|
+
k.value = t;
|
|
74
|
+
}
|
|
75
|
+
function J() {
|
|
76
|
+
k.value = /* @__PURE__ */ new Set();
|
|
77
|
+
}
|
|
78
|
+
const C = v((l == null ? void 0 : l.viewMode) ?? "grid");
|
|
79
|
+
function ue(e) {
|
|
80
|
+
C.value = e;
|
|
81
|
+
}
|
|
82
|
+
const D = v(!1), w = v((l == null ? void 0 : l.filterPanelPinned) ?? !1);
|
|
83
|
+
function oe() {
|
|
84
|
+
D.value = !D.value;
|
|
85
|
+
}
|
|
86
|
+
function se() {
|
|
87
|
+
w.value = !w.value;
|
|
88
|
+
}
|
|
89
|
+
const _ = y(() => {
|
|
90
|
+
const e = d.data.value;
|
|
91
|
+
return Array.isArray(e) ? e : e.data ?? [];
|
|
92
|
+
}), b = y(() => {
|
|
93
|
+
if (F) return !0;
|
|
94
|
+
const e = d.data.value;
|
|
95
|
+
return !Array.isArray(e) && "current_page" in e;
|
|
96
|
+
}), x = y(() => {
|
|
97
|
+
if (b.value) return _.value;
|
|
98
|
+
let e = [..._.value];
|
|
99
|
+
if (P.value) {
|
|
100
|
+
const t = P.value.toLowerCase();
|
|
101
|
+
e = e.filter((a) => S.value ? String(a[S.value] ?? "").toLowerCase().includes(t) : Object.values(a).some(
|
|
102
|
+
(r) => String(r ?? "").toLowerCase().includes(t)
|
|
103
|
+
));
|
|
104
|
+
}
|
|
105
|
+
for (const t of s.value) {
|
|
106
|
+
const a = p.find((n) => (n.filterKey ?? n.key) === t.key), r = (a == null ? void 0 : a.key) ?? t.key;
|
|
107
|
+
e = e.filter((n) => {
|
|
108
|
+
const u = String(n[r] ?? "").toLowerCase();
|
|
109
|
+
return t.type === "text" ? u.includes(String(t.value).toLowerCase()) : t.type === "select" ? u === String(t.value).toLowerCase() : t.type === "multi-select" ? (Array.isArray(t.value) ? t.value : [t.value]).some((g) => u === g.toLowerCase()) : t.type === "date-range" && Array.isArray(t.value) && t.value.length === 2 ? u >= t.value[0] && u <= t.value[1] : !0;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return e;
|
|
113
|
+
}), j = y(() => {
|
|
114
|
+
if (b.value || !i.value) return x.value;
|
|
115
|
+
const { key: e, direction: t } = i.value, a = p.find((n) => (n.sortKey ?? n.key) === e), r = (a == null ? void 0 : a.key) ?? e;
|
|
116
|
+
return [...x.value].sort((n, u) => {
|
|
117
|
+
const f = n[r], g = u[r];
|
|
118
|
+
if (f == null && g == null) return 0;
|
|
119
|
+
if (f == null) return 1;
|
|
120
|
+
if (g == null) return -1;
|
|
121
|
+
let h;
|
|
122
|
+
return typeof f == "number" && typeof g == "number" ? h = f - g : h = String(f).localeCompare(String(g)), t === "desc" ? -h : h;
|
|
123
|
+
});
|
|
124
|
+
}), ie = y(() => {
|
|
125
|
+
if (b.value) return _.value;
|
|
126
|
+
const e = (o.value - 1) * c.value;
|
|
127
|
+
return j.value.slice(e, e + c.value);
|
|
128
|
+
}), ce = y(() => {
|
|
129
|
+
if (b.value) {
|
|
130
|
+
const n = d.data.value;
|
|
131
|
+
if (!Array.isArray(n) && "current_page" in n) {
|
|
132
|
+
const u = n;
|
|
133
|
+
return {
|
|
134
|
+
current_page: u.current_page,
|
|
135
|
+
last_page: u.last_page,
|
|
136
|
+
per_page: u.per_page,
|
|
137
|
+
total: u.total,
|
|
138
|
+
from: u.from,
|
|
139
|
+
to: u.to
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const e = j.value.length, t = Math.max(1, Math.ceil(e / c.value)), a = e > 0 ? (o.value - 1) * c.value + 1 : null, r = e > 0 ? Math.min(o.value * c.value, e) : null;
|
|
144
|
+
return {
|
|
145
|
+
current_page: o.value,
|
|
146
|
+
last_page: t,
|
|
147
|
+
per_page: c.value,
|
|
148
|
+
total: e,
|
|
149
|
+
from: a,
|
|
150
|
+
to: r
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
function ve() {
|
|
154
|
+
return {
|
|
155
|
+
page: o.value,
|
|
156
|
+
perPage: c.value,
|
|
157
|
+
sort: i.value,
|
|
158
|
+
filters: s.value.length > 0 ? [...s.value] : void 0,
|
|
159
|
+
search: P.value || void 0,
|
|
160
|
+
searchField: S.value
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
let A = JSON.stringify(Q());
|
|
164
|
+
function Q() {
|
|
165
|
+
return {
|
|
166
|
+
columns: G.map((e) => ({ ...e })),
|
|
167
|
+
sort: null,
|
|
168
|
+
filters: [],
|
|
169
|
+
perPage: L,
|
|
170
|
+
viewMode: "grid",
|
|
171
|
+
filterPanelPinned: !1
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function M() {
|
|
175
|
+
return {
|
|
176
|
+
columns: m.value.map((e) => ({ ...e })),
|
|
177
|
+
sort: i.value ? { ...i.value } : null,
|
|
178
|
+
filters: s.value.map((e) => ({ ...e })),
|
|
179
|
+
perPage: c.value,
|
|
180
|
+
viewMode: C.value,
|
|
181
|
+
filterPanelPinned: w.value
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function R(e) {
|
|
185
|
+
m.value = e.columns.map((t) => ({ ...t })), i.value = e.sort ? { ...e.sort } : null, s.value = e.filters.map((t) => ({ ...t })), c.value = e.perPage, C.value = e.viewMode, w.value = e.filterPanelPinned, o.value = 1, T();
|
|
186
|
+
}
|
|
187
|
+
const fe = y(
|
|
188
|
+
() => JSON.stringify(M()) !== A
|
|
189
|
+
);
|
|
190
|
+
function T() {
|
|
191
|
+
A = JSON.stringify(M());
|
|
192
|
+
}
|
|
193
|
+
function de() {
|
|
194
|
+
R(Q()), O(), J();
|
|
195
|
+
}
|
|
196
|
+
if (l && (A = JSON.stringify(l)), z && typeof window < "u") {
|
|
197
|
+
const e = new URLSearchParams(window.location.search), t = e.get("sort"), a = e.get("direction");
|
|
198
|
+
t && (i.value = { key: t, direction: a === "desc" ? "desc" : "asc" });
|
|
199
|
+
const r = e.get("search");
|
|
200
|
+
r && (P.value = r, S.value = e.get("search_field") ?? null);
|
|
201
|
+
const n = e.get("per_page");
|
|
202
|
+
n && (c.value = Number(n));
|
|
203
|
+
const u = e.get("page");
|
|
204
|
+
u && (o.value = Number(u));
|
|
205
|
+
const f = e.get("view_mode");
|
|
206
|
+
(f === "card" || f === "grid") && (C.value = f);
|
|
207
|
+
for (const [g, h] of e.entries()) {
|
|
208
|
+
const U = g.match(/^filter\[(.+)\]$/);
|
|
209
|
+
if (U) {
|
|
210
|
+
const q = U[1], K = p.find((E) => (E.filterKey ?? E.key) === q), B = (K == null ? void 0 : K.filterType) ?? "text", ge = B === "multi-select" ? h.split(",") : h;
|
|
211
|
+
N({ key: q, value: ge, type: B });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
columns: p,
|
|
217
|
+
columnState: m,
|
|
218
|
+
visibleColumns: H,
|
|
219
|
+
filterableColumns: W,
|
|
220
|
+
sort: i,
|
|
221
|
+
applySort: Z,
|
|
222
|
+
filters: s,
|
|
223
|
+
applyFilter: N,
|
|
224
|
+
removeFilter: V,
|
|
225
|
+
clearFilters: ee,
|
|
226
|
+
searchQuery: P,
|
|
227
|
+
searchField: S,
|
|
228
|
+
search: te,
|
|
229
|
+
clearSearch: O,
|
|
230
|
+
page: o,
|
|
231
|
+
perPage: c,
|
|
232
|
+
setPage: ae,
|
|
233
|
+
setPerPage: le,
|
|
234
|
+
selectedRows: k,
|
|
235
|
+
toggleSelection: re,
|
|
236
|
+
selectAll: ne,
|
|
237
|
+
clearSelection: J,
|
|
238
|
+
toggleColumnVisibility: X,
|
|
239
|
+
reorderColumns: Y,
|
|
240
|
+
viewMode: C,
|
|
241
|
+
setViewMode: ue,
|
|
242
|
+
filterPanelOpen: D,
|
|
243
|
+
filterPanelPinned: w,
|
|
244
|
+
toggleFilterPanel: oe,
|
|
245
|
+
toggleFilterPanelPin: se,
|
|
246
|
+
displayData: ie,
|
|
247
|
+
paginationMeta: ce,
|
|
248
|
+
getConfig: M,
|
|
249
|
+
loadConfig: R,
|
|
250
|
+
isDirty: fe,
|
|
251
|
+
markClean: T,
|
|
252
|
+
resetToDefaults: de,
|
|
253
|
+
serverSide: F,
|
|
254
|
+
getQueryParams: ve
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function ke(d) {
|
|
258
|
+
ye(I, d);
|
|
259
|
+
}
|
|
260
|
+
function Ce() {
|
|
261
|
+
const d = pe(I);
|
|
262
|
+
if (!d) throw new Error("useDataGridState must be used within a CuiDataGrid");
|
|
263
|
+
return d;
|
|
264
|
+
}
|
|
265
|
+
export {
|
|
266
|
+
ke as provideDataGrid,
|
|
267
|
+
he as useDataGrid,
|
|
268
|
+
Ce as useDataGridState
|
|
269
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { watch as g } from "vue";
|
|
2
|
+
function v(n) {
|
|
3
|
+
const { grid: t, url: c, router: l, extraParams: a = {} } = n;
|
|
4
|
+
function o(e) {
|
|
5
|
+
const r = { ...a };
|
|
6
|
+
if (e.page && e.page > 1 && (r.page = String(e.page)), e.perPage && (r.per_page = String(e.perPage)), e.sort && (r.sort = e.sort.key, r.direction = e.sort.direction), e.search && (r.search = e.search, e.searchField && (r.search_field = e.searchField)), e.filters)
|
|
7
|
+
for (const i of e.filters) {
|
|
8
|
+
const f = Array.isArray(i.value) ? i.value.join(",") : i.value;
|
|
9
|
+
r[`filter[${i.key}]`] = f;
|
|
10
|
+
}
|
|
11
|
+
return r;
|
|
12
|
+
}
|
|
13
|
+
function u() {
|
|
14
|
+
const e = t.getQueryParams(), r = o(e);
|
|
15
|
+
l.get(c, r, {
|
|
16
|
+
preserveState: !0,
|
|
17
|
+
preserveScroll: !0
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return g(
|
|
21
|
+
[
|
|
22
|
+
() => t.sort.value,
|
|
23
|
+
() => t.filters.value,
|
|
24
|
+
() => t.searchQuery.value,
|
|
25
|
+
() => t.page.value,
|
|
26
|
+
() => t.perPage.value
|
|
27
|
+
],
|
|
28
|
+
() => {
|
|
29
|
+
u();
|
|
30
|
+
}
|
|
31
|
+
), { navigate: u, buildQueryData: o };
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
v as useDataGridInertia
|
|
35
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ref as u } from "vue";
|
|
2
|
+
function g(s = "cui-datagrid") {
|
|
3
|
+
function r(a) {
|
|
4
|
+
return `${s}-views-${a}`;
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
async load(a) {
|
|
8
|
+
try {
|
|
9
|
+
const e = localStorage.getItem(r(a));
|
|
10
|
+
return e ? JSON.parse(e) : [];
|
|
11
|
+
} catch {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
async save(a, e) {
|
|
16
|
+
const t = await this.load(a), i = t.findIndex((l) => l.id === e.id);
|
|
17
|
+
i >= 0 ? t[i] = e : t.push(e), localStorage.setItem(r(a), JSON.stringify(t));
|
|
18
|
+
},
|
|
19
|
+
async remove(a, e) {
|
|
20
|
+
const i = (await this.load(a)).filter((l) => l.id !== e);
|
|
21
|
+
localStorage.setItem(r(a), JSON.stringify(i));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function I(s) {
|
|
26
|
+
const r = s.adapter ?? g(), a = u([]), e = u(null), t = u(!1);
|
|
27
|
+
async function i() {
|
|
28
|
+
t.value = !0;
|
|
29
|
+
try {
|
|
30
|
+
a.value = await r.load(s.gridId);
|
|
31
|
+
} finally {
|
|
32
|
+
t.value = !1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function l(n, d) {
|
|
36
|
+
const c = a.value.find((y) => y.name === n), o = {
|
|
37
|
+
id: (c == null ? void 0 : c.id) ?? crypto.randomUUID(),
|
|
38
|
+
name: n,
|
|
39
|
+
config: d
|
|
40
|
+
};
|
|
41
|
+
await r.save(s.gridId, o), await i(), e.value = o.id;
|
|
42
|
+
}
|
|
43
|
+
async function f(n, d) {
|
|
44
|
+
const c = a.value.find((o) => o.id === n);
|
|
45
|
+
c && (await r.save(s.gridId, { ...c, config: d }), await i());
|
|
46
|
+
}
|
|
47
|
+
async function w(n) {
|
|
48
|
+
await r.remove(s.gridId, n), e.value === n && (e.value = null), await i();
|
|
49
|
+
}
|
|
50
|
+
function v(n) {
|
|
51
|
+
e.value = n;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
views: a,
|
|
55
|
+
activeViewId: e,
|
|
56
|
+
loading: t,
|
|
57
|
+
fetchViews: i,
|
|
58
|
+
saveView: l,
|
|
59
|
+
updateView: f,
|
|
60
|
+
removeView: w,
|
|
61
|
+
selectView: v
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
g as localStorageViewAdapter,
|
|
66
|
+
I as useDataGridViews
|
|
67
|
+
};
|