@aplus-frontend/ui 0.0.1-beta.4 → 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.
- package/es/index.mjs +86 -65
- package/es/src/ap-field/checkbox/helper.mjs +5 -0
- package/es/src/ap-field/checkbox/index.vue.d.ts +39 -0
- package/es/src/ap-field/checkbox/index.vue.mjs +56 -0
- package/es/src/ap-field/checkbox/index.vue2.mjs +4 -0
- package/es/src/ap-field/date/constant.d.ts +11 -1
- package/es/src/ap-field/date/constant.mjs +50 -0
- package/es/src/ap-field/date/helper.d.ts +5 -0
- package/es/src/ap-field/date/helper.mjs +10 -0
- package/es/src/ap-field/date/index.vue.d.ts +57 -0
- package/es/src/ap-field/date/index.vue.mjs +75 -0
- package/es/src/ap-field/date/index.vue2.mjs +4 -0
- package/es/src/ap-field/date/interface.d.ts +1 -0
- package/es/src/ap-field/date-range/index.vue.d.ts +59 -0
- package/es/src/ap-field/date-range/index.vue.mjs +87 -0
- package/es/src/ap-field/date-range/index.vue2.mjs +4 -0
- package/es/src/ap-field/index.d.ts +9 -2
- package/es/src/ap-field/interface.d.ts +66 -7
- package/es/src/ap-field/number/helper.d.ts +1 -0
- package/es/src/ap-field/number/helper.mjs +14 -0
- package/es/src/ap-field/number/index.vue.d.ts +72 -0
- package/es/src/ap-field/number/index.vue.mjs +108 -0
- package/es/src/ap-field/number/index.vue2.mjs +4 -0
- package/es/src/ap-field/number/style.css +6 -0
- package/es/src/ap-field/radio/helper.d.ts +4 -0
- package/es/src/ap-field/radio/helper.mjs +5 -0
- package/es/src/ap-field/radio/index.vue.d.ts +40 -0
- package/es/src/ap-field/radio/index.vue.mjs +68 -0
- package/es/src/ap-field/radio/index.vue2.mjs +4 -0
- package/es/src/ap-field/select/index.vue.d.ts +235 -0
- package/es/src/ap-field/select/index.vue.mjs +114 -0
- package/es/src/ap-field/select/index.vue2.mjs +4 -0
- package/es/src/ap-field/switch/index.vue.d.ts +54 -0
- package/es/src/ap-field/switch/index.vue.mjs +93 -0
- package/es/src/ap-field/switch/index.vue2.mjs +4 -0
- package/es/src/ap-field/text/index.vue.d.ts +63 -0
- package/es/src/ap-field/text/index.vue.mjs +132 -0
- package/es/src/ap-field/text/index.vue2.mjs +4 -0
- package/es/src/ap-field/text-area/index.vue.d.ts +49 -0
- package/es/src/ap-field/text-area/index.vue.mjs +86 -0
- package/es/src/ap-field/text-area/index.vue2.mjs +4 -0
- package/es/src/ap-field/text-area/style.css +5 -0
- package/es/src/ap-form/index.d.ts +12 -12
- package/es/src/basic/help.vue.d.ts +1 -1
- package/es/src/basic/index.d.ts +3 -3
- package/es/src/config-provider/config-provider.d.ts +2 -2
- package/es/src/config-provider/index.d.ts +6 -6
- package/es/src/design-token/index.d.ts +4 -0
- package/es/src/design-token/index.mjs +59 -0
- package/es/src/hooks/useControllableValue.mjs +9 -9
- package/es/src/index.d.ts +2 -0
- package/es/src/index.mjs +104 -83
- package/es/src/modal/basic.vue.d.ts +1 -1
- package/es/src/modal/components/modal-footer.vue.d.ts +1 -1
- package/es/src/modal/components/modal.d.ts +1 -1
- package/es/src/modal/index.d.ts +3 -3
- package/es/src/modal/style/index.css +2 -2
- package/es/src/pro-form/components/api-transfer.vue.d.ts +1 -1
- package/es/src/pro-form/hooks/use-form-events.mjs +22 -22
- package/es/src/pro-form/hooks/use-form-values.mjs +12 -12
- package/es/src/pro-form/hooks/use-label-width.d.ts +3 -3
- package/es/src/pro-form/pro-form.vue.mjs +23 -23
- package/es/src/pro-table/hooks/use-columns.mjs +24 -24
- package/es/src/theme/ap-field/number.css +6 -0
- package/es/src/theme/ap-field/text-area.css +5 -0
- package/es/src/theme/modal/index.css +2 -2
- package/es/src/type.d.ts +3 -1
- package/es/src/utils/index.d.ts +7 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/checkbox/helper.js +1 -0
- package/lib/src/ap-field/checkbox/index.vue.d.ts +39 -0
- package/lib/src/ap-field/checkbox/index.vue.js +1 -0
- package/lib/src/ap-field/checkbox/index.vue2.js +1 -0
- package/lib/src/ap-field/date/constant.d.ts +11 -1
- package/lib/src/ap-field/date/constant.js +1 -0
- package/lib/src/ap-field/date/helper.d.ts +5 -0
- package/lib/src/ap-field/date/helper.js +1 -0
- package/lib/src/ap-field/date/index.vue.d.ts +57 -0
- package/lib/src/ap-field/date/index.vue.js +1 -0
- package/lib/src/ap-field/date/index.vue2.js +1 -0
- package/lib/src/ap-field/date/interface.d.ts +1 -0
- package/lib/src/ap-field/date-range/index.vue.d.ts +59 -0
- package/lib/src/ap-field/date-range/index.vue.js +1 -0
- package/lib/src/ap-field/date-range/index.vue2.js +1 -0
- package/lib/src/ap-field/index.d.ts +9 -2
- package/lib/src/ap-field/interface.d.ts +66 -7
- package/lib/src/ap-field/number/helper.d.ts +1 -0
- package/lib/src/ap-field/number/helper.js +1 -0
- package/lib/src/ap-field/number/index.vue.d.ts +72 -0
- package/lib/src/ap-field/number/index.vue.js +1 -0
- package/lib/src/ap-field/number/index.vue2.js +1 -0
- package/lib/src/ap-field/number/style.css +6 -0
- package/lib/src/ap-field/radio/helper.d.ts +4 -0
- package/lib/src/ap-field/radio/helper.js +1 -0
- package/lib/src/ap-field/radio/index.vue.d.ts +40 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -0
- package/lib/src/ap-field/radio/index.vue2.js +1 -0
- package/lib/src/ap-field/select/index.vue.d.ts +235 -0
- package/lib/src/ap-field/select/index.vue.js +1 -0
- package/lib/src/ap-field/select/index.vue2.js +1 -0
- package/lib/src/ap-field/switch/index.vue.d.ts +54 -0
- package/lib/src/ap-field/switch/index.vue.js +1 -0
- package/lib/src/ap-field/switch/index.vue2.js +1 -0
- package/lib/src/ap-field/text/index.vue.d.ts +63 -0
- package/lib/src/ap-field/text/index.vue.js +1 -0
- package/lib/src/ap-field/text/index.vue2.js +1 -0
- package/lib/src/ap-field/text-area/index.vue.d.ts +49 -0
- package/lib/src/ap-field/text-area/index.vue.js +1 -0
- package/lib/src/ap-field/text-area/index.vue2.js +1 -0
- package/lib/src/ap-field/text-area/style.css +5 -0
- package/lib/src/ap-form/index.d.ts +12 -12
- package/lib/src/basic/help.vue.d.ts +1 -1
- package/lib/src/basic/index.d.ts +3 -3
- package/lib/src/config-provider/config-provider.d.ts +2 -2
- package/lib/src/config-provider/index.d.ts +6 -6
- package/lib/src/design-token/index.d.ts +4 -0
- package/lib/src/design-token/index.js +1 -0
- package/lib/src/hooks/useControllableValue.js +1 -1
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.js +1 -1
- package/lib/src/modal/basic.vue.d.ts +1 -1
- package/lib/src/modal/components/modal-footer.vue.d.ts +1 -1
- package/lib/src/modal/components/modal.d.ts +1 -1
- package/lib/src/modal/index.d.ts +3 -3
- package/lib/src/modal/style/index.css +2 -2
- package/lib/src/pro-form/components/api-transfer.vue.d.ts +1 -1
- package/lib/src/pro-form/hooks/use-form-events.js +1 -1
- package/lib/src/pro-form/hooks/use-form-values.js +1 -1
- package/lib/src/pro-form/hooks/use-label-width.d.ts +3 -3
- package/lib/src/pro-form/pro-form.vue.js +1 -1
- package/lib/src/pro-table/hooks/use-columns.js +1 -1
- package/lib/src/theme/ap-field/number.css +6 -0
- package/lib/src/theme/ap-field/text-area.css +5 -0
- package/lib/src/theme/modal/index.css +2 -2
- package/lib/src/type.d.ts +3 -1
- package/lib/src/utils/index.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { InputProps, CheckboxGroupProps } 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
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { ApFormatPresetType } from './date/interface';
|
|
4
|
+
import { RangeValue } from 'ant-design-vue/es/vc-picker/interface';
|
|
5
|
+
import { RangePickerProps } from 'ant-design-vue/es/date-picker/dayjs';
|
|
6
6
|
|
|
7
7
|
export type FieldMode = 'read' | 'edit';
|
|
8
8
|
export type BasicApFieldProps<FieldPropsType = any> = {
|
|
9
9
|
mode?: FieldMode;
|
|
10
10
|
} & FieldPropsType;
|
|
11
|
+
export type ApFieldComposedProps<FieldPropsType = any> = {
|
|
12
|
+
mode?: FieldMode;
|
|
13
|
+
fieldProps?: FieldPropsType;
|
|
14
|
+
};
|
|
11
15
|
export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
12
16
|
emptyText?: string;
|
|
13
17
|
};
|
|
14
18
|
export type ApFieldTextExpose = {
|
|
15
19
|
focus: (options?: InputFocusOptions) => void;
|
|
16
20
|
blur: () => void;
|
|
21
|
+
input: any;
|
|
17
22
|
setSelectionRange: (start: number, end: number, direction?: 'forward' | 'backward' | 'none') => void;
|
|
18
23
|
select: () => void;
|
|
19
24
|
};
|
|
@@ -21,11 +26,65 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
|
|
|
21
26
|
emptyText?: string;
|
|
22
27
|
request?: () => Promise<CheckboxGroupProps['options']>;
|
|
23
28
|
};
|
|
24
|
-
export type
|
|
25
|
-
export type ApFieldDateProps = BasicApFieldProps<OmitValue<PickerBaseProps<Dayjs>> | OmitValue<PickerDateProps<Dayjs>> | OmitValue<PickerTimeProps<Dayjs>>> & {
|
|
29
|
+
export type ApFieldDateProps = ApFieldComposedProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format'>> & {
|
|
26
30
|
emptyText?: string;
|
|
27
31
|
value?: number | null;
|
|
28
32
|
defaultValue?: number;
|
|
29
33
|
onChange?: (ts: number | null, dayStr: string) => void;
|
|
30
|
-
|
|
34
|
+
onOk?: (ts: number | null) => void;
|
|
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 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash-unified");function a(t,l){if(o.isNil(l))return t;let[i,e]=t.split(".");if(!e||e.length>=l)return t;for(let r=e.length;r<l;r++)e+="0";return i+"."+e}exports.addZeroToDecimalPlaces=a;
|
|
@@ -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 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("ant-design-vue");require("../../hooks/useMessage.js");const k=require("../../hooks/useControllableValue.js"),u=require("lodash-unified"),g=require("@fruits-chain/utils"),S=require("./helper.js");require("../../config-provider/index.js");require("./style.css");const q=require("../../config-provider/hooks/use-namespace.js"),C=e.defineComponent({name:"ApFieldNumber",inheritAttrs:!1,__name:"index",props:{mode:{},size:{},bordered:{type:Boolean,default:!0},placeholder:{},name:{},id:{},type:{},addonBefore:{},addonAfter:{},prefix:{},"onUpdate:value":{},valueModifiers:{},status:{},stringMode:{type:Boolean},defaultValue:{},value:{},prefixCls:{},min:{default:-1/0},max:{default:1/0},step:{default:1},tabindex:{},controls:{type:Boolean,default:!0},readonly:{type:Boolean},disabled:{type:Boolean},autofocus:{type:Boolean},keyboard:{type:Boolean,default:!0},parser:{},formatter:{},precision:{},decimalSeparator:{},onInput:{},onChange:{},onPressEnter:{},onStep:{},onBlur:{},onFocus:{},emptyText:{default:"-"},thousands:{type:Boolean,default:!1},limitDecimalsRetain:{type:Boolean}},emits:["update:value"],setup(i,{expose:p,emit:d}){const c=d,{b:a}=q.useNamespace("field-number"),o=i,n=e.ref(),{value:l,updateValue:f}=k.useControllableValue(o,c),m=e.computed(()=>{let t=e.unref(l);if(u.isNil(t))return o.emptyText;let r=g.toDecimalMark(t,o.precision);return o.precision&&o.limitDecimalsRetain&&(r=S.addZeroToDecimalPlaces(r,o.precision)),r});function y(){var t;(t=n.value)==null||t.focus()}function v(){var t;(t=n.value)==null||t.blur()}return p({focus:y,blur:v}),(t,r)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a)("label-left"))},[e.renderSlot(t.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(m.value),1),t.$slots.addonAfter?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a)("label-right"))},[e.renderSlot(t.$slots,"addonAfter")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(e.unref(b.InputNumber),e.mergeProps({key:1},e.unref(u.omit)(o,["precision","value","update:value"]),{value:e.unref(l),"onUpdate:value":e.unref(f),precision:t.precision,ref_key:"inputRef",ref:n}),e.createSlots({_:2},[e.renderList(t.$slots,(h,s)=>({name:s,fn:e.withCtx(B=>[e.renderSlot(t.$slots,s,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1040,["value","onUpdate:value","precision"]))}});exports.default=C;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>typeof e=="object"?e.value:e,o=e=>typeof e=="object"?e.label:e;exports.getOptionLabel=o;exports.getOptionValue=t;
|
|
@@ -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 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("ant-design-vue");require("../../hooks/useMessage.js");const x=require("../../hooks/useControllableValue.js"),i=require("lodash-unified"),s=require("./helper.js"),_=e.defineComponent({name:"ApFieldRadio",inheritAttrs:!1,__name:"index",props:{mode:{default:"edit"},prefixCls:{},value:{},size:{},options:{},disabled:{type:Boolean},name:{},buttonStyle:{},id:{},optionType:{},onChange:{},"onUpdate:value":{},emptyText:{default:"-"},request:{}},emits:["update:value"],setup(d,{expose:c,emit:p}){const o=d,f=p,u=e.ref(),a=e.ref((o==null?void 0:o.options)||[]),{value:l,updateValue:v}=x.useControllableValue(o,f);e.onMounted(()=>{var t;(t=o.request)==null||t.call(o).then(n=>a.value=n)});const m=e.computed(()=>{var r;const t=e.unref(l);if(i.isNil(t))return o.emptyText;const n=(r=a.value)==null?void 0:r.find(b=>t===s.getOptionValue(b));return s.getOptionLabel(n)||o.emptyText});function g(){var t;(t=u.value)==null||t.focus()}function y(){var t;(t=u.value)==null||t.blur()}return c({focus:g,blur:y}),(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(m.value),1)],64)):(e.openBlock(),e.createBlock(e.unref(q.RadioGroup),e.mergeProps({key:1},e.unref(i.omit)(o,["value","update:value","options"]),{value:e.unref(l),"onUpdate:value":e.unref(v),options:a.value,ref_key:"radioGroupRef",ref:u}),null,16,["value","onUpdate:value","options"]))}});exports.default=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.js");exports.default=e.default;
|
|
@@ -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
|
+
}>>, "value" | "mode" | "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 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("lodash-unified"),m=require("ant-design-vue");require("../../hooks/useMessage.js");const C=require("../../hooks/useControllableValue.js"),O={key:0},V=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},fieldProps:{default:()=>({})},emptyText:{default:"-"},request:{},multiple:{type:Boolean},value:{},"onUpdate:value":{}},emits:["update:value"],setup(h,{expose:y,emit:P}){var p,v;let s=0;const S=(t,o)=>typeof(o==null?void 0:o.label)=="string"&&o.label.indexOf(t)>-1,g=c.debounce(t=>{if(!c.isFunction(l.request))return;s+=1;const o=s;a.value=[],u.value=!0,l.request(t).then(r=>{s===o&&(a.value=r)}).finally(()=>{u.value=!1})},300),l=h,a=e.ref(((p=l.fieldProps)==null?void 0:p.options)||[]),f=e.ref(),u=e.ref(((v=l.fieldProps)==null?void 0:v.loading)||!1),b=P;e.onMounted(()=>{if(c.isFunction(l.request)){u.value=!0,s+=1;const t=s;l.request().then(o=>{t===s&&(a.value=o)}).finally(()=>{u.value=!1})}});const{value:d,updateValue:q}=C.useControllableValue(l,b),F=e.computed(()=>{const t=e.unref(d);if(!t)return l.emptyText;if(c.isArray(t))return t.map(r=>{var n;return(n=e.unref(a).find(i=>i.value===r))==null?void 0:n.label}).filter(Boolean).join("、")||l.emptyText;const o=e.unref(a).find(r=>r.value===t);return(o==null?void 0:o.label)||l.emptyText}),w=e.computed(()=>{var r,n,i;const o=!!((r=l.fieldProps)!=null&&r.showSearch)?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:g,notFoundContent:u.value?void 0:null}:{showArrow:!0};return{...l.fieldProps,...o,filterOption:l.fieldProps.showSearch?!1:c.isNil((n=l.fieldProps)==null?void 0:n.filterOption)?S:(i=l.fieldProps)==null?void 0:i.filterOption}});function _(){var t;(t=f.value)==null||t.focus()}function k(){var t;(t=f.value)==null||t.blur()}return y({focus:_,blur:k}),(t,o)=>t.mode==="read"?(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(F.value),1)):(e.openBlock(),e.createBlock(e.unref(m.Select),e.mergeProps({key:1,"allow-clear":"",ref_key:"selectRef",ref:f},w.value,{mode:t.multiple?"multiple":void 0,value:e.unref(d),"onUpdate:value":e.unref(q),options:a.value,loading:u.value}),e.createSlots({_:2},[e.renderList(t.$slots,(r,n)=>({name:n,fn:e.withCtx(i=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(i||{})))])})),u.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(m.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","onUpdate:value","options","loading"]))}});exports.default=V;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.js");exports.default=e.default;
|
|
@@ -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
|
+
size: "small" | "default";
|
|
27
|
+
loading: boolean;
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("ant-design-vue");require("../../hooks/useMessage.js");const g=require("../../hooks/useControllableValue.js"),i=require("lodash-unified"),y=require("@fruits-chain/utils"),v=e.defineComponent({name:"ApFieldSwitch",__name:"index",props:{mode:{},id:{},prefixCls:{},size:{default:"default"},disabled:{type:Boolean},checkedChildren:{},unCheckedChildren:{},tabindex:{},autofocus:{type:Boolean},loading:{type:Boolean,default:void 0},checked:{},checkedValue:{default:!0},unCheckedValue:{default:!1},onChange:{},onKeydown:{},onMouseup:{},"onUpdate:checked":{},onBlur:{},onFocus:{},emptyText:{default:"-"},onAction:{}},emits:["update:checked"],setup(s,{emit:h}){const t=e.useSlots(),o=s,f=h,{value:d,updateValue:a}=g.useControllableValue(o,f,{valuePropName:"checked"}),l=e.ref(!1);async function k(n,r){if(!y.isDef(o.onAction)){a(n);return}l.value=!0;try{await o.onAction(n,r)&&a(n)}finally{l.value=!1}}const p=e.computed(()=>{var c,u;const n=e.unref(d);return i.isNil(n)?e.createVNode(e.Fragment,null,[o.emptyText]):n===o.checkedValue?e.createVNode(e.Fragment,null,[o.checkedChildren||((c=t.checkedChildren)==null?void 0:c.call(t))||o.checkedValue]):e.createVNode(e.Fragment,null,[o.unCheckedChildren||((u=t.unCheckedChildren)==null?void 0:u.call(t))||o.unCheckedValue])});return(n,r)=>n.mode==="read"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),{key:0})):(e.openBlock(),e.createBlock(e.unref(m.Switch),e.mergeProps({key:1},e.unref(i.omit)(o,"onUpdate:checked"),{checked:e.unref(d),onClick:k,loading:n.loading??l.value}),e.createSlots({_:2},[e.renderList(n.$slots,(c,u)=>({name:u,fn:e.withCtx(C=>[e.renderSlot(n.$slots,u,e.normalizeProps(e.guardReactiveProps(C||{})))])}))]),1040,["checked","loading"]))}});exports.default=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.js");exports.default=e.default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ApFieldTextProps, FieldMode } from '../interface';
|
|
2
|
+
import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
|
|
3
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
4
|
+
|
|
5
|
+
type ApFieldTextSlots = {
|
|
6
|
+
addonAfter(): any;
|
|
7
|
+
addonBefore(): any;
|
|
8
|
+
prefix(): any;
|
|
9
|
+
suffix(): any;
|
|
10
|
+
clearIcon(): any;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldTextProps>, {
|
|
13
|
+
emptyText: string;
|
|
14
|
+
mode: string;
|
|
15
|
+
bordered: boolean;
|
|
16
|
+
type: string;
|
|
17
|
+
lazy: boolean;
|
|
18
|
+
}>, {
|
|
19
|
+
focus: (options?: InputFocusOptions | undefined) => void;
|
|
20
|
+
blur: () => void;
|
|
21
|
+
input: any;
|
|
22
|
+
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none" | undefined) => void;
|
|
23
|
+
select: () => void;
|
|
24
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
25
|
+
"update:value": (...args: any[]) => void;
|
|
26
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldTextProps>, {
|
|
27
|
+
emptyText: string;
|
|
28
|
+
mode: string;
|
|
29
|
+
bordered: boolean;
|
|
30
|
+
type: string;
|
|
31
|
+
lazy: boolean;
|
|
32
|
+
}>>> & {
|
|
33
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
mode: FieldMode;
|
|
36
|
+
type: "number" | "hidden" | "button" | "time" | "reset" | "submit" | "image" | "text" | "search" | "color" | "checkbox" | "radio" | "range" | "date" | "url" | "email" | "week" | "month" | "datetime-local" | "file" | "password" | "tel";
|
|
37
|
+
lazy: boolean;
|
|
38
|
+
bordered: boolean;
|
|
39
|
+
emptyText: string;
|
|
40
|
+
}, {}>, Readonly<ApFieldTextSlots> & ApFieldTextSlots>;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
43
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
44
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
45
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
46
|
+
} : {
|
|
47
|
+
type: PropType<T[K]>;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
type __VLS_WithDefaults<P, D> = {
|
|
52
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
53
|
+
default: D[K];
|
|
54
|
+
}> : P[K];
|
|
55
|
+
};
|
|
56
|
+
type __VLS_Prettify<T> = {
|
|
57
|
+
[K in keyof T]: T[K];
|
|
58
|
+
} & {};
|
|
59
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),y=require("ant-design-vue");require("../../hooks/useMessage.js");const v=require("../../hooks/useControllableValue.js"),x=require("lodash-unified");function g(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!o.isVNode(l)}const B=o.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onFocus:{},onBlur:{},onChange:{},onInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean},emptyText:{default:"-"}},emits:["update:value"],setup(l,{expose:i,emit:c}){const a=o.ref(),t=o.useSlots();i({focus:e=>{var n;(n=a.value)==null||n.focus(e)},blur:()=>{var e;(e=a.value)==null||e.blur()},setSelectionRange:(e,n,m)=>{var r;(r=a.value)==null||r.setSelectionRange(e,n,m)},select:()=>{var e;(e=a.value)==null||e.select()},input:o.computed(()=>{var e;return(e=a.value)==null?void 0:e.input})});const d=c,u=l,{value:p,updateValue:s}=v.useControllableValue(u,d);function f(){var e,n;return u.mode==="edit"?o.createVNode(y.Input,o.mergeProps(x.omit(u,["mode","emptyText"]),{value:o.unref(p),"onUpdate:value":s,ref:a}),g(t)?t:{default:()=>[t]}):o.createVNode(o.Fragment,null,[u.prefix||((e=t==null?void 0:t.prefix)==null?void 0:e.call(t)),u.value||u.emptyText,u.suffix||((n=t==null?void 0:t.suffix)==null?void 0:n.call(t))])}return(e,n)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(f())))}});exports.default=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.js");exports.default=e.default;
|