@aplus-frontend/ui 0.0.35 → 0.0.36
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/src/ap-field/date/index.vue.mjs +35 -33
- package/es/src/ap-field/date-range/index.vue.mjs +55 -53
- package/es/src/ap-field/hooks/use-default-placeholder.d.ts +16 -0
- package/es/src/ap-field/hooks/use-default-placeholder.mjs +25 -0
- package/es/src/ap-field/interface.d.ts +1 -0
- package/es/src/ap-field/number/index.vue.mjs +25 -23
- package/es/src/ap-field/select/index.vue.d.ts +2 -0
- package/es/src/ap-field/select/index.vue.mjs +63 -53
- package/es/src/ap-field/text/index.vue2.mjs +26 -24
- package/es/src/ap-field/text/password.vue.mjs +28 -26
- package/es/src/ap-field/text-area/index.vue.mjs +15 -13
- package/es/src/ap-table/constants.d.ts +9 -0
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-placeholder.d.ts +16 -0
- package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -0
- package/lib/src/ap-field/interface.d.ts +1 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +2 -0
- package/lib/src/ap-field/select/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-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, computed as i, unref as t, openBlock as v, createElementBlock as _, Fragment as w, createTextVNode as M, toDisplayString as R, createBlock as F, mergeProps as A, createSlots as D, renderList as x, withCtx as E, renderSlot as V, normalizeProps as z, guardReactiveProps as N } from "vue";
|
|
2
2
|
import r from "dayjs";
|
|
3
|
-
import { DatePicker as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
3
|
+
import { DatePicker as j } from "ant-design-vue";
|
|
4
|
+
import { ApFieldDatePresetFormats as I, PRESET_FORMAT_MAP as H, PRESET_FORMAT_PICK_MAP as U, PRESET_FORMAT_TIME_MAP as K } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isNil as y, omit as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { getTimeFormatToZone as
|
|
9
|
-
import {
|
|
10
|
-
|
|
6
|
+
import { isNil as y, omit as $ } from "lodash-unified";
|
|
7
|
+
import { formatDayWithTimezone as L } from "./helper.mjs";
|
|
8
|
+
import { getTimeFormatToZone as W } from "@aplus-frontend/utils";
|
|
9
|
+
import { useDefaultPlaceholder as Y } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
const le = /* @__PURE__ */ b({
|
|
11
12
|
name: "ApFieldDate",
|
|
12
13
|
__name: "index",
|
|
13
14
|
props: {
|
|
@@ -86,19 +87,19 @@ const te = /* @__PURE__ */ S({
|
|
|
86
87
|
},
|
|
87
88
|
emits: ["update:value"],
|
|
88
89
|
setup(h, { emit: B }) {
|
|
89
|
-
const e = h, k = B, { value:
|
|
90
|
-
() =>
|
|
90
|
+
const e = h, k = B, { value: p, updateValue: m } = Z(e, k), P = Y("Date", e), l = i(
|
|
91
|
+
() => I.indexOf(e.format) > -1
|
|
91
92
|
), d = i(
|
|
92
|
-
() => l.value ?
|
|
93
|
+
() => l.value ? H[e.format] : e.format
|
|
93
94
|
), f = i(() => {
|
|
94
|
-
if (y(t(
|
|
95
|
+
if (y(t(p)))
|
|
95
96
|
return;
|
|
96
|
-
let o = r(t(
|
|
97
|
-
return e.timezone && (o = r(
|
|
98
|
-
}), g = i(() => t(l) ? e.picker ??
|
|
99
|
-
const o = t(l) ?
|
|
97
|
+
let o = r(t(p));
|
|
98
|
+
return e.timezone && (o = r(W(t(p), e.timezone))), o;
|
|
99
|
+
}), g = i(() => t(l) ? e.picker ?? U[e.format] : e.picker), O = i(() => {
|
|
100
|
+
const o = t(l) ? K[e.format] : {};
|
|
100
101
|
return {
|
|
101
|
-
|
|
102
|
+
...$(e, [
|
|
102
103
|
"value",
|
|
103
104
|
"defaultValue",
|
|
104
105
|
"onChange",
|
|
@@ -107,46 +108,47 @@ const te = /* @__PURE__ */ S({
|
|
|
107
108
|
"onUpdate:value",
|
|
108
109
|
"mode"
|
|
109
110
|
]),
|
|
111
|
+
placeholder: t(P),
|
|
110
112
|
...o
|
|
111
113
|
};
|
|
112
|
-
}), c =
|
|
113
|
-
function
|
|
114
|
+
}), c = L(e.timezone);
|
|
115
|
+
function C(o) {
|
|
114
116
|
if (y(o)) {
|
|
115
|
-
|
|
117
|
+
m(null);
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
const a = r(o);
|
|
119
|
-
t(l) ?
|
|
121
|
+
t(l) ? m(c(a, t(d))) : m(a.valueOf());
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function T(o, a) {
|
|
122
124
|
var s;
|
|
123
125
|
const u = r(o), n = o ? t(l) ? c(u, t(d)) : u.valueOf() : null;
|
|
124
126
|
(s = e.onChange) == null || s.call(e, n, a);
|
|
125
127
|
}
|
|
126
|
-
function
|
|
128
|
+
function S(o) {
|
|
127
129
|
var n;
|
|
128
130
|
const a = r(o), u = o ? t(l) ? c(a, t(d)) : a.valueOf() : null;
|
|
129
131
|
(n = e.onOk) == null || n.call(e, u);
|
|
130
132
|
}
|
|
131
|
-
return (o, a) => o.mode === "read" ? (v(),
|
|
132
|
-
|
|
133
|
-
], 64)) : (v(),
|
|
133
|
+
return (o, a) => o.mode === "read" ? (v(), _(w, { key: 0 }, [
|
|
134
|
+
M(R(f.value ? t(r)(f.value).format(d.value) : o.emptyText), 1)
|
|
135
|
+
], 64)) : (v(), F(t(j), A({ key: 1 }, O.value, {
|
|
134
136
|
value: f.value,
|
|
135
137
|
format: d.value,
|
|
136
|
-
"onUpdate:value":
|
|
137
|
-
onChange:
|
|
138
|
-
onOk:
|
|
138
|
+
"onUpdate:value": C,
|
|
139
|
+
onChange: T,
|
|
140
|
+
onOk: S,
|
|
139
141
|
picker: g.value
|
|
140
|
-
}),
|
|
142
|
+
}), D({ _: 2 }, [
|
|
141
143
|
x(o.$slots, (u, n) => ({
|
|
142
144
|
name: n,
|
|
143
|
-
fn:
|
|
144
|
-
|
|
145
|
+
fn: E((s) => [
|
|
146
|
+
V(o.$slots, n, z(N(s || {})))
|
|
145
147
|
])
|
|
146
148
|
}))
|
|
147
149
|
]), 1040, ["value", "format", "picker"]));
|
|
148
150
|
}
|
|
149
151
|
});
|
|
150
152
|
export {
|
|
151
|
-
|
|
153
|
+
le as default
|
|
152
154
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as V, computed as c, unref as t, openBlock as h, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as P, renderSlot as T, createVNode as I, createBlock as j, mergeProps as U, createSlots as H, renderList as $, withCtx as K, normalizeProps as L, guardReactiveProps as W } from "vue";
|
|
2
|
+
import { ApFieldDatePresetFormats as Y, PRESET_FORMAT_MAP as Z, PRESET_FORMAT_PICK_MAP as q, PRESET_FORMAT_TIME_MAP as G } from "../date/constant.mjs";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
5
|
-
import
|
|
6
|
-
import { DatePicker as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { SwapRightOutlined as
|
|
9
|
-
import { omitUndefined as
|
|
10
|
-
import { getTimeFormatToZone as
|
|
11
|
-
import {
|
|
12
|
-
|
|
4
|
+
import { isNil as D, omit as S, isString as f } from "lodash-unified";
|
|
5
|
+
import i from "dayjs";
|
|
6
|
+
import { DatePicker as J } from "ant-design-vue";
|
|
7
|
+
import { formatDayWithTimezone as Q, formatValue as b } from "../date/helper.mjs";
|
|
8
|
+
import { SwapRightOutlined as X } from "@ant-design/icons-vue";
|
|
9
|
+
import { omitUndefined as ee } from "../../utils/index.mjs";
|
|
10
|
+
import { getTimeFormatToZone as R } from "@aplus-frontend/utils";
|
|
11
|
+
import { useDefaultPlaceholder as oe } from "../hooks/use-default-placeholder.mjs";
|
|
12
|
+
import { useControllableValue as te } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
const ve = /* @__PURE__ */ V({
|
|
13
14
|
__name: "index",
|
|
14
15
|
props: {
|
|
15
16
|
mode: { default: "edit" },
|
|
@@ -88,26 +89,26 @@ const fe = /* @__PURE__ */ x({
|
|
|
88
89
|
timezone: {}
|
|
89
90
|
},
|
|
90
91
|
emits: ["update:value"],
|
|
91
|
-
setup(
|
|
92
|
-
const o =
|
|
93
|
-
() =>
|
|
92
|
+
setup(M, { emit: w }) {
|
|
93
|
+
const o = M, _ = w, u = c(
|
|
94
|
+
() => Y.indexOf(o.format) > -1
|
|
94
95
|
), r = c(
|
|
95
|
-
() =>
|
|
96
|
-
), { value: p, updateValue:
|
|
96
|
+
() => u.value ? Z[o.format] : o.format
|
|
97
|
+
), { value: p, updateValue: g } = te(
|
|
97
98
|
o,
|
|
98
99
|
_
|
|
99
|
-
), m =
|
|
100
|
+
), A = oe("DateRange", o), m = Q(o.timezone), v = c(() => {
|
|
100
101
|
var l, d;
|
|
101
102
|
const e = t(p);
|
|
102
|
-
if (
|
|
103
|
+
if (D(e) || !(e != null && e.length))
|
|
103
104
|
return e;
|
|
104
|
-
const n = o.timezone ?
|
|
105
|
-
return [
|
|
106
|
-
}),
|
|
107
|
-
const e = t(
|
|
105
|
+
const n = o.timezone ? R(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? R(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
|
|
106
|
+
return [i(n), i(a)];
|
|
107
|
+
}), F = c(() => t(u) ? o.picker ?? q[o.format] : o.picker), z = c(() => {
|
|
108
|
+
const e = t(u) ? G[o.format] : {};
|
|
108
109
|
return {
|
|
109
|
-
...
|
|
110
|
-
|
|
110
|
+
...ee(
|
|
111
|
+
S(o, [
|
|
111
112
|
"value",
|
|
112
113
|
"onUpdate:value",
|
|
113
114
|
"onChange",
|
|
@@ -116,58 +117,59 @@ const fe = /* @__PURE__ */ x({
|
|
|
116
117
|
"mode"
|
|
117
118
|
])
|
|
118
119
|
),
|
|
120
|
+
placeholder: t(A),
|
|
119
121
|
...e
|
|
120
122
|
};
|
|
121
123
|
});
|
|
122
|
-
function
|
|
124
|
+
function E(e) {
|
|
123
125
|
if (!e) {
|
|
124
|
-
|
|
126
|
+
g(e);
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
|
-
let n = f(e[0]) ?
|
|
128
|
-
t(
|
|
129
|
+
let n = f(e[0]) ? i(e[0]) : e[0], a = f(e[1]) ? i(e[1]) : e[1];
|
|
130
|
+
t(u) ? g([
|
|
129
131
|
m(n, t(r)),
|
|
130
132
|
m(a, t(r), !1)
|
|
131
|
-
]) :
|
|
133
|
+
]) : g([b(n), b(a)]);
|
|
132
134
|
}
|
|
133
|
-
function
|
|
135
|
+
function N(e) {
|
|
134
136
|
var s;
|
|
135
|
-
const n = f(e[0]) ?
|
|
137
|
+
const n = f(e[0]) ? i(e[0]) : e[0], a = f(e[1]) ? i(e[1]) : e[1], l = e[0] ? t(u) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(u) ? m(a, t(r), !1) : a.valueOf() : null;
|
|
136
138
|
(s = o.onOk) == null || s.call(o, [l, d]);
|
|
137
139
|
}
|
|
138
|
-
function
|
|
139
|
-
var y,
|
|
140
|
-
if (
|
|
140
|
+
function x(e, n) {
|
|
141
|
+
var y, C;
|
|
142
|
+
if (D(e)) {
|
|
141
143
|
(y = o.onChange) == null || y.call(o, e, n);
|
|
142
144
|
return;
|
|
143
145
|
}
|
|
144
|
-
const a = f(e[0]) ?
|
|
145
|
-
(
|
|
146
|
+
const a = f(e[0]) ? i(e[0]) : e[0], l = f(e[1]) ? i(e[1]) : e[1], d = e[0] ? t(u) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(u) ? m(l, t(r), !1) : l.valueOf() : null;
|
|
147
|
+
(C = o.onChange) == null || C.call(o, [d, s], n);
|
|
146
148
|
}
|
|
147
149
|
return (e, n) => {
|
|
148
150
|
var a, l;
|
|
149
|
-
return e.mode === "read" ? (
|
|
150
|
-
v.value ? (
|
|
151
|
-
O(
|
|
151
|
+
return e.mode === "read" ? (h(), k(B, { key: 0 }, [
|
|
152
|
+
v.value ? (h(), k(B, { key: 0 }, [
|
|
153
|
+
O(P((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
|
|
152
154
|
T(e.$slots, "readModeSeparator", {}, () => [
|
|
153
|
-
|
|
155
|
+
I(t(X))
|
|
154
156
|
]),
|
|
155
|
-
O(" " +
|
|
156
|
-
], 64)) : (
|
|
157
|
-
O(
|
|
157
|
+
O(" " + P((l = v.value[1]) == null ? void 0 : l.format(r.value)), 1)
|
|
158
|
+
], 64)) : (h(), k(B, { key: 1 }, [
|
|
159
|
+
O(P(e.emptyText), 1)
|
|
158
160
|
], 64))
|
|
159
|
-
], 64)) : (
|
|
161
|
+
], 64)) : (h(), j(t(J).RangePicker, U({ key: 1 }, z.value, {
|
|
160
162
|
value: v.value,
|
|
161
|
-
"onUpdate:value":
|
|
162
|
-
onChange:
|
|
163
|
-
picker:
|
|
163
|
+
"onUpdate:value": E,
|
|
164
|
+
onChange: x,
|
|
165
|
+
picker: F.value,
|
|
164
166
|
format: r.value,
|
|
165
|
-
onOk:
|
|
166
|
-
}),
|
|
167
|
-
|
|
167
|
+
onOk: N
|
|
168
|
+
}), H({ _: 2 }, [
|
|
169
|
+
$(t(S)(e.$slots, "readModeSeparator"), (d, s) => ({
|
|
168
170
|
name: s,
|
|
169
|
-
fn:
|
|
170
|
-
T(e.$slots, s,
|
|
171
|
+
fn: K((y) => [
|
|
172
|
+
T(e.$slots, s, L(W(y || {})))
|
|
171
173
|
])
|
|
172
174
|
}))
|
|
173
175
|
]), 1040, ["value", "picker", "format"]));
|
|
@@ -175,5 +177,5 @@ const fe = /* @__PURE__ */ x({
|
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
export {
|
|
178
|
-
|
|
180
|
+
ve as default
|
|
179
181
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { ApFieldTextPasswordProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldSelectProps, BasicApFieldProps } from '../interface';
|
|
3
|
+
|
|
4
|
+
type FieldType = {
|
|
5
|
+
Text: ApFieldTextProps;
|
|
6
|
+
TextArea: ApFieldTextAreaProps;
|
|
7
|
+
Number: ApFieldNumberProps;
|
|
8
|
+
Date: ApFieldDateProps;
|
|
9
|
+
DateRange: ApFieldDateRangeProps;
|
|
10
|
+
Select: ApFieldSelectProps;
|
|
11
|
+
TextPassword: ApFieldTextPasswordProps;
|
|
12
|
+
};
|
|
13
|
+
export declare const useDefaultPlaceholder: <FieldName extends keyof FieldType>(fieldName: FieldName, props: BasicApFieldProps<{
|
|
14
|
+
placeholder?: FieldType[FieldName]['placeholder'];
|
|
15
|
+
}>) => ComputedRef<FieldType[FieldName]["placeholder"] | undefined>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed as r } from "vue";
|
|
2
|
+
import "../../config-provider/index.mjs";
|
|
3
|
+
import { isDef as c } from "../../utils/index.mjs";
|
|
4
|
+
import { useLocale as n } from "../../config-provider/hooks/use-locale.mjs";
|
|
5
|
+
const s = ["Select", "Date"], i = [
|
|
6
|
+
"Text",
|
|
7
|
+
"TextArea",
|
|
8
|
+
"Number",
|
|
9
|
+
"TextPassword"
|
|
10
|
+
], p = (o, t) => {
|
|
11
|
+
const { t: e } = n();
|
|
12
|
+
return r(() => {
|
|
13
|
+
if (c(t.placeholder))
|
|
14
|
+
return t.placeholder;
|
|
15
|
+
if (o === "DateRange")
|
|
16
|
+
return [e("ap.common.chooseText"), e("ap.common.chooseText")];
|
|
17
|
+
if (s.includes(o))
|
|
18
|
+
return e("ap.common.chooseText");
|
|
19
|
+
if (i.includes(o))
|
|
20
|
+
return e("ap.common.inputText");
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
p as useDefaultPlaceholder
|
|
25
|
+
};
|
|
@@ -108,6 +108,7 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
108
108
|
export type ApFieldSelectSlots = {
|
|
109
109
|
focus: () => void;
|
|
110
110
|
blur: () => void;
|
|
111
|
+
request: (clear?: boolean) => Promise<void>;
|
|
111
112
|
};
|
|
112
113
|
export type ApFieldSliderProps = BasicApFieldProps<SliderProps> & {
|
|
113
114
|
emptyText?: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InputNumber as
|
|
1
|
+
import { defineComponent as C, ref as N, computed as x, unref as o, openBlock as r, createElementBlock as n, Fragment as D, normalizeClass as d, renderSlot as s, createCommentVNode as m, createElementVNode as P, toDisplayString as V, createBlock as $, mergeProps as R, createSlots as A, renderList as I, withCtx as U, normalizeProps as z, guardReactiveProps as E } from "vue";
|
|
2
|
+
import { InputNumber as F } from "ant-design-vue";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
5
|
-
import { toDecimalMark as
|
|
6
|
-
import { addZeroToDecimalPlaces as
|
|
4
|
+
import { isNil as M, omit as T } from "lodash-unified";
|
|
5
|
+
import { toDecimalMark as _ } from "@fruits-chain/utils";
|
|
6
|
+
import { addZeroToDecimalPlaces as w } from "./helper.mjs";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
8
|
import "./style.css";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
9
|
+
import { useDefaultPlaceholder as L } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
const oe = /* @__PURE__ */ C({
|
|
12
13
|
name: "ApFieldNumber",
|
|
13
14
|
__name: "index",
|
|
14
15
|
props: {
|
|
@@ -56,15 +57,15 @@ const Y = /* @__PURE__ */ h({
|
|
|
56
57
|
},
|
|
57
58
|
emits: ["update:value"],
|
|
58
59
|
setup(f, { expose: c, emit: y }) {
|
|
59
|
-
const v = y, { b: i } =
|
|
60
|
+
const v = y, { b: i } = Z("field-number"), t = f, l = N(), { value: u, updateValue: b } = j(
|
|
60
61
|
t,
|
|
61
62
|
v
|
|
62
|
-
),
|
|
63
|
+
), B = L("Number", t), h = x(() => {
|
|
63
64
|
let e = o(u);
|
|
64
|
-
if (
|
|
65
|
+
if (M(e))
|
|
65
66
|
return t.emptyText;
|
|
66
|
-
let a = t.thousands ?
|
|
67
|
-
return t.precision && t.limitDecimalsRetain && (a =
|
|
67
|
+
let a = t.thousands ? _(e, t.precision) : String(e);
|
|
68
|
+
return t.precision && t.limitDecimalsRetain && (a = w(a, t.precision)), a;
|
|
68
69
|
});
|
|
69
70
|
function k() {
|
|
70
71
|
var e;
|
|
@@ -74,35 +75,36 @@ const Y = /* @__PURE__ */ h({
|
|
|
74
75
|
var e;
|
|
75
76
|
(e = l.value) == null || e.blur();
|
|
76
77
|
}
|
|
77
|
-
return c({ focus: k, blur: g }), (e, a) => e.mode === "read" ? (r(), n(
|
|
78
|
+
return c({ focus: k, blur: g }), (e, a) => e.mode === "read" ? (r(), n(D, { key: 0 }, [
|
|
78
79
|
e.$slots.prefix ? (r(), n("span", {
|
|
79
80
|
key: 0,
|
|
80
81
|
class: d(o(i)("label-left"))
|
|
81
82
|
}, [
|
|
82
83
|
s(e.$slots, "prefix")
|
|
83
84
|
], 2)) : m("", !0),
|
|
84
|
-
|
|
85
|
+
P("span", null, V(h.value), 1),
|
|
85
86
|
e.$slots.addonAfter ? (r(), n("span", {
|
|
86
87
|
key: 1,
|
|
87
88
|
class: d(o(i)("label-right"))
|
|
88
89
|
}, [
|
|
89
90
|
s(e.$slots, "addonAfter")
|
|
90
91
|
], 2)) : m("", !0)
|
|
91
|
-
], 64)) : (r(),
|
|
92
|
+
], 64)) : (r(), $(o(F), R({ key: 1 }, o(T)(t, ["value", "onUpdate:value"]), {
|
|
93
|
+
placeholder: o(B),
|
|
92
94
|
value: o(u),
|
|
93
|
-
"onUpdate:value": o(
|
|
95
|
+
"onUpdate:value": o(b),
|
|
94
96
|
ref_key: "inputRef",
|
|
95
97
|
ref: l
|
|
96
|
-
}),
|
|
97
|
-
|
|
98
|
+
}), A({ _: 2 }, [
|
|
99
|
+
I(e.$slots, (q, p) => ({
|
|
98
100
|
name: p,
|
|
99
|
-
fn:
|
|
100
|
-
s(e.$slots, p,
|
|
101
|
+
fn: U((S) => [
|
|
102
|
+
s(e.$slots, p, z(E(S || {})))
|
|
101
103
|
])
|
|
102
104
|
}))
|
|
103
|
-
]), 1040, ["value", "onUpdate:value"]));
|
|
105
|
+
]), 1040, ["placeholder", "value", "onUpdate:value"]));
|
|
104
106
|
}
|
|
105
107
|
});
|
|
106
108
|
export {
|
|
107
|
-
|
|
109
|
+
oe as default
|
|
108
110
|
};
|
|
@@ -15,6 +15,7 @@ type ApFieldSelectSlots = {
|
|
|
15
15
|
optionLabel: any;
|
|
16
16
|
default: any;
|
|
17
17
|
};
|
|
18
|
+
declare function requestIfNeeded(clear?: boolean): Promise<void>;
|
|
18
19
|
declare function focus(): void;
|
|
19
20
|
declare function blur(): void;
|
|
20
21
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
|
|
@@ -38,6 +39,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
38
39
|
}>, {
|
|
39
40
|
focus: typeof focus;
|
|
40
41
|
blur: typeof blur;
|
|
42
|
+
request: typeof requestIfNeeded;
|
|
41
43
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
42
44
|
"update:value": (...args: any[]) => void;
|
|
43
45
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { Select as
|
|
1
|
+
import { defineComponent as k, ref as c, onMounted as q, computed as m, unref as a, openBlock as v, createElementBlock as A, toDisplayString as M, createBlock as O, mergeProps as T, createSlots as _, renderList as R, withCtx as h, renderSlot as D, normalizeProps as U, guardReactiveProps as L, createVNode as z } from "vue";
|
|
2
|
+
import { debounce as K, isFunction as y, isArray as H, isNil as $, omit as j } from "lodash-unified";
|
|
3
|
+
import { Select as E, Spin as W } from "ant-design-vue";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { omitUndefined as
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { omitUndefined as G } from "../../utils/index.mjs";
|
|
6
|
+
import { useDefaultPlaceholder as J } from "../hooks/use-default-placeholder.mjs";
|
|
7
|
+
import { useControllableValue as Q } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
const X = { key: 0 }, ae = /* @__PURE__ */ k({
|
|
8
9
|
name: "ApFieldSelect",
|
|
9
10
|
__name: "index",
|
|
10
11
|
props: {
|
|
@@ -90,61 +91,68 @@ const G = { key: 0 }, oe = /* @__PURE__ */ P({
|
|
|
90
91
|
searchMode: { default: "filter" }
|
|
91
92
|
},
|
|
92
93
|
emits: ["update:value"],
|
|
93
|
-
setup(
|
|
94
|
+
setup(w, { expose: S, emit: g }) {
|
|
94
95
|
let i = 0;
|
|
95
|
-
const
|
|
96
|
-
if (!
|
|
96
|
+
const B = K((o) => {
|
|
97
|
+
if (!y(e.request))
|
|
97
98
|
return;
|
|
98
99
|
i += 1;
|
|
99
100
|
const t = i;
|
|
100
|
-
|
|
101
|
-
i === t && (
|
|
101
|
+
r.value = [], u.value = !0, e.request(o).then((l) => {
|
|
102
|
+
i === t && (r.value = l);
|
|
102
103
|
}).finally(() => {
|
|
103
|
-
|
|
104
|
+
u.value = !1;
|
|
104
105
|
});
|
|
105
|
-
}, 300), e =
|
|
106
|
+
}, 300), e = w, b = (o, t) => {
|
|
106
107
|
var n;
|
|
107
108
|
const l = ((n = e.fieldNames) == null ? void 0 : n.label) || "label";
|
|
108
109
|
return typeof (t == null ? void 0 : t.label) == "string" && t[l].indexOf(o) > -1;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
}, r = c((e == null ? void 0 : e.options) || []), d = c(), u = c((e == null ? void 0 : e.loading) || !1), C = g;
|
|
111
|
+
async function f(o = !0) {
|
|
112
|
+
if (!y(e.request))
|
|
113
|
+
return;
|
|
114
|
+
u.value = !0, i += 1;
|
|
115
|
+
const t = i;
|
|
116
|
+
try {
|
|
117
|
+
o && (r.value = []);
|
|
118
|
+
const l = await e.request();
|
|
119
|
+
if (t !== i)
|
|
120
|
+
return;
|
|
121
|
+
r.value = l;
|
|
122
|
+
} finally {
|
|
123
|
+
u.value = !1;
|
|
119
124
|
}
|
|
125
|
+
}
|
|
126
|
+
q(() => {
|
|
127
|
+
f();
|
|
120
128
|
});
|
|
121
|
-
const { value:
|
|
122
|
-
const o =
|
|
129
|
+
const { value: p, updateValue: x } = Q(e, C), F = J("Select", e), I = m(() => {
|
|
130
|
+
const o = a(p);
|
|
123
131
|
if (!o)
|
|
124
132
|
return e.emptyText;
|
|
125
|
-
if (
|
|
133
|
+
if (H(o))
|
|
126
134
|
return o.map(
|
|
127
135
|
(l) => {
|
|
128
136
|
var n;
|
|
129
|
-
return (n = r
|
|
137
|
+
return (n = a(r).find((s) => s.value === l)) == null ? void 0 : n.label;
|
|
130
138
|
}
|
|
131
139
|
).filter(Boolean).join("、") || e.emptyText;
|
|
132
|
-
const t = r
|
|
140
|
+
const t = a(r).find((l) => l.value === o);
|
|
133
141
|
return (t == null ? void 0 : t.label) || e.emptyText;
|
|
134
|
-
}),
|
|
142
|
+
}), P = m(() => {
|
|
135
143
|
const o = !!(e != null && e.showSearch), t = e.searchMode;
|
|
136
144
|
let l = {};
|
|
137
145
|
return o && (l = t === "request" ? {
|
|
138
146
|
showArrow: !1,
|
|
139
147
|
defaultActiveFirstOption: !1,
|
|
140
|
-
onSearch:
|
|
141
|
-
notFoundContent:
|
|
148
|
+
onSearch: B,
|
|
149
|
+
notFoundContent: u.value ? void 0 : null
|
|
142
150
|
} : {
|
|
143
151
|
showArrow: !0,
|
|
144
|
-
filterOption:
|
|
152
|
+
filterOption: $(e == null ? void 0 : e.filterOption) ? b : e == null ? void 0 : e.filterOption
|
|
145
153
|
}), {
|
|
146
|
-
...
|
|
147
|
-
|
|
154
|
+
...G(
|
|
155
|
+
j(e, [
|
|
148
156
|
"mode",
|
|
149
157
|
"value",
|
|
150
158
|
"onUpdate:value",
|
|
@@ -153,42 +161,44 @@ const G = { key: 0 }, oe = /* @__PURE__ */ P({
|
|
|
153
161
|
"searchMode"
|
|
154
162
|
])
|
|
155
163
|
),
|
|
164
|
+
placeholder: a(F),
|
|
156
165
|
...l
|
|
157
166
|
};
|
|
158
167
|
});
|
|
159
|
-
function
|
|
168
|
+
function V() {
|
|
160
169
|
var o;
|
|
161
170
|
(o = d.value) == null || o.focus();
|
|
162
171
|
}
|
|
163
|
-
function
|
|
172
|
+
function N() {
|
|
164
173
|
var o;
|
|
165
174
|
(o = d.value) == null || o.blur();
|
|
166
175
|
}
|
|
167
|
-
return
|
|
168
|
-
focus:
|
|
169
|
-
blur:
|
|
170
|
-
|
|
176
|
+
return S({
|
|
177
|
+
focus: V,
|
|
178
|
+
blur: N,
|
|
179
|
+
request: f
|
|
180
|
+
}), (o, t) => o.mode === "read" ? (v(), A("span", X, M(I.value), 1)) : (v(), O(a(E), T({
|
|
171
181
|
key: 1,
|
|
172
182
|
"allow-clear": "",
|
|
173
183
|
ref_key: "selectRef",
|
|
174
184
|
ref: d
|
|
175
|
-
},
|
|
185
|
+
}, P.value, {
|
|
176
186
|
mode: o.multiple ? "multiple" : void 0,
|
|
177
|
-
value:
|
|
178
|
-
"onUpdate:value":
|
|
179
|
-
options:
|
|
180
|
-
loading:
|
|
181
|
-
}),
|
|
182
|
-
|
|
187
|
+
value: a(p),
|
|
188
|
+
"onUpdate:value": a(x),
|
|
189
|
+
options: r.value,
|
|
190
|
+
loading: u.value
|
|
191
|
+
}), _({ _: 2 }, [
|
|
192
|
+
R(o.$slots, (l, n) => ({
|
|
183
193
|
name: n,
|
|
184
|
-
fn:
|
|
185
|
-
|
|
194
|
+
fn: h((s) => [
|
|
195
|
+
D(o.$slots, n, U(L(s || {})))
|
|
186
196
|
])
|
|
187
197
|
})),
|
|
188
|
-
|
|
198
|
+
u.value ? {
|
|
189
199
|
name: "notFoundContent",
|
|
190
|
-
fn:
|
|
191
|
-
|
|
200
|
+
fn: h(() => [
|
|
201
|
+
z(a(W), { size: "small" })
|
|
192
202
|
]),
|
|
193
203
|
key: "0"
|
|
194
204
|
} : void 0
|
|
@@ -196,5 +206,5 @@ const G = { key: 0 }, oe = /* @__PURE__ */ P({
|
|
|
196
206
|
}
|
|
197
207
|
});
|
|
198
208
|
export {
|
|
199
|
-
|
|
209
|
+
ae as default
|
|
200
210
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { isVNode as
|
|
1
|
+
import { isVNode as v, defineComponent as B, ref as g, useSlots as h, computed as b, createVNode as i, mergeProps as C, unref as u, Fragment as S, openBlock as _, createBlock as R, resolveDynamicComponent as T } from "vue";
|
|
2
2
|
import { Input as V } from "ant-design-vue";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import { omit as j } from "lodash-unified";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { useDefaultPlaceholder as F } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { useControllableValue as w } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
function z(l) {
|
|
8
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !v(l);
|
|
8
9
|
}
|
|
9
|
-
const
|
|
10
|
+
const M = /* @__PURE__ */ B({
|
|
10
11
|
name: "ApFieldText",
|
|
11
12
|
__name: "index",
|
|
12
13
|
props: {
|
|
@@ -90,46 +91,47 @@ const K = /* @__PURE__ */ v({
|
|
|
90
91
|
expose: c,
|
|
91
92
|
emit: d
|
|
92
93
|
}) {
|
|
93
|
-
const
|
|
94
|
+
const a = g(), t = h();
|
|
94
95
|
c({
|
|
95
96
|
focus: (e) => {
|
|
96
97
|
var o;
|
|
97
|
-
(o =
|
|
98
|
+
(o = a.value) == null || o.focus(e);
|
|
98
99
|
},
|
|
99
100
|
blur: () => {
|
|
100
101
|
var e;
|
|
101
|
-
(e =
|
|
102
|
+
(e = a.value) == null || e.blur();
|
|
102
103
|
},
|
|
103
|
-
setSelectionRange: (e, o,
|
|
104
|
-
var
|
|
105
|
-
(
|
|
104
|
+
setSelectionRange: (e, o, x) => {
|
|
105
|
+
var p;
|
|
106
|
+
(p = a.value) == null || p.setSelectionRange(e, o, x);
|
|
106
107
|
},
|
|
107
108
|
select: () => {
|
|
108
109
|
var e;
|
|
109
|
-
(e =
|
|
110
|
+
(e = a.value) == null || e.select();
|
|
110
111
|
},
|
|
111
112
|
input: b(() => {
|
|
112
113
|
var e;
|
|
113
|
-
return (e =
|
|
114
|
+
return (e = a.value) == null ? void 0 : e.input;
|
|
114
115
|
})
|
|
115
116
|
});
|
|
116
|
-
const f = d,
|
|
117
|
-
value:
|
|
117
|
+
const f = d, n = l, {
|
|
118
|
+
value: r,
|
|
118
119
|
updateValue: s
|
|
119
|
-
} =
|
|
120
|
-
function
|
|
120
|
+
} = w(n, f), m = F("Text", n);
|
|
121
|
+
function y() {
|
|
121
122
|
var e, o;
|
|
122
|
-
return
|
|
123
|
-
|
|
123
|
+
return n.mode === "edit" ? i(V, C(j(n, ["mode", "emptyText", "value", "onUpdate:value"]), {
|
|
124
|
+
placeholder: u(m),
|
|
125
|
+
value: u(r),
|
|
124
126
|
"onUpdate:value": s,
|
|
125
|
-
ref:
|
|
126
|
-
}),
|
|
127
|
+
ref: a
|
|
128
|
+
}), z(t) ? t : {
|
|
127
129
|
default: () => [t]
|
|
128
|
-
}) :
|
|
130
|
+
}) : i(S, null, [n.prefix || ((e = t == null ? void 0 : t.prefix) == null ? void 0 : e.call(t)), u(r) || n.emptyText, n.suffix || ((o = t == null ? void 0 : t.suffix) == null ? void 0 : o.call(t))]);
|
|
129
131
|
}
|
|
130
|
-
return (e, o) => (
|
|
132
|
+
return (e, o) => (_(), R(T(y())));
|
|
131
133
|
}
|
|
132
134
|
});
|
|
133
135
|
export {
|
|
134
|
-
|
|
136
|
+
M as default
|
|
135
137
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { isVNode as x, defineComponent as h, ref as C, useSlots as g, unref as i, createVNode as o, mergeProps as P, Fragment as w, openBlock as V, createBlock as _, resolveDynamicComponent as S } from "vue";
|
|
2
|
+
import { Input as T, Space as U } from "ant-design-vue";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import { omit as O } from "lodash-unified";
|
|
5
|
-
import { EyeOutlined as
|
|
5
|
+
import { EyeOutlined as j, EyeInvisibleOutlined as k } from "@ant-design/icons-vue";
|
|
6
|
+
import { useDefaultPlaceholder as E } from "../hooks/use-default-placeholder.mjs";
|
|
6
7
|
import { useControllableValue as d } from "../../hooks/useControllableValue.mjs";
|
|
7
|
-
function
|
|
8
|
-
return typeof
|
|
8
|
+
function F(l) {
|
|
9
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !x(l);
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
+
const G = /* @__PURE__ */ h({
|
|
11
12
|
name: "ApFieldTextPassword",
|
|
12
13
|
__name: "password",
|
|
13
14
|
props: {
|
|
@@ -100,7 +101,7 @@ const D = /* @__PURE__ */ x({
|
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
103
|
emits: ["update:value", "update:visible"],
|
|
103
|
-
setup(
|
|
104
|
+
setup(l, {
|
|
104
105
|
expose: c,
|
|
105
106
|
emit: f
|
|
106
107
|
}) {
|
|
@@ -115,40 +116,41 @@ const D = /* @__PURE__ */ x({
|
|
|
115
116
|
(e = a.value) == null || e.blur();
|
|
116
117
|
}
|
|
117
118
|
});
|
|
118
|
-
const
|
|
119
|
+
const s = f, t = l, {
|
|
119
120
|
value: m,
|
|
120
121
|
updateValue: y
|
|
121
|
-
} = d(
|
|
122
|
-
value:
|
|
123
|
-
updateValue:
|
|
124
|
-
} = d(
|
|
122
|
+
} = d(t, s), v = E("TextPassword", t), {
|
|
123
|
+
value: b,
|
|
124
|
+
updateValue: r
|
|
125
|
+
} = d(t, s, {
|
|
125
126
|
valuePropName: "visible"
|
|
126
127
|
});
|
|
127
|
-
function
|
|
128
|
-
const e =
|
|
129
|
-
if (
|
|
130
|
-
return
|
|
128
|
+
function B() {
|
|
129
|
+
const e = i(m), n = i(b);
|
|
130
|
+
if (t.mode === "edit")
|
|
131
|
+
return o(T.Password, P(O(t, ["mode", "emptyText", "value", "onUpdate:value", "visible", "onUpdate:visible"]), {
|
|
132
|
+
placeholder: i(v),
|
|
131
133
|
value: e,
|
|
132
134
|
"onUpdate:value": y,
|
|
133
135
|
visible: n,
|
|
134
|
-
"onUpdate:visible":
|
|
136
|
+
"onUpdate:visible": r,
|
|
135
137
|
ref: a
|
|
136
|
-
}),
|
|
138
|
+
}), F(u) ? u : {
|
|
137
139
|
default: () => [u]
|
|
138
140
|
});
|
|
139
|
-
let
|
|
140
|
-
return e && (
|
|
141
|
-
default: () => [
|
|
141
|
+
let p = o(w, null, [t.emptyText]);
|
|
142
|
+
return e && (p = o(U, null, {
|
|
143
|
+
default: () => [o("span", null, [n ? e : "********"]), o("span", {
|
|
142
144
|
style: {
|
|
143
145
|
cursor: "pointer"
|
|
144
146
|
},
|
|
145
|
-
onClick: () =>
|
|
146
|
-
}, [n ?
|
|
147
|
-
})),
|
|
147
|
+
onClick: () => r(!n)
|
|
148
|
+
}, [n ? o(j, null, null) : o(k, null, null)])]
|
|
149
|
+
})), p;
|
|
148
150
|
}
|
|
149
|
-
return (e, n) => (
|
|
151
|
+
return (e, n) => (V(), _(S(B())));
|
|
150
152
|
}
|
|
151
153
|
});
|
|
152
154
|
export {
|
|
153
|
-
|
|
155
|
+
G as default
|
|
154
156
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as C, omit as
|
|
1
|
+
import { defineComponent as f, ref as y, computed as B, openBlock as r, createElementBlock as x, normalizeClass as v, unref as o, toDisplayString as h, createBlock as b, mergeProps as z } from "vue";
|
|
2
|
+
import { isNil as C, omit as A } from "lodash-unified";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { Input as g } from "ant-design-vue";
|
|
6
6
|
import "./style.css";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { useDefaultPlaceholder as T } from "../hooks/use-default-placeholder.mjs";
|
|
8
|
+
import { useControllableValue as k } from "../../hooks/useControllableValue.mjs";
|
|
9
|
+
import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const S = /* @__PURE__ */ f({
|
|
10
11
|
name: "ApFieldTextArea",
|
|
11
12
|
__name: "index",
|
|
12
13
|
props: {
|
|
@@ -58,31 +59,32 @@ const I = /* @__PURE__ */ c({
|
|
|
58
59
|
},
|
|
59
60
|
emits: ["update:value"],
|
|
60
61
|
setup(u, { expose: p, emit: s }) {
|
|
61
|
-
const t =
|
|
62
|
+
const t = y(), l = u, i = s, { value: a, updateValue: d } = k(l, i), { b: m } = _("field-text-area"), c = T("TextArea", l);
|
|
62
63
|
return p({
|
|
63
64
|
focus: (e) => {
|
|
64
|
-
var
|
|
65
|
-
(
|
|
65
|
+
var n;
|
|
66
|
+
(n = t.value) == null || n.focus(e);
|
|
66
67
|
},
|
|
67
68
|
blur: () => {
|
|
68
69
|
var e;
|
|
69
70
|
(e = t.value) == null || e.blur();
|
|
70
71
|
},
|
|
71
|
-
resizableTextArea:
|
|
72
|
+
resizableTextArea: B(() => {
|
|
72
73
|
var e;
|
|
73
74
|
return (e = t.value) == null ? void 0 : e.resizableTextArea;
|
|
74
75
|
})
|
|
75
|
-
}), (e,
|
|
76
|
+
}), (e, n) => e.mode === "read" ? (r(), x("span", {
|
|
76
77
|
key: 0,
|
|
77
78
|
class: v(o(m)())
|
|
78
|
-
},
|
|
79
|
+
}, h(o(C)(o(a)) || o(a) === "" ? e.emptyText : o(a)), 3)) : (r(), b(o(g).TextArea, z({ key: 1 }, o(A)(l, ["onUpdate:value", "value"]), {
|
|
80
|
+
placeholder: o(c),
|
|
79
81
|
value: o(a),
|
|
80
82
|
"onUpdate:value": o(d),
|
|
81
83
|
ref_key: "textAreaRef",
|
|
82
84
|
ref: t
|
|
83
|
-
}), null, 16, ["value", "onUpdate:value"]));
|
|
85
|
+
}), null, 16, ["placeholder", "value", "onUpdate:value"]));
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
S as default
|
|
88
90
|
};
|
|
@@ -12144,6 +12144,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12144
12144
|
}, {
|
|
12145
12145
|
focus: () => void;
|
|
12146
12146
|
blur: () => void;
|
|
12147
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12147
12148
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
12148
12149
|
"update:value": (...args: any[]) => void;
|
|
12149
12150
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
@@ -12694,6 +12695,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12694
12695
|
}, {
|
|
12695
12696
|
focus: () => void;
|
|
12696
12697
|
blur: () => void;
|
|
12698
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12697
12699
|
}, {}, {}, {}, {
|
|
12698
12700
|
disabled: boolean;
|
|
12699
12701
|
loading: boolean;
|
|
@@ -12979,6 +12981,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12979
12981
|
}, {
|
|
12980
12982
|
focus: () => void;
|
|
12981
12983
|
blur: () => void;
|
|
12984
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12982
12985
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
12983
12986
|
"update:value": (...args: any[]) => void;
|
|
12984
12987
|
}, string, {
|
|
@@ -15204,12 +15207,18 @@ export declare const apTableRenderItemMap: {
|
|
|
15204
15207
|
$slots: Readonly<{
|
|
15205
15208
|
addonAfter: any;
|
|
15206
15209
|
addonBefore: any;
|
|
15210
|
+
/**
|
|
15211
|
+
* 表格到查询表单的映射
|
|
15212
|
+
*/
|
|
15207
15213
|
prefix: any;
|
|
15208
15214
|
suffix: any;
|
|
15209
15215
|
clearIcon: any;
|
|
15210
15216
|
}> & {
|
|
15211
15217
|
addonAfter: any;
|
|
15212
15218
|
addonBefore: any;
|
|
15219
|
+
/**
|
|
15220
|
+
* 表格到查询表单的映射
|
|
15221
|
+
*/
|
|
15213
15222
|
prefix: any;
|
|
15214
15223
|
suffix: any;
|
|
15215
15224
|
clearIcon: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),S=require("ant-design-vue"),s=require("./constant.js");require("../../hooks/index.js");const v=require("lodash-unified"),T=require("./helper.js"),_=require("@aplus-frontend/utils"),M=require("../hooks/use-default-placeholder.js"),w=require("../../hooks/useControllableValue.js"),D=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,g=h,{value:c,updateValue:f}=w.useControllableValue(o,g),B=M.useDefaultPlaceholder("Date",o),l=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),r=e.computed(()=>l.value?s.PRESET_FORMAT_MAP[o.format]:o.format),p=e.computed(()=>{if(v.isNil(e.unref(c)))return;let t=u(e.unref(c));return o.timezone&&(t=u(_.getTimeFormatToZone(e.unref(c),o.timezone))),t}),P=e.computed(()=>e.unref(l)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(l)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...v.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(B),...t}}),m=T.formatDayWithTimezone(o.timezone);function O(t){if(v.isNil(t)){f(null);return}const n=u(t);e.unref(l)?f(m(n,e.unref(r))):f(n.valueOf())}function C(t,n){var i;const d=u(t),a=t?e.unref(l)?m(d,e.unref(r)):d.valueOf():null;(i=o.onChange)==null||i.call(o,a,n)}function b(t){var a;const n=u(t),d=t?e.unref(l)?m(n,e.unref(r)):n.valueOf():null;(a=o.onOk)==null||a.call(o,d)}return(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.value?e.unref(u)(p.value).format(r.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(S.DatePicker),e.mergeProps({key:1},k.value,{value:p.value,format:r.value,"onUpdate:value":O,onChange:C,onOk:b,picker:P.value}),e.createSlots({_:2},[e.renderList(t.$slots,(d,a)=>({name:a,fn:e.withCtx(i=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../date/constant.js");require("../../hooks/index.js");const l=require("lodash-unified"),s=require("dayjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../date/constant.js");require("../../hooks/index.js");const l=require("lodash-unified"),s=require("dayjs"),_=require("ant-design-vue"),h=require("../date/helper.js"),w=require("@ant-design/icons-vue"),F=require("../../utils/index.js"),S=require("@aplus-frontend/utils"),V=require("../hooks/use-default-placeholder.js"),q=require("../../hooks/useControllableValue.js"),A=e.defineComponent({__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},presets:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},timezone:{}},emits:["update:value"],setup(B,{emit:T}){const t=B,O=T,i=e.computed(()=>y.ApFieldDatePresetFormats.indexOf(t.format)>-1),u=e.computed(()=>i.value?y.PRESET_FORMAT_MAP[t.format]:t.format),{value:p,updateValue:g}=q.useControllableValue(t,O),P=V.useDefaultPlaceholder("DateRange",t),f=h.formatDayWithTimezone(t.timezone),m=e.computed(()=>{var r,d;const o=e.unref(p);if(l.isNil(o)||!(o!=null&&o.length))return o;const a=t.timezone?S.getTimeFormatToZone(e.unref(p)[0],t.timezone):(r=e.unref(p))==null?void 0:r[0],n=t.timezone?S.getTimeFormatToZone(e.unref(p)[1],t.timezone):(d=e.unref(p))==null?void 0:d[1];return[s(a),s(n)]}),D=e.computed(()=>e.unref(i)?t.picker??y.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),C=e.computed(()=>{const o=e.unref(i)?y.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...F.omitUndefined(l.omit(t,["value","onUpdate:value","onChange","onOk","format","mode"])),placeholder:e.unref(P),...o}});function b(o){if(!o){g(o);return}let a=l.isString(o[0])?s(o[0]):o[0],n=l.isString(o[1])?s(o[1]):o[1];e.unref(i)?g([f(a,e.unref(u)),f(n,e.unref(u),!1)]):g([h.formatValue(a),h.formatValue(n)])}function M(o){var c;const a=l.isString(o[0])?s(o[0]):o[0],n=l.isString(o[1])?s(o[1]):o[1],r=o[0]?e.unref(i)?f(a,e.unref(u)):a.valueOf():null,d=o[1]?e.unref(i)?f(n,e.unref(u),!1):n.valueOf():null;(c=t.onOk)==null||c.call(t,[r,d])}function R(o,a){var v,k;if(l.isNil(o)){(v=t.onChange)==null||v.call(t,o,a);return}const n=l.isString(o[0])?s(o[0]):o[0],r=l.isString(o[1])?s(o[1]):o[1],d=o[0]?e.unref(i)?f(n,e.unref(u)):n.valueOf():null,c=o[1]?e.unref(i)?f(r,e.unref(u),!1):r.valueOf():null;(k=t.onChange)==null||k.call(t,[d,c],a)}return(o,a)=>{var n,r;return o.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((n=m.value[0])==null?void 0:n.format(u.value))+" ",1),e.renderSlot(o.$slots,"readModeSeparator",{},()=>[e.createVNode(e.unref(w.SwapRightOutlined))]),e.createTextVNode(" "+e.toDisplayString((r=m.value[1])==null?void 0:r.format(u.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(_.DatePicker).RangePicker,e.mergeProps({key:1},C.value,{value:m.value,"onUpdate:value":b,onChange:R,picker:D.value,format:u.value,onOk:M}),e.createSlots({_:2},[e.renderList(e.unref(l.omit)(o.$slots,"readModeSeparator"),(d,c)=>({name:c,fn:e.withCtx(v=>[e.renderSlot(o.$slots,c,e.normalizeProps(e.guardReactiveProps(v||{})))])}))]),1040,["value","picker","format"]))}}});exports.default=A;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { ApFieldTextPasswordProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldSelectProps, BasicApFieldProps } from '../interface';
|
|
3
|
+
|
|
4
|
+
type FieldType = {
|
|
5
|
+
Text: ApFieldTextProps;
|
|
6
|
+
TextArea: ApFieldTextAreaProps;
|
|
7
|
+
Number: ApFieldNumberProps;
|
|
8
|
+
Date: ApFieldDateProps;
|
|
9
|
+
DateRange: ApFieldDateRangeProps;
|
|
10
|
+
Select: ApFieldSelectProps;
|
|
11
|
+
TextPassword: ApFieldTextPasswordProps;
|
|
12
|
+
};
|
|
13
|
+
export declare const useDefaultPlaceholder: <FieldName extends keyof FieldType>(fieldName: FieldName, props: BasicApFieldProps<{
|
|
14
|
+
placeholder?: FieldType[FieldName]['placeholder'];
|
|
15
|
+
}>) => ComputedRef<FieldType[FieldName]["placeholder"] | undefined>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../../config-provider/index.js");const c=require("../../utils/index.js"),n=require("../../config-provider/hooks/use-locale.js"),u=["Select","Date"],s=["Text","TextArea","Number","TextPassword"],i=(t,o)=>{const{t:e}=n.useLocale();return r.computed(()=>{if(c.isDef(o.placeholder))return o.placeholder;if(t==="DateRange")return[e("ap.common.chooseText"),e("ap.common.chooseText")];if(u.includes(t))return e("ap.common.chooseText");if(s.includes(t))return e("ap.common.inputText")})};exports.useDefaultPlaceholder=i;
|
|
@@ -108,6 +108,7 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
108
108
|
export type ApFieldSelectSlots = {
|
|
109
109
|
focus: () => void;
|
|
110
110
|
blur: () => void;
|
|
111
|
+
request: (clear?: boolean) => Promise<void>;
|
|
111
112
|
};
|
|
112
113
|
export type ApFieldSliderProps = BasicApFieldProps<SliderProps> & {
|
|
113
114
|
emptyText?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("ant-design-vue");require("../../hooks/index.js");const s=require("lodash-unified"),h=require("@fruits-chain/utils"),g=require("./helper.js");require("../../config-provider/index.js");require("./style.css");const S=require("../hooks/use-default-placeholder.js"),q=require("../../config-provider/hooks/use-namespace.js"),C=require("../../hooks/useControllableValue.js"),N=e.defineComponent({name:"ApFieldNumber",__name:"index",props:{mode:{},class:{},style:{},size:{},bordered:{type:Boolean,default:!0},placeholder:{},name:{},id:{},type:{},addonBefore:{},addonAfter:{},prefix:{},"onUpdate:value":{},valueModifiers:{},status:{},stringMode:{type:Boolean},defaultValue:{},value:{},prefixCls:{},min:{default:-1/0},max:{default:1/0},step:{default:1},tabindex:{},controls:{type:Boolean,default:!0},readonly:{type:Boolean},disabled:{type:Boolean},autofocus:{type:Boolean},keyboard:{type:Boolean,default:!0},parser:{},formatter:{},precision:{},decimalSeparator:{},onInput:{},onChange:{},onPressEnter:{},onStep:{},onBlur:{},onFocus:{},emptyText:{default:"--"},thousands:{type:Boolean,default:!1},limitDecimalsRetain:{type:Boolean}},emits:["update:value"],setup(i,{expose:d,emit:p}){const c=p,{b:a}=q.useNamespace("field-number"),o=i,l=e.ref(),{value:n,updateValue:f}=C.useControllableValue(o,c),m=S.useDefaultPlaceholder("Number",o),y=e.computed(()=>{let t=e.unref(n);if(s.isNil(t))return o.emptyText;let r=o.thousands?h.toDecimalMark(t,o.precision):String(t);return o.precision&&o.limitDecimalsRetain&&(r=g.addZeroToDecimalPlaces(r,o.precision)),r});function v(){var t;(t=l.value)==null||t.focus()}function B(){var t;(t=l.value)==null||t.blur()}return d({focus:v,blur:B}),(t,r)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a)("label-left"))},[e.renderSlot(t.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(y.value),1),t.$slots.addonAfter?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a)("label-right"))},[e.renderSlot(t.$slots,"addonAfter")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.unref(k.InputNumber),e.mergeProps({key:1},e.unref(s.omit)(o,["value","onUpdate:value"]),{placeholder:e.unref(m),value:e.unref(n),"onUpdate:value":e.unref(f),ref_key:"inputRef",ref:l}),e.createSlots({_:2},[e.renderList(t.$slots,(V,u)=>({name:u,fn:e.withCtx(b=>[e.renderSlot(t.$slots,u,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1040,["placeholder","value","onUpdate:value"]))}});exports.default=N;
|
|
@@ -15,6 +15,7 @@ type ApFieldSelectSlots = {
|
|
|
15
15
|
optionLabel: any;
|
|
16
16
|
default: any;
|
|
17
17
|
};
|
|
18
|
+
declare function requestIfNeeded(clear?: boolean): Promise<void>;
|
|
18
19
|
declare function focus(): void;
|
|
19
20
|
declare function blur(): void;
|
|
20
21
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
|
|
@@ -38,6 +39,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
38
39
|
}>, {
|
|
39
40
|
focus: typeof focus;
|
|
40
41
|
blur: typeof blur;
|
|
42
|
+
request: typeof requestIfNeeded;
|
|
41
43
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
42
44
|
"update:value": (...args: any[]) => void;
|
|
43
45
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-unified"),v=require("ant-design-vue");require("../../hooks/index.js");const I=require("../../utils/index.js"),P=require("../hooks/use-default-placeholder.js"),V=require("../../hooks/useControllableValue.js"),M={key:0},k=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},options:{},showAction:{},placeholder:{},onDeselect:{},loading:{type:Boolean,default:void 0},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showSearch:{type:Boolean,default:void 0},searchValue:{},onInputKeyDown:{},removeIcon:{},maxTagCount:{},maxTagTextLength:{},maxTagPlaceholder:{},tokenSeparators:{},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},showArrow:{type:Boolean,default:void 0},onPopupScroll:{},menuItemSelectedIcon:{},listItemHeight:{},inputValue:{},autoClearSearchValue:{type:Boolean,default:void 0},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},defaultActiveFirstOption:{type:Boolean,default:void 0},labelInValue:{type:Boolean,default:void 0},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"}},emits:["update:value"],setup(m,{expose:h,emit:y}){let i=0;const g=d.debounce(o=>{if(!d.isFunction(t.request))return;i+=1;const n=i;r.value=[],u.value=!0,t.request(o).then(l=>{i===n&&(r.value=l)}).finally(()=>{u.value=!1})},300),t=m,w=(o,n)=>{var a;const l=((a=t.fieldNames)==null?void 0:a.label)||"label";return typeof(n==null?void 0:n.label)=="string"&&n[l].indexOf(o)>-1},r=e.ref((t==null?void 0:t.options)||[]),s=e.ref(),u=e.ref((t==null?void 0:t.loading)||!1),S=y;async function f(o=!0){if(!d.isFunction(t.request))return;u.value=!0,i+=1;const n=i;try{o&&(r.value=[]);const l=await t.request();if(n!==i)return;r.value=l}finally{u.value=!1}}e.onMounted(()=>{f()});const{value:p,updateValue:b}=V.useControllableValue(t,S),B=P.useDefaultPlaceholder("Select",t),C=e.computed(()=>{const o=e.unref(p);if(!o)return t.emptyText;if(d.isArray(o))return o.map(l=>{var a;return(a=e.unref(r).find(c=>c.value===l))==null?void 0:a.label}).filter(Boolean).join("、")||t.emptyText;const n=e.unref(r).find(l=>l.value===o);return(n==null?void 0:n.label)||t.emptyText}),q=e.computed(()=>{const o=!!(t!=null&&t.showSearch),n=t.searchMode;let l={};return o&&(l=n==="request"?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:g,notFoundContent:u.value?void 0:null}:{showArrow:!0,filterOption:d.isNil(t==null?void 0:t.filterOption)?w:t==null?void 0:t.filterOption}),{...I.omitUndefined(d.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode"])),placeholder:e.unref(B),...l}});function x(){var o;(o=s.value)==null||o.focus()}function F(){var o;(o=s.value)==null||o.blur()}return h({focus:x,blur:F,request:f}),(o,n)=>o.mode==="read"?(e.openBlock(),e.createElementBlock("span",M,e.toDisplayString(C.value),1)):(e.openBlock(),e.createBlock(e.unref(v.Select),e.mergeProps({key:1,"allow-clear":"",ref_key:"selectRef",ref:s},q.value,{mode:o.multiple?"multiple":void 0,value:e.unref(p),"onUpdate:value":e.unref(b),options:r.value,loading:u.value}),e.createSlots({_:2},[e.renderList(o.$slots,(l,a)=>({name:a,fn:e.withCtx(c=>[e.renderSlot(o.$slots,a,e.normalizeProps(e.guardReactiveProps(c||{})))])})),u.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(v.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","onUpdate:value","options","loading"]))}});exports.default=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),v=require("ant-design-vue");require("../../hooks/index.js");const x=require("lodash-unified"),g=require("../hooks/use-default-placeholder.js"),B=require("../../hooks/useControllableValue.js");function b(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!t.isVNode(a)}const h=t.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onFocus:{},onBlur:{},onChange:{},onInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(a,{expose:i,emit:d}){const l=t.ref(),o=t.useSlots();i({focus:e=>{var n;(n=l.value)==null||n.focus(e)},blur:()=>{var e;(e=l.value)==null||e.blur()},setSelectionRange:(e,n,y)=>{var c;(c=l.value)==null||c.setSelectionRange(e,n,y)},select:()=>{var e;(e=l.value)==null||e.select()},input:t.computed(()=>{var e;return(e=l.value)==null?void 0:e.input})});const s=d,u=a,{value:r,updateValue:p}=B.useControllableValue(u,s),f=g.useDefaultPlaceholder("Text",u);function m(){var e,n;return u.mode==="edit"?t.createVNode(v.Input,t.mergeProps(x.omit(u,["mode","emptyText","value","onUpdate:value"]),{placeholder:t.unref(f),value:t.unref(r),"onUpdate:value":p,ref:l}),b(o)?o:{default:()=>[o]}):t.createVNode(t.Fragment,null,[u.prefix||((e=o==null?void 0:o.prefix)==null?void 0:e.call(o)),t.unref(r)||u.emptyText,u.suffix||((n=o==null?void 0:o.suffix)==null?void 0:n.call(o))])}return(e,n)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(m())))}});exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("ant-design-vue");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("ant-design-vue");require("../../hooks/index.js");const g=require("lodash-unified"),c=require("@ant-design/icons-vue"),h=require("../hooks/use-default-placeholder.js"),p=require("../../hooks/useControllableValue.js");function x(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!e.isVNode(l)}const C=e.defineComponent({name:"ApFieldTextPassword",__name:"password",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onFocus:{},onBlur:{},onChange:{},onInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},inputPrefixCls:{},action:{default:"click"},visibilityToggle:{type:Boolean,default:!0},visible:{type:Boolean,default:void 0},"onUpdate:visible":{},emptyText:{default:"--"}},emits:["update:value","update:visible"],setup(l,{expose:f,emit:v}){const a=e.ref(),u=e.useSlots();f({focus:()=>{var t;(t=a.value)==null||t.focus()},blur:()=>{var t;(t=a.value)==null||t.blur()}});const r=v,o=l,{value:y,updateValue:m}=p.useControllableValue(o,r),b=h.useDefaultPlaceholder("TextPassword",o),{value:B,updateValue:s}=p.useControllableValue(o,r,{valuePropName:"visible"});function V(){const t=e.unref(y),n=e.unref(B);if(o.mode==="edit")return e.createVNode(d.Input.Password,e.mergeProps(g.omit(o,["mode","emptyText","value","onUpdate:value","visible","onUpdate:visible"]),{placeholder:e.unref(b),value:t,"onUpdate:value":m,visible:n,"onUpdate:visible":s,ref:a}),x(u)?u:{default:()=>[u]});let i=e.createVNode(e.Fragment,null,[o.emptyText]);return t&&(i=e.createVNode(d.Space,null,{default:()=>[e.createVNode("span",null,[n?t:"********"]),e.createVNode("span",{style:{cursor:"pointer"},onClick:()=>s(!n)},[n?e.createVNode(c.EyeOutlined,null,null):e.createVNode(c.EyeInvisibleOutlined,null,null)])]})),i}return(t,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V())))}});exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("lodash-unified");require("../../hooks/index.js");require("../../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("lodash-unified");require("../../hooks/index.js");require("../../config-provider/index.js");const m=require("ant-design-vue");require("./style.css");const y=require("../hooks/use-default-placeholder.js"),v=require("../../hooks/useControllableValue.js"),B=require("../../config-provider/hooks/use-namespace.js"),b=e.defineComponent({name:"ApFieldTextArea",__name:"index",props:{mode:{default:"edit"},class:{},style:{},rows:{},autosize:{type:[Boolean,Object]},autoSize:{type:[Boolean,Object]},onResize:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},size:{},value:{},name:{},type:{default:"text"},onFocus:{},onBlur:{},onChange:{},onInput:{},onKeydown:{},onKeyup:{},focused:{type:Boolean},hidden:{type:Boolean},disabled:{type:Boolean},prefixCls:{},id:{},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},status:{},defaultValue:{},"onUpdate:value":{},placeholder:{},loading:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},inputElement:{},triggerFocus:{},handleReset:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(r,{expose:s,emit:i}){const t=e.ref(),l=r,p=i,{value:a,updateValue:d}=v.useControllableValue(l,p),{b:c}=B.useNamespace("field-text-area"),f=y.useDefaultPlaceholder("TextArea",l);return s({focus:o=>{var n;(n=t.value)==null||n.focus(o)},blur:()=>{var o;(o=t.value)==null||o.blur()},resizableTextArea:e.computed(()=>{var o;return(o=t.value)==null?void 0:o.resizableTextArea})}),(o,n)=>o.mode==="read"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(c)())},e.toDisplayString(e.unref(u.isNil)(e.unref(a))||e.unref(a)===""?o.emptyText:e.unref(a)),3)):(e.openBlock(),e.createBlock(e.unref(m.Input).TextArea,e.mergeProps({key:1},e.unref(u.omit)(l,["onUpdate:value","value"]),{placeholder:e.unref(f),value:e.unref(a),"onUpdate:value":e.unref(d),ref_key:"textAreaRef",ref:t}),null,16,["placeholder","value","onUpdate:value"]))}});exports.default=b;
|
|
@@ -12144,6 +12144,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12144
12144
|
}, {
|
|
12145
12145
|
focus: () => void;
|
|
12146
12146
|
blur: () => void;
|
|
12147
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12147
12148
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
12148
12149
|
"update:value": (...args: any[]) => void;
|
|
12149
12150
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
@@ -12694,6 +12695,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12694
12695
|
}, {
|
|
12695
12696
|
focus: () => void;
|
|
12696
12697
|
blur: () => void;
|
|
12698
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12697
12699
|
}, {}, {}, {}, {
|
|
12698
12700
|
disabled: boolean;
|
|
12699
12701
|
loading: boolean;
|
|
@@ -12979,6 +12981,7 @@ export declare const apTableRenderItemMap: {
|
|
|
12979
12981
|
}, {
|
|
12980
12982
|
focus: () => void;
|
|
12981
12983
|
blur: () => void;
|
|
12984
|
+
request: (clear?: boolean) => Promise<void>;
|
|
12982
12985
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
12983
12986
|
"update:value": (...args: any[]) => void;
|
|
12984
12987
|
}, string, {
|
|
@@ -15204,12 +15207,18 @@ export declare const apTableRenderItemMap: {
|
|
|
15204
15207
|
$slots: Readonly<{
|
|
15205
15208
|
addonAfter: any;
|
|
15206
15209
|
addonBefore: any;
|
|
15210
|
+
/**
|
|
15211
|
+
* 表格到查询表单的映射
|
|
15212
|
+
*/
|
|
15207
15213
|
prefix: any;
|
|
15208
15214
|
suffix: any;
|
|
15209
15215
|
clearIcon: any;
|
|
15210
15216
|
}> & {
|
|
15211
15217
|
addonAfter: any;
|
|
15212
15218
|
addonBefore: any;
|
|
15219
|
+
/**
|
|
15220
|
+
* 表格到查询表单的映射
|
|
15221
|
+
*/
|
|
15213
15222
|
prefix: any;
|
|
15214
15223
|
suffix: any;
|
|
15215
15224
|
clearIcon: any;
|