wyfe-ivue 0.5.0 → 0.8.7
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 +28 -16
- package/dist/{InlineForm-CJgRTO8w.js → InlineForm-DC1lqOwN.js} +39 -37
- package/dist/{RecTableColumn--TL4ZAq5.js → RecTableColumn-CQz9NDpd.js} +12 -11
- package/dist/RowForm-DPU_OZq-.js +1094 -0
- package/dist/{Selection-BqmTkjpI.js → Selection-BrvRLYD8.js} +5 -5
- package/dist/{Span-r-IKXZvi.js → Span-BbXSa8ak.js} +7 -7
- package/dist/{el-radio-DgLOuieg.js → el-radio-DMvIhc3J.js} +66 -66
- package/dist/{index-Bi7nW-sZ.js → index-MzlgxHOB.js} +4753 -4440
- package/dist/index.es.js +13 -10
- package/dist/index.umd.js +9 -4
- package/dist/types/index.d.ts +177 -13
- package/dist/{useFormHook-BVZ_gZcT.js → useFormHook-DYgWi8dF.js} +1209 -1184
- package/dist/wyfe-ivue.css +1 -1
- package/package.json +2 -1
- package/dist/RowForm-sni-NX8u.js +0 -272
package/README.md
CHANGED
|
@@ -12,30 +12,29 @@
|
|
|
12
12
|
$ pnpm i wyfe-ivue
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
## 本地构建
|
|
16
|
-
1. 生成 tgz 包
|
|
17
|
-
```shell
|
|
18
|
-
$ cd wyfe-ivue
|
|
19
|
-
$ pnpm tgz
|
|
20
|
-
# 生成 wyfe-ivue-0.0.1.tgz
|
|
21
|
-
```
|
|
22
|
-
2. 在目标项目中安装和使用
|
|
23
|
-
```shell
|
|
24
|
-
$ cd targetProject
|
|
25
|
-
$ pnpm i D:/xxx/wyfe-ivue/wyfe-ivue-0.0.1.tgz
|
|
26
|
-
```
|
|
27
|
-
|
|
28
15
|
## 使用
|
|
29
16
|
```js
|
|
30
17
|
// 1、创建plugins/WyfeIVue.ts:
|
|
18
|
+
|
|
19
|
+
// UseSvgIcon组件需要手动引入svg图标注册脚本 并且需在vite.config.ts中配置插件
|
|
20
|
+
import 'virtual:svg-icons-register'
|
|
21
|
+
import { type App, type Component } from 'vue'
|
|
31
22
|
import 'wyfe-ivue/dist/wyfe-ivue.css'
|
|
32
|
-
import { type App } from 'vue'
|
|
33
23
|
import * as WyfeIVue from 'wyfe-ivue'
|
|
34
24
|
|
|
25
|
+
type ComponentExports = {
|
|
26
|
+
[K in keyof typeof WyfeIVue]: (typeof WyfeIVue)[K] extends Component
|
|
27
|
+
? (typeof WyfeIVue)[K]
|
|
28
|
+
: never
|
|
29
|
+
}
|
|
30
|
+
|
|
35
31
|
export default (app: App) => {
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const components = WyfeIVue as ComponentExports
|
|
33
|
+
|
|
34
|
+
for (const [key, component] of Object.entries(components)) {
|
|
35
|
+
key.startsWith('Use') && app.component(key, component)
|
|
38
36
|
}
|
|
37
|
+
}
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
// 2、在main.ts中引入使用:
|
|
@@ -47,6 +46,19 @@ createApp(App).use(WyfeIVuePlugins).mount('#app')
|
|
|
47
46
|
<UseElButton btnText="保存" @onClick="handleClick"/>
|
|
48
47
|
```
|
|
49
48
|
|
|
49
|
+
## 本地构建
|
|
50
|
+
1. 生成 tgz 包
|
|
51
|
+
```shell
|
|
52
|
+
$ cd wyfe-ivue
|
|
53
|
+
$ pnpm tgz
|
|
54
|
+
# 生成 wyfe-ivue-0.0.1.tgz
|
|
55
|
+
```
|
|
56
|
+
2. 在目标项目中安装和使用
|
|
57
|
+
```shell
|
|
58
|
+
$ cd targetProject
|
|
59
|
+
$ pnpm i D:/xxx/wyfe-ivue/wyfe-ivue-0.0.1.tgz
|
|
60
|
+
```
|
|
61
|
+
|
|
50
62
|
## 版本号规则
|
|
51
63
|
+ 仅升级组件库依赖,修改第1位。eg:1.x.x;
|
|
52
64
|
+ 仅新增组件库组件,修改第2位。eg:x.8.x;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { defineComponent as q, computed as
|
|
4
|
-
const
|
|
1
|
+
import { Q as I, D as S, T as U, R as Q } from "./index-MzlgxHOB.js";
|
|
2
|
+
import { h as K, E as N, i as R, j as L, k as W } from "./useFormHook-DYgWi8dF.js";
|
|
3
|
+
import { defineComponent as q, computed as x, onMounted as D, createElementBlock as y, openBlock as t, normalizeStyle as a, createVNode as i, createElementVNode as T, withModifiers as j, withCtx as d, Fragment as z, renderList as A, createBlock as p, createCommentVNode as u, withKeys as f, unref as C, createTextVNode as k } from "vue";
|
|
4
|
+
const H = { class: "btnWrapper" }, G = /* @__PURE__ */ q({
|
|
5
5
|
__name: "InlineForm",
|
|
6
6
|
props: I,
|
|
7
|
-
emits: ["
|
|
8
|
-
setup(
|
|
9
|
-
const s =
|
|
7
|
+
emits: ["onQuery"],
|
|
8
|
+
setup(_, { expose: b, emit: V }) {
|
|
9
|
+
const s = _, m = V, w = x(
|
|
10
10
|
() => s.showBorberBottom ? "1px solid var(--el-border-color)" : ""
|
|
11
11
|
);
|
|
12
|
-
|
|
12
|
+
D(() => {
|
|
13
13
|
document.querySelectorAll(".el-select__input").forEach((o) => {
|
|
14
14
|
o.addEventListener(
|
|
15
15
|
"keydown",
|
|
@@ -22,40 +22,42 @@ const G = { class: "btnWrapper" }, J = /* @__PURE__ */ q({
|
|
|
22
22
|
});
|
|
23
23
|
const r = () => {
|
|
24
24
|
m("onQuery", s.formModel);
|
|
25
|
-
},
|
|
25
|
+
}, P = () => {
|
|
26
26
|
m("onQuery", {});
|
|
27
|
-
}, { formRef: c,
|
|
27
|
+
}, { formRef: c, dateFormatComputed: g } = K(s);
|
|
28
28
|
return b({ formRef: c }), (o, l) => {
|
|
29
|
-
const
|
|
30
|
-
return t(),
|
|
29
|
+
const E = S, M = L, v = W, B = R, F = N, h = U;
|
|
30
|
+
return t(), y("div", {
|
|
31
31
|
class: "inlineForm",
|
|
32
|
-
style: a({ borderBottom:
|
|
32
|
+
style: a({ borderBottom: w.value })
|
|
33
33
|
}, [
|
|
34
|
-
|
|
34
|
+
i(F, {
|
|
35
35
|
ref_key: "formRef",
|
|
36
36
|
ref: c,
|
|
37
37
|
inline: "",
|
|
38
38
|
model: o.formModel,
|
|
39
39
|
"label-suffix": o.labelSuffix,
|
|
40
|
-
onSubmit: l[0] || (l[0] =
|
|
40
|
+
onSubmit: l[0] || (l[0] = j(() => {
|
|
41
41
|
}, ["prevent"]))
|
|
42
42
|
}, {
|
|
43
43
|
default: d(() => [
|
|
44
|
-
(t(!0),
|
|
44
|
+
(t(!0), y(z, null, A(o.formColumns, (e) => (t(), p(B, {
|
|
45
45
|
key: e.label,
|
|
46
46
|
label: e.label
|
|
47
47
|
}, {
|
|
48
48
|
default: d(() => [
|
|
49
|
-
e.inputConfig ? (t(), p(
|
|
49
|
+
e.inputConfig ? (t(), p(E, {
|
|
50
50
|
key: 0,
|
|
51
51
|
modelValue: o.formModel[e.prop],
|
|
52
52
|
"onUpdate:modelValue": (n) => o.formModel[e.prop] = n,
|
|
53
|
-
placeholder: "请输入",
|
|
53
|
+
placeholder: e.inputConfig.placeholder || "请输入",
|
|
54
|
+
maxlength: e.inputConfig.maxlength || "",
|
|
55
|
+
"show-word-limit": !!e.inputConfig.maxlength,
|
|
54
56
|
style: a({ width: e.inputConfig.width || o.formItemWidth }),
|
|
55
57
|
clearable: "",
|
|
56
58
|
onClear: r,
|
|
57
|
-
onKeyup:
|
|
58
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) :
|
|
59
|
+
onKeyup: f(r, ["enter"])
|
|
60
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "style"])) : u("", !0),
|
|
59
61
|
e.selectConfig ? (t(), p(M, {
|
|
60
62
|
key: 1,
|
|
61
63
|
modelValue: o.formModel[e.prop],
|
|
@@ -65,43 +67,43 @@ const G = { class: "btnWrapper" }, J = /* @__PURE__ */ q({
|
|
|
65
67
|
style: a({ width: e.selectConfig.width || o.formItemWidth }),
|
|
66
68
|
clearable: "",
|
|
67
69
|
onClear: r,
|
|
68
|
-
onKeyup:
|
|
69
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "style"])) :
|
|
70
|
-
e.datePickerConfig ? (t(), p(
|
|
70
|
+
onKeyup: f(r, ["enter"])
|
|
71
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "style"])) : u("", !0),
|
|
72
|
+
e.datePickerConfig ? (t(), p(v, {
|
|
71
73
|
key: 2,
|
|
72
74
|
modelValue: o.formModel[e.prop],
|
|
73
75
|
"onUpdate:modelValue": (n) => o.formModel[e.prop] = n,
|
|
74
76
|
type: e.datePickerConfig.type || "date",
|
|
75
|
-
"range-separator": e.datePickerConfig.rangeSeparator || "
|
|
76
|
-
"start-placeholder": e.datePickerConfig.startPlaceholder || "",
|
|
77
|
-
"end-placeholder": e.datePickerConfig.endPlaceholder || "",
|
|
78
|
-
format:
|
|
79
|
-
"value-format":
|
|
77
|
+
"range-separator": e.datePickerConfig.rangeSeparator || "至",
|
|
78
|
+
"start-placeholder": e.datePickerConfig.startPlaceholder || "开始日期",
|
|
79
|
+
"end-placeholder": e.datePickerConfig.endPlaceholder || "结束日期",
|
|
80
|
+
format: C(g)(e.datePickerConfig),
|
|
81
|
+
"value-format": C(g)(e.datePickerConfig),
|
|
80
82
|
placeholder: e.datePickerConfig.placeholder || "请选择",
|
|
81
83
|
style: a({ width: e.datePickerConfig.width ?? "100%" }),
|
|
82
84
|
onClear: r,
|
|
83
|
-
onKeyup:
|
|
84
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "range-separator", "start-placeholder", "end-placeholder", "format", "value-format", "placeholder", "style"])) :
|
|
85
|
+
onKeyup: f(r, ["enter"])
|
|
86
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "range-separator", "start-placeholder", "end-placeholder", "format", "value-format", "placeholder", "style"])) : u("", !0)
|
|
85
87
|
]),
|
|
86
88
|
_: 2
|
|
87
89
|
}, 1032, ["label"]))), 128))
|
|
88
90
|
]),
|
|
89
91
|
_: 1
|
|
90
92
|
}, 8, ["model", "label-suffix"]),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
T("div", H, [
|
|
94
|
+
i(h, {
|
|
93
95
|
type: "primary",
|
|
94
96
|
loading: o.queryLoading,
|
|
95
97
|
onClick: r
|
|
96
98
|
}, {
|
|
97
99
|
default: d(() => [...l[1] || (l[1] = [
|
|
98
|
-
|
|
100
|
+
k(" 查询 ", -1)
|
|
99
101
|
])]),
|
|
100
102
|
_: 1
|
|
101
103
|
}, 8, ["loading"]),
|
|
102
|
-
|
|
104
|
+
i(h, { onClick: P }, {
|
|
103
105
|
default: d(() => [...l[2] || (l[2] = [
|
|
104
|
-
|
|
106
|
+
k("重置", -1)
|
|
105
107
|
])]),
|
|
106
108
|
_: 1
|
|
107
109
|
})
|
|
@@ -109,7 +111,7 @@ const G = { class: "btnWrapper" }, J = /* @__PURE__ */ q({
|
|
|
109
111
|
], 4);
|
|
110
112
|
};
|
|
111
113
|
}
|
|
112
|
-
}),
|
|
114
|
+
}), Y = /* @__PURE__ */ Q(G, [["__scopeId", "data-v-734b6bdb"]]);
|
|
113
115
|
export {
|
|
114
|
-
|
|
116
|
+
Y as default
|
|
115
117
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const R = /* @__PURE__ */
|
|
1
|
+
import { bb as g } from "./index-MzlgxHOB.js";
|
|
2
|
+
import { defineComponent as m, defineAsyncComponent as C, resolveComponent as s, createBlock as t, openBlock as n, withCtx as r, createElementBlock as u, Fragment as c, renderList as h, renderSlot as b, mergeProps as i, unref as y, normalizeProps as j, guardReactiveProps as k } from "vue";
|
|
3
|
+
const R = /* @__PURE__ */ m({
|
|
4
4
|
__name: "RecTableColumn",
|
|
5
5
|
props: {
|
|
6
6
|
columnObj: {
|
|
@@ -17,10 +17,10 @@ const R = /* @__PURE__ */ g({
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
setup(l) {
|
|
20
|
-
const
|
|
20
|
+
const p = C(() => import("./Span-BbXSa8ak.js"));
|
|
21
21
|
return (a, O) => {
|
|
22
|
-
const f = s("RecTableColumn", !0),
|
|
23
|
-
return n(), t(
|
|
22
|
+
const f = s("RecTableColumn", !0), d = g;
|
|
23
|
+
return n(), t(d, {
|
|
24
24
|
label: l.columnObj.label,
|
|
25
25
|
align: l.columnObj.align || l.tableColumnAlign
|
|
26
26
|
}, {
|
|
@@ -34,35 +34,36 @@ const R = /* @__PURE__ */ g({
|
|
|
34
34
|
e.children && e.children.length ? (n(), t(f, {
|
|
35
35
|
key: 0,
|
|
36
36
|
columnObj: e
|
|
37
|
-
}, null, 8, ["columnObj"])) : (n(), t(
|
|
37
|
+
}, null, 8, ["columnObj"])) : (n(), t(d, {
|
|
38
38
|
key: 1,
|
|
39
39
|
label: e.label,
|
|
40
40
|
prop: e.prop,
|
|
41
|
+
width: e.width,
|
|
41
42
|
"min-width": e.minWidth,
|
|
42
43
|
align: e.align || l.tableColumnAlign
|
|
43
44
|
}, {
|
|
44
45
|
default: r(({ row: o }) => [
|
|
45
46
|
e.prop && Object.keys(o).length ? (n(), u(c, { key: 0 }, [
|
|
46
|
-
e?.extConfig?.slot ? b(a.$slots, e.prop,
|
|
47
|
+
e?.extConfig?.slot ? b(a.$slots, e.prop, i({
|
|
47
48
|
key: 0,
|
|
48
49
|
ref_for: !0
|
|
49
50
|
}, {
|
|
50
51
|
row: o,
|
|
51
52
|
data: o[e.prop],
|
|
52
53
|
dict: e.extConfig?.dict
|
|
53
|
-
})) : (n(), t(y(
|
|
54
|
+
})) : (n(), t(y(p), {
|
|
54
55
|
key: 1,
|
|
55
56
|
item: e,
|
|
56
57
|
data: o[e.prop],
|
|
57
58
|
extConfig: l.extConfig
|
|
58
59
|
}, null, 8, ["item", "data", "extConfig"]))
|
|
59
|
-
], 64)) : b(a.$slots, "default",
|
|
60
|
+
], 64)) : b(a.$slots, "default", i({
|
|
60
61
|
key: 1,
|
|
61
62
|
ref_for: !0
|
|
62
63
|
}, { row: o }))
|
|
63
64
|
]),
|
|
64
65
|
_: 2
|
|
65
|
-
}, 1032, ["label", "prop", "min-width", "align"]))
|
|
66
|
+
}, 1032, ["label", "prop", "width", "min-width", "align"]))
|
|
66
67
|
], 64))), 128))
|
|
67
68
|
]),
|
|
68
69
|
_: 3
|