@aplus-frontend/ui 0.0.23 → 0.0.24
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 +26 -26
- package/es/src/ap-field/number/helper.d.ts +9 -0
- package/es/src/ap-field/number/helper.mjs +20 -11
- package/es/src/ap-table/ap-table.vue.d.ts +2137 -112
- package/es/src/ap-table/ap-table.vue.mjs +31 -30
- package/es/src/check-card/style/index.css +1 -0
- package/es/src/editable-table/form-item.vue.mjs +61 -63
- package/es/src/editable-table/hooks/use-get-columns.mjs +27 -27
- package/es/src/editable-table/index.vue.mjs +63 -65
- package/es/src/editable-table/utils.d.ts +13 -0
- package/es/src/editable-table/utils.mjs +26 -6
- package/es/src/theme/check-card/index.css +1 -0
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/number/helper.d.ts +9 -0
- package/lib/src/ap-field/number/helper.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2137 -112
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/check-card/style/index.css +1 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/utils.d.ts +13 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/theme/check-card/index.css +1 -0
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as i, unref as t, openBlock as v, createElementBlock as b, Fragment as _, createTextVNode as w, toDisplayString as M, createBlock as R, mergeProps as F, createSlots as A, renderList as x, withCtx as D, renderSlot as E, normalizeProps as V, guardReactiveProps as z } from "vue";
|
|
2
2
|
import r from "dayjs";
|
|
3
3
|
import { DatePicker as N } from "ant-design-vue";
|
|
4
4
|
import { ApFieldDatePresetFormats as j, PRESET_FORMAT_MAP as I, PRESET_FORMAT_PICK_MAP as H, PRESET_FORMAT_TIME_MAP as U } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isNil as
|
|
6
|
+
import { isNil as y, omit as K } from "lodash-unified";
|
|
7
7
|
import { formatDayWithTimezone as $ } from "./helper.mjs";
|
|
8
8
|
import { getTimeFormatToZone as L } from "@aplus-frontend/utils";
|
|
9
9
|
import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
|
|
@@ -85,17 +85,17 @@ const te = /* @__PURE__ */ S({
|
|
|
85
85
|
timezone: {}
|
|
86
86
|
},
|
|
87
87
|
emits: ["update:value"],
|
|
88
|
-
setup(
|
|
89
|
-
const e =
|
|
88
|
+
setup(h, { emit: B }) {
|
|
89
|
+
const e = h, k = B, { value: m, updateValue: p } = W(e, k), l = i(
|
|
90
90
|
() => j.indexOf(e.format) > -1
|
|
91
|
-
),
|
|
91
|
+
), d = i(
|
|
92
92
|
() => l.value ? I[e.format] : e.format
|
|
93
|
-
),
|
|
94
|
-
if (
|
|
93
|
+
), f = i(() => {
|
|
94
|
+
if (y(t(m)))
|
|
95
95
|
return;
|
|
96
|
-
let o = r(t(
|
|
97
|
-
return e.timezone && (o = r(L(t(
|
|
98
|
-
}), g =
|
|
96
|
+
let o = r(t(m));
|
|
97
|
+
return e.timezone && (o = r(L(t(m), e.timezone))), o;
|
|
98
|
+
}), g = i(() => t(l) ? e.picker ?? H[e.format] : e.picker), O = i(() => {
|
|
99
99
|
const o = t(l) ? U[e.format] : {};
|
|
100
100
|
return {
|
|
101
101
|
...K(e, [
|
|
@@ -109,39 +109,39 @@ const te = /* @__PURE__ */ S({
|
|
|
109
109
|
]),
|
|
110
110
|
...o
|
|
111
111
|
};
|
|
112
|
-
}),
|
|
112
|
+
}), c = $(e.timezone);
|
|
113
113
|
function P(o) {
|
|
114
|
-
if (
|
|
114
|
+
if (y(o)) {
|
|
115
115
|
p(null);
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const a = r(o);
|
|
119
|
-
t(l) ? p(
|
|
119
|
+
t(l) ? p(c(a, t(d))) : p(a.valueOf());
|
|
120
120
|
}
|
|
121
121
|
function C(o, a) {
|
|
122
|
-
var
|
|
123
|
-
const
|
|
124
|
-
(
|
|
122
|
+
var s;
|
|
123
|
+
const u = r(o), n = o ? t(l) ? c(u, t(d)) : u.valueOf() : null;
|
|
124
|
+
(s = e.onChange) == null || s.call(e, n, a);
|
|
125
125
|
}
|
|
126
126
|
function T(o) {
|
|
127
127
|
var n;
|
|
128
|
-
const a = r(o),
|
|
129
|
-
(n = e.onOk) == null || n.call(e,
|
|
128
|
+
const a = r(o), u = o ? t(l) ? c(a, t(d)) : a.valueOf() : null;
|
|
129
|
+
(n = e.onOk) == null || n.call(e, u);
|
|
130
130
|
}
|
|
131
|
-
return (o, a) => o.mode === "read" ? (
|
|
132
|
-
w(M(
|
|
133
|
-
], 64)) : (
|
|
134
|
-
value:
|
|
135
|
-
format:
|
|
131
|
+
return (o, a) => o.mode === "read" ? (v(), b(_, { key: 0 }, [
|
|
132
|
+
w(M(f.value ? t(r)(f.value).format(d.value) : o.emptyText), 1)
|
|
133
|
+
], 64)) : (v(), R(t(N), F({ key: 1 }, O.value, {
|
|
134
|
+
value: f.value,
|
|
135
|
+
format: d.value,
|
|
136
136
|
"onUpdate:value": P,
|
|
137
137
|
onChange: C,
|
|
138
138
|
onOk: T,
|
|
139
139
|
picker: g.value
|
|
140
140
|
}), A({ _: 2 }, [
|
|
141
|
-
x(o.$slots, (
|
|
141
|
+
x(o.$slots, (u, n) => ({
|
|
142
142
|
name: n,
|
|
143
|
-
fn: D((
|
|
144
|
-
E(o.$slots, n, V(z(
|
|
143
|
+
fn: D((s) => [
|
|
144
|
+
E(o.$slots, n, V(z(s || {})))
|
|
145
145
|
])
|
|
146
146
|
}))
|
|
147
147
|
]), 1040, ["value", "format", "picker"]));
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
import { ApFieldNumberProps } from '../interface';
|
|
2
|
+
|
|
1
3
|
export declare function addZeroToDecimalPlaces(numStr: string, precision?: number): string;
|
|
4
|
+
/**
|
|
5
|
+
* 获取字符串类型的值
|
|
6
|
+
* @param value
|
|
7
|
+
* @param options
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getValueStr(value?: number, options?: ApFieldNumberProps): string | undefined;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { isNil as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { isNil as c } from "lodash-unified";
|
|
2
|
+
import { toDecimalMark as t } from "@fruits-chain/utils";
|
|
3
|
+
function m(l, e) {
|
|
4
|
+
if (c(e))
|
|
5
|
+
return l;
|
|
6
|
+
let [a, r = ""] = l.split(".");
|
|
7
|
+
if (r.length >= e)
|
|
8
|
+
return l;
|
|
9
|
+
for (let f = r.length; f < e; f++)
|
|
10
|
+
r += "0";
|
|
11
|
+
return a + "." + r;
|
|
12
|
+
}
|
|
13
|
+
function g(l, e) {
|
|
14
|
+
const a = l;
|
|
15
|
+
if (c(a))
|
|
16
|
+
return e == null ? void 0 : e.emptyText;
|
|
17
|
+
let r = e != null && e.thousands ? t(a, e.precision) : String(a);
|
|
18
|
+
return e != null && e.precision && e.limitDecimalsRetain && (r = m(r, e.precision)), r;
|
|
11
19
|
}
|
|
12
20
|
export {
|
|
13
|
-
|
|
21
|
+
m as addZeroToDecimalPlaces,
|
|
22
|
+
g as getValueStr
|
|
14
23
|
};
|