savor-ui 0.12.0 → 0.12.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/CHANGELOG.md +20 -0
- package/README.md +45 -11
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/menu/sub-menu.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -1
- package/dist/es/components/src/modal/modal.vue_vue_type_script_setup_true_vapor_true_lang.mjs +79 -77
- package/dist/es/components/src/segmented/segmented.vue_vue_type_script_setup_true_vapor_true_lang.mjs +8 -5
- package/dist/es/components/src/steps/index.d.ts +1 -1
- package/dist/es/components/src/steps/index.mjs +1 -1
- package/dist/es/components/src/switch/switch.vue_vue_type_script_setup_true_vapor_true_lang.mjs +8 -5
- package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs +56 -44
- package/dist/es/core/components.mjs +1 -1
- package/dist/es/core/global.d.ts +1 -1
- package/dist/es/core/index.mjs +2 -2
- package/dist/json/web-types.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [0.12.2](https://gitee.com/mach552/savor-ui/compare/v0.12.1...v0.12.2) (2026-07-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **segmented:** 修复默认值错误赋值为false的问题 ([ab153ae](https://gitee.com/mach552/savor-ui/commits/ab153ae99cfa690b535c40bb7fe6ff4f02085245))
|
|
11
|
+
* **steps:** 修复组件导出名称错误问题 ([6a61ac4](https://gitee.com/mach552/savor-ui/commits/6a61ac4045b24ba8576842cba5cec04a332fc77b))
|
|
12
|
+
* **switch:** 修复默认值错误赋值为false的问题 ([1d2e43e](https://gitee.com/mach552/savor-ui/commits/1d2e43ec434caf5b93bc7c2f8f780cdf8c80f4db))
|
|
13
|
+
* **table:** 修复插槽列的`align`属性失效问题 ([fbab17f](https://gitee.com/mach552/savor-ui/commits/fbab17fc24cbff58cb8cfd3eadc3512f07333b53))
|
|
14
|
+
|
|
15
|
+
## [0.12.1](https://gitee.com/mach552/savor-ui/compare/v0.12.0...v0.12.1) (2026-07-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **cascader:** 修复类型错误 ([84cd4a2](https://gitee.com/mach552/savor-ui/commits/84cd4a23c677746fa75446b00b66b9b76081f1d9))
|
|
21
|
+
* **menu:** 修复菜单的level错误问题 ([e956f57](https://gitee.com/mach552/savor-ui/commits/e956f573138984ce39af1ded97bc3ff9abb7f6a0))
|
|
22
|
+
* **modal:** 修复过渡组件报无子元素警告的问题 ([0e29418](https://gitee.com/mach552/savor-ui/commits/0e29418a85cd27f08b77cfbf9ed9ba9fe078f463))
|
|
23
|
+
* **modal:** 修复内容尺寸变化不居中的问题 ([0cb4e66](https://gitee.com/mach552/savor-ui/commits/0cb4e665a027cb5814b24c734516c450ff6aa3f6))
|
|
24
|
+
|
|
5
25
|
# [0.12.0](https://gitee.com/mach552/savor-ui/compare/v0.11.0...v0.12.0) (2026-07-15)
|
|
6
26
|
|
|
7
27
|
|
package/README.md
CHANGED
|
@@ -1,39 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
# savor-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 Vue3 Vapor 模式打造的轻量自用 UI 组件库
|
|
4
|
+
|
|
5
|
+
**savor-ui** 是一款轻量级 UI 组件库,专为 **Vue Vapor 编译模式** 设计,针对性适配 Vapor 编译特性,全部采用**组合式 Api**编写,主打轻量化、高性能、高定制化,适配现代前端工程化开发场景。
|
|
6
|
+
|
|
7
|
+
本组件库为个人自用开源组件库,整合多款主流优秀 Vue UI 组件库的设计思路与交互逻辑,优化适配 Vapor 专属编译规则,保留简洁易用的开发体验,同时支持灵活的主题自定义能力,满足日常后台系统、中后台业务页面开发需求。
|
|
8
|
+
|
|
9
|
+
- **专属适配**:仅支持 Vue3 Vapor 编译模式,不兼容 Runtime 模式,深度适配 Vapor 编译优化特性,打包体积更小、运行性能更高
|
|
10
|
+
|
|
11
|
+
- **轻量高效**:组件轻量化封装,无冗余依赖,按需加载友好,适配现代化工程化项目
|
|
12
|
+
|
|
13
|
+
- **主题定制**:内置完整明暗主题体系,支持全局一键主题切换、主色自定义、样式灵活覆盖
|
|
14
|
+
|
|
15
|
+
- **规范统一**:参考主流企业级组件库设计规范,交互逻辑统一,降低开发上手成本
|
|
16
|
+
|
|
17
|
+
项目部分组件设计、交互逻辑、主题配置方案参考以下业界优秀开源组件库,特此致谢!
|
|
18
|
+
|
|
19
|
+
- [Element Plus](https://cn.element-plus.org/):Vue3 主流企业级组件库,成熟的组件交互与设计体系
|
|
20
|
+
|
|
21
|
+
- [Arco Design Vue](https://arco.design/vue):字节跳动出品,优秀的按需加载、主题配置与工程化适配方案
|
|
22
|
+
|
|
23
|
+
- [Antdv Next](https://www.antdv-next.cn/index-cn):参考 Ant Design v6 设计规范,灵活的主题算法与现代化 UI 设计
|
|
24
|
+
|
|
25
|
+
- [Naive UI](https://www.naiveui.com/zh-CN):高质量、类型完备的 Vue3 组件库,严谨的组件设计逻辑
|
|
26
|
+
|
|
27
|
+
- [Prime Vue](https://primevue.dev/):功能丰富的跨端 UI 组件库,多样化业务组件交互参考
|
|
28
|
+
|
|
29
|
+
- [Vexip UI](https://www.vexipui.com/):轻量化、高自定义的 Vue3 组件库设计思路
|
|
4
30
|
|
|
5
31
|
## 快速开始
|
|
6
32
|
|
|
7
|
-
|
|
33
|
+
[文档地址](http://122.51.220.99:12121/)
|
|
34
|
+
|
|
35
|
+
适配 Vue3 最新 Vapor 编译模式,最低版本要求:
|
|
8
36
|
|
|
9
|
-
vue >= 3.6.0-beta.11
|
|
37
|
+
`vue >= 3.6.0-beta.11`
|
|
10
38
|
|
|
11
|
-
|
|
39
|
+
**注意**:本组件库**仅支持 Vue Vapor 编译模式**,不支持 IE 浏览器及传统 Vue3 Runtime 编译模式。
|
|
40
|
+
|
|
41
|
+
推荐使用 `pnpm` 安装(极速、节省磁盘空间)
|
|
12
42
|
|
|
13
43
|
```shell
|
|
14
44
|
pnpm add savor-ui
|
|
15
45
|
```
|
|
16
46
|
|
|
17
|
-
|
|
47
|
+
在项目入口文件全局引入组件库及样式,完成全局注册:
|
|
18
48
|
|
|
19
49
|
```ts
|
|
20
50
|
import { createVaporApp } from "vue";
|
|
21
51
|
import App from "./App.vue";
|
|
22
52
|
import SavorUI from "savor-ui";
|
|
23
53
|
|
|
54
|
+
// 引入组件库全局主题样式
|
|
24
55
|
import "savor-ui/theme/index.scss";
|
|
25
56
|
|
|
26
57
|
const app = createVaporApp(App);
|
|
58
|
+
// 全局注册所有 SavorUI 组件
|
|
27
59
|
app.use(SavorUI);
|
|
28
60
|
app.mount("#app");
|
|
29
61
|
```
|
|
30
62
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
主题可以通过使用 `s-config-provider` 组件调整。
|
|
63
|
+
组件库内置明暗两套主题,通过 `s-config-provider` 全局配置组件实现**全局主题、主色值自定义**,支持动态切换主题:
|
|
34
64
|
|
|
35
65
|
```html
|
|
36
66
|
<template>
|
|
67
|
+
<!-- 全局主题配置包裹根路由,全局生效 -->
|
|
37
68
|
<s-config-provider :theme="theme">
|
|
38
69
|
<VaporRouterView />
|
|
39
70
|
</s-config-provider>
|
|
@@ -43,12 +74,15 @@ app.mount("#app");
|
|
|
43
74
|
import { reactive } from "vue";
|
|
44
75
|
import { VaporRouterView } from "vue-router";
|
|
45
76
|
|
|
77
|
+
// 自定义明暗主题主色及配置
|
|
46
78
|
const theme = reactive({
|
|
79
|
+
// 亮色主题配置
|
|
47
80
|
lightTheme: {
|
|
48
|
-
colorPrimary: "#1890ff",
|
|
81
|
+
colorPrimary: "#1890ff", // 全局主色
|
|
49
82
|
},
|
|
83
|
+
// 暗色主题配置
|
|
50
84
|
darkTheme: {
|
|
51
|
-
colorPrimary: "#1890ff",
|
|
85
|
+
colorPrimary: "#1890ff", // 全局主色
|
|
52
86
|
},
|
|
53
87
|
});
|
|
54
88
|
</script>
|
package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -115,7 +115,7 @@ var k = /*@__PURE__*/ p({
|
|
|
115
115
|
if (h.pathMode && typeof A.value == "string") {
|
|
116
116
|
let t = A.value.split(h.pathSeparator);
|
|
117
117
|
e = X(h.options, t);
|
|
118
|
-
} else e = Y(h.options, A.value);
|
|
118
|
+
} else Array.isArray(A.value) || (e = Y(h.options, A.value));
|
|
119
119
|
e && (F.value = e.map((e) => e[L.value.key]), I.value = e, R.value = V(e));
|
|
120
120
|
}, Q = (e) => {
|
|
121
121
|
A.value === void 0 ? e.forEach((e) => {
|
package/dist/es/components/src/menu/sub-menu.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -58,7 +58,7 @@ var P = /*@__PURE__*/ m({
|
|
|
58
58
|
}), A(() => I?.openKeys.value || [], (e) => {
|
|
59
59
|
e && e.length > 0 && (B.value = e.includes(E.name));
|
|
60
60
|
}, { immediate: !0 }), y(() => {
|
|
61
|
-
F.value?.style.setProperty("--s-menu-level", `${z}`), L?.registerDescendant(E.name);
|
|
61
|
+
F.value?.style.setProperty("--s-menu-level", `${z.value}`), L?.registerDescendant(E.name);
|
|
62
62
|
}), b(o, { level: z }), b(s, {
|
|
63
63
|
registerDescendant: (e) => {
|
|
64
64
|
V.value.add(e), L?.registerDescendant(e);
|
package/dist/es/components/src/modal/modal.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -2,25 +2,25 @@ import { getSize as e } from "../../../utils/src/tool.mjs";
|
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { useDrag as t } from "../../../hooks/src/use-drag.mjs";
|
|
4
4
|
import { useNamespace as n } from "../../../hooks/src/use-namespace.mjs";
|
|
5
|
-
import { useResizeObserver as
|
|
6
|
-
import { useScrollHidden as
|
|
7
|
-
import { useZIndex as
|
|
5
|
+
import { useResizeObserver as r } from "../../../hooks/src/use-resize-observer.mjs";
|
|
6
|
+
import { useScrollHidden as ee } from "../../../hooks/src/use-scroll-hidden.mjs";
|
|
7
|
+
import { useZIndex as te } from "../../../hooks/src/use-zIndex.mjs";
|
|
8
8
|
import "../../../hooks/index.mjs";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import ne from "../../../icons/src/close.vue.mjs";
|
|
10
|
+
import re from "../../../icons/src/fullscreen-exit.vue.mjs";
|
|
11
|
+
import ie from "../../../icons/src/fullscreen.vue.mjs";
|
|
12
12
|
import "../../../icons/index.mjs";
|
|
13
|
-
import { SScrollbar as
|
|
14
|
-
import { SButton as
|
|
15
|
-
import { STransition as
|
|
16
|
-
import { VaporTeleport as
|
|
13
|
+
import { SScrollbar as ae } from "../scrollbar/index.mjs";
|
|
14
|
+
import { SButton as i } from "../button/index.mjs";
|
|
15
|
+
import { STransition as a } from "../transition/index.mjs";
|
|
16
|
+
import { VaporTeleport as oe, applyVShow as o, child as s, computed as c, createComponent as l, createIf as u, createInvoker as se, createSlot as d, createTemplateRefSetter as ce, defineVaporComponent as f, delegateEvents as p, mergeModels as m, next as h, nextTick as g, onUnmounted as le, ref as _, renderEffect as v, setClass as y, setInsertionState as b, setStyle as x, setText as S, template as C, toDisplayString as w, unref as T, useModel as E, useTemplateRef as D, watch as O, watchEffect as ue } from "vue";
|
|
17
17
|
//#region ../components/src/modal/modal.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
18
|
-
var k =
|
|
19
|
-
|
|
20
|
-
var M = /*@__PURE__*/
|
|
18
|
+
var k = C("<div>"), A = C(" "), de = C("<div><div></div><div></div>"), j = C("<div style=\"flex: 1; overflow: hidden; display: flex; flex-direction: column\">"), fe = C("<div><div>");
|
|
19
|
+
p("click");
|
|
20
|
+
var M = /*@__PURE__*/ f({
|
|
21
21
|
name: "SModal",
|
|
22
22
|
__name: "modal",
|
|
23
|
-
props: /*@__PURE__*/
|
|
23
|
+
props: /*@__PURE__*/ m({
|
|
24
24
|
modalValue: { type: Boolean },
|
|
25
25
|
width: { default: "0px" },
|
|
26
26
|
height: {},
|
|
@@ -82,33 +82,35 @@ var M = /*@__PURE__*/ m({
|
|
|
82
82
|
},
|
|
83
83
|
modelModifiers: {}
|
|
84
84
|
}),
|
|
85
|
-
emits: /*@__PURE__*/
|
|
85
|
+
emits: /*@__PURE__*/ m([
|
|
86
86
|
"close",
|
|
87
87
|
"closed",
|
|
88
88
|
"opened",
|
|
89
89
|
"confirm"
|
|
90
90
|
], ["update:modelValue"]),
|
|
91
|
-
setup(
|
|
92
|
-
let
|
|
93
|
-
|
|
91
|
+
setup(f, { expose: p, emit: m }) {
|
|
92
|
+
let C = f, M = m, N = n("modal"), { lockScroll: pe, unlockScroll: P } = ee(), { nextZIndex: me } = te(), F = _(0), I = D("modalRef"), L = D("headerRef"), R = E(f, "modelValue"), z = _(!1), B = _(!1), V = _(!1), H = _(!1), U = _(0), W = _(0), G = _(!1), K = _(0), q = _(0), J = c(() => typeof C.to == "string" ? document.querySelector(C.to) || document.body : C.to);
|
|
93
|
+
r(J, () => {
|
|
94
94
|
let e = J.value;
|
|
95
95
|
K.value = e.clientHeight, q.value = e.clientWidth, Q();
|
|
96
|
+
}), r(I, () => {
|
|
97
|
+
z.value && Q();
|
|
96
98
|
});
|
|
97
|
-
let he =
|
|
99
|
+
let he = c(() => ({
|
|
98
100
|
zIndex: F.value,
|
|
99
|
-
position:
|
|
100
|
-
})), ge =
|
|
101
|
-
width: e(
|
|
102
|
-
height: e(
|
|
101
|
+
position: C.to === "body" ? "fixed" : "absolute"
|
|
102
|
+
})), ge = c(() => V.value ? {} : {
|
|
103
|
+
width: e(C.width),
|
|
104
|
+
height: e(C.height),
|
|
103
105
|
top: `${U.value}px`,
|
|
104
106
|
left: `${W.value}px`,
|
|
105
|
-
...
|
|
107
|
+
...C.modalStyle
|
|
106
108
|
}), _e = () => {
|
|
107
109
|
M("opened");
|
|
108
110
|
}, ve = () => {
|
|
109
|
-
B.value = !1, H.value = !1, G.value = !1, M("closed"),
|
|
111
|
+
B.value = !1, H.value = !1, G.value = !1, M("closed"), g(P);
|
|
110
112
|
}, ye = () => {
|
|
111
|
-
|
|
113
|
+
C.closeOnOverlayClick && X();
|
|
112
114
|
}, be = (e) => {
|
|
113
115
|
e ? R.value = !1 : H.value = !1;
|
|
114
116
|
}, Y = () => {
|
|
@@ -118,117 +120,117 @@ var M = /*@__PURE__*/ m({
|
|
|
118
120
|
}, xe = () => {
|
|
119
121
|
V.value = !V.value;
|
|
120
122
|
};
|
|
121
|
-
O(() =>
|
|
123
|
+
O(() => C.fullscreen, (e) => V.value = e, { immediate: !0 });
|
|
122
124
|
let Z = (e) => {
|
|
123
|
-
e.key === "Escape" &&
|
|
125
|
+
e.key === "Escape" && C.closeOnEsc && z.value && X();
|
|
124
126
|
}, Q = async () => {
|
|
125
|
-
if (await
|
|
127
|
+
if (await g(), !I.value || G.value) return;
|
|
126
128
|
let e = I.value;
|
|
127
|
-
|
|
129
|
+
C.center ? U.value = Math.max(0, (K.value - e.offsetHeight) / 2) : U.value = C.offset, W.value = Math.max(0, (q.value - e.offsetWidth) / 2);
|
|
128
130
|
};
|
|
129
131
|
O(() => R.value, async (e) => {
|
|
130
|
-
e ? (F.value = me(), pe(), B.value = !0, await
|
|
132
|
+
e ? (F.value = me(), pe(), B.value = !0, await g(), z.value = !0, Q()) : z.value = !1;
|
|
131
133
|
}, { immediate: !0 }), ue((e) => {
|
|
132
134
|
z.value && (document.addEventListener("keydown", Z), e(() => document.removeEventListener("keydown", Z)));
|
|
133
135
|
}), t({
|
|
134
136
|
container: I,
|
|
135
137
|
target: L,
|
|
136
138
|
parent: J,
|
|
137
|
-
enable:
|
|
139
|
+
enable: c(() => C.draggable && !V.value),
|
|
138
140
|
divLeft: W,
|
|
139
141
|
divTop: U,
|
|
140
142
|
hasDragged: G
|
|
141
|
-
}),
|
|
143
|
+
}), le(() => {
|
|
142
144
|
P();
|
|
143
|
-
}),
|
|
144
|
-
let $ =
|
|
145
|
-
return
|
|
146
|
-
to: () =>
|
|
145
|
+
}), p({ handleClose: X });
|
|
146
|
+
let $ = ce();
|
|
147
|
+
return l(oe, {
|
|
148
|
+
to: () => f.to,
|
|
147
149
|
defer: ""
|
|
148
150
|
}, () => {
|
|
149
|
-
let e = fe(), t =
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
}),
|
|
151
|
+
let e = fe(), t = s(e, 1);
|
|
152
|
+
return v(() => {
|
|
153
|
+
y(e, [T(N).e("container")]), x(e, he.value);
|
|
154
|
+
}), b(e, 0, 0), l(T(a), { type: "opacity" }, () => u(() => f.mask, () => {
|
|
153
155
|
let e = k();
|
|
154
|
-
return e.$evtclick =
|
|
155
|
-
|
|
156
|
+
return o(e, () => z.value), e.$evtclick = se(ye), v(() => {
|
|
157
|
+
x(e, f.maskStyle), y(e, [T(N).e("mask")]);
|
|
156
158
|
}), e;
|
|
157
|
-
}, null, 129)),
|
|
159
|
+
}, null, 129)), v(() => y(t, [T(N).e("wrapper")])), b(t, null, 0), l(T(a), {
|
|
158
160
|
type: "scale",
|
|
159
161
|
onAfterLeave: () => ve,
|
|
160
162
|
onAfterEnter: () => _e
|
|
161
163
|
}, () => {
|
|
162
164
|
let e = k();
|
|
163
|
-
return
|
|
164
|
-
let t =
|
|
165
|
-
|
|
165
|
+
return v(() => {
|
|
166
|
+
let t = T(N);
|
|
167
|
+
y(e, [
|
|
166
168
|
t.b(),
|
|
167
|
-
t.is("drag",
|
|
169
|
+
t.is("drag", f.draggable),
|
|
168
170
|
t.is("fullscreen", V.value),
|
|
169
|
-
|
|
170
|
-
]),
|
|
171
|
-
}),
|
|
172
|
-
let e = de(), t =
|
|
173
|
-
return
|
|
174
|
-
let n =
|
|
175
|
-
|
|
176
|
-
}),
|
|
171
|
+
f.className
|
|
172
|
+
]), x(e, ge.value);
|
|
173
|
+
}), b(e, null, 0), u(() => f.header, () => {
|
|
174
|
+
let e = de(), t = s(e), n = h(t, 1);
|
|
175
|
+
return v(() => {
|
|
176
|
+
let n = T(N);
|
|
177
|
+
y(e, [n.e("header")]), y(t, [n.e("title")]);
|
|
178
|
+
}), b(t, null, 0), d("header", null, () => {
|
|
177
179
|
let e = A();
|
|
178
|
-
return
|
|
179
|
-
}),
|
|
180
|
+
return v(() => S(e, w(f.title))), e;
|
|
181
|
+
}), v(() => y(n, [T(N).e("header-icon")])), b(n, null, 0), u(() => f.fullable, () => l(T(i), {
|
|
180
182
|
text: "",
|
|
181
183
|
size: "small",
|
|
182
184
|
onClick: () => xe
|
|
183
|
-
}, { icon: () =>
|
|
185
|
+
}, { icon: () => u(() => V.value, () => l(T(re)), () => l(T(ie)), 645) })), b(n, null, 1), u(() => f.closable, () => l(T(i), {
|
|
184
186
|
text: "",
|
|
185
187
|
size: "small",
|
|
186
188
|
circle: "",
|
|
187
189
|
onClick: () => X
|
|
188
|
-
}, { icon: () =>
|
|
189
|
-
}),
|
|
190
|
+
}, { icon: () => l(T(ne)) })), $(e, L, null, "headerRef"), e;
|
|
191
|
+
}), b(e, null, 1), u(() => !f.scrollContent, () => {
|
|
190
192
|
let e = k();
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
+
return v(() => {
|
|
194
|
+
y(e, [T(N).e("body")]), x(e, {
|
|
193
195
|
padding: "16px",
|
|
194
|
-
...
|
|
196
|
+
...f.bodyStyle
|
|
195
197
|
});
|
|
196
|
-
}),
|
|
198
|
+
}), b(e, null, 0), d("default", null, () => {
|
|
197
199
|
let e = A();
|
|
198
|
-
return
|
|
200
|
+
return v(() => S(e, w(f.content))), e;
|
|
199
201
|
}), e;
|
|
200
202
|
}, () => {
|
|
201
203
|
let e = j();
|
|
202
|
-
return
|
|
204
|
+
return b(e, null, 0), l(T(ae), { $: [() => ({
|
|
203
205
|
padding: "16px",
|
|
204
|
-
...
|
|
205
|
-
})] }, () =>
|
|
206
|
+
...f.scrollbarProps
|
|
207
|
+
})] }, () => d("default", null, () => {
|
|
206
208
|
let e = A();
|
|
207
|
-
return
|
|
209
|
+
return v(() => S(e, w(f.content))), e;
|
|
208
210
|
}, 4)), e;
|
|
209
|
-
}, 1541),
|
|
211
|
+
}, 1541), b(e, null, 2), u(() => f.footer, () => {
|
|
210
212
|
let e = k();
|
|
211
|
-
return
|
|
213
|
+
return v(() => y(e, [T(N).e("footer")])), b(e, null, 0), d("footer", null, () => u(() => f.btnReverse, () => [l(T(i), {
|
|
212
214
|
label: "确定",
|
|
213
215
|
loading: () => H.value,
|
|
214
216
|
type: "primary",
|
|
215
217
|
onClick: () => Y
|
|
216
|
-
}),
|
|
218
|
+
}), l(T(i), {
|
|
217
219
|
label: "取消",
|
|
218
220
|
secondary: "",
|
|
219
221
|
onClick: () => X
|
|
220
|
-
})], () => [
|
|
222
|
+
})], () => [l(T(i), {
|
|
221
223
|
label: "取消",
|
|
222
224
|
secondary: "",
|
|
223
225
|
onClick: () => X
|
|
224
|
-
}),
|
|
226
|
+
}), l(T(i), {
|
|
225
227
|
label: "确定",
|
|
226
228
|
loading: () => H.value,
|
|
227
229
|
type: "primary",
|
|
228
230
|
onClick: () => Y
|
|
229
231
|
})], 1930)), e;
|
|
230
|
-
}),
|
|
231
|
-
}),
|
|
232
|
+
}), o(e, () => z.value), $(e, I, null, "modalRef"), e;
|
|
233
|
+
}), o(e, () => B.value), e;
|
|
232
234
|
}, !0);
|
|
233
235
|
}
|
|
234
236
|
});
|
|
@@ -15,11 +15,14 @@ var O = /*@__PURE__*/ c({
|
|
|
15
15
|
value: "value",
|
|
16
16
|
disabled: "disabled"
|
|
17
17
|
}) },
|
|
18
|
-
defaultValue: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
defaultValue: {
|
|
19
|
+
type: [
|
|
20
|
+
String,
|
|
21
|
+
Number,
|
|
22
|
+
Boolean
|
|
23
|
+
],
|
|
24
|
+
default: void 0
|
|
25
|
+
},
|
|
23
26
|
size: {},
|
|
24
27
|
block: { type: Boolean }
|
|
25
28
|
}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicProps, VNode, Plugin } from 'vue';
|
|
2
2
|
import { StepsItemProps } from './types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const SSteps: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
4
|
attrs: any;
|
|
5
5
|
slots: {};
|
|
6
6
|
emit: ((evt: "change", index: number) => void) & ((event: "update:current", value: number) => void);
|
package/dist/es/components/src/switch/switch.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -14,11 +14,14 @@ var j = /*@__PURE__*/ c({
|
|
|
14
14
|
String,
|
|
15
15
|
Number
|
|
16
16
|
] },
|
|
17
|
-
defaultValue: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
defaultValue: {
|
|
18
|
+
type: [
|
|
19
|
+
Boolean,
|
|
20
|
+
String,
|
|
21
|
+
Number
|
|
22
|
+
],
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
22
25
|
disabled: { type: Boolean },
|
|
23
26
|
activeValue: {
|
|
24
27
|
type: [
|
package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -5,12 +5,13 @@ import "../../../hooks/index.mjs";
|
|
|
5
5
|
import r from "../../../icons/src/right.vue.mjs";
|
|
6
6
|
import "../../../icons/index.mjs";
|
|
7
7
|
import { STooltip as i } from "../tooltip/index.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { SCheckbox as a } from "../checkbox/index.mjs";
|
|
9
|
+
import { tableContextKey as o } from "./types.mjs";
|
|
10
|
+
import { child as s, computed as c, createComponent as l, createFor as u, createIf as d, createInvoker as f, createSlot as p, createTemplateRefSetter as m, defineVaporComponent as h, delegateEvents as g, inject as _, nextTick as v, ref as y, renderEffect as b, setClass as x, setInsertionState as S, setProp as C, setStyle as w, setText as T, template as E, toDisplayString as D, txt as O, unref as k, watch as A } from "vue";
|
|
10
11
|
//#region ../components/src/table/table-body.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
11
|
-
var j = E("<td><div>"), M = E("<span>"), N = E("<div><div> </div>"),
|
|
12
|
-
|
|
13
|
-
var L = /*@__PURE__*/
|
|
12
|
+
var j = E("<td><div>"), M = E("<span>"), N = E("<div>"), P = E("<div><div> </div>"), F = E("<div><div> "), ee = E("<td>"), te = E("<tr>"), I = E("<tbody>", 1);
|
|
13
|
+
g("click");
|
|
14
|
+
var L = /*@__PURE__*/ h({
|
|
14
15
|
__name: "table-body",
|
|
15
16
|
props: { data: { default: () => [] } },
|
|
16
17
|
emits: [
|
|
@@ -18,11 +19,11 @@ var L = /*@__PURE__*/ m({
|
|
|
18
19
|
"selectRow",
|
|
19
20
|
"expandedRow"
|
|
20
21
|
],
|
|
21
|
-
setup(
|
|
22
|
-
let E =
|
|
22
|
+
setup(h, { emit: g }) {
|
|
23
|
+
let E = h, L = g, R = n("table"), z = _(o, void 0), B = y({}), V = y({}), H = (e, t) => {
|
|
23
24
|
e instanceof HTMLElement && (V.value[t] = e);
|
|
24
25
|
}, U = async () => {
|
|
25
|
-
await
|
|
26
|
+
await v(), requestAnimationFrame(() => {
|
|
26
27
|
let t = {};
|
|
27
28
|
Object.entries(V.value).forEach(([n, r]) => {
|
|
28
29
|
t[n] = e(r);
|
|
@@ -38,10 +39,10 @@ var L = /*@__PURE__*/ m({
|
|
|
38
39
|
});
|
|
39
40
|
let W = (e, t) => {
|
|
40
41
|
L("expandedRow", e, t);
|
|
41
|
-
}, G = (e, n) => t(e, n), K =
|
|
42
|
+
}, G = (e, n) => t(e, n), K = c(() => z?.flatColumns.value || []), q = c(() => z?.props.stripe ?? !1), J = c(() => z?.isScrollAtLeft.value ?? !0), Y = c(() => z?.isScrollAtRight.value ?? !1), X = (e) => {
|
|
42
43
|
let t = {};
|
|
43
44
|
return e.width === "auto" && (t.whiteSpace = "nowrap"), e.fixed && e.fixedOffset !== void 0 && (t.position = "sticky", t[e.fixed] = `${e.fixedOffset}px`, t.zIndex = 1), t;
|
|
44
|
-
}, Z =
|
|
45
|
+
}, Z = c(() => {
|
|
45
46
|
let e = z?.checked.value ?? [];
|
|
46
47
|
return new Set(e.map((e) => e._id));
|
|
47
48
|
}), Q = (e) => Z.value.has(e._id), ne = (e, t, n) => {
|
|
@@ -62,10 +63,10 @@ var L = /*@__PURE__*/ m({
|
|
|
62
63
|
if (!z?.props?.rowSelection) return;
|
|
63
64
|
let t = z?.selected.value;
|
|
64
65
|
L("selectRow", t && t._id === e._id ? {} : e, E.data.indexOf(e));
|
|
65
|
-
}, ae =
|
|
66
|
+
}, ae = m(), $ = I();
|
|
66
67
|
return S($, null, 0), u(() => E.data, (e, t) => {
|
|
67
|
-
let n =
|
|
68
|
-
return
|
|
68
|
+
let n = te();
|
|
69
|
+
return b(() => {
|
|
69
70
|
let r = k(R), i = e.value;
|
|
70
71
|
x(n, [
|
|
71
72
|
r.e("body-row"),
|
|
@@ -73,9 +74,9 @@ var L = /*@__PURE__*/ m({
|
|
|
73
74
|
r.is("selected", re(i) || Q(i)),
|
|
74
75
|
r.is("selection", k(z)?.props?.rowSelection)
|
|
75
76
|
]);
|
|
76
|
-
}), S(n, null, 0), u(() => K.value, (n,
|
|
77
|
-
let r = j(), i =
|
|
78
|
-
|
|
77
|
+
}), S(n, null, 0), u(() => K.value, (n, o) => d(() => n.value.type === "select", () => {
|
|
78
|
+
let r = j(), i = s(r);
|
|
79
|
+
b(() => {
|
|
79
80
|
let e = k(R), t = n.value, a = t.fixed;
|
|
80
81
|
x(r, [
|
|
81
82
|
e.e("body-cell"),
|
|
@@ -86,16 +87,16 @@ var L = /*@__PURE__*/ m({
|
|
|
86
87
|
{ [e.m("body-cell", "align", t.align)]: t.align }
|
|
87
88
|
]), w(r, X(t)), x(i, [e.e("body-cell-content")]);
|
|
88
89
|
}), S(i, null, 0);
|
|
89
|
-
let
|
|
90
|
-
return l(
|
|
90
|
+
let o = (n) => ne(n, e.value, t.value);
|
|
91
|
+
return l(k(a), {
|
|
91
92
|
"model-value": () => Q(e.value),
|
|
92
|
-
onChange: () =>
|
|
93
|
+
onChange: () => o
|
|
93
94
|
}), r;
|
|
94
95
|
}, () => {
|
|
95
|
-
let
|
|
96
|
-
return
|
|
96
|
+
let a = ee();
|
|
97
|
+
return b(() => {
|
|
97
98
|
let e = k(R), t = n.value, r = t.fixed;
|
|
98
|
-
x(
|
|
99
|
+
x(a, [
|
|
99
100
|
e.e("body-cell"),
|
|
100
101
|
e.is("ellipsis", t.ellipsis || t.ellipsisTooltip),
|
|
101
102
|
r ? e.m("body-cell", "fixed") : "",
|
|
@@ -103,46 +104,57 @@ var L = /*@__PURE__*/ m({
|
|
|
103
104
|
e.is("shadow", r === "left" && !J.value),
|
|
104
105
|
e.is("shadow", r === "right" && !Y.value),
|
|
105
106
|
{ [e.m("body-cell", "align", t.align)]: t.align }
|
|
106
|
-
]), w(
|
|
107
|
-
}), S(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
]), w(a, X(t));
|
|
108
|
+
}), S(a, null, 0), d(() => n.value.slot, () => {
|
|
109
|
+
let i = N();
|
|
110
|
+
return b(() => {
|
|
111
|
+
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
112
|
+
}), S(i, null, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
113
|
+
let n = M();
|
|
114
|
+
return b(() => {
|
|
115
|
+
let t = k(R);
|
|
116
|
+
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
117
|
+
}), S(n, null, 0), l(k(r)), n.$evtclick = f(() => W(e.value, t.value)), n;
|
|
118
|
+
}), S(i, null, 1), p(() => n.value.slot, {
|
|
119
|
+
column: () => n.value,
|
|
120
|
+
index: () => t.value,
|
|
121
|
+
row: () => e.value
|
|
122
|
+
}), i;
|
|
123
|
+
}, () => d(() => n.value.ellipsisTooltip, () => l(k(i), {
|
|
112
124
|
content: () => G(e.value, n.value.field),
|
|
113
125
|
mini: "",
|
|
114
|
-
disabled: () => B.value[t.value + "_" +
|
|
126
|
+
disabled: () => B.value[t.value + "_" + o.value] !== !0
|
|
115
127
|
}, () => {
|
|
116
|
-
let i =
|
|
117
|
-
|
|
128
|
+
let i = P(), a = s(i, 1);
|
|
129
|
+
b(() => {
|
|
118
130
|
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
119
131
|
}), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
120
132
|
let n = M();
|
|
121
|
-
return
|
|
133
|
+
return b(() => {
|
|
122
134
|
let t = k(R);
|
|
123
135
|
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
124
|
-
}), S(n, null, 0),
|
|
136
|
+
}), S(n, null, 0), l(k(r)), n.$evtclick = f(() => W(e.value, t.value)), n;
|
|
125
137
|
});
|
|
126
|
-
let
|
|
127
|
-
return
|
|
128
|
-
x(
|
|
138
|
+
let c = O(a);
|
|
139
|
+
return b(() => {
|
|
140
|
+
x(a, k(R).e("body-cell-text")), T(c, D(G(e.value, n.value.field))), ae(a, (e) => H(e, t.value + "_" + o.value), !0);
|
|
129
141
|
}), i;
|
|
130
142
|
}), () => {
|
|
131
|
-
let i =
|
|
132
|
-
|
|
143
|
+
let i = F(), a = s(i, 1);
|
|
144
|
+
b(() => {
|
|
133
145
|
x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
|
|
134
146
|
}), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
|
|
135
147
|
let n = M();
|
|
136
|
-
return
|
|
148
|
+
return b(() => {
|
|
137
149
|
let t = k(R);
|
|
138
150
|
x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
|
|
139
|
-
}), S(n, null, 0),
|
|
151
|
+
}), S(n, null, 0), l(k(r)), n.$evtclick = f(() => W(e.value, t.value)), n;
|
|
140
152
|
});
|
|
141
|
-
let
|
|
142
|
-
return
|
|
143
|
-
x(a, k(R).e("body-cell-text")), T(
|
|
153
|
+
let o = O(a);
|
|
154
|
+
return b(() => {
|
|
155
|
+
x(a, k(R).e("body-cell-text")), T(o, D(G(e.value, n.value.field)));
|
|
144
156
|
}), i;
|
|
145
|
-
},
|
|
157
|
+
}, 1285), 773), a;
|
|
146
158
|
}, 266), (e, t) => t, 17), n.$evtclick = f(() => ie(e.value)), n;
|
|
147
159
|
}, (e, t) => t, 9), C($, "tabindex", -1), $;
|
|
148
160
|
}
|
|
@@ -53,7 +53,7 @@ import { SSliderVerify as ge } from "../components/src/slider-verify/index.mjs";
|
|
|
53
53
|
import { SSpace as _e } from "../components/src/space/index.mjs";
|
|
54
54
|
import { SSplit as ve, SSplitPane as ye } from "../components/src/split/index.mjs";
|
|
55
55
|
import { SStatistic as be } from "../components/src/statistic/index.mjs";
|
|
56
|
-
import {
|
|
56
|
+
import { SSteps as xe } from "../components/src/steps/index.mjs";
|
|
57
57
|
import { SSwitch as Se } from "../components/src/switch/index.mjs";
|
|
58
58
|
import { STable as Ce } from "../components/src/table/index.mjs";
|
|
59
59
|
import { STab as we, STabPane as Te, STabs as Ee } from "../components/src/tabs/index.mjs";
|
package/dist/es/core/global.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ declare module "vue" {
|
|
|
70
70
|
SSplit: (typeof import("savor-ui"))["SSplit"];
|
|
71
71
|
SSplitPane: (typeof import("savor-ui"))["SSplitPane"];
|
|
72
72
|
SStatistic: (typeof import("savor-ui"))["SStatistic"];
|
|
73
|
-
|
|
73
|
+
SSteps: (typeof import("savor-ui"))["SSteps"];
|
|
74
74
|
SSwitch: (typeof import("savor-ui"))["SSwitch"];
|
|
75
75
|
STab: (typeof import("savor-ui"))["STab"];
|
|
76
76
|
STable: (typeof import("savor-ui"))["STable"];
|
package/dist/es/core/index.mjs
CHANGED
|
@@ -71,7 +71,7 @@ import { SSpace as Le } from "../components/src/space/index.mjs";
|
|
|
71
71
|
import { splitContextKey as Re } from "../components/src/split/types.mjs";
|
|
72
72
|
import { SSplit as ze, SSplitPane as Be } from "../components/src/split/index.mjs";
|
|
73
73
|
import { SStatistic as Ve } from "../components/src/statistic/index.mjs";
|
|
74
|
-
import {
|
|
74
|
+
import { SSteps as He } from "../components/src/steps/index.mjs";
|
|
75
75
|
import { SSwitch as Ue } from "../components/src/switch/index.mjs";
|
|
76
76
|
import { tableContextKey as We } from "../components/src/table/types.mjs";
|
|
77
77
|
import { STable as Ge } from "../components/src/table/index.mjs";
|
|
@@ -94,4 +94,4 @@ import lt from "./components.mjs";
|
|
|
94
94
|
//#region index.ts
|
|
95
95
|
var ut = e(lt);
|
|
96
96
|
//#endregion
|
|
97
|
-
export { t as SAlert, r as SAnchor, i as SAnchorLink, v as SAutoComplete, y as SAvatar, g as SBackTop, b as SBadge, x as SButton, S as SButtonGroup, C as SCard, w as SCarousel, M as SCascader, N as SChatList, P as SChatSender, D as SCheckbox, O as SCheckboxGroup, L as SCollapse, R as SCollapseItem, H as SColorPicker, l as SConfigProvider, U as SDatePicker, W as SDatetimePicker, K as SDescriptions, q as SDescriptionsItem, J as SDivider, Z as SDoption, Y as SDrawer, Q as SDropdown, $ as SDsubmenu, T as SEmpty, ee as SExpandCard, f as SForm, p as SFormItem, te as SGalleria, re as SGrid, ie as SGridItem, ae as SHighlight, z as SIcon, se as SImage, ce as SImageGroup, le as SImagePreview, m as SInput, ue as SInputNumber, de as SInputTag, pe as SLayout, me as SLayoutAside, he as SLayoutContent, ge as SLayoutFooter, _e as SLayoutHeader, ve as SLink, ye as SList, Ce as SMenu, we as SMenuGroup, Te as SMenuItem, Oe as SMeterGroup, Ae as SModal, je as SPagination, Me as SPanel, u as SPopover, Ne as SProgress, A as SRadio, j as SRadioGroup, _ as SScrollbar, Pe as SSegmented, V as SSelect, Fe as SSkeleton, Ie as SSliderVerify, Le as SSpace, ze as SSplit, Be as SSplitPane, Ve as SStatistic, Ee as SSubMenu, Ue as SSwitch, qe as STab, Je as STabPane, Ge as STable, Ye as STabs, B as STag, Xe as SText, Ze as STextarea, $e as STimeline, et as STimelineItem, d as STooltip, F as STransition, nt as STree, rt as STreeSelect, it as SUpload, at as SVirtualList, ot as SWaterfall, st as SWatermark, ct as SWheel,
|
|
97
|
+
export { t as SAlert, r as SAnchor, i as SAnchorLink, v as SAutoComplete, y as SAvatar, g as SBackTop, b as SBadge, x as SButton, S as SButtonGroup, C as SCard, w as SCarousel, M as SCascader, N as SChatList, P as SChatSender, D as SCheckbox, O as SCheckboxGroup, L as SCollapse, R as SCollapseItem, H as SColorPicker, l as SConfigProvider, U as SDatePicker, W as SDatetimePicker, K as SDescriptions, q as SDescriptionsItem, J as SDivider, Z as SDoption, Y as SDrawer, Q as SDropdown, $ as SDsubmenu, T as SEmpty, ee as SExpandCard, f as SForm, p as SFormItem, te as SGalleria, re as SGrid, ie as SGridItem, ae as SHighlight, z as SIcon, se as SImage, ce as SImageGroup, le as SImagePreview, m as SInput, ue as SInputNumber, de as SInputTag, pe as SLayout, me as SLayoutAside, he as SLayoutContent, ge as SLayoutFooter, _e as SLayoutHeader, ve as SLink, ye as SList, Ce as SMenu, we as SMenuGroup, Te as SMenuItem, Oe as SMeterGroup, Ae as SModal, je as SPagination, Me as SPanel, u as SPopover, Ne as SProgress, A as SRadio, j as SRadioGroup, _ as SScrollbar, Pe as SSegmented, V as SSelect, Fe as SSkeleton, Ie as SSliderVerify, Le as SSpace, ze as SSplit, Be as SSplitPane, Ve as SStatistic, He as SSteps, Ee as SSubMenu, Ue as SSwitch, qe as STab, Je as STabPane, Ge as STable, Ye as STabs, B as STag, Xe as SText, Ze as STextarea, $e as STimeline, et as STimelineItem, d as STooltip, F as STransition, nt as STree, rt as STreeSelect, it as SUpload, at as SVirtualList, ot as SWaterfall, st as SWatermark, ct as SWheel, n as anchorContextKey, h as buttonGroupContextKey, E as checkboxGroupContextKey, I as collapseContextKey, c as configProviderContextKey, ut as default, G as descriptionsContextKey, X as dropdownContextKey, a as formContextKey, o as formItemContextKey, s as formItemStatusContextKey, ne as gridContextKey, oe as imageGroupContextKey, be as menuContextKey, xe as menuLevelContextKey, k as radioGroupContextKey, Re as splitContextKey, Se as subMenuContextKey, We as tableContextKey, Ke as tabsContextKey, Qe as timelineContextKey, tt as treeContextKey, fe as useLayer, De as useMessage, ke as useModal };
|
package/dist/json/web-types.json
CHANGED