@aplus-frontend/ui 0.0.17 → 0.0.19
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 +18 -14
- package/es/src/ap-field/date/helper.d.ts +7 -0
- package/es/src/ap-field/date/helper.mjs +17 -7
- package/es/src/ap-field/date/index.vue.d.ts +3 -1
- package/es/src/ap-field/date/index.vue.mjs +46 -39
- package/es/src/ap-field/date-range/index.vue.d.ts +3 -3
- package/es/src/ap-field/date-range/index.vue.mjs +64 -62
- package/es/src/ap-field/interface.d.ts +10 -1
- package/es/src/ap-form/ap-form-item.vue.mjs +61 -57
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/style/ap-form-item.css +11 -0
- package/es/src/ap-modal/index.d.ts +9 -0
- package/es/src/ap-modal/index.mjs +10 -0
- package/es/src/ap-modal/type.d.ts +13 -0
- package/es/src/ap-modal/type.mjs +1 -0
- package/es/src/ap-modal/utils/createModal.d.ts +3 -0
- package/es/src/ap-modal/utils/createModal.mjs +74 -0
- package/es/src/ap-modal/utils/index.d.ts +1 -0
- package/es/src/ap-modal/utils/index.mjs +4 -0
- package/es/src/ap-table/ap-table.vue.mjs +151 -141
- package/es/src/ap-table/constants.d.ts +41 -15
- package/es/src/ap-table/interface.d.ts +22 -4
- package/es/src/ap-table/style/ap-table.css +1 -0
- package/es/src/ap-table/utils.d.ts +6831 -845
- package/es/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/es/src/business/ap-label/ApLabel.vue.mjs +4 -0
- package/es/src/business/ap-label/ApLabel.vue2.mjs +52 -0
- package/es/src/business/ap-label/index.d.ts +4 -0
- package/es/src/business/ap-label/interface.d.ts +8 -0
- package/es/src/business/ap-label/style.css +4 -0
- package/es/src/business/expandAlert/ApExpandAlert.vue.d.ts +81 -0
- package/es/src/business/expandAlert/ApExpandAlert.vue.mjs +4 -0
- package/es/src/business/expandAlert/ApExpandAlert.vue2.mjs +113 -0
- package/es/src/business/expandAlert/interface.d.ts +26 -0
- package/es/src/business/expandAlert/style.css +42 -0
- package/es/src/business/index.d.ts +416 -1
- package/es/src/business/index.mjs +10 -4
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +192 -188
- package/es/src/theme/ap-expand-alert/ap-expand-alert.css +42 -0
- package/es/src/theme/ap-form/ap-form-item.css +11 -0
- package/es/src/theme/ap-label/ap-label.css +4 -0
- package/es/src/theme/ap-table/ap-table.css +1 -0
- package/es/src/type.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date/helper.d.ts +7 -0
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-field/date/index.vue.d.ts +3 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +3 -3
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +10 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/ap-form-item.css +11 -0
- package/lib/src/ap-modal/index.d.ts +9 -0
- package/lib/src/ap-modal/index.js +1 -0
- package/lib/src/ap-modal/type.d.ts +13 -0
- package/lib/src/ap-modal/type.js +1 -0
- package/lib/src/ap-modal/utils/createModal.d.ts +3 -0
- package/lib/src/ap-modal/utils/createModal.js +1 -0
- package/lib/src/ap-modal/utils/index.d.ts +1 -0
- package/lib/src/ap-modal/utils/index.js +1 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +41 -15
- package/lib/src/ap-table/interface.d.ts +22 -4
- package/lib/src/ap-table/style/ap-table.css +1 -0
- package/lib/src/ap-table/utils.d.ts +6831 -845
- package/lib/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/lib/src/business/ap-label/ApLabel.vue.js +1 -0
- package/lib/src/business/ap-label/ApLabel.vue2.js +1 -0
- package/lib/src/business/ap-label/index.d.ts +4 -0
- package/lib/src/business/ap-label/interface.d.ts +8 -0
- package/lib/src/business/ap-label/style.css +4 -0
- package/lib/src/business/expandAlert/ApExpandAlert.vue.d.ts +81 -0
- package/lib/src/business/expandAlert/ApExpandAlert.vue.js +1 -0
- package/lib/src/business/expandAlert/ApExpandAlert.vue2.js +1 -0
- package/lib/src/business/expandAlert/interface.d.ts +26 -0
- package/lib/src/business/expandAlert/style.css +42 -0
- package/lib/src/business/index.d.ts +416 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-expand-alert/ap-expand-alert.css +42 -0
- package/lib/src/theme/ap-form/ap-form-item.css +11 -0
- package/lib/src/theme/ap-label/ap-label.css +4 -0
- package/lib/src/theme/ap-table/ap-table.css +1 -0
- package/lib/src/type.d.ts +3 -1
- package/package.json +3 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { isArray as
|
|
5
|
-
import { apFormItemColPropKeys as
|
|
6
|
-
import { QuestionCircleOutlined as
|
|
1
|
+
import { defineComponent as j, useSlots as q, ref as m, computed as B, unref as o, watch as D, cloneVNode as E, openBlock as h, createBlock as C, mergeProps as K, createSlots as O, withCtx as i, resolveDynamicComponent as Q, createCommentVNode as U, createElementVNode as w, normalizeClass as G, createVNode as g, normalizeStyle as H, renderList as J, renderSlot as W, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { Form as Z, Tooltip as M } from "ant-design-vue";
|
|
3
|
+
import { useToken as ee } from "ant-design-vue/es/theme/internal";
|
|
4
|
+
import { isArray as oe, omit as k } from "lodash-unified";
|
|
5
|
+
import { apFormItemColPropKeys as te } from "./constant.mjs";
|
|
6
|
+
import { QuestionCircleOutlined as re } from "@ant-design/icons-vue";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
8
|
import { useInjectForm as le } from "./context.mjs";
|
|
9
9
|
import "./style/ap-form-item.css";
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
10
|
+
import { useNamespace as ae } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const ye = /* @__PURE__ */ j({
|
|
12
12
|
name: "ApFormItem",
|
|
13
13
|
__name: "ap-form-item",
|
|
14
14
|
props: {
|
|
@@ -51,87 +51,91 @@ const ve = /* @__PURE__ */ $({
|
|
|
51
51
|
},
|
|
52
52
|
setup(N, { expose: P }) {
|
|
53
53
|
var y, F;
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const t = N, r = q(), { model: u, updateModel: d } = le(), { m: f, b: x } = ae("ap-form-item"), s = m(!1), l = m(), [, V] = ee(), p = B(() => t.name ? oe(t.name) ? t.name.reduce((e, a) => e == null ? void 0 : e[a], o(u)) : u == null ? void 0 : u.value[t.name] : null), c = m((F = (y = r.default) == null ? void 0 : y.call(r)) == null ? void 0 : F[0]);
|
|
55
|
+
D(
|
|
56
56
|
() => {
|
|
57
57
|
var e;
|
|
58
|
-
return (e =
|
|
58
|
+
return (e = r.default) == null ? void 0 : e.call(r);
|
|
59
59
|
},
|
|
60
60
|
(e) => {
|
|
61
61
|
c.value = e == null ? void 0 : e[0];
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
function
|
|
65
|
-
d == null || d(
|
|
64
|
+
function I(e) {
|
|
65
|
+
d == null || d(t.name, e);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function S() {
|
|
68
68
|
s.value = !0;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function _() {
|
|
71
71
|
s.value = !1;
|
|
72
72
|
}
|
|
73
|
-
const v =
|
|
73
|
+
const v = B(() => {
|
|
74
74
|
var a, n;
|
|
75
|
-
if (!
|
|
76
|
-
return (a =
|
|
77
|
-
const e =
|
|
78
|
-
return e ?
|
|
79
|
-
[
|
|
80
|
-
[`onUpdate:${
|
|
81
|
-
bordered:
|
|
82
|
-
onFocus:
|
|
83
|
-
onBlur:
|
|
75
|
+
if (!t.name)
|
|
76
|
+
return (a = r.default()) == null ? void 0 : a[0];
|
|
77
|
+
const e = o(c);
|
|
78
|
+
return e ? E(e, {
|
|
79
|
+
[t.valuePropName]: o(p),
|
|
80
|
+
[`onUpdate:${t.valuePropName}`]: I,
|
|
81
|
+
bordered: t.bordered ? !1 : (n = e == null ? void 0 : e.props) == null ? void 0 : n.bordered,
|
|
82
|
+
onFocus: S,
|
|
83
|
+
onBlur: _
|
|
84
84
|
}) : null;
|
|
85
85
|
});
|
|
86
|
-
function _() {
|
|
87
|
-
var e;
|
|
88
|
-
(e = r.value) == null || e.onFieldBlur();
|
|
89
|
-
}
|
|
90
86
|
function z() {
|
|
91
87
|
var e;
|
|
92
|
-
(e =
|
|
88
|
+
(e = l.value) == null || e.onFieldBlur();
|
|
93
89
|
}
|
|
94
90
|
function A() {
|
|
95
91
|
var e;
|
|
96
|
-
(e =
|
|
92
|
+
(e = l.value) == null || e.onFieldChange();
|
|
97
93
|
}
|
|
98
94
|
function R() {
|
|
99
95
|
var e;
|
|
100
|
-
(e =
|
|
96
|
+
(e = l.value) == null || e.clearValidate();
|
|
101
97
|
}
|
|
102
98
|
function T() {
|
|
103
|
-
|
|
99
|
+
var e;
|
|
100
|
+
(e = l.value) == null || e.resetField();
|
|
101
|
+
}
|
|
102
|
+
function L() {
|
|
103
|
+
return o(p);
|
|
104
104
|
}
|
|
105
105
|
return P({
|
|
106
|
-
onFieldBlur:
|
|
107
|
-
onFieldChange:
|
|
108
|
-
clearValidate:
|
|
109
|
-
resetField:
|
|
110
|
-
getFieldValue:
|
|
111
|
-
}), (e, a) => (h(), C(
|
|
106
|
+
onFieldBlur: z,
|
|
107
|
+
onFieldChange: A,
|
|
108
|
+
clearValidate: R,
|
|
109
|
+
resetField: T,
|
|
110
|
+
getFieldValue: L
|
|
111
|
+
}), (e, a) => (h(), C(o(Z).Item, K({
|
|
112
112
|
ref_key: "formItemRef",
|
|
113
|
-
ref:
|
|
114
|
-
},
|
|
115
|
-
class: {
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
ref: l
|
|
114
|
+
}, o(k)(t, [...o(te), "tooltip"]), {
|
|
115
|
+
class: {
|
|
116
|
+
[o(f)("bordered")]: e.bordered,
|
|
117
|
+
[o(f)("focused")]: e.bordered && s.value,
|
|
118
|
+
[o(x)()]: !0
|
|
119
|
+
},
|
|
120
|
+
colon: e.bordered ? !1 : t.colon
|
|
121
|
+
}), O({
|
|
118
122
|
default: i(() => [
|
|
119
|
-
v.value ? (h(), C(
|
|
123
|
+
v.value ? (h(), C(Q(v.value), { key: 0 })) : U("", !0)
|
|
120
124
|
]),
|
|
121
125
|
_: 2
|
|
122
126
|
}, [
|
|
123
|
-
|
|
127
|
+
t.tooltip ? {
|
|
124
128
|
name: "tooltip",
|
|
125
129
|
fn: i(({ class: n }) => [
|
|
126
|
-
|
|
127
|
-
class:
|
|
130
|
+
w("span", {
|
|
131
|
+
class: G(n)
|
|
128
132
|
}, [
|
|
129
|
-
g(
|
|
130
|
-
title:
|
|
133
|
+
g(o(M), {
|
|
134
|
+
title: t.tooltip
|
|
131
135
|
}, {
|
|
132
136
|
default: i(() => [
|
|
133
|
-
g(
|
|
134
|
-
style:
|
|
137
|
+
g(o(re), {
|
|
138
|
+
style: H({ color: o(V).colorPrimary })
|
|
135
139
|
}, null, 8, ["style"])
|
|
136
140
|
]),
|
|
137
141
|
_: 1
|
|
@@ -140,15 +144,15 @@ const ve = /* @__PURE__ */ $({
|
|
|
140
144
|
]),
|
|
141
145
|
key: "0"
|
|
142
146
|
} : void 0,
|
|
143
|
-
|
|
144
|
-
name:
|
|
145
|
-
fn: i((
|
|
146
|
-
|
|
147
|
+
J(o(k)(r, "default"), (n, b) => ({
|
|
148
|
+
name: b,
|
|
149
|
+
fn: i(($) => [
|
|
150
|
+
W(e.$slots, b, X(Y($ || {})))
|
|
147
151
|
])
|
|
148
152
|
}))
|
|
149
153
|
]), 1040, ["class", "colon"]));
|
|
150
154
|
}
|
|
151
155
|
});
|
|
152
156
|
export {
|
|
153
|
-
|
|
157
|
+
ye as default
|
|
154
158
|
};
|
|
@@ -147,7 +147,7 @@ const s = 24, Pe = /* @__PURE__ */ K({
|
|
|
147
147
|
const v = p.props;
|
|
148
148
|
return _ += v.span || r, Y(p, {
|
|
149
149
|
span: v.span || r,
|
|
150
|
-
key: `ApFormSearchFormItem-${c}`,
|
|
150
|
+
key: `ApFormSearchFormItem-${c}-${Date.now()}`,
|
|
151
151
|
hidden: !t.forceExpand && o(u) && _ > x
|
|
152
152
|
});
|
|
153
153
|
}), H = s - Math.min(x, _) - r;
|
|
@@ -48,3 +48,14 @@
|
|
|
48
48
|
border-color: #66a9ff;
|
|
49
49
|
box-shadow: 0 0 0 2px rgba(5, 155, 255, 0.1);
|
|
50
50
|
}
|
|
51
|
+
.aplus-ap-form-item .ant-form-show-help .ant-form-item-explain-error {
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
line-height: 18px;
|
|
54
|
+
margin-top: 2px;
|
|
55
|
+
}
|
|
56
|
+
.aplus-ap-form-item .ant-col .ant-form-item-extra {
|
|
57
|
+
line-height: 22px;
|
|
58
|
+
min-height: unset;
|
|
59
|
+
margin-top: 4px;
|
|
60
|
+
margin-bottom: 12px;
|
|
61
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Modal as _Modal } from 'ant-design-vue';
|
|
2
|
+
import { CreateModalFunc } from './type';
|
|
3
|
+
|
|
4
|
+
export * from './type';
|
|
5
|
+
type ApModalMixedProps = typeof _Modal & {
|
|
6
|
+
createModal: CreateModalFunc;
|
|
7
|
+
};
|
|
8
|
+
declare const ApModal: ApModalMixedProps;
|
|
9
|
+
export { ApModal };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModalProps } from 'ant-design-vue';
|
|
2
|
+
|
|
3
|
+
export type CreateModalFuncProps = Omit<ModalProps, 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onCancel' | 'onOk' | 'getContainer'> & Partial<{
|
|
4
|
+
onCancel: (e: MouseEvent) => void | Promise<unknown>;
|
|
5
|
+
onOk: (e: MouseEvent) => void | Promise<unknown>;
|
|
6
|
+
getContainer: HTMLElement;
|
|
7
|
+
content: any;
|
|
8
|
+
}>;
|
|
9
|
+
export type CreateModalFuncReturn = {
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
update: (newConfig: CreateModalFuncProps) => void;
|
|
12
|
+
};
|
|
13
|
+
export type CreateModalFunc = (props: CreateModalFuncProps) => CreateModalFuncReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { render as d, defineComponent as h, createVNode as m, mergeProps as f, h as u } from "vue";
|
|
2
|
+
import { Modal as C } from "ant-design-vue";
|
|
3
|
+
const k = (a) => {
|
|
4
|
+
let r, t;
|
|
5
|
+
function s() {
|
|
6
|
+
r && r(!1), setTimeout(() => {
|
|
7
|
+
d(null, o), i.removeChild(o);
|
|
8
|
+
}, 500);
|
|
9
|
+
}
|
|
10
|
+
function c(e) {
|
|
11
|
+
t && t(e);
|
|
12
|
+
}
|
|
13
|
+
const l = /* @__PURE__ */ h({
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
open: !0,
|
|
17
|
+
props: a
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
async handleCancel(e) {
|
|
22
|
+
var n, p;
|
|
23
|
+
(n = this.props) != null && n.onCancel && await ((p = this.props) == null ? void 0 : p.onCancel(e)), s();
|
|
24
|
+
},
|
|
25
|
+
async handleOk(e) {
|
|
26
|
+
var n;
|
|
27
|
+
try {
|
|
28
|
+
t({
|
|
29
|
+
confirmLoading: !0
|
|
30
|
+
}), (n = this.props) != null && n.onOk && await this.props.onOk(e), t({
|
|
31
|
+
confirmLoading: !1
|
|
32
|
+
}), s();
|
|
33
|
+
} catch {
|
|
34
|
+
t({
|
|
35
|
+
confirmLoading: !1
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
created() {
|
|
41
|
+
r = (e) => {
|
|
42
|
+
this.open = e;
|
|
43
|
+
}, t = (e) => {
|
|
44
|
+
this.props = {
|
|
45
|
+
...this.props,
|
|
46
|
+
...e
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
render() {
|
|
51
|
+
const {
|
|
52
|
+
...e
|
|
53
|
+
} = this.props;
|
|
54
|
+
return delete e.onCancel, delete e.onOk, m(C, f({
|
|
55
|
+
open: this.open,
|
|
56
|
+
destroyOnClose: !0,
|
|
57
|
+
onCancel: this.handleCancel,
|
|
58
|
+
onOk: this.handleOk
|
|
59
|
+
}, e), {
|
|
60
|
+
default: () => {
|
|
61
|
+
var n;
|
|
62
|
+
return [(n = this.props) == null ? void 0 : n.content];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}), i = a.getContainer || document.body, o = document.createElement("div");
|
|
67
|
+
return i.appendChild(o), d(u(l), o), {
|
|
68
|
+
destroy: s,
|
|
69
|
+
update: c
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
k as createModal
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './createModal';
|