@aplus-frontend/ui 0.0.35 → 0.0.37
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 +16 -14
- package/es/src/ap-descriptions/ap-descriptions.vue.d.ts +27 -0
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +97 -0
- package/es/src/ap-descriptions/ap-descriptions.vue2.mjs +5 -0
- package/es/src/ap-descriptions/formatter/index.d.ts +78 -0
- package/es/src/ap-descriptions/formatter/index.mjs +127 -0
- package/es/src/ap-descriptions/formatter/utils.d.ts +7 -0
- package/es/src/ap-descriptions/formatter/utils.mjs +6 -0
- package/es/src/ap-descriptions/help-message/index.vue.d.ts +23 -0
- package/es/src/ap-descriptions/help-message/index.vue.mjs +4 -0
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +27 -0
- package/es/src/ap-descriptions/helper.d.ts +10 -0
- package/es/src/ap-descriptions/helper.mjs +24 -0
- package/es/src/ap-descriptions/index.d.ts +4 -0
- package/es/src/ap-descriptions/index.mjs +2 -0
- package/es/src/ap-descriptions/interface.d.ts +50 -0
- package/es/src/ap-descriptions/interface.mjs +1 -0
- package/es/src/ap-descriptions/style/ap-descriptions.css +57 -0
- package/es/src/ap-download/ap-download.vue.mjs +27 -21
- 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 +4 -3
- 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/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +6 -2
- package/es/src/config-provider/config-provider.d.ts +14 -1
- package/es/src/config-provider/config-provider.mjs +17 -16
- package/es/src/config-provider/constants.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +241 -238
- package/es/src/theme/ap-descriptions/ap-descriptions.css +57 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/ap-descriptions.vue.d.ts +27 -0
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -0
- package/lib/src/ap-descriptions/ap-descriptions.vue2.js +1 -0
- package/lib/src/ap-descriptions/formatter/index.d.ts +78 -0
- package/lib/src/ap-descriptions/formatter/index.js +1 -0
- package/lib/src/ap-descriptions/formatter/utils.d.ts +7 -0
- package/lib/src/ap-descriptions/formatter/utils.js +1 -0
- package/lib/src/ap-descriptions/help-message/index.vue.d.ts +23 -0
- package/lib/src/ap-descriptions/help-message/index.vue.js +1 -0
- package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -0
- package/lib/src/ap-descriptions/helper.d.ts +10 -0
- package/lib/src/ap-descriptions/helper.js +1 -0
- package/lib/src/ap-descriptions/index.d.ts +4 -0
- package/lib/src/ap-descriptions/index.js +1 -0
- package/lib/src/ap-descriptions/interface.d.ts +50 -0
- package/lib/src/ap-descriptions/interface.js +1 -0
- package/lib/src/ap-descriptions/style/ap-descriptions.css +57 -0
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- 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 +4 -3
- 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/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +14 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-descriptions/ap-descriptions.css +57 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
TODO:
|
|
3
|
+
1.admin和aplus样式提成变量?
|
|
4
|
+
*/
|
|
5
|
+
.aplus-ap-descriptions {
|
|
6
|
+
--ap-descriptions-item-padding-bottom: 24px;
|
|
7
|
+
--ap-descriptions-item-label-width: auto;
|
|
8
|
+
}
|
|
9
|
+
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-view table {
|
|
10
|
+
table-layout: fixed;
|
|
11
|
+
}
|
|
12
|
+
.aplus-ap-descriptions .ant-descriptions td.ant-descriptions-item {
|
|
13
|
+
padding-bottom: var(--ap-descriptions-item-padding-bottom);
|
|
14
|
+
}
|
|
15
|
+
.aplus-ap-descriptions .ant-descriptions th.ant-descriptions-item {
|
|
16
|
+
padding-bottom: 8px;
|
|
17
|
+
}
|
|
18
|
+
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-row:last-child .ant-descriptions-item {
|
|
19
|
+
padding-bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-item-label::after {
|
|
22
|
+
margin-inline: 4px 20px;
|
|
23
|
+
}
|
|
24
|
+
.aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-label {
|
|
25
|
+
justify-content: flex-end;
|
|
26
|
+
width: var(--ap-descriptions-item-label-width);
|
|
27
|
+
color: #999999;
|
|
28
|
+
}
|
|
29
|
+
.aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-label .ap-descriptions-item-content__help {
|
|
30
|
+
margin-left: 4px;
|
|
31
|
+
color: #34b77c;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
}
|
|
34
|
+
.aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-content {
|
|
35
|
+
color: #333333;
|
|
36
|
+
}
|
|
37
|
+
.aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-content .ap-descriptions-item-content__link {
|
|
38
|
+
color: #1890ff;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
.aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-label {
|
|
42
|
+
justify-content: flex-end;
|
|
43
|
+
width: var(--ap-descriptions-item-label-width);
|
|
44
|
+
color: #8896B0;
|
|
45
|
+
}
|
|
46
|
+
.aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-label .ap-descriptions-item-content__help {
|
|
47
|
+
margin-left: 4px;
|
|
48
|
+
color: #0070FF;
|
|
49
|
+
font-size: 16px;
|
|
50
|
+
}
|
|
51
|
+
.aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-content {
|
|
52
|
+
color: #182948;
|
|
53
|
+
}
|
|
54
|
+
.aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-content .ap-descriptions-item-content__link {
|
|
55
|
+
color: #0070FF;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, computed as a, watch as _, openBlock as z, createElementBlock as I, normalizeStyle as O, normalizeClass as i, createElementVNode as n, renderSlot as v, toDisplayString as B } from "vue";
|
|
2
2
|
import "../config-provider/index.mjs";
|
|
3
|
-
import { useOssInit as
|
|
3
|
+
import { useOssInit as N, useOss as k } from "./hooks/index.mjs";
|
|
4
4
|
import "./style/ap-download.css";
|
|
5
|
-
import { useGlobalConfig as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
const
|
|
5
|
+
import { useGlobalConfig as A } from "../config-provider/hooks/use-global-config.mjs";
|
|
6
|
+
import { useNamespace as F } from "../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const M = { class: "icon" }, W = { class: "text" }, j = /* @__PURE__ */ y({
|
|
8
8
|
name: "ApDownload",
|
|
9
9
|
__name: "ap-download",
|
|
10
10
|
props: {
|
|
@@ -16,41 +16,47 @@ const F = { class: "icon" }, W = { class: "text" }, q = /* @__PURE__ */ _({
|
|
|
16
16
|
getOssAccess: {}
|
|
17
17
|
},
|
|
18
18
|
setup(l) {
|
|
19
|
-
const t = l, p =
|
|
20
|
-
function c(e,
|
|
19
|
+
const t = l, p = A("uiMode"), { b: r, bm: s } = F("download");
|
|
20
|
+
function c(e, o) {
|
|
21
21
|
e.length === 4 && (e = `#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);
|
|
22
|
-
const w = parseInt(e.slice(1, 3), 16), S = parseInt(e.slice(3, 5), 16),
|
|
23
|
-
return `#${w.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${
|
|
22
|
+
const w = parseInt(e.slice(1, 3), 16), S = parseInt(e.slice(3, 5), 16), b = parseInt(e.slice(5, 7), 16), $ = Math.round(o * 255).toString(16).padStart(2, "0");
|
|
23
|
+
return `#${w.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}${$}`;
|
|
24
24
|
}
|
|
25
|
-
const d =
|
|
25
|
+
const d = a(() => ({
|
|
26
26
|
"--download-main-color": t.color,
|
|
27
27
|
"--download-main-color-opacity": c(t.color, 0.6)
|
|
28
|
-
})), u =
|
|
29
|
-
const e = [
|
|
28
|
+
})), u = a(() => [r("wrapper"), s("wrapper", t.size)].filter(Boolean)), m = a(() => {
|
|
29
|
+
const e = [r("inner-wrapper"), s("inner-wrapper", t.size)];
|
|
30
30
|
return t.disabled && (p.value === "aplus" ? e.push(s("inner-wrapper", "disabled")) : e.push(s("inner-wrapper", "disabled-admin"))), e;
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
_(
|
|
33
|
+
() => t.disabled,
|
|
34
|
+
() => {
|
|
35
|
+
t.disabled || N(t.getOssAccess);
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
flush: "sync"
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
const { client: f } = k(), g = () => {
|
|
36
42
|
t.disabled || f.downloadFile(t.fileName);
|
|
37
43
|
};
|
|
38
|
-
return (e,
|
|
44
|
+
return (e, o) => (z(), I("span", {
|
|
39
45
|
style: O(d.value),
|
|
40
46
|
class: i(u.value),
|
|
41
47
|
onClick: g
|
|
42
48
|
}, [
|
|
43
|
-
|
|
49
|
+
n("span", {
|
|
44
50
|
class: i(m.value)
|
|
45
51
|
}, [
|
|
46
|
-
|
|
52
|
+
n("span", M, [
|
|
47
53
|
v(e.$slots, "icon")
|
|
48
54
|
]),
|
|
49
|
-
|
|
55
|
+
n("span", W, B(e.text), 1)
|
|
50
56
|
], 2)
|
|
51
57
|
], 6));
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
export {
|
|
55
|
-
|
|
61
|
+
j as default
|
|
56
62
|
};
|
|
@@ -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
|
+
};
|
|
@@ -105,15 +105,16 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
105
105
|
*/
|
|
106
106
|
searchMode?: 'filter' | 'request';
|
|
107
107
|
};
|
|
108
|
-
export type
|
|
108
|
+
export type ApFieldSelectExpose = {
|
|
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;
|
|
114
115
|
defaultValue?: number | [number, number];
|
|
115
116
|
};
|
|
116
|
-
export type
|
|
117
|
+
export type ApFieldSliderExpose = {
|
|
117
118
|
focus: () => void;
|
|
118
119
|
blur: () => void;
|
|
119
120
|
};
|
|
@@ -125,7 +126,7 @@ export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
|
|
|
125
126
|
export type ApFieldRateProps = BasicApFieldProps<RateProps> & {
|
|
126
127
|
defaultValue?: number;
|
|
127
128
|
};
|
|
128
|
-
export type
|
|
129
|
+
export type ApFieldRateExpose = {
|
|
129
130
|
focus: () => void;
|
|
130
131
|
blur: () => void;
|
|
131
132
|
};
|
|
@@ -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>, {
|