@aplus-frontend/ui 7.17.1-beta.0 → 7.17.2

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 (139) hide show
  1. package/es/index.mjs +29 -31
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +48 -48
  3. package/es/src/ap-field/cascader/index.vue.mjs +82 -130
  4. package/es/src/ap-field/cascader/read.vue2.mjs +36 -35
  5. package/es/src/ap-field/checkbox/index.vue.d.ts +18 -1
  6. package/es/src/ap-field/checkbox/index.vue.mjs +42 -43
  7. package/es/src/ap-field/checkbox/read.vue2.mjs +1 -1
  8. package/es/src/ap-field/date/index.vue.mjs +48 -48
  9. package/es/src/ap-field/date/read.vue2.mjs +1 -1
  10. package/es/src/ap-field/date-range/index.vue.mjs +31 -31
  11. package/es/src/ap-field/date-range/read.vue2.mjs +1 -1
  12. package/es/src/ap-field/interface.d.ts +13 -23
  13. package/es/src/ap-field/number/index.vue.mjs +36 -34
  14. package/es/src/ap-field/number/read.vue2.mjs +1 -1
  15. package/es/src/ap-field/radio/index.vue.mjs +34 -42
  16. package/es/src/ap-field/radio/read.vue2.mjs +1 -1
  17. package/es/src/ap-field/rate/index.vue.mjs +23 -23
  18. package/es/src/ap-field/second/index.vue.mjs +27 -29
  19. package/es/src/ap-field/second/read.vue2.mjs +2 -2
  20. package/es/src/ap-field/segmented/index.vue.mjs +37 -37
  21. package/es/src/ap-field/select/index.vue.d.ts +1 -1
  22. package/es/src/ap-field/select/index.vue.mjs +147 -136
  23. package/es/src/ap-field/select/read.vue2.mjs +2 -1
  24. package/es/src/ap-field/slider/index.vue.mjs +35 -37
  25. package/es/src/ap-field/switch/index.vue.mjs +38 -38
  26. package/es/src/ap-field/switch/read.vue2.mjs +3 -3
  27. package/es/src/ap-field/text/index.vue.d.ts +478 -3
  28. package/es/src/ap-field/text/index.vue2.mjs +47 -46
  29. package/es/src/ap-field/text/password.vue.d.ts +549 -3
  30. package/es/src/ap-field/text/password.vue.mjs +61 -56
  31. package/es/src/ap-field/text/read-password.vue2.mjs +16 -16
  32. package/es/src/ap-field/text/read.vue2.mjs +1 -1
  33. package/es/src/ap-field/text-area/index.vue.mjs +29 -31
  34. package/es/src/ap-field/text-area/read.vue2.mjs +1 -1
  35. package/es/src/ap-field/tree-select/index.vue.mjs +47 -47
  36. package/es/src/ap-field/tree-select/read.vue2.mjs +3 -3
  37. package/es/src/ap-form/drawer-form/index.vue.mjs +99 -90
  38. package/es/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  39. package/es/src/ap-form/hooks/use-regist-form.mjs +24 -0
  40. package/es/src/ap-form/interface.d.ts +18 -0
  41. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  42. package/es/src/ap-form/item/index.vue.mjs +85 -94
  43. package/es/src/ap-form/item-group/index.vue.mjs +14 -14
  44. package/es/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  45. package/es/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  46. package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
  47. package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  48. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  49. package/es/src/ap-form/items/select/index.vue.d.ts +10 -8
  50. package/es/src/ap-form/items/switch/index.vue.d.ts +3 -3
  51. package/es/src/ap-form/items/text/index.vue.d.ts +476 -4
  52. package/es/src/ap-form/items/text/password.vue.d.ts +547 -4
  53. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  54. package/es/src/ap-form/list/index.vue.mjs +29 -34
  55. package/es/src/ap-form/modal-form/index.vue.mjs +77 -68
  56. package/es/src/ap-form/set/index.vue.d.ts +2 -4
  57. package/es/src/ap-form/set/index.vue.mjs +23 -18
  58. package/es/src/ap-grid/index.vue.mjs +1 -1
  59. package/es/src/ap-table/constants.d.ts +600 -37
  60. package/es/src/ap-table/utils.d.ts +1 -1
  61. package/es/src/business/batch-input-group/index.vue.d.ts +240 -3
  62. package/es/src/business/batch-input-group/index.vue.mjs +1 -1
  63. package/es/src/check-card/index.vue2.mjs +61 -64
  64. package/es/src/hooks/index.d.ts +0 -1
  65. package/es/src/hooks/index.mjs +10 -12
  66. package/es/src/version.d.ts +1 -1
  67. package/es/src/version.mjs +1 -1
  68. package/lib/index.js +1 -1
  69. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  70. package/lib/src/ap-field/cascader/index.vue.js +1 -1
  71. package/lib/src/ap-field/cascader/read.vue2.js +1 -1
  72. package/lib/src/ap-field/checkbox/index.vue.d.ts +18 -1
  73. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  74. package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
  75. package/lib/src/ap-field/date/index.vue.js +1 -1
  76. package/lib/src/ap-field/date/read.vue2.js +1 -1
  77. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  78. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  79. package/lib/src/ap-field/interface.d.ts +13 -23
  80. package/lib/src/ap-field/number/index.vue.js +1 -1
  81. package/lib/src/ap-field/number/read.vue2.js +1 -1
  82. package/lib/src/ap-field/radio/index.vue.js +1 -1
  83. package/lib/src/ap-field/radio/read.vue2.js +1 -1
  84. package/lib/src/ap-field/rate/index.vue.js +1 -1
  85. package/lib/src/ap-field/second/index.vue.js +1 -1
  86. package/lib/src/ap-field/second/read.vue2.js +1 -1
  87. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  88. package/lib/src/ap-field/select/index.vue.d.ts +1 -1
  89. package/lib/src/ap-field/select/index.vue.js +1 -1
  90. package/lib/src/ap-field/select/read.vue2.js +1 -1
  91. package/lib/src/ap-field/slider/index.vue.js +1 -1
  92. package/lib/src/ap-field/switch/index.vue.js +1 -1
  93. package/lib/src/ap-field/switch/read.vue2.js +1 -1
  94. package/lib/src/ap-field/text/index.vue.d.ts +478 -3
  95. package/lib/src/ap-field/text/index.vue2.js +1 -1
  96. package/lib/src/ap-field/text/password.vue.d.ts +549 -3
  97. package/lib/src/ap-field/text/password.vue.js +1 -1
  98. package/lib/src/ap-field/text/read-password.vue2.js +1 -1
  99. package/lib/src/ap-field/text/read.vue2.js +1 -1
  100. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  101. package/lib/src/ap-field/text-area/read.vue2.js +1 -1
  102. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  103. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  104. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  105. package/lib/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  106. package/lib/src/ap-form/hooks/use-regist-form.js +1 -0
  107. package/lib/src/ap-form/interface.d.ts +18 -0
  108. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  109. package/lib/src/ap-form/item/index.vue.js +1 -1
  110. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  111. package/lib/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  112. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  113. package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
  114. package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  115. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  116. package/lib/src/ap-form/items/select/index.vue.d.ts +10 -8
  117. package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -3
  118. package/lib/src/ap-form/items/text/index.vue.d.ts +476 -4
  119. package/lib/src/ap-form/items/text/password.vue.d.ts +547 -4
  120. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  121. package/lib/src/ap-form/list/index.vue.js +1 -1
  122. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  123. package/lib/src/ap-form/set/index.vue.d.ts +2 -4
  124. package/lib/src/ap-form/set/index.vue.js +1 -1
  125. package/lib/src/ap-grid/index.vue.js +1 -1
  126. package/lib/src/ap-table/constants.d.ts +600 -37
  127. package/lib/src/ap-table/utils.d.ts +1 -1
  128. package/lib/src/business/batch-input-group/index.vue.d.ts +240 -3
  129. package/lib/src/business/batch-input-group/index.vue.js +1 -1
  130. package/lib/src/check-card/index.vue2.js +1 -1
  131. package/lib/src/hooks/index.d.ts +0 -1
  132. package/lib/src/hooks/index.js +1 -1
  133. package/lib/src/version.d.ts +1 -1
  134. package/lib/src/version.js +1 -1
  135. package/package.json +1 -1
  136. package/es/src/hooks/useMessage.d.ts +0 -62
  137. package/es/src/hooks/useMessage.mjs +0 -86
  138. package/lib/src/hooks/useMessage.d.ts +0 -62
  139. package/lib/src/hooks/useMessage.js +0 -1
@@ -1,10 +1,9 @@
1
- import { isVNode as g, defineComponent as C, computed as b, createVNode as d, Fragment as c, createBlock as w, openBlock as x, resolveDynamicComponent as B } from "vue";
1
+ import { defineComponent as C, computed as w, unref as m, createElementBlock as d, createBlock as B, openBlock as p, toDisplayString as f, withCtx as x, Fragment as b, renderList as v } from "vue";
2
2
  import { Space as N } from "@aplus-frontend/antdv";
3
- import { isArray as v } from "lodash-unified";
4
- function S(o) {
5
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !g(o);
6
- }
7
- const P = /* @__PURE__ */ C({
3
+ import { isArray as S } from "lodash-unified";
4
+ const T = {
5
+ key: 0
6
+ }, R = /* @__PURE__ */ C({
8
7
  name: "ApFieldCascaderRead",
9
8
  __name: "read",
10
9
  props: {
@@ -13,6 +12,9 @@ const P = /* @__PURE__ */ C({
13
12
  },
14
13
  class: {},
15
14
  style: {},
15
+ emptyText: {
16
+ default: "--"
17
+ },
16
18
  multiple: {
17
19
  type: Boolean
18
20
  },
@@ -112,9 +114,6 @@ const P = /* @__PURE__ */ C({
112
114
  dropdownPrefixCls: {},
113
115
  dropdownMenuColumnStyle: {},
114
116
  loadingIcon: {},
115
- emptyText: {
116
- default: "--"
117
- },
118
117
  request: {},
119
118
  lazy: {
120
119
  type: Boolean
@@ -124,36 +123,38 @@ const P = /* @__PURE__ */ C({
124
123
  type: Boolean
125
124
  }
126
125
  },
127
- setup(o) {
128
- const e = o, u = b(() => {
129
- let p;
130
- const n = e.value;
131
- if (!n.length)
132
- return d(c, null, [e.emptyText]);
133
- const i = [], m = e.fieldNames?.label || "label", f = e.fieldNames?.value || "value";
134
- function s(t, a) {
135
- const l = [];
136
- for (const r of t) {
137
- if (a.find((h) => h === r[f]) && l.push(r[m]), l.length === a.length)
138
- return l;
139
- r.children?.length && l.push(...s(r.children, a));
126
+ setup(h) {
127
+ const a = h, i = w(() => {
128
+ const e = m(a.value);
129
+ if (!e?.length) return [];
130
+ const u = a.fieldNames?.label || "label", r = a.fieldNames?.value || "value";
131
+ function t(s, o) {
132
+ const n = [];
133
+ for (const l of s || []) {
134
+ if (o.find((g) => g === l[r]) && n.push(l[u]), n.length === o.length)
135
+ return n;
136
+ l.children?.length && n.push(...t(l.children, o));
140
137
  }
141
- return l;
138
+ return n;
139
+ }
140
+ const c = [], y = S(e[0]) ? e : [e];
141
+ for (const s of y) {
142
+ const o = t(a.options, s);
143
+ o.length && c.push(o);
142
144
  }
143
- const y = v(n[0]) ? n : [n];
144
- for (const t of y)
145
- i.push(s(e.options, t));
146
- return i.length ? d(N, {
147
- size: 4
148
- }, S(p = i.map((t, a) => d("span", {
149
- key: a
150
- }, [t.join(", ")]))) ? p : {
151
- default: () => [p]
152
- }) : d(c, null, [e.emptyText]);
145
+ return c;
153
146
  });
154
- return (p, n) => (x(), w(B(u.value)));
147
+ return (e, u) => i.value.length ? (p(), B(m(N), {
148
+ key: 1,
149
+ size: 4
150
+ }, {
151
+ default: x(() => [(p(!0), d(b, null, v(i.value, (r, t) => (p(), d("span", {
152
+ key: t
153
+ }, f(r.join(", ")), 1))), 128))]),
154
+ _: 1
155
+ })) : (p(), d("span", T, f(e.emptyText), 1));
155
156
  }
156
157
  });
157
158
  export {
158
- P as default
159
+ R as default
159
160
  };
@@ -2,7 +2,18 @@ import { ApFieldCheckboxProps } from '../interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  import { FieldMode } from '..';
4
4
  import { CheckboxOptionType } from '@aplus-frontend/antdv';
5
- declare const _default: DefineComponent<ApFieldCheckboxProps, {
5
+ type CheckboxGroupSlots = {
6
+ label?: any;
7
+ default?: any;
8
+ };
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: Readonly<CheckboxGroupSlots> & CheckboxGroupSlots;
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: DefineComponent<ApFieldCheckboxProps, {
6
17
  request: () => void;
7
18
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
19
  "update:value": (...args: any[]) => void;
@@ -14,4 +25,10 @@ declare const _default: DefineComponent<ApFieldCheckboxProps, {
14
25
  options: (string | number | CheckboxOptionType)[];
15
26
  emptyText: string;
16
27
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
29
  export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -1,14 +1,14 @@
1
- import { defineComponent as V, ref as q, onMounted as B, createElementBlock as l, openBlock as o, Fragment as n, unref as e, createTextVNode as m, toDisplayString as d, createBlock as c, mergeProps as O } from "vue";
2
- import { Spin as T, CheckboxGroup as U } from "@aplus-frontend/antdv";
3
- import { isFunction as _, isNil as F, omit as N } from "lodash-unified";
1
+ import { defineComponent as O, computed as T, useSlots as _, ref as P, onMounted as U, createElementBlock as r, openBlock as o, Fragment as s, unref as e, createTextVNode as d, toDisplayString as c, createBlock as f, mergeProps as F, createSlots as N, renderList as z, withCtx as A, renderSlot as L, normalizeProps as j, guardReactiveProps as w } from "vue";
2
+ import { Spin as D, CheckboxGroup as E } from "@aplus-frontend/antdv";
3
+ import { omit as G, isFunction as I, isNil as M } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import S from "../hooks/use-options.mjs";
7
- import A from "../style/index.mjs";
8
- import { getOptionValue as j, getOptionLabel as z } from "./helper.mjs";
9
- import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
11
- const W = /* @__PURE__ */ V({
6
+ import R from "../hooks/use-options.mjs";
7
+ import $ from "../style/index.mjs";
8
+ import { getOptionValue as H, getOptionLabel as J } from "./helper.mjs";
9
+ import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useControllableValue as Q } from "../../hooks/useControllableValue.mjs";
11
+ const ne = /* @__PURE__ */ O({
12
12
  name: "ApFieldCheckbox",
13
13
  inheritAttrs: !1,
14
14
  __name: "index",
@@ -16,6 +16,7 @@ const W = /* @__PURE__ */ V({
16
16
  mode: { default: "edit" },
17
17
  class: {},
18
18
  style: {},
19
+ emptyText: { default: "--" },
19
20
  defaultValue: {},
20
21
  value: {},
21
22
  onChange: {},
@@ -25,60 +26,58 @@ const W = /* @__PURE__ */ V({
25
26
  options: { default: () => [] },
26
27
  disabled: { type: Boolean, default: void 0 },
27
28
  id: {},
28
- emptyText: { default: "--" },
29
29
  request: {},
30
30
  vertical: { type: Boolean }
31
31
  },
32
32
  emits: ["update:value"],
33
- setup(f, { expose: v, emit: y }) {
34
- const k = y, t = f, { options: u, updateOptions: x } = S(t), { b: h, m: b } = D("field-checkbox"), g = A("field"), r = q(!1);
33
+ setup(v, { expose: y, emit: k }) {
34
+ const x = k, t = v, h = T(
35
+ () => G(t, ["onUpdate:value", "value", "request", "vertical", "emptyText"])
36
+ ), g = _(), { options: u, updateOptions: b } = R(t), { b: C, m: S } = K("field-checkbox"), V = $("field"), n = P(!1);
35
37
  async function p() {
36
- if (_(t.request))
37
- return r.value = !0, t.request().then((a) => x(a)).finally(() => {
38
- r.value = !1;
38
+ if (I(t.request))
39
+ return n.value = !0, t.request().then((a) => b(a)).finally(() => {
40
+ n.value = !1;
39
41
  });
40
42
  }
41
- B(() => {
43
+ U(() => {
42
44
  p();
43
45
  });
44
- const { value: i, updateValue: C } = E(
46
+ const { value: i, updateValue: q } = Q(
45
47
  t,
46
- k,
48
+ x,
47
49
  {
48
50
  defaultValue: []
49
51
  }
50
52
  );
51
- return v({
53
+ return y({
52
54
  request: p
53
- }), (a, G) => a.mode === "read" ? (o(), l(n, { key: 0 }, [
54
- e(F)(e(i)) ? (o(), l(n, { key: 0 }, [
55
- m(d(t.emptyText), 1)
56
- ], 64)) : (o(), l(n, { key: 1 }, [
57
- m(d(e(u)?.filter((s) => e(i).indexOf(e(j)(s)) > -1).map((s) => e(z)(s)).join("、") || t.emptyText), 1)
55
+ }), (a, W) => a.mode === "read" ? (o(), r(s, { key: 0 }, [
56
+ e(M)(e(i)) ? (o(), r(s, { key: 0 }, [
57
+ d(c(t.emptyText), 1)
58
+ ], 64)) : (o(), r(s, { key: 1 }, [
59
+ d(c(e(u)?.filter((l) => e(i).indexOf(e(H)(l)) > -1).map((l) => e(J)(l)).join("、") || t.emptyText), 1)
58
60
  ], 64))
59
- ], 64)) : (o(), l(n, { key: 1 }, [
60
- r.value ? (o(), c(e(T), {
61
+ ], 64)) : (o(), r(s, { key: 1 }, [
62
+ n.value ? (o(), f(e(D), {
61
63
  key: 0,
62
64
  size: "small"
63
- })) : (o(), c(e(U), O(
64
- { key: 1 },
65
- e(N)(t, [
66
- "onUpdate:value",
67
- "value",
68
- "request",
69
- "vertical",
70
- "emptyText"
71
- ]),
72
- {
73
- options: e(u),
74
- value: e(i),
75
- class: [e(h)(), a.vertical ? e(b)("vertical") : null, e(g)],
76
- "onUpdate:value": e(C)
77
- }
78
- ), null, 16, ["options", "value", "class", "onUpdate:value"]))
65
+ })) : (o(), f(e(E), F({ key: 1 }, h.value, {
66
+ options: e(u),
67
+ value: e(i),
68
+ class: [e(C)(), a.vertical ? e(S)("vertical") : null, e(V)],
69
+ "onUpdate:value": e(q)
70
+ }), N({ _: 2 }, [
71
+ z(g, (l, m) => ({
72
+ name: m,
73
+ fn: A((B) => [
74
+ L(a.$slots, m, j(w(B || {})))
75
+ ])
76
+ }))
77
+ ]), 1040, ["options", "value", "class", "onUpdate:value"]))
79
78
  ], 64));
80
79
  }
81
80
  });
82
81
  export {
83
- W as default
82
+ ne as default
84
83
  };
@@ -8,6 +8,7 @@ const g = /* @__PURE__ */ r({
8
8
  mode: { default: "edit" },
9
9
  class: {},
10
10
  style: {},
11
+ emptyText: { default: "--" },
11
12
  defaultValue: {},
12
13
  value: {},
13
14
  onChange: {},
@@ -17,7 +18,6 @@ const g = /* @__PURE__ */ r({
17
18
  options: { default: () => [] },
18
19
  disabled: { type: Boolean, default: void 0 },
19
20
  id: {},
20
- emptyText: { default: "--" },
21
21
  request: {},
22
22
  vertical: { type: Boolean }
23
23
  },
@@ -1,21 +1,22 @@
1
- import { defineComponent as j, ref as I, computed as r, unref as t, createElementBlock as B, createBlock as h, openBlock as i, Fragment as g, createTextVNode as b, toDisplayString as P, normalizeStyle as U, withCtx as s, createVNode as w, createCommentVNode as H, isRef as K, renderList as C, mergeProps as W, createSlots as $, renderSlot as G, normalizeProps as L, guardReactiveProps as Y } from "vue";
2
- import { InputGroup as Z, FormItemRest as q, Select as J, SelectOption as Q, DatePicker as X } from "@aplus-frontend/antdv";
3
- import { getTimeFormatToZone as ee } from "@aplus-frontend/utils";
1
+ import { defineComponent as I, useSlots as U, ref as H, computed as r, unref as t, createElementBlock as B, createBlock as h, openBlock as i, Fragment as g, createTextVNode as b, toDisplayString as P, normalizeStyle as K, withCtx as s, createVNode as w, createCommentVNode as W, isRef as G, renderList as C, mergeProps as L, createSlots as Y, renderSlot as Z, normalizeProps as $, guardReactiveProps as q } from "vue";
2
+ import { InputGroup as J, FormItemRest as Q, Select as X, SelectOption as ee, DatePicker as oe } from "@aplus-frontend/antdv";
3
+ import { getTimeFormatToZone as te } from "@aplus-frontend/utils";
4
4
  import u from "dayjs";
5
- import { isNil as O, omit as oe } from "lodash-unified";
5
+ import { isNil as S, omit as ae } from "lodash-unified";
6
6
  import "../../hooks/index.mjs";
7
- import { useDateTimezone as te } from "../hooks/use-date-timezone.mjs";
8
- import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
9
- import { ApFieldDatePresetFormats as ne, PRESET_FORMAT_MAP as S, PRESET_FORMAT_PICK_MAP as le, PRESET_FORMAT_TIME_MAP as re } from "./constant.mjs";
10
- import { formatDayWithTimezone as ue } from "./helper.mjs";
11
- import { useControllableValue as de } from "../../hooks/useControllableValue.mjs";
12
- const ge = /* @__PURE__ */ j({
7
+ import { useDateTimezone as ne } from "../hooks/use-date-timezone.mjs";
8
+ import { useDefaultPlaceholder as le } from "../hooks/use-default-placeholder.mjs";
9
+ import { ApFieldDatePresetFormats as re, PRESET_FORMAT_MAP as O, PRESET_FORMAT_PICK_MAP as ue, PRESET_FORMAT_TIME_MAP as de } from "./constant.mjs";
10
+ import { formatDayWithTimezone as ie } from "./helper.mjs";
11
+ import { useControllableValue as se } from "../../hooks/useControllableValue.mjs";
12
+ const Pe = /* @__PURE__ */ I({
13
13
  name: "ApFieldDate",
14
14
  __name: "index",
15
15
  props: {
16
16
  mode: { default: "edit" },
17
17
  class: {},
18
18
  style: {},
19
+ emptyText: { default: "--" },
19
20
  dropdownClassName: {},
20
21
  dropdownAlign: {},
21
22
  popupStyle: {},
@@ -80,7 +81,6 @@ const ge = /* @__PURE__ */ j({
80
81
  disabledMinutes: {},
81
82
  disabledSeconds: {},
82
83
  valueFormat: {},
83
- emptyText: { default: "--" },
84
84
  value: {},
85
85
  defaultValue: {},
86
86
  "onUpdate:value": {},
@@ -92,23 +92,23 @@ const ge = /* @__PURE__ */ j({
92
92
  timezone: {}
93
93
  },
94
94
  emits: ["update:value"],
95
- setup(T, { expose: F, emit: R }) {
96
- const e = T, _ = R, f = I(), { value: c, updateValue: k } = de(
95
+ setup(T, { expose: _, emit: F }) {
96
+ const R = U(), e = T, A = F, f = H(), { value: c, updateValue: k } = se(
97
97
  e,
98
- _
99
- ), A = ae("Date", e), { currentTimezone: d } = te(e), l = r(
100
- () => ne.indexOf(e.format) > -1
101
- ), M = r(() => e.shownFormat ? e.shownFormat : l.value ? S[e.format] : e.format), m = r(
102
- () => l.value ? S[e.format] : e.format
98
+ A
99
+ ), M = le("Date", e), { currentTimezone: d } = ne(e), l = r(
100
+ () => re.indexOf(e.format) > -1
101
+ ), x = r(() => e.shownFormat ? e.shownFormat : l.value ? O[e.format] : e.format), m = r(
102
+ () => l.value ? O[e.format] : e.format
103
103
  ), v = r(() => {
104
- if (O(t(c)))
104
+ if (S(t(c)))
105
105
  return;
106
106
  let o = u(t(c));
107
- return e.timezone && (o = u(ee(t(c), d.value))), o;
108
- }), D = r(() => t(l) ? e.picker ?? le[e.format] : e.picker), x = r(() => {
109
- const o = t(l) ? re[e.format] : {};
107
+ return e.timezone && (o = u(te(t(c), d.value))), o;
108
+ }), D = r(() => t(l) ? e.picker ?? ue[e.format] : e.picker), V = r(() => {
109
+ const o = t(l) ? de[e.format] : {};
110
110
  return {
111
- ...oe(e, [
111
+ ...ae(e, [
112
112
  "value",
113
113
  "defaultValue",
114
114
  "onChange",
@@ -117,12 +117,12 @@ const ge = /* @__PURE__ */ j({
117
117
  "onUpdate:value",
118
118
  "mode"
119
119
  ]),
120
- placeholder: t(A),
120
+ placeholder: t(M),
121
121
  ...o
122
122
  };
123
- }), y = (o, n, a = !0) => ue(d.value)(o, n, a);
124
- function V(o) {
125
- if (O(o)) {
123
+ }), y = (o, n, a = !0) => ie(d.value)(o, n, a);
124
+ function z(o) {
125
+ if (S(o)) {
126
126
  k(null);
127
127
  return;
128
128
  }
@@ -135,7 +135,7 @@ const ge = /* @__PURE__ */ j({
135
135
  )
136
136
  );
137
137
  }
138
- function z(o, n) {
138
+ function E(o, n) {
139
139
  const a = u(o), p = o ? y(
140
140
  a,
141
141
  t(l) ? t(m) : void 0,
@@ -143,7 +143,7 @@ const ge = /* @__PURE__ */ j({
143
143
  ) : null;
144
144
  e.onChange?.(p, n);
145
145
  }
146
- function E(o) {
146
+ function N(o) {
147
147
  const n = u(o), a = o ? y(
148
148
  n,
149
149
  t(l) ? t(m) : void 0,
@@ -151,32 +151,32 @@ const ge = /* @__PURE__ */ j({
151
151
  ) : null;
152
152
  e.onOk?.(a);
153
153
  }
154
- return F({
154
+ return _({
155
155
  focus: () => f.value?.focus(),
156
156
  blur: () => f.value?.blur()
157
157
  }), (o, n) => o.mode === "read" ? (i(), B(g, { key: 0 }, [
158
158
  b(P(v.value ? t(u)(v.value).format(m.value) : o.emptyText), 1)
159
- ], 64)) : (i(), h(t(Z), {
159
+ ], 64)) : (i(), h(t(J), {
160
160
  key: 1,
161
161
  compact: "",
162
- style: U({
162
+ style: K({
163
163
  display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
164
164
  })
165
165
  }, {
166
166
  default: s(() => [
167
- w(t(q), null, {
167
+ w(t(Q), null, {
168
168
  default: s(() => [
169
- Array.isArray(e.timezone) && e.timezone.length ? (i(), h(t(J), {
169
+ Array.isArray(e.timezone) && e.timezone.length ? (i(), h(t(X), {
170
170
  key: 0,
171
171
  value: t(d),
172
- "onUpdate:value": n[0] || (n[0] = (a) => K(d) ? d.value = a : null),
172
+ "onUpdate:value": n[0] || (n[0] = (a) => G(d) ? d.value = a : null),
173
173
  "default-active-first-option": "",
174
174
  "dropdown-match-select-width": !1,
175
175
  style: { "max-width": "50%" },
176
176
  disabled: o.disabled
177
177
  }, {
178
178
  default: s(() => [
179
- (i(!0), B(g, null, C(e.timezone, (a) => (i(), h(t(Q), {
179
+ (i(!0), B(g, null, C(e.timezone, (a) => (i(), h(t(ee), {
180
180
  key: a?.value,
181
181
  value: a?.value
182
182
  }, {
@@ -187,25 +187,25 @@ const ge = /* @__PURE__ */ j({
187
187
  }, 1032, ["value"]))), 128))
188
188
  ]),
189
189
  _: 1
190
- }, 8, ["value", "disabled"])) : H("", !0)
190
+ }, 8, ["value", "disabled"])) : W("", !0)
191
191
  ]),
192
192
  _: 1
193
193
  }),
194
- w(t(X), W({
194
+ w(t(oe), L({
195
195
  ref_key: "datePickerRef",
196
196
  ref: f
197
- }, x.value, {
197
+ }, V.value, {
198
198
  value: v.value,
199
- format: M.value,
199
+ format: x.value,
200
200
  picker: D.value,
201
- "onUpdate:value": V,
202
- onChange: z,
203
- onOk: E
204
- }), $({ _: 2 }, [
205
- C(o.$slots, (a, p) => ({
201
+ "onUpdate:value": z,
202
+ onChange: E,
203
+ onOk: N
204
+ }), Y({ _: 2 }, [
205
+ C(R, (a, p) => ({
206
206
  name: p,
207
- fn: s((N) => [
208
- G(o.$slots, p, L(Y(N || {})))
207
+ fn: s((j) => [
208
+ Z(o.$slots, p, $(q(j || {})))
209
209
  ])
210
210
  }))
211
211
  ]), 1040, ["value", "format", "picker"])
@@ -215,5 +215,5 @@ const ge = /* @__PURE__ */ j({
215
215
  }
216
216
  });
217
217
  export {
218
- ge as default
218
+ Pe as default
219
219
  };
@@ -11,6 +11,7 @@ const S = /* @__PURE__ */ u({
11
11
  mode: {},
12
12
  class: {},
13
13
  style: {},
14
+ emptyText: { default: "--" },
14
15
  dropdownClassName: {},
15
16
  dropdownAlign: {},
16
17
  popupStyle: {},
@@ -75,7 +76,6 @@ const S = /* @__PURE__ */ u({
75
76
  disabledMinutes: {},
76
77
  disabledSeconds: {},
77
78
  valueFormat: {},
78
- emptyText: { default: "--" },
79
79
  value: {},
80
80
  defaultValue: {},
81
81
  "onUpdate:value": {},
@@ -1,18 +1,18 @@
1
- import { defineComponent as Z, useSlots as q, ref as J, computed as s, unref as t, isVNode as Q, createVNode as D, Fragment as m, createElementBlock as g, createBlock as k, openBlock as u, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as X, normalizeStyle as ee, withCtx as P, createCommentVNode as oe, isRef as te, renderList as w, mergeProps as ne, createSlots as ae, renderSlot as re, normalizeProps as le, guardReactiveProps as ue } from "vue";
1
+ import { defineComponent as $, useSlots as q, ref as J, computed as s, unref as t, isVNode as Q, createVNode as D, Fragment as m, createElementBlock as g, createBlock as k, openBlock as u, createTextVNode as S, toDisplayString as C, resolveDynamicComponent as X, normalizeStyle as ee, withCtx as P, createCommentVNode as oe, isRef as te, renderList as T, mergeProps as ne, createSlots as ae, renderSlot as re, normalizeProps as le, guardReactiveProps as ue } from "vue";
2
2
  import { SwapRightOutlined as de } from "@ant-design/icons-vue";
3
3
  import { InputGroup as ie, Select as se, SelectOption as fe, DatePicker as pe } from "@aplus-frontend/antdv";
4
- import { getTimeFormatToZone as T } from "@aplus-frontend/utils";
4
+ import { getTimeFormatToZone as M } from "@aplus-frontend/utils";
5
5
  import d from "dayjs";
6
- import { isNil as M, omit as R, isString as c, isFunction as me } from "lodash-unified";
6
+ import { isNil as R, omit as A, isString as c, isFunction as me } from "lodash-unified";
7
7
  import "../../hooks/index.mjs";
8
8
  import { omitUndefined as ce } from "../../utils/index.mjs";
9
- import { ApFieldDatePresetFormats as ye, PRESET_FORMAT_MAP as A, PRESET_FORMAT_PICK_MAP as ve, PRESET_FORMAT_TIME_MAP as he } from "../date/constant.mjs";
9
+ import { ApFieldDatePresetFormats as ye, PRESET_FORMAT_MAP as _, PRESET_FORMAT_PICK_MAP as ve, PRESET_FORMAT_TIME_MAP as he } from "../date/constant.mjs";
10
10
  import { formatDayWithTimezone as ge } from "../date/helper.mjs";
11
11
  import { useDateTimezone as ke } from "../hooks/use-date-timezone.mjs";
12
12
  import { useDefaultPlaceholder as Se } from "../hooks/use-default-placeholder.mjs";
13
13
  import { useDefaultPresets as Ce } from "../hooks/use-default-presets.mjs";
14
14
  import { useControllableValue as Pe } from "../../hooks/useControllableValue.mjs";
15
- const Ee = /* @__PURE__ */ Z({
15
+ const Ee = /* @__PURE__ */ $({
16
16
  name: "ApFieldDateRange",
17
17
  __name: "index",
18
18
  props: {
@@ -21,6 +21,9 @@ const Ee = /* @__PURE__ */ Z({
21
21
  },
22
22
  class: {},
23
23
  style: {},
24
+ emptyText: {
25
+ default: "--"
26
+ },
24
27
  id: {},
25
28
  defaultPickerValue: {},
26
29
  placeholder: {},
@@ -142,9 +145,6 @@ const Ee = /* @__PURE__ */ Z({
142
145
  disabledMinutes: {},
143
146
  disabledSeconds: {},
144
147
  valueFormat: {},
145
- emptyText: {
146
- default: "--"
147
- },
148
148
  value: {},
149
149
  defaultValue: {},
150
150
  "onUpdate:value": {},
@@ -162,13 +162,13 @@ const Ee = /* @__PURE__ */ Z({
162
162
  },
163
163
  emits: ["update:value"],
164
164
  setup(F, {
165
- expose: _,
166
- emit: x
165
+ expose: x,
166
+ emit: z
167
167
  }) {
168
- const o = F, z = x, N = q(), B = J(), i = s(() => ye.indexOf(o.format) > -1), y = s(() => i.value ? A[o.format] : o.format), {
168
+ const o = F, N = z, b = q(), B = J(), i = s(() => ye.indexOf(o.format) > -1), y = s(() => i.value ? _[o.format] : o.format), {
169
169
  value: v,
170
- updateValue: b
171
- } = Pe(o, z), E = s(() => o.shownFormat ? o.shownFormat : i.value ? A[o.format] : o.format), V = Se("DateRange", o), {
170
+ updateValue: w
171
+ } = Pe(o, N), E = s(() => o.shownFormat ? o.shownFormat : i.value ? _[o.format] : o.format), V = Se("DateRange", o), {
172
172
  currentTimezone: l
173
173
  } = ke(o), {
174
174
  presets: j,
@@ -178,14 +178,14 @@ const Ee = /* @__PURE__ */ Z({
178
178
  timezone: l
179
179
  }), f = (e, a, n = !0) => ge(l.value)(e, a, n), h = s(() => {
180
180
  const e = t(v);
181
- if (M(e) || !e?.length)
181
+ if (R(e) || !e?.length)
182
182
  return e;
183
- const a = l.value ? T(t(v)[0], l.value) : t(v)?.[0], n = o.timezone ? T(t(v)[1], l.value) : t(v)?.[1];
183
+ const a = l.value ? M(t(v)[0], l.value) : t(v)?.[0], n = o.timezone ? M(t(v)[1], l.value) : t(v)?.[1];
184
184
  return [d(a), d(n)];
185
185
  }), U = s(() => t(i) ? o.picker ?? ve[o.format] : o.picker), H = s(() => {
186
186
  const e = t(i) ? he[o.format] : {};
187
187
  return {
188
- ...ce(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
188
+ ...ce(A(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
189
189
  placeholder: t(V),
190
190
  presets: t(j),
191
191
  ...e
@@ -193,43 +193,43 @@ const Ee = /* @__PURE__ */ Z({
193
193
  });
194
194
  function K(e) {
195
195
  if (!e) {
196
- b(e);
196
+ w(e);
197
197
  return;
198
198
  }
199
199
  let a = c(e[0]) ? d(e[0]) : e[0], n = c(e[1]) ? d(e[1]) : e[1];
200
200
  const r = t(i) ? t(y) : void 0;
201
- b([f(a, r), f(n, r, !1)]);
201
+ w([f(a, r), f(n, r, !1)]);
202
202
  }
203
203
  function W(e) {
204
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
205
  o.onOk?.([p, O]);
206
206
  }
207
- function $(e) {
207
+ function G(e) {
208
208
  e && I(), o.onOpenChange?.(e);
209
209
  }
210
- function G(e, a) {
211
- if (M(e)) {
210
+ function L(e, a) {
211
+ if (R(e)) {
212
212
  o.onChange?.(e, a);
213
213
  return;
214
214
  }
215
- const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(y) : void 0, O = e[0] ? f(n, p) : null, Y = e[1] ? f(r, p, !1) : null;
216
- o.onChange?.([O, Y], a);
215
+ const n = c(e[0]) ? d(e[0]) : e[0], r = c(e[1]) ? d(e[1]) : e[1], p = t(i) ? t(y) : void 0, O = e[0] ? f(n, p) : null, Z = e[1] ? f(r, p, !1) : null;
216
+ o.onChange?.([O, Z], a);
217
217
  }
218
- const L = s(() => {
218
+ const Y = s(() => {
219
219
  const e = o.readModeSeparator;
220
220
  if (e)
221
221
  return Q(e) || me(e) ? o.readModeSeparator : D(m, null, [o.readModeSeparator]);
222
- const a = N.readModeSeparator?.();
222
+ const a = b.readModeSeparator?.();
223
223
  return a ? D(m, null, [a]) : de;
224
224
  });
225
- return _({
225
+ return x({
226
226
  focus: B.value?.focus(),
227
227
  blur: B.value?.blur()
228
228
  }), (e, a) => e.mode === "read" ? (u(), g(m, {
229
229
  key: 0
230
230
  }, [h.value ? (u(), g(m, {
231
231
  key: 0
232
- }, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(X(L.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
232
+ }, [S(C(h.value[0]?.format(y.value)) + " ", 1), (u(), k(X(Y.value))), S(" " + C(h.value[1]?.format(y.value)), 1)], 64)) : (u(), g(m, {
233
233
  key: 1
234
234
  }, [S(C(e.emptyText), 1)], 64))], 64)) : (u(), k(t(ie), {
235
235
  key: 1,
@@ -245,7 +245,7 @@ const Ee = /* @__PURE__ */ Z({
245
245
  "default-active-first-option": "",
246
246
  "dropdown-match-select-width": !1
247
247
  }, {
248
- default: P(() => [(u(!0), g(m, null, w(o.timezone, (n) => (u(), k(t(fe), {
248
+ default: P(() => [(u(!0), g(m, null, T(o.timezone, (n) => (u(), k(t(fe), {
249
249
  key: n?.value,
250
250
  value: n?.value
251
251
  }, {
@@ -261,12 +261,12 @@ const Ee = /* @__PURE__ */ Z({
261
261
  picker: U.value,
262
262
  format: E.value,
263
263
  "onUpdate:value": K,
264
- onChange: G,
264
+ onChange: L,
265
265
  onOk: W,
266
- onOpenChange: $
266
+ onOpenChange: G
267
267
  }), ae({
268
268
  _: 2
269
- }, [w(t(R)(e.$slots, "readModeSeparator"), (n, r) => ({
269
+ }, [T(t(A)(b, "readModeSeparator"), (n, r) => ({
270
270
  name: r,
271
271
  fn: P((p) => [re(e.$slots, r, le(ue(p || {})))])
272
272
  }))]), 1040, ["value", "picker", "format"])]),
@@ -11,6 +11,7 @@ const M = /* @__PURE__ */ v({
11
11
  mode: {},
12
12
  class: {},
13
13
  style: {},
14
+ emptyText: { default: "--" },
14
15
  id: {},
15
16
  defaultPickerValue: {},
16
17
  placeholder: {},
@@ -76,7 +77,6 @@ const M = /* @__PURE__ */ v({
76
77
  disabledMinutes: {},
77
78
  disabledSeconds: {},
78
79
  valueFormat: {},
79
- emptyText: { default: "--" },
80
80
  value: {},
81
81
  defaultValue: {},
82
82
  "onUpdate:value": {},