@gct-paas/v-ben 0.1.4-dev.13 → 0.1.4-dev.14

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.
@@ -1,2 +1,2 @@
1
- .vben-basic-table-action{align-items:center;display:flex}.vben-basic-table-action .action-divider{display:table}.vben-basic-table-action.left{justify-content:flex-start}.vben-basic-table-action.center{justify-content:center}.vben-basic-table-action.right{justify-content:flex-end}.vben-basic-table-action button{align-items:center;display:flex}.vben-basic-table-action button span{margin-left:0!important}.vben-basic-table-action button.ant-btn-circle span{margin:auto!important}.vben-basic-table-action .ant-divider,.vben-basic-table-action .ant-divider-vertical{margin:0 10px}.vben-basic-table-action .icon-more{transform:rotate(90deg)}.vben-basic-table-action .icon-more svg{font-size:1.1em;font-weight:700}.custom-btn-container[data-v-305f4090]{white-space:nowrap;text-align:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;color:#fff;border:1px solid #0000;border-color:var(--ant-primary-color);background-image:none;background:var(--ant-primary-color);text-shadow:0 -1px #0000001f;vertical-align:top;border-radius:4px;justify-content:center;align-items:center;height:32px;font-size:14px;font-weight:400;line-height:1.5715;transition:all .3s cubic-bezier(.645,.045,.355,1);display:inline-flex;position:relative;box-shadow:0 2px #0000000b}.custom-btn-container .btn-left[data-v-305f4090]{justify-content:center;align-items:center;height:32px;margin-right:1px;padding:4px 12px;display:flex}.custom-btn-container .btn-left-title[data-v-305f4090]{margin-left:4px;line-height:22px}.custom-btn-container .btn-left[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}.custom-btn-container .btn-right[data-v-305f4090]{justify-content:center;align-items:center;height:32px;margin-left:2px;padding:4px 12px;display:flex;position:relative}.custom-btn-container .btn-right[data-v-305f4090]:before{content:"";background-color:#fff;width:1px;height:14px;position:absolute;left:-2px}.custom-btn-container .btn-right[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}
1
+ .vben-basic-table-action{align-items:center;display:flex}.vben-basic-table-action .action-divider{display:table}.vben-basic-table-action.left{justify-content:flex-start}.vben-basic-table-action.center{justify-content:center}.vben-basic-table-action.right{justify-content:flex-end}.vben-basic-table-action button{align-items:center;display:flex}.vben-basic-table-action button span{margin-left:0!important}.vben-basic-table-action button.ant-btn-circle span{margin:auto!important}.vben-basic-table-action .ant-divider,.vben-basic-table-action .ant-divider-vertical{margin:0 10px}.vben-basic-table-action .icon-more{transform:rotate(90deg)}.vben-basic-table-action .icon-more svg{font-size:1.1em;font-weight:700}.custom-btn-container[data-v-305f4090]{white-space:nowrap;text-align:center;cursor:pointer;user-select:none;touch-action:manipulation;color:#fff;border:1px solid #0000;border-color:var(--ant-primary-color);background-image:none;background:var(--ant-primary-color);text-shadow:0 -1px #0000001f;vertical-align:top;border-radius:4px;justify-content:center;align-items:center;height:32px;font-size:14px;font-weight:400;line-height:1.5715;transition:all .3s cubic-bezier(.645,.045,.355,1);display:inline-flex;position:relative;box-shadow:0 2px #0000000b}.custom-btn-container .btn-left[data-v-305f4090]{justify-content:center;align-items:center;height:32px;margin-right:1px;padding:4px 12px;display:flex}.custom-btn-container .btn-left-title[data-v-305f4090]{margin-left:4px;line-height:22px}.custom-btn-container .btn-left[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}.custom-btn-container .btn-right[data-v-305f4090]{justify-content:center;align-items:center;height:32px;margin-left:2px;padding:4px 12px;display:flex;position:relative}.custom-btn-container .btn-right[data-v-305f4090]:before{content:"";background-color:#fff;width:1px;height:14px;position:absolute;left:-2px}.custom-btn-container .btn-right[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}
2
2
  /*$vite$:1*/
@@ -1,693 +1 @@
1
- import { cssLoader as e, permission as t, t as n } from "@gct-paas/core";
2
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, h as m, mergeProps as h, normalizeClass as g, normalizeProps as _, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, toDisplayString as C, toRaw as w, unref as T, useAttrs as E, vShow as ee, withCtx as D, withDirectives as te, withModifiers as O } from "vue";
3
- import { omit as k } from "lodash-es";
4
- import { MoreOutlined as A } from "@ant-design/icons-vue";
5
- import { Button as j, Divider as M, Dropdown as ne, Menu as N, Popconfirm as P, Tooltip as F } from "ant-design-vue";
6
- //#region src/utils/is.ts
7
- var re = Object.prototype.toString;
8
- function I(e, t) {
9
- return re.call(e) === `[object ${t}]`;
10
- }
11
- function L(e) {
12
- return e !== void 0;
13
- }
14
- function R(e) {
15
- return !L(e);
16
- }
17
- function z(e) {
18
- return e !== null && I(e, "Object");
19
- }
20
- function ie(e) {
21
- return G(e) || V(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : z(e) ? Object.keys(e).length === 0 : !1;
22
- }
23
- function ae(e) {
24
- return I(e, "Date");
25
- }
26
- function B(e) {
27
- return e === null;
28
- }
29
- function oe(e) {
30
- return R(e) && B(e);
31
- }
32
- function se(e) {
33
- return R(e) || B(e);
34
- }
35
- function ce(e) {
36
- return I(e, "Number");
37
- }
38
- function le(e) {
39
- return I(e, "Promise") && z(e) && H(e.then) && H(e.then);
40
- }
41
- function V(e) {
42
- return I(e, "String");
43
- }
44
- function H(e) {
45
- return typeof e == "function";
46
- }
47
- function U(e) {
48
- return I(e, "Boolean");
49
- }
50
- function W(e) {
51
- return I(e, "RegExp");
52
- }
53
- function G(e) {
54
- return !!e && Array.isArray(e);
55
- }
56
- function ue(e) {
57
- return typeof window < "u" && I(e, "Window");
58
- }
59
- function de(e) {
60
- return z(e) && !!e.tagName;
61
- }
62
- function fe(e) {
63
- return I(e, "Map");
64
- }
65
- var K = typeof window > "u", pe = !K;
66
- function me(e) {
67
- return /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e);
68
- }
69
- function he(e) {
70
- return e === void 0 || !e && e !== 0 && e !== "0" || !/[^\s]/.test(e + "");
71
- }
72
- //#endregion
73
- //#region src/components/v-ben-table/src/components/HeaderCell.vue?vue&type=script&lang.ts
74
- var ge = f({
75
- name: "TableHeaderCell",
76
- components: {},
77
- props: { column: {
78
- type: Object,
79
- default: () => ({})
80
- } },
81
- setup(e) {
82
- return { getTitle: i(() => e.column?.customTitle || e.column?.title) };
83
- }
84
- }), q = (e, t) => {
85
- let n = e.__vccOpts || e;
86
- for (let [e, r] of t) n[e] = r;
87
- return n;
88
- };
89
- //#endregion
90
- //#region src/components/v-ben-table/src/components/HeaderCell.vue
91
- function _e(e, t, n, r, i, a) {
92
- return v(), s("span", null, C(e.getTitle), 1);
93
- }
94
- var ve = /* @__PURE__ */ q(ge, [["render", _e]]), ye = {
95
- clickToRowSelect: {
96
- type: Boolean,
97
- default: !0
98
- },
99
- isTreeTable: Boolean,
100
- tableSetting: {
101
- type: Object,
102
- default: {}
103
- },
104
- inset: Boolean,
105
- showTableSetting: Boolean,
106
- autoCreateKey: {
107
- type: Boolean,
108
- default: !0
109
- },
110
- striped: {
111
- type: Boolean,
112
- default: !0
113
- },
114
- showSummary: Boolean,
115
- summaryFunc: {
116
- type: [Function, Array],
117
- default: null
118
- },
119
- summaryData: {
120
- type: Array,
121
- default: null
122
- },
123
- indentSize: {
124
- type: Number,
125
- default: 24
126
- },
127
- canColDrag: {
128
- type: Boolean,
129
- default: !0
130
- },
131
- api: {
132
- type: Function,
133
- default: null
134
- },
135
- beforeFetch: {
136
- type: Function,
137
- default: null
138
- },
139
- afterFetch: {
140
- type: Function,
141
- default: null
142
- },
143
- handleSearchInfoFn: {
144
- type: Function,
145
- default: null
146
- },
147
- immediate: {
148
- type: Boolean,
149
- default: !0
150
- },
151
- emptyDataIsShowTable: {
152
- type: Boolean,
153
- default: !0
154
- },
155
- searchInfo: {
156
- type: Object,
157
- default: null
158
- },
159
- defSort: {
160
- type: Object,
161
- default: null
162
- },
163
- useSearchForm: Boolean,
164
- columns: {
165
- type: Array,
166
- default: () => []
167
- },
168
- showIndexColumn: {
169
- type: Boolean,
170
- default: !0
171
- },
172
- indexColumnProps: {
173
- type: Object,
174
- default: null
175
- },
176
- actionColumn: {
177
- type: Object,
178
- default: null
179
- },
180
- ellipsis: {
181
- type: Boolean,
182
- default: !0
183
- },
184
- isCanResizeParent: {
185
- type: Boolean,
186
- default: !1
187
- },
188
- canResize: {
189
- type: Boolean,
190
- default: !0
191
- },
192
- clearSelectOnPageChange: Boolean,
193
- resizeHeightOffset: {
194
- type: Number,
195
- default: 0
196
- },
197
- rowSelection: {
198
- type: Object,
199
- default: null
200
- },
201
- title: {
202
- type: [String, Function],
203
- default: null
204
- },
205
- titleHelpMessage: { type: [String, Array] },
206
- maxHeight: Number,
207
- dataSource: {
208
- type: Array,
209
- default: null
210
- },
211
- rowKey: {
212
- type: [String, Function],
213
- default: ""
214
- },
215
- bordered: Boolean,
216
- pagination: {
217
- type: [Object, Boolean],
218
- default: null
219
- },
220
- loading: Boolean,
221
- rowClassName: { type: Function },
222
- scroll: {
223
- type: Object,
224
- default: null
225
- },
226
- beforeEditSubmit: { type: Function },
227
- rowDraggable: {
228
- type: Boolean,
229
- default: !1
230
- },
231
- supportSameLevel: {
232
- type: Boolean,
233
- default: !1
234
- },
235
- rowDragApi: {
236
- type: Function,
237
- default: null
238
- },
239
- expandedRowKeys: {
240
- type: Array,
241
- default: () => []
242
- },
243
- emptyFull: {
244
- type: Boolean,
245
- default: !1
246
- }
247
- }, be = f({
248
- name: "BasicTable",
249
- components: { HeaderCell: ve },
250
- props: ye,
251
- emits: ["change"],
252
- setup(e, { attrs: t, emit: n, slots: r, expose: a }) {
253
- let o = y(null), s = y([]), c = y(null), l = i(() => {
254
- let e = { ...t };
255
- return e = k(e, ["class", "onChange"]), e;
256
- });
257
- function u(...e) {
258
- n("change", ...e);
259
- }
260
- return {
261
- formRef: c,
262
- tableElRef: o,
263
- getBindValues: l,
264
- handleTableChange: u,
265
- expandKeysList: s,
266
- getEmptyDataIsShowTable: i(() => {
267
- let { emptyDataIsShowTable: t, useSearchForm: n, dataSource: r } = e;
268
- return t || !n ? !0 : !!r.length;
269
- })
270
- };
271
- },
272
- mounted() {
273
- this.expandKeysList = this.getBindValues.expandedRowKeys;
274
- }
275
- }), xe = { ref: "wrapRef" }, Se = {
276
- key: 0,
277
- class: "pr26px"
278
- }, Ce = {
279
- key: 1,
280
- class: "pr8px"
281
- };
282
- function we(e, t, n, i, o, c) {
283
- let u = S("HeaderCell"), f = S("a-table");
284
- return v(), s("div", xe, [x(e.$slots, "beforeTable"), te(d(f, h({ ref: "tableElRef" }, e.getBindValues, {
285
- "expanded-row-keys": e.expandKeysList,
286
- "onUpdate:expandedRowKeys": t[0] ||= (t) => e.expandKeysList = t,
287
- onChange: e.handleTableChange
288
- }), l({
289
- headerCell: D(({ column: t }) => [e.rowDraggable && t?.dataIndex === e.getBindValues.columns[0].dataIndex ? (v(), s(r, { key: 0 }, [e.isTreeTable ? (v(), s("span", Se)) : (v(), s("span", Ce)), d(u, { column: t }, null, 8, ["column"])], 64)) : (v(), a(u, {
290
- key: 1,
291
- column: t
292
- }, null, 8, ["column"]))]),
293
- bodyCell: D((t) => [x(e.$slots, "bodyCell", _(p(t || {})))]),
294
- _: 2
295
- }, [b(Object.keys(e.$slots), (t) => ({
296
- name: t,
297
- fn: D((n) => [x(e.$slots, t, _(p(n || {})))])
298
- }))]), 1040, ["expanded-row-keys", "onChange"]), [[ee, e.getEmptyDataIsShowTable]])], 512);
299
- }
300
- var Te = /* @__PURE__ */ q(be, [["render", we]]), J = "vben";
301
- function Y(e) {
302
- return {
303
- prefixCls: `${J}-${e}`,
304
- prefixVar: J
305
- };
306
- }
307
- //#endregion
308
- //#region src/components/v-ben-table/src/components/TableAction.vue?vue&type=script&setup=true&lang.ts
309
- var Ee = {
310
- key: 0,
311
- class: "text-14px"
312
- }, De = {
313
- key: 0,
314
- class: "text-14px"
315
- }, Oe = /* @__PURE__ */ f({
316
- __name: "TableAction",
317
- props: {
318
- actions: {
319
- type: Array,
320
- default: null
321
- },
322
- dropDownActions: {
323
- type: Array,
324
- default: null
325
- },
326
- divider: {
327
- type: Boolean,
328
- default: !0
329
- },
330
- outside: Boolean,
331
- stopButtonPropagation: {
332
- type: Boolean,
333
- default: !1
334
- }
335
- },
336
- setup(e) {
337
- let n = e, { prefixCls: c } = Y("basic-table-action"), l = t.has;
338
- function u(e) {
339
- let t = e.ifShow, n = !0;
340
- return U(t) && (n = t), H(t) && (n = t(e)), n;
341
- }
342
- let f = i(() => (w(n.actions) || []).filter((e) => l(e.auth) && u(e)).map((e) => {
343
- let { popConfirm: t } = e;
344
- return {
345
- getPopupContainer: () => document.body,
346
- type: "link",
347
- size: "small",
348
- ...e,
349
- ...t || {},
350
- onConfirm: t?.confirm,
351
- onCancel: t?.cancel,
352
- enable: !!t
353
- };
354
- })), p = i(() => {
355
- let e = (w(n.dropDownActions) || []).filter((e) => l(e.auth) && u(e));
356
- return e.map((t, r) => {
357
- let { label: i, popConfirm: a } = t;
358
- return {
359
- ...t,
360
- ...a,
361
- onConfirm: a?.confirm,
362
- onCancel: a?.cancel,
363
- text: i,
364
- divider: r < e.length - 1 ? n.divider : !1
365
- };
366
- });
367
- }), m = i(() => "left");
368
- function _(e) {
369
- return {
370
- getPopupContainer: () => document.body,
371
- ...V(e) ? { title: e } : e
372
- };
373
- }
374
- function y(e) {
375
- n.stopButtonPropagation && e.composedPath().find((e) => e.tagName?.toUpperCase() === "BUTTON") && e.stopPropagation();
376
- }
377
- return (t, n) => {
378
- let i = S("a-button");
379
- return v(), s("div", {
380
- class: g([T(c), m.value]),
381
- onClick: y
382
- }, [(v(!0), s(r, null, b(f.value, (t, n) => (v(), s(r, { key: `${n}-${t.label}` }, [t.tooltip ? (v(), a(T(F), h({
383
- key: 0,
384
- placement: "bottom"
385
- }, { ref_for: !0 }, _(t.tooltip)), {
386
- default: D(() => [d(T(Q), h({ ref_for: !0 }, t), {
387
- default: D(() => [t.label ? (v(), s("span", Ee, C(t.label), 1)) : o("", !0)]),
388
- _: 2
389
- }, 1040)]),
390
- _: 2
391
- }, 1040)) : (v(), a(T(Q), h({
392
- key: 1,
393
- ref_for: !0
394
- }, t), {
395
- default: D(() => [t.label ? (v(), s("span", De, C(t.label), 1)) : o("", !0)]),
396
- _: 2
397
- }, 1040)), e.divider && n < f.value.length - 1 ? (v(), a(T(M), {
398
- key: 2,
399
- type: "vertical",
400
- class: "action-divider"
401
- })) : o("", !0)], 64))), 128)), e.dropDownActions && p.value.length > 0 ? (v(), a(T($), {
402
- key: 0,
403
- trigger: ["hover"],
404
- "drop-menu-list": p.value,
405
- popconfirm: ""
406
- }, {
407
- default: D(() => [x(t.$slots, "more"), t.$slots.more ? o("", !0) : (v(), a(i, {
408
- key: 0,
409
- type: "link",
410
- size: "small"
411
- }, {
412
- default: D(() => [d(T(A), { class: "icon-more" })]),
413
- _: 1
414
- }))]),
415
- _: 3
416
- }, 8, ["drop-menu-list"])) : o("", !0)], 2);
417
- };
418
- }
419
- }), ke = {
420
- key: 0,
421
- class: "text-14px"
422
- }, Ae = {
423
- key: 0,
424
- class: "text-14px"
425
- }, X = /* @__PURE__ */ f({
426
- __name: "TableActionAuto",
427
- props: {
428
- actions: {
429
- type: Array,
430
- default: null
431
- },
432
- divider: {
433
- type: Boolean,
434
- default: !0
435
- },
436
- outside: Boolean,
437
- stopButtonPropagation: {
438
- type: Boolean,
439
- default: !1
440
- },
441
- maxDispalyCount: {
442
- type: Number,
443
- default: 4
444
- }
445
- },
446
- setup(e) {
447
- let n = e, { prefixCls: c } = Y("basic-table-action"), l = t.has;
448
- function u(e) {
449
- let t = e.ifShow ?? !0;
450
- return H(t) ? t(e) : !!t;
451
- }
452
- let f = i(() => [...w(n.actions) || []].filter((e) => l(e.auth) && u(e))), p = i(() => {
453
- let e = [];
454
- return e = n.maxDispalyCount >= f.value.length ? [...f.value] : f.value.slice(0, n.maxDispalyCount), e.map((e) => {
455
- let { popConfirm: t } = e;
456
- return {
457
- getPopupContainer: () => document.body,
458
- type: "link",
459
- size: "small",
460
- ...e,
461
- ...t || {},
462
- onConfirm: t?.confirm,
463
- onCancel: t?.cancel,
464
- enable: !!t
465
- };
466
- });
467
- }), m = i(() => {
468
- let e = [];
469
- return n.maxDispalyCount >= f.value.length ? [] : (e = f.value.slice(n.maxDispalyCount), e.map((t, r) => {
470
- let { label: i, popConfirm: a } = t;
471
- return {
472
- ...t,
473
- ...a,
474
- onConfirm: a?.confirm,
475
- onCancel: a?.cancel,
476
- text: i,
477
- divider: r < e.length - 1 ? n.divider : !1
478
- };
479
- }));
480
- }), _ = i(() => "left");
481
- function y(e) {
482
- return {
483
- getPopupContainer: () => document.body,
484
- placement: "bottom",
485
- ...V(e) ? { title: e } : e
486
- };
487
- }
488
- function E(e) {
489
- n.stopButtonPropagation && e.composedPath().find((e) => e.tagName?.toUpperCase() === "BUTTON") && e.stopPropagation();
490
- }
491
- return (t, n) => {
492
- let i = S("a-button");
493
- return v(), s("div", {
494
- class: g([T(c), _.value]),
495
- onClick: O(E, ["stop"])
496
- }, [(v(!0), s(r, null, b(p.value, (t, n) => (v(), s(r, { key: `${n}-${t.label}` }, [t.tooltip ? (v(), a(T(F), h({
497
- key: 0,
498
- ref_for: !0
499
- }, y(t.tooltip)), {
500
- default: D(() => [d(T(Q), h({ ref_for: !0 }, t), {
501
- default: D(() => [t.label ? (v(), s("span", ke, C(t.label), 1)) : o("", !0)]),
502
- _: 2
503
- }, 1040)]),
504
- _: 2
505
- }, 1040)) : (v(), a(T(Q), h({
506
- key: 1,
507
- ref_for: !0
508
- }, t), {
509
- default: D(() => [t.label ? (v(), s("span", Ae, C(t.label), 1)) : o("", !0)]),
510
- _: 2
511
- }, 1040)), e.divider && n < p.value.length - 1 ? (v(), a(T(M), {
512
- key: 2,
513
- type: "vertical",
514
- class: "action-divider"
515
- })) : o("", !0)], 64))), 128)), m.value.length > 0 ? (v(), a(T($), {
516
- key: 0,
517
- trigger: ["hover"],
518
- "drop-menu-list": m.value,
519
- popconfirm: ""
520
- }, {
521
- default: D(() => [x(t.$slots, "more"), t.$slots.more ? o("", !0) : (v(), a(i, {
522
- key: 0,
523
- type: "link",
524
- size: "small"
525
- }, {
526
- default: D(() => [d(T(A), { class: "icon-more" })]),
527
- _: 1
528
- }))]),
529
- _: 3
530
- }, 8, ["drop-menu-list"])) : o("", !0)], 2);
531
- };
532
- }
533
- }), je = [
534
- "primary",
535
- "error",
536
- "warning",
537
- "success",
538
- ""
539
- ], Z = /* @__PURE__ */ f({
540
- name: "AButton",
541
- extends: j,
542
- inheritAttrs: !1,
543
- __name: "BasicButton",
544
- props: {
545
- color: {
546
- type: String,
547
- validator: (e) => je.includes(e),
548
- default: ""
549
- },
550
- loading: { type: Boolean },
551
- disabled: { type: Boolean },
552
- preIcon: { type: String },
553
- postIcon: { type: String },
554
- iconSize: {
555
- type: Number,
556
- default: 14
557
- },
558
- onClick: {
559
- type: Function,
560
- default: null
561
- }
562
- },
563
- setup(e) {
564
- let t = e, n = E(), r = i(() => {
565
- let { color: e, disabled: n } = t;
566
- return [{
567
- [`ant-btn-${e}`]: !!e,
568
- "is-disabled": n
569
- }];
570
- }), o = i(() => ({
571
- ...T(n),
572
- ...t
573
- }));
574
- return (e, t) => (v(), a(T(j), h(o.value, {
575
- class: r.value,
576
- onClick: e.onClick
577
- }), {
578
- default: D((t) => [x(e.$slots, "default", _(p(t || {})))]),
579
- _: 3
580
- }, 16, ["class", "onClick"]));
581
- }
582
- }), Me = f({
583
- name: "PopButton",
584
- inheritAttrs: !1,
585
- props: { enable: {
586
- type: Boolean,
587
- default: !0
588
- } },
589
- setup(e, { slots: t }) {
590
- let r = E(), a = i(() => Object.assign({
591
- okText: n("sys.okText"),
592
- cancelText: n("sys.cancelText"),
593
- overlayStyle: {}
594
- }, {
595
- ...e,
596
- ...T(r)
597
- }));
598
- return () => {
599
- let n = k(T(a), "icon"), r = k(n, "title");
600
- r.disabled && (r.color = "");
601
- let i = m(Z, r, t);
602
- return e.enable ? m(P, n, { default: () => i }) : i;
603
- };
604
- }
605
- }), Ne = { class: "custom-btn-container" }, Pe = { class: "btn-left-title" }, Fe = /* @__PURE__ */ q(/* @__PURE__ */ f({
606
- __name: "custom-button",
607
- props: { title: {} },
608
- emits: ["btn-left-click", "btn-right-click"],
609
- setup(e) {
610
- return (t, n) => (v(), s("div", Ne, [c("div", {
611
- class: "btn-left",
612
- onClick: n[0] ||= O((e) => t.$emit("btn-left-click"), ["stop"])
613
- }, [x(t.$slots, "left-icon", {}, void 0, !0), c("div", Pe, C(e.title), 1)]), c("div", {
614
- class: "btn-right",
615
- onClick: n[1] ||= O((e) => t.$emit("btn-right-click"), ["stop"])
616
- }, [x(t.$slots, "right-icon", {}, void 0, !0)])]));
617
- }
618
- }), [["__scopeId", "data-v-305f4090"]]), Ie = Z, Q = Me, Le = { class: "ml-1" }, Re = {
619
- key: 1,
620
- class: "ml-1"
621
- }, $ = /* @__PURE__ */ f({
622
- name: "VDropdown",
623
- __name: "Dropdown",
624
- props: {
625
- popconfirm: Boolean,
626
- trigger: {
627
- type: Array,
628
- default: () => ["contextmenu"]
629
- },
630
- dropMenuList: {
631
- type: Array,
632
- default: () => []
633
- },
634
- selectedKeys: {
635
- type: Array,
636
- default: () => []
637
- }
638
- },
639
- emits: ["menuEvent"],
640
- setup(e, { emit: t }) {
641
- let n = ne, i = N, l = N.Item, f = N.Divider, p = P, m = e, g = t;
642
- function _(e) {
643
- let { event: t } = e;
644
- g("menuEvent", m.dropMenuList.find((e) => `${e.event}` == `${t}`)), e.onClick?.();
645
- }
646
- function y(e) {
647
- let t = k(e, [
648
- "confirm",
649
- "cancel",
650
- "icon"
651
- ]);
652
- return !e.onConfirm && e.confirm && H(e.confirm) && (t.onConfirm = e.confirm), !e.onCancel && e.cancel && H(e.cancel) && (t.onCancel = e.cancel), t;
653
- }
654
- let S = (e) => ({ key: e });
655
- return (t, m) => (v(), a(T(n), h({ trigger: e.trigger }, t.$attrs), {
656
- overlay: D(() => [d(T(i), { "selected-keys": e.selectedKeys }, {
657
- default: D(() => [(v(!0), s(r, null, b(e.dropMenuList, (t) => (v(), s(r, { key: `${t.event}` }, [d(T(l), h({ class: t.class }, { ref_for: !0 }, S(t.event), {
658
- disabled: t.disabled,
659
- onClick: (e) => _(t)
660
- }), {
661
- default: D(() => [e.popconfirm && t.popConfirm ? (v(), a(T(p), h({
662
- key: 0,
663
- ref_for: !0
664
- }, y(t.popConfirm)), {
665
- default: D(() => [c("div", null, [c("span", Le, C(t.text), 1)])]),
666
- _: 2
667
- }, 1040)) : (v(), s("span", Re, C(t.text), 1))]),
668
- _: 2
669
- }, 1040, [
670
- "class",
671
- "disabled",
672
- "onClick"
673
- ]), t.divider ? (v(), a(T(f), { key: `d-${t.event}` })) : o("", !0)], 64))), 128))]),
674
- _: 1
675
- }, 8, ["selected-keys"])]),
676
- default: D(() => [c("span", null, [x(t.$slots, "default")]), u(" " + C(e.dropMenuList) + " ", 1)]),
677
- _: 3
678
- }, 16, ["trigger"]));
679
- }
680
- });
681
- //#endregion
682
- //#region src/index.ts
683
- function ze() {}
684
- //#endregion
685
- //#region src/loader.ts
686
- var Be = new URL(
687
- /* @vite-ignore */
688
- "./index.min.css",
689
- import.meta.url
690
- );
691
- e.load(Be.href);
692
- //#endregion
693
- export { Te as BasicTable, Ie as Button, Fe as CustomButton, $ as Dropdown, Q as PopConfirmButton, Oe as TableAction, X as TableActionAuto, I as is, G as isArray, U as isBoolean, pe as isClient, ae as isDate, L as isDef, de as isElement, ie as isEmpty, he as isEmptyStr, H as isFunction, fe as isMap, B as isNull, oe as isNullAndUnDef, se as isNullOrUnDef, ce as isNumber, z as isObject, le as isPromise, W as isRegExp, K as isServer, V as isString, R as isUnDef, me as isUrl, ue as isWindow, ze as run };
1
+ import{cssLoader as e,permission as t,t as n}from"@gct-paas/core";import{Fragment as o,computed as l,createBlock as a,createCommentVNode as r,createElementBlock as i,createElementVNode as u,createSlots as s,createTextVNode as c,createVNode as p,defineComponent as d,guardReactiveProps as f,h as y,mergeProps as m,normalizeClass as b,normalizeProps as v,openBlock as g,ref as C,renderList as h,renderSlot as k,resolveComponent as B,toDisplayString as x,toRaw as w,unref as _,useAttrs as S,vShow as T,withCtx as A,withDirectives as $,withModifiers as D}from"vue";import{omit as O}from"lodash-es";import{MoreOutlined as F}from"@ant-design/icons-vue";import{Button as P,Divider as j,Dropdown as I,Menu as N,Popconfirm as R,Tooltip as K}from"ant-design-vue";var z=Object.prototype.toString;function L(e,t){return z.call(e)===`[object ${t}]`}function E(e){return void 0!==e}function M(e){return!E(e)}function H(e){return null!==e&&L(e,"Object")}function U(e){return te(e)||X(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:!!H(e)&&0===Object.keys(e).length}function V(e){return L(e,"Date")}function W(e){return null===e}function q(e){return M(e)&&W(e)}function G(e){return M(e)||W(e)}function J(e){return L(e,"Number")}function Q(e){return L(e,"Promise")&&H(e)&&Y(e.then)&&Y(e.then)}function X(e){return L(e,"String")}function Y(e){return"function"==typeof e}function Z(e){return L(e,"Boolean")}function ee(e){return L(e,"RegExp")}function te(e){return!!e&&Array.isArray(e)}function ne(e){return"undefined"!=typeof window&&L(e,"Window")}function oe(e){return H(e)&&!!e.tagName}function le(e){return L(e,"Map")}var ae="undefined"==typeof window,re=!ae;function ie(e){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e)}function ue(e){return void 0===e||!e&&0!==e&&"0"!==e||!/[^\s]/.test(e+"")}var se=d({name:"TableHeaderCell",components:{},props:{column:{type:Object,default:()=>({})}},setup:e=>({getTitle:l(()=>{var t,n;return(null===(t=e.column)||void 0===t?void 0:t.customTitle)||(null===(n=e.column)||void 0===n?void 0:n.title)})})}),ce=(e,t)=>{const n=e.__vccOpts||e;for(const[o,l]of t)n[o]=l;return n},pe=d({name:"BasicTable",components:{HeaderCell:/* @__PURE__ */ce(se,[["render",function(e,t,n,o,l,a){return g(),i("span",null,x(e.getTitle),1)}]])},props:{clickToRowSelect:{type:Boolean,default:!0},isTreeTable:Boolean,tableSetting:{type:Object,default:{}},inset:Boolean,showTableSetting:Boolean,autoCreateKey:{type:Boolean,default:!0},striped:{type:Boolean,default:!0},showSummary:Boolean,summaryFunc:{type:[Function,Array],default:null},summaryData:{type:Array,default:null},indentSize:{type:Number,default:24},canColDrag:{type:Boolean,default:!0},api:{type:Function,default:null},beforeFetch:{type:Function,default:null},afterFetch:{type:Function,default:null},handleSearchInfoFn:{type:Function,default:null},immediate:{type:Boolean,default:!0},emptyDataIsShowTable:{type:Boolean,default:!0},searchInfo:{type:Object,default:null},defSort:{type:Object,default:null},useSearchForm:Boolean,columns:{type:Array,default:()=>[]},showIndexColumn:{type:Boolean,default:!0},indexColumnProps:{type:Object,default:null},actionColumn:{type:Object,default:null},ellipsis:{type:Boolean,default:!0},isCanResizeParent:{type:Boolean,default:!1},canResize:{type:Boolean,default:!0},clearSelectOnPageChange:Boolean,resizeHeightOffset:{type:Number,default:0},rowSelection:{type:Object,default:null},title:{type:[String,Function],default:null},titleHelpMessage:{type:[String,Array]},maxHeight:Number,dataSource:{type:Array,default:null},rowKey:{type:[String,Function],default:""},bordered:Boolean,pagination:{type:[Object,Boolean],default:null},loading:Boolean,rowClassName:{type:Function},scroll:{type:Object,default:null},beforeEditSubmit:{type:Function},rowDraggable:{type:Boolean,default:!1},supportSameLevel:{type:Boolean,default:!1},rowDragApi:{type:Function,default:null},expandedRowKeys:{type:Array,default:()=>[]},emptyFull:{type:Boolean,default:!1}},emits:["change"],setup(e,{attrs:t,emit:n,slots:o,expose:a}){const r=C(null),i=C([]);return{formRef:C(null),tableElRef:r,getBindValues:l(()=>{let e={...t};return e=O(e,["class","onChange"]),e}),handleTableChange:function(...e){n("change",...e)},expandKeysList:i,getEmptyDataIsShowTable:l(()=>{const{emptyDataIsShowTable:t,useSearchForm:n,dataSource:o}=e;return!(!t&&n&&!o.length)})}},mounted(){this.expandKeysList=this.getBindValues.expandedRowKeys}}),de={ref:"wrapRef"},fe={key:0,class:"pr26px"},ye={key:1,class:"pr8px"},me=/* @__PURE__ */ce(pe,[["render",function(e,t,n,l,r,u){const c=B("HeaderCell"),d=B("a-table");return g(),i("div",de,[k(e.$slots,"beforeTable"),$(p(d,m({ref:"tableElRef"},e.getBindValues,{"expanded-row-keys":e.expandKeysList,"onUpdate:expandedRowKeys":t[0]||(t[0]=t=>e.expandKeysList=t),onChange:e.handleTableChange}),s({headerCell:A(({column:t})=>[e.rowDraggable&&(null==t?void 0:t.dataIndex)===e.getBindValues.columns[0].dataIndex?(g(),i(o,{key:0},[e.isTreeTable?(g(),i("span",fe)):(g(),i("span",ye)),p(c,{column:t},null,8,["column"])],64)):(g(),a(c,{key:1,column:t},null,8,["column"]))]),bodyCell:A(t=>[k(e.$slots,"bodyCell",v(f(t||{})))]),_:2},[h(Object.keys(e.$slots),t=>({name:t,fn:A(n=>[k(e.$slots,t,v(f(n||{})))])}))]),1040,["expanded-row-keys","onChange"]),[[T,e.getEmptyDataIsShowTable]])],512)}]]),be="vben";function ve(e){return{prefixCls:`${be}-${e}`,prefixVar:be}}var ge={key:0,class:"text-14px"},Ce={key:0,class:"text-14px"},he=/* @__PURE__ */d({__name:"TableAction",props:{actions:{type:Array,default:null},dropDownActions:{type:Array,default:null},divider:{type:Boolean,default:!0},outside:Boolean,stopButtonPropagation:{type:Boolean,default:!1}},setup(e){const n=e,{prefixCls:u}=ve("basic-table-action"),s=t.has;function c(e){const t=e.ifShow;let n=!0;return Z(t)&&(n=t),Y(t)&&(n=t(e)),n}const d=l(()=>(w(n.actions)||[]).filter(e=>s(e.auth)&&c(e)).map(e=>{const{popConfirm:t}=e;return{getPopupContainer:()=>document.body,type:"link",size:"small",...e,...t||{},onConfirm:null==t?void 0:t.confirm,onCancel:null==t?void 0:t.cancel,enable:!!t}})),f=l(()=>{const e=(w(n.dropDownActions)||[]).filter(e=>s(e.auth)&&c(e));return e.map((t,o)=>{const{label:l,popConfirm:a}=t;return{...t,...a,onConfirm:null==a?void 0:a.confirm,onCancel:null==a?void 0:a.cancel,text:l,divider:o<e.length-1&&n.divider}})}),y=l(()=>"left");function v(e){n.stopButtonPropagation&&e.composedPath().find(e=>{var t;return"BUTTON"===(null===(t=e.tagName)||void 0===t?void 0:t.toUpperCase())})&&e.stopPropagation()}return(t,n)=>{const l=B("a-button");return g(),i("div",{class:b([_(u),y.value]),onClick:v},[(g(!0),i(o,null,h(d.value,(t,n)=>{return g(),i(o,{key:`${n}-${t.label}`},[t.tooltip?(g(),a(_(K),m({key:0,placement:"bottom"},{ref_for:!0},(l=t.tooltip,{getPopupContainer:()=>document.body,...X(l)?{title:l}:l})),{default:A(()=>[p(_(Ie),m({ref_for:!0},t),{default:A(()=>[t.label?(g(),i("span",ge,x(t.label),1)):r("",!0)]),_:2},1040)]),_:2},1040)):(g(),a(_(Ie),m({key:1,ref_for:!0},t),{default:A(()=>[t.label?(g(),i("span",Ce,x(t.label),1)):r("",!0)]),_:2},1040)),e.divider&&n<d.value.length-1?(g(),a(_(j),{key:2,type:"vertical",class:"action-divider"})):r("",!0)],64);var l}),128)),e.dropDownActions&&f.value.length>0?(g(),a(_(Ke),{key:0,trigger:["hover"],"drop-menu-list":f.value,popconfirm:""},{default:A(()=>[k(t.$slots,"more"),t.$slots.more?r("",!0):(g(),a(l,{key:0,type:"link",size:"small"},{default:A(()=>[p(_(F),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):r("",!0)],2)}}}),ke=he,Be={key:0,class:"text-14px"},xe={key:0,class:"text-14px"},we=/* @__PURE__ */d({__name:"TableActionAuto",props:{actions:{type:Array,default:null},divider:{type:Boolean,default:!0},outside:Boolean,stopButtonPropagation:{type:Boolean,default:!1},maxDispalyCount:{type:Number,default:4}},setup(e){const n=e,{prefixCls:u}=ve("basic-table-action"),s=t.has,c=l(()=>[...w(n.actions)||[]].filter(e=>s(e.auth)&&function(e){const t=e.ifShow??!0;return Y(t)?t(e):!!t}(e))),d=l(()=>{let e=[];return e=n.maxDispalyCount>=c.value.length?[...c.value]:c.value.slice(0,n.maxDispalyCount),e.map(e=>{const{popConfirm:t}=e;return{getPopupContainer:()=>document.body,type:"link",size:"small",...e,...t||{},onConfirm:null==t?void 0:t.confirm,onCancel:null==t?void 0:t.cancel,enable:!!t}})}),f=l(()=>{let e=[];return n.maxDispalyCount>=c.value.length?[]:(e=c.value.slice(n.maxDispalyCount),e.map((t,o)=>{const{label:l,popConfirm:a}=t;return{...t,...a,onConfirm:null==a?void 0:a.confirm,onCancel:null==a?void 0:a.cancel,text:l,divider:o<e.length-1&&n.divider}}))}),y=l(()=>"left");function v(e){n.stopButtonPropagation&&e.composedPath().find(e=>{var t;return"BUTTON"===(null===(t=e.tagName)||void 0===t?void 0:t.toUpperCase())})&&e.stopPropagation()}return(t,n)=>{const l=B("a-button");return g(),i("div",{class:b([_(u),y.value]),onClick:D(v,["stop"])},[(g(!0),i(o,null,h(d.value,(t,n)=>{return g(),i(o,{key:`${n}-${t.label}`},[t.tooltip?(g(),a(_(K),m({key:0,ref_for:!0},(l=t.tooltip,{getPopupContainer:()=>document.body,placement:"bottom",...X(l)?{title:l}:l})),{default:A(()=>[p(_(Ie),m({ref_for:!0},t),{default:A(()=>[t.label?(g(),i("span",Be,x(t.label),1)):r("",!0)]),_:2},1040)]),_:2},1040)):(g(),a(_(Ie),m({key:1,ref_for:!0},t),{default:A(()=>[t.label?(g(),i("span",xe,x(t.label),1)):r("",!0)]),_:2},1040)),e.divider&&n<d.value.length-1?(g(),a(_(j),{key:2,type:"vertical",class:"action-divider"})):r("",!0)],64);var l}),128)),f.value.length>0?(g(),a(_(Ke),{key:0,trigger:["hover"],"drop-menu-list":f.value,popconfirm:""},{default:A(()=>[k(t.$slots,"more"),t.$slots.more?r("",!0):(g(),a(l,{key:0,type:"link",size:"small"},{default:A(()=>[p(_(F),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):r("",!0)],2)}}}),_e=we,Se=["primary","error","warning","success",""],Te={color:{type:String,validator:e=>Se.includes(e),default:""},loading:{type:Boolean},disabled:{type:Boolean},preIcon:{type:String},postIcon:{type:String},iconSize:{type:Number,default:14},onClick:{type:Function,default:null}},Ae=/* @__PURE__ */d({name:"AButton",extends:P,inheritAttrs:!1,__name:"BasicButton",props:Te,setup(e){const t=e,n=S(),o=l(()=>{const{color:e,disabled:n}=t;return[{[`ant-btn-${e}`]:!!e,"is-disabled":n}]}),r=l(()=>({..._(n),...t}));return(e,t)=>(g(),a(_(P),m(r.value,{class:o.value,onClick:e.onClick}),{default:A(t=>[k(e.$slots,"default",v(f(t||{})))]),_:3},16,["class","onClick"]))}}),$e=d({name:"PopButton",inheritAttrs:!1,props:{enable:{type:Boolean,default:!0}},setup(e,{slots:t}){const o=S(),a=l(()=>Object.assign({okText:n("sys.okText"),cancelText:n("sys.cancelText"),overlayStyle:{}},{...e,..._(o)}));return()=>{const n=O(_(a),"icon"),o=O(n,"title");o.disabled&&(o.color="");const l=y(Ae,o,t);return e.enable?y(R,n,{default:()=>l}):l}}}),De=$e,Oe={class:"custom-btn-container"},Fe={class:"btn-left-title"},Pe=/* @__PURE__ */ce(/* @__PURE__ */d({__name:"custom-button",props:{title:{}},emits:["btn-left-click","btn-right-click"],setup:e=>(t,n)=>(g(),i("div",Oe,[u("div",{class:"btn-left",onClick:n[0]||(n[0]=D(e=>t.$emit("btn-left-click"),["stop"]))},[k(t.$slots,"left-icon",{},void 0,!0),u("div",Fe,x(e.title),1)]),u("div",{class:"btn-right",onClick:n[1]||(n[1]=D(e=>t.$emit("btn-right-click"),["stop"]))},[k(t.$slots,"right-icon",{},void 0,!0)])]))}),[["__scopeId","data-v-305f4090"]]),je=Ae,Ie=De,Ne={class:"ml-1"},Re={key:1,class:"ml-1"},Ke=/* @__PURE__ */d({name:"VDropdown",__name:"Dropdown",props:{popconfirm:Boolean,trigger:{type:Array,default:()=>["contextmenu"]},dropMenuList:{type:Array,default:()=>[]},selectedKeys:{type:Array,default:()=>[]}},emits:["menuEvent"],setup(e,{emit:t}){const n=I,l=N,s=N.Item,d=N.Divider,f=R,y=e,b=t;function v(e){const t=O(e,["confirm","cancel","icon"]);return!e.onConfirm&&e.confirm&&Y(e.confirm)&&(t.onConfirm=e.confirm),!e.onCancel&&e.cancel&&Y(e.cancel)&&(t.onCancel=e.cancel),t}return(t,C)=>(g(),a(_(n),m({trigger:e.trigger},t.$attrs),{overlay:A(()=>[p(_(l),{"selected-keys":e.selectedKeys},{default:A(()=>[(g(!0),i(o,null,h(e.dropMenuList,t=>{return g(),i(o,{key:`${t.event}`},[p(_(s),m({class:t.class},{ref_for:!0},(n=t.event,{key:n}),{disabled:t.disabled,onClick:e=>function(e){var t;const{event:n}=e;b("menuEvent",y.dropMenuList.find(e=>`${e.event}`==`${n}`)),null===(t=e.onClick)||void 0===t||t.call(e)}(t)}),{default:A(()=>[e.popconfirm&&t.popConfirm?(g(),a(_(f),m({key:0,ref_for:!0},v(t.popConfirm)),{default:A(()=>[u("div",null,[u("span",Ne,x(t.text),1)])]),_:2},1040)):(g(),i("span",Re,x(t.text),1))]),_:2},1040,["class","disabled","onClick"]),t.divider?(g(),a(_(d),{key:`d-${t.event}`})):r("",!0)],64);var n}),128))]),_:1},8,["selected-keys"])]),default:A(()=>[u("span",null,[k(t.$slots,"default")]),c(" "+x(e.dropMenuList)+" ",1)]),_:3},16,["trigger"]))}});function ze(){}var Le=new URL("./index.min.css",import.meta.url);e.load(Le.href);export{me as BasicTable,je as Button,Pe as CustomButton,Ke as Dropdown,Ie as PopConfirmButton,ke as TableAction,_e as TableActionAuto,L as is,te as isArray,Z as isBoolean,re as isClient,V as isDate,E as isDef,oe as isElement,U as isEmpty,ue as isEmptyStr,Y as isFunction,le as isMap,W as isNull,q as isNullAndUnDef,G as isNullOrUnDef,J as isNumber,H as isObject,Q as isPromise,ee as isRegExp,ae as isServer,X as isString,M as isUnDef,ie as isUrl,ne as isWindow,ze as run};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/v-ben",
3
- "version": "0.1.4-dev.13",
3
+ "version": "0.1.4-dev.14",
4
4
  "type": "module",
5
5
  "description": "paas 平台历史 v-ben 内容",
6
6
  "main": "dist/index.min.cjs",
@@ -50,23 +50,16 @@
50
50
  "dependencies": {
51
51
  "@ant-design/icons-vue": "^6.1.0",
52
52
  "@gct-paas/api": "^0.1.1",
53
- "@gct-paas/core": "0.1.4-dev.13",
53
+ "@gct-paas/core": "0.1.4-dev.14",
54
54
  "@gct-paas/platform-icons": "^0.0.2",
55
- "@gct-paas/scss": "0.1.4-dev.13",
55
+ "@gct-paas/scss": "0.1.4-dev.14",
56
56
  "@icon-park/vue-next": "^1.4.2",
57
57
  "@vueuse/core": "^14.1.0",
58
- "ant-design-vue": "3.2.20",
58
+ "ant-design-vue": "~3.2.20",
59
59
  "lodash-es": "^4.17.23",
60
60
  "sortablejs": "^1.15.7",
61
61
  "vue": "^3.5.30",
62
62
  "vue-types": "^6.0.0"
63
63
  },
64
- "devDependencies": {
65
- "@gct-paas/build": "^0.1.6-dev.4",
66
- "vue-tsc": "^3.2.5"
67
- },
68
- "peerDependencies": {
69
- "vue": "^3.x"
70
- },
71
- "gitHead": "730343d424ac98e1cd00b6f4cddf8a9823a48357"
64
+ "gitHead": "d03e6d5c7bd1c3edf73777ce40e0c0ed4982622f"
72
65
  }