@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,256 @@
|
|
|
1
|
+
import { defineComponent as J, computed as b, ref as K, watch as L, useTemplateRef as N, withDirectives as O, openBlock as Q, createBlock as U, createSlots as W, withCtx as g, renderSlot as C, vShow as X, nextTick as Y } from "vue";
|
|
2
|
+
import _ from "./CuiInput.vue.js";
|
|
3
|
+
const ne = /* @__PURE__ */ J({
|
|
4
|
+
__name: "CuiMaskedInput",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: { default: "" },
|
|
7
|
+
mask: {},
|
|
8
|
+
tokens: {},
|
|
9
|
+
fillChar: { default: "_" },
|
|
10
|
+
placeholder: {},
|
|
11
|
+
clearable: { type: Boolean, default: !1 },
|
|
12
|
+
error: { type: Boolean, default: !1 },
|
|
13
|
+
errorMessage: {},
|
|
14
|
+
readonly: { type: Boolean, default: !1 },
|
|
15
|
+
hidden: { type: Boolean, default: !1 },
|
|
16
|
+
color: { default: "primary" },
|
|
17
|
+
size: { default: "md" },
|
|
18
|
+
disabled: { type: Boolean, default: !1 }
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue", "update:formattedValue"],
|
|
21
|
+
setup(u, { expose: $, emit: F }) {
|
|
22
|
+
const f = u, B = F, z = {
|
|
23
|
+
"#": { pattern: /[0-9]/ },
|
|
24
|
+
A: { pattern: /[a-zA-Z]/ },
|
|
25
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
26
|
+
}, D = b(() => ({ ...z, ...f.tokens })), c = b(() => {
|
|
27
|
+
const e = [];
|
|
28
|
+
let t = 0;
|
|
29
|
+
for (let n = 0; n < f.mask.length; n++) {
|
|
30
|
+
const l = f.mask[n];
|
|
31
|
+
if (l === "\\" && n + 1 < f.mask.length) {
|
|
32
|
+
n++, e.push({ index: t, isToken: !1, char: f.mask[n] }), t++;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const s = D.value[l];
|
|
36
|
+
s ? e.push({ index: t, isToken: !0, char: l, pattern: s.pattern }) : e.push({ index: t, isToken: !1, char: l }), t++;
|
|
37
|
+
}
|
|
38
|
+
return e;
|
|
39
|
+
}), v = b(() => c.value.filter((e) => e.isToken));
|
|
40
|
+
function d(e) {
|
|
41
|
+
let t = 0, n = "";
|
|
42
|
+
for (const l of c.value)
|
|
43
|
+
l.isToken ? t < e.length ? (n += e[t], t++) : n += f.fillChar : n += l.char;
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function P(e) {
|
|
47
|
+
var n;
|
|
48
|
+
let t = "";
|
|
49
|
+
for (const l of c.value)
|
|
50
|
+
if (l.isToken && l.index < e.length) {
|
|
51
|
+
const s = e[l.index];
|
|
52
|
+
s !== f.fillChar && ((n = l.pattern) != null && n.test(s)) && (t += s);
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
function E(e) {
|
|
57
|
+
var l;
|
|
58
|
+
let t = "", n = 0;
|
|
59
|
+
for (const s of e) {
|
|
60
|
+
if (n >= v.value.length) break;
|
|
61
|
+
(l = v.value[n].pattern) != null && l.test(s) && (t += s, n++);
|
|
62
|
+
}
|
|
63
|
+
return t;
|
|
64
|
+
}
|
|
65
|
+
const i = K(d(f.modelValue));
|
|
66
|
+
L(
|
|
67
|
+
() => f.modelValue,
|
|
68
|
+
(e) => {
|
|
69
|
+
const t = E(e);
|
|
70
|
+
i.value = d(t);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
const A = b(() => i.value);
|
|
74
|
+
function x(e) {
|
|
75
|
+
let t = 0;
|
|
76
|
+
for (const n of c.value)
|
|
77
|
+
if (n.isToken) {
|
|
78
|
+
if (t === e) return n.index;
|
|
79
|
+
t++;
|
|
80
|
+
}
|
|
81
|
+
return c.value.length;
|
|
82
|
+
}
|
|
83
|
+
function w(e) {
|
|
84
|
+
for (const t of c.value)
|
|
85
|
+
if (t.isToken && t.index >= e) return t.index;
|
|
86
|
+
return c.value.length;
|
|
87
|
+
}
|
|
88
|
+
const y = N("maskedInputRef");
|
|
89
|
+
function I() {
|
|
90
|
+
var e;
|
|
91
|
+
return (e = y.value) == null ? void 0 : e.el;
|
|
92
|
+
}
|
|
93
|
+
function p(e) {
|
|
94
|
+
Y(() => {
|
|
95
|
+
const t = I();
|
|
96
|
+
t && t.setSelectionRange(e, e);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function M(e) {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const t = I();
|
|
102
|
+
if (!t) return;
|
|
103
|
+
const n = t.selectionStart ?? 0, l = t.selectionEnd ?? n, s = P(i.value);
|
|
104
|
+
if (e.inputType === "insertText" && e.data) {
|
|
105
|
+
let a = 0;
|
|
106
|
+
for (const m of c.value) {
|
|
107
|
+
if (m.index >= n) break;
|
|
108
|
+
m.isToken && a++;
|
|
109
|
+
}
|
|
110
|
+
const r = S(e.data, a);
|
|
111
|
+
if (!r) return;
|
|
112
|
+
let o = s;
|
|
113
|
+
if (n !== l) {
|
|
114
|
+
const m = k(n), H = k(l);
|
|
115
|
+
o = o.slice(0, m) + o.slice(H), a = m;
|
|
116
|
+
}
|
|
117
|
+
o = o.slice(0, a) + r + o.slice(a), o = o.slice(0, v.value.length), i.value = d(o), T(o);
|
|
118
|
+
const h = a + r.length, R = x(h);
|
|
119
|
+
p(w(R));
|
|
120
|
+
} else if (e.inputType === "deleteContentBackward" || e.inputType === "deleteContentForward") {
|
|
121
|
+
let a = k(n), r = k(l);
|
|
122
|
+
if (n === l)
|
|
123
|
+
if (e.inputType === "deleteContentBackward")
|
|
124
|
+
if (a > 0)
|
|
125
|
+
a--;
|
|
126
|
+
else
|
|
127
|
+
return;
|
|
128
|
+
else if (r < s.length)
|
|
129
|
+
r++;
|
|
130
|
+
else
|
|
131
|
+
return;
|
|
132
|
+
const o = s.slice(0, a) + s.slice(r);
|
|
133
|
+
i.value = d(o), T(o);
|
|
134
|
+
const h = x(a);
|
|
135
|
+
e.inputType === "deleteContentBackward" ? p(h) : p(w(h));
|
|
136
|
+
} else if (e.inputType === "insertFromPaste") {
|
|
137
|
+
const a = e.data ?? "";
|
|
138
|
+
let r = k(n), o = s;
|
|
139
|
+
if (n !== l) {
|
|
140
|
+
const m = k(l);
|
|
141
|
+
o = o.slice(0, r) + o.slice(m);
|
|
142
|
+
}
|
|
143
|
+
const h = Z(a, r);
|
|
144
|
+
o = o.slice(0, r) + h + o.slice(r), o = o.slice(0, v.value.length), i.value = d(o), T(o);
|
|
145
|
+
const R = r + h.length;
|
|
146
|
+
p(x(R));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function k(e) {
|
|
150
|
+
let t = 0;
|
|
151
|
+
for (const n of c.value) {
|
|
152
|
+
if (n.index >= e) break;
|
|
153
|
+
n.isToken && t++;
|
|
154
|
+
}
|
|
155
|
+
return t;
|
|
156
|
+
}
|
|
157
|
+
function S(e, t) {
|
|
158
|
+
var s;
|
|
159
|
+
let n = "", l = t;
|
|
160
|
+
for (const a of e) {
|
|
161
|
+
if (l >= v.value.length) break;
|
|
162
|
+
(s = v.value[l].pattern) != null && s.test(a) && (n += a, l++);
|
|
163
|
+
}
|
|
164
|
+
return n;
|
|
165
|
+
}
|
|
166
|
+
function Z(e, t) {
|
|
167
|
+
return S(e, t);
|
|
168
|
+
}
|
|
169
|
+
function T(e) {
|
|
170
|
+
B("update:modelValue", e), B("update:formattedValue", d(e));
|
|
171
|
+
}
|
|
172
|
+
function V() {
|
|
173
|
+
const e = P(i.value);
|
|
174
|
+
return e.length === 0 ? w(0) : x(e.length);
|
|
175
|
+
}
|
|
176
|
+
function j() {
|
|
177
|
+
const e = I();
|
|
178
|
+
if (!e) return;
|
|
179
|
+
const t = e.selectionStart ?? 0, n = V();
|
|
180
|
+
if (t > n)
|
|
181
|
+
p(n);
|
|
182
|
+
else {
|
|
183
|
+
const l = w(t);
|
|
184
|
+
l > n ? p(n) : l !== t && p(l);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function q() {
|
|
188
|
+
i.value = d(""), T(""), p(w(0));
|
|
189
|
+
}
|
|
190
|
+
function G() {
|
|
191
|
+
(!i.value || i.value === d("")) && (i.value = d("")), p(V());
|
|
192
|
+
}
|
|
193
|
+
return $({
|
|
194
|
+
el: y,
|
|
195
|
+
formattedValue: A,
|
|
196
|
+
focus: () => {
|
|
197
|
+
var e;
|
|
198
|
+
return (e = y.value) == null ? void 0 : e.focus();
|
|
199
|
+
},
|
|
200
|
+
blur: () => {
|
|
201
|
+
var e;
|
|
202
|
+
return (e = y.value) == null ? void 0 : e.blur();
|
|
203
|
+
}
|
|
204
|
+
}), (e, t) => O((Q(), U(_, {
|
|
205
|
+
ref: "maskedInputRef",
|
|
206
|
+
"model-value": i.value,
|
|
207
|
+
type: "text",
|
|
208
|
+
placeholder: u.placeholder,
|
|
209
|
+
color: u.color,
|
|
210
|
+
size: u.size,
|
|
211
|
+
clearable: u.clearable,
|
|
212
|
+
error: u.error,
|
|
213
|
+
"error-message": u.errorMessage,
|
|
214
|
+
disabled: u.disabled,
|
|
215
|
+
readonly: u.readonly,
|
|
216
|
+
onBeforeinput: M,
|
|
217
|
+
onClick: j,
|
|
218
|
+
onFocusin: G,
|
|
219
|
+
onClear: q
|
|
220
|
+
}, W({ _: 2 }, [
|
|
221
|
+
e.$slots.prefix ? {
|
|
222
|
+
name: "prefix",
|
|
223
|
+
fn: g(() => [
|
|
224
|
+
C(e.$slots, "prefix")
|
|
225
|
+
]),
|
|
226
|
+
key: "0"
|
|
227
|
+
} : void 0,
|
|
228
|
+
e.$slots.suffix ? {
|
|
229
|
+
name: "suffix",
|
|
230
|
+
fn: g(() => [
|
|
231
|
+
C(e.$slots, "suffix")
|
|
232
|
+
]),
|
|
233
|
+
key: "1"
|
|
234
|
+
} : void 0,
|
|
235
|
+
e.$slots["prefix-button"] ? {
|
|
236
|
+
name: "prefix-button",
|
|
237
|
+
fn: g(() => [
|
|
238
|
+
C(e.$slots, "prefix-button")
|
|
239
|
+
]),
|
|
240
|
+
key: "2"
|
|
241
|
+
} : void 0,
|
|
242
|
+
e.$slots["suffix-button"] ? {
|
|
243
|
+
name: "suffix-button",
|
|
244
|
+
fn: g(() => [
|
|
245
|
+
C(e.$slots, "suffix-button")
|
|
246
|
+
]),
|
|
247
|
+
key: "3"
|
|
248
|
+
} : void 0
|
|
249
|
+
]), 1032, ["model-value", "placeholder", "color", "size", "clearable", "error", "error-message", "disabled", "readonly"])), [
|
|
250
|
+
[X, !u.hidden]
|
|
251
|
+
]);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
export {
|
|
255
|
+
ne as default
|
|
256
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { defineComponent as x, useTemplateRef as z, computed as N, openBlock as i, createBlock as O, Teleport as $, unref as l, withDirectives as E, createElementBlock as c, normalizeClass as m, createVNode as d, createElementVNode as u, normalizeStyle as M, Fragment as S, withCtx as V, renderSlot as f, vShow as I, createCommentVNode as R } from "vue";
|
|
2
|
+
import { useOverlay as G } from "../composables/useOverlay.js";
|
|
3
|
+
import K from "./CuiBackdrop.vue.js";
|
|
4
|
+
import T from "./CuiModalHeader.vue.js";
|
|
5
|
+
import W from "./CuiModalBody.vue.js";
|
|
6
|
+
const A = { class: "cui-modal-container" }, D = ["aria-labelledby"], J = /* @__PURE__ */ x({
|
|
7
|
+
__name: "CuiModal",
|
|
8
|
+
props: {
|
|
9
|
+
visible: { type: Boolean, default: !1 },
|
|
10
|
+
size: { default: "md" },
|
|
11
|
+
title: {},
|
|
12
|
+
persistent: { type: Boolean, default: !1 },
|
|
13
|
+
noCloseButton: { type: Boolean, default: !1 },
|
|
14
|
+
allowNested: { type: Boolean, default: !1 },
|
|
15
|
+
backdropOpacity: { default: 0.5 },
|
|
16
|
+
backdropBlur: { default: "none" },
|
|
17
|
+
backdropColor: { default: "black" },
|
|
18
|
+
backdropImage: {},
|
|
19
|
+
backdropGradient: {},
|
|
20
|
+
rounded: { default: "md" },
|
|
21
|
+
hidden: { type: Boolean, default: !1 }
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:visible", "close"],
|
|
24
|
+
setup(e, { emit: b }) {
|
|
25
|
+
const o = e, p = {
|
|
26
|
+
none: "0",
|
|
27
|
+
sm: "0.25rem",
|
|
28
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
29
|
+
lg: "0.5rem",
|
|
30
|
+
full: "9999px"
|
|
31
|
+
}, n = b, v = z("dialogEl"), { isVisible: y, isAnimating: a, closeOverlay: k, onBackdropClick: C, onKeydown: r } = G({
|
|
32
|
+
open: () => o.visible,
|
|
33
|
+
dialogRef: v,
|
|
34
|
+
persistent: () => o.persistent,
|
|
35
|
+
allowNested: () => o.allowNested,
|
|
36
|
+
onUpdateOpen: (t) => n("update:visible", t),
|
|
37
|
+
onClose: () => n("close")
|
|
38
|
+
}), g = {
|
|
39
|
+
sm: "24rem",
|
|
40
|
+
// 384px
|
|
41
|
+
md: "32rem",
|
|
42
|
+
// 512px
|
|
43
|
+
lg: "48rem",
|
|
44
|
+
// 768px
|
|
45
|
+
xl: "64rem",
|
|
46
|
+
// 1024px
|
|
47
|
+
full: "calc(100vw - 2rem)"
|
|
48
|
+
}, B = N(() => g[o.size] ?? o.size), h = `cui-modal-title-${Math.random().toString(36).slice(2, 8)}`;
|
|
49
|
+
return (t, s) => (i(), O($, { to: "body" }, [
|
|
50
|
+
l(y) ? E((i(), c("div", {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: m(["cui-modal-overlay", { "cui-modal-overlay--visible": l(a) }]),
|
|
53
|
+
onKeydown: s[0] || (s[0] = //@ts-ignore
|
|
54
|
+
(...w) => l(r) && l(r)(...w))
|
|
55
|
+
}, [
|
|
56
|
+
d(K, {
|
|
57
|
+
visible: l(a),
|
|
58
|
+
opacity: e.backdropOpacity,
|
|
59
|
+
blur: e.backdropBlur,
|
|
60
|
+
color: e.backdropColor,
|
|
61
|
+
image: e.backdropImage,
|
|
62
|
+
gradient: e.backdropGradient,
|
|
63
|
+
onClick: l(C)
|
|
64
|
+
}, null, 8, ["visible", "opacity", "blur", "color", "image", "gradient", "onClick"]),
|
|
65
|
+
u("div", A, [
|
|
66
|
+
u("div", {
|
|
67
|
+
ref: "dialogEl",
|
|
68
|
+
class: m(["cui-modal", { "cui-modal--visible": l(a) }]),
|
|
69
|
+
style: M({ maxWidth: B.value, borderRadius: p[e.rounded] }),
|
|
70
|
+
role: "dialog",
|
|
71
|
+
"aria-modal": "true",
|
|
72
|
+
"aria-labelledby": e.title ? h : void 0,
|
|
73
|
+
tabindex: "-1"
|
|
74
|
+
}, [
|
|
75
|
+
e.title ? (i(), c(S, { key: 0 }, [
|
|
76
|
+
d(T, {
|
|
77
|
+
title: e.title,
|
|
78
|
+
"no-close-button": e.noCloseButton,
|
|
79
|
+
onClose: l(k)
|
|
80
|
+
}, null, 8, ["title", "no-close-button", "onClose"]),
|
|
81
|
+
d(W, null, {
|
|
82
|
+
default: V(() => [
|
|
83
|
+
f(t.$slots, "default", {}, void 0, !0)
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
})
|
|
87
|
+
], 64)) : f(t.$slots, "default", { key: 1 }, void 0, !0)
|
|
88
|
+
], 14, D)
|
|
89
|
+
])
|
|
90
|
+
], 34)), [
|
|
91
|
+
[I, !e.hidden]
|
|
92
|
+
]) : R("", !0)
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
J as default
|
|
98
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as m, withDirectives as y, openBlock as o, createElementBlock as l, createElementVNode as S, unref as e, normalizeStyle as t, renderSlot as p, createCommentVNode as a, vShow as v } from "vue";
|
|
2
|
+
import { useScrollShadows as h, scrollShadowTopStyle as w, scrollShadowBottomStyle as g } from "../composables/useScrollShadows.js";
|
|
3
|
+
const x = { style: {
|
|
4
|
+
position: "relative",
|
|
5
|
+
display: "flex",
|
|
6
|
+
flexDirection: "column",
|
|
7
|
+
flex: "1 1 auto",
|
|
8
|
+
minHeight: "0",
|
|
9
|
+
overflow: "hidden"
|
|
10
|
+
} }, C = /* @__PURE__ */ m({
|
|
11
|
+
__name: "CuiModalBody",
|
|
12
|
+
props: {
|
|
13
|
+
noPadding: { type: Boolean, default: !1 },
|
|
14
|
+
hidden: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
setup(n) {
|
|
17
|
+
const { canScrollUp: d, canScrollDown: c, onScroll: r, onMount: s } = h();
|
|
18
|
+
return (u, i) => y((o(), l("div", x, [
|
|
19
|
+
S("div", {
|
|
20
|
+
ref: e(s),
|
|
21
|
+
style: t({
|
|
22
|
+
flex: "1 1 auto",
|
|
23
|
+
minHeight: "0",
|
|
24
|
+
overflowY: "auto",
|
|
25
|
+
padding: n.noPadding ? "0" : "calc(0.75rem * var(--cui-density-scale, 1)) calc(1.5rem * var(--cui-density-scale, 1))",
|
|
26
|
+
fontSize: "0.875rem",
|
|
27
|
+
lineHeight: "1.6",
|
|
28
|
+
color: "var(--cui-text-secondary)"
|
|
29
|
+
}),
|
|
30
|
+
onScroll: i[0] || (i[0] = //@ts-ignore
|
|
31
|
+
(...f) => e(r) && e(r)(...f))
|
|
32
|
+
}, [
|
|
33
|
+
p(u.$slots, "default")
|
|
34
|
+
], 36),
|
|
35
|
+
e(d) ? (o(), l("div", {
|
|
36
|
+
key: 0,
|
|
37
|
+
style: t(e(w))
|
|
38
|
+
}, null, 4)) : a("", !0),
|
|
39
|
+
e(c) ? (o(), l("div", {
|
|
40
|
+
key: 1,
|
|
41
|
+
style: t(e(g))
|
|
42
|
+
}, null, 4)) : a("", !0)
|
|
43
|
+
], 512)), [
|
|
44
|
+
[v, !n.hidden]
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
C as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as n, withDirectives as i, openBlock as l, createElementBlock as c, normalizeStyle as r, renderSlot as s, vShow as o } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ n({
|
|
3
|
+
__name: "CuiModalFooter",
|
|
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, d) => i((l(), c("div", {
|
|
16
|
+
style: r({
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
gap: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
20
|
+
padding: "calc(0.75rem * var(--cui-density-scale, 1)) calc(1.5rem * var(--cui-density-scale, 1)) calc(1.25rem * var(--cui-density-scale, 1))",
|
|
21
|
+
flexShrink: "0",
|
|
22
|
+
justifyContent: t[e.align],
|
|
23
|
+
background: "var(--cui-surface-base)",
|
|
24
|
+
position: "relative",
|
|
25
|
+
zIndex: "1"
|
|
26
|
+
})
|
|
27
|
+
}, [
|
|
28
|
+
s(a.$slots, "default")
|
|
29
|
+
], 4)), [
|
|
30
|
+
[o, !e.hidden]
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
f as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { defineComponent as u, withDirectives as m, openBlock as r, createElementBlock as o, createElementVNode as y, renderSlot as n, toDisplayString as g, createCommentVNode as s, unref as f, createVNode as p, vShow as v } from "vue";
|
|
2
|
+
import h from "./CuiIcon.vue.js";
|
|
3
|
+
import { useMessages as b } from "../composables/useMessages.js";
|
|
4
|
+
const k = { style: {
|
|
5
|
+
display: "flex",
|
|
6
|
+
alignItems: "flex-start",
|
|
7
|
+
gap: "calc(0.75rem * var(--cui-density-scale, 1))",
|
|
8
|
+
padding: "calc(1.25rem * var(--cui-density-scale, 1)) calc(1.5rem * var(--cui-density-scale, 1)) calc(0.25rem * var(--cui-density-scale, 1))",
|
|
9
|
+
flexShrink: "0",
|
|
10
|
+
background: "var(--cui-surface-base)",
|
|
11
|
+
position: "relative",
|
|
12
|
+
zIndex: "1"
|
|
13
|
+
} }, x = { style: { flex: "1", "min-width": "0" } }, C = {
|
|
14
|
+
key: 0,
|
|
15
|
+
style: {
|
|
16
|
+
fontSize: "1.125rem",
|
|
17
|
+
fontWeight: "600",
|
|
18
|
+
lineHeight: "1.4",
|
|
19
|
+
color: "var(--cui-text-emphasis)",
|
|
20
|
+
margin: "0"
|
|
21
|
+
}
|
|
22
|
+
}, B = {
|
|
23
|
+
key: 0,
|
|
24
|
+
style: { display: "flex", "align-items": "center", gap: "calc(0.5rem * var(--cui-density-scale, 1))", "flex-shrink": "0" }
|
|
25
|
+
}, S = ["aria-label"], z = /* @__PURE__ */ u({
|
|
26
|
+
__name: "CuiModalHeader",
|
|
27
|
+
props: {
|
|
28
|
+
title: {},
|
|
29
|
+
noCloseButton: { type: Boolean, default: !1 },
|
|
30
|
+
hidden: { type: Boolean, default: !1 }
|
|
31
|
+
},
|
|
32
|
+
emits: ["close"],
|
|
33
|
+
setup(i, { emit: l }) {
|
|
34
|
+
const c = l, d = b();
|
|
35
|
+
return (a, e) => m((r(), o("div", k, [
|
|
36
|
+
y("div", x, [
|
|
37
|
+
n(a.$slots, "default", {}, () => [
|
|
38
|
+
i.title ? (r(), o("h2", C, g(i.title), 1)) : s("", !0)
|
|
39
|
+
])
|
|
40
|
+
]),
|
|
41
|
+
a.$slots.actions ? (r(), o("div", B, [
|
|
42
|
+
n(a.$slots, "actions")
|
|
43
|
+
])) : s("", !0),
|
|
44
|
+
i.noCloseButton ? s("", !0) : (r(), o("button", {
|
|
45
|
+
key: 1,
|
|
46
|
+
type: "button",
|
|
47
|
+
style: {
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center",
|
|
51
|
+
width: "1.75rem",
|
|
52
|
+
height: "1.75rem",
|
|
53
|
+
border: "none",
|
|
54
|
+
background: "none",
|
|
55
|
+
cursor: "pointer",
|
|
56
|
+
color: "var(--cui-text-tertiary)",
|
|
57
|
+
padding: "0",
|
|
58
|
+
borderRadius: "0.375rem",
|
|
59
|
+
flexShrink: "0",
|
|
60
|
+
marginTop: "calc(-0.125rem * var(--cui-density-scale, 1))",
|
|
61
|
+
marginRight: "calc(-0.25rem * var(--cui-density-scale, 1))",
|
|
62
|
+
transition: "color 0.15s ease, background 0.15s ease"
|
|
63
|
+
},
|
|
64
|
+
"aria-label": f(d).close,
|
|
65
|
+
onClick: e[0] || (e[0] = (t) => c("close")),
|
|
66
|
+
onMouseenter: e[1] || (e[1] = (t) => {
|
|
67
|
+
t.target.style.color = "var(--cui-text-body)", t.target.style.background = "var(--cui-primary-bg)";
|
|
68
|
+
}),
|
|
69
|
+
onMouseleave: e[2] || (e[2] = (t) => {
|
|
70
|
+
t.target.style.color = "var(--cui-text-tertiary)", t.target.style.background = "none";
|
|
71
|
+
})
|
|
72
|
+
}, [
|
|
73
|
+
p(h, {
|
|
74
|
+
name: "x",
|
|
75
|
+
size: "1rem"
|
|
76
|
+
})
|
|
77
|
+
], 40, S))
|
|
78
|
+
], 512)), [
|
|
79
|
+
[v, !i.hidden]
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
export {
|
|
84
|
+
z as default
|
|
85
|
+
};
|