@huyooo/ui 1.0.2 → 1.0.3

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/dist/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-QWUNRjGh.js";
1
+ import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -1,279 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- /* empty css */
4
- import "./index-D3Kp6R4z.js";
5
- /* empty css */
6
- /* empty css */
7
- /* empty css */
8
- import { defineComponent as O, ref as q, computed as b, onMounted as Z, nextTick as A, watch as I, onBeforeUnmount as ee, openBlock as o, createElementBlock as d, normalizeStyle as x, normalizeClass as C, renderSlot as R, useModel as L, createVNode as z, unref as c, withCtx as S, createElementVNode as g, createBlock as K, createCommentVNode as m, Fragment as w, renderList as W, toDisplayString as E, createTextVNode as te, mergeModels as P, useSlots as ne } from "vue";
9
- import { Spin as ie, Checkbox as V, Tooltip as le, Empty as ae, Pagination as oe } from "@arco-design/web-vue";
10
- import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- import { g as N, a as B } from "./index-D56hUMeD.js";
12
- const se = /* @__PURE__ */ O({
13
- __name: "Ellipsis",
14
- props: {
15
- open: {
16
- type: Boolean,
17
- required: !1,
18
- default: () => !0
19
- }
20
- },
21
- setup(v) {
22
- const y = v, t = q(null), h = q(0), u = b(() => {
23
- var _, k;
24
- if (!y.open || h.value === 0)
25
- return {};
26
- const r = (k = (_ = t.value) == null ? void 0 : _.parentElement) == null ? void 0 : k.style.width;
27
- return r && r !== "auto" ? {
28
- width: r
29
- } : {
30
- width: `${h.value}px`
31
- };
32
- });
33
- function f() {
34
- t.value && y.open && A(() => {
35
- t.value && (h.value = t.value.clientWidth);
36
- });
37
- }
38
- function p() {
39
- f();
40
- }
41
- return Z(() => {
42
- y.open && A(() => {
43
- f(), window.addEventListener("resize", p);
44
- });
45
- }), I(() => y.open, (r) => {
46
- r ? (f(), window.addEventListener("resize", p)) : window.removeEventListener("resize", p);
47
- }), ee(() => {
48
- window.removeEventListener("resize", p);
49
- }), (r, _) => (o(), d("div", {
50
- ref_key: "ellipsisContainer",
51
- ref: t,
52
- class: C({
53
- ellipsis: v.open
54
- }),
55
- style: x(v.open ? u.value : {})
56
- }, [R(r.$slots, "default", {}, void 0, !0)], 6));
57
- }
58
- }), re = /* @__PURE__ */ j(se, [["__scopeId", "data-v-4874d041"]]), de = {
59
- class: "CubeTableCom"
60
- }, ue = {
61
- class: "tableContain"
62
- }, ce = {
63
- class: "table-header"
64
- }, pe = {
65
- key: 0,
66
- class: "header-cell checkbox-cell"
67
- }, fe = {
68
- class: "table-body"
69
- }, he = ["onMouseenter", "onMouseleave"], ve = {
70
- key: 0,
71
- class: "contain"
72
- }, ge = {
73
- class: "pagination"
74
- }, ye = /* @__PURE__ */ O({
75
- __name: "CustomTable",
76
- props: /* @__PURE__ */ P({
77
- loading: {
78
- type: Boolean,
79
- required: !1,
80
- default: () => !1
81
- },
82
- bordered: {
83
- type: Boolean,
84
- required: !1,
85
- default: () => !0
86
- },
87
- data: {
88
- type: Array,
89
- required: !0
90
- },
91
- pagination: {
92
- type: Object,
93
- required: !1,
94
- default: () => null
95
- },
96
- columns: {
97
- type: Array,
98
- required: !0
99
- },
100
- /** 行选择配置 */
101
- rowSelection: {
102
- type: Object,
103
- required: !1,
104
- default: void 0
105
- },
106
- /** 行数据的唯一标识字段,默认 'id' */
107
- rowKey: {
108
- type: String,
109
- required: !1,
110
- default: "id"
111
- }
112
- }, {
113
- selectedKeys: {
114
- default: () => []
115
- },
116
- selectedKeysModifiers: {},
117
- activeKey: {
118
- default: -1
119
- },
120
- activeKeyModifiers: {}
121
- }),
122
- emits: /* @__PURE__ */ P(["mouseenter", "mouseleave", "pageChange", "pageSizeChange"], ["update:selectedKeys", "update:activeKey"]),
123
- setup(v, {
124
- emit: y
125
- }) {
126
- const t = v, h = y, u = L(v, "selectedKeys"), f = L(v, "activeKey");
127
- function p(e, i) {
128
- return e[t.rowKey] ?? String(i);
129
- }
130
- function r(e, i) {
131
- const s = p(e, i);
132
- return u.value.includes(s);
133
- }
134
- const _ = b(() => t.data.length === 0 ? !1 : t.data.every((e, i) => r(e, i))), k = b(() => {
135
- if (t.data.length === 0) return !1;
136
- const e = t.data.filter((i, s) => r(i, s)).length;
137
- return e > 0 && e < t.data.length;
138
- });
139
- function H(e, i, s) {
140
- const n = p(e, i);
141
- s ? u.value.includes(n) || (u.value = [...u.value, n]) : u.value = u.value.filter((l) => l !== n);
142
- }
143
- function J(e) {
144
- if (Array.isArray(e) ? e.length > 0 : e) {
145
- const s = t.data.map((l, a) => p(l, a)), n = /* @__PURE__ */ new Set([...u.value, ...s]);
146
- u.value = Array.from(n);
147
- } else {
148
- const s = new Set(t.data.map((n, l) => p(n, l)));
149
- u.value = u.value.filter((n) => !s.has(n));
150
- }
151
- }
152
- const D = b(() => {
153
- const e = t.columns.map((i) => i.width ? `${i.width}px` : i.minWidth ? `minmax(${i.minWidth}px, 1fr)` : "minmax(120px, 1fr)");
154
- return t.rowSelection && e.unshift("48px"), e.join(" ");
155
- }), F = b(() => `${t.columns.reduce((i, s) => {
156
- const n = Number(s.width || s.minWidth || 120);
157
- return i + n;
158
- }, t.rowSelection ? 48 : 0)}px`);
159
- function M(e) {
160
- const i = {};
161
- return e.maxWidth && (i.maxWidth = `${e.maxWidth}px`), i;
162
- }
163
- function U(e) {
164
- h("pageChange", e);
165
- }
166
- function G(e) {
167
- h("pageSizeChange", e);
168
- }
169
- function Q(e) {
170
- const i = ne();
171
- return e ? !!i[e] : !1;
172
- }
173
- function T(e) {
174
- return typeof e.cellClassName != "string" ? !1 : e.cellClassName.split(/\s+/).includes("catalog-cell-wrap");
175
- }
176
- function X(e) {
177
- f.value = e, h("mouseenter", e);
178
- }
179
- function Y(e) {
180
- f.value = -1, h("mouseleave", e);
181
- }
182
- return (e, i) => (o(), d("div", de, [z(c(ie), {
183
- loading: t.loading,
184
- tip: "数据加载中"
185
- }, {
186
- default: S(() => {
187
- var s;
188
- return [g("div", ue, [g("div", {
189
- class: "flex-table",
190
- style: x({
191
- "grid-template-columns": D.value,
192
- "min-width": F.value
193
- })
194
- }, [g("div", ce, [t.rowSelection ? (o(), d("div", pe, [t.rowSelection.showCheckedAll !== !1 ? (o(), K(c(V), {
195
- key: 0,
196
- "model-value": _.value,
197
- indeterminate: k.value,
198
- onChange: J
199
- }, null, 8, ["model-value", "indeterminate"])) : m("", !0)])) : m("", !0), (o(!0), d(w, null, W(t.columns, (n, l) => (o(), d("div", {
200
- key: l,
201
- class: C(["header-cell", {
202
- fixed: n.fixed,
203
- fixedBackground: n.fixed,
204
- lastBorder: l === t.columns.length - 1
205
- }]),
206
- style: x(M(n))
207
- }, E(n.title), 7))), 128))]), g("div", fe, [(o(!0), d(w, null, W(t.data, (n, l) => (o(), d("div", {
208
- key: p(n, l),
209
- class: C(["table-row", {
210
- trListHover: l === f.value,
211
- "row-selected": r(n, l)
212
- }]),
213
- onMouseenter: (a) => X(l),
214
- onMouseleave: (a) => Y(l)
215
- }, [t.rowSelection ? (o(), d("div", {
216
- key: 0,
217
- class: C(["body-cell checkbox-cell", {
218
- trListHover: l === f.value,
219
- "row-selected": r(n, l)
220
- }])
221
- }, [z(c(V), {
222
- "model-value": r(n, l),
223
- onChange: (a) => H(n, l, a)
224
- }, null, 8, ["model-value", "onChange"])], 2)) : m("", !0), (o(!0), d(w, null, W(t.columns, (a, $) => (o(), d("div", {
225
- key: $,
226
- class: C(["body-cell", {
227
- [a.cellClassName]: typeof a.cellClassName == "string",
228
- fixed: a.fixed,
229
- trListHover: l === f.value,
230
- "row-selected": r(n, l),
231
- lastBorder: $ === t.columns.length - 1
232
- }]),
233
- style: x(M(a))
234
- }, [g("div", {
235
- class: C(["body-cell-inner", {
236
- "body-cell-inner--wrap": T(a)
237
- }])
238
- }, [z(re, {
239
- open: !!a.ellipsis && !T(a)
240
- }, {
241
- default: S(() => [Q(a.slotName) ? R(e.$slots, a.slotName, {
242
- key: 0,
243
- record: n
244
- }, void 0, !0) : (o(), d(w, {
245
- key: 1
246
- }, [a.dataIndex ? (o(), d(w, {
247
- key: 0
248
- }, [a.tooltip ? (o(), K(c(le), {
249
- key: 0,
250
- content: c(N)(c(B)(n, a.dataIndex)),
251
- position: "bottom"
252
- }, {
253
- default: S(() => [g("span", null, E(c(N)(c(B)(n, a.dataIndex))), 1)]),
254
- _: 2
255
- }, 1032, ["content"])) : (o(), d(w, {
256
- key: 1
257
- }, [te(E(c(N)(c(B)(n, a.dataIndex))), 1)], 64))], 64)) : m("", !0)], 64))]),
258
- _: 2
259
- }, 1032, ["open"])], 2)], 6))), 128))], 42, he))), 128))])], 4), t.data.length === 0 ? (o(), d("div", ve, [z(c(ae))])) : m("", !0)]), g("div", ge, [t.pagination ? (o(), K(c(oe), {
260
- key: 0,
261
- current: t.pagination.current,
262
- total: ((s = t.pagination) == null ? void 0 : s.total) || 0,
263
- pageSize: t.pagination.pageSize,
264
- showTotal: t.pagination.showTotal ?? !0,
265
- showJumper: t.pagination.showJumper ?? !1,
266
- showPageSize: t.pagination.showPageSize ?? !0,
267
- pageSizeOptions: t.pagination.pageSizeOptions ?? [10, 20, 50, 100],
268
- onChange: U,
269
- onPageSizeChange: G
270
- }, null, 8, ["current", "total", "pageSize", "showTotal", "showJumper", "showPageSize", "pageSizeOptions"])) : m("", !0)])];
271
- }),
272
- _: 3
273
- }, 8, ["loading"])]));
274
- }
275
- }), Ee = /* @__PURE__ */ j(ye, [["__scopeId", "data-v-3bbfd66b"]]);
276
- export {
277
- Ee as C,
278
- re as E
279
- };