@guoyg578/k-ui 0.1.0 → 0.1.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 +66 -22
- 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/{KAvatar.js → KAvatar.vue.js} +1 -1
- package/dist/components/{KAvatarGroup.js → KAvatarGroup.vue.js} +1 -1
- 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/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/{KCheckbox.js → KCheckbox.vue.js} +1 -1
- package/dist/components/{KCheckboxGroup.js → KCheckboxGroup.vue.js} +1 -1
- 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/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/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 +7 -4
- 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/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/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/{KLoadingOverlay.js → KLoadingOverlay.vue.js} +1 -1
- 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/{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.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.js → KRadio.vue.js} +1 -1
- package/dist/components/{KRadioGroup.js → KRadioGroup.vue.js} +1 -1
- 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/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/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/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/{KTooltip.js → KTooltip.vue.js} +1 -1
- package/dist/components/{KTreeNode.js → KTreeNode.vue.js} +1 -1
- 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/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/form-context.d.ts +7 -3
- package/dist/components/upload-context.d.ts +6 -0
- package/dist/components/upload-context.js +4 -0
- package/dist/index.d.ts +17 -3
- package/dist/index.js +66 -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
package/README.md
CHANGED
|
@@ -1,8 +1,61 @@
|
|
|
1
1
|
# k-ui
|
|
2
2
|
|
|
3
|
-
一套可复用的 Vue 3 组件库(K 前缀),基于 reka-ui(headless)+ Tailwind v4
|
|
3
|
+
一套可复用的 Vue 3 组件库(K 前缀),基于 reka-ui(headless)+ Tailwind v4 设计令牌。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @guoyg578/k-ui
|
|
9
|
+
# 必需 peer 依赖
|
|
10
|
+
pnpm add vue reka-ui lucide-vue-next
|
|
11
|
+
# 可选:仅用到 KDatePicker 时
|
|
12
|
+
pnpm add @vuepic/vue-datepicker date-fns
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> 需要 **Tailwind v4**:组件大量使用工具类(`bg-ink-200` / `text-brand-500` / `size-4` …),这些类必须由你项目自己的 Tailwind 生成。
|
|
16
|
+
|
|
17
|
+
## 引入样式 ⚠️ 最关键
|
|
18
|
+
|
|
19
|
+
在全局 CSS 入口(即 `@import "tailwindcss"` 所在文件):
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@import "tailwindcss";
|
|
23
|
+
|
|
24
|
+
/* 设计令牌 + 组件基础类(含 @theme / @layer,必须交给 Tailwind 处理)*/
|
|
25
|
+
@import "@guoyg578/k-ui/styles/tokens.css";
|
|
26
|
+
@import "@guoyg578/k-ui/styles/components.css";
|
|
27
|
+
|
|
28
|
+
/* 已编译的组件作用域样式(纯 CSS,含弹层 menu / 日期选择器样式)*/
|
|
29
|
+
@import "@guoyg578/k-ui/css";
|
|
30
|
+
|
|
31
|
+
/* ⚠️ 让 Tailwind 扫描 k-ui 产物里出现的工具类,否则颜色/间距全部散架。
|
|
32
|
+
路径相对本 CSS 文件,按你的目录层级调整到 node_modules。 */
|
|
33
|
+
@source "../../node_modules/@guoyg578/k-ui/dist";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> - Tailwind v4 默认**不扫描 node_modules**,`@source` 那一行必不可少。
|
|
37
|
+
> - 暗色模式:`tokens.css` 自带 `:root[data-theme="dark"]` 覆盖,设 `<html data-theme="dark">` 即生效;不设则保持亮色。
|
|
38
|
+
|
|
39
|
+
## 快速上手
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { KButton, KDialog, KMessage } from '@guoyg578/k-ui'
|
|
44
|
+
import { ref } from 'vue'
|
|
45
|
+
const open = ref(false)
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<KButton type="primary" @click="open = true">打开</KButton>
|
|
50
|
+
<KDialog v-model:open="open" title="示例" footer @confirm="KMessage.success('done')">
|
|
51
|
+
Hello from k-ui.
|
|
52
|
+
</KDialog>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- `KConfirmDialog`(配 `useConfirm`):在根组件挂一次 `<KConfirmDialog />`。
|
|
57
|
+
- `v-reveal` / `v-spotlight` 指令:`import { installDirectives } from '@guoyg578/k-ui'` 后 `installDirectives(app)`。
|
|
58
|
+
- `KMessage`(函数式 toast)开箱即用,首次调用自动挂载容器。
|
|
6
59
|
|
|
7
60
|
## 组件清单(45+)
|
|
8
61
|
|
|
@@ -21,8 +74,6 @@
|
|
|
21
74
|
|
|
22
75
|
辅助导出:`useConfirm()`、`KMessage`、`installDirectives`、类型 `ConfirmOptions` / `ThemeMode` / `FormRule` / `FormFieldRef` / `TreeNode` / `CmdItem` / `UploadFile` / `MessageOptions`。
|
|
23
76
|
|
|
24
|
-
> 本库由两套同源组件合并而来:重叠组件(KTooltip / KPagination / KEmpty / KGridSkeleton / KListSkeleton / KRefetchOverlay)以 k-ui 原实现为基准。
|
|
25
|
-
|
|
26
77
|
## 依赖(peer dependencies)
|
|
27
78
|
|
|
28
79
|
| 依赖 | 用途 |
|
|
@@ -31,29 +82,22 @@
|
|
|
31
82
|
| `reka-ui` ^2 | 大量 headless 组件(Dialog / Select / Tooltip / Tabs …) |
|
|
32
83
|
| `lucide-vue-next` ^1 | 图标 |
|
|
33
84
|
| **Tailwind v4** | 工具类 + 设计令牌(`tokens.css` / `components.css`) |
|
|
34
|
-
| `vue-router` ^4+ | **可选** —— 仅 `KBreadcrumb` 用到 |
|
|
35
85
|
| `@vuepic/vue-datepicker` + `date-fns` | **可选** —— 仅 `KDatePicker` 用到(v13 依赖 date-fns 的 zhCN locale) |
|
|
36
86
|
|
|
37
|
-
|
|
87
|
+
> 本库**不依赖任何路由库**。`KBreadcrumb` 的链接项渲染为原生 `<a href>`,点击派发 `item-click` 事件,由宿主自行导航(如 `router.push`)。
|
|
38
88
|
|
|
39
|
-
|
|
40
|
-
<script setup lang="ts">
|
|
41
|
-
import { KButton, KDialog, KMessage } from './k-ui'
|
|
42
|
-
import { ref } from 'vue'
|
|
43
|
-
const open = ref(false)
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<template>
|
|
47
|
-
<KButton type="primary" @click="open = true">打开</KButton>
|
|
48
|
-
<KDialog v-model:open="open" title="示例" footer @confirm="KMessage.success('done')">
|
|
49
|
-
Hello from k-ui.
|
|
50
|
-
</KDialog>
|
|
51
|
-
</template>
|
|
52
|
-
```
|
|
89
|
+
## 排错速查
|
|
53
90
|
|
|
54
|
-
|
|
91
|
+
| 现象 | 原因 | 解决 |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| 颜色全是默认 / 输入框无边框 / 骨架屏不动 | 漏了引入样式 | 引入 `tokens.css` + `components.css` + `css` |
|
|
94
|
+
| 工具类(`size-4`、`rounded-lg`)不生效 | 缺 `@source`,或项目不是 Tailwind v4 | 加 `@source ".../@guoyg578/k-ui/dist"`,接入 Tailwind v4 |
|
|
95
|
+
| 切换主题按钮点了没反应 | `KThemeToggleButton` 无状态 | 接 `v-model:mode` 并自行应用 `data-theme` |
|
|
96
|
+
| 暗色模式不生效 | 没设 `<html data-theme="dark">` | 自己控制该属性 |
|
|
97
|
+
| `KConfirmDialog` 不弹出 | 没在根组件挂载,或挂了多个 | 全局只挂一个 `<KConfirmDialog />` |
|
|
98
|
+
| 图标不显示 | 没装 `lucide-vue-next` | `pnpm add lucide-vue-next` |
|
|
55
99
|
|
|
56
100
|
## 备注
|
|
57
101
|
|
|
58
102
|
- 文案中文硬编码(「搜索」「确定」「暂无数据」等),需 i18n 自行替换。
|
|
59
|
-
-
|
|
103
|
+
- CSS 类与设计令牌统一用 `k-` 前缀(`k-input` / `--k-surface` …),与宿主项目自有样式一般不冲突。
|
|
@@ -26,8 +26,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
26
26
|
onClose?: (() => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
type: AlertType;
|
|
29
|
-
closable: boolean;
|
|
30
29
|
variant: "tint" | "outline";
|
|
30
|
+
closable: boolean;
|
|
31
31
|
icon: boolean;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KAlert.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KAlert.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-e5ce1f58"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s,
|
|
2
|
-
import { AlertCircle as
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, getCurrentInstance as c, normalizeClass as l, openBlock as u, ref as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, watch as g } from "vue";
|
|
2
|
+
import { AlertCircle as _, AlertTriangle as v, CheckCircle2 as y, Info as b, X as x } from "lucide-vue-next";
|
|
3
3
|
//#region components/KAlert.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var S = { class: "k-alert__body" }, C = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "k-alert__title"
|
|
7
|
-
},
|
|
7
|
+
}, w = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "k-alert__desc"
|
|
10
|
-
},
|
|
10
|
+
}, T = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "k-alert__actions"
|
|
13
|
-
},
|
|
13
|
+
}, E = /* @__PURE__ */ s({
|
|
14
14
|
__name: "KAlert",
|
|
15
15
|
props: {
|
|
16
16
|
type: { default: "info" },
|
|
@@ -28,49 +28,52 @@ var x = { class: "k-alert__body" }, S = {
|
|
|
28
28
|
modelValue: { type: Boolean }
|
|
29
29
|
},
|
|
30
30
|
emits: ["update:modelValue", "close"],
|
|
31
|
-
setup(s, { emit:
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
setup(s, { emit: E }) {
|
|
32
|
+
let D = s, O = E, k = c(), A = e(() => {
|
|
33
|
+
let e = k?.vnode.props ?? {};
|
|
34
|
+
return "modelValue" in e || "model-value" in e;
|
|
35
|
+
}), j = d(!0);
|
|
36
|
+
g(() => [
|
|
37
|
+
D.type,
|
|
38
|
+
D.title,
|
|
39
|
+
D.description
|
|
37
40
|
], () => {
|
|
38
|
-
|
|
41
|
+
A.value || (j.value = !0);
|
|
39
42
|
});
|
|
40
|
-
let
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
+
let M = e(() => A.value ? D.modelValue : j.value);
|
|
44
|
+
function N() {
|
|
45
|
+
A.value ? O("update:modelValue", !1) : j.value = !1, O("close");
|
|
43
46
|
}
|
|
44
|
-
let
|
|
45
|
-
info:
|
|
46
|
-
success:
|
|
47
|
-
warning:
|
|
48
|
-
error:
|
|
47
|
+
let P = {
|
|
48
|
+
info: b,
|
|
49
|
+
success: y,
|
|
50
|
+
warning: v,
|
|
51
|
+
error: _
|
|
49
52
|
};
|
|
50
|
-
return (e,
|
|
53
|
+
return (e, c) => M.value ? (u(), r("div", {
|
|
51
54
|
key: 0,
|
|
52
|
-
class:
|
|
55
|
+
class: l(["k-alert", [`k-alert--${s.type}`, `k-alert--${s.variant}`]]),
|
|
53
56
|
role: "alert"
|
|
54
57
|
}, [
|
|
55
|
-
s.icon ? (
|
|
58
|
+
s.icon ? (u(), t(p(P[s.type]), {
|
|
56
59
|
key: 0,
|
|
57
60
|
size: 16,
|
|
58
61
|
class: "k-alert__icon"
|
|
59
62
|
})) : n("", !0),
|
|
60
|
-
i("div",
|
|
61
|
-
s.title || e.$slots.title ? (
|
|
62
|
-
s.description || e.$slots.default ? (
|
|
63
|
-
e.$slots.actions ? (
|
|
63
|
+
i("div", S, [
|
|
64
|
+
s.title || e.$slots.title ? (u(), r("div", C, [f(e.$slots, "title", {}, () => [a(m(s.title), 1)], !0)])) : n("", !0),
|
|
65
|
+
s.description || e.$slots.default ? (u(), r("div", w, [f(e.$slots, "default", {}, () => [a(m(s.description), 1)], !0)])) : n("", !0),
|
|
66
|
+
e.$slots.actions ? (u(), r("div", T, [f(e.$slots, "actions", {}, void 0, !0)])) : n("", !0)
|
|
64
67
|
]),
|
|
65
|
-
s.closable ? (
|
|
68
|
+
s.closable ? (u(), r("button", {
|
|
66
69
|
key: 1,
|
|
67
70
|
type: "button",
|
|
68
71
|
class: "k-alert__close",
|
|
69
72
|
"aria-label": "关闭",
|
|
70
|
-
onClick:
|
|
71
|
-
}, [o(
|
|
73
|
+
onClick: N
|
|
74
|
+
}, [o(h(x), { size: 14 })])) : n("", !0)
|
|
72
75
|
], 2)) : n("", !0);
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
78
|
//#endregion
|
|
76
|
-
export {
|
|
79
|
+
export { E as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KAvatar.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KAvatar.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-14ccf4af"]]);
|
|
6
6
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KAvatarGroup.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KAvatarGroup.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-00da4b72"]]);
|
|
6
6
|
//#endregion
|
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
2
|
interface BreadcrumbItem {
|
|
3
3
|
label: string;
|
|
4
|
+
/** 链接目标(路由路径或 URL)。带 to 且非最后一项时渲染为 <a href>;
|
|
5
|
+
* 普通左键点击会被拦截并派发 item-click, 交给宿主导航(如 router.push)。 */
|
|
4
6
|
to?: string;
|
|
5
7
|
icon?: Component;
|
|
6
8
|
}
|
|
7
9
|
type __VLS_Props = {
|
|
8
10
|
items: BreadcrumbItem[];
|
|
9
11
|
};
|
|
10
|
-
declare
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
item: BreadcrumbItem;
|
|
14
|
+
index: number;
|
|
15
|
+
isLink: boolean;
|
|
16
|
+
isLast: boolean;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
item?: (props: typeof __VLS_1) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
"item-click": (payload: {
|
|
23
|
+
item: BreadcrumbItem;
|
|
24
|
+
index: number;
|
|
25
|
+
event: MouseEvent;
|
|
26
|
+
}) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
+
"onItem-click"?: ((payload: {
|
|
29
|
+
item: BreadcrumbItem;
|
|
30
|
+
index: number;
|
|
31
|
+
event: MouseEvent;
|
|
32
|
+
}) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
35
|
declare const _default: typeof __VLS_export;
|
|
12
36
|
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KBreadcrumb.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KBreadcrumb.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b6e9004a"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,38 +1,53 @@
|
|
|
1
|
-
import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c,
|
|
1
|
+
import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, renderSlot as l, resolveDynamicComponent as u, toDisplayString as d, unref as f } from "vue";
|
|
2
2
|
import { ChevronRight as p } from "lucide-vue-next";
|
|
3
|
-
import { RouterLink as m } from "vue-router";
|
|
4
3
|
//#region components/KBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
4
|
+
var m = {
|
|
6
5
|
class: "k-bread",
|
|
7
6
|
"aria-label": "面包屑"
|
|
8
|
-
}, g = /* @__PURE__ */ a({
|
|
7
|
+
}, h = ["href", "onClick"], g = ["aria-current"], _ = /* @__PURE__ */ a({
|
|
9
8
|
__name: "KBreadcrumb",
|
|
10
9
|
props: { items: {} },
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
emits: ["item-click"],
|
|
11
|
+
setup(a, { emit: _ }) {
|
|
12
|
+
let v = a, y = _;
|
|
13
|
+
function b(e, t) {
|
|
14
|
+
return !!e.to && t < v.items.length - 1;
|
|
15
|
+
}
|
|
16
|
+
function x(e, t, n) {
|
|
17
|
+
n.defaultPrevented || n.button !== 0 || n.metaKey || n.ctrlKey || n.shiftKey || n.altKey || (n.preventDefault(), y("item-click", {
|
|
18
|
+
item: e,
|
|
19
|
+
index: t,
|
|
20
|
+
event: n
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
return (_, v) => (s(), r("nav", m, [(s(!0), r(e, null, c(a.items, (c, m) => (s(), r(e, { key: m }, [l(_.$slots, "item", {
|
|
24
|
+
item: c,
|
|
25
|
+
index: m,
|
|
26
|
+
isLink: b(c, m),
|
|
27
|
+
isLast: m === a.items.length - 1
|
|
28
|
+
}, () => [b(c, m) ? (s(), r("a", {
|
|
13
29
|
key: 0,
|
|
14
|
-
|
|
15
|
-
class: "k-bread__item k-bread__item--link"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_: 2
|
|
23
|
-
}, 1032, ["to"])) : (s(), r("span", {
|
|
30
|
+
href: c.to,
|
|
31
|
+
class: "k-bread__item k-bread__item--link",
|
|
32
|
+
onClick: (e) => x(c, m, e)
|
|
33
|
+
}, [c.icon ? (s(), t(u(c.icon), {
|
|
34
|
+
key: 0,
|
|
35
|
+
size: 13,
|
|
36
|
+
class: "k-bread__icon"
|
|
37
|
+
})) : n("", !0), i(" " + d(c.label), 1)], 8, h)) : (s(), r("span", {
|
|
24
38
|
key: 1,
|
|
25
|
-
class: o(["k-bread__item", { "k-bread__item--last":
|
|
26
|
-
|
|
39
|
+
class: o(["k-bread__item", { "k-bread__item--last": m === a.items.length - 1 }]),
|
|
40
|
+
"aria-current": m === a.items.length - 1 ? "page" : void 0
|
|
41
|
+
}, [c.icon ? (s(), t(u(c.icon), {
|
|
27
42
|
key: 0,
|
|
28
43
|
size: 13,
|
|
29
44
|
class: "k-bread__icon"
|
|
30
|
-
})) : n("", !0), i(" " +
|
|
31
|
-
key:
|
|
45
|
+
})) : n("", !0), i(" " + d(c.label), 1)], 10, g))], !0), m < a.items.length - 1 ? (s(), t(f(p), {
|
|
46
|
+
key: 0,
|
|
32
47
|
size: 14,
|
|
33
48
|
class: "k-bread__sep"
|
|
34
49
|
})) : n("", !0)], 64))), 128))]));
|
|
35
50
|
}
|
|
36
51
|
});
|
|
37
52
|
//#endregion
|
|
38
|
-
export {
|
|
53
|
+
export { _ as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type KButtonType = 'primary' | '
|
|
2
|
-
type KButtonSize = 'sm' | 'md' | 'lg';
|
|
1
|
+
type KButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'error' | 'danger' | 'secondary' | 'ghost';
|
|
2
|
+
type KButtonSize = 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
type?: KButtonType;
|
|
5
5
|
size?: KButtonSize;
|
|
@@ -7,6 +7,14 @@ type __VLS_Props = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
block?: boolean;
|
|
9
9
|
nativeType?: 'button' | 'submit' | 'reset';
|
|
10
|
+
quaternary?: boolean;
|
|
11
|
+
tertiary?: boolean;
|
|
12
|
+
text?: boolean;
|
|
13
|
+
secondary?: boolean;
|
|
14
|
+
ghost?: boolean;
|
|
15
|
+
circle?: boolean;
|
|
16
|
+
round?: boolean;
|
|
17
|
+
color?: string;
|
|
10
18
|
};
|
|
11
19
|
declare var __VLS_6: {}, __VLS_8: {};
|
|
12
20
|
type __VLS_Slots = {} & {
|
|
@@ -19,12 +27,19 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
19
27
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
28
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
21
29
|
}>, {
|
|
30
|
+
secondary: boolean;
|
|
31
|
+
ghost: boolean;
|
|
22
32
|
type: KButtonType;
|
|
23
33
|
size: KButtonSize;
|
|
24
34
|
loading: boolean;
|
|
25
35
|
disabled: boolean;
|
|
26
36
|
block: boolean;
|
|
27
37
|
nativeType: "button" | "submit" | "reset";
|
|
38
|
+
quaternary: boolean;
|
|
39
|
+
tertiary: boolean;
|
|
40
|
+
text: boolean;
|
|
41
|
+
circle: boolean;
|
|
42
|
+
round: boolean;
|
|
28
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
45
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./KButton.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
/* empty css
|
|
2
|
+
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
//#region components/KButton.vue
|
|
5
|
-
var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-e72ea9f3"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, defineComponent as i, normalizeClass as a,
|
|
2
|
-
import { Loader2 as
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderSlot as c, unref as l } from "vue";
|
|
2
|
+
import { Loader2 as u } from "lucide-vue-next";
|
|
3
3
|
//#region components/KButton.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var d = ["type", "disabled"], f = /* @__PURE__ */ i({
|
|
5
5
|
__name: "KButton",
|
|
6
6
|
props: {
|
|
7
|
-
type: { default: "
|
|
7
|
+
type: { default: "default" },
|
|
8
8
|
size: { default: "md" },
|
|
9
9
|
loading: {
|
|
10
10
|
type: Boolean,
|
|
@@ -18,33 +18,67 @@ var u = ["type", "disabled"], d = /* @__PURE__ */ i({
|
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: !1
|
|
20
20
|
},
|
|
21
|
-
nativeType: { default: "button" }
|
|
21
|
+
nativeType: { default: "button" },
|
|
22
|
+
quaternary: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
tertiary: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
text: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
secondary: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
ghost: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
circle: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
round: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
color: {}
|
|
22
51
|
},
|
|
23
52
|
emits: ["click"],
|
|
24
53
|
setup(i) {
|
|
25
|
-
let
|
|
26
|
-
return (e,
|
|
54
|
+
let f = i, p = e(() => f.size === "tiny" || f.size === "xs" ? "xs" : f.size === "small" || f.size === "sm" ? "sm" : f.size === "large" || f.size === "lg" ? "lg" : "md"), m = e(() => f.type === "danger" || f.type === "error" ? "error" : f.type === "secondary" || f.type === "ghost" ? "default" : f.type), h = e(() => f.text ? "text" : f.quaternary || f.ghost || f.type === "ghost" ? "ghost" : f.tertiary || f.secondary ? "soft" : f.type === "secondary" ? "outline" : "solid"), g = e(() => p.value === "xs" || p.value === "sm" ? 12 : p.value === "lg" ? 16 : 14), _ = e(() => f.color ? { "--k-btn-custom": f.color } : void 0);
|
|
55
|
+
return (e, f) => (s(), r("button", {
|
|
27
56
|
type: i.nativeType,
|
|
28
57
|
disabled: i.disabled || i.loading,
|
|
29
58
|
class: a(["k-btn", [
|
|
30
|
-
`k-btn--${
|
|
31
|
-
`k-btn--${
|
|
59
|
+
`k-btn--${m.value}`,
|
|
60
|
+
`k-btn--${h.value}`,
|
|
61
|
+
`k-btn--${p.value}`,
|
|
32
62
|
{
|
|
33
63
|
"k-btn--block": i.block,
|
|
34
|
-
"k-btn--loading": i.loading
|
|
64
|
+
"k-btn--loading": i.loading,
|
|
65
|
+
"k-btn--circle": i.circle,
|
|
66
|
+
"k-btn--round": i.round,
|
|
67
|
+
"k-btn--custom": i.color
|
|
35
68
|
}
|
|
36
69
|
]]),
|
|
37
|
-
|
|
70
|
+
style: o(_.value),
|
|
71
|
+
onClick: f[0] ||= (t) => e.$emit("click", t)
|
|
38
72
|
}, [
|
|
39
|
-
i.loading ? (
|
|
73
|
+
i.loading ? (s(), t(l(u), {
|
|
40
74
|
key: 0,
|
|
41
|
-
size:
|
|
75
|
+
size: g.value,
|
|
42
76
|
class: "k-btn__spinner"
|
|
43
77
|
}, null, 8, ["size"])) : n("", !0),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
],
|
|
78
|
+
c(e.$slots, "icon", {}, void 0, !0),
|
|
79
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
80
|
+
], 14, d));
|
|
47
81
|
}
|
|
48
82
|
});
|
|
49
83
|
//#endregion
|
|
50
|
-
export {
|
|
84
|
+
export { f as default };
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
hoverable?: boolean;
|
|
7
7
|
bodyClass?: string;
|
|
8
8
|
};
|
|
9
|
-
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {};
|
|
9
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_11: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
11
|
title?: (props: typeof __VLS_1) => any;
|
|
12
12
|
} & {
|
|
@@ -14,9 +14,11 @@ type __VLS_Slots = {} & {
|
|
|
14
14
|
} & {
|
|
15
15
|
actions?: (props: typeof __VLS_5) => any;
|
|
16
16
|
} & {
|
|
17
|
-
|
|
17
|
+
'header-extra'?: (props: typeof __VLS_7) => any;
|
|
18
18
|
} & {
|
|
19
|
-
|
|
19
|
+
default?: (props: typeof __VLS_9) => any;
|
|
20
|
+
} & {
|
|
21
|
+
footer?: (props: typeof __VLS_11) => any;
|
|
20
22
|
};
|
|
21
23
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
22
24
|
bordered: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCard.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KCard.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-31c11daf"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -36,11 +36,11 @@ var l = {
|
|
|
36
36
|
"k-card--bordered": i.bordered,
|
|
37
37
|
"k-card--hoverable": i.hoverable
|
|
38
38
|
}]]) }, [
|
|
39
|
-
i.title || h.$slots.title || h.$slots.header || h.$slots.actions ? (o(), t("header", l, [n("div", u, [
|
|
39
|
+
i.title || h.$slots.title || h.$slots.header || h.$slots.actions || h.$slots["header-extra"] ? (o(), t("header", l, [n("div", u, [
|
|
40
40
|
i.title || h.$slots.title ? (o(), t("h3", d, [s(h.$slots, "title", {}, () => [r(c(i.title), 1)], !0)])) : e("", !0),
|
|
41
41
|
i.subtitle ? (o(), t("p", f, c(i.subtitle), 1)) : e("", !0),
|
|
42
42
|
s(h.$slots, "header", {}, void 0, !0)
|
|
43
|
-
]), h.$slots.actions ? (o(), t("div", p, [s(h.$slots, "actions", {}, void 0, !0)])) : e("", !0)])) : e("", !0),
|
|
43
|
+
]), h.$slots.actions || h.$slots["header-extra"] ? (o(), t("div", p, [s(h.$slots, "actions", {}, () => [s(h.$slots, "header-extra", {}, void 0, !0)], !0)])) : e("", !0)])) : e("", !0),
|
|
44
44
|
n("div", { class: a(["k-card__body", i.bodyClass]) }, [s(h.$slots, "default", {}, void 0, !0)], 2),
|
|
45
45
|
h.$slots.footer ? (o(), t("footer", m, [s(h.$slots, "footer", {}, void 0, !0)])) : e("", !0)
|
|
46
46
|
], 2));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCarousel.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KCarousel.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-173fae98"]]);
|
|
6
6
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KCheckbox.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-17c1bf53"]]);
|
|
6
6
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCheckboxGroup.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KCheckboxGroup.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0188db2b"]]);
|
|
6
6
|
//#endregion
|