@aplus-frontend/ui 7.4.0 → 7.4.2
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 +183 -181
- package/es/src/ag-grid/index.vue.mjs +207 -187
- package/es/src/ap-field/date/index.vue.mjs +68 -63
- package/es/src/ap-field/text/index.vue2.mjs +27 -23
- package/es/src/ap-field/text/password.vue.mjs +31 -27
- package/es/src/ap-form/item/index.vue.mjs +95 -86
- package/es/src/ap-modal/style/index.d.ts +3 -0
- package/es/src/ap-modal/style/index.mjs +20 -0
- package/es/src/ap-modal/utils/createModal.mjs +38 -39
- package/es/src/ap-pro-card/style/title.mjs +10 -10
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +26 -24
- package/es/src/business/ag-grid-modal/interface.d.ts +2 -1
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +16 -15
- package/es/src/business/ap-value-select-card/style/index.mjs +2 -2
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +302 -299
- package/es/src/render/index.d.ts +2 -0
- package/es/src/render/index.mjs +4 -0
- package/es/src/render/render.d.ts +15 -0
- package/es/src/render/render.mjs +17 -0
- package/es/src/utils/cssinjs/TokenUtil.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-modal/style/index.d.ts +3 -0
- package/lib/src/ap-modal/style/index.js +1 -0
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-pro-card/style/title.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/style/index.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/render/index.d.ts +2 -0
- package/lib/src/render/index.js +1 -0
- package/lib/src/render/render.d.ts +15 -0
- package/lib/src/render/render.js +1 -0
- package/lib/src/utils/cssinjs/TokenUtil.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/es/src/portal/style/css.d.ts +0 -1
- package/es/src/portal/style/index.d.ts +0 -1
- package/lib/src/portal/style/css.d.ts +0 -1
- package/lib/src/portal/style/index.d.ts +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as N, withCtx as s, createVNode as P, createCommentVNode as I, isRef as j, renderList as b, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
|
|
2
2
|
import u from "dayjs";
|
|
3
|
-
import { InputGroup as G,
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
3
|
+
import { InputGroup as G, FormItemRest as L, Select as Y, SelectOption as Z, DatePicker as q } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ApFieldDatePresetFormats as J, PRESET_FORMAT_MAP as C, PRESET_FORMAT_PICK_MAP as Q, PRESET_FORMAT_TIME_MAP as X } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isNil as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { getTimeFormatToZone as
|
|
9
|
-
import { useDefaultPlaceholder as
|
|
10
|
-
import { useDateTimezone as
|
|
11
|
-
import { useControllableValue as
|
|
12
|
-
const
|
|
6
|
+
import { isNil as S, omit as ee } from "lodash-unified";
|
|
7
|
+
import { formatDayWithTimezone as oe } from "./helper.mjs";
|
|
8
|
+
import { getTimeFormatToZone as te } from "@aplus-frontend/utils";
|
|
9
|
+
import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useDateTimezone as ne } from "../hooks/use-date-timezone.mjs";
|
|
11
|
+
import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
const he = /* @__PURE__ */ E({
|
|
13
13
|
name: "ApFieldDate",
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
@@ -91,23 +91,23 @@ const ye = /* @__PURE__ */ z({
|
|
|
91
91
|
timezone: {}
|
|
92
92
|
},
|
|
93
93
|
emits: ["update:value"],
|
|
94
|
-
setup(
|
|
95
|
-
const e =
|
|
94
|
+
setup(T, { emit: F }) {
|
|
95
|
+
const e = T, O = F, { value: f, updateValue: h } = le(
|
|
96
96
|
e,
|
|
97
97
|
O
|
|
98
|
-
),
|
|
99
|
-
() =>
|
|
100
|
-
), A = r(() => e.shownFormat ? e.shownFormat : l.value ?
|
|
101
|
-
() => l.value ?
|
|
98
|
+
), _ = ae("Date", e), { currentTimezone: d } = ne(e), l = r(
|
|
99
|
+
() => J.indexOf(e.format) > -1
|
|
100
|
+
), A = r(() => e.shownFormat ? e.shownFormat : l.value ? C[e.format] : e.format), m = r(
|
|
101
|
+
() => l.value ? C[e.format] : e.format
|
|
102
102
|
), c = r(() => {
|
|
103
|
-
if (
|
|
103
|
+
if (S(t(f)))
|
|
104
104
|
return;
|
|
105
105
|
let o = u(t(f));
|
|
106
|
-
return e.timezone && (o = u(
|
|
107
|
-
}),
|
|
108
|
-
const o = t(l) ?
|
|
106
|
+
return e.timezone && (o = u(te(t(f), d.value))), o;
|
|
107
|
+
}), R = r(() => t(l) ? e.picker ?? Q[e.format] : e.picker), M = r(() => {
|
|
108
|
+
const o = t(l) ? X[e.format] : {};
|
|
109
109
|
return {
|
|
110
|
-
...
|
|
110
|
+
...ee(e, [
|
|
111
111
|
"value",
|
|
112
112
|
"defaultValue",
|
|
113
113
|
"onChange",
|
|
@@ -116,12 +116,12 @@ const ye = /* @__PURE__ */ z({
|
|
|
116
116
|
"onUpdate:value",
|
|
117
117
|
"mode"
|
|
118
118
|
]),
|
|
119
|
-
placeholder: t(
|
|
119
|
+
placeholder: t(_),
|
|
120
120
|
...o
|
|
121
121
|
};
|
|
122
|
-
}), v = (o, n, a = !0) =>
|
|
123
|
-
function
|
|
124
|
-
if (
|
|
122
|
+
}), v = (o, n, a = !0) => oe(d.value)(o, n, a);
|
|
123
|
+
function D(o) {
|
|
124
|
+
if (S(o)) {
|
|
125
125
|
h(null);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
@@ -129,71 +129,76 @@ const ye = /* @__PURE__ */ z({
|
|
|
129
129
|
h(
|
|
130
130
|
v(
|
|
131
131
|
n,
|
|
132
|
-
t(l) ? t(
|
|
132
|
+
t(l) ? t(m) : void 0,
|
|
133
133
|
e.formatBegins
|
|
134
134
|
)
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const a = u(o),
|
|
137
|
+
function V(o, n) {
|
|
138
|
+
const a = u(o), p = o ? v(
|
|
139
139
|
a,
|
|
140
|
-
t(l) ? t(
|
|
140
|
+
t(l) ? t(m) : void 0,
|
|
141
141
|
e.formatBegins
|
|
142
142
|
) : null;
|
|
143
|
-
e.onChange?.(
|
|
143
|
+
e.onChange?.(p, n);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function x(o) {
|
|
146
146
|
const n = u(o), a = o ? v(
|
|
147
147
|
n,
|
|
148
|
-
t(l) ? t(
|
|
148
|
+
t(l) ? t(m) : void 0,
|
|
149
149
|
e.formatBegins
|
|
150
150
|
) : null;
|
|
151
151
|
e.onOk?.(a);
|
|
152
152
|
}
|
|
153
153
|
return (o, n) => o.mode === "read" ? (i(), B(g, { key: 0 }, [
|
|
154
|
-
k(w(c.value ? t(u)(c.value).format(
|
|
154
|
+
k(w(c.value ? t(u)(c.value).format(m.value) : o.emptyText), 1)
|
|
155
155
|
], 64)) : (i(), y(t(G), {
|
|
156
156
|
key: 1,
|
|
157
157
|
compact: "",
|
|
158
|
-
style:
|
|
158
|
+
style: N({
|
|
159
159
|
display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
|
|
160
160
|
})
|
|
161
161
|
}, {
|
|
162
|
-
default:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
(i(!0), B(g, null, P(e.timezone, (a) => (i(), y(t(Y), {
|
|
174
|
-
key: a?.value,
|
|
175
|
-
value: a?.value
|
|
162
|
+
default: s(() => [
|
|
163
|
+
P(t(L), null, {
|
|
164
|
+
default: s(() => [
|
|
165
|
+
Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(Y), {
|
|
166
|
+
key: 0,
|
|
167
|
+
value: t(d),
|
|
168
|
+
"onUpdate:value": n[0] || (n[0] = (a) => j(d) ? d.value = a : null),
|
|
169
|
+
"default-active-first-option": "",
|
|
170
|
+
"dropdown-match-select-width": !1,
|
|
171
|
+
style: { "max-width": "50%" },
|
|
172
|
+
disabled: o.disabled
|
|
176
173
|
}, {
|
|
177
|
-
default:
|
|
178
|
-
|
|
174
|
+
default: s(() => [
|
|
175
|
+
(i(!0), B(g, null, b(e.timezone, (a) => (i(), y(t(Z), {
|
|
176
|
+
key: a?.value,
|
|
177
|
+
value: a?.value
|
|
178
|
+
}, {
|
|
179
|
+
default: s(() => [
|
|
180
|
+
k(w(a?.label ?? a?.value), 1)
|
|
181
|
+
]),
|
|
182
|
+
_: 2
|
|
183
|
+
}, 1032, ["value"]))), 128))
|
|
179
184
|
]),
|
|
180
|
-
_:
|
|
181
|
-
},
|
|
185
|
+
_: 1
|
|
186
|
+
}, 8, ["value", "disabled"])) : I("", !0)
|
|
182
187
|
]),
|
|
183
188
|
_: 1
|
|
184
|
-
}
|
|
185
|
-
|
|
189
|
+
}),
|
|
190
|
+
P(t(q), U(M.value, {
|
|
186
191
|
value: c.value,
|
|
187
192
|
format: A.value,
|
|
188
|
-
picker:
|
|
189
|
-
"onUpdate:value":
|
|
190
|
-
onChange:
|
|
191
|
-
onOk:
|
|
193
|
+
picker: R.value,
|
|
194
|
+
"onUpdate:value": D,
|
|
195
|
+
onChange: V,
|
|
196
|
+
onOk: x
|
|
192
197
|
}), H({ _: 2 }, [
|
|
193
|
-
|
|
194
|
-
name:
|
|
195
|
-
fn:
|
|
196
|
-
K(o.$slots,
|
|
198
|
+
b(o.$slots, (a, p) => ({
|
|
199
|
+
name: p,
|
|
200
|
+
fn: s((z) => [
|
|
201
|
+
K(o.$slots, p, W($(z || {})))
|
|
197
202
|
])
|
|
198
203
|
}))
|
|
199
204
|
]), 1040, ["value", "format", "picker"])
|
|
@@ -203,5 +208,5 @@ const ye = /* @__PURE__ */ z({
|
|
|
203
208
|
}
|
|
204
209
|
});
|
|
205
210
|
export {
|
|
206
|
-
|
|
211
|
+
he as default
|
|
207
212
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { isVNode as g, defineComponent as C, ref as S, useSlots as _, createVNode as i, mergeProps as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { isVNode as g, defineComponent as C, ref as S, useSlots as _, createVNode as i, mergeProps as R, unref as r, computed as V, createBlock as w, openBlock as T } from "vue";
|
|
2
|
+
import { Input as j } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
6
|
-
import
|
|
4
|
+
import { omit as U } from "lodash-unified";
|
|
5
|
+
import { useDefaultPlaceholder as z } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import "../../render/index.mjs";
|
|
7
|
+
import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
import M from "../../render/render.mjs";
|
|
7
9
|
function N(n) {
|
|
8
10
|
return typeof n == "function" || Object.prototype.toString.call(n) === "[object Object]" && !g(n);
|
|
9
11
|
}
|
|
10
|
-
const
|
|
12
|
+
const $ = /* @__PURE__ */ C({
|
|
11
13
|
name: "ApFieldText",
|
|
12
14
|
__name: "index",
|
|
13
15
|
props: {
|
|
@@ -95,43 +97,45 @@ const K = /* @__PURE__ */ C({
|
|
|
95
97
|
emits: ["update:value"],
|
|
96
98
|
setup(n, {
|
|
97
99
|
expose: d,
|
|
98
|
-
emit:
|
|
100
|
+
emit: f
|
|
99
101
|
}) {
|
|
100
|
-
const t = S(),
|
|
102
|
+
const t = S(), u = _(), c = (o) => {
|
|
101
103
|
t.value?.focus(o);
|
|
102
104
|
}, m = () => {
|
|
103
105
|
t.value?.blur();
|
|
104
|
-
}, y = (o,
|
|
105
|
-
t.value?.setSelectionRange(o,
|
|
106
|
-
},
|
|
106
|
+
}, y = (o, l, a) => {
|
|
107
|
+
t.value?.setSelectionRange(o, l, a);
|
|
108
|
+
}, x = () => {
|
|
107
109
|
t.value?.select();
|
|
108
|
-
},
|
|
110
|
+
}, v = f, e = n, {
|
|
109
111
|
value: p,
|
|
110
112
|
updateValue: B
|
|
111
|
-
} =
|
|
113
|
+
} = F(e, v), b = z("Text", e);
|
|
112
114
|
function h(o) {
|
|
113
|
-
const
|
|
115
|
+
const l = o.target.value || "", a = e.beforeInput ? e.beforeInput?.(l) : l, s = t.value?.$el?.querySelector("input");
|
|
114
116
|
s && (s.value = a), B(a);
|
|
115
117
|
}
|
|
116
118
|
function I() {
|
|
117
|
-
return e.mode === "edit" ? i(
|
|
119
|
+
return e.mode === "edit" ? i(j, R(U(e, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
|
|
118
120
|
placeholder: r(b),
|
|
119
121
|
value: r(p),
|
|
120
122
|
onInput: h,
|
|
121
123
|
ref: t
|
|
122
|
-
}), N(
|
|
123
|
-
default: () => [
|
|
124
|
-
}) : i("span", null, [e.prefix ||
|
|
124
|
+
}), N(u) ? u : {
|
|
125
|
+
default: () => [u]
|
|
126
|
+
}) : i("span", null, [e.prefix || u?.prefix?.(), r(p) || e.emptyText, e.suffix || u?.suffix?.()]);
|
|
125
127
|
}
|
|
126
128
|
return d({
|
|
127
|
-
focus:
|
|
129
|
+
focus: c,
|
|
128
130
|
blur: m,
|
|
129
131
|
setSelectionRange: y,
|
|
130
|
-
select:
|
|
131
|
-
input:
|
|
132
|
-
}), (o,
|
|
132
|
+
select: x,
|
|
133
|
+
input: V(() => t.value?.input)
|
|
134
|
+
}), (o, l) => (T(), w(r(M), {
|
|
135
|
+
renderer: I
|
|
136
|
+
}));
|
|
133
137
|
}
|
|
134
138
|
});
|
|
135
139
|
export {
|
|
136
|
-
|
|
140
|
+
$ as default
|
|
137
141
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { isVNode as x, defineComponent as h, useSlots as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { isVNode as x, defineComponent as h, useSlots as g, ref as C, unref as a, createVNode as e, mergeProps as w, Fragment as P, createBlock as U, openBlock as V } from "vue";
|
|
2
|
+
import { Input as _, Space as S } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { EyeOutlined as
|
|
6
|
-
import { useDefaultPlaceholder as
|
|
7
|
-
import
|
|
4
|
+
import { omit as T } from "lodash-unified";
|
|
5
|
+
import { EyeOutlined as I, EyeInvisibleOutlined as O } from "@ant-design/icons-vue";
|
|
6
|
+
import { useDefaultPlaceholder as j } from "../hooks/use-default-placeholder.mjs";
|
|
7
|
+
import "../../render/index.mjs";
|
|
8
|
+
import { useControllableValue as p } from "../../hooks/useControllableValue.mjs";
|
|
9
|
+
import k from "../../render/render.mjs";
|
|
8
10
|
function E(t) {
|
|
9
11
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
|
|
10
12
|
}
|
|
11
|
-
const
|
|
13
|
+
const J = /* @__PURE__ */ h({
|
|
12
14
|
name: "ApFieldTextPassword",
|
|
13
15
|
__name: "password",
|
|
14
16
|
props: {
|
|
@@ -110,48 +112,50 @@ const G = /* @__PURE__ */ h({
|
|
|
110
112
|
expose: c,
|
|
111
113
|
emit: f
|
|
112
114
|
}) {
|
|
113
|
-
const
|
|
115
|
+
const r = f, o = t, u = g(), i = C(), {
|
|
114
116
|
value: m,
|
|
115
117
|
updateValue: v
|
|
116
|
-
} =
|
|
118
|
+
} = p(o, r), y = j("TextPassword", o), {
|
|
117
119
|
value: b,
|
|
118
|
-
updateValue:
|
|
119
|
-
} =
|
|
120
|
+
updateValue: s
|
|
121
|
+
} = p(o, r, {
|
|
120
122
|
valuePropName: "visible"
|
|
121
123
|
});
|
|
122
124
|
function B() {
|
|
123
|
-
const n =
|
|
125
|
+
const n = a(m), l = a(b);
|
|
124
126
|
if (o.mode === "edit")
|
|
125
|
-
return e(
|
|
126
|
-
placeholder:
|
|
127
|
+
return e(_.Password, w(T(o, ["mode", "emptyText", "value", "onUpdate:value", "visible", "onUpdate:visible"]), {
|
|
128
|
+
placeholder: a(y),
|
|
127
129
|
value: n,
|
|
128
130
|
"onUpdate:value": v,
|
|
129
131
|
visible: l,
|
|
130
|
-
"onUpdate:visible":
|
|
131
|
-
ref:
|
|
132
|
-
}), E(
|
|
133
|
-
default: () => [
|
|
132
|
+
"onUpdate:visible": s,
|
|
133
|
+
ref: i
|
|
134
|
+
}), E(u) ? u : {
|
|
135
|
+
default: () => [u]
|
|
134
136
|
});
|
|
135
|
-
let
|
|
136
|
-
return n && (
|
|
137
|
+
let d = e(P, null, [o.emptyText]);
|
|
138
|
+
return n && (d = e(S, null, {
|
|
137
139
|
default: () => [e("span", null, [l ? n : "********"]), e("span", {
|
|
138
140
|
style: {
|
|
139
141
|
cursor: "pointer"
|
|
140
142
|
},
|
|
141
|
-
onClick: () =>
|
|
142
|
-
}, [l ? e(
|
|
143
|
-
})),
|
|
143
|
+
onClick: () => s(!l)
|
|
144
|
+
}, [l ? e(I, null, null) : e(O, null, null)])]
|
|
145
|
+
})), d;
|
|
144
146
|
}
|
|
145
147
|
return c({
|
|
146
148
|
focus: () => {
|
|
147
|
-
|
|
149
|
+
i.value?.focus();
|
|
148
150
|
},
|
|
149
151
|
blur: () => {
|
|
150
|
-
|
|
152
|
+
i.value?.blur();
|
|
151
153
|
}
|
|
152
|
-
}), (n, l) => (V(), U(
|
|
154
|
+
}), (n, l) => (V(), U(a(k), {
|
|
155
|
+
renderer: B
|
|
156
|
+
}));
|
|
153
157
|
}
|
|
154
158
|
});
|
|
155
159
|
export {
|
|
156
|
-
|
|
160
|
+
J as default
|
|
157
161
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as _, useSlots as j, ref as y, onMounted as E, computed as M, unref as r, cloneVNode as O, createBlock as b, openBlock as v, mergeProps as $, createSlots as q, withCtx as i, resolveDynamicComponent as K, renderList as Q, createElementVNode as U, normalizeClass as Y, createVNode as f, normalizeStyle as G, renderSlot as H, normalizeProps as J, guardReactiveProps as W } from "vue";
|
|
2
|
+
import { Form as X, Tooltip as Z, TypographyText as ee } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useToken as oe } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
|
+
import { isFunction as F, cloneDeep as te, isArray as re, omit as V } from "lodash-unified";
|
|
5
5
|
import { apFormItemColPropKeys as le } from "../constant.mjs";
|
|
6
|
-
import { QuestionCircleOutlined as
|
|
6
|
+
import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
8
|
import { useInjectForm as ae } from "../context.mjs";
|
|
9
|
-
import { isPromise as
|
|
10
|
-
import { getValidVNodeList as
|
|
11
|
-
import
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
const
|
|
9
|
+
import { isPromise as ie } from "@fruits-chain/utils";
|
|
10
|
+
import { getValidVNodeList as se } from "../../utils/slot.mjs";
|
|
11
|
+
import ue from "../style/item.mjs";
|
|
12
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
const Ce = /* @__PURE__ */ _({
|
|
14
14
|
name: "ApFormItem",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -57,100 +57,109 @@ const Be = /* @__PURE__ */ L({
|
|
|
57
57
|
customFilled: {},
|
|
58
58
|
disabled: { type: Boolean }
|
|
59
59
|
},
|
|
60
|
-
setup(
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
name:
|
|
66
|
-
initialValue:
|
|
67
|
-
transform:
|
|
60
|
+
setup(g, { expose: h }) {
|
|
61
|
+
const o = g, m = j(), { model: p, updateModel: B, internalInstance: C } = ae(), { m: u, b: k } = de("ap-form-item"), P = ue("ap-form-item"), d = y(!1), a = y(), [, x] = oe();
|
|
62
|
+
E(async () => {
|
|
63
|
+
let e = F(o.initialValue) ? o.initialValue() : o.initialValue;
|
|
64
|
+
ie(e) && (e = await e), C?.registerField({
|
|
65
|
+
name: o.name,
|
|
66
|
+
initialValue: te(e),
|
|
67
|
+
transform: o.transform
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
const
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return l ? j(l, {
|
|
77
|
-
[e.valuePropName]: t(f),
|
|
78
|
-
[`onUpdate:${e.valuePropName}`]: N,
|
|
79
|
-
variant: e.bordered ? "borderless" : l?.props?.variant,
|
|
80
|
-
bordered: e.bordered ? !1 : l?.props?.bordered,
|
|
81
|
-
onFocus: P,
|
|
82
|
-
onBlur: S
|
|
83
|
-
}) : null;
|
|
84
|
-
}
|
|
85
|
-
function N(o) {
|
|
86
|
-
h?.(e.name, o);
|
|
70
|
+
const c = M(() => o.name ? re(o.name) ? o.name.reduce((e, t) => e?.[t], r(p)) : p?.value[o.name] : null);
|
|
71
|
+
function N(e, t) {
|
|
72
|
+
const l = Object.keys(t), n = { ...t };
|
|
73
|
+
return l.forEach((s) => {
|
|
74
|
+
s in e || delete n[s];
|
|
75
|
+
}), n;
|
|
87
76
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
77
|
+
function I() {
|
|
78
|
+
const e = m.default?.() || [];
|
|
79
|
+
if (!o.name)
|
|
80
|
+
return e[0];
|
|
81
|
+
const t = se(e)[0];
|
|
82
|
+
if (!t)
|
|
83
|
+
return null;
|
|
84
|
+
const l = t?.type?.props ?? {}, n = {
|
|
85
|
+
[o.valuePropName]: r(c),
|
|
86
|
+
[`onUpdate:${o.valuePropName}`]: S,
|
|
87
|
+
variant: o.bordered ? "borderless" : t?.props?.variant,
|
|
88
|
+
bordered: o.bordered ? !1 : t?.props?.bordered,
|
|
89
|
+
onFocus: T,
|
|
90
|
+
onBlur: w
|
|
91
|
+
};
|
|
92
|
+
return O(t, N(l, n));
|
|
90
93
|
}
|
|
91
|
-
function S() {
|
|
92
|
-
|
|
94
|
+
function S(e) {
|
|
95
|
+
B?.(o.name, e);
|
|
93
96
|
}
|
|
94
97
|
function T() {
|
|
95
|
-
|
|
98
|
+
d.value = !0;
|
|
96
99
|
}
|
|
97
100
|
function w() {
|
|
98
|
-
|
|
101
|
+
d.value = !1;
|
|
99
102
|
}
|
|
100
103
|
function z() {
|
|
101
|
-
|
|
104
|
+
a.value?.onFieldBlur();
|
|
102
105
|
}
|
|
103
106
|
function R() {
|
|
104
|
-
|
|
107
|
+
a.value?.onFieldChange();
|
|
108
|
+
}
|
|
109
|
+
function A() {
|
|
110
|
+
a.value?.clearValidate();
|
|
111
|
+
}
|
|
112
|
+
function D() {
|
|
113
|
+
a.value?.resetField();
|
|
105
114
|
}
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
return
|
|
110
|
-
const
|
|
111
|
-
return
|
|
115
|
+
function L(e = !1) {
|
|
116
|
+
const t = r(c);
|
|
117
|
+
if (!e || !o.transform)
|
|
118
|
+
return t;
|
|
119
|
+
const l = F(o.transform) ? o.transform : o.transform.transformer;
|
|
120
|
+
return o.transform ? l(t) : t;
|
|
112
121
|
}
|
|
113
|
-
return
|
|
114
|
-
onFieldBlur:
|
|
115
|
-
onFieldChange:
|
|
116
|
-
clearValidate:
|
|
117
|
-
resetField:
|
|
118
|
-
getFieldValue:
|
|
119
|
-
}), (
|
|
122
|
+
return h({
|
|
123
|
+
onFieldBlur: z,
|
|
124
|
+
onFieldChange: R,
|
|
125
|
+
clearValidate: A,
|
|
126
|
+
resetField: D,
|
|
127
|
+
getFieldValue: L
|
|
128
|
+
}), (e, t) => (v(), b(r(X).Item, $(
|
|
120
129
|
{
|
|
121
130
|
ref_key: "formItemRef",
|
|
122
|
-
ref:
|
|
131
|
+
ref: a
|
|
123
132
|
},
|
|
124
|
-
|
|
133
|
+
r(V)(o, [...r(le), "tooltip", "label", "description"]),
|
|
125
134
|
{
|
|
126
135
|
class: {
|
|
127
|
-
[
|
|
128
|
-
[
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
[
|
|
136
|
+
[r(u)("bordered")]: e.bordered,
|
|
137
|
+
[r(u)("focused")]: e.bordered && d.value,
|
|
138
|
+
[r(u)("disabled")]: e.bordered && e.disabled,
|
|
139
|
+
[r(k)()]: !0,
|
|
140
|
+
[r(P)]: !0
|
|
132
141
|
},
|
|
133
|
-
colon:
|
|
142
|
+
colon: e.bordered ? !1 : o.colon
|
|
134
143
|
}
|
|
135
|
-
),
|
|
136
|
-
default:
|
|
144
|
+
), q({
|
|
145
|
+
default: i(() => [
|
|
137
146
|
(v(), b(K(I())))
|
|
138
147
|
]),
|
|
139
148
|
_: 2
|
|
140
149
|
}, [
|
|
141
|
-
|
|
150
|
+
o.tooltip ? {
|
|
142
151
|
name: "tooltip",
|
|
143
|
-
fn:
|
|
144
|
-
|
|
145
|
-
class:
|
|
152
|
+
fn: i(({ class: l }) => [
|
|
153
|
+
U("span", {
|
|
154
|
+
class: Y(l)
|
|
146
155
|
}, [
|
|
147
|
-
|
|
148
|
-
title:
|
|
156
|
+
f(r(Z), {
|
|
157
|
+
title: o.tooltip
|
|
149
158
|
}, {
|
|
150
|
-
default:
|
|
151
|
-
|
|
152
|
-
style:
|
|
153
|
-
color:
|
|
159
|
+
default: i(() => [
|
|
160
|
+
f(r(ne), {
|
|
161
|
+
style: G({
|
|
162
|
+
color: r(x).colorTextTertiary,
|
|
154
163
|
fontSize: "14px",
|
|
155
164
|
transform: "translateY(1px)"
|
|
156
165
|
})
|
|
@@ -162,26 +171,26 @@ const Be = /* @__PURE__ */ L({
|
|
|
162
171
|
]),
|
|
163
172
|
key: "0"
|
|
164
173
|
} : void 0,
|
|
165
|
-
|
|
174
|
+
e.label ? {
|
|
166
175
|
name: "label",
|
|
167
|
-
fn:
|
|
168
|
-
|
|
169
|
-
content:
|
|
170
|
-
ellipsis: { tooltip:
|
|
176
|
+
fn: i(() => [
|
|
177
|
+
f(r(ee), {
|
|
178
|
+
content: e.label,
|
|
179
|
+
ellipsis: { tooltip: e.label },
|
|
171
180
|
style: { "min-width": "0px", flex: "1" }
|
|
172
181
|
}, null, 8, ["content", "ellipsis"])
|
|
173
182
|
]),
|
|
174
183
|
key: "1"
|
|
175
184
|
} : void 0,
|
|
176
|
-
|
|
177
|
-
name:
|
|
178
|
-
fn:
|
|
179
|
-
|
|
185
|
+
Q(r(V)(m, "default"), (l, n) => ({
|
|
186
|
+
name: n,
|
|
187
|
+
fn: i((s) => [
|
|
188
|
+
H(e.$slots, n, J(W(s || {})))
|
|
180
189
|
])
|
|
181
190
|
}))
|
|
182
191
|
]), 1040, ["class", "colon"]));
|
|
183
192
|
}
|
|
184
193
|
});
|
|
185
194
|
export {
|
|
186
|
-
|
|
195
|
+
Ce as default
|
|
187
196
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
|
|
2
|
+
const t = (o) => {
|
|
3
|
+
const { componentCls: e } = o;
|
|
4
|
+
return {
|
|
5
|
+
[e]: {
|
|
6
|
+
[`${e}-body-wrapper`]: {
|
|
7
|
+
"scrollbar-width": "none",
|
|
8
|
+
"-ms-overflow-style": "none",
|
|
9
|
+
"&::-webkit-scrollbar": {
|
|
10
|
+
display: "none"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}, r = n("ApModal", (o) => [
|
|
16
|
+
t(o)
|
|
17
|
+
]);
|
|
18
|
+
export {
|
|
19
|
+
r as default
|
|
20
|
+
};
|