@aplus-frontend/ui 0.0.35 → 0.0.37

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 (83) hide show
  1. package/es/index.mjs +16 -14
  2. package/es/src/ap-descriptions/ap-descriptions.vue.d.ts +27 -0
  3. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +97 -0
  4. package/es/src/ap-descriptions/ap-descriptions.vue2.mjs +5 -0
  5. package/es/src/ap-descriptions/formatter/index.d.ts +78 -0
  6. package/es/src/ap-descriptions/formatter/index.mjs +127 -0
  7. package/es/src/ap-descriptions/formatter/utils.d.ts +7 -0
  8. package/es/src/ap-descriptions/formatter/utils.mjs +6 -0
  9. package/es/src/ap-descriptions/help-message/index.vue.d.ts +23 -0
  10. package/es/src/ap-descriptions/help-message/index.vue.mjs +4 -0
  11. package/es/src/ap-descriptions/help-message/index.vue2.mjs +27 -0
  12. package/es/src/ap-descriptions/helper.d.ts +10 -0
  13. package/es/src/ap-descriptions/helper.mjs +24 -0
  14. package/es/src/ap-descriptions/index.d.ts +4 -0
  15. package/es/src/ap-descriptions/index.mjs +2 -0
  16. package/es/src/ap-descriptions/interface.d.ts +50 -0
  17. package/es/src/ap-descriptions/interface.mjs +1 -0
  18. package/es/src/ap-descriptions/style/ap-descriptions.css +57 -0
  19. package/es/src/ap-download/ap-download.vue.mjs +27 -21
  20. package/es/src/ap-field/date/index.vue.mjs +35 -33
  21. package/es/src/ap-field/date-range/index.vue.mjs +55 -53
  22. package/es/src/ap-field/hooks/use-default-placeholder.d.ts +16 -0
  23. package/es/src/ap-field/hooks/use-default-placeholder.mjs +25 -0
  24. package/es/src/ap-field/interface.d.ts +4 -3
  25. package/es/src/ap-field/number/index.vue.mjs +25 -23
  26. package/es/src/ap-field/select/index.vue.d.ts +2 -0
  27. package/es/src/ap-field/select/index.vue.mjs +63 -53
  28. package/es/src/ap-field/text/index.vue2.mjs +26 -24
  29. package/es/src/ap-field/text/password.vue.mjs +28 -26
  30. package/es/src/ap-field/text-area/index.vue.mjs +15 -13
  31. package/es/src/ap-table/constants.d.ts +9 -0
  32. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  33. package/es/src/config-provider/config-provider-props.mjs +6 -2
  34. package/es/src/config-provider/config-provider.d.ts +14 -1
  35. package/es/src/config-provider/config-provider.mjs +17 -16
  36. package/es/src/config-provider/constants.d.ts +3 -0
  37. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  38. package/es/src/config-provider/index.d.ts +20 -1
  39. package/es/src/index.d.ts +1 -0
  40. package/es/src/index.mjs +241 -238
  41. package/es/src/theme/ap-descriptions/ap-descriptions.css +57 -0
  42. package/lib/index.js +1 -1
  43. package/lib/src/ap-descriptions/ap-descriptions.vue.d.ts +27 -0
  44. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -0
  45. package/lib/src/ap-descriptions/ap-descriptions.vue2.js +1 -0
  46. package/lib/src/ap-descriptions/formatter/index.d.ts +78 -0
  47. package/lib/src/ap-descriptions/formatter/index.js +1 -0
  48. package/lib/src/ap-descriptions/formatter/utils.d.ts +7 -0
  49. package/lib/src/ap-descriptions/formatter/utils.js +1 -0
  50. package/lib/src/ap-descriptions/help-message/index.vue.d.ts +23 -0
  51. package/lib/src/ap-descriptions/help-message/index.vue.js +1 -0
  52. package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -0
  53. package/lib/src/ap-descriptions/helper.d.ts +10 -0
  54. package/lib/src/ap-descriptions/helper.js +1 -0
  55. package/lib/src/ap-descriptions/index.d.ts +4 -0
  56. package/lib/src/ap-descriptions/index.js +1 -0
  57. package/lib/src/ap-descriptions/interface.d.ts +50 -0
  58. package/lib/src/ap-descriptions/interface.js +1 -0
  59. package/lib/src/ap-descriptions/style/ap-descriptions.css +57 -0
  60. package/lib/src/ap-download/ap-download.vue.js +1 -1
  61. package/lib/src/ap-field/date/index.vue.js +1 -1
  62. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  63. package/lib/src/ap-field/hooks/use-default-placeholder.d.ts +16 -0
  64. package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -0
  65. package/lib/src/ap-field/interface.d.ts +4 -3
  66. package/lib/src/ap-field/number/index.vue.js +1 -1
  67. package/lib/src/ap-field/select/index.vue.d.ts +2 -0
  68. package/lib/src/ap-field/select/index.vue.js +1 -1
  69. package/lib/src/ap-field/text/index.vue2.js +1 -1
  70. package/lib/src/ap-field/text/password.vue.js +1 -1
  71. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  72. package/lib/src/ap-table/constants.d.ts +9 -0
  73. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  74. package/lib/src/config-provider/config-provider-props.js +1 -1
  75. package/lib/src/config-provider/config-provider.d.ts +14 -1
  76. package/lib/src/config-provider/config-provider.js +1 -1
  77. package/lib/src/config-provider/constants.d.ts +3 -0
  78. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  79. package/lib/src/config-provider/index.d.ts +20 -1
  80. package/lib/src/index.d.ts +1 -0
  81. package/lib/src/index.js +1 -1
  82. package/lib/src/theme/ap-descriptions/ap-descriptions.css +57 -0
  83. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ TODO:
3
+ 1.admin和aplus样式提成变量?
4
+ */
5
+ .aplus-ap-descriptions {
6
+ --ap-descriptions-item-padding-bottom: 24px;
7
+ --ap-descriptions-item-label-width: auto;
8
+ }
9
+ .aplus-ap-descriptions .ant-descriptions .ant-descriptions-view table {
10
+ table-layout: fixed;
11
+ }
12
+ .aplus-ap-descriptions .ant-descriptions td.ant-descriptions-item {
13
+ padding-bottom: var(--ap-descriptions-item-padding-bottom);
14
+ }
15
+ .aplus-ap-descriptions .ant-descriptions th.ant-descriptions-item {
16
+ padding-bottom: 8px;
17
+ }
18
+ .aplus-ap-descriptions .ant-descriptions .ant-descriptions-row:last-child .ant-descriptions-item {
19
+ padding-bottom: 0;
20
+ }
21
+ .aplus-ap-descriptions .ant-descriptions .ant-descriptions-item-label::after {
22
+ margin-inline: 4px 20px;
23
+ }
24
+ .aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-label {
25
+ justify-content: flex-end;
26
+ width: var(--ap-descriptions-item-label-width);
27
+ color: #999999;
28
+ }
29
+ .aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-label .ap-descriptions-item-content__help {
30
+ margin-left: 4px;
31
+ color: #34b77c;
32
+ font-size: 16px;
33
+ }
34
+ .aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-content {
35
+ color: #333333;
36
+ }
37
+ .aplus-ap-descriptions--admin .ant-descriptions-row .ant-descriptions-item-content .ap-descriptions-item-content__link {
38
+ color: #1890ff;
39
+ cursor: pointer;
40
+ }
41
+ .aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-label {
42
+ justify-content: flex-end;
43
+ width: var(--ap-descriptions-item-label-width);
44
+ color: #8896B0;
45
+ }
46
+ .aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-label .ap-descriptions-item-content__help {
47
+ margin-left: 4px;
48
+ color: #0070FF;
49
+ font-size: 16px;
50
+ }
51
+ .aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-content {
52
+ color: #182948;
53
+ }
54
+ .aplus-ap-descriptions--aplus .ant-descriptions-row .ant-descriptions-item-content .ap-descriptions-item-content__link {
55
+ color: #0070FF;
56
+ cursor: pointer;
57
+ }
@@ -1,10 +1,10 @@
1
- import { defineComponent as _, computed as n, onMounted as y, openBlock as z, createElementBlock as I, normalizeStyle as O, normalizeClass as i, createElementVNode as a, renderSlot as v, toDisplayString as B } from "vue";
1
+ import { defineComponent as y, computed as a, watch as _, openBlock as z, createElementBlock as I, normalizeStyle as O, normalizeClass as i, createElementVNode as n, renderSlot as v, toDisplayString as B } from "vue";
2
2
  import "../config-provider/index.mjs";
3
- import { useOssInit as M, useOss as N } from "./hooks/index.mjs";
3
+ import { useOssInit as N, useOss as k } from "./hooks/index.mjs";
4
4
  import "./style/ap-download.css";
5
- import { useGlobalConfig as k } from "../config-provider/hooks/use-global-config.mjs";
6
- import { useNamespace as A } from "../config-provider/hooks/use-namespace.mjs";
7
- const F = { class: "icon" }, W = { class: "text" }, q = /* @__PURE__ */ _({
5
+ import { useGlobalConfig as A } from "../config-provider/hooks/use-global-config.mjs";
6
+ import { useNamespace as F } from "../config-provider/hooks/use-namespace.mjs";
7
+ const M = { class: "icon" }, W = { class: "text" }, j = /* @__PURE__ */ y({
8
8
  name: "ApDownload",
9
9
  __name: "ap-download",
10
10
  props: {
@@ -16,41 +16,47 @@ const F = { class: "icon" }, W = { class: "text" }, q = /* @__PURE__ */ _({
16
16
  getOssAccess: {}
17
17
  },
18
18
  setup(l) {
19
- const t = l, p = k("uiMode"), { b: o, bm: s } = A("download");
20
- function c(e, r) {
19
+ const t = l, p = A("uiMode"), { b: r, bm: s } = F("download");
20
+ function c(e, o) {
21
21
  e.length === 4 && (e = `#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);
22
- const w = parseInt(e.slice(1, 3), 16), S = parseInt(e.slice(3, 5), 16), $ = parseInt(e.slice(5, 7), 16), b = Math.round(r * 255).toString(16).padStart(2, "0");
23
- return `#${w.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${$.toString(16).padStart(2, "0")}${b}`;
22
+ const w = parseInt(e.slice(1, 3), 16), S = parseInt(e.slice(3, 5), 16), b = parseInt(e.slice(5, 7), 16), $ = Math.round(o * 255).toString(16).padStart(2, "0");
23
+ return `#${w.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}${$}`;
24
24
  }
25
- const d = n(() => ({
25
+ const d = a(() => ({
26
26
  "--download-main-color": t.color,
27
27
  "--download-main-color-opacity": c(t.color, 0.6)
28
- })), u = n(() => [o("wrapper"), s("wrapper", t.size)].filter(Boolean)), m = n(() => {
29
- const e = [o("inner-wrapper"), s("inner-wrapper", t.size)];
28
+ })), u = a(() => [r("wrapper"), s("wrapper", t.size)].filter(Boolean)), m = a(() => {
29
+ const e = [r("inner-wrapper"), s("inner-wrapper", t.size)];
30
30
  return t.disabled && (p.value === "aplus" ? e.push(s("inner-wrapper", "disabled")) : e.push(s("inner-wrapper", "disabled-admin"))), e;
31
31
  });
32
- y(() => {
33
- t.disabled || M(t.getOssAccess);
34
- });
35
- const { client: f } = N(), g = () => {
32
+ _(
33
+ () => t.disabled,
34
+ () => {
35
+ t.disabled || N(t.getOssAccess);
36
+ },
37
+ {
38
+ flush: "sync"
39
+ }
40
+ );
41
+ const { client: f } = k(), g = () => {
36
42
  t.disabled || f.downloadFile(t.fileName);
37
43
  };
38
- return (e, r) => (z(), I("span", {
44
+ return (e, o) => (z(), I("span", {
39
45
  style: O(d.value),
40
46
  class: i(u.value),
41
47
  onClick: g
42
48
  }, [
43
- a("span", {
49
+ n("span", {
44
50
  class: i(m.value)
45
51
  }, [
46
- a("span", F, [
52
+ n("span", M, [
47
53
  v(e.$slots, "icon")
48
54
  ]),
49
- a("span", W, B(e.text), 1)
55
+ n("span", W, B(e.text), 1)
50
56
  ], 2)
51
57
  ], 6));
52
58
  }
53
59
  });
54
60
  export {
55
- q as default
61
+ j as default
56
62
  };
@@ -1,13 +1,14 @@
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";
1
+ import { defineComponent as b, computed as i, unref as t, openBlock as v, createElementBlock as _, Fragment as w, createTextVNode as M, toDisplayString as R, createBlock as F, mergeProps as A, createSlots as D, renderList as x, withCtx as E, renderSlot as V, normalizeProps as z, guardReactiveProps as N } from "vue";
2
2
  import r from "dayjs";
3
- import { DatePicker as N } from "ant-design-vue";
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";
3
+ import { DatePicker as j } from "ant-design-vue";
4
+ import { ApFieldDatePresetFormats as I, PRESET_FORMAT_MAP as H, PRESET_FORMAT_PICK_MAP as U, PRESET_FORMAT_TIME_MAP as K } from "./constant.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { isNil as y, omit as K } from "lodash-unified";
7
- import { formatDayWithTimezone as $ } from "./helper.mjs";
8
- import { getTimeFormatToZone as L } from "@aplus-frontend/utils";
9
- import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
10
- const te = /* @__PURE__ */ S({
6
+ import { isNil as y, omit as $ } from "lodash-unified";
7
+ import { formatDayWithTimezone as L } from "./helper.mjs";
8
+ import { getTimeFormatToZone as W } from "@aplus-frontend/utils";
9
+ import { useDefaultPlaceholder as Y } from "../hooks/use-default-placeholder.mjs";
10
+ import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
11
+ const le = /* @__PURE__ */ b({
11
12
  name: "ApFieldDate",
12
13
  __name: "index",
13
14
  props: {
@@ -86,19 +87,19 @@ const te = /* @__PURE__ */ S({
86
87
  },
87
88
  emits: ["update:value"],
88
89
  setup(h, { emit: B }) {
89
- const e = h, k = B, { value: m, updateValue: p } = W(e, k), l = i(
90
- () => j.indexOf(e.format) > -1
90
+ const e = h, k = B, { value: p, updateValue: m } = Z(e, k), P = Y("Date", e), l = i(
91
+ () => I.indexOf(e.format) > -1
91
92
  ), d = i(
92
- () => l.value ? I[e.format] : e.format
93
+ () => l.value ? H[e.format] : e.format
93
94
  ), f = i(() => {
94
- if (y(t(m)))
95
+ if (y(t(p)))
95
96
  return;
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
- const o = t(l) ? U[e.format] : {};
97
+ let o = r(t(p));
98
+ return e.timezone && (o = r(W(t(p), e.timezone))), o;
99
+ }), g = i(() => t(l) ? e.picker ?? U[e.format] : e.picker), O = i(() => {
100
+ const o = t(l) ? K[e.format] : {};
100
101
  return {
101
- ...K(e, [
102
+ ...$(e, [
102
103
  "value",
103
104
  "defaultValue",
104
105
  "onChange",
@@ -107,46 +108,47 @@ const te = /* @__PURE__ */ S({
107
108
  "onUpdate:value",
108
109
  "mode"
109
110
  ]),
111
+ placeholder: t(P),
110
112
  ...o
111
113
  };
112
- }), c = $(e.timezone);
113
- function P(o) {
114
+ }), c = L(e.timezone);
115
+ function C(o) {
114
116
  if (y(o)) {
115
- p(null);
117
+ m(null);
116
118
  return;
117
119
  }
118
120
  const a = r(o);
119
- t(l) ? p(c(a, t(d))) : p(a.valueOf());
121
+ t(l) ? m(c(a, t(d))) : m(a.valueOf());
120
122
  }
121
- function C(o, a) {
123
+ function T(o, a) {
122
124
  var s;
123
125
  const u = r(o), n = o ? t(l) ? c(u, t(d)) : u.valueOf() : null;
124
126
  (s = e.onChange) == null || s.call(e, n, a);
125
127
  }
126
- function T(o) {
128
+ function S(o) {
127
129
  var n;
128
130
  const a = r(o), u = o ? t(l) ? c(a, t(d)) : a.valueOf() : null;
129
131
  (n = e.onOk) == null || n.call(e, u);
130
132
  }
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, {
133
+ return (o, a) => o.mode === "read" ? (v(), _(w, { key: 0 }, [
134
+ M(R(f.value ? t(r)(f.value).format(d.value) : o.emptyText), 1)
135
+ ], 64)) : (v(), F(t(j), A({ key: 1 }, O.value, {
134
136
  value: f.value,
135
137
  format: d.value,
136
- "onUpdate:value": P,
137
- onChange: C,
138
- onOk: T,
138
+ "onUpdate:value": C,
139
+ onChange: T,
140
+ onOk: S,
139
141
  picker: g.value
140
- }), A({ _: 2 }, [
142
+ }), D({ _: 2 }, [
141
143
  x(o.$slots, (u, n) => ({
142
144
  name: n,
143
- fn: D((s) => [
144
- E(o.$slots, n, V(z(s || {})))
145
+ fn: E((s) => [
146
+ V(o.$slots, n, z(N(s || {})))
145
147
  ])
146
148
  }))
147
149
  ]), 1040, ["value", "format", "picker"]));
148
150
  }
149
151
  });
150
152
  export {
151
- te as default
153
+ le as default
152
154
  };
@@ -1,15 +1,16 @@
1
- import { defineComponent as x, computed as c, unref as t, openBlock as g, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as C, renderSlot as T, createVNode as V, createBlock as I, mergeProps as j, createSlots as U, renderList as H, withCtx as $, normalizeProps as K, guardReactiveProps as L } from "vue";
2
- import { ApFieldDatePresetFormats as W, PRESET_FORMAT_MAP as Y, PRESET_FORMAT_PICK_MAP as Z, PRESET_FORMAT_TIME_MAP as q } from "../date/constant.mjs";
1
+ import { defineComponent as V, computed as c, unref as t, openBlock as h, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as P, renderSlot as T, createVNode as I, createBlock as j, mergeProps as U, createSlots as H, renderList as $, withCtx as K, normalizeProps as L, guardReactiveProps as W } from "vue";
2
+ import { ApFieldDatePresetFormats as Y, PRESET_FORMAT_MAP as Z, PRESET_FORMAT_PICK_MAP as q, PRESET_FORMAT_TIME_MAP as G } from "../date/constant.mjs";
3
3
  import "../../hooks/index.mjs";
4
- import { isNil as S, omit as b, isString as f } from "lodash-unified";
5
- import u from "dayjs";
6
- import { DatePicker as G } from "ant-design-vue";
7
- import { formatDayWithTimezone as J, formatValue as D } from "../date/helper.mjs";
8
- import { SwapRightOutlined as Q } from "@ant-design/icons-vue";
9
- import { omitUndefined as X } from "../../utils/index.mjs";
10
- import { getTimeFormatToZone as M } from "@aplus-frontend/utils";
11
- import { useControllableValue as ee } from "../../hooks/useControllableValue.mjs";
12
- const fe = /* @__PURE__ */ x({
4
+ import { isNil as D, omit as S, isString as f } from "lodash-unified";
5
+ import i from "dayjs";
6
+ import { DatePicker as J } from "ant-design-vue";
7
+ import { formatDayWithTimezone as Q, formatValue as b } from "../date/helper.mjs";
8
+ import { SwapRightOutlined as X } from "@ant-design/icons-vue";
9
+ import { omitUndefined as ee } from "../../utils/index.mjs";
10
+ import { getTimeFormatToZone as R } from "@aplus-frontend/utils";
11
+ import { useDefaultPlaceholder as oe } from "../hooks/use-default-placeholder.mjs";
12
+ import { useControllableValue as te } from "../../hooks/useControllableValue.mjs";
13
+ const ve = /* @__PURE__ */ V({
13
14
  __name: "index",
14
15
  props: {
15
16
  mode: { default: "edit" },
@@ -88,26 +89,26 @@ const fe = /* @__PURE__ */ x({
88
89
  timezone: {}
89
90
  },
90
91
  emits: ["update:value"],
91
- setup(R, { emit: w }) {
92
- const o = R, _ = w, i = c(
93
- () => W.indexOf(o.format) > -1
92
+ setup(M, { emit: w }) {
93
+ const o = M, _ = w, u = c(
94
+ () => Y.indexOf(o.format) > -1
94
95
  ), r = c(
95
- () => i.value ? Y[o.format] : o.format
96
- ), { value: p, updateValue: h } = ee(
96
+ () => u.value ? Z[o.format] : o.format
97
+ ), { value: p, updateValue: g } = te(
97
98
  o,
98
99
  _
99
- ), m = J(o.timezone), v = c(() => {
100
+ ), A = oe("DateRange", o), m = Q(o.timezone), v = c(() => {
100
101
  var l, d;
101
102
  const e = t(p);
102
- if (S(e) || !(e != null && e.length))
103
+ if (D(e) || !(e != null && e.length))
103
104
  return e;
104
- const n = o.timezone ? M(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? M(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
105
- return [u(n), u(a)];
106
- }), A = c(() => t(i) ? o.picker ?? Z[o.format] : o.picker), F = c(() => {
107
- const e = t(i) ? q[o.format] : {};
105
+ const n = o.timezone ? R(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? R(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
106
+ return [i(n), i(a)];
107
+ }), F = c(() => t(u) ? o.picker ?? q[o.format] : o.picker), z = c(() => {
108
+ const e = t(u) ? G[o.format] : {};
108
109
  return {
109
- ...X(
110
- b(o, [
110
+ ...ee(
111
+ S(o, [
111
112
  "value",
112
113
  "onUpdate:value",
113
114
  "onChange",
@@ -116,58 +117,59 @@ const fe = /* @__PURE__ */ x({
116
117
  "mode"
117
118
  ])
118
119
  ),
120
+ placeholder: t(A),
119
121
  ...e
120
122
  };
121
123
  });
122
- function z(e) {
124
+ function E(e) {
123
125
  if (!e) {
124
- h(e);
126
+ g(e);
125
127
  return;
126
128
  }
127
- let n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1];
128
- t(i) ? h([
129
+ let n = f(e[0]) ? i(e[0]) : e[0], a = f(e[1]) ? i(e[1]) : e[1];
130
+ t(u) ? g([
129
131
  m(n, t(r)),
130
132
  m(a, t(r), !1)
131
- ]) : h([D(n), D(a)]);
133
+ ]) : g([b(n), b(a)]);
132
134
  }
133
- function E(e) {
135
+ function N(e) {
134
136
  var s;
135
- const n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1], l = e[0] ? t(i) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(i) ? m(a, t(r), !1) : a.valueOf() : null;
137
+ const n = f(e[0]) ? i(e[0]) : e[0], a = f(e[1]) ? i(e[1]) : e[1], l = e[0] ? t(u) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(u) ? m(a, t(r), !1) : a.valueOf() : null;
136
138
  (s = o.onOk) == null || s.call(o, [l, d]);
137
139
  }
138
- function N(e, n) {
139
- var y, P;
140
- if (S(e)) {
140
+ function x(e, n) {
141
+ var y, C;
142
+ if (D(e)) {
141
143
  (y = o.onChange) == null || y.call(o, e, n);
142
144
  return;
143
145
  }
144
- const a = f(e[0]) ? u(e[0]) : e[0], l = f(e[1]) ? u(e[1]) : e[1], d = e[0] ? t(i) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(i) ? m(l, t(r), !1) : l.valueOf() : null;
145
- (P = o.onChange) == null || P.call(o, [d, s], n);
146
+ const a = f(e[0]) ? i(e[0]) : e[0], l = f(e[1]) ? i(e[1]) : e[1], d = e[0] ? t(u) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(u) ? m(l, t(r), !1) : l.valueOf() : null;
147
+ (C = o.onChange) == null || C.call(o, [d, s], n);
146
148
  }
147
149
  return (e, n) => {
148
150
  var a, l;
149
- return e.mode === "read" ? (g(), k(B, { key: 0 }, [
150
- v.value ? (g(), k(B, { key: 0 }, [
151
- O(C((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
151
+ return e.mode === "read" ? (h(), k(B, { key: 0 }, [
152
+ v.value ? (h(), k(B, { key: 0 }, [
153
+ O(P((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
152
154
  T(e.$slots, "readModeSeparator", {}, () => [
153
- V(t(Q))
155
+ I(t(X))
154
156
  ]),
155
- O(" " + C((l = v.value[1]) == null ? void 0 : l.format(r.value)), 1)
156
- ], 64)) : (g(), k(B, { key: 1 }, [
157
- O(C(e.emptyText), 1)
157
+ O(" " + P((l = v.value[1]) == null ? void 0 : l.format(r.value)), 1)
158
+ ], 64)) : (h(), k(B, { key: 1 }, [
159
+ O(P(e.emptyText), 1)
158
160
  ], 64))
159
- ], 64)) : (g(), I(t(G).RangePicker, j({ key: 1 }, F.value, {
161
+ ], 64)) : (h(), j(t(J).RangePicker, U({ key: 1 }, z.value, {
160
162
  value: v.value,
161
- "onUpdate:value": z,
162
- onChange: N,
163
- picker: A.value,
163
+ "onUpdate:value": E,
164
+ onChange: x,
165
+ picker: F.value,
164
166
  format: r.value,
165
- onOk: E
166
- }), U({ _: 2 }, [
167
- H(t(b)(e.$slots, "readModeSeparator"), (d, s) => ({
167
+ onOk: N
168
+ }), H({ _: 2 }, [
169
+ $(t(S)(e.$slots, "readModeSeparator"), (d, s) => ({
168
170
  name: s,
169
- fn: $((y) => [
170
- T(e.$slots, s, K(L(y || {})))
171
+ fn: K((y) => [
172
+ T(e.$slots, s, L(W(y || {})))
171
173
  ])
172
174
  }))
173
175
  ]), 1040, ["value", "picker", "format"]));
@@ -175,5 +177,5 @@ const fe = /* @__PURE__ */ x({
175
177
  }
176
178
  });
177
179
  export {
178
- fe as default
180
+ ve as default
179
181
  };
@@ -0,0 +1,16 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { ApFieldTextPasswordProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldSelectProps, BasicApFieldProps } from '../interface';
3
+
4
+ type FieldType = {
5
+ Text: ApFieldTextProps;
6
+ TextArea: ApFieldTextAreaProps;
7
+ Number: ApFieldNumberProps;
8
+ Date: ApFieldDateProps;
9
+ DateRange: ApFieldDateRangeProps;
10
+ Select: ApFieldSelectProps;
11
+ TextPassword: ApFieldTextPasswordProps;
12
+ };
13
+ export declare const useDefaultPlaceholder: <FieldName extends keyof FieldType>(fieldName: FieldName, props: BasicApFieldProps<{
14
+ placeholder?: FieldType[FieldName]['placeholder'];
15
+ }>) => ComputedRef<FieldType[FieldName]["placeholder"] | undefined>;
16
+ export {};
@@ -0,0 +1,25 @@
1
+ import { computed as r } from "vue";
2
+ import "../../config-provider/index.mjs";
3
+ import { isDef as c } from "../../utils/index.mjs";
4
+ import { useLocale as n } from "../../config-provider/hooks/use-locale.mjs";
5
+ const s = ["Select", "Date"], i = [
6
+ "Text",
7
+ "TextArea",
8
+ "Number",
9
+ "TextPassword"
10
+ ], p = (o, t) => {
11
+ const { t: e } = n();
12
+ return r(() => {
13
+ if (c(t.placeholder))
14
+ return t.placeholder;
15
+ if (o === "DateRange")
16
+ return [e("ap.common.chooseText"), e("ap.common.chooseText")];
17
+ if (s.includes(o))
18
+ return e("ap.common.chooseText");
19
+ if (i.includes(o))
20
+ return e("ap.common.inputText");
21
+ });
22
+ };
23
+ export {
24
+ p as useDefaultPlaceholder
25
+ };
@@ -105,15 +105,16 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
105
105
  */
106
106
  searchMode?: 'filter' | 'request';
107
107
  };
108
- export type ApFieldSelectSlots = {
108
+ export type ApFieldSelectExpose = {
109
109
  focus: () => void;
110
110
  blur: () => void;
111
+ request: (clear?: boolean) => Promise<void>;
111
112
  };
112
113
  export type ApFieldSliderProps = BasicApFieldProps<SliderProps> & {
113
114
  emptyText?: string;
114
115
  defaultValue?: number | [number, number];
115
116
  };
116
- export type ApFieldSliderSlots = {
117
+ export type ApFieldSliderExpose = {
117
118
  focus: () => void;
118
119
  blur: () => void;
119
120
  };
@@ -125,7 +126,7 @@ export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
125
126
  export type ApFieldRateProps = BasicApFieldProps<RateProps> & {
126
127
  defaultValue?: number;
127
128
  };
128
- export type ApFieldRateSlots = {
129
+ export type ApFieldRateExpose = {
129
130
  focus: () => void;
130
131
  blur: () => void;
131
132
  };
@@ -1,14 +1,15 @@
1
- import { defineComponent as h, ref as C, computed as x, unref as o, openBlock as r, createElementBlock as n, Fragment as N, normalizeClass as d, renderSlot as s, createCommentVNode as m, createElementVNode as V, toDisplayString as $, createBlock as D, mergeProps as P, createSlots as R, renderList as A, withCtx as I, normalizeProps as U, guardReactiveProps as z } from "vue";
2
- import { InputNumber as E } from "ant-design-vue";
1
+ import { defineComponent as C, ref as N, computed as x, unref as o, openBlock as r, createElementBlock as n, Fragment as D, normalizeClass as d, renderSlot as s, createCommentVNode as m, createElementVNode as P, toDisplayString as V, createBlock as $, mergeProps as R, createSlots as A, renderList as I, withCtx as U, normalizeProps as z, guardReactiveProps as E } from "vue";
2
+ import { InputNumber as F } from "ant-design-vue";
3
3
  import "../../hooks/index.mjs";
4
- import { isNil as F, omit as M } from "lodash-unified";
5
- import { toDecimalMark as T } from "@fruits-chain/utils";
6
- import { addZeroToDecimalPlaces as _ } from "./helper.mjs";
4
+ import { isNil as M, omit as T } from "lodash-unified";
5
+ import { toDecimalMark as _ } from "@fruits-chain/utils";
6
+ import { addZeroToDecimalPlaces as w } from "./helper.mjs";
7
7
  import "../../config-provider/index.mjs";
8
8
  import "./style.css";
9
- import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useControllableValue as L } from "../../hooks/useControllableValue.mjs";
11
- const Y = /* @__PURE__ */ h({
9
+ import { useDefaultPlaceholder as L } from "../hooks/use-default-placeholder.mjs";
10
+ import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
11
+ import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
12
+ const oe = /* @__PURE__ */ C({
12
13
  name: "ApFieldNumber",
13
14
  __name: "index",
14
15
  props: {
@@ -56,15 +57,15 @@ const Y = /* @__PURE__ */ h({
56
57
  },
57
58
  emits: ["update:value"],
58
59
  setup(f, { expose: c, emit: y }) {
59
- const v = y, { b: i } = w("field-number"), t = f, l = C(), { value: u, updateValue: B } = L(
60
+ const v = y, { b: i } = Z("field-number"), t = f, l = N(), { value: u, updateValue: b } = j(
60
61
  t,
61
62
  v
62
- ), b = x(() => {
63
+ ), B = L("Number", t), h = x(() => {
63
64
  let e = o(u);
64
- if (F(e))
65
+ if (M(e))
65
66
  return t.emptyText;
66
- let a = t.thousands ? T(e, t.precision) : String(e);
67
- return t.precision && t.limitDecimalsRetain && (a = _(a, t.precision)), a;
67
+ let a = t.thousands ? _(e, t.precision) : String(e);
68
+ return t.precision && t.limitDecimalsRetain && (a = w(a, t.precision)), a;
68
69
  });
69
70
  function k() {
70
71
  var e;
@@ -74,35 +75,36 @@ const Y = /* @__PURE__ */ h({
74
75
  var e;
75
76
  (e = l.value) == null || e.blur();
76
77
  }
77
- return c({ focus: k, blur: g }), (e, a) => e.mode === "read" ? (r(), n(N, { key: 0 }, [
78
+ return c({ focus: k, blur: g }), (e, a) => e.mode === "read" ? (r(), n(D, { key: 0 }, [
78
79
  e.$slots.prefix ? (r(), n("span", {
79
80
  key: 0,
80
81
  class: d(o(i)("label-left"))
81
82
  }, [
82
83
  s(e.$slots, "prefix")
83
84
  ], 2)) : m("", !0),
84
- V("span", null, $(b.value), 1),
85
+ P("span", null, V(h.value), 1),
85
86
  e.$slots.addonAfter ? (r(), n("span", {
86
87
  key: 1,
87
88
  class: d(o(i)("label-right"))
88
89
  }, [
89
90
  s(e.$slots, "addonAfter")
90
91
  ], 2)) : m("", !0)
91
- ], 64)) : (r(), D(o(E), P({ key: 1 }, o(M)(t, ["value", "onUpdate:value"]), {
92
+ ], 64)) : (r(), $(o(F), R({ key: 1 }, o(T)(t, ["value", "onUpdate:value"]), {
93
+ placeholder: o(B),
92
94
  value: o(u),
93
- "onUpdate:value": o(B),
95
+ "onUpdate:value": o(b),
94
96
  ref_key: "inputRef",
95
97
  ref: l
96
- }), R({ _: 2 }, [
97
- A(e.$slots, (Z, p) => ({
98
+ }), A({ _: 2 }, [
99
+ I(e.$slots, (q, p) => ({
98
100
  name: p,
99
- fn: I((S) => [
100
- s(e.$slots, p, U(z(S || {})))
101
+ fn: U((S) => [
102
+ s(e.$slots, p, z(E(S || {})))
101
103
  ])
102
104
  }))
103
- ]), 1040, ["value", "onUpdate:value"]));
105
+ ]), 1040, ["placeholder", "value", "onUpdate:value"]));
104
106
  }
105
107
  });
106
108
  export {
107
- Y as default
109
+ oe as default
108
110
  };
@@ -15,6 +15,7 @@ type ApFieldSelectSlots = {
15
15
  optionLabel: any;
16
16
  default: any;
17
17
  };
18
+ declare function requestIfNeeded(clear?: boolean): Promise<void>;
18
19
  declare function focus(): void;
19
20
  declare function blur(): void;
20
21
  declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
@@ -38,6 +39,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
38
39
  }>, {
39
40
  focus: typeof focus;
40
41
  blur: typeof blur;
42
+ request: typeof requestIfNeeded;
41
43
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
42
44
  "update:value": (...args: any[]) => void;
43
45
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {