@itguy614/clean-ui 0.9.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.js +7 -0
- package/dist/components/CuiAlert.vue2.js +110 -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.js +7 -0
- package/dist/components/CuiBadge.vue2.js +79 -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.js +7 -0
- package/dist/components/CuiButton.vue2.js +133 -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.js +176 -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.js +7 -0
- package/dist/components/CuiInput.vue2.js +148 -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.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.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.js +57 -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/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,332 @@
|
|
|
1
|
+
import { defineComponent as ue, ref as v, computed as w, watch as L, onMounted as se, onUnmounted as ce, nextTick as V, withDirectives as de, openBlock as n, createElementBlock as s, toDisplayString as p, createCommentVNode as m, createElementVNode as C, normalizeStyle as b, Fragment as j, renderList as K, createBlock as k, withCtx as ve, createTextVNode as me, Teleport as fe, createVNode as ge, unref as Y, withModifiers as ye, renderSlot as he, vShow as pe } from "vue";
|
|
2
|
+
import { clampSize as be, scaleDensity as o } from "../utils/sizing.js";
|
|
3
|
+
import A from "./CuiIcon.vue.js";
|
|
4
|
+
import xe from "./CuiBadge.vue.js";
|
|
5
|
+
import { useMessages as we } from "../composables/useMessages.js";
|
|
6
|
+
import Z from "./CuiSpinner.vue.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const ke = {
|
|
9
|
+
key: 0,
|
|
10
|
+
style: { display: "block", marginBottom: "calc(0.25rem * var(--cui-density-scale, 1))", fontSize: "0.875rem", fontWeight: "500", color: "var(--cui-text-secondary)" }
|
|
11
|
+
}, Se = ["src"], ze = ["value", "placeholder", "disabled"], $e = { style: { display: "flex", alignItems: "center", gap: "calc(0.25rem * var(--cui-density-scale, 1))", flexShrink: "0" } }, Ce = {
|
|
12
|
+
key: 1,
|
|
13
|
+
style: { fontSize: "0.75rem", color: "var(--cui-error)", marginTop: "calc(0.25rem * var(--cui-density-scale, 1))" }
|
|
14
|
+
}, Re = {
|
|
15
|
+
key: 0,
|
|
16
|
+
style: { padding: "calc(1rem * var(--cui-density-scale, 1))", textAlign: "center" }
|
|
17
|
+
}, Oe = {
|
|
18
|
+
key: 1,
|
|
19
|
+
style: { padding: "calc(0.75rem * var(--cui-density-scale, 1))", textAlign: "center", fontSize: "0.8125rem", color: "var(--cui-text-tertiary)" }
|
|
20
|
+
}, Te = {
|
|
21
|
+
key: 2,
|
|
22
|
+
style: { padding: "calc(0.75rem * var(--cui-density-scale, 1))", textAlign: "center", fontSize: "0.8125rem", color: "var(--cui-text-tertiary)" }
|
|
23
|
+
}, Ve = ["data-index", "onClick", "onMouseenter"], Be = ["src"], Me = { style: { flex: "1", minWidth: "0" } }, De = {
|
|
24
|
+
key: 0,
|
|
25
|
+
style: { fontSize: "0.75rem", color: "var(--cui-text-tertiary)", lineHeight: "1.3", marginTop: "calc(0.0625rem * var(--cui-density-scale, 1))" }
|
|
26
|
+
}, Ne = /* @__PURE__ */ ue({
|
|
27
|
+
__name: "CuiCombobox",
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: {},
|
|
30
|
+
options: { default: () => [] },
|
|
31
|
+
multiple: { type: Boolean, default: !1 },
|
|
32
|
+
placeholder: { default: "Search..." },
|
|
33
|
+
fetchOptions: {},
|
|
34
|
+
debounce: { default: 300 },
|
|
35
|
+
minChars: { default: 0 },
|
|
36
|
+
maxVisible: { default: 8 },
|
|
37
|
+
loading: { type: Boolean, default: !1 },
|
|
38
|
+
label: {},
|
|
39
|
+
error: { type: Boolean, default: !1 },
|
|
40
|
+
errorMessage: {},
|
|
41
|
+
noResultsText: { default: "No results found" },
|
|
42
|
+
rounded: { default: "md" },
|
|
43
|
+
hidden: { type: Boolean, default: !1 },
|
|
44
|
+
color: { default: "primary" },
|
|
45
|
+
size: { default: "md" },
|
|
46
|
+
disabled: { type: Boolean, default: !1 }
|
|
47
|
+
},
|
|
48
|
+
emits: ["update:modelValue", "search"],
|
|
49
|
+
setup(l, { expose: G, emit: J }) {
|
|
50
|
+
const r = l, Q = {
|
|
51
|
+
none: "0",
|
|
52
|
+
sm: "0.25rem",
|
|
53
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
54
|
+
lg: "0.5rem",
|
|
55
|
+
full: "9999px"
|
|
56
|
+
}, R = J, u = v(""), c = v(!1), d = v(-1), B = v(!1), O = v([]), f = v(null), M = v(null), S = v(null), I = v({});
|
|
57
|
+
let z = null;
|
|
58
|
+
const g = w(() => r.modelValue == null ? /* @__PURE__ */ new Set() : Array.isArray(r.modelValue) ? new Set(r.modelValue) : /* @__PURE__ */ new Set([r.modelValue])), $ = v([]);
|
|
59
|
+
L(() => r.options, (e) => {
|
|
60
|
+
for (const a of e)
|
|
61
|
+
$.value.find((t) => t.value === a.value) || $.value.push(a);
|
|
62
|
+
}, { immediate: !0 }), L(O, (e) => {
|
|
63
|
+
for (const a of e)
|
|
64
|
+
$.value.find((t) => t.value === a.value) || $.value.push(a);
|
|
65
|
+
});
|
|
66
|
+
const y = w(
|
|
67
|
+
() => [...g.value].map((e) => $.value.find((a) => a.value === e)).filter(Boolean)
|
|
68
|
+
), h = w(() => {
|
|
69
|
+
const e = r.fetchOptions ? O.value : r.options;
|
|
70
|
+
if (!u.value || r.fetchOptions) return e;
|
|
71
|
+
const a = u.value.toLowerCase();
|
|
72
|
+
return e.filter(
|
|
73
|
+
(t) => t.label.toLowerCase().includes(a) || t.description && t.description.toLowerCase().includes(a)
|
|
74
|
+
);
|
|
75
|
+
}), P = w(() => r.loading || B.value), X = ["sm", "md", "lg"], _ = {
|
|
76
|
+
sm: { fontSize: "0.8125rem", padding: `${o("0.25rem")} ${o("0.5rem")}`, tagSize: "sm", itemPadding: `${o("0.375rem")} ${o("0.625rem")}`, inputHeight: o("2rem") },
|
|
77
|
+
md: { fontSize: "0.875rem", padding: `${o("0.3125rem")} ${o("0.625rem")}`, tagSize: "sm", itemPadding: `${o("0.5rem")} ${o("0.75rem")}`, inputHeight: o("2.375rem") },
|
|
78
|
+
lg: { fontSize: "0.9375rem", padding: `${o("0.4375rem")} ${o("0.75rem")}`, tagSize: "md", itemPadding: `${o("0.625rem")} ${o("0.875rem")}`, inputHeight: o("2.75rem") }
|
|
79
|
+
}, x = w(() => _[be(r.size, X)]);
|
|
80
|
+
function T() {
|
|
81
|
+
if (!S.value) return;
|
|
82
|
+
const e = S.value.getBoundingClientRect(), a = window.innerHeight, t = a - e.bottom, i = e.top, E = Math.min(320, Math.max(t, i) - 16), oe = t < 200 && i > t, H = {
|
|
83
|
+
position: "fixed",
|
|
84
|
+
zIndex: "9990",
|
|
85
|
+
left: `${e.left}px`,
|
|
86
|
+
width: `${e.width}px`,
|
|
87
|
+
maxHeight: `${E}px`,
|
|
88
|
+
overflowY: "auto",
|
|
89
|
+
background: "var(--cui-surface-base)",
|
|
90
|
+
border: "1px solid var(--cui-border)",
|
|
91
|
+
borderRadius: "0.5rem",
|
|
92
|
+
boxShadow: "0 8px 24px -4px rgba(0,0,0,0.12), 0 2px 8px -2px rgba(0,0,0,0.08)",
|
|
93
|
+
padding: "calc(0.25rem * var(--cui-density-scale, 1))"
|
|
94
|
+
};
|
|
95
|
+
oe ? H.bottom = `${a - e.top + 4}px` : H.top = `${e.bottom + 4}px`, I.value = H;
|
|
96
|
+
}
|
|
97
|
+
function ee(e) {
|
|
98
|
+
if (u.value = e.target.value, d.value = -1, c.value || D(), R("search", u.value), r.fetchOptions) {
|
|
99
|
+
if (u.value.length < r.minChars) {
|
|
100
|
+
O.value = [];
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
z && clearTimeout(z), z = setTimeout(async () => {
|
|
104
|
+
B.value = !0;
|
|
105
|
+
try {
|
|
106
|
+
O.value = await r.fetchOptions(u.value);
|
|
107
|
+
} finally {
|
|
108
|
+
B.value = !1;
|
|
109
|
+
}
|
|
110
|
+
}, r.debounce);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function F(e) {
|
|
114
|
+
var a;
|
|
115
|
+
if (!e.disabled)
|
|
116
|
+
if (r.multiple) {
|
|
117
|
+
const t = new Set(g.value);
|
|
118
|
+
t.has(e.value) ? t.delete(e.value) : t.add(e.value), R("update:modelValue", [...t]), u.value = "", V(() => {
|
|
119
|
+
var i;
|
|
120
|
+
return (i = f.value) == null ? void 0 : i.focus();
|
|
121
|
+
});
|
|
122
|
+
} else
|
|
123
|
+
R("update:modelValue", e.value), u.value = "", c.value = !1, (a = f.value) == null || a.blur();
|
|
124
|
+
}
|
|
125
|
+
function N(e) {
|
|
126
|
+
if (r.disabled) return;
|
|
127
|
+
const a = [...g.value];
|
|
128
|
+
R("update:modelValue", a.filter((t) => t !== e)), V(() => {
|
|
129
|
+
var t;
|
|
130
|
+
return (t = f.value) == null ? void 0 : t.focus();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function te(e) {
|
|
134
|
+
if (e.key === "ArrowDown") {
|
|
135
|
+
if (e.preventDefault(), !c.value) {
|
|
136
|
+
D();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
d.value = Math.min(d.value + 1, h.value.length - 1), W();
|
|
140
|
+
} else e.key === "ArrowUp" ? (e.preventDefault(), d.value = Math.max(d.value - 1, 0), W()) : e.key === "Enter" ? (e.preventDefault(), d.value >= 0 && d.value < h.value.length && F(h.value[d.value])) : e.key === "Escape" ? c.value = !1 : e.key === "Backspace" && !u.value && r.multiple && y.value.length > 0 && N(y.value[y.value.length - 1].value);
|
|
141
|
+
}
|
|
142
|
+
function W() {
|
|
143
|
+
V(() => {
|
|
144
|
+
var e, a;
|
|
145
|
+
(a = (e = M.value) == null ? void 0 : e.querySelector(`[data-index="${d.value}"]`)) == null || a.scrollIntoView({ block: "nearest" });
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function D() {
|
|
149
|
+
r.disabled || (c.value = !0, T());
|
|
150
|
+
}
|
|
151
|
+
function ae() {
|
|
152
|
+
D();
|
|
153
|
+
}
|
|
154
|
+
function q(e) {
|
|
155
|
+
var t, i;
|
|
156
|
+
const a = e.target;
|
|
157
|
+
(t = S.value) != null && t.contains(a) || (i = M.value) != null && i.contains(a) || (c.value = !1);
|
|
158
|
+
}
|
|
159
|
+
se(() => {
|
|
160
|
+
document.addEventListener("mousedown", q), window.addEventListener("scroll", () => {
|
|
161
|
+
c.value && T();
|
|
162
|
+
}, !0), window.addEventListener("resize", () => {
|
|
163
|
+
c.value && T();
|
|
164
|
+
});
|
|
165
|
+
}), ce(() => {
|
|
166
|
+
document.removeEventListener("mousedown", q), z && clearTimeout(z);
|
|
167
|
+
});
|
|
168
|
+
const le = w(() => r.multiple ? "" : y.value.length > 0 ? y.value[0].label : "");
|
|
169
|
+
L(c, (e) => {
|
|
170
|
+
e || (u.value = ""), e && V(T);
|
|
171
|
+
});
|
|
172
|
+
function re(e) {
|
|
173
|
+
var a;
|
|
174
|
+
(a = f.value) == null || a.focus(e);
|
|
175
|
+
}
|
|
176
|
+
function ne() {
|
|
177
|
+
var e;
|
|
178
|
+
(e = f.value) == null || e.blur();
|
|
179
|
+
}
|
|
180
|
+
G({ el: S, focus: re, blur: ne });
|
|
181
|
+
function ie(e, a) {
|
|
182
|
+
const t = g.value.has(a.value), i = d.value === e;
|
|
183
|
+
return {
|
|
184
|
+
display: "flex",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
gap: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
187
|
+
padding: x.value.itemPadding,
|
|
188
|
+
cursor: a.disabled ? "default" : "pointer",
|
|
189
|
+
fontSize: x.value.fontSize,
|
|
190
|
+
color: a.disabled ? "var(--cui-text-tertiary)" : "var(--cui-text-body)",
|
|
191
|
+
opacity: a.disabled ? "0.5" : "1",
|
|
192
|
+
background: i ? "var(--cui-primary-bg)" : t ? "color-mix(in srgb, var(--cui-primary-bg) 50%, transparent)" : "transparent",
|
|
193
|
+
transition: "background 0.1s ease",
|
|
194
|
+
borderRadius: "0.25rem"
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const U = we();
|
|
198
|
+
return (e, a) => de((n(), s("div", {
|
|
199
|
+
ref_key: "wrapperRef",
|
|
200
|
+
ref: S,
|
|
201
|
+
style: { position: "relative" }
|
|
202
|
+
}, [
|
|
203
|
+
l.label ? (n(), s("label", ke, p(l.label), 1)) : m("", !0),
|
|
204
|
+
C("div", {
|
|
205
|
+
style: b({
|
|
206
|
+
display: "flex",
|
|
207
|
+
flexWrap: "wrap",
|
|
208
|
+
alignItems: "center",
|
|
209
|
+
gap: "calc(0.25rem * var(--cui-density-scale, 1))",
|
|
210
|
+
padding: x.value.padding,
|
|
211
|
+
border: `1px solid ${l.error ? "var(--cui-error)" : "var(--cui-border-strong, var(--cui-border))"}`,
|
|
212
|
+
borderRadius: Q[l.rounded],
|
|
213
|
+
background: "var(--cui-surface-base, white)",
|
|
214
|
+
cursor: l.disabled ? "default" : "text",
|
|
215
|
+
opacity: l.disabled ? "0.5" : "1",
|
|
216
|
+
minHeight: x.value.inputHeight
|
|
217
|
+
}),
|
|
218
|
+
onClick: a[0] || (a[0] = (t) => {
|
|
219
|
+
var i;
|
|
220
|
+
return (i = f.value) == null ? void 0 : i.focus();
|
|
221
|
+
})
|
|
222
|
+
}, [
|
|
223
|
+
(n(!0), s(j, null, K(l.multiple ? y.value : [], (t) => (n(), k(xe, {
|
|
224
|
+
key: String(t.value),
|
|
225
|
+
color: l.color,
|
|
226
|
+
size: x.value.tagSize,
|
|
227
|
+
removable: "",
|
|
228
|
+
onRemove: (i) => N(t.value)
|
|
229
|
+
}, {
|
|
230
|
+
default: ve(() => [
|
|
231
|
+
t.image ? (n(), s("img", {
|
|
232
|
+
key: 0,
|
|
233
|
+
src: t.image,
|
|
234
|
+
style: { width: "1rem", height: "1rem", borderRadius: "50%", objectFit: "cover", marginRight: "calc(0.125rem * var(--cui-density-scale, 1))" }
|
|
235
|
+
}, null, 8, Se)) : m("", !0),
|
|
236
|
+
me(" " + p(t.label), 1)
|
|
237
|
+
]),
|
|
238
|
+
_: 2
|
|
239
|
+
}, 1032, ["color", "size", "onRemove"]))), 128)),
|
|
240
|
+
C("input", {
|
|
241
|
+
ref_key: "inputRef",
|
|
242
|
+
ref: f,
|
|
243
|
+
value: c.value ? u.value : le.value,
|
|
244
|
+
placeholder: y.value.length > 0 ? "" : l.placeholder,
|
|
245
|
+
disabled: l.disabled,
|
|
246
|
+
style: b({
|
|
247
|
+
flex: "1",
|
|
248
|
+
minWidth: "4rem",
|
|
249
|
+
border: "none",
|
|
250
|
+
outline: "none",
|
|
251
|
+
background: "transparent",
|
|
252
|
+
fontSize: x.value.fontSize,
|
|
253
|
+
color: "var(--cui-text-body)",
|
|
254
|
+
padding: "calc(0.125rem * var(--cui-density-scale, 1)) 0",
|
|
255
|
+
fontFamily: "inherit"
|
|
256
|
+
}),
|
|
257
|
+
onInput: ee,
|
|
258
|
+
onFocus: ae,
|
|
259
|
+
onKeydown: te
|
|
260
|
+
}, null, 44, ze),
|
|
261
|
+
C("div", $e, [
|
|
262
|
+
P.value ? (n(), k(Z, {
|
|
263
|
+
key: 0,
|
|
264
|
+
size: "xs"
|
|
265
|
+
})) : (n(), k(A, {
|
|
266
|
+
key: 1,
|
|
267
|
+
name: "caret-down",
|
|
268
|
+
size: "0.875rem",
|
|
269
|
+
style: b({ color: "var(--cui-text-tertiary)", transform: c.value ? "rotate(180deg)" : "none", transition: "transform 0.15s ease" })
|
|
270
|
+
}, null, 8, ["style"]))
|
|
271
|
+
])
|
|
272
|
+
], 4),
|
|
273
|
+
l.error && l.errorMessage ? (n(), s("div", Ce, p(l.errorMessage), 1)) : m("", !0),
|
|
274
|
+
(n(), k(fe, { to: "body" }, [
|
|
275
|
+
c.value ? (n(), s("div", {
|
|
276
|
+
key: 0,
|
|
277
|
+
ref_key: "dropdownRef",
|
|
278
|
+
ref: M,
|
|
279
|
+
style: b(I.value)
|
|
280
|
+
}, [
|
|
281
|
+
P.value && h.value.length === 0 ? (n(), s("div", Re, [
|
|
282
|
+
ge(Z, {
|
|
283
|
+
size: "sm",
|
|
284
|
+
"show-label": "",
|
|
285
|
+
label: Y(U).combobox.searching
|
|
286
|
+
}, null, 8, ["label"])
|
|
287
|
+
])) : h.value.length === 0 && (u.value.length >= l.minChars || !l.fetchOptions) ? (n(), s("div", Oe, p(l.noResultsText), 1)) : h.value.length === 0 && l.fetchOptions && u.value.length < l.minChars ? (n(), s("div", Te, p(Y(U).combobox.typeMore(l.minChars - u.value.length)), 1)) : m("", !0),
|
|
288
|
+
(n(!0), s(j, null, K(h.value, (t, i) => (n(), s("div", {
|
|
289
|
+
key: String(t.value),
|
|
290
|
+
"data-index": i,
|
|
291
|
+
style: b(ie(i, t)),
|
|
292
|
+
onClick: ye((E) => F(t), ["stop"]),
|
|
293
|
+
onMouseenter: (E) => d.value = i
|
|
294
|
+
}, [
|
|
295
|
+
he(e.$slots, "option", {
|
|
296
|
+
option: t,
|
|
297
|
+
selected: g.value.has(t.value)
|
|
298
|
+
}, () => [
|
|
299
|
+
t.image ? (n(), s("img", {
|
|
300
|
+
key: 0,
|
|
301
|
+
src: t.image,
|
|
302
|
+
style: { width: "1.75rem", height: "1.75rem", borderRadius: "50%", objectFit: "cover", flexShrink: "0" }
|
|
303
|
+
}, null, 8, Be)) : t.icon ? (n(), k(A, {
|
|
304
|
+
key: 1,
|
|
305
|
+
name: t.icon,
|
|
306
|
+
size: "1rem",
|
|
307
|
+
style: { flexShrink: "0", color: "var(--cui-text-secondary)" }
|
|
308
|
+
}, null, 8, ["name"])) : m("", !0),
|
|
309
|
+
C("div", Me, [
|
|
310
|
+
C("div", {
|
|
311
|
+
style: b({ lineHeight: "1.3", fontWeight: g.value.has(t.value) ? "600" : "400" })
|
|
312
|
+
}, p(t.label), 5),
|
|
313
|
+
t.description ? (n(), s("div", De, p(t.description), 1)) : m("", !0)
|
|
314
|
+
]),
|
|
315
|
+
g.value.has(t.value) ? (n(), k(A, {
|
|
316
|
+
key: 2,
|
|
317
|
+
name: "check",
|
|
318
|
+
size: "0.875rem",
|
|
319
|
+
style: b({ color: `var(--cui-${l.color})`, flexShrink: "0" })
|
|
320
|
+
}, null, 8, ["style"])) : m("", !0)
|
|
321
|
+
])
|
|
322
|
+
], 44, Ve))), 128))
|
|
323
|
+
], 4)) : m("", !0)
|
|
324
|
+
]))
|
|
325
|
+
], 512)), [
|
|
326
|
+
[pe, !l.hidden]
|
|
327
|
+
]);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
export {
|
|
331
|
+
Ne as default
|
|
332
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as m, inject as a, computed as p, provide as i, renderSlot as u } from "vue";
|
|
2
|
+
import { CuiConfigKey as s } from "./config-context.js";
|
|
3
|
+
import { mergeMessages as f, defaultMessages as c } from "../messages.js";
|
|
4
|
+
const _ = /* @__PURE__ */ m({
|
|
5
|
+
__name: "CuiConfigProvider",
|
|
6
|
+
props: {
|
|
7
|
+
messages: {}
|
|
8
|
+
},
|
|
9
|
+
setup(o) {
|
|
10
|
+
const r = o, e = a(s, null), t = p(
|
|
11
|
+
() => f(e ? e.value : c, r.messages)
|
|
12
|
+
);
|
|
13
|
+
return i(s, t), (n, d) => u(n.$slots, "default");
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
_ as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { defineComponent as V, computed as l, ref as I, watch as R, openBlock as v, createBlock as N, withCtx as a, createElementVNode as o, normalizeStyle as h, createVNode as t, toDisplayString as s, createElementBlock as x, renderSlot as P, createTextVNode as g, createCommentVNode as C, unref as j, withKeys as H, createSlots as E } from "vue";
|
|
2
|
+
import K from "./CuiModal.vue.js";
|
|
3
|
+
import L from "./CuiModalBody.vue.js";
|
|
4
|
+
import M from "./CuiModalFooter.vue.js";
|
|
5
|
+
import k from "./CuiButton.vue.js";
|
|
6
|
+
import U from "./CuiInput.vue.js";
|
|
7
|
+
import w from "./CuiIcon.vue.js";
|
|
8
|
+
import { useMessages as _ } from "../composables/useMessages.js";
|
|
9
|
+
const q = { style: {
|
|
10
|
+
padding: "calc(1.25rem * var(--cui-density-scale, 1)) calc(1.5rem * var(--cui-density-scale, 1)) 0",
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "flex-start",
|
|
13
|
+
gap: "calc(0.875rem * var(--cui-density-scale, 1))"
|
|
14
|
+
} }, A = { style: { flex: "1", "min-width": "0" } }, F = { style: {
|
|
15
|
+
fontSize: "1.0625rem",
|
|
16
|
+
fontWeight: "600",
|
|
17
|
+
lineHeight: "1.3",
|
|
18
|
+
color: "var(--cui-text-emphasis)",
|
|
19
|
+
margin: "calc(0.125rem * var(--cui-density-scale, 1)) 0 0"
|
|
20
|
+
} }, G = {
|
|
21
|
+
key: 0,
|
|
22
|
+
style: {
|
|
23
|
+
fontSize: "0.875rem",
|
|
24
|
+
color: "var(--cui-text-secondary)",
|
|
25
|
+
lineHeight: "1.55",
|
|
26
|
+
marginTop: "calc(0.375rem * var(--cui-density-scale, 1))"
|
|
27
|
+
}
|
|
28
|
+
}, J = ["aria-label"], O = { key: 0 }, Q = { style: { display: "flex", gap: "calc(0.5rem * var(--cui-density-scale, 1))", "justify-content": "flex-end" } }, ne = /* @__PURE__ */ V({
|
|
29
|
+
__name: "CuiConfirmDialog",
|
|
30
|
+
props: {
|
|
31
|
+
visible: { type: Boolean, default: !1 },
|
|
32
|
+
title: {},
|
|
33
|
+
message: {},
|
|
34
|
+
variant: { default: "danger" },
|
|
35
|
+
confirmText: {},
|
|
36
|
+
cancelText: {},
|
|
37
|
+
confirmWord: {},
|
|
38
|
+
confirmPrompt: {},
|
|
39
|
+
icon: {},
|
|
40
|
+
loading: { type: Boolean, default: !1 },
|
|
41
|
+
hidden: { type: Boolean, default: !1 }
|
|
42
|
+
},
|
|
43
|
+
emits: ["update:visible", "confirm", "cancel"],
|
|
44
|
+
setup(e, { emit: T }) {
|
|
45
|
+
const i = e, c = _(), z = l(() => i.title ?? c.value.confirmDialog.title), S = l(() => i.confirmText ?? c.value.confirmDialog.confirm), $ = l(() => i.cancelText ?? c.value.confirmDialog.cancel), d = T, m = I("");
|
|
46
|
+
R(
|
|
47
|
+
() => i.visible,
|
|
48
|
+
(u) => {
|
|
49
|
+
u && (m.value = "");
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const B = {
|
|
53
|
+
danger: { color: "error", icon: "warning-circle" },
|
|
54
|
+
warning: { color: "warning", icon: "warning" },
|
|
55
|
+
info: { color: "info", icon: "info" }
|
|
56
|
+
}, r = l(() => B[i.variant]), y = l(() => i.confirmWord ? m.value.trim().toLowerCase() !== i.confirmWord.trim().toLowerCase() : !1), W = l(
|
|
57
|
+
() => c.value.confirmDialog.typePrompt(i.confirmWord ?? "")
|
|
58
|
+
);
|
|
59
|
+
function D() {
|
|
60
|
+
d("update:visible", !1);
|
|
61
|
+
}
|
|
62
|
+
function p() {
|
|
63
|
+
y.value || d("confirm");
|
|
64
|
+
}
|
|
65
|
+
function b() {
|
|
66
|
+
d("cancel"), D();
|
|
67
|
+
}
|
|
68
|
+
return (u, n) => (v(), N(K, {
|
|
69
|
+
hidden: e.hidden,
|
|
70
|
+
visible: e.visible,
|
|
71
|
+
size: "sm",
|
|
72
|
+
"no-close-button": "",
|
|
73
|
+
"onUpdate:visible": n[1] || (n[1] = (f) => d("update:visible", f))
|
|
74
|
+
}, {
|
|
75
|
+
default: a(() => [
|
|
76
|
+
o("div", q, [
|
|
77
|
+
o("div", {
|
|
78
|
+
style: h({
|
|
79
|
+
width: "2.5rem",
|
|
80
|
+
height: "2.5rem",
|
|
81
|
+
borderRadius: "0.625rem",
|
|
82
|
+
display: "flex",
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
justifyContent: "center",
|
|
85
|
+
flexShrink: "0",
|
|
86
|
+
background: `var(--cui-${r.value.color}-bg)`,
|
|
87
|
+
color: `var(--cui-${r.value.color})`,
|
|
88
|
+
border: `1px solid var(--cui-${r.value.color}-border)`
|
|
89
|
+
})
|
|
90
|
+
}, [
|
|
91
|
+
t(w, {
|
|
92
|
+
name: e.icon || r.value.icon,
|
|
93
|
+
size: "1.25rem"
|
|
94
|
+
}, null, 8, ["name"])
|
|
95
|
+
], 4),
|
|
96
|
+
o("div", A, [
|
|
97
|
+
o("h2", F, s(z.value), 1),
|
|
98
|
+
e.message || u.$slots.default ? (v(), x("div", G, [
|
|
99
|
+
P(u.$slots, "default", {}, () => [
|
|
100
|
+
g(s(e.message), 1)
|
|
101
|
+
])
|
|
102
|
+
])) : C("", !0)
|
|
103
|
+
]),
|
|
104
|
+
o("button", {
|
|
105
|
+
type: "button",
|
|
106
|
+
style: {
|
|
107
|
+
display: "flex",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
width: "1.75rem",
|
|
111
|
+
height: "1.75rem",
|
|
112
|
+
border: "none",
|
|
113
|
+
background: "none",
|
|
114
|
+
cursor: "pointer",
|
|
115
|
+
color: "var(--cui-text-tertiary)",
|
|
116
|
+
borderRadius: "0.25rem",
|
|
117
|
+
flexShrink: "0",
|
|
118
|
+
marginTop: "calc(-0.125rem * var(--cui-density-scale, 1))",
|
|
119
|
+
marginRight: "calc(-0.25rem * var(--cui-density-scale, 1))"
|
|
120
|
+
},
|
|
121
|
+
"aria-label": j(c).close,
|
|
122
|
+
onClick: b
|
|
123
|
+
}, [
|
|
124
|
+
t(w, {
|
|
125
|
+
name: "x",
|
|
126
|
+
size: "1rem"
|
|
127
|
+
})
|
|
128
|
+
], 8, J)
|
|
129
|
+
]),
|
|
130
|
+
t(L, null, {
|
|
131
|
+
default: a(() => [
|
|
132
|
+
e.confirmWord ? (v(), x("div", O, [
|
|
133
|
+
o("div", {
|
|
134
|
+
style: h({
|
|
135
|
+
fontSize: "0.8125rem",
|
|
136
|
+
color: "var(--cui-text-secondary)",
|
|
137
|
+
marginBottom: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
138
|
+
lineHeight: "1.4",
|
|
139
|
+
padding: "calc(0.625rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))",
|
|
140
|
+
background: `var(--cui-${r.value.color}-bg)`,
|
|
141
|
+
borderRadius: "0.375rem",
|
|
142
|
+
border: `1px solid var(--cui-${r.value.color}-border)`
|
|
143
|
+
})
|
|
144
|
+
}, s(e.confirmPrompt || W.value), 5),
|
|
145
|
+
t(U, {
|
|
146
|
+
modelValue: m.value,
|
|
147
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => m.value = f),
|
|
148
|
+
placeholder: e.confirmWord,
|
|
149
|
+
size: "sm",
|
|
150
|
+
onKeydown: H(p, ["enter"])
|
|
151
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
152
|
+
])) : C("", !0)
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}),
|
|
156
|
+
t(M, null, {
|
|
157
|
+
default: a(() => [
|
|
158
|
+
o("div", Q, [
|
|
159
|
+
t(k, {
|
|
160
|
+
variant: "outline",
|
|
161
|
+
size: "sm",
|
|
162
|
+
onClick: b
|
|
163
|
+
}, {
|
|
164
|
+
default: a(() => [
|
|
165
|
+
g(s($.value), 1)
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}),
|
|
169
|
+
t(k, {
|
|
170
|
+
variant: "solid",
|
|
171
|
+
size: "sm",
|
|
172
|
+
color: r.value.color,
|
|
173
|
+
disabled: y.value || e.loading,
|
|
174
|
+
onClick: p
|
|
175
|
+
}, E({
|
|
176
|
+
default: a(() => [
|
|
177
|
+
g(" " + s(S.value), 1)
|
|
178
|
+
]),
|
|
179
|
+
_: 2
|
|
180
|
+
}, [
|
|
181
|
+
e.loading ? {
|
|
182
|
+
name: "prefix",
|
|
183
|
+
fn: a(() => [
|
|
184
|
+
n[2] || (n[2] = o("span", { style: {
|
|
185
|
+
display: "inline-block",
|
|
186
|
+
width: "0.875rem",
|
|
187
|
+
height: "0.875rem",
|
|
188
|
+
border: "2px solid currentColor",
|
|
189
|
+
borderTopColor: "transparent",
|
|
190
|
+
borderRadius: "50%",
|
|
191
|
+
animation: "cui-spin 0.75s linear infinite"
|
|
192
|
+
} }, null, -1))
|
|
193
|
+
]),
|
|
194
|
+
key: "0"
|
|
195
|
+
} : void 0
|
|
196
|
+
]), 1032, ["color", "disabled"])
|
|
197
|
+
])
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
})
|
|
201
|
+
]),
|
|
202
|
+
_: 3
|
|
203
|
+
}, 8, ["hidden", "visible"]));
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
export {
|
|
207
|
+
ne as default
|
|
208
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as c, computed as m, withDirectives as u, openBlock as f, createElementBlock as h, normalizeStyle as x, renderSlot as g, vShow as y } from "vue";
|
|
2
|
+
import { useBreakpoint as v } from "../composables/useBreakpoint.js";
|
|
3
|
+
import { resolveResponsive as a, spacingToCss as n, CONTAINER_WIDTHS as B } from "../utils/responsive.js";
|
|
4
|
+
const w = /* @__PURE__ */ c({
|
|
5
|
+
__name: "CuiContainer",
|
|
6
|
+
props: {
|
|
7
|
+
maxWidth: { default: "2xl" },
|
|
8
|
+
px: { default: "4" },
|
|
9
|
+
py: {},
|
|
10
|
+
centered: { type: Boolean, default: !0 },
|
|
11
|
+
hidden: { type: Boolean, default: !1 }
|
|
12
|
+
},
|
|
13
|
+
setup(r) {
|
|
14
|
+
const o = r, { breakpoint: s } = v(), l = m(() => {
|
|
15
|
+
const e = s.value, d = a(o.maxWidth, "2xl", e), p = a(o.px, "4", e), i = a(o.py, void 0, e), t = {
|
|
16
|
+
width: "100%",
|
|
17
|
+
maxWidth: B[d] ?? "1536px",
|
|
18
|
+
paddingLeft: n(p),
|
|
19
|
+
paddingRight: n(p)
|
|
20
|
+
};
|
|
21
|
+
return o.centered && (t.marginLeft = "auto", t.marginRight = "auto"), i && (t.paddingTop = n(i), t.paddingBottom = n(i)), t;
|
|
22
|
+
});
|
|
23
|
+
return (e, d) => u((f(), h("div", {
|
|
24
|
+
class: "cui-container",
|
|
25
|
+
style: x(l.value)
|
|
26
|
+
}, [
|
|
27
|
+
g(e.$slots, "default")
|
|
28
|
+
], 4)), [
|
|
29
|
+
[y, !r.hidden]
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
w as default
|
|
35
|
+
};
|