@itguy614/clean-ui 1.2.2 → 1.3.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/README.md +12 -0
- package/dist/clean-ui.css +1 -1
- package/dist/components/CuiAccordion.vue.js +2 -2
- package/dist/components/CuiAlert.vue.d.ts +3 -5
- package/dist/components/CuiAlert.vue.d.ts.map +1 -1
- package/dist/components/CuiAlert.vue.js +1 -1
- package/dist/components/CuiAlert.vue2.js +54 -50
- package/dist/components/CuiBadge.vue.js +3 -3
- package/dist/components/CuiBadge.vue2.js +23 -23
- package/dist/components/CuiBanner.vue.d.ts +15 -10
- package/dist/components/CuiBanner.vue.d.ts.map +1 -1
- package/dist/components/CuiBanner.vue.js +5 -80
- package/dist/components/CuiBanner.vue2.js +90 -2
- package/dist/components/CuiButton.vue.d.ts +9 -0
- package/dist/components/CuiButton.vue.d.ts.map +1 -1
- package/dist/components/CuiButton.vue.js +1 -1
- package/dist/components/CuiButton.vue2.js +77 -83
- package/dist/components/CuiButtonGroup.vue.d.ts +4 -2
- package/dist/components/CuiButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiButtonGroup.vue.js +1 -1
- package/dist/components/CuiButtonGroup.vue2.js +18 -9
- package/dist/components/CuiCard.vue.d.ts.map +1 -1
- package/dist/components/CuiCard.vue.js +5 -33
- package/dist/components/CuiCard.vue2.js +32 -2
- package/dist/components/CuiCardBody.vue.d.ts.map +1 -1
- package/dist/components/CuiCardBody.vue.js +5 -18
- package/dist/components/CuiCardBody.vue2.js +18 -2
- package/dist/components/CuiCardFooter.vue.d.ts.map +1 -1
- package/dist/components/CuiCardFooter.vue.js +5 -30
- package/dist/components/CuiCardFooter.vue2.js +25 -2
- package/dist/components/CuiCardHeader.vue.d.ts +5 -4
- package/dist/components/CuiCardHeader.vue.d.ts.map +1 -1
- package/dist/components/CuiCardHeader.vue.js +5 -49
- package/dist/components/CuiCardHeader.vue2.js +40 -2
- package/dist/components/CuiCardMedia.vue.d.ts.map +1 -1
- package/dist/components/CuiCardMedia.vue.js +3 -3
- package/dist/components/CuiCardMedia.vue2.js +6 -6
- package/dist/components/CuiCheckbox.vue.d.ts +2 -2
- package/dist/components/CuiCheckbox.vue.d.ts.map +1 -1
- package/dist/components/CuiCheckbox.vue.js +1 -1
- package/dist/components/CuiCheckbox.vue2.js +46 -34
- package/dist/components/CuiCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/CuiCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiCheckboxGroup.vue.js +2 -2
- package/dist/components/CuiCheckboxGroup.vue2.js +45 -35
- package/dist/components/CuiCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/CuiCodeBlock.vue.js +14 -11
- package/dist/components/CuiColorPicker.vue.d.ts +2 -2
- package/dist/components/CuiColorPicker.vue.d.ts.map +1 -1
- package/dist/components/CuiColorPicker.vue.js +117 -104
- package/dist/components/CuiCombobox.vue.d.ts +2 -2
- package/dist/components/CuiCombobox.vue.d.ts.map +1 -1
- package/dist/components/CuiCombobox.vue.js +5 -330
- package/dist/components/CuiCombobox.vue2.js +330 -2
- package/dist/components/CuiConfirmDialog.vue.d.ts +5 -4
- package/dist/components/CuiConfirmDialog.vue.d.ts.map +1 -1
- package/dist/components/CuiConfirmDialog.vue.js +84 -73
- package/dist/components/CuiContextMenu.vue.d.ts +40 -1
- package/dist/components/CuiContextMenu.vue.d.ts.map +1 -1
- package/dist/components/CuiContextMenu.vue.js +1 -1
- package/dist/components/CuiContextMenu.vue2.js +149 -91
- package/dist/components/CuiCopyButton.vue.d.ts.map +1 -1
- package/dist/components/CuiCopyButton.vue.js +5 -61
- package/dist/components/CuiCopyButton.vue2.js +68 -2
- package/dist/components/CuiDataGridCardView.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridCardView.vue.js +10 -9
- package/dist/components/CuiDataGridColumnManager.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridColumnManager.vue.js +12 -11
- package/dist/components/CuiDataGridPagination.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridPagination.vue.js +9 -8
- package/dist/components/CuiDataGridSearch.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridSearch.vue.js +12 -9
- package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridTable.vue.js +213 -190
- package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridViewManager.vue.js +21 -20
- package/dist/components/CuiDatePicker.vue.d.ts +2 -2
- package/dist/components/CuiDatePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiDatePicker.vue.js +257 -173
- package/dist/components/CuiDateRangePicker.vue.d.ts +2 -2
- package/dist/components/CuiDateRangePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiDateRangePicker.vue.js +262 -179
- package/dist/components/CuiDivider.vue.d.ts +1 -3
- package/dist/components/CuiDivider.vue.d.ts.map +1 -1
- package/dist/components/CuiDivider.vue.js +47 -59
- package/dist/components/CuiDropdownMenu.vue.js +2 -2
- package/dist/components/CuiDropdownRadioGroup.vue.d.ts +4 -1
- package/dist/components/CuiDropdownRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiDropdownRadioGroup.vue.js +27 -14
- package/dist/components/CuiDropdownSub.vue.js +2 -2
- package/dist/components/CuiEmptyState.vue.d.ts +5 -4
- package/dist/components/CuiEmptyState.vue.d.ts.map +1 -1
- package/dist/components/CuiEmptyState.vue.js +1 -1
- package/dist/components/CuiEmptyState.vue2.js +30 -24
- package/dist/components/CuiFieldset.vue.d.ts.map +1 -1
- package/dist/components/CuiFieldset.vue.js +1 -1
- package/dist/components/CuiFieldset.vue2.js +21 -21
- package/dist/components/CuiFileUpload.vue.d.ts +2 -2
- package/dist/components/CuiFileUpload.vue.d.ts.map +1 -1
- package/dist/components/CuiFileUpload.vue.js +70 -57
- package/dist/components/CuiFormField.vue.d.ts.map +1 -1
- package/dist/components/CuiFormField.vue.js +2 -2
- package/dist/components/CuiFormField.vue2.js +48 -42
- package/dist/components/CuiInput.vue.d.ts +2 -2
- package/dist/components/CuiInput.vue.d.ts.map +1 -1
- package/dist/components/CuiInput.vue.js +1 -1
- package/dist/components/CuiInput.vue2.js +97 -85
- package/dist/components/CuiInputStepper.vue.d.ts +2 -2
- package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
- package/dist/components/CuiInputStepper.vue.js +5 -187
- package/dist/components/CuiInputStepper.vue2.js +237 -2
- package/dist/components/CuiKbd.vue.d.ts.map +1 -1
- package/dist/components/CuiKbd.vue.js +6 -5
- package/dist/components/CuiMaskedInput.vue.d.ts +9 -3
- package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
- package/dist/components/CuiMaskedInput.vue.js +132 -117
- package/dist/components/CuiModal.vue.d.ts +10 -2
- package/dist/components/CuiModal.vue.d.ts.map +1 -1
- package/dist/components/CuiModal.vue.js +2 -2
- package/dist/components/CuiModal.vue2.js +48 -44
- package/dist/components/CuiModalBody.vue.d.ts.map +1 -1
- package/dist/components/CuiModalBody.vue.js +16 -13
- package/dist/components/CuiModalFooter.vue.d.ts.map +1 -1
- package/dist/components/CuiModalFooter.vue.js +3 -2
- package/dist/components/CuiModalHeader.vue.d.ts +13 -4
- package/dist/components/CuiModalHeader.vue.d.ts.map +1 -1
- package/dist/components/CuiModalHeader.vue.js +54 -42
- package/dist/components/CuiPagination.vue.d.ts.map +1 -1
- package/dist/components/CuiPagination.vue.js +1 -1
- package/dist/components/CuiPagination.vue2.js +28 -25
- package/dist/components/CuiPopover.vue.d.ts.map +1 -1
- package/dist/components/CuiPopover.vue.js +80 -72
- package/dist/components/CuiRadio.vue.d.ts +2 -4
- package/dist/components/CuiRadio.vue.d.ts.map +1 -1
- package/dist/components/CuiRadio.vue.js +2 -2
- package/dist/components/CuiRadio.vue2.js +88 -74
- package/dist/components/CuiRadioGroup.vue.d.ts +2 -2
- package/dist/components/CuiRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiRadioGroup.vue.js +3 -3
- package/dist/components/CuiRadioGroup.vue2.js +47 -37
- package/dist/components/CuiRating.vue.d.ts.map +1 -1
- package/dist/components/CuiRating.vue.js +15 -14
- package/dist/components/CuiResizablePanels.vue.d.ts.map +1 -1
- package/dist/components/CuiResizablePanels.vue.js +10 -9
- package/dist/components/CuiSelect.vue.d.ts +2 -2
- package/dist/components/CuiSelect.vue.d.ts.map +1 -1
- package/dist/components/CuiSelect.vue.js +2 -2
- package/dist/components/CuiSelect.vue2.js +161 -151
- package/dist/components/CuiSkeleton.vue.js +2 -2
- package/dist/components/CuiSkeleton.vue2.js +10 -10
- package/dist/components/CuiSlideover.vue.d.ts +2 -2
- package/dist/components/CuiSlideover.vue.d.ts.map +1 -1
- package/dist/components/CuiSlideover.vue.js +34 -30
- package/dist/components/CuiSlider.vue.d.ts +2 -2
- package/dist/components/CuiSlider.vue.d.ts.map +1 -1
- package/dist/components/CuiSlider.vue.js +5 -154
- package/dist/components/CuiSlider.vue2.js +171 -2
- package/dist/components/CuiSpinner.vue.d.ts.map +1 -1
- package/dist/components/CuiSpinner.vue.js +5 -4
- package/dist/components/CuiTable.vue.d.ts.map +1 -1
- package/dist/components/CuiTable.vue.js +4 -1
- package/dist/components/CuiTableBody.vue.d.ts.map +1 -1
- package/dist/components/CuiTableBody.vue.js +6 -6
- package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
- package/dist/components/CuiTableCell.vue.js +11 -10
- package/dist/components/CuiTableFoot.vue.d.ts.map +1 -1
- package/dist/components/CuiTableFoot.vue.js +7 -7
- package/dist/components/CuiTableHead.vue.d.ts.map +1 -1
- package/dist/components/CuiTableHead.vue.js +7 -7
- package/dist/components/CuiTabs.vue.d.ts.map +1 -1
- package/dist/components/CuiTabs.vue.js +2 -2
- package/dist/components/CuiTabs.vue2.js +81 -76
- package/dist/components/CuiTagInput.vue.d.ts +2 -2
- package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
- package/dist/components/CuiTagInput.vue.js +5 -294
- package/dist/components/CuiTagInput.vue2.js +276 -2
- package/dist/components/CuiTextarea.vue.d.ts +2 -2
- package/dist/components/CuiTextarea.vue.d.ts.map +1 -1
- package/dist/components/CuiTextarea.vue.js +4 -4
- package/dist/components/CuiTextarea.vue2.js +73 -59
- package/dist/components/CuiTimePicker.vue.d.ts +2 -2
- package/dist/components/CuiTimePicker.vue.d.ts.map +1 -1
- package/dist/components/CuiTimePicker.vue.js +172 -97
- package/dist/components/CuiTimeline.vue.d.ts.map +1 -1
- package/dist/components/CuiTimeline.vue.js +6 -5
- package/dist/components/CuiTimelineItem.vue.d.ts.map +1 -1
- package/dist/components/CuiTimelineItem.vue.js +11 -10
- package/dist/components/CuiToast.vue.d.ts +8 -10
- package/dist/components/CuiToast.vue.d.ts.map +1 -1
- package/dist/components/CuiToast.vue.js +2 -2
- package/dist/components/CuiToast.vue2.js +69 -67
- package/dist/components/CuiToggle.vue.d.ts +2 -2
- package/dist/components/CuiToggle.vue.d.ts.map +1 -1
- package/dist/components/CuiToggle.vue.js +2 -2
- package/dist/components/CuiToggle.vue2.js +71 -59
- package/dist/components/CuiToggleGroup.vue.d.ts +2 -2
- package/dist/components/CuiToggleGroup.vue.d.ts.map +1 -1
- package/dist/components/CuiToggleGroup.vue.js +2 -2
- package/dist/components/CuiToggleGroup.vue2.js +45 -35
- package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
- package/dist/components/CuiTooltip.vue.js +2 -2
- package/dist/components/CuiTooltip.vue2.js +49 -45
- package/dist/components/CuiTransferList.vue.d.ts.map +1 -1
- package/dist/components/CuiTransferList.vue.js +31 -30
- package/dist/components/CuiTreeNode.vue.d.ts +9 -2
- package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeNode.vue.js +5 -179
- package/dist/components/CuiTreeNode.vue2.js +198 -2
- package/dist/components/CuiTreeView.vue.d.ts +33 -5
- package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeView.vue.js +187 -44
- package/dist/composables/useCalendarKeyboard.d.ts +48 -0
- package/dist/composables/useCalendarKeyboard.d.ts.map +1 -0
- package/dist/composables/useCalendarKeyboard.js +91 -0
- package/dist/composables/useFieldDescribedBy.d.ts +30 -0
- package/dist/composables/useFieldDescribedBy.d.ts.map +1 -0
- package/dist/composables/useFieldDescribedBy.js +11 -0
- package/dist/composables/useMessages.d.ts.map +1 -1
- package/dist/composables/useMessages.js +6 -6
- package/dist/composables/usePopover.d.ts.map +1 -1
- package/dist/composables/usePopover.js +10 -0
- package/dist/composables/useScrollShadows.d.ts +3 -0
- package/dist/composables/useScrollShadows.d.ts.map +1 -1
- package/dist/composables/useScrollShadows.js +15 -12
- package/dist/icons/builtin.d.ts.map +1 -1
- package/dist/icons/builtin.js +38 -37
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +185 -182
- package/dist/messages.d.ts +39 -4
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +8 -7
- package/dist/types/common.d.ts +90 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/utils/colorIconMap.d.ts +47 -3
- package/dist/utils/colorIconMap.d.ts.map +1 -1
- package/dist/utils/colorIconMap.js +20 -5
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +46 -40
- package/dist/utils/sizing.d.ts +26 -1
- package/dist/utils/sizing.d.ts.map +1 -1
- package/dist/utils/sizing.js +22 -21
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as t, provide as n, withDirectives as
|
|
2
|
-
import { TableSectionContextKey as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as t, provide as n, withDirectives as a, openBlock as i, createElementBlock as l, renderSlot as r, vShow as s } from "vue";
|
|
2
|
+
import { TableSectionContextKey as c } from "./table-context.js";
|
|
3
|
+
const d = { class: "cui-table-foot" }, u = /* @__PURE__ */ t({
|
|
4
4
|
__name: "CuiTableFoot",
|
|
5
5
|
props: {
|
|
6
6
|
hidden: { type: Boolean, default: !1 }
|
|
7
7
|
},
|
|
8
8
|
setup(e) {
|
|
9
|
-
return n(
|
|
10
|
-
|
|
9
|
+
return n(c, { isHead: !1 }), (o, f) => a((i(), l("tfoot", d, [
|
|
10
|
+
r(o.$slots, "default")
|
|
11
11
|
], 512)), [
|
|
12
|
-
[
|
|
12
|
+
[s, !e.hidden]
|
|
13
13
|
]);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
u as default
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTableHead.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableHead.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CACvD;
|
|
1
|
+
{"version":3,"file":"CuiTableHead.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableHead.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CACvD;AAkCD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe;;6EAOnB,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"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as o, provide as
|
|
2
|
-
import { TableSectionContextKey as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as o, provide as a, withDirectives as n, openBlock as r, createElementBlock as d, renderSlot as i, vShow as l } from "vue";
|
|
2
|
+
import { TableSectionContextKey as s } from "./table-context.js";
|
|
3
|
+
const c = { class: "cui-table-head" }, h = /* @__PURE__ */ o({
|
|
4
4
|
__name: "CuiTableHead",
|
|
5
5
|
props: {
|
|
6
6
|
hidden: { type: Boolean, default: !1 }
|
|
7
7
|
},
|
|
8
8
|
setup(e) {
|
|
9
|
-
return
|
|
10
|
-
|
|
9
|
+
return a(s, { isHead: !0 }), (t, p) => n((r(), d("thead", c, [
|
|
10
|
+
i(t.$slots, "default")
|
|
11
11
|
], 512)), [
|
|
12
|
-
[
|
|
12
|
+
[l, !e.hidden]
|
|
13
13
|
]);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
h as default
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"AA8gBA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;IACjE,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAyXD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAgC/C,QAAA,MAAM,eAAe;;;;;;;;;aAlaT,UAAU;iBAEN,cAAc;gBAIf,aAAa;eAFd,OAAO;6EAsanB,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CuiTabs.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3da0079d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { TabsContextKey as
|
|
4
|
-
import { useMessages as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as M, ref as b, watch as _, provide as N, toRef as m, onMounted as L, nextTick as z, onBeforeUnmount as O, computed as U, withDirectives as W, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as A, renderList as q, normalizeStyle as F, createBlock as j, resolveDynamicComponent as G, createTextVNode as J, toDisplayString as P, withModifiers as Q, unref as X, createVNode as Y, createCommentVNode as Z, renderSlot as ee, vShow as te } from "vue";
|
|
2
|
+
import ae from "./CuiIcon.vue.js";
|
|
3
|
+
import { TabsContextKey as oe } from "./tabs-context.js";
|
|
4
|
+
import { useMessages as le } from "../composables/useMessages.js";
|
|
5
|
+
const ne = { class: "cui-tabs__bar-outer" }, ie = ["aria-orientation", "data-overflow"], re = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], se = { class: "cui-tabs__tab-content" }, ue = ["aria-label", "onClick"], ce = { class: "cui-tabs__panels" }, me = /* @__PURE__ */ M({
|
|
6
6
|
__name: "CuiTabs",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: {},
|
|
@@ -14,29 +14,29 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
|
|
|
14
14
|
color: { default: "primary" }
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue", "close"],
|
|
17
|
-
setup(
|
|
18
|
-
const n =
|
|
17
|
+
setup(i, { emit: D }) {
|
|
18
|
+
const n = i, g = D, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
|
|
19
19
|
_(
|
|
20
20
|
() => n.modelValue,
|
|
21
21
|
(e) => {
|
|
22
22
|
e !== void 0 && e !== o.value && (p.value = o.value, o.value = e);
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
function
|
|
25
|
+
function B(e) {
|
|
26
26
|
const a = l.value.findIndex((t) => t.value === e.value);
|
|
27
|
-
a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value,
|
|
27
|
+
a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, g("update:modelValue", e.value));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function E(e) {
|
|
30
30
|
l.value = l.value.filter((a) => a.value !== e);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function x(e) {
|
|
33
33
|
const a = l.value.find((t) => t.value === e);
|
|
34
|
-
a != null && a.disabled || (p.value = o.value, o.value = e,
|
|
34
|
+
a != null && a.disabled || (p.value = o.value, o.value = e, g("update:modelValue", e));
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
36
|
+
function C(e) {
|
|
37
|
+
g("close", e);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
N(oe, {
|
|
40
40
|
activeTab: o,
|
|
41
41
|
variant: m(n, "variant"),
|
|
42
42
|
orientation: m(n, "orientation"),
|
|
@@ -44,119 +44,124 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
|
|
|
44
44
|
keepAlive: m(n, "keepAlive"),
|
|
45
45
|
transition: m(n, "transition"),
|
|
46
46
|
previousTab: p,
|
|
47
|
-
register:
|
|
48
|
-
unregister:
|
|
49
|
-
activate:
|
|
50
|
-
close:
|
|
47
|
+
register: B,
|
|
48
|
+
unregister: E,
|
|
49
|
+
activate: x,
|
|
50
|
+
close: C
|
|
51
51
|
});
|
|
52
|
-
function
|
|
53
|
-
const a = l.value.filter((
|
|
52
|
+
function R(e) {
|
|
53
|
+
const a = l.value.filter((u) => !u.disabled), t = a.findIndex((u) => u.value === o.value);
|
|
54
54
|
if (t < 0) return;
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
e.key === y ? (e.preventDefault(),
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
55
|
+
const s = n.orientation === "horizontal", y = s ? "ArrowRight" : "ArrowDown", V = s ? "ArrowLeft" : "ArrowUp";
|
|
56
|
+
let r = -1;
|
|
57
|
+
if (e.key === y ? (e.preventDefault(), r = t < a.length - 1 ? t + 1 : 0) : e.key === V ? (e.preventDefault(), r = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), r = 0) : e.key === "End" && (e.preventDefault(), r = a.length - 1), r >= 0) {
|
|
58
|
+
const u = a[r].value, K = u !== o.value;
|
|
59
|
+
x(u), z(() => {
|
|
60
|
+
var $;
|
|
61
|
+
($ = S(u)) == null || $.focus({ preventScroll: !0 }), K || I();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
+
function S(e) {
|
|
66
|
+
var t;
|
|
67
|
+
const a = e.replace(/["\\]/g, "\\$&");
|
|
68
|
+
return ((t = f.value) == null ? void 0 : t.querySelector(`[data-cui-tab-value="${a}"]`)) ?? null;
|
|
65
69
|
}
|
|
66
|
-
const
|
|
67
|
-
function
|
|
70
|
+
const w = b("none");
|
|
71
|
+
function c() {
|
|
68
72
|
const e = f.value;
|
|
69
73
|
if (!e) return;
|
|
70
|
-
const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight,
|
|
71
|
-
if (
|
|
72
|
-
|
|
74
|
+
const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, s = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
|
|
75
|
+
if (s - t <= 1) {
|
|
76
|
+
w.value = "none";
|
|
73
77
|
return;
|
|
74
78
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
79
|
+
const V = y <= 1, r = y >= s - t - 1;
|
|
80
|
+
w.value = V ? "end" : r ? "start" : "both";
|
|
77
81
|
}
|
|
78
|
-
function
|
|
82
|
+
function I() {
|
|
79
83
|
var e, a;
|
|
80
|
-
(a = (e =
|
|
84
|
+
(a = (e = S(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
|
|
81
85
|
}
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}), typeof ResizeObserver < "u" && f.value && (
|
|
87
|
-
}),
|
|
88
|
-
|
|
86
|
+
let d;
|
|
87
|
+
L(() => {
|
|
88
|
+
z(() => {
|
|
89
|
+
I(), c();
|
|
90
|
+
}), typeof ResizeObserver < "u" && f.value && (d = new ResizeObserver(c), d.observe(f.value));
|
|
91
|
+
}), O(() => {
|
|
92
|
+
d == null || d.disconnect(), d = void 0;
|
|
89
93
|
}), _(o, () => {
|
|
90
|
-
|
|
91
|
-
}, { flush: "post" }), _(() => l.value.length,
|
|
94
|
+
I(), c();
|
|
95
|
+
}, { flush: "post" }), _(() => l.value.length, c, { flush: "post" }), _(() => n.orientation, c, { flush: "post" }), U(() => {
|
|
92
96
|
const e = l.value.findIndex((t) => t.value === p.value);
|
|
93
97
|
return l.value.findIndex((t) => t.value === o.value) >= e ? "left" : "right";
|
|
94
98
|
});
|
|
95
|
-
const
|
|
96
|
-
return (e, a) =>
|
|
99
|
+
const H = le();
|
|
100
|
+
return (e, a) => W((v(), h("div", {
|
|
97
101
|
class: T(["cui-tabs", [
|
|
98
|
-
`cui-tabs--${
|
|
99
|
-
`cui-tabs--${
|
|
102
|
+
`cui-tabs--${i.variant}`,
|
|
103
|
+
`cui-tabs--${i.orientation}`
|
|
100
104
|
]])
|
|
101
105
|
}, [
|
|
102
|
-
k("div",
|
|
106
|
+
k("div", ne, [
|
|
103
107
|
k("div", {
|
|
104
108
|
ref_key: "barRef",
|
|
105
109
|
ref: f,
|
|
106
110
|
class: "cui-tabs__bar",
|
|
107
111
|
role: "tablist",
|
|
108
|
-
"aria-orientation":
|
|
109
|
-
"data-overflow":
|
|
110
|
-
onKeydown:
|
|
111
|
-
onScroll:
|
|
112
|
+
"aria-orientation": i.orientation,
|
|
113
|
+
"data-overflow": w.value,
|
|
114
|
+
onKeydown: R,
|
|
115
|
+
onScroll: c
|
|
112
116
|
}, [
|
|
113
|
-
(v(!0), h(
|
|
117
|
+
(v(!0), h(A, null, q(l.value, (t) => (v(), h("button", {
|
|
114
118
|
key: t.value,
|
|
119
|
+
type: "button",
|
|
115
120
|
"data-cui-tab-value": t.value,
|
|
116
121
|
class: T(["cui-tabs__tab", {
|
|
117
122
|
"cui-tabs__tab--active": o.value === t.value,
|
|
118
123
|
"cui-tabs__tab--disabled": t.disabled
|
|
119
124
|
}]),
|
|
120
|
-
style:
|
|
121
|
-
"--_tab-color": `var(--cui-${
|
|
122
|
-
"--_tab-hover": `var(--cui-${
|
|
123
|
-
"--_tab-bg": `var(--cui-${
|
|
125
|
+
style: F({
|
|
126
|
+
"--_tab-color": `var(--cui-${i.color})`,
|
|
127
|
+
"--_tab-hover": `var(--cui-${i.color}-hover)`,
|
|
128
|
+
"--_tab-bg": `var(--cui-${i.color}-bg)`
|
|
124
129
|
}),
|
|
125
130
|
role: "tab",
|
|
126
131
|
"aria-selected": o.value === t.value,
|
|
127
132
|
"aria-disabled": t.disabled || void 0,
|
|
128
133
|
tabindex: o.value === t.value ? 0 : -1,
|
|
129
|
-
onClick: (
|
|
134
|
+
onClick: (s) => x(t.value)
|
|
130
135
|
}, [
|
|
131
|
-
k("span",
|
|
132
|
-
t.labelSlot ? (v(),
|
|
133
|
-
|
|
136
|
+
k("span", se, [
|
|
137
|
+
t.labelSlot ? (v(), j(G(t.labelSlot), { key: 0 })) : (v(), h(A, { key: 1 }, [
|
|
138
|
+
J(P(t.label), 1)
|
|
134
139
|
], 64))
|
|
135
140
|
]),
|
|
136
141
|
t.closeable ? (v(), h("button", {
|
|
137
142
|
key: 0,
|
|
138
143
|
type: "button",
|
|
139
144
|
class: "cui-tabs__tab-close",
|
|
140
|
-
"aria-label":
|
|
145
|
+
"aria-label": X(H).tabs.closeTab,
|
|
141
146
|
tabindex: "-1",
|
|
142
|
-
onClick:
|
|
147
|
+
onClick: Q((s) => C(t.value), ["stop"])
|
|
143
148
|
}, [
|
|
144
|
-
|
|
149
|
+
Y(ae, {
|
|
145
150
|
name: "x",
|
|
146
151
|
size: "0.75rem"
|
|
147
152
|
})
|
|
148
|
-
], 8,
|
|
149
|
-
], 14,
|
|
150
|
-
], 40,
|
|
153
|
+
], 8, ue)) : Z("", !0)
|
|
154
|
+
], 14, re))), 128))
|
|
155
|
+
], 40, ie)
|
|
151
156
|
]),
|
|
152
|
-
k("div",
|
|
153
|
-
|
|
157
|
+
k("div", ce, [
|
|
158
|
+
ee(e.$slots, "default", {}, void 0, !0)
|
|
154
159
|
])
|
|
155
160
|
], 2)), [
|
|
156
|
-
[
|
|
161
|
+
[te, !i.hidden]
|
|
157
162
|
]);
|
|
158
163
|
}
|
|
159
164
|
});
|
|
160
165
|
export {
|
|
161
|
-
|
|
166
|
+
me as default
|
|
162
167
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, CuiRounded } from "../types/common";
|
|
1
|
+
import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, CuiRounded, NativeControlProps } from "../types/common";
|
|
2
2
|
export interface TagOption {
|
|
3
3
|
value: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
color?: CuiColor;
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}
|
|
8
|
-
export interface CuiTagInputProps extends HideableProps, ColorableProps, SizeableProps, DisableableProps {
|
|
8
|
+
export interface CuiTagInputProps extends NativeControlProps, HideableProps, ColorableProps, SizeableProps, DisableableProps {
|
|
9
9
|
/** Selected tags */
|
|
10
10
|
modelValue?: string[];
|
|
11
11
|
/** Predefined tag suggestions */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTagInput.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTagInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTagInput.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTagInput.vue"],"names":[],"mappings":"AAyhBA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAOzJ,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IAC1H,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iCAAiC;IACjC,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC;IAC1B,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC3D,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAmQD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAGjC;AAED,iBAAS,IAAI,SAEZ;AAkOD,QAAA,IAAI,QAAQ;;CAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAmDnD,QAAA,MAAM,eAAe;;;;;;;;;WA5iBX,OAAO;YAQN,OAAO;;;aAEN,UAAU;;iBAdN,MAAM;gBAdP,MAAM,EAAE;cAQV,MAAM;cAEN,MAAM;iBARH,SAAS,EAAE;iBAIX,OAAO;aAMX,MAAM;uBAUI,MAAM;gBAEb,MAAM;6EA+iBnB,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"}
|
|
@@ -1,296 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import pe from "./CuiSpinner.vue.js";
|
|
6
|
-
/* empty css */
|
|
7
|
-
const ye = {
|
|
8
|
-
key: 0,
|
|
9
|
-
style: { display: "block", marginBottom: "calc(0.25rem * var(--cui-density-scale, 1))", fontSize: "0.875rem", fontWeight: "500", color: "var(--cui-text-secondary)" }
|
|
10
|
-
}, be = ["value", "placeholder", "disabled"], he = {
|
|
11
|
-
key: 1,
|
|
12
|
-
style: { fontSize: "0.75rem", color: "var(--cui-error)", marginTop: "calc(0.25rem * var(--cui-density-scale, 1))" }
|
|
13
|
-
}, xe = {
|
|
14
|
-
key: 0,
|
|
15
|
-
style: { padding: "calc(0.75rem * var(--cui-density-scale, 1))", textAlign: "center" }
|
|
16
|
-
}, we = ["data-index", "onClick", "onMouseenter"], Me = /* @__PURE__ */ le({
|
|
17
|
-
__name: "CuiTagInput",
|
|
18
|
-
props: {
|
|
19
|
-
modelValue: { default: () => [] },
|
|
20
|
-
suggestions: { default: () => [] },
|
|
21
|
-
fetchSuggestions: {},
|
|
22
|
-
allowCreate: { type: Boolean, default: !0 },
|
|
23
|
-
debounce: { default: 300 },
|
|
24
|
-
minChars: { default: 0 },
|
|
25
|
-
maxTags: { default: 0 },
|
|
26
|
-
placeholder: { default: "Add tag..." },
|
|
27
|
-
label: {},
|
|
28
|
-
error: { type: Boolean, default: !1 },
|
|
29
|
-
errorMessage: {},
|
|
30
|
-
noSuggestionsText: { default: "No suggestions" },
|
|
31
|
-
createText: { default: "Create" },
|
|
32
|
-
hidden: { type: Boolean, default: !1 },
|
|
33
|
-
rounded: { default: "md" },
|
|
34
|
-
color: { default: "primary" },
|
|
35
|
-
size: { default: "md" },
|
|
36
|
-
disabled: { type: Boolean, default: !1 }
|
|
37
|
-
},
|
|
38
|
-
emits: ["update:modelValue"],
|
|
39
|
-
setup(r, { expose: K, emit: Y }) {
|
|
40
|
-
const l = r, Z = {
|
|
41
|
-
none: "0",
|
|
42
|
-
sm: "0.25rem",
|
|
43
|
-
md: "var(--cui-button-radius, 0.375rem)",
|
|
44
|
-
lg: "0.5rem",
|
|
45
|
-
full: "9999px"
|
|
46
|
-
}, B = Y, o = v(""), c = v(!1), u = v(-1), V = v(!1), m = v([]), f = v(null), E = v(null), g = v(null), I = v({});
|
|
47
|
-
let S = null;
|
|
48
|
-
const z = h(() => new Set(l.modelValue)), C = h(() => l.maxTags > 0 && l.modelValue.length >= l.maxTags);
|
|
49
|
-
function j(e) {
|
|
50
|
-
const a = [...l.suggestions, ...m.value].find((t) => t.value === e);
|
|
51
|
-
return (a == null ? void 0 : a.label) ?? e;
|
|
52
|
-
}
|
|
53
|
-
function G(e) {
|
|
54
|
-
const a = [...l.suggestions, ...m.value].find((t) => t.value === e);
|
|
55
|
-
return (a == null ? void 0 : a.color) ?? l.color;
|
|
56
|
-
}
|
|
57
|
-
const i = h(() => {
|
|
58
|
-
const a = (l.fetchSuggestions ? m.value : l.suggestions).filter((n) => !z.value.has(n.value));
|
|
59
|
-
if (!o.value || l.fetchSuggestions) return a;
|
|
60
|
-
const t = o.value.toLowerCase();
|
|
61
|
-
return a.filter(
|
|
62
|
-
(n) => n.value.toLowerCase().includes(t) || n.label && n.label.toLowerCase().includes(t)
|
|
63
|
-
);
|
|
64
|
-
}), p = h(() => {
|
|
65
|
-
if (!l.allowCreate || !o.value.trim() || C.value) return !1;
|
|
66
|
-
const e = o.value.trim().toLowerCase();
|
|
67
|
-
return z.value.has(e) || z.value.has(o.value.trim()) ? !1 : ![...l.suggestions, ...m.value].map((t) => t.value.toLowerCase()).includes(e);
|
|
68
|
-
}), D = h(() => V.value), J = ["sm", "md", "lg"], Q = {
|
|
69
|
-
sm: { fontSize: "0.8125rem", padding: "calc(0.25rem * var(--cui-density-scale, 1)) calc(0.5rem * var(--cui-density-scale, 1))", tagSize: "sm", inputHeight: "2rem" },
|
|
70
|
-
md: { fontSize: "0.875rem", padding: "calc(0.3125rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))", tagSize: "sm", inputHeight: "2.375rem" },
|
|
71
|
-
lg: { fontSize: "0.9375rem", padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))", tagSize: "md", inputHeight: "2.75rem" }
|
|
72
|
-
}, y = h(() => Q[fe(l.size, J)]);
|
|
73
|
-
function b() {
|
|
74
|
-
if (!g.value) return;
|
|
75
|
-
const e = g.value.getBoundingClientRect(), a = window.innerHeight, t = a - e.bottom, n = t < 200 && e.top > t, M = Math.min(240, Math.max(t, e.top) - 16), R = {
|
|
76
|
-
position: "fixed",
|
|
77
|
-
zIndex: "9990",
|
|
78
|
-
left: `${e.left}px`,
|
|
79
|
-
width: `${e.width}px`,
|
|
80
|
-
maxHeight: `${M}px`,
|
|
81
|
-
overflowY: "auto",
|
|
82
|
-
background: "var(--cui-surface-base)",
|
|
83
|
-
border: "1px solid var(--cui-border)",
|
|
84
|
-
borderRadius: "0.5rem",
|
|
85
|
-
boxShadow: "0 8px 24px -4px rgba(0,0,0,0.12), 0 2px 8px -2px rgba(0,0,0,0.08)",
|
|
86
|
-
padding: "calc(0.25rem * var(--cui-density-scale, 1))"
|
|
87
|
-
};
|
|
88
|
-
n ? R.bottom = `${a - e.top + 4}px` : R.top = `${e.bottom + 4}px`, I.value = R;
|
|
89
|
-
}
|
|
90
|
-
function X(e) {
|
|
91
|
-
if (o.value = e.target.value, u.value = -1, c.value || (c.value = !0, b()), l.fetchSuggestions) {
|
|
92
|
-
if (o.value.length < l.minChars) {
|
|
93
|
-
m.value = [];
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
S && clearTimeout(S), S = setTimeout(async () => {
|
|
97
|
-
V.value = !0;
|
|
98
|
-
try {
|
|
99
|
-
m.value = await l.fetchSuggestions(o.value);
|
|
100
|
-
} finally {
|
|
101
|
-
V.value = !1;
|
|
102
|
-
}
|
|
103
|
-
}, l.debounce);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function H(e) {
|
|
107
|
-
if (l.disabled || C.value) return;
|
|
108
|
-
const a = e.trim();
|
|
109
|
-
!a || z.value.has(a) || (B("update:modelValue", [...l.modelValue, a]), o.value = "", u.value = -1, L(() => {
|
|
110
|
-
var t;
|
|
111
|
-
return (t = f.value) == null ? void 0 : t.focus();
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
function A(e) {
|
|
115
|
-
H(e.value);
|
|
116
|
-
}
|
|
117
|
-
function T() {
|
|
118
|
-
p.value && H(o.value.trim());
|
|
119
|
-
}
|
|
120
|
-
function N(e) {
|
|
121
|
-
l.disabled || (B("update:modelValue", l.modelValue.filter((a) => a !== e)), L(() => {
|
|
122
|
-
var a;
|
|
123
|
-
return (a = f.value) == null ? void 0 : a.focus();
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
|
-
function _(e) {
|
|
127
|
-
const a = i.value.length + (p.value ? 1 : 0);
|
|
128
|
-
if (e.key === "ArrowDown") {
|
|
129
|
-
if (e.preventDefault(), !c.value) {
|
|
130
|
-
c.value = !0, b();
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
u.value = Math.min(u.value + 1, a - 1);
|
|
134
|
-
} else e.key === "ArrowUp" ? (e.preventDefault(), u.value = Math.max(u.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), u.value >= 0 && u.value < i.value.length ? A(i.value[u.value]) : (p.value && (u.value === i.value.length || u.value === -1) || p.value && o.value.trim()) && T()) : e.key === "," || e.key === "Tab" ? o.value.trim() && l.allowCreate && (e.preventDefault(), T()) : e.key === "Escape" ? c.value = !1 : e.key === "Backspace" && !o.value && l.modelValue.length > 0 && N(l.modelValue[l.modelValue.length - 1]);
|
|
135
|
-
}
|
|
136
|
-
function W(e) {
|
|
137
|
-
var t, n;
|
|
138
|
-
const a = e.target;
|
|
139
|
-
(t = g.value) != null && t.contains(a) || (n = E.value) != null && n.contains(a) || (c.value = !1);
|
|
140
|
-
}
|
|
141
|
-
function ee() {
|
|
142
|
-
!l.disabled && !C.value && (c.value = !0, b());
|
|
143
|
-
}
|
|
144
|
-
ne(() => {
|
|
145
|
-
document.addEventListener("mousedown", W), window.addEventListener("scroll", () => {
|
|
146
|
-
c.value && b();
|
|
147
|
-
}, !0), window.addEventListener("resize", () => {
|
|
148
|
-
c.value && b();
|
|
149
|
-
});
|
|
150
|
-
}), re(() => {
|
|
151
|
-
document.removeEventListener("mousedown", W), S && clearTimeout(S);
|
|
152
|
-
}), oe(c, (e) => {
|
|
153
|
-
e || (o.value = ""), e && L(b);
|
|
154
|
-
});
|
|
155
|
-
function ae(e) {
|
|
156
|
-
var a;
|
|
157
|
-
f.value ? f.value.focus(e) : (a = g.value) == null || a.focus(e);
|
|
158
|
-
}
|
|
159
|
-
function te() {
|
|
160
|
-
var e;
|
|
161
|
-
(e = f.value) == null || e.blur();
|
|
162
|
-
}
|
|
163
|
-
return K({ el: g, focus: ae, blur: te }), (e, a) => ue((s(), d("div", {
|
|
164
|
-
ref_key: "wrapperRef",
|
|
165
|
-
ref: g,
|
|
166
|
-
style: { position: "relative" }
|
|
167
|
-
}, [
|
|
168
|
-
r.label ? (s(), d("label", ye, x(r.label), 1)) : w("", !0),
|
|
169
|
-
$("div", {
|
|
170
|
-
style: k({
|
|
171
|
-
display: "flex",
|
|
172
|
-
flexWrap: "wrap",
|
|
173
|
-
alignItems: "center",
|
|
174
|
-
gap: "calc(0.25rem * var(--cui-density-scale, 1))",
|
|
175
|
-
padding: y.value.padding,
|
|
176
|
-
border: `1px solid ${r.error ? "var(--cui-error)" : "var(--cui-border-strong, var(--cui-border))"}`,
|
|
177
|
-
borderRadius: Z[r.rounded],
|
|
178
|
-
background: "var(--cui-surface-base, white)",
|
|
179
|
-
cursor: r.disabled ? "default" : "text",
|
|
180
|
-
opacity: r.disabled ? "0.5" : "1",
|
|
181
|
-
minHeight: y.value.inputHeight
|
|
182
|
-
}),
|
|
183
|
-
onClick: a[0] || (a[0] = (t) => {
|
|
184
|
-
var n;
|
|
185
|
-
return (n = f.value) == null ? void 0 : n.focus();
|
|
186
|
-
})
|
|
187
|
-
}, [
|
|
188
|
-
(s(!0), d(q, null, F(r.modelValue, (t) => (s(), O(ge, {
|
|
189
|
-
key: t,
|
|
190
|
-
color: G(t),
|
|
191
|
-
size: y.value.tagSize,
|
|
192
|
-
removable: "",
|
|
193
|
-
onRemove: (n) => N(t)
|
|
194
|
-
}, {
|
|
195
|
-
default: ie(() => [
|
|
196
|
-
se(x(j(t)), 1)
|
|
197
|
-
]),
|
|
198
|
-
_: 2
|
|
199
|
-
}, 1032, ["color", "size", "onRemove"]))), 128)),
|
|
200
|
-
C.value ? w("", !0) : (s(), d("input", {
|
|
201
|
-
key: 0,
|
|
202
|
-
ref_key: "inputRef",
|
|
203
|
-
ref: f,
|
|
204
|
-
value: o.value,
|
|
205
|
-
placeholder: r.modelValue.length > 0 ? "" : r.placeholder,
|
|
206
|
-
disabled: r.disabled,
|
|
207
|
-
style: k({
|
|
208
|
-
flex: "1",
|
|
209
|
-
minWidth: "4rem",
|
|
210
|
-
border: "none",
|
|
211
|
-
outline: "none",
|
|
212
|
-
background: "transparent",
|
|
213
|
-
fontSize: y.value.fontSize,
|
|
214
|
-
color: "var(--cui-text-body)",
|
|
215
|
-
padding: "calc(0.125rem * var(--cui-density-scale, 1)) 0",
|
|
216
|
-
fontFamily: "inherit"
|
|
217
|
-
}),
|
|
218
|
-
onInput: X,
|
|
219
|
-
onFocus: ee,
|
|
220
|
-
onKeydown: _
|
|
221
|
-
}, null, 44, be))
|
|
222
|
-
], 4),
|
|
223
|
-
r.error && r.errorMessage ? (s(), d("div", he, x(r.errorMessage), 1)) : w("", !0),
|
|
224
|
-
(s(), O(ce, { to: "body" }, [
|
|
225
|
-
c.value && (i.value.length > 0 || p.value || D.value) ? (s(), d("div", {
|
|
226
|
-
key: 0,
|
|
227
|
-
ref_key: "dropdownRef",
|
|
228
|
-
ref: E,
|
|
229
|
-
style: k(I.value)
|
|
230
|
-
}, [
|
|
231
|
-
D.value && i.value.length === 0 ? (s(), d("div", xe, [
|
|
232
|
-
P(pe, {
|
|
233
|
-
size: "xs",
|
|
234
|
-
"show-label": "",
|
|
235
|
-
label: "Searching..."
|
|
236
|
-
})
|
|
237
|
-
])) : w("", !0),
|
|
238
|
-
(s(!0), d(q, null, F(i.value, (t, n) => (s(), d("div", {
|
|
239
|
-
key: t.value,
|
|
240
|
-
"data-index": n,
|
|
241
|
-
style: k({
|
|
242
|
-
display: "flex",
|
|
243
|
-
alignItems: "center",
|
|
244
|
-
gap: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
245
|
-
padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))",
|
|
246
|
-
cursor: "pointer",
|
|
247
|
-
fontSize: y.value.fontSize,
|
|
248
|
-
borderRadius: "0.25rem",
|
|
249
|
-
background: u.value === n ? "var(--cui-primary-bg)" : "transparent",
|
|
250
|
-
color: "var(--cui-text-body)",
|
|
251
|
-
transition: "background 0.1s ease"
|
|
252
|
-
}),
|
|
253
|
-
onClick: U((M) => A(t), ["stop"]),
|
|
254
|
-
onMouseenter: (M) => u.value = n
|
|
255
|
-
}, [
|
|
256
|
-
de(e.$slots, "suggestion", { suggestion: t }, () => [
|
|
257
|
-
$("span", null, x(t.label || t.value), 1)
|
|
258
|
-
])
|
|
259
|
-
], 44, we))), 128)),
|
|
260
|
-
p.value ? (s(), d("div", {
|
|
261
|
-
key: 1,
|
|
262
|
-
style: k({
|
|
263
|
-
display: "flex",
|
|
264
|
-
alignItems: "center",
|
|
265
|
-
gap: "calc(0.375rem * var(--cui-density-scale, 1))",
|
|
266
|
-
padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))",
|
|
267
|
-
cursor: "pointer",
|
|
268
|
-
fontSize: y.value.fontSize,
|
|
269
|
-
borderRadius: "0.25rem",
|
|
270
|
-
background: u.value === i.value.length ? "var(--cui-primary-bg)" : "transparent",
|
|
271
|
-
color: "var(--cui-primary)",
|
|
272
|
-
fontWeight: "500",
|
|
273
|
-
transition: "background 0.1s ease",
|
|
274
|
-
borderTop: i.value.length > 0 ? "1px solid color-mix(in srgb, var(--cui-border) 50%, transparent)" : "none",
|
|
275
|
-
marginTop: i.value.length > 0 ? "calc(0.125rem * var(--cui-density-scale, 1))" : "0",
|
|
276
|
-
paddingTop: i.value.length > 0 ? "calc(0.5rem * var(--cui-density-scale, 1))" : void 0
|
|
277
|
-
}),
|
|
278
|
-
onClick: U(T, ["stop"]),
|
|
279
|
-
onMouseenter: a[1] || (a[1] = (t) => u.value = i.value.length)
|
|
280
|
-
}, [
|
|
281
|
-
P(me, {
|
|
282
|
-
name: "plus",
|
|
283
|
-
size: "0.75rem"
|
|
284
|
-
}),
|
|
285
|
-
$("span", null, x(r.createText) + " “" + x(o.value.trim()) + "”", 1)
|
|
286
|
-
], 36)) : w("", !0)
|
|
287
|
-
], 4)) : w("", !0)
|
|
288
|
-
]))
|
|
289
|
-
], 512)), [
|
|
290
|
-
[ve, !r.hidden]
|
|
291
|
-
]);
|
|
292
|
-
}
|
|
293
|
-
});
|
|
1
|
+
import o from "./CuiTagInput.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-532a086a"]]);
|
|
294
5
|
export {
|
|
295
|
-
|
|
6
|
+
m as default
|
|
296
7
|
};
|