@aplus-frontend/ui 0.1.28 → 0.1.30
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/es/index.mjs +78 -76
- package/es/src/ap-field/date-range/index.vue.mjs +154 -109
- package/es/src/ap-field/interface.d.ts +4 -0
- package/es/src/ap-field/select/index.vue.mjs +4 -2
- package/es/src/ap-form/ap-form.vue.d.ts +1 -1
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/style/ap-form-item.css +2 -0
- package/es/src/ap-table/ap-table.vue.mjs +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -97
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +37 -33
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +5 -6
- package/es/src/ap-table/components/setting/utils.d.ts +7 -1
- package/es/src/ap-table/components/setting/utils.mjs +37 -22
- package/es/src/ap-table/constants.d.ts +12 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +101 -33
- package/es/src/ap-table/interface.d.ts +8 -1
- package/es/src/ap-table/utils.mjs +42 -42
- package/es/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
- package/es/src/business/ap-action-button/ApActionButton.vue.mjs +4 -0
- package/es/src/business/ap-action-button/ApActionButton.vue2.mjs +97 -0
- package/es/src/business/ap-action-button/index.css +6 -0
- package/es/src/business/ap-action-button/interface.d.ts +6 -0
- package/es/src/business/ap-action-button/interface.mjs +1 -0
- package/es/src/business/index.d.ts +265 -0
- package/es/src/business/index.mjs +25 -21
- package/es/src/editable-table/form-item.vue.d.ts +2 -1
- package/es/src/editable-table/form-item.vue.mjs +69 -65
- package/es/src/editable-table/index.vue.d.ts +2 -1
- package/es/src/editable-table/index.vue.mjs +84 -79
- package/es/src/editable-table/interface.d.ts +6 -0
- package/es/src/index.mjs +209 -207
- package/es/src/theme/ap-action-button/ap-action-button.css +6 -0
- package/es/src/theme/ap-form/ap-form-item.css +2 -0
- package/es/src/work-order-modal/index.mjs +4 -3
- package/es/src/work-order-modal/interfaces.d.ts +3 -0
- package/es/src/work-order-modal/interfaces.mjs +6 -1
- package/es/src/work-order-modal/work-order-modal.vue.mjs +28 -28
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +4 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/style/ap-form-item.css +2 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +7 -1
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +12 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/interface.d.ts +8 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
- package/lib/src/business/ap-action-button/ApActionButton.vue.js +1 -0
- package/lib/src/business/ap-action-button/ApActionButton.vue2.js +1 -0
- package/lib/src/business/ap-action-button/index.css +6 -0
- package/lib/src/business/ap-action-button/interface.d.ts +6 -0
- package/lib/src/business/ap-action-button/interface.js +1 -0
- package/lib/src/business/index.d.ts +265 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +2 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +6 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-action-button/ap-action-button.css +6 -0
- package/lib/src/theme/ap-form/ap-form-item.css +2 -0
- package/lib/src/work-order-modal/index.js +1 -1
- package/lib/src/work-order-modal/interfaces.d.ts +3 -0
- package/lib/src/work-order-modal/interfaces.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1,46 +1,114 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isDef as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ref as _, unref as i, computed as j, watchEffect as z } from "vue";
|
|
2
|
+
import { isDef as D } from "../../utils/index.mjs";
|
|
3
|
+
import G, { customCloneColumnStates as k, getColumnStateString as R } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as W } from "../context.mjs";
|
|
5
|
+
import { isObject as v, mergeWith as E, isBoolean as X, omit as q, isNumber as N } from "lodash-unified";
|
|
6
|
+
function f(r, o) {
|
|
7
|
+
r.forEach((t) => {
|
|
8
|
+
var c;
|
|
9
|
+
o(t), (c = t.children) != null && c.length && f(t.children, o);
|
|
7
10
|
});
|
|
8
11
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
function H(r, o) {
|
|
13
|
+
if (!o)
|
|
14
|
+
return {};
|
|
15
|
+
const t = r.getItem(o);
|
|
16
|
+
return t ? JSON.parse(t) : {};
|
|
17
|
+
}
|
|
18
|
+
function I(r, o) {
|
|
19
|
+
if (v(r) && v(o))
|
|
20
|
+
return E({}, r, o, I);
|
|
21
|
+
}
|
|
22
|
+
const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
|
|
23
|
+
const t = _(o);
|
|
24
|
+
let c = k(o);
|
|
25
|
+
const { columnsBackup: h, updateColumns: u } = W(), T = r.persistenceType || "localStorage", S = window[T];
|
|
26
|
+
function F() {
|
|
27
|
+
const e = H(
|
|
28
|
+
S,
|
|
29
|
+
r.persistenceKey
|
|
30
|
+
), n = E(
|
|
31
|
+
{},
|
|
32
|
+
r.defaultValue || {},
|
|
33
|
+
e,
|
|
34
|
+
I
|
|
35
|
+
), l = i(h);
|
|
36
|
+
function b(M, d, x) {
|
|
37
|
+
return M.map((s) => {
|
|
38
|
+
var A;
|
|
39
|
+
const a = (d == null ? void 0 : d[s.key]) || {}, m = {
|
|
40
|
+
key: s.key,
|
|
41
|
+
label: s.title,
|
|
42
|
+
show: !0,
|
|
43
|
+
fixed: x ? x.fixed : X(s.fixed) ? s.fixed ? "left" : void 0 : s.fixed,
|
|
44
|
+
disabled: !1,
|
|
45
|
+
...q(a, "children")
|
|
46
|
+
};
|
|
47
|
+
return m.children = (A = s.children) != null && A.length ? b(
|
|
48
|
+
s.children,
|
|
49
|
+
a.children,
|
|
50
|
+
m
|
|
51
|
+
) : void 0, m;
|
|
52
|
+
}).sort(
|
|
53
|
+
(s, a) => (N(s.order) ? s.order : B) - (N(a.order) ? a.order : B)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return b(l || [], n);
|
|
57
|
+
}
|
|
58
|
+
const g = j(() => i(t).every((e) => e.show));
|
|
59
|
+
function p() {
|
|
60
|
+
const e = i(t);
|
|
61
|
+
f(e, (n) => {
|
|
62
|
+
!n.disabled && (n.show = !0);
|
|
15
63
|
});
|
|
16
64
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
!
|
|
65
|
+
function C() {
|
|
66
|
+
const e = i(t);
|
|
67
|
+
f(e, (n) => {
|
|
68
|
+
!n.disabled && (n.show = !1);
|
|
21
69
|
});
|
|
22
70
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
71
|
+
function O() {
|
|
72
|
+
i(g) ? C() : p();
|
|
25
73
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
74
|
+
function K(e, n) {
|
|
75
|
+
f(i(t), (l) => {
|
|
76
|
+
l.key === e && (l.show = D(n) ? n : !l.show);
|
|
29
77
|
});
|
|
30
78
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
function w(e) {
|
|
80
|
+
t.value = e;
|
|
81
|
+
}
|
|
82
|
+
function J(e) {
|
|
83
|
+
c = e;
|
|
84
|
+
}
|
|
85
|
+
function y(e) {
|
|
86
|
+
if (r.persistenceKey) {
|
|
87
|
+
const n = R(e);
|
|
88
|
+
S.setItem(r.persistenceKey, JSON.stringify(n));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return z(() => {
|
|
92
|
+
const e = F();
|
|
93
|
+
w(e), u == null || u(
|
|
94
|
+
G(
|
|
95
|
+
i(h),
|
|
96
|
+
i(e)
|
|
97
|
+
)
|
|
98
|
+
), c = k(e), y(e);
|
|
99
|
+
}), {
|
|
100
|
+
columnState: t,
|
|
101
|
+
selectAll: p,
|
|
102
|
+
unSelectAll: C,
|
|
103
|
+
toggleSelect: K,
|
|
104
|
+
setColumnState: w,
|
|
105
|
+
isAllSelected: g,
|
|
106
|
+
toggleSelectAll: O,
|
|
107
|
+
columnStateBackup: c,
|
|
108
|
+
setColumnStateBackup: J,
|
|
109
|
+
cacheColumnStateIfNeeded: y
|
|
42
110
|
};
|
|
43
111
|
};
|
|
44
112
|
export {
|
|
45
|
-
|
|
113
|
+
Z as useTableColumnState
|
|
46
114
|
};
|
|
@@ -84,7 +84,7 @@ export type ApTableSettingType = {
|
|
|
84
84
|
/**
|
|
85
85
|
* 列的默认状态
|
|
86
86
|
*/
|
|
87
|
-
defaultValue?:
|
|
87
|
+
defaultValue?: ApTableSettingDefaultValueType;
|
|
88
88
|
/**
|
|
89
89
|
* 列状态变更时的回调(注意,返回的是全量状态)
|
|
90
90
|
* @param val
|
|
@@ -92,6 +92,9 @@ export type ApTableSettingType = {
|
|
|
92
92
|
*/
|
|
93
93
|
onChange?: (val: ApColumnState[]) => void;
|
|
94
94
|
};
|
|
95
|
+
export type ApTableSettingDefaultValueType = Recordable<Omit<ApColumnState, 'label' | 'key' | 'children'> & {
|
|
96
|
+
children?: ApTableSettingDefaultValueType;
|
|
97
|
+
}>;
|
|
95
98
|
export type ApColumnState = {
|
|
96
99
|
/**
|
|
97
100
|
* 列的唯一标识
|
|
@@ -117,6 +120,10 @@ export type ApColumnState = {
|
|
|
117
120
|
* 子节点状态
|
|
118
121
|
*/
|
|
119
122
|
children?: ApColumnState[];
|
|
123
|
+
/**
|
|
124
|
+
* 字段排序(和其同级的表头排序)
|
|
125
|
+
*/
|
|
126
|
+
order?: number;
|
|
120
127
|
};
|
|
121
128
|
export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
|
|
122
129
|
value: any;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { isObject as c, isArray as p, isUndefined as
|
|
3
|
-
import { apTableRenderItemMap as
|
|
4
|
-
import { isType as
|
|
1
|
+
import { isVNode as m, createVNode as u, mergeProps as f, cloneVNode as T, Fragment as b } from "vue";
|
|
2
|
+
import { isObject as c, isArray as p, isUndefined as y, isFunction as g, omit as h, isBoolean as j, isString as a } from "lodash-unified";
|
|
3
|
+
import { apTableRenderItemMap as F, apTableFormItemMap as O } from "./constants.mjs";
|
|
4
|
+
import { isType as E } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { QuestionCircleOutlined as
|
|
8
|
-
import
|
|
9
|
-
function
|
|
10
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
6
|
+
import { Tooltip as x } from "ant-design-vue";
|
|
7
|
+
import { QuestionCircleOutlined as N } from "@ant-design/icons-vue";
|
|
8
|
+
import S from "../ap-form/ap-form-item.vue.mjs";
|
|
9
|
+
function I(t) {
|
|
10
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !m(t);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const v = (t, e, n) => {
|
|
13
13
|
let r = {};
|
|
14
14
|
return c(t) ? Object.keys(t).forEach((o) => {
|
|
15
|
-
c(t[o]) ? r[o] =
|
|
15
|
+
c(t[o]) ? r[o] = v(t[o], e[o], n) : r[o] = n(t[o], e);
|
|
16
16
|
}) : r = n(t, e), r;
|
|
17
|
-
},
|
|
17
|
+
}, H = (t, e) => {
|
|
18
18
|
switch (t) {
|
|
19
19
|
case "dayjs":
|
|
20
20
|
return e.valueOf();
|
|
@@ -35,15 +35,15 @@ const P = (t, e, n) => {
|
|
|
35
35
|
return e;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
function
|
|
38
|
+
function J(t) {
|
|
39
39
|
return p(t) ? t.join(".") : t;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function P(t) {
|
|
42
42
|
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
43
43
|
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const e = [], n =
|
|
45
|
+
const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t) => {
|
|
46
|
+
const e = [], n = V(t);
|
|
47
47
|
return n.forEach((r, o) => {
|
|
48
48
|
const i = n.get(o) || n.get(`${o}`);
|
|
49
49
|
if (i) {
|
|
@@ -63,7 +63,7 @@ const w = (t) => V(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}), e;
|
|
66
|
-
},
|
|
66
|
+
}, L = (t) => y(t) || t < 0 ? 0 : t, Q = (t, e, n) => {
|
|
67
67
|
if (n)
|
|
68
68
|
return n;
|
|
69
69
|
const r = ["select", "date"], o = ["text", "textArea", "number"];
|
|
@@ -74,16 +74,16 @@ const w = (t) => V(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
|
|
|
74
74
|
if (o.includes(e))
|
|
75
75
|
return t("ap.common.inputText");
|
|
76
76
|
};
|
|
77
|
-
function
|
|
78
|
-
return !t || !
|
|
77
|
+
function w(t, e) {
|
|
78
|
+
return !t || !g(t) ? t : t(e);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function U(t) {
|
|
81
81
|
let e = t.valueType || "text";
|
|
82
82
|
return t.valueEnum && (e = "status"), e;
|
|
83
83
|
}
|
|
84
84
|
function z(t, e, n, r) {
|
|
85
85
|
var s;
|
|
86
|
-
const o =
|
|
86
|
+
const o = F[t];
|
|
87
87
|
if (o)
|
|
88
88
|
return u(o, f(e, {
|
|
89
89
|
mode: "read"
|
|
@@ -95,34 +95,34 @@ function G(t, e) {
|
|
|
95
95
|
if (t.customRenderFormItem)
|
|
96
96
|
return () => {
|
|
97
97
|
const o = t.customRenderFormItem(t);
|
|
98
|
-
return
|
|
98
|
+
return T(o, {
|
|
99
99
|
...t.fieldProps,
|
|
100
100
|
span: t.span,
|
|
101
101
|
...o.props || {}
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
const n =
|
|
104
|
+
const n = O[t.valueType];
|
|
105
105
|
if (n)
|
|
106
106
|
return n;
|
|
107
107
|
const r = e == null ? void 0 : e[t.valueType];
|
|
108
108
|
return () => {
|
|
109
109
|
var i;
|
|
110
110
|
const o = (i = r == null ? void 0 : r.renderFormItem) == null ? void 0 : i.call(r, t.fieldProps.field);
|
|
111
|
-
return o ? u(
|
|
111
|
+
return o ? u(S, f(t.fieldProps, {
|
|
112
112
|
span: t.span
|
|
113
|
-
}),
|
|
113
|
+
}), I(o) ? o : {
|
|
114
114
|
default: () => [o]
|
|
115
115
|
}) : null;
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
function K(t, e) {
|
|
119
|
-
const n =
|
|
119
|
+
const n = w(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", i = t.valueType === "index", s = o ? {
|
|
120
120
|
checked: e.value
|
|
121
121
|
} : {
|
|
122
122
|
value: i ? e.index + 1 : e.value
|
|
123
123
|
};
|
|
124
124
|
return t.valueEnum && (r.valueEnum = t.valueEnum), {
|
|
125
|
-
...
|
|
125
|
+
...h(r, ["request"]),
|
|
126
126
|
...s
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -130,7 +130,7 @@ function X(t) {
|
|
|
130
130
|
const e = {
|
|
131
131
|
...t
|
|
132
132
|
};
|
|
133
|
-
return
|
|
133
|
+
return j(t.filters) && t.filters && t.valueEnum && (e.filters = d(t.valueEnum)), e;
|
|
134
134
|
}
|
|
135
135
|
function Y(t, e) {
|
|
136
136
|
var r;
|
|
@@ -141,7 +141,7 @@ function Y(t, e) {
|
|
|
141
141
|
}), n;
|
|
142
142
|
}
|
|
143
143
|
function Z(t) {
|
|
144
|
-
if (!
|
|
144
|
+
if (!E("Object")(t))
|
|
145
145
|
return t;
|
|
146
146
|
try {
|
|
147
147
|
return JSON.stringify(t);
|
|
@@ -159,40 +159,40 @@ function k(t, e, n, r) {
|
|
|
159
159
|
const s = a(t.title) ? u("span", {
|
|
160
160
|
class: e,
|
|
161
161
|
title: t.title
|
|
162
|
-
}, [t.title]) : t.title, l = t.tooltip ? a(t.tooltip) ? u(
|
|
162
|
+
}, [t.title]) : t.title, l = t.tooltip ? a(t.tooltip) ? u(b, null, [t.tooltip]) : t.tooltip(t) : null;
|
|
163
|
+
return l ? u("span", {
|
|
163
164
|
style: {
|
|
164
165
|
display: "inline-flex",
|
|
165
166
|
alignItems: "center"
|
|
166
167
|
}
|
|
167
|
-
}, [s, u(
|
|
168
|
+
}, [s, u(x, {
|
|
168
169
|
title: l,
|
|
169
170
|
placement: "bottom"
|
|
170
171
|
}, {
|
|
171
|
-
default: () => [u(
|
|
172
|
+
default: () => [u(N, {
|
|
172
173
|
style: {
|
|
173
174
|
padding: "4px",
|
|
174
175
|
color: r,
|
|
175
176
|
verticalAlign: "middle"
|
|
176
177
|
}
|
|
177
178
|
}, null)]
|
|
178
|
-
})]);
|
|
179
|
-
return l ? m : s;
|
|
179
|
+
})]) : s;
|
|
180
180
|
}
|
|
181
181
|
export {
|
|
182
182
|
X as apColumnToColumn,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
J as dataIndexToStr,
|
|
184
|
+
v as formatParamsValueType,
|
|
185
|
+
L as getColumnOrder,
|
|
186
|
+
w as getFieldProps,
|
|
187
|
+
Q as getPlaceholder,
|
|
188
188
|
G as getSearchFormItemRenderNode,
|
|
189
189
|
z as getTableCellRenderNode,
|
|
190
190
|
K as getTableRenderProps,
|
|
191
|
-
|
|
191
|
+
U as getTableRenderType,
|
|
192
192
|
k as getTableTitle,
|
|
193
|
-
|
|
193
|
+
V as objectToMap,
|
|
194
194
|
Z as objectToString,
|
|
195
|
-
|
|
195
|
+
H as parseFieldValue,
|
|
196
196
|
Y as updateFormProps,
|
|
197
197
|
d as valueEnumToArray
|
|
198
198
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ApActionButtonProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { ButtonType } from 'ant-design-vue/es/button';
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
slots: Partial<Record<string, (_: any) => any>>;
|
|
6
|
+
refs: {};
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApActionButtonProps>, {
|
|
11
|
+
type: string;
|
|
12
|
+
minWidth: boolean;
|
|
13
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApActionButtonProps>, {
|
|
14
|
+
type: string;
|
|
15
|
+
minWidth: boolean;
|
|
16
|
+
}>>>, {
|
|
17
|
+
type: ButtonType | "borderLink";
|
|
18
|
+
minWidth: boolean | number | string;
|
|
19
|
+
}, {}>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithDefaults<P, D> = {
|
|
23
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
24
|
+
default: D[K];
|
|
25
|
+
}> : P[K];
|
|
26
|
+
};
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
+
type __VLS_TypePropsToOption<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
+
} : {
|
|
32
|
+
type: PropType<T[K]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_PrettifyLocal<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { defineComponent as M, computed as a, openBlock as h, createBlock as P, unref as p, mergeProps as x, createSlots as A, renderList as _, withCtx as w, renderSlot as z, normalizeProps as F, guardReactiveProps as O } from "vue";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import { Button as S } from "ant-design-vue";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { omit as T } from "lodash-unified";
|
|
6
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { useGlobalConfig as G } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
const I = 88, K = /* @__PURE__ */ M({
|
|
9
|
+
__name: "ApActionButton",
|
|
10
|
+
props: {
|
|
11
|
+
prefixCls: {},
|
|
12
|
+
htmlType: {},
|
|
13
|
+
shape: {},
|
|
14
|
+
size: {},
|
|
15
|
+
loading: { type: [Boolean, Object] },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
ghost: { type: Boolean },
|
|
18
|
+
block: { type: Boolean },
|
|
19
|
+
danger: { type: Boolean },
|
|
20
|
+
icon: {},
|
|
21
|
+
href: {},
|
|
22
|
+
target: {},
|
|
23
|
+
title: {},
|
|
24
|
+
onClick: {},
|
|
25
|
+
onMousedown: {},
|
|
26
|
+
type: { default: "borderLink" },
|
|
27
|
+
borderLinkColor: {},
|
|
28
|
+
minWidth: { type: [Boolean, Number, String], default: !0 }
|
|
29
|
+
},
|
|
30
|
+
setup(v) {
|
|
31
|
+
const e = v, c = {
|
|
32
|
+
aplus: "#0070FF",
|
|
33
|
+
admin: "#34b77c"
|
|
34
|
+
}, { b: l } = j("ap-action-button"), g = G("uiMode"), k = a(
|
|
35
|
+
() => e.borderLinkColor || c[g.value] || c.aplus
|
|
36
|
+
), d = a(
|
|
37
|
+
() => e.type === "borderLink" ? k.value : void 0
|
|
38
|
+
), f = a(() => $(d.value)), B = a(() => e.minWidth === !0 ? `${I}px` : typeof e.minWidth == "number" ? `${e.minWidth}px` : typeof e.minWidth == "string" ? e.minWidth : void 0), W = a(
|
|
39
|
+
() => (e.type === "borderLink" ? "default" : e.type) || "default"
|
|
40
|
+
);
|
|
41
|
+
function L() {
|
|
42
|
+
const r = T(e, ["type", "borderLinkColor", "minWidth"]);
|
|
43
|
+
return r ? {
|
|
44
|
+
...r,
|
|
45
|
+
type: W.value
|
|
46
|
+
} : {};
|
|
47
|
+
}
|
|
48
|
+
function $(r, s = "0.7") {
|
|
49
|
+
var y;
|
|
50
|
+
try {
|
|
51
|
+
var t = r == null ? void 0 : r.toLowerCase(), u = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
52
|
+
if (t && u.test(t)) {
|
|
53
|
+
if (t.length === 4) {
|
|
54
|
+
for (var m = "#", o = 1; o < 4; o += 1)
|
|
55
|
+
m += t.slice(o, o + 1).concat(t.slice(o, o + 1));
|
|
56
|
+
t = m;
|
|
57
|
+
}
|
|
58
|
+
for (var b = [], i = 1; i < 7; i += 2)
|
|
59
|
+
b.push(parseInt("0x" + t.slice(i, i + 2)));
|
|
60
|
+
return "rgba(" + b.join(",") + "," + s + ")";
|
|
61
|
+
}
|
|
62
|
+
if (t && t.startsWith("rgb")) {
|
|
63
|
+
let n = t.match(/(\d(\.\d+)?)+/g);
|
|
64
|
+
return n = (y = n == null ? void 0 : n.slice(0, 3)) == null ? void 0 : y.concat(s), "rgba(" + n.join(",") + ")";
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
} catch {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return (r, s) => (h(), P(p(S), x({
|
|
72
|
+
class: {
|
|
73
|
+
[p(l)()]: !0,
|
|
74
|
+
[`${p(l)()}-border-link`]: f.value
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
...r.$attrs,
|
|
78
|
+
...L()
|
|
79
|
+
}, {
|
|
80
|
+
style: {
|
|
81
|
+
color: d.value,
|
|
82
|
+
minWidth: B.value,
|
|
83
|
+
"--button-border-color": f.value
|
|
84
|
+
}
|
|
85
|
+
}), A({ _: 2 }, [
|
|
86
|
+
_(Object.keys(r.$slots), (t) => ({
|
|
87
|
+
name: t,
|
|
88
|
+
fn: w((u) => [
|
|
89
|
+
z(r.$slots, t, F(O(u || {})))
|
|
90
|
+
])
|
|
91
|
+
}))
|
|
92
|
+
]), 1040, ["class", "style"]));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export {
|
|
96
|
+
K as default
|
|
97
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
.aplus-ap-action-button-border-link:not(:disabled):hover,
|
|
2
|
+
.aplus-ap-action-button-border-link:not(:disabled):active,
|
|
3
|
+
.aplus-ap-action-button-border-link:not(:disabled):focus {
|
|
4
|
+
border-color: var(--button-border-color);
|
|
5
|
+
color: var(--button-border-color) !important;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|