@yeepay/yee-boss-ui 0.1.20 → 0.1.22
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 +94 -67
- package/dist/YeeGrid-C5jcjTuQ.js +629 -0
- package/dist/components/{form → grid}/form-api.d.ts +8 -4
- package/dist/components/grid/form-component-map.d.ts +9 -0
- package/dist/components/{form/types.d.ts → grid/form-types.d.ts} +45 -42
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/types.d.ts +12 -10
- package/dist/components/grid/use-yee-grid.d.ts +2 -2
- package/dist/components/grid/yee-grid-api.d.ts +4 -3
- package/dist/grid.css +1 -1
- package/dist/grid.js +2 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +42 -47
- package/dist/resolver.d.ts +25 -0
- package/dist/resolver.js +22 -0
- package/dist/style.css +1 -5
- package/dist/use-yee-grid-idCNjiBi.js +141 -0
- package/package.json +15 -26
- package/dist/YeeForm-COND7XQj.js +0 -160
- package/dist/YeeGrid-CF-0OZUj.js +0 -395
- package/dist/components/form/YeeForm.vue.d.ts +0 -14
- package/dist/components/form/component-map.d.ts +0 -9
- package/dist/components/form/index.d.ts +0 -3
- package/dist/components/grid/YeeGrid.vue.d.ts +0 -28
- package/dist/components/select/YeeSelect.vue.d.ts +0 -32
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/types.d.ts +0 -120
- package/dist/form-api-0148j8ew.js +0 -44
- package/dist/form.d.ts +0 -1
- package/dist/form.js +0 -6
- package/dist/index-DvY7PmUA.js +0 -132
- package/dist/select.d.ts +0 -1
- package/dist/select.js +0 -4
- package/dist/use-yee-grid-ClKZU8CY.js +0 -85
package/dist/index-DvY7PmUA.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { defineComponent as F, useModel as G, useSlots as H, useAttrs as J, useTemplateRef as K, shallowRef as Q, computed as n, openBlock as y, createBlock as S, unref as d, mergeProps as g, withCtx as u, createElementVNode as N, normalizeStyle as W, normalizeClass as X, createSlots as O, createVNode as Z, toDisplayString as ee, renderList as A, renderSlot as R, normalizeProps as Y, guardReactiveProps as x, mergeModels as te } from "vue";
|
|
2
|
-
import { Tooltip as j, Select as oe } from "ant-design-vue";
|
|
3
|
-
import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
const le = { class: "yee-ui-select__option-label" }, se = /* @__PURE__ */ F({
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
name: "YeeSelect",
|
|
7
|
-
__name: "YeeSelect",
|
|
8
|
-
props: /* @__PURE__ */ te({
|
|
9
|
-
fieldNames: {},
|
|
10
|
-
options: {}
|
|
11
|
-
}, {
|
|
12
|
-
value: {},
|
|
13
|
-
valueModifiers: {}
|
|
14
|
-
}),
|
|
15
|
-
emits: ["update:value"],
|
|
16
|
-
setup(c, { expose: z }) {
|
|
17
|
-
const h = oe, s = c, i = G(c, "value"), p = H(), f = J(), v = K("select"), C = Q(!1), l = n(() => ({
|
|
18
|
-
label: s.fieldNames?.label ?? "label",
|
|
19
|
-
options: s.fieldNames?.options ?? "options",
|
|
20
|
-
value: s.fieldNames?.value ?? "value"
|
|
21
|
-
})), B = n(() => f.class), M = n(() => f.style), w = n(() => {
|
|
22
|
-
const e = {};
|
|
23
|
-
for (const [t, o] of Object.entries(f))
|
|
24
|
-
t !== "class" && t !== "style" && t !== "onDropdownVisibleChange" && (e[t] = o);
|
|
25
|
-
return e;
|
|
26
|
-
}), P = n(() => !p.default && !p.option), V = n(() => Object.keys(p)), $ = n(() => V.value.filter(
|
|
27
|
-
(e) => e !== "default" && e !== "option"
|
|
28
|
-
));
|
|
29
|
-
function E(e) {
|
|
30
|
-
const t = f.onDropdownVisibleChange;
|
|
31
|
-
if (typeof t == "function") {
|
|
32
|
-
t(e);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
t?.forEach((o) => o?.(e));
|
|
36
|
-
}
|
|
37
|
-
function D(e) {
|
|
38
|
-
C.value = e, E(e);
|
|
39
|
-
}
|
|
40
|
-
function a(e) {
|
|
41
|
-
return typeof e == "number" || typeof e == "string" ? String(e) : "";
|
|
42
|
-
}
|
|
43
|
-
function m(e, t) {
|
|
44
|
-
if (e)
|
|
45
|
-
for (const o of e) {
|
|
46
|
-
const r = o[l.value.options], _ = m(r, t);
|
|
47
|
-
if (_) return _;
|
|
48
|
-
const k = o[l.value.value];
|
|
49
|
-
if (k === t || String(k) === String(t)) return o;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function b(e) {
|
|
53
|
-
return e ? a(e[l.value.label]) || a(e.title) || a(e[l.value.value]) : "";
|
|
54
|
-
}
|
|
55
|
-
const L = n(() => {
|
|
56
|
-
const e = i.value;
|
|
57
|
-
if (!(e == null || e === ""))
|
|
58
|
-
return Array.isArray(e) ? e.map((t) => b(m(s.options, t)) || a(t)).filter(Boolean).join("、") || void 0 : b(m(s.options, e)) || a(e) || void 0;
|
|
59
|
-
});
|
|
60
|
-
function T(e) {
|
|
61
|
-
return b(e);
|
|
62
|
-
}
|
|
63
|
-
function U() {
|
|
64
|
-
v.value?.blur();
|
|
65
|
-
}
|
|
66
|
-
function I() {
|
|
67
|
-
v.value?.focus();
|
|
68
|
-
}
|
|
69
|
-
function q(...e) {
|
|
70
|
-
v.value?.scrollTo(...e);
|
|
71
|
-
}
|
|
72
|
-
return z({ blur: U, focus: I, scrollTo: q }), (e, t) => (y(), S(d(j), g(C.value ? { open: !1 } : {}, { title: L.value }), {
|
|
73
|
-
default: u(() => [
|
|
74
|
-
N("div", {
|
|
75
|
-
class: X(["yee-ui-select", B.value]),
|
|
76
|
-
style: W(M.value)
|
|
77
|
-
}, [
|
|
78
|
-
P.value ? (y(), S(d(h), g({
|
|
79
|
-
key: 0,
|
|
80
|
-
ref: "select",
|
|
81
|
-
value: i.value,
|
|
82
|
-
"onUpdate:value": t[0] || (t[0] = (o) => i.value = o)
|
|
83
|
-
}, w.value, {
|
|
84
|
-
"field-names": l.value,
|
|
85
|
-
options: c.options,
|
|
86
|
-
onDropdownVisibleChange: D
|
|
87
|
-
}), O({
|
|
88
|
-
option: u((o) => [
|
|
89
|
-
Z(d(j), {
|
|
90
|
-
title: T(o),
|
|
91
|
-
placement: "left"
|
|
92
|
-
}, {
|
|
93
|
-
default: u(() => [
|
|
94
|
-
N("span", le, ee(T(o)), 1)
|
|
95
|
-
]),
|
|
96
|
-
_: 2
|
|
97
|
-
}, 1032, ["title"])
|
|
98
|
-
]),
|
|
99
|
-
_: 2
|
|
100
|
-
}, [
|
|
101
|
-
A($.value, (o) => ({
|
|
102
|
-
name: o,
|
|
103
|
-
fn: u((r) => [
|
|
104
|
-
R(e.$slots, o, Y(x(r)), void 0, !0)
|
|
105
|
-
])
|
|
106
|
-
}))
|
|
107
|
-
]), 1040, ["value", "field-names", "options"])) : (y(), S(d(h), g({
|
|
108
|
-
key: 1,
|
|
109
|
-
ref: "select",
|
|
110
|
-
value: i.value,
|
|
111
|
-
"onUpdate:value": t[1] || (t[1] = (o) => i.value = o)
|
|
112
|
-
}, w.value, {
|
|
113
|
-
"field-names": l.value,
|
|
114
|
-
options: c.options,
|
|
115
|
-
onDropdownVisibleChange: D
|
|
116
|
-
}), O({ _: 2 }, [
|
|
117
|
-
A(V.value, (o) => ({
|
|
118
|
-
name: o,
|
|
119
|
-
fn: u((r) => [
|
|
120
|
-
R(e.$slots, o, Y(x(r)), void 0, !0)
|
|
121
|
-
])
|
|
122
|
-
}))
|
|
123
|
-
]), 1040, ["value", "field-names", "options"]))
|
|
124
|
-
], 6)
|
|
125
|
-
]),
|
|
126
|
-
_: 3
|
|
127
|
-
}, 16, ["title"]));
|
|
128
|
-
}
|
|
129
|
-
}), ie = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-8acc9d8f"]]), ce = ie;
|
|
130
|
-
export {
|
|
131
|
-
ce as Y
|
|
132
|
-
};
|
package/dist/select.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/select';
|
package/dist/select.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { shallowRef as s, defineComponent as l, onBeforeUnmount as n, h as u, defineAsyncComponent as d } from "vue";
|
|
2
|
-
import { Y as h } from "./form-api-0148j8ew.js";
|
|
3
|
-
class m {
|
|
4
|
-
/** 查询表单控制器。 */
|
|
5
|
-
formApi = new h();
|
|
6
|
-
/** 查询表单当前是否可见。 */
|
|
7
|
-
searchFormVisible;
|
|
8
|
-
/** 当前 Grid 初始化配置。 */
|
|
9
|
-
state;
|
|
10
|
-
grid;
|
|
11
|
-
constructor(e) {
|
|
12
|
-
this.state = s(e), this.searchFormVisible = s(e.showSearchForm ?? !0);
|
|
13
|
-
}
|
|
14
|
-
/** @internal 由 YeeGrid 挂载底层 VXE Grid 实例。 */
|
|
15
|
-
mount(e) {
|
|
16
|
-
this.grid = e;
|
|
17
|
-
}
|
|
18
|
-
/** 保留当前页码并执行查询,可在查询前合并表单值。 */
|
|
19
|
-
query = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("query"));
|
|
20
|
-
/** 回到第一页并重新查询,可在查询前合并表单值。 */
|
|
21
|
-
reload = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("reload"));
|
|
22
|
-
/** 合并更新 VXE Grid 配置。 */
|
|
23
|
-
setGridOptions(e) {
|
|
24
|
-
this.setState({
|
|
25
|
-
gridOptions: {
|
|
26
|
-
...this.state.value.gridOptions,
|
|
27
|
-
...e
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/** 设置表格加载状态。 */
|
|
32
|
-
setLoading(e) {
|
|
33
|
-
this.setGridOptions({ loading: e });
|
|
34
|
-
}
|
|
35
|
-
/** 合并更新 useYeeGrid 初始化配置。 */
|
|
36
|
-
setState(e) {
|
|
37
|
-
this.state.value = {
|
|
38
|
-
...this.state.value,
|
|
39
|
-
...e
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/** 切换查询表单显隐,并返回切换后的状态。 */
|
|
43
|
-
toggleSearchForm(e) {
|
|
44
|
-
return this.searchFormVisible.value = e ?? !this.searchFormVisible.value, this.searchFormVisible.value;
|
|
45
|
-
}
|
|
46
|
-
/** @internal 清理底层 VXE Grid 实例引用。 */
|
|
47
|
-
unmount() {
|
|
48
|
-
this.grid = void 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
let i = !1;
|
|
52
|
-
function c() {
|
|
53
|
-
if (!(i || typeof document > "u")) {
|
|
54
|
-
if (document.querySelector("link[data-yee-grid-styles]")) {
|
|
55
|
-
i = !0;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
i = !0, import("@yeepay/yee-boss-ui/grid.css");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const p = d(() => import("./YeeGrid-CF-0OZUj.js"));
|
|
62
|
-
function b(r) {
|
|
63
|
-
c();
|
|
64
|
-
const e = new m(r);
|
|
65
|
-
return [l({
|
|
66
|
-
name: "YeeGrid",
|
|
67
|
-
inheritAttrs: !1,
|
|
68
|
-
props: {
|
|
69
|
-
tableTitle: String,
|
|
70
|
-
tableTitleHelp: String
|
|
71
|
-
},
|
|
72
|
-
setup(t, { attrs: a, slots: o }) {
|
|
73
|
-
return n(() => e.unmount()), () => u(p, {
|
|
74
|
-
...a,
|
|
75
|
-
api: e,
|
|
76
|
-
...t.tableTitle ? { tableTitle: t.tableTitle } : {},
|
|
77
|
-
...t.tableTitleHelp ? { tableTitleHelp: t.tableTitleHelp } : {}
|
|
78
|
-
}, o);
|
|
79
|
-
}
|
|
80
|
-
}), e];
|
|
81
|
-
}
|
|
82
|
-
export {
|
|
83
|
-
m as Y,
|
|
84
|
-
b as u
|
|
85
|
-
};
|