@aplus-frontend/ui 0.2.0 → 0.2.1
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 +1 -1
- package/es/src/ap-button/ap-action-button.vue.mjs +1 -0
- package/es/src/ap-button/ap-button.vue.d.ts +3 -0
- package/es/src/ap-button/ap-button.vue.mjs +47 -66
- package/es/src/ap-button/interface.d.ts +1 -0
- package/es/src/ap-button/utils/index.d.ts +3 -0
- package/es/src/ap-button/utils/index.mjs +33 -0
- package/es/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
- package/es/src/ap-descriptions/interface.d.ts +1 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +23 -22
- package/es/src/ap-field/hooks/use-options.d.ts +8 -0
- package/es/src/ap-field/hooks/use-options.mjs +22 -0
- package/es/src/ap-field/radio/index.vue.mjs +25 -24
- package/es/src/ap-field/segmented/index.vue.mjs +37 -33
- package/es/src/ap-field/select/index.vue.mjs +74 -73
- package/es/src/ap-table/ap-table.vue.mjs +2 -428
- package/es/src/ap-table/ap-table.vue2.mjs +428 -2
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +22 -20
- package/es/src/ap-table/hooks/use-table-column-state.mjs +72 -69
- package/es/src/ap-table/index.d.ts +6 -1
- package/es/src/ap-table/index.mjs +9 -3
- package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +42 -29
- package/es/src/business/ap-batch-action/index.d.ts +8 -3
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +14 -13
- package/es/src/business/ap-batch-action-group/index.d.ts +4 -0
- package/es/src/business/ap-button-group/index.d.ts +8 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +42 -40
- package/es/src/business/ap-table-modal/index.d.ts +38 -1
- package/es/src/business/ap-table-modal/interface.d.ts +17 -2
- package/es/src/business/ap-table-modal/style/css.js +1 -1
- package/es/src/business/ap-table-modal/style/index.js +1 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
- package/es/src/business/ap-table-modal/table-layout/index.vue.mjs +4 -0
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +74 -0
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +134 -79
- package/es/src/config-provider/config-provider.d.ts +1 -0
- package/es/src/config-provider/css-var.d.ts +1 -0
- package/es/src/config-provider/css-var.mjs +7 -5
- package/es/src/config-provider/index.d.ts +6 -0
- package/es/src/index.mjs +201 -202
- package/es/src/locale/lang/en.mjs +3 -1
- package/es/src/locale/lang/zh-cn.mjs +3 -1
- package/es/src/path-map.mjs +2 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-button/ap-action-button.vue.js +1 -1
- package/lib/src/ap-button/ap-button.vue.d.ts +3 -0
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/interface.d.ts +1 -0
- package/lib/src/ap-button/utils/index.d.ts +3 -0
- package/lib/src/ap-button/utils/index.js +1 -0
- package/lib/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
- package/lib/src/ap-descriptions/interface.d.ts +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-options.d.ts +8 -0
- package/lib/src/ap-field/hooks/use-options.js +1 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/index.d.ts +6 -1
- package/lib/src/ap-table/index.js +1 -1
- package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
- package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
- package/lib/src/business/ap-batch-action/index.d.ts +8 -3
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +4 -0
- package/lib/src/business/ap-button-group/index.d.ts +8 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +38 -1
- package/lib/src/business/ap-table-modal/interface.d.ts +17 -2
- package/lib/src/business/ap-table-modal/style/css.js +1 -1
- package/lib/src/business/ap-table-modal/style/index.js +1 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
- package/lib/src/business/ap-table-modal/table-layout/index.vue.js +1 -0
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +1 -0
- package/lib/src/config-provider/css-var.d.ts +1 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +6 -0
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -89,7 +89,7 @@ import { useTableRefresh as Nr } from "./src/business/hooks/useTableRefresh.mjs"
|
|
|
89
89
|
import { computedRecords as wr, flattenColumns as Rr, formatDataIndex as vr, formatNumber as Er } from "./src/business/ap-summary/utils.mjs";
|
|
90
90
|
import { ApSummary as Kr } from "./src/business/ap-summary/index.mjs";
|
|
91
91
|
import { useTablePaging as Wr } from "./src/ap-table/hooks/use-table-paging.mjs";
|
|
92
|
-
import {
|
|
92
|
+
import { ApTable as Ur } from "./src/ap-table/index.mjs";
|
|
93
93
|
import { default as $r } from "./src/editable-table/index.vue.mjs";
|
|
94
94
|
import { default as qr } from "./src/editable-table/form-item.vue.mjs";
|
|
95
95
|
import { default as Jr } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
|
|
@@ -11,16 +11,19 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
11
11
|
type: string;
|
|
12
12
|
minWidth: boolean;
|
|
13
13
|
loading: undefined;
|
|
14
|
+
lazy: boolean;
|
|
14
15
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApButtonProps>, {
|
|
15
16
|
type: string;
|
|
16
17
|
minWidth: boolean;
|
|
17
18
|
loading: undefined;
|
|
19
|
+
lazy: boolean;
|
|
18
20
|
}>>>, {
|
|
19
21
|
type: ButtonType | "borderLink";
|
|
20
22
|
minWidth: boolean | number | string;
|
|
21
23
|
loading: boolean | {
|
|
22
24
|
delay?: number;
|
|
23
25
|
};
|
|
26
|
+
lazy: boolean | number;
|
|
24
27
|
}, {}>;
|
|
25
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
29
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { defineComponent as C, ref as B, computed as t, openBlock as W, createBlock as z, unref as a, mergeProps as L, createSlots as w, renderList as M, withCtx as T, renderSlot as $, normalizeProps as P, guardReactiveProps as _ } from "vue";
|
|
2
|
+
import { Button as x } from "@aplus-frontend/antdv";
|
|
3
|
+
import { wait as N } from "@aplus-frontend/utils";
|
|
3
4
|
import "../config-provider/index.mjs";
|
|
4
5
|
import { omit as O } from "lodash-unified";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { transferOpacityColor as j, isAsynchronous as A } from "./utils/index.mjs";
|
|
7
|
+
import { useNamespace as D } from "../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import { useGlobalConfig as F } from "../config-provider/hooks/use-global-config.mjs";
|
|
9
|
+
const S = 88, G = 300, U = /* @__PURE__ */ C({
|
|
8
10
|
__name: "ap-button",
|
|
9
11
|
props: {
|
|
10
12
|
prefixCls: {},
|
|
@@ -24,94 +26,73 @@ const G = 88, K = /* @__PURE__ */ L({
|
|
|
24
26
|
type: { default: "default" },
|
|
25
27
|
borderLinkColor: {},
|
|
26
28
|
minWidth: { type: [Boolean, Number, String], default: !1 },
|
|
29
|
+
lazy: { type: [Boolean, Number], default: !0 },
|
|
27
30
|
onClick: {}
|
|
28
31
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const e =
|
|
32
|
+
setup(f) {
|
|
33
|
+
const e = f, l = {
|
|
31
34
|
aplus: "#0070FF",
|
|
32
35
|
admin: "#34b77c"
|
|
33
|
-
}, { b:
|
|
34
|
-
() => e.borderLinkColor ||
|
|
35
|
-
),
|
|
36
|
-
() => e.type === "borderLink" ?
|
|
37
|
-
),
|
|
36
|
+
}, { b: i } = D("ap-action-button"), m = F("uiMode"), r = B(!1), y = t(
|
|
37
|
+
() => e.borderLinkColor || l[m.value] || l.aplus
|
|
38
|
+
), s = t(
|
|
39
|
+
() => e.type === "borderLink" ? y.value : void 0
|
|
40
|
+
), u = t(
|
|
41
|
+
() => j(s.value)
|
|
42
|
+
), b = t(() => e.minWidth === !0 ? `${S}px` : typeof e.minWidth == "number" ? `${e.minWidth}px` : typeof e.minWidth == "string" ? e.minWidth : void 0), v = t(
|
|
38
43
|
() => (e.type === "borderLink" ? "default" : e.type) || "default"
|
|
39
|
-
),
|
|
40
|
-
function
|
|
41
|
-
const
|
|
44
|
+
), d = t(() => e.loading ?? r.value ?? !1), p = t(() => e.lazy === !0 ? G : typeof e.lazy == "number" && e.lazy >= 0 ? e.lazy : 0);
|
|
45
|
+
function h() {
|
|
46
|
+
const o = O(e, [
|
|
42
47
|
"type",
|
|
43
48
|
"borderLinkColor",
|
|
44
49
|
"minWidth",
|
|
45
50
|
"onClick",
|
|
46
51
|
"loading"
|
|
47
52
|
]);
|
|
48
|
-
return
|
|
49
|
-
...
|
|
50
|
-
type:
|
|
51
|
-
onclick:
|
|
53
|
+
return o ? {
|
|
54
|
+
...o,
|
|
55
|
+
type: v.value,
|
|
56
|
+
onclick: k
|
|
52
57
|
} : {};
|
|
53
58
|
}
|
|
54
|
-
async function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
s.value = !0;
|
|
58
|
-
try {
|
|
59
|
-
await ((t = e.onClick) == null ? void 0 : t.call(e));
|
|
60
|
-
} finally {
|
|
61
|
-
s.value = !1;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function W(t, u = "0.7") {
|
|
66
|
-
var i;
|
|
59
|
+
async function k() {
|
|
60
|
+
if (d.value) return;
|
|
61
|
+
const o = A(e.onClick), c = Date.now();
|
|
67
62
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
r += o.slice(l, l + 1).concat(o.slice(l, l + 1));
|
|
74
|
-
o = r;
|
|
75
|
-
}
|
|
76
|
-
const n = [];
|
|
77
|
-
for (let r = 1; r < 7; r += 2)
|
|
78
|
-
n.push(parseInt("0x" + o.slice(r, r + 2)));
|
|
79
|
-
return "rgba(" + n.join(",") + "," + u + ")";
|
|
80
|
-
}
|
|
81
|
-
if (o && o.startsWith("rgb")) {
|
|
82
|
-
let n = o.match(/(\d(\.\d+)?)+/g);
|
|
83
|
-
return n = (i = n == null ? void 0 : n.slice(0, 3)) == null ? void 0 : i.concat(u), "rgba(" + n.join(",") + ")";
|
|
63
|
+
o && (r.value = !0, await o);
|
|
64
|
+
} finally {
|
|
65
|
+
if (o) {
|
|
66
|
+
const n = Date.now() - c;
|
|
67
|
+
n < p.value && await N(p.value - n), r.value = !1;
|
|
84
68
|
}
|
|
85
|
-
return o;
|
|
86
|
-
} catch {
|
|
87
|
-
return;
|
|
88
69
|
}
|
|
89
70
|
}
|
|
90
|
-
return (
|
|
71
|
+
return (o, c) => (W(), z(a(x), L({
|
|
91
72
|
class: {
|
|
92
|
-
[
|
|
93
|
-
[`${
|
|
73
|
+
[a(i)()]: !0,
|
|
74
|
+
[`${a(i)()}-border-link`]: u.value
|
|
94
75
|
}
|
|
95
76
|
}, {
|
|
96
|
-
...
|
|
97
|
-
...
|
|
77
|
+
...o.$attrs,
|
|
78
|
+
...h()
|
|
98
79
|
}, {
|
|
99
80
|
style: {
|
|
100
|
-
color:
|
|
101
|
-
minWidth:
|
|
102
|
-
"--button-border-color":
|
|
81
|
+
color: s.value,
|
|
82
|
+
minWidth: b.value,
|
|
83
|
+
"--button-border-color": u.value
|
|
103
84
|
},
|
|
104
|
-
loading:
|
|
105
|
-
}),
|
|
106
|
-
|
|
107
|
-
name:
|
|
108
|
-
fn:
|
|
109
|
-
|
|
85
|
+
loading: d.value
|
|
86
|
+
}), w({ _: 2 }, [
|
|
87
|
+
M(Object.keys(o.$slots), (n) => ({
|
|
88
|
+
name: n,
|
|
89
|
+
fn: T((g) => [
|
|
90
|
+
$(o.$slots, n, P(_(g || {})))
|
|
110
91
|
])
|
|
111
92
|
}))
|
|
112
93
|
]), 1040, ["class", "style", "loading"]));
|
|
113
94
|
}
|
|
114
95
|
});
|
|
115
96
|
export {
|
|
116
|
-
|
|
97
|
+
U as default
|
|
117
98
|
};
|
|
@@ -3,6 +3,7 @@ export type ApButtonProps = Omit<ButtonProps, 'type' | 'onClick'> & {
|
|
|
3
3
|
type?: ButtonProps['type'] | 'borderLink';
|
|
4
4
|
borderLinkColor?: string;
|
|
5
5
|
minWidth?: boolean | number | string;
|
|
6
|
+
lazy?: boolean | number;
|
|
6
7
|
onClick?: () => any | Promise<any>;
|
|
7
8
|
};
|
|
8
9
|
export type ApActionButtonProps = ApButtonProps;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function a(t) {
|
|
2
|
+
return typeof t == "object" && typeof t.then == "function" ? t : !1;
|
|
3
|
+
}
|
|
4
|
+
const l = (t) => typeof t == "function" && a(t == null ? void 0 : t()), f = (t, n = "0.7") => {
|
|
5
|
+
var s;
|
|
6
|
+
try {
|
|
7
|
+
let e = t == null ? void 0 : t.toLowerCase();
|
|
8
|
+
if (e && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) {
|
|
9
|
+
if (e.length === 4) {
|
|
10
|
+
let o = "#";
|
|
11
|
+
for (let c = 1; c < 4; c += 1)
|
|
12
|
+
o += e.slice(c, c + 1).concat(e.slice(c, c + 1));
|
|
13
|
+
e = o;
|
|
14
|
+
}
|
|
15
|
+
const r = [];
|
|
16
|
+
for (let o = 1; o < 7; o += 2)
|
|
17
|
+
r.push(parseInt("0x" + e.slice(o, o + 2)));
|
|
18
|
+
return "rgba(" + r.join(",") + "," + n + ")";
|
|
19
|
+
}
|
|
20
|
+
if (e && e.startsWith("rgb")) {
|
|
21
|
+
let r = e.match(/(\d(\.\d+)?)+/g);
|
|
22
|
+
return r = (s = r == null ? void 0 : r.slice(0, 3)) == null ? void 0 : s.concat(n), "rgba(" + r.join(",") + ")";
|
|
23
|
+
}
|
|
24
|
+
return e;
|
|
25
|
+
} catch {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
l as isAsynchronous,
|
|
31
|
+
a as isPromise,
|
|
32
|
+
f as transferOpacityColor
|
|
33
|
+
};
|
|
@@ -8,9 +8,9 @@ declare function __VLS_template(): {
|
|
|
8
8
|
};
|
|
9
9
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
10
|
declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<{
|
|
11
|
-
helpMessage?:
|
|
11
|
+
helpMessage?: any;
|
|
12
12
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
13
|
-
helpMessage?:
|
|
13
|
+
helpMessage?: any;
|
|
14
14
|
}>>>, {}, {}>;
|
|
15
15
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
16
|
export default _default;
|
|
@@ -23,7 +23,7 @@ export interface ItemSchema<T extends Recordable = Recordable> {
|
|
|
23
23
|
labelStyle?: CSSProperties;
|
|
24
24
|
customRender?: (record?: T) => VNodeChild | VNode;
|
|
25
25
|
contentSlotName?: string;
|
|
26
|
-
helpMessage?:
|
|
26
|
+
helpMessage?: any;
|
|
27
27
|
}
|
|
28
28
|
/** 空的类型描述类型 */
|
|
29
29
|
export type EmptyItemSchema = {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as h, ref as
|
|
2
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as h, ref as b, onMounted as C, openBlock as o, createElementBlock as l, Fragment as n, unref as e, createTextVNode as m, toDisplayString as c, createBlock as d, mergeProps as V } from "vue";
|
|
2
|
+
import { isFunction as B, isNil as O, omit as q } from "lodash-unified";
|
|
3
3
|
import { Spin as T, CheckboxGroup as U } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { getOptionValue as _, getOptionLabel as F } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import N from "../hooks/use-options.mjs";
|
|
8
|
+
import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useControllableValue as S } from "../../hooks/useControllableValue.mjs";
|
|
10
|
+
const I = /* @__PURE__ */ h({
|
|
10
11
|
name: "ApFieldCheckbox",
|
|
11
12
|
inheritAttrs: !1,
|
|
12
13
|
__name: "index",
|
|
@@ -28,35 +29,35 @@ const P = /* @__PURE__ */ h({
|
|
|
28
29
|
vertical: { type: Boolean }
|
|
29
30
|
},
|
|
30
31
|
emits: ["update:value"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
setup(f, { emit: v }) {
|
|
33
|
+
const y = v, t = f, { options: p, updateOptions: k } = N(t), { m: x } = A("field-checkbox"), i = b(!1);
|
|
34
|
+
C(() => {
|
|
35
|
+
B(t.request) && (i.value = !0, t.request().then((a) => k(a)).finally(() => {
|
|
36
|
+
i.value = !1;
|
|
36
37
|
}));
|
|
37
38
|
});
|
|
38
|
-
const { value:
|
|
39
|
+
const { value: r, updateValue: g } = S(
|
|
39
40
|
t,
|
|
40
|
-
|
|
41
|
+
y,
|
|
41
42
|
{
|
|
42
43
|
defaultValue: []
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
|
-
return (a,
|
|
46
|
-
var
|
|
46
|
+
return (a, j) => {
|
|
47
|
+
var u;
|
|
47
48
|
return a.mode === "read" ? (o(), l(n, { key: 0 }, [
|
|
48
|
-
e(
|
|
49
|
-
c(
|
|
49
|
+
e(O)(e(r)) ? (o(), l(n, { key: 0 }, [
|
|
50
|
+
m(c(t.emptyText), 1)
|
|
50
51
|
], 64)) : (o(), l(n, { key: 1 }, [
|
|
51
|
-
c(
|
|
52
|
+
m(c(((u = e(p)) == null ? void 0 : u.filter((s) => e(r).indexOf(e(_)(s)) > -1).map((s) => e(F)(s)).join("、")) || t.emptyText), 1)
|
|
52
53
|
], 64))
|
|
53
54
|
], 64)) : (o(), l(n, { key: 1 }, [
|
|
54
|
-
|
|
55
|
+
i.value ? (o(), d(e(T), {
|
|
55
56
|
key: 0,
|
|
56
57
|
size: "small"
|
|
57
|
-
})) : (o(),
|
|
58
|
-
options:
|
|
59
|
-
value: e(
|
|
58
|
+
})) : (o(), d(e(U), V({ key: 1 }, e(q)(t, ["onUpdate:value", "value", "request", "vertical"]), {
|
|
59
|
+
options: e(p),
|
|
60
|
+
value: e(r),
|
|
60
61
|
"onUpdate:value": e(g),
|
|
61
62
|
class: a.vertical ? e(x)("vertical") : null
|
|
62
63
|
}), null, 16, ["options", "value", "onUpdate:value", "class"]))
|
|
@@ -65,5 +66,5 @@ const P = /* @__PURE__ */ h({
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
I as default
|
|
69
70
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ref as i, watch as o } from "vue";
|
|
2
|
+
const f = (e) => {
|
|
3
|
+
const u = i((e == null ? void 0 : e.options) || []);
|
|
4
|
+
function n(t) {
|
|
5
|
+
t && (u.value = t);
|
|
6
|
+
}
|
|
7
|
+
return o(
|
|
8
|
+
() => e.options,
|
|
9
|
+
(t) => {
|
|
10
|
+
t && (u.value = t);
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
deep: !0
|
|
14
|
+
}
|
|
15
|
+
), {
|
|
16
|
+
options: u,
|
|
17
|
+
updateOptions: n
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
f as default
|
|
22
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, ref as p, onMounted as C, computed as O, unref as o, openBlock as l, createElementBlock as m, Fragment as c, createTextVNode as R, toDisplayString as U, createBlock as d, mergeProps as h } from "vue";
|
|
2
2
|
import { Spin as G, RadioGroup as N } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import { isNil as S, omit as z } from "lodash-unified";
|
|
5
|
-
import { getOptionValue as F, getOptionLabel as
|
|
5
|
+
import { getOptionValue as F, getOptionLabel as A } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import D from "../hooks/use-options.mjs";
|
|
8
|
+
import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
|
|
9
|
+
import { useNamespace as L } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const W = /* @__PURE__ */ q({
|
|
10
11
|
name: "ApFieldRadio",
|
|
11
12
|
__name: "index",
|
|
12
13
|
props: {
|
|
@@ -30,36 +31,36 @@ const J = /* @__PURE__ */ _({
|
|
|
30
31
|
},
|
|
31
32
|
emits: ["update:value"],
|
|
32
33
|
setup(f, { expose: v, emit: y }) {
|
|
33
|
-
const t = f, g = y, n =
|
|
34
|
-
|
|
34
|
+
const t = f, g = y, n = p(), { options: u, updateOptions: k } = D(t), { value: i, updateValue: x } = E(t, g), { m: b } = L("field-radio"), r = p(!1);
|
|
35
|
+
C(() => {
|
|
35
36
|
var e;
|
|
36
|
-
t.request && (r.value = !0, (e = t.request) == null || e.call(t).then((a) =>
|
|
37
|
+
t.request && (r.value = !0, (e = t.request) == null || e.call(t).then((a) => k(a)).finally(() => {
|
|
37
38
|
r.value = !1;
|
|
38
39
|
}));
|
|
39
40
|
});
|
|
40
|
-
const
|
|
41
|
-
var
|
|
42
|
-
const e = o(
|
|
41
|
+
const T = O(() => {
|
|
42
|
+
var s;
|
|
43
|
+
const e = o(i);
|
|
43
44
|
if (S(e))
|
|
44
45
|
return t.emptyText;
|
|
45
|
-
const a = (
|
|
46
|
-
(
|
|
46
|
+
const a = (s = u.value) == null ? void 0 : s.find(
|
|
47
|
+
(_) => e === F(_)
|
|
47
48
|
);
|
|
48
|
-
return
|
|
49
|
+
return A(a) || t.emptyText;
|
|
49
50
|
});
|
|
50
|
-
function
|
|
51
|
+
function B() {
|
|
51
52
|
var e;
|
|
52
53
|
(e = n.value) == null || e.focus();
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function V() {
|
|
55
56
|
var e;
|
|
56
57
|
(e = n.value) == null || e.blur();
|
|
57
58
|
}
|
|
58
59
|
return v({
|
|
59
|
-
focus:
|
|
60
|
-
blur:
|
|
60
|
+
focus: B,
|
|
61
|
+
blur: V
|
|
61
62
|
}), (e, a) => e.mode === "read" ? (l(), m(c, { key: 0 }, [
|
|
62
|
-
R(U(
|
|
63
|
+
R(U(T.value), 1)
|
|
63
64
|
], 64)) : (l(), m(c, { key: 1 }, [
|
|
64
65
|
r.value ? (l(), d(o(G), {
|
|
65
66
|
key: 0,
|
|
@@ -74,17 +75,17 @@ const J = /* @__PURE__ */ _({
|
|
|
74
75
|
"vertical"
|
|
75
76
|
]),
|
|
76
77
|
{
|
|
77
|
-
value: o(
|
|
78
|
-
"onUpdate:value": o(
|
|
79
|
-
options: u
|
|
78
|
+
value: o(i),
|
|
79
|
+
"onUpdate:value": o(x),
|
|
80
|
+
options: o(u),
|
|
80
81
|
ref_key: "radioGroupRef",
|
|
81
82
|
ref: n,
|
|
82
|
-
class: e.vertical ? o(
|
|
83
|
+
class: e.vertical ? o(b)("vertical") : null
|
|
83
84
|
}
|
|
84
85
|
), null, 16, ["value", "onUpdate:value", "options", "class"]))
|
|
85
86
|
], 64));
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
+
W as default
|
|
90
91
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as S, ref as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as S, ref as B, useSlots as U, onMounted as V, computed as _, unref as l, createVNode as s, Fragment as a, openBlock as r, createBlock as d, createElementBlock as h, resolveDynamicComponent as N, mergeProps as q, withCtx as z, renderSlot as F, normalizeProps as P, guardReactiveProps as T } from "vue";
|
|
2
|
+
import { Spin as O, Segmented as R } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isFunction as c, isUndefined as w, isString as A, isNumber as D, omit as E } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import M from "../hooks/use-options.mjs";
|
|
6
|
+
import { useControllableValue as $ } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
const L = /* @__PURE__ */ S({
|
|
7
8
|
name: "ApFieldSegmented",
|
|
8
9
|
__name: "index",
|
|
9
10
|
props: {
|
|
@@ -34,50 +35,53 @@ const J = /* @__PURE__ */ S({
|
|
|
34
35
|
request: {}
|
|
35
36
|
},
|
|
36
37
|
emits: ["update:value"],
|
|
37
|
-
setup(
|
|
38
|
-
emit:
|
|
38
|
+
setup(v, {
|
|
39
|
+
emit: y
|
|
39
40
|
}) {
|
|
40
|
-
const
|
|
41
|
+
const o = v, {
|
|
42
|
+
options: m,
|
|
43
|
+
updateOptions: g
|
|
44
|
+
} = M(o), k = y, {
|
|
41
45
|
value: p,
|
|
42
46
|
updateValue: b
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
} = $(o, k), i = B(!1), x = U();
|
|
48
|
+
V(() => {
|
|
49
|
+
c(o.request) && (i.value = !0, o.request().then((e) => g(e)).finally(() => {
|
|
50
|
+
i.value = !1;
|
|
47
51
|
}));
|
|
48
52
|
});
|
|
49
|
-
const C =
|
|
53
|
+
const C = _(() => {
|
|
50
54
|
var f;
|
|
51
|
-
const
|
|
52
|
-
if (w(
|
|
53
|
-
return s(
|
|
54
|
-
const
|
|
55
|
-
if (A(
|
|
56
|
-
return s(
|
|
57
|
-
const n = (
|
|
58
|
-
return
|
|
59
|
-
...
|
|
60
|
-
})]) : s(
|
|
55
|
+
const e = l(p);
|
|
56
|
+
if (w(e))
|
|
57
|
+
return s(a, null, [o.emptyText]);
|
|
58
|
+
const t = (f = l(m)) == null ? void 0 : f.find((u) => u === e || (u == null ? void 0 : u.value) === e);
|
|
59
|
+
if (A(t) || D(t))
|
|
60
|
+
return s(a, null, [t]);
|
|
61
|
+
const n = (t == null ? void 0 : t.label) || x.label;
|
|
62
|
+
return c(n) ? s(a, null, [n == null ? void 0 : n({
|
|
63
|
+
...t
|
|
64
|
+
})]) : s(a, null, [n || o.emptyText]);
|
|
61
65
|
});
|
|
62
|
-
return (
|
|
66
|
+
return (e, t) => i.value ? (r(), d(l(O), {
|
|
63
67
|
key: 0,
|
|
64
68
|
size: "small"
|
|
65
|
-
})) : (r(),
|
|
69
|
+
})) : (r(), h(a, {
|
|
66
70
|
key: 1
|
|
67
|
-
}, [
|
|
71
|
+
}, [e.mode === "read" ? (r(), d(N(C.value), {
|
|
68
72
|
key: 0
|
|
69
|
-
})) : (r(),
|
|
73
|
+
})) : (r(), d(l(R), q({
|
|
70
74
|
key: 1
|
|
71
|
-
},
|
|
72
|
-
value:
|
|
73
|
-
"onUpdate:value":
|
|
74
|
-
options:
|
|
75
|
+
}, l(E)(o, ["onUpdate:value", "value", "defaultValue", "options"]), {
|
|
76
|
+
value: l(p),
|
|
77
|
+
"onUpdate:value": l(b),
|
|
78
|
+
options: l(m)
|
|
75
79
|
}), {
|
|
76
|
-
label:
|
|
80
|
+
label: z((n) => [F(e.$slots, "label", P(T(n)))]),
|
|
77
81
|
_: 3
|
|
78
82
|
}, 16, ["value", "onUpdate:value", "options"]))], 64));
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
export {
|
|
82
|
-
|
|
86
|
+
L as default
|
|
83
87
|
};
|