@aplus-frontend/ui 0.4.11 → 0.4.12

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.
Files changed (38) hide show
  1. package/es/src/ap-field/date-range/index.vue.mjs +65 -57
  2. package/es/src/ap-field/hooks/use-default-presets.d.ts +7 -4
  3. package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
  4. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
  5. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +109 -127
  6. package/es/src/business/ap-ladder/index.d.ts +1 -0
  7. package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  8. package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
  9. package/es/src/config-provider/hooks/use-locale.mjs +7 -7
  10. package/es/src/full-screen/index.vue.d.ts +2 -2
  11. package/es/src/full-screen/index.vue.mjs +19 -18
  12. package/es/src/hooks/useFullScreen.mjs +12 -11
  13. package/es/src/utils/data-range-persets.d.ts +23 -40
  14. package/es/src/utils/data-range-persets.mjs +95 -102
  15. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  16. package/lib/src/ap-field/hooks/use-default-presets.d.ts +7 -4
  17. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  18. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
  19. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  20. package/lib/src/business/ap-ladder/index.d.ts +1 -0
  21. package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  22. package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
  23. package/lib/src/config-provider/hooks/use-locale.js +1 -1
  24. package/lib/src/full-screen/index.vue.d.ts +2 -2
  25. package/lib/src/full-screen/index.vue.js +1 -1
  26. package/lib/src/hooks/useFullScreen.js +1 -1
  27. package/lib/src/utils/data-range-persets.d.ts +23 -40
  28. package/lib/src/utils/data-range-persets.js +1 -1
  29. package/package.json +2 -2
  30. package/theme/ap-form/ap-form-item.css +1 -1
  31. package/theme/ap-form/ap-form-item.less +1 -1
  32. package/theme/ap-form/index.css +4 -1
  33. package/theme/ap-form/search-form.css +4 -1
  34. package/theme/ap-form/search-form.less +5 -0
  35. package/theme/ap-table/ap-table.css +4 -1
  36. package/theme/ap-table-modal/index.css +4 -1
  37. package/theme/editable-table/index.css +4 -1
  38. package/theme/index.css +4 -1
@@ -1,18 +1,18 @@
1
- import { defineComponent as L, useSlots as W, computed as y, unref as t, isVNode as Y, createVNode as M, Fragment as v, openBlock as d, createElementBlock as k, createTextVNode as B, toDisplayString as P, createBlock as C, resolveDynamicComponent as Z, normalizeStyle as q, withCtx as D, isRef as J, renderList as R, createCommentVNode as Q, mergeProps as X, createSlots as z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ne } from "vue";
2
- import { ApFieldDatePresetFormats as te, PRESET_FORMAT_MAP as ae, PRESET_FORMAT_PICK_MAP as re, PRESET_FORMAT_TIME_MAP as le } from "../date/constant.mjs";
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 ue } from "lodash-unified";
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 de, Select as ie, SelectOption as se, DatePicker as fe } from "@aplus-frontend/antdv";
7
- import { formatDayWithTimezone as pe } from "../date/helper.mjs";
8
- import { SwapRightOutlined as me } from "@ant-design/icons-vue";
9
- import { omitUndefined as ce } from "../../utils/index.mjs";
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 ye } from "../hooks/use-default-placeholder.mjs";
12
- import { useDefaultPresets as ve } from "../hooks/use-default-presets.mjs";
13
- import { useDateTimezone as he } from "../hooks/use-date-timezone.mjs";
14
- import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
15
- const Fe = /* @__PURE__ */ L({
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 o = N, E = x, T = W(), s = y(() => te.indexOf(o.format) > -1), f = y(() => s.value ? ae[o.format] : o.format), {
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: O
163
- } = ge(o, E), V = ye("DateRange", o), {
162
+ updateValue: M
163
+ } = ke(n, E), V = he("DateRange", n), {
164
164
  currentTimezone: u
165
- } = he(o), I = ve({
166
- ...o,
165
+ } = Se(n), {
166
+ presets: I,
167
+ changeCurrentDate: U
168
+ } = ge({
169
+ ...n,
167
170
  timezone: u
168
- }), p = (e, a, r = !0) => pe(u.value)(e, a, r), S = y(() => {
169
- var l, n;
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 = o.timezone ? F(t(g)[1], u.value) : (n = t(g)) == null ? void 0 : n[1];
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
- }), U = y(() => t(s) ? o.picker ?? re[o.format] : o.picker), j = y(() => {
176
- const e = t(s) ? le[o.format] : {};
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
- ...ce(_(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
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 H(e) {
187
+ function K(e) {
185
188
  if (!e) {
186
- O(e);
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
- O([p(a, l), p(r, l, !1)]);
194
+ M([p(a, l), p(r, l, !1)]);
192
195
  }
193
- function K(e) {
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, n = e[0] ? p(a, l) : null, m = e[1] ? p(r, l, !1) : null;
196
- (c = o.onOk) == null || c.call(o, [n, m]);
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 $(e, a) {
205
+ function L(e, a) {
199
206
  var b, A;
200
207
  if (w(e)) {
201
- (b = o.onChange) == null || b.call(o, e, a);
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], n = t(s) ? t(f) : void 0, m = e[0] ? p(r, n) : null, c = e[1] ? p(l, n, !1) : null;
205
- (A = o.onChange) == null || A.call(o, [m, c], 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 G = y(() => {
214
+ const W = y(() => {
208
215
  var r;
209
- const e = o.readModeSeparator;
216
+ const e = n.readModeSeparator;
210
217
  if (e)
211
- return Y(e) || ue(e) ? o.readModeSeparator : M(v, null, [o.readModeSeparator]);
212
- const a = (r = T.readModeSeparator) == null ? void 0 : r.call(T);
213
- return a ? M(v, null, [a]) : me;
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(P((r = S.value[0]) == null ? void 0 : r.format(f.value)) + " ", 1), (d(), C(Z(G.value))), B(" " + P((l = S.value[1]) == null ? void 0 : l.format(f.value)), 1)], 64)) : (d(), k(v, {
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(P(e.emptyText), 1)], 64))], 64)) : (d(), C(t(de), {
230
+ }, [C(B(e.emptyText), 1)], 64))], 64)) : (d(), P(t(se), {
224
231
  key: 1,
225
232
  compact: "",
226
- style: q({
227
- display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
233
+ style: Q({
234
+ display: Array.isArray(n.timezone) && n.timezone.length ? "flex" : "block"
228
235
  })
229
236
  }, {
230
- default: D(() => [Array.isArray(o.timezone) && o.timezone.length ? (d(), C(t(ie), {
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] = (n) => J(u) ? u.value = n : null),
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(o.timezone, (n) => (d(), C(t(se), {
238
- key: n == null ? void 0 : n.value,
239
- value: n == null ? void 0 : n.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(P((n == null ? void 0 : n.label) ?? (n == null ? void 0 : n.value)), 1)]),
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"])) : Q("", !0), M(t(fe).RangePicker, X(j.value, {
252
+ }, 8, ["value"])) : z("", !0), T(t(me).RangePicker, ee(H.value, {
246
253
  value: S.value,
247
- picker: U.value,
254
+ picker: j.value,
248
255
  format: f.value,
249
- "onUpdate:value": H,
250
- onChange: $,
251
- onOk: K
252
- }), z({
256
+ "onUpdate:value": K,
257
+ onChange: L,
258
+ onOk: $,
259
+ onOpenChange: G
260
+ }), ne({
253
261
  _: 2
254
- }, [R(t(_)(e.$slots, "readModeSeparator"), (n, m) => ({
262
+ }, [R(t(_)(e.$slots, "readModeSeparator"), (o, m) => ({
255
263
  name: m,
256
- fn: D((c) => [ee(e.$slots, m, oe(ne(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
- Fe as default
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
- }>) => ComputedRef<{
10
- label: VueNode;
11
- value: Dayjs[];
12
- }[] | undefined>;
9
+ }>) => {
10
+ presets: ComputedRef<{
11
+ label: VueNode;
12
+ value: Dayjs[];
13
+ }[] | undefined>;
14
+ changeCurrentDate: () => void;
15
+ };
@@ -1,15 +1,26 @@
1
- import { computed as f } from "vue";
2
- import { presetsDefault as n } from "../../utils/data-range-persets.mjs";
3
- const b = (e) => f(() => {
4
- var u, l, a;
5
- return e.presets === !0 ? n((u = e == null ? void 0 : e.timezone) == null ? void 0 : u.value) : (a = (l = e == null ? void 0 : e.presets) == null ? void 0 : l.map) == null ? void 0 : a.call(l, (t) => {
6
- var m;
7
- return {
8
- label: t.label,
9
- value: (m = t == null ? void 0 : t.value) == null ? void 0 : m.filter((r) => r !== null)
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
- b as useDefaultPresets
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"]>;