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

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 (127) hide show
  1. package/es/index.mjs +86 -65
  2. package/es/src/ap-field/checkbox/helper.mjs +5 -0
  3. package/es/src/ap-field/checkbox/index.vue.d.ts +39 -0
  4. package/es/src/ap-field/checkbox/index.vue.mjs +56 -0
  5. package/es/src/ap-field/checkbox/index.vue2.mjs +4 -0
  6. package/es/src/ap-field/date/constant.mjs +50 -0
  7. package/es/src/ap-field/date/helper.d.ts +2 -0
  8. package/es/src/ap-field/date/helper.mjs +10 -0
  9. package/es/src/ap-field/date/index.vue.d.ts +57 -0
  10. package/es/src/ap-field/date/index.vue.mjs +75 -0
  11. package/es/src/ap-field/date/index.vue2.mjs +4 -0
  12. package/es/src/ap-field/date-range/index.vue.d.ts +59 -0
  13. package/es/src/ap-field/date-range/index.vue.mjs +87 -0
  14. package/es/src/ap-field/date-range/index.vue2.mjs +4 -0
  15. package/es/src/ap-field/index.d.ts +9 -3
  16. package/es/src/ap-field/interface.d.ts +64 -5
  17. package/es/src/ap-field/number/helper.d.ts +1 -0
  18. package/es/src/ap-field/number/helper.mjs +14 -0
  19. package/es/src/ap-field/number/index.vue.d.ts +72 -0
  20. package/es/src/ap-field/number/index.vue.mjs +108 -0
  21. package/es/src/ap-field/number/index.vue2.mjs +4 -0
  22. package/es/src/ap-field/number/style.css +6 -0
  23. package/es/src/ap-field/radio/helper.d.ts +4 -0
  24. package/es/src/ap-field/radio/helper.mjs +5 -0
  25. package/es/src/ap-field/radio/index.vue.d.ts +40 -0
  26. package/es/src/ap-field/radio/index.vue.mjs +68 -0
  27. package/es/src/ap-field/radio/index.vue2.mjs +4 -0
  28. package/es/src/ap-field/select/index.vue.d.ts +235 -0
  29. package/es/src/ap-field/select/index.vue.mjs +114 -0
  30. package/es/src/ap-field/select/index.vue2.mjs +4 -0
  31. package/es/src/ap-field/switch/index.vue.d.ts +54 -0
  32. package/es/src/ap-field/switch/index.vue.mjs +93 -0
  33. package/es/src/ap-field/switch/index.vue2.mjs +4 -0
  34. package/es/src/ap-field/text/index.vue.d.ts +63 -0
  35. package/es/src/ap-field/text/index.vue.mjs +132 -0
  36. package/es/src/ap-field/text/index.vue2.mjs +4 -0
  37. package/es/src/ap-field/text-area/index.vue.d.ts +49 -0
  38. package/es/src/ap-field/text-area/index.vue.mjs +86 -0
  39. package/es/src/ap-field/text-area/index.vue2.mjs +4 -0
  40. package/es/src/ap-field/text-area/style.css +5 -0
  41. package/es/src/ap-form/index.d.ts +12 -12
  42. package/es/src/basic/help.vue.d.ts +1 -1
  43. package/es/src/basic/index.d.ts +3 -3
  44. package/es/src/config-provider/config-provider.d.ts +2 -2
  45. package/es/src/config-provider/index.d.ts +6 -6
  46. package/es/src/design-token/index.d.ts +4 -0
  47. package/es/src/design-token/index.mjs +59 -0
  48. package/es/src/index.d.ts +2 -0
  49. package/es/src/index.mjs +104 -83
  50. package/es/src/modal/basic.vue.d.ts +1 -1
  51. package/es/src/modal/components/modal-footer.vue.d.ts +1 -1
  52. package/es/src/modal/components/modal.d.ts +1 -1
  53. package/es/src/modal/index.d.ts +3 -3
  54. package/es/src/pro-form/components/api-transfer.vue.d.ts +1 -1
  55. package/es/src/pro-form/hooks/use-form-events.mjs +22 -22
  56. package/es/src/pro-form/hooks/use-form-values.mjs +12 -12
  57. package/es/src/pro-form/hooks/use-label-width.d.ts +3 -3
  58. package/es/src/pro-form/pro-form.vue.mjs +23 -23
  59. package/es/src/pro-table/hooks/use-columns.mjs +24 -24
  60. package/es/src/theme/ap-field/number.css +6 -0
  61. package/es/src/theme/ap-field/text-area.css +5 -0
  62. package/es/src/type.d.ts +3 -1
  63. package/es/src/utils/index.d.ts +7 -0
  64. package/lib/index.js +1 -1
  65. package/lib/src/ap-field/checkbox/helper.js +1 -0
  66. package/lib/src/ap-field/checkbox/index.vue.d.ts +39 -0
  67. package/lib/src/ap-field/checkbox/index.vue.js +1 -0
  68. package/lib/src/ap-field/checkbox/index.vue2.js +1 -0
  69. package/lib/src/ap-field/date/constant.js +1 -0
  70. package/lib/src/ap-field/date/helper.d.ts +2 -0
  71. package/lib/src/ap-field/date/helper.js +1 -0
  72. package/lib/src/ap-field/date/index.vue.d.ts +57 -0
  73. package/lib/src/ap-field/date/index.vue.js +1 -0
  74. package/lib/src/ap-field/date/index.vue2.js +1 -0
  75. package/lib/src/ap-field/date-range/index.vue.d.ts +59 -0
  76. package/lib/src/ap-field/date-range/index.vue.js +1 -0
  77. package/lib/src/ap-field/date-range/index.vue2.js +1 -0
  78. package/lib/src/ap-field/index.d.ts +9 -3
  79. package/lib/src/ap-field/interface.d.ts +64 -5
  80. package/lib/src/ap-field/number/helper.d.ts +1 -0
  81. package/lib/src/ap-field/number/helper.js +1 -0
  82. package/lib/src/ap-field/number/index.vue.d.ts +72 -0
  83. package/lib/src/ap-field/number/index.vue.js +1 -0
  84. package/lib/src/ap-field/number/index.vue2.js +1 -0
  85. package/lib/src/ap-field/number/style.css +6 -0
  86. package/lib/src/ap-field/radio/helper.d.ts +4 -0
  87. package/lib/src/ap-field/radio/helper.js +1 -0
  88. package/lib/src/ap-field/radio/index.vue.d.ts +40 -0
  89. package/lib/src/ap-field/radio/index.vue.js +1 -0
  90. package/lib/src/ap-field/radio/index.vue2.js +1 -0
  91. package/lib/src/ap-field/select/index.vue.d.ts +235 -0
  92. package/lib/src/ap-field/select/index.vue.js +1 -0
  93. package/lib/src/ap-field/select/index.vue2.js +1 -0
  94. package/lib/src/ap-field/switch/index.vue.d.ts +54 -0
  95. package/lib/src/ap-field/switch/index.vue.js +1 -0
  96. package/lib/src/ap-field/switch/index.vue2.js +1 -0
  97. package/lib/src/ap-field/text/index.vue.d.ts +63 -0
  98. package/lib/src/ap-field/text/index.vue.js +1 -0
  99. package/lib/src/ap-field/text/index.vue2.js +1 -0
  100. package/lib/src/ap-field/text-area/index.vue.d.ts +49 -0
  101. package/lib/src/ap-field/text-area/index.vue.js +1 -0
  102. package/lib/src/ap-field/text-area/index.vue2.js +1 -0
  103. package/lib/src/ap-field/text-area/style.css +5 -0
  104. package/lib/src/ap-form/index.d.ts +12 -12
  105. package/lib/src/basic/help.vue.d.ts +1 -1
  106. package/lib/src/basic/index.d.ts +3 -3
  107. package/lib/src/config-provider/config-provider.d.ts +2 -2
  108. package/lib/src/config-provider/index.d.ts +6 -6
  109. package/lib/src/design-token/index.d.ts +4 -0
  110. package/lib/src/design-token/index.js +1 -0
  111. package/lib/src/index.d.ts +2 -0
  112. package/lib/src/index.js +1 -1
  113. package/lib/src/modal/basic.vue.d.ts +1 -1
  114. package/lib/src/modal/components/modal-footer.vue.d.ts +1 -1
  115. package/lib/src/modal/components/modal.d.ts +1 -1
  116. package/lib/src/modal/index.d.ts +3 -3
  117. package/lib/src/pro-form/components/api-transfer.vue.d.ts +1 -1
  118. package/lib/src/pro-form/hooks/use-form-events.js +1 -1
  119. package/lib/src/pro-form/hooks/use-form-values.js +1 -1
  120. package/lib/src/pro-form/hooks/use-label-width.d.ts +3 -3
  121. package/lib/src/pro-form/pro-form.vue.js +1 -1
  122. package/lib/src/pro-table/hooks/use-columns.js +1 -1
  123. package/lib/src/theme/ap-field/number.css +6 -0
  124. package/lib/src/theme/ap-field/text-area.css +5 -0
  125. package/lib/src/type.d.ts +3 -1
  126. package/lib/src/utils/index.d.ts +7 -0
  127. package/package.json +2 -2
@@ -0,0 +1,87 @@
1
+ import { defineComponent as V, computed as m, unref as t, openBlock as p, createElementBlock as k, Fragment as _, createTextVNode as T, toDisplayString as O, createVNode as C, createBlock as x, mergeProps as B, createSlots as N, renderList as w, withCtx as I, renderSlot as U, normalizeProps as $, guardReactiveProps as b } from "vue";
2
+ import { ApFieldDatePresetFormats as j, PRESET_FORMAT_MAP as z, PRESET_FORMAT_PICK_MAP as K, PRESET_FORMAT_TIME_MAP as L } from "../date/constant.mjs";
3
+ import "../../hooks/useMessage.mjs";
4
+ import { useControllableValue as Y } from "../../hooks/useControllableValue.mjs";
5
+ import { isNil as q, isString as c } from "lodash-unified";
6
+ import u from "dayjs";
7
+ import { DatePicker as G } from "ant-design-vue";
8
+ import { formatDay as d, formatValue as R } from "../date/helper.mjs";
9
+ import { SwapRightOutlined as H } from "@ant-design/icons-vue";
10
+ const ae = /* @__PURE__ */ V({
11
+ __name: "index",
12
+ props: {
13
+ mode: { default: "edit" },
14
+ fieldProps: { default: () => ({}) },
15
+ emptyText: { default: "-" },
16
+ value: {},
17
+ defaultValue: {},
18
+ onChange: {},
19
+ onOk: {},
20
+ format: { default: "Y-D" }
21
+ },
22
+ emits: ["update:value"],
23
+ setup(y, { emit: D }) {
24
+ const o = y, E = D, l = m(
25
+ () => j.indexOf(o.format) > -1
26
+ ), n = m(
27
+ () => l.value ? z[o.format] : o.format
28
+ ), { value: P, updateValue: v } = Y(
29
+ o,
30
+ E
31
+ ), s = m(() => {
32
+ var e, r;
33
+ if (!q(t(P)))
34
+ return [
35
+ u((e = t(P)) == null ? void 0 : e[0]),
36
+ u((r = t(P)) == null ? void 0 : r[1])
37
+ ];
38
+ }), S = m(() => t(l) ? o.fieldProps.picker ?? K[o.format] : o.fieldProps.picker), A = m(() => {
39
+ const e = t(l) ? L[o.format] : {};
40
+ return {
41
+ ...o.fieldProps,
42
+ ...e
43
+ };
44
+ });
45
+ function F(e) {
46
+ e || v(null);
47
+ const r = c(e[0]) ? u(e[0]) : e[0], a = c(e[1]) ? u(e[1]) : e[1];
48
+ t(l) ? v([
49
+ d(r, t(n)),
50
+ d(a, t(n), !1)
51
+ ]) : v([R(r), R(a)]);
52
+ }
53
+ function M(e) {
54
+ var i;
55
+ const r = c(e[0]) ? u(e[0]) : e[0], a = c(e[1]) ? u(e[1]) : e[1], f = e[0] ? t(l) ? d(r, t(n)) : r.valueOf() : null, g = e[1] ? t(l) ? d(a, t(n), !1) : a.valueOf() : null;
56
+ (i = o.onOk) == null || i.call(o, [f, g]);
57
+ }
58
+ return (e, r) => {
59
+ var a, f;
60
+ return e.mode === "read" ? (p(), k(_, { key: 0 }, [
61
+ s.value ? (p(), k(_, { key: 0 }, [
62
+ T(O((a = s.value[0]) == null ? void 0 : a.format(n.value)) + " ", 1),
63
+ C(t(H)),
64
+ T(" " + O((f = s.value[1]) == null ? void 0 : f.format(n.value)), 1)
65
+ ], 64)) : (p(), k(_, { key: 1 }, [
66
+ T(O(e.emptyText), 1)
67
+ ], 64))
68
+ ], 64)) : (p(), x(t(G).RangePicker, B({ key: 1 }, A.value, {
69
+ value: s.value,
70
+ "onUpdate:value": F,
71
+ picker: S.value,
72
+ format: n.value,
73
+ onOk: M
74
+ }), N({ _: 2 }, [
75
+ w(e.$slots, (g, i) => ({
76
+ name: i,
77
+ fn: I((h) => [
78
+ U(e.$slots, i, $(b(h || {})))
79
+ ])
80
+ }))
81
+ ]), 1040, ["value", "picker", "format"]));
82
+ };
83
+ }
84
+ });
85
+ export {
86
+ ae as default
87
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,6 +1,12 @@
1
1
  import { default as ApFieldText } from './text/index.vue';
2
- import { default as ApFiledCheckbox } from './checkbox/index.vue';
3
- import { default as ApFiledDate } from './date/index.vue';
2
+ import { default as ApFieldCheckbox } from './checkbox/index.vue';
3
+ import { default as ApFieldDate } from './date/index.vue';
4
+ import { default as ApFieldNumber } from './number/index.vue';
5
+ import { default as ApFieldRadio } from './radio/index.vue';
6
+ import { default as ApFieldSwitch } from './switch/index.vue';
7
+ import { default as ApFieldTextArea } from './text-area/index.vue';
8
+ import { default as ApFieldDateRange } from './date-range/index.vue';
9
+ import { default as ApFieldSelect } from './select/index.vue';
4
10
 
5
11
  export * from './interface';
6
- export { ApFieldText, ApFiledCheckbox, ApFiledDate };
12
+ export { ApFieldText, ApFieldCheckbox, ApFieldDate, ApFieldNumber, ApFieldRadio, ApFieldSwitch, ApFieldTextArea, ApFieldDateRange, ApFieldSelect };
@@ -1,18 +1,24 @@
1
- import { InputProps, CheckboxGroupProps, DatePickerProps } from 'ant-design-vue';
1
+ import { InputProps, CheckboxGroupProps, DatePickerProps, InputNumberProps, RadioGroupProps, SwitchProps, TextAreaProps, SelectProps } from 'ant-design-vue';
2
2
  import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
3
3
  import { ApFormatPresetType } from './date/interface';
4
- import { PanelMode } from 'ant-design-vue/es/vc-picker/interface';
4
+ import { RangeValue } from 'ant-design-vue/es/vc-picker/interface';
5
+ import { RangePickerProps } from 'ant-design-vue/es/date-picker/dayjs';
5
6
 
6
7
  export type FieldMode = 'read' | 'edit';
7
8
  export type BasicApFieldProps<FieldPropsType = any> = {
8
9
  mode?: FieldMode;
9
10
  } & FieldPropsType;
11
+ export type ApFieldComposedProps<FieldPropsType = any> = {
12
+ mode?: FieldMode;
13
+ fieldProps?: FieldPropsType;
14
+ };
10
15
  export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
11
16
  emptyText?: string;
12
17
  };
13
18
  export type ApFieldTextExpose = {
14
19
  focus: (options?: InputFocusOptions) => void;
15
20
  blur: () => void;
21
+ input: any;
16
22
  setSelectionRange: (start: number, end: number, direction?: 'forward' | 'backward' | 'none') => void;
17
23
  select: () => void;
18
24
  };
@@ -20,12 +26,65 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
20
26
  emptyText?: string;
21
27
  request?: () => Promise<CheckboxGroupProps['options']>;
22
28
  };
23
- export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue'>> & {
29
+ export type ApFieldDateProps = ApFieldComposedProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format'>> & {
24
30
  emptyText?: string;
25
31
  value?: number | null;
26
32
  defaultValue?: number;
27
33
  onChange?: (ts: number | null, dayStr: string) => void;
28
34
  onOk?: (ts: number | null) => void;
29
- format?: ApFormatPresetType;
30
- pickerMode?: PanelMode | undefined;
35
+ format?: ApFormatPresetType | string;
36
+ };
37
+ export type ApFieldNumberProps = BasicApFieldProps<InputNumberProps> & {
38
+ emptyText?: string;
39
+ /**
40
+ * 是否展示千分位,只读模式可用
41
+ */
42
+ thousands?: boolean;
43
+ /**
44
+ * 强制保留指定的小数位,只读模式可用,只有在设置了`precision`才生效
45
+ */
46
+ limitDecimalsRetain?: boolean;
47
+ };
48
+ export type ApiFieldNumberExpose = {
49
+ focus: () => void;
50
+ blur: () => void;
51
+ };
52
+ export type ApFieldRadioProps = BasicApFieldProps<RadioGroupProps> & {
53
+ emptyText?: string;
54
+ request?: () => Promise<RadioGroupProps['options']>;
55
+ };
56
+ export type ApiFieldRadioExpose = {
57
+ focus: () => void;
58
+ blur: () => void;
59
+ };
60
+ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>> & {
61
+ emptyText?: string;
62
+ onAction?: (checked: string | boolean | number, e: Event) => boolean | Promise<boolean>;
63
+ };
64
+ export type ApFieldTextAreaProps = BasicApFieldProps<TextAreaProps> & {
65
+ emptyText?: string;
66
+ };
67
+ export type ApFieldTextAreaExpose = {
68
+ focus: (options?: InputFocusOptions) => void;
69
+ blur: () => void;
70
+ resizableTextArea: any;
71
+ };
72
+ export type ApFieldDateRangeProps = ApFieldComposedProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter'>> & {
73
+ emptyText?: string;
74
+ value?: RangeValue<number>;
75
+ defaultValue?: RangeValue<number>;
76
+ onChange?: (ts: RangeValue<number>, dayStr: string) => void;
77
+ onOk?: (ts: RangeValue<number>) => void;
78
+ format?: ApFormatPresetType | string;
79
+ };
80
+ export type ApFieldSelectProps = ApFieldComposedProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
81
+ emptyText?: string;
82
+ request?: (value?: string) => Promise<SelectProps['options']>;
83
+ multiple?: boolean;
84
+ value?: SelectProps['value'];
85
+ 'onUpdate:value'?: SelectProps['onUpdate:value'];
86
+ };
87
+ export type ApFieldSelectSlots = {
88
+ focus: () => void;
89
+ blur: () => void;
31
90
  };
@@ -0,0 +1 @@
1
+ export declare function addZeroToDecimalPlaces(numStr: string, precision?: number): string;
@@ -0,0 +1,14 @@
1
+ import { isNil as i } from "lodash-unified";
2
+ function a(t, r) {
3
+ if (i(r))
4
+ return t;
5
+ let [f, e] = t.split(".");
6
+ if (!e || e.length >= r)
7
+ return t;
8
+ for (let l = e.length; l < r; l++)
9
+ e += "0";
10
+ return f + "." + e;
11
+ }
12
+ export {
13
+ a as addZeroToDecimalPlaces
14
+ };
@@ -0,0 +1,72 @@
1
+ import { ApFieldNumberProps } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ import { ValueType } from 'ant-design-vue/es/input-number/src/utils/MiniDecimal';
4
+
5
+ type ApFieldNumberSlots = {
6
+ addonBefore?: any;
7
+ addonAfter?: any;
8
+ prefix?: any;
9
+ default?: any;
10
+ upIcon?: any;
11
+ downIcon?: any;
12
+ };
13
+ declare function focus(): void;
14
+ declare function blur(): void;
15
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldNumberProps>, {
16
+ emptyText: string;
17
+ thousands: boolean;
18
+ bordered: boolean;
19
+ controls: boolean;
20
+ keyboard: boolean;
21
+ max: number;
22
+ min: number;
23
+ step: number;
24
+ }>, {
25
+ focus: typeof focus;
26
+ blur: typeof blur;
27
+ }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
28
+ "update:value": (...args: any[]) => void;
29
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldNumberProps>, {
30
+ emptyText: string;
31
+ thousands: boolean;
32
+ bordered: boolean;
33
+ controls: boolean;
34
+ keyboard: boolean;
35
+ max: number;
36
+ min: number;
37
+ step: number;
38
+ }>>> & {
39
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
40
+ }, {
41
+ bordered: boolean;
42
+ min: ValueType;
43
+ max: ValueType;
44
+ step: ValueType;
45
+ controls: boolean;
46
+ keyboard: boolean;
47
+ emptyText: string;
48
+ thousands: boolean;
49
+ }, {}>, Readonly<ApFieldNumberSlots> & ApFieldNumberSlots>;
50
+ export default _default;
51
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
52
+ type __VLS_TypePropsToRuntimeProps<T> = {
53
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
54
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
55
+ } : {
56
+ type: PropType<T[K]>;
57
+ required: true;
58
+ };
59
+ };
60
+ type __VLS_WithDefaults<P, D> = {
61
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
62
+ default: D[K];
63
+ }> : P[K];
64
+ };
65
+ type __VLS_Prettify<T> = {
66
+ [K in keyof T]: T[K];
67
+ } & {};
68
+ type __VLS_WithTemplateSlots<T, S> = T & {
69
+ new (): {
70
+ $slots: S;
71
+ };
72
+ };
@@ -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
+ };