@aplus-frontend/ui 0.4.11 → 0.4.13
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-range/index.vue.mjs +65 -57
- package/es/src/ap-field/hooks/use-default-presets.d.ts +7 -4
- package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +109 -127
- package/es/src/business/ap-ladder/index.d.ts +1 -0
- package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
- package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +31 -21
- package/es/src/business/ap-table-modal/interface.d.ts +3 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +53 -46
- package/es/src/business/ap-title/interface.d.ts +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +7 -7
- package/es/src/full-screen/index.vue.d.ts +2 -2
- package/es/src/full-screen/index.vue.mjs +19 -18
- package/es/src/hooks/useFullScreen.mjs +12 -11
- package/es/src/utils/data-range-persets.d.ts +23 -40
- package/es/src/utils/data-range-persets.mjs +95 -102
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +7 -4
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/index.d.ts +1 -0
- package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
- package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
- package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/business/ap-title/interface.d.ts +1 -1
- package/lib/src/config-provider/hooks/use-locale.js +1 -1
- package/lib/src/full-screen/index.vue.d.ts +2 -2
- package/lib/src/full-screen/index.vue.js +1 -1
- package/lib/src/hooks/useFullScreen.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +23 -40
- package/lib/src/utils/data-range-persets.js +1 -1
- package/package.json +3 -3
- package/theme/ap-form/ap-form-item.css +8 -5
- package/theme/ap-form/ap-form-item.less +11 -8
- package/theme/ap-form/index.css +8 -5
- package/theme/ap-form/search-form.css +8 -5
- package/theme/ap-form/search-form.less +0 -1
- package/theme/ap-table/ap-table.css +8 -5
- package/theme/ap-table-modal/index.css +8 -5
- package/theme/editable-table/index.css +8 -5
- package/theme/index.css +8 -5
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as Y, useSlots as Z, computed as y, unref as t, isVNode as q, createVNode as T, Fragment as v, openBlock as d, createElementBlock as k, createTextVNode as C, toDisplayString as B, createBlock as P, resolveDynamicComponent as J, normalizeStyle as Q, withCtx as D, isRef as X, renderList as R, createCommentVNode as z, mergeProps as ee, createSlots as ne, renderSlot as oe, normalizeProps as te, guardReactiveProps as ae } from "vue";
|
|
2
|
+
import { ApFieldDatePresetFormats as re, PRESET_FORMAT_MAP as le, PRESET_FORMAT_PICK_MAP as ue, PRESET_FORMAT_TIME_MAP as de } from "../date/constant.mjs";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as w, omit as _, isString as h, isFunction as
|
|
4
|
+
import { isNil as w, omit as _, isString as h, isFunction as ie } from "lodash-unified";
|
|
5
5
|
import i from "dayjs";
|
|
6
|
-
import { InputGroup as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { SwapRightOutlined as
|
|
9
|
-
import { omitUndefined as
|
|
6
|
+
import { InputGroup as se, Select as fe, SelectOption as pe, DatePicker as me } from "@aplus-frontend/antdv";
|
|
7
|
+
import { formatDayWithTimezone as ce } from "../date/helper.mjs";
|
|
8
|
+
import { SwapRightOutlined as ye } from "@ant-design/icons-vue";
|
|
9
|
+
import { omitUndefined as ve } from "../../utils/index.mjs";
|
|
10
10
|
import { getTimeFormatToZone as F } from "@aplus-frontend/utils";
|
|
11
|
-
import { useDefaultPlaceholder as
|
|
12
|
-
import { useDefaultPresets as
|
|
13
|
-
import { useDateTimezone as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
11
|
+
import { useDefaultPlaceholder as he } from "../hooks/use-default-placeholder.mjs";
|
|
12
|
+
import { useDefaultPresets as ge } from "../hooks/use-default-presets.mjs";
|
|
13
|
+
import { useDateTimezone as Se } from "../hooks/use-date-timezone.mjs";
|
|
14
|
+
import { useControllableValue as ke } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const xe = /* @__PURE__ */ Y({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
mode: {
|
|
@@ -157,60 +157,67 @@ const Fe = /* @__PURE__ */ L({
|
|
|
157
157
|
setup(N, {
|
|
158
158
|
emit: x
|
|
159
159
|
}) {
|
|
160
|
-
const
|
|
160
|
+
const n = N, E = x, O = Z(), s = y(() => re.indexOf(n.format) > -1), f = y(() => s.value ? le[n.format] : n.format), {
|
|
161
161
|
value: g,
|
|
162
|
-
updateValue:
|
|
163
|
-
} =
|
|
162
|
+
updateValue: M
|
|
163
|
+
} = ke(n, E), V = he("DateRange", n), {
|
|
164
164
|
currentTimezone: u
|
|
165
|
-
} =
|
|
166
|
-
|
|
165
|
+
} = Se(n), {
|
|
166
|
+
presets: I,
|
|
167
|
+
changeCurrentDate: U
|
|
168
|
+
} = ge({
|
|
169
|
+
...n,
|
|
167
170
|
timezone: u
|
|
168
|
-
}), p = (e, a, r = !0) =>
|
|
169
|
-
var l,
|
|
171
|
+
}), p = (e, a, r = !0) => ce(u.value)(e, a, r), S = y(() => {
|
|
172
|
+
var l, o;
|
|
170
173
|
const e = t(g);
|
|
171
174
|
if (w(e) || !(e != null && e.length))
|
|
172
175
|
return e;
|
|
173
|
-
const a = u.value ? F(t(g)[0], u.value) : (l = t(g)) == null ? void 0 : l[0], r =
|
|
176
|
+
const a = u.value ? F(t(g)[0], u.value) : (l = t(g)) == null ? void 0 : l[0], r = n.timezone ? F(t(g)[1], u.value) : (o = t(g)) == null ? void 0 : o[1];
|
|
174
177
|
return [i(a), i(r)];
|
|
175
|
-
}),
|
|
176
|
-
const e = t(s) ?
|
|
178
|
+
}), j = y(() => t(s) ? n.picker ?? ue[n.format] : n.picker), H = y(() => {
|
|
179
|
+
const e = t(s) ? de[n.format] : {};
|
|
177
180
|
return {
|
|
178
|
-
...
|
|
181
|
+
...ve(_(n, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
|
|
179
182
|
placeholder: t(V),
|
|
180
183
|
presets: t(I),
|
|
181
184
|
...e
|
|
182
185
|
};
|
|
183
186
|
});
|
|
184
|
-
function
|
|
187
|
+
function K(e) {
|
|
185
188
|
if (!e) {
|
|
186
|
-
|
|
189
|
+
M(e);
|
|
187
190
|
return;
|
|
188
191
|
}
|
|
189
192
|
let a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1];
|
|
190
193
|
const l = t(s) ? t(f) : void 0;
|
|
191
|
-
|
|
194
|
+
M([p(a, l), p(r, l, !1)]);
|
|
192
195
|
}
|
|
193
|
-
function
|
|
196
|
+
function $(e) {
|
|
194
197
|
var c;
|
|
195
|
-
const a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1], l = t(s) ? t(f) : void 0,
|
|
196
|
-
(c =
|
|
198
|
+
const a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1], l = t(s) ? t(f) : void 0, o = e[0] ? p(a, l) : null, m = e[1] ? p(r, l, !1) : null;
|
|
199
|
+
(c = n.onOk) == null || c.call(n, [o, m]);
|
|
200
|
+
}
|
|
201
|
+
function G(e) {
|
|
202
|
+
var a;
|
|
203
|
+
e && U(), (a = n.onOpenChange) == null || a.call(n, e);
|
|
197
204
|
}
|
|
198
|
-
function
|
|
205
|
+
function L(e, a) {
|
|
199
206
|
var b, A;
|
|
200
207
|
if (w(e)) {
|
|
201
|
-
(b =
|
|
208
|
+
(b = n.onChange) == null || b.call(n, e, a);
|
|
202
209
|
return;
|
|
203
210
|
}
|
|
204
|
-
const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1],
|
|
205
|
-
(A =
|
|
211
|
+
const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1], o = t(s) ? t(f) : void 0, m = e[0] ? p(r, o) : null, c = e[1] ? p(l, o, !1) : null;
|
|
212
|
+
(A = n.onChange) == null || A.call(n, [m, c], a);
|
|
206
213
|
}
|
|
207
|
-
const
|
|
214
|
+
const W = y(() => {
|
|
208
215
|
var r;
|
|
209
|
-
const e =
|
|
216
|
+
const e = n.readModeSeparator;
|
|
210
217
|
if (e)
|
|
211
|
-
return
|
|
212
|
-
const a = (r =
|
|
213
|
-
return a ?
|
|
218
|
+
return q(e) || ie(e) ? n.readModeSeparator : T(v, null, [n.readModeSeparator]);
|
|
219
|
+
const a = (r = O.readModeSeparator) == null ? void 0 : r.call(O);
|
|
220
|
+
return a ? T(v, null, [a]) : ye;
|
|
214
221
|
});
|
|
215
222
|
return (e, a) => {
|
|
216
223
|
var r, l;
|
|
@@ -218,42 +225,43 @@ const Fe = /* @__PURE__ */ L({
|
|
|
218
225
|
key: 0
|
|
219
226
|
}, [S.value ? (d(), k(v, {
|
|
220
227
|
key: 0
|
|
221
|
-
}, [B(
|
|
228
|
+
}, [C(B((r = S.value[0]) == null ? void 0 : r.format(f.value)) + " ", 1), (d(), P(J(W.value))), C(" " + B((l = S.value[1]) == null ? void 0 : l.format(f.value)), 1)], 64)) : (d(), k(v, {
|
|
222
229
|
key: 1
|
|
223
|
-
}, [B(
|
|
230
|
+
}, [C(B(e.emptyText), 1)], 64))], 64)) : (d(), P(t(se), {
|
|
224
231
|
key: 1,
|
|
225
232
|
compact: "",
|
|
226
|
-
style:
|
|
227
|
-
display: Array.isArray(
|
|
233
|
+
style: Q({
|
|
234
|
+
display: Array.isArray(n.timezone) && n.timezone.length ? "flex" : "block"
|
|
228
235
|
})
|
|
229
236
|
}, {
|
|
230
|
-
default: D(() => [Array.isArray(
|
|
237
|
+
default: D(() => [Array.isArray(n.timezone) && n.timezone.length ? (d(), P(t(fe), {
|
|
231
238
|
key: 0,
|
|
232
239
|
value: t(u),
|
|
233
|
-
"onUpdate:value": a[0] || (a[0] = (
|
|
240
|
+
"onUpdate:value": a[0] || (a[0] = (o) => X(u) ? u.value = o : null),
|
|
234
241
|
"default-active-first-option": "",
|
|
235
242
|
"dropdown-match-select-width": !1
|
|
236
243
|
}, {
|
|
237
|
-
default: D(() => [(d(!0), k(v, null, R(
|
|
238
|
-
key:
|
|
239
|
-
value:
|
|
244
|
+
default: D(() => [(d(!0), k(v, null, R(n.timezone, (o) => (d(), P(t(pe), {
|
|
245
|
+
key: o == null ? void 0 : o.value,
|
|
246
|
+
value: o == null ? void 0 : o.value
|
|
240
247
|
}, {
|
|
241
|
-
default: D(() => [B(
|
|
248
|
+
default: D(() => [C(B((o == null ? void 0 : o.label) ?? (o == null ? void 0 : o.value)), 1)]),
|
|
242
249
|
_: 2
|
|
243
250
|
}, 1032, ["value"]))), 128))]),
|
|
244
251
|
_: 1
|
|
245
|
-
}, 8, ["value"])) :
|
|
252
|
+
}, 8, ["value"])) : z("", !0), T(t(me).RangePicker, ee(H.value, {
|
|
246
253
|
value: S.value,
|
|
247
|
-
picker:
|
|
254
|
+
picker: j.value,
|
|
248
255
|
format: f.value,
|
|
249
|
-
"onUpdate:value":
|
|
250
|
-
onChange:
|
|
251
|
-
onOk:
|
|
252
|
-
|
|
256
|
+
"onUpdate:value": K,
|
|
257
|
+
onChange: L,
|
|
258
|
+
onOk: $,
|
|
259
|
+
onOpenChange: G
|
|
260
|
+
}), ne({
|
|
253
261
|
_: 2
|
|
254
|
-
}, [R(t(_)(e.$slots, "readModeSeparator"), (
|
|
262
|
+
}, [R(t(_)(e.$slots, "readModeSeparator"), (o, m) => ({
|
|
255
263
|
name: m,
|
|
256
|
-
fn: D((c) => [
|
|
264
|
+
fn: D((c) => [oe(e.$slots, m, te(ae(c || {})))])
|
|
257
265
|
}))]), 1040, ["value", "picker", "format"])]),
|
|
258
266
|
_: 3
|
|
259
267
|
}, 8, ["style"]));
|
|
@@ -261,5 +269,5 @@ const Fe = /* @__PURE__ */ L({
|
|
|
261
269
|
}
|
|
262
270
|
});
|
|
263
271
|
export {
|
|
264
|
-
|
|
272
|
+
xe as default
|
|
265
273
|
};
|
|
@@ -6,7 +6,10 @@ import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
|
6
6
|
export declare const useDefaultPresets: (props: BasicApFieldProps<{
|
|
7
7
|
presets?: ApFieldDateRangeProps["presets"];
|
|
8
8
|
timezone?: Ref<ZoneAlias | undefined>;
|
|
9
|
-
}>) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
}>) => {
|
|
10
|
+
presets: ComputedRef<{
|
|
11
|
+
label: VueNode;
|
|
12
|
+
value: Dayjs[];
|
|
13
|
+
}[] | undefined>;
|
|
14
|
+
changeCurrentDate: () => void;
|
|
15
|
+
};
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { presetsDefault as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ref as s, computed as i } from "vue";
|
|
2
|
+
import { presetsDefault as v } from "../../utils/data-range-persets.mjs";
|
|
3
|
+
import m from "dayjs";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { useLocale as D } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
const j = (e) => {
|
|
7
|
+
const u = s(m().valueOf()), { t: f } = D();
|
|
8
|
+
return {
|
|
9
|
+
presets: i(() => {
|
|
10
|
+
var a, t, l;
|
|
11
|
+
return e.presets === !0 ? v((a = e == null ? void 0 : e.timezone) == null ? void 0 : a.value, u.value, f) : (l = (t = e == null ? void 0 : e.presets) == null ? void 0 : t.map) == null ? void 0 : l.call(t, (r) => {
|
|
12
|
+
var n;
|
|
13
|
+
return {
|
|
14
|
+
label: r.label,
|
|
15
|
+
value: (n = r == null ? void 0 : r.value) == null ? void 0 : n.filter((c) => c !== null)
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}),
|
|
19
|
+
changeCurrentDate: () => {
|
|
20
|
+
u.value = m().valueOf();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
13
24
|
export {
|
|
14
|
-
|
|
25
|
+
j as useDefaultPresets
|
|
15
26
|
};
|
|
@@ -10,6 +10,7 @@ declare function __VLS_template(): {
|
|
|
10
10
|
attrs: Partial<{}>;
|
|
11
11
|
slots: Readonly<ApLadderSlots> & ApLadderSlots;
|
|
12
12
|
refs: {
|
|
13
|
+
wrapperRef: HTMLDivElement;
|
|
13
14
|
valueRefs: HTMLSpanElement;
|
|
14
15
|
};
|
|
15
16
|
rootEl: HTMLDivElement;
|
|
@@ -95,6 +96,7 @@ declare const __VLS_component: DefineComponent<ApLadderProps, {}, {}, {}, {}, Co
|
|
|
95
96
|
tooltipLabelStyles: string | false | CSSProperties | StyleValue[] | null;
|
|
96
97
|
tooltipValueStyles: string | false | CSSProperties | StyleValue[] | null;
|
|
97
98
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
99
|
+
wrapperRef: HTMLDivElement;
|
|
98
100
|
valueRefs: HTMLSpanElement;
|
|
99
101
|
}, HTMLDivElement>;
|
|
100
102
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|