@aplus-frontend/ui 7.17.4 → 7.18.0
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/ag-grid/hooks/use-editable-form-item-api.mjs +1 -1
- package/es/src/ap-field/cascader/index.vue.mjs +9 -8
- package/es/src/ap-field/cascader/read.vue2.mjs +3 -2
- package/es/src/ap-field/checkbox/index.vue.mjs +12 -11
- package/es/src/ap-field/checkbox/read.vue2.mjs +5 -4
- package/es/src/ap-field/date/index.vue.mjs +83 -73
- package/es/src/ap-field/date/read.vue2.mjs +1 -0
- package/es/src/ap-field/date-range/index.vue.mjs +80 -70
- package/es/src/ap-field/date-range/read.vue2.mjs +3 -2
- package/es/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
- package/es/src/ap-field/hooks/use-read-mode-render.mjs +6 -0
- package/es/src/ap-field/interface.d.ts +8 -0
- package/es/src/ap-field/number/index.vue.mjs +57 -46
- package/es/src/ap-field/number/read.vue2.mjs +1 -0
- package/es/src/ap-field/radio/index.vue.mjs +17 -16
- package/es/src/ap-field/radio/read.vue2.mjs +1 -0
- package/es/src/ap-field/rate/index.vue.mjs +6 -5
- package/es/src/ap-field/second/index.vue.mjs +35 -20
- package/es/src/ap-field/second/read.vue2.mjs +1 -0
- package/es/src/ap-field/segmented/index.vue.mjs +15 -14
- package/es/src/ap-field/select/index.vue.mjs +53 -52
- package/es/src/ap-field/select/read.vue2.mjs +1 -0
- package/es/src/ap-field/slider/index.vue.mjs +11 -10
- package/es/src/ap-field/switch/index.vue.mjs +20 -19
- package/es/src/ap-field/switch/read.vue2.mjs +5 -4
- package/es/src/ap-field/text/index.vue2.mjs +35 -31
- package/es/src/ap-field/text/password.vue.d.ts +4 -4
- package/es/src/ap-field/text/password.vue.mjs +57 -48
- package/es/src/ap-field/text/read-password.vue2.mjs +6 -5
- package/es/src/ap-field/text/read.vue2.mjs +3 -2
- package/es/src/ap-field/text-area/index.vue.mjs +46 -36
- package/es/src/ap-field/text-area/read.vue2.mjs +1 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +9 -8
- package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
- package/es/src/ap-form/items/cascader/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/date/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/date-range/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/number/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/select/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/switch/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/text/index.vue.d.ts +3 -1
- package/es/src/ap-form/items/text/password.vue.d.ts +3 -1
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
- package/es/src/ap-table/constants.d.ts +11 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +109 -98
- package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/es/src/business/batch-input-group/index.vue.mjs +11 -10
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ap-field/cascader/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/read.vue2.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/read.vue2.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/hooks/use-read-mode-render.d.ts +9 -0
- package/lib/src/ap-field/hooks/use-read-mode-render.js +1 -0
- package/lib/src/ap-field/interface.d.ts +8 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/read.vue2.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/second/index.vue.js +1 -1
- package/lib/src/ap-field/second/read.vue2.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/switch/read.vue2.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +4 -4
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text/read-password.vue2.js +1 -1
- package/lib/src/ap-field/text/read.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/text-area/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/items/cascader/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/date/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +3 -1
- package/lib/src/ap-form/items/text/password.vue.d.ts +3 -1
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +3 -1
- package/lib/src/ap-table/constants.d.ts +11 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SwapRightOutlined as
|
|
3
|
-
import { InputGroup as
|
|
4
|
-
import { getTimeFormatToZone as
|
|
1
|
+
import { defineComponent as q, useSlots as J, ref as Q, computed as s, unref as t, isVNode as X, createVNode as O, Fragment as k, createBlock as h, openBlock as u, withCtx as g, createElementBlock as R, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as ee, normalizeStyle as oe, createCommentVNode as te, isRef as ne, renderList as M, mergeProps as ae, createSlots as re, renderSlot as le, normalizeProps as ue, guardReactiveProps as de } from "vue";
|
|
2
|
+
import { SwapRightOutlined as ie } from "@ant-design/icons-vue";
|
|
3
|
+
import { InputGroup as se, Select as fe, SelectOption as pe, DatePicker as me } from "@aplus-frontend/antdv";
|
|
4
|
+
import { getTimeFormatToZone as w } from "@aplus-frontend/utils";
|
|
5
5
|
import d from "dayjs";
|
|
6
|
-
import { isNil as
|
|
6
|
+
import { isNil as T, omit as _, isString as m, isFunction as ce } from "lodash-unified";
|
|
7
|
+
import "../../render/index.mjs";
|
|
7
8
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { omitUndefined as
|
|
9
|
-
import { ApFieldDatePresetFormats as
|
|
10
|
-
import { formatDayWithTimezone as
|
|
11
|
-
import { useDateTimezone as
|
|
12
|
-
import { useDefaultPlaceholder as
|
|
13
|
-
import { useDefaultPresets as
|
|
14
|
-
import {
|
|
15
|
-
|
|
9
|
+
import { omitUndefined as ye } from "../../utils/index.mjs";
|
|
10
|
+
import { ApFieldDatePresetFormats as ve, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as he, PRESET_FORMAT_TIME_MAP as ge } from "../date/constant.mjs";
|
|
11
|
+
import { formatDayWithTimezone as ke } from "../date/helper.mjs";
|
|
12
|
+
import { useDateTimezone as Se } from "../hooks/use-date-timezone.mjs";
|
|
13
|
+
import { useDefaultPlaceholder as Ce } from "../hooks/use-default-placeholder.mjs";
|
|
14
|
+
import { useDefaultPresets as Pe } from "../hooks/use-default-presets.mjs";
|
|
15
|
+
import { useReadModeRender as Be } from "../hooks/use-read-mode-render.mjs";
|
|
16
|
+
import { useControllableValue as Oe } from "../../hooks/useControllableValue.mjs";
|
|
17
|
+
import Re from "../../render/render.mjs";
|
|
18
|
+
const De = {
|
|
19
|
+
key: 0
|
|
20
|
+
}, We = /* @__PURE__ */ q({
|
|
16
21
|
name: "ApFieldDateRange",
|
|
17
22
|
__name: "index",
|
|
18
23
|
props: {
|
|
@@ -24,6 +29,7 @@ const Ee = /* @__PURE__ */ $({
|
|
|
24
29
|
emptyText: {
|
|
25
30
|
default: "--"
|
|
26
31
|
},
|
|
32
|
+
customReadMode: {},
|
|
27
33
|
id: {},
|
|
28
34
|
defaultPickerValue: {},
|
|
29
35
|
placeholder: {},
|
|
@@ -165,115 +171,119 @@ const Ee = /* @__PURE__ */ $({
|
|
|
165
171
|
expose: x,
|
|
166
172
|
emit: z
|
|
167
173
|
}) {
|
|
168
|
-
const o = F, N = z,
|
|
169
|
-
value:
|
|
170
|
-
updateValue:
|
|
171
|
-
} =
|
|
174
|
+
const o = F, N = z, D = J(), P = Q(), i = s(() => ve.indexOf(o.format) > -1), c = s(() => i.value ? A[o.format] : o.format), {
|
|
175
|
+
value: y,
|
|
176
|
+
updateValue: b
|
|
177
|
+
} = Oe(o, N), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Ce("DateRange", o), {
|
|
172
178
|
currentTimezone: l
|
|
173
|
-
} =
|
|
179
|
+
} = Se(o), {
|
|
174
180
|
presets: j,
|
|
175
181
|
changeCurrentDate: I
|
|
176
|
-
} =
|
|
182
|
+
} = Pe({
|
|
177
183
|
...o,
|
|
178
184
|
timezone: l
|
|
179
|
-
}), f = (e, a, n = !0) =>
|
|
180
|
-
const e = t(
|
|
181
|
-
if (
|
|
185
|
+
}), f = (e, a, n = !0) => ke(l.value)(e, a, n), v = s(() => {
|
|
186
|
+
const e = t(y);
|
|
187
|
+
if (T(e) || !e?.length)
|
|
182
188
|
return e;
|
|
183
|
-
const a = l.value ?
|
|
189
|
+
const a = l.value ? w(t(y)[0], l.value) : t(y)?.[0], n = o.timezone ? w(t(y)[1], l.value) : t(y)?.[1];
|
|
184
190
|
return [d(a), d(n)];
|
|
185
|
-
}),
|
|
186
|
-
|
|
191
|
+
}), {
|
|
192
|
+
renderer: U
|
|
193
|
+
} = Be(o, v), H = s(() => t(i) ? o.picker ?? he[o.format] : o.picker), K = s(() => {
|
|
194
|
+
const e = t(i) ? ge[o.format] : {};
|
|
187
195
|
return {
|
|
188
|
-
...
|
|
196
|
+
...ye(_(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
|
|
189
197
|
placeholder: t(V),
|
|
190
198
|
presets: t(j),
|
|
191
199
|
...e
|
|
192
200
|
};
|
|
193
201
|
});
|
|
194
|
-
function
|
|
202
|
+
function W(e) {
|
|
195
203
|
if (!e) {
|
|
196
|
-
|
|
204
|
+
b(e);
|
|
197
205
|
return;
|
|
198
206
|
}
|
|
199
|
-
let a =
|
|
200
|
-
const r = t(i) ? t(
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
function W(e) {
|
|
204
|
-
const a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(y) : void 0, p = e[0] ? f(a, r) : null, O = e[1] ? f(n, r, !1) : null;
|
|
205
|
-
o.onOk?.([p, O]);
|
|
207
|
+
let a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1];
|
|
208
|
+
const r = t(i) ? t(c) : void 0;
|
|
209
|
+
b([f(a, r), f(n, r, !1)]);
|
|
206
210
|
}
|
|
207
211
|
function G(e) {
|
|
212
|
+
const a = m(e[0]) ? d(e[0]) : e[0], n = m(e[1]) ? d(e[1]) : e[1], r = t(i) ? t(c) : void 0, p = e[0] ? f(a, r) : null, B = e[1] ? f(n, r, !1) : null;
|
|
213
|
+
o.onOk?.([p, B]);
|
|
214
|
+
}
|
|
215
|
+
function L(e) {
|
|
208
216
|
e && I(), o.onOpenChange?.(e);
|
|
209
217
|
}
|
|
210
|
-
function
|
|
211
|
-
if (
|
|
218
|
+
function Y(e, a) {
|
|
219
|
+
if (T(e)) {
|
|
212
220
|
o.onChange?.(e, a);
|
|
213
221
|
return;
|
|
214
222
|
}
|
|
215
|
-
const n =
|
|
216
|
-
o.onChange?.([
|
|
223
|
+
const n = m(e[0]) ? d(e[0]) : e[0], r = m(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(c) : void 0, B = e[0] ? f(n, p) : null, $ = e[1] ? f(r, p, !1) : null;
|
|
224
|
+
o.onChange?.([B, $], a);
|
|
217
225
|
}
|
|
218
|
-
const
|
|
226
|
+
const Z = s(() => {
|
|
219
227
|
const e = o.readModeSeparator;
|
|
220
228
|
if (e)
|
|
221
|
-
return
|
|
222
|
-
const a =
|
|
223
|
-
return a ?
|
|
229
|
+
return X(e) || ce(e) ? o.readModeSeparator : O(k, null, [o.readModeSeparator]);
|
|
230
|
+
const a = D.readModeSeparator?.();
|
|
231
|
+
return a ? O(k, null, [a]) : ie;
|
|
224
232
|
});
|
|
225
233
|
return x({
|
|
226
|
-
focus:
|
|
227
|
-
blur:
|
|
228
|
-
}), (e, a) => e.mode === "read" ? (u(),
|
|
229
|
-
key: 0
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
focus: P.value?.focus(),
|
|
235
|
+
blur: P.value?.blur()
|
|
236
|
+
}), (e, a) => e.mode === "read" ? (u(), h(t(Re), {
|
|
237
|
+
key: 0,
|
|
238
|
+
renderer: t(U)
|
|
239
|
+
}, {
|
|
240
|
+
default: g(() => [v.value ? (u(), R("span", De, [S(C(v.value[0]?.format(c.value)) + " ", 1), (u(), h(ee(Z.value))), S(" " + C(v.value[1]?.format(c.value)), 1)])) : (u(), R(k, {
|
|
241
|
+
key: 1
|
|
242
|
+
}, [S(C(e.emptyText), 1)], 64))]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["renderer"])) : (u(), h(t(se), {
|
|
235
245
|
key: 1,
|
|
236
246
|
compact: "",
|
|
237
|
-
style:
|
|
247
|
+
style: oe({
|
|
238
248
|
display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
|
|
239
249
|
})
|
|
240
250
|
}, {
|
|
241
|
-
default:
|
|
251
|
+
default: g(() => [Array.isArray(o.timezone) && o.timezone.length ? (u(), h(t(fe), {
|
|
242
252
|
key: 0,
|
|
243
253
|
value: t(l),
|
|
244
|
-
"onUpdate:value": a[0] || (a[0] = (n) =>
|
|
254
|
+
"onUpdate:value": a[0] || (a[0] = (n) => ne(l) ? l.value = n : null),
|
|
245
255
|
"default-active-first-option": "",
|
|
246
256
|
"dropdown-match-select-width": !1
|
|
247
257
|
}, {
|
|
248
|
-
default:
|
|
258
|
+
default: g(() => [(u(!0), R(k, null, M(o.timezone, (n) => (u(), h(t(pe), {
|
|
249
259
|
key: n?.value,
|
|
250
260
|
value: n?.value
|
|
251
261
|
}, {
|
|
252
|
-
default:
|
|
262
|
+
default: g(() => [S(C(n?.label ?? n?.value), 1)]),
|
|
253
263
|
_: 2
|
|
254
264
|
}, 1032, ["value"]))), 128))]),
|
|
255
265
|
_: 1
|
|
256
|
-
}, 8, ["value"])) :
|
|
266
|
+
}, 8, ["value"])) : te("", !0), O(t(me).RangePicker, ae({
|
|
257
267
|
ref_key: "rangePickerRef",
|
|
258
|
-
ref:
|
|
259
|
-
},
|
|
260
|
-
value:
|
|
261
|
-
picker:
|
|
268
|
+
ref: P
|
|
269
|
+
}, K.value, {
|
|
270
|
+
value: v.value,
|
|
271
|
+
picker: H.value,
|
|
262
272
|
format: E.value,
|
|
263
|
-
"onUpdate:value":
|
|
264
|
-
onChange:
|
|
265
|
-
onOk:
|
|
266
|
-
onOpenChange:
|
|
267
|
-
}),
|
|
273
|
+
"onUpdate:value": W,
|
|
274
|
+
onChange: Y,
|
|
275
|
+
onOk: G,
|
|
276
|
+
onOpenChange: L
|
|
277
|
+
}), re({
|
|
268
278
|
_: 2
|
|
269
|
-
}, [
|
|
279
|
+
}, [M(t(_)(D, "readModeSeparator"), (n, r) => ({
|
|
270
280
|
name: r,
|
|
271
|
-
fn:
|
|
281
|
+
fn: g((p) => [le(e.$slots, r, ue(de(p || {})))])
|
|
272
282
|
}))]), 1040, ["value", "picker", "format"])]),
|
|
273
283
|
_: 3
|
|
274
284
|
}, 8, ["style"]));
|
|
275
285
|
}
|
|
276
286
|
});
|
|
277
287
|
export {
|
|
278
|
-
|
|
288
|
+
We as default
|
|
279
289
|
};
|
|
@@ -4,7 +4,7 @@ import c from "dayjs";
|
|
|
4
4
|
import { isNil as g } from "lodash-unified";
|
|
5
5
|
import { ApFieldDatePresetFormats as w, PRESET_FORMAT_MAP as C } from "../date/constant.mjs";
|
|
6
6
|
import { useDateTimezone as O } from "../hooks/use-date-timezone.mjs";
|
|
7
|
-
const
|
|
7
|
+
const F = /* @__PURE__ */ v({
|
|
8
8
|
name: "ApFieldDateRangeRead",
|
|
9
9
|
__name: "read",
|
|
10
10
|
props: {
|
|
@@ -12,6 +12,7 @@ const M = /* @__PURE__ */ v({
|
|
|
12
12
|
class: {},
|
|
13
13
|
style: {},
|
|
14
14
|
emptyText: { default: "--" },
|
|
15
|
+
customReadMode: {},
|
|
15
16
|
id: {},
|
|
16
17
|
defaultPickerValue: {},
|
|
17
18
|
placeholder: {},
|
|
@@ -116,5 +117,5 @@ const M = /* @__PURE__ */ v({
|
|
|
116
117
|
}
|
|
117
118
|
});
|
|
118
119
|
export {
|
|
119
|
-
|
|
120
|
+
F as default
|
|
120
121
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref, VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
import { BasicApFieldProps } from '../interface';
|
|
3
|
+
export declare const useReadModeRender: (props: BasicApFieldProps<object>, val: Ref<any>) => {
|
|
4
|
+
renderer: (children: VNode[]) => VNode< RendererNode, RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}> | VNode< RendererNode, RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>[];
|
|
9
|
+
};
|
|
@@ -7,6 +7,7 @@ import { SharedTimeProps } from '@aplus-frontend/antdv/es/vc-picker/panels/TimeP
|
|
|
7
7
|
import { LegacyDataNode } from '@aplus-frontend/antdv/es/vc-tree-select/interface';
|
|
8
8
|
import { ZoneAlias } from '@aplus-frontend/utils';
|
|
9
9
|
import { Dayjs } from 'dayjs';
|
|
10
|
+
import { VNode } from 'vue';
|
|
10
11
|
import { LiteralUnion, Recordable } from '../type';
|
|
11
12
|
import { ApFormatPresetType } from './date/interface';
|
|
12
13
|
import { InputPasswordProps } from './text/input-password-props';
|
|
@@ -21,6 +22,13 @@ export type BasicApFieldProps<FieldPropsType = any> = {
|
|
|
21
22
|
class?: unknown;
|
|
22
23
|
style?: unknown;
|
|
23
24
|
emptyText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 自定义渲染只读模式(仅输入类型控件支持)
|
|
27
|
+
* @param originalNode 默认渲染的节点
|
|
28
|
+
* @param val 将要渲染的文本
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
customReadMode?: (originalNode: any, val?: any) => VNode;
|
|
24
32
|
} & FieldPropsType;
|
|
25
33
|
export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
26
34
|
/**
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, useSlots as $, computed as m, shallowRef as A, unref as t, createBlock as f, openBlock as r, withCtx as c, createElementVNode as y, normalizeClass as s, createElementBlock as v, createCommentVNode as h, renderSlot as i, toDisplayString as U, mergeProps as z, createSlots as E, renderList as T, normalizeProps as _, guardReactiveProps as w } from "vue";
|
|
2
2
|
import { InputNumber as F } from "@aplus-frontend/antdv";
|
|
3
3
|
import { omit as O, isNil as W } from "lodash-unified";
|
|
4
|
-
import
|
|
4
|
+
import "../../render/index.mjs";
|
|
5
|
+
import { roundWith as L, toDecimalMark as Z } from "../../utils/format.mjs";
|
|
5
6
|
import "../../config-provider/index.mjs";
|
|
6
7
|
import "../../hooks/index.mjs";
|
|
7
|
-
import { useDefaultPlaceholder as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
8
|
+
import { useDefaultPlaceholder as j } from "../hooks/use-default-placeholder.mjs";
|
|
9
|
+
import { useReadModeRender as q } from "../hooks/use-read-mode-render.mjs";
|
|
10
|
+
import G from "../style/index.mjs";
|
|
11
|
+
import { addZeroToDecimalPlaces as H } from "./helper.mjs";
|
|
12
|
+
import { useNamespace as J } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useControllableValue as K } from "../../hooks/useControllableValue.mjs";
|
|
14
|
+
import Q from "../../render/render.mjs";
|
|
15
|
+
const fe = /* @__PURE__ */ I({
|
|
13
16
|
name: "ApFieldNumber",
|
|
14
17
|
__name: "index",
|
|
15
18
|
props: {
|
|
@@ -17,6 +20,7 @@ const se = /* @__PURE__ */ D({
|
|
|
17
20
|
class: {},
|
|
18
21
|
style: {},
|
|
19
22
|
emptyText: { default: "--" },
|
|
23
|
+
customReadMode: {},
|
|
20
24
|
size: {},
|
|
21
25
|
bordered: { type: Boolean, default: !0 },
|
|
22
26
|
placeholder: {},
|
|
@@ -61,60 +65,67 @@ const se = /* @__PURE__ */ D({
|
|
|
61
65
|
limitDecimalsRetain: { type: Boolean }
|
|
62
66
|
},
|
|
63
67
|
emits: ["update:value"],
|
|
64
|
-
setup(
|
|
65
|
-
const
|
|
68
|
+
setup(B, { expose: b, emit: g }) {
|
|
69
|
+
const k = g, R = $(), { b: l } = J("field-number"), S = G("field"), o = B, x = m(
|
|
66
70
|
() => O(o, ["value", "onUpdate:value", "mode"])
|
|
67
|
-
), n =
|
|
71
|
+
), n = A(), { value: u, updateValue: C } = K(
|
|
68
72
|
o,
|
|
69
|
-
|
|
70
|
-
),
|
|
71
|
-
let e = t(
|
|
73
|
+
k
|
|
74
|
+
), M = j("Number", o), d = m(() => {
|
|
75
|
+
let e = t(u);
|
|
72
76
|
if (W(e))
|
|
73
77
|
return o.emptyText;
|
|
74
|
-
o.precision && (e =
|
|
75
|
-
let a = o.thousands ?
|
|
76
|
-
return o.precision && o.limitDecimalsRetain && (a =
|
|
77
|
-
});
|
|
78
|
-
function
|
|
78
|
+
o.precision && (e = L(e, o.precision));
|
|
79
|
+
let a = o.thousands ? Z(e) : String(e);
|
|
80
|
+
return o.precision && o.limitDecimalsRetain && (a = H(a, o.precision)), a;
|
|
81
|
+
}), { renderer: N } = q(o, d);
|
|
82
|
+
function P() {
|
|
79
83
|
n.value?.focus();
|
|
80
84
|
}
|
|
81
|
-
function
|
|
85
|
+
function D() {
|
|
82
86
|
n.value?.blur();
|
|
83
87
|
}
|
|
84
|
-
return
|
|
88
|
+
return b({ focus: P, blur: D }), (e, a) => e.mode === "read" ? (r(), f(t(Q), {
|
|
85
89
|
key: 0,
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
renderer: t(N)
|
|
91
|
+
}, {
|
|
92
|
+
default: c(() => [
|
|
93
|
+
y("span", {
|
|
94
|
+
class: s([t(l)(), t(S)])
|
|
95
|
+
}, [
|
|
96
|
+
e.$slots.prefix ? (r(), v("span", {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: s(t(l)("label-left"))
|
|
99
|
+
}, [
|
|
100
|
+
i(e.$slots, "prefix")
|
|
101
|
+
], 2)) : h("", !0),
|
|
102
|
+
y("span", null, U(d.value), 1),
|
|
103
|
+
e.$slots.addonAfter ? (r(), v("span", {
|
|
104
|
+
key: 1,
|
|
105
|
+
class: s(t(l)("label-right"))
|
|
106
|
+
}, [
|
|
107
|
+
i(e.$slots, "addonAfter")
|
|
108
|
+
], 2)) : h("", !0)
|
|
109
|
+
], 2)
|
|
110
|
+
]),
|
|
111
|
+
_: 3
|
|
112
|
+
}, 8, ["renderer"])) : (r(), f(t(F), z({ key: 1 }, x.value, {
|
|
102
113
|
ref_key: "inputRef",
|
|
103
114
|
ref: n,
|
|
104
|
-
placeholder: t(
|
|
105
|
-
value: t(
|
|
115
|
+
placeholder: t(M),
|
|
116
|
+
value: t(u),
|
|
106
117
|
mode: e.inputMode,
|
|
107
|
-
"onUpdate:value": t(
|
|
108
|
-
}),
|
|
109
|
-
|
|
110
|
-
name:
|
|
111
|
-
fn:
|
|
112
|
-
|
|
118
|
+
"onUpdate:value": t(C)
|
|
119
|
+
}), E({ _: 2 }, [
|
|
120
|
+
T(R, (X, p) => ({
|
|
121
|
+
name: p,
|
|
122
|
+
fn: c((V) => [
|
|
123
|
+
i(e.$slots, p, _(w(V || {})))
|
|
113
124
|
])
|
|
114
125
|
}))
|
|
115
126
|
]), 1040, ["placeholder", "value", "mode", "onUpdate:value"]));
|
|
116
127
|
}
|
|
117
128
|
});
|
|
118
129
|
export {
|
|
119
|
-
|
|
130
|
+
fe as default
|
|
120
131
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as V, computed as
|
|
2
|
-
import { Spin as
|
|
1
|
+
import { defineComponent as V, computed as u, ref as C, onMounted as O, unref as e, createElementBlock as p, openBlock as a, Fragment as m, createTextVNode as R, toDisplayString as S, createBlock as d, mergeProps as U } from "vue";
|
|
2
|
+
import { Spin as _, RadioGroup as N } from "@aplus-frontend/antdv";
|
|
3
3
|
import { omit as z, isNil as F } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import G from "../hooks/use-options.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { getOptionValue as
|
|
9
|
-
import { useControllableValue as
|
|
10
|
-
import { useNamespace as
|
|
7
|
+
import M from "../style/index.mjs";
|
|
8
|
+
import { getOptionValue as P, getOptionLabel as A } from "./helper.mjs";
|
|
9
|
+
import { useControllableValue as D } from "../../hooks/useControllableValue.mjs";
|
|
10
|
+
import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
const Y = /* @__PURE__ */ V({
|
|
12
12
|
name: "ApFieldRadio",
|
|
13
13
|
__name: "index",
|
|
@@ -16,6 +16,7 @@ const Y = /* @__PURE__ */ V({
|
|
|
16
16
|
class: {},
|
|
17
17
|
style: {},
|
|
18
18
|
emptyText: { default: "--" },
|
|
19
|
+
customReadMode: {},
|
|
19
20
|
prefixCls: {},
|
|
20
21
|
value: {},
|
|
21
22
|
size: {},
|
|
@@ -33,9 +34,9 @@ const Y = /* @__PURE__ */ V({
|
|
|
33
34
|
},
|
|
34
35
|
emits: ["update:value"],
|
|
35
36
|
setup(c, { expose: f, emit: v }) {
|
|
36
|
-
const t = c, y =
|
|
37
|
+
const t = c, y = u(
|
|
37
38
|
() => z(t, ["value", "onUpdate:value", "options", "request", "vertical"])
|
|
38
|
-
), g = v, { options: n, updateOptions: k } = G(t), { value: r, updateValue: x } =
|
|
39
|
+
), g = v, { options: n, updateOptions: k } = G(t), { value: r, updateValue: x } = D(t, g), { b, m: B } = E("field-radio"), T = M("field"), l = C(!1);
|
|
39
40
|
async function s() {
|
|
40
41
|
t.request && (l.value = !0, t.request?.().then((o) => k(o)).finally(() => {
|
|
41
42
|
l.value = !1;
|
|
@@ -44,24 +45,24 @@ const Y = /* @__PURE__ */ V({
|
|
|
44
45
|
O(() => {
|
|
45
46
|
s();
|
|
46
47
|
});
|
|
47
|
-
const h =
|
|
48
|
+
const h = u(() => {
|
|
48
49
|
const o = e(r);
|
|
49
50
|
if (F(o))
|
|
50
51
|
return t.emptyText;
|
|
51
52
|
const i = n.value?.find(
|
|
52
|
-
(q) => o ===
|
|
53
|
+
(q) => o === P(q)
|
|
53
54
|
);
|
|
54
|
-
return
|
|
55
|
+
return A(i) || t.emptyText;
|
|
55
56
|
});
|
|
56
57
|
return f({
|
|
57
58
|
request: s
|
|
58
|
-
}), (o, i) => o.mode === "read" ? (a(),
|
|
59
|
-
S(
|
|
60
|
-
], 64)) : (a(),
|
|
61
|
-
l.value ? (a(), d(e(
|
|
59
|
+
}), (o, i) => o.mode === "read" ? (a(), p(m, { key: 0 }, [
|
|
60
|
+
R(S(h.value), 1)
|
|
61
|
+
], 64)) : (a(), p(m, { key: 1 }, [
|
|
62
|
+
l.value ? (a(), d(e(_), {
|
|
62
63
|
key: 0,
|
|
63
64
|
size: "small"
|
|
64
|
-
})) : (a(), d(e(
|
|
65
|
+
})) : (a(), d(e(N), U({ key: 1 }, y.value, {
|
|
65
66
|
ref: "radioGroupRef",
|
|
66
67
|
value: e(r),
|
|
67
68
|
options: e(n),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as b, computed as a, shallowRef as y, useSlots as h, createBlock as B, openBlock as C, unref as t, mergeProps as _, createSlots as x, withCtx as
|
|
2
|
-
import { Rate as
|
|
1
|
+
import { defineComponent as b, computed as a, shallowRef as y, useSlots as h, createBlock as B, openBlock as C, unref as t, mergeProps as _, createSlots as x, withCtx as R, renderSlot as k } from "vue";
|
|
2
|
+
import { Rate as w } from "@aplus-frontend/antdv";
|
|
3
3
|
import { omit as g } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { useControllableValue as V } from "../../hooks/useControllableValue.mjs";
|
|
@@ -10,6 +10,7 @@ const A = /* @__PURE__ */ b({
|
|
|
10
10
|
mode: { default: "edit" },
|
|
11
11
|
class: {},
|
|
12
12
|
style: {},
|
|
13
|
+
customReadMode: {},
|
|
13
14
|
prefixCls: {},
|
|
14
15
|
count: { default: 5 },
|
|
15
16
|
value: {},
|
|
@@ -44,7 +45,7 @@ const A = /* @__PURE__ */ b({
|
|
|
44
45
|
return r({
|
|
45
46
|
focus: p,
|
|
46
47
|
blur: m
|
|
47
|
-
}), (v, S) => (C(), B(t(
|
|
48
|
+
}), (v, S) => (C(), B(t(w), _(n.value, {
|
|
48
49
|
ref_key: "rateRef",
|
|
49
50
|
ref: o,
|
|
50
51
|
value: t(c),
|
|
@@ -53,8 +54,8 @@ const A = /* @__PURE__ */ b({
|
|
|
53
54
|
}), x({ _: 2 }, [
|
|
54
55
|
d.character ? {
|
|
55
56
|
name: "character",
|
|
56
|
-
fn:
|
|
57
|
-
|
|
57
|
+
fn: R(() => [
|
|
58
|
+
k(v.$slots, "character")
|
|
58
59
|
]),
|
|
59
60
|
key: "0"
|
|
60
61
|
} : void 0
|