@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,46 @@
|
|
|
1
|
+
import { defineComponent as d, inject as p, ref as i, onMounted as v, computed as l, withDirectives as h, openBlock as o, createElementBlock as c, createBlock as _, resolveDynamicComponent as b, mergeProps as k, withCtx as y, renderSlot as C, toDisplayString as B, unref as g, createCommentVNode as x, vShow as S } from "vue";
|
|
2
|
+
import { BreadcrumbContextKey as w } from "./breadcrumb-context.js";
|
|
3
|
+
const D = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "cui-breadcrumb-item__separator",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, R = /* @__PURE__ */ d({
|
|
8
|
+
__name: "CuiBreadcrumbItem",
|
|
9
|
+
props: {
|
|
10
|
+
href: {},
|
|
11
|
+
to: {},
|
|
12
|
+
hidden: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
setup(u) {
|
|
15
|
+
const e = u, s = p(w, { separator: "/" }), t = i(), r = i(!1);
|
|
16
|
+
v(() => {
|
|
17
|
+
var a;
|
|
18
|
+
if ((a = t.value) != null && a.parentElement) {
|
|
19
|
+
const n = t.value.parentElement.querySelectorAll(".cui-breadcrumb-item");
|
|
20
|
+
r.value = n[n.length - 1] === t.value;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const m = l(() => r.value ? "span" : e.to ? "router-link" : e.href ? "a" : "span"), f = l(() => r.value ? {} : e.to ? { to: e.to } : e.href ? { href: e.href } : {});
|
|
24
|
+
return (a, n) => h((o(), c("li", {
|
|
25
|
+
ref_key: "elRef",
|
|
26
|
+
ref: t,
|
|
27
|
+
class: "cui-breadcrumb-item"
|
|
28
|
+
}, [
|
|
29
|
+
(o(), _(b(m.value), k(f.value, {
|
|
30
|
+
class: ["cui-breadcrumb-item__link", { "cui-breadcrumb-item__link--current": r.value }],
|
|
31
|
+
"aria-current": r.value ? "page" : void 0
|
|
32
|
+
}), {
|
|
33
|
+
default: y(() => [
|
|
34
|
+
C(a.$slots, "default", {}, void 0, !0)
|
|
35
|
+
]),
|
|
36
|
+
_: 3
|
|
37
|
+
}, 16, ["class", "aria-current"])),
|
|
38
|
+
r.value ? x("", !0) : (o(), c("span", D, B(g(s).separator), 1))
|
|
39
|
+
], 512)), [
|
|
40
|
+
[S, !u.hidden]
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
R as default
|
|
46
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiButton.vue"],"names":[],"mappings":"AAsRA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,cACf,SAAQ,aAAa,EACnB,cAAc,EACd,aAAa,EACb,gBAAgB;IAClB,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,uBAAuB;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA+CD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;AAoLD,QAAA,IAAuB,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACrF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA0B/C,QAAA,MAAM,eAAe;;;;;;;;UA9QZ,QAAQ,GAAG,QAAQ,GAAG,OAAO;aAJ1B,aAAa;aAEb,UAAU;aAQV,OAAO;;6EAgRjB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent as _, computed as u, useTemplateRef as y, withDirectives as x, openBlock as s, createBlock as k, resolveDynamicComponent as C, mergeProps as B, withCtx as S, createElementBlock as c, renderSlot as d, createCommentVNode as v, createVNode as z, createElementVNode as R, normalizeClass as w, vShow as E } from "vue";
|
|
2
|
+
import N from "./CuiIcon.vue.js";
|
|
3
|
+
import { BUTTON_SIZE_SCALE as V } from "../utils/sizing.js";
|
|
4
|
+
import { warnVariantColor as D } from "../utils/devWarn.js";
|
|
5
|
+
const T = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "cui-button__prefix"
|
|
8
|
+
}, A = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "cui-button__spinner",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, I = {
|
|
13
|
+
key: 2,
|
|
14
|
+
class: "cui-button__suffix"
|
|
15
|
+
}, U = /* @__PURE__ */ _({
|
|
16
|
+
__name: "CuiButton",
|
|
17
|
+
props: {
|
|
18
|
+
variant: { default: "outline" },
|
|
19
|
+
rounded: { default: "md" },
|
|
20
|
+
type: { default: "button" },
|
|
21
|
+
href: {},
|
|
22
|
+
to: {},
|
|
23
|
+
loading: { type: Boolean, default: !1 },
|
|
24
|
+
hidden: { type: Boolean, default: !1 },
|
|
25
|
+
color: { default: "primary" },
|
|
26
|
+
size: { default: "md" },
|
|
27
|
+
disabled: { type: Boolean, default: !1 }
|
|
28
|
+
},
|
|
29
|
+
setup(a, { expose: b }) {
|
|
30
|
+
const t = a;
|
|
31
|
+
D("CuiButton", { value: t.variant, allowed: ["solid", "outline", "dash", "ghost"] }, t.color);
|
|
32
|
+
const o = u(() => t.disabled || t.loading), f = u(() => t.to ? "router-link" : t.href ? "a" : "button"), p = u(() => t.to ? { to: t.to, ...o.value ? { "aria-disabled": "true", tabindex: "-1" } : {} } : t.href ? {
|
|
33
|
+
href: o.value ? void 0 : t.href,
|
|
34
|
+
role: "button",
|
|
35
|
+
...o.value ? { "aria-disabled": "true", tabindex: "-1" } : {}
|
|
36
|
+
} : {
|
|
37
|
+
type: t.type,
|
|
38
|
+
disabled: o.value || void 0,
|
|
39
|
+
"aria-disabled": o.value || void 0
|
|
40
|
+
}), l = y("buttonRef");
|
|
41
|
+
function h(e) {
|
|
42
|
+
var r;
|
|
43
|
+
(r = l.value) == null || r.focus(e);
|
|
44
|
+
}
|
|
45
|
+
function g() {
|
|
46
|
+
var e;
|
|
47
|
+
(e = l.value) == null || e.blur();
|
|
48
|
+
}
|
|
49
|
+
b({ el: l, focus: h, blur: g });
|
|
50
|
+
const m = {
|
|
51
|
+
none: "0",
|
|
52
|
+
sm: "0.25rem",
|
|
53
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
54
|
+
lg: "0.5rem",
|
|
55
|
+
full: "9999px"
|
|
56
|
+
}, $ = u(() => {
|
|
57
|
+
const e = t.color, r = t.variant, i = V[t.size], n = {
|
|
58
|
+
height: i.height,
|
|
59
|
+
paddingLeft: i.px,
|
|
60
|
+
paddingRight: i.px,
|
|
61
|
+
fontSize: i.fontSize,
|
|
62
|
+
gap: i.gap,
|
|
63
|
+
borderRadius: m[t.rounded],
|
|
64
|
+
"--_btn-focus-ring": `var(--cui-${e}-focus-ring)`
|
|
65
|
+
};
|
|
66
|
+
return r === "solid" ? {
|
|
67
|
+
...n,
|
|
68
|
+
background: `var(--cui-${e}-solid, var(--cui-${e}))`,
|
|
69
|
+
color: `var(--cui-${e}-text)`,
|
|
70
|
+
border: "1px solid transparent",
|
|
71
|
+
"--_btn-hover-bg": `var(--cui-${e}-solid-hover, var(--cui-${e}-hover))`,
|
|
72
|
+
"--_btn-active-bg": `var(--cui-${e}-solid-active, var(--cui-${e}-active))`
|
|
73
|
+
} : r === "outline" ? {
|
|
74
|
+
...n,
|
|
75
|
+
background: "transparent",
|
|
76
|
+
color: `var(--cui-${e})`,
|
|
77
|
+
border: "1px solid var(--cui-border-strong)",
|
|
78
|
+
"--_btn-hover-bg": `var(--cui-${e}-bg)`,
|
|
79
|
+
"--_btn-hover-color": `var(--cui-${e}-hover)`,
|
|
80
|
+
"--_btn-hover-border": `var(--cui-${e})`,
|
|
81
|
+
"--_btn-active-bg": `var(--cui-${e}-subtle)`
|
|
82
|
+
} : r === "dash" ? {
|
|
83
|
+
...n,
|
|
84
|
+
background: "transparent",
|
|
85
|
+
color: `var(--cui-${e})`,
|
|
86
|
+
border: "1px dashed var(--cui-border-strong)",
|
|
87
|
+
"--_btn-hover-bg": `var(--cui-${e}-bg)`,
|
|
88
|
+
"--_btn-hover-color": `var(--cui-${e}-hover)`,
|
|
89
|
+
"--_btn-hover-border": `var(--cui-${e})`,
|
|
90
|
+
"--_btn-active-bg": `var(--cui-${e}-subtle)`
|
|
91
|
+
} : {
|
|
92
|
+
...n,
|
|
93
|
+
background: "transparent",
|
|
94
|
+
color: `var(--cui-${e})`,
|
|
95
|
+
border: "1px solid transparent",
|
|
96
|
+
"--_btn-hover-bg": `var(--cui-${e}-bg)`,
|
|
97
|
+
"--_btn-hover-color": `var(--cui-${e}-hover)`,
|
|
98
|
+
"--_btn-active-bg": `var(--cui-${e}-subtle)`
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
return (e, r) => x((s(), k(C(f.value), B({
|
|
102
|
+
ref: "buttonRef",
|
|
103
|
+
class: ["cui-button", { "cui-button--disabled": o.value }],
|
|
104
|
+
style: $.value
|
|
105
|
+
}, p.value, {
|
|
106
|
+
"aria-busy": a.loading || void 0
|
|
107
|
+
}), {
|
|
108
|
+
default: S(() => [
|
|
109
|
+
e.$slots.prefix ? (s(), c("span", T, [
|
|
110
|
+
d(e.$slots, "prefix", {}, void 0, !0)
|
|
111
|
+
])) : v("", !0),
|
|
112
|
+
a.loading ? (s(), c("span", A, [
|
|
113
|
+
z(N, {
|
|
114
|
+
name: "circle-notch",
|
|
115
|
+
size: "1em",
|
|
116
|
+
class: "cui-button__spinner-svg"
|
|
117
|
+
})
|
|
118
|
+
])) : v("", !0),
|
|
119
|
+
R("span", {
|
|
120
|
+
class: w([{ "opacity-0": a.loading }, "cui-button__content"])
|
|
121
|
+
}, [
|
|
122
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
123
|
+
], 2),
|
|
124
|
+
e.$slots.suffix ? (s(), c("span", I, [
|
|
125
|
+
d(e.$slots, "suffix", {}, void 0, !0)
|
|
126
|
+
])) : v("", !0)
|
|
127
|
+
]),
|
|
128
|
+
_: 3
|
|
129
|
+
}, 16, ["class", "style", "aria-busy"])), [
|
|
130
|
+
[E, !a.hidden]
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export {
|
|
135
|
+
U as default
|
|
136
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as t, withDirectives as n, openBlock as r, createElementBlock as i, normalizeClass as u, renderSlot as a, vShow as l } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ t({
|
|
3
|
+
__name: "CuiButtonGroup",
|
|
4
|
+
props: {
|
|
5
|
+
orientation: { default: "horizontal" },
|
|
6
|
+
hidden: { type: Boolean, default: !1 }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (o, d) => n((r(), i("div", {
|
|
10
|
+
class: u(["cui-button-group", `cui-button-group--${e.orientation}`]),
|
|
11
|
+
role: "group"
|
|
12
|
+
}, [
|
|
13
|
+
a(o.$slots, "default", {}, void 0, !0)
|
|
14
|
+
], 2)), [
|
|
15
|
+
[l, !e.hidden]
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
c as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as d, computed as n, withDirectives as l, openBlock as i, createElementBlock as u, normalizeStyle as s, renderSlot as c, vShow as p } from "vue";
|
|
2
|
+
const v = /* @__PURE__ */ d({
|
|
3
|
+
__name: "CuiCard",
|
|
4
|
+
props: {
|
|
5
|
+
variant: { default: "elevated" },
|
|
6
|
+
rounded: { default: "lg" },
|
|
7
|
+
hidden: { type: Boolean, default: !1 }
|
|
8
|
+
},
|
|
9
|
+
setup(a) {
|
|
10
|
+
const o = {
|
|
11
|
+
none: "0",
|
|
12
|
+
sm: "0.25rem",
|
|
13
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
14
|
+
lg: "0.5rem",
|
|
15
|
+
full: "9999px"
|
|
16
|
+
}, r = a, t = n(() => {
|
|
17
|
+
const e = {
|
|
18
|
+
borderRadius: o[r.rounded],
|
|
19
|
+
overflow: "clip",
|
|
20
|
+
background: "var(--cui-surface-base)"
|
|
21
|
+
};
|
|
22
|
+
return r.variant === "elevated" ? (e.border = "1px solid var(--cui-border)", e.boxShadow = "0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.03)") : r.variant === "outline" ? e.border = "1px solid var(--cui-border)" : (e.border = "none", e.background = "transparent"), e;
|
|
23
|
+
});
|
|
24
|
+
return (e, b) => l((i(), u("div", {
|
|
25
|
+
style: s(t.value)
|
|
26
|
+
}, [
|
|
27
|
+
c(e.$slots, "default")
|
|
28
|
+
], 4)), [
|
|
29
|
+
[p, !a.hidden]
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
v as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent as n, withDirectives as t, openBlock as d, createElementBlock as l, normalizeStyle as o, renderSlot as i, vShow as r } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ n({
|
|
3
|
+
__name: "CuiCardBody",
|
|
4
|
+
props: {
|
|
5
|
+
noPadding: { type: Boolean, default: !1 },
|
|
6
|
+
hidden: { type: Boolean, default: !1 }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (a, c) => t((d(), l("div", {
|
|
10
|
+
style: o({ padding: e.noPadding ? "0" : "calc(0.5rem * var(--cui-density-scale, 1)) calc(1.125rem * var(--cui-density-scale, 1))" })
|
|
11
|
+
}, [
|
|
12
|
+
i(a.$slots, "default")
|
|
13
|
+
], 4)), [
|
|
14
|
+
[r, !e.hidden]
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
u as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as n, withDirectives as l, openBlock as c, createElementBlock as i, normalizeStyle as r, renderSlot as s, vShow as d } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ n({
|
|
3
|
+
__name: "CuiCardFooter",
|
|
4
|
+
props: {
|
|
5
|
+
align: { default: "right" },
|
|
6
|
+
hidden: { type: Boolean, default: !1 }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
const t = {
|
|
10
|
+
left: "flex-start",
|
|
11
|
+
right: "flex-end",
|
|
12
|
+
center: "center",
|
|
13
|
+
between: "space-between"
|
|
14
|
+
};
|
|
15
|
+
return (a, o) => l((c(), i("div", {
|
|
16
|
+
style: r({
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
gap: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
20
|
+
padding: "calc(0.375rem * var(--cui-density-scale, 1)) calc(1.125rem * var(--cui-density-scale, 1)) calc(1rem * var(--cui-density-scale, 1))",
|
|
21
|
+
justifyContent: t[e.align]
|
|
22
|
+
})
|
|
23
|
+
}, [
|
|
24
|
+
s(a.$slots, "default")
|
|
25
|
+
], 4)), [
|
|
26
|
+
[d, !e.hidden]
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
u as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as n, withDirectives as o, openBlock as t, createElementBlock as i, createElementVNode as r, renderSlot as l, toDisplayString as c, createCommentVNode as a, vShow as d } from "vue";
|
|
2
|
+
const m = { style: {
|
|
3
|
+
display: "flex",
|
|
4
|
+
alignItems: "flex-start",
|
|
5
|
+
justifyContent: "space-between",
|
|
6
|
+
gap: "calc(0.75rem * var(--cui-density-scale, 1))",
|
|
7
|
+
padding: "calc(1rem * var(--cui-density-scale, 1)) calc(1.125rem * var(--cui-density-scale, 1)) calc(0.375rem * var(--cui-density-scale, 1))"
|
|
8
|
+
} }, u = { style: { flex: "1", minWidth: "0" } }, y = {
|
|
9
|
+
key: 0,
|
|
10
|
+
style: {
|
|
11
|
+
fontSize: "1.0625rem",
|
|
12
|
+
fontWeight: "600",
|
|
13
|
+
lineHeight: "1.4",
|
|
14
|
+
color: "var(--cui-text-emphasis)"
|
|
15
|
+
}
|
|
16
|
+
}, f = {
|
|
17
|
+
key: 1,
|
|
18
|
+
style: {
|
|
19
|
+
fontSize: "0.8125rem",
|
|
20
|
+
color: "var(--cui-text-secondary)",
|
|
21
|
+
marginTop: "calc(0.125rem * var(--cui-density-scale, 1))"
|
|
22
|
+
}
|
|
23
|
+
}, h = {
|
|
24
|
+
key: 0,
|
|
25
|
+
style: { display: "flex", alignItems: "center", gap: "calc(0.5rem * var(--cui-density-scale, 1))", flexShrink: "0" }
|
|
26
|
+
}, p = /* @__PURE__ */ n({
|
|
27
|
+
__name: "CuiCardHeader",
|
|
28
|
+
props: {
|
|
29
|
+
title: {},
|
|
30
|
+
subtitle: {},
|
|
31
|
+
hidden: { type: Boolean, default: !1 }
|
|
32
|
+
},
|
|
33
|
+
setup(e) {
|
|
34
|
+
return (s, v) => o((t(), i("div", m, [
|
|
35
|
+
r("div", u, [
|
|
36
|
+
l(s.$slots, "default", {}, () => [
|
|
37
|
+
e.title ? (t(), i("div", y, c(e.title), 1)) : a("", !0),
|
|
38
|
+
e.subtitle ? (t(), i("div", f, c(e.subtitle), 1)) : a("", !0)
|
|
39
|
+
])
|
|
40
|
+
]),
|
|
41
|
+
s.$slots.actions ? (t(), i("div", h, [
|
|
42
|
+
l(s.$slots, "actions")
|
|
43
|
+
])) : a("", !0)
|
|
44
|
+
], 512)), [
|
|
45
|
+
[d, !e.hidden]
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
p as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as l, computed as d, withDirectives as n, openBlock as a, createElementBlock as c, normalizeClass as r, renderSlot as u, normalizeStyle as m, createCommentVNode as p, vShow as f } from "vue";
|
|
2
|
+
const h = ["src", "alt"], C = /* @__PURE__ */ l({
|
|
3
|
+
__name: "CuiCardMedia",
|
|
4
|
+
props: {
|
|
5
|
+
src: {},
|
|
6
|
+
alt: { default: "" },
|
|
7
|
+
aspect: { default: "video" },
|
|
8
|
+
position: { default: "top" },
|
|
9
|
+
hidden: { type: Boolean, default: !1 }
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
const t = e, o = {
|
|
13
|
+
auto: "auto",
|
|
14
|
+
video: "16 / 9",
|
|
15
|
+
square: "1 / 1"
|
|
16
|
+
}, s = d(() => ({
|
|
17
|
+
aspectRatio: o[t.aspect] ?? t.aspect
|
|
18
|
+
}));
|
|
19
|
+
return (i, v) => n((a(), c("div", {
|
|
20
|
+
class: r(["cui-card-media", `cui-card-media--${e.position}`])
|
|
21
|
+
}, [
|
|
22
|
+
u(i.$slots, "default", {}, () => [
|
|
23
|
+
e.src ? (a(), c("img", {
|
|
24
|
+
key: 0,
|
|
25
|
+
src: e.src,
|
|
26
|
+
alt: e.alt,
|
|
27
|
+
class: "cui-card-media__img",
|
|
28
|
+
style: m(s.value)
|
|
29
|
+
}, null, 12, h)) : p("", !0)
|
|
30
|
+
], !0)
|
|
31
|
+
], 2)), [
|
|
32
|
+
[f, !e.hidden]
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
C as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineComponent as w, inject as _, computed as u, ref as S, withDirectives as z, openBlock as r, createElementBlock as b, normalizeStyle as h, normalizeClass as D, createElementVNode as d, withModifiers as E, createBlock as k, createCommentVNode as f, renderSlot as y, createTextVNode as x, toDisplayString as p, vShow as N } from "vue";
|
|
2
|
+
import { CheckboxGroupKey as R } from "./multi-select-group-context.js";
|
|
3
|
+
import C from "./CuiIcon.vue.js";
|
|
4
|
+
const K = ["aria-checked", "aria-disabled", "tabindex"], j = ["value", "checked", "indeterminate", "disabled", "readonly"], G = { class: "cui-checkbox__label-wrap" }, I = { class: "cui-checkbox__label" }, M = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "cui-checkbox__description"
|
|
7
|
+
}, F = /* @__PURE__ */ w({
|
|
8
|
+
__name: "CuiCheckbox",
|
|
9
|
+
props: {
|
|
10
|
+
value: {},
|
|
11
|
+
modelValue: { type: Boolean },
|
|
12
|
+
label: {},
|
|
13
|
+
description: {},
|
|
14
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
15
|
+
readonly: { type: Boolean, default: !1 },
|
|
16
|
+
hidden: { type: Boolean, default: !1 },
|
|
17
|
+
color: {},
|
|
18
|
+
disabled: { type: Boolean, default: !1 }
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue"],
|
|
21
|
+
setup(e, { expose: V, emit: $ }) {
|
|
22
|
+
const t = e, g = $, l = _(R, null), a = u(() => l && t.value !== void 0 ? l.modelValue.value.includes(t.value) : t.modelValue === !0), o = u(() => l != null && l.disabled.value ? !0 : t.disabled), n = u(() => l != null && l.readonly.value ? !0 : t.readonly), c = u(() => t.color ?? (l == null ? void 0 : l.color.value) ?? "primary"), s = S();
|
|
23
|
+
function v() {
|
|
24
|
+
o.value || n.value || (l && t.value !== void 0 ? l.toggle(t.value) : g("update:modelValue", !t.modelValue));
|
|
25
|
+
}
|
|
26
|
+
function B(i) {
|
|
27
|
+
(i.key === " " || i.key === "Enter") && (i.preventDefault(), v());
|
|
28
|
+
}
|
|
29
|
+
return V({ el: s, focus: () => {
|
|
30
|
+
var i;
|
|
31
|
+
return (i = s.value) == null ? void 0 : i.focus();
|
|
32
|
+
} }), (i, m) => z((r(), b("label", {
|
|
33
|
+
ref_key: "elRef",
|
|
34
|
+
ref: s,
|
|
35
|
+
class: D(["cui-checkbox", {
|
|
36
|
+
"cui-checkbox--checked": a.value,
|
|
37
|
+
"cui-checkbox--indeterminate": e.indeterminate && !a.value,
|
|
38
|
+
"cui-checkbox--disabled": o.value,
|
|
39
|
+
"cui-checkbox--readonly": n.value
|
|
40
|
+
}]),
|
|
41
|
+
style: h({ "--_check-focus-ring": `var(--cui-${c.value}-focus-ring)` }),
|
|
42
|
+
role: "checkbox",
|
|
43
|
+
"aria-checked": e.indeterminate && !a.value ? "mixed" : a.value,
|
|
44
|
+
"aria-disabled": o.value || n.value || void 0,
|
|
45
|
+
tabindex: o.value ? -1 : 0,
|
|
46
|
+
onClick: v,
|
|
47
|
+
onKeydown: B
|
|
48
|
+
}, [
|
|
49
|
+
d("input", {
|
|
50
|
+
type: "checkbox",
|
|
51
|
+
value: e.value !== void 0 ? String(e.value) : void 0,
|
|
52
|
+
checked: a.value,
|
|
53
|
+
indeterminate: e.indeterminate && !a.value,
|
|
54
|
+
disabled: o.value,
|
|
55
|
+
readonly: n.value,
|
|
56
|
+
tabindex: "-1",
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
class: "cui-checkbox__input",
|
|
59
|
+
onClick: m[0] || (m[0] = E(() => {
|
|
60
|
+
}, ["stop", "prevent"]))
|
|
61
|
+
}, null, 8, j),
|
|
62
|
+
d("span", {
|
|
63
|
+
class: "cui-checkbox__indicator",
|
|
64
|
+
style: h({
|
|
65
|
+
"--_check-color": `var(--cui-${c.value})`,
|
|
66
|
+
"--_check-border": a.value || e.indeterminate && !a.value ? `var(--cui-${c.value})` : "var(--cui-border-strong)",
|
|
67
|
+
"--_check-bg": a.value || e.indeterminate && !a.value ? `var(--cui-${c.value}-bg)` : "transparent"
|
|
68
|
+
})
|
|
69
|
+
}, [
|
|
70
|
+
a.value ? (r(), k(C, {
|
|
71
|
+
key: 0,
|
|
72
|
+
name: "check",
|
|
73
|
+
weight: "bold",
|
|
74
|
+
size: "0.875rem",
|
|
75
|
+
color: `var(--cui-${c.value})`,
|
|
76
|
+
class: "cui-checkbox__icon"
|
|
77
|
+
}, null, 8, ["color"])) : e.indeterminate ? (r(), k(C, {
|
|
78
|
+
key: 1,
|
|
79
|
+
name: "minus",
|
|
80
|
+
weight: "bold",
|
|
81
|
+
size: "0.875rem",
|
|
82
|
+
color: `var(--cui-${c.value})`,
|
|
83
|
+
class: "cui-checkbox__icon"
|
|
84
|
+
}, null, 8, ["color"])) : f("", !0)
|
|
85
|
+
], 4),
|
|
86
|
+
d("span", G, [
|
|
87
|
+
d("span", I, [
|
|
88
|
+
y(i.$slots, "default", {}, () => [
|
|
89
|
+
x(p(e.label), 1)
|
|
90
|
+
], !0)
|
|
91
|
+
]),
|
|
92
|
+
e.description || i.$slots.description ? (r(), b("span", M, [
|
|
93
|
+
y(i.$slots, "description", {}, () => [
|
|
94
|
+
x(p(e.description), 1)
|
|
95
|
+
], !0)
|
|
96
|
+
])) : f("", !0)
|
|
97
|
+
])
|
|
98
|
+
], 46, K)), [
|
|
99
|
+
[N, !e.hidden]
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
export {
|
|
104
|
+
F as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent as b, useSlots as y, computed as u, provide as g, toRef as a, withDirectives as v, openBlock as c, createElementBlock as s, normalizeClass as k, createElementVNode as x, renderSlot as V, toDisplayString as C, createCommentVNode as S, vShow as B } from "vue";
|
|
2
|
+
import { CheckboxGroupKey as D } from "./multi-select-group-context.js";
|
|
3
|
+
const M = ["aria-label", "aria-invalid"], w = { class: "cui-checkbox-group__options" }, z = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "cui-checkbox-group__error"
|
|
6
|
+
}, N = /* @__PURE__ */ b({
|
|
7
|
+
__name: "CuiCheckboxGroup",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { default: () => [] },
|
|
10
|
+
orientation: { default: "auto" },
|
|
11
|
+
readonly: { type: Boolean, default: !1 },
|
|
12
|
+
error: { type: Boolean, default: !1 },
|
|
13
|
+
errorMessage: {},
|
|
14
|
+
label: {},
|
|
15
|
+
hidden: { type: Boolean, default: !1 },
|
|
16
|
+
color: { default: "primary" },
|
|
17
|
+
disabled: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(o, { emit: f }) {
|
|
21
|
+
const e = o, m = f, i = y(), h = u(() => {
|
|
22
|
+
var r;
|
|
23
|
+
const t = (r = i.default) == null ? void 0 : r.call(i);
|
|
24
|
+
return t ? t.reduce((l, n) => {
|
|
25
|
+
var d;
|
|
26
|
+
return n.type === Symbol.for("v-fgm") || n.type === Symbol.for("v-fgt") ? l + (((d = n.children) == null ? void 0 : d.length) ?? 0) : l + 1;
|
|
27
|
+
}, 0) : 0;
|
|
28
|
+
}), p = u(() => e.orientation !== "auto" ? e.orientation : h.value <= 2 ? "horizontal" : "vertical");
|
|
29
|
+
return g(D, {
|
|
30
|
+
modelValue: a(e, "modelValue"),
|
|
31
|
+
color: a(e, "color"),
|
|
32
|
+
disabled: a(e, "disabled"),
|
|
33
|
+
readonly: a(e, "readonly"),
|
|
34
|
+
toggle(t) {
|
|
35
|
+
if (e.disabled || e.readonly) return;
|
|
36
|
+
const r = [...e.modelValue], l = r.indexOf(t);
|
|
37
|
+
l >= 0 ? r.splice(l, 1) : r.push(t), m("update:modelValue", r);
|
|
38
|
+
}
|
|
39
|
+
}), (t, r) => v((c(), s("div", {
|
|
40
|
+
role: "group",
|
|
41
|
+
"aria-label": o.label,
|
|
42
|
+
"aria-invalid": o.error || void 0,
|
|
43
|
+
class: k(["cui-checkbox-group", [
|
|
44
|
+
`cui-checkbox-group--${p.value}`,
|
|
45
|
+
{ "cui-checkbox-group--error": o.error }
|
|
46
|
+
]])
|
|
47
|
+
}, [
|
|
48
|
+
x("div", w, [
|
|
49
|
+
V(t.$slots, "default", {}, void 0, !0)
|
|
50
|
+
]),
|
|
51
|
+
o.error && o.errorMessage ? (c(), s("div", z, C(o.errorMessage), 1)) : S("", !0)
|
|
52
|
+
], 10, M)), [
|
|
53
|
+
[B, !o.hidden]
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
N as default
|
|
59
|
+
};
|