@guoyg578/k-ui 0.1.0 → 0.1.2
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 +75 -29
- package/dist/components/KAffix.vue.d.ts +17 -0
- package/dist/components/KAffix.vue.js +7 -0
- package/dist/components/KAffix.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/KAlert.vue.d.ts +1 -1
- package/dist/components/{KAlert.js → KAlert.vue.js} +2 -2
- package/dist/components/KAlert.vue_vue_type_script_setup_true_lang.js +35 -32
- package/dist/components/KAnchor.vue.d.ts +14 -0
- package/dist/components/KAnchor.vue.js +7 -0
- package/dist/components/KAnchor.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/KAutoComplete.vue.d.ts +26 -0
- package/dist/components/KAutoComplete.vue.js +8 -0
- package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/{KAvatar.js → KAvatar.vue.js} +1 -1
- package/dist/components/{KAvatarGroup.js → KAvatarGroup.vue.js} +1 -1
- package/dist/components/KBackTop.vue.d.ts +24 -0
- package/dist/components/KBackTop.vue.js +7 -0
- package/dist/components/KBackTop.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/KBadge.vue.d.ts +31 -0
- package/dist/components/KBadge.vue.js +7 -0
- package/dist/components/KBadge.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/KBreadcrumb.vue.d.ts +30 -1
- package/dist/components/{KBreadcrumb.js → KBreadcrumb.vue.js} +2 -2
- package/dist/components/KBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -21
- package/dist/components/KButton.vue.d.ts +17 -2
- package/dist/components/{KButton.js → KButton.vue.js} +2 -2
- package/dist/components/KButton.vue_vue_type_script_setup_true_lang.js +51 -17
- package/dist/components/KButtonGroup.vue.d.ts +18 -0
- package/dist/components/KButtonGroup.vue.js +6 -0
- package/dist/components/KButtonGroup.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KCalendar.vue.d.ts +33 -0
- package/dist/components/KCalendar.vue.js +7 -0
- package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/KCard.vue.d.ts +5 -3
- package/dist/components/{KCard.js → KCard.vue.js} +2 -2
- package/dist/components/KCard.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/{KCarousel.js → KCarousel.vue.js} +1 -1
- package/dist/components/KCascader.vue.d.ts +29 -0
- package/dist/components/KCascader.vue.js +8 -0
- package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/{KCheckbox.js → KCheckbox.vue.js} +1 -1
- package/dist/components/{KCheckboxGroup.js → KCheckboxGroup.vue.js} +1 -1
- package/dist/components/KCode.vue.d.ts +27 -0
- package/dist/components/KCode.vue.js +7 -0
- package/dist/components/KCode.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/KCollapse.vue.d.ts +25 -0
- package/dist/components/KCollapse.vue.js +7 -0
- package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/KCollapseItem.vue.d.ts +22 -0
- package/dist/components/KCollapseItem.vue.js +7 -0
- package/dist/components/KCollapseItem.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/components/KColorPicker.vue.d.ts +40 -0
- package/dist/components/KColorPicker.vue.js +7 -0
- package/dist/components/KColorPicker.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/{KCombobox.js → KCombobox.vue.js} +2 -2
- package/dist/components/{KCommandPalette.js → KCommandPalette.vue.js} +1 -1
- package/dist/components/KConfigProvider.vue.d.ts +26 -0
- package/dist/components/KConfigProvider.vue.js +5 -0
- package/dist/components/KConfigProvider.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/{KConfirmDialog.js → KConfirmDialog.vue.js} +1 -1
- package/dist/components/KCountdown.vue.d.ts +15 -0
- package/dist/components/KCountdown.vue.js +7 -0
- package/dist/components/KCountdown.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/KDataTable.vue.d.ts +33 -10
- package/dist/components/{KDataTable.js → KDataTable.vue.js} +2 -2
- package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +128 -30
- package/dist/components/{KDatePicker.js → KDatePicker.vue.js} +1 -1
- package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/KDescriptions.vue.d.ts +30 -0
- package/dist/components/KDescriptions.vue.js +6 -0
- package/dist/components/KDescriptions.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/KDescriptionsItem.vue.d.ts +17 -0
- package/dist/components/KDescriptionsItem.vue.js +5 -0
- package/dist/components/KDescriptionsItem.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/KDialog.vue.d.ts +1 -0
- package/dist/components/{KDialog.js → KDialog.vue.js} +2 -2
- package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +45 -38
- package/dist/components/{KDiff.js → KDiff.vue.js} +1 -1
- package/dist/components/KDivider.vue.d.ts +21 -0
- package/dist/components/KDivider.vue.js +7 -0
- package/dist/components/KDivider.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/KDrawer.vue.d.ts +7 -3
- package/dist/components/{KDrawer.js → KDrawer.vue.js} +2 -2
- package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +41 -29
- package/dist/components/KDropdown.vue.d.ts +8 -5
- package/dist/components/{KDropdown.js → KDropdown.vue.js} +2 -2
- package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +40 -38
- package/dist/components/KDynamicInput.vue.d.ts +33 -0
- package/dist/components/KDynamicInput.vue.js +7 -0
- package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/KDynamicTags.vue.d.ts +20 -0
- package/dist/components/KDynamicTags.vue.js +7 -0
- package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/KEmpty.vue.d.ts +8 -4
- package/dist/components/KEmpty.vue_vue_type_script_setup_true_lang.js +17 -14
- package/dist/components/KForm.vue.d.ts +12 -6
- package/dist/components/{KForm.js → KForm.vue.js} +2 -2
- package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +31 -15
- package/dist/components/KFormField.vue.d.ts +3 -2
- package/dist/components/{KFormField.js → KFormField.vue.js} +2 -2
- package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +41 -28
- package/dist/components/KGrid.vue.d.ts +29 -0
- package/dist/components/KGrid.vue.js +7 -0
- package/dist/components/KGrid.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/KGridItem.vue.d.ts +20 -0
- package/dist/components/KGridItem.vue.js +7 -0
- package/dist/components/KGridItem.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/KIcon.vue.d.ts +22 -0
- package/dist/components/KIcon.vue.js +7 -0
- package/dist/components/KIcon.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/KImage.vue.d.ts +3 -3
- package/dist/components/{KImage.js → KImage.vue.js} +1 -1
- package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/{KImageViewer.js → KImageViewer.vue.js} +1 -1
- package/dist/components/KInput.vue.d.ts +11 -5
- package/dist/components/{KInput.js → KInput.vue.js} +2 -2
- package/dist/components/KInput.vue_vue_type_script_setup_true_lang.js +62 -38
- package/dist/components/KInputNumber.vue.d.ts +18 -4
- package/dist/components/{KInputNumber.js → KInputNumber.vue.js} +2 -2
- package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +80 -62
- package/dist/components/KLayout.vue.d.ts +19 -0
- package/dist/components/KLayout.vue.js +7 -0
- package/dist/components/KLayout.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KLayoutContent.vue.d.ts +17 -0
- package/dist/components/KLayoutContent.vue.js +7 -0
- package/dist/components/KLayoutContent.vue_vue_type_script_setup_true_lang.js +11 -0
- package/dist/components/KLayoutHeader.vue.d.ts +19 -0
- package/dist/components/KLayoutHeader.vue.js +7 -0
- package/dist/components/KLayoutHeader.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KLayoutSider.vue.d.ts +28 -0
- package/dist/components/KLayoutSider.vue.js +7 -0
- package/dist/components/KLayoutSider.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/KList.vue.d.ts +24 -0
- package/dist/components/KList.vue.js +7 -0
- package/dist/components/KList.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/KListItem.vue.d.ts +17 -0
- package/dist/components/KListItem.vue.js +7 -0
- package/dist/components/KListItem.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/components/{KLoadingOverlay.js → KLoadingOverlay.vue.js} +1 -1
- package/dist/components/KMention.vue.d.ts +27 -0
- package/dist/components/KMention.vue.js +8 -0
- package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/KMenu.vue.d.ts +30 -0
- package/dist/components/KMenu.vue.js +9 -0
- package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/components/KMenuItem.vue.d.ts +10 -0
- package/dist/components/KMenuItem.vue.js +7 -0
- package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/KMessage.js +1 -1
- package/dist/components/{KMessageContainer.js → KMessageContainer.vue.js} +1 -1
- package/dist/components/KNotification.d.ts +36 -0
- package/dist/components/KNotification.js +55 -0
- package/dist/components/KNotificationContainer.vue.d.ts +20 -0
- package/dist/components/KNotificationContainer.vue.js +7 -0
- package/dist/components/KNotificationContainer.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/KNotificationProvider.vue.d.ts +13 -0
- package/dist/components/KNotificationProvider.vue.js +10 -0
- package/dist/components/KNumberAnimation.vue.d.ts +33 -0
- package/dist/components/KNumberAnimation.vue.js +7 -0
- package/dist/components/KNumberAnimation.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/{KPagination.js → KPagination.vue.js} +1 -1
- package/dist/components/KPopconfirm.vue.d.ts +46 -0
- package/dist/components/KPopconfirm.vue.js +6 -0
- package/dist/components/KPopconfirm.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/KPopover.vue.d.ts +1 -1
- package/dist/components/{KPopover.js → KPopover.vue.js} +1 -1
- package/dist/components/KProgress.vue.d.ts +3 -2
- package/dist/components/{KProgress.js → KProgress.vue.js} +2 -2
- package/dist/components/KProgress.vue_vue_type_script_setup_true_lang.js +23 -20
- package/dist/components/KRadio.vue.d.ts +4 -2
- package/dist/components/{KRadio.js → KRadio.vue.js} +2 -2
- package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +24 -11
- package/dist/components/KRadioGroup.vue.d.ts +3 -0
- package/dist/components/{KRadioGroup.js → KRadioGroup.vue.js} +2 -2
- package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +17 -12
- package/dist/components/KRate.vue.d.ts +25 -0
- package/dist/components/KRate.vue.js +7 -0
- package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/components/{KResizablePanel.js → KResizablePanel.vue.js} +1 -1
- package/dist/components/{KResult.js → KResult.vue.js} +1 -1
- package/dist/components/KSelect.vue.d.ts +10 -3
- package/dist/components/{KSelect.js → KSelect.vue.js} +4 -4
- package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +89 -48
- package/dist/components/{KSkeleton.js → KSkeleton.vue.js} +1 -1
- package/dist/components/KSlider.vue.d.ts +24 -0
- package/dist/components/KSlider.vue.js +7 -0
- package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/components/KSpace.vue.d.ts +32 -0
- package/dist/components/KSpace.vue.js +7 -0
- package/dist/components/KSpace.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/KSpin.vue.d.ts +23 -0
- package/dist/components/KSpin.vue.js +7 -0
- package/dist/components/KSpin.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/KStatistic.vue.d.ts +23 -0
- package/dist/components/KStatistic.vue.js +7 -0
- package/dist/components/KStatistic.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/KSteps.vue.d.ts +1 -1
- package/dist/components/{KSteps.js → KSteps.vue.js} +1 -1
- package/dist/components/KSwitch.vue.d.ts +2 -2
- package/dist/components/{KSwitch.js → KSwitch.vue.js} +2 -2
- package/dist/components/KSwitch.vue_vue_type_script_setup_true_lang.js +12 -11
- package/dist/components/KTabs.vue.d.ts +10 -5
- package/dist/components/{KTabs.js → KTabs.vue.js} +2 -2
- package/dist/components/KTabs.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/components/KTag.vue.d.ts +3 -3
- package/dist/components/{KTag.js → KTag.vue.js} +2 -2
- package/dist/components/KTag.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/components/KText.vue.d.ts +26 -0
- package/dist/components/KText.vue.js +7 -0
- package/dist/components/KText.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/KTextarea.vue.d.ts +17 -2
- package/dist/components/{KTextarea.js → KTextarea.vue.js} +2 -2
- package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +51 -22
- package/dist/components/{KThemeToggleButton.js → KThemeToggleButton.vue.js} +1 -1
- package/dist/components/KTime.vue.d.ts +14 -0
- package/dist/components/KTime.vue.js +7 -0
- package/dist/components/KTime.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/KTimePicker.vue.d.ts +19 -0
- package/dist/components/KTimePicker.vue.js +8 -0
- package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/KTimeline.vue.d.ts +13 -0
- package/dist/components/KTimeline.vue.js +7 -0
- package/dist/components/KTimeline.vue_vue_type_script_setup_true_lang.js +10 -0
- package/dist/components/KTimelineItem.vue.d.ts +29 -0
- package/dist/components/KTimelineItem.vue.js +7 -0
- package/dist/components/KTimelineItem.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/{KTooltip.js → KTooltip.vue.js} +1 -1
- package/dist/components/KTransfer.vue.d.ts +24 -0
- package/dist/components/KTransfer.vue.js +7 -0
- package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/{KTreeNode.js → KTreeNode.vue.js} +1 -1
- package/dist/components/KTreeSelect.vue.d.ts +22 -0
- package/dist/components/KTreeSelect.vue.js +8 -0
- package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/{KTreeView.js → KTreeView.vue.js} +1 -1
- package/dist/components/KTreeView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/KTypography.vue.d.ts +13 -0
- package/dist/components/KTypography.vue.js +7 -0
- package/dist/components/KTypography.vue_vue_type_script_setup_true_lang.js +10 -0
- package/dist/components/KUpload.vue.d.ts +100 -4
- package/dist/components/{KUpload.js → KUpload.vue.js} +2 -2
- package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +189 -94
- package/dist/components/KUploadDragger.vue.d.ts +13 -0
- package/dist/components/KUploadDragger.vue.js +7 -0
- package/dist/components/KUploadDragger.vue_vue_type_script_setup_true_lang.js +12 -0
- package/dist/components/{KVirtualList.js → KVirtualList.vue.js} +1 -1
- package/dist/components/KWatermark.vue.d.ts +27 -0
- package/dist/components/KWatermark.vue.js +7 -0
- package/dist/components/KWatermark.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/form-context.d.ts +7 -3
- package/dist/components/list-context.d.ts +6 -0
- package/dist/components/list-context.js +4 -0
- package/dist/components/menu-context.d.ts +26 -0
- package/dist/components/menu-context.js +4 -0
- package/dist/components/radio-context.d.ts +6 -0
- package/dist/components/radio-context.js +4 -0
- package/dist/components/upload-context.d.ts +6 -0
- package/dist/components/upload-context.js +4 -0
- package/dist/index.d.ts +60 -3
- package/dist/index.js +104 -55
- package/dist/k-ui.css +1 -1
- package/package.json +6 -12
- /package/dist/components/{KEmpty.js → KEmpty.vue.js} +0 -0
- /package/dist/components/{KGridSkeleton.js → KGridSkeleton.vue.js} +0 -0
- /package/dist/components/{KListSkeleton.js → KListSkeleton.vue.js} +0 -0
- /package/dist/components/{KRefetchOverlay.js → KRefetchOverlay.vue.js} +0 -0
- /package/dist/components/{KSearchBar.js → KSearchBar.vue.js} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LIST_KEY as e } from "./list-context.js";
|
|
2
|
+
import { createCommentVNode as t, createElementBlock as n, defineComponent as r, normalizeClass as i, openBlock as a, provide as o, renderSlot as s } from "vue";
|
|
3
|
+
//#region components/KList.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var c = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "k-list__header"
|
|
7
|
+
}, l = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "k-list__footer"
|
|
10
|
+
}, u = /* @__PURE__ */ r({
|
|
11
|
+
__name: "KList",
|
|
12
|
+
props: {
|
|
13
|
+
bordered: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
hoverable: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(r) {
|
|
23
|
+
let u = r;
|
|
24
|
+
return o(e, {
|
|
25
|
+
get bordered() {
|
|
26
|
+
return u.bordered;
|
|
27
|
+
},
|
|
28
|
+
get hoverable() {
|
|
29
|
+
return u.hoverable;
|
|
30
|
+
}
|
|
31
|
+
}), (e, o) => (a(), n("div", { class: i(["k-list", { "k-list--bordered": r.bordered }]) }, [
|
|
32
|
+
e.$slots.header ? (a(), n("div", c, [s(e.$slots, "header", {}, void 0, !0)])) : t("", !0),
|
|
33
|
+
s(e.$slots, "default", {}, void 0, !0),
|
|
34
|
+
e.$slots.footer ? (a(), n("div", l, [s(e.$slots, "footer", {}, void 0, !0)])) : t("", !0)
|
|
35
|
+
], 2));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export { u as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
prefix?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_3) => any;
|
|
6
|
+
} & {
|
|
7
|
+
suffix?: (props: typeof __VLS_5) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KListItem.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KListItem.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b3ad1f4a"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LIST_KEY as e } from "./list-context.js";
|
|
2
|
+
import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, inject as o, normalizeClass as s, openBlock as c, renderSlot as l } from "vue";
|
|
3
|
+
//#region components/KListItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var u = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "k-list-item__prefix"
|
|
7
|
+
}, d = { class: "k-list-item__main" }, f = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "k-list-item__suffix"
|
|
10
|
+
}, p = /* @__PURE__ */ a({
|
|
11
|
+
__name: "KListItem",
|
|
12
|
+
setup(a) {
|
|
13
|
+
let p = o(e, null), m = t(() => !!p?.hoverable);
|
|
14
|
+
return (e, t) => (c(), r("div", { class: s(["k-list-item", { "k-list-item--hoverable": m.value }]) }, [
|
|
15
|
+
e.$slots.prefix ? (c(), r("div", u, [l(e.$slots, "prefix", {}, void 0, !0)])) : n("", !0),
|
|
16
|
+
i("div", d, [l(e.$slots, "default", {}, void 0, !0)]),
|
|
17
|
+
e.$slots.suffix ? (c(), r("div", f, [l(e.$slots, "suffix", {}, void 0, !0)])) : n("", !0)
|
|
18
|
+
], 2));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { p as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KLoadingOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KLoadingOverlay.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0199872e"]]);
|
|
6
6
|
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface MentionOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string | number;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
modelValue?: string;
|
|
7
|
+
options?: MentionOption[];
|
|
8
|
+
prefix?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
rows?: number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
"update:modelValue": (v: string) => any;
|
|
15
|
+
mention: (o: MentionOption) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
18
|
+
onMention?: ((o: MentionOption) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
modelValue: string;
|
|
22
|
+
prefix: string;
|
|
23
|
+
rows: number;
|
|
24
|
+
options: MentionOption[];
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "./KMention.vue_vue_type_script_setup_true_lang.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
//#region components/KMention.vue
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-fa664c6d"]]);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, nextTick as o, openBlock as s, ref as c, renderList as l, toDisplayString as u, withModifiers as d } from "vue";
|
|
2
|
+
//#region components/KMention.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var f = { class: "k-mention" }, p = [
|
|
4
|
+
"value",
|
|
5
|
+
"rows",
|
|
6
|
+
"placeholder",
|
|
7
|
+
"disabled"
|
|
8
|
+
], m = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "k-mention__list k-menu-surface"
|
|
11
|
+
}, h = ["onMousedown"], g = /* @__PURE__ */ a({
|
|
12
|
+
__name: "KMention",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { default: "" },
|
|
15
|
+
options: { default: () => [] },
|
|
16
|
+
prefix: { default: "@" },
|
|
17
|
+
placeholder: {},
|
|
18
|
+
rows: { default: 3 },
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue", "mention"],
|
|
25
|
+
setup(a, { emit: g }) {
|
|
26
|
+
let _ = a, v = g, y = c(null), b = c(!1), x = c(""), S = -1;
|
|
27
|
+
function C(e) {
|
|
28
|
+
let t = e.selectionStart ?? 0, n = e.value.slice(0, t), r = _.prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = n.match(RegExp(`(?:^|\\s)${r}([^\\s${r}]*)$`));
|
|
29
|
+
i ? (x.value = i[1], S = t - i[1].length - _.prefix.length, b.value = !0) : b.value = !1;
|
|
30
|
+
}
|
|
31
|
+
function w(e) {
|
|
32
|
+
let t = e.target;
|
|
33
|
+
v("update:modelValue", t.value), C(t);
|
|
34
|
+
}
|
|
35
|
+
let T = t(() => {
|
|
36
|
+
let e = x.value.toLowerCase();
|
|
37
|
+
return (_.options ?? []).filter((t) => t.label.toLowerCase().includes(e));
|
|
38
|
+
});
|
|
39
|
+
async function E(e) {
|
|
40
|
+
let t = y.value;
|
|
41
|
+
if (!t) return;
|
|
42
|
+
let n = t.selectionStart ?? 0, r = _.modelValue ?? "", i = `${_.prefix}${e.label} `;
|
|
43
|
+
v("update:modelValue", r.slice(0, S) + i + r.slice(n)), v("mention", e), b.value = !1, await o(), t.focus();
|
|
44
|
+
let a = S + i.length;
|
|
45
|
+
t.setSelectionRange(a, a);
|
|
46
|
+
}
|
|
47
|
+
function D(e) {
|
|
48
|
+
b.value && e.key === "Enter" && T.value.length ? (e.preventDefault(), E(T.value[0])) : e.key === "Escape" && (b.value = !1);
|
|
49
|
+
}
|
|
50
|
+
function O() {
|
|
51
|
+
setTimeout(() => b.value = !1, 120);
|
|
52
|
+
}
|
|
53
|
+
return (t, o) => (s(), r("div", f, [i("textarea", {
|
|
54
|
+
ref_key: "ta",
|
|
55
|
+
ref: y,
|
|
56
|
+
class: "k-mention__input",
|
|
57
|
+
value: a.modelValue,
|
|
58
|
+
rows: a.rows,
|
|
59
|
+
placeholder: a.placeholder,
|
|
60
|
+
disabled: a.disabled,
|
|
61
|
+
onInput: w,
|
|
62
|
+
onKeydown: D,
|
|
63
|
+
onBlur: O
|
|
64
|
+
}, null, 40, p), b.value && T.value.length ? (s(), r("div", m, [(s(!0), r(e, null, l(T.value, (e) => (s(), r("button", {
|
|
65
|
+
key: e.value ?? e.label,
|
|
66
|
+
type: "button",
|
|
67
|
+
class: "k-mention__item",
|
|
68
|
+
onMousedown: d((t) => E(e), ["prevent"])
|
|
69
|
+
}, u(e.label), 41, h))), 128))])) : n("", !0)]));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
//#endregion
|
|
73
|
+
export { g as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MenuOption } from './menu-context';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 当前选中项的 key(受控) */
|
|
4
|
+
value?: string | null;
|
|
5
|
+
options: MenuOption[];
|
|
6
|
+
/** 折叠为仅图标 */
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
collapsedWidth?: number;
|
|
9
|
+
/** 每级子菜单缩进 */
|
|
10
|
+
indent?: number;
|
|
11
|
+
/** 顶层左缩进 */
|
|
12
|
+
rootIndent?: number;
|
|
13
|
+
/** 手风琴:同层只展开一个 */
|
|
14
|
+
accordion?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
17
|
+
select: (key: string, option: MenuOption) => any;
|
|
18
|
+
"update:value": (key: string) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onSelect?: ((key: string, option: MenuOption) => any) | undefined;
|
|
21
|
+
"onUpdate:value"?: ((key: string) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
indent: number;
|
|
24
|
+
accordion: boolean;
|
|
25
|
+
collapsedWidth: number;
|
|
26
|
+
collapsed: boolean;
|
|
27
|
+
rootIndent: number;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "./KMenu.vue_vue_type_script_setup_true_lang.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
//#region components/KMenu.vue
|
|
7
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c59150ee"]]);
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { MENU_KEY as e } from "./menu-context.js";
|
|
2
|
+
import t from "./KMenuItem.vue.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, provide as m, ref as h, renderList as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
|
|
4
|
+
import { HoverCardContent as S, HoverCardPortal as C, HoverCardRoot as w, HoverCardTrigger as T } from "reka-ui";
|
|
5
|
+
//#region components/KMenu.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var E = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "k-menu-tree__divider"
|
|
9
|
+
}, D = ["aria-label"], O = ["disabled", "onClick"], k = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "k-menu-tree-flyout__icon"
|
|
12
|
+
}, A = { class: "k-menu-tree-flyout__label" }, j = [
|
|
13
|
+
"disabled",
|
|
14
|
+
"aria-label",
|
|
15
|
+
"onClick"
|
|
16
|
+
], M = /* @__PURE__ */ u({
|
|
17
|
+
__name: "KMenu",
|
|
18
|
+
props: {
|
|
19
|
+
value: {},
|
|
20
|
+
options: {},
|
|
21
|
+
collapsed: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
collapsedWidth: { default: 64 },
|
|
26
|
+
indent: { default: 20 },
|
|
27
|
+
rootIndent: { default: 16 },
|
|
28
|
+
accordion: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:value", "select"],
|
|
34
|
+
setup(u, { emit: M }) {
|
|
35
|
+
let N = u, P = M, F = h(/* @__PURE__ */ new Set()), I = r(() => {
|
|
36
|
+
let e = [], t = (n, r) => {
|
|
37
|
+
for (let i of n) if (i.type !== "divider") {
|
|
38
|
+
if (i.key === N.value) return e.push(...r), !0;
|
|
39
|
+
if (i.children?.length && t(i.children, [...r, i.key])) return !0;
|
|
40
|
+
}
|
|
41
|
+
return !1;
|
|
42
|
+
};
|
|
43
|
+
return t(N.options, []), e;
|
|
44
|
+
});
|
|
45
|
+
b(I, (e) => {
|
|
46
|
+
if (!e.length) return;
|
|
47
|
+
let t = new Set(F.value);
|
|
48
|
+
e.forEach((e) => t.add(e)), F.value = t;
|
|
49
|
+
}, { immediate: !0 });
|
|
50
|
+
let L = {
|
|
51
|
+
isActive: (e) => e === N.value,
|
|
52
|
+
inActiveTrail: (e) => I.value.includes(e),
|
|
53
|
+
isExpanded: (e) => F.value.has(e),
|
|
54
|
+
toggle: (e) => {
|
|
55
|
+
let t = new Set(F.value);
|
|
56
|
+
t.has(e) ? t.delete(e) : (N.accordion && t.clear(), t.add(e)), F.value = t;
|
|
57
|
+
},
|
|
58
|
+
select: (e) => {
|
|
59
|
+
P("update:value", e.key), P("select", e.key, e);
|
|
60
|
+
},
|
|
61
|
+
get indent() {
|
|
62
|
+
return N.indent;
|
|
63
|
+
},
|
|
64
|
+
get rootIndent() {
|
|
65
|
+
return N.rootIndent;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
m(e, L);
|
|
69
|
+
let R = (e) => typeof e == "function";
|
|
70
|
+
function z(e) {
|
|
71
|
+
e.disabled || (P("update:value", e.key), P("select", e.key, e));
|
|
72
|
+
}
|
|
73
|
+
return (e, r) => (p(), o("nav", {
|
|
74
|
+
class: d(["k-menu-tree", { "k-menu-tree--collapsed": u.collapsed }]),
|
|
75
|
+
style: f(u.collapsed ? { width: `${u.collapsedWidth}px` } : void 0)
|
|
76
|
+
}, [u.collapsed ? (p(!0), o(n, { key: 1 }, g(u.options, (e, t) => (p(), o(n, { key: e.key || `_div${t}` }, [e.type === "divider" ? (p(), o("div", E)) : e.children?.length ? (p(), i(y(w), {
|
|
77
|
+
key: 1,
|
|
78
|
+
"open-delay": 0,
|
|
79
|
+
"close-delay": 120
|
|
80
|
+
}, {
|
|
81
|
+
default: x(() => [l(y(T), { "as-child": "" }, {
|
|
82
|
+
default: x(() => [s("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
class: d(["k-menu-tree__icon-btn", { "k-menu-tree__icon-btn--trail": L.inActiveTrail(e.key) }]),
|
|
85
|
+
"aria-label": typeof e.label == "string" ? e.label : void 0
|
|
86
|
+
}, [e.icon ? (p(), i(_(e.icon), {
|
|
87
|
+
key: 0,
|
|
88
|
+
size: 20
|
|
89
|
+
})) : a("", !0)], 10, D)]),
|
|
90
|
+
_: 2
|
|
91
|
+
}, 1024), l(y(C), null, {
|
|
92
|
+
default: x(() => [l(y(S), {
|
|
93
|
+
class: "k-menu-surface k-menu-tree-flyout",
|
|
94
|
+
side: "right",
|
|
95
|
+
align: "start",
|
|
96
|
+
"side-offset": 10
|
|
97
|
+
}, {
|
|
98
|
+
default: x(() => [(p(!0), o(n, null, g(e.children, (e) => (p(), o("button", {
|
|
99
|
+
key: e.key,
|
|
100
|
+
type: "button",
|
|
101
|
+
class: d(["k-menu-tree-flyout__item", {
|
|
102
|
+
"k-menu-tree-flyout__item--active": L.isActive(e.key),
|
|
103
|
+
"k-menu-tree-flyout__item--disabled": e.disabled
|
|
104
|
+
}]),
|
|
105
|
+
disabled: e.disabled,
|
|
106
|
+
onClick: (t) => z(e)
|
|
107
|
+
}, [e.icon ? (p(), o("span", k, [(p(), i(_(e.icon), { size: 16 }))])) : a("", !0), s("span", A, [R(e.label) ? (p(), i(_(e.label), { key: 0 })) : (p(), o(n, { key: 1 }, [c(v(e.label), 1)], 64))])], 10, O))), 128))]),
|
|
108
|
+
_: 2
|
|
109
|
+
}, 1024)]),
|
|
110
|
+
_: 2
|
|
111
|
+
}, 1024)]),
|
|
112
|
+
_: 2
|
|
113
|
+
}, 1024)) : (p(), o("button", {
|
|
114
|
+
key: 2,
|
|
115
|
+
type: "button",
|
|
116
|
+
class: d(["k-menu-tree__icon-btn", {
|
|
117
|
+
"k-menu-tree__icon-btn--active": L.isActive(e.key),
|
|
118
|
+
"k-menu-tree__icon-btn--disabled": e.disabled
|
|
119
|
+
}]),
|
|
120
|
+
disabled: e.disabled,
|
|
121
|
+
"aria-label": typeof e.label == "string" ? e.label : void 0,
|
|
122
|
+
onClick: (t) => z(e)
|
|
123
|
+
}, [e.icon ? (p(), i(_(e.icon), {
|
|
124
|
+
key: 0,
|
|
125
|
+
size: 20
|
|
126
|
+
})) : a("", !0)], 10, j))], 64))), 128)) : (p(!0), o(n, { key: 0 }, g(u.options, (e, n) => (p(), i(t, {
|
|
127
|
+
key: e.key || `_div${n}`,
|
|
128
|
+
option: e,
|
|
129
|
+
depth: 0
|
|
130
|
+
}, null, 8, ["option"]))), 128))], 6));
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
//#endregion
|
|
134
|
+
export { M as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MenuOption } from './menu-context';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
option: MenuOption;
|
|
4
|
+
depth?: number;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
depth: number;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KMenuItem.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KMenuItem.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-7e1cc01a"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MENU_KEY as e } from "./menu-context.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, inject as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, resolveComponent as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, vShow as v, withDirectives as y } from "vue";
|
|
3
|
+
import { ChevronDown as b } from "lucide-vue-next";
|
|
4
|
+
//#region components/KMenuItem.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var x = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "k-menu-tree__divider"
|
|
8
|
+
}, S = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "k-menu-tree__node"
|
|
11
|
+
}, C = ["disabled"], w = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "k-menu-tree__icon"
|
|
14
|
+
}, T = { class: "k-menu-tree__label" }, E = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "k-menu-tree__children"
|
|
17
|
+
}, D = /* @__PURE__ */ c({
|
|
18
|
+
name: "KMenuItem",
|
|
19
|
+
__name: "KMenuItem",
|
|
20
|
+
props: {
|
|
21
|
+
option: {},
|
|
22
|
+
depth: { default: 0 }
|
|
23
|
+
},
|
|
24
|
+
setup(c) {
|
|
25
|
+
let D = c, O = l(e), k = n(() => !!D.option.children?.length), A = (e) => typeof e == "function", j = n(() => `${O.rootIndent + D.depth * O.indent}px`);
|
|
26
|
+
function M() {
|
|
27
|
+
D.option.disabled || (k.value ? O.toggle(D.option.key) : O.select(D.option));
|
|
28
|
+
}
|
|
29
|
+
return (e, n) => {
|
|
30
|
+
let l = m("KMenuItem", !0);
|
|
31
|
+
return c.option.type === "divider" ? (f(), a("div", x)) : (f(), a("div", S, [o("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
class: u(["k-menu-tree__item", {
|
|
34
|
+
"k-menu-tree__item--active": !k.value && _(O).isActive(c.option.key),
|
|
35
|
+
"k-menu-tree__item--trail": k.value && _(O).inActiveTrail(c.option.key),
|
|
36
|
+
"k-menu-tree__item--disabled": c.option.disabled
|
|
37
|
+
}]),
|
|
38
|
+
style: d({ paddingLeft: j.value }),
|
|
39
|
+
disabled: c.option.disabled,
|
|
40
|
+
onClick: M
|
|
41
|
+
}, [
|
|
42
|
+
c.option.icon ? (f(), a("span", w, [(f(), r(h(c.option.icon), { size: 18 }))])) : i("", !0),
|
|
43
|
+
o("span", T, [A(c.option.label) ? (f(), r(h(c.option.label), { key: 0 })) : (f(), a(t, { key: 1 }, [s(g(c.option.label), 1)], 64))]),
|
|
44
|
+
k.value ? (f(), r(_(b), {
|
|
45
|
+
key: 1,
|
|
46
|
+
size: 14,
|
|
47
|
+
class: u(["k-menu-tree__arrow", { "k-menu-tree__arrow--open": _(O).isExpanded(c.option.key) }])
|
|
48
|
+
}, null, 8, ["class"])) : i("", !0)
|
|
49
|
+
], 14, C), k.value ? y((f(), a("div", E, [(f(!0), a(t, null, p(c.option.children, (e) => (f(), r(l, {
|
|
50
|
+
key: e.key,
|
|
51
|
+
option: e,
|
|
52
|
+
depth: c.depth + 1
|
|
53
|
+
}, null, 8, ["option", "depth"]))), 128))], 512)), [[v, _(O).isExpanded(c.option.key)]]) : i("", !0)]));
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { D as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KMessageContainer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KMessageContainer.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-44613943"]]);
|
|
6
6
|
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type VNodeChild } from 'vue';
|
|
2
|
+
export interface NotificationOptions {
|
|
3
|
+
type?: 'success' | 'error' | 'info' | 'warning';
|
|
4
|
+
title?: string | (() => VNodeChild);
|
|
5
|
+
content?: string | (() => VNodeChild);
|
|
6
|
+
duration?: number;
|
|
7
|
+
closable?: boolean;
|
|
8
|
+
avatar?: () => VNodeChild;
|
|
9
|
+
action?: () => VNodeChild;
|
|
10
|
+
}
|
|
11
|
+
export interface NotificationReactive {
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare function create(options: NotificationOptions): NotificationReactive;
|
|
15
|
+
declare function close(id: number): void;
|
|
16
|
+
declare function closeAll(): void;
|
|
17
|
+
type ShortHand = (options: Omit<NotificationOptions, 'type'> | string) => NotificationReactive;
|
|
18
|
+
export declare const KNotification: {
|
|
19
|
+
create: typeof create;
|
|
20
|
+
close: typeof close;
|
|
21
|
+
closeAll: typeof closeAll;
|
|
22
|
+
success: ShortHand;
|
|
23
|
+
error: ShortHand;
|
|
24
|
+
warning: ShortHand;
|
|
25
|
+
info: ShortHand;
|
|
26
|
+
};
|
|
27
|
+
export declare function useNotification(): {
|
|
28
|
+
create: typeof create;
|
|
29
|
+
close: typeof close;
|
|
30
|
+
closeAll: typeof closeAll;
|
|
31
|
+
success: ShortHand;
|
|
32
|
+
error: ShortHand;
|
|
33
|
+
warning: ShortHand;
|
|
34
|
+
info: ShortHand;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import e from "./KNotificationContainer.vue.js";
|
|
2
|
+
import { createApp as t, h as n, ref as r } from "vue";
|
|
3
|
+
//#region components/KNotification.ts
|
|
4
|
+
var i = null, a = null, o = null, s = 0;
|
|
5
|
+
function c() {
|
|
6
|
+
i || (o = document.createElement("div"), document.body.appendChild(o), a = r([]), i = t({ setup() {
|
|
7
|
+
return () => n(e, {
|
|
8
|
+
notifications: a.value,
|
|
9
|
+
onRemove: u
|
|
10
|
+
});
|
|
11
|
+
} }), i.mount(o));
|
|
12
|
+
}
|
|
13
|
+
function l(e) {
|
|
14
|
+
c();
|
|
15
|
+
let t = ++s, n = e.duration ?? 4500;
|
|
16
|
+
return a.value = [...a.value, {
|
|
17
|
+
id: t,
|
|
18
|
+
...e
|
|
19
|
+
}], n > 0 && setTimeout(() => u(t), n), { destroy: () => u(t) };
|
|
20
|
+
}
|
|
21
|
+
function u(e) {
|
|
22
|
+
a && (a.value = a.value.filter((t) => t.id !== e));
|
|
23
|
+
}
|
|
24
|
+
function d() {
|
|
25
|
+
a && (a.value = []);
|
|
26
|
+
}
|
|
27
|
+
function f(e) {
|
|
28
|
+
return typeof e == "string" ? { content: e } : e;
|
|
29
|
+
}
|
|
30
|
+
var p = {
|
|
31
|
+
create: l,
|
|
32
|
+
close: u,
|
|
33
|
+
closeAll: d,
|
|
34
|
+
success: ((e) => l({
|
|
35
|
+
...f(e),
|
|
36
|
+
type: "success"
|
|
37
|
+
})),
|
|
38
|
+
error: ((e) => l({
|
|
39
|
+
...f(e),
|
|
40
|
+
type: "error"
|
|
41
|
+
})),
|
|
42
|
+
warning: ((e) => l({
|
|
43
|
+
...f(e),
|
|
44
|
+
type: "warning"
|
|
45
|
+
})),
|
|
46
|
+
info: ((e) => l({
|
|
47
|
+
...f(e),
|
|
48
|
+
type: "info"
|
|
49
|
+
}))
|
|
50
|
+
};
|
|
51
|
+
function m() {
|
|
52
|
+
return p;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { p as KNotification, m as useNotification };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type VNodeChild } from 'vue';
|
|
2
|
+
export interface NotificationItem {
|
|
3
|
+
id: number;
|
|
4
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
5
|
+
title?: string | (() => VNodeChild);
|
|
6
|
+
content?: string | (() => VNodeChild);
|
|
7
|
+
avatar?: () => VNodeChild;
|
|
8
|
+
action?: () => VNodeChild;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
notifications: NotificationItem[];
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
|
+
remove: (id: number) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onRemove?: ((id: number) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KNotificationContainer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KNotificationContainer.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c681409f"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Fragment as e, TransitionGroup as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderList as u, resolveDynamicComponent as d, unref as f, withCtx as p } from "vue";
|
|
2
|
+
import { AlertCircle as m, AlertTriangle as h, CheckCircle2 as g, Info as _, X as v } from "lucide-vue-next";
|
|
3
|
+
//#region components/KNotificationContainer.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var y = { class: "k-notif__avatar" }, b = { class: "k-notif__main" }, x = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "k-notif__title"
|
|
7
|
+
}, S = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "k-notif__content"
|
|
10
|
+
}, C = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "k-notif__action"
|
|
13
|
+
}, w = ["onClick"], T = /* @__PURE__ */ s({
|
|
14
|
+
__name: "KNotificationContainer",
|
|
15
|
+
props: { notifications: {} },
|
|
16
|
+
emits: ["remove"],
|
|
17
|
+
setup(T) {
|
|
18
|
+
let E = {
|
|
19
|
+
success: g,
|
|
20
|
+
error: m,
|
|
21
|
+
warning: h,
|
|
22
|
+
info: _
|
|
23
|
+
}, D = s({
|
|
24
|
+
props: { value: { type: [String, Function] } },
|
|
25
|
+
setup(e) {
|
|
26
|
+
return () => typeof e.value == "function" ? e.value() : e.value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return (s, m) => (l(), n(t, {
|
|
30
|
+
name: "k-notif",
|
|
31
|
+
tag: "div",
|
|
32
|
+
class: "k-notif-container"
|
|
33
|
+
}, {
|
|
34
|
+
default: p(() => [(l(!0), i(e, null, u(T.notifications, (e) => (l(), i("article", {
|
|
35
|
+
key: e.id,
|
|
36
|
+
class: c(["k-notif", `k-notif--${e.type || "info"}`])
|
|
37
|
+
}, [
|
|
38
|
+
a("div", y, [e.avatar ? (l(), n(f(D), {
|
|
39
|
+
key: 0,
|
|
40
|
+
value: e.avatar
|
|
41
|
+
}, null, 8, ["value"])) : (l(), n(d(E[e.type || "info"]), {
|
|
42
|
+
key: 1,
|
|
43
|
+
size: 20
|
|
44
|
+
}))]),
|
|
45
|
+
a("div", b, [
|
|
46
|
+
e.title ? (l(), i("div", x, [o(f(D), { value: e.title }, null, 8, ["value"])])) : r("", !0),
|
|
47
|
+
e.content ? (l(), i("div", S, [o(f(D), { value: e.content }, null, 8, ["value"])])) : r("", !0),
|
|
48
|
+
e.action ? (l(), i("div", C, [o(f(D), { value: e.action }, null, 8, ["value"])])) : r("", !0)
|
|
49
|
+
]),
|
|
50
|
+
e.closable === !1 ? r("", !0) : (l(), i("button", {
|
|
51
|
+
key: 0,
|
|
52
|
+
type: "button",
|
|
53
|
+
class: "k-notif__close",
|
|
54
|
+
"aria-label": "关闭",
|
|
55
|
+
onClick: (t) => s.$emit("remove", e.id)
|
|
56
|
+
}, [o(f(v), { size: 14 })], 8, w))
|
|
57
|
+
], 2))), 128))]),
|
|
58
|
+
_: 1
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { T as default };
|