@aplus-frontend/ui 0.0.1-beta.5 → 0.0.1-beta.7

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 (215) hide show
  1. package/es/index.mjs +114 -83
  2. package/es/src/ap-action/constant.d.ts +0 -0
  3. package/es/src/ap-action/group/index.vue.d.ts +38 -0
  4. package/es/src/ap-action/group/index.vue.mjs +64 -0
  5. package/es/src/ap-action/group/index.vue2.mjs +4 -0
  6. package/es/src/ap-action/index.d.ts +14 -0
  7. package/es/src/ap-action/index.mjs +17 -0
  8. package/es/src/ap-action/interface.d.ts +81 -0
  9. package/es/src/ap-action/item/index.vue.d.ts +44 -0
  10. package/es/src/ap-action/item/index.vue.mjs +49 -0
  11. package/es/src/ap-action/item/index.vue2.mjs +4 -0
  12. package/es/src/ap-action/item-dropdown/index.vue.d.ts +57 -0
  13. package/es/src/ap-action/item-dropdown/index.vue.mjs +92 -0
  14. package/es/src/ap-action/item-dropdown/index.vue2.mjs +4 -0
  15. package/es/src/ap-action/item-modal/index.vue.d.ts +41 -0
  16. package/es/src/ap-action/item-modal/index.vue.mjs +34 -0
  17. package/es/src/ap-action/item-modal/index.vue2.mjs +4 -0
  18. package/es/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
  19. package/es/src/ap-action/item-popconfirm/index.vue.mjs +37 -0
  20. package/es/src/ap-action/item-popconfirm/index.vue2.mjs +4 -0
  21. package/es/src/ap-action/style/item-dropdown.css +11 -0
  22. package/es/src/ap-action/style/item.css +28 -0
  23. package/es/src/ap-field/checkbox/helper.mjs +5 -0
  24. package/es/src/ap-field/checkbox/index.vue.d.ts +39 -0
  25. package/es/src/ap-field/checkbox/index.vue.mjs +56 -0
  26. package/es/src/ap-field/checkbox/index.vue2.mjs +4 -0
  27. package/es/src/ap-field/date/constant.mjs +50 -0
  28. package/es/src/ap-field/date/helper.d.ts +2 -0
  29. package/es/src/ap-field/date/helper.mjs +10 -0
  30. package/es/src/ap-field/date/index.vue.d.ts +57 -0
  31. package/es/src/ap-field/date/index.vue.mjs +75 -0
  32. package/es/src/ap-field/date/index.vue2.mjs +4 -0
  33. package/es/src/ap-field/date-range/index.vue.d.ts +59 -0
  34. package/es/src/ap-field/date-range/index.vue.mjs +87 -0
  35. package/es/src/ap-field/date-range/index.vue2.mjs +4 -0
  36. package/es/src/ap-field/index.d.ts +9 -3
  37. package/es/src/ap-field/interface.d.ts +65 -5
  38. package/es/src/ap-field/number/helper.d.ts +1 -0
  39. package/es/src/ap-field/number/helper.mjs +14 -0
  40. package/es/src/ap-field/number/index.vue.d.ts +72 -0
  41. package/es/src/ap-field/number/index.vue.mjs +108 -0
  42. package/es/src/ap-field/number/index.vue2.mjs +4 -0
  43. package/es/src/ap-field/number/style.css +6 -0
  44. package/es/src/ap-field/radio/helper.d.ts +4 -0
  45. package/es/src/ap-field/radio/helper.mjs +5 -0
  46. package/es/src/ap-field/radio/index.vue.d.ts +40 -0
  47. package/es/src/ap-field/radio/index.vue.mjs +68 -0
  48. package/es/src/ap-field/radio/index.vue2.mjs +4 -0
  49. package/es/src/ap-field/select/index.vue.d.ts +235 -0
  50. package/es/src/ap-field/select/index.vue.mjs +114 -0
  51. package/es/src/ap-field/select/index.vue2.mjs +4 -0
  52. package/es/src/ap-field/switch/index.vue.d.ts +54 -0
  53. package/es/src/ap-field/switch/index.vue.mjs +122 -0
  54. package/es/src/ap-field/switch/index.vue2.mjs +4 -0
  55. package/es/src/ap-field/text/index.vue.d.ts +63 -0
  56. package/es/src/ap-field/text/index.vue.mjs +132 -0
  57. package/es/src/ap-field/text/index.vue2.mjs +4 -0
  58. package/es/src/ap-field/text-area/index.vue.d.ts +49 -0
  59. package/es/src/ap-field/text-area/index.vue.mjs +86 -0
  60. package/es/src/ap-field/text-area/index.vue2.mjs +4 -0
  61. package/es/src/ap-field/text-area/style.css +5 -0
  62. package/es/src/ap-form/index.d.ts +64 -64
  63. package/es/src/base-button/index.d.ts +28 -28
  64. package/es/src/basic/help.vue.d.ts +1 -1
  65. package/es/src/basic/index.d.ts +3 -3
  66. package/es/src/config-provider/config-provider.d.ts +2 -2
  67. package/es/src/config-provider/index.d.ts +6 -6
  68. package/es/src/count-down/index.d.ts +12 -12
  69. package/es/src/cropper/cropper-avatar.vue.d.ts +1 -1
  70. package/es/src/cropper/cropper-image.vue.d.ts +1 -1
  71. package/es/src/cropper/index.d.ts +42 -42
  72. package/es/src/description/description.vue.d.ts +1 -1
  73. package/es/src/description/index.d.ts +3 -3
  74. package/es/src/design-token/index.d.ts +4 -0
  75. package/es/src/design-token/index.mjs +59 -0
  76. package/es/src/dropdown/dropdown.vue.d.ts +1 -1
  77. package/es/src/dropdown/index.d.ts +7 -7
  78. package/es/src/icon/index.d.ts +41 -41
  79. package/es/src/icon-picker/icon-picker.vue.d.ts +3 -3
  80. package/es/src/icon-picker/index.d.ts +45 -45
  81. package/es/src/index.d.ts +3 -0
  82. package/es/src/index.mjs +121 -90
  83. package/es/src/modal/basic.vue.d.ts +3 -2
  84. package/es/src/modal/basic.vue.mjs +53 -49
  85. package/es/src/modal/components/modal-footer.vue.d.ts +1 -1
  86. package/es/src/modal/components/modal.d.ts +1 -1
  87. package/es/src/modal/index.d.ts +7 -8
  88. package/es/src/modal/index.mjs +2 -3
  89. package/es/src/modal/props.mjs +1 -1
  90. package/es/src/modal/style/index.css +29 -30
  91. package/es/src/pro-form/components/api-radio-group.vue.d.ts +1 -1
  92. package/es/src/pro-form/components/api-select.vue.d.ts +2 -2
  93. package/es/src/pro-form/components/api-tree.vue.d.ts +1 -1
  94. package/es/src/pro-form/hooks/use-form-events.mjs +22 -22
  95. package/es/src/pro-form/hooks/use-form-values.mjs +12 -12
  96. package/es/src/pro-form/hooks/use-label-width.d.ts +5 -5
  97. package/es/src/pro-form/pro-form.vue.d.ts +1 -1
  98. package/es/src/pro-form/pro-form.vue.mjs +23 -23
  99. package/es/src/pro-table/hooks/use-columns.mjs +24 -24
  100. package/es/src/strength-meter/index.d.ts +12 -12
  101. package/es/src/theme/ap-action/item-dropdown.css +11 -0
  102. package/es/src/theme/ap-action/item.css +28 -0
  103. package/es/src/theme/ap-field/number.css +6 -0
  104. package/es/src/theme/ap-field/text-area.css +5 -0
  105. package/es/src/theme/modal/index.css +29 -30
  106. package/es/src/type.d.ts +3 -1
  107. package/es/src/utils/index.d.ts +7 -0
  108. package/lib/index.js +1 -1
  109. package/lib/src/ap-action/constant.d.ts +0 -0
  110. package/lib/src/ap-action/group/index.vue.d.ts +38 -0
  111. package/lib/src/ap-action/group/index.vue.js +1 -0
  112. package/lib/src/ap-action/group/index.vue2.js +1 -0
  113. package/lib/src/ap-action/index.d.ts +14 -0
  114. package/lib/src/ap-action/index.js +1 -0
  115. package/lib/src/ap-action/interface.d.ts +81 -0
  116. package/lib/src/ap-action/item/index.vue.d.ts +44 -0
  117. package/lib/src/ap-action/item/index.vue.js +1 -0
  118. package/lib/src/ap-action/item/index.vue2.js +1 -0
  119. package/lib/src/ap-action/item-dropdown/index.vue.d.ts +57 -0
  120. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -0
  121. package/lib/src/ap-action/item-dropdown/index.vue2.js +1 -0
  122. package/lib/src/ap-action/item-modal/index.vue.d.ts +41 -0
  123. package/lib/src/ap-action/item-modal/index.vue.js +1 -0
  124. package/lib/src/ap-action/item-modal/index.vue2.js +1 -0
  125. package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
  126. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -0
  127. package/lib/src/ap-action/item-popconfirm/index.vue2.js +1 -0
  128. package/lib/src/ap-action/style/item-dropdown.css +11 -0
  129. package/lib/src/ap-action/style/item.css +28 -0
  130. package/lib/src/ap-field/checkbox/helper.js +1 -0
  131. package/lib/src/ap-field/checkbox/index.vue.d.ts +39 -0
  132. package/lib/src/ap-field/checkbox/index.vue.js +1 -0
  133. package/lib/src/ap-field/checkbox/index.vue2.js +1 -0
  134. package/lib/src/ap-field/date/constant.js +1 -0
  135. package/lib/src/ap-field/date/helper.d.ts +2 -0
  136. package/lib/src/ap-field/date/helper.js +1 -0
  137. package/lib/src/ap-field/date/index.vue.d.ts +57 -0
  138. package/lib/src/ap-field/date/index.vue.js +1 -0
  139. package/lib/src/ap-field/date/index.vue2.js +1 -0
  140. package/lib/src/ap-field/date-range/index.vue.d.ts +59 -0
  141. package/lib/src/ap-field/date-range/index.vue.js +1 -0
  142. package/lib/src/ap-field/date-range/index.vue2.js +1 -0
  143. package/lib/src/ap-field/index.d.ts +9 -3
  144. package/lib/src/ap-field/interface.d.ts +65 -5
  145. package/lib/src/ap-field/number/helper.d.ts +1 -0
  146. package/lib/src/ap-field/number/helper.js +1 -0
  147. package/lib/src/ap-field/number/index.vue.d.ts +72 -0
  148. package/lib/src/ap-field/number/index.vue.js +1 -0
  149. package/lib/src/ap-field/number/index.vue2.js +1 -0
  150. package/lib/src/ap-field/number/style.css +6 -0
  151. package/lib/src/ap-field/radio/helper.d.ts +4 -0
  152. package/lib/src/ap-field/radio/helper.js +1 -0
  153. package/lib/src/ap-field/radio/index.vue.d.ts +40 -0
  154. package/lib/src/ap-field/radio/index.vue.js +1 -0
  155. package/lib/src/ap-field/radio/index.vue2.js +1 -0
  156. package/lib/src/ap-field/select/index.vue.d.ts +235 -0
  157. package/lib/src/ap-field/select/index.vue.js +1 -0
  158. package/lib/src/ap-field/select/index.vue2.js +1 -0
  159. package/lib/src/ap-field/switch/index.vue.d.ts +54 -0
  160. package/lib/src/ap-field/switch/index.vue.js +1 -0
  161. package/lib/src/ap-field/switch/index.vue2.js +1 -0
  162. package/lib/src/ap-field/text/index.vue.d.ts +63 -0
  163. package/lib/src/ap-field/text/index.vue.js +1 -0
  164. package/lib/src/ap-field/text/index.vue2.js +1 -0
  165. package/lib/src/ap-field/text-area/index.vue.d.ts +49 -0
  166. package/lib/src/ap-field/text-area/index.vue.js +1 -0
  167. package/lib/src/ap-field/text-area/index.vue2.js +1 -0
  168. package/lib/src/ap-field/text-area/style.css +5 -0
  169. package/lib/src/ap-form/index.d.ts +64 -64
  170. package/lib/src/base-button/index.d.ts +28 -28
  171. package/lib/src/basic/help.vue.d.ts +1 -1
  172. package/lib/src/basic/index.d.ts +3 -3
  173. package/lib/src/config-provider/config-provider.d.ts +2 -2
  174. package/lib/src/config-provider/index.d.ts +6 -6
  175. package/lib/src/count-down/index.d.ts +12 -12
  176. package/lib/src/cropper/cropper-avatar.vue.d.ts +1 -1
  177. package/lib/src/cropper/cropper-image.vue.d.ts +1 -1
  178. package/lib/src/cropper/index.d.ts +42 -42
  179. package/lib/src/description/description.vue.d.ts +1 -1
  180. package/lib/src/description/index.d.ts +3 -3
  181. package/lib/src/design-token/index.d.ts +4 -0
  182. package/lib/src/design-token/index.js +1 -0
  183. package/lib/src/dropdown/dropdown.vue.d.ts +1 -1
  184. package/lib/src/dropdown/index.d.ts +7 -7
  185. package/lib/src/icon/index.d.ts +41 -41
  186. package/lib/src/icon-picker/icon-picker.vue.d.ts +3 -3
  187. package/lib/src/icon-picker/index.d.ts +45 -45
  188. package/lib/src/index.d.ts +3 -0
  189. package/lib/src/index.js +1 -1
  190. package/lib/src/modal/basic.vue.d.ts +3 -2
  191. package/lib/src/modal/basic.vue.js +1 -1
  192. package/lib/src/modal/components/modal-footer.vue.d.ts +1 -1
  193. package/lib/src/modal/components/modal.d.ts +1 -1
  194. package/lib/src/modal/index.d.ts +7 -8
  195. package/lib/src/modal/index.js +1 -1
  196. package/lib/src/modal/props.js +1 -1
  197. package/lib/src/modal/style/index.css +29 -30
  198. package/lib/src/pro-form/components/api-radio-group.vue.d.ts +1 -1
  199. package/lib/src/pro-form/components/api-select.vue.d.ts +2 -2
  200. package/lib/src/pro-form/components/api-tree.vue.d.ts +1 -1
  201. package/lib/src/pro-form/hooks/use-form-events.js +1 -1
  202. package/lib/src/pro-form/hooks/use-form-values.js +1 -1
  203. package/lib/src/pro-form/hooks/use-label-width.d.ts +5 -5
  204. package/lib/src/pro-form/pro-form.vue.d.ts +1 -1
  205. package/lib/src/pro-form/pro-form.vue.js +1 -1
  206. package/lib/src/pro-table/hooks/use-columns.js +1 -1
  207. package/lib/src/strength-meter/index.d.ts +12 -12
  208. package/lib/src/theme/ap-action/item-dropdown.css +11 -0
  209. package/lib/src/theme/ap-action/item.css +28 -0
  210. package/lib/src/theme/ap-field/number.css +6 -0
  211. package/lib/src/theme/ap-field/text-area.css +5 -0
  212. package/lib/src/theme/modal/index.css +29 -30
  213. package/lib/src/type.d.ts +3 -1
  214. package/lib/src/utils/index.d.ts +7 -0
  215. package/package.json +3 -3
@@ -0,0 +1,108 @@
1
+ import { defineComponent as C, ref as S, computed as N, unref as o, openBlock as r, createElementBlock as n, Fragment as V, normalizeClass as m, renderSlot as i, createCommentVNode as d, createElementVNode as $, toDisplayString as x, createBlock as A, mergeProps as D, createSlots as P, renderList as R, withCtx as I, normalizeProps as z, guardReactiveProps as E } from "vue";
2
+ import { InputNumber as F } from "ant-design-vue";
3
+ import "../../hooks/useMessage.mjs";
4
+ import { useControllableValue as M } from "../../hooks/useControllableValue.mjs";
5
+ import { isNil as T, omit as U } from "lodash-unified";
6
+ import { toDecimalMark as w } from "@fruits-chain/utils";
7
+ import { addZeroToDecimalPlaces as L } from "./helper.mjs";
8
+ import "../../config-provider/index.mjs";
9
+ import "./style.css";
10
+ import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const Y = /* @__PURE__ */ C({
12
+ name: "ApFieldNumber",
13
+ inheritAttrs: !1,
14
+ __name: "index",
15
+ props: {
16
+ mode: {},
17
+ size: {},
18
+ bordered: { type: Boolean, default: !0 },
19
+ placeholder: {},
20
+ name: {},
21
+ id: {},
22
+ type: {},
23
+ addonBefore: {},
24
+ addonAfter: {},
25
+ prefix: {},
26
+ "onUpdate:value": {},
27
+ valueModifiers: {},
28
+ status: {},
29
+ stringMode: { type: Boolean },
30
+ defaultValue: {},
31
+ value: {},
32
+ prefixCls: {},
33
+ min: { default: -1 / 0 },
34
+ max: { default: 1 / 0 },
35
+ step: { default: 1 },
36
+ tabindex: {},
37
+ controls: { type: Boolean, default: !0 },
38
+ readonly: { type: Boolean },
39
+ disabled: { type: Boolean },
40
+ autofocus: { type: Boolean },
41
+ keyboard: { type: Boolean, default: !0 },
42
+ parser: {},
43
+ formatter: {},
44
+ precision: {},
45
+ decimalSeparator: {},
46
+ onInput: {},
47
+ onChange: {},
48
+ onPressEnter: {},
49
+ onStep: {},
50
+ onBlur: {},
51
+ onFocus: {},
52
+ emptyText: { default: "-" },
53
+ thousands: { type: Boolean, default: !1 },
54
+ limitDecimalsRetain: { type: Boolean }
55
+ },
56
+ emits: ["update:value"],
57
+ setup(f, { expose: c, emit: y }) {
58
+ const v = y, { b: s } = Z("field-number"), t = f, l = S(), { value: p, updateValue: B } = M(
59
+ t,
60
+ v
61
+ ), b = N(() => {
62
+ let e = o(p);
63
+ if (T(e))
64
+ return t.emptyText;
65
+ let a = w(e, t.precision);
66
+ return t.precision && t.limitDecimalsRetain && (a = L(a, t.precision)), a;
67
+ });
68
+ function k() {
69
+ var e;
70
+ (e = l.value) == null || e.focus();
71
+ }
72
+ function g() {
73
+ var e;
74
+ (e = l.value) == null || e.blur();
75
+ }
76
+ return c({ focus: k, blur: g }), (e, a) => e.mode === "read" ? (r(), n(V, { key: 0 }, [
77
+ e.$slots.prefix ? (r(), n("span", {
78
+ key: 0,
79
+ class: m(o(s)("label-left"))
80
+ }, [
81
+ i(e.$slots, "prefix")
82
+ ], 2)) : d("", !0),
83
+ $("span", null, x(b.value), 1),
84
+ e.$slots.addonAfter ? (r(), n("span", {
85
+ key: 1,
86
+ class: m(o(s)("label-right"))
87
+ }, [
88
+ i(e.$slots, "addonAfter")
89
+ ], 2)) : d("", !0)
90
+ ], 64)) : (r(), A(o(F), D({ key: 1 }, o(U)(t, ["precision", "value", "update:value"]), {
91
+ value: o(p),
92
+ "onUpdate:value": o(B),
93
+ precision: e.precision,
94
+ ref_key: "inputRef",
95
+ ref: l
96
+ }), P({ _: 2 }, [
97
+ R(e.$slots, (_, u) => ({
98
+ name: u,
99
+ fn: I((h) => [
100
+ i(e.$slots, u, z(E(h || {})))
101
+ ])
102
+ }))
103
+ ]), 1040, ["value", "onUpdate:value", "precision"]));
104
+ }
105
+ });
106
+ export {
107
+ Y as default
108
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,6 @@
1
+ .aplus-field-number-label-left {
2
+ padding-right: 4px;
3
+ }
4
+ .aplus-field-number-label-right {
5
+ padding-left: 4px;
6
+ }
@@ -0,0 +1,4 @@
1
+ import { RadioGroupChildOption } from 'ant-design-vue/es/radio/Group';
2
+
3
+ export declare const getOptionValue: (v: RadioGroupChildOption | string | number) => any;
4
+ export declare const getOptionLabel: (v: RadioGroupChildOption | string | number) => any;
@@ -0,0 +1,5 @@
1
+ const t = (e) => typeof e == "object" ? e.value : e, o = (e) => typeof e == "object" ? e.label : e;
2
+ export {
3
+ o as getOptionLabel,
4
+ t as getOptionValue
5
+ };
@@ -0,0 +1,40 @@
1
+ import { ApFieldRadioProps, FieldMode } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+
4
+ declare function focus(): void;
5
+ declare function blur(): void;
6
+ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldRadioProps>, {
7
+ emptyText: string;
8
+ mode: string;
9
+ }>, {
10
+ focus: typeof focus;
11
+ blur: typeof blur;
12
+ }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
13
+ "update:value": (...args: any[]) => void;
14
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldRadioProps>, {
15
+ emptyText: string;
16
+ mode: string;
17
+ }>>> & {
18
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
19
+ }, {
20
+ mode: FieldMode;
21
+ emptyText: string;
22
+ }, {}>;
23
+ export default _default;
24
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
25
+ type __VLS_TypePropsToRuntimeProps<T> = {
26
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
27
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
28
+ } : {
29
+ type: PropType<T[K]>;
30
+ required: true;
31
+ };
32
+ };
33
+ type __VLS_WithDefaults<P, D> = {
34
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
35
+ default: D[K];
36
+ }> : P[K];
37
+ };
38
+ type __VLS_Prettify<T> = {
39
+ [K in keyof T]: T[K];
40
+ } & {};
@@ -0,0 +1,68 @@
1
+ import { defineComponent as b, ref as i, onMounted as k, computed as T, unref as o, openBlock as p, createElementBlock as _, Fragment as V, createTextVNode as h, toDisplayString as B, createBlock as C, mergeProps as R } from "vue";
2
+ import { RadioGroup as G } from "ant-design-vue";
3
+ import "../../hooks/useMessage.mjs";
4
+ import { useControllableValue as U } from "../../hooks/useControllableValue.mjs";
5
+ import { isNil as q, omit as A } from "lodash-unified";
6
+ import { getOptionValue as F, getOptionLabel as N } from "./helper.mjs";
7
+ const M = /* @__PURE__ */ b({
8
+ name: "ApFieldRadio",
9
+ inheritAttrs: !1,
10
+ __name: "index",
11
+ props: {
12
+ mode: { default: "edit" },
13
+ prefixCls: {},
14
+ value: {},
15
+ size: {},
16
+ options: {},
17
+ disabled: { type: Boolean },
18
+ name: {},
19
+ buttonStyle: {},
20
+ id: {},
21
+ optionType: {},
22
+ onChange: {},
23
+ "onUpdate:value": {},
24
+ emptyText: { default: "-" },
25
+ request: {}
26
+ },
27
+ emits: ["update:value"],
28
+ setup(s, { expose: m, emit: d }) {
29
+ const t = s, f = d, n = i(), u = i((t == null ? void 0 : t.options) || []), { value: l, updateValue: c } = U(t, f);
30
+ k(() => {
31
+ var e;
32
+ (e = t.request) == null || e.call(t).then((a) => u.value = a);
33
+ });
34
+ const v = T(() => {
35
+ var r;
36
+ const e = o(l);
37
+ if (q(e))
38
+ return t.emptyText;
39
+ const a = (r = u.value) == null ? void 0 : r.find(
40
+ (g) => e === F(g)
41
+ );
42
+ return N(a) || t.emptyText;
43
+ });
44
+ function y() {
45
+ var e;
46
+ (e = n.value) == null || e.focus();
47
+ }
48
+ function x() {
49
+ var e;
50
+ (e = n.value) == null || e.blur();
51
+ }
52
+ return m({
53
+ focus: y,
54
+ blur: x
55
+ }), (e, a) => e.mode === "read" ? (p(), _(V, { key: 0 }, [
56
+ h(B(v.value), 1)
57
+ ], 64)) : (p(), C(o(G), R({ key: 1 }, o(A)(t, ["value", "update:value", "options"]), {
58
+ value: o(l),
59
+ "onUpdate:value": o(c),
60
+ options: u.value,
61
+ ref_key: "radioGroupRef",
62
+ ref: n
63
+ }), null, 16, ["value", "onUpdate:value", "options"]));
64
+ }
65
+ });
66
+ export {
67
+ M as default
68
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,235 @@
1
+ import { DefaultOptionType, SelectValue, LabeledValue } from 'ant-design-vue/es/select';
2
+ import { ApFieldSelectProps, FieldMode } from '../interface';
3
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType, CSSProperties } from 'vue';
4
+ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
5
+ import { ButtonSize } from 'ant-design-vue/es/button';
6
+ import { VueNode } from 'ant-design-vue/es/_util/type';
7
+ import { SelectHandler, FieldNames, FilterFunc } from 'ant-design-vue/es/vc-select/Select';
8
+ import { RenderDOMFunc, DropdownRender, CustomTagProps } from 'ant-design-vue/es/vc-select/BaseSelect';
9
+ import { AlignType } from 'ant-design-vue/es/vc-trigger/interface';
10
+
11
+ type ApFieldSelectSlots = {
12
+ notFoundContent: any;
13
+ suffixIcon: any;
14
+ itemIcon: any;
15
+ removeIcon: any;
16
+ clearIcon: any;
17
+ dropdownRender: any;
18
+ option: any;
19
+ placeholder: any;
20
+ tagRender: any;
21
+ maxTagPlaceholder: any;
22
+ optionLabel: any;
23
+ default: any;
24
+ };
25
+ declare function focus(): void;
26
+ declare function blur(): void;
27
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
28
+ fieldProps: () => {};
29
+ emptyText: string;
30
+ mode: string;
31
+ }>, {
32
+ focus: typeof focus;
33
+ blur: typeof blur;
34
+ }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
35
+ "update:value": (...args: any[]) => void;
36
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSelectProps>, {
37
+ fieldProps: () => {};
38
+ emptyText: string;
39
+ mode: string;
40
+ }>>> & {
41
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ mode: FieldMode;
44
+ emptyText: string;
45
+ fieldProps: Omit<Partial< ExtractPropTypes<{
46
+ value: {
47
+ type: PropType<SelectValue>;
48
+ default: SelectValue;
49
+ };
50
+ defaultValue: {
51
+ type: PropType<SelectValue>;
52
+ default: SelectValue;
53
+ };
54
+ notFoundContent: VueTypeValidableDef<any>;
55
+ suffixIcon: VueTypeValidableDef<any>;
56
+ itemIcon: VueTypeValidableDef<any>;
57
+ size: {
58
+ type: PropType<ButtonSize>;
59
+ default: ButtonSize;
60
+ };
61
+ mode: {
62
+ type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
63
+ default: "multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE";
64
+ };
65
+ bordered: {
66
+ type: BooleanConstructor;
67
+ default: boolean;
68
+ };
69
+ transitionName: StringConstructor;
70
+ choiceTransitionName: {
71
+ type: PropType<"">;
72
+ default: "";
73
+ };
74
+ popupClassName: StringConstructor;
75
+ dropdownClassName: StringConstructor;
76
+ placement: {
77
+ type: PropType<"bottomLeft" | "bottomRight" | "topLeft" | "topRight">;
78
+ default: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
79
+ };
80
+ status: {
81
+ type: PropType<"" | "error" | "warning">;
82
+ default: "" | "error" | "warning";
83
+ };
84
+ 'onUpdate:value': {
85
+ type: PropType<(val: SelectValue) => void>;
86
+ default: (val: SelectValue) => void;
87
+ };
88
+ children: PropType< VueNode[]>;
89
+ listHeight: NumberConstructor;
90
+ onMouseenter: PropType<(e: MouseEvent) => void>;
91
+ onMouseleave: PropType<(e: MouseEvent) => void>;
92
+ tabindex: NumberConstructor;
93
+ onClick: PropType<(e: MouseEvent) => void>;
94
+ onFocus: {
95
+ type: PropType<(e: FocusEvent) => void>;
96
+ };
97
+ onBlur: {
98
+ type: PropType<(e: FocusEvent) => void>;
99
+ };
100
+ onChange: PropType<(value: SelectValue, option: DefaultOptionType | DefaultOptionType[]) => void>;
101
+ onKeydown: PropType<(e: KeyboardEvent) => void>;
102
+ onKeyup: PropType<(e: KeyboardEvent) => void>;
103
+ onMousedown: PropType<(e: MouseEvent) => void>;
104
+ onSelect: PropType<SelectHandler<(string | number) | LabeledValue, DefaultOptionType>>;
105
+ open: {
106
+ type: BooleanConstructor;
107
+ default: any;
108
+ };
109
+ animation: StringConstructor;
110
+ direction: {
111
+ type: PropType<"ltr" | "rtl">;
112
+ };
113
+ disabled: {
114
+ type: BooleanConstructor;
115
+ default: any;
116
+ };
117
+ prefixCls: StringConstructor;
118
+ id: StringConstructor;
119
+ autofocus: BooleanConstructor;
120
+ getPopupContainer: {
121
+ type: PropType<RenderDOMFunc>;
122
+ };
123
+ virtual: {
124
+ type: BooleanConstructor;
125
+ default: any;
126
+ };
127
+ dropdownMatchSelectWidth: {
128
+ type: PropType<number | boolean>;
129
+ default: any;
130
+ };
131
+ options: PropType<DefaultOptionType[]>;
132
+ showAction: {
133
+ type: PropType<("click" | "focus")[]>;
134
+ };
135
+ placeholder: VueTypeValidableDef<any>;
136
+ onDeselect: PropType<SelectHandler<(string | number) | LabeledValue, DefaultOptionType>>;
137
+ loading: {
138
+ type: BooleanConstructor;
139
+ default: any;
140
+ };
141
+ clearIcon: VueTypeValidableDef<any>;
142
+ allowClear: {
143
+ type: BooleanConstructor;
144
+ default: any;
145
+ };
146
+ onSearch: PropType<(value: string) => void>;
147
+ fieldNames: PropType<FieldNames>;
148
+ dropdownStyle: {
149
+ type: PropType<CSSProperties>;
150
+ };
151
+ dropdownRender: {
152
+ type: PropType<DropdownRender>;
153
+ };
154
+ dropdownAlign: PropType<AlignType>;
155
+ showSearch: {
156
+ type: BooleanConstructor;
157
+ default: any;
158
+ };
159
+ searchValue: StringConstructor;
160
+ onInputKeyDown: PropType<(e: KeyboardEvent) => void>;
161
+ removeIcon: VueTypeValidableDef<any>;
162
+ maxTagCount: {
163
+ type: PropType<number | "responsive">;
164
+ };
165
+ maxTagTextLength: NumberConstructor;
166
+ maxTagPlaceholder: VueTypeValidableDef<any>;
167
+ tokenSeparators: {
168
+ type: PropType<string[]>;
169
+ };
170
+ tagRender: {
171
+ type: PropType<(props: CustomTagProps) => any>;
172
+ };
173
+ optionLabelRender: {
174
+ type: PropType<(option: Record<string, any>) => any>;
175
+ };
176
+ onClear: PropType<() => void>;
177
+ defaultOpen: {
178
+ type: BooleanConstructor;
179
+ default: any;
180
+ };
181
+ onDropdownVisibleChange: {
182
+ type: PropType<(open: boolean) => void>;
183
+ };
184
+ showArrow: {
185
+ type: BooleanConstructor;
186
+ default: any;
187
+ };
188
+ onPopupScroll: PropType<(e: UIEvent) => void>;
189
+ menuItemSelectedIcon: VueTypeValidableDef<any>;
190
+ listItemHeight: NumberConstructor;
191
+ inputValue: StringConstructor;
192
+ autoClearSearchValue: {
193
+ type: BooleanConstructor;
194
+ default: any;
195
+ };
196
+ filterOption: {
197
+ type: PropType<boolean | FilterFunc<DefaultOptionType>>;
198
+ default: any;
199
+ };
200
+ filterSort: PropType<(optionA: DefaultOptionType, optionB: DefaultOptionType) => number>;
201
+ optionFilterProp: StringConstructor;
202
+ optionLabelProp: StringConstructor;
203
+ defaultActiveFirstOption: {
204
+ type: BooleanConstructor;
205
+ default: any;
206
+ };
207
+ labelInValue: {
208
+ type: BooleanConstructor;
209
+ default: any;
210
+ };
211
+ }>>, "mode" | "value" | "onUpdate:value" | "onSearch">;
212
+ }, {}>, Readonly<ApFieldSelectSlots> & ApFieldSelectSlots>;
213
+ export default _default;
214
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
215
+ type __VLS_TypePropsToRuntimeProps<T> = {
216
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
217
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
218
+ } : {
219
+ type: PropType<T[K]>;
220
+ required: true;
221
+ };
222
+ };
223
+ type __VLS_WithDefaults<P, D> = {
224
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
225
+ default: D[K];
226
+ }> : P[K];
227
+ };
228
+ type __VLS_Prettify<T> = {
229
+ [K in keyof T]: T[K];
230
+ } & {};
231
+ type __VLS_WithTemplateSlots<T, S> = T & {
232
+ new (): {
233
+ $slots: S;
234
+ };
235
+ };
@@ -0,0 +1,114 @@
1
+ import { defineComponent as B, ref as d, onMounted as C, computed as v, unref as a, openBlock as h, createElementBlock as V, toDisplayString as T, createBlock as I, mergeProps as M, createSlots as R, renderList as U, withCtx as y, renderSlot as z, normalizeProps as N, guardReactiveProps as $, createVNode as j } from "vue";
2
+ import { debounce as D, isFunction as P, isArray as E, isNil as L } from "lodash-unified";
3
+ import { Select as G, Spin as H } from "ant-design-vue";
4
+ import "../../hooks/useMessage.mjs";
5
+ import { useControllableValue as J } from "../../hooks/useControllableValue.mjs";
6
+ const K = { key: 0 }, ee = /* @__PURE__ */ B({
7
+ name: "ApFieldSelect",
8
+ __name: "index",
9
+ props: {
10
+ mode: { default: "edit" },
11
+ fieldProps: { default: () => ({}) },
12
+ emptyText: { default: "-" },
13
+ request: {},
14
+ multiple: { type: Boolean },
15
+ value: {},
16
+ "onUpdate:value": {}
17
+ },
18
+ emits: ["update:value"],
19
+ setup(S, { expose: g, emit: F }) {
20
+ var p, m;
21
+ let s = 0;
22
+ const b = (e, l) => typeof (l == null ? void 0 : l.label) == "string" && l.label.indexOf(e) > -1, w = D((e) => {
23
+ if (!P(t.request))
24
+ return;
25
+ s += 1;
26
+ const l = s;
27
+ u.value = [], n.value = !0, t.request(e).then((o) => {
28
+ s === l && (u.value = o);
29
+ }).finally(() => {
30
+ n.value = !1;
31
+ });
32
+ }, 300), t = S, u = d(((p = t.fieldProps) == null ? void 0 : p.options) || []), f = d(), n = d(((m = t.fieldProps) == null ? void 0 : m.loading) || !1), k = F;
33
+ C(() => {
34
+ if (P(t.request)) {
35
+ n.value = !0, s += 1;
36
+ const e = s;
37
+ t.request().then((l) => {
38
+ e === s && (u.value = l);
39
+ }).finally(() => {
40
+ n.value = !1;
41
+ });
42
+ }
43
+ });
44
+ const { value: c, updateValue: _ } = J(t, k), x = v(() => {
45
+ const e = a(c);
46
+ if (!e)
47
+ return t.emptyText;
48
+ if (E(e))
49
+ return e.map(
50
+ (o) => {
51
+ var r;
52
+ return (r = a(u).find((i) => i.value === o)) == null ? void 0 : r.label;
53
+ }
54
+ ).filter(Boolean).join("、") || t.emptyText;
55
+ const l = a(u).find((o) => o.value === e);
56
+ return (l == null ? void 0 : l.label) || t.emptyText;
57
+ }), O = v(() => {
58
+ var o, r, i;
59
+ const l = !!((o = t.fieldProps) != null && o.showSearch) ? {
60
+ showArrow: !1,
61
+ defaultActiveFirstOption: !1,
62
+ onSearch: w,
63
+ notFoundContent: n.value ? void 0 : null
64
+ } : {
65
+ showArrow: !0
66
+ };
67
+ return {
68
+ ...t.fieldProps,
69
+ ...l,
70
+ filterOption: t.fieldProps.showSearch ? !1 : L((r = t.fieldProps) == null ? void 0 : r.filterOption) ? b : (i = t.fieldProps) == null ? void 0 : i.filterOption
71
+ };
72
+ });
73
+ function q() {
74
+ var e;
75
+ (e = f.value) == null || e.focus();
76
+ }
77
+ function A() {
78
+ var e;
79
+ (e = f.value) == null || e.blur();
80
+ }
81
+ return g({
82
+ focus: q,
83
+ blur: A
84
+ }), (e, l) => e.mode === "read" ? (h(), V("span", K, T(x.value), 1)) : (h(), I(a(G), M({
85
+ key: 1,
86
+ "allow-clear": "",
87
+ ref_key: "selectRef",
88
+ ref: f
89
+ }, O.value, {
90
+ mode: e.multiple ? "multiple" : void 0,
91
+ value: a(c),
92
+ "onUpdate:value": a(_),
93
+ options: u.value,
94
+ loading: n.value
95
+ }), R({ _: 2 }, [
96
+ U(e.$slots, (o, r) => ({
97
+ name: r,
98
+ fn: y((i) => [
99
+ z(e.$slots, r, N($(i || {})))
100
+ ])
101
+ })),
102
+ n.value ? {
103
+ name: "notFoundContent",
104
+ fn: y(() => [
105
+ j(a(H), { size: "small" })
106
+ ]),
107
+ key: "0"
108
+ } : void 0
109
+ ]), 1040, ["mode", "value", "onUpdate:value", "options", "loading"]));
110
+ }
111
+ });
112
+ export {
113
+ ee as default
114
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,54 @@
1
+ import { ApFieldSwitchProps } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+
4
+ type ApFieldSwitch = {
5
+ checkedChildren: any;
6
+ unCheckedChildren: any;
7
+ default: any;
8
+ };
9
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSwitchProps>, {
10
+ emptyText: string;
11
+ checkedValue: boolean;
12
+ unCheckedValue: boolean;
13
+ size: string;
14
+ loading: undefined;
15
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
16
+ "update:checked": (...args: any[]) => void;
17
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldSwitchProps>, {
18
+ emptyText: string;
19
+ checkedValue: boolean;
20
+ unCheckedValue: boolean;
21
+ size: string;
22
+ loading: undefined;
23
+ }>>> & {
24
+ "onUpdate:checked"?: ((...args: any[]) => any) | undefined;
25
+ }, {
26
+ loading: boolean;
27
+ size: "default" | "small";
28
+ checkedValue: string | number | boolean;
29
+ unCheckedValue: string | number | boolean;
30
+ emptyText: string;
31
+ }, {}>, Readonly<ApFieldSwitch> & ApFieldSwitch>;
32
+ export default _default;
33
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
+ type __VLS_TypePropsToRuntimeProps<T> = {
35
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
36
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
37
+ } : {
38
+ type: PropType<T[K]>;
39
+ required: true;
40
+ };
41
+ };
42
+ type __VLS_WithDefaults<P, D> = {
43
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
44
+ default: D[K];
45
+ }> : P[K];
46
+ };
47
+ type __VLS_Prettify<T> = {
48
+ [K in keyof T]: T[K];
49
+ } & {};
50
+ type __VLS_WithTemplateSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };