@aplus-frontend/ui 7.14.5 → 7.15.0
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/src/ap-field/checkbox/index.vue.d.ts +1 -1
- package/es/src/ap-field/date/index.vue.d.ts +1086 -6
- package/es/src/ap-field/date/index.vue.mjs +63 -57
- package/es/src/ap-field/date-range/index.vue.d.ts +1155 -4
- package/es/src/ap-field/date-range/index.vue.mjs +70 -63
- package/es/src/ap-field/interface.d.ts +25 -29
- package/es/src/ap-field/number/index.vue.d.ts +1 -1
- package/es/src/ap-field/radio/index.vue.d.ts +1 -1
- package/es/src/ap-field/rate/index.vue.d.ts +1 -1
- package/es/src/ap-field/second/index.vue.d.ts +1 -1
- package/es/src/ap-field/select/index.vue.d.ts +3 -2
- package/es/src/ap-field/select/index.vue.mjs +116 -104
- package/es/src/ap-field/select/read.vue2.mjs +4 -3
- package/es/src/ap-field/slider/index.vue.d.ts +1 -1
- package/es/src/ap-field/switch/index.vue.d.ts +232 -4
- package/es/src/ap-field/switch/index.vue.mjs +48 -42
- package/es/src/ap-field/text/password.vue.d.ts +1 -1
- package/es/src/ap-field/text-area/index.vue.d.ts +1 -1
- package/es/src/ap-form/item-group/index.vue.d.ts +2 -4
- package/es/src/ap-form/item-group/index.vue.mjs +37 -42
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
- package/es/src/ap-form/items/checkbox/index.vue.mjs +20 -14
- package/es/src/ap-form/items/date/index.vue.d.ts +1497 -5
- package/es/src/ap-form/items/date/index.vue.mjs +25 -19
- package/es/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
- package/es/src/ap-form/items/date-range/index.vue.mjs +25 -19
- package/es/src/ap-form/items/number/index.vue.d.ts +4 -4
- package/es/src/ap-form/items/radio/index.vue.d.ts +5 -5
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -3
- package/es/src/ap-form/items/select/index.vue.d.ts +18 -12
- package/es/src/ap-form/items/switch/index.vue.d.ts +436 -5
- package/es/src/ap-form/items/switch/index.vue.mjs +24 -17
- package/es/src/ap-form/items/text/password.vue.d.ts +5 -5
- package/es/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/es/src/ap-table/constants.d.ts +1923 -107
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/checkbox/index.vue.d.ts +1 -1
- package/lib/src/ap-field/date/index.vue.d.ts +1086 -6
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +1155 -4
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +25 -29
- package/lib/src/ap-field/number/index.vue.d.ts +1 -1
- package/lib/src/ap-field/radio/index.vue.d.ts +1 -1
- package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
- package/lib/src/ap-field/second/index.vue.d.ts +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +3 -2
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +1 -1
- package/lib/src/ap-field/switch/index.vue.d.ts +232 -4
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +1 -1
- package/lib/src/ap-field/text-area/index.vue.d.ts +1 -1
- package/lib/src/ap-form/item-group/index.vue.d.ts +2 -4
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +66 -5
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.d.ts +1497 -5
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +1607 -5
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +4 -4
- package/lib/src/ap-form/items/radio/index.vue.d.ts +5 -5
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +18 -12
- package/lib/src/ap-form/items/switch/index.vue.d.ts +436 -5
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.d.ts +5 -5
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/lib/src/ap-table/constants.d.ts +1923 -107
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("@ant-design/icons-vue"),g=require("@aplus-frontend/antdv"),S=require("@aplus-frontend/utils"),i=require("dayjs"),r=require("lodash-unified");require("../../hooks/index.js");const z=require("../../utils/index.js"),m=require("../date/constant.js"),j=require("../date/helper.js"),I=require("../hooks/use-date-timezone.js"),U=require("../hooks/use-default-placeholder.js"),H=require("../hooks/use-default-presets.js"),K=require("../../hooks/useControllableValue.js"),L=e.defineComponent({name:"ApFieldDateRange",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},showWeek:{type:Boolean},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},variant:{},showTime:{type:[Boolean,Object],default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},onOk:{},format:{default:"Y-D"},shownFormat:{},timezone:{},readModeSeparator:{},presets:{type:[Array,Boolean,Object]}},emits:["update:value"],setup(B,{expose:C,emit:P}){const t=B,T=P,D=e.useSlots(),v=e.ref(),s=e.computed(()=>m.ApFieldDatePresetFormats.indexOf(t.format)>-1),f=e.computed(()=>s.value?m.PRESET_FORMAT_MAP[t.format]:t.format),{value:p,updateValue:k}=K.useControllableValue(t,T),O=e.computed(()=>t.shownFormat?t.shownFormat:s.value?m.PRESET_FORMAT_MAP[t.format]:t.format),b=U.useDefaultPlaceholder("DateRange",t),{currentTimezone:u}=I.useDateTimezone(t),{presets:w,changeCurrentDate:F}=H.useDefaultPresets({...t,timezone:u}),d=(n,a,o=!0)=>j.formatDayWithTimezone(u.value)(n,a,o),y=e.computed(()=>{const n=e.unref(p);if(r.isNil(n)||!n?.length)return n;const a=u.value?S.getTimeFormatToZone(e.unref(p)[0],u.value):e.unref(p)?.[0],o=t.timezone?S.getTimeFormatToZone(e.unref(p)[1],u.value):e.unref(p)?.[1];return[i(a),i(o)]}),M=e.computed(()=>e.unref(s)?t.picker??m.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),R=e.computed(()=>{const n=e.unref(s)?m.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...z.omitUndefined(r.omit(t,["value","onUpdate:value","onChange","onOk","format","mode","presets"])),placeholder:e.unref(b),presets:e.unref(w),...n}});function _(n){if(!n){k(n);return}let a=r.isString(n[0])?i(n[0]):n[0],o=r.isString(n[1])?i(n[1]):n[1];const l=e.unref(s)?e.unref(f):void 0;k([d(a,l),d(o,l,!1)])}function A(n){const a=r.isString(n[0])?i(n[0]):n[0],o=r.isString(n[1])?i(n[1]):n[1],l=e.unref(s)?e.unref(f):void 0,c=n[0]?d(a,l):null,h=n[1]?d(o,l,!1):null;t.onOk?.([c,h])}function x(n){n&&F(),t.onOpenChange?.(n)}function N(n,a){if(r.isNil(n)){t.onChange?.(n,a);return}const o=r.isString(n[0])?i(n[0]):n[0],l=r.isString(n[1])?i(n[1]):n[1],c=e.unref(s)?e.unref(f):void 0,h=n[0]?d(o,c):null,q=n[1]?d(l,c,!1):null;t.onChange?.([h,q],a)}const V=e.computed(()=>{const n=t.readModeSeparator;if(n)return e.isVNode(n)||r.isFunction(n)?t.readModeSeparator:e.createVNode(e.Fragment,null,[t.readModeSeparator]);const a=D.readModeSeparator?.();return a?e.createVNode(e.Fragment,null,[a]):E.SwapRightOutlined});return C({focus:v.value?.focus(),blur:v.value?.blur()}),(n,a)=>n.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(y.value[0]?.format(f.value))+" ",1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value))),e.createTextVNode(" "+e.toDisplayString(y.value[1]?.format(f.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(g.InputGroup),{key:1,compact:"",style:e.normalizeStyle({display:Array.isArray(t.timezone)&&t.timezone.length?"flex":"block"})},{default:e.withCtx(()=>[Array.isArray(t.timezone)&&t.timezone.length?(e.openBlock(),e.createBlock(e.unref(g.Select),{key:0,value:e.unref(u),"onUpdate:value":a[0]||(a[0]=o=>e.isRef(u)?u.value=o:null),"default-active-first-option":"","dropdown-match-select-width":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timezone,o=>(e.openBlock(),e.createBlock(e.unref(g.SelectOption),{key:o?.value,value:o?.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o?.label??o?.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(g.DatePicker).RangePicker,e.mergeProps({ref_key:"rangePickerRef",ref:v},R.value,{value:y.value,picker:M.value,format:O.value,"onUpdate:value":_,onChange:N,onOk:A,onOpenChange:x}),e.createSlots({_:2},[e.renderList(e.unref(r.omit)(n.$slots,"readModeSeparator"),(o,l)=>({name:l,fn:e.withCtx(c=>[e.renderSlot(n.$slots,l,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["value","picker","format"])]),_:3},8,["style"]))}});exports.default=L;
|
|
@@ -10,6 +10,11 @@ import { LiteralUnion, Recordable } from '../type';
|
|
|
10
10
|
import { ApFormatPresetType } from './date/interface';
|
|
11
11
|
import { InputPasswordProps } from './text/input-password-props';
|
|
12
12
|
export type FieldMode = 'read' | 'edit';
|
|
13
|
+
type CommonApFieldExpose = {
|
|
14
|
+
focus: () => void;
|
|
15
|
+
blur: () => void;
|
|
16
|
+
request: () => void;
|
|
17
|
+
};
|
|
13
18
|
export type BasicApFieldProps<FieldPropsType = any> = {
|
|
14
19
|
mode?: FieldMode;
|
|
15
20
|
class?: unknown;
|
|
@@ -27,10 +32,7 @@ export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
|
27
32
|
export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
|
|
28
33
|
emptyText?: string;
|
|
29
34
|
};
|
|
30
|
-
export type ApFieldTextPasswordExpose =
|
|
31
|
-
focus: () => void;
|
|
32
|
-
blur: () => void;
|
|
33
|
-
};
|
|
35
|
+
export type ApFieldTextPasswordExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
34
36
|
export type ApFieldTextExpose = {
|
|
35
37
|
focus: (options?: InputFocusOptions) => void;
|
|
36
38
|
blur: () => void;
|
|
@@ -43,9 +45,7 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
|
|
|
43
45
|
request?: () => Promise<CheckboxGroupProps['options']>;
|
|
44
46
|
vertical?: boolean;
|
|
45
47
|
};
|
|
46
|
-
export type ApFieldCheckboxExpose =
|
|
47
|
-
request: () => Promise<void>;
|
|
48
|
-
};
|
|
48
|
+
export type ApFieldCheckboxExpose = Pick<CommonApFieldExpose, 'request'>;
|
|
49
49
|
export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue' | 'onChange' | 'onOk' | 'format' | 'onUpdate:value'>> & {
|
|
50
50
|
emptyText?: string;
|
|
51
51
|
value?: number | null;
|
|
@@ -72,6 +72,7 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
72
72
|
}[];
|
|
73
73
|
disabledTime?: SharedTimeProps<Dayjs>['disabledTime'];
|
|
74
74
|
};
|
|
75
|
+
export type ApFieldDateExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
75
76
|
export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
|
|
76
77
|
/**
|
|
77
78
|
* 输入框的显示模式(输入框/数字轮播)
|
|
@@ -87,24 +88,20 @@ export type ApFieldNumberProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'
|
|
|
87
88
|
*/
|
|
88
89
|
limitDecimalsRetain?: boolean;
|
|
89
90
|
};
|
|
90
|
-
export type ApiFieldNumberExpose =
|
|
91
|
-
focus: () => void;
|
|
92
|
-
blur: () => void;
|
|
93
|
-
};
|
|
91
|
+
export type ApiFieldNumberExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
94
92
|
export type ApFieldRadioProps = BasicApFieldProps<RadioGroupProps> & {
|
|
95
93
|
emptyText?: string;
|
|
96
94
|
request?: () => Promise<RadioGroupProps['options']>;
|
|
97
95
|
vertical?: boolean;
|
|
98
96
|
};
|
|
99
|
-
export type
|
|
100
|
-
request: () => Promise<void>;
|
|
101
|
-
};
|
|
97
|
+
export type ApFieldRadioExpose = Pick<CommonApFieldExpose, 'request'>;
|
|
102
98
|
export type ApFieldSwitchConfirmConfig = Pick<PopconfirmProps, 'title' | 'okText' | 'cancelText' | 'description' | 'showCancel' | 'icon' | 'okType' | 'onCancel' | 'okButtonProps' | 'cancelButtonProps'>;
|
|
103
99
|
export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>> & {
|
|
104
100
|
emptyText?: string;
|
|
105
101
|
onAction?: (checked: string | boolean | number, e?: Event) => boolean | Promise<boolean>;
|
|
106
102
|
confirm?: ApFieldSwitchConfirmConfig | ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig);
|
|
107
103
|
};
|
|
104
|
+
export type ApFieldSwitchExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
108
105
|
export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
|
|
109
106
|
emptyText?: string;
|
|
110
107
|
/**
|
|
@@ -120,9 +117,8 @@ export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosi
|
|
|
120
117
|
language?: 'text' | 'json';
|
|
121
118
|
};
|
|
122
119
|
};
|
|
123
|
-
export type ApFieldTextAreaExpose = {
|
|
120
|
+
export type ApFieldTextAreaExpose = Pick<CommonApFieldExpose, 'blur'> & {
|
|
124
121
|
focus: (options?: InputFocusOptions) => void;
|
|
125
|
-
blur: () => void;
|
|
126
122
|
resizableTextArea: any;
|
|
127
123
|
};
|
|
128
124
|
export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format' | 'presets'>> & {
|
|
@@ -195,6 +191,7 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
|
|
|
195
191
|
lastYear?: boolean;
|
|
196
192
|
};
|
|
197
193
|
};
|
|
194
|
+
export type ApFieldDateRangeExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
198
195
|
export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
|
|
199
196
|
emptyText?: string;
|
|
200
197
|
request?: (value?: string, extraParams?: Recordable) => Promise<SelectProps['options']>;
|
|
@@ -207,12 +204,18 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
207
204
|
searchMode?: 'filter' | 'request';
|
|
208
205
|
/**
|
|
209
206
|
* 是否在Select框聚焦时再次触发选项请求
|
|
207
|
+
* @deprecated 有歧义,请使用fetchOnFocus
|
|
210
208
|
*/
|
|
211
209
|
refetchOnFocus?: boolean;
|
|
212
210
|
/**
|
|
213
|
-
*
|
|
211
|
+
* 是否在聚焦时触发网络请求
|
|
212
|
+
* @since 7.15.0
|
|
214
213
|
*/
|
|
215
|
-
|
|
214
|
+
fetchOnFocus?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* 是否延迟请求选项列表 true: 不请求选项; 'first-focus': 首次聚焦时触发网络请求
|
|
217
|
+
*/
|
|
218
|
+
lazy?: boolean | 'first-focus';
|
|
216
219
|
/**
|
|
217
220
|
* 添加一个名为全部的节点(只在多选的情况下有效)
|
|
218
221
|
*/
|
|
@@ -253,9 +256,7 @@ export type ApFieldTreeSelectProps = BasicApFieldProps<Omit<TreeSelectProps, 'lo
|
|
|
253
256
|
*/
|
|
254
257
|
loadData?: boolean;
|
|
255
258
|
};
|
|
256
|
-
export type ApFieldSelectExpose = {
|
|
257
|
-
focus: () => void;
|
|
258
|
-
blur: () => void;
|
|
259
|
+
export type ApFieldSelectExpose = Omit<CommonApFieldExpose, 'request'> & {
|
|
259
260
|
request: (clear?: boolean) => Promise<void>;
|
|
260
261
|
};
|
|
261
262
|
export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
|
|
@@ -271,10 +272,7 @@ export type ApFieldSliderProps = BasicApFieldProps<Partial<SliderProps>> & {
|
|
|
271
272
|
emptyText?: string;
|
|
272
273
|
defaultValue?: number | [number, number];
|
|
273
274
|
};
|
|
274
|
-
export type ApFieldSliderExpose =
|
|
275
|
-
focus: () => void;
|
|
276
|
-
blur: () => void;
|
|
277
|
-
};
|
|
275
|
+
export type ApFieldSliderExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
278
276
|
export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
|
|
279
277
|
emptyText?: string;
|
|
280
278
|
defaultValue?: string | number;
|
|
@@ -283,12 +281,10 @@ export type ApFieldSegmentedProps = BasicApFieldProps<SegmentedProps> & {
|
|
|
283
281
|
export type ApFieldRateProps = BasicApFieldProps<RateProps> & {
|
|
284
282
|
defaultValue?: number;
|
|
285
283
|
};
|
|
286
|
-
export type ApFieldRateExpose =
|
|
287
|
-
focus: () => void;
|
|
288
|
-
blur: () => void;
|
|
289
|
-
};
|
|
284
|
+
export type ApFieldRateExpose = Omit<CommonApFieldExpose, 'request'>;
|
|
290
285
|
export type ApFieldSecondProps = BasicApFieldProps<Omit<InputNumberProps, 'mode'>> & {
|
|
291
286
|
placeholder?: string;
|
|
292
287
|
emptyText?: string;
|
|
293
288
|
};
|
|
294
289
|
export type ApFieldSecondExpose = ApiFieldNumberExpose;
|
|
290
|
+
export {};
|
|
@@ -382,8 +382,8 @@ declare function __VLS_template(): {
|
|
|
382
382
|
};
|
|
383
383
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
384
384
|
declare const __VLS_component: DefineComponent<ApFieldNumberProps, {
|
|
385
|
-
focus: () => void;
|
|
386
385
|
blur: () => void;
|
|
386
|
+
focus: () => void;
|
|
387
387
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
388
388
|
"update:value": (...args: any[]) => void;
|
|
389
389
|
}, string, PublicProps, Readonly<ApFieldNumberProps> & Readonly<{
|
|
@@ -7,7 +7,7 @@ import { RadioGroupButtonStyle, RadioGroupOptionType } from '@aplus-frontend/ant
|
|
|
7
7
|
import { RadioChangeEvent } from '@aplus-frontend/antdv';
|
|
8
8
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
9
9
|
declare const _default: DefineComponent<ApFieldRadioProps, {
|
|
10
|
-
request: () =>
|
|
10
|
+
request: () => void;
|
|
11
11
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
12
12
|
"update:value": (...args: any[]) => void;
|
|
13
13
|
}, string, PublicProps, Readonly<ApFieldRadioProps> & Readonly<{
|
|
@@ -270,8 +270,8 @@ declare function __VLS_template(): {
|
|
|
270
270
|
};
|
|
271
271
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
272
272
|
declare const __VLS_component: DefineComponent<ApFieldRateProps, {
|
|
273
|
-
focus: () => void;
|
|
274
273
|
blur: () => void;
|
|
274
|
+
focus: () => void;
|
|
275
275
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
276
276
|
"update:value": (...args: any[]) => void;
|
|
277
277
|
}, string, PublicProps, Readonly<ApFieldRateProps> & Readonly<{
|
|
@@ -17,8 +17,8 @@ declare function __VLS_template(): {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
19
|
declare const __VLS_component: DefineComponent<ApFieldSecondProps, {
|
|
20
|
-
focus: () => void;
|
|
21
20
|
blur: () => void;
|
|
21
|
+
focus: () => void;
|
|
22
22
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
23
23
|
"update:value": (...args: any[]) => void;
|
|
24
24
|
}, string, PublicProps, Readonly<ApFieldSecondProps> & Readonly<{
|
|
@@ -454,8 +454,8 @@ declare function __VLS_template(): {
|
|
|
454
454
|
};
|
|
455
455
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
456
456
|
declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
457
|
-
focus: () => void;
|
|
458
457
|
blur: () => void;
|
|
458
|
+
focus: () => void;
|
|
459
459
|
request: (clear?: boolean) => Promise<void>;
|
|
460
460
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
461
461
|
"update:value": (...args: any[]) => void;
|
|
@@ -468,7 +468,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
468
468
|
disabled: boolean;
|
|
469
469
|
virtual: boolean;
|
|
470
470
|
autofocus: boolean;
|
|
471
|
-
lazy: boolean;
|
|
471
|
+
lazy: boolean | "first-focus";
|
|
472
472
|
loading: boolean;
|
|
473
473
|
bordered: boolean;
|
|
474
474
|
allowClear: boolean;
|
|
@@ -481,6 +481,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
481
481
|
emptyText: string;
|
|
482
482
|
searchMode: "filter" | "request";
|
|
483
483
|
refetchOnFocus: boolean;
|
|
484
|
+
fetchOnFocus: boolean;
|
|
484
485
|
addAll: boolean | number;
|
|
485
486
|
searchDelay: number;
|
|
486
487
|
allowOnlySelect: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv"),s=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv"),s=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");const Y=require("../../utils/warning.js");require("../../hooks/index.js");const Z=require("../hooks/use-default-placeholder.js"),ee=require("../style/index.js"),te=require("./use-select-options.js"),w=require("../../utils/is.js"),x=require("../../config-provider/hooks/use-namespace.js"),ne=require("../../config-provider/hooks/use-locale.js"),oe=require("../../hooks/useControllableValue.js"),le={key:0},ae=["onClick"],ue=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},variant:{},maxCount:{},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean,default:void 0},prefix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},inputValue:{},searchValue:{},autoClearSearchValue:{type:Boolean,default:void 0},onDeselect:{},onActive:{},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},options:{},defaultActiveFirstOption:{type:Boolean,default:void 0},listItemHeight:{},onClickOption:{},menuItemSelectedIcon:{},labelInValue:{type:Boolean,default:void 0},showSearch:{type:Boolean,default:void 0},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},fetchOnFocus:{type:Boolean,default:void 0},lazy:{type:[Boolean,String],default:!1},addAll:{type:[Boolean,Number],default:5},params:{},searchDelay:{default:300},allowOnlySelect:{type:Boolean,default:!0}},emits:["update:value"],setup(O,{expose:V,emit:q}){let r=0;const S=e.useSlots(),t=O,{deprecated:A}=Y.useDevWarning("ApFieldSelect");A(!w.isDef(t.refetchOnFocus),"refetchOnFocus","fetchOnFocus");const{b:v}=x.useNamespace("field-select"),{b:i}=x.useNamespace("field-select-popup-option"),D=ee.default("field"),k=e.ref(!1),B=e.ref(!1),{t:N}=ne.useLocale(),I=s.debounce(n=>{if(!s.isFunction(t.request))return;r+=1;const o=r;h([]),u.value=!0,t.request(n).then(l=>{r===o&&(h(l),u.value=!1)})},t.searchDelay),_=(n,o)=>{const l=t.fieldNames?.label||"label";return typeof o?.[l]=="string"&&o[l].toLowerCase().indexOf(n.toLowerCase())>-1},{options:d,updateOptions:h}=te.useSelectOptions(t),y=e.shallowRef(),u=e.ref(t?.loading||!1),M=q,P=e.computed(()=>t.fetchOnFocus??t.refetchOnFocus),z=e.computed(()=>{if(t.multiple)return t.tokenSeparators?"tags":"multiple"});async function m(n=!0){if(!s.isFunction(t.request))return;u.value=!0,r+=1;const o=r;try{n&&h([]);const l=await t.request(void 0,t.params);if(o!==r)return;h(l)}finally{u.value=!1}}function T(n){!B.value&&r===0&&t.lazy==="first-focus"?m():P.value&&!u.value&&m(!0),t.onFocus?.(n),B.value=!0}e.onMounted(()=>{if(!t.lazy){m();return}}),e.watch(()=>t.params,()=>{m()},{deep:!0});const{value:f,updateValue:C}=oe.useControllableValue(t,M),L=Z.useDefaultPlaceholder("Select",t),R=e.computed(()=>{const n=e.unref(f);if(!n)return t.emptyText;const o=t.fieldNames?.label||"label",l=t.fieldNames?.value||"value";return s.isArray(n)?n.map(a=>e.unref(d).find(X=>X[l]===a)?.[o]).filter(Boolean).join("、")||t.emptyText:e.unref(d).find(a=>a[l]===n)?.[o]||t.emptyText}),E=e.computed(()=>{const n=!!t?.showSearch,o=t.searchMode;let l={};return n&&(l=o==="request"?{defaultActiveFirstOption:!1,onSearch:I,notFoundContent:u.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:s.isNil(t?.filterOption)?_:t?.filterOption}),{...s.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect"]),placeholder:e.unref(L),...l}}),U=e.computed(()=>d.value.map(n=>n[t.fieldNames?.value||"value"])),g=e.computed(()=>d.value.filter(n=>!n.disabled).map(n=>n[t.fieldNames?.value||"value"])),F=e.computed(()=>!t.multiple||w.isDef(t.maxCount)?!1:s.isNumber(t.addAll)?U.value.length>=t.addAll:!!t.addAll),$=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!w.isDef(t.maxCount)||t.maxCount>=1));function j(){y.value?.focus()}function K(){y.value?.blur()}function b(n,o){const l=t.fieldNames?.[o]??o;return n[l]}function H(n){const o=b(n,"value");C(t.multiple?[o]:o),t.onChange?.([o],[n])}function W(n){return S.option?e.createVNode("div",{class:i("custom")},[S.option(n)]):e.createVNode("span",{class:i("label")},[b(n,"label")])}const G=e.computed(()=>{const n=e.unref(f)||[],o=g.value;return o.length>0&&o.every(l=>n.includes(l))}),J=e.computed(()=>{const n=e.unref(f)||[],o=g.value,l=o.filter(c=>n.includes(c)).length;return l>0&&l<o.length});function Q(){const n=new Set(e.unref(f)||[]),o=g.value;o.length>0&&o.every(a=>n.has(a))?o.forEach(a=>n.delete(a)):o.forEach(a=>n.add(a));const c=d.value.filter(a=>n.has(a[t.fieldNames?.value||"value"]));C([...n]),t.onChange?.([...n],c)}return V({focus:j,blur:K,request:m}),(n,o)=>n.mode==="read"?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(R.value),1)):(e.openBlock(),e.createBlock(e.unref(p.Select),e.mergeProps({key:1,ref_key:"selectRef",ref:y,"allow-clear":""},E.value,{mode:z.value,value:e.unref(f),options:e.unref(d),loading:u.value,"menu-item-selected-icon":e.h("span"),"popup-class-name":`${e.unref(v)("popup")} ${e.unref(D)}`,open:k.value,"onUpdate:value":e.unref(C),onFocus:T,onDropdownVisibleChange:o[0]||(o[0]=l=>k.value=l)}),e.createSlots({option:e.withCtx(l=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)("outter"))},[e.createVNode(e.unref(p.Flex),{justify:"space-between",align:"center",class:e.normalizeClass(e.unref(i)("wrapper")),gap:8},{default:e.withCtx(()=>[e.createVNode(e.unref(p.Flex),{gap:8,align:"center",class:e.normalizeClass(e.unref(i)("content-wrapper"))},{default:e.withCtx(()=>[F.value?(e.openBlock(),e.createBlock(e.unref(p.Checkbox),{key:0,checked:e.unref(f)?.includes(b(l,"value"))},null,8,["checked"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W(l))))]),_:2},1032,["class"]),$.value&&!l?.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(i)("action")),onClick:e.withModifiers(()=>H(l),["stop"])},e.toDisplayString(e.unref(N)("ap.field.chooseOnly")),11,ae)):e.createCommentVNode("",!0)]),_:2},1032,["class"])],2)]),_:2},[e.renderList(e.unref(s.omit)(n.$slots,["option"]),(l,c)=>({name:c,fn:e.withCtx(a=>[e.renderSlot(n.$slots,c,e.normalizeProps(e.guardReactiveProps(a||{})))])})),u.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(p.Spin),{size:"small"})]),key:"0"}:void 0,F.value?{name:"dropdownRender",fn:e.withCtx(({menuNode:l})=>[e.createElementVNode("div",{tabindex:-1,class:e.normalizeClass(e.unref(v)("popup-all-option")),onClick:Q},[e.createVNode(e.unref(p.Checkbox),{checked:G.value,indeterminate:J.value},null,8,["checked","indeterminate"]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(v)("popup-all-option-label"))},e.toDisplayString(e.unref(N)("ap.field.selectAll")),3)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l)))]),key:"1"}:void 0]),1040,["mode","value","options","loading","menu-item-selected-icon","popup-class-name","open","onUpdate:value"]))}});exports.default=ue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),s=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),s=require("lodash-unified"),u={key:0},d=t.defineComponent({name:"ApFieldSelectRead",__name:"read",props:{mode:{},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean},showArrow:{type:Boolean},variant:{},maxCount:{},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean},animation:{},direction:{},disabled:{type:Boolean},prefixCls:{},id:{},autofocus:{type:Boolean},getPopupContainer:{},virtual:{type:Boolean},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean},prefix:{},clearIcon:{},allowClear:{type:Boolean},fieldNames:{},inputValue:{},searchValue:{},autoClearSearchValue:{type:Boolean},onDeselect:{},onActive:{},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},options:{},defaultActiveFirstOption:{type:Boolean},listItemHeight:{},onClickOption:{},menuItemSelectedIcon:{},labelInValue:{type:Boolean},showSearch:{type:Boolean},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},emptyText:{default:"--"},request:{},multiple:{type:Boolean},value:{},"onUpdate:value":{},searchMode:{},refetchOnFocus:{type:Boolean},fetchOnFocus:{type:Boolean},lazy:{type:[Boolean,String]},addAll:{type:[Boolean,Number]},params:{},searchDelay:{},allowOnlySelect:{type:Boolean}},setup(r){const e=r,i=t.computed(()=>{const o=e.value;if(!o)return e.emptyText;const n=e.fieldNames?.label||"label",l=e.fieldNames?.value||"value";return s.isArray(o)?o.map(a=>e.options?.find(p=>p[l]===a)?.[n]).filter(Boolean).join("、")||e.emptyText:e.options?.find(a=>a[l]===o)?.[n]||e.emptyText});return(o,n)=>o.mode==="read"?(t.openBlock(),t.createElementBlock("span",u,t.toDisplayString(i.value),1)):t.createCommentVNode("",!0)}});exports.default=d;
|
|
@@ -169,8 +169,8 @@ declare function __VLS_template(): {
|
|
|
169
169
|
};
|
|
170
170
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
171
171
|
declare const __VLS_component: DefineComponent<ApFieldSliderProps, {
|
|
172
|
-
focus: () => void;
|
|
173
172
|
blur: () => void;
|
|
173
|
+
focus: () => void;
|
|
174
174
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
175
175
|
"update:value": (...args: any[]) => void;
|
|
176
176
|
}, string, PublicProps, Readonly<ApFieldSliderProps> & Readonly<{
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ApFieldSwitchProps } from '../interface';
|
|
2
|
-
import {
|
|
2
|
+
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
|
3
|
+
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
4
|
+
import { FocusEventHandler } from '@aplus-frontend/antdv/es/_util/EventInterface';
|
|
5
|
+
import { VueNode, CustomSlotsType } from '@aplus-frontend/antdv/es/_util/type';
|
|
3
6
|
type ApFieldSwitchSlots = {
|
|
4
7
|
checkedChildren: any;
|
|
5
8
|
unCheckedChildren: any;
|
|
@@ -8,11 +11,125 @@ type ApFieldSwitchSlots = {
|
|
|
8
11
|
declare function __VLS_template(): {
|
|
9
12
|
attrs: Partial<{}>;
|
|
10
13
|
slots: Readonly<ApFieldSwitchSlots> & ApFieldSwitchSlots;
|
|
11
|
-
refs: {
|
|
14
|
+
refs: {
|
|
15
|
+
switchRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
16
|
+
id: StringConstructor;
|
|
17
|
+
prefixCls: StringConstructor;
|
|
18
|
+
size: VueTypeDef<"default" | "small">;
|
|
19
|
+
disabled: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
23
|
+
checkedChildren: VueTypeValidableDef<any>;
|
|
24
|
+
unCheckedChildren: VueTypeValidableDef<any>;
|
|
25
|
+
tabindex: VueTypeDef<string | number>;
|
|
26
|
+
autofocus: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: any;
|
|
29
|
+
};
|
|
30
|
+
loading: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: any;
|
|
33
|
+
};
|
|
34
|
+
checked: VueTypeDef<string | number | boolean>;
|
|
35
|
+
checkedValue: VueTypeDef<string | number | boolean> & {
|
|
36
|
+
default: string | number | boolean;
|
|
37
|
+
};
|
|
38
|
+
unCheckedValue: VueTypeDef<string | number | boolean> & {
|
|
39
|
+
default: string | number | boolean;
|
|
40
|
+
};
|
|
41
|
+
onChange: {
|
|
42
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
43
|
+
};
|
|
44
|
+
onClick: {
|
|
45
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
46
|
+
};
|
|
47
|
+
onKeydown: {
|
|
48
|
+
type: PropType<(e: Event) => void>;
|
|
49
|
+
};
|
|
50
|
+
onMouseup: {
|
|
51
|
+
type: PropType<(e: Event) => void>;
|
|
52
|
+
};
|
|
53
|
+
'onUpdate:checked': {
|
|
54
|
+
type: PropType<(checked: string | number | boolean) => void>;
|
|
55
|
+
};
|
|
56
|
+
onBlur: PropType<FocusEventHandler>;
|
|
57
|
+
onFocus: PropType<FocusEventHandler>;
|
|
58
|
+
}>> & Readonly<{}>, () => VueNode, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
autofocus: boolean;
|
|
61
|
+
loading: boolean;
|
|
62
|
+
checkedValue: string | number | boolean;
|
|
63
|
+
unCheckedValue: string | number | boolean;
|
|
64
|
+
}, true, {}, CustomSlotsType<{
|
|
65
|
+
checkedChildren: any;
|
|
66
|
+
unCheckedChildren: any;
|
|
67
|
+
default: any;
|
|
68
|
+
}>, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
69
|
+
P: {};
|
|
70
|
+
B: {};
|
|
71
|
+
D: {};
|
|
72
|
+
C: {};
|
|
73
|
+
M: {};
|
|
74
|
+
Defaults: {};
|
|
75
|
+
}, Readonly< ExtractPropTypes<{
|
|
76
|
+
id: StringConstructor;
|
|
77
|
+
prefixCls: StringConstructor;
|
|
78
|
+
size: VueTypeDef<"default" | "small">;
|
|
79
|
+
disabled: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: any;
|
|
82
|
+
};
|
|
83
|
+
checkedChildren: VueTypeValidableDef<any>;
|
|
84
|
+
unCheckedChildren: VueTypeValidableDef<any>;
|
|
85
|
+
tabindex: VueTypeDef<string | number>;
|
|
86
|
+
autofocus: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: any;
|
|
89
|
+
};
|
|
90
|
+
loading: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: any;
|
|
93
|
+
};
|
|
94
|
+
checked: VueTypeDef<string | number | boolean>;
|
|
95
|
+
checkedValue: VueTypeDef<string | number | boolean> & {
|
|
96
|
+
default: string | number | boolean;
|
|
97
|
+
};
|
|
98
|
+
unCheckedValue: VueTypeDef<string | number | boolean> & {
|
|
99
|
+
default: string | number | boolean;
|
|
100
|
+
};
|
|
101
|
+
onChange: {
|
|
102
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
103
|
+
};
|
|
104
|
+
onClick: {
|
|
105
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
106
|
+
};
|
|
107
|
+
onKeydown: {
|
|
108
|
+
type: PropType<(e: Event) => void>;
|
|
109
|
+
};
|
|
110
|
+
onMouseup: {
|
|
111
|
+
type: PropType<(e: Event) => void>;
|
|
112
|
+
};
|
|
113
|
+
'onUpdate:checked': {
|
|
114
|
+
type: PropType<(checked: string | number | boolean) => void>;
|
|
115
|
+
};
|
|
116
|
+
onBlur: PropType<FocusEventHandler>;
|
|
117
|
+
onFocus: PropType<FocusEventHandler>;
|
|
118
|
+
}>> & Readonly<{}>, () => VueNode, {}, {}, {}, {
|
|
119
|
+
disabled: boolean;
|
|
120
|
+
autofocus: boolean;
|
|
121
|
+
loading: boolean;
|
|
122
|
+
checkedValue: string | number | boolean;
|
|
123
|
+
unCheckedValue: string | number | boolean;
|
|
124
|
+
}> | null;
|
|
125
|
+
};
|
|
12
126
|
rootEl: any;
|
|
13
127
|
};
|
|
14
128
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
-
declare const __VLS_component: DefineComponent<ApFieldSwitchProps, {
|
|
129
|
+
declare const __VLS_component: DefineComponent<ApFieldSwitchProps, {
|
|
130
|
+
blur: () => void;
|
|
131
|
+
focus: () => void;
|
|
132
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
133
|
"update:checked": (...args: any[]) => void;
|
|
17
134
|
}, string, PublicProps, Readonly<ApFieldSwitchProps> & Readonly<{
|
|
18
135
|
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
@@ -23,7 +140,118 @@ declare const __VLS_component: DefineComponent<ApFieldSwitchProps, {}, {}, {}, {
|
|
|
23
140
|
emptyText: string;
|
|
24
141
|
checkedValue: string | number | boolean;
|
|
25
142
|
unCheckedValue: string | number | boolean;
|
|
26
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
143
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
144
|
+
switchRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
145
|
+
id: StringConstructor;
|
|
146
|
+
prefixCls: StringConstructor;
|
|
147
|
+
size: VueTypeDef<"default" | "small">;
|
|
148
|
+
disabled: {
|
|
149
|
+
type: BooleanConstructor;
|
|
150
|
+
default: any;
|
|
151
|
+
};
|
|
152
|
+
checkedChildren: VueTypeValidableDef<any>;
|
|
153
|
+
unCheckedChildren: VueTypeValidableDef<any>;
|
|
154
|
+
tabindex: VueTypeDef<string | number>;
|
|
155
|
+
autofocus: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: any;
|
|
158
|
+
};
|
|
159
|
+
loading: {
|
|
160
|
+
type: BooleanConstructor;
|
|
161
|
+
default: any;
|
|
162
|
+
};
|
|
163
|
+
checked: VueTypeDef<string | number | boolean>;
|
|
164
|
+
checkedValue: VueTypeDef<string | number | boolean> & {
|
|
165
|
+
default: string | number | boolean;
|
|
166
|
+
};
|
|
167
|
+
unCheckedValue: VueTypeDef<string | number | boolean> & {
|
|
168
|
+
default: string | number | boolean;
|
|
169
|
+
};
|
|
170
|
+
onChange: {
|
|
171
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
172
|
+
};
|
|
173
|
+
onClick: {
|
|
174
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
175
|
+
};
|
|
176
|
+
onKeydown: {
|
|
177
|
+
type: PropType<(e: Event) => void>;
|
|
178
|
+
};
|
|
179
|
+
onMouseup: {
|
|
180
|
+
type: PropType<(e: Event) => void>;
|
|
181
|
+
};
|
|
182
|
+
'onUpdate:checked': {
|
|
183
|
+
type: PropType<(checked: string | number | boolean) => void>;
|
|
184
|
+
};
|
|
185
|
+
onBlur: PropType<FocusEventHandler>;
|
|
186
|
+
onFocus: PropType<FocusEventHandler>;
|
|
187
|
+
}>> & Readonly<{}>, () => VueNode, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
188
|
+
disabled: boolean;
|
|
189
|
+
autofocus: boolean;
|
|
190
|
+
loading: boolean;
|
|
191
|
+
checkedValue: string | number | boolean;
|
|
192
|
+
unCheckedValue: string | number | boolean;
|
|
193
|
+
}, true, {}, CustomSlotsType<{
|
|
194
|
+
checkedChildren: any;
|
|
195
|
+
unCheckedChildren: any;
|
|
196
|
+
default: any;
|
|
197
|
+
}>, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
198
|
+
P: {};
|
|
199
|
+
B: {};
|
|
200
|
+
D: {};
|
|
201
|
+
C: {};
|
|
202
|
+
M: {};
|
|
203
|
+
Defaults: {};
|
|
204
|
+
}, Readonly< ExtractPropTypes<{
|
|
205
|
+
id: StringConstructor;
|
|
206
|
+
prefixCls: StringConstructor;
|
|
207
|
+
size: VueTypeDef<"default" | "small">;
|
|
208
|
+
disabled: {
|
|
209
|
+
type: BooleanConstructor;
|
|
210
|
+
default: any;
|
|
211
|
+
};
|
|
212
|
+
checkedChildren: VueTypeValidableDef<any>;
|
|
213
|
+
unCheckedChildren: VueTypeValidableDef<any>;
|
|
214
|
+
tabindex: VueTypeDef<string | number>;
|
|
215
|
+
autofocus: {
|
|
216
|
+
type: BooleanConstructor;
|
|
217
|
+
default: any;
|
|
218
|
+
};
|
|
219
|
+
loading: {
|
|
220
|
+
type: BooleanConstructor;
|
|
221
|
+
default: any;
|
|
222
|
+
};
|
|
223
|
+
checked: VueTypeDef<string | number | boolean>;
|
|
224
|
+
checkedValue: VueTypeDef<string | number | boolean> & {
|
|
225
|
+
default: string | number | boolean;
|
|
226
|
+
};
|
|
227
|
+
unCheckedValue: VueTypeDef<string | number | boolean> & {
|
|
228
|
+
default: string | number | boolean;
|
|
229
|
+
};
|
|
230
|
+
onChange: {
|
|
231
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
232
|
+
};
|
|
233
|
+
onClick: {
|
|
234
|
+
type: PropType<(checked: string | number | boolean, e: Event) => void>;
|
|
235
|
+
};
|
|
236
|
+
onKeydown: {
|
|
237
|
+
type: PropType<(e: Event) => void>;
|
|
238
|
+
};
|
|
239
|
+
onMouseup: {
|
|
240
|
+
type: PropType<(e: Event) => void>;
|
|
241
|
+
};
|
|
242
|
+
'onUpdate:checked': {
|
|
243
|
+
type: PropType<(checked: string | number | boolean) => void>;
|
|
244
|
+
};
|
|
245
|
+
onBlur: PropType<FocusEventHandler>;
|
|
246
|
+
onFocus: PropType<FocusEventHandler>;
|
|
247
|
+
}>> & Readonly<{}>, () => VueNode, {}, {}, {}, {
|
|
248
|
+
disabled: boolean;
|
|
249
|
+
autofocus: boolean;
|
|
250
|
+
loading: boolean;
|
|
251
|
+
checkedValue: string | number | boolean;
|
|
252
|
+
unCheckedValue: string | number | boolean;
|
|
253
|
+
}> | null;
|
|
254
|
+
}, any>;
|
|
27
255
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
256
|
export default _default;
|
|
29
257
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@aplus-frontend/antdv"),d=require("lodash-unified");require("../../utils/index.js");require("../../hooks/index.js");const b=require("../../hooks/useControllableValue.js"),u=require("../../utils/is.js"),w=e.defineComponent({name:"ApFieldSwitch",__name:"index",props:{mode:{},class:{},style:{},id:{},prefixCls:{},size:{default:"default"},disabled:{type:Boolean,default:void 0},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:{},confirm:{}},emits:["update:checked"],setup(p,{expose:C,emit:g}){const l=e.useSlots(),n=p,y=g,s=e.ref(),{value:r,updateValue:i}=b.useControllableValue(n,y,{valuePropName:"checked"}),t=e.ref(!1);async function k(o,a){if(!u.isDef(n.confirm)){if(!u.isDef(n.onAction)){i(o);return}t.value=!0;try{await n.onAction(o,a)&&i(o)}finally{t.value=!1}}}async function v(){const o=e.unref(r)===n.checkedValue?n.unCheckedValue:n.checkedValue;if(!u.isDef(n.onAction)){i(o);return}await n.onAction(o)&&i(o)}const V=e.computed(()=>{const o=e.unref(r);return d.isNil(o)?e.createVNode(e.Fragment,null,[n.emptyText]):o===n.checkedValue?e.createVNode(e.Fragment,null,[n.checkedChildren||l.checkedChildren?.()||`${n.checkedValue}`]):e.createVNode(e.Fragment,null,[n.unCheckedChildren||l.unCheckedChildren?.()||`${n.unCheckedValue}`])}),B=e.computed(()=>u.isDef(n.confirm)?d.isFunction(n.confirm)?n.confirm(e.unref(r)):n.confirm:{});return C({focus:()=>s.value?.focus(),blur:()=>s.value?.blur()}),(o,a)=>o.mode==="read"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(u.isDef)(o.confirm)||o.disabled?(e.openBlock(),e.createBlock(e.unref(h.Switch),e.mergeProps({key:0,ref_key:"switchRef",ref:s},e.unref(d.omit)(n,["onUpdate:checked","emptyText"]),{checked:e.unref(r),loading:o.loading??t.value,onClick:k}),e.createSlots({_:2},[e.renderList(l,(m,c)=>({name:c,fn:e.withCtx(f=>[e.renderSlot(o.$slots,c,e.normalizeProps(e.guardReactiveProps(f||{})))])}))]),1040,["checked","loading"])):(e.openBlock(),e.createBlock(e.unref(h.Popconfirm),e.mergeProps({key:1,disabled:t.value},B.value,{onConfirm:v}),{default:e.withCtx(()=>[e.createVNode(e.unref(h.Switch),e.mergeProps(e.unref(d.omit)(n,["onUpdate:checked","emptyText"]),{checked:e.unref(r),loading:o.loading??t.value,onClick:k}),e.createSlots({_:2},[e.renderList(l,(m,c)=>({name:c,fn:e.withCtx(f=>[e.renderSlot(o.$slots,c,e.normalizeProps(e.guardReactiveProps(f||{})))])}))]),1040,["checked","loading"])]),_:3},16,["disabled"]))],64))}});exports.default=w;
|
|
@@ -17,8 +17,8 @@ declare function __VLS_template(): {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
19
|
declare const __VLS_component: DefineComponent<ApFieldTextPasswordProps, {
|
|
20
|
-
focus: () => void;
|
|
21
20
|
blur: () => void;
|
|
21
|
+
focus: () => void;
|
|
22
22
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
23
23
|
"update:value": (...args: any[]) => void;
|
|
24
24
|
"update:visible": (...args: any[]) => void;
|
|
@@ -9,8 +9,8 @@ import { ShowCountProps } from '@aplus-frontend/antdv/es/vc-input/inputProps';
|
|
|
9
9
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
10
10
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
11
11
|
declare const _default: DefineComponent<ApFieldTextAreaProps, {
|
|
12
|
-
focus: (options?: InputFocusOptions) => void;
|
|
13
12
|
blur: () => void;
|
|
13
|
+
focus: (options?: InputFocusOptions) => void;
|
|
14
14
|
resizableTextArea: any;
|
|
15
15
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
16
|
"update:value": (...args: any[]) => void;
|
|
@@ -4,10 +4,8 @@ import { Breakpoint } from '@aplus-frontend/antdv/es/_util/responsiveObserve';
|
|
|
4
4
|
import { Gutter } from '@aplus-frontend/antdv/es/grid/Row';
|
|
5
5
|
declare function __VLS_template(): {
|
|
6
6
|
attrs: Partial<{}>;
|
|
7
|
-
slots:
|
|
8
|
-
default(): any
|
|
9
|
-
}> & {
|
|
10
|
-
default(): any[];
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
11
9
|
};
|
|
12
10
|
refs: {};
|
|
13
11
|
rootEl: any;
|