@yuiyideyui/everybody-ui 1.0.26
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 +7 -0
- package/dist/components/message/src/EBmessage.d.ts +9 -0
- package/dist/components/table/src/EbCustomTable.d.ts +51 -0
- package/dist/components/table/src/EbCustomTable.vue.d.ts +2 -0
- package/dist/directives/directive.d.ts +2 -0
- package/dist/directives/vJsxTable.d.ts +6 -0
- package/dist/directives/vTransitionText.d.ts +21 -0
- package/dist/everybody-ui.css +1 -0
- package/dist/index.js +470 -0
- package/dist/index.type.d.ts +2 -0
- package/dist/main.d.ts +12 -0
- package/dist/resolver.d.ts +2 -0
- package/dist/resolver.js +19 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
export interface EbMessageOptions {
|
|
3
|
+
jsx: VNode | (() => VNode);
|
|
4
|
+
position: "top" | "bottom" | "left" | "right" | "center";
|
|
5
|
+
timeClose?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const EbMessage: (options: EbMessageOptions) => {
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DirectiveBinding, VNode } from 'vue';
|
|
2
|
+
export interface TableRowData {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface CustomListConfig {
|
|
6
|
+
cellRenderer?: (nodeData: {
|
|
7
|
+
val: any;
|
|
8
|
+
rowData: TableRowData;
|
|
9
|
+
prop: string;
|
|
10
|
+
}, el: Element, binding: DirectiveBinding, vnode: VNode) => any;
|
|
11
|
+
click?: (rowData: TableRowData) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface ItableHeaderNoChildren {
|
|
14
|
+
prop: string;
|
|
15
|
+
label: string;
|
|
16
|
+
align?: 'left' | 'center' | 'right';
|
|
17
|
+
customList?: CustomListConfig[];
|
|
18
|
+
showOverflowTooltip?: boolean;
|
|
19
|
+
width?: string | number;
|
|
20
|
+
boxClass?: string;
|
|
21
|
+
boxStyle?: string;
|
|
22
|
+
children?: never;
|
|
23
|
+
}
|
|
24
|
+
export interface ItableHeaderChildren {
|
|
25
|
+
children: ItableHeaderNoChildren[];
|
|
26
|
+
label: string;
|
|
27
|
+
align?: 'left' | 'center' | 'right';
|
|
28
|
+
prop?: never;
|
|
29
|
+
}
|
|
30
|
+
export type everybodyTableHeaderItem = ItableHeaderNoChildren | ItableHeaderChildren;
|
|
31
|
+
export type everybodyTableHeader = everybodyTableHeaderItem[];
|
|
32
|
+
export interface propsType {
|
|
33
|
+
tableHeader: everybodyTableHeader;
|
|
34
|
+
customListLoading?: boolean;
|
|
35
|
+
data: Record<string, any>[];
|
|
36
|
+
isDataSlice?: {
|
|
37
|
+
isSlice: false;
|
|
38
|
+
};
|
|
39
|
+
rowHeight?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface propsType1 {
|
|
42
|
+
tableHeader: everybodyTableHeader;
|
|
43
|
+
customListLoading?: boolean;
|
|
44
|
+
data: Record<string, any>[];
|
|
45
|
+
isDataSlice: {
|
|
46
|
+
isSlice: true;
|
|
47
|
+
num: number;
|
|
48
|
+
};
|
|
49
|
+
rowHeight: number;
|
|
50
|
+
}
|
|
51
|
+
export type everybodyTableProps = propsType | propsType1;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DirectiveBinding, Ref, VNode } from 'vue';
|
|
2
|
+
import { TransitionPresets } from '@vueuse/core';
|
|
3
|
+
type TransitionCurve = keyof typeof TransitionPresets;
|
|
4
|
+
interface TransitionOptions {
|
|
5
|
+
value: number;
|
|
6
|
+
duration?: number;
|
|
7
|
+
transition?: TransitionCurve;
|
|
8
|
+
format?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface ElWithTransition extends HTMLElement {
|
|
11
|
+
__transitionNumber__?: {
|
|
12
|
+
source: Ref<number>;
|
|
13
|
+
stop: () => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const _default: {
|
|
17
|
+
mounted(el: ElWithTransition, binding: DirectiveBinding<TransitionOptions | string | number>, vnode: VNode): void;
|
|
18
|
+
updated(el: ElWithTransition, binding: DirectiveBinding<TransitionOptions | string | number>, vnode: VNode): void;
|
|
19
|
+
unmounted(el: ElWithTransition): void;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-b2d248d6] .el-table__inner-wrapper{display:flex;flex-direction:column}[data-v-b2d248d6] .el-scrollbar__view{will-change:transform}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { defineComponent as x, resolveDirective as O, ref as _, computed as w, resolveComponent as F, withDirectives as T, openBlock as H, createElementBlock as Q, createVNode as y, mergeProps as P, withCtx as I, unref as $, createElementVNode as L, normalizeStyle as M, Fragment as U, h as z, render as S, getCurrentScope as J, onScopeDispose as q, shallowRef as G, watch as D, toValue as m, watchEffect as W } from "vue";
|
|
2
|
+
import { ElTableColumn as k } from "element-plus";
|
|
3
|
+
const X = {
|
|
4
|
+
"element-loading-background": "transparent",
|
|
5
|
+
class: "virtual-table-container"
|
|
6
|
+
}, Y = /* @__PURE__ */ x({
|
|
7
|
+
__name: "EbCustomTable",
|
|
8
|
+
props: {
|
|
9
|
+
tableHeader: {},
|
|
10
|
+
customListLoading: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
data: {},
|
|
15
|
+
isDataSlice: {
|
|
16
|
+
default: () => ({
|
|
17
|
+
isSlice: !1
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
rowHeight: {}
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const t = e, o = O("eb-jsx-table"), n = /* @__PURE__ */ x({
|
|
24
|
+
name: "TableColumnsRender",
|
|
25
|
+
props: {
|
|
26
|
+
columns: {
|
|
27
|
+
type: Array,
|
|
28
|
+
required: !0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(a) {
|
|
32
|
+
const l = (d) => d.map((u, v) => u.children && u.children.length > 0 ? y(k, {
|
|
33
|
+
key: u.label + v,
|
|
34
|
+
label: u.label,
|
|
35
|
+
align: u.align
|
|
36
|
+
}, {
|
|
37
|
+
default: () => l(u.children)
|
|
38
|
+
}) : u.prop ? y(k, {
|
|
39
|
+
key: u.prop + v,
|
|
40
|
+
prop: u.prop,
|
|
41
|
+
label: u.label,
|
|
42
|
+
width: u.width,
|
|
43
|
+
align: u.align,
|
|
44
|
+
"show-overflow-tooltip": u.showOverflowTooltip
|
|
45
|
+
}, {
|
|
46
|
+
default: (g) => u.customList?.map((b, h) => {
|
|
47
|
+
const A = g.row[u.prop], C = g.row;
|
|
48
|
+
return b.cellRenderer && o ? T(y("span", {
|
|
49
|
+
key: h + "b",
|
|
50
|
+
class: u.boxClass || "",
|
|
51
|
+
style: u.boxStyle,
|
|
52
|
+
onClick: (B) => {
|
|
53
|
+
b.click && (B.stopPropagation(), b.click?.(C));
|
|
54
|
+
}
|
|
55
|
+
}, null), [[o, [b.cellRenderer, A, C, u.prop]]]) : null;
|
|
56
|
+
})
|
|
57
|
+
}) : null);
|
|
58
|
+
return () => y(U, null, [l(a.columns)]);
|
|
59
|
+
}
|
|
60
|
+
}), r = _(), i = _(0), c = _(0), s = w(() => {
|
|
61
|
+
if (!t.isDataSlice.isSlice) return t.data;
|
|
62
|
+
const a = Math.max(0, c.value - 5), l = Math.min(t.data.length, a + (t.isDataSlice.num || 20) + 10);
|
|
63
|
+
return t.data.slice(a, l);
|
|
64
|
+
}), f = w(() => {
|
|
65
|
+
if (!t.isDataSlice.isSlice)
|
|
66
|
+
return 0;
|
|
67
|
+
const a = Math.min(t.data.length, c.value + (t.isDataSlice.num || 20) + 5);
|
|
68
|
+
return (t.data.length - a) * t.rowHeight;
|
|
69
|
+
}), p = ({
|
|
70
|
+
scrollTop: a
|
|
71
|
+
}) => {
|
|
72
|
+
if (i.value = a, t.isDataSlice.isSlice) {
|
|
73
|
+
c.value = Math.floor(a / t.rowHeight);
|
|
74
|
+
const l = r.value?.$el.querySelector(".el-scrollbar__view");
|
|
75
|
+
if (l) {
|
|
76
|
+
const d = Math.max(0, c.value - 5) * t.rowHeight;
|
|
77
|
+
l.style.transform = `translateY(${d}px)`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return (a, l) => {
|
|
82
|
+
const d = F("el-table"), u = O("loading");
|
|
83
|
+
return T((H(), Q("div", X, [y(d, P({
|
|
84
|
+
onScroll: p,
|
|
85
|
+
ref_key: "customTableRef",
|
|
86
|
+
ref: r,
|
|
87
|
+
class: "sub_table",
|
|
88
|
+
style: {
|
|
89
|
+
width: "100%"
|
|
90
|
+
},
|
|
91
|
+
data: s.value
|
|
92
|
+
}, a.$attrs, {
|
|
93
|
+
"row-style": {
|
|
94
|
+
maxHeight: e.rowHeight + "px"
|
|
95
|
+
}
|
|
96
|
+
}), {
|
|
97
|
+
append: I(() => [L("div", {
|
|
98
|
+
style: M({
|
|
99
|
+
height: f.value + "px"
|
|
100
|
+
})
|
|
101
|
+
}, null, 4)]),
|
|
102
|
+
default: I(() => [y($(n), {
|
|
103
|
+
columns: e.tableHeader
|
|
104
|
+
}, null, 8, ["columns"])]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 16, ["data", "row-style"])])), [[u, e.customListLoading]]);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}), K = (e, t) => {
|
|
110
|
+
const o = e.__vccOpts || e;
|
|
111
|
+
for (const [n, r] of t)
|
|
112
|
+
o[n] = r;
|
|
113
|
+
return o;
|
|
114
|
+
}, Z = /* @__PURE__ */ K(Y, [["__scopeId", "data-v-b2d248d6"]]), ge = (e) => {
|
|
115
|
+
const t = document.createElement("div");
|
|
116
|
+
t.className = "eb-message-container";
|
|
117
|
+
const o = () => {
|
|
118
|
+
S(null, t), t.remove();
|
|
119
|
+
}, n = () => {
|
|
120
|
+
const c = {
|
|
121
|
+
position: "fixed",
|
|
122
|
+
zIndex: 1e3,
|
|
123
|
+
backgroundColor: "#fff",
|
|
124
|
+
border: "1px solid #ccc",
|
|
125
|
+
borderRadius: "8px",
|
|
126
|
+
padding: "20px",
|
|
127
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
|
|
128
|
+
};
|
|
129
|
+
if (e.position === "center")
|
|
130
|
+
return {
|
|
131
|
+
...c,
|
|
132
|
+
top: "50%",
|
|
133
|
+
left: "50%",
|
|
134
|
+
transform: "translate(-50%, -50%)"
|
|
135
|
+
};
|
|
136
|
+
const s = {
|
|
137
|
+
left: "50%",
|
|
138
|
+
transform: "translateX(-50%)"
|
|
139
|
+
};
|
|
140
|
+
return e.position === "left" ? (s.left = "20px", s.top = "50%", s.transform = "translateY(-50%)") : e.position === "right" ? (s.left = "auto", s.right = "20px", s.top = "50%", s.transform = "translateY(-50%)") : s[e.position] = "20px", {
|
|
141
|
+
...c,
|
|
142
|
+
...s
|
|
143
|
+
};
|
|
144
|
+
}, i = z(/* @__PURE__ */ x({
|
|
145
|
+
setup() {
|
|
146
|
+
return () => y("div", {
|
|
147
|
+
class: "dialog-message-wrapper",
|
|
148
|
+
style: n()
|
|
149
|
+
}, [typeof e.jsx == "function" ? e.jsx() : e.jsx]);
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
return S(i, t), document.body.appendChild(t), e.timeClose && setTimeout(o, e.timeClose), {
|
|
153
|
+
close: o
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
function ee(e, t) {
|
|
157
|
+
return J() ? (q(e, t), !0) : !1;
|
|
158
|
+
}
|
|
159
|
+
const te = typeof window < "u" && typeof document < "u";
|
|
160
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
161
|
+
function ne(e, t = !1, o = "Timeout") {
|
|
162
|
+
return new Promise((n, r) => {
|
|
163
|
+
setTimeout(t ? () => r(o) : n, e);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function R(e) {
|
|
167
|
+
return e;
|
|
168
|
+
}
|
|
169
|
+
const oe = te ? window : void 0, ae = {
|
|
170
|
+
easeInSine: [
|
|
171
|
+
0.12,
|
|
172
|
+
0,
|
|
173
|
+
0.39,
|
|
174
|
+
0
|
|
175
|
+
],
|
|
176
|
+
easeOutSine: [
|
|
177
|
+
0.61,
|
|
178
|
+
1,
|
|
179
|
+
0.88,
|
|
180
|
+
1
|
|
181
|
+
],
|
|
182
|
+
easeInOutSine: [
|
|
183
|
+
0.37,
|
|
184
|
+
0,
|
|
185
|
+
0.63,
|
|
186
|
+
1
|
|
187
|
+
],
|
|
188
|
+
easeInQuad: [
|
|
189
|
+
0.11,
|
|
190
|
+
0,
|
|
191
|
+
0.5,
|
|
192
|
+
0
|
|
193
|
+
],
|
|
194
|
+
easeOutQuad: [
|
|
195
|
+
0.5,
|
|
196
|
+
1,
|
|
197
|
+
0.89,
|
|
198
|
+
1
|
|
199
|
+
],
|
|
200
|
+
easeInOutQuad: [
|
|
201
|
+
0.45,
|
|
202
|
+
0,
|
|
203
|
+
0.55,
|
|
204
|
+
1
|
|
205
|
+
],
|
|
206
|
+
easeInCubic: [
|
|
207
|
+
0.32,
|
|
208
|
+
0,
|
|
209
|
+
0.67,
|
|
210
|
+
0
|
|
211
|
+
],
|
|
212
|
+
easeOutCubic: [
|
|
213
|
+
0.33,
|
|
214
|
+
1,
|
|
215
|
+
0.68,
|
|
216
|
+
1
|
|
217
|
+
],
|
|
218
|
+
easeInOutCubic: [
|
|
219
|
+
0.65,
|
|
220
|
+
0,
|
|
221
|
+
0.35,
|
|
222
|
+
1
|
|
223
|
+
],
|
|
224
|
+
easeInQuart: [
|
|
225
|
+
0.5,
|
|
226
|
+
0,
|
|
227
|
+
0.75,
|
|
228
|
+
0
|
|
229
|
+
],
|
|
230
|
+
easeOutQuart: [
|
|
231
|
+
0.25,
|
|
232
|
+
1,
|
|
233
|
+
0.5,
|
|
234
|
+
1
|
|
235
|
+
],
|
|
236
|
+
easeInOutQuart: [
|
|
237
|
+
0.76,
|
|
238
|
+
0,
|
|
239
|
+
0.24,
|
|
240
|
+
1
|
|
241
|
+
],
|
|
242
|
+
easeInQuint: [
|
|
243
|
+
0.64,
|
|
244
|
+
0,
|
|
245
|
+
0.78,
|
|
246
|
+
0
|
|
247
|
+
],
|
|
248
|
+
easeOutQuint: [
|
|
249
|
+
0.22,
|
|
250
|
+
1,
|
|
251
|
+
0.36,
|
|
252
|
+
1
|
|
253
|
+
],
|
|
254
|
+
easeInOutQuint: [
|
|
255
|
+
0.83,
|
|
256
|
+
0,
|
|
257
|
+
0.17,
|
|
258
|
+
1
|
|
259
|
+
],
|
|
260
|
+
easeInExpo: [
|
|
261
|
+
0.7,
|
|
262
|
+
0,
|
|
263
|
+
0.84,
|
|
264
|
+
0
|
|
265
|
+
],
|
|
266
|
+
easeOutExpo: [
|
|
267
|
+
0.16,
|
|
268
|
+
1,
|
|
269
|
+
0.3,
|
|
270
|
+
1
|
|
271
|
+
],
|
|
272
|
+
easeInOutExpo: [
|
|
273
|
+
0.87,
|
|
274
|
+
0,
|
|
275
|
+
0.13,
|
|
276
|
+
1
|
|
277
|
+
],
|
|
278
|
+
easeInCirc: [
|
|
279
|
+
0.55,
|
|
280
|
+
0,
|
|
281
|
+
1,
|
|
282
|
+
0.45
|
|
283
|
+
],
|
|
284
|
+
easeOutCirc: [
|
|
285
|
+
0,
|
|
286
|
+
0.55,
|
|
287
|
+
0.45,
|
|
288
|
+
1
|
|
289
|
+
],
|
|
290
|
+
easeInOutCirc: [
|
|
291
|
+
0.85,
|
|
292
|
+
0,
|
|
293
|
+
0.15,
|
|
294
|
+
1
|
|
295
|
+
],
|
|
296
|
+
easeInBack: [
|
|
297
|
+
0.36,
|
|
298
|
+
0,
|
|
299
|
+
0.66,
|
|
300
|
+
-0.56
|
|
301
|
+
],
|
|
302
|
+
easeOutBack: [
|
|
303
|
+
0.34,
|
|
304
|
+
1.56,
|
|
305
|
+
0.64,
|
|
306
|
+
1
|
|
307
|
+
],
|
|
308
|
+
easeInOutBack: [
|
|
309
|
+
0.68,
|
|
310
|
+
-0.6,
|
|
311
|
+
0.32,
|
|
312
|
+
1.6
|
|
313
|
+
]
|
|
314
|
+
}, re = /* @__PURE__ */ Object.assign({}, { linear: R }, ae);
|
|
315
|
+
function le([e, t, o, n]) {
|
|
316
|
+
const r = (a, l) => 1 - 3 * l + 3 * a, i = (a, l) => 3 * l - 6 * a, c = (a) => 3 * a, s = (a, l, d) => ((r(l, d) * a + i(l, d)) * a + c(l)) * a, f = (a, l, d) => 3 * r(l, d) * a * a + 2 * i(l, d) * a + c(l), p = (a) => {
|
|
317
|
+
let l = a;
|
|
318
|
+
for (let d = 0; d < 4; ++d) {
|
|
319
|
+
const u = f(l, e, o);
|
|
320
|
+
if (u === 0) return l;
|
|
321
|
+
const v = s(l, e, o) - a;
|
|
322
|
+
l -= v / u;
|
|
323
|
+
}
|
|
324
|
+
return l;
|
|
325
|
+
};
|
|
326
|
+
return (a) => e === t && o === n ? a : s(p(a), t, n);
|
|
327
|
+
}
|
|
328
|
+
function E(e, t, o) {
|
|
329
|
+
return e + o * (t - e);
|
|
330
|
+
}
|
|
331
|
+
function se(e, t, o) {
|
|
332
|
+
const n = m(e), r = m(t);
|
|
333
|
+
if (typeof n == "number" && typeof r == "number") return E(n, r, o);
|
|
334
|
+
if (Array.isArray(n) && Array.isArray(r)) return n.map((i, c) => E(i, m(r[c]), o));
|
|
335
|
+
throw new TypeError("Unknown transition type, specify an interpolation function.");
|
|
336
|
+
}
|
|
337
|
+
function N(e) {
|
|
338
|
+
var t;
|
|
339
|
+
return typeof e == "function" ? e : (t = m(e)) !== null && t !== void 0 ? t : R;
|
|
340
|
+
}
|
|
341
|
+
function ie(e, t, o, n = {}) {
|
|
342
|
+
var r;
|
|
343
|
+
const { window: i = oe } = n, c = m(t), s = m(o), f = (r = m(n.duration)) !== null && r !== void 0 ? r : 1e3, p = Date.now(), a = Date.now() + f, l = typeof n.interpolation == "function" ? n.interpolation : se, d = typeof n.easing < "u" ? N(n.easing) : N(n.transition), u = typeof d == "function" ? d : le(d);
|
|
344
|
+
return new Promise((v) => {
|
|
345
|
+
e.value = c;
|
|
346
|
+
const g = () => {
|
|
347
|
+
var b;
|
|
348
|
+
if (!((b = n.abort) === null || b === void 0) && b.call(n)) {
|
|
349
|
+
v();
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const h = Date.now();
|
|
353
|
+
e.value = l(c, s, u((h - p) / f)), h < a ? i?.requestAnimationFrame(g) : (e.value = s, v());
|
|
354
|
+
};
|
|
355
|
+
g();
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function ue(e, t = {}) {
|
|
359
|
+
let o = 0;
|
|
360
|
+
const n = () => {
|
|
361
|
+
const i = m(e);
|
|
362
|
+
return typeof t.interpolation > "u" && Array.isArray(i) ? i.map(m) : i;
|
|
363
|
+
}, r = G(n());
|
|
364
|
+
return D(n, async (i) => {
|
|
365
|
+
var c, s;
|
|
366
|
+
if (m(t.disabled)) return;
|
|
367
|
+
const f = ++o;
|
|
368
|
+
t.delay && await ne(m(t.delay)), f === o && ((c = t.onStarted) === null || c === void 0 || c.call(t), await ie(r, r.value, i, {
|
|
369
|
+
...t,
|
|
370
|
+
abort: () => {
|
|
371
|
+
var p;
|
|
372
|
+
return f !== o || ((p = t.abort) === null || p === void 0 ? void 0 : p.call(t));
|
|
373
|
+
}
|
|
374
|
+
}), (s = t.onFinished) === null || s === void 0 || s.call(t));
|
|
375
|
+
}, { deep: !0 }), D(() => m(t.disabled), (i) => {
|
|
376
|
+
i && (o++, r.value = n());
|
|
377
|
+
}), ee(() => {
|
|
378
|
+
o++;
|
|
379
|
+
}), w(() => m(t.disabled) ? n() : r.value);
|
|
380
|
+
}
|
|
381
|
+
function ce(e, t, o) {
|
|
382
|
+
return o ? e.toLocaleString(void 0, {
|
|
383
|
+
minimumFractionDigits: t,
|
|
384
|
+
maximumFractionDigits: t
|
|
385
|
+
}) : e.toFixed(t);
|
|
386
|
+
}
|
|
387
|
+
function V(e, t) {
|
|
388
|
+
const {
|
|
389
|
+
value: o,
|
|
390
|
+
duration: n = 1e3,
|
|
391
|
+
transition: r = "easeInOutCubic",
|
|
392
|
+
format: i = !1
|
|
393
|
+
} = t;
|
|
394
|
+
if (typeof o != "number") {
|
|
395
|
+
e.textContent = String(o ?? "");
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const c = e.__transitionNumber__?.source.value, s = _(typeof c == "number" ? c : 0), f = ue(s, {
|
|
399
|
+
duration: n,
|
|
400
|
+
transition: re[r]
|
|
401
|
+
}), p = w(() => {
|
|
402
|
+
const l = o.toString(), d = l.indexOf(".");
|
|
403
|
+
return d === -1 ? 0 : l.length - d - 1;
|
|
404
|
+
}), a = W(() => {
|
|
405
|
+
e.textContent = ce(f.value, p.value, i);
|
|
406
|
+
});
|
|
407
|
+
e.__transitionNumber__ = { source: s, stop: a }, s.value = o;
|
|
408
|
+
}
|
|
409
|
+
const de = {
|
|
410
|
+
mounted(e, t, o) {
|
|
411
|
+
const n = typeof t.value == "object" ? t.value.value : t.value;
|
|
412
|
+
typeof n == "number" ? V(e, t.value) : e.textContent = String(n ?? "");
|
|
413
|
+
},
|
|
414
|
+
updated(e, t, o) {
|
|
415
|
+
const n = t.value, r = typeof n == "object" ? n.value : n;
|
|
416
|
+
typeof r == "number" ? e.__transitionNumber__ ? e.__transitionNumber__.source.value = r : V(e, n) : e.textContent = String(r ?? "");
|
|
417
|
+
},
|
|
418
|
+
unmounted(e) {
|
|
419
|
+
e.__transitionNumber__?.stop(), delete e.__transitionNumber__;
|
|
420
|
+
}
|
|
421
|
+
}, fe = {
|
|
422
|
+
mounted(e, t, o) {
|
|
423
|
+
j(e, t, o);
|
|
424
|
+
},
|
|
425
|
+
updated(e, t, o) {
|
|
426
|
+
pe(t) && j(e, t, o);
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
function j(e, t, o) {
|
|
430
|
+
try {
|
|
431
|
+
const [n, r, i, c] = t.value, [s, f, p] = t.oldValue || [];
|
|
432
|
+
(r !== f || JSON.stringify(i) !== JSON.stringify(p)) && S(
|
|
433
|
+
n(
|
|
434
|
+
{
|
|
435
|
+
val: r,
|
|
436
|
+
rowData: i,
|
|
437
|
+
prop: c
|
|
438
|
+
},
|
|
439
|
+
e,
|
|
440
|
+
t,
|
|
441
|
+
o
|
|
442
|
+
),
|
|
443
|
+
e
|
|
444
|
+
);
|
|
445
|
+
} catch (n) {
|
|
446
|
+
console.error("[v-jsx-table] updated error:", n);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function pe(e) {
|
|
450
|
+
return JSON.stringify(e.value) !== JSON.stringify(e.oldValue);
|
|
451
|
+
}
|
|
452
|
+
const me = (e) => {
|
|
453
|
+
e.directive("eb-jsx-table", fe), e.directive("eb-transition-text", de);
|
|
454
|
+
}, be = {
|
|
455
|
+
EbCustomTable: Z
|
|
456
|
+
}, he = {
|
|
457
|
+
install(e, t = { global: !0 }) {
|
|
458
|
+
if (me(e), t.global !== !1) {
|
|
459
|
+
for (const [o, n] of Object.entries(be))
|
|
460
|
+
e.component(o, n);
|
|
461
|
+
console.log("[Everybody-UI] 全量组件已注册");
|
|
462
|
+
} else
|
|
463
|
+
console.log("[Everybody-UI] 按需模式:组件需通过 Resolver 或手动引入");
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
export {
|
|
467
|
+
Z as EbCustomTable,
|
|
468
|
+
ge as EbMessage,
|
|
469
|
+
he as default
|
|
470
|
+
};
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as EbCustomTable } from './components/table/src/EbCustomTable.vue';
|
|
3
|
+
import { EbMessage } from './components/message/src/EBmessage';
|
|
4
|
+
export interface EverybodyUIOptions {
|
|
5
|
+
global?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export { EbCustomTable, EbMessage };
|
|
8
|
+
export * from './index.type';
|
|
9
|
+
declare const _default: {
|
|
10
|
+
install(app: App, options?: EverybodyUIOptions): void;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function t() {
|
|
2
|
+
return {
|
|
3
|
+
type: "component",
|
|
4
|
+
resolve: (e) => {
|
|
5
|
+
if (e.startsWith("Eb")) {
|
|
6
|
+
const r = e.slice(2);
|
|
7
|
+
return r.charAt(0).toLowerCase() + r.slice(1), {
|
|
8
|
+
name: e,
|
|
9
|
+
from: "@yuiyideyui/everybody-ui"
|
|
10
|
+
// 如果你的 CSS 也是按组件名分的,可以开启自动加载样式
|
|
11
|
+
// sideEffects: `@yuiyideyui/everybody-ui/dist/theme/${exportName}.css`
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
t as EverybodyUIResolver
|
|
19
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuiyideyui/everybody-ui",
|
|
3
|
+
"version": "1.0.26",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/yuiyideyui/everybody-ui.git",
|
|
9
|
+
"directory": "packages/everybody-ui"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"provenance": false
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.umd.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/types/main.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types/main.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./resolver": {
|
|
24
|
+
"types": "./dist/resolver.d.ts",
|
|
25
|
+
"import": "./dist/resolver.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "vite build"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"element-plus": "^2.13.2"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@vueuse/core": "^14.2.1",
|
|
39
|
+
"vue": "^3.5.20"
|
|
40
|
+
}
|
|
41
|
+
}
|